teleren/devto huggingface dataset:
Why I don't design for free when 'friends' ask.
Tags: design, uiweekly
Published: 2020-11-09 06:12:15

This could have been a tweet but I would like to elaborate over this topic. Here is a fact:

#1 out of 12 people remain friends for a longer duration of time 

This is explanatory enough but it is not that simple I understand, we say, but they are friends. I'd say but they a going to earn profits out of it. It is as simple as that, some time down the line they are going to earn from what you did for free if they plan on any form of business. 

There are always some exceptions to it, like they are not going to get absolutely anything in return or they are doing if for a good cause. I have designed for friends, who now earn from it or not, but they do, I as a designer was just a cheap/free of charge resource in the name of a friend. 

When they say they do not have enough budget, ask for something in return, if they have the audacity to ask to get something for their benefit, in my opinion, you should too. 

##If a friend is starting out with a Bakery, ask for some cake at least if not money. 

Thank you.
What is a suitable Cryptocurrency for making investment in 2020?
Tags: whitebitcoin, cryptocurrency, wbtc, bitcoin
Published: 2020-11-09 05:19:00

Every year, more and more investors are attracted to an amazing trading tool known as cryptocurrency. There is a huge amount of growth seen from 2013 onwards. Now, people can choose from 5000+ varieties of cryptocurrencies to trade from. This popularity is because of a single major factor known as the Blockchain Technology. This advanced technology is a base of all the cryptocurrencies and offers high returns on the invested amount.
Before investing in any kind of cryptocurrency, several factors need to be considered like the purpose of investment, platforms, transparency, liquidity rate and the duration involved. ROI performance history should also be properly analyzed before investing in any of them. For persons who are just new to cryptocurrency, can buy it in fractions, which make it affordable to buy for any person.

According to the considerations mentioned above, two major cryptocurrencies can be looked upon for trading-

1. **Bitcoins**- When you talk about buying a cryptocurrency, the first thing that still comes to the mind is the Bitcoin because of the dominance in the market. It has high liquidity levels which hugely benefit the investors, thus imparting a lot of trust in the minds of investors. So, considering Bitcoin as an investment option is most feasible, although it is a bit expensive.

2. **White Bitcoins**- [White Bitcoins (WBTC)](https://www.whitebitcoin.io/) are lower in price as compared to Bitcoins, although it offers similar benefits. This latest and advanced variant of traditional Bitcoin is safe as well as promises prominent returns.
Bitcoins, whether traditional Bitcoin or White Bitcoin (WBTC), offer great opportunities for the investors. They are also considered as the safe options for traders and investors who are amateur in the field of cryptocurrencies.
Decision Trees Splitting. 
Tags: datascience, machinelearning, beginners
Published: 2020-11-09 04:56:59

**Decision Trees Splitting Algorithms**
  
When building decision tree models, we need to split data effectively at each node. There is a criterion parameter in the Sklearn library, which measures and chooses the best split by minimizing the splitting function.

Let's see what common splitting functions are used in Sklearn. So, for the classification trees, we can use Gini Impurity and Entropy Gain. Whereas, regression trees use Reduction of Variance, which is the average of the sum of squared residuals.

I did not use mathematical formulas, but wanted to give an intuitive explanation of the concepts. You can find equations [here](https://en.wikipedia.org/wiki/Decision_tree_learning#Metrics). 

**Gini Impurity**

To get a better perspective, how the Gini index works. This term is often used in [economics](https://www.investopedia.com/terms/g/gini-index.asp) to describe economic inequality by measuring income distribution. For example, the average income does not give full information about the variation and the distribution of income among the population. So, we can apply the same approach for our binary classification problems, where we measure the Gini index on how to split the data. 
 

**Entropy or Information Gain**

The entropy uses Log in the formula, and basically, it measures how homogeneous or organized is the system after the split. It is very similar to the Gini index. 

**Reduction of Variance**

This approach is similar to linear regression, where we calculate the sum of squared residuals.
So, for regression trees at each node after the split, we measure the mean value of the data points. Then for each data point, we compute the difference (=residual) between the point (true value) and the calculated mean. Then we calculate the average of the sum of the squared residuals. 

In the next post, I will show the application of each method in Python and Sklearn.
JavaScript template literals
Tags: javascript
Published: 2020-11-09 04:44:37

Something cool that was introduced in `JavaScript ES6` is Template Literals.

You might wonder, what the hell are Template Literals Chris, and more importantly, why do I even need them?

Template Literals are a very quick and widely adopted new way of defining strings.

Besides that, they come with some extra new and handy methods. I'm going to be showcasing some examples of the changes between the old method and the new one.

## Difference between strings and template literals

If we want to define a string in JavaScript, we can do that using quotes, either single (`'`) or double (`"`) quotes.

```js
const myString = 'Cool I can be anything';
const otherString = "Me too!";
```

With template literals we can do the same, but using a backtick.

```txt
` (backtick)
```

```js
const templateLiteral = `I can also be a string`; 
```

Ok, but that almost looks the same so what makes them so great?

## Template literals can be multiline

Creating a multiline string was always an issue when it comes to JavaScript, we had to include a `\n` or just use multiple strings.

```js
const multi = 'Hello\
Also hello'
console.log(multi); 
// 'HelloAlso hello'

const multi = 'Hello \n Also hello';
console.log(multi); 
// 'Hello 
// Also hello'
```

As you can see this can be super annoying to include these `\n` escapes everywhere.

With template literals this is way easier, we can just type multiple lines.

```js
const multi = `Hi

Yes I'm on multiple lines
How cool`;
console.log(multi);
//"Hi
//
//Yes I'm on multiple lines
//How cool"
```

Ok that's a big pro already!

## It can handle variables

Another thing that will annoy you as a developer is that you have to escape the string to use a variable.

```js
console.log("What is 2 + 3: " + ( 2 + 3 ) + "!");
//'What is 2 + 3: 5!'
```

Jeez, such a hassle to include a simple variable or function.

With template literals, we can use variables using this syntax `${variable}`.

```js
console.log(`What is 2 + 3: ${2+3}!`);
//'What is 2 + 3: 5!'
```

Oh, wow way shorted and easier on the eyes already!

Another great example and everyday use-case would be expressions.

Let's say we have a dynamic class we need to add.

With normal string we have to either escape or break this in two separate things.

```js
let bodyClass = 'body ' + (isLargeScreen() ? 'large' : 'small' );
console.log(bodyClass);
// 'body large'
```

With template literals this can be made easier.

```js
let bodyClass = `body ${isLargeScreen() ? 'large' : 'small'}`;
console.log(bodyClass);
// 'body large'
```

So with this being said, create a habit of using template literals, it will make your life so much easier.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
We look at install of kubernetes on windows 10
Tags: devops, linux, docker
Published: 2020-11-09 04:42:45

---
title: We look at install of kubernetes on windows 10
published: true
description: With the new Windows subsystem for linux it's easier to install Kubernetes on Windows 10. In this video we look at Kubernetes using minikub and KinD which is two easy setups to try out kubernetes locally.
tags: devops, linux, docker
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/atbn5cgxil2p84pjsouy.jpg
---

{% youtube BX_nXzn3I14 %}

With the new Windows subsystem for linux it's easier to install Kubernetes on Windows 10. In this video we look at Kubernetes using minikub and KinD which is two easy setups to try out kubernetes locally.
Twitter search tricks for Developers: Must Know
Tags: twitter, tips, tricks, html
Published: 2020-11-09 04:31:59

Hey, guys, there is a huge community of developers on Twitter. So, it's just essential and cool to know some Twitter search tricks. All the search tricks mention here are amazing and important for you.

![undraw_social_girl_562b.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1604895499034/Q3BaZcei4.png)
Let's go on hunting them all. 

<hr>
Do you want development news right on your default chrome or firefox page? Then get the amazing  [daily.dev](https://api.daily.dev/get?r=rahxul) extension. There are only PROS of getting this extension no CONS. 
<hr>

# Twitter Search Tricks 

- **Particular user tweets**: `from:iamsrk` -> Here what will happen is all tweets from iamsrk will be shown when you perform the search. **iamsrk** is the username.
![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1604893001748/mQ-IyNMj4.png)

- **Tweets from user mentioning someone but excluding retweets**: `from:rahxul to:john -RT` -> `rahxuls` is the username and the second one `john` too. This will show all the tweets from rahxul to john but not the retweets. 

- **Filter adult content**: `developing filter:safe` -> This will filter all the adult content that is with the developing keyword. 

- **Finding a YouTube video**: `web development youtube.com min_faves:100 ` -> This will find YouTube video that has keyword web development. 

- **Find retweets**: `html min_retweets:10`-> This will find tweets that has minimum 100 retweets and has HTML as keyword. 

- **Find image with hashtag**: `#CodeNewbie filter:images` -> This will show tweets that has #CodeNewbie hashtag and has image. 

- **Get the media**: `tsunami filter:media` -> This will show tsunami tweets, having media(photos or videos). 

- **Tweets in particular language**: `#WebDevelopment lang:fr`-> This will show all the tweets which is tweeted in french language under #WebDevelopment tag. 

<hr>
Do you want development news right on your default chrome or firefox page? Then get the amazing  [daily.dev](https://api.daily.dev/get?r=rahxul) extension. There are only PROS of getting this extension no CONS. 
<hr>

Here i'm done showing some amazing tricks for twitter searches. If you loved then let me know in the comments.
Scene Based Applications
Tags: javascript, react, webdev, architecture
Published: 2020-11-09 04:05:13

Recently I've found myself building lots of small microsites with 2, maybe 3 routes and I seem to struggle with how do I layout my files? I want my site to be able to grow, be resilient to change and ultimately know where to go looking for things. I also leverage the [Module Federation](https://dev.to/marais/webpack-5-and-module-federation-4j1i) technology, which mean's often areas of my route, or sometimes entire routes aren't actually part of that file tree.

And because of this, I introduce you to:

The "scene" pattern! A scene is single page instance, the "macro" component for a route if you will. Within the screenwriting industry, a scene is described as a narrative device, where the film is the story. Scenes are mini-stories that occur within that film. Similarly, a scene is a mini-story as part of the greater app.

What does this look like?

```
src/
├── scenes/
|   ├── homepage/
|   |   ├── Homepage.tsx
|   |   └── SupportingFile.tsx
|   └── product/
|       ├── ProductPage.tsx
|       └── Product.tsx
└── routes/
    ├── index.tsx
    └── product/
        └── $product.tsx
```

From that you can see that I have now clearly exported the page component for the route, leaving me to seamlessly change, alter or move my routes. Allowing me compose my scenes freely, and without an awareness of where (or what route) that scene might render.

> Scenes **don't** compose other scenes. Scenes compose components that you may share.

In worlds such as [Next](https://nextjs.org/) or [Remix](https://remix.run/) that leverage file-based routing, often times all files in that sub tree will in-tern render a route. Which often leads to some large files with all the supporting components in them, or some circular dependencies because you have routes importing parts of another route and so on.

---

<small>Photo by <a href="https://unsplash.com/@yiranding?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">丁亦然</a> on <a href="https://unsplash.com/s/photos/stage?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></small>
Stream Heroku logs to AWS Cloudwatch using an EC2 instance and Docker
Tags: aws, heroku, docker, devops
Published: 2020-11-09 03:15:23

I am pretty sure we all have one or more apps deployed on Heroku. It is one of the most popular platform to deploy apps encompassing various technologies. I use Heroku to deploy many of my side projects as it has a generous free tier. But one thing I always struggled in Heroku was to manage the logs. I agree it is easy to get the logs on Heroku CLI with just one command but I wanted a more automated a stable solution to track the Heroku logs.
I really like how AWS enables tracking application logs in Cloudwatch Logs. Its easy to setup and we can setup multiple actions on the logs like setup alerts, prepare reports from the log data and on and on. AWS Cloudwatch is a vast solution and I cant fit its all features in one post. So I will just go through some overview.

So to have a better tracking of the Heroku logs, I went ahead and integrated the Heroku logs to Cloudwatch where I can perform further analysis on the log data. In this post I will be explaining how to achieve the same and stream any Heroku app logs to an AWS Cloudwatch log stream. Hope this will be useful for your Heroku deployments. This can also be used in any enterprise scenario where any application is deployed on Heroku.  

For more details:  https://amlanscloud.com/herokulogsaws/
How to create & publish a npm package
Tags: javascript, node, tutorial
Published: 2020-11-09 02:43:45

npm is package manager for Node.js that allows JavaScript developers to easily share packaged modules of code. In this tutorial we’ll be creating and publishing a simple npm package that displays a funny quote in the console.

Before you can publish a package you’ll need an npm account (sign up [here](https://www.npmjs.com/signup)).

With the account created login by running the following command:

```
npm login
```

Enter your account details when prompted to login.

Next let’s create a folder for our package and a `package.json` file:

```
mkdir funny-quotes 
cd funny-quotes
touch package.json
```

Open the `package.json` file in your code editor of choice and add the following:

```javascript
{
  "name": "funny-quotes",
  "version": "0.1.0",  
  "main": "index.js",
  "license": "MIT", 
  "description": "Funny quotes in your console.",
  "keywords": [
    "funny",
    "quote",
    "console"
  ]
}
```

Name and version are required the others are optional.

- name – unique package name.
- version – current release version of the package.
- main – entry point for the package.
- licence – we’ll use MIT which allows developers to do anything they wish with the code.
- description – short description of what the package does.
- keywords – a list of keywords to help people discover your package.

We can now create the main entry point for the package:

```
touch index.js
```

And add the following code:

```javascript
const quotes = [
  '"I’m sick of following my dreams, man. I’m just going to ask where they’re going and hook up with em later." — Mitch Hedberg',
  '"Before you marry a person, you should first make them use a computer with slow Internet to see who they really are." - Will Ferrell',
  '"Someone asked me, if I were stranded on a desert island what book would I bring: ‘How to Build a Boat.’" - Steven Wright',
];
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];

console.log(
  "\x1b[33m%s\x1b[0m",
  "---------------------\n" + randomQuote + "\n---------------------"
);
```

This create’s an array with some quotes and then grabs a random quote to display. `\x1b[33m` is an escape sequence that when encountered switches the color of the text logged to yellow so the quote will stand out a little, `\x1b[0m` then resets the color.

Let’s test the script by running the following command:

```
node index.js 
```
You should see a random quote as follows:

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

With everything working we can go ahead and publish the package:

```
npm publish
```

If there was no errors you’ll get an email letting you know the package was successfully published. If you visit the npm website and search for the package by name it will now appear in the search results.

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

The package can now be installed from npm using the following command:

```
npm i funny-quotes
```
React & Redux Tips
Tags: codenewbie, react, redux
Published: 2020-11-09 02:43:11

---
title: React & Redux Tips
published: true
description: Creating a web application using React and Redux
tags: codenewbie, react, redux
cover_image: 
---
# React
It's been an exciting last few weeks cramming my brain with all the wonderful things you can do with React (not to mention the mind-boggling work flow using Redux). I wanted to write a quick helpful article with just a few tidbits of useful info.
## Container VS Presentational Components
As I'm sure all you React pros are aware of the power of components. Whether they are full fledged class components with state, multiple methods, and tons of logic or just a simple functional component that simply returns an HTML element, components are what React is all about. While there are new/other ways of designing a React app (hooks seem pretty cool to me), for the project at Flatiron School we need to create container components and presentational (or stateless) components. It's kind of cool thinking about the design of our app this way. We want our simple components to be the children of the more complex parents that do all the heavy lifting including sending down props.
## MAP
If you are unfamiliar with map, one of my favorite higher order functions, I would recommend reviewing it. Map is called on an array and is provided a callback function and returns a new array based on the results of the function provided. You use it a ton in React.
```javascript
{this.props.stacks.included.map( card => {
  if (card.relationships.stack.data.id === this.props.id)
    return (
      <div key={card.id}>
        < Question front={card.attributes.front} id={card.id} configureColor={this.configureColor} handleChange={this.handleChange}/>
      </div>
           )
      }
})}
```
While this might look intimidating all map is doing is going through the stacks.included array and checking the id of each card and rendering the Question component with the proper props passed in. 
## The Terms of Redux
Action :: a plain JS object with a type key and potentially a payload of data
Reducer :: a pure function (always returns the same value when given the same arguments) that has a switch statement which checks our action's type and returns a new state
**REMEMBER** reducers never update the previous state, they create a completely new state object.
There is a lot more to say about Redux. I plan on writing a separate article.
## Onward
This marks the end of my Flatiron journey, but I will continue to learn, create, and write! I look forward to what lies ahead!
Twitter??
Published: 2020-11-09 02:18:08

Today is Sunday Nov 8th, exactly one week ago I finished my assessment for Twitter last Sunday. I have not heard back from them since but I do feel that I did well on it. I remember one of the questions was about sorting through a 2d array(matrix). That particular question was really easy to do complete because I had done a similar question on leetcode.com. It have not gotten a response from them but I understand that they have a lot of candidates(thousands). A few of my other Flatiron grads have also taken that assessments and have heard nothing yet. This past week has consisted of lots of job searching on Linkedin and sending out emails to recruiters. This next week will consist of the same and hopefully I will be asked to interview for more options.
Get Gist-ed. New target telescoped. Wow weekends. 
Tags: opensource
Published: 2020-11-09 02:17:35

Hello fams! Been a while since my last post. Been busy here and there. enjoying the weather though, 20 degrees one day, -1 the next. lots of jumping's eh, I guess summer's not over yet, and winter is coming. Anyways back to the main topic of the post, I just uploaded my first gist, hyped af.

As you can see from my last blog posts that I was busy with hacktober fest for the whole month of October. But, this month now dealing with new stuffs. Will be working with a program called "Telescope" from now on. "Telescope" is an open source web server and client application for aggregating and presenting a timeline of Seneca's open source blogs. I just implemented a function on my cli that deals with 10 latest posts from Telescope and outputs if its broken or not. I tested it and it seems to be working as expected. 

I also made a secret gist on it. I compared the differences between my last 2 commits. You can see from that I just implemented a single functions that deals with this problem entirely. But, the coding part this time was the easy part in my opinion. I found the installing and readying up the programs beforehand (Docker and Elasticsearch) was more challenging as it was my first time doing it. Learned lots about both applications, specially docker. pretty positive will be using it more often from now on as it automates literally everything and makes your life a whole lot easier.

Been watching some series in the free time I have between stud studies. I prefer kdramas for the moment as I have been watching them for a while now. Its great for me because the drams are usually very chill and relaxing, helps me relieve stress I accumulate from studying. I think I'll probably reduce the time I spend with watching and focus more on studying as the final weeks of this semester is coming very quickly.

That's all I have for todays blog post and Ill be back very soon on my Release 3.0 news. Probably early-mid next week. Till then Thank you for reading and have a great day!

Links - 

[GIST](https://gist.github.com/Niaz-Ul-Haque/293512c0af69d3a9c4f1d4c9e3c5882f)

[Latest Commit](https://github.com/Niaz-Ul-Haque/nlinks/commit/a43612b0f0e5ebf6e226c54f8987f5eb9db391b3)