teleren/devto huggingface dataset:
Batch photo tagging for stock websites using GPT-4 Vision
Tags: programming, python, openai
Published: 2023-12-04 20:19:36

I'm eager to share with you the piece of software I've created with an intent to help my wife with her photo business.

She is a photographer and from time to time she uploads photos to stock sites. Some batches contain 100+ photos that makes tagging of them an endless nightmare.

I wrote a command-line utility that uses GPT-4 Vision to bulk tag photos and installed on her Mac to make her a bit happier 🌷! 

{% embed https://www.youtube.com/watch?v=tqLcjiP0Lyc %}

Source code [available on GitHub](https://github.com/vladignatyev/bulktag).

Push the "Like" button if you want the full story, code samples and tutorials for beginners!
What is PostgreSQL?
Tags: opensource, database, postgres, beginners
Published: 2023-12-04 20:03:12

In our [latest blog](https://dbadbadba.com/blog/what-is-postgresql), we explore a key technology in our toolkit: PostgreSQL, commonly known as ‘Postgres’. Since its inception in the late 1980s, PostgreSQL has been a reliable and versatile choice for database management, known for its robust features and open-source status.


# History

PostgreSQL originated in the 1980s at the University of California, Berkeley. It started as a successor to the Ingres database, under the leadership of Professor Michael Stonebraker. The original name 'POSTGRES' reflects its post-Ingres development, and it was later renamed to PostgreSQL to highlight its SQL capabilities. The system was designed to expand database functionalities, introducing user-defined types and table inheritance early in its development. Over the years, PostgreSQL evolved with contributions from a global community, growing into a powerful, open-source object-relational database system widely adopted in various industries.


# Advantages

PostgreSQL offers several advantages both from a technological and business perspective. Technically, it stands out with advanced data management capabilities, high performance and reliability due to features like MVCC, and extensive indexing options. For businesses, PostgreSQL provides robust security features, scalable architecture suitable for various workloads, and cost-effectiveness owing to its open-source framework. These attributes make it a strategic choice for organizations seeking a reliable, versatile database solution.


# Conclusion

PostgreSQL's blend of advanced technical features and business-friendly attributes makes it a top choice for organizations seeking a robust, scalable, and cost-effective database solution.

Want to learn more? **[Read the full blog](https://dbadbadba.com/blog/what-is-postgresql)** on our website.

💬 Have you tried PostgreSQL in your projects? **Drop a comment** and tell us about your experience.
Making RDBMS Simple: What's Up with the First Normal Form?
Tags: tutorial, database, datacleaning, learning
Published: 2023-12-04 19:41:33

**Introduction:**

Hey there! Ready to explore the world of databases? We're starting with a cool topic: normalization. Today, we're talking about the First Normal Form (1NF). It might sound fancy, but don't worry, we'll break it down into easy bits. Let's dive in!

**Scenario 1:**

Imagine you're building a library database to keep track of books. At first, you might think, "Let's put everything about a book in one place—title, author, genre, and if it's available." Sounds good, right? But as your library grows, things get messy.

**Enter the First Normal Form:**

So, what's this 1NF thing? It's like the hero that saves your data from being a mess. It tackles two main problems: too much repeated info (we call it redundancy), and making sure each piece of info is simple and clear (that's atomicity).

Let's take note of the following key terms:

1. **Redundancy:** This is when you have the same info in different spots. 1NF helps us get rid of this mess and keeps things neat.

2. **Atomicity:** Fancy word, simple idea. It means each column (like title or author) should have just one type of info. And every piece of info should be simple, not a mix of things.

Putting it into Action:

Let's make our library database! We'll use two tables – one for authors and another for books.

```
-- Table: authors
CREATE TABLE authors (
    author_id INT PRIMARY KEY,
    author_name VARCHAR(255) NOT NULL
);

-- Table: books
CREATE TABLE books (
    book_id INT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    genre VARCHAR(50),
    availability BOOLEAN,
    author_id INT,
    FOREIGN KEY (author_id) REFERENCES authors(author_id)
);
```

This code creates two tables. One for authors, keeping things like their ID and name. The other is for books, linking back to the authors. Easy, right?

**Scenario 2:**
Consider the mock database below:

![A mock database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cntda27c124bnto1stml.png)
This table structure violates 1NF because the 'Skills' attribute is multivalued. This means that a single employee can have multiple skills.

Implementing 1NF:

To transform the mock database into 1NF, we need to address the multivalued attribute in the 'Skills' column. We can create a separate table named 'EmployeeSkills', with the following structure:

![database in 1NF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfppqi0c31i8kolvceaf.png)

This new table establishes a many-to-many relationship between the 'Employees' and 'EmployeeSkills' tables, ensuring that each employee is associated with a unique set of skills.

**Conclusion:**

Great job! You've just conquered the basics of the First Normal Form. This simple rule helps us make databases that are organized, grow-friendly, and easy to understand. Stick around for more fun database stuff in our next chat!
Big Countries
Published: 2023-12-04 19:20:01

[LeetCode](https://leetcode.com/problems/big-countries/?envType=study-plan-v2&envId=top-sql-50)

1st try.
`SELECT area >= 3000000 and population >= 25000000 from World table`

2nd try with AI.

```
SELECT*
FROM World
WHERE area >= 3000000 and population >= 25000000;
```
It shows unnecessarily column so I had to edit query again.


Message From ChatGPT as follows.
> To find the name, population, and area of countries that meet the specified criteria (area at least 3 million km² or population at least 25 million), you can use the following SQL query:
```
SELECT name, population, area
FROM World
WHERE area >= 3000000 OR population >= 25000000;
```
> This query selects the "name," "population," and "area" columns from the "World" table where the country has an area of at least 3 million km² or a population of at least 25 million. The result will include countries that meet either of these conditions.
> Make sure to run this query in your SQL database to get the desired result.

I realized that it can be reduced by notating the columns to be displayed as follows
`SELECT name, population, area`
PHP echo tag - A simple solution to common problem
Tags: programming, webdev, php, productivity
Published: 2023-12-04 19:09:40

Hi, what's up? If you ever coded in PHP, you definitely had created a code as simple as this

```php
<?php
    echo "Some more or less important info";
?>
```

It takes us as much as 3 lines - it's not a lot but while writing my PHP course and consuming the [docs](https://www.php.net/manual/en/language.basic-syntax.phptags.php) I've encountered this

> PHP includes a short echo tag <?= which is a short-hand to the more verbose <?php echo. 

I thought - "Huh, let's give it a try". And it worked, so that's why I write this article

## A little bit of info

This **short echo tag** is in standard and is not a part of some library/framework. And by the way it's not classified as `short tag` 

So even if `short_open_tag` is disabled, this tag still works

But, let's test it

## Short echo tag in practice

So, syntax for this tag looks like this

```php
<?= "Text to display" ?>
```

When I checked it - I wrote this
```php
<?=  "Hello short echo tags" ?>
```

And it worked

![working short echo tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/or1l63zzrcjwb29mk63p.png)
 
(Don't think about the size, I purposefully made this text bigger with browser scaling)

But, does it allow use to use multi-line echo? Can we do something like this?

```php
<?=  
    "Hello short echo tags
    Hi"
?>
```

Yes, we can!

![Many lines](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qajue7d7wbshpv0r2la8.png)


But maybe a variable?
```php
<?php 
    $var = 5;
?>

<?=  
    $var
?>
```


![Variable](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4doscgpi3si023e4oe5.png)

It still works!

And last test - a function + variable
```php
<?php 
    $var = "password";
?>

<?=  
    password_hash($var, PASSWORD_DEFAULT)
?>
```


![Function inside that tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9b5d87nx1npaqtuc3l3s.png)

No problem with that too

So, it successfully managed to pass all of the tests

## Conclusion

When I discovered this tag, my first thought was to write article about it. And when I found time - that's how this article was born

I hope you learned something new and useful, that this will help you with your work

Check out my other articles and series such as
- [PHP 0 to Hero](https://dev.to/wizarddos/series/25461)
- [Coding DIY pt.2 - making private message system with PHP](https://dev.to/wizarddos/coding-diy-pt2-making-dm-system-with-php-3459)
- [Quick guide for linux privileges](https://dev.to/wizarddos/quick-guide-for-linux-privileges-4dd6)

That's it, see you in next articles
24 Pull Requests: A Holiday Tradition for Open Source Contributors
Tags: 24pullrequests, opensource, webdev, learning
Published: 2023-12-04 18:48:24


24 Pull Requests is a yearly initiative that encourages open source contributors around the world to send 24 pull requests between December 1st and December 24th. The goal of the project is to help people get involved in open source and make a positive impact on the world.

## How to Participate

To participate in 24 Pull Requests, simply find an open source project that you're interested in and start contributing. You can find projects to contribute to on GitHub, GitLab, and other code hosting platforms. Once you've found a project, you can start by fixing bugs, adding new features, or writing documentation.

## Benefits of Participating

There are many benefits to participating in 24 Pull Requests. Some of the benefits include:

**Learn new skills:** By contributing to open source projects, you can learn new skills and technologies.
**Gain experience:** Contributing to open source projects is a great way to gain experience and build your portfolio.
**Make a difference:** Your contributions can help make open source projects better and more useful for everyone.
**Meet new people:** You can meet new people from all over the world by contributing to open source projects.
**Give back:** Contributing to open source is a great way to give back to the community.

## Tips for Success

Here are a few tips for success when participating in 24 Pull Requests:

**Start small:** Don't try to do too much too soon. Start by fixing small bugs or adding small features.
**Ask for help:** If you're stuck, don't be afraid to ask for help. Most open source communities are very welcoming and helpful.
**Be patient:** It takes time to become a good open source contributor. Don't get discouraged if you don't get positive feedback right away.
**Have fun!:** Contributing to open source should be fun. If you're not enjoying yourself, you're less likely to stick with it.

24 Pull Requests is a great way to get involved in open source and make a positive impact on the world. I encourage everyone to participate this year!

In addition to the benefits mentioned above, 24 Pull Requests is also a great way to learn about different open source projects and communities. By participating, you'll be exposed to a wide range of projects and people, which can help you find new projects to contribute to in the future.

So, what are you waiting for? Get started today and make a difference!

I hope this blog post has been helpful. If you have any questions, please feel free to leave a comment below.

Happy coding!
Count negatives in grid
Published: 2023-12-04 18:41:53

[LeetCode](https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix/description/?envType=study-plan-v2&envId=binary-search)

1st try.

```
class Solution:
    def countNegatives(self, grid: List[List[int]]) -> int:
        #Count negetive numbers.
        i = int<=-1
        negetive = count.List(i)
        return negetive
```

2nd try with AI.

from typing import List

```
class Solution:
    def countNegatives(self, grid: List[List[int]]) -> int:
        # Count negative numbers.
        negative_count = 0

        for row in grid:
            for num in row:
                if num < 0:
                    negative_count += 1

        return negative_count
```
What does this mean ?
        for row in grid:
            for num in row: 


ChatGPT
for row in grid:
    for num in row:
is a nested loop structure that iterates over each element in a 2D grid.

Here's a breakdown:

for row in grid:: This loop iterates over each row in the 2D grid. In each iteration, row represents a list of numbers (a row in the grid).

for num in row:: This inner loop iterates over each element (num) in the current row (row). In each iteration of the inner loop, num represents a specific number in the current row.

So, when you combine these loops, the entire structure iterates over each element in the 2D grid. This is commonly used to perform operations on each individual element or to extract information from the entire grid. In the context of your original code, it is used to count the number of negative numbers in the grid by checking each element (num) in each row (row).
Getting Started With Cloud
Tags: cloudcomputing, aws, cloudskills
Published: 2023-12-04 18:38:47

Hi there!, 

As one who made the move from a non-technical background into tech, I get asked a lot on how I made the move especially in the cloud. 

While I understand that getting started in the cloud might be hard, I am here to provide some tips which I found really helpful. 

1. Start with the fundamentals: Before you start off with getting into the specifics of any cloud service, I recommend you get familiar with  the IT fundamentals. This will serve as a strong foundations to build on your cloud skills. trust me, cloud computing is mostly around these basic IT fundamentals. Some concepts include; 
 a. Linux Bash
 b. Networking fundamentals 
 c. Programming, Git (advised to start with python)

2. Cloud service fundamentals: Now that you have a good understanding of the fundamentals, it's time to now dive in to a cloud service. There are various cloud services to leverage. As a two time certified AWS person, I am a little biased towards AWS as I have found that to be more easy to learn with and understand. (Do not worry, anyone one you start with is fine, there is a lot of similarity amongst the cloud services). 

3. Find mentors: I can not over emphasise this enough. There are many people that have walked the path you are currently embarking on. Find such people and learn from them. Ask as many questions as you may have. I wish I learnt this earlier, but I am happy I did too. It will save you tons of mistakes you might make. You do not need to physically meet people before they become your mentors. Thank God for platforms like linkedIn where you can find a lot of people to learn from. I will add a list of people you can follow on your cloud journey. 

4. Celebrate every win: Whether big or small, celebrate every win and believe that you are deserving of every good opportunity that comes your way. It's never easy to get things done. You are trying and should be proud of your journey. 

Feel free to connect with me on LinkedIn. https://www.linkedin.com/in/nana-adjoa-anim/
I have a question about how to send data to websites
Tags: backend, webdev
Published: 2023-12-04 18:31:33

Hello, so I want to make on a website (A) a button where you insert a number and on another website (B) a div is created with the number you input. My question is what should I look into/learn to do that? I know HTML, CSS, JS. The websites will be hosted online. Thank you.

More context: 
I wanna make a website for a restaurant's menu and include a "call a waiter" button, and my idea is to have a tablet in the waiter's area where when a customer clicks and inputs their table a <div> is created on the waiter's website with the table number.
Raku Blog Posts 2023.49
Tags: programming, rakulang, summary
Published: 2023-12-04 18:30:40

- [Day 1 – Rocking Raku Meets Stodgy Debian](https://raku-advent.blog/2023/12/01/rocking-raku-meets-stodgy-debian/) by *Tom Browder*
- [Day 2 – An update on raku.land](https://raku-advent.blog/2023/12/02/an-update-on-raku-land/) by *JJ Atria*
- [Day 3 – Helping the Elves Sort Their Mail](https://raku-advent.blog/2023/12/03/day-3-helping-the-elves-sort-their-mail/) by *Julia*
- [Day 4 – Embedding a stack-based programming language in Raku](https://raku-advent.blog/2023/12/04/day-4-embedding-a-stack-based-programming-language-in-raku/) by *Wim Vanderbauwhede*.

The first batch of blog posts for the Raku Advent Calendar.

- [Fixing Raku’s Readline module to work on macOS](http://clarkema.org/lab/2023/2023-12-01-macos-nix-raku-readline/)
- [More Raku Readline Fixes](https://clarkema.org/lab/2023/2023-12-03-raku-readline-openbsd/)

*Mike Clarke* blogged about fixing the Readline module on MacOS *and* OpenBSD.

- [Rakudo Weekly News 2023.49](https://rakudoweekly.blog/2023/12/04/2023-49-venting-this-ad/)

*Elizabeth Mattijsen* reports on all recent developments around Rakudo, an implementation of the [Raku Programming Language](https://raku.org).
Best resources to learn web development
Tags: webdev, discuss, coding, programming
Published: 2023-12-04 18:23:39

So, one of my goals for 2024 is to learn web development thoroughly as I have mentioned in this [post](https://dev.to/nandinishinduja/tech-related-goals-for-2024-4gbb). So for that I need to collect some resources which would be useful for me in the learning process. Some resources which I am planning to use are:

- https://www.freecodecamp.org/learn/2022/responsive-web-design/
- https://www.freecodecamp.org/learn/front-end-development-libraries/
- https://www.udemy.com/course/the-complete-web-development-bootcamp/
- https://www.w3schools.com/html/
- https://www.w3schools.com/w3css/defaulT.asp

Some resources which I have used in the past and found helpful are:

- https://online.umich.edu/series/web-design-for-everybody/
- https://www.coursera.org/learn/website-coding
- https://www.futurelearn.com/courses/learn-to-code-for-the-web

What resources do you recommend? Let us know in the comments!
O que é o método .split( ) e como podemos manipular nossas strings utilizando ele
Tags: ruby, programming, webdev, tutorial
Published: 2023-12-04 18:10:59

Em ruby, o método split( ) é um método muito útil para manipularmos respostas com base na string que nos foi oferecida.
O método .split( ) basicamente pode ser utilizado da seguinte forma:

`array = string.split(padrão, limite)`

Segue alguns exemplos de situações em que podemos utilizar o método .split( ):

**Como eu posso contar a quantidade de itens dentro de uma string?**
`array = "As estrelas cintilavam no céu noturno, iluminando a tranquila paisagem silenciosa.".split
puts array.length`

`=> 11`

**Como eu posso utilizar o método split sem parâmetros?**
`array = "Esta é a 1º string".split
array2 = "Esta é a 2º string".split`

**Como eu posso recuperar valores de uma string?**
`puts "#{array[2..4]}"
puts "#{array2[2]} #{array2[3]}"`

`=> ["a", "1º", "string"]`
` => a 2º`

**Como eu posso excluir valores de uma string?**

`array = "Esta é a 1º string".split("1º ")
puts array.join`

`=> Esta é a string`

> O método .join( ) pode ser usado neste caso para juntar nossas substrings, se tornando assim em uma única string. Ele também pode ser utilizado para trazermos um espaço para cada substring adicionada com o comando .join(' ').

**Como eu posso somar 1º com 2º para retornar 3º?**
`x = array[3].to_i
y = array2[3].to_i
result = x + y
puts "#{result}º"`

`=> 3º`

**Como eu posso realizar uma conta com os valores da minha string?**
`array = "3.7 38 93 700 333".split
a = array[0].to_f
b = array[1].to_i
c = array[2].to_i
d = array[3].to_i
e = array[4].to_i
valor = (a + b) * (c / (e - d))
puts valor`

`=> -41.7`

---

Quanto mais aumentarmos a complexidade dos nossos parâmetros passados no método .split( ), mais funcionalidades conseguiremos trazer para o nosso código.
5 Min Series - Prompting
Tags: chatgpt, genai
Published: 2023-12-04 18:10:27

I've started a YouTube series "5+ min of My GPT".  In this series I am creating short screencasts of me trying out various prompting techniques on ChatGPT, customGPTs and more.

I've been using ChatGPT and other genAI tools for over a year now and they've changed the way I do my technical work and research.  Before I explore the OpenAI Assistants API, I want to 'go deep' into what can be done in ChatGPT web UI.

So far I've looked at the following:
- Creating, testing and updating multiple custom GPTs in the ChatGPT web UI
- Using multiple plugins to improve the quality of responses
- Prompt engineering techniques such as setting context, specifying output, chaining and others.

In addition to the 10 short screencasts I've made already, I am looking to explore/collaborate with others who are learning in this space.  I feel like the dev community headed directly to RAG patterns (i.e. embeddings and vector DBs) and skipped deep diving into understanding the nuances of prompt engineering.

I welcome feedback and requests for topics in my expanding series. 

Here's a screenshot which shows the currently available videos.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t85c5q0brxmz4cectbts.png)

My YouTube playlist is [here](https://www.youtube.com/playlist?list=PL4Q4HssKcxYuwbVAgVqwM5od3yLtg9NM0).

I am interested in hearing from the Dev.to audience.  
- What is your experience with ChatGPT?  
- Which ChatGPT features are you using/learning in your technical work?  

I am looking forward to reading comments in response to this post.
Telegram: a developer wanted dead or alive
Tags: telegram, programming, webdev, ai
Published: 2023-12-04 17:38:55

hello, I would like to develop a specific telegram application similar to www.flock.com with AI assistance as chatbot.

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