teleren/devto huggingface dataset:
nvm install stable
Published: 2017-10-18 18:28:57

---
title: nvm install stable
published: published
description: Install "Node stable" via "nvm" on Ubuntu Server 16.04.3
tags: 
---
```shell
➜  ~ nvm install stable
Downloading and installing node v8.7.0...
Downloading https://nodejs.org/dist/v8.7.0/node-v8.7.0-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v8.7.0 (npm v5.4.2)
Creating default alias: default -> stable (-> v8.7.0)
```
```shell
➜  ~ node -v
v8.7.0
```
I'm an engineer, educator & innovator with 10+ software patents from my R&D past. Ask Me Anything!
Tags: ama
Published: 2017-10-18 16:49:37

---
title: I'm an engineer, educator & innovator with 10+ software patents from my R&D past. Ask Me Anything!
published: True
description: Nitya currently has 11 issued patents with 20+ applications pending.
tags: ama
cover_image: https://thepracticaldev.s3.amazonaws.com/i/bigq4anp5p6lmi2mtncu.png
---

I am NOT a patent attorney. I don't know patent law and litigation issues and have not kept up with much of the furor around software patents & regulations.

My patents all stem primarily from my 10+ years at Motorola Labs, the R&D (research & development) arm of Motorola. I ended my tenure there in 2012 as a Distinguished Member of Technical Staff and member of the Scientific Advisory Board (SABA). During that time, I served as a _reviewer_ (subject matter expert) for multiple internal patent review committees, a _champion_ (department-level mentor) to help first-time innovators navigate the process, and an _innovator_ (author of patent disclosures with at least 1 issued patent).

Since I left Motorola, I have worked as an independent consultant and systems architect for multiple early-stage startups. In at least one case, I helped them identify critical IP that helped protect their idea in a competitive market, and was key to their securing funding and a buyout later.

I am also currently an industry advisor and mentor to students at SUNY New Paltz, where we are exploring ideas bridging IoT and the Share Economy. Again, I find cases where the research & development work done on these early-stage concepts could benefit from IP protection, if only to give projects the time and resources needed to take them further.

I am happy to talk about what the process is (from the innovator's perspective) and how strategies that were useful to me in identifying the core invention. There are some things that I cannot talk about, and some things that I am not qualified to talk about. 

That said, I do wear multiple hats - I manage the Google Developer Group NYC (tech meetup), run training events (Study Camps), organize dev conferences (DevFestNYC) and am passionate about education and workforce retraining.

Ask me anything!
Which qualities or skills define a Sr. Developer?
Tags: discuss
Published: 2017-10-18 16:34:09

---
title: Which qualities or skills define a Sr. Developer?
published: true
description: Trying to crowdsource a definition of a Sr. Developer
tags: discuss
---
I'm more or less trying to get an idea of what others think a Sr. Developer is. 

The goal is to define the role so I know what to shoot for.
Considering changing to sans-serif for post body
Tags: discuss, meta
Published: 2017-10-18 15:37:09

---
title: Considering changing to sans-serif for post body
published: true
tags: discuss, meta
---

Early on with this site, I made the decision to go with the serif font for the post's body. I thought it was a good look for a lot of articles, and also implicitly positioned ourselves as a viable Medium alternative.

But a lot of types of content really look bad with this font choice, and a sans-serif, similar to the comments, makes more sense in our opinion.

This is a one-line change, but not something we'd make lightly because these are _your posts_ and we don't want to catch people off guard.

How do folks feel about this?
Reflections on the first CSS Stylesheet
Tags: css
Published: 2017-10-18 15:26:31

---
title: Reflections on the first CSS Stylesheet
published: true
description: As I look over the first CSS stylesheet released to the public some interesting details jump out at me.
tags: css
---

This is probably the first CSS stylesheet released to the public, it comes from HÃ¥kon W Lie's [initial proposal for CSS](https://www.w3.org/People/howcome/p/cascade.html) in October 1994!

As I look over it in 2017 I notice some interesting things represented here:

- single line comments (all comments here are single-line comments starting with `#`)
- custom-set cascade (no calculating based on selector specificity)
- `pt`, `mm`, and `cm` units are as old/foundational to CSS as `px`
- Setting `font.size` or `space.left` then using `font.size * 2` and `space.left + 0.5cm` later as values is like a precursor to CSS variables today
- `.first` seems to be either a pseudo-element like `::first-line` or `::first-letter`, or a pseudo-class like `:first`, `:first-child` or `:first-of-type`
- `x > y ? a : b` similar to at-rule logic like `@media` queries
- `REAL_HEIGHT` looks like environment values, something brand new in CSS
- separate screen and print media styles

So even as CSS grows over the years, it's still striving to match some of the expressive power intended from the beginning.

```ruby
#
# This is an initial style sheet. It should provide fallback values
# with low influence. Also, at the end, the user has added some
# favorite settings
#

0%			# 0% impact, i.e. fallbacks

# first, set some common defaults

font.family = times
font.size = 12pt		# alternative units are px, mm, cm
font.slant = normal
font.weight = normal

h1.font.size = font.size * 3
h2.font.size = font.size * 2.5
h3.font.size = font.size * 2

strong.font.weight = bold
em.font.slant = italics
tt.font.spacing = proportional


align.style = left		# paragraph alignment
h1.align.style = center


space.left = 0pt		# set the white space surrounding paragraphs
space.right = 0pt
space.above = 4pt
space.below = 4pt
space.first = space.left + 0.5cm 	# i.e. some extra indentation

head.space.above = 15pt			# straying from the 4pt default above

list.space.left = 1cm			# extra indentation for all lists
list.space.first = 1cm

# window-wide settings

AGE > 3d ? window.background = pale_yellow : window.background = white

window.foreground = black

window.width = 400px
window.height = REAL_HEIGHT - 50px

window.margin.left = 2cm
window.margin.right = 2cm
window.margin.above = 2cm
window.margin.below = 2cm

#
# paper works different
#

print.font.size = 10pt

#
# The user has redefined some of the default values below
#

100%	# first, redefine influence to dictatorship

font.family = helvetica

#
# after this, the rest of the influence is handed over to the style
# sheets of the incoming documents
#
```
Explain container orchestration like i'm five
Tags: explainlikeimfive, discuss, cloud, serverless
Published: 2017-10-18 15:22:02

---
title: Explain container orchestration like i'm five
published: true
description: 
tags: #explainlikeimfive #discuss #cloud #serverless
---

Hi everyone, 

After a little more than 3 months internship, i have to do my report. I know what is container and orchestration but i'm really bad at explain it. So explain me container orchestration like i'm five !
Suggesting Codota
Tags: coding, codota, alpha, testing
Published: 2017-10-18 15:18:06

---
title: Suggesting Codota
published: true
description: 
tags: coding , codota , alpha , testing
---

I started using **Codota** recently and i want to suggest it to others. Really helpful with wrong code because just highlighting small portions of code give you suggestions most of the time from **Stackoverflow**, one of my favorite sites. I find errors faster and also can give suggestions wile coding.

You should try it, maybe you will find it useful.
Dead Simple Spark Cluster Installer by using Sparrowdo, Docker and CentOS
Tags: docker, centos, spark, perl6
Published: 2017-10-18 15:02:27

---
title: Dead Simple Spark Cluster Installer by using Sparrowdo, Docker and CentOS 
published: true
description: Quick and dirty way to bootstrap Spark Cluster under CentOS and Docker
tags: docker, centos, spark, perl6 
---

Here is dead simple install of Spark cluster by using Docker, Sparrowdo and CentOS - https://github.com/melezhik/sparrowdo-spark

What you'll get:

* Spark cluster in standalone mode run across docker containers under CentOS with minimum of fuss

All you need is:

* [Sparrowdo](https://github.com/melezhik/sparrowdo)
* Docker with CentOS images

Hopefully will be useful for someone.

Enjoy.
Calling function inside Apple Script
Tags: macos, applescript, swift
Published: 2017-10-18 11:55:46

---
title: Calling function inside Apple Script
published: true
description: 
tags: macos, applescript, swift
---

Original post https://github.com/onmyway133/blog/issues/88

I 've been using [Apple Script](https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptX/AppleScriptX.html) to for my Finder extension [FinderGo](https://github.com/onmyway133/FinderGo). Because of [sandboxing](https://www.objc.io/issues/14-mac/sandbox-scripting/), all scripts must lie inside `Application Scripts` folder.

Today, I was rewriting my Xcode extension [XcodeWay](https://github.com/onmyway133/XcodeWay). Before Xcode 8, we could use Xcode plugin and all kinds of magic to make our dreams come true https://github.com/onmyway133/XcodeWay/blob/1.0/XcodeWay/Helper/FTGEnvironmentManager.m#L50. But then it does not work since Xcode Source Editor Extension was introduced. So I rewrote XcodeWay as an extension https://github.com/onmyway133/XcodeWay/releases/tag/1.1.0

Extension must run inside sandbox. If you switch `App Sandbox` in your `XcodeWayExtensions.entitlements` to `NO`, it won't load. So sandbox restricts me a lot in what kinds of things I want to do. And under Xcode 9, I can't use `NSWorkspace` to open `Finder`.

So I think I could use `Apple Script` too, and it worked like a charm. The only restriction is code reuse, since I only know how to run an entire script. One way is to import other Apple scripts https://stackoverflow.com/questions/2606136/import-applescript-methods-in-another-applescript but I think I will write all the functions inside 1 script, and find out how to call specific function.

By function, I also mean handler, procedure. I come across this snippet [Scriptinator](https://github.com/chockenberry/Scriptinator/blob/master/Scriptinator/AppDelegate.m) that pretty much inspires me, thanks to open source.

So here is my [script](https://github.com/onmyway133/XcodeWay/blob/master/XcodeWayExtensions/Script/XcodeWayScript.scpt) that contains lots of functions . And here is [ScriptRunner](https://github.com/onmyway133/XcodeWay/blob/master/XcodeWayExtensions/Helper/ScriptRunner.swift#L28) that explains how to build `NSAppleEventDescriptor`. Note that you need to `import Carbon`

```swift
import Carbon

func eventDescriptior(functionName: String) -> NSAppleEventDescriptor {
  var psn = ProcessSerialNumber(highLongOfPSN: 0, lowLongOfPSN: UInt32(kCurrentProcess))
  let target = NSAppleEventDescriptor(
    descriptorType: typeProcessSerialNumber,
    bytes: &psn,
    length: MemoryLayout<ProcessSerialNumber>.size
  )

  let event = NSAppleEventDescriptor(
    eventClass: UInt32(kASAppleScriptSuite),
    eventID: UInt32(kASSubroutineEvent),
    targetDescriptor: target,
    returnID: Int16(kAutoGenerateReturnID),
    transactionID: Int32(kAnyTransactionID)
  )

  let function = NSAppleEventDescriptor(string: functionName)
  event.setParam(function, forKeyword: AEKeyword(keyASSubroutineName))

  return event
}
```
Using Roku without its controller
Tags: wifi, trip, tips, tutorial
Published: 2017-10-30 01:19:30

---
title: "Using Roku without its controller"
published: true
tags: wifi,trip,tips,tutorial
canonical_url: 
---

### Using Roku without its controller (on a&nbsp;trip)

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

So… I decided to trip with my girlfriend and one stuff that we like to do is watch some Netflix or Anime. We noticed that packed only: roku, ac adapter and HDMI cable, no controller!

Without a controller, we could do nothing: can’t select app, can’t connect do Wi-Fi, even the common things like play a YouTube video from smartphone wasn’t possible…

After some precipitation, we started Googling… But no success, was all about with the same Wi-Fi network using the controller app. Great, we discovered that there is an app to controll the Roku! Now, how to make it&nbsp;work???

More google and no success. I solved this problem and decided to write the solution here, to help travelers&nbsp;:)

You’ll need **2 (two) smartphones** to make this&nbsp;happen.

First, with smartphone A create an Ad-hoc network with the same SSID (wireless name) and Password from your home, don’t need the 3G/4G enabled to this work. With this ad-hoc the roku’ll connect automatically, it “thinks that’s in home so why not auto&nbsp;connect?

![](https://cdn-images-1.medium.com/max/391/1*85I5eEzUSOJWn1au3I0Rxg.jpeg)

Second, on the smartphone B download the controller app then connect to the ad-hoc network. This smartphone should connect automatically too, since it’s your Wi-Fi from home. And now the app will find for and a Roku in the network… Boom!&nbsp;Founded!

Now just go to setting on Roku and connect to the Wi-Fi from hotel/airbnb/place you are to not end your 3G/4G plan before the trip. Just turn off ad-hoc on smartphone A to not drain your battery and connect both smartphone to the hotel/airbnb/place’s Wi-Fi.

That’s all! That simple. I don’t know how didn’t find this on Google&nbsp;:(

Don’t forget to enjoy your&nbsp;trip.
The very simplified concept of Binding in programming languages
Tags: java
Published: 2017-10-18 10:19:23

---
title: The very simplified concept of Binding in programming languages
published: true
description: 
tags: Java 
---

At the vary basic, binding is assigning one thing to another, usually, values to variables either by explicit declaration or implicit declaration. 
For the newbies in programming, the terms, explicit and implicit declaration seems daunting its really not. Explicit declaration simply implies a statement that defines the variable name and it's type e.g 
```
public int i;
```
 while in implicit, the default convention is implemented e.g
```
int i;
```
 it assumes it is public. 
Binding `int a, b = 0;` can occur at run-time or at compilation time, when it happens at run-time, the current state of the variable is changed in that a value is assigned to it. For instance 
```
int a, b = 0, c;
    for(a = 0; a < 10; a++){
        b+=c;
    }
```
 the state of `c` changes as values are been added as the `for` loop is being executed.
    **Types of Binding**
 *Dynamic Binding* : Variable are bound to a type depending on the value assigned.
                    this happens at run-time.
*Static Binding* : This happens at compile time where the compiler figures out what variable to assign to what method or function. A perfect example is method overloading where two methods have same name but different number or type of parameter. If two parameters are passed in a method `A` (that has two parameters), the compiler figures out that the method to return is `A`.
Hope this helps.
Today I Learned: Some VIM tricks
Tags: vim, nerdtree, file, todayilearned
Published: 2017-10-18 08:41:24

---
title: "Today I Learned: Some VIM tricks"
published: true
description: 
tags: VIM, NERDTree, File, todayilearned
---

#VIM Trick 1 - Create new file using NERDTree plugin 

Many VIM users depend on NERDTree plugin to browse directory but rare use it to create a new file on without leaving Vim (at least I was one such Vim user). 

I found nice blog entry which told me how to do so - [Link here](https://sookocheff.com/post/vim/creating-a-new-file-or-directoryin-vim-using-nerdtree/)

To summarize - 

- Open NERDTree panel
- Navigate to the directory where you want to create new file or directory. 
- Press `m` - which opens up NERDTree Filesystem Menu. 
- Type `a` to create the child node and type the name of file or directory. For directory append `/` at the end. 
- That's it. 



#VIM Trick 2 - Create new file using VIM built-in feature. 

While I was experimenting on the steps above I made a silly mistake. I didn't open the newly created file before typing my experiment with NERDTree. So I typed my content in an un-named buffer. To wiggle out, I decided to rely on VIM help. This is what I did - 

- Type `:h save` - this opened up the help window with VIM
- The `saveas` command in VIM helps us same the current buffer into a file. 
- Use `!` option to save to an existing file. 
- I will let the reader experiment with this with their own hands-on exercise.
Feature toggles in the front-end - useful pattern or delivering dead code? #discuss!
Tags: webdev, javascript, webapp, discuss
Published: 2017-10-18 08:35:35

---
title: Feature toggles in the front-end - useful pattern or delivering dead code? #discuss!
published: true
description: Discussion on how feature toggles are a popular pattern in the backend, where the hidden code is not exposed to the user, but in the front-end, it may lead to unused code being delivered to the client
tags: #webdev, #javascript, #webapp, #discuss
---

Feature toggles, like a lot of other paradigms and patterns from the back-end are becoming popular in the front-end. However, the context to which they apply is very different.

A feature toggle in the back-end will not expose the toggled code to the customer until it is activated. In the front-end, unless the feature is loaded only after its activation, it will be delivered and at least partially exposed to the user. There are several ways to reduce the exposure, ranging from hiding the feature behind `display: none;` to not executing the code.

The former will dirty up the DOM with hidden elements while the latter will still mean that you deliver dead code to the customer.

Please discuss how for you the advantages outweigh these drawbacks or not.
Photo thumbnails are reversing on mobile
Tags: php, orientation, imagerotation, javascript
Published: 2017-10-18 03:05:30

---
title: "Photo thumbnails are reversing on mobile"
published: true
description: --TEXT--
tags: php,orientation,image-rotation,javascript
---

As i said on title, Photos are uploading normal. Thumbnails are uploading reverse. This issue only on Mobile. When i upload on PC, uploading properly. If anyone has any tips I would be very grateful.

There is no solution. Can someone help me with this code please ?

SOURCE LINK: https://github.com/pluck-cms/pluck/blob/master/data/inc/lib/SmartImage.class.php

PHP VERSION : 7.1

Here is my code:
http://sandbox.onlinephpfunctions.com/code/5d21cff82cb571ac39b1f5a89c28be990645adcd
Async Iteration in Nodejs
Tags: node, async, loops, database
Published: 2017-10-17 22:52:38

---
title: Async Iteration in Nodejs
published: true
description: 
tags: nodejs, async, loops, database
---

Node.js is an amazing JavaScript run-time environment, no doubt. Its non-blocking IO model makes applications built with it amazingly fast and highly efficient. But sometimes its non-blocking nature provides some interesting challenges when performing asynchronous iterations.

Lets say we have an array of user ids, and we want to loop through the array and query our users collection(or table) for more information such as their first name, last name and email address. In the end we want to return another array of objects containing these data.

One approach we may use will be as follows:


```javascript

const getUserDetails = (userIds, callback) => {

	let userInfoArr = [];

	for(let i = 0; i < userIds.length; i++){
		User.findById(userIds[i], (err, user) => {
			if(err){
				return next(err);
			}

			userInfoArr.push({
				firstName: user.firstName,
				lastName: user.lastName,
				email: user.email
			});
		})
	}

	callback(userInfoArr);
}

getUserDetails(ids, (users) => {
	console.log(users);
})

```
You might think this will work and that we successfully get back the array of users that we wanted, but when we log the resulting users array to the console, we get an empty array. Why is that? 

Well, as we already know, node is asynchronous: it doesn't sit around and wait for the result of an execution and instead goes back only when the result is available.
So the reason we are getting an empty array is that at the point where we logged the resulting array, the execution of our code was not complete.

This means we have to wait for the execution to be complete before we return our results. One way that has worked for me is by introducing a new counter variable.
In every iteration, the value of the counter is increased and then checked to see if its equal to the length of the array we are iterating over. If the counter is equal to the array's length, then we assume the execution has completed and we return the resulting array, like so:

```javascript


const getUserDetails = (userIds, callback) => {

	let userInfoArr = [];
	let counter = 0;

	for(let i = 0; i < userIds.length; i++){
		User.findById(userIds[i], (err, user) => {
			if(err){
				return next(err);
			}

			userInfoArr.push({
				firstName: user.firstName,
				lastName: user.lastName,
				email: user.email
			});

			counter++;

			if(counter == userIds.length){
				return callback(userInfoArr);
			}
		})
	}
}

getUserDetails(ids, (users) => {
	console.log(users);
});


```

Happy coding!