teleren/devto huggingface dataset:
Three things from today - 8/30
Tags: devjournal, spark, kubernetes
Published: 2019-08-30 21:12:51

#8/30/2019
###Happy Friday!

I had a bit too much 🍷 yesterday so i'm a bit foggy, however that's not stopping me from learning today!

##1. Spark S3 tweaking
 Spark appears to use ParquetOutputCommitter - a function of Hadoop to write parquet files to S3.

Digging into an issue we've had writing Spark to S3 we [came across a fix described here](http://agrajmangal.in/blog/big-data/spark-parquet-s3/) which involves setting a config value in hadoop:

Testing it - it appears to work.

I made a PR to set this going forward from the Hadoop / Hive side of things.
```
 hadoop_conf.set('spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version', '2')
```
This can also be set in Spark with the following property:
```
'spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version':2
```

##2. Helm 3 beta 2 is released
The buzz around the office is that Helm 3 beta 2 has been released. Helm 3 is an important release for Helm as it removes the dependency on Tiller.
It is so important it seems to have warranted a 7 part blog series on their [website](https://helm.sh/blog/helm-3-preview-pt1/)

Also Microsoft has a great article describing [why Helm 3 is important.] (https://cloudblogs.microsoft.com/opensource/2019/05/21/helm-3-release/)

##3. What is Apache Zeppelin? How is it different than Jupyter?
Apache Zeppelin and Jupyter are both interactive notebooks that you can use to do data science things like perform calculation, plot graphs, etc.

Jupyter notebooks run python in the background. Apache Zeppelin uses JVM underneath the hood.

As for features I enjoy, Jupyter is an offshoot of iPython, which I enjoy quite a bit for doing Python work.
Apache Zeppelin seems to be a little more robust for non-python languages, and also their demo is pretty sweet, being able to use their sweet Angular graph UI is pretty swell.

[Check out these graphs!](https://www.zepl.com/viewer/notebooks/aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL0xlZW1vb25zb28vemVwcGVsaW4tZXhhbXBsZXMvbWFzdGVyLzJCMlhLRkNETS9ub3RlLmpzb24)

## 4. Bonus thing!!

I have been promising myself i'm going to learn prometheus for too long. It's time to dig into the [awesome-prometheus](https://github.com/roaldnefs/awesome-prometheus) list.... 

I also created a new GKE cluster on my own Google Cloud account for testing.. Compared to Azure and AWS it's Kubernetes easy mode. More to come with monitoring and my new test cluster next week :)

Happy Labor day - seeya Tuesday!
Docker image for create-react-app
Tags: docker, react
Published: 2019-08-30 21:04:45

---
title: Docker image for create-react-app
published: true
description: Docker image to generate a `create-react-app` scaffold
tags: docker, react
---

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

Because I'm a huge fan of dockerizing all of my development environments, I don't want to install `node`, `npm` (or `yarn`), and [`create-react-app`](https://github.com/facebook/create-react-app)
in my machine, not even for generating a `create-react-app` scaffold.

For that reason I created a [simple docker image](https://hub.docker.com/r/edgargonzalez/create-react-app), that does only one thing, installs `create-react-app` and generates a `create-react-app` scaffold.

## Usage

```
$ docker run --rm -v $PWD:/app edgargonzalez/create-react-app my-app

Creating a new React app in /app/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
...
Happy hacking!
```

## Github repo

The code for the Docker image lives in the following repository:

{% github edgar/docker-create-react-app %}
1050ti benchmarking better than a 1650?

Published: 2019-08-30 20:29:41

Hey there, the short of it is that I am limited on my graphics card options. I previously had an asus single fan 1050ti and upgraded to a 1650 The power supply is 750w so that shouldn't be a problem but I still have to use MB power only (long story), no external power.

Anyways before the new 1650 came in, I benchmarked my system and it ran 52fps on valley benchmark in 1440p @ 60hz. Not bad for a 1050ti honestly. I benched it again after installing the 1650 and it is consistently around 48fps.https://www.spanish55.com/

The only difference in my system is that I have to use a PNY card which only has a HDMI and DVI output (single slot), whereas my asus 1050ti used DP. Other than using HDMI instead of DP, everthing else is the same.

Is displayport really that much better? My monitor supports HDMI 2.0 so I figured I was actually upgrading.
Expression comparison between C# and Java
Tags: functional
Published: 2019-08-30 20:05:30

Recently I have started my study and am preparing my Java course next to C# for the Unity framework. 

Are there any expression comparatives which are aligning somehow basic functions and differences between these two programming languages?

I know it is depending on which libraries but as a student I’m currently trying to write some down, but hoped to find some online suggestions?

Example:

Java: ((Integer)42).toString()
C#: toString.()

Thank you for sharing!
Restore applications and their positions from the command line on linux desktops
Tags: linux, node, showdev, productivity
Published: 2019-08-30 20:04:21

---
title: Restore applications and their positions from the command line on linux desktops
published: true
description: 
tags: linux, node, showdev, productivity
---

<p align="center"><a href="https://github.com/johannesjo/linux-window-session-manager><img src="logo.png"></a></p>

LWSM is an [open source](https://github.com/johannesjo/linux-window-session-manager) library / command line tool that lets you save and reload your opened programs and the positions of their windows. 
Supports Unity and Gnome Desktops and possibly all other compositing window managers using X (including XWayland).


## Installation
NodeJs needs to be installed.

```
npm install -g linux-window-session-manager
```

For older distros, you also might need to install the `locate` command via `sudo apt-get install mlocate`. 
 
## Updating
```
npm update -g linux-window-session-manager
# (optional) delete config to update it to the newest version
rm ~/.lwsm/config.json
```
 
## CMD Usage

### Saving a session:
```
# save the current session to ~/.lwsm/sessionData/DEFAULT.json
lwsm save

# save the current session to ~/.lwsm/sessionData/my-session.json
lwsm save my-session   
```
Note that the session are stored for the specific display combination, you're currently running. If you want to store a different layout for when you have an external monitor plugged in this is possible. Just run the save command again for the same session. 


### Restoring a session:
```
# restore the session from ~/.lwsm/sessionData/DEFAULT.json
lwsm restore

# restore the session from ~/.lwsm/sessionData/my-session.json
lwsm restore my-session   

# gracefully close all running apps before starting the session
lwsm restore --closeAllOpenWindows
```

### List saved sessions:
```
lwsm list
```

### Rename a saved session:
```
lwsm rename oldName newName
```

### Adjusting the configuration:
You can manually edit the config file present at `~/.lwsm/config.json` and the session files in `~/.lwsm/sessionData/[sessionName].json`.

### Command-line completion:
```
# Automatically install command-line completion
lwsm --setupCompletion
# Generate command-line completion code for bash and zsh shells for manual installation
lwsm --completion
# Generate command-line completion code for fish shell for manual installation
lwsm --completion-fish
```
Command-line completion implemented by [omelette](https://github.com/f/omelette), so you may refer it's README to check file where completion code will be added on automatic install.
Restart your shell after automatic install to apply changes.

## Companion Tools
There's also a [companion tool in form of an indicator applet](https://github.com/johannesjo/linux-window-session-manger-indicator), a [gnome-shell-extension](https://github.com/johannesjo/gnome-shell-extension-window-session-manager) and a [Ulauncher extension](https://github.com/kpost/ulauncher-lwsm) if you like such things but this package can also be used standalone.
Launch WSL bash prompt from Tower
Tags: git, windows10, wsl
Published: 2019-08-30 21:35:10

---
title: Launch WSL bash prompt from Tower
published: true
tags: git,Windows 10,wsl
canonical_url: https://jessehouwing.net/git-tower-launch-wsl-bash/
---

 ![Launch WSL bash prompt from Tower](https://jessehouwing.net/content/images/2018/12/19340354430_4329b4584e_k-1-.jpg)

When you launch a terminal from Tower, it launches an included MingW bash shell. Now that Windows 10 ships with the Windows Subsystem for Linux it would be nice to use that bash shell instead.

[My first attempts at launching WSL failed miserably](https://superuser.com/questions/1380488/opening-a-wsl-shell-from-another-windows-application/1380499#1380499). It looks like Windows Filesystem Redirection causes to not see `wsl.exe` or `bash.exe` because Tower is a 32-bit program.

After a number of tries, I found that you can use the `sysnative` filesystem redirection point to escape the 32 bit world:

Title: Bash (WSL)  
Path: `C:\WINDOWS\sysnative\wsl.exe`  
Arguments:

![Launch WSL bash prompt from Tower](https://jessehouwing.net/content/images/2018/12/image.png)<figcaption>Launch Windows Subsystem for Linux from Tower</figcaption>

![Launch WSL bash prompt from Tower](https://jessehouwing.net/content/images/2018/12/launch-ps-wsl.gif)<figcaption>Launching the Windows Subsystem for Linux bash prompt from Tower</figcaption>
Do you limit your mobile screen time?
Tags: discuss, wellbeing, screentime, friday
Published: 2019-08-30 18:20:03

It’s Friday and I don’t really feel writing a technical post, so lets talk about tracking mobile screen time :)

As a developer I spend a lot of time staring at screens throughout the day. Big part of it, of course, is due to my profession but I also stay on my laptop to work on side projects, read articles, watch videos, etc.

And then there’s my phone. It’s quite easy to take it out of the pocket to quickly check out Twitter, Dev.to, of course, or my email even though I’ve already done that 5 min ago.

I’ve been using the [Digital Wellbeing](https://play.google.com/store/apps/details?id=com.google.android.apps.wellbeing&hl=en) app to keep track of my mobile screen time. Here’s a screenshot I made earlier today:

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

As you can see, I’ve unlocked the phone 42 times already. I woke up around 06:00 today so that’s almost 4 times per hour or once every 15 min.

These days I’m spending between 2 and 3 hours a day on my phone. I think that’s quite a lot. Up until a month ago, I was spending not more than 1:15-30 hours on average.

Some of the strategies that I have for limiting the screen time are:

*  I’ve set up an app limit to 40 min (currently) per day on Chrome. After that time, Chrome gets blocked and I can’t really open it unless I go and manually extend the time from the settings. Why Chrome? Because I’m using Twitter’s PWA app, which I’ve saved from Chrome. When I open it, the time there counts against Chrome. That’s where I spend most of my time. 
* I’ve also set up a so called “Wind Down” timer from 21:00 to 07:00 on the next day, which turns my screen gray. This hasn’t prevented me from using the phone less. It just annoys people when they try to look at it because the colors are not there :D

I would really like to cut some of the time. Maybe reduce it down to an hour. The data for how much I use the phone is there, an app that lets me block other apps is there but I miss the will power.

So, do you keep track of how much time you spend on your phone? Do you limit that time? If you do, what strategies are you using?
What are your pet peeves?
Tags: humor, watercooler
Published: 2019-08-30 18:19:02

There are a lot of things that annoy me in this world. Some people, other children, my computer, WiFi speed, etc. But (relating to computers) here are my most reoccurring, persistent and annoying things that bother me.

### Packaging one tiny file in a .zip, .tar.gz...
Okay, this really gets me. I don't know what the thinking is about this. One file doesn't need a .zip! For goodness sake, the whole reason of a zip file is to compress or to send a folder filled with **MANY** files. A .png that is less than a megabyte has absolutely no reason to be downloaded as a zip!

### Calling things cross-platform when it isn't
This gets me more than it should. I will search an application, and it will say in the description "cross-platform", and I will search for the Linux version for it, and you know what, it will only support Windows, or even worse, only support Mac. I think the problem arises when people hear "opensource". Opensource is not cross-platform, neither vice versa.

### Getting dead or broken links
So your first assumption would be to say, "Lazar, things don't last forever on the internet, you are bound to walk into a few of these every now or then". But please, when you have a well-moderated forum, that **ISN'T** dead, then at least try to warn other users about it being dead. It's just the good thing to do.

### Using hacking and coding interchangeably
*"A hacker is one who exploits vulnerabilities on a system or a network. Someone who can solve problems by manipulating computer code is known as a programmer. Someone who makes things."* You can hack a computer without writing a line of code (sometimes). But coding you must sit down and write **ACTUAL CODE**! My word! Please don't overuse this one!

### People calling drag and drop "coding"
Alright, now I get really steamed up about this one. **DRAG AND DROP IS NOT CODING!** Oi vey! I get that when you want to teach someone the beginnings of coding you tech them block based. I have nothing against that, but when someone builds a website using drag and drop, and calls themselves a "web-developer" afterwards... this really gets me. And I know, I'm only 14, but people who actually code should be called coders.

Well I think I ranted enough on this one. What are your pet peeves and your triggers?

Have a great day!
Is your code fast enough? Let's find out in Chrome Dev Tools
Tags: javascript, webpack, webdev
Published: 2019-08-30 18:17:26

We all have that curiosity to find out that is my code fast enough, when is it loaded in the application lifecycle, and what is the execution time, or what happens in the application when you just add a function block.


Chrome dev tool is really powerful enough to find out answers of all these questions. You can use the [performance](https://developer.mozilla.org/en-US/docs/Web/API/Performance) API to analyse the role of a code block inside your application. 


####  Let's find out the execution time of `for` loop to perform `1000000000` iterations. 

```javascript 
  performance.mark("start"); // start marker 
  
  for(let i = 0; i < 1000000000; i += 1){}

  performance.mark("end"); // end marker 
  performance.measure("for loop performance report", "start", "end");

  const measurements = performance.getEntriesByType("measure");
  console.log(measurements);

```

When you run the above code in the browser, you can find the performance in chrome dev tools. 

- Load your application. 
- Open Chrome developer tools.
- Select the `Performance` tab. 
- Record the new profiling by clicking on the `reload` icon.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/9dmniwpoz0jeund3734x.png)

- Check the execution time inside the timing section. 
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ylb9h4r3iskvk4z4xipq.png)


You can clearly notice that `for` loop is executed for `544ms` before the `FMP(First meaningful paint)` and after the `onload` events. 


I hope you find the article useful. Happy learning.  ☺️
Javascript variables and it's data types 
Tags: javascript, var, let, frontend
Published: 2019-08-30 17:54:16

---
title: Javascript variables and it's data types 
published: true
description: 
tags: Javascript,Var,Let,FrontEnd
---

## How to declare a variable in javascript?

There are 3 types of variable declaration.

First using "var" keyword, which is an old method to declare a variable.

    Syntax: - var "Variable Name";
    var x;//Now x value is undefined means we not defined the variable yet
    var y=5; //Now y value is 5 as we assigned 5 to it

Second, using "let" keyword

    let x=5; //Now x value is 5 as we assigned 5 to it

Difference between var and let keyword is variables declared with "let" keyword have block scope but in case of "var" have function scope.

see the code below 

    {
        let i=0;
    }
    console.log(i)//Throws ReferenceError:i is undefined
Here scope of i is limited inside the curly braces only. Outside curly braces variable i not available.

    {
        var x=5;
    }

    console.log(x);//5

Here the scope of variable x is available inside and outside of the curly braces as variables declared with "var" keyword are hoisted(Only variable declarations moved on top of the function or program)
Above code executed like below

    var x;
    {
        x=5;
    }
    console.log(x)//5

Third, using const, If we declare a variable using the const keyword value which is assigned first will never be updated with other value.

    const x=4;
    x=5//Throws TypeError: Assignment to constant variable.

## Data Types and Type Checking

There are 6 basic data types of variables that can be declared in javascript.

    1.Number
    2.String
    3.Boolean
    4.Object
    5.Undefined
    6.Null

One more data type in ES6 added is "Symbol"[I will cover this data type in my future blogs].
Javascript variables are dynamically typed which means if we declare variable and assign value to it then it will convert that value type.

    var x=5;
    console.log(x)//Type is Number
    x="Ryu" // Type is String


We can check the type of the variables using **typeof** function

    let x=5;
    typeof(x) //Number

    let x="Ryu";
    typeof(x) //String

    let x=true;
    typeof(x) //Boolean

    let x={};
    typeof(x) //Object

    let x=[];
    typeof(x) //Object (In javascript array is also a object)

    let x;
    typeof(x) //Undefined

    let x=null
    typeof(x) //Object(It's a Javascript's exception is that typeof null is also a object)


Note:- This blog gives a brief about the variables and it's data types in Javascript. There are a lot of concepts regarding this topic that are not discussed in this blog.


Follow me on my (twitter)[https://twitter.com/GodtiVinod] and connect me on (LinkedIn)[https://www.linkedin.com/in/godti-vinod-37bb46a9/]
A Gentle Introduction to Functional Programming in JavaScript
Tags: javascript, beginners, tutorial, computerscience
Published: 2019-08-30 18:07:31

---
title: A Gentle Introduction to Functional Programming in JavaScript
published: true
description: 
tags: javascript, beginners, tutorial, computerscience
cover_image: https://thepracticaldev.s3.amazonaws.com/i/s7qzk89b6nsccch7m0xp.png
---

Functional programming is a programming paradigm in which you build programs by **composing functions**. The computation is then the evaluation of those functions.

Functional programming focuses on the usage of **pure functions** and on **avoiding shared, mutable state**. This programming paradigm is **declarative**. Functional code is usually more concise and easier to test.

JavaScript has its flaws, but at the same time the language is well adapted for functional style of programming. Functions are first-class objects. It is easy to pass them around as arguments, or to return them from other functions.

{% youtube M4EyBg1dgas %}

In this [mini video series](https://www.youtube.com/playlist?list=PLhXZp00uXBk4ejkUZiDnv3R0AERA7Z4xp), we will embark on an exciting journey to learn a bit about functional programming by using JavaScript. Presented concepts will be mostly universal and applicable to other programming languages.

This series is created with beginners and non-programmers in mind. 

**Don't worry, we will take it slowly!**

If you'd like to be notified about new episodes, [subscribe here](https://www.youtube.com/zaiste)
What is Kubernetes?
Tags: kubernetes
Published: 2019-08-30 18:07:18

---
title: What is Kubernetes?
published: true
description:  Kubernetes (short k8s) is an open-source orchestration software for deploying, managing and scaling containers
tags: Kubernetes 
cover_image:  https://thepracticaldev.s3.amazonaws.com/i/bj2uq6od74w0643n22bw.jpg
---

Kubernetes (short k8s) is an open-source orchestration software for deploying, managing and scaling containers. When applications (microservices) are packaged with their dependencies and configuration into a container it´s necessary a tool to manage and automatically scale up and down the containers according to the application access demand. Kubernetes is the right tool for do that.

As applications grow and it is deployed on multiples servers Kubernetes can control how and where those containers will run. It can easily scale horizontally your application while monitor and maintain the container health.

Use Kubernetes also brings you portability, you can deploy containerized applications from local development, QA, or stage machines to production and ensure the same version tested is running. The tool also have a wide collections of extensions and plugins that brings even more power.

Visit the [Standardized Glossary](https://kubernetes.io/docs/reference/glossary/?all=true) to know a comprehensive list of Kubernetes terminology.

This post was originally released on my [Blog](https://educosta.dev/blog/what-is-kubernetes/). If you have any doubts or questions feel free to drop a comment here or reach me out on Twitter [@educostadev](http://twitter.com/educostadev).