teleren/devto huggingface dataset:
Join Packt Conference - Put Generative AI to Work
Tags: ai, news, learning
Published: 2023-08-23 18:00:51

📢 Exciting Announcement: Join the Packt Conference - Put Generative AI to Work 

Are you ready to dive into the world of Generative AI and unleash its limitless potential? Look no further! 

Packt invites you to a groundbreaking conference that will revolutionize your understanding of Generative AI. This event is tailor-made for tech enthusiasts, professionals, and curious minds who want to explore the cutting-edge possibilities of Generative AI in the #tech!

🗓️ Dates: October 11-13, 2023 

📍 Location: Virtual

🎟️ Grab Your Early Bird Ticket Today!

Secure your spot now with our limited-time Early Bird Tickets (Upto Sept 1)! 🎫🕊️

🚀 Why Attend?


✅ Expert Conversations: Engage with industry-leading experts who have harnessed the power of Generative AI to drive innovation and change the tech landscape.

✅ Hands-on Tech Sessions: Get your hands dirty with practical workshops, deep-dive sessions, and tutorials that will empower you to put Generative AI concepts into action.

✅ Cutting-edge Demos: Witness live demonstrations of the latest advancements in Generative AI, showcasing its real-world applications across diverse domains.

✅ Networking Opportunities: Connect with fellow attendees, speakers, and professionals who share your passion for pushing the boundaries of AI technology.

Register today: https://packt.link/V5psq
Migration of Terraform State file from Azure Storage Account to Terraform Cloud workspace
Tags: terraform, terraformcloud, infrastructureascode, devops
Published: 2023-08-23 18:00:06

## What is Terraform State file?

Terraform stores information about your infrastructure in a State file. This state file keeps track of resources created by your configuration and maps them to real-world resources.

**Migration Steps involves:**
- Download the latest State file from the Azure storage account, and rename it to `terraform.tfstate`.
- Create a new directory/folder and create a new `main.tf` file with following configurations:
```
terraform {
 cloud {
  organization = "YOUR_TFC_ORGANIZATION"

  workspaces {
   name = "WORKSPACE_NAME"
  }
 }
}
```
- Copy the downloaded state file into this new directory/folder in which you created the new `main.tf` file.
- Make sure that the local version of Terraform match with the Terraform version of your Terraform Cloud workspace. If not install the required version.
- Now run `terraform init` command. It will show you something similar:
```
Initializing Terraform Cloud...
Do you wish to proceed?
  As part of migrating to Terraform Cloud, Terraform can optionally copy your
  current workspace state to the configured Terraform Cloud workspace.

  Answer "yes" to copy the latest state snapshot to the configured
  Terraform Cloud workspace.

  Answer "no" to ignore the existing state and just activate the configured
  Terraform Cloud workspace with its existing state, if any.

  Should Terraform migrate your existing state?

  Enter a value: 
```
Type "yes".
- Now you can check over your TFC workspace and you should see the migrated state file.

**After Migration:**
- Go back to your actual directory/folder containing your Terraform infrastructure code.
- Add this same code block to your `main.tf` file or `providers.tf` file:
```
terraform {
 cloud {
  organization = "YOUR_TFC_ORGANIZATION"

  workspaces {
   name = "WORKSPACE_NAME"
  }
 }
}
```
- Run `terraform init` and `terraform plan` commands or initiate a run over Terraform Cloud. You should see that Terraform Plan phase is not showing any changes to be done.

You have successfully migrated your TF state file from storage account to TFC workspace.

### Note:
One TFC workspace can hold only a single state file. If you have multiple environments with multiple state files, you need to create a separate workspace for individual environment's state files respectively and follow the same migration steps.

Checkout this repository: 
{% github aniketkumarsinha/migration-of-terraform-state-file-to-terraform-cloud-workspace %}

Share if your like the blog and follow for more!!
{% user aniketkumarsinha %}
Day 32: async/await vs Generators
Tags: javascript, 100daysofcode, day32
Published: 2023-08-23 18:00:00

Before diving into the comparison, let's revisit the concept of asynchronous programming. It's all about managing tasks that don't necessarily execute in a linear order. This is particularly crucial when dealing with time-consuming operations like network requests, file I/O, or database queries. The traditional approach often led to callback hell, where nested callbacks became difficult to manage. `async/await` and `generators` address this issue in unique ways.

## 🚀 The Power of `async/await`

`async/await` is a paradigm-shifting addition to JavaScript that simplifies asynchronous code readability and structure. It's built upon Promises, another crucial concept in modern JavaScript. With `async/await`, asynchronous functions can be written almost like synchronous ones, making the code easier to understand.

```javascript
async function fetchUserData(userId) {
  try {
    const response = await fetch(`/users/${userId}`);
    const data = await response.json();
    return data;
  } catch (error) {
    console.error("Error fetching user data:", error);
    throw error;
  }
}
```

## 🔄 The Intricacies of Generators

Generators, on the other hand, are a different approach to handling asynchronous operations. They provide a way to pause and resume the execution of a function, allowing for more flexible asynchronous control flow. This can be useful when working with data streams or tasks that can be paused and resumed at will.

```javascript
function* dataStream() {
  yield fetchData("data1");
  yield fetchData("data2");
  yield fetchData("data3");
}
```

## Comparison

1. **Readability and Ease of Use**
   `async/await` shines in terms of code readability. It resembles synchronous code, making it easier for developers to grasp the flow of asynchronous operations. `Generators`, while powerful, can sometimes lead to complex control flow, making them harder to understand.

2. **Error Handling**
   `async/await` handles errors elegantly with the familiar `try/catch` syntax. `Generators` require manual error propagation using the `throw` method, which can be more error-prone.

3. **Flexibility and Streaming**
   `Generators` offer more control over asynchronous tasks due to their ability to pause and resume execution. This makes them suitable for scenarios like data streaming or custom iteration. `async/await` is generally better suited for linear asynchronous flows.

4. **Promise Integration**
   `async/await` seamlessly integrates with Promises, enabling easy adoption in existing asynchronous codebases. `Generators`, while not inherently Promise-based, can be combined with Promises to achieve similar functionality.

## Conclusion

Both `async/await` and `generators` have their places in modern JavaScript development, each excelling in different scenarios. `async/await` is your go-to choice for simplifying asynchronous flows, improving readability, and handling errors. `Generators` offer more fine-grained control and are well-suited for custom iteration patterns and streaming data.
"The Journey from a Bootcamp to a FAANG": CodeNewbie Podcast S25E2
Tags: podcast, career, codenewbie, beginners
Published: 2023-08-23 17:28:36

In our second episode of the CodeNewbie Podcast, @saronyitbarek talks about  about choosing a bootcamp, finding resume tips, and navigating career paths with confidence with [Alex Lee](https://twitter.com/TheTechRally?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor), Frontend Engineer at Amazon.

{% embed https://www.codenewbie.org/podcast/the-journey-from-a-bootcamp-to-a-faang %}

Alex is a Frontend Engineer at Amazon based in Los Angeles. He also is a career coach dedicated to helping new and seasoned Software Developers change or advance their career.

- [Listen on Apple Podcasts](https://podcasts.apple.com/us/podcast/codenewbie/id919219256?i=1000625365837)

- [Listen on Spotify](https://open.spotify.com/episode/2JbXu0bOshzmvqPhNgOsoR?si=ce88c015661b4511)

Or, listen wherever you normally get your podcasts!

***

### We will see you next week, happy coding

PS: Make sure to subscribe to the CodeNewbie podcast if you haven't yet + review us on your chosen platform!
Exploring the Power of Generic Repository Pattern in RESTful APIs
Tags: csharp, restapi, security, architecture
Published: 2023-08-23 17:27:41

🇺🇸/🇪🇸/🇫🇷 👋 Welcome to the world of SampleAPIGenericRepository! In this repository, we're diving into the implementation of a Generic Repository Pattern within a RESTful API that manages data access for various entities. Plus, we'll showcase built-in Authentication using JWT tokens. / 👋 ¡Bienvenidos al mundo de SampleAPIGenericRepository! En este repositorio, exploramos la implementación de un Patrón de Repositorio Genérico en una API RESTful que maneja el acceso a datos para diversas entidades. Además, en este proyecto mostramos la Autenticación incorporada utilizando tokens JWT. / 👋 Bienvenue dans l'univers de SampleAPIGenericRepository ! Dans ce référentiel, nous explorons la mise en œuvre d'un Modèle de Répertoire Générique dans une API RESTful qui gère l'accès aux données pour différentes entités. De plus, ce projet démontre l'utilisation d'une Authentification intégrée en utilisant des jetons JWT.
[LinkedIn](https://www.linkedin.com/pulse/exploring-power-generic-repository-pattern-restful-gaytan-delgado)
Building Secure APIs with JWT
Tags: csharp, restapi, encryption
Published: 2023-08-23 17:24:47

👋 Today, I want to take you on a journey through a project that demonstrates how to build a secure API with user authentication using JSON Web Tokens (JWT). Let's dive into SampleAPIWithAuthentication! / 👋 Hoy les voy a llevar a través de un proyecto que demuestra cómo construir una API segura con autenticación de usuarios utilizando Tokens Web JSON (JWT). ¡Sumérgete en SampleAPIWithAuthentication!

[LinkedIn](https://www.linkedin.com/pulse/building-secure-apis-jwt-juan-carlos-gaytan-delgado)
Enhancing Data Security with AES Encryption: A Practical Guide
Tags: csharp, security, encryption
Published: 2023-08-23 17:21:21

In this article, we delve into the world of AES encryption and demonstrate its application through a step-by-step guide. We'll explore the creation of an AES encryption library and provide a hands-on example to showcase how it can be seamlessly integrated into your applications 
[LinkedIn](https://www.linkedin.com/pulse/enhancing-data-security-aes-encryption-practical-gaytan-delgado)
Single directory components in backend frameworks
Tags: php, laravel, architecture
Published: 2023-08-23 17:19:44

## The rant

At the moment I'm working on some Laravel sites. And I was thinking about the [Drupal single directory component](https://www.drupal.org/project/sdc). 

Why do we need to place all those classes in different directories? Most, if not all, classes have a suffix to identify their role in the application.

In Drupal it revolves around html that is in a twig file. For backend code most classes revole around a model or a controller.

Laravel artisan make commands allow you to bootstrap the different classes. But few of them offer you a path option. So the only thing you can do at the moment is to create the classes and move them manually.

## A solution?

To show what it could be I made a [make:group command](https://github.com/xwero/laravel-console-group). For now it is proof of concept code. A lot of functionality and refinement is missing.

The command guides you through the creation of a group and the bootstrapping of the controller, model and/or repository.

For the generation of the controller I choose to make it possible to create the methods instead of choosing between a few templates.

When you want to create a repository it will create the class and the interface with the methods you add.

Try it out, let me know what your thoughts are on this way of strucuring the code. And have a good day!
#DEVDiscuss: Sassy CSS
Tags: devdiscuss, discuss
Published: 2023-08-23 17:19:05

---
title: #DEVDiscuss: Sassy CSS
published: true
description: 
tags: devdiscuss, discuss, 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4f92fzhfxojcul2gejan.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-07-26 18:51 +0000
---
Time for #DEVDiscuss — right here on DEV 😎

{% embed https://dev.to/classicthedemigod/getting-started-with-scss-the-css-preprocessor-with-superpowers-34ed %}

Inspired by @classicthedemigod' Top 7 post, tonight’s topic is... Sassy CSS!

Have you ever felt there should be a way to make writing CSS easier and faster? This is where SCSS (Sassy CSS) comes in! SCSS (Sassy CSS) is a preprocessor scripting language that is compiled into regular CSS. It extends the capabilities of CSS by adding features like variables, nesting, mix-ins, and more.

### Questions:
- **What are the biggest challenges you have faced when working with SCSS?**
- **How difficult did you find it to pick up SCSS if you were already familiar with CSS? Any tips for newcomers?**
- **Where do you see the future of SCSS going? Do you think CSS will eventually incorporate more features that are currently SCSS-only?**
- **Any triumphs, fails, or other stories you'd like to share on this topic?**
@rslike: compare your structures in TypeScript/JavaScript like a pro
Tags: programming, npm, typescript, opensource
Published: 2023-08-23 17:16:29

At the previous [article](https://dev.to/vitalicset/its-done-rust-like-api-in-your-javascript-code-1e76) I was described my new package distributed via npm - @rslike/std - standard JS library which allows to remove undefined behavior in your code. But today, std is not a part of our story.

Today, I'm gonna show you comparison package([@rslike/cmp](https://www.npmjs.com/package/@rslike/cmp)). Using this package you can compare your classes and(or) objects like a pro. 

## How to install

```bash
npm install @rslike/cmp
# or via yarn
yarn add @rslike/cmp 
# or via pnpm
pnpm add @rslike/cmp
```

I highly recommend to install `@rslike/std` package too, since if you would like to implement `PartialEq` - you need to use `Option` from `@rslike/std` package

## Usage

``` ts
// filename: node.ts
import {type Ord, Ordering} from '@rslike/cmp'

import { None, Option, Some } from '@rslike/std';

class Node implements Ord {
  left: Node | null;
  right: Node | null;

  constructor(readonly value: number) {
    this.value = value;
  }
  partialEquals(other: unknown): boolean {
    return this.value == Number(other);
  }
  notEquals(other: unknown): boolean {
    return !this.partialEquals(other);
  }
  partialCompare(other: unknown): Option<Ordering> {
    const asNumber = Number(other);
    if (this.value === asNumber) {
      return Some(Ordering.Equal);
    } else if (this.value > asNumber) {
      return Some(Ordering.Greater);
    } else if (this.value < asNumber) {
      return Some(Ordering.Less);
    }
    return None()
  }
  lt(other: unknown): boolean {
    return this.compare(other).isLt();
  }
  le(other: unknown): boolean {
    return this.compare(other).isLe();
  }
  gt(other: unknown): boolean {
    return this.compare(other).isGt();
  }
  ge(other: unknown): boolean {
    return this.compare(other).isGe();
  }
  compare(other: unknown): Ordering {
    return this.partialCompare(other).unwrap();
  }
}
```

Easy, isn't it?

That's because I use the same(mostly inspired) types(traits) from [rustlang](https://doc.rust-lang.org/std/cmp/trait.Ord.html).

![Ord trait](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oggjvxkksmmgyyggpc11.png)

That's it for today. Check it out [std](https://www.npmjs.com/package/@rslike/std) package.

P.S. I was release 2.x version since new package `cmp` was included and now here is 2 packages:
- [std](https://www.npmjs.com/package/@rslike/std)
- [cmp](https://www.npmjs.com/package/@rslike/cmp)
Hakeem sunny 100m winner for Japan https://shorturl.at/jowCW
Published: 2023-08-23 17:08:45

https://shorturl.at/jowCW
Abdul Hakeem Sunny Brown wrote history for Japan in 2019

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


he already broke the under 10 seconds barrier over 100 meter this season 2022 he met himself to the most successful individual 100 meter sprint in Japan but let's start from the beginning Sunny Brown is born 1999 in Fukuoka Japan his mom is Japanese his dad is coming from Ghana at the age of 16 he had his first International breakthrough at the youth World

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

 Championships in Kali Colombia 15th of July Hakeem won the gold medal of one meter in an outstanding time of 10.28 four days later the Japanese also won the 200 meter in a time of 20.34 in 2017 Sunny Brown qualified himself for the world championships in London over 100 meter he ran a solid 1005 in the Heats but missed the final after 10.28 in the semi-final Hakeem showed a better performance over 200 meter he qualified himself for the final and played Seven in a time of 20.63 in 2019 Hakeem broke totally three times the magical under 10 seconds barrier over 100 meter at the NCAA championships he finished third with the second fastest time of 9.97 at the world championships in Doha he missed the final over 100 meter in a time of 10.15 in Doha Hakeem helped the 4x1 reel team of Japan to win the brass medal they also broke the Asian record the season 2021 was very special for every Japanese athlete the Olympic Games were held in Tokyo Japan sadly Sunny Brown had injury problems in that season he was still competing at the 200 meter Heats in a time of 2141 he couldn't show his big potential in the season 2022 Hakeem showed the world what a phenomenal Sprinter he is after winning the Japanese Nationals over 100 meter in a time of 1008 he was ready for the world championships in Eugene Oregon Sunny Brown started excellent into the championships with 9.98 in the Heats and 10.04 in the semi-final Abdul Hakeem Sunny Brown qualified himself for the 100 meter final he is the first Japanese 100 meters printer who reached the world championship final in the solid race the 23 year old played seventh in a time of 10.06 we can be excited how fast this young Japanese Sprinter will be in the future if you missed the documentary about The Sensational season of Matthew bowling click up in the right corner thanks for watching everyone and see you next time foreign ...Read more[](https://shorturl.at/jowCW)
https://shorturl.at/jowCW
How to Rebuild Android and iOS Separately in a Flutter Project
Tags: flutter, android, ios, rebuild
Published: 2023-08-23 16:46:42

In Flutter development, there might be times when you want to rebuild only the Android or iOS part of your project. Here's how you can do it for each platform:

## Rebuilding Android:

- **Delete the build folder inside the Android directory**:
   - Navigate to the root directory of your Flutter project.
   - From there, delete the `build` folder inside the `android` directory using the command:
     ```bash
     rm -rf android/app/build
     ```

- **Use Flutter build command**:
   - Still in the root directory of your Flutter project, to build only the Android part, you can use the following commands:
   
   - For APK:
     ```bash
     flutter build apk
     ```

   - For App Bundle:
     ```bash
     flutter build appbundle
     ```

- **Using Android Studio**:
   - Open your Flutter project in Android Studio.
   - Go to the 'Build' menu and select 'Rebuild Project'.

## Rebuilding iOS:

- **Delete the build and DerivedData folders inside the iOS directory**:
   - Navigate to the root directory of your Flutter project.
   - From there, delete the `DerivedData` and `build` folders inside the `ios` directory using the commands:
     ```bash
     rm -rf ios/DerivedData
     rm -rf ios/build
     ```

- **Use Flutter build command**:
   - Still in the root directory of your Flutter project, to build only the iOS part, use the following command:
   ```bash
   flutter build ios
   ```

- **Using Xcode**:
   - Open the `ios` folder of your Flutter project in Xcode.
   - From the top menu, select 'Product', then 'Clean Build Folder'. This action removes all the previously compiled files, ensuring a fresh build the next time you compile.
   - After that, click the 'Run' button or select 'Product' > 'Build' to rebuild the project. This compiles the project using the latest code and resources.

---

By following these steps, you can rebuild the Android or iOS parts of your Flutter project separately, without affecting the other platform.
How does SEO work? what is SEO ? Explain in short blog...
Published: 2023-08-23 16:29:00

https://shorturl.at/giVX4
[](https://shorturl.at/giVX4)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4evm3lh7c5urttxfbrvy.jpg)
1991 the world's first website was torch in the coming years one turned into hundreds and hundreds into thousands ultimately crowding the internet necessity does the mother of invention so this was the time to structure and make the information on the Internet is accessible which led to the birth of search engines search engines help people to find information on the internet so now the question arises how are search engines able to identify the information people are searching for this happens with the help of Search terms users enter to search for the information search engines identify the web content containing those phrases thereby displaying it into the search engine result pages also known as serps so to break users or search engine traffic to your website you will need to optimize your web content with the Search terms or relevant keyword which users are actually looking for say if you have a shoe website then it should have keywords like Snickers sport shoes and some phrases like best knickers for men which will help you to gain more use attraction and for this search engine optimization plays an important role so the process of getting good quality and quantity of traffic on your website or a web page through search engines is called search engine optimization or SEO in short search engine optimization practices involves on-page SEO of page SEO and Technical SEO each of these is directly or indirectly responsible for getting organic traffic to your website with the growth of SEO industry and Rising demand for SEO experts leading companies like Microsoft udemy Deloitte and Siemens are already hiring SEO expert with salaries going as high as 100 000 dollars per annum that's as you wrap in two minutes if you like this video hit the like button and subscribe to Simply learn to get more information about SEO [](https://shorturl.at/giVX4)
NumPy Tutorial #4: Array Slicing
Tags: datascience, python, beginners, tutorial
Published: 2023-08-23 16:25:20

{% embed https://youtu.be/b3JI8J-oaF8 %}

How can you slicing a NumPy array? The concept is same as python list implementation. Let us see how to implement slicing.

First of all, let's create a NumPy array
```python
import numpy as np

list_of_number = [6, 7, 8, 9, 10]

arr = np.array(list_of_number)
```

To create a slice of [6, 7, 8] from the array, you can run this code
```python
print(arr[0:3])
```
you will get this output
```
[6 7 8]
```

---

That is how you can slice an array to create a set of new sliced array. Thank you for reading this blog and have a good day!