teleren/devto huggingface dataset:
Swift and the Evolution of Modern Programming Languages

Published: 2021-04-20 02:40:57

In the modern tech world, there’s significant overlap among the key players. Google and Apple, for example, develop augmented reality technologies side-by-side. In fact, they share an AR API of the same name. However, instead of consolidating around this shared interest, a competition emerges. This approach can absolutely lead to great tech, but it creates a conundrum for developers. Big tech firms tend to frame their breakthroughs within their product ecosystem, and devote fewer resources to cross-platform support. As a result, developers who want the agility to work across all tech platforms often find themselves in a bind. One step towards Google, or Microsoft, is a step taken away From Apple, or vice versa.

Meanwhile, an interesting thing tends to happen to incumbent technology. Its creators become tasked with its maintenance and upkeep, and can focus less on innovation. Meanwhile, competing companies looking for a greater foothold have to push exciting ideas into the marketplace to compete. Inevitably, this dynamic swings interest away from the incumbent and they are forced to reconcile their out-moded approach with new demands. One example of this is Apple’s Swift programming language.

Swift aims to bridge the gap between Apple’s keystone Objective-C language and popular scripting languages like Javascript and Typescript. Objective-C’s run began in the 1980’s, and in 2014 Apple decided it was time to begin its inevitable phase out. 

Like Javascript and Typescript, the code is structured in a way that reads naturally. Of course, there’s no shortage of proprietary flourishes to distinguish it from its competitors. But the structural similarities are clear.

# Syntax

In Javascript, const and let lend different types of functionality to variables. In Swift, there is no const, and the variable let is actually more similar to the Javascript const. The only difference is its value can be declared after initialization. 

Swift
```
Let greeting
Greeting = ‘hello world’
//cannot be changed
```

Javascript
```
Let greeting = ‘hello world’
Greeting = ‘new greeting’
//can be reassigned
```

String literals in Javascript and Typescript rely on backticks to create a string that can interpret variables. In Swift, this process is accomplished with a ‘\’ escape character followed by the variable name in parenthesis. 

Swift
```
Let timelyGreeting = “Good \(timeOfDay)!”
```

Javascript
```
Let timelyGreeting = `Good ${timeOfDay}!`
```
Arrays in Swift and Javascript are identical

```
Var colors = [“red”, “green”, “blue”]
Colors[3] = “orange”
//valid in both Swift and Javascript!
```
Summary

This is just a brief exploration of the reasons for Swift’s recent rise in popularity and the way the language interprets to Javascript and Typescript.
Inicializando un repositorio en GIT
Tags: spanish, git, productivity
Published: 2021-04-20 01:58:02

Ya instalado y configurado Git en nuestro equipo estamos listos para empezar a guardar y versionar nuestros proyectos con esta herramienta.
<br/>
Para poder guardar y versionar nuestros proyectos es necesario crear un repositorio. Este repositorio, es inicializado en el espacio de trabajo donde queremos que Git controle nuestro proyecto.
<br/>
Ejemplo de espacio de trabajo sin control de Git
![vacio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y1bbiiahwtoh0ia5ti4.jpg)
En la imagen anterior se pude visualizar el espacio de trabajo que se ha creado el cual de momento no es controlado por Git 

###Inicializamos GIT 

####Para ello hacemos lo siguiente: 
•	Nos posicionamos en el directorio donde vamos a controlar nuestro proyecto con GIT, para el ejemplo lo he nombrado *primer_proyecto_git*.
•	Ya posicionados en el directorio hacemos uso del comando **git init** ejecutandolo en la _línea de comandos_, esto creara un subdirectorio con terminación *“.git”* y al mismo tiempo, se crea una rama principal la cual git por default la nombra *“main”*

![repo creado](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j64kvv41i7jtjfjj4tf.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/um1iq4t8rgw4uuy7hh8f.jpg)

Listo, ya tienes creado tu repositorio con GIT.  Ahora lo que sigue es saber cómo funciona GIT.

Espero que la información compartida te sea de utilidad.
<br/>
 ¡Te dejo mis saludos y mis deseos de que coseches muchos conocimientos y en consecuente éxitos!
How to be the best software developer
Tags: ruby, rails, webdev, react
Published: 2021-04-20 01:52:30


How to be the best software developer. Look like I’m a genius from Stanford or Harvard university, Steve Jobs, Mark Zuckerberg. But they aren’t still in my definition. 
Mark had to learn Python when he was a billionaire. Steve Jobs was designer
We don’t need to go to school to become the best developer.
I may have different unique ideas connecting knowledge between the Eastern and Western. I’m a philosopher and linguist. I’m still improving myself to become the best.

If you wanna be better at something, you must have more the concepts
If you wanna master something, you must spend 10,000 hours of practice.
That is why the time period of studying at university is often 4 years.

I spent 5 years mastering English in Vietnam country where people don’t speak English. I still can speak English like native speakers.
If you are a software developer and can’t speak English well, you are a joke. Most developers in Vietnam only can understand 50% of what they are reading.
You can learn English, mathematics and some basic knowledge in 4 years. You can read books from school and university.

Now you begin to learn software. Do you only learn PHP or Ruby to find a job? It’s a common mistake. You need to learn 10 programming languages. It takes 4 years.
Most developers in Vietnam learn a language in 1 week or 1 month to build a garbage website. We should learn a language at least in 6 months carefully.
Not like English which includes most of concepts on the world, Each programming language only deals with some special functions such as HTML, CSS, JavaScript for the front-end, Ruby on Rails or PHP to connect database, Python for machine learning, AI, Erlang for real system, Java for compiling, NoSQL and SQL for database.
Now can you find a job?, Yes, you can but you aren’t the best developer.
You can code at 14 years old. The software company will hire you but the customer can’t. Your career is limited by the name: “PHP developer”, like most graduates. The customer doesn’t care what language you are using.

You spend 4 years building some business models: social network, e-commerce, fintech. Now the interviewers can ask you: “do you have experiences?”. Yes, you have 4 years of experience. You can find a job or you can set up a company. What’s up to you.
If you don’t wanna work at 18 years old, you can learn another field like economy and finance.

You should believe that you can master something in 4 years of practice. Like me, after 3 years, I still don’t speak English well but in the fourth year, I can speak English about business and software like this time.
So you don’t have time to go to school and university like Stanford or Harvard and lose a bunch of money.
Some students like Steve Jobs or Mark Zuckerberge dropped out of college because there are very few new things to learn. 
Hire me at https://www.fiverr.com/willingnguyen
{% youtube EvmJnYgMqTM %}
cool game
Published: 2021-04-20 00:44:25

<meta name="viewport" content="width=device-width,user-scalable=no">

<div id="container">
  <div id="game"></div>
  <div id="score">0</div>
  <div id="instructions">Click (or press the spacebar) to place the block</div>
  <div class="game-over">
    <h2>Game Over</h2>
    <p>You did great, you're the best.</p>
    <p>Click or spacebar to start again</p>
  </div>
  <div class="game-ready">
    <div id="start-button">Start</div>
    <div></div>
  </div>
</div>
Métodos de Array - Map
Published: 2021-04-20 00:35:16

Chegamos a mais um post da minha [saga de estudos](https://dev.to/inando85/bem-vindo-de-novo-javascript-1b48) em JavaScript.

No post de hoje irei falar um pouco sobre o método de array `map`.

### Método Map

`Map` é método de array que pode ser usado quando queremos gerar um **novo** array com a mesma quantidade de itens do array original, mas com cada item transformado.

O `map` irá percorrer por todos os itens do array executando uma transformação em cada um deles através de uma função que é passada como argumento.

Este método irá retornar um novo array com os itens modificados, logo, o array original não sofrerá alteração.

O `map` recebe como argumento uma função.

Esta função pode receber até 3 argumentos:

- 1: Item, que é o item atual que está sendo iterado
- 2: Index, que é o índice do item atual que está sendo iterado
- 3: Array, que é o próprio array original que está sendo iterado

Dos 3 argumentos, somente o `item` é obrigatório.

```js
const numbers = [1, 2, 3]

const doubleNumbers = numbers.map(item => item * 2)

console.log(doubleNumbers) // Array(3) [ 2, 4, 6 ]
```

Conforme visto acima, um novo array foi criado a partir do array numbers, pegando os seus itens e multiplicando por 2.

E para ficar claro, abaixo irei imprimir no console o array original e o modificado, para provar que o array original permanece intacto.

```js
console.log(doubleNumbers, numbers) // Array(3) [ 2, 4, 6 ] Array(3) [ 1, 2, 3 ]
```

Agora iremos pegar um array de produtos e executar o método `map` nele, fazendo uma verificação e pegando todos os produtos que custarem 30 ou mais e colocando eles com 50% do preço no array novo.

```js
const products = [
  { name: 'Mouse Sem Fio', price: 30 },
  { name: 'Pen Drive', price: 25 },
  { name: 'Cartucho de Tinta', price: 50 },
  { name: 'Suporte Ergonômico para Notebook', price: 23 },
  { name: 'Repetidor de Sinal Wi-Fi', price: 44 }
]

const saleProducts = products.map(product => {
  if (product.price >= 30) {
    return { name: product.name, price: product.price / 2 }
  }

  return product
})

console.log(saleProducts)

// Output

/*
(5) […]
​
0: Object { name: "Mouse Sem Fio", price: 15 }
​
1: Object { name: "Pen Drive", price: 25 }
​
2: Object { name: "Cartucho de Tinta", price: 25 }
​
3: Object { name: "Suporte Ergonômico para Notebook", price: 23 }
​
4: Object { name: "Repetidor de Sinal Wi-Fi", price: 22 }
​
length: 5
*/
```

Ficamos por aqui com mais um conteúdo dos meus estudos, vou deixar o link da documentação do site da MDN sobre o [método map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).

________________________________________________________________

Esse foi mais um post da minha saga de estudos em JavaScript Vanilla. Espero que estejam gostando!

Qualquer dúvida ou sugestão, vocês me encontram nas minhas redes sociais:

[LinkedIn](https://linkedin.com/in/inando85)
[GIthub](https://github.com/inando85)
[Twitter](https://twitter.com/inando85)
¿Es recomendable aprender Vim?
Tags: vim, aprender, neovim, terminal
Published: 2021-04-20 00:28:45

> Cabe aclarar que este no es un tutorial de Vim, sino un post sobre mi experiencia hasta ahora usando Vim.



Muchas personas se asustan al escuchar el nombre de Vim, puede que ya sepas que es, pero igual te dejaré esta definición por si no sabes que es:

*Vim, como su antecesor Vi, se utiliza desde un Terminal en modo texto. Se controla por completo mediante el teclado. Esto es en parte a causa de que Vi fue desarrollado a mediados de la década de 1970, cuando los terminales se comunicaban con un ordenador principal (host) mediante una conexión serie, que no era muy rápida (20 Kbps). Las limitaciones de los terminales de la época dieron lugar al concepto de diferentes modos, idea que ha resultado muy provechosa desde entonces. Vim es casi 100 % compatible con Vi,1​2​ aunque tiene muchas mejoras e incluso cuenta con versiones dotadas de interfaz gráfica y menús que pueden operarse mediante el ratón (gvim o kvim), así como una versión simplificada, evim que se comporta como un editor sin diferentes modos.*


En resumen Vim es sucesor de Vi, se usa desde una Terminal, se controla por completo mediante el teclado, etc.

A diferencias de otros editores Vim tiene modos, así es, esto sonará complicado, pero si lo practicas mucho no será muy complicado.

Vim es bastante utilizado por desarrolladores ya que, aumenta tu productividad en cierta medida por la razón de que no es necesario tocar el mouse en ningún momento, ya que puedes usar atajos de teclado creados por ti mismo.

Para mí fue algo dificil aprender a utilizarlo ya que estaba acostumbrado a utilizar Editores de Código como Visual Studio Code o Sublime Text, pero con los plugins adecuados y la motivación necesaria se puede lograr lo que sea

Si estas interesado en aprender Vim te recomiendo jugar a este juego llamado [Vim Adventures](https://vim-adventures.com/).

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ju17z1k6i1q2h4hcsjt.png)


Hasta aqui el post de hoy, si ya estas aprendiendo y/o usando Vim quiero que dejes tu opinión acerca de este tema siempre con respeto.

Chao Devs!
 

Eso es todo, espero puedan darle un buen apoyo a este post!!
Why "Agile Scrum" is an oxymoron
Tags: scrum, agile, kanban, practices
Published: 2021-04-22 15:57:19

---
title: Why "Agile Scrum" is an oxymoron
published: true
date: 2021-04-20 00:00:00 UTC
tags: scrum,agile,kanban,practices
canonical_url: https://jhall.io/archive/2021/04/20/why-agile-scrum-is-an-oxymoron/
---

Scrum is perhaps the best-known “Agile Framework”. So how can I get by saying “Agile Scrum” is an oxymoron?

Lest you think I’m picking on Scrum, let me expand my list of Agile oxymorons a bit:

- “Agile Kanban” is an oxymoron
- “Agile Lean” is an oxymoron
- “Agile XP” is an oxymoron

I could go on, but I think you get the picture.

And my point is this:

**No matter which framework or methodology you choose, if you stick to that thing, you’re not being agile.** And as soon as you are being truly agile, you’ll begin to diverge from the chosen framework or methodology, to the point that you’re no longer truly doing that thing.

* * *
If you enjoyed this message, [subscribe](https://jhall.io/daily) to _The Daily Commit_ to get future messages to your inbox.
How to get the last modified time of the file asynchronously using Node.js?
Tags: node
Published: 2021-04-20 00:00:00

---
  title: How to get the last modified time of the file asynchronously using Node.js?
  published: true
  tags: Nodejs
  date: Tue Apr 20 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/get-last-modified-time-of-file-asynchronously-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-aba4dee720da06d892d819be9d41635f.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/get-last-modified-time-of-file-asynchronously-nodejs)
  
To get the last modified time of a file asynchronously, you can use the `stat()` method from the `fs` (filesystem) module and then use the `mtime` property from the returned `stats` object in Node.js.

Let's say we have a file called `myFile.txt` in which you want to get the last modified time. Here you can use the `fs.stat()` method and pass:

- the `path` to the file as the first argument.
- a callback function that will get invoked after statistics about the file is obtained, in which the first parameter is an `error` object and the second parameter is the `stats` object which contains all the information about the file.

In our case, the last modified time of the file can be obtained using the `mtime` property from the `stats` object. The `mtime` property returns a valid `Date` object in JavaScript.

It can be done like this,

```js
// require fs module
const fs = require("fs");

// get last modified time using fs.stat() method
fs.stat("./myFile.txt", (error, stats) => {
  // in case of any error
  if (error) {
    console.log(error);
    return;
  }

  // else show last modified time from stats object
  console.log("File last modified at: ", stats.mtime); // File last modified at:  2021-04-30T23:53:07.633Z
});
```

See the above code live in [repl.it](https://replit.com/@melvin2016/get-last-modified-time-of-file-asynchronously-nodejs).

If you want to see the `Date` in a more human-readable way you can use the `Date` object methods. Let's use the `toUTCString()` method like this,

```js
// require fs module
const fs = require("fs");

// get last modified time using fs.stat() method
fs.stat("./myFile.txt", (error, stats) => {
  // in case of any error
  if (error) {
    console.log(error);
    return;
  }

  // else show last modified time from stats object
  console.log("File last modified at: ", stats.mtime.toUTCString()); // File last modified at: Fri, 30 Apr 2021 23:53:07 GMT
});
```

That's it! 😀

### Feel free to share if you found this useful 😃.

---
Python Zero to Hero - Ep.40 - Answering questions on Stackoverflow
Tags: python, beginners, stackoverflow, video
Published: 2021-04-19 23:27:14

---
title: Python Zero to Hero - Ep.40 - Answering questions on Stackoverflow
published: true
description: We will have some fresh air and do something different this episode, we look for some Python questions to answer on Stackoverflow. 
tags: python, beginner, stackoverflow, video
---
We will have some fresh air and do something different this episode, we look for some Python questions to answer on Stackoverflow. If you have any questions or any suggestions about which Python topics to cover, please leave your comment at my [Twitch channel](https://www.twitch.tv/cheukting_ho)
Business Calculator
Tags: calculator
Published: 2021-04-19 23:23:57

Decided to write a business debt service calculator for my day job.  Originally I wrote it in a procedural format but then in version two I cleaned it up.  

-Version 1- procedural and looked messy.
-Version 2- more organized in functions and cleaned up with PyLint.
-Version 3- created a GUI using TKinter.
-Version 3- mentor helped me organize functions & use if __name__ = "__main__": to indicate a clear entry point.

https://github.com/Bankerman007/DSC_Calculator/tree/master

The first version was definitely the most challenging.  Simple things like taking a user input and converting it to an integer caused slow downs.
Every Arch Linux User Ever - Satire
Tags: linux, productivity, opensource, beginners
Published: 2021-04-19 23:03:32

---
title: Every Arch Linux User Ever - Satire 
published: true
description: Are you an Arch Linux user? Have you told the world about it? I thought so! 
tags: linux, productivity, opensource, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rcblzwwqg2nhtalbzqih.png
---

Hello everyone, 

Do you love Arch Linux? Are you someone who digs setting up Arch from scratch or spending hours getting Wifi to work? If so, then I have a funny video for you!  

[This is a parody - just meant for a quick laugh]

Video (3 mins)

{% youtube a9MzPAY2UP0%}

Conclusion

Feel free to checkout my [future Twitch streams](https://twitch.tv/mbcrump) as we learn about security and app development or you can watch the condensed version of all of my streams by subscribing to my [YouTube](https://youtube.com/mbcrump). 

Stay connected with me on social platforms for daily software development news.

-[Twitter](https://twitter.com/intent/follow?screen_name=mbcrump) | [Twitch](https://twitch.tv/mbcrump) | [Instagram](https://instagram.com/mbcrump) | [YouTube](https://youtube.com/mbcrump) | [GitHub](https://github.com/mbcrump) | [Website](https://www.michaelcrump.net)
New roles at startup
Published: 2021-04-19 22:46:03

Hey folks there are 3-4 openings at a cryptocurrency startup. 

We're in need of blockchain developers who have well grasped the idea of blockchains and can build one.

We're trying to build a layer 2 blockchain, a cryptocurrency and an NFT/DeFi aggregator and we need more hands on deck. Pay is awesome.

You may reach out to me or drop a comment if you're proficient in any of these:

Typescript
Reactjs
Nodejs/Express

You need to be proficient in at least one of the mentioned tools but it is necessary you know how to build a blockchain or build apps/DApps on existing blockchains.
How to parse nonhard-coded markdown in NextJS with Syntax Highlighting
Tags: syntaxhighlighting, nextjs, react, markdown
Published: 2021-04-19 22:40:56

Instead of writing individual html pages or embedding an article from an external blog site, you may want to make your own customization to your articles and to make use of markdown's simplicity to write blogs alongside NextJS's incremental static site generation for fast loading and dynamic data. However, if you have used a markdown parser, you probably have realized that while it gets the job done, you would prefer to have syntax highlighting in your code snippets rather than just having text that looks somewhat different from your paragraphs. If you have faced this, there is a solution to this. First you need to install two packages: markdown-it and highlight.js.

``` bash
// if you're using npm

npm i highlight.js
npm i markdown-it

//if you're using yarn

yarn add highlight.js
yarn add markdown-it

```

First, at the top of your file, you need to import hljs from highlight.js and then import MarkdownIt from markdown-it.

``` javascript
import hljs from 'highlight.js'
import MarkdownIt from 'markdown-it'
```
After that, you need to create a const (let's call it md) that is equal to a MarkdownIt function that incorporates hljs that was imported. This will allow Markdown-It to recognize parts of your markdown data that has code and will apply syntax highlighting for that language. It should look something like this.

``` javascript
    const md = new MarkdownIt({
        highlight: function (str, lang) {
          if (lang && hljs.getLanguage(lang)) {
            try {
              return '<pre class="hljs"><code>' +
                     hljs.highlight(lang, str, true).value +
                     '</code></pre>';
            } catch (err) {console.log(err)}
          }
      
          return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
        }
      });

```
After that, you can create a div element with an attribute called dangerouslySetInnerHTML. That attribute should contain an object with a propterty called: __html (yes with two underscores). This should be equal to md.render(/*your markdown data*/, */language*/)  (assuming that you named the const md). It should look like this:


``` javascript
<div id={styles.blog} dangerouslySetInnerHTML={{__html: md.render(/*your markdown data*/, */language*/)}}></div>

```

Finally to make sure that syntax highlighting actually appear, you need to import a css file from highligh.js in your _app.js file. Highlight.js has alot of css styles so you can experiment with those. To find those styles, you can go to the node_modules folder, then inside that folder go to the highlight.js folder, and then styles. The import statement should look something like this:

``` javascript
import 'highlight.js/styles/atelier-forest-light.css'
```
In the end, you will have a blog article with syntax highlighting. [E.G This site](https://alonzoaustin.com/blog?title=Rj0nK8aJE1vj1QpgOETx)