teleren/devto huggingface dataset:
Whether NodeJS is right platform for your WebAPIs ?
Tags: javascript, node, beginners, microservices
Published: 2020-04-08 19:04:10

Javascript is the language for NodeJS platform which is native to all front-end developers, Hence it enables many developers to write server side code without going through additional OR with minimal learning curve. Many developers who have just entered the software development world (A warm welcome to them :) ) find it easy to learn and code in javascript. However NodeJS is not the last bar in server side development.

I personally like the simplicity of NodeJS, I am a big fan of it's package management system and managing project dependencies. These simplicity comes with a cost. Its not bad but it can be, if one is not aware of below important NodeJS concepts.

![Javascript runtime](https://dev-to-uploads.s3.amazonaws.com/i/4wmkaexr2ojsxedxszv3.png)

##Single Threaded
The javascript code whether in browser/nodejs executes on one single main thread called as Event loop. So it means that while the javascript code is in execution (For example : A long running while loop) no other parts of your application will be able to run at that time, Not even callbacks like event handlers or ajax callbacks etc. Every such callbacks ariving that time will be queued to internal Message Queue and will be processed one after another based on their arrival. If the main thread is idle and a message arrives in a message queue (basically a notification to execute a callback), [v8](https://nodejs.dev/the-v8-javascript-engine) will execute it on main thread with right context. This is how a callback function remembers the enclosing lexical scope..... closures.

##Non Blocking asynchronous I/O
A callback function is provided while instructing NodeJS to perform I/O operation (Reading/Writing a file, Socket operations). The actual I/O operation performs on the background thread called as worker pool, while it happens, V8 further continues to execute your remaining part of function. If there is no javascript code to further execute and I/O is still in process then we say that main thread blocked.
While a thread is blocked working on behalf of one client, it cannot handle requests from any other clients.

##CONCLUSION
So this means that in a NodeJS web server scenario your web application runs on a single thread and if a request takes time to execute then this will result in very poor performance because it will make other requests to wait until current request execution is finished. It becomes very important that you shouldn't do too much work for any client in any single callback or task. Every request should be completed very fast. This is the reason why NodeJs can scale well, but it also means that you are responsible for ensuring fair scheduling.

If the code that is written on NodeJS platform is going to take more time or CPU then one should think, Whether NodeJS is right platform for your WebAPIs?
O que é Algoritmo?
Tags: algoritmo, iniciante, programacao, logica
Published: 2020-04-08 18:58:27

Escrito por [Danielle Clericuz](https://www.linkedin.com/in/danielle-clericuzi/) especialmente para o [Elas Programam](https://dev.to/elasprogramam)

Quando escutamos a palavra algoritmo de cara pensamos em algo complexo, milhões de telas, códigos, etc e tal. A gente usa algoritmo o tempo todo, de forma tão intuitiva e automática, que nem percebemos! Sério! Uma receita de bolo, os passos para atravessar a rua e trocar uma lâmpada, são exemplos de algoritmo. É isso mesmo! 
O conceito de algoritmo vai muito além da programação. O algoritmo pode ser descrito como uma sequência lógica, finita e definida de instruções que devem ser seguidas para resolver um problema ou executar uma tarefa. Então, olha aí o algoritmo para trocar uma lâmpada:

1 – Pegar uma escada;
2 – Posicionar a escada debaixo da lâmpada;
3 - Buscar a lâmpada nova;
4 – Subir na escada;
5 – Retirar a lâmpada velha;
6 – Colocar a lâmpada nova.

Claro, iremos nos deparar com situações bem mais complexas no nosso dia a dia, mas por que não começar com algo mais simples? No caso da computação, uma soma de dois números é o exemplo mais clássico de um algoritmo simples e, que envolve os mesmos elementos: entrada de dados, processamento e saída.
Precisamos quebrar esse mito de que mulheres não são boas em exatas!

Bora estudar mais sobre Algoritmo e Lógica de Programação? Seguem links de cursos sugeridos por mulheres que fazem parte do grupo [Elas Programam](https://www.facebook.com/groups/elasprogramam/):

####Introdução a Algoritmos: [Curso em Vídeo do Gustavo Guanabara](https://www.cursoemvideo.com/unit/curso-de-algoritmos-01-introducao-a-algoritmos/)

####Lógica de Programação: [SENAI](https://www.ead.ms.senai.br/cursos/iniciacao_profissional/?c=L%C3%B3gica_de_Programa%C3%A7%C3%A3o&id=11&fbclid=IwAR0gvEv8ThhYoyCFGSsqnXJ-B2wKusx7umM10nXK2zuR3hRNWFYNuJ0VyBk)

####Lógica de Programação: [NodeStudio](https://www.nodestudio.com.br/curso/curso-de-logica-de-programacao?fbclid=IwAR2RAuZ2tanJX9BXaKPpaBFSMbymvkrwv6Ljz2l76c4M2rL3MgT9deYVSW8)

####Fundamentos de Lógica de Programação: [Fundação Bradesco](https://www.ev.org.br/curso/informatica/desenvolvimento-de-sistemas/fundamentos-de-logica-de-programacao?return=/cursos/informatica)

####Logica de Programação: [Prime Cursos](https://www.primecursos.com.br/logica-de-programacao-basica/)

####Introdução à Lógica (legendas em Português): [Coursera](https://www.coursera.org/learn/logic-introduction)

E ó! Não esqueçam: “Não faça todos. Escolhe um e faz muito bem feito. Depois  pratique com exercícios de matemática aplicada, projetos pessoais e aos poucos vá construindo seu portfólio”

Caso tenham mais dicas e sugestões, fiquem à vontade para deixar links nos comentários.
Data Gurus: What's your Take on this..!
Tags: aws, beginners, datascience, help
Published: 2020-04-08 18:53:37

As part of my course work at my university and organizations demanding knowledge of AWS, I have started learning AWS Architecture from scratch. Being into analytics program and targeting Data Analytics positions for career ahead I am now confused should I be going with the Solutions Architect first or directly dive into the Machine Learning services.


***To all the Data scientist's with AWS expertise ,what's your take on this.***
Cooking in quarantine? Check out this Twilio recipe finder!
Tags: twiliohackathon, showdev, javascript
Published: 2020-04-08 18:49:58

## What I built
With a growing populace "sheltering in place" and restaurants closing their doors temporarily, the need for home cooking is on the rise and if you're anything like me, you are lacking inspiration. That is why I decided to help myself out with a recipe finder! Simply send a text to +1 (202) 952-8194 with a comma separated list of ingredients and receive delicious recipes. If only Twilio could cook the meals too...

![Example Interaction](https://dev-to-uploads.s3.amazonaws.com/i/34t0qs77uktqufvlt9uh.PNG)

You can also send a number as the last parameter to specify how many recipes to bring back (e.g. Carrots, potatoes, 7). **Keep in mind**, each recipe will be a separate text message and contain an image.

## How I built it
I wrote the project in NodeJS and it is currently hosted on Heroku. I utilized Twilio's programmable SMS API as well as the [Spoonacular recipe API](https://spoonacular.com/food-api).

**[Here's the source code.](https://github.com/austincrim/dev-to-twilio)**
FYI, I'm currently working through an issue where Twilio is slow to post my message to my app. This causes intermittent delays in the recipe response. Thanks for understanding!

Let me know what you think in the comments!
Vs Code Extension
Tags: 100daysofcode, javascript, learning, vscode
Published: 2020-04-08 18:34:20

---
title: Vs Code Extension
published: true
description: Converting JS code to class
tags: #100daysofcode, #JavaScript, #Learning, #vscode
cover_image: https://miro.medium.com/max/2400/1*aLEReyihZv-VHmnAjCbQxg.jpeg
series: 100 Days of Code
---


Today I spent time updating the code from JS file to Class Format. The update is partially done. I will be continuing this tomorrow. You can check full code in Repo as well.

```javascript
const vscode = require("vscode");

const pomodo = class Pomodoro {
  constructor(context) {
    this.vsCodeStatusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment["Right"], 10);
    this.context = context;
  }
  startPomodoTimer() {
    this.vsCodeStatusBar.text = "Pomodo Started";
    this.vsCodeStatusBar.show();
    this.startWorkTimer();
  }
  appendZero() {
    this.num <= 9 ? "0" + this.num : this.num;
  }

  updateStatusBar(min, sec, icon) {}

  timer(countDownTime, callEverySecond = null, counterisDone = null, icon = null) {
    let countDownTimer = countDownTime;
    let that = this;
    let timerId = setInterval(function () {
      countDownTimer -= 1000;
      let min = Math.floor(countDownTimer / (60 * 1000));
      let sec = Math.floor((countDownTimer - min * 60 * 1000) / 1000);

      if (countDownTimer <= 0) {
        clearInterval(timerId);
        if (counterisDone) counterisDone();
      } else {
        that.vsCodeStatusBar.text = icon + " " + this.appendZero(min) + " : " + this.appendZero(sec);
      }
    }, 1000);
  }

  startWorkTimer() {
    const pomodoCountDown = 5 * 60 * 1000;
    const tomatodIcon = "🍅";
    this.timer(pomodoCountDown, this.updateStatusBar, this.startRestTimer, tomatodIcon);
  }

  pomodoDone() {
    this.vsCodeStatusBar.text = "Pomodo Done!!!";
  }

  startRestTimer() {
    const restCountDown = 1 * 60 * 100;
    const restIcon = "🌴";
    this.timer(restCountDown, this.updateStatusBar, this.pomodoDone, restIcon);
  }
};
exports.pomodo = pomodo;

```
Best ETL Tools for Data Warehousing
Tags: datascience
Published: 2020-04-08 18:27:02

#Choosing an ETL Tool

[The ETL](https://hevodata.com/blog/what-is-etl-tool/) (extract, transform, load) process is the most popular method of collecting data from multiple sources and loading it into a centralized data warehouse. During the ETL process, information is first extracted from a source such as a database, file, or spreadsheet, then transformed to comply with the data warehouse’s standards, and finally loaded into the data warehouse.

ETL is an essential component of data warehousing and analytics, but not all ETL software tools are created equal. 

Here is a list of top 8 ETL tools for 2020 to help you make the right choice.
1. [Informatica PowerCenter] (https://www.informatica.com/products/data-integration/powercenter.html)
2. [IBM InfoSphere DataStage] (https://www.ibm.com/products/infosphere-datastage)
3. [Hevo Data] (https://hevodata.com/?utm_source=best_etl_tools&utm_medium=click&utm_campaign=dev_to_posting)
4. [Talend] (https://www.talend.com/)
5. [Pentaho](https://www.hitachivantara.com/en-us/products/data-management-analytics/pentaho-platform/pentaho-data-integration.html?source=pentaho-redirect)
6. [AWS Glue](https://aws.amazon.com/glue/)
7. [StreamSets](https://streamsets.com/)
8. [Blendo](https://www.blendo.co/)

[Read more about each of these ETL Tools here](https://hevodata.com/blog/best-etl-tools-data-warehouse/).
Going multi-region
Published: 2020-04-08 18:13:29

I recently shared a high level idea, on the infrastructure needed to evolve a single-region system into a multi-region system. This is a bit abstract, but I wanted to share this with you, to illustrate one of the most important system design principles I employ: pushing complexity down the stack.

So, say you want to move your system to a multi-region system. What would you need to do to evolve that system?

## 1. You need a multi-region deploy train

In a service’s configuration, the service owner should be able to write regions they can deploy to

```
    {US-East, US-West, China, Sweden}
```

Then, the deploy train should be able to deploy to all regions

To do this, you need deployment infrastructure which takes this configuration and can reserve and update machines in all regions. 


## 2. You need a multi-region DNS service

A service owner should be able to make a request out to another service, by some url: 

```
curl service-b.internal-dns
```

Once the request is made, the DNS service should find a machine that’s geographically closest to the origin request. It needs to be able to handle failures, and find different machines if that is the case

To do this, you need infrastructure for service routing. This should be a tool that lets a service owner associate specific machines to a route, and allows them to set specific rules: things like default timeouts and failover behaviors.

This infrastructure should come with a library available on all system languages, which lets them send requests.

## 3. You need a distributed database

A service owner should be able to create tables and specify: where the source of truth should live, privacy rules, and compliance rules. The database should expose a friendly API that abstracts away how it fetches the data, as well as how it determines privacy and compliance rules.

To do this, you first need to introduce a database like cassandra or spanner. After that you likely also need to add an extra layer of infrastructure on top, to abstract away privacy and compliance rules.


----------


If you have these three pieces of infrastructure, you can begin to migrate leaf services with significant velocity. **A key thing to notice: much of the leg work is done by infrastructure**. Pushing complexity down the stack is what will allow you to scale your organization. It can be easy to leave much of this complexity in the product domain. If you do this, you will slow down every product engineer, and force them to have enough context to make significant system decisions for most changes. It will also leave your infrastructure engineers scrambling to manage and maintain numerous esoteric solutions, which were brought up in product land and now need to be maintained. By managing most of the complexity with your infrastructure, your product engineers can focus and maximize their impact with product, and your infra engineers can maximize theirs by empowering the whole company.

*Thanks to Daniel Woelfel for reviewing drafts of this essay*
The difference between code and magic 🧙‍♀️🧙‍♂️
Tags: showerthoughts
Published: 2020-04-08 18:11:51

I've been listening to the Harry Potter audiobooks, as one does.

There is a plot point in _Harry Potter and the Deathly Hallows_ where Harry is counting down the days until he turns 17 when he is no longer under surveillance for use of under-age magic. It's a spell the magical community places on young magicians to maintain law and order, and perhaps a bit of Orwellian control.

There is a moment where Ron wishes Harry "happy birthday" early in the morning, and it immediately clicks to Harry that he can now use magic without detection! (They are currently on the run from Death Eaters so this is important).

Harry immediately casts a spell in celebration.

![](https://media.giphy.com/media/144waw4kQiQVgY/giphy.gif)

Me, the software developer, not being able to help myself, gets nervous. I literally think to myself "What if the curse is time zone sensitive, what if it's based on UTC, what if Harry was born later in the day and he hasn't actually hit 17 yet? What about leap years? Why doesn't Harry leave himself a buffer of certainty before casting a needless spell!"

And then I think to myself "that's not how magic works at all, that's how computers work." Technology and magic are not too different a lot of the time, but this is a significant distinction: Magic works _as intended_. Technology works as built.

In general, if Harry is 17, for all intents and purposes, the spell will be lifted. That's just how the universe works. When a spell doesn't work as intended, it's likely because the castor isn't capable of expressing their intentions effectively. This is why focus and nuance are such an important thing when casting. But when a wise witch or wizard casts a spell, it's going to work to their intentions.

Code just works how it works, we have off-by-one errors, we have time zones, we have string interpolation, we race conditions. Code does what it was built to do, but it's not magic, it doesn't just work _as intended_. No amount of wisdom makes code work as intended unless it is meticulously crafted to work this way. The closer it is to work as intended without the burden of edge cases, the closer it is to magic, but our code will never have the kind of guarantees of effectiveness that magic does. That's the deal.

![](https://media.giphy.com/media/w2b1p2huzDktO/giphy.gif)

Happy coding 🧙‍♀️🧙‍♂️
A dev on UX
Tags: ux, productivity
Published: 2020-04-08 18:04:47

So I've been working with IntelliJ (sadly on Windows) and I've got so angry when once more shifting focus made me mess up code and build to fail in 3 seconds window.

What happens is that I click Run for Spring Boot application while having my Terminal in Intellij opened. For some reason it takes about 3 seconds to start the process and meanwhile I'm writing some commands like "git add ." where my lovely tool switches focus to some file, so I'm typing "git ad" to console and "d ." into code and Intellij switches to tab Run/Debug then to Build and shows crash log because my file contains "d ." in middle of the code.

Now I instantly reported this as a bug on their tracker because it reeeeeeeeaaaaally pi*e* me of. And they are quite good compared to others. Imagine starting installer, putting it into background, writing code and stuff, refactoring things in code with famous Ctrl + F6 and all of a sudden instead of hitting Enter/Return on "Rename" you hit it on installer window asking you to accept all for installing McAfee, toolbar for your non existing IE, some stuff from 95, spyware for government, cookies for your grandmother, child support for other peoples kids and so on.

Really? A lot of installers wont do this but why is it even possible to make such app that steals focus? Have people not been multitasking lately with 11293810 core leaving stuff to run in the background instead of "You must wait until other installers finish!" message from half-core CPU times?? 

Who thought every software is so special and important that they need to blast you as a pop-up before Opera or before ad-blockers on other browsers? Why oh why would anyone do this? Blinking light in the taskbar or notification popups in specific corner are not good enough for snoflware software so OS just allows it to torture me?

Dear UI/UX people please talk with other people that will actually use software, see their experience, stop assuming your building most important thing and just make everything so important that it steals your focus.

Now a lot of things are amazing, great, and surprise me how well are they done and thought through when it comes to UX but some of the stuff make me write these kinds of posts.
Coding like a sick for none
Tags: mentalhealth, cms, welcome
Published: 2020-04-08 17:56:46

Hi all.

This is my first post.

I am Spaniard/Catalan/Whatever (human in the end), so sorry for my English.


I want to create a damned CMS (which stands for Content Management System) in Node.js and MySQL.

I am creating little modules for **npm** to compose a little framework to create and manage web applications. My stack is Node.js + Express + MySQL.

I have calculated around 20 APIs needed to do this.

The framework will be released under WTFPL. This means What The Fuck Public License. So, for anyone, to anything.

If someone helped me, we maybe can do something cool for the world.

I know, I know, "*there are too much CMS already, why do you reinvent the wheel?*".

Well, none is enough simple and flexible to let you know exactly and play with how code is written. This one is to do that.


I am not asking for help, but yes.

I have been wanting to create a CMS since... I knew what was that badword, like 8 years ago. All I got was doubts and unconfidence, it is not easy to know exactly what to do and how when you create a CMS.

This is my Github profile.

[https://github.com/allnulled](https://github.com/allnulled)

My other dream was a full-featured and futuristic (given the state of the art) programming language that resembles to natural language, but writes JavaScript under the hood. I did it, but the big companies are into profit and money and markets and slavery, and they did not even answer (Microsoft, Google, IBM, Intel, Oracle). Okay, I do not want to remember this episode of my life, in which logic and language met each other, but nobody appreciated the effort, nor the achievement. Okay, to another thing, the world urges logic, but I am not the one to give it to them.

CMS, who wants, please, tell me something.
Don't aim for 'Senior'
Tags: devlive, career, discuss, productivity
Published: 2020-04-08 17:55:06

Something to think about and discuss.

- No one really knows what senior means.
- Time doesn't mean better.
- Who's to judge?

What should be the aim?

I think its adaptability and being able to problem solve best (and the best problem solving is avoiding it all together).

Your thoughts?
Variables names don't need their type
Tags: datascience, python, discuss
Published: 2020-04-08 17:36:50

So often I see a variables `type()` inside of its name and it hurts me a little inside.  Tell me I'm right or prove me wrong below.

## Examples

Pandas `DataFrames` are probably the worst offender that I see

``` python
# bad
sales_df = get_sales()

# good
sales = get_sales()
```

Sometimes vanilla structures too!

``` python
# bad
items_list = ['sneakers', 'pencils', 'paper', ]

# good
items = ['sneakers', 'pencils', 'paper', ]
```


## Edge Cases?

It's so common when you need to get inside a data structure in a special way that itsn't provided by the library.... I am not exactly sure of a good way around it.

``` python
# bad ??
sales = get_sales()
sales_dict = sales.to_dict()

# good
🤷‍♀️
```

## Containers are plural

Always name your containers plural, so that naming while iterating is simple.


``` python
prices = {}
items = ['sneakers', 'pencils', 'paper', ]
for item in items:
   prices[item] = get_price(item)
```

Before I start fights 🥊 in code review, am I inline here or just being pedantic? 

## 👇 NOW DISCUSS
I don't want to be a developer (ish)
Tags: watercooler
Published: 2020-04-08 17:29:28

⚠️ Disclaimer, I'm drunk.

Okay let me level with you, growing to retirement age I'm going to code until I'm dead and write some AI to live on when I'm gone that can atleast carry on my work.

I started my career from a failing fine art degree, where creating my website was far more interesting than any paintings I was working on, I have come along way from a 18 year old winging it to a nearly 30 year old with some wisdom behind me.

The thing is I am rather shockingly good at 3D art and I suppose that comes from the occasional practice over the same period of time I have been developing.

Let's get to the point already, I wish I had the time and financial security to make a go of 3D artwork but the truth is I don't, I need to keep programming. What is your hidden talent? Can you show me?
DotNet OpenSource Days-2
Tags: dotnet, opensource, conference, showdev
Published: 2020-04-08 17:09:06

Will we see you on Apr-17-2020? 

[RegisterNow](https://www.eventbrite.com/e/dot-net-open-source-days-virtual-conference-tickets-101833546880)

Join us on April-17-2020 at the first virtual version of DotNet Open Source Days.

We are excited to have Chris Woodruff do the keynote on "Embracing your Renaissance Man (or Woman) in the Digital Age".

Whether you are CodeNewbie or experienced professional everyone has something to learn from this virtual conference.

Check out the great line up of speakers.

![DotNet Open Source Days Speakers](https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F97899224%2F188658796555%2F1%2Foriginal.20200402-212624?h=2000&w=720&auto=format%2Ccompress&q=75&sharp=10&s=3c8bc6caefeffbc19925501e0ff4d34b)

Check out the [website](https://www.dotnetopensourcedays.com/) for updated schedule.