teleren/devto huggingface dataset:
What I learnt about obsessing with my competitors
Tags: startup, competition, productivity
Published: 2019-02-16 15:50:51

---
title: What I learnt about obsessing with my competitors
published: true
description: What I leant from watching my competitors in the market closely. Let me help you find your focus when watching your competition.
tags: Startup, Competition, Productivity
---
I am obsessed with my competitors. I literally track them everywhere. Meticulously and relentlessly.

When I started [Skcript](https://www.skcript.com) back in 2013, I was obsessed over my competition that I would give a lot of damn about it. Few years went by, and it was 2016, and the feeling of never being able to ‘pause’ (not stop) my running started sinking in. I went on a drive one nice evening to see how I cloud overcome this mindset and move on to focus on other things that we could do at Skcript.

What I realized about analyzing by competition was something different.

People say that competition is good. And that you will have to be obsessed over your competition. The real reason behind that is not to keep your company updated all the time, but to know what your customers really want. Period. It is that simple.

Knowing what your customer wants is more important than watching your competition closely. It is probably the only single metric that will matter to you when you are new to the market trying to create something good.

Watching your competition and being obsessed over them comes as a part of knowing your customers well enough.

Post that long drive I had in 2016, after being stressed, the one thing that changed in me to build great products that matter, is where I looked at my competition.

Earlier, I used to obsessively follow them everywhere. On social media, get more information about them from friends, and my major stress came in when I used to hear news saying that they on-boarded say 2000 more users on-to their platform.

Today, all that I look for and the one metric that helped me grow our revenue was to analyze my competitors’ feature set and figure out why they built it like they did. Considering my competitor as one of my biggest and free user-testing providers made all the difference.

Ultimately, we all are here to solve a customers’ problems. Not our own problems.

---

This post first appeared on [Karthik's Desk on Skcript](https://www.skcript.com/karthik/about-watching-competition/).
Bye Bye Oracle JDK, Hello OpenJDK on macos
Tags: openjdk, uninstalloraclejdk, brewopenjkd
Published: 2019-02-16 15:25:14

---
title: Bye Bye Oracle JDK, Hello OpenJDK on macos
published: true
description: In this post I'll take you through the journey of uninstalling Oracle JDK from my macos and installing OpenJDK 11
tags: openjdk, uninstall oracle jdk, brew openjkd
---
After reading [this](https://derflounder.wordpress.com/2018/10/19/oracle-java-jdk-openjdk-java-11-and-macos/) post I wanted to remove Oracle JDK 8 from my system and install OpenJDK 11.

* Before I started I checked my java version using ```java -version```
![checking version of java ](https://thepracticaldev.s3.amazonaws.com/i/gmolx7dv4o0dn0wwktrp.png)

* The first step was to remove Oracle JDK, which I found [instructions here](https://stackoverflow.com/questions/19039752/removing-java-8-jdk-from-mac).
```
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk

sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.Helper-Tool.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist

```

![removing oracle jdk](https://thepracticaldev.s3.amazonaws.com/i/ffxf78ebfi96e4i17lxa.png)

* After uninstalling installation was easy ```brew cask install java```
![installing OpenJDK using brew](https://thepracticaldev.s3.amazonaws.com/i/5kxdc9f78c6kkvzu82na.png)

* Install and Check the java version again

![installation and version check](https://thepracticaldev.s3.amazonaws.com/i/0bndylwbsazs4pv5591z.png)

That's it!

Cheers :)
How to create and debug Ruby gem with C (native) extension
Tags: c, debug, gem, ruby
Published: 2019-02-16 15:10:17

---
title: How to create and debug Ruby gem with C (native) extension
published: true
description: explains how to create a minimum Ruby gem with native extension written in C and debug it with gdb.
tags: c, debug, gem, ruby
---

Moved to https://blog.wataash.com/ruby-c-extension/
Monkey Patching in Python
Tags: python
Published: 2019-02-16 11:47:14

---
title: Monkey Patching in Python
published: true
description: Monkey Patching in Python
tags: #python
---

In Python, the term monkey patch refers to dynamic (or run-time) modifications of a class or module. In Python, we can actually change the behavior of code at run-time.


# monk.py 
class A: 
     def func(self): 
          print "func() is being called"


We use above module (monk) in below code and change behavior of func() at run-time by assigning different value.


import monk 
def monkey_f(self): 
     print "monkey_f() is being called"

   
# replacing address of "func" with "monkey_f" 
monk.A.func = monkey_f 
obj = monk.A() 
  
# calling function "func" whose address got replaced 
# with function "monkey_f()" 
obj.func() 


Output :monkey_f() is being called
How valuable would an open-source 3rd party user management be to you or your upcoming project?
Tags: opensource, javascript, dev, discuss
Published: 2019-02-16 07:46:05

---
title: How valuable would an open-source 3rd party user management be to you or your upcoming project?
published: true
description: Think nginx, but for user management. What problems in user management are you facing right now?
tags: #oss #javascript #dev #discuss
---
The Manager's Path Review
Tags: fridayblast, links, post
Published: 2019-02-16 15:26:32

---
title: The Manager's Path Review
published: true
tags: friday_blast,links,post
canonical_url: https://horia141.com/the-managers-path-review.html
series: "Book Reviews"
---

Another month, another book review [1]. This time it’s [“The Manager’s Path”](https://www.amazon.com/Managers-Path-Leaders-Navigating-Growth/dp/1491973897) by Camille Fournier. This was quite the good read and I felt like I got a lot out of it. It seem to pop up a lot on first time managers reading lists and its been recently doing the rounds at work as well. Mostly cause there’s a lot of us these days.

The book aims to be a manual for management of software engineering teams. Is has a straightforward structure: several chapters, each covering one level in a typical engineering management ladder. So it starts with individual contributor, the goes on to lead engineer, manager, manager of managers/director and finishes with the executive roles: VPs and CTOs.

For each level there’s also a common structure - typical expectations, pitfalls to avoid, case studies etc. Most of the stuff resonated from my (super limited) experience. There were several things which perhaps bear repeating.

First, this is more or less a career change from software engineering. Not a promotion, not a “modifier” (except at the entry level perhaps, in some companies). Treat it as such and see that’s it’s the thing you want to do. If you only see it as the only natural progression at the company where you work, it’s not going to live up to your expectations. And you’re better off moving to a company with a solid individual contributor career trajectory

Second, point number one taken into account, you are still the _engineering_ manger. So you need to know enough if the tech parts of the job to contribute. At lower levels through code reviews, architecture proposals etc and at higher levels through tehnology choices, strategic decisions etc.

Anyways, there’s a wealth of extra information in this books, from how to manage your career, to how to interact with other departments. Well worth your time.

* * *

[1] Ha! If I only had such a good cadence.
Don't trust SemVersioning in NPM Modules
Tags: npm, node, javascript
Published: 2019-02-16 02:47:10

---
title: Don't trust SemVersioning in NPM Modules
published: true
description: Don't trust SemVersioning in NPM Modules
tags: npm, nodejs, javascript
---


### Problem ###
```json
{
    "dependencies": {
        "some_module": "^0.3.8",
        "some_other_module": "~0.1.3",
        "dont_do_this": "*"
    }
}
```

Do any of those patterns look familiar to you? Yes? Then I sure hope you know whether all of your installed packages follow [semantic versioning](https://docs.npmjs.com/about-semantic-versioning) (semver)! Otherwise these could be ticking time bombs waiting to blow up in your future deployment.

Some packages follow semver better than others, but, from my experience, the ones you should be most cautious with are the sub-1.0 packages because they definitely don't follow semver; they typically use the second digit (0.x) as the major version and the third digit (0.1.x) as the patch or feature version! So the next time you run your build for a package in version `0.x` you might be in for a nasty surprise.

For a more concrete example, let's use `knex`, which is currently in version `0.16.3`. Now, if you specify in your `package.json` to install version `0.x`, then this means that the next time you run a deployment you could be installing version `0.17.0`, which might contain breaking changes that impact your app!


### Solution ###
At this point, you might be wondering how you could solve this problem. Luckily for us, the solution is pretty simple: lock down all of the package versions! Your `package.json` should look more like the one below to avoid any surprises.

```json
{
    "dependencies": {
        "some_module": "0.3.8",
        "some_other_module": "0.1.3",
    }
}
```

Of course, you can also relax the rules for any packages that you know follow semver. For instance, you're probably safe to trust packages like `react` (v16.8.2) and `restify` (v7.7.0) since they're both pretty popular projects with many major releases.


#### Edit ####
As mentioned in the discussion, this issue can also be mitigated by keeping your package-lock.json up to date. This works because once a version is specified in the package-lock.json, it won't be updated if it meets the required version specified in package.json. For instance, 0.24.0 fulfills the requirement for 0.x, so even if 0.25.0 is released, npm will continue to install and use 0.24.0.


#### References ####
https://docs.npmjs.com/about-semantic-versioning
https://docs.npmjs.com/files/package-locks
Is it just me or power users have been losing their power?
Tags: productivity, rant
Published: 2019-02-15 17:54:53

---
title: Is it just me or power users have been losing their power?
published: true
description: 
tags: #productivity #rant
---

I don't know if I am just getting older, or the trend in the past 5-7 years is really that bad for the average power user.

#1. Laptop -> ThinkPad

ThinkPads used to be more than mere laptops. They were **function over form** all the way. They looked ugly to the untrained eye, but for me I knew to appreciate what was on the inside (and on the outside). Durability, serviceability, fantastic keyboard and of course the trackpoint. But slowly designers started the quest of trying to **"modernize" the ThinkPad** and make it more and more generic. 
The original keyboard got replaced with a new island-style keyboard. Next on the list were the physical buttons beneath the trackpoint. Why not replace the convenience of physical buttons with touch-based buggy ones (and not do any usability testing)? Fortunately this experiment lasted only one generation. Next - upgrading hardware was too easy, why not make it hard by having the user to unscrew everything and remove the whole bottom case? I have almost forgotten about the ThinkLight - gone. 

#2. OS -> Windows7

Windows7 used to be an OS. Not OS as a Service as Windows10. I could disable all updates indefinitely if I wanted to. Not with Windows10. I will be forced to be MS **beta user** for life (if I ever decided to upgrade?)


#3. Smartphone -> BB10

BB10 was (still is) the best mobile OS I have ever experienced. No home button. All navigation is gesture-based. Great device search, best unified notification system, best stock apps there are -> file manager, browser, calendar etc, super original device unlock mechanism via Picture Password (youtube it), device encryption, Android runtime and... physical keyboard. 
Now if I want to use a physical keyboard, my only option (hence no choice) is the inferior Key-x series running an inferior OS - Android.

#4. Browser -> Firefox

Firefox used to be fully and **easily** customizable. Not anymore. 
The first blow for me was when the Panorama feature was removed. Why? _Nobody seemed to have been using it_. Great. Next, let's kill all of the add-ons that made Firefox what it is. Why? _We wanna be as fast as google no matter what!!!_ Next, let's remove said add-ons from our repository as if they never existed. 
Why? _We truly want to disown our legacy_. Next, and this was it for me, let's hide the "Never update" option. Why? _Nobody seems to be using it._ Yeah, right.

PS.
Wherever you found one, it was mostly intended.
How to Change the iOS Status Bar Color with UIKit
Tags: ios, uikit
Published: 2020-09-24 03:48:21

---
title: How to Change the iOS Status Bar Color with UIKit
published: true
date: 2019-02-16 00:00:00 UTC
tags: iOS, UIKit
canonical_url: https://nickymarino.com/2019/02/16/change-status-bar-ios/
---

https://nickymarino.com/public/assets/2020/optimizing-virgo/example_11.png

For some iOS apps, it may be helpful to change the color of the status bar at the top of the screen. For example, if I have a dark background, the default status bar style is hard to read:

![Dark iPhone app](https://nickymarino.com/public/assets/2019/change-status-bar-ios/dark-dark.png)

To change the appearance of the status bar within a view controller, first add “View controller-based status bar appearance” as an item to your `Info.plist` with a value of `YES`:

![Info.plist](https://nickymarino.com/public/assets/2019/change-status-bar-ios/plist.png)

Then in any view controller, you override the `preferredStatusBarStyle` property:

```
override var preferredStatusBarStyle: UIStatusBarStyle {
    return .lightContent
}

```

And if you ever need to update the status bar color, call `setNeedsStatusBarAppearanceUpdate()`. Now the full view controller looks like this:

```
import UIKit

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view,
        // typically from a nib.
        setNeedsStatusBarAppearanceUpdate()
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
}

```

Running this view controller, we get a light status bar!

![Dark iPhone app with light status bar](https://nickymarino.com/public/assets/2019/change-status-bar-ios/dark-white.png)
REST API e2e testing with cURL
Tags: testing, showdev, api, learning
Published: 2019-02-15 23:04:34

---
title: REST API e2e testing with cURL
published: true
description: 
tags: testing, showdev, api, learning
---

A while ago I was looking for a simple way to e2e test my REST API, written in Flask. Since I was only interested in make HTTP requests and parse the JSON response I didn't see any point of using any assertion library or test framework. To improve my bash skills i decided to write it with cURL and bash functions.

## Readable output
Testing is to give us control and possibility to with ease find troubles. Therefore I made some colors and an icon to make it easy to parse the results for a human eye.

```
Green='\033[0;32m'
Red='\033[0;31m'
Color_Off='\033[0m'

Check_Mark='\xE2\x9C\x94'
```

## Assertions
To keep the tests simple I tested everything with "assert equals", which was ran by this function.

```
assert_equals () {
  if [ "$1" = "$2" ]; then
    echo -e "$Green $Check_Mark Success $Color_Off"
  else
    echo -e "$Red Failed $Color_Off"
    echo -e "$Red Expected $1 to equal $2 $Color_Off"
    Errors=$((Errors  + 1))
  fi
}
```

## Parsing the JSON
To parse the JSON I used jq, and created a helper function. The first argument is the JSON string and the second is the path, for example ".[0].title".


```
get_json_value () {
  echo $1 | jq -r $2
}
```

## The tests
So finally came the tests that I run. They looked like this:

```
echo "### START /api/v2/shelters"
shelters_url="localhost:5000/api/v2/shelters/"

echo "When retrieving a shelter accurate properties should be given"
response=$(curl -s "${shelters_url}142784-8")
assert_equals "$(get_json_value "$response" ".shelterId")" "142784-8"
assert_equals "$(get_json_value "$response" ".address")" "Sockerbruksgatan 3"
assert_equals "$(get_json_value "$response" ".slots")" "80"
```

## Am I happier?
Yes. I guess it'd been easier to write it with Python, but this was more fun. I also think that we developers may tend to use bloated frameworks that moves us away from the core and the control. This was a good lesson for me to think outside of my small box, which I think is necessary to keep learning.

[You can see the full test suite here](https://github.com/hitta-skyddsrum/services/blob/78db77d36a5eddef8ef8b4f8178b64e63e0171d9/e2e/shelters.sh)
React Hooks explained as simply as I humanly can
Tags: react, hooks, javascript, beginners
Published: 2019-02-15 22:42:26

Hooks let you do more things with function components.

---

You can use state with the `useState()` hook.

eg. `const [count, setCount] = useState(0)`.

Now `count` equals `0`.

Update `count` with `setCount(1)`.

Now `count` equals `1` and the component will update.

---

You can also trigger side effects with the `useEffect()` hook.

eg. `useEffect(() => console.log(count), [count])`.

Now it will console log every time `count` updates.

_hint: use `[]` to only trigger the side effect once when the component is mounted and just leave off the second argument to trigger the effect after any state change._

_hint 2: if you return a function from your side effect it will run that function after the componet unmounts._

---

Here's some code.

```jsx
import React, {useState, useEffect} from "react";

function Counter(props) {
  const [count, setCount] = useState(0);

  useEffect(() => {
    document.title = count;
  }, [count]);

  function countHigher() {
    setCount(count + 1);
  }

  return (
    <p onClick={countHigher}>
      {count}
    </p>
  );
}

```
And that's pretty much it.

If you want a more in-depth look [read the docs](https://reactjs.org/docs/hooks-intro.html).
MLP - Multilayer Perceptron
Tags: multilayerperceptron, javascript, neuralnetwork
Published: 2019-02-15 21:41:44

---
title: MLP - Multilayer Perceptron
published: true
description: A JavaScript implementation of a Multilayer Perceptron.
tags: Multilayer Perceptron, javascript, neural network
canonical_url: https://github.com/victorqribeiro/mlp
---

# MLP - Multilayer Perceptron

A multilayer perceptron implementation in JavaScript.

## About

This is my implementation of a [MLP](https://en.wikipedia.org/wiki/Multilayer_perceptron) in JavaScript.
It's comes along with a matrix library to help with the matrix multiplications.
Right now the code is untested and only with basic checks, but I'm still working on it. 
There's a *s* variable commented out in the code, it can be used to measure the error over iterations.
The error should get smaller as the MLP gets trained. The dataset used in the html example was taken from [here](https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data).

## How to use

Let's suppose you have the following data set:

| Height (cm) | Weight (kg) | Class (0-1) |
|-------------|-------------|-------------|
| 180         | 80          | 0           |
| 175         | 67          | 0           |
| 100         | 30          | 1           |
| 120         | 32          | 1           |

0 - adult  
1 - child

You need to process the table to this format:

```
const x = [
	[180, 80],
	[175, 67],
	[100, 30],
	[120, 32]
];

const y = [
	[1,0],
	[1,0],
	[0,1],
	[0,1]
];
```

Note that different from my [perceptron](https://github.com/perceptron) the labels are now [one-hot encoded](https://en.wikipedia.org/wiki/One-hot)

Then just create a new MLP passing the number of inputs, the number of nodes in the hidden layer, the number of outputs,
the learning rate and the number of iterations.


```
const nn = new MLP( x[0].length, x[0].length * 2, 2, 0.03, 500 );
```

Call the fit function

```
nn.fit( x, y );
```

And you're all set to make predictions

```
nn.predict( [178, 70] )
```

There's also a [shuffle](https://datascience.stackexchange.com/questions/24511/why-should-the-data-be-shuffled-for-machine-learning-tasks) function that can be used before the training.

```
nn.shuffle( x, y );
```

You can take a look at the code [here](https://github.com/victorqribeiro/mlp)
Find out about companies
Tags: discuss
Published: 2019-02-15 20:26:41

---
title: Find out about companies
published: true
description: 
tags: #discuss
---

A company is trying to recruit you, what do you do in order to find if that's a good option without getting into the interview process that may cost you time?

Options:

1 - Search the web and make questions. Does the company have a good reputation? How long? How much? If it is a startup, what is the past of the founders?

https://www.glassdoor.com

https://www.crunchbase.com

https://angel.co

LinkedIn, Facebook and Twitter.


2 - Talk with friends, what do they know about it?

3 - Do not make too many questions about the startup (if thats the case) until the interview.


What other things do you do?