teleren/devto huggingface dataset:
Best online data science course for beginners (My opinion)
Tags: machinelearning, beginners, python
Published: 2020-01-02 22:21:21

I have done some research to find out the best online course to learn data science especially for beginners and I found this course really interesting. They have a really good course structure starting with data preprocessing and covered all the popular algorithms with hands on experience. 

Course: Udemy - Machine Learning A-Z : Hands-On Python & R in Data Science

**Prerequisites**
1. Intermediate level of Python or R
2. Anyone with a programming background can try this but I suggest to go through the python or R basics before starting this course

This course provides hands on of building a model using some of the basic and most used algorithms in Regression, Classification, Clustering, Association Rule Mining, Neural Networks etc., in both R and Python. 

Each section is structured in a way to help us understand the basics of how to build a model. Every section consists of following steps:
1. Dataset (Explanation and Importing)
2. Algorithm (Intuition and Implementation)

**And coming to how I learned data science:**
1. Think of an use case you want to implement (I work in telecommunications industry, so I searched for the most popular machine learning use cases in telecom)
2. Set your objective
3. Which category does your objective falls into? (For this you need to have prior understanding of machine learning categories like Regression, Classification, Clustering etc.,)
4. Choose a dataset (you can download datasets online - Kaggle.com has some good datasets)
5. Start your project (I started in Jupyter Notebooks)
6. Go through the data and make sure you have a clear understanding of the features (you should be able to answer all your questions from the data itself)
7. And now the most important part Data pre-processing (handling missing data, removing duplicates etc.,)
8. Select the features you need from data to train your model
9. Select an algorithm that will fit your purpose
10. Train your model
11. Validate the model performance
Setting Up Kotlin (Command Line)
Tags: tutorial, kotlin, linux
Published: 2020-01-02 21:53:38

##### Step 0: Set up JDK
Kotlin requires that your JDK be set up. You can [head over to Oracle's official website](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) to download and install JDK 8. 
##### Step 1: Get Kotlin 
First we have to get the latest release of the Kotlin. [Follow this link to download Kotlin's latest release.](https://github.com/JetBrains/kotlin/releases/latest) At the time of writing, the latest version was `v1.3.61`. For Linux, download `kotlin-native-linux-1.3.61.tar.gz` and place it in a directory of your choosing.
##### Step 2: Extract and Move Kotlin
I prefer to have Kotlin set up in `/usr/local/bin/kotlin`. Having it there and renamed to `'kotlin'` instead of `'kotlin-native-linux-1.3.61'` makes it easy for me to update Kotlin whenever a newer release is ready. We'll get to that in a minute. For now, open your terminal and follow these steps:

```
# first let's extract Kotlin
$ tar zxfv kotlin-native-linux-1.3.61.tar.gz

# next we'll rename the extracted folder
$ mv kotlin-native-linux-1.3.61/ kotlin

# then we'll create a kotlin directory in /usr/local/bin (requires admin rights)
$ mkdir /usr/local/bin/kotlin

# move kotlin
$ mv kotlin /usr/local/bin/

```
##### Step 3: Add Kotlin to PATH
We have to add Kotlin to our PATH so we can access the compiler without having to write out the full path to our installation. Add the following lines to your `'~/.bashrc'` file.
```
export KOTLIN_HOME=/usr/local/bin/kotlin
export PATH=$PATH:$KOTLIN_HOME/bin
```
Then make sure to run `source ~/.bashrc` in order to access the Kotlin compiler in your current terminal session.
##### Step 4: Check Kotlin Installation
Run the following command to confirm that you can access the Kotlin compiler:
```
$ kotlinc -version
# should return something like => info: kotlinc-native 1.3.60 
```

##### Step 5: Upgrading Kotlin
To upgrade Kotlin, delete the contents of your current installation in `/usr/local/bin/kotlin`. Download and extract a more recent version of Kotlin and move the extracted content into `/usr/local/bin/kotlin` (a repeat of step 2). Voila!
Estructurando la base de nuestro proyecto NodeJS
Tags: node, express, scaffolding, mongodb
Published: 2020-01-02 21:52:44

La idea de escribir este articulo nace de una necesidad que se manifesto en un [meetup](https://www.meetup.com/NodeJS-Medellin) de la ciudad en cual asistí. Muchas de las personas que estuvieron allí, preguntaban que como sabrían donde debería estar los archivos que componen su proyecto como lo son: *modelos, eventos, controllers, vistas, etc* etc. Ya que en Node.JS no existía como una forma base para hacerlo y que muchos de los ejemplos visibles, nunca sustentaban la razón por la cual se construía de esa manera.

Es por eso que he decido crear un proyecto base simple, que me permite tener una autenticación en local usando [Passport.JS](http://passportjs.org/) persistiendo los datos en una base de datos NoSQL como MongoDB, mediante [Mongoose.JS](http://mongoosejs.com/), tiene ademas el uso de JWT y expone una API que podría extender facilmente.

Este proyecto tuvo como adición una charla la cual comparti en el meetup [*Test con AVA y Estructurando la base de nuestro proyecto](https://www.meetup.com/NodeJS-Medellin/events/243518840) *donde explique el proceso paso a paso de como se **Estructura un** **Proyecto NodeJS con ExpressJS para una API**, aca dejo el link del proyecto [https://github.com/khriztianmoreno/nodejs-scaffolding](https://github.com/khriztianmoreno/nodejs-scaffolding) y estan invitados a generar sus pull request, crear issues y mejorar este proyecto en comunidad.

![](https://cdn-images-1.medium.com/max/2560/1*Nk12eQZLmnRPCXMrriVSug.jpeg)

![NodeJS Medellin Meetup — Estructurando la base de nuestro proyecto](https://cdn-images-1.medium.com/max/2000/1*1sDmQ3pJ2XydMdXa8KTIcQ.jpeg)*NodeJS Medellin Meetup — Estructurando la base de nuestro proyecto*

**Plus**:

Acá esta la guía paso a paso de como construir el proyecto que puede ser usado para replicarlo en sus proyecto futuros. [**Gist](https://gist.github.com/khriztianmoreno/51891107b240fbd61c3c3fd725a6bf4a)**

Resource:

* [Proyecto](https://github.com/khriztianmoreno/nodejs-scaffolding)

* [Issues](https://github.com/khriztianmoreno/nodejs-scaffolding/issues)
Javascript Scopes Types .. Simplified! 
Tags: scope, javascript, functional, tutorial
Published: 2020-01-02 21:35:52

Just like with many programming languages, there’s fundamental concepts that might seem confusing even though they are essential to mastering the target language. We can all agree that Scope and Scope is one of them. 

Hopefully by the end of this blog post, you’ll be able to find it less confusing and you’ll be on your way to writing better, more efficient and cleaner code.

What is Scope?

Scope is the accessibility of variables. It refers to where and which part of your program can your variables be accessed/utilized. 


How Many types?

Global Scope, Function Scope and Block Scope

Is Scope even that important?

Yes! And the main benefit is security and preventing changes to our variables through out our code and to also make sure we don’t end up with same variables.



Global Scope:

-> Not inside a function or block {}

-> Can be accessed anywhere.

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



Local Scope:

-> Variable declared inside a function 

-> Only accessed in that function and no where else outside..

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




Block scope:

-> They can be accessed within the nearest pair of curly braves,
   but not outside of it.

-> Unlike var, it doesn’t have that block scope limitation.

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



*Quick tip: 

Scopes can be nested on top of each other..


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

The let variable that’s a block scope, is inside of the local scope, which is nested inside the global scope.

*Quick tip:

Most modern day browsers support "Strict Mode"
which basically means, undeclared variables are not automatically global.
so if you were to assign a variable without const or var, this would throw an error. 

Scopes might seem very confusing at first, but with the more practice and detail you give to how you initially write out your code, the less errors and debugging your code will experience..! 

Happy coding!
Into The Blog-lands
Tags: webdev, javascript, css, webperf
Published: 2020-01-02 21:27:29

```js
console.log('Hello Blog-lands!');
```

As part of my _New Year's Resolution_, I have conditioned myself to start writing blog posts about my experiences with web development, what I have learned, what I am learning and what I will learn.

To that effect I want to let you all know of a series I will be writing about how to improve performance on the web, called __'Flash On The Web'__. 

_Terrible name right? I am bad at naming things 😅._ 
_You will get used to it because I am here to stay 😎._

In the series, I will try my best to explain what I know about the web and what affects performance on the web. Some of the things I will be writing about (in no particular order) include but not limited to the following:
- Critical Rendering Path, 
- Lazy Loading,
- Next-Gen Image Formats and so on.

I will try my best to deliver new posts every week to keep up a good momentum and hopefully get used to the process of writing posts.

I very much look forward to this new year of learning, sharing and other avenues.

Happy new year to you 🎊.
How to use GraphQL Fragments with Apollo
Tags: graphql, apollo
Published: 2020-01-02 20:43:40

GraphQL requires that the queries specify the fields to return with the result to prevent over-selecting (too much fields) by design.

This means for us developers that if we design a GraphQL query, we need to write out all the fields we want to retrieve from the query node.

GraphQL itself has a really nice concept called [Fragments](https://graphql.org/learn/queries/#fragments) to make life easier:
>GraphQL includes reusable units called fragments. Fragments let you construct sets of fields, and then include them in queries where you need to.

This is great to use on the server side.

Here is how it looks on the server side (copied from the docs):
```js
{
  leftComparison: hero(episode: EMPIRE) {
    ...comparisonFields
  }
  rightComparison: hero(episode: JEDI) {
    ...comparisonFields
  }
}

fragment comparisonFields on Character {
  name
  appearsIn
  friends {
    name
  }
}
```

#### You can also use Fragments with Apollo on the client side!

Why? To have as less as possible lines to change when a new field is added on a type and needs to be returned! ... and of course to type the fields only once :-D

![GIF of fast typing](https://media.giphy.com/media/pALw8LdftuqAw/source.gif)

The apollo client lets you define queries in the following syntax:

```js
// gqlQueries.js
import gql from 'graphql-tag';

export const MY_CONTENT_QUERY = gql`
  query MY_CONTENT_QUERY($id: ID!) {
    contentDetails(id: $id) {
      id
      contentUpdated
      title
      body
      notes
      link
      tags {
        id
        name
      }
      updatedAt
    }
  }
`;
```

We are already using the [graphql-tag](https://github.com/apollographql/graphql-tag) library here, so we can also use it to construct Fragments!

This example defines fragments in a separate file, imports them into the file where the queries are defined and uses them.

```js
// gqlFragments.js
import gql from 'graphql-tag';

export const FRAGMENT_CONTENT_ALL_FIELDS = gql`
    fragment ContentAllFields on Content {
        id
        contentUpdated
        title
        body
        notes
        link
        tags {
            id
            name
        }
        updatedAt
    }
`;

```

```js
// gqlQueries.js
import gql from 'graphql-tag';
import { FRAGMENT_CONTENT_ALL_FIELDS } from './gqlFragments';

export const MY_CONTENT_QUERY = gql`
  query MY_CONTENT_QUERY($id: ID!) {
    contentDetails(id: $id) {
      ...ContentAllFields
    }
  }
  ${FRAGMENT_CONTENT_ALL_FIELDS}
`;
```

My personal preferences:

Use Fragments if:
- you query the same set of fields of a type more than once
- you query fields of a type from which you know it could get more fields in the future that also needs to be returned
- you refactor an existing query and add a field to it

Don't use Fragments if:
- you are writing a PoC
- you have less than 3 queries for a type
- you don't always have the same fields for each query for a type
React Native JS Only Environment Variable Library
Tags: showdev, javascript, reactnative
Published: 2020-01-02 20:38:06

---
title: React Native JS Only Environment Variable Library
published: true
description: Library for simple manage js only environment variable in react nativ
tags: showdev,javascript,react native
---

Hi guys, So a few days ago I read post here about Environment Variable in React Native, the Author made me realize that  an Envfile should be build/compile time only.
so I just created a library for  React Native JS-only Environment variable. checkit out
https://github.com/hanipcode/rnenv

### My goals
- can be installed as dev dependency
- JS only, no need native modules (you can use react-native-config for that)
- suport multiple environment
- select environment as command for example `rnenv ENV=production npm run build:android`


sorry for my bad english though.
Balance: My 2020 Programming Goal
Tags: beginners, career
Published: 2020-01-02 20:33:07

---
title: Balance: My 2020 Programming Goal
published: true
description: Whats most important to me heading into my second full decade as a developer
tags: beginners, career
cover_image: https://thepracticaldev.s3.amazonaws.com/i/exa2qmekjulvnosnde6e.jpg
---

## My Earlier Goals

When I started as a developer on this day: January 2nd, 2009, I wanted just a few things as a developer that you may be familiar with:

* To be accepted
* A job
* Money

These were my thoughts as a college dropout with no relevant professional experience starting my first day as a developer. Only days before my work had been loading trucks on the 9pm-5am shift, and now I found myself in the equally dark basement cubicle of the 9am-5pm shift looking for answers on Stack Overflow.

And then I solved a problem, and then another one, and like fireworks they lit my way though the dark unknown of my early years as a developer. As I grew, and the [fog of war](https://en.wikipedia.org/wiki/Fog_of_war) lifted around the world of software I found myself in, I gained new motivations over time:

* To learn
* To teach

These ideals guided me to the better places, and when I followed them I found new jobs where I made more money and my ideas were better accepted. Here I encountered new problems — but rather than talk about symptoms — let my highlight my prescription.

## My New Goal: Balance

When you take a learner's stance, you can see that problems in software are solvable with time. Time however is a limited resource, and so the trick of being an advanced problem solver is to find a balanced approach that optimizes for time.

Rewrite, or refactor. Do it yourself, or delegate. Solve now, or solve later. Most often the answer to these questions lies in answering 
"What is the balanced approach here?" Balance looks like you and your team working normal hours. Balance looks like you and your team feeling proud of the work. Balance is achieving professional goals without sacrificing the personal ones.

So this is my new goal, to find a balanced approach, and in doing so I hope to learn, to teach, to find great jobs, get paid great money, and find acceptance from my clients and peers. How does balance affect your life as a dev? Let me know in the comments!
Two Sum Algorithm - JavaScript Tutorial/Solution
Tags: challenge, javascript, tutorial, codenewbie
Published: 2020-01-02 20:19:39

### **The Problem**

Given an array of integers, return **indices** of the two numbers such that they add up to a specific target.

You may assume that each input would have *exactly* one solution, and you may not use the same element twice.

**Example:**
```
Given nums = [2, 7, 11, 15], target = 9,

Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].
```
### **Basic Solution**

The brute force way of solving this would be looping through the array twice and adding up one number from each array to see if it equals the target. This is what it that looks like:

```javascript
let twoSum = (nums, target) => {
    for(var i = 0; i < nums.length; i++) {
        for(var j = i + 1; j < nums.length; j++) {
            if(nums[i] + nums[j] == target) {
                return [i,j]
            }
        }
    }
}
```
This is inefficient simply because we have to do double the amount of work when looping through the same array twice. Although this will always work, as the array gets larger, the execution gets exponentially slower.

So let's take a look at how to go through this array only once.

### **Efficient Solution**
First off, we need a way to keep track of all of the numbers we've already looked at as well as what numbers we need. We're going to do this by using a prevValues object to store our values which allows us to look at our numbers instantly without having to loop through the array again to see if the number exists. Take a look:

```javascript
let twoSum = (nums, target) => {
// Create object to store values
  const previousValues = {}
  for (let i = 0; i < nums.length; i++) {
    const currentValue = nums[i]
    const neededValue = target - currentValue
// Store needed value as a key in the object
    const index2 = previousValues[neededValue]
// Check if we have an index that is equal to our needed value 
    if (index2 != null) {
      return [index2, i]
    } else {
// Store index for current value
      previousValues[currentValue] = i
    }
  }
}
```
Streams consumer not working for AWS MSK Kafka
Tags: help, kafka, java, msk
Published: 2020-01-02 19:52:13

Hello everyone,

We are currently playing with AWS' MSK (Kafka 2.2.1).  This is a 3-node cluster, and we can successfully produce events to it.

We are also able to consume events from topics using some basic consumer code (subscribe or assign).

I wanted to start playing with Kafka Streams, but for the life of me, I'm not able to get the darn thing going... it doesn't seem to want to consume events.  I have tried googleing this problem but not a single result is found.  All the example code I find is the same and super easy to set up.  

I'm wondering if there is some broker config that needs to be specifically setup for streams to work correctly?  I have enabled debug logging for Streams and I see messages like "Disconnecting from node -2 due to request timeout." The broker URL is set correctly (it's not using localhost). Not really sure what I'm doing wrong. Here is the sample code I'm using

```
Properties props = new Properties();
props.setProperty(StreamsConfig.APPLICATION_ID_CONFIG, "test-stream-5");
props.setProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, BROKER);
props.setProperty(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, LongSerde.class.getName());
props.setProperty(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, StringSerde.class.getName());
props.setProperty(StreamsConfig.NUM_STREAM_THREADS_CONFIG, "1");

KStream<String, String> kstream = builder.stream("stream-test");
kstream.print(Printed.toSysOut());

try (KafkaStreams streams = new KafkaStreams(builder.build(), props)) {
	System.out.println("Starting");
	streams.start();

	for (int i = 0; i < 100; i++) {
		Thread.sleep(1000);
		System.out.println("Sleeping");
	}
}
System.out.println("Done");
```
COBOL is dead...or is it? 😳
Tags: cobol, mainframe, business, legacy
Published: 2020-01-02 19:12:14

An acquaintance was surprised to learn recently that the [COBOL](https://en.wikipedia.org/wiki/COBOL) business programming language, created ~ 1959, was still in use in 2019.

In fact COBOL is still prolific and won't be going away any time soon, if ever.

Below are several observations which demonstrate that COBOL is still alive and well today.

✔️ Companies are still actively hiring COBOL developers [1]. LinkedIn, for example, has 2075 COBOL jobs open in the US today.
✔️ The national average for a senior COBOL developer is ~ $110k [2].
✔️ COBOL has been object oriented since 2002 [3].
✔️ GitHub has 1558 COBOL repositories [4].
✔️ The [LinkedIn Mainframe Experts Network](https://www.linkedin.com/groups/55779/) has ~ 32k members [5a].
✔️ The [LinkedIn Mainframe Experts Group](https://www.linkedin.com/groups/910927/), which includes COBOL, has ~ 47.6k members [5b].
✔️ There are 173 groups in total on LinkedIn which include COBOL.
✔️ Micro Focus offers JVM COBOL support [6].
✔️ The Oracle GraalVM supports COBOL [7].
✔️ The Microsoft Visual Studio 2015 IDE supports COBOL [8].
✔️ COBOL code can be run on AWS Lambda [9].
✔️ Per [10 & 11] 25k+ companies use COBOL.
✔️ In 2017 Reuters calculated that there was still 220bn lines of COBOL code running in production & COBOL systems handled $3 trillion in commerce every day [12].

If you have additional points please add your thoughts in the comments section.

# References

[1] https://enterprisersproject.com/article/2018/11/3-aging-it-specialties-just-won-t-retire
[2] https://www.ziprecruiter.com/Salaries/Senior-Cobol-Developer-Salary
[3] https://en.wikipedia.org/wiki/COBOL
[4] https://github.com/search?q=cobol
[5a] https://www.linkedin.com/groups/55779/
[5b] https://www.linkedin.com/groups/910927/
[6] https://www.microfocus.com/documentation/visual-cobol/VC40/EclWin/GUID-DEAFFCA6-6D75-4AEA-A3B6-6DF0BDCF3E2F.html
[7] https://www.graalvm.org/uploads/graalvm-language-level-virtualization-oracle-tech-papers.pdf
[8] https://blogs.msdn.microsoft.com/cdndevs/2015/09/09/visual-studio-2015-now-supports-cobol-and-you-can-make-desktop-and-web-apps-with-it/
[9] https://searchaws.techtarget.com/news/252454023/COBOL-applications-can-go-serverless-on-AWS-Lambda
[10] ["Companies using COBOL"](https://enlyft.com/tech/products/cobol}
[11] ["COBOL" / "COMPANIES WE TRACK USING COBOL: 25,193"](https://discovery.hgdata.com/product/cobol)
[12] https://thenewstack.io/cobol-everywhere-will-maintain/