teleren/devto huggingface dataset:
loops(python3)
Tags: python, codenewbie, motivation
Published: 2020-04-22 18:29:25

Sometimes, you need to perform code on each item in a list. This is called iteration, and it can be accomplished with a while loop and a counter variable.
For example:


words = ['hello', 'words', 'viggies', 'eggs']
counter = 0
max_index = len(words) - 1

while counter <= max_index:
    word = words[counter]
    print(word + '!')
    counter = counter+1



sololearn
Reactive Architecture InShort!! 
Tags: architecture, reactivemenifesto, systemdesign
Published: 2020-04-22 18:25:47

####Why Reactive System?
_It’s increasingly obvious that the old, linear, three-tier architecture model is obsolete._
_- A Gartner Summit track description_

**What has changed over the time?**
- Few years ago, large applications had tens of server, seconds of response time,  hours of offline maintenance time and gigabytes of data.

- Today applications are getting deployed on mobile devices to cloud-based clusters, running thousands of multi-core processors. Modern users expect **millisecond** response times and **100% uptime**. Data is measured in Petabytes.

Current users software demand can not met by yesterday's system architecture. 

**What is Reactive System?**

We have already identified the all necessary aspects of the modern system architecture. We want systems that are **Responsive**, **Resilient**, **Elastic** and **Message Driven**. We call these **Reactive Systems**.

![Reactive System](https://dev-to-uploads.s3.amazonaws.com/i/arnwai1e6fs9n6k8s415.png)

Its core meaning has been formalized with the creation of the Reactive [Manifesto2](https://www.reactivemanifesto.org/pdf/the-reactive-manifesto-2.0.pdf) in 2013, when Jonas Bonér collected some of the brightest minds in the distributed and high-performance computing industry – Dave Farley, Roland Kuhn, and Martin Thompson to collaborate and solidify what the core principles were for building reactive applications and systems. The goal was to clarify some of the confusion around reactive and build a strong basis for what would become a viable development style. 

Responsiveness means
React to user/client in timely manner ~= real time !

Resilience ~=Stability
Ability to withstand failure

Elastic ~= Scale up(> request traffic) and Scale Down (< request traffic)

Message Driven ~= Asynchronous and non blocking messaging behaviour
How to Install Linux for the First Time
Tags: linux, beginners, popos, tutorial
Published: 2020-04-22 18:21:13

---
title: How to Install Linux for the First Time
published: true
description: If you've ever wanted to install Linux but were afraid to modify your computer, or simply don't know how this is the video for you.
tags: Linux, beginner, popos, tutorial
canonical_url: https://www.jeremymorgan.com/blog/linux/how-to-install-linux/
---

*If you've ever wanted to install Linux for the first time but don't know where to start, this is the video for you.*

One reason people often don't want to install Linux is that they don't want to wipe out Windows, or repartition their hard drive, etc. But today's computers handle virtualization quite well, and you can follow the steps in this video to install Linux quickly and easily. 

Here are some great courses to help you learn Linux:

* **[Getting Started with Linux](https://bit.ly/LinuxGettingStarted)**
* **[Linux Installation and Initial Configuration](http://bit.ly/PSLinuxInstallation)**
* **[Getting Started with the Linux Command Line](https://bit.ly/PSLinuxCommandLine)**

So what are you waiting for? It's time to try out Linux now!!

Let me know what you think in the comments!
Getting out of the comfort zone
Tags: androiddevelopment, android, beginners
Published: 2020-04-22 18:20:03

---
title: Getting out of the comfort zone
published: true
description: 
tags: android development, android, beginner 
---
 Success is usually on the other side of your comfort zone. You usually get the feeling to step out of your comfort zone but the resistance is usually too great and you end up falling back to your old habits.
In programming, the same applies. You might be good in coding in a particular language and you have mastered your craft, but if you don't take on new challenges and set out time to learn new things, you'll become 'outdated'. 
  Set small achievable goals, Have a journal to write your thoughts(I'm old-school) and always be willing to learn. Remember nothing good comes easy.
Placeholder title
Tags: twiliohackathon
Published: 2020-04-22 18:13:01

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
#### Category Submission: 


## Demo Link
 

## Link to Code


## How I built it (what's the stack? did I run into issues or discover something new along the way?)


## Additional Resources/Info
Nintendo Switch Midi Controller with Max MSP
Tags: tutorial
Published: 2020-04-22 18:04:23

Thanks to all the free time lately, I've been dabbling into a different kind of development, one that bridges my passion for music production with programming.

Max, also known as Max/MSP/Jitter, is a visual programming language for music and multimedia developed and maintained by San Francisco-based software company Cycling '74. You can learn now about it [here](https://cycling74.com/products/max/)

In this video, I'll show you how to turn a Nintendo Switch JoyCOn into a drum rack sample trigger!

{% youtube U8GwmTjnCac%}


If you'd like to try it out for yourself, code is here:

{% github madebygps/m4l-game-midi-controllers no-readme%}

If you have ANY feedback at all, please let me know in the comments below or reach out to me on socials.

Thanks for reading and possibly watching!
How to monitor application using probes in OpenShift?
Tags: openshift, kubernetes, node, devops
Published: 2020-04-22 17:32:05

## Objective
- Add Readiness Probe to Node JS Application
- Add Liveness Probe to Node JS Application

### Step 1: Deploy nodejs application using s2i
Refer [How to deploy application using Source to Image (S2I) in OpenShift?](https://dev.to/sagarjadhv23/how-to-deploy-application-using-source-to-image-s2i-in-openshift-35di) blog

### Step 2: Open dashobard
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0cel2l32oizumq0bixvh.JPG)

### Step 3: Login with developer user
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4gh9651vwalcehgul87r.JPG)

### Step 4: Go to project my-project
 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u3giro05sq49ibso1kqi.JPG)

### Step 5: Go to application nodejs
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jbug1hw2e5tk2thzjtaz.JPG)

### Step 6: Go to deployment
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qy864vpgzbv80yiaaolg.JPG)

### Step 7: Go to health checks
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xpnl0xylr6njv0m5rzuk.JPG)

### Step 8: Add readiness probe
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/laa9bkk021sksa5q9hct.JPG)

### Step 9: Add liveness probe & save
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9qb1tm23b6tm5xv77g60.JPG)

### Demo
{% youtube _y32cqqBH2Q %}
What's inside /etc/apt/sources.list
Tags: linux, bash
Published: 2020-04-22 17:22:55

And also quite possibly inside `/etc/apt/sources.list.d/`

Upfront, the `/etc/apt/source.list` is a configuration file for Linux's Advance Packaging Tool, that holds URLs and other information for remote repositories from where software packages and applications are installed.
Same goes with files inside `/etc/apt/sources.list.d/`.

Basically, when an installation command is executed, eg. `apt-get install <package_name>` then the Package Management System looks inside `/etc/apt/sources.list` and `/etc/apt/sources.list.d/` for the remote repository link, and searches for the desired application to be downloaded.

" One of the reasons why there are two places for list instead of one, is in order to make sure data are not overwritten/lost during a system update. `/etc/apt/source.list` may be overwritten in update as this tend to happen with `/etc/profile`. That is also why custom configurations that generally goes inside `/etc/profile` file are preferably placed inside `/etc/profile.d/` directory. "

A single link inside `/etc/apt/sources.list` file looks like this:
`deb-src http://security.ubuntu.com/ubuntu eoan-security universe`

On interpreting individual word:
**deb-src**
- debian source files that needs to be compiled. It can also be **deb**, which means precompiled debian source files.

**http://securty.ubuntu.com/ubuntu**
- The URL where the repository is stored

**eoan-security**
- The version name of the repository

**universe**
- How the software is available to end users
- It can be one of `Main`, `Restricted`, `Universe` or `Multiverse`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7v3en0y1daw6hsebdlk1.png)



Overall:
`deb (or deb-src) address distribution_name package_type_list`
range(python3)
Tags: python, codenewbie
Published: 2020-04-22 17:22:54


The range function creates a sequential list of numbers.
The code below generates a list containing all of the integers, up to 10.



#------------------------------------
ex.

nums = list(range(2,20,2))
print(nums)


[2, 4, 6, 8, 10, 12, 14, 16, 18]





solo learn
FRANCNSTEIN©  | Created 𝗐𝗂𝗍𝗁 ❤
JavaScript error handling pattern tip
Tags: javascript, webdev
Published: 2020-04-22 17:22:44

Don't throw a <code>new Error(msg)</code> if you not sure you handle it everywhere you use a module. It can break your app and it's not ideal UX for a user. You can follow the Either pattern from FP to avoid such situations.
```javascript
// success and error cases
Success: { _tag: "Right", right: "Success data" }
Error: { _tag: "Left", left: "Error message" }

// helpers to define right or left value
export const isLeft = (left) => {
  switch (left._tag) {
    case 'Left':
      return true
    case 'Right':
      return false
  }
}

export const isRight = (right) => !isLeft(right)

export const right = (right) => ({ _tag: "Right", right })

export const left = (left) => ({ _tag: "Left", left })

// simple usage
import * as E from 'helpers/either'

const success = E.right("some value")
const error = E.isLeft("some error")

console.log(isRight(success) && success.right) // "some value"
console.log(isLeft(error) && error.left) // "some error"
```
100daysofcode Flutter
Tags: 100daysofcode, flutter
Published: 2020-04-22 16:57:28

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

Today finishing tutorial about user input and form, and the next course is http request...:)
https://github.com/triyono777/100-days-of-code/blob/master/log.md
Manually downloading a software package using apt
Tags: linux, ubuntu, bash
Published: 2020-04-22 16:55:02

Packages are generally installed with below command:
`apt-get install <package_name>`
`apt install <package_name>`

Using the `--download-only` option will only download the package and not install it
`apt install --download-only <package_name>`

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

The downloaded files are inside `/var/cache/apt/archives`

The package can then be manually installed with `dpkg -i <package_name>`

Be warned it may cause dependency resolution error for a number of different reason:
1. The `--download-only` option only downloads the package and not the dependencies
2. `dpkg` can not resolve dependency, which is also why `apt` or `apt-get` were built on top of it to solve this and some other drawbacks.
Difference between Array.slice() and Array.splice()
Tags: javascript
Published: 2020-04-22 16:36:15

In javascript, we use two methods slice() and splice() very often, but still, get confused between them. Here you can have a quick look at these methods and find the difference.

##1. Uses.
`slice()`: This method is used to select array elements.
`splice()`: This method is used to add/remove elements to/from an array.

##2. Number of Arguments.
`slice()`: This method can take a maximum of 2 arguments.

`Syntax: array.slice(start, end)`
 
`start`: It specifies where to start the selection of elements.
`end(optional)`: If the 2nd argument provided, elements from the start position up to the end of the array will be returned(excluding the end position).

Example:
```
let array = [1,2,3,4,5];
array.slice(1)  //returns [2,3,4,5]
array.slice(1,3) //returns [2,3]
```

`splice()`: This method can take n arguments. 

`Syntax: array.splice(start, removeCount, item1, ...., itemN)`

`start`: It specifies at what position to add/remove items.
`removeCount(optional)`: It specifies the number of items to be removed
`item1,...itemN(optional)`: Items to be added to the array.
Example:
```
let array = [1,2,3,4,5];
array.splice(1)  //returns [2,3,4,5]
array.splice(1,3) //returns [2,3,4]
array.splice(2,1,6,7); //here it return [3] as it removes the element at index 2.
                       //console.log(array) is [1,2,6,7,4,5]
```

##3. Return Value:
`slice(start, end)`: It returns the array of elements begin with the start and up to the end of the array excluding the end index.
Example:
```
let array = [1,2,3,4,5];
array.slice(1,3)  //returns [2,3]
```

`splice(start, removeCount)`: It returns the array of removed elements begin with start index with number of removeCount.
Example:
```
let array = [1,2,3,4,5];
array.splice(1,2)  //returns [2,3]
```

##4. Mutability:
`slice()`: This method doesn't change the original array. But it is considered as [Accessor method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
Example:
```
let array = [1,2,3,4,5];
array.slice(1)  //returns [2,3,4,5];
console.log(array) // [1,2,3,4,5]
```

`splice()`: This method is [mutator method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) as it modifies the original array.
Example 1. 
```
let array = [1,2,3,4,5];
array.splice(1,2)  //returns [2,3]
console.log(array) // [1,4,5]
```

Example 2. 
```
let array = [1,2,3,4,5];
array.splice(2,1,6,7)  //returns [3]
console.log(array) // [1,2,6,7,4,5]
```

Thank you.
Ditching apt-get for apt
Tags: linux, bash, ubuntu
Published: 2020-04-22 16:35:07

Well not really ditching, but if we are to believe in linux command manuals, then `apt` is being encouraged over `apt-get`, not that `apt-get` is being deprecated in any sense.

I like to think of `apt` as a churned down version of `apt-get` and `apt-cache`. I have been regularly using `apt-get`. `apt-cache`, however, is a different story.
A quick `man apt-cache` tells me `apt-cache` performs a wide variety of operations on APT's package cache. I know APT stands for Advance Packaging Tool, and is something the debian based linux distros use for compiling and installing software packages. `apt-cache`, on further google search, seems to do 'stuffs' with the packages in the **remote** repository.

Anyway, `apt` has command lines most frequently used in both `apt-get` and `apt-cache`. `apt` tends to make performing task easier for "end users". We can think of `apt-cache` and `apt-get` as something that works on lower level than `apt`. 

Again, point to note is that `apt-cache` and `apt-get` are like the front end to the debian's `dpkg` tool, which is the core tool of the Package Management System. The `dpkg` tool can, however, only work with locally existing software packages. It means it cannot itself download software packages from remote repositories. To overcome this, we have many other tools built on top of `dpkg`, out of which, and not very surprisingly, `apt-get` and `apt-cache` are some of those. And when `apt-get` and `apt-cache` are again 'combined' in a sense, we get `apt`.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2wfsk15qism8jfymswey.png)
list functions (PYTHON3)
Tags: python, codenewbie
Published: 2020-04-22 16:25:02


So it I described it, I would say list allow you to do just that. Create a list of things.  Simple yup!


List in Python are ordered and have a definite count. The elements in a list are indexed according to a definite sequence and the indexing of a list is done with 0 being the first index. Each element in the list has its definite place in the list, which allows duplicating of elements in the list, with each element having its own distinct place and credibility.

Note- Lists are a useful tool for preserving a sequence of data and further iterating over it.


#--------------------------------------
ex. 

numbers = list(range(20))
print(numbers)


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]





FRANCNSTEIN | Created 𝗐𝗂𝗍𝗁 ❤
Learning Web - 01
Tags: webdev, css, beginners
Published: 2020-04-22 16:09:02

I've been following a tutorial series on Web Dev. 
Halted the progress on that to practice some basic CSS, Flexbox and Grid to create a responsive layout.
The idea was to experiment a bit with the design for specific theme [here is the result on my githubpage](https://vguerreiro.github.io/webdev_experiment-01/).
On to Javascript
EDITLY - Slick, declarative command line video editing
Tags: node, javascript, opensource
Published: 2020-04-22 15:58:24

I created an opinionated, easy to use JS library and CLI that lets you cut/assemble videos without a GUI.

Editly is a tool and framework for declarative NLE (non-linear video editing) using Node.js and ffmpeg. It allows you to **easily and programmatically** create a video from set of clips, images and titles, with smooth transitions between.

There is a simple command line for quickly assembling a video from a set of clips or images, or you can use it from Javascript!

Inspired by [ffmpeg-concat](https://github.com/transitive-bullshit/ffmpeg-concat). The problem with that project is that it is quite slow and uses an extreme amount of disk space, especially for HD/4K videos. This projects solves that by doing **streaming** editing, so it doesn't store any temporary files.

[![demo](https://github.com/mifi/gifs/raw/master/commonFeatures.gif)](https://youtu.be/LNeclLkxUEY)

This GIF/YouTube was created with this command:
"editly [commonFeatures.json5](https://github.com/mifi/editly/blob/master/examples/commonFeatures.json5)"

Hope you find it useful!

https://github.com/mifi/editly
.gitignore Generating Tool
Tags: git, gitignore, tools
Published: 2020-04-22 15:54:47

Hi everyone,

I've been worked in projects with different stacks like Python, Java, JavaScript... and I found a very useful tool to generate `.gitignore` files according to the technologies you are using and I want to share it with you.

Take a look:
https://www.gitignore.io/

Thanks
Selecting an Element
Tags: javascript, beginners
Published: 2020-04-22 15:50:30

---
title: Selecting an Element
published: true
description: the document object & querySelector
tags: javascript, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/6x8c82cyajxt1kfxrcep.jpg
---

In JavaScript if we want to select an element inside our DOM and for example we want to change the color, we can do it this way
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0xolzk50d3zur7loc3a2.png)
The **document** object contains the method **querySelector** that allows us to point to the element that we want to
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/93l0yth5zbk9p3yfkl77.png)
As in the example above we pass inside **querySelector("ID / CLASS / TAG /  and ATTRIBUTE but just [INSIDE SQUARE BRACKETS ]")**
No matter how many elements match our call; will always be selected the first starting from the root element and down to the last element
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d5z42rhwexf08c5f4b4g.png)
There are other ways to select multiple items at once but we'll talk about it in another moment (querySelectorAll).
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ntjbspl0eis1uzny271c.png)
In the example above we see that every element has the querySelector method too so we may select an element children through its father without going through the root element and going down the whole tree.
I am one of the world’s leading experts on sloths and the founder of The Sloth Conservation Foundation, ask me anything!
Tags: ama, watercooler, earthday
Published: 2020-04-22 15:48:17

Hello - Happy Earth Day! My name is Dr. Rebecca Cliffe and I am considered to be one of the world’s leading experts on sloths. I have spent the last 11 years living in the Costa Rican jungle where I have been researching the behaviour, ecology and physiology of wild sloths. During my years living in the jungle I have been infected with a flesh eating parasite, chased by killer bees and been stranded on a real-life desert island for three days. 

Four years ago I founded [The Sloth Conservation Foundation](https://slothconservation.com/); a registered non-profit organisation that is dedicated to saving sloths in the wild through research and conservation initiatives. Through SloCo, we have developed a range of community-based strategies and programs that are providing sustainable ways in which humans and sloths can coexist peacefully. Today I am based full-time in Costa Rica where I manage all of the foundation’s in-field sloth conservation and research programs.

Ask me anything!
Facebook agreed to censor "anti-state" content in Vietnam
Tags: news, discuss
Published: 2020-04-22 15:39:47

## **[Reuters: Facebook agreed to censor posts after Vietnam slowed traffic](https://www.reuters.com/article/us-vietnam-facebook-exclusive/exclusive-facebook-agreed-to-censor-posts-after-vietnam-slowed-traffic-sources-idUSKCN2232JX)**

> “We believe the action was taken to place significant pressure on us to increase our compliance with legal takedown orders when it comes to content that our users in Vietnam see,” the first of the two Facebook sources told Reuters.

How do you feel about this?
Got any tips for folks looking to live Earth consciously?
Tags: watercooler, opensource, discuss, earthday
Published: 2020-04-22 15:35:52

---
title: Got any tips for folks looking to live Earth consciously?   
published: true
description: Got any tips for folks looking to live Earth consciously?
tags: #watercooler, #opensource, #discuss, #earthday
---

Today, we're celebrating Earth Day on DEV! 🌍🌏🌎

{% link https://dev.to/devteam/today-is-earth-day-devs-can-have-an-impact-f81 %}

In light of this, I'm wondering if anybody has any tips for folks looking to live more Earth consciously. Alternatively, you can just talk about what you're personally doing to help keep this planet healthy. Every little bit counts!

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

Got any tips? Drop'em below!
Make your Angular App faster using Dynamic import
Tags: angular, javascript
Published: 2020-04-22 15:33:25

#Tips to make your angular app faster:
while importing your module using lazy loading helps

``` { 𝑝𝑎𝑡ℎ: 'ℎ𝑜𝑚𝑒', 𝑐𝑜𝑚𝑝𝑜𝑛𝑒𝑛𝑡: 𝐻𝑜𝑚𝑒𝐶𝑜𝑚𝑝𝑜𝑛𝑒𝑛𝑡;} ```

To using loadChildren:

```{𝑝𝑎𝑡ℎ: 'ℎ𝑜𝑚𝑒', 𝑙𝑜𝑎𝑑𝐶ℎ𝑖𝑙𝑑𝑟𝑒𝑛: './ℎ𝑜𝑚𝑒/ℎ𝑜𝑚𝑒.𝑚𝑜𝑑𝑢𝑙𝑒#𝐻𝑜𝑚𝑒𝑀𝑜𝑑𝑢𝑙𝑒'}```

to make even better use dynamic import() function in Javascript.

```{
    𝑝𝑎𝑡ℎ: 'ℎ𝑜𝑚𝑒',
    𝑙𝑜𝑎𝑑𝐶ℎ𝑖𝑙𝑑𝑟𝑒𝑛: () => 𝑖𝑚𝑝𝑜𝑟𝑡('./ℎ𝑜𝑚𝑒/ℎ𝑜𝑚𝑒.𝑚𝑜𝑑𝑢𝑙𝑒').𝑡ℎ𝑒𝑛(𝑚 => 
    𝑚.𝐻𝑜𝑚𝑒𝑀𝑜𝑑𝑢𝑙𝑒)
  },```

import statement return a promise. you read more about in given link.

 link:: https://javascript.info/modules-dynamic-imports