teleren/devto huggingface dataset:
Functional Programming with JS
Tags: javascript, functional, programming
Published: 2021-10-18 19:26:17

**Functional programming** is a programming paradigm designed to handle pure mathematical functions. This paradigm is totally focused on writing more compounded and pure functions.

**Functional programming** is a particular kind of **declarative programming**.

First, you need to know the difference between declarative programming and imperative programming, they are js paradigms or techniques to organize your code.
In imperative programming, we specify the program logic describing the flow control.
```
let name = "Ali";
let Greeting = "Hi, ";
console.log(Greeting , name);  // Hi,  Ali
```
In the opposite, declarative programming we specify the program logic without describing the flow control
```
const Greeting = (name) => {
    console.log('Hi, ',name);
}

Greeting("Ali"); // Hi, Ali
```
So, as you have noticed, the **functional programming** focuses on the code being clean, organized, and reused through

1. **Pure Functions**: 
      are simple and reusable. They are completely independent of the outside state(global variables), easy to refactor, test and debug.
A pure function is a function which given the same input, will always return the same output.
```
const add = (x,y) => x+y;
add(5,4) // 9
```
`Math.random` is a popular example of not pure function.
another example for not pure function:
```
let count = 0;
const incCount = (value) => count += value;
```
2. **Higher-Order Functions**: they can receive a function as a parameter(callback) and also can return a function, they are very helpful for writing complex functions.
```
const animals = ["Cat", "Dog", "Elephant",
 "Giraffe", "Lion", "Monkey"];
const zooWithoutCat = animals.filter(animal => animal !== "Cat");
```
**Note ==> Don't Iterate** you can use higher-order functions like map, filter, reduce, find...

```
let numbers = [2, 4, 6];
let numbersX2 = numbers.map(number => number*2); // [ 4, 8, 12 ]
```
3. **Avoid Mutability**: you must avoid changing the data.
```
let num1 = [1, 2, 3];
let num2 = num1;
```
any change in num2 affects num1 (mutability), we can fix this problem by using higher-order functions or spread operator.
```
let num2 = [...num1];
```

4. **Persistent Data Structures for Efficient Immutability**

> Think of all data as immutable, never changing.

the problem with immutability is that you need to copy all data for a little change and this can give you efficiency problems, because you will use a lot of space, so **What is the solution?**
**_Don't Worry_**
there are many of js libraries that handle this problem like:
* Mori
* Immutable.js
* Underscore
* Lodash
* Ramda
they depend on structural sharing idea 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/du4myz2e9lpubaoxljlp.jpg)
Note that the yellow squares are shared between 2 variables.

**Thanks for your time**
you can add me on LinkedIn: [Link](https://www.linkedin.com/in/mahmoudhassan7764)
You're invited: What's on the maintainer wishlist for Hacktoberfest?
Tags: hacktoberfest, opensource, documentation
Published: 2021-10-18 19:26:15

---
title: You're invited: What's on the maintainer wishlist for Hacktoberfest?
published: true
tags: Hacktoberfest, opensource, documentation

---

<p>Hacktoberfest, a month-long celebration of open source software that encourages OSS enthusiasts and beginners alike to contribute to projects, seems like the perfect opportunity for first time contributors to start participating in open source... but what are some ways you can add to a project while you’re still learning?</p>
<!--more-->
<p>Join us <strong>Thursday, October 21 at 1 p.m. ET / 10 a.m. PT</strong> as Tidelift ecosystem strategy lead Josh Simmons and maintainer Isabel Costa sit down to discuss this topic. Josh will share some stats from a recent maintainer-only survey about the areas where maintainers need help most. Spoiler alert: it involves documentation and testing. Isabel will share what sorts of pull requests she’s most likely to merge. Josh and Isabel will also discuss ways maintainers might be able to make Hacktoberfest a success for their projects.</p>
<p>This will be a fun, casual discussion in which Josh and Isabel will explore:</p>
<ul>
<li aria-level="1">Why do people contribute to open source?</li>
<li aria-level="1">What is the definition of a meaningful contribution?&nbsp;</li>
<li aria-level="1">What are some good first steps someone can contribute?&nbsp;</li>
<li aria-level="1">What areas do maintainers most need help with?</li>
</ul>
<p>Bonus: <a href="https://upstream.live/webinar/hacktoberfest">RSVP</a> and attend, and we’ll send U.S.-based attendees our newest Pay the Maintainers t-shirt!</p>
Angular Developer Roadmap
Tags: angular, javascript, webdev, beginners
Published: 2021-10-18 19:10:54

[Angular Developer Roadmap](https://codingtute.com/angular-developer-roadmap/) will help you to start your angular learning path in an organized way.
You can find more useful developer content at [codingtute](https://codingtute.com) and follow [facebook](https://www.facebook.com/codingtute) page for latest updates
![Angular Developer Roadmap](https://codingtute.com/wp-content/uploads/2021/10/Angular-Roadmap.png)
Environmental coder
Tags: sql, python, dash
Published: 2021-10-18 18:50:45

Carl here - and this is my very first post. I’m new to the confusing and inspiring world of coding. I have an old sailboat where I had to learn how to wire 12 volt circuits. Once I figured it out I loved how I could build anything - bilge pumps, lights, whatever.. I feel like coding is the same. Tools to build anything you can imagine. And with those tools I hope to build a more sustainable world. So please help me learn! Can’t wait to get to know this community.
First DEV post
Tags: programming, gamedev, webdev, mobiledev
Published: 2021-10-18 18:25:14

Hello, everyone.
  
My name is TurboSpeedzter or Ted Bailey.  I am a software developer who does Webdev, MobileAppDev, and Gamedev. Video game development is my number one obsession, with Phaser3 engine my favorite.

I love video games, like Metal Gear Solid, TitanFall2, MassEffect, Metroid, and most others.  I am also a comic book fan with a large collection.  I seek out Game Arcades around the world.

Additionally, as a former radio broadcaster, I do podcasts and write articles and science fiction novels.

It's great to be among like-minded people of great visions and aspirations.  

CODE ON!
--T
⚔️ Open Source v/s cPaaS ⚔️ - The architecture choices for building a live video applications.
Tags: webrtc, javascript, reactnative, flutter
Published: 2021-10-18 18:24:41



Join Kshitij Gupta, Co-founder & CEO at #100ms along with Sean DuBois, founder of #Pion, Developer at Twitch talk about #WebRTC at upcoming #CTOTalk, October session! 🚀

**Agenda** -> Open Source v/s cPaaS - The architecture choices for building a live video applications.

Watch as the top minds in the space of live video systems answer queries about -

👉 How live video applications work and why are they hard to build
👉 Architecture choices for building live video applications
👉 How to scale live video systems in production and war stories
👉 How to grow an open source project

Block your seats now ⬇️

**Date** : 9 AM - 11 AM IST Saturday, 23rd October 

**Register here** : https://bit.ly/ctotalk-opensource
Day 33/100 Coding Challenge
Tags: 100daysofcode, programming, codenewbie, challenge
Published: 2021-10-18 18:13:51

Note to self: Construction site are highly valuable. You need to play its waiting game together with its tools and equipments. Together they create a bond that makes one wondering “Who are they talking to?” I will pay tons of time and bills. Imagine, you can’t connect to the world because of sewage maintenance and it might take a month or so to fixed it. The life of a coder.

![challenge](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rfe421e6v9q8nl8f9l3x.png)
100 algos in 100 days (Day 30)
Published: 2021-10-18 18:07:26

[17/10]

### Question
### nthToLastNode of a Linked List

The solution was pretty eye opening. Turns out, sometimes you do have to walk all the way through a Linked List. For a while I was convinced there was a trick to be used.

There was also a stick solution where you keep track of two points as you iterate over. Those being the start of the stick and the end. Similar to how you find a cycle. I like examples of ways of thinking like this.
100 algos in 100 days (Day 29)
Published: 2021-10-18 18:02:37

[16/10] A bit of a gap over the last 3 days with some stuff going on.
I started really looking into Linked Lists. Coming from JS we hardly ever use this data structure but in .NET it is quite common so really cool to know more. 

###Question
### Reverse a linked list in place

This was a cool trick to not go all the way through. As long as you keep track of previous, current and next you can do it all there and then.
Something like this pseudo code:
```
// Copy a pointer to the next element
// before we overwrite currentNode.next
// Reverse the 'next' pointer
// Step forward in the list
```
Hello, world
Tags: welcome
Published: 2021-10-18 17:44:38

Hey, 

Google keeps leading me to dev.to as a source of some random but interesting articles, so I finally decided to leave the read-only mode and join the club.

As a web developer, I tap into other people's wisdom and knowledge every day, and I'd be happy to start giving back, even if it's a penny at a time.

It'd be awesome if some of my notes provide any help to a person or two, let's see if they actually do (:

I don't have any illustrations for this welcome post, so there's a random photo of my cat [(there's a link to the high res version on Unsplash)](https://unsplash.com/photos/p97J_A4yfcQ)
![Portrait of a Siberian brown mackerel tabby cat hunting in the grass](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wv5vlthuxdqyv6093sf9.jpg)
HTTP - Verbs, HTTP codes & Request Params
Tags: http, javascript, webdev, programming
Published: 2021-10-18 16:56:15

## Verbs

  - GET - Reading infos
  - POST - Create infos
  - PUT - Update Infos
  - PATCH - Update PARTIAL info (example: avatar from user)
  - DELETE - Delete infos

## HTTP - Status Code 

  - 1xx - Informative: processing..
  - 2xx - Confirmation:
    - 200: Request success
    - 201: Created - AFTER REQUEST POST
  - 3xx - Redirect:
    - 301: Moved Permanently
    - 302: Moved
  - 4xx - Client Error
    - 400: Bad Request
    - 401: Unauthorized
    - 403: Forbidden
    - 404: Not Found
    - 422: Unprocessable Entity 
  - 5xx - Server Error
    - 500: Internal Server Error
    - 502: Bad Gateway

## Request Params

  - Header Params: Token, authorization, cors
  - Query Params: key,value,separator (page=28&)
  - Route Params: /products/{id}
  - Body Params: { name: 'john doe', last_name: 'stewie' }
Sr. DevOps Engineer - Remote (US based)
Tags: devops, fintech, career, blockchain
Published: 2021-10-18 16:48:05

Sila’s goal is to transform the financial landscape by creating an open-access financial network with a stable cryptocurrency at its core. We want to help developers and entrepreneurs bring their fintech ideas to market quicker and easier by incorporating compliant processes and making money programmable.

We are looking for a Sr. DevOps Engineer to join our team.  Need to be US based, knowledgeable in the use of Jenkins, Docker and AWS.  Will be supporting multiple developer teams coding in Python.

https://silamoney.applytojob.com/apply/k0ZeigUu22/Sr-DevOps-Engineer?source=DEV+Community+via+Twitter
API Rest - a little bit..
Tags: http, api, webdev, rest
Published: 2021-10-18 16:44:08

# Application Programming Interface

  - Group of possible specifications about interactions at applications.
  - Documentation (example: Swagger)

# REST: Representation State Transfer

  - Architecture Shape

# 6 rules for REST

  - Client-Server
  - Stateless
  - Cache
  - Uniform Interface
    - http://address.com/users (example)
    - JSON/XML ...
    - Messages and Status coherent
    - HATEOS
      - Return links inside request
  - Layers
    - Charger Balanced (example)
  - Code on Demand
Divtober Day 18: Shine
Tags: codepen, divtober, css
Published: 2021-10-18 16:36:31

---
title: Divtober Day 18: Shine
description: A cartoon of a shiny diamond.
published: true
tags: codepen,divtober,css
series: divtober
---

Divtober's word of the day is "Shine." And if you ask any kid (or Rihanna), they'll say that diamonds shine, so here's a shiny diamond:

{% codepen https://codepen.io/alvaromontoro/pen/MWvyBbY %}

I haven't been too inspired these last couple of days (or decades 😳)
NodeJS - Fundamentals
Tags: node, javascript, webdev, programming
Published: 2021-10-18 16:35:15

# NODEJS

 - Open Source platform, allow the execution of javascript language in server-side.

 - Single Thread (v8) with Thread Pool (libuv c++) and group of modules.

 - Event Loop (Call Stack)

 - NoN-Blocking I/O

 - Self Modules (http, fs, dns, buffer, etc..)

# What's Event Loop?
 ![luiztools](https://i.imgur.com/JGHGkdy.png)
 - <b>the last one in is the first one out!<b>
Number.NaN and isNaN()
Tags: javascript, tutorial
Published: 2021-10-18 16:32:36

In this tutorial I'm going to be going over what are the Number.isNaN and isNaN(). So what are Number.NaN and isNaN, Number.isNaN determines if the value is not a number this method is true if the value of the type of number is identify to NaN (Not-A-Number) it is false the function for Number.isNaN is totally different from isNaN function the siNaN convert the value to a number it will be true for any value not a number. Note that Number.isNaN method is not supported in Internet Explorer.
My First Year at Hacktoberfest
Tags: beginners, opensource, cpp, hacktoberfest
Published: 2021-10-18 16:25:03


New to the community:
Hey everyone, I am Ashutosh, a Computer Science & Engineering sophomore from Academy of Technology, India. I am new to the Dev Community. 

My Background:
I am a beginner in open source. Currently, I am learning C++. I came to know about the Dev Community from the Hacktoberfest website.

My Progress:
My Hacktoberfest 2021 journey has been pretty good till now. I have made 5 contributions as for now and looking for more.

Reflections:
Overall, my Hacktoberfest 2021 experience till now has been great and I will also participate in upcoming years.
What questions do you have about publishing software development books? Answer to be featured on our podcast 🎧
Tags: podcast, discuss
Published: 2021-10-18 16:23:45

---
title: What questions do you have about publishing software development books? Answer to be featured on our podcast 🎧  
published: true
description: 
tags: podcast, discuss
---

The [DevDiscuss Podcast](dev.to/devdiscuss) begins with an interview and ends with commentary from listeners — and we like to feature the _actual_ voices from our community!

To inform an upcoming episode of the show, we'd like to know...

> ### **What questions do you have about publishing software development books?**

For your chance to hear your actual comments on an upcoming episode, answer the question above by:

- Calling our Google Voice at +1 (929)500-1513 and leave a message 📞

- Sending a voice memo to pod@dev.to 🎙

- OR, leaving a comment here (we'll read your response aloud for you) 🗣

Please send in your recordings by Thursday, October 21st at 9 AM, ET (1 PM UTC, 6 AM PT)

#### Voice recordings will be given priority placement 😉

Catch up on recent episodes of the show [here](https://dev.to/devdiscuss) 👀
isNaN() & Number.NaN()  
Published: 2021-10-18 16:21:27

This tutorial will explain how to use the Number.isNaN() method and the global isNaN() function.

###NaN (Not a Number)
NaN is the result of operations that have an undefined numerical result.
####Examples
* Converting a non-numeric string into a number
* Any operation involving NaN itself.

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

Strangely enough Numbers contains NaN.

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

The important thing to note is that NaN is indeed a numeric data type but it has an undefined numeric value.

##isNaN() 
The Global isNaN() function checks to see if a value is equal to NaN. This function will return true if the value is NaN. Otherwise it will return false.

For example: 

####Syntax
isNaN(value)

####Parameters 
value - The value being compared to NaN.

####Returns
A Boolean: true if the value is NaN, otherwise it will return false.

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

When the value being evaluated is not of the Number data type this function first attempts to coerce it to being a Number type and then it determines whether it’s NaN so you may find some strange results. 

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

##Number.isNaN()
The Number.isNaN() method evaluates if a value if of the Number data type AND If it is NaN. This method will return true only if the value is NaN with the Number type, otherwise it will be false. This method will not convert its parameter value type to be Number.

####Syntax
Number.isNaN(value)

####Parameters 
value - The value being compared to NaN

####Returns
A Boolean: true if the value is NaN and its type is Number , otherwise it will return false.

####Example

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

The key distinction here is that the global isNaN() is changing its parameter to a Number first and then making the comparison. Number.isNaN() will simply return false on the basis that the value doesn't match the data type requirement before even attempting to check isNaN().
String.prototype.toUpperCase() vs. String.prototype.toLocaleUpperCase()
Tags: javascript, tutorial
Published: 2021-10-18 15:52:52

This is a short tutorial on String.prototype.toUpperCase() vs String.prototype.toLocaleUpperCase().

##String.prototype.toUpperCase()
This method converts any string value to uppercase letters.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/484tgshqo95zltnaddqh.png)

##String.prototype.toLocaleUpperCase()
This method converts any string value to uppercase letters, based on the locale-specific case mappings. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2nfhvoi33qvwxt2z6rbd.png) 
 
In this example, we used Turkey and we can see that the "I" has a dot. This is because the alphabet in the Turkic language is different. Using their language code gives us "İ".
######If multiple locales are given in an array, the best available locale will be used. 

###Both of these methods are similar. However some mappings are different so using toLocaleUpperCase() method would be more specific.
C++ Programming:  Implicit and Explicit Constructors
Tags: cpp, beginners, programming, computerscience
Published: 2021-10-18 15:48:34

> **Note:** Any code snippets posted here are licensed under the **MIT License**.

Did you know that there are both implicit and explicit constructors? 
Let's look into the difference between both, and what each can do for code readability and convivence when programming.

## Explicit Constructors
You may see warnings in certain C++ compilers about making certain constructors explicit. But what does it mean? Let's look at an example of an explicit constructor:
```c++
class MyClass {
  int i;
  explicit MyClass(int i) : i(i) {}
}

// ...

int main() {
  MyClass clz = MyClass(2);
}
```
Looks pretty normal, right? So you might wonder what this actually does. You must initialize the value with the name of the type before it's initialization aka: `MyClass` then with the constructor parameters. You can see the difference in usability in the implicit constructor code.

## Implicit Constructors
These constructors allow you to initialize a class value without specifying the name of the class. Let's look at an example:
```c++
class MyClass {
  int i;
  /*implicit*/ MyClass(int i) : i(i) {}
}

// ...

int main() {
  MyClass clz = 2;
}
```
Wait, is the class `MyClass` now the integer type? **No.** What actually happened was that the C++ compiler was able to tell that you were calling the `MyClass` constructor implicitly and allowed that conversion. 

Every wondered why this code was legal?
```c++
std::string my_string = "Wow, this is cool!";
```
It's because there is an implicit constructor with std::string that takes in a `const char *` and thus allows this initialization to be valid.

## Bringing It Together
In accordance with certain code writing standards, compilers or code analyzers may warn using implicit constructors, why? They do this because in general it is harder for another programmer to analyze code that uses implicit constructors because it is hard to pin point the type of the object being initialized.

## Conclusion
Understanding implicit and explicit constructors will allow you to take in full control of how your code is read and how you use it. This is especially important to take note of if you are reviewing code, or reading code from a library. I hope you learned something today, and have good day!
🤔 ID Token and Access Token: What Is the Difference?
Tags: security, programming, devops
Published: 2021-10-18 14:56:17

#### 📚 Learn what ID and access tokens are and how to correctly use them in the OpenID Connect and OAuth context.

### <br>

"Let’s use a token to secure this API call. Should I use the ID token or the access token? ​🤔 The ID token looks nicer to me. After all, if I know who the user is, I can make better authorization decisions, right?"

Have you ever found yourself making similar arguments? Choices based on your intuition may sound good, but what looks intuitive is not always correct. In the case of ID and access tokens, they have clear and well-defined purposes, so you should use them based on that. Using the wrong token can result in your solution being insecure.

"What changes after all? They are just tokens. I can use them as I see fit. What’s the worst that could happen?"

Let’s take a closer look at these two types of tokens to better understand their role in authentication and authorization processes.

## What Is an ID Token?

An ID token is an artifact that proves that **the user has been authenticated**. It was introduced by [OpenID Connect](https://openid.net/connect/) (OIDC), an open standard for authentication used by many identity providers such as Google, Facebook, and, of course, Auth0. Check out [this document for more details on OpenID Connect](https://auth0.com/docs/protocols/openid-connect-protocol). Let's take a quick look at the problem OIDC wants to resolve.

Consider the following diagram:

![ID token scenario](https://images.ctfassets.net/23aumh6u8s0i/4x34jgYBU7vjBYLumNr9Sg/57e0b420de0d27568981af4aef0ab27f/id-token-scenario.png)

Here, a user with their browser authenticates against an OpenID provider and gets access to a web application. The result of that authentication process based on OpenID Connect is the ID token, which is passed to the application as proof that the user has been authenticated.

This provides a very basic idea of what an ID token is: proof of the user's authentication. Let’s see some other details.

An ID token is **encoded as a JSON Web Token** (JWT), a standard format that allows your application to easily inspect its content, and make sure it comes from the expected issuer and that no one else changed it. If you want to learn more about JWTs, check out [The JWT Handbook](https://auth0.com/resources/ebooks/jwt-handbook).

[Read more...](https://auth0.com/blog/id-token-access-token-what-is-the-difference/?utm_source=content_synd&utm_medium=sc&utm_campaign=security)