teleren/devto huggingface dataset:
Seeking Speakers for *virtual* ChicagoJS Meetup
Tags: javascript
Published: 2022-10-12 20:29:19

# Chicago JavaScript meetup is looking for speakers!

**If you have a talk related to any JavaScript framework, tools, or techniques, we would love to hear from you. Giving a talk is a great opportunity to help others, find friends with similar interests, get hired and get selected as a speaker at world-class conferences**.

## **What**
We focus on JavaScript themes for presentations, but the subject of the talk is up to you!
Potential topics might include:

+ GraphQL
+ Webpack
+ Front-end workflow
+ React/Redux/Redux-saga
+ Typescript
+ Angular 5
+ Progressive web app
+ JavaScript performance
+ npm vs yarn vs Turbo to package your app
+ Functional programming in JS
+ JavaScript app architecture
+ Vue JS

## **Where**
Virtual! Speak from the comfort of your own home. 

## **When**
The second to last Tuesday of each month from 5:30pm - 6:30pm CT
 
**Upcoming Dates**: November 15, 2022 - December 13, 2022

To check out a full list of our upcoming meetups, visit us <https://www.meetup.com/js-chi/events/>
100 DAYS OF CODE CHALLENGE
Tags: tutorial
Published: 2022-10-12 20:28:55

**Day 3**
what I did today:-
Today, my school mate and I got a little assignment from Alt school, we were asked to solve some problems on "LeetCode" website,
   LeetCode is a website for coding, you can solve some coding problems on the website.
   So, my group and I solved a few problems for about two hours and we called it a day
Participação Hacktoberfest 2022!
Tags: php, hacktoberfest
Published: 2022-10-12 20:09:26

Feito! Participação concluída nesta edição da hacktoberfest!

![lista de badges por ter participado da hacktoberfest 2022](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c72yjpo1fcqvyip7l6sl.png)
Golang: Desmistificando channels - Select
Published: 2022-10-12 19:51:59

## Select: selecionando o canal “mais rápido”

### O desafio

Imagina que você quer consultar as informações de um local a partir de um CEP.

Existem algumas APIs de CEP, mas você quer que o resultado seja o mais rápido possível. O que você faz?

Você poderia fazer um benchmark para ver qual é a API mais rápida, mas isso não seria muito preciso, porque uma certa API pode ficar mais lenta em certos horários, ou pode ser mais rápida para alguns CEPs e não para outros...

Uma estratégia que podemos usar é disparar uma requisição para cada uma e usar a primeira que responder com um status de `200 OK`, e essa é justamente a ideia do [projeto CEP Promise do BrasilAPI](https://github.com/BrasilAPI/cep-promise).

![CEP Promise](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27ku1wsh4kbmuuqsal4i.png)


Dessa forma não só ganhamos em performance como também em disponibilidade, porque mesmo se uma API falhar, ainda vamos ter outra(s) de fallback.

Para implementar algo parecido, podemos usar o `select`.

O select é como se fosse um `switch`, onde cada `case` é uma tentativa de comunicar com um canal.

O **primeiro** `case` com um recebimento ou envio pronto para ser executado vai ser o case que a goroutine vai entrar. 

Exemplo:

```go
select {
case <-time.After(time.Second):
	fmt.Println("1 segundo")

case <-time.After(500 * time.Millisecond):
	fmt.Println("500ms")
}

// "500ms"
```

O `select` por padrão pausa a execução da goroutine. Um `select` sem `case` vai parar a goroutine indefinidamente:

```go
package main

func main() {
	...

	// Se não tiver outra goroutine, vai causar um deadlock e encerrar
	select {}
}
```

O `select`, assim como o `switch`, também tem um caso `default`. 

Ele cai no `default` quando nenhum dos outros casos está pronto para ser executado.

```go
read := false

// combinando um loop com um select
for !read {

	select {
	case x := <-ch:
		fmt.Println("li do channel:", x)
		read = true

	default:
		fmt.Println("channel ainda não está preparado para leitura")
		time.Sleep(100 * time.Millisecond)
	}
}

// "channel ainda não está preparado para leitura"
// "channel ainda não está preparado para leitura"
// "li do channel: 123"
```

No exemplo de consulta de CEP, um código fictício para pegar o primeiro CEP que retornar seria:

```go
cep := "12345678"
var info CepInfo

select {
case info = <-cepInfoCorreios(cep):
	fmt.Println("Correios retornou primeiro")

case info = <-cepInfoViaCep(cep):
	fmt.Println("ViaCEP retornou primeiro")
}

fmt.Println(info.City)

// obs.: num caso real você teria que cancelar as requisições HTTP também
```
Let's help each other find good horror movies!
Tags: watercooler, discuss, halloween, movies
Published: 2022-10-12 19:41:37

_cover image source: [Poltergeist](https://giphy.com/gifs/poltergeist-BCgp2FqVz1ByE)_ 

It's October, the month of Halloween, and that means many of us are getting into the spirit of things by watching scary movies and freaking ourselves out the best we can. 😱🍿

![Cartoon referencing the movie The Ring... a person with long black hair is climbing out of the tv](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/15zbha6glrhoix6lcwa5.gif)

I'm starting up this discussion post to collect a list of good horror flicks, which I plan to watch throughout the month. Follow along and you can do the same.

If you have any suggestions for good horror movies, please drop'em in the comments! 📼
Restart nodemon when html or css file is modified
Tags: node, javascript, programming, productivity
Published: 2022-10-12 19:17:09


**Nodemon is a utility that monitor for any changes in your source and automatically restarts your server. It's a great utility for development as it saves you from manually restarting your server every time you make a change.**

1. Install nodemon using npm:

`npm install -g nodemon`

2. Use nodemon to run your node.js application:

`nodemon <your_app.js>
`
3. Your application will now automatically restart when any changes are made to your code.

**To Refresh Nodemon on all file modification, use this steps** :

1. Make a `nodemon.json` on your Project working directory

2. include `{"ext":"html,css,js,cjs,mjs,json,pug"}` in `nodemon.json` File

3. Now Run Nodemon File again
JS PDF generator that is accessible
Tags: javascript, pdf, a11y
Published: 2022-10-12 19:15:43


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

I'm looking for client side JS PDF generator that can output PDF which is accessible (WCAG compliance).

If you know any such library that can fulfill the requirement please share the details.
Welcome Thread - v195
Tags: welcome
Published: 2022-10-12 19:03:35

---
title: Welcome Thread - v195
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![We see the painting of The Creation Of Adam by Michelangelo but the arms on Adam and God are in motion and giving each other a goofy handshake](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8j11y3ksjgqxzpj8rmx.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
Timed out
Tags: testing
Published: 2022-10-12 19:02:11

i'm just tried to scan (contrast scan/contrast scan -f war_file_name.war) a **war ** file and i have this output

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

it's about Contrast Scan timed out.
what can i do to fix this please?
How to generate all subarrays in javascript in 2022?
Tags: javascript, programming, algorithms, beginners
Published: 2022-10-12 18:46:32

---
title: How to generate all subarrays in javascript in 2022?
published: true
canonical_url: https://weekendtutorial.com/how-to-generate-all-subarrays-in-javascript-in-2022/
---

![How to generate all subarrays in javascript in 2022?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b184wpdro0fme8zcnp0q.png)

Hello Readers,

Interviewers like to ask questions about the subarrays as it gives a clear indication of the logical thinking and aptitude of a candidate.

Considering the above, we are going to start a new tag MCAIQ (most commonly asked interview questions) on [weekendtutorial](https://weekendtutorial.com/) that will contain the most frequently asked questions in the interview. This will be your single stop for all such questions and interview preparations.

we will see how to generate all the subarrays of an array in javascript using iterative and recursive ways both.

---

## Generate all subarrays using iteration

### Problem Statement
Given an array, generate all the possible subarrays of the given array using an iterative way.

```
Input : [1, 2, 3]

Output: [1], [1, 2], [1, 2, 3], [2], [2, 3], [3]

Input: [1, 2]

Output: [1], [1, 2], [2]
```

### Implementation

{% embed https://gist.github.com/ajayv1/177494260b8f733726e55be0472eea2d.js %}

---

## Generate all subarrays using recursion

### Implementation

{% embed https://gist.github.com/ajayv1/6fc60b8b844cc94efdc2fd2427d4bad7.js %}

---

I hope you have learned something if you like the article please share it with friends and help [weekendtutorial](https://weekendtutorial.com/) to grow. This site is run by ads and it is required for it to be alive and grow.

Read the following articles –

1. [Learn Nginx in-depth](https://weekendtutorial.com/nginx-tutorial/)
2. [Implement binary tree using javascript](https://weekendtutorial.com/binary-tree-and-its-traversal-in-javascript/)

This is all for today. Please visit our other articles, and keep learning.
Podcast Livestream w/ Ilan Rabinovitch, SVP Product at Datadog
Tags: sre, devops, apm, aws
Published: 2022-10-12 18:32:43

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

We're incredibly excited to launch our new podcast tomorrow Thursday, October 13 with our first episode featuring a very ✨ special guest ✨, Ilan Rabinovitch, SVP of Product at Datadog.

Sedai would like to extend a personal invitation to the community on dev.to to join this special livestream of Episode 1 as we discuss The Future of APM and Cloud Operations. In this episode, we'll explore the different application performance challenges companies face today with the rise of microservice architectures, containers and serverless computing. We'll discuss the strengths and limits of the observability paradigm, and how autonomous systems and AIOps have emerged to streamline and scale operations for complex modern applications.

[Register to join us live tomorrow Thursday, October 13 at 11AM PT / 2PM ET!
](https://www.sedai.io/lp/beyond-automation-ep1-ilan-rabinovitch)
A handy text comparison view in vscode
Tags: vscode, comparison
Published: 2022-10-12 18:28:34

---
title: A handy text comparison view in vscode
published: true
description: Often we just need to compare two functions or few lines of code, this extension comes in handy.
tags: vscode, comparison
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

Often we just need to compare two functions or few lines of code, vscode extension [compare-view](https://marketplace.visualstudio.com/items?itemName=chekweitan.compare-view&ssr=false#overview) comes in handy. Just convenient, no need to create files, just create a compare view and paste text on the left and the right boxes respectively you get the comparison view.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/37hq2jcj68ki44lnu5zv.png)
Lambda@Edge or Cloudfront Functions
Tags: aws, serverless, cloudnative, javascript
Published: 2022-10-12 18:27:02

Both AWS services provide the same concept of delivering processing power with the lowest latency to the user. In essence, they act as HTTP middleware that enables the execution of request & response related processing. However, even though the purpose is the same there are significant differences that can be used in specific cases.

**Cloudfront Functions**— run on the edge locations themselves. There are currently more than 400 edge locations in the world run by AWS. Edge locations are dominantly used for caching the content served by Cloudfront.
Cloudfront functions are also running on the edge locations. With that said, the power and execution time is very limited. However, startup time is measured in submillisecond and scaling is rapidly fast to handle hundreds of million requests per second.
However, Cloudfront Functions have a few limitations that might be an issue when architecting a solution. Some of the CF Functions' limitations are: memory is limited to 2 MB, max function code size is limited to 10KB, only JS can be used for coding, no internet access, no access to a request body, no 3rd party libs and etc.
Also, there are some advantages over Lambda@Edge functions for instance rapid scaling and lower cost.

**Lambda@Edge** — is similar to Cloudfront Functions, but it runs on a Regional Edge Cache instead of an Edge location. So name as such, might be misleading. Lambda@Edge are following a similar concept as regular AWS Lambda, however, there are some significant differences. Such as It can last 5sec(30sec for origin req/resp), max memory can be 128MB to 3GB, and it can be coded only in JS or Pythons.
In comparison to Cloudfront Functions, it has access to the internet, other AWS services, and 3rd party libs that can be used. However, it scales a lot slower and costs much more.
Anticloner bootloader
Tags: bootloader, opensource, embedded, protected
Published: 2022-10-12 18:26:41

I would like to share with you open-source project [IMBootloader](https://github.com/IMProject/IMBootloader). It is a part of the [IMProject](https://github.com/IMProject) ecosystem that contains a simple firmware example [IMLedBlink](https://github.com/IMProject/IMLedBlink) and [IMFlasher](https://github.com/IMProject/IMFlasher) application that can communicate with the [server](https://imtech.hr/).


The idea behind the project is to protect innovation. There are a lot of small companies that struggle with protecting their intellectual property so instead of investing in R&D and pursuing innovation, most of the time end in a war against cloners.

For the embedded part of the project, we are trying to follow MISRA C 2012 guidelines so the code is very close to being automotive/avionic approved.

At the moment we added full support for STM32H7 microcontrollers. With this MCU we are capable to activate Read protection, adding the self-update capability of the bootloader, integrating Monocypher with XChaCha20 for data decryption, and key exchange with a preshared key to make sure no Man-In-the-Middle will intercept the data.

We would like to get some feedback from the community so we can see in what direction should we proceed. Also worth mentioning, we are very aware that there is a lot of room for improvement, so please don't be too harsh :)
Experienced Jr. Web Developer?
Published: 2022-10-12 18:20:32

Employers seem to be "Dazed and Confused" when it comes to requirements in the Tech Industry. Especially in the case of Jr. Web Developers; the norm is to either have you take an impossible code challenge, know 3 coding languages, 3 frameworks, 4 libraries or simply ask you for at least 3 years in industry experience. I thought Jr. Web Developers where people who just started in the industry. Is safe to say that expectations among employers are above reality and below market demands.
100 DAYS OF CODE CHALLENGE
Published: 2022-10-12 18:13:55

## DAY 4

- WHAT I DID TODAY
Adding image to my web page

-WHAT I LEAERNT FROM WHAT I DID TODAY
 
   The  first step I took was to download an image of my choice, after which I went to the folder containing my index.html, then I moved and pasted the image within the folder.
   Within the body element, I created an image element <img> which is a self closing tag, then I changed the source attribute of the element, the source attribute was; Src="Shrek.png"'#> [Shrek.png =the name of my image].
   If I am working with a web page that has a lot of images I would create a separate folder for the images, it might be unnecessary but if my image is located within a separate folder, I need to find a file path relating to my index.html file.#
   So I created a new folder and named it images, it will contain all the images for my web page, then I moved my images to the image folder. I could no longer locate my image so I had to find a file path relating to my index.html file.
   To look within my image file I had to proceed the image name with forward slash, the name of the folder[images], slash. For instance; <img Src="/images/shrek.png">.
   The width and height of the image can e changed to any size of your choice. For instance height="300", width="200".
   The image can also be turned into a hyperlink by surrounding the image element with a pair of a tag <a></a>.
   Within the opening a tag <a>there is a href attribute I can set to the URL of my choice, though I set the URL to the Wikipedia page for Shrek ["https://Wikipedia.org/wiki/shrek"].
Setting the Default Node.JS version with nvm
Tags: webdev, javascript, typescript
Published: 2022-10-12 18:07:41

When developing projects and products in Node.JS, it becomes essential to set the Node.JS version being used on your computer. `nvm` is a really useful tool for changing your Node.JS version on the fly. [If you need to install nvm, you can learn how to do that here](https://fjolt.com/article/linux-install-nvm).

`nvm` also lets you set the default version of Node.JS so that you don't have to constantly change it. To do that, you can use the `nvm` command like so:
```javascript
nvm alias default 18.10.0
```

Before you do that, though, make sure you have the version you want to use installed. You can do that using `nvm install`:
```javascript
nvm install 18.10.0
```

If you want to see what versions are available for you to set as your default version of Node.JS, try using `nvm ls`, which will return a list likethe one below. It also states which version is set as the default, beside the `default -> node` line.
```shell
❯ nvm ls
       v14.15.1
        v16.4.0
       v16.13.2
       v16.14.0
->      v18.3.0
         system
default -> node (-> v18.3.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.3.0) (default)
stable -> 18.3 (-> v18.3.0) (default)
lts/* -> lts/gallium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.20.0 (-> N/A)
lts/gallium -> v16.17.0 (-> N/A)
```

Also, running `node -v` will show you which version you are currently using. If it's not the one you want, you can set it back to the default using `nvm use default`:
```
❯ node -v
v16.18.0
❯ nvm use default
Now using node v18.3.0 (npm v8.11.0)
```
4 cool Project Ideas for 2022(for beginners)🤩👇 - codemarch
Published: 2022-10-12 17:56:22

####   Original Tweet From  [@codemarch](https://twitter.com/codemarch)
{% embed https://twitter.com/codemarch/status/1577531494691741697 %}


Thread🧵👇 

1.E-commerce project :- https://youtu.be/RDV3Z1KCBvo 

2.Blogging website:- https://youtu.be/AWHGQfzfHxI  

3.Portfolio Website:-  https://youtu.be/3HNyXCPDQ7Q 

4. Food Delivery Website:-  https://youtu.be/GiWJQOin5dk  

If you enjoyed reading this thread, please do the following: 
1. Like the thread❤️
2. Retweet the first tweet.🔃
3. Follow me and enable notifications: ✅
@CodeMarch
 
Thank you for reading all the way through. 

✨ JavaScript for Starters: The Complete Guide ✨

➱ JavaScript Roadmap 2022
➱ JavaScript Fundamentals with Exp.
➱ 50+ Programs to practice with Soln.
➱ 50+ Project Ideas
➱ 25+ Projects Code

Grab it NOW.  https://codemarch.gumroad.com/l/btfjn 



##### Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
MVC - Rails
Tags: rails, mvc, beginners
Published: 2022-10-12 17:56:05


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oeo5oy1px7nwb86a3th2.jpeg) 
               **MVC Architecture**
 
MVC stands for Model View Controller which is a pattern for the architecture of a software application. MVC separates an application into multiple components which makes it easy to understand and maintain. 

To communicate with a Rails application a User will send a request via browser where browser acts a view and the rails application receives the request via routing engine and passes it to the specific controller handler method defined in the rails application. Here controller layer acts as a bridge between View and Model. From controller the requests are handled over to Model's where Model interacts with Database to fetch/update data and returns back to controller and controller then returns back the processed data to the User via View layer.


**Model**
In our rails application we use ActiveRecord as a dependency module which will handle the business logic and database communication like fetching/creating/updating/deleting (CRUD). This plays a role of Model in our MVC architecture. 

For example in the below diagram there is a Student Model which can create Students and also perform all CRUD operations on Student Model using ActiveRecord.

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

**Controller**
The ApplicationController class acts as a controller of view and model where it takes in the request from the browser performs some business logic if needed and calls the Model to  do the database operations and sends back the result to View so User can View the processed data.

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

**View**
In MVC architecture View should contain presentation logic only where we show something on the browser by using frontend frameworks like React. Basically View layer should be mostly used for showing/presenting data and does not directly interact with database and only communicates with controller layer of the backend application like Rails. View layer will contain Html code, css code and Java script code in case of our React application as shown below.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4ymkbdc1h3vntab1ejv.png)
A brief intro to JS Promises
Tags: javascript, beginners, programming
Published: 2022-10-12 14:33:34

A JS Promise is an object that represents the completion or failure of an asynchronous operation and gives results. 

## Syntax
The syntax for writing a promise by using the ‘new’ keyword and promise constructor function.
`const myPromise = new Promise();`
A promise has three states. That is -

- Pending

- Resolved

- Rejected

**Pending:** When the state is ‘Pending’, it means the operation has neither been resolved nor rejected. Pending is the initial state, and the initial result is undefined.
**Resolved:** When the state is ‘Resolved’, it means the operation has been completed successfully and will give a result. 
**Rejected:** When the state is ‘Rejected’, it means the operation has not been completed successfully and will give an error. 

![Promise state](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqpcg6xm9wi91bh811u3.PNG)

## How to reject or fulfill a promise?
For instance, you have an API where there is information such as product id, name, price, etc is stored. You make an API call. When you are making the API call, initially the state is pending and the promise has neither been resolved nor rejected. Now you want to show the data which in this case are the product pieces of information on the UI,  and if any error occurs you want to show an error message.

![State](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uf61g78xhdxt1innkd98.PNG)
![States](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzhjvipcdm7k5xxm1vz2.PNG)