teleren/devto huggingface dataset:
Mysterious JavaScript Part-I: Synchronous Js
Tags: javascript, webdev, beginners, codenewbie
Published: 2020-07-10 15:12:36

Learning is fun. Well, I think it should be written like **"Learning is fun🥱😒"**
I don't know who said this but to me, learning is anything but fun. Imagine learning one of __JavaScript's mysterious topics like synchronous & asynchronous programming__😫😫 
Could it be any harder?
Well, don't worry. __I will try my best to explain some of the inner workings of javascript in a simple way__ so that you don't have to take the hard path. Join me!👯‍♂️ 
(Quite a marketing pitch, huh?😎😎) 

##Evolution of JavaScript
**JavaScript evolved so much so that it sometimes feels like a different programming language** that we used to know.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ho7ngxy8t38xms08qc5t.jpg)
While this is a good thing, it sometimes can create confusion. One such confusion- **Is JavaScript Synchronous or Asynchronous?**

##JavaScript is Synchronous
Yaay! The truth has been revealed😜. JavaScript at its core- a single-threaded, synchronous language. That basically fancy way of saying- **JavaScript does one operation at a time.**
While one operation is on run, others stay stand still and wait for their turn. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y07ezcj2wmtqmgg29jna.jpg)
I hear you saying, what if I try to break this traditional way of executing things? I am glad that you ask. But I believe, in this case, the ladies have the answer😝😜
**Protip: If you want to die sooner, come India and try breaking a line like this (referring the image).**

##Example
Let's assume that I have three sentences to log in console-

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1osmf1jj33bpvjd2zbu0.png)

I would get output like this-

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k408j1aeictii5114n0m.png)

The output will be in sequence. JavaScript shows output in sequence.

Hence, if I were to change the sequence of the log- 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wq8wo4blpvlqls4rn2zq.png)

the output sequence will also be changed-
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cpobpwwm03wjx5ugbcs4.png)

The point is, **JavaScript logs the outputs in a specific order** So,  changing the order changes the output sequence too. The execution order is tracked & strictly maintained.

Well! Now, the important question- **How does JavaScript keep track of this sequence?** I mean, we need someone to play the managerial role, right? The manager keeps the rules in place & makes sure that the functions are executed in proper order. **Who is this manager?**

This million 💲💲💲 question will be answered in the next part. So stay tuned 😍
(images are from unsplash and timesofindia)
A great feature in C# 9.0 (Simplified Parameter Null Validation)
Tags: csharp, dotnet, news
Published: 2020-07-10 15:11:40

Well, as C# advances, some features are been more simplified inside the language. One common problem that beginners programmers have is how to deal with nullable variables.

In the first versions of C# language, validate null values were very explicity when I was coding, eg...

```csharp
public static void Main()
	{
		string Name = null;
		if(Name == null)
			throw new NullReferenceException
			("Error, the name is null");
	}
```

After version 4.0 of .Net Framework, C# has gain some other interesting options to use. eg...

```csharp

public static void Main()
	{
		//Using ?? Operator
		string Name = null ?? "Undefined";
		Console.WriteLine(Name);
		
		Name = null;
		
		//Using String Extension Mehtods
		if(String.IsNullOrEmpty(Name))
			throw new NullReferenceException
			("Error, the name is null or Empty");
		
	}

```

But now with C# 9.0, I can simplify all of this with the !! Operator like:

```csharp

public static void Main()
	{
		string Name = null;
		ManipulateString(Name);
		OtherManipulateString(Name)
	}
	
	//Using new ! Operator to throw exception
	public static string ManipulateString(string s!)
	{
		return s + " is a Valid string";
	}
	
	//Using new !! Operator to substitute null to other things like "" (probably)
	public static string OtherManipulateString(string s!!)
	{
		return s + " is a Valid string";
	}

```

although it is too early to validate whether it will be interesting to use this operator, in fact, it seems an interesting option to consider, despite not making it so explicit in the code, the economy of lines of code may be surprising.

Useful links:
http://www.macoratti.net/20/02/c_versao9.htm
https://www.infoq.com/news/2020/06/CSharp-9-Null/
https://www.c-sharpcorner.com/article/null-value-and-null-reference-handling-c-sharp6-to-c-sharp-9-new-features-day-1/
New Here!🙌
Tags: newbie, blog, react, pwa
Published: 2020-07-10 14:55:07

**Hi DEV community,**
I'm new here and hoping to share my work, experiences and ideas as well as learn from you all. I've been reading and love a lot of the work and experiences that is shared on DEV.

In the spirit of sharing, I will share a recent project that I worked on: Rebuilding my personal site. My writing is mostly poetry and prose but getting into writing about my programming work.

## Learning goals:
1. Apply React.js to a Web project
2. Make the website a Progressive Web Application
3. Use Contentful to deliver blog posts

## [Working Site](https://laudebugs.me/laudebugs.me/#/):
![Current Website Version](https://dev-to-uploads.s3.amazonaws.com/i/8b5y9g9dc8kcsl2bjku5.png)

Still working on the home page animation and adding a few perks. 

Feel free to give me feedback!
REST API and caching?
Tags: webdev, devops, help, restapi
Published: 2020-07-10 14:55:00

If I use GET requests for ones with dynamic database calls, will it be **over-cached**?

Or, does it depends on response code, e.g. other than 200, no-cache?

How do I enable caching in the first place? Another new database just for caching?

Lastly, can POST requests be cached? (Because, sometimes, supposedly GET requests would have a too big querystring.)
When to use const and when not?
Tags: react, javascript, webdev
Published: 2020-07-10 14:49:03

Why prefer-const
One Way to Do It: It is mental overhead to have to choose between let and const every time. A rule like “always use const where it works” lets you stop thinking about it and can be enforced by a linter.
Reassignments May Cause Bugs: In a longer function, it can be easy to miss when a variable is reassigned. This may cause bugs. Particularly in closures, const gives you confidence you’ll always “see” the same value.


Learning About Mutation: Folks new to JavaScript often get confused thinking const implies immutability. However, one could argue that it’s important to learn the difference between variable mutation and assignment anyway, and preferring const forces you to confront this distinction early on.


Meaningless Assignments: Sometimes, an assignment doesn’t make sense at all. For example, with React Hooks, the values you get from a Hook like useState are more like parameters. They flow in one direction. Seeing an error on their assignment helps you learn earlier about the React data flow.
Performance Benefits: There are occasional claims that JavaScript engines could make code using const run faster due to the knowledge the variable won’t be reassigned.


Why Not prefer-const
Loss of Intent: If we force const everywhere it can work, we lose the ability to communicate whether it was important for something to not be reassigned.


Confusion with Immutability: In every discussion about why you should prefer const, someone always confuses with immutability. This is unsurprising, as both assignment and mutation use the same = operator. In response, people are usually told that they should “just learn the language”. However, the counter-argument is that if a feature that prevents mostly beginner mistakes is confusing to beginners, it isn’t very helpful. And unfortunately, it doesn’t help prevent mutation mistakes which span across modules and affect everyone.


Pressure to Avoid Redeclaring: A const-first codebase creates a pressure to not use let for conditionally assigned variables. For example, you might write const a = cond ? b : c instead of an if condition, even if both b and c branches are convoluted and giving them explicit names is awkward.


Reassignments May Not Cause Bugs: There are three common cases when reassignments cause bugs: when the scope is very large (such as module scope or huge functions), when the value is a parameter (so it’s unexpected that it would be equal to something other than what was passed), and when a variable is used in a nested function. However, in many codebases most variables won’t satisfy either of those cases, and parameters can’t be marked as constant at all.


No Performance Benefits: It is my understanding that the engines are already aware of which variables are only assigned once — even if you use var or let. If we insist on speculating, we could just as well speculate that extra checks can create performance cost rather than reduce it. But really, engines are smart.
Introduction to Clojure Ring
Tags: clojure, functional, tutorial
Published: 2020-07-10 14:43:23

This is an introduction to clojure ring. Ring is a low level library that makes it possible to build web servers, it's important to understand the internals of this library as most, if not all other web frameworks in clojure is built on top of Ring.

{% youtube 3AWXM8CN6FA %}

## Included in video
- Project setup with deps.edn
- VS Code Calva editor integration
- Setting up a ring server
- Explanation of middleware usage with ring

## Resource Links
- [Ring](https://github.com/ring-clojure/ring)

## Follow and support me
- [YouTube](https://www.youtube.com/c/kelvinmai)
- [Twitter](https://twitter.com/kelvinmai)
- [Patreon](https://www.patreon.com/kelvinmai)
SSL/TLS Vulnerabilities
Tags: security, testing, webdev
Published: 2020-07-10 14:36:14

Transport Layer Security (TLS) is a security protocol that provides authentication, privacy, and data integrity. It is most widely-deployed and used for web browsers and other applications. 

TLS is the successor protocol to SSL. These cryptographic protocols have had their own share of flaws like any other technology. 

So, it is important to understand the flaws in order to secure your servers. Some of the SSL/TLS vulnerabilities are:

**POODLE ATTACK**

In the Padding Oracle On Downgraded Legacy Encryption (POODLE) attack, an active MITM attacker can force a browser to downgrade the session to SSLv3, which can then be exploited. The vulnerability affects TLS implementations that don't properly check the structure of the padding used in TLS packets.    

**FREAK  ATTACK**

Factoring Attack on RSA-EXPORT Keys (FREAK) is an SSL/TLS vulnerability that can allow an attacker to decrypt secure communications between vulnerable clients and servers. 

**SWEET32: BIRTHDAY ATTACK**

The SWEET32 attack exploits a collision attack in SSL/TLS protocol cipher suites. When CBC mode of encryption is used, these cipher suites uses 64-bit block ciphers to extract plain text of the encrypted data.

**BLEICHENBACHER WITH THE ROBOT ATTACK**

Return of Bleichenbacher’s Oracle Threat vulnerability, also known as ROBOT, allows an attacker to gain the RSA key necessary to decrypt TLS traffic under some specific conditions. An attacker can exploit this vulnerability by sending crafted TLS messages to the device, which would act as an oracle and allow the attacker to carry out a chosen-ciphertext attack.

**BEAST ATTACK**

The BEAST attack exploits a weakness in SSL/TLS cipher-block chaining (CBC). It allows a man-in-the-middle attacker to recover certain session information.

**CRIME ATTACK**

CRIME, “Compression Ratio Info-leak Made Easy “, is a security exploit against secret web cookies over connections using the HTTPS and SPDY protocols that also use data compression.

**BREACH ATTACK**

BREACH, “Browser Reconnaissance and Exfiltration via Adaptive Compression of Hypertext”, targets information compressed in HTTP responses through HTTP compression.

***
*More detailed version along with how you can avoid these vulnerabilities is published at :* [*https://beaglesecurity.com/blog/blogs/2020/07/06/Importance-of-TLS-1-3-SSL-and-TLS-Vulnerabilities.html*](https://beaglesecurity.com/blog/blogs/2020/07/06/Importance-of-TLS-1-3-SSL-and-TLS-Vulnerabilities.html)
#JulyOT - Visualizing Object Detection Data in Near Real-Time with PowerBI
Tags: ai, computervision, nvidia, iot
Published: 2020-07-10 14:24:11

---
title: #JulyOT - Visualizing Object Detection Data in Near Real-Time with PowerBI
published: true
description: Erik and Paul forward object detection results from an Azure Stream Analytics Job into a PowerBI Dataset.  They then develop a custom report for visualizing data in a live PowerBI Dashboard.
tags: artificialintelligence, computervision, nvidia, iot
---
Erik and Paul forward object detection results from an Azure Stream Analytics Job into a PowerBI Dataset.  They then develop a custom report for visualizing data in a live PowerBI Dashboard.

Part 5 of a 5 part series created for #JulyOT - more details @ http://julyot.com

The full steps to reproduce this project can be found on github @ https://github.com/toolboc/Intelligent-Video-Analytics-with-NVIDIA-Jetson-and-Microsoft-Azure

For more information on the services employed, check out:
[Stream Analytics Documentation](https://docs.microsoft.com/en-us/azure/stream-analytics/?WT.mc_id=julyot-devto-cxa)
[PowerBI Documentation](https://docs.microsoft.com/en-us/power-bi/?WT.mc_id=julyot-devto-cxa)
Smooshing arrays : flat() and flatMap()
Tags: codenewbie, javascript, todayilearned, beginners
Published: 2020-07-10 14:16:10


If you want to flatten an array that has sub-arrays, these two methods are helpful. They were introduced in the ES2019 standard. There was a bit of a [controversy](https://github.com/tc39/proposal-flatMap/pull/56) with the initial name *flatten*. 

Sometimes, we have to deal with data in nested arrays, you can implement the function yourself
```javascript  
function flattenArrays(arrays) {
  const result = []
  arrays.forEach(array => {
    array.forEach(el => {
      result.push(el)
    })
  })
  return result
}

flattenArrays([[5, 10],15, 20]])
// Expect result : [5, 10, 15, 20]
// This function will only flatten one level of arrays 
```
Luckily Javascript already provides the .flat() array method. Check [browser support](https://caniuse.com/#feat=array-flat) before using it. 
```javascript
[1,2,3,4,5,6,7,8,9,[10,11,12],13,14,15].flat()
// Expect result : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
```
.flat() only flattens one level of arrays. Nested arrays deeper than one level are left unmodified.
```javascript

[1,2,[[3,4],5],6,7,8,9,[10,11,12]].flat()

// Expect result: [1, 2, [3, 4], 5, 6, 7, 8, 9, 10, 11, 12]
```

You can flatten beyond the first level, the default depth is 1. The depth can also be *Infinity* to flatten all arrays. 
```javascript 
//flatten two levels deep
 [1,2,[[3,4],5],6,7,8,9,[10,11,12]].flat(2)
//Expect result: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
```
The depth can be Infinity, in which case flat will flatten all arrays no matter how deeply nested they are.
```javascript
[[[1]],[[[2]]],[3]].flat(Infinity)
//Expect result: [1, 2, 3]
```
* Note: The flat method only flattens arrays and stops when it is a non-array value. If there are arrays inside an object, it will skip them.
```javascript
[{ item:'shirt', stockIds: [124,12,145,12,33]}, [121,[2],[1]].flat(Infinity)
/* Expect result: [{
  item: "shirt",
  stockIds: [124, 12, 145, 12, 33]
}, 121, 2, 1] */
```
.flat() is so commonly used with .map() that a .flatMap() method was created. 

Imagine if you sold paint, and you had a tracking system that allows you to save different colours for each brand. You might want to write a list of every colour you have in stock regardless of the brand.

```javascript
const paintBrands = [
  {name: 'Dulux', colours: ['red', 'white', 'green', 'yellow']},
  {name: 'Berger', colours: ['grey', 'orange']}
]
paintBrands.flatMap(stock => stock.colours)
//Expect result: ["red", "white", "green", "yellow", "grey", "orange"]
```
* Note: .flatMap only flattens to 1 depth.

If you have any interesting use-cases for these methods please share below. Thanks for reading.
Announcing the first experimental release of dhall-docs 🎉
Published: 2020-07-10 14:15:25

Hi there! This short post is to let you know that `dhall-docs` was released 🎉.

The tool is quite experimental yet, but you can start to generate useful documentation.

For more information read this discourse post:
https://discourse.dhall-lang.org/t/announcing-the-first-experimental-release-of-dhall-docs/300?u=german1608

If you want to try `dhall-docs` on your Dhall package and you'd like to give me feedback, please participate in the discourse post.

Cheers 🥳
404 Error Page with Search Functionality Using VueJS
Tags: codepen, vue, javascript, showdev
Published: 2020-07-10 14:13:51

<p>404 Error page example layout built in VueJS and CSS animations.</p>

<p>You may click anywhere on the screen to search. I just used sample data for the search field.</p>

<p>I load external JSON file for the search. I used the Javascript fetch() method to load the JSON data from my assets.</p>

<p>I initialized the data on mount.</p>

<p>Except for the fonts, I made all of the assets.</p>

<p>The search textbox will be having a "floating" effect  if the search content is scrolled.</p>

<p>I used VueJS rendering transition in this component.</p>

{% codepen https://codepen.io/takaneichinose/pen/ZEQvRYQ %}
Biotracking - ¿Qué Medir?
Published: 2020-07-10 14:10:25


En el curso de Productividad que estoy por lanzar en @Platzi, me he obsesionado por entender qué es lo que medimos, qué es lo que debemos de medir, especialmente en la categoría salud. ¿Qué apps utilizan para recopilar su data?  

*Sistemas de Medición de indicadores biológicos*
+ Frecuencia cardíaca (FC)
+ Temperatura corporal
+ Nivel de estrés
+ Presión arterial (PA) y dinámica cardiovascular
+ Consumo máximo de oxígeno
+ La frecuencia respiratoria
+ Número de pasos
+ Distancia recorrida
+ Actividad Física: Corriendo, Alpinismo, Nadando
+ Calorías quemadas
+ Ingesta de alimentos y líquidos
+ Etapas del sueño (REM, ligero y profundo)

Yo la mayoría de los indicadores los mido por medio de mis dispositivos Apple, pero quiero entender qué apps les han resultado más útiles para entender sus patrones. 

--------------------------------------------
*Apps para control de datos biométricos:*
+ 23andMe - Perfil Genético: https://www.23andme.com/en-int/
+ My Fitness Pal — Hábito de comidas: https://www.myfitnesspal.com/es
+ Sleep Cycle — Hábitos de Sueño: https://www.sleepcycle.com/

--------------------------------------------
*Apps para autodiagnóstico de personalidad:*
https://wingfinder.com
https://www.truity.com/
https://www.traitify.com/
--------------------------------------------
*Sugerencias de Amigxs* 
Super Di @cotufa82 - https://twitter.com/NightscoutProj
What does it mean to YOU to "make an impact"?
Tags: discuss
Published: 2020-07-10 14:09:41

I've been thinking about this a lot. Some days more that others but the questions I ask myself are "What does it mean to 'make an impact'?", "How do I know whether I've made 'enough' impact?", "What is it actually that I want to impact?", etc.

I recently had a light bulb 💡 moment and instantly understood* what 'making an impact' means to me.

But before I share it, I'd like to ask you the same questions. How do you define 'impact'? I'm excited to read your comments.

Edit: I've published my perspective as well.

{% post https://dev.to/dzhavat/making-an-impact-213h %}

<sup>* Right now at least. This will probably change when (if) I get wiser :)</sup>

---

<span>Photo by <a href="https://unsplash.com/@jeremybishop?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jeremy Bishop</a> on <a href="https://unsplash.com/s/photos/wave?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>.
Creator Interview With David Thorpe - Creator of The Average Dev
Tags: creator, interview, spotlight
Published: 2020-07-10 14:09:37

---
title: Creator Interview With David Thorpe - Creator of The Average Dev
published: true
tags:
- creator
- interview
- spotlight
canonical_url: https://michaelbrooks.co.uk/creator-interview-with-david-thorpe/
---
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a82bup6l7n2wlzuqo0jg.png)

David has been a good friend and I've always enjoyed the content he's published. He's a man of many talents and now has a focus on taking control over digital anxiety. He has also started a podcast called "The Average Dev" with very insightful information, I recommend you give it a listen to after reading this great interview.

## Hello Dave, for those that don't know, please introduce yourself. Who are you, and what do you do?

Hey Michael,

I’m a software engineer, and I’ve been in the game for over 10 years now. I primarily work with startups and other companies wanting to build internal products. Recently I’ve moved to more leadership roles, and I want to communicate great career advice and confidence in other developers.

## You recently decided to teach others digital wellness. What made you decide this change in direction?

I used to find myself overusing my iPhone. I’d browse and browse, refresh all the feeds and it was horrible. It made my head feel spaced out all the time. I had to make a change and get away from screens when I wasn’t working since I was also spending 8+ hours a day on them coding. I’m militant about how I use technology now. It’s the most important thing to me with regards to tech that I control how I use it and not the other way around.

This has allowed me the focus to work on the things that matter to me, and that is communicating my story and learnt lessons from 8 years of self-employment to other people who are looking to start out. This has been hugely rewarding.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ylw62jh2mdfe4rfchuxc.png)

## You also have a podcast called "The Average Dev". What are your thoughts behind the name, and what made you decide to create it?

The name clicked for me because we, as developers, are always exposed to people in our industry doing incredible things. Releasing the next CSS framework, launching a video course, making millions from it etc. It’s the Instagram of the dev world. It’s really easy to believe that this is what we’re all expected to do, but I fundamentally reject that idea since it is unhealthy and isn’t actually a realistic goal for everyone.

The Average Dev name just communicates that. I am just an average dev, but I’m one who wants to talk about my experiences.

## Where can my audience find you?

I tweet about tips I’ve found and updates to my content output at [@davzie](https://twitter.com/davzie), and you can sign up for email alerts or view my content at [davidthorpe.dev](https://davidthorpe.dev/)

Thanks for having me, Michael!!
Don't freak out! Stay calm and get organized.
Tags: todayilearned, career, beginners
Published: 2020-07-10 14:03:43

Before I wrote this article, when I was trying to learn another language to make my portfolio's website, an article window about other languages was open. and I 	thought: Oh my god, too many things to study! D:
Yes, information technology, always gives the impression that we have to learn more and more and more, And That is not enough, 
**But... stay calm...**
Every time that you have this sensation, remember: Everything of life has **rhythm, patience, and selflove**.it's just one step and maybe **it's time to organize your study time**, to arrive at the spot that you want, And **STOP** to reproduce the imposter syndrome, 
Just keep learning!
Como aprendo tecnologias – planejamento de estudo
Tags: paideia
Published: 2020-12-21 03:53:39

---
title: Como aprendo tecnologias – planejamento de estudo
published: true
date: 2020-07-10 14:00:42 UTC
tags: paideia
canonical_url: https://www.itexto.com.br/devkico/?p=3093
---

Aprender é difícil, e com o tempo entendi que é impossível se você não tem um planejamento mínimo. Neste post apresento o meu método de estudo e como este me ajudou e a meus colegas de trabalho.