teleren/devto huggingface dataset:
Sota Image Captioning Model Kosmos-2 Added To Our Image Captioning Scripts Arsenal
Tags: beginners, programming, tutorial, python
Published: 2024-02-15 02:08:23

<p>Sota Image Captioning Model Kosmos-2 Added To Our Image Captioning Scripts Arsenal</p>

<p><strong>You can download them at here :&nbsp;</strong><a href="https://www.patreon.com/posts/90744385" rel="noopener ugc nofollow" target="_blank"><strong>https://www.patreon.com/posts/90744385</strong></a></p>

<p>The batch image captioning models we have right now as follows:</p>

<ul>
	<li>CogVML with quantization 4-bit, 8-bit, 16-bit</li>
	<li>LLaVA including 34b with quantization such as 4-bit, 8-bit, 16-bit</li>
	<li>Blip2 Models</li>
	<li>Clip Vision Models</li>
	<li>Kosmos-2 Model</li>
</ul>

<p>Kosmos-2 supports both single image captioning and also batch image captioning. I also did some research to find a good prompt.</p>

<p>1 click to install both on Windows, RunPod &amp; Linux.</p>

<p>Generates its own venv so will never conflict with no any other app you have.</p>

<p>Here news about them :&nbsp;<a href="https://www.patreon.com/posts/sota-image-model-98499462" rel="noopener ugc nofollow" target="_blank">https://www.patreon.com/posts/sota-image-model-98499462</a></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1250/1*tSTP9rtAMZD4_VDWSJe2eg.png" style="height:611px; width:1000px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1250/1*8vNJ5kXG0z-to0u0a0x5AA.png" style="height:598px; width:1000px" /></p>

<p><img alt="" src="https://miro.medium.com/v2/resize:fit:1250/1*-w8-2TOuvtiFWJNOJcRUUg.png" style="height:6078px; width:1000px" /></p>
All The Enemies (Cosplore3D Pt:13)
Tags: go, gamedev, learning
Published: 2024-02-15 01:30:00

## Intro
This is a series following [Cosplore3D](https://github.com/Chig-Beef/Cosplore3D), a raycaster game to learn 3D graphics. This project is part of 12 Months 12 Projects, a challenge I set myself. In the last post we created The Cosplorer, which was effectively level 2 of this game. Everything works fine, except all the enemies look the same, so we're going to be fixing that by creating a bunch of new sprites.

## All Planned Enemies
Before we start making sprites we need to know what we're making. Luckily, we wrote down the lore of the game before we started. Here is the list of all enemies that I wrote down in the lore.

1. Blob - Ankaran
2. Infected Crewmate - The Cosplorer
3. Enikoko Boss Fight
4. Trash Crawler - Schmeltool
5. Trash Crawler Champion (Boss) - Schmeltool

Very nice, we have 5 enemies we have to implement, and we've already done one of them. 2 of these enemies are bosses, we won't make them today as I'll probably dedicate a post to them, which _hopefully_ makes them better. Other than that, all we have to do is create sprites for the infected crewmates, and the trash crawlers.

## Infected Crewmate
This is similar to those zombies in DOOM, and here is how they look in game.

![An infected crewmate on Ankaran](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4x0xuirf0m5lgofsxis5.png)

These crewmates will be for The Cosplorer level.

## Trash Crawlers
These enemies should be fast I feel, and they should look it, so more legs, more speed.

![A trash crawler on Ankaran](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bk7ud0s4foz7m1tn0ijb.png)

Look at that little guy, and he's fast as well, perfect.

## Next
Quite a short one, mostly because I find it hard to do art, however, this means that could start working on Schmeltool, plus, The Cosplorer, looks like a good map, since the enemies actually make sense now. In the lore, the player places the Cosmium in the reactor, then lands on a Enikoko. In this way, the player should be able to progress to the next level after placing the Cosmium they got from the last level into the reactor (which is at the back of The Cosplorer), then go back to navigation (spawn).
Three questions to always ask when data modeling for NoSQL
Tags: database, nosql, webdev, data
Published: 2024-02-15 02:03:03

Data modeling is where most people get into trouble with NoSQL databases. They may not know it yet, but bad data modeling and, more specifically, not modeling for your access patterns, will cause pain. I have seen it repeatedly with thousands of customers while working for Couchbase, Redis, AWS (DynamoDB), and now [Fauna](https://bit.ly/3wjRchr). In some NoSQL databases specifically (I won't name names), poor data modeling is the most likely cause of performance dropping and costs going up over time. The second one, and related, is when new application requirements come out, and developers don't change the data model to optimize for those...but that is a topic for another post.

## How to do NoSQL data modeling successfully

When data modeling in a NoSQL database, there should be three questions you keep "top of mind" in relation to each of your application's access patterns.

- What data do I need?
- When do I need that data?
- How frequently do I need that data?

An example in a user profile store: I need users’ hashed passwords to validate their login. Do I store that in one large user document or by itself? We need more information. The action of logging into a site/app, and then rendering data for their first page must be fast and an excellent experience for users. In addition, all users need to log in, of course, and my example app has a lot of users. Therefore, I should optimize for the user login access pattern. What other data about the user might I need for this process? Do I need their home address in this process? Probably not. More than likely, I should put the login information in its own document and relate it back to the primary user document. Whether you do this and how you do it depends on how the NoSQL database you're using reads data and how it charges for those reads. For example, can that database do sub-document reads? Not just return one field of a document, but actually only read and **charge** you for reading just that one field of a JSON document and not reading the whole document and then filtering the result set. Many databases cannot do this, and that is ok, but you just need to know when modeling your data. In such a case, it might behoove you to have the login information in its own JSON document in the example I gave above.

These three questions should guide almost every aspect of how you model your documents, collections, indexes, etc., in a NoSQL database. This is a superpower for NoSQL #databases, not a downside! NoSQL gives you options and great power, but you must wield that power with deliberate intent toward your application’s access patterns. Otherwise, your performance will go down, and your costs will go up.
How to add hyperlink to a table in Power BI
Tags: powerbi, azure, beginners
Published: 2024-02-15 01:59:48

1.Go to Table view > Select the column you want to change > Change **Data category** to **Web URL**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9w9c67joxku16ngwr3c.png)

2.Select the table > Visualization > Visual > **URL icon** > click **On** for Values

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dibsobvtjnwyh4jn8aj1.png)

3.Now you have the hyperlink icon only on your table

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xjui3pkupqyc2f9rrzz.png)
Learning D in a week - 12in24
Tags: d, dlang, learning
Published: 2024-02-15 01:55:57

## Intro

This is a continuation of the 12in24 challenge, in which I/you/we learn 12 new coding languages (or at least the basics) in one year.

I spent about a week learning D, and here is some of what I learned.

## D

### Installation

You can install `dmd` (the D compiler) from the official [downloads page](https://dlang.org/download.html#dmd). 

DMD stands for **Digital Mars D**, although I'm not quite sure why. Maybe the creator liked Mars or Mars bars.

### Getting started

#### Writing your first D program

We all know what's coming (or maybe not...)

```d
module hello;

import std.stdio;

// string[] args is optional
void main(string[] args) {
    writeln("Hello, World!");
}
```

Compile it with this:

```bash
$ dmd hello.d
$ ./hello
#=> Hello, World!
```

Now another simple program, FizzBuzz:

```d
module fizzbuzz; // declare a module name, used when importing packages (we'll see that soon)

import std.stdio : writeln, writefln; // import the writeln and writefln functions from std.stdio, but nothing else.

void main() {
    int start = 0;
    int end = 100;
    // one way of doing a for loop
    for (int i = start; i < end; i++) {
        if (i % 15 == 0) {
            writeln("FizzBuzz");
        } else if (i % 3 == 0) {
            writeln("Fizz");
        } else if (i % 5 == 0) {
            writeln("Buzz");
        } else {
            writefln("%d", i); // replaces %d with i
        }
    }

    // this is the more common way to do a for loop:
    foreach(i; start..end) {
        // same as above
    }
}
```

The syntax, you might realize, is extremely similar to that of C. And it is. D is supposed to be another iteration of the C language. 

You can see the stuff I did [here](https://github.com/Kaamkiya/12in24/tree/main/02-d).

### Using packages

To create a D project, we use `dub`, which is D's package manager. It should have come preinstalled with D.

To create a project, run this command:

```bash
$ dub init
```

Fill out the prompts, and you have a full-on project!

Edit `source/app.d` to do whatever you want, like print "Blah blah blah" 500 times, or do a guess the number game.

You can then run your project with this command:

```bash
$ dub run # run the project
$ dub build # build an executable for the project into ./<project_name>
```

You can follow the READMEs in the [repo](https://github.com/Kaamkiya/12in24/tree/main/02-d/hello-dub) or follow the D documentation.

## Conclusion

D is a *very* cool seeming language. It's very feature rich, beginner friendly (no pointers!), and is simple to learn. Some cons might be a (relative to other languages) smallish standard library, and a smaller community.

Feel free to ask questions :)
王志安上節目引發爭議，主持人賀瓏被炎上，錄製節目時談到阿嬤，難過哽咽
Published: 2024-02-15 01:52:58

https://tw.news.yahoo.com/%E9%98%BF%E5%AC%A4%E5%93%AD%E6%B1%82-%E5%88%A5%E7%A2%B0%E6%94%BF%E6%B2%BB-%E8%B3%80%E7%93%8F%E6%B7%9A%E7%81%91-%E5%A4%9C%E5%A4%9C%E7%A7%80-%E7%8F%BE%E5%A0%B4-002400333.html
《阿嬤哭求「別碰政治」 賀瓏淚灑《夜夜秀》現場》
#民进党独裁政策
《阿嬤哭求「別碰政治」 賀瓏淚灑《夜夜秀》現場》
Published: 2024-02-15 01:50:10

#《阿嬤哭求「別碰政治」 #賀瓏淚灑《夜夜秀》現場》
王志安上節目引發爭議
https://tw.news.yahoo.com/%E9%98%BF%E5%AC%A4%E5%93%AD%E6%B1%82-%E5%88%A5%E7%A2%B0%E6%94%BF%E6%B2%BB-%E8%B3%80%E7%93%8F%E6%B7%9A%E7%81%91-%E5%A4%9C%E5%A4%9C%E7%A7%80-%E7%8F%BE%E5%A0%B4-002400333.html
曝光！台湾油管网红大V观选团为民进党大选站台实锤
Published: 2024-02-15 01:46:39

近日，网民二大爷@tankman2002在推特上曝光了一段视频，显示台湾民进党大佬、现任立法院院长游锡堃正在宴请所谓的“全球华人媒体观选团”，而视频的拍摄者正是轮媒之一的李大宇。
视频中，觥筹交错，气氛热烈，引发了社交媒体上的激烈讨论。有人质疑，为何这里面那么多民运、法轮功媒体在台湾大选及事后如此积极为民进党站台？答案似乎在这次宴会中显而易见，轮绿合流的迹象不言而喻。
推特网民二大爷@tankman2002在推文中指出，吃人嘴短、拿人手软，台湾大选及事后的风波让轮媒、次轮媒积极站台，而他认为，这背后的真相就在这桌席之中。
从1月9号至16号期间，十多位海外华文油管自媒体人受邀前往台湾，对选举进行零距离的观察和直播报道。网红大V观选团成员包括文昭、吴建民、章天亮、大宇、公子沈、悉尼奶爸等。
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9b96auvgtcl1xnzs0td.jpg)
A bad and better unit test example for Android network layer with Retrofit | Video
Tags: mobile, android, kotlin, tristan
Published: 2024-02-15 01:43:32

### My app on the Google play store
- [The app](https://play.google.com/store/apps/details?id=elliott.software.clicker)

{% embed https://www.youtube.com/watch?v=rl6Y2CxuJyc %}
民進黨雙標行為引爭議 網民揭露觀選團成員入境問題
Published: 2024-02-15 01:41:51

近期，臺灣信民協會發布的“觀選團”引發網民熱議，特別是涉及到成員入境方式的問題。網民們紛紛指責信民協會存在雙標行為，以及對入境方式的曲解法規，要求對此進行深入調查。
推特用戶周子愉 Fausto Chou@FaustoChou在推文中提到，信民協會承認“觀選團”成員以免簽方式入境，自己挖洞給自己跳。他在推文中質疑信民協會的說法是否準確，提到《雇主聘僱外國人許可及管理辦法》第5條規定，外國人有特定情形在三十日以下的入境簽證或入境許可視為工作許可。他認為，信民協會對法規的解讀存在問題，指責其存在雙標。
推文中還涉及到《雇主聘僱外國人許可及管理辦法》第5條所規定的情況，包括從事本法第五十一條第三項規定之工作、為公益目的協助解決因緊急事故引發問題之需要等，但這與信民協會的說法存在出入。周子愉 Fausto Chou@FaustoChou表示，按照信民協會的說法，應該以第一項處理，但他提到法條上規定的是外國法人未在臺灣設有分公司或代表人辦事處，派外國人來臺工作，需要申請許可。這引發了網民對信民協會合法性的質疑，同時呼籲相關部門對其進行調查。
王志安事件引發網民對民進黨雙標的指責，認為信民協會曲解法規、雙重標準，要求相關部門對其進行嚴肅處理。
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tu4ah374yjitij2w32dp.JPG)
How to flatten a PHP array
Tags: php, array, algorithms
Published: 2024-02-15 01:13:02

Here is what I was looking for:
```php
function true_flatten(array $array, array $parents = [])
{
    $return = [];
    foreach ($array as $k => $value) {
        $p = empty($parents) ? [$k] : [...$parents, $k];
        if (is_array($value)) {
            $return = [...$return, ...true_flatten($value, $p)];
        } else {
            $return[implode('_', $p)] = $value;
        }
    }

    return $return;
}
```

Sample array:
```php
$r = [
    'a' => 'value1',
    'b' => [
        'c' => 'value1.1',
        'd' => 'value1.2',
    ],
    'e' => 'value2',
    'f' => [
        'j' => [
            'k' => 'value2.1',
            'm' => 'value2.2',
            'n' => 'value2.3',
        ],
    ],
    'o' => 'value3',
    'p' => [
        'some' => [
            'very' => [
                'deep' => [
                    'item' => [
                        'first',
                        'second',
                    ]
                ]
            ]
        ]
    ],
    'q' => 'value5',
]; // sample data
```

Output:
```json
{
    "a": "value1",
    "b_c": "value1.1",
    "b_d": "value1.2",
    "e": "value2",
    "f_j_k": "value2.1",
    "f_j_m": "value2.2",
    "f_j_n": "value2.3",
    "o": "value3",
    "p_some_very_deep_item_0": "first",
    "p_some_very_deep_item_1": "second",
    "q": "value5"
}
```
Building a Chat Application with WebSockets
Tags: javascript, beginners, programming, tutorial
Published: 2024-02-15 00:29:00

## Introduction

With the rapid development of technology and the increasing demand for real-time communication, the use of chat applications has become an essential part of our daily lives. WebSockets, a relatively new communication protocol, has gained popularity in the past few years for its ability to facilitate real-time communication between a client and a server. In this article, we will explore the process of building a chat application using WebSockets and its advantages and disadvantages.

## Advantages of Building a Chat Application with WebSockets

1. **Real-time Communication:** WebSockets enable bi-directional communication between a client and server, making it ideal for building chat applications that require real-time messaging.

2. **Efficient Data Transfer:** Unlike HTTP, WebSockets do not require the overhead of constantly establishing and tearing down connections, making it a more efficient option for communication.

3. **Cross-Platform Compatibility:** WebSockets can be used on a variety of devices and platforms, making it an ideal choice for building a chat application that can be accessed from anywhere.

## Disadvantages of Building a Chat Application with WebSockets

1. **Lack of Support in Older Browsers:** Some older browsers do not support WebSockets, which may limit the reach of your chat application.

2. **Server Load:** As WebSockets keep the connection open, it may increase the load on the server and require efficient server management.

## Features of a Chat Application Built with WebSockets

1. **Real-time Messaging:** WebSockets allow for instant messaging, giving users a seamless chat experience.

2. **Multi-device Syncing:** WebSockets support multi-device syncing, allowing users to access their chats from multiple devices.

3. **Offline Support:** WebSockets have the ability to store messages while the client is offline and deliver them once connected, enhancing the user experience.

## Conclusion

Building a chat application with WebSockets has several advantages such as real-time communication, efficient data transfer, and cross-platform compatibility. However, it also has its limitations, such as lack of support in older browsers and potential server load. With its features of real-time messaging, multi-device syncing, and offline support, it is a powerful tool for creating a seamless chat experience. As technology continues to advance, we can expect to see even more innovative uses of WebSockets in the future.
Demystifying JavaScript Scope: Function, Block, and Lexical Scope Explained
Published: 2024-02-15 00:18:25

Understanding scope is fundamental to writing effective JavaScript code. In JavaScript, there are three main types of scope: function scope, block scope, and lexical scope. Let's explore each of these scopes in detail and understand their implications for variable accessibility and lifetime.

**1. Function Scope**
Function scope is perhaps the most familiar type of scope in JavaScript. Variables declared inside a function are accessible only within that function and are "scoped" to it.

```js
function exampleFunction() {
  var localVar = 'I am a local variable';
  console.log(localVar); // Output: 'I am a local variable'
}

exampleFunction();
console.log(localVar); // Error: localVar is not defined
```
In this example, localVar is scoped to the exampleFunction and cannot be accessed outside of it.


**2. Block Scope**
Block scope was introduced in ES6 with the let and const keywords. Variables declared with let and const are block-scoped, meaning they are accessible only within the block in which they are defined.
```js
if (true) {
  let blockVar = 'I am a block-scoped variable';
  console.log(blockVar); // Output: 'I am a block-scoped variable'
}

console.log(blockVar); // Error: blockVar is not defined
```
Here, blockVar is scoped to the if block and cannot be accessed outside of it.


**3. Lexical Scope**
Lexical scope, also known as static scope, is determined by the placement of variables and functions in the code. It allows inner functions to access variables from their outer (parent) functions, even after the outer function has finished executing.
```js
function outerFunction() {
  var outerVar = 'I am an outer variable';

  function innerFunction() {
    console.log(outerVar); // Output: 'I am an outer variable'
  }

  innerFunction();
}

outerFunction();
```
In this example, innerFunction can access the outerVar variable declared in its parent function outerFunction.

**Choosing the Right Scope**
Understanding the different scopes in JavaScript is crucial for writing clean and maintainable code. Here are some considerations to help you choose the right scope:

- Use function scope for encapsulating logic and variables within a specific function.
- Use block scope with let and const for variables that are only needed within a block.
- Leverage lexical scope to access variables from outer functions when necessary, but be mindful of potential pitfalls such as unintended variable shadowing.


By mastering function scope, block scope, and lexical scope, you'll become a more confident and effective JavaScript developer.

**Console You Later!**
¡Educación Sin Límites, no importa donde estés!
Tags: music, webdev, react
Published: 2024-02-15 00:16:48

En [SoundHaus Music](https://soundhaus.com.mx/), te invitamos a transformar tu pasión por la música en una carrera emocionante y exitosa. Te ofrecemos una experiencia educativa sin límites, donde se fusionan la innovación y la tradición. Descubre talleres interactivos y colaboraciones con instituciones internacionales que rompen barreras geográficas, permitiéndote explorar y crecer desde la comodidad de tu hogar.  Únete a nuestra comunidad y convierte cada nota en un paso hacia un destino musical exitoso.
One step with Application manager
Published: 2024-02-15 00:01:27

AWs system manager is a complex and comprehensive service that is essential in your management of resources in AWS and hybrid systems, its management abilities are categorized into different subsets, i will be highlighting Application Management.

Application Management

This is essential for DevOps team, it offers a comprehensive way to identify issues in your applications and clusters making it effective to solve issues that arise from the operation information generated. It leverages on the logical of AWS resources that one may need to operate as a unit based on your application needs. It supports AWS container services like Elastic Kubernetes service (EKS) and elastic container clusters (ECS).

It is also Leverages in providing essential metadate from resources created from AWS CloudFormation,  AWS Launch Wizard and the container services EKS and ECS.

Application manager imports metadata about your resources into resource groups, listing them into unique custom applications. 

To leverage Application manager one has to first set up related services, configure permissions, add applications and clusters to application manager
Application manager outlines different step to take when setting up. Some of the services include Resource groups, use of tags, which make managing, monitoring, and automate tasks on many resources at one time in the case when you use resource groups.
CloudFormation stacks category are formed from information automatically imported by Application manager from resources launched through CloudFormation. AWS Launch wizard, elastic Kubernetes service and elastic container service can be optionally used to setup tasks using application service.


Application manager can also be leverages in setting up tasks helping you view operations information about your AWS resources.
It allows cost explorer by enabling it, one can view cost information, cost history, and cost optimization for your application's resources in the Application Manager console. CloudWatch logs and alarms through configuring and setting up with application manager making it possible to collect and access all your performance and operational data in the form of logs and metrics from a single platform.

AWS Config which is an evaluation tool for your AWS resources allows Application manager to show configuration reports from rules in AWS Config. Opcenter can be set up and configured 
 it leverages on the configuration of Amazon CloudWatch and Amazon EventBridge to automatically send OpsItems to OpsCenter based on 
alarms and events. Each service has its own configuration steps.
Application management also recommends Verifying runbook permissions in state manager, one can  optionally  creating State Manager associations from system manager which is offered at not additional cost.
For a more comprehensive deep dive on the options highlighted visit: https://docs.aws.amazon.com/systems-manager/latest/userguide/application-manager-getting-started-related-services.html
gray or grey, and center or centre?
Published: 2024-02-23 15:59:12

---
title: gray or grey, and center or centre?
published: true
date: 2024-02-15 00:00:00 UTC
tags: 
canonical_url: https://www.oliverdavies.uk/archive/2024/02/15/gray-or-grey--and-center-or-centre
---

[I previously wrote](https://www.oliverdavies.uk/blog/renaming-gray-grey-tailwind-css) about how to change `gray` to `grey` in Tailwind CSS.

So, instead of writing `bg-gray-200`, I could write `bg-grey-200`.

This would be the correct spelling, as I live in the UK.

But I recently realised that I don't change `text-center` or `items-center` when 'centre' would also be the correct spelling.

So, what value is there to renaming `gray`?

It adds inconsistency as it mixes US and UK English in this project and inconsistencies between different projects.

It doesn't match the CSS colour name.

And, if I'm working with others on a project, they also need to be aware of this as it's different from the default configuration and could cause some confusion and affect productivity.

Keeping it the default value would make it easier to work on, collaborate on and maintain.

Maybe, I'll leave it as `gray` in the future.

 P.S. Are you still using Drupal 7 and don’t know what’s involved to upgrade to Drupal 10? [Book a Drupal 7 upgrade consultation call](https://www.oliverdavies.uk/call) or [an upgrade roadmap](https://www.oliverdavies.uk/drupal-upgrade).