teleren/devto huggingface dataset:
Day 440 : ATLiens 25
Tags: hiphop, code, coding, lifelongdev
Published: 2021-08-27 21:56:39

_liner notes_:
- Professional : Started the day off finding out that an update to some libraries didn't automatically increase the version number. I normally don't work on these libraries and was just helping out by updating a package. Cool thing was that I was able to update the version numbers in GitHub, in VS Code, in the browser. May talk about it on the Sunday show and do a demo. I created another screenshot and added code snippets to a blog post I've been working. It's pretty much done. Got it added to the Content Management System. I may add some text between some screenshots because it kind of looks like one long screenshot. Also added a couple of cosmetic things the team asked to be added to another demo application I've been working on. Not a bad way to end off the week.

- Personal : Last night, I worked on getting my new laptop to be able to do the the tasks to get ready for the radio show. I went through the process of getting tracks and listening to them, and converting them to the file type I use. I was successful it getting everything working. Watched an episode of Boruto. Then made a quick mock up to work out the layout for a part of my side project. I also randomly figured out how I want to be able to let people add themselves to a map. Basically, they will be able to click a button that will get there latitude and longitude via the Geolocation and then I'll use that to put on a map and then use reverse geocoding from openstreetmap.org to get the City to put in the info bubble. Pretty good night.

![A mountain in Castleton, United Kingdom at sunset with a winding road wrapping around it.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qobcz91i5j3u8xbp0vze.jpg)

Tonight, I'm going to do a test run of the new equipment for the radio show. I want to make sure the audio records properly and I can transfer it to my new laptop. A whole lot of new happening, what could go wrong? haha Also need to finish up prepping for the radio show. About to eat dinner and watch an episode of Boruto. Today also marked the 25th Anniversary of OutKast's "ATLiens" album. Had such an impact on me when I first heard it.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube cEXsOqXP34s %}
#100daysofcode [Day - 05]
Published: 2021-08-27 21:22:09

Hey There , Today is my fifth day of 100 days coding challenge.and today i tried to make a site of random users by using random user api . Here is the live site : https://random-user-using-api.netlify.app/ And here is the code link : https://github.com/thekawsarhossain/100-days-of-code/tree/main/day%2005
Welcome to my dev journal
Tags: devjournal, beginners
Published: 2021-08-27 21:04:18

#_You know if your code works or if it doesn't. And this is powerful._#


I moved in London three years ago, 2018, but it was only during the lockdown that I really started to question myself about what I really want to do in my life. I guess it was a great time of reflection for everyone. Basically I was not happy with my choices and the lockdown pushed everything to the limit.

This general feeling of unease lead to a very interesting conversation with my dear friend F. to whom I mentioned my life-long passion for coding that, for some unknown reasons, I never really followed.

In middle school, the girl I had a massive crush on asked me to burn her a cd with some songs. Instead of just writing a cd containing the mp3s I created a menu with the 'autorun.inf' automatically showing a window with a soundtrack and button to play the songs.(She wasnt impressed though....)

Later on I explored Turbo Pascal, Visual Basic, Fortran 77 and bits of web development (HTML, CSS, JS) on my own and thanks to my high school / uni.

I never asked myself the big question: why not trying to properly learn coding? (I was studyin Civil Engineering and Architecture).

It was F. who, after that chat, realised how much I would enjoy it and kept pushing me everyday for a couple of months until I paid the subscription to LeWagon for the part time bootcamp.

Now, at only one month left to the bootcamp and after five quite intense months I realised that coding makes me happy. It delivers so much: abstract problem solving is extremely rewarding because of the validation coming mainly from yourself.

After finishing the lectures we started coding our first airbnb clone. Every single day of those two weeks was so exciting. I would start coding after dinner and suddenly it was 2am and I wasn't even tired. 

This must mean something, right?
Capstone Project 
Published: 2021-08-27 20:55:58

## This project has been developed to  showcase the skills that I have gathered through the four weeks of bootcamp. 

## The main focus is to be able to create an authentication system wherein a user can log in to see the next page of the site. The credentials when a user creates a new account gets stored in a database. 

# First we will need to create our directory which will store our code. And then later on we would start importing the modules that are needed to make sure our application is built successfully. 

#Import The Tkinter Function
What does import tkinter do in Python?
Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit

##Importing the mysql connector
#What is MySQL connector in Python?
MySQL Connector/Python enables Python programs to access MySQL databases, using an API that is compliant with the Python Database API Specification v2. 0 (PEP 249). It is written in pure Python and does not have any dependencies except for the Python Standard Library.

#Connecting to the Database
In the code below, which is for the connection to the mysql database.

#Lastly is the main window
So first of all you have to design the main display. This display screen have two buttons Login and exit. So let’s see the way to put into effect this.(Python Language with Source Code for Login Page with MySql Database)

You can also minimize or maximize the design of main screen window as in line with your choice and make it extra attractive.
When the above code is executed, let’s see the output of this code.(Python Language with Source Code for Login Page with MySql Database)

In this Login Page in Python with MySql Database with Source Code, I use the mysql.Connector library to set up a connection.
How do you merge millions of small files in a S3 bucket to larger single files to a separate bucket daily?
Tags: aws, database, devops, datascience
Published: 2021-08-27 20:49:47

We have a situation where we're currently uploading events to s3 in real-time. The result is roughly 30 million tiny json files (<1kb) per day. These files sit in a raw layer bucket with the following folder format  `"#{folder_name}/#{year}/#{month}/#{day}/#{hour}/#{minute}/#{System.os_time()}-#{file_name}.#{file_ext}"`. We want to send this to a data warehouse for analytics but need the files to be much larger (150-200mb). What solutions are there for merging json files from a s3 bucket back to a separate s3 bucket. I have tried developing a lambda to tackle this problem but it was not enough since all the files must be downloaded in `/tmp` and lambda ran out of memory. Please help :)
Python Boot Camp.
Published: 2021-08-27 20:39:45

## What is a coding bootcamp?
Coding bootcamps are an innovative new form of short-term, intensive, and often immersive education designed to provide aspiring tech professionals the technical skills they need to start careers in software engineering and other tech fields.

When you enroll in a coding bootcamp, you have several options to choose from based on your individual educational needs. The curriculum and the value you receive from any type of bootcamp are the same, the biggest difference is the schedule.

While some students can invest more time in a coding program, others require more flexibility.
IPython with Vim shortcuts [RE#7]
Tags: vim, python, ipython, productivity
Published: 2021-08-28 18:42:40

---
title: IPython with Vim shortcuts [RE#7]
published: true
date: 2021-08-27 20:30:00 UTC
tags: vim, python, ipython, productivity
canonical_url: https://babakks.github.io/article/2021/08/27/re-007-ipython-with-vim-shortcuts.html
series: "Regular Encounters"
---

If you’re a Vim fan like me, probably you’ve already set your shell editor mode on `vi` by appending this line to `~/.bashrc` (or for ZSH users, like me, `~/.zshrc`):

```
set -o vi
```

But not all editors take this setup into account. One of the most revered REPL environments for Python people is _IPython_. The good news is IPython lets you opt to `vi` shortcuts by just running it like this:

```
ipython --TerminalInteractiveShell.editing_mode=vi
```

(Thanks to **imiric** for [this](https://stackoverflow.com/a/38329940/7089799) great answer.)

If you’re using IPython as Django shell or you just want to make the setup above as a persistent default, open `~/.ipython/profile_default/ipython_config.py` (if it was already there, otherwise read on), look for `c.TerminalInteractiveShell.editing_mode` parameter and set it like this:

```
c.TerminalInteractiveShell.editing_mode = 'vi'
```

If you couldn’t find the file don’t attempt to create it by yourself. Just create it with this shell command:

```
ipython profile create
```

* * *

**_About Regular Encounters_**  
_I’ve decided to record my daily encounters with professional issues on a somewhat regular basis. Not all of them are equally important/unique/intricate, but are indeed practical, real, and of course,_ **_textually minimal._**
How to quickly start a webpack project
Tags: javascript, webpack
Published: 2021-08-27 20:24:00

In this article, I'll show a simple way to start a webpack project with [degit](https://www.npmjs.com/package/degit)

# degit
degit is a tool that lets you take another repository from GitHub and use it to scaffold your project. You can see it being used in serious projects such as [SolidJS](https://how-to.dev/how-to-start-a-project-with-solidjs).

# webpack-starter
Since I started working on this blog, I created more than 10 repositories with simple applications build with webpack. As I try keeping the code rather minimalistic, in most cases, all the projects end up almost the same. So today, I created a starter project to save me few seconds when starting new demo projects.

# Usage
```
$ npx degit how-to-js/webpack-starter
npx: installed 1 in 0.671s
> cloned how-to-js/webpack-starter#HEAD

$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
added 121 packages from 158 contributors and audited 121 packages in 3.164s

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npm run build                    

> webpack-starter@1.0.0 build /home/marcin/workspace/github/webpack-starter-demo
> webpack

asset main.js 22 bytes [compared for emit] [minimized] (name: main)
./src/index.js 23 bytes [built] [code generated]

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/

webpack 5.51.1 compiled with 1 warning in 186 ms
```

The resulting application does nothing but says hello in the development console.

# Links
* [webpack-starter](https://github.com/how-to-js/webpack-starter)
* [webpack video course](https://bit.ly/WebpackCourse)

# Summary
In this article, I have presented a simple project started for the webpack application.
Simple Face
Tags: python, programming
Published: 2021-08-27 19:17:02

This is a simple program to draw a simple face using the graphics module created by John Zelle.

```python
# simple_face.py
#   Drawing of a simple face
# by: Scott Gordon

from graphics import *


def main():
    win = GraphWin("Face", 300, 300)
    win.setCoords(-3, -3, 3, 3)
    win.setBackground("white")
    center = Point(0, 0)

    head = Circle(center, 2)
    head.setFill("yellow")
    head.draw(win)

    eye = Circle(Point(-1, .50), .25)
    eye.setFill("black")
    eye.draw(win)

    eye2 = eye.clone()
    eye2.move(2,0)
    eye2.draw(win)

    mouth = Line(Point(-1, -.5), Point(1, -.5))
    mouth.setWidth(7)
    mouth.draw(win)

    win.getMouse()
    win.close()

main()

```
Steps for installing K3s on Ubuntu.
Tags: rancher, suse, k3s, ubuntu
Published: 2021-08-27 19:02:06

In the kubernetes world, there are so many distros available today -  kubeadm, Minikube and many more.
But, what's K3s?

Let's begin!

##What's K3s?

K3s is a fully CNCF(Cloud Native Computing Foundation) certified, compliant Kubernetes distribution by SUSE(formally Rancher Labs) that is easy to use and focused on lightness. Also, the deployment of applications with this lightweight kubernetes is faster. K3s has a built foundation on a single binary which is less than 100MB in size.

Advantage of K3s.
* Small Size
* Fast Deployment
* Lightweight
* Continuous Integration
* Simplified and Secure
* Perfect for IoT and Edge Computing.

If you want to learn more about K3s, just visit the [K3s documentation](https://rancher.com/docs/k3s/latest/en/).

Let's jump into the installation steps.

Step 1:
```
curl -sfL https://get.k3s.io | sh -
```
After installation of k3s if you run `kubectl get node`, you will get an error for that reason step 2 is important.

Step 2:

To make kubectl work run these commands.
```
mkdir -p $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.* $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
```
Now, it's ready!
Go and check the node:)

It's pretty easy to install K3s, just in few seconds.

That's all, hope you have enjoyed it.
Happy Reading!
Target
Tags: python
Published: 2021-08-27 18:43:45

This is a simple drawing of a target created using Python and the graphics.py module created by John Zelle.

```python

# target.py
#   Archery target drawing using layered circles
# by: Scott Gordon

from graphics import *


def main():
    win = GraphWin("Target", 600, 600)
    win.setCoords(-6, -6, 6, 6)
    win.setBackground("grey")
    center = Point(0, 0)

    circle1 = Circle(center, 5)
    circle1.setFill("white")
    circle1.draw(win)

    circle1 = Circle(center, 4)
    circle1.setFill("black")
    circle1.draw(win)

    circle1 = Circle(center, 3)
    circle1.setFill("blue")
    circle1.draw(win)

    circle1 = Circle(center, 2)
    circle1.setFill("red")
    circle1.draw(win)

    circle1 = Circle(center, 1)
    circle1.setFill("yellow")
    circle1.draw(win)

    win.getMouse()
    win.close()


main()
```

```python


```
O que é visibilidade em atributos
Tags: braziliandevs, programming, codenewbie
Published: 2021-08-27 18:27:59

Na Orientação à objetos temos diversos modificadores de visibilidade: *Public, Private e Protect.* São keywords comuns em diversas linguagens de programação orientadas à objetos - Indicam o nível de acesso aos componentes internos de uma classe - Logo abaixo, enumerarei algumas diferenças entre seus respectivos acessos aos componentes da classe:

| Modificadores       | Modo de acesso     |
| :------------- | :----------: | 
| public | Classe atual e todas as outras classes.  | 
| privado   | Apenas a classe atual. |
| protect   | Classe atual e todas suas sub-classes. |
```java:
public class ExemploClasse: {
  public String name; // O acesso ao atributo name é público para todas as outras classes.
  private double number; // O atributo number não poderá nem ser lido ou modificado - Ao não ser pela própria classe - Ou seja, o dono dos dados da classe é a própria classe. Assim, caso queira alterar propriedades da classe - Nunca diretamente - É indicado utilizar invocações de métodos da classe.
  protect String city; // Somente será acessado através da própria classe - Como visto anteriormente no private - Mas, ao contrário do private, as sub-classes também obterão acesso. 
}
```
Debugging an Angular mobile app
Tags: angular, chrome, android, mobile
Published: 2021-08-27 18:23:41

When working on a mobile app in Angular, we need to test and debug mobile events (such as pinching) that are not triggered from the desktop chrome or Android simulator.
 - Run the application on the local network
```bash 
ng serve --host 0.0.0.0 
```
 - Reach app from mobile phone use ip address and port number
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3vrx5jovh1lr4gsf4xu.png)
 - Activate developer options on phone - tap 7 times on **Build Number** (Settings > About Phone > Build Number)
 - Enable **USB Debugging** (Settings > System > Developer Options > USB debugging)
 - Connect phone to computer via usb and **allow usb debugging**
 - Add to address line ` chrome://inspect#devices `
 - Inspect app
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9sp1bow2iwllv5vh7j1m.png)
I ditched what I worked on for months...
Tags: music, audio, synthesizer, iot
Published: 2021-08-27 18:18:36

...but I didn't threw it out.

I worked on [Ava sound engine](https://github.com/funktional-stdo/ava) for quite some time. I made it from scratch, in C++. C++ is a good choice for audio-related programs, such as the DAW that inspired development of Ava. I decided to separate the DAW's interface with its processing unit, and Ava was born there. It's still in the development.

But Ava was also intended to be used for another project I've been working on for two years too: a digital IoT-based hardware synthesizer. It was/is my university thesis project.

The idea was to turn data from nature, into sounds. But all through the internet and wirelessly.
The basic flow of the device is that there are a unlimited number of ESP8266 (something like Arduino) devices that each have a sensor connected to them. They share their sensor data in a network connected to the internet.
There is a processing unit, a raspberry pi, which receives all of these data and turns them into sounds and MIDI signals. The sounds can be heard when it gets produced, but you can run the MIDI signals into other instruments!

And there is a dashboard that you can use to manage all the sensor nodes in the network, as well as controlling how their data is processed and turned into notes; so you can choose which musical scale the device makes notes in. Or which sound wave type the sound should have. Or how long each note should play. And more!

I intended to use Ava as the sound engine for device. But it was too hard to integrate it with all the python code and have them exchange data without bugs. So I had to ditch Ava in this project. It was sad but it made the project much more easier to develop and flexible.

Anyways, the synthesizer is called "Natural." It's also fully open-source. The repo is [here](https://github.com/funktional-stdo/natural-synth)!

It's not done yet, but it's so close to version 1 release! I don't know how many hours I've worked on this, I know I'm having fun tho.

I'll write more about it when the version 1 gets ready!
How to Deploy Django in Production With Nginx and Gunicorn
Tags: django, nginx, python
Published: 2021-08-27 18:13:45

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. However, Django, an inbuilt development server, is not suitable for deploying your Django application since it isn’t scalable enough for production use.
 
NGINX is open-source software for web serving, reverse proxying, caching, load balancing, media streaming, and more. NGINX is the best-in-class load‑balancing solution used by high‑traffic websites such as Dropbox, Netflix. 

Gunicorn, coined from ‘Green Unicorn’, is a Python HTTP Server for UNIX. Gunicorn interfaces with both Nginx and your actual python web-app code to serve dynamic content, as Dev Zero demonstrates in his project on Education Ecosystem.

This article will explain how to deploy our Django web application via Nginx and Gunicorn.
Setting your Django project.
Once your code has moved to the server, make sure all required installations are present on the server.

This code will install Python, pip, and Nginx.

sudo apt install python3-pip python3-dev nginx

Next, install all the packages required by your application in your virtual environment next. Install gunicorn with pip.

Pip install gunicorn

Then, open the port where we want to run the application.

sudo ufw allow 8100


Configuring Gunicorn
A socket is a special file for interprocess communication, which enables two processes to communicate. You now need to create a socket file for gunicorn. 

Use the following command to create your file;

sudo vim /etc/systemd/system/gunicorn.socket

Create a service file for Gunicorn and specify a user name, the working directory for our project, the virtual environment for our project, and a sock file. Gunicorn is the Django web server that needs to know the user. Gunicorn needs to know the working directory for the project and to know the virtual environment folder. You also need to create a sock file for the project. The sock file communicates with Nginx, and they are both able to communicate through this socket.

sudo vim /etc/systemd/system/gunicorn.service

Enable the Gunicorn socket using this command;

sudo systemctl start gunicorn.socket
sudo systemctl enable gunicorn.socket
 
Configuring Nginx
Now you need to create the configuration file for Nginx, using the following command;

sudo vim /etc/nginx/sites-available/Lorem_Test_Project

Activate your configuration, then finish by a restart of Nginx.

sudo ln -s /etc/nginx/sites-available/Lorem_Test_Project /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Your application is up and running!

Summary
Running a local Django server is not recommended in production because it’s just a test server, not a production-ready server. 

This article is a guide to show you how to run Django in production with Gunicorn. It uses Nginx as the reverse proxy to make your application more secure.