teleren/devto huggingface dataset:
Day-4 Squares of a sorted array
Tags: python, challenge, beginners
Published: 2020-04-16 18:10:25

---
title: Day-4 Squares of a sorted array
published: true
description: 
tags: #python #challenge #beginners
---
The below solution is to the problem present in Leetcode's Introduction to Data Structures Array-101 part.

##### Problem Statement
Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.

##### Example 1
```
Input: [-4,-1,0,3,10]
Output: [0,1,9,16,100]
```

##### Example 2
```
Input: [-7,-3,2,3,11]
Output: [4,9,9,49,121]
```
##### Solution Approach

1. Iterate over the list.
2. Calculate the square of each element.
3. Append the squares of each element to a new list.
4. Sort and return the new list.

```
class Solution:
    def sortedSquares(self, A: List[int]) -> List[int]:
        square_elements = []
        for item in A:
            prod = item*item
            square_elements.append(prod)
        square_elements.sort()
        return square_elements
```

NOTE - Leetcode has a skeleton structure for codes that uses classes.
Spotify playlists
Tags: watercooler, productivity
Published: 2020-04-16 17:55:00

Coding, programming, and writing code is the creative process. We all artists seeking for the best solution to the task we are working on. Building worlds and creating new universes in our minds, modeling and prototyping data-flow, components interaction, API interfaces, user stories, predicting arising issues, and preventing common ones.

Every creative process is accompanied by a muse. And muse... you know a lady, she won't give a company to a grumpy one. You had to be positive, charged with a good mood, and be in the "zone." And our mood is tied to music, as the prefrontal cortex and auditory cortex — uplifting our emotional function.

To keep my emotional function in balance, I compiled and listening to the next playlists. Daily switching in between to compensate for my mood shifts. Sharing all of them with you — to stay focused, uplifted, and inspired, enjoy!

- [Dubbed Tech](https://open.spotify.com/playlist/35eDsYHhXTNXUeXoigYawK?si=DpV6awpyQLaE870ymiFFJQ) — Lately, this one drives my coding sessions
- [This is rave 😎](https://open.spotify.com/playlist/3gZpELq06aIug9sJcDyaa6?si=0ca3015f769e4249) — This is *my favorite* one, uplifting, and pumping beats with drops;
- [Party hard 🤩](https://open.spotify.com/playlist/5RZNNp5fBsqdiM9fBxbRQr?si=-hPjO15STdSJTxAXveppPQ) — Not for everyone, hard pressing on your ears;
- [Party light 😎](https://open.spotify.com/playlist/6BbfExnImDGY63eXDL5Lea?si=85VXJ2TPSGOCtdN-PShmzw) — Easy to listen in the background;
- [Party weird 🤓](https://open.spotify.com/playlist/5SLLUSp6PHbsYDp4uGXVWr?si=9B3uk35iTVaoEwcYp7EZqw) — Pop, the 70s, mainstream, good morning/long drive music, sometimes used during the coding sessions, usually on new tasks, **some tracks may surprise you,** so don't get surprised;
- [Jazz 🎷](https://open.spotify.com/playlist/6IIfMD0qd08lQIsc1Rn9h8?si=pK5g-drUTqGmZcMu-4QV6w) — Jazz can be different, this one is perfect for driving; Always great on low volume in the background;
- [Drum & bass 🕺](https://open.spotify.com/playlist/0vkwlpojOLTnU2BV6QeEqr?si=cA-kIA42R1K6emNgu7LPTw) — Think fast — code fast 🚀. Usually using this one on hackathons and urgent tasks;
- [Nostalgy 🚴‍♂️](https://open.spotify.com/playlist/6n7jtM93cqrgJKRk7ecsit?si=Z-RJO7HbS7K_ZIH14NwJDg) — Driving, cycling, pedaling. As well as focus-coding sessions. Beloved Kung Fury style beats!
- [Chill 🥱](https://open.spotify.com/playlist/67DXPxwZ7hycxyTqye6KL1?si=iFOfeC-aQVmmf0RMJaicqQ) — Chill after hard-working day; Perfect for your long-range speaker on low volume at the end of the day;
- [Meditation 👳🏾‍♀️](https://open.spotify.com/playlist/5wiQlSdsXvwFdAsNzeXHn5?si=7rSVyw9JSySAP6OGDHFTKg) — Deep-deep-deep meditation playlist. Use it while relaxing in the bathtub, drinking tea, or during massage sessions with beloved ones.

I update playlists regularly. All other playlists are **[here](https://open.spotify.com/user/tj4ybmn6rx31oev0enznadu23/playlists)**.
Let me know what you think. Share yours.

👨‍💻
Twilio Hackathon Deadline Is Two Weeks Away
Tags: twiliohackathon
Published: 2020-04-16 17:48:57

---
title: Twilio Hackathon Deadline Is Two Weeks Away
published: true
description: 
tags: twiliohackathon
---

{% link https://dev.to/devteam/announcing-the-twilio-hackathon-on-dev-2lh8 %}

We're now two weeks away from the April 30 deadline, so we wanted to post a quick reminder and a round up some of the early submissions.

**Need ideas?** Check out the [ideas thread](https://dev.to/thepracticaldev/your-twilio-hackathon-updates-172k).

**Have questions?** There's also a dedicated [help thread](https://dev.to/thepracticaldev/twilio-hackathon-help-thread-1jno) - the Twilio team has been amazing at offering their support.

A few submissions so far—

Just to be clear, we will not favor early entries, but with this kind of thing it's always best not to wait until the last minute. 

Gwyneth finds an opportunity to bring some positivity into the pandemic:

{% link https://dev.to/madebygps/a-serverless-app-that-texts-me-positive-covid-19-news-1h6o %}

Austin is sheltering in place and needed inspiration for new recipes, so they built a recipe finder: 

{% link https://dev.to/austincrim/cooking-in-quarantine-check-out-this-twilio-recipe-finder-4ape %}

Robert leveraged Twilio Sync to build a collaborative drawing app:

{% link https://dev.to/sorxrob/milliondollarpaint-a-real-time-multi-user-drawing-web-app-4ab6 %}

We’re excited to see more submissions across all four categories!

- COVID-19 Communications
- Engaging Engagements
- Interesting Integrations
- Exciting X-Factors

Remember, there will be a Grand Prize winner in each category, so you might want to choose a less-popular category to increase your chances of taking home the top prize!

Happy Coding!
Rapidtext multipurpose sms/bulk sms app for alert & commercial purpose
Tags: twiliohackathon, javascript, node, showdev
Published: 2020-04-16 17:47:45



## What I built
Rapidtext is a open source web application used to send a sms/bulk sms using twilio api

This is multi purpose sms / bulk SMS app it can be used for various of purpose like thet sending alert message related to covid19, and also used for commercial purpose for business , colleges , hospitals

#### Category Submission: 
node.js,javscript,express.js
 
## How I built It

-    Node.js web server using Express.js
-    Basic web user interface using ejs
-    Bcrypt for hashing a user password
-    Encrypt & decrypt a twilio credential by Crypto-js
-    Mysql database is used
-    Its support multi users
-    Validation on each forms by express valiadtor
-    Error handling in different situations
-    Send bulk sms Through txt file
-    Send massages with different mobile numbers (purchase a Different mobile number from twilio), No default Sender number
-    Linting and formatting using ESLint and Prettier
    fancy 404 page and 500 page
-   Uploaded files will be deleted in every 3600sec 

#Screenshot below
![Login](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/login.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/register.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/emailexist.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/errcon.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/regvalidation.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/sendsms.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/sms.PNG)

![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/bulksms.PNG)
#### checks a uploaded file is a mobile numbers or unwanded content 
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/upoladnonnumbers.PNG)

![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/bulksmsOK.PNG)

![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/checkint.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/responsive.PNG)
![img](https://raw.githubusercontent.com/gmpravin/rapidtext/master/screenshot/index.PNG)


## Link to Code
https://github.com/gmpravin/rapidtext

#If you Like this repo please hit a star button

## Additional Learning Resources/Info
Node.js sql https://www.w3schools.com/nodejs/nodejs_mysql.asp
Node.js https://www.w3schools.com/nodejs/default.asp
Stackoverflow for issues sloving
Google for seraching
EJS ejs.co


Bust of Luck!!!!!!!!!!!!!!!!!!!!

Happy learning :)
Skyrocket your CSS skills with Spaced Repetition
Tags: css, learning, anki
Published: 2020-04-16 17:26:43

---
title: Skyrocket your CSS skills with Spaced Repetition
published: true
description: What if I tell you that there is a way to either greatly decrease your time spent studying, or greatly increase the amount you learn? Doesn't matter if it's CSS, HTML or geography.
tags: css, learning, anki
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9mp85jo04y6fibvpaglo.png
---

What if I tell you that there is a way to either greatly decrease your time spent studying, or greatly increase the amount you learn? Doesn't matter if it's CSS, HTML or geography.

## How?

I was never able to study in a way of memorizing stacks of texts. I need some sort of game that can keep me entertained while studying. I have recently tripped over term called Spaced Repetition. Spaced repetition is a study method which uses spacing effect which describes how our brains make better connections and overall remember things more effectively when we space out our learning over time.

The following curve better describes the review cycle that can help memorizing topic for longer period of time.
![Forgetting curve](https://dev-to-uploads.s3.amazonaws.com/i/cl8jnspqrfn4425fupcq.png)

To apply Spaced repetition in studying, I use an app called [Anki](https://apps.ankiweb.net/). It's multiplatform (Web, Android, iOS (paid), Mac, Windows and Linux) app that is based on flash cards.

In Anki I've created multiple Decks (topics) with multiple questions about CSS.
Namely these decks:
- CSS properties
- CSS pseudo-elements
- CSS pseudo-classes

You can download them on my Github repo, simply import them to Anki and start studying!

There are some advanced stuff in those decks that I was not aware it even exists.

Link to repo: [https://github.com/michalhonc/anki__decks](https://github.com/michalhonc/anki__decks)

Let me know which decks should I create next! React? NodeJS? HTML elements?
Comic: Have you Heard of Configuration Management?
Tags: devops, beginners, comics, automation
Published: 2020-04-16 17:26:31

---
title: Comic: Have you Heard of Configuration Management?
published: true
description: A gentle introduction to configuration management for beginners
tags: devops, beginners, comics, automation
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/a7jklvnm2xbcvp1wrese.jpg
series: Configuration Management 101
---

In this comic, you'll get a introduction to configuration management and how it can help improve your server infrastructure reliability over time.

![Comic: Have You Heard of Configuration Management](https://dev-to-uploads.s3.amazonaws.com/i/w64zs95wq8mjv04tug6a.jpg)

Transcription:

> Imagine you have to make a puppy house for your new puppy. This could work well for *one* puppy, but what if you get a new puppy ever week? No matter how good you are at making puppy houses, that won't scale well. Maintenance is also a problem.
**Configuration Management** allows you to streamline your infrastructure setup by defining a number of standard procedures for new servers. In the context of servers, configuration management tools will automate these procedures based on *provisioning scripts*.
By using configuration management, you'll assure that no matter who builds your puppy houses, they'll always look the same.

### Benefits

Some of the benefits of using configuration management include:

- Turning your infrastructure into code, and being able to version control it
- Ability to quickly recover from critical errors by spinning up new servers with the exact same configuration
- Sharing the same environment with coworkers and between different servers (testing, staging, production)

### Configuration Management Tools

There are many configuration management tools in the market. Some popular choices include:

- [Ansible](https://ansible.com)
- [Chef](https://www.chef.io/)
- [Puppet](https://puppet.com/)
- [SaltStack](https://www.saltstack.com/)

For a more detailed overview of configuration management for beginners, you can have a look at this series: [Getting Started with Configuration Management](https://www.digitalocean.com/community/tutorial_series/getting-started-with-configuration-management).
Do Java Code Streams Exist?
Tags: java, discuss, help, twitch
Published: 2020-04-16 17:18:44

---
title: Do Java Code Streams Exist?
published: true
description: Recently while doing some coding on Twitch I was posed a question, "Are there any people streaming Java?"
tags: #java #discuss #help #twitch
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ar6wn42uyqu8i4arbyr1.jpg
---
Recently while doing some coding on Twitch I was posed a question, "Are there any people streaming Java?"

It's an interesting question, as I've seen a lot of people streaming a lot of languages. The bulk of streamers seem to be streaming JavaScript and the related frameworks and tools like React, Node.js, Vue.js, and others. I've also seen a lot of people using Python, and a few doing things like Rust, C++, and a few others but barely anybody using Java.

With that stated, I'd love to find others writing Java apps on Twitch. Anybody have some pointers to anybody? Who do you , if you do, watch on Twitch?

{% youtube Eay5xmsyJtA %}

For JavaScript, Go, Python, Terraform, and more infrastructure, web dev, and coding in general I stream regularly on Twitch at [https://twitch.tv/adronhall](https://twitch.tv/adronhall), post the VOD's to YouTube along with entirely new tech and *metal* content at [https://youtube.com/c/ThrashingCode](https://youtube.com/c/ThrashingCode).

For more blogging, I've got https://compositecode.blog and the [Thrashing Code Newsletter](https://compositecode.blog/thrashing-composite-code-newsletter/), sign up for it [here](https://compositecode.blog/thrashing-composite-code-newsletter/)!
JavaScript arrow function
Tags: javascript
Published: 2020-04-16 17:17:02

###Introducrion
ES6 comes with a new function syntax which looks very different from others. Arrow functions were added in 2015, on the whole to make writing functions with less expression. Instead of using the "function" keyword, we can use an arrow (=>), which made up of an equal sign and a greater-than character (do not get confused with the greater-than-or-equal operator, which is written like >=).

###Syntax
<pre>
const variable = (parameter) => {
  // function body
}
</pre>
The arrow comes after a list of function's parameters and followed by the function's body. Which is same as,
<pre>
function functionName () {
  // function body
}
</pre>
If the function has only one parameter, we can omit the parentheses around the parameter list. If the body is a single expression, rather than a block in braces, that expression will be returned automatically from the function. So, these two function definitions will do the same thing.
<pre>
const func1 = (x) => { return x*x; };

cosnt func2 = x => x*x;
</pre>
If function has only a single argument in the argument list, its parameter list is just empty set of parentheses.
<pre>
const func = () => {
  return "Hello, world";
}
</pre>
egoless programming
Published: 2020-04-16 17:06:58

---
title: egoless programming
published: true
description: egoless programming
tags: 
---

I saw this link from a hnews discussion here: https://news.ycombinator.com/item?id=22864109

The original story is here: http://wiki.c2.com/?EgolessProgramming

My take on egoless programming (which I have had this opinion for as long as I could remember) is that code is transient and does not matter in the least.

I can write code and it will exist and some (changed) form of it will run and do something. But at the point I have written it and it is starting to do the job I wrote it for ... it feels like it is not part of me anymore. I have only a vague connection to the running thing that is my code.

So naturally criticizing or changing my code or fixing my code or replacing my code does not bother me in the least.

I picked up this attitude (I think) from when I was a musician many years ago. I found that I could play and sing and what would come out of mouth or from my hands would entertain people most of the time. Sometimes I imagine it horrified them too or made them ill. :)

But either way once I had sung/played music it left me. It was no longer my choice as to how people reacted.

I also used to be an artist ... maybe I still am. And my art was the same way. I could paint something and make it look like what I wanted but I could not control how people reacted to it. So even my art was completely separate. I was delighted that it was liked at all but never hurt if it was not. 

Let go of your code it is not you.
100daysofcode Flutter
Tags: 100daysofcode, flutter
Published: 2020-04-16 16:55:38

day 38/100 of #100daysofcode #Flutter
Learning Flutter , courses Udemy from
@maxedapps

Today still learning about form, text form field
not much today because of work
https://github.com/triyono777/100-days-of-code/blob/master/log.md
Framework vs library vs package vs module: The debate
Tags: library, framework
Published: 2020-04-16 16:44:04

---
title: Framework vs library vs package vs module: The debate
published: true
description: As a software developer, this is one of the questions that is often asked, and one of a big source of confusion. In the debate about the difference between frameworks, libraries, packages and modules, what does each one of them represent.
tags: #library #framework 
---

_[This article was first published in  my blog](https://hamza-tam.gitlab.io)_

As a software developer, this is one of the questions that is often asked, and one of a big source of confusion. In the debate about the difference between frameworks, libraries, packages and modules, what does each one of them represent.

### Module 

Is the smallest piece of software. A module is a set of methods or functions ready to be used somewhere else.

### Package

Is a collection of modules. This may sound funny, but usually what a package does, is gather a number of modules holding in general the same functional purpose. Making it easier to include all the related modules at once.

### Library

Well library at it's core, is a collections of packages. It's purpose is to offer  a set of functionalities ready to use without worrying about the subsequent packages. So a library is what you include when you want to add some functionality to your code. It does not force any coding style on you either.

### Framework

It's a set of libraries. But this time, the framework does not just offer functionalities, but it also provides an architecture for the development work. In other words you don't include a framework. You integrate you code into it. He is the wire frame of the project. That's why a framework forces its coding style on you.

I hope that this quick summary was enjoyable !
Why let was introduced in Javascript
Tags: javascript, todayilearned
Published: 2020-04-16 16:43:10


See this code
```
use strict
function f() {
  if (true) {
    var x = 1
  }
  return x
}
```

Try to run this function, and it will return '1'

Now see this
```
use strict
function f() {
  if (true) {
    let x = 1
  }
  return x
}
```

Try to run this function, and it will throw error.

Why?

Logically anything scoped inside if shouldn't be accessible outside, but 'var' was accessible outside, thats why in ECMA2015 JS introduced 'let' to achieve this.
📈 Fetch and use French COVID-19 dataset
Tags: bash, node, jq, covid19
Published: 2020-04-16 16:29:08

---
title: 📈 Fetch and use French COVID-19 dataset
published: true
description: Fetch and plot France offical COVID-19 dataset like theres no tomorrow
tags: bash,nodejs,jq,covid19
cover_image: https://i.imgur.com/7qGgOhr.png
---

The French government has published an [opensource](https://github.com/etalab/covid19-dashboard) [GIS website](https://dashboard.covid19.data.gouv.fr) to keep an eye on the current epidemic growth.

They also publish the [raw dataset](https://raw.githubusercontent.com/opencovid19-fr/data/master/dist/chiffres-cles.json) but it's a mess to deal with, so let's just scrap the hell of the homepage.

```sh
BASE=https://dashboard.covid19.data.gouv.fr
FILE=$(curl -s $BASE | grep -Po '/_next/static/[^/]+?/pages/index.js' | head -n1)
JSON=$(curl -s $BASE/$FILE | grep -Po "JSON.parse\('\[.*?\]" | cut -c13- | sed 's/\\.//g')
```

You can now plot your 1-month worth of data using your favorite language or spreadsheet.

Paris data as CSV using [jq](https://stedolan.github.io/jq/):

```sh
echo "$JSON" | jq -r '.[] | select(.nom=="Paris") | [.date,.deces,.reanimation,.hospitalises,.gueris] |@csv'
```

Or if your a pipe junky, this bad boy will show you a New/Total logarithmic representation as shown in [this video](https://www.youtube.com/watch?v=54XLXg4fYsc) :

```sh
echo "$JSON" | node -e "
JSON.parse(require('fs').readFileSync('/dev/stdin').toString())
.filter(d=>d.nom=='France')
.map((d,i,a)=>({...d,sum:a.slice(0,i).reduce((a,c)=>a+(c.hospitalises||0),0)}))
.map((d,i,a)=>[d.sum,d.hospitalises-(a[i-1]||{}).hospitalises||0])
.forEach(l=>console.log(l.join(' ')))
" | graph -T png -lx -ly -X 'Total cases' -Y 'New cases variation' | display
```
Here is the ouput for the whole country

![France](https://dev-to-uploads.s3.amazonaws.com/i/3sannlbn17udx2ji9n19.png)

Here is the ouput for the Paris region

![Paris](https://dev-to-uploads.s3.amazonaws.com/i/0q8q878dghu39ubrekgm.png)
Scroll snap effect
Tags: codepen, html, css, csseffect
Published: 2020-04-16 16:13:25

---
title: Scroll snap effect
published: true
tags: codepen, html, css, css effect
---

A few years ago when I show this effect then I can't imagine that this snap effect is possible with only pure CSS but this is true 👇🏼 this effect is created with only Html and CSS...

{% codepen https://codepen.io/atulcodex/pen/mdyOQab %}

Learn [CSS and get one free course](https://www.eduonix.com/the-ultimate-css-3-bootcamp/UHJvZHVjdC0xMzE1MDIw)
Scripting To Save Lives: A COVID-19 Charity where Developers can pitch in.
Published: 2020-04-16 16:09:30

# Introduction:

Recently, the world has been swept with the COVID-19 pandemic. Recently a few developers from the Glitch community and I founded <a href="https://scriptingtosavelives.com">scriptingtosavelives.com</a>. Let me explain how it works. Visitors have three main ways of helping out.

# The first way to help:

The first way to help us out is to donate code. Donating code makes the website look better and may even prompt more people to donate! More on that <a href="https://github.com/RiversideRocks/ScriptingToSaveLives">here.</a>

# The second way to help:

Visitors can create there own subdomain of our website tailored to their town! Just fill out the form <a href="https://developers.scriptingtosavelives.com">here.</a>

# The third way to help:

Visitors can donate money to one of the causes that we have showcased on our website. These causes need a lot of help now and we are proud to advertise them!

See you on <a href="https://ScriptingToSaveLives.com">scriptingtosavelives.com</a>!