teleren/devto huggingface dataset:
Simply explained : predict_proba() 
Tags: machinelearning, sklearn, datascience, prediction
Published: 2020-06-13 08:27:49

I have been following a course on udemy on Machine Learning. Here is a quick explanation of how `predict_proba()` works and how it can be useful to us.

`predict_proba()` basically returns probabilities of a classification label 

## How does it work?

Official Documentation: The predicted class probabilities of an input sample are computed as the mean predicted class probabilities of the trees in the forest. The class probability of a single tree is the fraction of samples of the same class in a leaf.

Let's try and understand this with an example.
Our first 5 records of X_test are:

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

using `predict_proba()` on the same data...

    clf.predict_proba(X_test[:5])

O/P 1:

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

On the same data `predict()` gives:

    clf.predict(X_test[:5])

O/P 2:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h20uodh53mujmezhdlzo.png)

Observations from two outputs:
 1. In o/p 1 the sum of values in each row is 1 (0.89 + 0.11 = 1)
 2. In o/p2, when the prediction is of 0, the corresponding column in op/1 has 
    higher value/probability. 
 3. Observe that in 1st row value is higher when prediction is of 0 and vice 
    versa.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b8ij2bf453bclln46ebf.png)

Conclusion:
Predict_proba() analyses the values of a row in our dataset and gives the probability of a result. So this can help us understand what factors determine the higher or lower probability of the result.
TwilioQuest 3, the RPG for Developers and New Programmers
Tags: twilio, twilioquest
Published: 2020-04-20 16:51:24

More and more of our lives are lived inside the virtual worlds of computers. This universe, which we refer to as The Cloud, expands every second of every day. The ability to write code - the laws of these virtual worlds - has become a precious resource.

There are those who would use the power of code to steal, deceive, and oppress. We know these evil forces as the Legacy Systems. From the shadows, they conspire to dominate the free people of The Cloud. Their wealth and privilege have carried them to the edge of victory, but one thing stands in their way - the Operators.

From every race, religion, gender, and background, Operators in the TwilioQuest program are known across The Cloud as champions of justice. They are sworn to uphold the Operator's Code - that their technical skills will be used only to unlock hope, power, and freedom for all humanity. But today, their numbers are few.

We turn to you for help. Take up the tools of software development. Become an Operator. Save The Cloud.

![fog owl](https://twilio-cms-prod.s3.amazonaws.com/images/dialogue-crop.width-800.png)

## About the Game

Chapter 1 of TwilioQuest challenges players to take their first steps as an Operator in the TwilioQuest program. The player is placed in command of the Fog Owl, a prototype Cloud Exploration Vessel designed to allow users to travel deeper into The Cloud than ever before. Players will be supported by Cedric, an advanced virtual intelligence designed to act as your advisor and executive officer. However, the Fog Owl is not yet fully operational. While technicians finish their work on the ship, the player can undertake training missions to prepare for their inevitable confrontation with the Legacy Systems.

Using the integrated code editor or your own programming tools, you will hack locked barriers and treasure chests by completing programming challenges. Your efforts will be rewarded with rad loot and experience points to track your progress as a developer. Today, most of the challenges you'll encounter are related to Twilio products and APIs. In the future, the overwhelming majority of content in TwilioQuest will be general-purpose technical training content aimed at teaching a new generation of Operators (at any experience level) to join the struggle against the Legacy Systems. 

Download the game (www.twilio.com/quest/download) and see how far your skills will take you today!

![Mission Computer](https://twilio-cms-prod.s3.amazonaws.com/images/mission-computer-crop.width-800.png)
Recent thoughts on coding and inspiration
Tags: community, inspiration, learning, attitude
Published: 2020-04-20 18:20:49

---
title: Recent thoughts on coding and inspiration
published: true
description:
tags: community,inspiration,learning,attitude
---

Some days I feel like there is not enough time to build things or learning the coding skills I want. Or I worry about choosing the wrong option so I keep researching but never commit to making a choice. 

So I am trying to take things easier. And to chip away at learning a new tool or language regularly and I look back a few weeks or months later and it's hard to imagine life without that thing.

I read this article about space missions and likening them to coding. They said they learnt more from one failed launch than 10 successful ones. If you're not making mistakes, you're not learning!

It's lonely sometimes coding. But if you find the right dev community whether online or at a local venue or meetup group, you'll get inspired rather than despondent when you find out you are wrong about something or that there is so much out there to learn. 

I found a vibrant community of Jekyll forums and Tweepy Discord group where I can teach and learn with newbies and veterans in the community.
Managing permission to edit user profiles & The downsides of not separating frontend from backend
Tags: react
Published: 2020-04-20 19:45:53

Hi there,

I am using React to build a website and have the following questions:

1. How can I only allow the owner of a profile to edit it and make it read-only for other users (e.g. LinkedIn profile)?

2. What are the downsides of directly calling firebase's methods in my frontend to (1) store data into my firebase database and (2) retrieve and display data from the database without using a backend?

Thank you so much for bearing with the beginner questions.
Windows10 WSL ssh Permission denied public key on new session
Tags: windows10, wsl, linux
Published: 2020-04-21 17:34:43

---
title: Windows10 WSL ssh Permission denied public key on new session
published: true
date: 2019-07-22 00:00:00 UTC
tags: Windows10,WSL,Linux
canonical_url: https://www.jskap.com/blog/Windows10-wsl-ssh-permission-denied-new-session/
---

  

![](https://friendly-heyrovsky-86d9f9.netlify.app/opengraph?&author=kapilgorve&title=Windows10%20WSL%20ssh%20Permission%20denied%20public%20key%20on%20new%20session&tags=Windows10,WSL,Linux)

  

Problem - When trying to connect using ssh, the existing key isn't recognized by the WSL shell. I had to manually add key each time `ssh-add ~/.ssh/id_work_digitalocean` on every session.

TLDR-Add your hostname and key to ~/.ssh/config

```
Host 49.35.99.253
IdentityFile ~/.ssh/id_work_digitalocean
AddKeysToAgent yes
```

I have been using WSL from long time. Most of it for experiment purposes only.

There is always something in whole tech stack of the project that it won't work on WSL. Thats why I use Windows for frontend only projects and an Ubunutu installed on other drive for backend projects.

For work we use DigitalOcean droplets to deploy projects for client demos. I didn't give much thought to SSH until recently. We are deploying multiple single page business websites for the client. That means I had to connect to droplets using ssh keys. Using passwords became hectic. So I switched to ssh keys.

There was one tiny issue though. It quickly became annoying.

When trying to connect using ssh, the existing key isn't recognized by the WSL shell. I had to manually add key each time `ssh-add ~/.ssh/id_work_digitalocean` on every session.

Solution - Add your key in the ssh config .

- 

Create a config file first.

```
$ touch ~/.ssh/config
```

There are chances that this file does not exist. In that case create it. If this file exists skip this step.

- 

Open `config` file using vim.

```
$ vim ~/.ssh/config
```

- 

Enter `i` to go into insert mode so you can edit it. Add your hostname and private key location.

```
Host 49.35.99.253
IdentityFile ~/.ssh/id_work_digitalocean
AddKeysToAgent yes
```

- Enter `ESC` key to get out of insert mode and press `:wq` to save your changes.

Now reopen your bash and connect using ssh to your host. You won't need to add ssh key this time.

Happy SSHING on Windows !!!

Fun Fact - `ssh` support landed in `Powershell` in 2018. You no longer need to use bash to use ssh. I discovered this while trying the newly launched `Windows Terminal`.

  

This post was originally published at https://www.jskap.com/blog/Windows10-wsl-ssh-permission-denied-new-session/

  

👋 Hi! I’m Kapil. I am always chatty about building things, sharing my learnings, freelancing. Come say hi to me at [https://twitter.com/kapilgorve](https://twitter.com/kapilgorve)
Using type Annotations in Typescript Functions.
Tags: javascript, typescript, codenewbie
Published: 2020-03-23 00:00:00



I am starting to move to Typescript. I discover how works type annotations in typescript functions.

Let start to show a few things learned today about typescript.

Typescript allows type annotation in function parameters and returns types.

## Types in Function parameters.

The default type for the parameters in functions is any. Use : type after the declaration to set the type.

```javascript
function Authentication(user:string, age:Number) {
}

```

## Types in functions the return type

The return type in functions allows set primitive, build-in types or custom types as a return type.

Use the **void** type for functions without a return value.

```javascript
function isValid(user:string, age:Number) : boolean {
 return true;
}

function removeCookies(user:string, age:Number) : void {

}

```

Another nice Typescript features are the optional and default parameters.

## Optional parameter

The optional parameters can be set as optional adding a ? to the end of parameter declaration.

```javascript
function authentication(user:string, age?:Number, save) : boolean {
return true;
}
authentication("dany") //no compiler error.

```

## The default parameters value

If the parameter is not passed it set a default value

```js
function authentication(user:string, age:Number = 32, save) : boolean {
  return age > 30
}

```

## That's it!

This was a small recap about how to use annotation types with typescript in functions If you enjoyed please share.

Photo by <a href="https://unsplash.com/@maxdelsid?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Max Delsid</a> on <a href="https://unsplash.com/s/photos/cooking?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
How can I reserve/protect/disable certain keywords in applications?
Tags: startup, discuss, security
Published: 2020-04-21 01:18:56

Hello there,

Firstly; thanks for showing up here.

I am developing a web application. So I would like to learn/hear from you on how I can protect, reserve, restrict and/or disable some keywords from being used by users as their username of choice. 

i.e When a user choose to use _Administrator_ as his/her username. They should get an error saying, the username is not available only because I have added the word `Administrator` as a reserved word on the server.

Now the last part of my question is; What happens in a case I forgot to reserve a word and a user was able to choose it as their username of choice. What is the next thing to do in this case?

Thanks in anticipation of your responses.
What are you monitoring
Tags: kubernetes, k8s, devops, sre
Published: 2020-04-21 15:58:33

---
title: What are you monitoring
published: true
description: In this article, you will understand the importance of monitoring and how you can take advantage of silence monitoring feature of grafana
tags: kubernetes, k8s, DevOps, SRE

cover_image: https://miro.medium.com/max/1400/1*-SCTnBJ6vt_6DcepKZ0StQ.png

---

___This post was initially posted on my medium blog @dapseen___

Working as a DevSecOps/SRE could be really fun, you know. The different kinds of errors tell you exactly where to go, yeah? It’s a 404 error — I’ll have to check my logs, check ELB (Elastic Load Balancer) status, I’ll…, bla bla… and yea, with that, i’d be able to determine if it’s a code error or a network error.

In more technical terms, it’s very common for DevSecOps/SRE to write promQL that monitors status 4XX, 5XX etc. However, what happens when you get none of these statuses?

What I mean is…

**WHAT DO YOU DO WHEN YOUR SERVICE IS NOT AVAILABLE?**

Don’t get me wrong guys, this is completely different from *your service not running*. What I mean exactly is — your service is running perfectly, but oops! it’s just not reachable.

![Service Architecture](https://miro.medium.com/max/1282/1*53yOk71Kufgl23T_6AcSHg.png)

To manage this kind of incident, checking logs for your regular 5XX or 4XX definitely wouldn’t work here. Why? Your service wouldn’t be logging any of these response statuses. Sadly.


Now let’s look on the brighter side. The question is, how can you monitor your service that is not reachable?


Simple!

###Monitor SILENCE

Service A on a regular day receives 5000 RPM (requests per minute) in peak hours. SILENCE comes into play when Service A is getting 0 (zero) RPM. Obviously, you know something is totally wrong.
Now to the main business…

Writing a well structured PROMQL to understand this and plugging Grafana to alert your slack channel is something i’d recommend.

![Grafana Alert](https://miro.medium.com/max/1400/1*yj60gD4-wqDH90NeAQcRuQ.png)

Setting if no data or all values are null to *ALERTING* will notify you when you don’t have any request hitting your service.

However, what i’m yet to figure out is — how can I prevent this from waking me up in the middle of the night when I get low traffic or zero traffic? That kind of *SILENCE* is valid, but peak hours *SILENCE* — **Definitely NOT valid**.
How to make unique Instagram fonts for your bio?
Tags: instagramfonts, instagram, fancyfonts
Published: 2020-04-21 15:36:36

If you want to make stand out yourself from a large number of accounts on Instagram, you need to have a unique Instagram bio. You don’t want to miss out on the opportunity to have that good impression on visitors at first glance.

How to Change The Instagram bio?

Instagram bio has a character limit of 150 words, you should be smart while choosing how to craft it. Writing a great bio using hashtags, smileys, symbols, etc., or a description of your interests and field of activity. To change or write your bio, go to your Instagram profile, click on “Edit Profile,” type in or edit the information in the relevant fields, and tap “Done” or “Submit.”

How to make your Instagram profile Unique?

Below some of the things that will help you to make your Instagram bio stand out:

Symbols :
To make your Instagram profile cool you can use special characters provided in Microsoft Word. You just need to go to “Insert,” then “Symbol” and choose whatever character you like. Then, copy and paste it on your Instagram bio.

Emojis :
We can see there is a large collection emojis on the internet. Select your most suitable emoji and copy-paste in your bio and you need to check whether its working or not.

Fancy Text :
We can use different fancy text to make your Instagram bios unique such as Inverted Squares Fonts, Luni Bubbles Fonts, Mirror Type fonts, etc..

You can also create a unique Instagram bio using a different fancy font or text generators. The site works by generating a set of different styles using a large range of varieties of Unicode characters. So technically you're not actually generating fonts, but instead, they are generating Instagram-compatible Unicodes. You can copy-paste these fancy text with symbols, emojis, and special charters into your bio. But here I will list you some good websites which help to create unique Instagram fonts.

https://www.fontgenerator.co/
https://www.swapcoder.com/

![Instagram Fonts](https://dev-to-uploads.s3.amazonaws.com/i/4gx7g0zqmmjc8hkvy801.png)

To generate Instagram font type or paste it in the field provided in these sites. These sites start to generate different fancy font, click to copy the best font of your choice and paste it in your Instagram bio.

It is difficult to make yourself stand out on Instagram with an ordinary bio, so to make your profile beyond ordinary try to have a more creative bio section. Also make sure that your bio is not too difficult to read, by using special character symbols.
Unions and Intersection Types en TypeScript
Tags: typescript, guia
Published: 2020-04-21 18:41:23

> Soy una nota nice

A veces debemos de admitir parámetros en una funcion donde el tipo de parametro puede ser por ejemplo **String** o **Number** : 

~~~
function padLef(value: string, padding: any) {
    if (typeof padding === "number") {
        return Array(padding + 1).join(" ") + value;
    }
    if (typeof padding === "string") {
        return  `${value} ${padding}`;
    }
    throw new Error(`Solo se admiten tipos de valores string o number, no se aceptan ${padding}`)
}

console.log(padLef("Hola mundo", 10));
~~~

El problema de declarar el parametro **padding** como **any** es que recibe cualquier tipo de valor ya sea **true* o hasta un **Array** y el compilador de Typescript lo aceptara sin problemas.

Para solucionar este problema utilizaremos las uniones de Typescript, donde solo se aceptaran los tipos que se declaren en el parámetro, no hay limite de uniones puedes utilizar 2 o mas uniones si es necesario:

~~~
function padLeft(value: string, padding: string | number) {
  // ...
}

let indentedString = padLeft("Hello world", true);
~~~
> El compilador de Typescript nos dirá que no se puede aceptar valores Booleanos porque en el parametro solo aceptan valores de tipo **string** o **number**

## Sindicatos discriminantes

Una técnica común para trabajar con uniones es tener un solo campo que use tipos literales que puede usar para permitir que TypeScript reduzca el posible tipo actual. Por ejemplo, vamos a crear una unión de tres tipos que tienen un solo campo compartido.

~~~
type NetworkLoadingState = {
    state: "loading";
  };
  
  type NetworkFailedState = {
    state: "failed";
    code: number;
  };
  
  type NetworkSuccessState = {
    state: "success";
    response: {
      title: string;
      duration: number;
      summary: string;
    };
  };
  
  // Crea un tipo que representa sólo uno de los tipos anteriores
  // pero aún no estás seguro de cuál es.
  type NetworkState =
    | NetworkLoadingState
    | NetworkFailedState
    | NetworkSuccessState;
~~~

Todos los tipos anteriores tienen un campo llamado **state**, y luego también tienen sus propios campos. Dado que el campo **state** es común en todos los tipos internos **NetworkState**, es seguro para su código acceder sin una verificación de existencia.
Software engineer vs Programmer, which one are you? 
Tags: software, development, programming, engineering
Published: 2020-04-21 19:35:17

Hi guys, today I want to share my opinions and thoughts with you about a kind of controversial topic: **"Software engineer vs Programmer, is there any difference? Is one better than the other?"**

It all started with a [tweet](https://twitter.com/manekinekko/status/1251802196783570944?s=20) I found in my timeline:

![Alt text of image](https://kdev-dev-to.s3.amazonaws.com/tweet.jpg)

This tweet reminded me of the time when I was studying a Software Engineering program, and I can remember clearly what one of my professors told us at the very beginning of the program: _"I want you to become Software Engineers, I want you to be able to deliver deliberate and sharp solutions, not just code algorithms and program subroutines"_.

At that time, I had never thought that there was a difference between being a software engineer and _"just a programmer"_ somehow that idea went so deep in my mind that even nowadays I sincerely think that being a Software (or Solutions) Engineer is the **natural evolution** of your career as a Software Developer or a Programmer. (No bias or discrimination intended of course)

I want to share some interesting and controversial replies to the original tweet:

![Alt text of image](https://kdev-dev-to.s3.amazonaws.com/op3.jpg)

![Alt text of image](https://kdev-dev-to.s3.amazonaws.com/op2.jpg)

![Alt text of image](https://kdev-dev-to.s3.amazonaws.com/op1.jpg)

![Alt text of image](https://kdev-dev-to.s3.amazonaws.com/op4.jpg)

With this last tweet though, I came to realize that it can be also a matter of culturalism, and it led me to immediately think:

*"What about people without a CS degree who have amazing skills? Are they not software engineers? Do they really care? Is it really important?"*

I consider that your school degree doesn't define nor constrain who you are professionally (or even personally), but your knowledge and skill set and, most importantly, the way you apply these two things altogether to craft and create effective solutions.

And, within this context, if becoming a Software Engineer is the **driver** to continue learning, developing your career and sharpening your abilities, **go for it** and use it as a way to challenge yourself.

What do you guys think?
Tracking link click from SMS, or any link!
Tags: webdev, tracking, tips
Published: 2020-04-21 19:13:33

How do you track a "link click" from an SMS? It's pretty simple 🤷🏻‍♂️

* Shorten your "actual link" ✂️ 
* Send that "shortened link" in SMS 📲
* User clicks on "shortened link" in SMS and opens it up in browser 🤏
* Boom, **that's a click** 🥳 (Increment your *clicks* stats)
* Now you can redirect them to "actual link" ♺

That's how all *link click tracking* works actually 🤷🏻‍♂️

Let's take a look at **Twitter** as an example:

When you click on any link shared inside a tweet, Twitter first redirects you to a url [https://t.co](https://t.co). That's how link clicks are calculated in Twitter analytics.

**bit.ly** works the same 😉

I hope someone finds it useful 🙌🏼
Using Pick<T,K> in TypeScript
Tags: typescript, angular
Published: 2020-04-22 00:34:26

---
title: Using Pick<T,K> in TypeScript
cover_image: https://www.gilcreque.blog/uploads/2020/67f6bb8830.png
published: true
date: 2020-04-21 20:54:00 UTC
tags: typescript, angular
canonical_url: https://www.gilcreque.blog/2020/04/21/using-picktk-in.html
---

I used `Pick<T,K>` for the first time today in TypeScript. I had been using `Partial<T>` for a while to allow some properties of a class/interface to be used in other places in my application. After doing a lot more reading on TypeScript lately I decided to find a way to grab specific properties from a class/interface and lo and behold that’s what `Pick<T,K>` is for. I was going to do a write up on how I am using it but I [found a post that sums it up quite nicely](https://medium.com/codafication-blog/typescript-2-1-and-the-power-of-pick-ff433f1e6fb).