teleren/devto huggingface dataset:
Don't forget the leaks
Tags: programming, mobile, softwareengineering
Published: 2023-08-03 14:56:47

I had spent the best part of a week on and off trying to fix an issue I was having with SpriteKit, one of the gaming frameworks on the Apple platforms.

This was the last bug between development and shipping the 1.0 release, but it was a big one.

I was getting repeated audio and animations where I should only be seeing and hearing them once. After all, how many times does a player have to die to indicate they dead?…once right?

I had re-written, re-architected the code numerous times and was convinced that I had everything right each time. There are only so many ways to change an image and play a sound after all.

Through out the process I had been live streaming the development at https://compileswift.com/livestream like I always do. And many more talented folks than I in the chatroom had suggested things that we tried with no solution in sight.

Then, someone whom I hold in high regard for SpriteKit said they would be happy to take a look at the whole codebase for me. After much defeat and imposter syndrome, I gave in and handed over the code base.

After a while they got back to me and said “Hey, I think you have a leak and retainer in the game scene”.

Now, I had looked at this, but did not see what they had seen. Maybe due to lack of observation on my part, or maybe code blindness had set in.

But sure enough, they were right. Two lines of code changes later everything started to fit into place and away it went happily just taking down the player once.

So there are two lessons here I want to share.

1. Always take help when it’s offered
2. Don’t forget to check beyond the code structure and see if something unexpected or unplanned is happening outside of the logic it’s self.

For now, I am sending the last version to TestFlight and hoping for a 1.0 release in the coming week or two.
TYPESCRIPT
Tags: webdev, programming, beginners, typescript
Published: 2023-08-03 14:52:35

``**Typescript** is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale, it enables you to write JavaScript  the way you want. it is a pure Object oriented programming language with class interface and static typing.
                    

## Why Use Typescript
- Compilation.
- Strong static typing. 
- Supports type definition from existing JavaScript.
- Supports Object Oriented Programming Language.
                  

## Type System In Typescript.

* **Any** : This is a super type of all types in typescripts.

* **Build In** : This type consists of (String, Null, Number, 
  Array, Undefined, Boolean, Void and so on).

* **User Define Type** : The user defines the kind of type. e.g 
  (Classes, OOP and Enums)

## How to declare an Array variable in Typescript.

 The type syntax for declaring a variable in TypeScript is to include a colon (:) after the variable name, followed by its type. Just as in JavaScript, we use the _var_ keyword to declare a variable. Declare its type and value in one statement.
   When you declare a variable, you have four options −

1  Declare its type and value in one statement :
   **var [identifier] : [type] = value ;**
2  Declare its type but no value. In this case, the variable will 
   be set to undefined:
   **var [identifier] : [type] ;**
3  Declare its value but no type. The variable type will be set to 
   the data type of the assigned value.
  **var [identifier] = [value] ;**
4  Declare neither value not type. In this case, the data type of 
   the variable will be any and will be initialized to undefined.
  **var [identifier] ;**
  

## Example: Variables in TypeScript

```
"use strict";

let a:number = 30;
 a = "35";

let b:any = true
b = "red" 
let c:undefined;
let z:null

let Uname:string = "Ade"
```

**how to declare an object in Typescript** 
_
```
`var Data1: {
    id : number | string;
    name: string;
    email: string;
    height:number;
    age: number;

}={
    id : 234567890,
    name: "adeola",
    email: "abcdefhh123@gmail.com",
    height: 50,
    age: 25,
};`
```

 **How to declare an array in typescript**
 array

`let carting: (string | number | boolean | null)[] = ["Addidas", 80, 90, null];
`
Função COALESCE no SQL: Lidando com Valores NULL
Tags: datascience, sql, beginners, tutorial
Published: 2023-08-03 12:47:43

Olá a todos! Hoje, vamos explorar uma função SQL extremamente útil, mas muitas vezes negligenciada: COALESCE. Essa função pode se tornar sua melhor amiga ao lidar com valores NULL em suas consultas.

Antes de mais nada, vamos falar sobre o que é um valor NULL. Em SQL, NULL é um marcador que indica a ausência de qualquer valor. Ele não é zero, nem uma string vazia, nem falso - é simplesmente nada. E isso pode causar alguns problemas. Por exemplo, qualquer cálculo que envolva um valor NULL resultará em NULL, o que pode distorcer suas estatísticas.

É aqui que entra a função COALESCE. Ela retorna o primeiro valor não-NULL em uma lista de expressões. Por exemplo:

```
SELECT COALESCE(nome, 'N/A') FROM Alunos;
```

Neste caso, se a coluna 'nome' contiver um valor NULL, 'N/A' será retornado em vez de NULL.

Mas a mágica do COALESCE não para por aí. Podemos usar quantas expressões quisermos, e a função retornará o primeiro valor não-NULL encontrado. Veja este exemplo:

```
SELECT COALESCE(coluna1, coluna2, coluna3, 'N/A') FROM Tabela;
```

Neste caso, se 'coluna1' for NULL, o SQL verificará 'coluna2'. Se 'coluna2' também for NULL, verificará 'coluna3'. Se todos os três forem NULL, 'N/A' será retornado.

COALESCE é uma função poderosa e flexível que você pode usar para evitar problemas com valores NULL. Aqui estão algumas ideias de como você pode usar COALESCE:

- Substitua valores NULL por um valor padrão.
- Use COALESCE para verificar várias colunas em ordem e retornar o primeiro valor não-NULL.
- Use COALESCE para simplificar a lógica condicional em suas consultas.

Por fim, COALESCE é uma função SQL indispensável para lidar com valores NULL de maneira eficaz. Espero que este artigo tenha lhe dado uma visão clara de como usar a função COALESCE em suas próprias consultas.
Intro to Python - Day 4 - Modifying a Class Variable from Within the Class Itself
Tags: python, programming, beginners, backend
Published: 2023-08-03 14:17:36

*Hi there. I'm a New York City based web developer documenting my journey with React, React Native, and Python for all to see. Please follow my dev.to profile or [my twitter](https://twitter.com/stonestwebdev) for updates and feel free to reach out if you have questions. Thanks for your support!*

Today in one of the lessons I worked on for the fantastic backend development tutorial [boot.dev](boot.dev) for one lesson we were asked to modify a class variable from within a method.

This follows on closely to [yesterday's blog post](https://dev.to/jwhubert91/intro-to-python-day-3-class-variables-vs-instance-variables-3m10) about classes and object oriented programming in Python.

It actually took me a bit of digging and eventually I just had to break down and ask ChatGPT to find the answer. Most of the documentation and blog posts out there only discuss changing a class variable from outside of the variable.

The answer is, to modify a class variable from within the class itself, you must use the name of the class itself.

For example, if I have a class called `Company` and a class variable on it called `number_of_employees = 0`. Say I have a method called `hire_new_employee` that takes in their name and position title, but also increments `number_of_employees` by 1:

```python
class Company:
    number_of_employees = 0

    def __init__(self, company_name):
        self.company_name = company_name

    def hire_new_employee(self, name, position):
        self.name = name
        self.position = position
        Company.number_of_employees += 1
```

As I show, you need to call the class itself and set the variable on it from within the class method, or wherever you are modifying the variable.

**If you like projects like this and want to stay up to date with more, check out my Twitter [@stonestwebdev](https://twitter.com/stonestwebdev), I follow back! See you tomorrow for another project.**
Come and geek out over synthesizers with me!
Tags: music, synthesizers, watercooler
Published: 2023-08-03 14:15:05

Calling all keyboardists, bedroom producers, and lovers of weird sounds!

I can stop myself from geeking out over [synthesizers](https://en.wikipedia.org/wiki/Synthesizer). Moog, Sequential, Roland, Oberheim, Korg... the list goes on and on.

![cartoon guy in a cape playing a Moog synthesizer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ln6j76gewkwi54ygjm6.gif)

I regularly find myself tuning into YouTube videos of folks playing, testing, tutorial-ing, unboxing, and just generally geeking out over synths. 

I'm starting this thread to share my findings and hopefully to find other folks who are interested in this kinda stuff too! So, with that said, what synths are y'all into? Which ones do you have in your personal collection? Watching any synthusiasts on YouTube? Got any synth news to share?
If_Else Statements: The Quick Guide For Beginners
Tags: javascript, beginners, tutorial
Published: 2023-08-03 14:00:00

_(See The Header Image For How An If_Else Statement Is Basically Written In A Function)_

## JavaScript likes to "solve" If_Else Statements like a simple "do thing 1 OR do thing 2" scenario:

Our function starts out by checking the condition with the block of code to the right of the "if". If the condition is true (it matches **exactly** with the thing we've defined to the right of the ===), the function will return something from this block of code, then exit the function.

BUT, if the condition is FALSE, (it DOESN'T match **exactly** with the thing we've defined to the right of the ===), the function will move on and run the ELSE part of the code.

**We're essentially saying:** Check the "if" part of the code, and if it matches, run the "if" part of the code. But if it doesn't match, run the "else" part of the code.

## You can remember when to use If Statements like this:
**If Thing 1 is TRUE, do Thing 1. If Thing 1 is FALSE, do Thing 2.**
Resolving OpenAI API Authentication Errors in Azure Functions by Correctly Setting Environment Variables
Tags: openai, azure
Published: 2023-08-03 14:11:06

---
title: Resolving OpenAI API Authentication Errors in Azure Functions by Correctly Setting Environment Variables
published: true
description: description
tags: OpenAI, Azure
---
**Problem:**
Your application hosted on Azure is not able to authenticate with the OpenAI API despite having the API key set as an environment variable.

**Cause:**
The environment variable name set in Azure does not match the one used in the application code.

**Solution:**
Ensure that the name of the environment variable set in Azure matches the one your application is trying to access.

---

**Step-by-step guide:**

1. Go to the Azure Functions settings screen.

2. Change the name of the environment variable `ChatGPT_key` to `OPENAI_API_KEY`. The value remains the same.

3. Save the changes and restart Azure Functions.

After these steps, Azure Functions should correctly recognize the `OPENAI_API_KEY` environment variable, and your application should successfully authenticate with the OpenAI API.
CSS and SASS Managing Style Priority
Tags: sass, css
Published: 2023-08-03 14:06:38

---
title: CSS and SASS Managing Style Priority 
published: true
description: description
tags: SASS, CSS
---
In CSS, style priority is determined by the rules of **specificity** and **source order**. Specificity determines which CSS rule is applied by the browsers based on matching conditions. Source order is the order in which the browsers read the CSS; later rules will override earlier ones if the specificity is the same.

## CSS Specificity

Specificity is determined by:

1. Inline styles (an element's `style` attribute) have the highest specificity.
2. ID selectors have higher specificity than class selectors, attribute selectors, and pseudo-classes.
3. Class selectors, attribute selectors, and pseudo-classes have higher specificity than type selectors and pseudo-elements.

## CSS Source Order

If two selectors have the same specificity, the one that comes last in the CSS will be applied. 

## Adjusting Specificity with Sass

You can adjust the specificity of your styles in Sass by making your selectors more specific. For instance, `body .pink` is more specific than `.pink` or `.default-gray`.

```scss
body .pink {
  background-color: pink;
}

.default {
  &-gray {
    background-color: gray;
  }
}
```
The & is a special feature of Sass that refers to the parent selector. Here, &-gray is compiled into .default-gray in CSS.

This compiles into the following CSS:
```css
body .pink {
  background-color: pink;
}

.default-gray {
  background-color: gray;
}
```
In this example, even if `.pink` and `.default-gray` are applied to the same element, the style of `.pink` has higher specificity due to its more specific selector, so its style will take precedence, making the background color `pink`.
Note: However, using more specific selectors limits the flexibility of your CSS rules, because they apply to fewer elements. Always choose the most appropriate method according to your needs.
Basic Docker Commands
Tags: docker
Published: 2023-08-03 14:01:40

---
title: Basic Docker Commands 
published: true
description: description
tags: Docker
---
Docker is a powerful tool for creating, deploying, and running applications using containerization. Here are some basic Docker commands you might find useful:

## Pull an Image

To download an image from Docker Hub or another Docker registry:
```bash
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
```
## List Images

To list all available Docker images:
```bash
docker images [OPTIONS] [REPOSITORY[:TAG]]
```
## Run a Container

To create a new container and start it:
```bash
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
```
For example, to run a bash shell with Ubuntu:
```bash
docker run -it ubuntu bash
```
## List Running Containers

To list all currently running containers:
```bash
docker ps [OPTIONS]
```
## Start a Container

To start a previously created or stopped container:
```bash
docker start [OPTIONS] CONTAINER [CONTAINER...]
```
## Stop a Container

To stop a running container:
```bash
docker stop [OPTIONS] CONTAINER [CONTAINER...]
```
## Remove a Container

To remove a container:
```bash
docker rm [OPTIONS] CONTAINER [CONTAINER...]
```
## Remove an Image

To remove an image:
```bash
docker rmi [OPTIONS] IMAGE [IMAGE...]
```
For more information about these commands and their options, please refer to the official Docker documentation.
Getting Started with Git Essential Commands
Tags: git
Published: 2023-08-03 12:47:46

---
title: Getting Started with Git Essential Commands 
published: true
description: description
tags: Git
---
## Configure Tooling

Sets the name you want attached to your commit transactions
```bash
git config --global user.name "[name]" 
```

Sets the email you want attached to your commit transactions
```bash
git config --global user.email "[email address]" 
```

## Create Repositories

Creates a new local repository with the specified name
```bash
git init [project-name]
```

Downloads a project and its entire version history
```bash
git clone [url]
```

## Make Changes

Lists all new or modified files to be committed
```bash
git status
```

Shows file differences not yet staged
```bash
git diff
```

Snapshots the file in preparation for versioning
```bash
git add [file]
```

Records file snapshots permanently in version history
```bash
git commit -m "[descriptive message]"
```

## Group Changes

Lists all local branches in the current repository
```bash
git branch
```

Creates a new branch
```bash
git branch [branch-name]
```

Switches to the specified branch and updates the working directory
```bash
git checkout [branch-name]
```

Combines the specified branch’s history into the current branch
```bash
git merge [branch]
```

Deletes the specified branch
```bash
git branch -d [branch-name]
```

## Refactor Filenames

Deletes the file from the working directory and stages the deletion
```bash
git rm [file]
```

Changes the file name and prepares it for commit
```bash
git mv [file-original] [file-renamed]
```

## Suppress Tracking

Lists the files and directories that git should ignore
```bash
.gitignore
```

## Review History

Displays commit history
```bash
git log
```

Shows content differences between two branches
```bash
git diff [first-branch]...[second-branch]
```

## Save Fragments

Temporarily stores all modified tracked files
```bash
git stash
```

Restores the most recently stashed files
```bash
git stash pop
```

Lists all stashed changesets
```bash
git stash list
```

Discards the most recently stashed changeset
```bash
git stash drop
```

## Synchronize Changes

Downloads all history from the repository bookmark
```bash
git fetch [bookmark]
```

Combines bookmark’s branch into current local branch
```bash
git merge [bookmark]/[branch]
```

Uploads all local branch commits to gitHub
```bash
git push [alias] [branch]
```

Downloads bookmark history and incorporates changes
```bash
git pull
```
Build NO-CODE AI Agents at Scale
Tags: webdev, javascript, beginners, programming
Published: 2023-08-03 13:30:00

## Fine-Tuner: Scaling AI Agents without Code

**Introduction**:

Unlock the limitless potential of AI with [Fine-Tuner](https://www.aiforme.wiki/ai/tools/fine-tuner%20ai)—a revolutionary platform that allows you to build sophisticated AI agents without any coding or technical skills. 

Say goodbye to lengthy development cycles and expensive machine learning teams, and say hello to a user-friendly, no-code solution that fast-tracks your journey to market and empowers you to scale intelligent solutions effortlessly.

**What is Fine-Tuner:**

[Fine-Tuner](https://www.aiforme.wiki/ai/tools/fine-tuner%20ai) is your all-in-one solution for creating sophisticated AI agents, harnessing the true power of AI while eliminating technical complexities and infrastructure limitations. With Fine-Tuner, you can bring your data and ideas to life, unleashing the full potential of AI without writing a single line of code.

**ConverSense Agent:**

Not your ordinary chatbots—our Agents are context-aware and interact intelligently with their environment. Even without technical expertise, you can create AI agents using Fine-Tuner's intuitive No-Code interface. Start with pre-built templates, receive step-by-step guidance, and design AI agents tailored to your needs.

**Our Agents can:**

Adapt to interaction stages, minimizing "hallucinations."
Extract and store crucial information from conversations.
Browse the internet and recommend products within a conversation.
Retrieve LinkedIn profiles and send emails via Gmail.
Convert text responses into audible speech.
Tools:

Fine-Tuner provides seamless integration options for deploying AI agents on various platforms:

REST API: Connect your AI agents to any data source, model, or third-party service using simple API endpoints.
Third-Party Tools: Interact with a variety of third-party tools, from internet browsing to LinkedIn profile retrieval, and more.
No-Code Plugins: Utilize Fine-Tuner's plugins for No-Code tools like Bubble and Zapier for enhanced functionality.

**Unlimited Secure Data Storage:**

At Fine-Tuner, we value your data's security and offer unlimited storage space in a dedicated Pinecone environment. Our SOC 2 Type II certified and GDPR-ready infrastructure ensures your data is protected. You have full control and transparency over your agent's learning and improvement process.

**More Features:**

Agent Simulations: Optimize your agents to the fullest with controlled simulations.
Workspace Collaboration: Collaborate with team members on your AI projects seamlessly.
LLM Fine-Tuning: Fine-tune LLMs, including OpenAI's davinci and Meta's Llama-2, using the intuitive No-Code interface.

**Conclusion:**

[Fine-Tuner](https://www.aiforme.wiki/ai/tools/fine-tuner%20ai) revolutionizes AI agent creation, empowering you to scale and deploy sophisticated AI agents without code. Explore the full potential of AI, interact intelligently with your environment, and ensure data security while building powerful AI solutions with Fine-Tuner. Step into the future of AI innovation with ease and confidence.
Day 18: Timeout
Tags: day17, javascript, 100daysofcode
Published: 2023-08-03 13:30:00

## Question
Write a function `promiseTimeout` that takes an asynchronous operation represented as a Promise and rejects it after a specific time if it hasn't been resolved yet.


```javascript
function promiseTimeout(promise, timeout) {
  // Todo add your code
}

  // Simulating an asynchronous operation 
const delayBy2000 = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve({ name: 'John Doe', age: 30 });
  }, 2000); // Resolves after 2 seconds
});

const timeout = 1500; // Set timeout for 1.5 seconds
const promiseWithTimeout = promiseTimeout(delayBy2000, timeout);

promiseWithTimeout
  .then((data) => {
    console.log('Promise resolved:', data);
  })
  .catch((error) => {
    console.error('Promise rejected:', error.message);
  });
```

🤫 Check the comment below to see answer.
Fun with UTF-8: browsing code points namespace
Tags: unicode, utf, raku
Published: 2023-08-03 13:13:02

This trick is very useful if you need to find all code points with given name or property. Let's find all characters that have ogonek (tiny tail) from previous post.

```
$ raku -e 'for 1..1_112_064 {
    next unless .uniname.contains( "WITH OGONEK" );
    say .chr, " ", .uniname;
}'

Ą LATIN CAPITAL LETTER A WITH OGONEK
ą LATIN SMALL LETTER A WITH OGONEK
Ę LATIN CAPITAL LETTER E WITH OGONEK
ę LATIN SMALL LETTER E WITH OGONEK
Į LATIN CAPITAL LETTER I WITH OGONEK
į LATIN SMALL LETTER I WITH OGONEK
Ų LATIN CAPITAL LETTER U WITH OGONEK
ų LATIN SMALL LETTER U WITH OGONEK
Ǫ LATIN CAPITAL LETTER O WITH OGONEK
ǫ LATIN SMALL LETTER O WITH OGONEK
Ǭ LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
ǭ LATIN SMALL LETTER O WITH OGONEK AND MACRON
```

In [Raku](https://www.raku.org/) you can call `uniname` or `chr` methods on integer value directly to get code point name or character under this code point respectively. If you are not familiar with `.method` syntax - this is just a lazy way to call a method inside a block on whatever value your iteration is at the moment, without assigning it explicitly to named variable. If you want you can be more explicit about it like: `for  1..1_112_064 -> $codepoint { next unless $codepoint.uniname... }`.

**Did you know that:**

- There are **899 digits** defined in Unicode?

```
$ raku -e '( 1 .. 1_112_064 ).grep( *.uniname.contains( "DIGIT" ) ).elems.say;'

899
```

- There are **154 sentence terminals**?

```
$ raku -e '( 1 .. 1_112_064 ).grep( *.uniprop( "Sentence_Terminal" ) ).elems.say;'

154
```

(Unicode properties will be explained in next post)

- Within those 154 sentence terminals there are **22 question marks**?

```
$ raku -e 'for 1 .. 1_112_064 { next unless .uniname.ends-with( "QUESTION MARK" ); say .chr, " ", .uniname; }'

? QUESTION MARK
¿ INVERTED QUESTION MARK
; GREEK QUESTION MARK
՞ ARMENIAN QUESTION MARK
؟ ARABIC QUESTION MARK
፧ ETHIOPIC QUESTION MARK
᥅ LIMBU QUESTION MARK
...
```

So, what was the funniest thing you found in Unicode?¿⸮