teleren/devto huggingface dataset:
How to make decisions in the face of uncertainty
Tags: todayilearned, career, programming
Published: 2020-04-03 05:21:28

*TL;DR notes from articles I read today.*

### [Three types of risk: making decisions in the face of uncertainty](https://bit.ly/2UTfGrs)

- Fatal risks can kill a company, so you need to be extra careful to watch for them as your company grows and ages. It is easy to get complacent but there is no recovery from such decisions gone wrong. 
- Painful risks have lower but significant repercussions: missing a key goal or losing key people. But you can recover from them. 
- Embarrassment risks have no significant impact beyond just what the name states. You just need to acknowledge the mistake, change course and move on.
- Another way to think about risk is Jeff Bezos categorization of decision making into Type 1 (irreversible, so spend time on them) and Type 2 (reversible, as with painful and embarrassing risks, so make the decision quickly and move on).

*[Full post here](https://bit.ly/2UTfGrs), 4 mins read*

---

### [Four magic numbers for measuring software delivery](https://bit.ly/2w7cgZL)

- **Lead time** to validate, design, implement and ship a new valuable thing. Consider two types of lead time: (a) feature lead time: the time to move an item from high-level requirements to feature release and (b) deployment lead time: the time from merging to master to the component being in production. 
- **Deployment frequency**, understood as number of times per developer per day you ship to production. Your deployment frequency may ebb and flow, from 5-10 on a busy day to none the rest of the week. Establish a baseline over 4 weeks: say, 1 production deployment per day on average.
- **Change failure percentage**, ie, the proportion of red deployments, bugs, alerts, etc. Defining change failure rate as bugs per production deployment over a given period, aim for about 10% or less with medium or high-priority of customer impact. 
- **Mean time to recovery/resolution**. For mean time to resolution, aim for less than a working week.  
- Considering feature lead time as a key performance indicator can help you break features up and deliver faster. This might also decrease lead time per deployment.
- Convert generic support tickets into bugs with customer impact implications so they can be tracked better. Make bugs more visible can also make bottlenecks in the resolution process more apparent.
- Count red production deployments and production alerts as a change failure.  

*[Full post here](https://bit.ly/2w7cgZL), 9 mins read*

---

*[Get these notes directly in your inbox every weekday by signing up for my newsletter, in.snippets().](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
The Ultimate Git Tutorial Part 2: Committing and Pushing
Tags: git, productivity, beginners, github
Published: 2020-04-03 04:52:20

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

I'm releasing a full series covering the use of Git from the very beginning! This series will cover everything from cloning, pulling, branching, merging, and so much more. Here's the second video in the series - stay tuned for more to come very soon!

{% youtube nquxBcx929o %}

Happy coding!
Want to become an open source contributor?
Tags: opensource, contributorswanted, javascript, webdev
Published: 2020-04-03 04:29:50

Hey everyone! For anyone interested in joining a project, I am leading an open source project called Ano.js, which is a web animation library that can be integrated into websites with just two lines of code! The goal is to allow users to have web animations without coding at all. Even tools like Mo.js and Anime.js (which are amazing) require coding. 

Open source contributors create their own web animations and upload them to the Ano.js database, where it will be displayed on our website. It will be labelled that you created the animation, and you will receive credit for it. You can add this as an experience to your LinkedIn, a project to your portfolio, or add it to your resume! Everything you do as a contributor is on your own time. No deadlines, no requirements, no prior knowledge required. 

I am looking for more open source contributors to join us, so if you're interested, please visit https://anojs.com/join-us and enter your email and GitHub username, and you will automatically be invited to our Slack workspace and added as a collaborator to our GitHub repository. 

Please DM me if you have any questions!
Could InsureTech look at Crypto Currency as a premium payment alternative?
Published: 2020-04-03 04:27:22

Link: https://blog.joshsoftware.com/2018/11/22/could-insuretech-look-at-crypto-currency-as-a-premium-payment-alternative/

The blockchain truly has shaped up into one of the biggest technological disruptions of the decade. A digitized, distributed and secure ledger that guarantees immutable, transparent transactions, it gives both parties involved a proper breakdown for each transaction, thus ensuring credibility throughout the entire process. The most popular implementation of the blockchain are cryptocurrencies, the most well-known of these cryptocurrencies being the Bitcoin. A few problems relating to cryptocurrencies have been brought to light recently, like slow performance and processing of the public blockchain, excessive price volatility, energy consumption while mining and scams involving fraudulent ICOs (Initial Coin Offering). However, I think that all these problems can be solved with time. With increasing awareness, the cryptocurrency regulations will fall into place and as the security around blackchains becomes robust, these issues should subside.
Started a Youtube channel to discuss about Kotlin and Android 
Tags: kotlin, android
Published: 2020-04-03 04:20:49

Hello all. How are you all doing? I hope every one of you is safe from the Coronavirus spread. Stay home, Stay safe. Even though it's a very difficult time for each one of us, I feel like I'm getting a little more time to spend on things that I always wanted to do. So, I have started a Youtube channel, "Duct tape developer" to discuss Kotlin and Android in general. I'm creating a Kotling tutorial for the beginner's course. I have already uploaded a few of them as well. Sharing the playlist here. If you feel like you want to spend some time learning new things, visit and watch these videos as well and if possible give me feedback.
:)
Let's make sure we are making most out of this quarantine time. Let's learn more and share our knowledge with the world. Thank you.

https://www.youtube.com/channel/UC6j-4K0IZbJvmwBB1J7B5-A/featured?view_as=subscriber
April 3, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-04-03 04:00:04

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![It’s time to get your learn on](https://media.giphy.com/media/a7NBvg3Ss8UYo/giphy.gif)

</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/jess/what-was-your-win-this-week-22af %}

<center>

![Someone feeling like "Yaaas!"](https://media.giphy.com/media/zBhZiVNNQjfTG/giphy.gif)

</center>

Photo by [Rainier Ridao](https://unsplash.com/@rainierridao?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/learn?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
My Story
Tags: beginners, webdev
Published: 2020-04-03 02:13:18

When I joined the Navy in 1999, I knew computers were the way of the future. I decided to take a job that would work with computers and the Recruiters sold me on the Advanced Electronic Computer Field.  Sounded amazing, and in fact it was amazing. I worked with missile systems shooting missiles! But it wasn't what I had originally wanted when I signed up.
***
Twenty years later, I still know computers are the way of the future. I still want a do get a job that will work with computers. I thought cyber security was interesting, and one of my co-workers was planning to do that when he got out of the Navy. So I dabbled in that and got my Security+ cert. But the more I learned the less I wanted to do that full time. I also got my Project Management Professional and Professional Scrum Master I certifications thinking that I could backdoor my way in by being an IT PM or SM. The more I learned, the less I wanted to do anything strictly PM. 
***
I started looking at coding, and web development. I enjoyed making something from nothing. Designing, building, and writing something of my own and having a finished product. Being as creative as I could be, and finding a solution to something I didn't know. I was hooked. 
***
I searched Google for everything I could learn in coding. I wanted to start with Python, but couldn't wrap my mind around it since I was new to everything. It gave me more information than I could ever process, telling to start here, and there, and over here. I signed up for some Udemy courses, but found it difficult to learn from the instructors that I got (not sure why since I had done Mike Myers' Sec+ course on Udemy). So I began to look for coding bootcamps. I came across Vets Who Code who gave you pre-work and a two-week deadline to read, comprehend, and make an "About Me" website. I learned so much and enjoyed every second as I stayed up to the wee hours in the morning trying to figure out how to make a text box stay where I wanted it to stay. I was hooked before, and now I was caught.  
*** 
I was ecstatic when I found out that I had made the Vets Who Code cohort, and started consuming information so that I could have a great start.  Almost five weeks into the cohort, and I am learning by leaps and bounds. I can do far more, and understand far more than I ever thought at this point. Just yesterday, I  decided to do some reading on Python for a break from the computer screen. To my amazement, as it explained Python, I could see and understand what they were talking about, even in the different syntax, just from what I have learned in Javascript. My mind is blown and I look forward to the rest of this cohort, and lifelong learning in coding and programming.
***
## TO BE CONTINUED...
Técnicas de aprendizado
Published: 2020-04-03 02:07:19

- Aprendizado é um processo, não dá para ser expert em uma semana
- Seja melhor do que ontem
- Não compare os seus bastidores com o palco de alguém
- Estude todo dia um pouquinho
- Tenha um cronograma de estudos
- Avançe um pouco mais cada vez que estudar
- O segredo está em se manter correndo e não chegar mais rápido no final
- Quem se manter correndo todo dia um pouquinho, e não desistir, é quem vai ganhar no final
How do you manage writing technical articles ?
Tags: discuss, question, writing
Published: 2020-04-03 01:59:01

As I find myself scheduling more technical blog posts and practicing maintaining a regular writing habit I sometimes get lost in the details.

I believe that what works for me is writing articles that are a 10 minute read or less. When it comes to more technical stuff, the required time to complete the article, ensuring high quality content, increases.

This is sometimes a deterrent for me and I end up taking many days thus breaking the habit and not respecting the schedule.

Do you ever find yourself in a similar situation ?
Do you end up splitting your post in multiple parts to better manage your time and effort ?
What practice do you recommend ?
NGRX Workshop Notes - Other links
Tags: angular, javascript, webdev, ngrx
Published: 2020-04-03 01:45:41



* [Avoiding swithcMap related bugs](https://ncjamieson.com/avoiding-switchmap-related-bugs/)

* [ngrx example application] (https://github.com/ngrx/platform/blob/master/projects/example-app/README.md)

* [Redux toolkit](https://redux-toolkit.js.org/)

* [ngrx docs](https://ngrx.io/docs)

{% github ngrx/platform%}

{% medium https://medium.com/angular-in-depth/ngrx-how-and-where-to-handle-loading-and-error-states-of-ajax-calls-6613a14f902d %}

{% youtube hsr4ArAsOL4 %}

{% youtube OZam9fNNwSE %}
Customizing a new Linux system
Tags: bash, ubuntu, bootstrap
Published: 2020-04-03 01:38:24

Bootstrap an Ubuntu/Debian based system effortlessly using [linux-bootstrap](https://github.com/drmikecrowe/linux-bootstrap)

{% github drmikecrowe/linux-bootstrap %}

## Why?

When you first login to a new linux box, you have many default packages you typically install:

- Your [dotfiles](https://github.com/drmikecrowe/dotphiles)
- Standard utilities like `git`, midnight commander, `jq`, `direnv`, etc

I've experimented with multiple ways to do this (and there are many). This seems to be the easiest way to maintain and expand as your preferences change.

## Running

Download the main script and make it executable:

```
wget -q https://raw.githubusercontent.com/drmikecrowe/linux-bootstrap/master/target/bootstrap-1.0.0.sh
chmod +x bootstrap-1.0.0.sh
./bootstrap-1.0.0.sh all
```

You can see all the options as follows:

```
./bootstrap-1.0.0.sh
```

You can also install a single item like this:

```
./bootstrap-1.0.0.sh goenv
```

## Demonstration

[See a demo](https://mcpubbucket.s3.amazonaws.com/Peek+2020-04-02+20-32.gif)

## Key concepts

This script uses [Bashing](https://github.com/xsc/bashing) to create the executable.

The key things I like to install are:

- [My dotfiles](https://github.com/drmikecrowe/dotphiles.git)
- [Bash-it](https://github.com/Bash-it/bash-it.git)
- Node via nodenv
- Go via goenv
- Python via pyenv
- [xonsh](https://xon.sh)
- docker
- AWS cli
- etckeeper
- Increase fs.inotify.max_user_watches by increasing to 524288
- Remove password prompt when executing `sudo`

If it's a GUI based system:

- Install my favorite GUI packages like `glogg` `meld` `synaptic` `kupfer` `remmina`
- Visual Studio Code
- Opera
- Spotify
- TerraForm
- Peek gif recorder
- google-chrome
- [copyq](https://hluk.github.io/CopyQ/)
- wavebox
- etc.

## Adapting to your needs

The genius of this system is how easy it is to add new items:

- Fork the repo (natually)
- Run the `./stub.sh abc` to add `abc` as `src/tasks/abc.sh`
- Edit `src/tasks/abc.sh`:
  - Add a test to determine if `abc` is already installed
  - Add the code to install it
- Build using `./build.sh` and push to your repo

## Innards

- Each task you answer (Y)es to writes the install steps from each install function (such as `install_dotfiles`) to `~/_todo.sh`
- Run all the commands in `~/_todo.sh`
Jewels 💎 and Stones ⛰
Tags: career, beginners, programing, interview
Published: 2020-04-03 01:28:48

Here is a rocking problem that shows how to deal with arrays. 

You're given strings J representing the types of stones that are jewels, and S representing the stones you have.  Each character in S is a type of stone you have.  You want to know how many of the stones you have are also jewels.

The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so "a" is considered a different type of stone from "A".

###Example 1:

Input: J = "aA", S = "aAAbbbb"
Output: 3

###Example 2:

Input: J = "z", S = "ZZ"
Output: 0

##Brute Force 👊
Looking at a brute force method I would use a double for loop which would increase my BigO notation to the length of S multiplied by length J. Here I would have to iterate through the stones multiple times for each jewel I am referencing.

{% gist https://gist.github.com/austinmsuarez/c266d07d3b34e8a624f15263ad6e0d00 %}

##An Optimal Solution
Looking at this problem what comes to mind is using some sort of hashmap or set. Today I'm going to be switching it up and using C++. In C++ there is a structure you can take advantage of known as an unordered_set. This will let us store unique values in a container based on a key 🔑. Looking at this problem here I can make the jewels my unordered set and search them quickly. This will also allow me to decrease my time complexity to the length of S plus by length J.

{% gist https://gist.github.com/austinmsuarez/025866e591faa0838bcca761d64527f0 %}

There are a couple of other ways to solve this problem so put your solution down below! Thanks for reading, like and follow for more! 🙃
Stacks and Queues
Tags: datastructures
Published: 2020-04-03 01:14:11

Stacks and queues are linear data structures that both contain objects and access them in a particular order. These structures use different principles to insert and remove their objects.

Stacks use the first-in-last-out(FILO)/last-in-first-out(LIFO) principle: The first object or item in a stack is the last object or item to leave the stack and the last item in a stack is the first to leave a stack.    

Queues use first-in-first-out(FIFO)/last-in-last-out(LILO) principle: The first item in a stack is the first object or item to leave the stack, and the last item in a stack is the last to leave a stack. 

Let's compare these two data structures in further detail.

##Stacks
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1jd3qpsdbmxhou8ltcmp.png)

Elements can be inserted and deleted only from one side of the stack. A good way to look at stacks is to imagine it like a stack of books, where you can only remove from the top. When you add books, you're adding it to the top of the stack. When you insert an element into the stack, it's called **push** operation, and deletion of an element from a stack is called **pop** operation, both of which abide by the last-in-first-out principle(LIFO). We only need one pointer, which keeps track of the last element present in the list, called **top**.

###Applications

-Reverse a word. You push a given word to stack - letter by letter - and then pop letters from the stack.
-"Undo" mechanism in text editors; this operation is accomplished by keeping all text changes in a stack
-Backtracking. This is a process when you need to access the most recent data element in a series of elements.
-Language Processing. Using a stack, space for parameters and local variables is created internally, compiler's syntax check for matching braces is implemented, and support for recursion is available. 

##Queues
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/paepim2e2iuiviayh6tp.png)

Queues work with both sides of the list. Elements can be inserted into one side, called **rear**, and on the the other side elements can be deleted from it called **front**. The methods for insertion and deletion are called **enqueue** and **dequeue**, respectively. Queues will always maintain two pointers, one pointing to the element which was inserted at the first position and still present in the list with the **front** pointer and the second position pointing to the element inserted at the last with the **rear** pointer. 

###Applications

-In operating systems, for controlling access to shared system resources such as printers, files, communication lines, disks and tapes
-When placed on hold for telephone operators.
-Handling of interrupts in real-time systems. The interrupts are handled in the same order as they arrive i.e First come first served.
NGRX Workshop Notes - Meta-Reducers
Tags: angular, javascript, webdev, ngrx
Published: 2020-04-03 01:12:22


* Intercept actions before they are reduced
* Intercept state before it  is emitted
* Can change the control flow of the Store

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4ji9re4d6scq342tnql4.gif)

## Most common use cases

* Reset state when a signout action occurs
* for debugging creating logger
* to rehydrate when the application starts up

-It is like a plugin system for the store, they behave similarly to the **interceptors**

## Example 
An example of this can be to use it in a logger

```typescript
const logger = (reducer: ActionReducer<any, any>) => (state: any, action: Action) => {
    console.log('Previous State', state);
    console.log('Action', action);

    const nextState = reducer(state, action);

    console.log('Next State', nextState);
    return nextState;
};

export const metaReducers: MetaReducer<State>[] = [logger];
```
Day 002 of #100DaysOfDesigning
Tags: 100daysofdesign, design, webdev
Published: 2020-04-03 01:10:36

On the second day of my #100DaysOfChallenege, I have designed another small website. I was very curious with those 'Drag and Drop file upload` containers in famous websites and I wanted to create something like that. Because of that reason, I have designed entire website to learn this feature.

At first I planned to create only one page website, but during the discovery phase, I changed my mind. As we can get basic information of files, I planned to add file preview feature to the website. At the end of design phase, now I have total 7 screens representing different states of the website.

**Here is today's design:**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gfw2q429566rk0kw46qm.png)

I have always found myself creating multipage website from small idea. I thank the god to give me so many ideas in my head. I was able to design the website in 1 day but I am not sure that I will be able to code this website in 1 day.. LOL 😂.

**Here is the Design on Figma:** https://www.figma.com/file/QCFhnbJ1oIfqaksabWucRQ/002-Drag-and-Drop-File-Upload?node-id=1%3A88

**Plan for Day 003:** Website to Explain CSS Border properties
How to use Web Components with Next.js and TypeScript
Tags: webcomponents, nextjs, typescript, usetheplatform
Published: 2020-04-03 01:07:42

In [my livestream today](https://dev.to/swyx/make-your-own-dev-to-cms-livestream-part-4-6em) I had the need to bring in a spinner component to show work in progress in my app. However found that existing React spinners were too heavy. That's when I had the idea to use web components in my Next.js (React/Preact) app for the first time ever!

We'll use https://github.com/craigjennings11/wc-spinners/ as a case study.

## Web Components 101

Normally to use a webcomponent in a project you just import it like a library:

```js
  import 'wc-spinners/dist/atom-spinner.js';
```

and then use it in our JSX/HTML:

```html
<div> 
    <atom-spinner/> Loading
</div>
```

The web component will encapsulate behavior and styles without the weight of a framework, which is very nice for us.

However when it comes to Next.js and TypeScript, we run into some problems.

## TypeScript and Web Components

When you use TypeScript with JSX, it tries to check every element you use to guard against typos. This is a problem when you've just registered a component that of course doesn't exist in the normal DOM:

```
Property 'atom-spinner' does not exist on type 'JSX.IntrinsicElements'.ts(2339)
```

The solution I got from [this guy](https://wespeter.com/posts/consuming-web-component-react-typescript/) is to use [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) to extend TypeScript:

```ts
// declarations.d.ts - place it anywhere, this is an ambient module
declare namespace JSX {
  interface IntrinsicElements {
    "atom-spinner": any;
  }
}
```

## Next.js and Web Components

The next issue you run into is server side rendering.

```
ReferenceError: HTMLElement is not defined
```

WC's famously don't have a great SSR story. If you need to SSR WC's, it seems the common recommendation is to use a framework like Stencil.js. I have no experience with that.

Since in my usecase I only needed the WC clientside, I found that I could simply defer loading the WC:

```js
function Component() {
  React.useEffect(() => import("wc-spinners/dist/atom-spinner.js")
  , [])
  return (<div>
        // etc
        <atom-spinner />
        </div>)
}
```

And that's that! Enjoy using the platform!