teleren/devto huggingface dataset:
Learnig a new Programming Language (PYTHON)
Tags: python, beginners
Published: 2020-04-01 03:40:59

The best way to learn a new Programming Language is to write programs, better projects on that language.

So in this post you are going to join while I make my very firsts steps with Python.

Before coding, we should get [Python](https://www.python.org/downloads/) and if you want an IDE like [Sublime Text](https://www.sublimetext.com/3) or [Visual Studio Code](https://code.visualstudio.com/download)
Maybe if you just want to learn and practice in a faster way, you could use [Repl.it](https://repl.it/languages/python3)

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

Our first baby step is going to be the most common and famous code.
Yes! "Hello world" inside brackets of a print.
```python
print("Hello world")
```
So, write the code then click on **run** and voilà!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n7t7hqryynnc7p6sq7w1.png)

Now let start with some variables
```python
character = 'c'
string = "This is a string"
number = 1
decimal = 3.14159
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9c12ewvrhqjrttjf2v3u.png)
Usando especificaciones OpenAPI
Tags: spanish, api, openapi, swagger
Published: 2020-04-07 12:18:01

---
title: Usando especificaciones OpenAPI
published: true
date: 2020-04-01 03:00:00 UTC
tags: spanish, api, OpenAPI, Swagger
---

# Que es esto que me enviaron cuando pedi documentacion de una API?!?

Te han pedido incorporar una API de terceros en tu aplicacion y cuando pedis la documentacion, te envian un archivo json o una url indicandote que alli esta la especificacion OpenAPI (o la documentacion Swagger) …

Y ahora? Esto como se come?

Bien, la especificacion OpenAPI (anteriormente conocida como especificacion Swagger) es un formato para describir APIs REST. Podes encontrar mas info sobre OpenAPI en el [sitio oficial](https://swagger.io/docs/specification/about/) (en ingles)

Supongamos que queremos integrar una API que nos da acceso a la biblia a nuestra aplicacion, y nos indican que la documentacion se encuentra en https://api.scripture.api.bible/v1/swagger.json

Si intentamos acceder en nuestro navegador, veremos el contenido del archivo json, con gran cantidad de informacion

![Image](https://i.imgur.com/bxGvwHL.png)

Una mejor forma de acceder, es utilizando el editor que OpenAPI nos provee, el mismo se encuentra en https://editor.swagger.io/ y veremos en primer lugar una documentacion de ejemplo de la API Petstore

Para cargar nuestra documentacion de biblia, debemos utilizar el menu File -> Import URL y alli pegar la URL de la documentacion

![Image](https://i.imgur.com/ywiUncX.png)

Veremos a nuestra izquierda, el archivo json formateado y a la derecha paneles que nos permitiran interactuar con las distintas direcciones que provee la API

![Image](https://i.imgur.com/n2inlMX.png)

Podemos acceder a detalles de una direccion en particular

![Image](https://i.imgur.com/qC5HEyC.png)

Y utilizando el boton Try it out, podemos ejecutar llamadas de prueba, ver parametros de entrada y ejemplos de salida.

En el caso de esta API de biblia, antes de poder hacer llamadas tenemos que tener acceso a un token de autorizacion, el mismo se carga en la opcion Authorize, otras APIs pueden tener distintas implementaciones de seguridad, por lo que la informacion a ingresar aqui depende de cada caso.

![Image](https://i.imgur.com/GFKEmCx.png)

Espero que este breve tutorial les haya sido de utilidad y les sirva como punto de entrada para comenzar a utilizar swagger de forma mas sencilla y eficiente

Nos leemos!
Rotting Oranges 🍊
Tags: codenewbie, beginners, career, interview
Published: 2020-04-01 03:24:44

This is a great problem looking at how to deal with grid problems.

In a given grid, each cell can have one of three values:

the value 0 representing an empty cell;
the value 1 representing a fresh orange;
the value 2 representing a rotten orange.

Every minute, any fresh orange that is adjacent (4-directionally) to a rotten orange becomes rotten.

Return the minimum number of minutes that must elapse until no cell has a fresh orange.  If this is impossible, return -1 instead.

###Example 1:
![problem for image](https://assets.leetcode.com/uploads/2019/02/16/oranges.png)

Input: [[2,1,1],[1,1,0],[0,1,1]]
Output: 4

###Example 2:

Input: [[2,1,1],[0,1,1],[1,0,1]]
Output: -1
Explanation:  The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally.

###Example 3:

Input: [[0,2]]
Output: 0
Explanation:  Since there are already no fresh oranges at minute 0, the answer is just 0.

Since this problem deals with a grid you can already start thinking of two different techniques. Either you utilize a depth-first or breadth-first method. 

###Solution 🙌
Looking at this I utilized a queue in a breadth-first traversal to solve this problem. First I iterate through the grid and add all rotten oranges to a list, this will give me a starting point. After I have gotten all initial rotten oranges I go through each rotten orange and convert it's neighbors to rotten if an orange exists. With a list of neighbors that have turned rotten, I add them to my rotten list with a counter denoting the "minute" that it turned. I use this minute each time I add a new set of neighbors to the rotten list.

{% gist https://gist.github.com/austinmsuarez/c4b94ecc13321365fe9aa92980562c57 %}

Hope you liked this post, please follow and clap for more! Throw your implementations in the comments below! 🙏
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2020-04-01 02:47:07

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

@saurabhdaware shared their fun text-to-handwriting project in **[What was your win this week?](https://dev.to/jess/what-was-your-win-this-week-1gc8)**:
{% devcomment n3lo %}

@roelofjanelsinga provided an answer to the prompt of **[Is PHP Dying?](https://dev.to/mayankjoshi/do-you-still-use-php-448h)**:
{% devcomment n499 %}

@bugsysailor shared their response to **[What is a project, you are really proud of?](https://dev.to/mayankjoshi/what-is-a-project-you-are-really-proud-of-201g)** 🌇:
{% devcomment n6kj %}

@roelofjanelsinga offered some suggestions about **[What are some good questions to ask when you're inheriting a codebase?](https://dev.to/leirasanchez/what-are-some-good-questions-to-ask-when-you-re-inheriting-a-codebase-ll9)**:
{% devcomment n1ih %}

Finally, @thelebdev shared their co-working related horror story in the **[Do you have a remote work, or remote co-working space horror story to tell? Call us with your answer!](https://dev.to/jess/do-you-have-a-remote-work-or-remote-co-working-space-horror-story-to-tell-call-us-with-your-answer-5cla)** thread:
{% devcomment n6mo %}

See you next week for more great comments ✌
Finding similarity using Edit Distance-Information Retrieval 
Tags: algorithms, java, tutorial, search
Published: 2020-04-01 02:40:20

Edit distance is a way of quantifying how dissimilar two strings are to one another by counting the minimum number of operations required to transform one string into the other.

How to calculate edit distance?

Ex: To calculate the edit distance or cost to convert string “Sunday” to “Saturday“.

——-> Traverse horizontally

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1kmtmtfg3t8w1m4m4ixn.png)
 	  
Edit distance of converting sunday to saturday is 3.
Edit 'r' in saturday to 'n' in sunday 
Delete in saturday 't'
Delete in saturday 'a'

To convert :

Considering the 1st row in the above table

S -> S the cost is 0 (highlighted in green)
S U – > S  the cost is 1 (U- deleted)
S U N -> S the cost is 2 ( U N – deleted)
S U N D -> S The cost is 3 (U N D  deleted)
S U N D A – >S The cost is 4 (UNDA needs to be deleted)

SUNDAY -> S The cost is 5 ( highlighted in green .UNDAY needs to be deleted)

S –> SA cost is 1
SU –> SA the cost is 1
SUN – SA the cost is 2.

Note : (If the char in the row and  column dont match Ex : in the iteration SUN ->SA (N doesn’t match A) then least cost from the upper cell,left cell and the diagonally upper cell +1 to calculate the cost)

So, in the iteration

Scenario 1:

S U N — > S A  the cost 2 can be simply calculated by considering the nearby least cell value +1. (In the above table the least cell value highlighted in red and adding 1. least value of the 3 cells is “1”,so adding 1 to it gets us 2 ,which is the cost for replacing SUN – SA ).

Scenario 2 :

SUNDA –>SA  Since the last char in the source string (SUNDA) is “A” and is same as the last char in the destination string, the cost is taken from the previous step SUND — >S (highlighted in pink) as there is no cost in replacing A -> A. Hence the cost for SUND –>S and SUNDA –> SA are same as 3.

Pseudo Code:

if(str1[i][j]==str2[i][j])
costMatrix[i][j]=costMatrix[i-1][j-1]
else
costMatrix[i][j] = min(costMatrix[i-1][j],costMatrix[i-1][j-1],costMatrix[i][j-1]) +1
Deploy Nuxt.js project in AWS S3 and Cloudfront
Tags: nuxt, aws, cloudfront, deploy
Published: 2020-04-01 02:15:54

Hi,

I'm a junior Nuxt developer and I'm having some issues when deploying my project in an AWS S3 with Cloudfront. The project is build according to the Nuxt docs in this link:
https://nuxtjs.org/faq/deployment-aws-s3-cloudfront/

The invalidations are executed succesfully but when I enter to the domain where the project is hosted, it doesn't update some styles, functionalities or even the backend URL. The project stills referencing to the previuos backend URL and does not change. Even if I reload with Ctrl + Shift or Ctrl + Shift + R, the page updates but if I close it and open a new tab, the issue appears again. 
I don't know if it is a matter of cache, building of the project, deployment in AWS or Cloudfront invalidation. I have been looking for some similar cases but not any answer or solution that can help. If someone knows how to deploy correctly a Nuxt project with an AWS S3 with Cloudfront I would really appreciate your help. 

Thanks,

Andres
🌏 I've open-sourced an interactive 3D visualization of COVID-19
Tags: showdev, javascript, webdev
Published: 2020-04-01 02:14:38


As a result of the enhanced community quarantine, I had the time to [develop and open-source](https://github.com/sorxrob/covid-3d) an interactive [3D map of latest data regarding COVID-19](https://covid3d.live/), provided by the World Health Organization.

## Reasoning
I am seeing a lot of coronavirus dashboards using plane map views (google maps, mapbox, leaflet)  and was inspired to develop an interactive way to visualize Johns Hopkins CSSE and other reliable data regarding the impact of COVID-19 to our world. It's actually based on [covidvisualizer.com](https://covidvisualizer.com) but decided to make one that doesn't have annoying ads (and open-source).

Here's a short demo:

![enter image description here](https://i.imgur.com/sClErhT.gif)

## Data
The interactive globe uses the [NovelCovid/API](https://github.com/NovelCOVID/API) which gets its data from [Worldometer's](https://www.worldometers.info/coronavirus/) real-time updates and [CSSEGISandData/COVID-19's](https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series) time series. Both of which utilizes reliable sources from around the world. 

The GeoJSON used is from [https://github.com/nvkelso/natural-earth-vector](https://github.com/nvkelso/natural-earth-vector).

## Tech Stack
For the front-end, I've used plain JavaScript and CSS to make it as simple as possible. The [NovelCovid/API](https://github.com/NovelCOVID/API) was plotted using [globe.gl](https://github.com/vasturiano/globe.gl) which is a UI component for Globe Data Visualization using ThreeJS/WebGL.

For the polygon colors, I've used [D3's sequential color scales](https://github.com/d3/d3-scale-chromatic). The color starts from a very light orange (low cases) to a red (high cases). Here's a sample:

![enter image description here](https://i.imgur.com/Ul7dY2l.png)

And lastly, I've used [Parcel](https://parceljs.org/) which is a blazing fast, zero configuration web application bundler to bundle the app.

## Links
Repo: [https://github.com/sorxrob/covid-3d](https://github.com/sorxrob/covid-3d)
Website: [https://covid3d.live](https://covid3d.live/)

If you have questions, suggestions, or feedback, please leave it in the comment section.

I hope you all stay safe and sane during these times!
How I deployed my first Python website on Heroku with CS50
Tags: python, beginners, webdev
Published: 2020-04-01 01:39:26

*Finding online learning resources is easy. But finding the ones that you will like is not that straight-forward.*

#Search for the right tools
Coursera, edX, FreeCodeCamp, Codecademy and many many more. There are a lot of websites that will help you learn coding. You can try to use them all — been there, done that — but you may struggle to find something that you enjoy watching and/or reading. I started many online programming courses that I was forcing myself to finish, but did not really know if I wanted to. And then, I found the one that I got me hooked for good.

If you have not heard of CS50, I encourage you to give it a try. Interesting lectures, challenging projects and great community is the short way I would describe it. They do not only teach programming, they also give you tools. I never knew how to take a step forward, I have always kept all my work on my laptop and never knew how to deploy it to see more than just localhost in the address bar. CS50 is how I found about Heroku and CS50 is where I found a project to post.

#The first project
The course I got into is Web Programming with Python and JavaScript and is available on [edX](https://www.edx.org/course/cs50s-web-programming-with-python-and-javascript). The first project (of three) focuses on Python, Flask and SQL. No need for JavaScript so far, but it is about to come along with different frameworks. What you are asked to build is a book review website ([more details](https://docs.cs50.net/web/2020/x/projects/1/project1.html)). Thus this is what I have created.

![](https://dev-to-uploads.s3.amazonaws.com/i/78m1gif0f13yffbvdbw7.png)

If you want to give it a try, if you want to try to break it, if you want to check it out and tell me what you think, you can find it [here](https://cs50-project1-lw.herokuapp.com/). It may be not sophisticated and complex, but this is just the beginning. I do not know yet if it is about the journey or destination, but I hope to find out.

Find my code on GitHub: {% github https://github.com/lwolczynski/CS50-Project1 no-readme %}
How do you measure soft skills?
Tags: discuss, askdev
Published: 2020-04-01 01:11:35

---
title: How do you measure soft skills?
published: true
description: Developers are told to improve their soft skills (like communication), but how do we know we are actually improving?
tags: discuss, askdev
---

As a dev, I've been told numerous times to get better at communication, writing, and other soft skills. But I've never had a metric to measure improvement.

How do you measure improvement in soft skills? Are there any good resources out there to help you improve?
Install Oracle Java JDK in Ubuntu Linux
Tags: java, linux, ubuntu
Published: 2020-04-01 01:08:48

Oracle Java SE 13 was released September 2019. The latest update of Java JDK is 13.0.2. In this post we install the JDK in Ubuntu Linux 18.04 LTS.


```shell
# Remove the OpenJDK/JRE completely 
$ sudo apt-get purge openjdk-\* 

$ sudo mkdir -p /usr/local/java 

# Download the Oracle Java JDK for Linux.
$ wget --no-check-certificate -c --header  "Cookie: oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/otn-pub/java/jdk/13.0.2+8/d4173c853231432d94f001e99d882ca7/jdk-13.0.2_linux-x64_bin.tar.gz"

$ sudo cp -r jdk-13.0.2_linux-x64_bin.tar.gz /usr/local/java/

$ cd /usr/local/java

# Unpack the compressed Java binaries
$ sudo tar xvzf jdk-13.0.2_linux-x64_bin.tar.gz

# Edit the system PATH file /etc/profile and add the following system variables to your system path.
$ sudo vim /etc/profile

JAVA_HOME=/usr/local/java/jdk-13.0.2
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

# Inform Ubuntu Linux system where your Oracle Java JDK/JRE is located.
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk-13.0.2/bin/java" 1

$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk-13.0.2/bin/javac" 1

# Inform Ubuntu Linux system that Oracle Java JDK/JRE must be the default Java.
$ sudo update-alternatives --set java /usr/local/java/jdk-13.0.2/jre/bin/java

$ sudo update-alternatives --set javac /usr/local/java/jdk-13.0.2/bin/javac

#Reload the system PATH  
$ . /etc/profile

# Test to see if Oracle Java is installed correctly
$ java -version

```


Update: To download Java JDK 14 use the below command

```shell
$ wget --no-check-certificate -c --header  "Cookie: oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/otn-pub/java/jdk/14+36/076bab302c7b4508975440c56f6cc26a/jdk-14_linux-x64_bin.tar.gz"
```
The Codewars’ Climb to 4kyu
Tags: watercooler, codenewbie, 100daysofcode
Published: 2020-04-01 01:00:50

### The Advice:
1. **Editor:** The code challenge sites all have their code editors, they all have some sort of UI/UX that makes them unique. I always suggest to people to take the problem into their code editor. The editor I use is VScode, and I have spent lots of time customizing it.

2. **Help:** I don’t immediately ask for help even at work, but at work, I will ask after being stuck on something for 15 or 20 minutes. When it comes to code challenges, I will sometimes stay on it for days, but asking for help is important once you have felt that you sufficiently pushed yourself past your limits.

3. **Research:** This should be happening all the time… Software Developers do not work in a desert with no resources available. The entire knowledge of the collective Internet is at your disposal.
Problem Domain: If the problem seems big, break it up into smaller pieces. That should be how most functions are written anyways, each function handles one task.

### The Story:
I haven’t used CodeWars for a while now, mainly because I have been working at Audea Development but occasionally I will still tackle a challenge here or there, but I get plenty of challenges at work for now. Now the question I was prompted with to write this article was, “How did you reach 4Kyu, what were your methods or strategies.” I am paraphrasing, however, that is the gist of it.
So let’s dive in, I do not have a computer science degree. I obtained my education at a coding Bootcamp. This should be a sign that computer science degrees are great. However, the degree is not necessary to reach your goal to become a proficient software developer.
I wanted to improve my problem solving and algorithm skills. So to achieve this I hit the coding challenges hard early on. The very first one I tried in CodeWars was a 5Kyu and at the time I was not syntactically strong in JavaScript yet, and none of it was making sense. So rather than be discouraged immediately I decided I would reverse engineer the syntax I didn’t understand. This included just searching on Mozilla Developers Network (MDN) everything I was unclear on. This was pure drudgery at first and imposter syndrome was creeping in quickly. The moment when all that meticulous research came together was when I went to 8kyu and it made sense! I could understand the JavaScript syntax and the problem domain.
After moving into the lower level challenges I was able to gradually acquire more completions. The solutions were starting to come faster at the 8Kyu level. It was time to move on, so of course, I tried 5Kyu again I was immediately humbled once more. The process is long and difficult, to get to the higher-level problem domains, and it’s a different pace for everyone.
Feel free to ever contact me for questions about JavaScript, Resources, Code Challenges, etc… If I don’t have an answer I will help you get one.
Gamification and Crowdsourcing
Tags: watercooler, gamification, crowdsource
Published: 2020-04-01 00:52:05

#### originally I wrote this for Journalism class in college. I liked it enough to put it on Medium a few years ago and now here. Enjoy :smile: 

Gamification had made the headlines a few times in recent years, and most people probably didn’t think much of it, I took serious notice. accompanied by crowdsourcing, gamification has been used to make leaps and bounds in knowledge and research.
A common theme I see, especially with certain parenting styles, is the constant blame that video games seem to take for children with bad behavior or learning difficulties. Now I am not saying that all people believe this, nor do I mean to imply games are all innately good or bad, there is age appropriation for games. The games are actually strictly (contrary to popular belief) rated based on their content, to determine age-appropriate games for gamers. Now, why does that matter, well don’t let your kid play games M 17+ (Games with this rating contain content which the board believes is suitable for those aged 17 years and older; they contain content with an impact higher than the “Teen” rating can accommodate, including intense and/or realistic portrayals of violence (such as blood, gore, mutilation, and depictions of death), stronger sexual themes and content, partial nudity, and more frequent use of strong language.) now obviously they won’t always listen, but kid rebel sometimes, just do your best. So are there “bad” games, yes and they are meant for adults and the fact kids get ahold of them is no reflection on ‘gaming culture’ itself, I personally find it annoying when kids play games they really shouldn’t be playing, but it happens and they yell at you over the Internet profanity you’d expect from a very angry sailor.
Ok, that was a long soapbox to get to this point, if there are “good” games, and “bad” games there must be “good” uses, functional games. Well, there is a resurgence of people using games to teach kids faster and for effectively, easier to learn when their interest and attention are on the teaching; that seems really great, but wait it gets better. Scientists looked at the potential of getting people’s interest and attention on a massive scale, of course, to further their own ambitions and goals. The idea was to take the concept of crowdsourcing and apply it to gamification, and the research they gamified was protein folding, the online game was called “Foldit.” The gamification was extremely successful, however, Foldit surpassed expectations, when in 2011 players created a 3D model of an enzyme that scientists hadn’t been able to accomplish for 15 years.
I personally think games have far more potential for good than any possible negative effect. There are even more studies that are showing gaming may increase certain cognitive abilities among other things. The real power of games is going to be in gamification and crowdsourcing where we essentially tap into the limitless potential of humanity’s collective imagination and humanity's raw computational power.