teleren/devto huggingface dataset:
Learning Python on Twitch with a kids book!
Tags: twitch, coding, python, kids
Published: 2019-06-28 10:04:20

---
title: Learning Python on Twitch with a kids book!
published: true
description: Jim learns Python on Twitch from a Kids book!
tags: twitch, coding,python,kids
cover_image: https://thepracticaldev.s3.amazonaws.com/i/hguedpbapz2xyjl29q3t.png
---

**Follow me on Twitch at [twitch.tv/jimbobbennett](https://www.twitch.tv/jimbobbennett)**

I thought it would be fun to learn Python over [Twitch](https://www.twitch.tv/jimbobbennett), so others can see how I learn and can follow along learning themselves. There's a lot of great streams that assume some knowledge to get the most out of them, but this stream goes back to the 101 level which is great for total newbies.

The book I'm following is:

[Coding for Beginners: Using Python](https://amzn.to/2JfRBoZ)

<a href="https://www.amazon.co.uk/gp/product/1409599345/ref=as_li_ss_il?ie=UTF8&psc=1&linkCode=li3&tag=expecti-21&linkId=e7332562f8fb28b9188745a35472f86f&language=en_GB" target="_blank"><img border="0" src="//ws-eu.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=1409599345&Format=_SL250_&ID=AsinImage&MarketPlace=GB&ServiceVersion=20070822&WS=1&tag=expecti-21&language=en_GB" ></a><img src="https://ir-uk.amazon-adsystem.com/e/ir?t=expecti-21&language=en_GB&l=li3&o=2&a=1409599345" width="1" height="1" border="0" alt="Coding for Beginners: Using Python book cover" style="border:none !important; margin:0px !important;" />

This is from Usbourne publishers who publish fantastic kids books full of fun illustrations and jokes, and very accessible content. I loved them as a kid, and my six year old daughter loves them now - especially their [look inside book on space](https://amzn.to/2NjYhr9).

I did my first stream earlier this week, and unfortunately I didn't know to tick the boxes to save it on Twitch or publish to YouTube - the curse of being a Twitch newbie!

![A dog floating in space with a caption of I have no idea what I'm doing](https://media.giphy.com/media/xDQ3Oql1BN54c/giphy.gif)

Luckily I made a local recording, so it's on YouTube here:

https://youtu.be/6AQXrNphCBQ

I'll be streaming this regularly on Wednesdays at 12pm UK time, so come join in the fun!
Email me maybe
Tags: linux, devops, sre
Published: 2019-07-03 16:55:00

---
title: Email me maybe
published: true
tags: linux, devops, sre
canonical_url: https://ethereal.io/2019-06-28/email-me-maybe/
---

Back in the 9th of May I did a little talk/workshop at [Porto Codes](https://porto.codes/previous.html#2019-05-09) where I talked about the advantages and perils of owning your own email server, the hassles with spam and protecting your domain from being flagged as an origin, and so forth.

Halfway through I did a live demo where I installed a postfix/dovecot server from a clean Ubuntu installation. The purpose of this exercise was to demonstrate how easily and fast it could be done. Sure enough, I was done in less than 15 minutes, as it is indeed an easy task.

Since then I had some people asking me about the script that I followed for that demo, so it is now available [here](https://ethereal.io/sneakermail/).

Happy emailing!
Getting System Information in Linux using Python script
Tags: python
Published: 2019-06-28 08:54:48

Finding system information in Ubuntu like Number and type of processors, memory usage, uptime, etc are extremely easy.

You can use Linux system commands like free -m, uname -a and uptime to find these details. But there is no fun in doing that.

If you love coding in python, you want to do everything in python. So we will see how to find this information using the python program. And in the process will learn something about Linux system in addition to python.

To find few details we will use python module, `platform`. We will be running this script using python3 interpreter and this script is tested on Ubuntu 16.04.



**General Info:**
So platform module is used to Access the underlying platform’s identifying data.
We will be using some of the method available in this module.

To get Architecture, call architecture method. It returns a tuple (bits, linkage). 

To get the Linux distribution, call `dist()` or `linux_distribution()` method. It also returns a tuple.

```python
import platform

# Architecture
print("Architecture: " + platform.architecture()[0])

# machine
print("Machine: " + platform.machine())

# node
print("Node: " + platform.node())

# system
print("System: " + platform.system())

# distribution
dist = platform.dist()
dist = " ".join(x for x in dist)
print("Distribution: " + dist)
```


Now to get other information we need to go into `/proc/` directory of your system. If you look at files you will get an idea where system stores this type of information.


**Processor Info:**
Processor information is stored in `cpuinfo` file. Read the file and count the number and model name of the processor. 

```python
# processor
print("Processors: ")
with open("/proc/cpuinfo", "r")  as f:
    info = f.readlines()

cpuinfo = [x.strip().split(":")[1] for x in info if "model name"  in x]
for index, item in enumerate(cpuinfo):
    print("    " + str(index) + ": " + item)
```


**Memory Usage:**
Memory details are stored in `/proc/meminfo` file. The first line is the Total memory in the system and the second line is the free memory available at the moment. 


```python
# Memory
print("Memory Info: ")
with open("/proc/meminfo", "r") as f:
    lines = f.readlines()

print("     " + lines[0].strip())
print("     " + lines[1].strip())
```


[Continue Reading.....](https://www.pythoncircle.com/post/535/python-script-9-getting-system-information-in-linux-using-python-script/)


**More from Author:**

- https://dev.to/anuragrana/collecting-one-million-website-links-3jc5
- https://dev.to/anuragrana/wishing-merry-christmas-in-pythonic-way-47mk
- https://www.pythoncircle.com/post/518/scraping-10000-tweets-in-60-seconds-using-celery-rabbitmq-and-docker-cluster-with-rotating-proxy/
- https://www.pythoncircle.com/post/485/python-script-8-validating-credit-card-number-luhns-algorithm/
Collecting one million website links
Tags: python, requests, scraping
Published: 2019-06-28 08:48:25

I needed a collection of different website links to experiment with Docker cluster. So I created this small script to collect one million website URLs.

Code is available on [Github](https://github.com/anuragrana/Python-Scripts) too.


**Running script:**

Either create a new virtual environment using python3 or use the existing one in your system.
Install the dependencies. 


```python
pip install requests, BeautifulSoup
```


Activate the virtual environment and run the code. 


```python
python one_million_websites.py
```


**Complete Code:**

```python
import requests
from bs4 import BeautifulSoup
import sys
import time


headers = {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
    "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.167 Chrome/64.0.3282.167 Safari/537.36"
}

site_link_count = 0

for i in range(1, 201):
    url = "http://websitelists.in/website-list-" + str(i) + ".html"
    response = requests.get(url, headers = headers)
    if response.status_code != 200:
        print(url + str(response.status_code))
        continue
    
    soup = BeautifulSoup(response.text, 'lxml')
    sites = soup.find_all("td",{"class": "web_width"})
    
    links = ""
    for site in sites:
        site = site.find("a")["href"]
        links += site + "\n"
        site_link_count += 1

    with open("one_million_websites.txt", "a") as f:
        f.write(links)
    
    print(str(site_link_count) + " links found")

    time.sleep(1)
```


We are scraping links from site http://www.websitelists.in/. If you inspect the webpage, you can see `anchor` tag inside `td` tag with class `web_width`.

We will convert the page response into BeautifulSoup object and get all such elements and extract the `HREF` value of them. 

![](https://www.pythoncircle.com/media/uploads/python-script-10-collecting-one-million-website-links-20180713-9d289d48854e4e408d007a9e32c53957.png)


Although there is a natural delay of more than 1 second between consecutive requests which is pretty slow but is good for the server. I still introduced a one-second delay to avoid 429 HTTP status.

Scraped links will be dumped in the text file in the same directory.  



Originally Published on [**pythoncircle.com**](https://www.pythoncircle.com)

More from [PythonCircle](https://www.pythoncircle.com):
- [Hosting Django App for free on PythonAnyWhere Server](https://www.pythoncircle.com/post/18/how-to-host-django-app-on-pythonanywhere-for-free/)
- [Scraping 10000 tweets in 60 seconds using celery, RabbitMQ and Docker cluster with rotating proxy](https://www.pythoncircle.com/post/518/scraping-10000-tweets-in-60-seconds-using-celery-rabbitmq-and-docker-cluster-with-rotating-proxy/)
- [5 common mistakes made by beginner python programmers](https://www.pythoncircle.com/post/602/5-common-mistakes-made-by-beginner-python-programmers/)
Func - a modern command-line framework
Tags: javascript, typescript, node
Published: 2019-06-28 08:31:29

# About func

Recently, I created a modern command-line framework with the idea of easier design and Developer Experience, and i call it `func`. 

You can easily create a command line tool with func. [Learn more at GitHub](https://github.com/WittBulter/func).


It has more advantages than previous frameworks:

  - Volume of very small packaging 
  - Elegant grammar and item structure without any thinking burden
  - Very few dependence, maximum optimized running speed
  - With the support of a complete template, one key can develop


# Document Site Preview

![preview](https://thepracticaldev.s3.amazonaws.com/i/hv8l7vqgzeiangrpd4wm.png)
How to Choose a Technology Stack for Mobile App Development
Tags: angular, techtalks, javascript, reactnative
Published: 2019-06-28 08:17:56

When it comes to mobile app development, one of the most crucial decisions is to choose the right technology stack. Consequently, it will serve as a basis for your mobile app functionality, scalability, and maintenance. Paying attention to the type of project, time to market and validation of the idea might be helpful when choosing a technology stack. Basically, the technologies should supplement your product’s purpose. For example, a cross-platform approach will be a great solution for startups, while native development is suitable for building a complex mobile app with great performance.
Therefore, this article focuses on the different ways that will help you to organize and build a mobile app. We will discuss native, hybrid, cross-platform development along with PWA approach, its main technologies, pros and cons.

Learn more: https://2muchcoffee.com/blog/how-to-choose-a-technology-stack-for-mobile-app-development/
What is your favorite company development culture/motto ?
Tags: discuss
Published: 2019-06-28 08:13:16

---
title: What is your favorite company development culture/motto ?
published: true
description: 
tags: discuss
---
I just read this [discord blog](https://blog.discordapp.com/how-discord-stores-billions-of-messages-7fa6ec7ee4c7) and saw this

> This is actually part of our company culture: **build quickly to prove out a product feature, but always with a path to a more robust solution.**

So that is how discord work, this is something I need to learn to do and it kind of fun too :).
I wonder what other development culture/motto out there
Centring Overlapping Content with CSS Grid
Tags: grid, css, layout
Published: 2019-06-28 08:04:49

---
title: Centring Overlapping Content with CSS Grid
published: true
description: How to overlay content on top of an image or other element simply using CSS Grid.
tags: grid, css, layout
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qxg70fwmu6u3sndtcxz1.jpg
canonical_url: https://bennypowers.dev/posts/centring-overlapping-content-with-css-grid/
---

So you've got an image and you want to centre some content over it.

```html
<figure id="beshalach">
  <a href="/beshalach-1520/"><img src="./images/beshalach-15-20.jpg" alt="Exodus 15:20" /></a>
  <figcaption><a href="/beshalach-1520/">Exodus 15:20</a></figcaption>
</figure>
```

In the past, you'd probably have reached for our old friend absolute positioning:

```css
figure {
  position: relative;
}

figcaption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
```

This is fine. `git commit -m "Job's done" && git push`. *Buuut* maybe we can do a little better. Using CSS grid we can accomplish the same result, but in what strikes me as a more declarative syntax.

```css
figure {
  display: grid;
  place-items: center;
  grid-template-areas: 'image'
}

figure > * {
  grid-area: image;
}
```

With these rules, we've defined a 1-by-1 grid with a single area named 'images', which all of its content fits into. With that established, the source order takes over to paint the caption on top of the image. No need for position, z-index, etc.

This has several advantages: 
1. It's **declarative**. These styles describe the intended outcome, instead of the steps the developer thought should be taken.
2. It's **readable**. I don't know about you, but future me probably wouldn't see `top: 50%; left: 50%; transform: translate(-50%, -50%);` and immediately think "centred!"
3. Flex and Grid have a simpler mental model for [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context) which is the darkest of black arts.


So next time you need to overlap content, consider using `grid` instead of `position`.
Pro Motivate
Published: 2019-06-28 06:44:12

Promotivate is a leading International Speakers Agency with offices in Europe, UK & Ireland and South America. We specialize exclusively in providing Speakers and Keynotes to Companies & for International Conferences worldwide with a focus on Europe and South America’s principal cities where we have offices. Our leading speakers bring impact, demonstrate proven success and share knowledge, method, and ambition which audiences can learn from. They are leaders and innovators, bright people with fresh ideas. For more details at:https://pro-motivate.com/location-london-conference-speakers/
Scroll parallax 3d ( xrp website )
Tags: codepen
Published: 2019-06-28 06:37:07

---
title: Scroll parallax 3d ( xrp website )
published: true
tags: codepen
---

<p>remake parallax from xrp website</p>

<p><a href="https://ripple.com/xrp/" target="_blank">https://ripple.com/xrp/</a></p>

{% codepen https://codepen.io/elecweb/pen/Zdaxyb %}
How to master database design?
Tags: needhelp, question
Published: 2019-06-28 06:32:20

---
title: How to master database design?
published: true
description: 
tags: needhelp,Question
---

This is my first post in dev.to (probably first in any of developer communities) and i am feeling nervous. I am not a good writer and my English is also bad. So please bear with me and my English.

I have been working with React and JavaScript for the past 2 years and felt this is the time to switch to backend. So i started giving backend interviews, as i am familiar with java, python, SQL and mongodb. In one interview i was asked to design Whatsapp (DB Models and Rest Apis). I started writing models(classes) and came up with 4-5 models (which is very less in my opinion). And i also confused as to a method should be in which model. Then i decided i want to learn Database design, and the best way to do (atleast for me) is to design and implement an application from scratch. I googled and found some app ideas, but i just wanted check here first. I am in the right direction? Is there anything i am missing? And also any app ideas to learn design are welcome.
Running Ubuntu From A USB Drive
Tags: linux, setup, ubuntu
Published: 2019-06-28 05:20:59

Hey, guys! I had quite the adventure today trying to run Ubuntu on my son's laptop from a flash drive, so I thought I would share what I learned here in case some of you would like to try it. 
The laptop I am presently using for coding classes is an Asus ROG Gaming Laptop. It has an Intel i7 processor, 16 gb of ram, and a 1TB HDD. There are still over 250 gb of space left, so, theoretically, I could run Ubuntu on this machine as a dual boot with the current Windows 10 OS, but that would require me to partition the drive, which I haven't tried before, so I decided that, since this isn't my computer, I'd go for the less invasive option. 

The steps for making this happen are as follows:
1. [Download Ubuntu](https://ubuntu.com/download/desktop)
2. [Download Rufus](https://rufus.ie/) and create a bootable drive.
3. Edit Power Button Settings in Windows Control Panel
4. Copy Ubuntu to flash drive.
5. Edit System Bios
6. Run Ubuntu

**Download Unbuntu** Depending on your system and network, this can take from 30-45 minutes. 

Next, **Download Rufus**. You will use Rufus to create your bootable USB drive. I found [these instructions](https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows?_ga=2.178864676.1005760627.1561695937-212263140.1561695937#0) from Ubuntu's website very helpful. Follow them to create your bootable drive. 

Next, you'll need to [change the settings for your power button](https://www.windowscentral.com/how-disable-windows-10-fast-startup). Make sure you complete this step **before** you alter the system Bios.

Once Ubuntu download is complete, you'll need to alter your system bios to boot from your USB drive **first** and Windows OS 2nd. To do this in Windows 10 is much more complicated than it once was in previous Windows Versions. 
You will have to go to the settings tab to accomplish this. 

    Select Settings at the Windows menu
    Select Update & security.
    Select Recovery from the left menu.
    Click Restart Now under Advanced startup. ...
    Click Troubleshoot.
    Click Advanced options.
    Select UEFI Firmware Settings. ...
    Click Restart.

Your computer should now boot to the Bios. Make sure the flash drive is plugged in when the Bios comes up. Different Bios can operate in various ways but on my system, I was able to choose the Boot tab and change the boot order of the computer. So now this laptop will boot from the USB drive first, then the C: drive, where Windows 10 OS lives.

Now, Restart your computer with the USB drive. The Ubuntu menu will load. Choose 'Try Ubuntu without Installing.' A usable version of Ubuntu will load! 

Fantastic! I am finally using Ubuntu and am loving how fast it is. Many of you recommended it in [this post](https://dev.to/angelarae63/laptop-requirements-for-coding-3l0n) and now I know why. I have downloaded Visual Studio and am ready to go!
Data Scientists|Engineers: What are the Frameworks you use the most at your job?
Tags: discuss, datascience, python, machinelearning
Published: 2019-06-28 05:20:11

---
title: Data Scientists|Engineers: What are the Frameworks you use the most at your job?
published: true
description: 
tags: discuss, datascience, python, machinelearning
cover-image: https://cdn.pixabay.com/photo/2015/10/30/15/04/green-tree-python-1014229_960_720.jpg
---

I've seen a lot of statistics about programmers, but not specifically about Data Scientists or Engineers.
Because of that, I'd like to propose this survey:

1. Do you identify as a **Data Scientist** or **Data Engineer**?
2. What are the **languages and frameworks** you use the most at your job? Say, the top 5 or 6.

As a bonus:
3. What are the Frameworks you *wish* you were using instead?

I will write back with some visuals or analysis if this gets enough traction. 
Of course all the data will be public here, so you can do your own too.
Qué Lenguaje de Programación Debería Aprender ?
Tags: python, csharp, php, java
Published: 2019-06-28 05:19:48

Cuando iniciamos en el mundo de la programación, de una manera autodidacta, se nos genera una laguna de dudas  que nos induce a navegar en miles de blogs, podcast,  y demás medios.

Pero no solo pasa  cuando iniciamos por nuestra cuenta, sin ningún tutor o instituto sino que tarde o temprano llegamos a esa pregunta.

Qué lenguaje debo aprender? 

![](https://thepracticaldev.s3.amazonaws.com/i/7zm49zsacnbuxlomw21y.gif)

esta pregunta no tiene una respuesta en concreto, pero si varias sugerencias.

En el mundo de la programación tienes varias etapas, no las citaré todas, solo la primera: 

![](https://thepracticaldev.s3.amazonaws.com/i/ij32hdqw0xcddewz1e9f.PNG)

1.- Cuando estas   aprendiendo lo esencial de la  lógica computacional, la cual es independiente de todo lenguaje. 

En esa etapa el lenguaje que uses no debería importar, lo que tienes que tener en cuenta es que no agregue una capa de complejidad a lo esencial.


Ok, ya sé lo esencial, quiero formarme para el mundo laboral o superar un reto personal, que hago?

Bien, entonces lo que necesitas ahora es análisis, necesitas saber donde estas parado, necesitas saber que tecnología domina tu territorio. 

![](https://thepracticaldev.s3.amazonaws.com/i/y87y6ittbcj0wzmmtp82.png)

Algo que no se menciona en algunos artículos de esta naturaleza,  es que necesitas saber que tecnologías usan más las instituciones publicas y privadas  de tu país, con el fin de que puedas encontrar trabajo con facilidad, ya que si aprendes a programar en C#(lenguaje de programación) pero la mayoría de trabajo que ofrecen en tu país es de Java(lenguaje de programación), realmente si quieres cobrar y vivir de lo que haces, no veo como C# puede apoyarte. 

No digo con esto que no puedas aprender más de un lenguaje, solo que necesitas saber tu contexto y adaptarte a él para que puedas desempeñar lo aprendido de una manera mas rápida.


En mi caso, en mi país C# es utilizado por el estado y por el sector privado, pero a mi me encanta Python(lenguaje de programación)... Aprendí C# y tecnologías de Microsoft  para poder subsistir, al final de eso se trata, ojo que no olvidé Python, mis proyectos personales y para clientes cercanos lo hago en él. 

Python es atractivo para lo laboral en otros países a los cuales quiero migrar más adelante, actualmente trabajo con C# e intento mejorar  cada día y hasta comenzó a gustarme. 


La conclusión es que investigues primero y tomes decisiones en base a la misma, puedes entrar a paginas de buscar trabajos y filtrarlo por desarrollo de software, desarrollo web, preguntarle a una persona cercana o que tengas contacto   que te diga que tecnologías de desarrollo se usan más pero siempre orientado a tu país.


Ahora sí te daré una lista lista de lenguajes para aprender  la lógica programación:

1.- Python
2.- JavaScript
3.- Php
5.- C#

![](https://thepracticaldev.s3.amazonaws.com/i/ixisow64qt0jcl3mmlxf.gif)
A native JavaScript paint and draw app
Tags: paint, draw, javascript
Published: 2019-06-28 05:15:05

---
title: A native JavaScript paint and draw app
published: true
description: I paint and draw project I made a while back
tags: paint, draw, javascript
canonical_url: https://github.com/victorqribeiro/paintDraw
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jx3qh8pdz7slrnqarwfw.gif
---


# Paint and Draw 

I made this project a while back. I always enjoy using the native functionalities of JavaScript to develop my projects. This one is no different. I was bored in class and decided to do something fun. I end up making this very simple app. Since I liked it a lot, I decided to upload it to GitHub and maybe work on it a little bit more latter on.

Hope you like it to.

[Live Version](https://victorribeiro.com/paintDraw)
[Source Code](https://github.com/victorqribeiro/paintDraw)