teleren/devto huggingface dataset:
I interviewed with Nick Janetakis: here's what I learned
Tags: interview, python, sideprojects, flask
Published: 2019-11-20 13:59:27


[My interview is available [here](https://runninginproduction.com/interviews/3-a-recipe-search-engine-and-aggregator-called-recipe-finder)]

Hello all,

When I first joined the dev.to community, my main goal was to learn from others, as everyone seemed so much more knowledgeable than me. Over time, this feeling of also wanting to put what I know into words and out there for other fellow developers to read and comment on grew, and I decided to start writing what I knew, what I learnt at my job on a daily basis, and, more importantly, I started **leaving my comfort zone**.

Being in your comfort zone is easy, you are comfortable with all the concepts you would be writing and thinking about, you can do it almost without thinking, and, while that can be great to showcase to others what you know, it has the downside that you won't be learning new things.

In order to change this, and, to both grow as a developer and as a writer, I started my Flask series, about a simple recipe aggregator app, that started in my head as simply consuming an API and showing some recipes, but, evolved into much more over time.

It has been the largest side project I've ever done so far, and I want to keep using it as a medium to become a better developer and software engineer.

In fact, I eventually have let's say, a beta version, up and running on Heroku, so, you could say, it's live and "in production".

Thanks to this, and out of my own initiative, I decided to contact fellow dev.to writer @nickjj thanks to his initiative of [interviewing devs](https://dev.to/nickjj/do-you-have-a-web-app-running-in-production-become-a-guest-on-my-new-podcast-interview-site-27dg) about what they have running in production.

Throughout the whole process, Nick was really helpful, taught me some things, and left me with the idea of improving some aspects of my app, that shall subsequently make me a better developer:

- Security matters: using http vs. https, encryption of DB passwords, how to handle failure and error recovery. I haven't given this a lot of thought **yet**, but, this process will point me in the right direction.

- Branding and a good name: yep, I hadn't thought about a name yet, so, the more social aspect was also something I am now much more aware of.

Overall, it was an amazing experience and I feel I left it being better than before and, once again, challenging myself.

If you like it, please share it in order to help me and Nick as well!

All the best!
What's your github labels?
Tags: github, management, opensource, productivity
Published: 2019-11-20 13:59:03

There is my [Github Gist](https://gist.github.com/ruizalexandre/a8c361bb2e8ad77fafbf156664ed877e) with all labels that I use !

Always, __keep it simple__.


Labels need to be explicit, Github give us so much labels on repository creation. 

> I use only _simple names and colors_.


About Github Gist, see more gists [here](https://gist.github.com/ruizalexandre)
A ciência de dados pode salvar um país
Tags: serenata, datascience, cienciadedados
Published: 2019-12-10 13:31:08

---
title: A ciência de dados pode salvar um país
published: true
date: 2019-11-20 13:11:42 UTC
tags: serenata,data science,ciencia de dados
canonical_url: https://jtemporal.com/a-ciencia-de-dados-pode-salvar-um-pais/
---

Mas só se você levantar o bumbum do sofá e começar a fazer sua parte

* * *

Usualmente cientistas de dados querem resolver problemas ou responder perguntas. Seja para encontrar a cura do câncer ou para combater a corrupção, dados passam por uma sequência parecida de passos antes de se tornarem parte da solução.

A ideia desse texto é explicar mostrando um caso prático (e famosinho) do uso da ciência de dados. Então, se você já manja de ciência de dados e tá precisando de inspiração pra projetos de estimação, se prepare para aprender coisas novas que você pode não saber sobre leis e dados. Esse texto também é pra você que ainda tá aprendendo e quer conhecer a dinâmica de um projeto de ciência de dados.

***

Vai lá no blog pra ler tudinho sobre esse projeto


[![](https://jtemporal.com/images/clique-aqui-para-ler.png)](https://jtemporal.com/a-ciencia-de-dados-pode-salvar-um-pais/)
How I use PM2 to run Node.js applications to production.
Tags: node, javascript, webdev, tutorial
Published: 2019-11-20 13:07:08


[PM2](https://pm2.keymetrics.io/) is a process manager for Node.js applications. It helps to monitor applications, their memory and CPU uses. Also, provides easy commands line to manipulate apps. In this article, I will explain to you how to deploy a Node.js application on a server using the `pm2` tool.

## Install PM2

PM2 depends on Node.js and `python-software-properties`, so we need to install them first:

```bash 
sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install nodejs
```

Then, we can install `pm2` globally:

```bash 
sudo npm i -g pm2
```

## Create the config file 

PM2 provides a command line for users to generate a config file. The config file will be generated in the YAML format under the project folder.

```bash
pm2 ecosystem # generates a config file
```

After generation, there is a file like:

```yml
apps:
  - script   : ./api.js
    name     : 'api-app'
    instances: 4
    exec_mode: cluster
    watch  : true
    env    :
      NODE_ENV: development
    env_production:
      NODE_ENV: production
```

## Configuring PM2

Here are what some of the configuration options are for:

1. `script`: how to start the application. PM2 also supports starting Python applications.
2. `instance`: the number of instances you are going to create.
3. `exec_mode`: `cluster`/`fork`.
4. `watch`: if `true`, the application will auto-restart if any crash happened.
5. `max_memory_restart`: if `true`, PM2 will restart the application if the application exceeds the amount of memory. 
6. `env`: all the env variables settings should be placed here.
7. `error_file`: a path string for forwarding stderr
8. `out_file`: a path string for forwarding stdout

## Start!

Now use the following command to start the application. PM2 will read the configuration file, start applications and assign a unique id to the process.

```bash 
pm2 start config.yml
```

PM2 provides a list function for showing all applications under PM2:

```bash
pm2 list
```

If you need to get more detailed info about one specific app, we can use the command:

```bash
pm2 show [app_id]
```

Thanks for reading, and I hope you guys learned something!
TemplateMonster Black Friday Discounts
Tags: blackfriday, cybermonday, discounts
Published: 2019-11-20 13:06:12

---
title: TemplateMonster Black Friday Discounts 
published: true
description:  50% Off
tags: blackfriday, cybermonday, discounts
---

Get the most from this Black Friday.
When? Nov, 21st - Dec, 3rd
Where? TemplateMonster Marketplace
![Web Development Black friday Deal](https://res.cloudinary.com/dyrnpkcoh/image/upload/v1574254166/templatemonster_BF2019.gif)
[Follow the link](https://www.templatemonster.com/landings/black-friday-2019/?aff=devto&utm_campaign=blog_site_devto&utm_source=bfcm&utm_medium=referral)
Microservices: when to choose it, how to migrate painlessly, & make it resilient
Tags: todayilearned, architecture, microservices
Published: 2019-11-20 13:00:15

*TL;DR style notes from articles I read today.*

### [Musings on software architecture: monoliths to microservices ](http://bit.ly/2Ow5NMS)

- Microservices architecture adds huge complexity overheads on your infrastructure & may not be suitable for a new project from the start.
- As a developer, you take on a lot of communication and coordination in addition to coding.
- Even successful companies using microservices today started as monoliths.
- When you start with a single team and a single product, it is logical to continue with a monolithic application. 
- Later, teams can split to be responsible for single services. Microservices may make better sense after that growth and when necessary experience and expertise is gained. 

*[Full post here](http://bit.ly/2Ow5NMS), 4 mins read* 

---

### [9 tips for a painless microservices migration](http://bit.ly/2XtFlaW)

- Draw domain lines to define and document your business entities early on. Be mindful of how you cross the boundaries between these entities. 
- Document your URL route domains and ensure everyone follows the one convention.
- Be explicit about routes and methods. Avoid wildcard routes and wildcard verbs or HTTP methods.
- Assign URL endpoint ownership for clean formation of teams in the future.
- Monitor URL usage by instrumenting the endpoints - at least graph the request rate, if not the error rate and performance of every HTTP endpoint you expose. 
- Kill dead code - delete it, not just comment on it. Have source code control for history, if needed.
- Document the environment variables a service, class or module uses. 

*[Full post here](http://bit.ly/2XtFlaW), 8 mins read* 

---

### [3 easy things to do to make your microservices more resilient](http://bit.ly/2XtF4oq)

- Test your system using chaos strategies.
- Have a plan to at least partially fulfill your service promise in case of a fault, whether it is a canned message or calling a different service as a backup. 
- Be conservative in what you send to a service and liberal in what you accept. Your unmarshalling logic should do just enough validation of responses and pull out just the data you need rather than executing a full validation.
- When services fail, multiple iterations of the same message should not add inconsistencies to your users’ systems.
- Use infrastructure that filters out duplicates. Or, track unique identifiers in the messages and discard those that are already processed successfully.  

*[Full post here](http://bit.ly/2XtF4oq), 7 mins read* 

---

*[Get these notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
Obtener información de repositorios OAI/PMH con Hoja de cálculo de Google
Tags: google, sheets, oai
Published: 2019-11-20 12:54:10

Los repositorios que soportan el protocolo OAI/PMH pueden ser consultados con distintas herramientas como [Open Harvester](https://pkp.sfu.ca/ohs/)  de PKP  o dSpace. 
Una herramienta como [metha](https://github.com/miku/metha) simplifica mucho la consulta pero todas requieren instalación y cierta experiencia. 
Para consultas rápidas pensé en armar algo con GoogleCalc o LibreOffice y encontré la función ImportXml que soporta la lectura de xml y el uso de una consulta xpath. 
La consulta xpath no puede ser versión dos pero con un simple cambio funciona para recuperar lo típico de un repositorio OAI/PMH 

*Algunas opciones*
Cantidad de registros en el verbo ListRecords: "//*[local-name() = 'resumptionToken']/@completeListSize"
Nombre del repositorio en el verbo Identify:"//*[local-name() = 'repositoryName']"

Hice una [hoja de cálculo](https://docs.google.com/spreadsheets/d/1awZkRlit1mtKDIlPup3qSQg9oU6WtmJdnCWA3XUoAkM/edit#gid=0) de prueba que puede accederse libremente.
So, what is your website development process
Tags: discuss, webdev, design, css
Published: 2019-11-20 12:29:40

How do you go about starting new project, from design to deployment.

Let’s say for the sake of discussion that you are building a small business website.

How do you decide what stack you are going to use, maybe static site generator, plain HTML and CSS with or without frameworks etc.

Let’s get it started.
I am curious.
Run code periodically using Promises
Tags: javascript, scheduler, async
Published: 2019-11-20 12:27:30

[Previous post](https://dev.to/lvidakovic/one-line-pause-function-in-plain-javascript-54kj) describes an implementation of a one-liner pause mechanism using a Promise. Here it is again:

```javascript
const pause = time => new Promise(resolve => setTimeout(resolve, time))
```

This will be our mechanism to pause execution between successive calls. Simplest implementation(with some flaws) of a periodic code execution would look something like this:

```javascript
async function runPeriodically(callback, time) {
  while (true) {
    await callback()
    await pause(time)
  }
}
```

*runPeriodically* function receives 2 parameters, a *callback* function which executes some code and *time* which is an integer specifying the delay between 2 consecutive calls of a callback. The loop itself is an infinite loop, because of the **true** condition which will never change. Usage example:

```javascript
function logTime() {
    const time = new Date()
    console.log(time.toLocaleTimeString())
}

runPeriodically(logTime, 2000)
```

This would run indefinitely and log out current time every 2 seconds. Having an infinite loop without any means of stopping it is a serious limitation and we'll make it right in the following posts. Maybe in the end there won't be any loops at all, at least not explicitly defined ones 🙃
What are your recommended books to learn event-driven architecture?
Tags: learning, evendriven, help
Published: 2019-11-20 11:49:47

---
title: What are your recommended books to learn event-driven architecture?
published: true
description: 
tags: learning, even-driven, help
---



Recently, I came across a paper published by O'Reilly titled "Software Architecture Patterns. Understanding Common Architecture Patterns and When to Use Them". 


Although the paper is a little bit old (published 2015), It has a very good comparison between some software architecture patterns including n-tier, event-driven, and microservices. I highly recommend you to take a look at it.


The way the event-driven architecture is explained is very interesting. So, I wanted to learn more about it. 

What are your recommended books to learn event-driven architecture?
Beginner Projects?
Tags: beginners, projects, rails
Published: 2019-11-20 11:47:20

What's up!

Look for some suggestions for what would be a good project to start learning Ruby/RoR. I do have some minimal coding experience so I am not a total beginner. However, I have found I learn far quicker if I have something to build or see actual use cases for the language.

I've been looking around for some basic projects to start but wanted to get some suggestions for everyone here. Crazy amount of experience and knowledge and what better way to learn than to get direction from people that have the experience.
Transforming Healthcare with Blockchain
Published: 2019-11-08 10:42:51

The healthcare industry is plagued by errors, bureaucracy, inefficiencies, and high administrative costs. To deliver a single healthcare service, healthcare providers need to access patients’ critical data which is typically scattered across different departments and systems. A hospital's administrative staff is responsible to accumulate the required data. However, a complex and sluggish information ecosystem renders the administrative staff struggling to collect vital data. Following are some stats that highlight the inefficiencies the healthcare industry suffers from:

 

The medical industry produces a lot of valuable patient data that can be used for treatment. Since the data is distributed across different networks it becomes difficult for healthcare providers to deliver appropriate care or necessary treatment in real-time.  Drug counterfeiting is one of the major issues of the healthcare industry which leads to losses of around $200 million every year. To avoid such undesirable instances, a reliable and verifiable information tracking system is the need of the hour. 

 

Blockchain technology has the potential to eliminate inefficiencies and inconsistencies in the healthcare industry. It can reduce the information gap between patients and healthcare providers by significantly eliminating the role of intermediaries. Blockchain application development solutions can connect fragmented systems to generate insights and enable healthcare professionals to serve their patients better. They can transform healthcare systems with better privacy, security, and interoperability of healthcare data. Blockchain technology creates a new model for health information exchanges (HIG) to enable stakeholders to access and store data effortlessly and securely. 

Read Full Blog Here: https://www.oodlestechnologies.com/blogs/Transforming-Healthcare-with-Blockchain/

Visit: https://www.oodlestechnologies.com/blockchain-applications-development/
Don’t excessively mutate the DOM. Here’s what you should do instead.
Tags: beginners, tutorial, javascript, webdev
Published: 2019-11-20 11:26:22

---
title: Don’t excessively mutate the DOM. Here’s what you should do instead.
published: true
description: Tips for avoiding direct DOM manipulation.
tags: beginners, tutorial, javascript, webdev
---

Before I continue I just want to say that it’s not bad practice to target the DOM. Without targeting the DOM, JavaScript wouldn’t be able to manipulate anything on your page, rendering it useless as a frontend programming language.

However, you do want to stay cautious and be very careful about when and where you’re targeting the DOM, as certain operations may noticeably affect the performance of your webpage.

Now with that said, you might be asking yourself:

*"How bad can directly manipulating the DOM really get?"*

**REALLY REALLY MESSY** especially if you're working in a team, you're adding unnecessary levels of complexity which can result to potential bugs whether it'd be from performance, testing and even refactoring. 

Take this bit of code for example:
```js
for (let i = 0; i < 10000; i++) {
  const p = document.createElement("p");
  document.body.appendChild(p);
}
```
We're generating 10,000 `<p>` tags and appending each one to the `<body>` of the DOM. This is highly inefficient as this code tells the DOM to update and figure out where everything goes again for 10,000 times.

A cleaner approach:
```js
const fragment = document.createDocumentFragment();
for (let i = 0; i < 10000; i++) {
    const p = document.createElement("p");
    fragment.appendChild(p);
}
document.body.appendChild(fragment);
```

By grouping all our elements so that we append them all together we are able to drastically reduce the amount of times that the DOM needs to be modified down to one. This also reduced the total running time from **413.125ms** to **12.189ms**.

**Fun Fact:** React.js provides a VirtualDOM that creates a lightweight copy of the DOM which it keeps track of. React also tries to update the DOM as little as possible by grouping together changes.

Thanks for reading!
JAVASCRIPT FUNDAMENTALS
Tags: beginners, javascript, discuss, findamentals
Published: 2019-11-20 11:24:47

---
title: JAVASCRIPT FUNDAMENTALS
published: True
description:Conditional Statements
tags: beginner, JavaScript, discuss,findamentals
cover_image: http://images.unsplash.com/photo-1472437774355-71ab6752b434?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjEyMDd9
---

#Question:

In what scenarios should one use if..else statements and in what scenarios should one switch statements in JavaScript?

Any help will be appreciated. 
Happy Coding
Streaming Video Textures and Webcam Feed with A-Frame
Published: 2019-11-20 10:56:03

{% youtube ylX8RCR-ALQ %}

A fun experiment with A-Frame / WebVR to use videos as textures and to stream webcam video to create a trippy room using the users webcam and videos as textures

Live version:
https://zonescanner.com/fractalfaces/

Sourcecode: 
https://github.com/drnoir/Streaming-Video-textures-and-Webcam-Feed-with-A-Frame
PrimeVue 1.0.0-beta.14 brings Virtual Scrolling for DataTable
Tags: vue
Published: 2019-11-20 10:54:52

[PrimeVue](https://www.primefaces.org/primevue) is under heavy development at [PrimeTek](http://www.primetek.com.tr/) and we’re excited to announce the new 1.0.0-beta.14 iteration that brings the Scrolling Functionality for DataTable. Horizontal and Vertical data scrolling are available along with the frozen columns and rows, in addition Virtual Scrolling is implemented to deal with huge datasets efficiently. View [the Scrollable DataTable Demo](https://primefaces.org/primevue/#/datatable/scroll) in action for a test run.

![enter image description here](https://i2.wp.com/www.primefaces.org/wp-content/uploads/2019/11/scroll-vue.png?resize=995,549&ssl=1)

**Full Changelog**

View the  [changelog](https://github.com/primefaces/primevue/milestone/11?closed=1)  at Github for more details about 1.0.0-beta.14.

**Download**

PrimeVue is free library to use under MIT License and available at [NPM](https://www.npmjs.com/package/primevue).

**Roadmap**

1.0.0-Final is right around the corner, we’ll not begin providing the menu components such as menubar, contextmenu, breadcrumb and release an RC in early December. More premium templates such as Serenity, Ultima and Apollo are also on their way to join  [Sapphire](http://www.primefaces.org/layouts/sapphire-vue),  [Avalon](http://www.primefaces.org/layouts/avalon-vue)  and  [Babylon](http://www.primefaces.org/layouts/babylon-vue).
Primeiros passos como programador Autodidata
Tags: webdev, productivity, learning, selftougth
Published: 2019-11-20 10:51:24

Criei uma thread no [twitter](https://twitter.com/codder404/status/1197060741255315456), sobre o assunto, dê uma olhada. Boa leitura. Que a Força esteja contigo sempre.
Metabase 500 internal server error
Tags: metabase, 500, errors, java
Published: 2019-11-20 10:20:31

This is a quick guide on how to fix 500 server error response on Metabase server.

After logging in to my Metabase, and querying data as usual, for a while, I had no issues running a few queries and traversing through the database. Until I was logged out all of a sudden, I tried to login and got kicked with a 500 internal server error response just like the one in the image below.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/igishq18xs93juxp48rv.png)


I figured I had to check the logs for clues as to what the cause of the error is.

I “sshed” into the server and opened the log file for the Metabase service.


[proxy:error] [pid 17125] [client 172.69.12.136:9960] AH00898: Error reading from remote server returned by /api/dataset


I got this from the server logs and all I had to do to fix the error was restart the Metabase service using the command below.

sudo service metabase restart

or try using systemctl

sudo systemctl stop metabase.service

sudo systemctl start metabase.service


and voila Metabase is back up and running.


References
https://computingforgeeks.com/how-to-install-metabase-with-systemd-on-ubuntu-18-04-ubuntu-16-04/