teleren/devto huggingface dataset:
Data Engineering Saga
Tags: learning, postgres, dataengineering
Published: 2024-01-19 21:34:44

I'm taking the DataTalksClub's Data Engineering Zoomcamp for the third time. The first time, I got through the whole course, but I had trouble loading the data for the final project. The second time, I quit early on. I had a job and the job was a priority.

What have I learned this time around? It feels like backsliding. Last night I spent three hours asking ChatGPT why I had so many errors trying to run postgres. I didn't tell it that I was supposed to run it in a Docker container because I didn't think of that. Why not? Because I quit the instructional video halfway through and started watching it the next day from where I left off. **I forgot that I was supposed to run postgres in a Docker container.** I finally posted my question on the Slack channel for the course. Thanks to Michael Shoemaker for pointing out my error so quickly and for encouraging me. I hope I can give something back when I finally get this.

I got past that roadblock. Next I had to load a .csv file into the database. I used a jupyter notebook (for python) with pandas (dataframe) and copied what the instructor did in the video. Success. Then I had to query the database using SQL. I don't use SQL, generally. So I asked ChatGPT how to query the database to answer the homework questions. Was this unfair? I don't think so. I would have had to look up the queries in a book, otherwise. I think it seems unfair because ChatGPT gives an answer right away, and it's specific. I think I'm slightly ahead of the game because I'm familiar with the data (New York Taxi Trip data) and because somewhere in the back of my mind, I remember what I can do with SQL.

I'm posting this for a few reasons. 1. The instructors want me to. I get points for posting this and for mentioning the course. 2. It will keep me accountable. I would like to finish the course this time around. 3. There is a slight chance it will help someone. I have my doubts.
The course is at https://github.com/DataTalksClub/data-engineering-zoomcamp. It started last week, but you can join anytime. It's one of the best courses I've taken.
How to Deal With Cheerio's load() Function Deprecation
Tags: javascript, programming, softwaredevelopment, softwareengineering
Published: 2024-01-19 21:35:57

[Cheerio 1.0.0-rc.10](https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0-rc.10) was released in June 2021 and deprecated the most common way of using [`cheerio`](https://www.npmjs.com/package/cheerio) to parse HTML. Starting with that version, the [`cheerio.load()`](https://cheerio.js.org/docs/api/interfaces/CheerioAPI/#load) instruction returns the deprecation message "Use the function returned by `load` instead."

Let's learn how to use Cheerio's `load()` function properly and avoid the deprecation message!

## The New Way to Use the `load()` Function in Cheerio

Before Cheerio 1.0.0-rc.10, you could the `load()` method on the Cheerio instance. However, as explained in the [official docs](https://cheerio.js.org/docs/api/interfaces/CheerioAPI/#load), the `load()` static method exposed by the Cheerio default variable is now deprecated.

![The deprecation message in Visual Studio Code](https://writech.run/wp-content/uploads/2023/08/image-46.png)

Instead, developers should prefer the [`load()`](https://cheerio.js.org/docs/api#load) function exported by the Cheerio module instead. Learn how to update your code and adopt the `load()` function exposed by the Cheerio API properly.

### Before

This is how you could use `load()` in Cheerio before deprecation:

```javascript
const cheerio = require('cheerio');
// ESM: import cheerio from 'cheerio';

// get the HTML content of a web page
const response = await fetch('https://your-target-site.com');
const html = await response.text();

const $ = cheerio.load(html);
```

### After

This is how you should use Cheerio's `load()` now:

```javascript
const { load } = require('cheerio');
// ESM: import { load } from 'cheerio';

// get the HTML content of a web page
const response = await fetch('https://your-target-site.com');
const html = await response.text();

const $ = load(html);
```

Et voilà! You are now using the `load` function exposed by Cheerio as recommended. The deprecation message will disappear!

## Conclusion

In this article, you learned that the `load()` method on the Cheerio default instance has been deprecated. Actually, they deprecated the use of the `cheerio` default instance. As you learned here, by importing the `load()` function directly, you can address the deprecation of that approach. Make your project up to date with the latest changes to Cheerio and its documentation.

Thanks for reading! I hope you found this article helpful.
  
***
_The post "[How to Deal With Cheerio's load() Function Deprecation](https://writech.run/blog/how-to-deal-with-cheerio-s-load-function-deprecation-a6401da930d1/)" appeared first on [Writech](https://writech.run)._
Compiling Ruby 3.3 on OpenBSD 7.4
Tags: ruby, openbsd
Published: 2024-01-14 18:14:18

Resuming the work done for

https://dev.to/olistik/a-naive-installation-of-ruby-and-rails-on-openbsd-4d50

I wanted to test the latest Ruby 3.3.0 on the latest OpenBSD 7.4 and here are the results.

First of all, let's download the sources:

```shell
$ curl -LO https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
$ tar xvfz ruby-3.3.0.tar.gz
$ cd ruby-3.3.0
```

Add `libyaml` dependency if you don't have it already:

```shell
$ doas pkg_add libyaml
```

Configure the compilation so that it picks libyaml and it outputs the binaries in our `rubies` directory:

```shell
$ CONFIGURE_ARGS="--with-libyaml-dir=/usr/local/lib" ./configure  --prefix ~/.rubies/3.3.0
$ make
$ make install
```

Update the symlink for the current version:

```shell
$ cd $HOME/rubies
$ rm current
$ ln -s /home/$HOME/.rubies/3.3.0/ current
```

And then check if everything works as expected:

```shell
$ ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-openbsd7.4]
```
How To Mark a File as Executable in a Git Repo
Tags: git, programming, softwaredevelopment, softwareengineering
Published: 2024-01-19 21:30:15

When dealing with Git repositories, you may run into situations where you need to mark a file as executable. The good news is that Git offers a way to set execution permissions on files in a repo, even on Windows. This is critical to allow anyone pulling the repo to run executable files that come from it without having to manually give them the right permissions.

In this article, you will learn how to give a file in a Git repository [0755 permission](https://chmodcommand.com/chmod-0755/) to make it executable.

## `--chmod=+x` and `--chmod=-x` Git Options

Before seeing how to achieve the desired result, let's take a look at the two Git options you can use to set executable permissions on a file. These are:

- `--chmod=+x`: Adds executable permissions to a file in the repo. The plus sign (+) specifies that the executable permission will be added.

- `--chmod=-x`: Removes executable permissions from a file. The minus sign (-) specifies that the executable permission will be removed.

Note that you can use these two options on popular git commands like [`git add`](https://git-scm.com/docs/git-add) and [`git update-index`](https://git-scm.com/docs/git-update-index).

Let's now dig into how to use these options to mark a file in a git repo as executable!

## Adding a File and Making it Executable in Git

Suppose your git repository contains a `script.sh` file and you want to give it executable permissions. Follow the steps below to add the file to the repo and mark it as executable with Git:

1. Add the file as executable to the repository with the command below:

```shell
git add --chmod=+x script.sh
```

2\. Commit the changes to the repository with:

```shell
git commit -m "<your_commit_message>"
```

Congrats! `script.sh` now has 0755 permissions. Keep in mind that you can also remove the executable permission from a file. To do so, simply replace `+x` with `-x` in the `git add` command in step 1. Note that with this approach, you can make a file executable for Linux and macOS from Windows.

That's it! It only took two commands and a handful of seconds!

## Conclusion

In this article, you learned that marking a file as executable in a Git repository is a straightforward process. In detail, you can use the `chmod=+x` and `chmod=-x` options to add or remove executable permissions on a file in git, respectively. By following this step-by-step tutorial, you learned how to give 0755 permissions to a file in your Git repository. This procedure works identically on Linux, Windows, and macOS.

Thanks for reading! I hope you found this article helpful.
  
***
_The post "[How To Mark a File as Executable in a Git Repo](https://writech.run/blog/how-to-mark-a-file-as-executable-in-a-git-repo-80ee532f4366/)" appeared first on [Writech](https://writech.run)._
HOW TO DOWNLOAD AND UNZIP ROCKYOU.TXT ON KALI
Published: 2024-01-19 19:53:05

Go to your web browser and search "rockyou.txt" on google to download the file from github.

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


After successful download click on your home file

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



Select "file system" and select the "usr" file

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



Select the "share" file

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


Select the "wordlists" file

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


Right click on your MENU KEY and select "open terminal here"

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


Input the command below to switch to root

```
sudo su

```

Now input the command below to unzip the file
```
gzip -d rockyou.txt.gz

```

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


The rockyou wordlist has been successfully unzipped.

### HOW TO CHECK THE TOTAL AMOUNT OF PASSWORD IN THE FILE
CD into the directory
```
cd /usr/share/wordlists 

```
input the command
```
wc -l rockyou.txt

```


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


### TO SEARCH PASSWORDS CONTAINING A CERTAIN WORD
Input the command
```
grep girlfriend rockyou.txt

```
NB- Change girlfriend to any word of your choice

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


### HOW TO SEARCH FOR PASSWORDS CONTAINING SPECIAL CHARACTERS

Input the command
```
grep -F "*#$" rockyou.txt 

```
NB- Change *#$ to any character of your choice

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q7vi13lo3vfdxo798qh.png)
EZ Bkup: The easiest backup program on earth!
Tags: opensource, nim, backup, owlkettle
Published: 2024-01-19 21:29:20


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

**<u>EZ Bkup:</u> The easiest backup program on earth!**
EZ Bkup is a data backup program for the desktop, striving to be as quick and easy to use, as possible.

EZ Bkup is a graphical front-end for Rsync, built with  [Owlkettle](https://github.com/can-lehmann/owlkettle) and GTK, written in Nim. EZ Bkup currently runs on Linux distributions, and expects rsync (3.2.4+) and polkit to be installed.

**Respects Your Time**

- Zero configuration/settings required.

- Zero Rsync knowledge required.

- Create Backup Routine(s) and run on-demand.

- Fast: Only copies what has changed since last time.

**Respects your Freedom**

- EZ Bkup source code is released under the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).

- No [DRM](https://www.gnu.org/proprietary/proprietary-drm.en.html).

**Respects your Privacy**

- No [Telemetry](https://www.gnu.org/proprietary/proprietary-surveillance.en.html).

- Does not beam your data back to the mothership.

If you’ve been reluctant to backup your data on a regular basis, or at all, because you didn’t want to learn/configure a backup program, read a man page and use a command line program, or deal with the slow and tedious process of copying and pasting disparate folders/directories, we understand. That’s why we created EZ Bkup for ourselves, and are happy to share it with you!

Thank You for supporting the development of ethical software!

[ezbkup.app](https://ezbkup.app/)
Game marketing strategies
Tags: gamedev, coding, programming, codenewbie
Published: 2024-01-19 21:03:57

If you have designed, developed and launched a game and want to market it, here are some strategies:

**Influencer Marketing**
You can pay gaming influencers to talk about your game on their channel. This might influence the subscribers of these influencers to play your game.

**PR**
You can reach out to gaming websites, gaming influencers and streamers and ask them to feature your game in their content or maybe even review your game in their content.

**ASO**
Just like SEO for blogs and websites, ASO (App Store Optimization) helps your app become more visible and thus reach more users. You can put relevant keywords in the game description and attach high quality screenshots of your game to increase ASO and thus increase the number of downloads of your game.

**SMM**
Social media marketing is another great way to market your game. You can use your own social media handles to promote your game. You can also try to build a following on various social media platforms by posting content regularly so that your game reaches maximum number of people possible. Ideally, you could post content regarding tech, entrepreneurship, gaming etc since you have created a game and want players to experience it.
My Hobby Project - Resume Builder - Next.js
Tags: nextjs, react, webdev, javascript
Published: 2024-01-19 20:33:51

I'm excited to share my hobby project: cvalley.io - a platform designed to make the resume-building process easy, efficient, and free. Whether you're a recent graduate entering the job market or an experienced professional looking to update your CV, CValley.io has got you covered.

CValley is open source on GitHub. Explore the project's key features and purpose, and feel free to contribute, provide feedback, or suggest improvements. 

🏠 Homepage: https://cvalley.io/
🐙 GitHub: https://github.com/junsantilla/cvalley
How to Add Leading Zero to Number in JavaScript (Bite-size article)
Tags: javascript
Published: 2024-01-19 20:22:32

#Introduction
Hello everyone.

Have you ever wanted to add a leading zero to numbers in web development or styling, making them `"01, 02, 03, ..."` instead of just `"1, 2, 3, ..."`?

Recently, there was a need for such formatting in a project I was working on. It's a very simple issue, but since I hadn't done it personally before, I had to research and solve it on my own. I thought it might be a small learning opportunity, so I decided to share the method I learned in this article. It's a straightforward approach, so some of you might already be familiar with it, but if you're interested, please give it a read.

*I use Javascript for this formatting




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





#Adding Zeros to One-digit Numbers
In JavaScript, you can add zeros to numbers using the `padStart` method.

First, look at the sample code below.

```js
function formatSingleDigit(number) {
  return number.toString().padStart(2, '0');
}

console.log(formatSingleDigit(3)); // Output: '03'
```

Here is basic syntax:

```js
padStart(targetLength)
padStart(targetLength, padString)
```

**targetLength**, is the length of the resulting string once the current `str` has been padded. If the value is shorter than or equal to `str.length`, then `str` is returned **as-is**.

**padString** is the string to pad the current `str` (this is optional value). If `padString` is too long to stay within the `targetLength`, it will be truncated from the end. 

---

So, the first argument becomes the length of string after padded, and the second argument becomes the character used for pad (in this case, 0).

When using this code, only single-digit numbers will have a leading 0 embedded. The `number` in `formatSingleDigit(number)` can be a dynamic value, and you can leverage this code as a foundational structure for various situations.

#Bonus: Other Example
This method can be applied to many different uses.
For example, the following uses may be useful.

```js
const serialNumber = 98765;
const formattedSerialNumber = String(serialNumber).padStart(10, '0');
console.log(formattedSerialNumber);  // Output: '0000098765'
```
This is an example of its use in situations where a certain number of digits are required, for example in formatted serial numbers.
In this way, the missing digits are complemented with '0' to achieve the specified number of digits.

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

#Conclusion
The content introduced this time is very simple, but I believe it's practical and you may find many opportunities to use it. Please try it if you are interested in.

Thank you for reading!
Desenvolvimento Web com Python Django: Uma introdução abrangente
Published: 2024-01-19 20:50:49

Python Django é um framework de desenvolvimento web de alto nível que permite a criação de aplicativos robustos e escaláveis. Com uma sintaxe limpa e uma ampla gama de recursos, o Django se tornou uma escolha popular entre os desenvolvedores 
que desejam construir sites e aplicativos web de forma eficiente.

No coração do Django está o conceito de "baterias incluídas". Isso significa que o framework vem com uma série de recursos e funcionalidades prontas para uso, o que acelera o processo de desenvolvimento. Com o Django, você pode se concentrar 
na lógica do seu aplicativo, em vez de gastar tempo escrevendo código repetitivo.

Um dos principais benefícios do Django é o seu poderoso sistema de administração. Com apenas algumas linhas de código, você pode criar uma interface de administração personalizada para gerenciar os dados do seu aplicativo. Isso é especialmente útil quando você precisa fornecer aos usuários finais a capacidade de adicionar, editar ou excluir informações sem a necessidade de conhecimentos avançados em programação.

Além disso, o Django possui um sistema de URL amigável que facilita a criação de URLs claras e significativas para suas páginas. Isso não apenas melhora a experiência do usuário, mas também ajuda nos esforços de otimização de mecanismos de busca (SEO).

Outro recurso poderoso do Django é o ORM (Object-Relational Mapping), que permite interagir com o banco de dados usando objetos Python. Isso elimina a necessidade de escrever consultas SQL complexas e simplifica o processo de manipulação e recuperação de dados.

O Django também possui suporte embutido para autenticação de usuários, o que facilita a implementação de recursos de login, registro e gerenciamento de contas. Além disso, o framework oferece recursos de segurança, como proteção contra ataques de injeção de SQL, ataques CSRF (Cross-Site Request Forgery) e XSS (Cross-Site Scripting).

Em termos de escalabilidade, o Django é conhecido por seu desempenho excepcional. Ele é capaz de lidar com uma grande quantidade de tráfego e pode ser dimensionado verticalmente ou horizontalmente, dependendo das necessidades do seu aplicativo.

Em resumo, o Python Django é uma ferramenta poderosa para o desenvolvimento web. Com sua sintaxe elegante, recursos abrangentes e comunidade ativa, o Django torna o processo de criação de aplicativos web rápido, eficiente e agradável. Se você está procurando construir um site ou aplicativo web, o Django é definitivamente uma opção a ser considerada.
TypeScript: Type Annotations and Type Inference
Tags: typescript
Published: 2024-01-19 20:07:43

As I go through the typescript course, here are some things I have learned. In TypeScript, there are two important concepts: Type annotations and Type inference.

**Type Annotations:** We, as developers, use type annotations to tell TypeScript the type of value a variable will have. For example:
```typescript
let apples: number = 5;
```
Here, we're saying that `apples` will always be a number. If we try to assign a string, TypeScript will show an error.

**Type Inference:** TypeScript tries to figure out the type of a variable by itself. For example:
```typescript
let apples = 5;
```
When we declare and initialize a variable in one line, TypeScript guesses its type. In this case, it's a number. If we try to assign a string, TypeScript will show an error.
<br><br>
### When to use each one?

**Type Inference:** Use it whenever possible. Let TypeScript do the work of figuring out types for you.

**Type Annotations:**
- When declaring a variable and initializing it in separate lines:
```typescript
let apples; // should be let apples: number;
```
- When a function needs to clarify the type it returns:
```typescript
const numberToString = (num: number): string => {
    return num.toString();
}
```
- When a variable's type can't be inferred(guessed by TypeScript):

When Typescript can't figure out the intended type (a scenario where a variable could potentially have multiple types), we need to use type annotations. For example:
```typescript
let words = ['red', 'green', 'blue'];
let foundWord = false;

for (let i = 0; i < words.length; i++) {
    if (words[i] === 'green') {
        foundWord = words[i];
    }
}
```
to fix this, we need to add type annotations to `foundWord` variable:
```typescript
let words = ['red', 'green', 'blue'];
let foundWord: boolean | string = false;
```

**Resources:**
- [NestJS: The Complete Developer's Guide](https://www.udemy.com/course/nestjs-the-complete-developers-guide/)