teleren/devto huggingface dataset:
Friday Blast #57
Tags: fridayblast, links, post
Published: 2019-01-20 14:44:02

---
title: Friday Blast #57
published: true
tags: friday_blast,links,post
canonical_url: https://horia141.com/friday-blast-57.html
series: "Friday Blast"
---

[A short guide to hard problems (2018)](https://www.quantamagazine.org/a-short-guide-to-hard-problems-20180716/) - most folks are familiar with the P and NP _complexity classes_, at least via the `P vs NP` problem at the core of computer science. Here a bunch of extra complexity classes are covered - BPP, BQP, PH, PSPACE and EXPTIME as well as the relationships between them. Sometimes they’re clear cut, other times we have strong reasons to believe a they’re the same, and yet other times the field is open.

[Introduction to model trees from scratch (2018)](https://towardsdatascience.com/introduction-to-model-trees-6e396259379a) - one of the cooler aspects of computer science inspired ML models (decision trees and neural networks[1]) is that they’re oftentimes “composable”. Here the space partitioning approach used in decision trees is combined with linear regressions at the leaves, to produce a more powerful model than the “classic” constant model one.

[AWS, MongoDB, and the economic realities of open source (2019)](https://stratechery.com/2019/aws-mongodb-and-the-economic-realities-of-open-source/) - as usual, a good piece from Stratechery on the business side of tech. This time with a focus on open source. It’s been a _thing_ for the last 2-3 years that tech companies in the open source infrastructure space were in for a tough time because cloud providers were offering their systems in a more convenient and cheap way. Docker, ElasticSearch, Redis, MongoDB, Hadoop and their backing companies were prime examples. This article focuses on MongoDB and Mongo Inc. But it’s telling. Companies in this space need to move up the value chain if they’re going to succeed. I plan on writing my own bit on this shortly.

[A primer on database replication (2017)](https://www.brianstorti.com/replication/) - the various approaches to data replication in the database context. It’s nice that it looks at both SQL and NoSQL solutions and how each tackled the problem.

[Billions of messages a day - Yelp’s real-time data pipeline (2016)](https://engineeringblog.yelp.com/2016/07/billions-of-messages-a-day-yelps-real-time-data-pipeline.html) - a description of the impressive architecture Yelp has deployed to organize it’s systems. A Kafka based central data repository is not that _future-tech-y_, and I’ve posted about such an approach several times here. But the central schema store with built-in tracking of streams, documentation and integration with code is pretty sweet.

* * *

[1] As opposed to statistics inspired ones - GLMs, SVMs etc.
#discuss What do you think a great manager of developers does? 
Tags: discuss, career, management
Published: 2019-01-18 06:40:55

---
title: #discuss What do you think a great manager of developers does? 
published: true
description: 
tags: discuss, career, management
---

I’ve had a couple of managers over my short career to date, and I’ve seen both technical and non technical ones. They’ve all been pretty great. 

Have yours? What did they do right? What did they do wrong? If you were one, what would you do differently? If you are one, what have you learned?
php cron manager for managing linux's cronjob
Tags: php, cron, crontab, linux
Published: 2019-01-18 05:14:28

---
title: php cron manager for managing linux's cronjob
published: true
description: php cron manager for managing linux's cronjob
tags: php,cron,crontab,linux
---
I managed it for inidividual use only but i think someone need it. When i use linux crontab i felt very uncomfortable unlike iptables, so i meade it as a php code instead of shell script. sorry I've no skills about shell script.

Whatever I tried to make this as simplest. So There's no handling about some danger commands(e.g : rm -rf [somethings], halt, reboot, shutdown, and so on... ). So I want you to be careful when you use this class. I've no responsibility about problems occurred by using this class. And understandably you need to know about cron commands.

Cronjobs are made by this class, managed by CRONTAG. CRONTAG is a comment that pasted cronjob's tail. It creates and removes about cronjobs by using regex,.

code and manual are below repo. i don't know how to write code snipet in here. Please use it well.

{% github https://github.com/jujumilk3/PHPCronManager %}
BinStorm 
Tags: reactnative, binstorm, reactnativestyle
Published: 2019-01-18 05:08:21

---
title: BinStorm 
published: true
description: BinStorm is a React Native styling utility for rapidly building custom user interfaces.
tags: React-Native, BinStorm, React-Native-Style
---

<p align="center">
  <img src="https://i.imgur.com/PydPzYZ.png" alt="FirebaseChat" title="FirebaseChat" height="80" width="80" />
</p>

BinStorm is a React Native styling utility for rapidly building custom user interfaces

It is different from frameworks like Shoutem, Native Base, or UI Kitten in that it's not a UI kit.

It doesn't have a default theme, and there are no built-in UI components.

But importantly, it contains all the helpers that will help you to build your application design. Rather than pre-defined components & theme which controls how your app should look.

If you're looking for a framework that comes with prebuilt widgets/components to build your app with, BinStorm might not be the right framework for you. 

## Example
See the [official examples](https://github.com/binbytes/binstorm-example) for usage reference with the latest version of BinStorm.

## Documentation
For full documentation, visit [BinStorm](https://docs-binstorm.binbytes.com)
Build a React SPA without Redux.
Tags: react, redux, javascript, webdev
Published: 2019-01-18 04:23:26

---
title: Build a React SPA without Redux.
published: true
description: Use capybara-router to build a React SPA without Redux.
tags: #react #redux #javascript #webdev
---

## We need two elements to render a page on the client.
- **Template**. The React component.
- **Data**. We fetch data from the backend.

The client-side app fetch data from the backend, then render it on the browser DOM.
It is really simple work. But what we do on projects. We use [flux](https://github.com/facebook/flux), [redux](https://github.com/reduxjs/redux), [redux-thunk](https://github.com/reduxjs/redux-thunk), [redux-saga](https://github.com/redux-saga/redux-saga)...

I have used redux, but I think redux takes too much time to build actions and reducers.
We just want a client-side router. We define the page of routes with the component and that how to fetch data.

I build [capybara router](https://github.com/kelp404/capybara-router). It is a react router without flux and redux.
It provides a simple way to build a frontend app of SPA.

{% github kelp404/capybara-router %}


### Live demo of SPA with capybara router.
- **[https://kelp404.github.io/capybara-router/](https://kelp404.github.io/capybara-router/)**

### Simple example code of building SPA with capybara router.
```js
const React = require('react');
const ReactDOM = require('react-dom');
const {Router, RouterView} = require('capybara-router');
const history = require('history');
const axios = require('axios');

const ErrorPage = props => {
  return <h2 className="text-center">{`${this.props.error}`}</h2>;
};
const Home = props => {
  return <h2>Home</h2>;
};

const router = new Router({
  history: history.createBrowserHistory(),
  routes: [
    {
      name: 'web',
      uri: '/',
      onEnter: props => {
        document.title = 'Home';
      },
      resolve: {
        data: params => {
          return axios({
            method: 'get',
            url: `/data/${params.id}.json`
          }).then((response) => {
            return response.data;
          });
        }
      },
      component: Home
    }
  ],
  errorComponent: ErrorPage
});
router.start();

const element = (
  <RouterView>
    <p className="text-center text-muted h3" style={padding: '20px 0'}>
      <i className="fa fa-spinner fa-pulse fa-fw"></i> Loading...
    </p>
  </RouterView>
);
ReactDOM.render(
  element,
  document.getElementById('root')
);
```

[more details example](https://github.com/kelp404/capybara-router/tree/master/example)
Is developer productivity a bigger constraint to innovation than capital?
Tags: discuss, productivity
Published: 2019-01-18 01:39:21

---
title: Is developer productivity a bigger constraint to innovation than capital?
published: true
description: Executives worry most about getting access to developer talent, but the real bottleneck is productivity.
canonical_url: https://www.software.com/review/developer-productivity-a-bigger-constraint-to-innovation-than-capital
cover_image: https://thepracticaldev.s3.amazonaws.com/i/yq2u5qa9ftb8dw225jcs.jpg
tags: discussion, productivity
---

I recently read a report that Stripe released called [The Developer Coefficient](https://stripe.com/reports/developer-coefficient-2018) that asked both C-level executives and developers to identify the largest constraints to innovation. One of the main the takeaways that I came across is that executives worry more about finding skilled developers than they do capital, with 53% identifying access to software talent as a major constraint and 52% identifying capital.

If you dig a little deeper, there are some other interesting takeaways in the article. 

Access to software talent isn’t the only problem. Both management and developers see huge gains to be made in productivity:

* **96%**: the number of C-level executives that believe increasing developer productivity is high or medium priority.
* **68.4%**: how productive on average developers believe they are as a whole, 100% being perfectly productive.

Per the report, “developers [are] force-multipliers: It’s not how many devs companies have; it’s how they’re being leveraged.”

I think many companies have incorrectly attributed their technology woes to a lack of developer talent.

The average developer spends 17.3 hours each week dealing with technical debt, bad code, and maintenance jobs, like debugging and refactoring. That’s a 31.6% efficiency impact that equates to an estimated nearly $300B loss in global annual GDP, which is equivalent to the entire GDP of Pakistan.
![The developer work week](https://thepracticaldev.s3.amazonaws.com/i/hip8p432wx5v8hjv2ziq.png)

<figcaption>Reproduced from Stripe's The Developer Coefficient</figcaption>

Despite the efficiency impact, roughly 83% of C-level executives and 77% of developers are very or somewhat confident they have sufficient resources to keep up with new technology trends, like AI/ML, IoT, and blockchain.

And yet a whopping 44% of developers believe their company is too slow to react to tech trends. 

Something doesn’t quite add up. Maybe companies need to innovate and react faster to new technology trends.


What do you think? Is software talent the biggest constraint to innovation?
Easy machine learning with Ruby using Rumale
Tags: ruby
Published: 2019-01-18 00:42:41

---
title: Easy machine learning with Ruby using Rumale
published: true
description: Ruby machine learning library
tags: ruby
---

## What is Rumale

A powerful library for machine learning written in pure Ruby!
Rumale is created by @yoshoku.
https://github.com/yoshoku/rumale

>Rumale (Ruby machine learning) is a machine learning library in Ruby. Rumale provides machine learning algorithms with interfaces similar to Scikit-Learn in Python. Rumale supports Linear / Kernel Support Vector Machine, Logistic Regression, Linear Regression, Ridge, Lasso, Factorization Machine, Naive Bayes, Decision Tree, AdaBoost, Gradient Tree Boosting, Random Forest, Extra-Trees, K-nearest neighbor classifier, K-Means, Gaussian Mixture Model, DBSCAN, Power Iteration Clustering, Mutidimensional Scaling, t-SNE, Principal Component Analysis, and Non-negative Matrix Factorization.

## Install

```bash
gem install rumale
```

## Prepare a dataset

```ruby
require 'rumale'
require 'daru'
require 'rdatasets'

# load datasets
iris = RDatasets.load(:datasets, :iris)
# Daru::DataFrame

# labels # Numo::Int32#shape=[150]
iris_labels = iris['Species'].to_a
encoder = Rumale::Preprocessing::LabelEncoder.new
labels = encoder.fit_transform(iris_labels) 

# samples Numo::DFloat#shape=[150,4]
# (Daru -> NArray )
samples = Numo::DFloat[*iris[0..3].to_matrix.to_a]
```

## Classification models

```ruby
# Support vector machine
model = Rumale::LinearModel::SVC.new(
  reg_param: 0.0001,
  fit_bias: true,
  max_iter: 3000,
  random_seed: 1
)
```

#### Various classifiers

* see official reference.
https://www.rubydoc.info/gems/rumale/

```ruby
model = Rumale::Tree::DecisionTreeClassifier.new(random_seed: 1)
model = Rumale::Ensemble::RandomForestClassifier.new(random_seed: 1)
model = Rumale::NearestNeighbors::KNeighborsClassifier.new(n_neighbors: 5)
model = Rumale::NaiveBayes::GaussianNB.new
# etc...
```

## Cross validation

```ruby
# KFold
kf = Rumale::ModelSelection::StratifiedKFold.new(
  n_splits: 5,
  random_seed: 1
)

cv = Rumale::ModelSelection::CrossValidation.new(
  estimator: model,
  splitter: kf
)
report = cv.perform(samples, labels)
```

## Result

```ruby
scores = report[:test_score]
puts scores.sum / scores.size
# 0.9466666666666667
```

## Learning and Predicting

```ruby
# Learning
model.fit(samples, labels)

# Predicting
# accept 2D NArray  (Numo::DFloat#shape=[150,4])
p model.predict(samples).to_a
```

## Save and load models

```ruby
# Save a model
File.binwrite("model.dat", Marshal.dump(model))

# Load a model
model = Marshal.load(File.binread("model.dat"))
```

Enjoy!
Monocle Reader - The Feedly alternative.
Tags: rss, reader
Published: 2019-01-17 23:40:20

---
title: "Monocle Reader - The Feedly alternative."
published: true
description: "Read the Internet: YouTube, Blogs, Twitter & more..."
tags: ['rss', 'reader']
---
!['Monocle Reader'](https://thepracticaldev.s3.amazonaws.com/i/0gwzoo48084vhbqxe7fh.png)

Yeah, it's a bit too much to say it's a Feedly alternative right now in it's current state but that's where I'm headed. I'm building the next-gen modern Reader app. The idea is to merge classic RSS Readers with Pocket and simplify Internet browsing into one single website to keep up to date with everything new every day.

It's in its early stages but it's already got the basic features of an everyday driver: feeds & folders. Oh, and a shiny and attractive "Import OPML file" to drop your feeds into.

www.monoclereader.com

Really, give it a try, check out the future features that I'm going to implement and just let me know what you think about it!

There's dark mode too, of course...
!['Dark mode!'](https://thepracticaldev.s3.amazonaws.com/i/kmmetrd6zdb3d9fzgsp5.png)

Cheers!
Tea Break Challenge #9 - #17
Published: 2019-01-17 23:04:20

*Day 10:*
Self control is a lot like a muscle; once you’ve exercised self-control in one area, it is perhaps easier to exercise it in another area. Decide on something you will (or will not) do today, and follow through as soon as possible.

*Day 11:*
If you are like most people, you have a lot of incoming noise. Take some time to permanently silence one source of incoming noise. This might mean unsubscribing to a newsletter, turning off push notifications, or removing a recurring meeting from your calendar.

*Day 12:*
Studies show that thank you notes are not only appreciated more than expected, but that people also overestimate how awkward giving one will feel. Give someone you know an unexpected note of appreciation today.

*Day 13:*
Most of us carry around stress, but most of us don’t try to locate the source of that stress. Take 5 minutes to figure out what your biggest stressor is today.

*Day 14:*
Naming things is very important, and very hard. The next thing you name - a file, a concept, a presentation, or a variable - take an extra pass over it and evaluate the quality of your naming.

*Day 15:*
Take out a sheet of paper and write down the basic schedule of your day. What things stand out to you as most useful? What things stand out as time wasters? How are you prioritizing these things?

*Day 16:*
Best practices always require context. Today, when encountering a situation where you might use a best practice, ask yourself how it works in this specific context.

*Day 17:*
Variety can provide major benefits to our mental schema and life experience. Take a different route home, try a new food, or listen to a genre you’ve never heard before today.
Insertion Sorting for Beginners in JS     
Tags: javascript, algorithms
Published: 2019-01-17 22:59:57

---
title: Insertion Sorting for Beginners in JS     
published: true
description: An intro to insertion sorting in javascript   
tags: javascript, js, algorithms
cover_image: https://thepracticaldev.s3.amazonaws.com/i/lblw88q5auv4airxux97.jpeg
---

Earlier this week I wrote a [post](https://dev.to/ryan_dunton/bubble-sorting-for-beginners-in-js-2opp) outlining a basic bubble sorting algorithm. Today I am going to tackle the insertion sort algorithm. The motivation behind these posts being that I understand what they are but need to tighten up my actual understanding of them, considering I'm a professional dev who uses JS all day every day.

## What is Insertion Sort?

Insertion sort is a method of sorting an array by dividing the array into a 'sorted' portion and 'unsorted' portion. Then we compare the unsorted item to see if it is larger than the previous element, if not we insert the new item. Basically we are looking from left to right and sorting as we go.

Let's start building our `insertionSort` function.

## Step 1

```javascript
const insertionSort = arr => {
  const len = arr.length;
  return arr;
};
```

I have always found it better to save the array length in a variable instead of continually referencing arr.length.

## Step 2

```javascript
const insertionSort = arr => {
  const len = arr.length;
  for (let i = 0; i < len; i++) {
    //
  }
  return arr;
};
```

Now we have a for loop looping over each element of the array, and we will do our sorting inside of it.

## Step 3

```javascript
const insertionSort = arr => {
  const len = arr.length;
  for (let i = 0; i < len; i++) {
    let el = arr[i];
    let j;
  }
  return arr;
};
```

Set up a variable `el` to hold the current value and initialize another variable `j` and set it outside of our next for loop to maintain appropriate scoping.

## Step 4

```javascript
const insertionSort = arr => {
  const len = arr.length;
  for (let i = 0; i < len; i++) {
    let el = arr[i];
    let j;

    for (j = i - 1; j >= 0 && arr[j] > el; j--) {
      arr[j + 1] = arr[j];
    }
  }
  return arr;
};
```

Now we set up a for loop inside our first for loop. We assign `j` the value of our current array position minus 1 and evaluate it against if it is greater than 0 and if the current element is smaller than the starting loop element.

## Step 5 

```javascript
const insertionSort = arr => {
  const len = arr.length;
  for (let i = 0; i < len; i++) {
    let el = arr[i];
    let j;

    for (j = i - 1; j >= 0 && arr[j] > el; j--) {
      arr[j + 1] = arr[j];
    }
    arr[j + 1] = el;
  }
  return arr;
};
```

Finally we add assign the value `el` to the current index position in the array. Using `j+1` because we are initially setting the value of `j` to `i-1`. 

There is the basics of an insertion sort algorithm!
Medicine4theDead I’d say — keep making aGIFs. Just then convert them to movies :).
Published: 2019-02-12 08:50:44

---
title: Medicine4theDead I’d say — keep making aGIFs. Just then convert them to movies :).
published: true
tags: 
canonical_url: 
---

[Medicine4theDead](https://medium.com/u/52148b58e96c) I’d say — keep making aGIFs. Just then convert them to movies :).
Demis Hassabis, The Theory of Everything
Tags: alphago, hassabis, ai, agi
Published: 2019-01-17 21:58:00

---
title: Demis Hassabis, The Theory of Everything
published: true
description: 
tags: alphago, Hassabis, ai, agi
---

Talk from AlphaGo creator. Understand theory of everything through AI or AGI(general).

He said they took part in Youtube recommendation. That's why youtube is so smart.

{% youtube rbsqaJwpu6A %}
What is Gatsby?
Tags: gatsby, react, beginners
Published: 2019-01-17 21:31:06

---
title: What is Gatsby?
description: How GatsbyJS helps us build performant apps and websites by combining the best features of React and static HTML. 
canonical_url: https://michaeluloth.com/gatsby-what-is-it/
tags: gatsby, react, beginner
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/bsqg6bsrkf24jqcqcsoh.png
series: Up & Running with Gatsby
published: true
---

This video kicks off a new [beginner series](https://www.youtube.com/watch?v=jAa1wh5ATm0&list=PLHBEcHVSROXQQhXpNhmiVKKcw72Cc0V-U) exploring GatsbyJS and how to use it to easily build performant apps and websites.

The first video explores the Gatsby ecosystem and how Gatsby simplifies web development by combining the best features of React and static HTML.

Check out the video below or [view the entire playlist](https://www.youtube.com/watch?v=jAa1wh5ATm0&list=PLHBEcHVSROXQQhXpNhmiVKKcw72Cc0V-U) on YouTube.

Enjoy! 🎉📺

{% youtube jAa1wh5ATm0 %}
A (Big) List of Resources for Developers
Tags: githunt, learning, webdev
Published: 2019-01-17 21:29:29

---
title: A (Big) List of Resources for Developers
published: true
cover_image: https://cdn.pixabay.com/photo/2017/02/18/11/00/checklist-2077020_1280.jpg
description: 
tags: githunt, learning, webdev
---

Worth a ⭐️!

{% github charlax/professional-programming %}

This list of resources has been going around my company, it's worth a once-over to see if there is something that relates to what you're learning right now.
Explain brain surgery so that a five year old child can understand it
Published: 2019-01-17 21:24:23

---
title: Explain brain surgery so that a five year old child can understand it
published: true
description: A short excursion into a popular way to ask for information about complicated topics.
tags: 
---

Disclaimer: This post is about a curiosity on my part. I'm not talking to anyone in particular, so if you are guilty of doing what I'm about to talk about, please do not take this personally. It's not about you. 

What I am curious about is why people keep asking for things to be explained "as if for a five year old."

How is this supposed to be helpful?

A five year old child has no frame of reference to make sense of the kind of work we do as developers. Even if someone could explain software development concepts and technologies in a way that a five year old could understand, how would that help any other developer?

How about we ask people to explain a technology so that a high-school student could understand it? At least a high-school student would have a frame of reference regarding computers and what they can do from a user's standpoint, and some of them have even taken basic programming classes.

I get the concept of being able to explain something really complicated in simple terms, and I think that is a helpful idea. But trying to take something down to the level of a five year old is, at least in my opinion, a bit of a stretch.

"Explain brain surgery to a five year old." 

"Sometimes people have broken brains. So a brain surgeon opens up that person's head and changes their brain so that it isn't broken anymore."

OK, assuming a five year old knows what a brain is, that might help them understand brain surgery, but how will that help a budding medical student?

I think it's about the same as trying to explain software development concepts and technologies at a five year old level. It might help someone understand something at the most basic level,  but how will that help a budding software developer?

Anyway, that is just my curiosity topic today. If you think explaining things at a five-year old level is helpful, please feel free to sound off in the comments.

Thanks, and have a great day.