teleren/devto huggingface dataset:
The Angular DevOps Series: Semantically release your Angular library
Tags: angular, javascript, typescript, ci
Published: 2018-10-22 14:05:20

---
title: The Angular DevOps Series: Semantically release your Angular library
published: true
description: I'm taking you along in my journey towards a fully automated process for releasing a library! Using CircleCI and the semantic-release.
tags: angular,javascript,typescript,ci
canonical: https://timdeschryver.dev/blog/semantically-release-your-angular-library
canonical_url: https://timdeschryver.dev/blog/semantically-release-your-angular-library
cover_image: https://thepracticaldev.s3.amazonaws.com/i/kffo17rmqm17nydinz45.jpeg
---

# The Angular DevOps Series: Semantically release your Angular library
Are you, like me, getting tired of releasing your Angular library manually? And how about keeping that CHANGELOG up to date? In this post I’m taking you along in my journey towards a fully automated process for my ngx-testing-library library!

## The Angular DevOps Series
This post is the first post of the Angular DevOps Series. The series will also include another post by fellow Angular in Depth writer, Todd Palmer, who will walk you through the details of deploying an Angular application with Travis CI to GitHub pages.

## Introduction
As a bit of background, ngx-testing-library is created with the ng generate library command and has tests written in the library as well as tests in the example application using it. To build and test my changes, I’m already using CircleCI as my Continuous Integration (CI) server.

Before we start let’s make a list of what we’re trying to accomplish after we push a commit:

🔲 Only release when the build passes
🔲 Only release when the push has been made to the master branch
🔲 Release the new version to npm
🔲 Release the new version to GitHub
🔲 Keep the CHANGELOG up to date️



[Read More...](https://blog.angularindepth.com/the-angular-devops-series-semantically-release-your-angular-library-7d78afb4c845)
From 3 Seconds down to 300 Milliseconds : 10^x 
Tags: cpp, optimize, parsing, json
Published: 2018-10-22 13:58:09

---
title: From 3 Seconds down to 300 Milliseconds : 10^x 
published: true
description: While developing a data set filtering algorithm in C++, the algorithm was not performing up to the expectation. So a little tweak made the code 10 times faster
tags: cpp, optimize, parsing, json
---


Here is a dataset filtering algorithm that took 3 seconds for 10000 entries
<pre>
	json& w = where; // condition for filter in JSON format
	// iterate an array of 10000 entries
	for (json::iterator it = col.begin(); it != col.end(); ++it) {
		bool matched = true;
        // iterate the condition array (area of interest)
		for (json::iterator wit = w.begin(); wit != w.end(); ++wit) {
                        
			json compareParams = wit.value();
			std::string key = compareParams.begin().key();

			for (auto item : compareParams) {
				//item.dump(4);
				std::string op = item.begin().key();
				int val = item.begin().value();
				matched &= match(*it, key, op, val);
				
			}			

		}

		if (matched) {
			out.push_back(*it);
		}
	}
</pre>

The algorithm was not performing up to the expectation. So a little tweak made the code 10 times faster. There was a condition in JSON format which was to be matched. Just moved moved the json parsing code for condition outside the big loop and wallah ... the algorithm returned results 10 times faster (or more).
<pre>
    // iterate the condition array
	struct Compare{
		Compare(std::string k, std::string o, int v) {
			key = k;
			op = o;
			val = v;
		}

		std::string key;
		std::string op;
		int val;
	};
	std::vector<Compare> c;

	json& w = where;
	for (json::iterator wit = w.begin(); wit != w.end(); ++wit) {
		json compareParams = wit.value();
		std::string key = compareParams.begin().key();

		for (auto item : compareParams) {
			
			std::string op = item.begin().key();
			int val = item.begin().value();

			c.push_back(Compare(key, op, val));
		}

	}

	// iterate the collection array
	for (json::iterator it = col.begin(); it != col.end(); ++it) {
		bool matched = true;
        // area of interest: This is where the condition parsing codes were
		for (int i = 0; i < c.size(); i++) {
			matched &= match(*it, c[i].key, c[i].op, c[i].val);
		}

		if (matched) {
			out.push_back(*it);
		}
	}		
</pre>
Make an open source maintainer's day with this one weird trick
Tags: opensource, github, devtips
Published: 2018-10-22 13:51:20

---
title: Make an open source maintainer's day with this one weird trick
published: true
canonical_url: https://changelog.com/posts/make-an-open-source-maintainers-day-with-this-one-weird-trick
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ao4dz4uoo854e050azf1.png
description: Little bits of appreciation can make _big_ differences in maintainers' lives. Here's one way you can show appreciation that should take less than five minutes out of your day and just might make someone else's. 🙌
tags: opensource, github, devtips
---

Little bits of appreciation can make _big_ differences in maintainers' lives. Here's one way you can show appreciation that will **take less than five minutes out of your day and just might make someone else's**. 🙌

## The one weird trick 

1. Think of an open source project that you use often.
2. Open your browser to its GitHub Issues (or alternate platform equivalent).
3. Open an issue, thanking the maintainer(s).

That's all there is to it! Weird, right? Let me get out ahead of some FAQs. 💡

### How do I pick an open source project to thank?

Tools are easy: just think about what you've been using lately to get stuff done. Chances are it's open source! Libraries are even easier: check your `package.json`, `Gemfile`, or `Cargo.toml` and find a dependency that has made your life easier. Done and done!

### What do I put in the Issue subject?

I suggest going with "Thanks!", but feel free to get creative with it. 😀

### What do I say in the Issue body?

Tell them how long you've used the thing, how it's made your life easier, why you think it's awesome, etc. <mark>You don't have to write a book!</mark> 

I also like to mention that I expect them to immediately close the issue, to spare them the awkward decision of whether or not to keep it open indefinitely.

### Do I have to use Issues?

No way! Tweet at them, email them, or send them a letter by carrier pigeon. It doesn't really matter which medium you use. It only matters that go out of your way to say thanks.

### Do you actually do this, Jerod?

Yes! But not as often as I should. Most recently, I realized just how much time I'd saved thanks to the _excellent_ [HTTPoison](https://github.com/edgurgel/httpoison) library, so I thanked the author. It made Eduardo's day, which subsequently made my day, too! Weird how that works, huh?

## A bonus trick 🎁

If you want to go the extra mile, [JS Party](https://changelog.com/jsparty) panelist [Feross](https://feross.org) has a  super cool npm package called [thanks](https://github.com/feross/thanks). It will crawl your `package.json` and print out a list of maintainers who accept donations. Because _saying_ thanks can make someone's day, but _giving_ thanks is on a whole other level. 💚
Concise Cheat Sheets of Machine Learning with Python (and Maths)
Tags: machinelearning, cheatsheets, keras, scikitlearn
Published: 2018-10-22 13:29:28

---
title: Concise Cheat Sheets of Machine Learning with Python (and Maths)
published: true
description: Over the past few weeks, I have been collecting Machine Learning cheat sheets from different sources and to make things more interesting and give context, I added excerpts for each major topic.
tags: machinelearning, cheatsheets, keras, Scikitlearn
canonical_url: https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/
---

This post was originally published [here](https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/).

If you are just getting started with Machine Learning or Data Science, you’ll richly benefit from resources compiled from our recent publications;

   - [A Beginner's Guide to Machine Learning with Python](https://sinxloud.com/best-machine-learning-python-course-beginner-learn/)

   - [Best Machine Learning Resources](https://sinxloud.com/machine-learning-tutorial-courses-specialization-beginner/)
   - [How to Learn Data Science With Python Track](https://sinxloud.com/learn-data-science-with-python-track/)
   - [Learn R for Data Science and Machine Learning](https://sinxloud.com/learn-r-for-data-science-courses-classes/)

---

##Best Machine Learning Cheat Sheets ...

Here's a curated a list of Machine Learning Cheat Sheets and most commonly used MLear Libraries in Python. 

---

###1. [Scikit-Learn Cheat Sheet: Python Machine Learning](https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/#1-scikit-learn-cheat-sheet-python-machine-learning)
###2. [Python Cheat Sheet for Scikit-learn](https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/#2-python-cheat-sheet-for-scikit-learn)
###3. [Keras Cheat Sheet: Neural Networks in Python](https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/#3-keras-cheat-sheet-neural-networks-in-python)
###4. [Python SciPy Cheat Sheet](https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/#4-python-scipy-cheat-sheet)
###5. [Theano Cheat Sheet](https://sinxloud.com/machine-learning-cheat-sheets-python-math-statistics/#5-theano-cheat-sheet)

---

We will update this collection of Machine Learning Cheat Sheets once every fortnight.

You may also be interested in reading [Become a Machine Learning Engineer in 6 months](https://sinxloud.com/machine-learning-tutorial-courses-specialization-beginner/#4-become-a-machine-learning-engineer-job-guarantee) to use as a springboard for a rewarding and lucrative career in the field of Machine Learning with a Job Guarantee.


***Cheers***
Why Is That?
Tags: dev
Published: 2018-10-22 12:46:52

---
title: Why Is That?
published: true
description: 
tags: dev
---
I often get a notification of the form "*Someone* and *n* others followed you!"

If *n* is, say 8, I may see an increase in follower count of say, 2.  This is typical, and the increment to the follower count is always a fraction of what's cited in the notification.

Why is that, I wonder.
Understanding the usage of optional and nullable in TypeScript
Tags: typescript, angular
Published: 2019-11-12 16:04:22

---
title: Understanding the usage of optional and nullable in TypeScript
published: true
date: 2018-10-22 11:16:20 UTC
tags: typescript,angular
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/1*3jpAbmyZn6TozMQpw-XSxw.jpeg)<figcaption>Designed by fanjianhua / Freepik</figcaption>

Angular is being widely used by developers as a front-end web application development platform. As an open-source platform, Angular is built with TypeScript, a superset of JavaScript. It is good for Angular developers to have an understanding of how things happen with TypeScript. So, in this article, let us discuss about some of the differences between **nullable** and **optional** parameters.

#### Common misconception

Most developers fall into the category of misunderstanding nullable and optional parameters. The confusion arises on where to use the “ **?** ”. Look at this code block.

```
function example(x: number?, y?: string) {
 // …
}
```

#### “?” Suffix

Notice carefully where the “?” is suffixed. In the first argument it is suffixed to the type of the parameter whereas in the second, it is suffixed to the name of the argument. Do you think both are same?  
**The answer is no**. The first one indicates a **nullable** parameter that can also be a number, _undefined_ or _null_. But, the second argument is an **optional** , it can be a string or _undefined_.

```
x // =\> number | undefined | null
y // =\> number | undefined
```

#### Undefined vs Null

Again here some may not be aware of the difference between “ **undefined** ” and “ **null** ”. Undefined represents something that may not exist. Null is used for things that are nullable. So both are entirely different.

#### [@Optional]

So what is this **@Optional** in angular is all about? What is the difference between “?” and @Optional? As the official document says, Optional is a constructor parameter decorator that marks a dependency as optional. This clearly states that @Optional is used in the context of **DI** (Dependency Injection). Here is an example from the [official docs](https://angular.io/api/core/Optional).

```
@Injectable()
class Car {
  constructor(@Optional() public engine: Engine) {}
}
```

When @Optional is used, no exceptions occur even when the injected dependency is undefined. It treats the dependency as optional. Same thing happens if we replace **@Optional** annotation with “ **?”**. The injector will search for the dependency and when it is undefined, it will throw the exception. 

It is always nice to follow the best practices and learn something new :)
problem solving
Tags: programming, problemsolving, javascript, discuss
Published: 2018-10-22 10:53:39

---
title: problem solving
published: true
description: 
tags: programming, problem solving, JavaScript, discussion
---

Hi, everybody talking about problem solving I’m a beginner and I have no idea what people talking about! Can you tell me an example what is problem solving in front-end development and how we can solve problems?
Making a CSS blob
Tags: css, animations, keyframes, showdev
Published: 2018-10-22 10:42:10

Some days ago i was trying to make an animated blob using just the CSS as a personal experiment and research. The big issue with the blob was the curvy-shape that was should randomly morph with a slow animation.

The only way i found to make this kind of transformation is using the multi-step `border-radius` values that allow you have more controls over the edge of the element.

![](https://thepracticaldev.s3.amazonaws.com/i/mp0vkurap1lmwxi690zy.png)
Image from [Medium](https://medium.com/9elements/css-border-radius-can-do-that-d46df1d013ae)


First I needed to read more informations about the multi step border-radius, and [this](https://css-tricks.com/almanac/properties/b/border-radius/) css-tricks article was perfect. So i started writing code to prepare all the things but i noticed immediately that handling the multi values border radius was not so easy as I expected. After a bit of googling I came on [this article](https://medium.com/9elements/css-border-radius-can-do-that-d46df1d013ae) and their awesome tool. This helped me to learn more about this approach and generating the values of the `border-radius` property.

By adding a bit of movement and colours I got what i wanted. Here you can check the final result.


{% codepen https://codepen.io/equinusocio/pen/jezBdZ %}



> # Follow me to get more about CSS tricks!
> ### https://equinsuocha.io
My 2 Cents On Go
Tags: go, webdev, devops
Published: 2018-10-22 10:29:56

Following my post, I decided to take on an action and learn Go.

{% link idoshamun/should-i-learn-go-31d4 %}

As everyone told me it was an easy task and since then I have already deployed two Go services to production on Kubernetes.

Here are my thoughts, bare with me and let me know what you think:

# Pros

* Very easy to learn
* Lightweight (memory & footprint)
* High performance
* Implementation is pretty straightforward
* Typed language

# Cons

* Error handling can be messy
* Dep (dependency manager) is not as trivial as NPM
* `GOPATH`!? Why is everything has to be in the same directory?
* Imperative programming (just a personal opinion)

# Tips

* Use `alpine` or even `scratch` as a base docker image (my docker image is only **10MB**)
* Make sure to use circuit breakers and timeouts for every third party call (external services, database, etc...). My favorite is [afex/hystrix-go](https://github.com/afex/hystrix-go), I also tried [sony/gobreaker](https://github.com/sony/gobreaker) but it has some performance overhead.
* Use [uber-go/automaxprocs](https://github.com/uber-go/automaxprocs) for automatically setting `GOMAXPROCS` according to the resources quota of Kubernetes
* To mock functions declare them as variables
* I use the builtin `net/http` router, usually it is more than enough for a simple microservice


Currently I am having fun writing Go and feeling confident with the outcome. I will keep it going for a while and see how it goes 😜
Working less than 40h a week?
Tags: discuss, career
Published: 2018-10-22 10:09:13

---
title: Working less than 40h a week?
published: true
description: 
tags: #discuss #career
---

Do you work less than 40h a week as a regular employee (not a freelancer)?

Most of us are familiar with the craziness around hiring experienced developers. We can't fill empty spots on our own teams, and constantly receive a sea of spam on LinkedIn.

Some companies go out of their way to lure people. Fancy offices with kicker tables, free fruits, cereal, sweets, sometimes even a company car, and of course higher and higher salaries.

But what if I don't want more money, but more free time?

How realistic it is to ask for a shorter working day, let's say, 6h a day? Or maybe a shorter week, 8h a day, but Fridays off?

I don't have any children or sick relatives I need to take care of, I just want to enjoy life a bit more.

Does anyone here have such an arrangement on a regular employment contract? If yes, in which part of the World?
I'm upgrading a React frontend that's an year old. My current process is slow and painful. How could I speed it up?
Tags: help, javascript, react, webdev
Published: 2018-10-22 06:24:44

---
title: I'm upgrading a React frontend that's an year old. My current process is slow and painful. How could I speed it up?
published: true
description: I'm upgrading a React frontend that's an year old. My current process is slow and painful. How could I speed it up?
tags: help,javascript,react,webdev
---

I'm working on a React 15 project that compiles in Node 6, and am updating it to React 16/Node 10.

My current process: I use `npm outdated` to find old packages and update them to newer versions. I run `npm install` after that, and then load the frontend with webpack.

I've found that there are several packages that might be deeply interdependent, and updating one without making changes or updating other packages breaks the frontend with an error in 'linkClass.js'

I'd appreciate any help.
How to Install Fortran Compiler in Linux
Tags: howto, linux, opensource, fortrancompiler
Published: 2019-02-26 10:39:35

---
title: How to Install Fortran Compiler in Linux
published: true 
tags: HowTo,Linux,open source,fortran compiler
canonical_url: https://fossnaija.com/how-to-install-fortran-compiler-in-linux/
---

[![gnufortran image banner](https://i0.wp.com/fossnaija.com/wp-content/uploads/2018/10/gnufortran-image-banner.png?resize=665%2C574&ssl=1)](https://i0.wp.com/fossnaija.com/wp-content/uploads/2018/10/gnufortran-image-banner.png?ssl=1)

 

In this post I will show you how you can set up a Fortran development environment in some easy steps in ubuntu [Linux](https://fossnaija.com/linux-installation-dual-booting-with-windows-7/).

## 

## GFORTRAN

 

[![gfortran man page](https://i2.wp.com/fossnaija.com/wp-content/uploads/2018/10/gfortran-man-page.png?resize=665%2C399&ssl=1)](https://i2.wp.com/fossnaija.com/wp-content/uploads/2018/10/gfortran-man-page.png?ssl=1)

 

Though there are many different Fortran compilers available for Linux systems; I will be installing gfortran (or GNUFortran), the Fortran compiler from [**GNU**](https://www.gnu.org/software//gcc/fortran/),( the custodian of many prominent and important free software). The reason for the choice is no other than its ease of installation and strong support from a prominent organization (GNU) in the Free and Open-Source software community.

Open your [terminal](https://fossnaija.com/the-anatomy-of-the-linux-command-line/)on your Linux machine (shortcut for ubuntu systems => **CTRL + Alt + T** ) and type the following command to first of all update your system software repositories:

 

```
sudo apt-get update
```

 

Then install gfortran:

 

```
sudo apt-get install gfortran
```

 

 

ALL DONE!!!

 

**Happy Linux’NG!**

The post [How to Install Fortran Compiler in Linux](https://fossnaija.com/how-to-install-fortran-compiler-in-linux/) appeared first on [Foss Naija](https://fossnaija.com).
Running Systemd commands on remote host from your local host
Tags: linux, devops, blog
Published: 2018-11-09 04:01:37

---
title: Running Systemd commands on remote host from your local host
published: true
tags: linux, devops, blog
canonical_url: https://mayeu.me/blog/running-systemd-command-on-remote-host-from-local-host/
---

While I was reading the [pretty awesome Archlinux wiki](https://wiki.archlinux.org/index.php/systemd) for something completely different, I found out that one can launch any `systemctl`command to a remote host via the `--host` (or `-H`) flag.

So let say you want to check the `cron` process on a server named kitten:

```
$ systemctl -H root@kitten status cron
● cron.service - Regular background program processing daemon
   Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-07-28 11:36:37 CST; 2 months 25 days ago
     Docs: man:cron(8)
 Main PID: 1045
    Tasks: 1 (limit: 4643)
   CGroup: /system.slice/cron.service
           └─1045 /usr/sbin/cron -f

```

Nice right? Under the hood this use SSH so you must have access to the host. And you can, of course, use any `systemctl` command, not just `status` ;)

Have fun :wave:


*This post was originally published on [mayeu.me](https://mayeu.me/blog/running-systemd-command-on-remote-host-from-local-host/).*
Lancer une commande systemd sur un serveur distant depuis la machine locale
Tags: blog, linux, french
Published: 2018-11-09 04:05:49

---
title: Lancer une commande systemd sur un serveur distant depuis la machine locale
published: true
tags: blog, linux, french
canonical_url: https://mayeu.me/blog/lancer-une-commande-systemd-sur-un-serveur-distant/
---

Alors que j’étais en train de lire [l’excellent wiki d’Archlinux](https://wiki.archlinux.org/index.php/systemd) pour quelque chose de complètement différent, j’ai découvert qu’il était possible d’utiliser l’option `--host` (ou `-H`) pour lancer une commande de`systemctl` directement sur un serveur distant.

Par exemple, disons que vous vouliez vérifier la santé du processus `cron` sur un serveur nommé `chaton`:

```
$ systemctl -H root@chaton status cron
● cron.service - Regular background program processing daemon
   Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-07-28 11:36:37 CST; 2 months 25 days ago
     Docs: man:cron(8)
 Main PID: 1045
    Tasks: 1 (limit: 4643)
   CGroup: /system.slice/cron.service
           └─1045 /usr/sbin/cron -f

```

Pratique non ? Les commandes sont exécutées par SSH, il est donc nécessaire d’avoir l’accès au serveur préalablement. Et ça n’est pas limité à `status` n’importe quelle commande de `systemctl` va pouvoir être lancée comme cela ;)

Have fun :wave:

*Cet article a été initialement publié sur [mayeu.me](https://mayeu.me/blog/lancer-une-commande-systemd-sur-un-serveur-distant/).*
#discuss What to do about feedback you don't think is accurate
Tags: career, interviewing, feedback
Published: 2018-10-22 04:23:09

---
title: #discuss What to do about feedback you don't think is accurate
published: true
description: Discussion about this question in career, life and interviews
tags: careers, interviewing, feedback
---

It’s performance review time of year for many businesses in New Zealand and abroad, and often that means people getting feedback. 

Given my experiences lately, I’ve thought of a question to ask in interviews. It would go something like this:

“Can you me about a time you received some feedback you didn’t think was accurate, and what did you do about it?”

I'd love for y'all to comment what you think some good or bad answers would be (make it clear which one you’re going for, haha), and whether you think this is a good question for an interview?