teleren/devto huggingface dataset:
Mastering JavaScript Generators: Understanding and Using the Power of Pausable Functions
Tags: javascript, typescript, webdev, programming
Published: 2023-01-17 03:19:25

JavaScript generators are a special type of function that can be paused and resumed, allowing you to control the flow of execution and produce a series of values. This makes them a powerful tool for tasks such as iterating through a large dataset or generating a stream of data.

To define a generator function, you use the `function*` syntax instead of the regular `function` keyword. Inside the generator, you can use the `yield` keyword to pause the function and produce a value. When the generator is resumed, it picks up right where it left off, allowing you to iterate through a series of values without the need for a loop.

Here is an example of a simple generator that produces the Fibonacci sequence:


```js
function* fibonacci() {
  let [prev, curr] = [0, 1];
  while (true) {
    yield curr;
    [prev, curr] = [curr, prev + curr];
  }
}

const sequence = fibonacci();
console.log(sequence.next().value); // 1
console.log(sequence.next().value); // 1
console.log(sequence.next().value); // 2
console.log(sequence.next().value); // 3
console.log(sequence.next().value); // 5
```

You can use the `next()` method to advance the generator to the next value. The method returns an object with a `value` property that contains the yielded value, and a `done` property that is `true` when the generator has completed.

Generators can also be used in combination with the `for-of` loop, which allows you to iterate through a series of values without the need for a traditional loop.

```js
for (let value of fibonacci()) {
  console.log(value);
  if (value > 100) {
    break;
  }
}
```

In addition, you can use the yield* statement inside a generator to delegate to another generator or iterable object. This allows you to easily compose multiple generators together and create more complex data streams.

Generators are a powerful feature in JavaScript that can help you write more elegant and efficient code. They allow you to control the flow of execution, iterate through a series of values, and create complex data streams. With their help, you can easily create efficient, sophisticated, and robust applications.

T﻿hanks for reading, happy hacking!

Originally posted in my personal blog: [https://blog.luispa.dev/posts/mastering-javascript-generators-understanding-and-using-the-power-of-pausable-functions](https://blog.luispa.dev/posts/mastering-javascript-generators-understanding-and-using-the-power-of-pausable-functions)
Install Drupal 10 in 5 Minutes
Tags: webdev, php, beginners, tutorial
Published: 2023-01-17 02:59:56

{% embed https://youtu.be/pYCZixiXX2U %}

Follow along to get a Drupal 10 website up and running in minutes!

Accepting requests for new content

## Prerequisites

* Docker
* DDEV

Watch installation tutorials for the prerequisites on my playlist [
Play all
Basic Software for Full Stack Development
](https://youtube.com/playlist?list=PLGOhKz8ZRJwA1KDe5JNkBbjHSzvV81tS6)

## References

* [DDEV CMS Quickstarts](https://ddev.readthedocs.io/en/latest/users/quickstart/)

## Revisions

* January 20, 2023 - Higher quality recording
* January 16, 2023 - Original post
Guia de TI é selecionado para o programa Microsoft for Startups Founders Hub
Tags: novidades, guiadeti, microsoft, startup
Published: 2023-01-17 12:57:45

---
title: Guia de TI é selecionado para o programa Microsoft for Startups Founders Hub
published: true
date: 2023-01-17 02:59:49 UTC
tags: Novidades,guiadeti,microsoft,startups
canonical_url: 
---

![Thumb Microsoft for Startups Founders Hub - Guia de TI](https://guiadeti.com.br/wp-content/uploads/2023/01/Guia-de-TI-Microsoft-Startups-1024x676.png "Thumb Microsoft for Startups Founders Hub - Guia de TI")

## Conteúdo
<nav><ul>
<li><a href="#o-microsoft-for-startups-founders-hub">O Microsoft for Startups Founders Hub</a></li>
<li><a href="#metas-para-2023">Metas para 2023</a></li>
<li><a href="#6-edicao-do-guia-de-ti">6º Edição do Guia de TI</a></li>
</ul></nav>

## O Microsoft for Startups Founders Hub

O [Microsoft for Startups](https://www.microsoft.com/en-us/startups) Founders Hub é um programa voltado para ajudar fundadores de startups a aproveitar as ferramentas e recursos da Microsoft para escalar seus negócios.

O programa oferece acesso a tecnologia, mentoria e oportunidades de parceria para ajudar as [startups](https://guiadeti.com.br/guia-tags/cursos-de-startup/)a crescer e se desenvolver. Além disso, os participantes também podem se beneficiar de recursos de marketing e vendas, bem como de acesso a um amplo ecossistema de parceiros e investidores.

## Metas para 2023

Estamos animados para anunciar que o [Guia de TI](https://guiadeti.com.br/) estará ampliando seu projeto para ajudar ainda mais profissionais de tecnologia a estarem atualizados com as últimas tendências e desenvolvimentos. Com novos conteúdos e recursos, o blog se tornará ainda mais valioso para aqueles que buscam aprimorar suas habilidades e conhecimentos na área de TI.

Estaremos ampliando nosso alcance para incluir mais opiniões de especialistas e conteúdos de qualidade. Não perca a oportunidade de ficar por dentro das últimas notícias e tendências em tecnologia com o [Guia de TI](https://guiadeti.com.br/)!

Com a ampliação do projeto, o Guia de TI estará oferecendo ainda mais cursos, notícias, mentorias, vídeos e muito mais para ajudar os profissionais de tecnologia a estarem sempre atualizados e preparados para as tendências e desafios do mercado.

## 6º Edição do Guia de TI

Ainda não baixou a ultima edição do Guia de TI? [Clique aqui](https://download.guiadeti.com.br/) e faça o download!

O post [Guia de TI é selecionado para o programa Microsoft for Startups Founders Hub](https://guiadeti.com.br/guia-de-ti-e-microsoft-for-startups-founders-hub/) apareceu primeiro em [Guia de TI](https://guiadeti.com.br).
6 Software Engineering Lessons I Wish I knew when I was 20
Tags: beginners, software, programming, career
Published: 2023-01-17 02:55:00

In the last 10 years, I have made a lot of mistakes while developing a reliable system.

Here are 6 Software Engineering Lessons I Wish I knew when I was 20.

**1. Read atleast 3 software engineering books every year:**

Reading a book thoroughly has always helped me level up in my craft. I wish I had read following books earlier:
-SICP
-Designing Data Intensive Applications
-The Joy of Clojure

**2. Go deeper into the language you are using at work:**

To scale up our servers cost-effectively, I had to go deeper into the NodeJS engine and understand how it works. It was the best decision I made. The more you know, the better you can evaluate their strengths and weaknesses.

**3. Consistently pair with your fellow developers:**

I was always hesitant to do it earlier. Because I wanted to be perceived as a better programmer than I actually was. Getting rid of the ego and willingness to take the hits from others helped me actually be better at it.

**4. Start by writing the unit tests:**

To appreciate the value of unit testing, you need to grunt your way through and write those tests. It enabled me to refactor your code with no fear, hence improving your codebase in the long run.

**5. More experience you gain, the better you will be as a software developer:**

I was intimated by other programmers. They saw bugs in my code that I didn't. After 10 years I realized the best engineers have the right mix of learned knowledge and real-world experience.

**6. Educate others about what you have learnt:**

The best way to learn is to teach. I was forced into it when the startup I worked for started growing and I had to teach new recruits about our existing stack. The earlier you start giving back and teaching, the more natural it is.

If you are in your twenties, I hope this thread helps you inculcate a few habits to be a better DevOps engineer.

Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to learn more in DevOps and Backend space, [follow me](https://dev.to/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).
Rentoor: Enhancing old photos Using AI
Tags: saas, beginners, ai
Published: 2023-01-17 02:53:45

**Unleash** the true beauty of your photos with our ***AI-powered*** image **enhancement** technology.

> Experience stunning details, vivid colors, and a whole new level of clarity with just a few clicks.

{% embed https://twitter.com/hanii986/status/1614973729016270849 %}
 

### Results

{% embed https://twitter.com/hanii986/status/1614974230600515587 %}
{% embed https://twitter.com/hanii986/status/1614974537669685248 %}
 

### Visit Us

[Rentoor](https://rentoor.vercel.app/)
Code Smell 192 - Optional Attributes
Tags: webdev, javascript, beginners, programming
Published: 2023-01-17 02:28:21

*You need to model something optional. Have you tried collections?*

> TL;DR: Collections are fantastic. And Polymorphic.

# Problems

- [Null](https://dev.to/mcsee/null-the-billion-dollar-mistake-1h1c)
- [If Pollution](https://dev.to/mcsee/how-to-get-rid-of-annoying-ifs-forever-1jfg) 

# Solutions

1. Change the optional attribute to a collection.

# Context

If you need to model something that might be missing, some fancy languages will provide optional, nullable, and many other wrong solutions dealing with [The Billion Dollar Mistake](https://dev.to/mcsee/null-the-billion-dollar-mistake-1h1c).

Empty collections and non-empty collections are polymorphic.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/a6549bd6a333574a2ba7120a74bcb974)
```javascript
class Person {
  constructor(name, email) {
    this.name = name;
    this.email = email;
  }
  
  email() {
    return this.email;
    // might be null    
  }
  
}

// We cannot use safely person.email()
// We need to check for null explicitly
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/ec3cca15f071ae1ecebb223675e0cf79)
```javascript
class Person {
  constructor(name, emails) {
    this.name = name;
    this.emails = emails;
    // emails should allways be a collection. 
    // even an empty one
    // We can check it here
  }
    
  emails() {
    return this.emails;
  }
  
  // We can mutate the emails since they are not essential
  
  addEmail(email) {
    this.emails.push(email);
  }
  
  removeEmail(email) {
    const index = this.emails.indexOf(email);
    if (index !== -1) {
      this.emails.splice(index, 1);
    }
  }
}

// we can iterate the person.emails() 
// in a loop without checking for null 
```

# Detection

[X] Semi-Automatic 

You can detect nullable attributes and change them when necessary.

# Tags

- Null 

# Conclusion

This is a generalization of the null object pattern.

# Relations

{% post https://dev.to/mcsee/code-smell-12-null-la4 %}

{% post https://dev.to/mcsee/code-smell-149-optional-chaining-jk %}

{% post https://dev.to/mcsee/code-smell-19-optional-arguments-48gc %}

# More Info

{% post https://dev.to/mcsee/null-the-billion-dollar-mistake-1h1c %}

- [Null Object Pattern](https://en.wikipedia.org/wiki/Null_object_pattern)

# Disclaimer

Code Smells are just my [opinion](https://dev.to/mcsee/i-wrote-more-than-90-articles-on-2021-here-is-what-i-learned-1n3a).

# Credits

Photo by [Levi Jones](https://unsplash.com/@levidjones) on [Unsplash](https://unsplash.com/photos/n0CTq0rroso)
  
* * *

> To iterate is human, to recurse divine

_Peter Deutsch_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
GitHub Actions + Black = Automatically Clean Python Code
Tags: programming, python, codenewbie, productivity
Published: 2023-01-17 02:22:23

A codebase that is easy to understand and navigate allows programmers to work more efficiently and effectively. Thi sis why having a clean and well-formatted codebase is crucial for the success of programmers.  Yet, ensuring that every team member follows a common standard can be difficult, which is where GitHub Actions comes in.

GitHub Actions is a powerful tool. And you can use it to automatically format code whenever changes are made to a repository. By configuring Black and other formatting libraries in GitHub Actions, you can ensure that your codebase is always consistent and easy to read. Additionally, if any formatting tasks fail, you can set up email notifications to alert you of the issue.

This post provides a step-by-step guide on how to set up automated code formatting in GitHub Actions, so you never have to worry about poorly formatted code being committed by team members again. 

If you're a Python dev, I'm sure you'll use this on a daily basis.

[Maintain Clean Python Code With Black and GitHub Actions](https://towardsdatascience.com/black-with-git-hub-actions-4ffc5c61b5fe?sk=715088977804f6e316e2594d2dc345d7)
Matrix multiplication in Python
Tags: python, programming, tutorial, shortposts
Published: 2023-01-17 01:49:54

Learn how to do matrix multiplication in Python using `@` operator. 

`@` operator is supported in Python version 3.5 and above. The operator works on ndarrays 

```python
# Matrix multiplication using @
import numpy as np
import random

# Generate a list
X = [[i for i in random.sample(range(0, 10), 3)] for i in range(3)]
Y = [[i for i in random.sample(range(0, 10), 3)] for i in range(3)]

# You can use numpy
X = np.array(X)
Y = np.array(Y)

Z = X @ Y
print(Z)

```
@Vidyasagar Machupalli
Azure SQL Cost Savings using Serverless
Tags: azure, azuresql
Published: 2023-01-17 01:03:19

One simple way to reduce your Azure SQL costs is to check your actual usage of your DBs occasionally and monitor usage.

If they fall into one of the following categories:
- Intermittent and also low usage
- Responsiveness is not critical 

You can consider switching them over to **vCore Serverless**.

Of course, there are some other factors to consider:
- As this is pay-per-usage model, if you suddenly have a surge in usage, this might exceed the costs that you were originally paying when using provisioned compute model
- After a period of inactivity/idleness, there will be some delay as it will need time warm-up before you can use
- Serverless option is only available on the **General Purpose** service tier
  
Another reason to consider Azure SQL Serverless is that ability to **auto-scale** compute power. This is useful for scenarios where sudden spikes in workload activity are expected. This can also be done by **manual scaling** in the provisioned model, however it can get considerably more expensive. 

Also, according to [official Microsoft docs](https://learn.microsoft.com/en-us/azure/azure-sql/database/migrate-dtu-to-vcore?view=azuresql), every 100 DTUs is equivalent to roughly 1 vCore.

![DTU to vCore conversion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frzehp6h2emyfx8a355n.png)

At time of writing, in terms of costs,

> 200 DTUs = 2 VCore = $294.37 per month
> 2 VCores (Serverless) is roughly around $0.01 per second / $0.60 per min / $36 per hour (Hence will get around 8 hours of 2 VCores)

Hence if your workload only requires 2 VCores for < 8 hours per month (And assuming no other workloads), then it will cost less.


Ultimately, I think it is best to try both models to be able to accurately gauge which model is best for cost-savings. Run each model for a month/months to compare.

Both models can easily be interchangeable at any time via the Azure Portal, hence this is worth the try.


Official documentation to learn more:
https://learn.microsoft.com/en-us/azure/azure-sql/database/serverless-tier-overview?view=azuresql
Vue CLI Guide
Tags: webdev, vue
Published: 2023-01-17 01:02:29

##Vue CLI Overview 
Vue CLI is the easiest way to build a new Vue app.
It provides:
- a command-line utility for you to choose build tools
- official plugins
- runtime dependency built on top of webpack with sensible defaults

<br>
<hr>

##Installation & Update
Run one of the following commands.
> Vue CLI 4.x requires Node.js version 8.9 or above. Manage multiple versions of Node with nvm.
```
$ npm install -g @vue/cli
# OR
$ yarn global add @vue/cli
```
Check if you did it right↓
```
$ vue --version
```
To upgrade the global Vue CLI package, run↓
```
$ npm update -g @vue/cli
# OR
$ yarn global upgrade --latest @vue/cli
```

<br>
<hr>

##Creating a Project

To create a new project, run↓
```
$ vue create <project name>
```
and you'll be prompted to pick a preset. You can either choose the default preset or select "Manually select features" to pick the versions and features you need.

<br>
<hr>

##Troubleshooting
### Vue command not found error after installation
#### a. Uninstall vue/cli and install it again<br>
(and then restarting terminal recommended)
```
$ npm uninstall -g @vue/cli
# OR
$ yarn global remove @vue/cli
```
If the globall installation fails, try running command with prefix 'sudo'.
```
$ sudo npm uninstall vue-cli -g
$ sudo npm install -g @vue/cli
```

#### b. Uninstall and install node again with the right version

check installed node version↓
```
$ node --verison
```
[How to uninstall Node.js completely](https://codedamn.com/news/nodejs/how-to-uninstall-node-js)


#### c. Add PATH environment variable
Run following command to see where npm puts your globally installed packages.
```
$ npm config get prefix
```
```
# output example(windows)
# C:\Users\{UserName}\AppData\Roaming\npm
```
Check if your operating system has the PATH environment variable. If not, add the path you got from the command above.

#### How to add PATH environment variable on WINDOWS

Open command promt(windows key + R) and run command↓
```
$ set
```
It will show you PATHs added to your OS. Try update it on Windows Control Panel.
> Control Panel > System and Security > System > Advanced system settings > Environment Variables...
![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rd8qfbyf69iwakop4900.png)

- [How to add PATH environment variable on LINUX](https://phoenixnap.com/kb/linux-add-to-path)
- [How to export PATH to ~/.bash_profile](https://stackoverflow.com/questions/40317578/yarn-global-command-not-working)

<br>
<hr>

###Sources
https://cli.vuejs.org/
https://bobbyhadz.com/blog/npm-command-not-found-vue
Get notified when there are commits to pull in VS Code
Tags: vscode, programming, tutorial, productivity
Published: 2023-01-17 00:39:59

With the help of GitLive’s new pull reminders, you can now pull sooner, reduce the chances of conflicts, and merge faster!

Get notified the moment your remote has been updated and there are commits to pull from your tracking branch. 

![Tracking branch notification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqrgj5prfr4hw9nklzkx.png)

We'll even notify you on falling behind your base branch (the branch you plan to merge your changes back into once you're done), we figure out your base branch by checking the git reflog to see which branch you originally branched off when you created your current branch. 


![base branch notification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ag11rkr3onymfdndusxw.png)

It's not always possible to tell where you branched from in the local reflog, in these cases we'll assume it was your default branch if possible, otherwise, we'll just ask you to pick one. In any case, you can easily change the base branch by clicking *Change base* on the notification.


![change base notification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ccl7mw31i6rhkn9sbknj.png)

You can also select *No base branch* to suppress notifications for your root branch (typically your main/trunk branch). Once the relationship between your branches is correctly set, you'll be notified when you are behind any branch in the chain of bases up to your root branch.

<sup>
  💡 <b>Example:</b> If you follow a <i>GitFlow</i> style branching strategy with main and develop branches, and your current feature branch was branched off develop, you'll not only be notified if your branch is behind develop but also if develop is behind master.
</sup>

Finally, you can click *Show changes* on the notification to open the **repository view** where you can inspect the changes in the branches you are behind.

![show changes notification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/54ckuopjhd2i913l06jq.png)

The repository view also shows all the remote feature branches ahead, in terms of commits, of your current branch, check out this article to learn more:

{% embed https://dev.to/gitlive/see-how-others-changes-compare-to-your-own-in-vs-code-1fl7 %}


***

Don't have the GitLive extension installed yet? You can find it [here](https://marketplace.visualstudio.com/items?itemName=TeamHub.teamhub), and if you want to learn more about the latest release, check out [this blog post](https://blog.git.live/GitLive-16.1-get-notified-when-you-fall-behind-the-remote-and-more-new-features).
6 Google Chrome extensions 🔥 that'll help you turn hours of work into minutes free 💯
Tags: codequality, webdev, programming, devops
Published: 2023-01-17 00:20:33

- Working with Chrome offers access to an immense repository of Chrome extensions and tools which make our daily tasks less of a chore.

- The following are the top 6  Google Chrome extensions that will help you do your job.


Happy working

🎥 {% youtube ZadRYU_bZD8 %}


####Bonus

#### Web developers tools 🛠️ you need to know💡👩‍💻

🎥 {% youtube lj4ZBJbV5yk %}

#### 7 programming 👩‍💻 tools 🔧 you should be using in 2023🎏

🎥 {% youtube djONtv0TM_E %}

#### 5 websites will make you a smarter 🏆 developer👩‍💻 

🎥 {% youtube LgkcEWC6uKY %}


### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)