teleren/devto huggingface dataset:
Recursion Illustrated with PseudoCode and Code
Tags: javascript, recursion, beginners, programming
Published: 2020-06-14 15:01:28

## WHAT IS RECURSION?
The simplest definition of recursion is simply when a function solves a problem by calling itself. Confusing right? Yes and no. I am going to illustrate how recursion works in both real life and in javascript in order to make things clearer.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3wgzsdk9jgcwjy0gdior.jpeg)

## HUNGER ILLUSTRATION
Imagine that you are hungry now and you will like to eat 'Jollof Rice'. Let us write the solution in pseudo code
```
 First you need to dish the Jollof Rice
      then you need to eat the Jollof rice
```
In Javascript, the code will look like this.
```
function eat(food) {
    dish(food)
    eatFood();
}
if(hungry) {
    eat('Jollof Rice')
}
```
If hungry is true, to eat, you dish the food and start eating. Simple right?

Except eating is not that simple. It involves carrying the rice with fork and chewing it before swallowing it.
```
function eat(food) {
    dish(food)
    eatFood()
}

function eatFood() {
    carryForkOfRice()
    chewAndSwallow()
}

if(hungry) {
    eat('Jollof Rice')
}
```
And then again and again, you carry fork and chew, the process only stops when you are satisfied. One spoonfull can not possible satisfy you right? You need to do it again and again. And that is why recursion comes in, the eat food function has to keep calling itself for the hunger to quench. Which means your eat food function has now gone **recursive** as it now calls itself over and over.
```
function eatFood() {
    carryForkOfRice()
    chewAndSwallow()
    eatFood()
}
```
But just as a computer has a limited memory, in the same way, your stomach can only take a sizeable amount of food. Which means your brain has to check after each for of rice whether you are satiated or not, in order to prevent overfeeding. This we implement by checking if you are satiated after swallowing food.
```
function eatFood() {
    carryForkOfRice()
    chewAndSwallow()
    if(satiated) {
        return
    } else {
        eatFood()
    }
}
```
In programming, a recursive function will continue to run perpetually until the computer runs out of memory. To prevent this, a breaking comdition is set. A good example is the if satiated clause condition in our eat food condition above.
Code Trends 0.0.4
Tags: rust, go, ai, trends
Published: 2020-06-14 15:17:07

---
title: Code Trends 0.0.4
published: true
description: Interesting trends in software development and code. This week: camera and video stuffs
tags: rust,go,ai,trends
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/rvvm2reby7j3g46y1jun.jpg
---

The coolest thing I’ve found this week is [IPTV](https://github.com/iptv-org/iptv). Literally 8000 public tv channels you can watch through your browser.

I’m working on a security camera solution and found [a distributed sql
lite](https://github.com/rqlite/rqlite). I love the idea of raft consensus between smart cameras. State syncing, updating, etc. You could make an api call to one camera and update all of them.

An [awesome-list of self hosted apps](https://github.com/awesome-selfhosted/awesome-selfhosted)

[Face rec (and other face ml things)](https://justadudewhohacks.github.io/face-api.js) in the browser. Yes it’s JS, yes it’s slow, but the cheapest machine to offload work to in the world
is the browser.

Fun. [Spotify in your terminal](https://github.com/Rigellute/spotify-tui)

[Want this in your inbox?](https://codetrends.substack.com/)

Hugs,
Where do you see yourself in 5 years?
Tags: career, discuss, goals, motivation
Published: 2020-06-14 19:39:07

I know it is quite a popular question on the interview, but do you think about this in everyday life or only during interview preparation?

Have you set goals for the next several years?

Are such thoughts/questions becoming less relevant over time, e.g. after 10, 15, 20 years of work?

*P.S. as for me, I think about it quite often, and I plan my future as I still have opportunities for growth.*
How to resolve missing 'libxcb-xtest0' package, when installing Zoom on Ubuntu 18.04
Tags: linux, ubuntu, zoom, apt
Published: 2020-06-14 20:59:09

This quick guide would walk you through installing Zoom video conferencing software and also teach you how to install packages from the Ubuntu store, using the libxcb-xtest0 package as a guide.

First, let me show you how to download and install the Zoom  software:

In your terminal, enter:

```
wget -O /tmp/zoom.deb https://zoom.us/client/latest/zoom_amd64.deb
```
This would download the zoom.deb file from the official website to the /tmp directory in your PC. 
You can as well download this file by accessing the Zoom website directly. The important thing is to note where you saved the file you downloaded.


Next up, in your terminal, enter:
```
sudo dpkg -i /tmp/zoom.deb
```
This would install .deb file.
If you downloaded the file by accessing the website directly, replace the /tmp there with the correct path.


After this installation, you would likely be faced with the unmet dependency problem as depicted in the image below.

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

This is caused by a missing libxcb-xtest0 package.

Doing 
```
sudo apt-get install libxcb-xtest0
```
would most likely not be of any help, because that package is somehow missing from the Advanced Package Tool (APT) store and cannot be gotten in that way, but you can try it out anyways.


So, this is what you do: 

Go to the [ubuntu manager page](https://packages.ubuntu.com/bionic/amd64/libxcb-xtest0/download) to download the libxcb-xtest0 package. 
Select your preferred mirror, based on your region and the download would start. 
Please note the folder where this is downloaded to.

On completion, in your terminal, navigate to the folder where this file was downloaded, and enter:
```
sudo dpkg -i libxcb-xtest0_1.13-1_amd64.deb
```
This would install the .deb package


Finally, run
```
sudo apt install -f
```


Hope you enjoyed my article and were able to resolve your issue.
Do leave a comment below so I can get your feedback.
Complete course on Infrastructure as Code(IaC) to Deploy EC2, EKS Kubernetes on AWS with Terraform
Tags: kubernetes, aws, terraform, techtter
Published: 2020-06-14 20:27:12

Hi.. I made some hands-on demo videos on AWS, Terraform & Kubernetes how to provision
- infrastructure as code on AWS,
- installing Jenkins,
- deploying apps,
- Autoscaling K8s cluster,
- Pod Autoscaling
It's complete hands on demos step by step. Interested..?? check the following links:

📌 Videos related to Kubernetes:
► What is Terraform:
https://www.youtube.com/watch?v=9wRaFwKEUKI
► Provisioning EKS cluster on AWS using Terraform: https://youtu.be/rv6MOvpXU90
► Kubernetes(EKS) Cluster Autoscaling & Horizontal Pod Autoscaling on AWS: https://www.youtube.com/watch?v=P1bfQy94aBk
► Jenkins installation on Kubernetes / AWS using Terraform: https://youtu.be/_uLeTb7eKR4
► Octant - Kubernetes Dashboard UI: https://youtu.be/S_-uOD3DNiM
► KinD - Kubernetes in Docker for K8s cluster on laptop: https://youtu.be/RTkoQiJ1x8w
► Kubernetes Basics Explained: https://youtu.be/KIV191levY4
► Kuberenetes Cheat Sheet: https://youtu.be/ik3iyhUmdO0
--------------------------------------------------------------------------------
📌 Docker related Videos:
► Docker Compose Explained with Spring Boot: https://youtu.be/ZZ2Llh4NhaY
► Docker Volumes Explained with Postgresql: https://youtu.be/QhjJPrnYIao
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2020-06-15 16:38:38

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
Every Monday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week. ❤️

### 1. Pride Month — What Does Equality in Tech Look Like?

Give it up for Super Diana who was generous enough to share her tech story (including what equality looks like to her in 2020) on DEV for Pride Month! 

{% link https://dev.to/superdiana/love-is-love-celebrate-it-31c1 %}

### 2. "Quotes Are Fun" - Anon. 

This cool tutorial by Tunde shows you how to use React state and Function to create a simple react app.

{% link https://dev.to/thinkc/build-a-random-quote-machine-with-react-41p4 %}


### 3. Work Smarter, Not Harder

Zoe gets granular on the difference between shallow work and deep work — and helps you achieve the latter!

{% link https://dev.to/zoebourque/a-guide-to-deep-work-how-to-achieve-the-ultimate-productivity-1mmg %}


### 4. First Time With Webpack

Carrie walks us through using Webpack for the first time by building a small JS program in Node.

{% link https://dev.to/carriepascale/a-very-beginner-s-guide-to-webpack-2jal %}


### 5. Time For Change

If you haven't been privy to the important decision many teams are making to rename their primary branch in git, Damian provides some important context and dives right into the renaming process. 


{% link https://dev.to/damcosset/replacing-master-in-git-2jim %}

### 6. Beyond Tables

As Lucas explains, some Ruby on Rails tables require a little personalization to reproduce real-world situations and the relationships between them. In this rundown, you'll learn how to do just that


{% link https://dev.to/luchiago/multiple-foreign-keys-for-the-same-model-in-rails-6-7ml %}


### 7. Doing More With Less Code

Taslan guides us through a few JavaScript Array methods to improve your code's readability and speed.

{% link https://dev.to/taslangraham/five-powerful-javascript-array-methods-57mi %}

---
_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
killing a process group
Tags: linux, tips
Published: 2020-06-15 01:58:41

electron-ssr will spawn a shadowcocks.py process, which cannot be killed simplely by `/usr/bin/killall electron-ssr`, this can cause problem of "port already being occupied" when trying to restart electron ssr, to kill all the processess belong to electron-ssr, use

    /usr/bin/killall -g electron-ssr
Termux tools continuation
Tags: hacking, android, terminal
Published: 2020-06-15 08:50:09

Here are a few more useful Termux tools that you can explore:

## Node.js

Node.js is a popular JavaScript runtime that can be used to build server-side applications. With Termux, you can install and use Node.js on your Android device, allowing you to run your server-side applications directly from the terminal.

To install Node.js on your Termux terminal, run the following command:
```

$ pkg install nodejs
```

Once installed, you can start using Node.js on your Android device.

Python
Python is a powerful and versatile programming language used in a wide range of applications. You can use Termux to install and run Python programs on your Android device. Termux provides access to Python 2.x and Python 3.x, making it suitable for most Python projects.

To install Python on your Termux terminal, run the following command:
```
$ pkg install python
```
After installing Python, you can start using it to run your Python programs.

## Nano

Nano is a simple and easy-to-use terminal-based text editor that provides basic editing functionality. It’s a great text editor for quick edits or for editing configuration files directly from the terminal.

To install Nano on your Termux terminal, run the following command:
```
$ pkg install nano
```
After installing Nano, you can start using it to edit text files directly from the terminal.

## SSH

SSH (Secure Shell) is a network protocol used for secure remote access to your Android device. With Termux and SSH, you can remotely access your device from another computer or mobile device.

To install SSH on your Termux terminal, run the following command:
```

$ pkg install openssh

```
Once installed, you can use SSH to establish a secure remote connection to your Android device from another device.

## Conclusion

Termux provides a versatile terminal emulator that can be used to run a variety of packages and tools. In this article, we discussed nine useful Termux tools that can enhance your terminal experience. With these tools, you can code on-the-go, monitor system resources, access Android APIs, and much more. Whether you are a developer, a system administrator, or just a terminal enthusiast, Termux provides a powerful and flexible terminal environment that can help you get things done on-the-go.
Road to Genius: smart #15
Tags: javascript, beginners, computerscience
Published: 2020-06-15 11:22:20

Each day I solve several coding challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, and you will learn a ton of new and interesting things as you go.

![coding challenge](https://dev-to-uploads.s3.amazonaws.com/i/1nwendzfc24i61ko6bjt.png)

From "smart" rank and up we will encounter problems which we actually have to fully analyze and solve, not just fixing a few bugs.

The code above starts with creating an array of numbers, then it declares two variables `R=0` and `T=2`. Further, we have a for-loop with a conditional `R++` operation, this executes only if `el` is equal to `T`. Due to the simplicity of the code, we can summarize the algorithm as such: the code is counting (using `R`) the number of occurrences of number `T` in the array.

Since `T=2`, we see that 2 appears only once in the array, so `R` should be 1:

![coding challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/d0w0bastwv9sm49x738i.png)

---

If you feel inspired and motivated to upgrade your coding + debugging skills, join me on the Road to Genius at https://nevolin.be/codr/
Pointers in Go
Tags: go, pointers
Published: 2020-06-15 14:29:36

---
title: Pointers in Go
published: true
description: Brief introduction on Pointers in go.
tags: go, pointers 
---
Pointers in golang gave me a hard time understanding them, for me that has been the biggest challenge when it comes to learning golang, so maybe I can give a brief walkthrough of what I used to help me understan pointers in Go.

A **Pointer** is a variable which is used to store the memory address of another variable.

**Operators**
Pointers comprise of two operators `*` and `&`. The `*` is used to *dereference* pointer variables, it is also used to represent/show that a variable is a pointer by putting it before the type of variable stored.
eg ``var length *int = 2`` .
The ``&`` is used to access the address of the variable and not the value. It is added before the variable.
Here is a simple example on how to declare, dereference,  get a variable's address and update a variable

``
// declare length of variable
var length int  =  12
// declare a pointer on the width type and get it's address
var width *int  =  &length
// log length which is 12
fmt.Println("creature =", length)
// log the address
fmt.Println("address =", width)
// dereference the width and log it
// you should get 12
fmt.Println("*pointer dereferenced", *width)
// change pointer value
*width =  13
fmt.Println("*pointer dereferenced", *width)
fmt.Println("*length value", length)
``
**Note** After changing the pointer value i.e width, the value of the length also changes since they are in the same address,  This is one of the reasons why you should use a pointer instead of a value, i.e if you want to make a change to a variable or update it and make it "persist".

**Example:** 
When passing an argument by value:
``
// Create a function called length that returns a number
func  length(x int) {
x =  12
}
func  main() {
x :=  5
length(x)
fmt.Println(x) // x is still 5
}``

When passing an argument using pointers.
``
func  length(x *int) {
*x =  12
}
func  main() {
x :=  5
length(&x)
fmt.Println(x) // x will return 12
}``

**Conclusion**
From this I hope you have a brief understanding on the use of pointers.

If you want to read more on pointers you can check out the following links.
[GopherConUk]([https://www.youtube.com/watch?v=yEiaCx0fR9k](https://www.youtube.com/watch?v=yEiaCx0fR9k))
[golang-book]([http://www.golang-book.com/books/intro/8](http://www.golang-book.com/books/intro/8))
[gopher-guides]([https://www.digitalocean.com/community/conceptual_articles/understanding-pointers-in-go](https://www.digitalocean.com/community/conceptual_articles/understanding-pointers-in-go))
Best Tools for Web Designer
Published: 2020-06-23 16:43:43

A web designer is someone who prepares content for the Web. His responsibility is to decide the overall look and feel of the website by using images and different technologies like HTML, CSS, Javascript, React, etc, to do so.
<a href="https://codersera.com/blog/best-tools-resources-for-web-designers/">Web designers</a> are often accomplished in various higher-level programming languages used to create scripts for the Web. Many of them also focus on the ability to create good-looking sites that will display well on a range of browsers and devices.
Nowadays there are a number of great web design tools are available in the market with different resources. For instance, website designers might work on a specific feature inside an app or develop a standalone feature; there’s a design tool for the same.
When I first started, I spent hours looking for the easiest way to design a website (using Photoshop) and turn it into a website. Eventually, I learned enough about WordPress to buy and install themes, I was a “web designer”.
So here I'm gonna present you some of the top Web designer tools that designers should try in 2020:

1. <B>Wordpress-</B>  WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database. Features include a plugin architecture and a template system, referred to within WordPress as Themes.
It has been at the top of the web design industry for a while now, and it continues to make waves and lead many other design tools.
This tool boasts over a thousand in-built themes and plugins that give users a variety of options to choose from and install, edit, and optimize the websites in a way that suits their taste and their needs.

2. <B>Photoshop-</B> This is another excellent tool if you are a creative web designer. The most amazing part of using this tool is that it allows you to create authentic websites since you’re creating digital artwork based on what you have drawn.

3. <B>Sketch-</B> Sketch is a web design software for Mac devices. It’s a professional tool focused on creating web templates and designs. It works with vector images, so you’ll get the best, highest-resolution results. The toolbar and options are very simple. Sketch gives you the full flexibility to create and manage your web design projects.

4. <B>Figma-</B> This flexible design platform helps demonstrate designs over the web. Designers and developers working independently or in a digital agency should consider adding Figma to their web design tools inventory for easy collaboration and real-time feedback from their clients.

5. <B>InVision-</B> Invision is also an amazing tool that lets you create advanced, vector-based screen designs fast thanks to flexible layers and infinite canvas. It's considered one of the best high-fidelity prototyping tools out there.
Ringtone collection
Published: 2020-06-23 14:31:09

Hi everybody
I'm looking for unique and funny ringtones for me to store them on my list. Can anybody help me find those ringtones?
Thank you
After searching for a while, I found a website that offers free ringtones for my phone, including categories like Sound effects, humor, games, nokia. , samsung, Iphone. , etc. You can download it at https://sonneriepro.com/ to set free phone ringtones.
How-To: Tracing React + Node in under 50 lines of code!
Tags: react, node, javascript, observability
Published: 2020-06-23 16:19:10

When you're building a React app, it can be difficult to know what's going on behind the scenes in terms of performance. When something's slow, how do you figure out why? There could be a hundred things at fault -- a bug in your reducer, a slow API, problems with the database, a network failure -- and tracking down these problems can be extremely time-consuming and frustrating.

What if there was an easier way to get answers? OpenTelemetry to the rescue! In less than 50 lines of code, you can trace every step in a request - from your React code, down to your database - in production with little additional overhead. In this video, I'll show you how to integrate OpenTelemetry into a React SPA and a Node.JS server built on Express, how to deal with common configuration problems, and how to verify that everything is working.

{% youtube utp-sOkFswY %}

Next time, we'll look at some deployment options for our application and explore building custom metrics in React. Join me then!
Have you been part of a project that failed? Why do you think that happened?
Tags: career, discuss
Published: 2020-06-23 17:41:18

One of the most frustrating experiences I've had as a software developer is to be part of a project that's doom to failure.

Some of the reasons for the failures I've witnessed are:
1. The business model of the software company doesn't allow for the flexibility needed to build the right software and have profit.
2. Lack of feedback from the real-world.

I think Reason 1 is most common when working with fixed quotes. What happens is that a client says he wants an app that does X, and the software company says it will cost Y$. But the truth is that the client doesn't know what X should do, with enough detail, to solve the problem they want to solve. This is perfectly normal since software development is a discovery process, and therefore we'll never know all we'll need before starting. The result is a quote that soon enough stops making sense, but that bounded both parties to building something useless. This creates a rigid environment that makes changing the course of a project so it can be useful and feasible extremely hard, since changing scope has financial implications. The renegotiations tend to drag so much and be so hostile that the project gets canceled. 

I've seen reason 2 happen when there's a lack of feedback from the end-user of the app. In situations like this, the client is not the end-user but assumes the role. The problem is that the client can't faithfully represent the user and doesn't communicate with him/her nearly enough. The result is building something that isn't useful to the user, or the client gets analysis paralysis and can't decide on what needs to be developed. Either way, the budget runs out before something useful is ever produced.

Have you been in a project that failed? Why do you think it failed?