teleren/devto huggingface dataset:
Programmer, aka Soldier of Fortune
Tags: programming
Published: 2020-04-10 15:33:18

---
title: Programmer, aka Soldier of Fortune
published: true
date: 2020-04-09 5:05:00 UTC
tags: programming
cover_image: https://www.stephanmiller.com/images/bcp/getting-hired/soldier-of-fortune.jpg
canonical_url: https://www.stephanmiller.com/programmer-aka-soldier-of-fortune/
---

Loyalty is overrated in a career. It used to be a thing, but so did pensions. But any more it does not pay off. And that is for any job. Now take programming jobs. It is one of the most in-demand jobs around these days. What that means is that it’s a seller’s market. If you are half-way decent at writing code and you get laid off, you will find a job. There are more jobs to go around currently than there are programmers.

But there is also a flip side of that coin. For some reason, raises are pretty much unheard of in programming jobs. Oh, there are some places that still subscribe to the old school model of benefits. I actually took one of those jobs. It had year-end bonuses, a great 401k and a guaranteed cost of living raise at the end of the year with possibility for more. I was there for two months. They got bought out and all those benefits disappeared. The contracts you sign when you get a job are for the companies protection, not yours. Benefits can and will be taken away at any moment.

Up to the point of getting hired for that job, an idea was brewing in my head that the best attitude to have in this job market is one of a mercenary. I owe no one for my job. I owe no loyalty to a company who pays me well for my best work. When I am unhappy, it is time to start looking. It’s the attitude that gives you the most options. It makes you stand on your own two feet and be responsible for who you are and what you do. If you do good work, then that is what you are paid for and that is all. They do not own you.

Well, when I got that job, I thought maybe I was wrong. Maybe I had found a job that I could retire at and be a “company man”. No, I was right in the first place, as the job itself was soon to teach me. When my benefits got cut, I started looking.

If you do good work, promote yourself so that you are one of the first people recruiters find and learn to roll with the punches, you will always find a job. And you will be the one in control of your career.

You will hold all the cards, which you already actually held. Corporations do like creating minions. Why do you think there are meetings you are required to go to. It’s like church. It’s indoctrination.

A lot of people in a corporation are easily replaceable and must accept the yoke. But not programmers. At least, not yet. So throw off that yoke and take control of your future. It will be your choice when it’s time to go. It will be your choice what your next job will be. Corporations will be more afraid of losing you than whether or not you are a good company man, the way it should be. You have the power.
What are alternatives for Wunderlist (for students)? 
Tags: productivity, discuss, tools
Published: 2020-04-10 05:02:09

I’ve been looking for alternatives for Wunderlist since it is going away. To be honest, I tried To Do for a month and it’s just not my thing. After using Wunderlist for three years, it’s a huge disappointment to see one of my favorite app downgrade to an app that is repetitive and crashes often. 
I was wondering if there are any recommendations for better alternatives.
Here are the three I tried to use so far: 

I tried [Trello](https://trello.com), enjoyed how the tasks can be easily separated into categories and add cards simply like having sticky notes, but its functions are restricted greatly if you use the free version. But as a student with budget, I prefer using free app with more functions. 

[Quire](https://quire.io) is similar to what I am looking for. They have simple and easy to use utilities, also I can collaborate on projects with my classmates easily. Particularly enjoyed the feature where you can assign tasks to different people with different deadlines; this makes group projects so much easier! The slight problem is that they don’t have the templates that I want.

The last app I tried was [Asana](https://asana.com). I loved the calendar feature, but overall, the app was a bit messy for me. There are too many features and isn’t user-friendly enough (which is a problem when I need to collaborate with many classmates who are often new users). Another problem is that the tasks can only be assigned to one person at a time, which seems pointless since most tasks take more than one person to finish. 

So out of the three, I prefer Quire the most. 

Are there any other recommendations?
Check if all records are matched with your prediction in javascript
Tags: javascript, ux, codenewbie, 100daysofcode
Published: 2020-04-10 04:31:14

Hi welcome folks, Javascript is one of the popular languages you can learn ( easily ). Herewith the series called "Javascript Useful Snippets ", I'm going to share some shortcodes and useful javascript methods. These snippets can help you to make your development more efficient and faster.  So, stay tuned till the end...

#### Javascript Useful Snippets - all() ####

In order to check whether every value of your records/array is matching with your prediction or not, you can use this function. all() function returns true if the predicate function returns true for all elements in a collection and false otherwise. let's look at the syntax...

``` 
   const all = (arr, fn = Boolean) => arr.every(fn); 
```

Here, are passing two parameters - one is an array of records and the second is prediction function where you can omit the second argument if you want to use Booleanas a default value.


#### Result one : ####
``` 
   all([ 4, 3, 5], x => x > 1);   // output:  true 
```

#### Result Two : ####
``` 
   all([ 4, 1, 5], x => x > 1);   // output:  false 
```

#### Result three : ####
``` 
   all([ 4, 1, 5]);   // output:  true 
```

As you have seen in results above with prediction function it'll return as per values in an array which passed through parameters. and without prediction, it'll return default boolean value.

{% youtube p5JW6YIh5yo %}

Now, what if we want to check whether all records of the array are equal or not?  Well our next episode it all about it so, stay tuned and keep support me. 

Thank you for watching folks, if you found this informative and wanted to make me more content like this please support me on Patreon.  


Subscribe on youtube https://www.youtube.com/channel/UCvNjso_gPQIPacA6EraoZmg

Facebook: https://www.facebook.com/KatharotiyaRajnish/

Twitter: https://twitter.com/tutorial_spot
Why I Don't Find Coding Tutorials As Helpful Anymore
Tags: productivity, programming, learning
Published: 2020-04-10 04:10:51

***Once upon a time when I was learning how to code about 2 years ago,*** I discovered the many different branches of software development and was eager to learn them all. 

It essentially felt as though the programming world was my oyster because of the unlimited amount of resources in online courses and tutorials that were available to me - I could learn anything whenever I wanted **and** as fast as I wanted to!(*At least that's what I thought at the time.*)

Course after course, and tutorial after tutorial, I was having so much fun setting up new project environments and following walkthroughs on how to build a new app or game, that I lost sight of what was really important to software development and programming in general. 

Over time I started to realize that I was following these tutorials to a **T** thinking that I actually knew the material being taught, but in reality when I tried to implement a similar project on my own, I could barely get past the set up stages. **The picture below essentially describes my situation:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9ugfsyd28o8srhq06d3u.jpg)

What I've learned over the course of the last few months is that if you really want to know how to develop on your own, or retain information on anything you're learning generally speaking, you just have to jump in and do it. 

I'd be lying if I said that I don't look at coding tutorials from time to time if I get lost on how to start or implement something, or if I just want to learn something new. But I've learned how to take the pieces of information I *do* need and use them to make my own thing.
Simple deploy typescript application to Heroku
Tags: typescript, node, devops
Published: 2020-04-10 03:53:24

## Step 1. Making project root directory

```bash
mkdir simple-deploy-app-typescript-to-heroku
```

## Step 2. Initialize your directory as a node project

```bash
cd simple-deploy-app-typescript-to-heroku
npm init -y // automatic create new file package.json
```

## Step 3. Install required dependency using NPM

```bash
npm i @types/express @types/node express nodemon ts-node typescript
```

* Express is used for making REST API easier.
* Nodemon keeps the server running and swapping the latest code so we don't need to restart the server every time our update new code.
* ts-node directly runs .ts node file.
* typescript for type-script support to javascript.


## Step 4. Configuring Typescript

```bash
tsc --init // automatic for create new file tsconfig.json
```

Then add new line below <code>compilerOptions</code> object.

```json

"include" : [
    "src/**/*.ts"   /* Include every ts file in source folder */
],
"exclude" : [
    "node_modules"  /* exclude everything in  node_modules */
]
```

## Step 5. Setting up server

Edit file package.json

```json
"compilerOptions" : {
  //**/
},
"scripts": {
    "start": "ts-node src/config/server.ts",
    "dev": "nodemon -x ts-node src/config/server.ts"
},
```

> Server script would live in src/config/server.ts

Create a new simple server with express now.

*src/config/server.ts*

```typescript
import express from 'express';
const app = express()
const PORT : string|number = process.env.PORT || 5000;

app.use("*",(req, res) =>{
    res.send("<h1>Welcome to your simple server! Awesome right</h1>");
});

app.listen(PORT,() => console.log(`hosting @${PORT}`));
```

Testing for server is running as well, we run cmd <code>npm run dev</code>.


## Step 6. Deploying to Heroku


### Substep 1: Installing [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)
### Substep 2: Logging in into Heroku

```bash
heroku login
```
Then we are going to a new windows browser for login to Heroku application.

### Substep 3: Creating a heroku application in [heroku](https://dashboard.heroku.com/apps) 
### Substep 4: Creating a file Procfile for Heroku

Add a new line to file
```bash
web:ts-node/src/config/server.ts
```

### Substep 5: Initializing our project into a git repo of Heroku

```bash
git init .
git add .
git commit -m "Initializing project"
```

### Finally of substeps: Pushing code to Heroku
```bash
git push heroku master
```

I hope it helps a little bit for you.
Thanks for reading my post.
Have a nice day!
Day 009 of #100DaysOfDesign — Mind Reader Game
Tags: challenge, design, 100daysofdesign, webdev
Published: 2020-04-10 03:43:23

Today’s idea was an interesting one for me. The idea was to design website for Mind Reader game. I have not done JS Games yet and I have not designed any, so it was bit out of the character for me. And here I am, writing blog about my today’s design.

I started by discovering about other JS games for an inspiration. It was bit hard to find but I did notice one important thing in all of them that they usually has dark colour theme. It is an important choice when we are designing for games as many times games access the website in night or in dark room and I would not want to kill their eyes! I chose to go with a dark theme based on dark navy colour. Design’s layout and wireframe did not had anything extra ordinary in it. It was a very basic website except I had to design a special case where we give a feedback to the user about his answer (in this case it was modal).

![Wireframe for Mind Reader Game](https://dev-to-uploads.s3.amazonaws.com/i/vwwthrijz6bdgf2rhx9b.png)

I did not had much time today for a design and I was having a bit pain in my back. Yet, I wanted to complete the design with all the pages and mobile. designs. Index page, the only part which was quite complex was the cards. It was not the complicated for desktop because I went with the similar layout as paper cards but I was not sure what changes should I make for mobile devices. I tried resizing the card but it did not turn out as well as expected. So I decided to change the layout of the card from horizontal to vertical. This way I was able to remove unnecessary scrolling on mobile device yet using the full width of mobile.

![Mind Reader Game - Final Design](https://dev-to-uploads.s3.amazonaws.com/i/5b45uje41hgb158w1jp8.png)

All together, it was a very good experience. I tried out to design with dark colour themes. Learned to do a complete website when I was not in good mood to be consistent on the challenge.

_Drop your comments/feedback on Figma file and on this blog. Let me know if you have any reference material that I can use to develop this website._

**Today’s Figma File**: [#009 — Mind Reader Game](https://www.figma.com/file/IhzTBWH6Jo924sxsW4P8b8/009-Mind-Reader-Game)

**Yesterday’s work**: [#008 — Product Image Gallery](https://dev.to/harshppatel/day-008-of-100daysofdesign-product-image-gallery-1nhe)

**Tomorrow’s Idea**: GitHub Timeline Generator (Probably I will take 2 days to complete this one)
Coming back to DEV
Tags: personal, update
Published: 2020-04-10 03:30:55

---
title: Coming back to DEV
published: true
description: It's been quite some time
tags: #personal #update
---
So just recently I got this email
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0fthh2uibxmfzuaeru3m.png)

which was cool and somewhat bittersweet because my last post was actually in mid-2018. I didn't actually stop posting for any specific reason other than I'm still a university student and I did get into academic research. Since then however, quite a bit has changed (and from what I can see, DEV has also changed quite a lot too.) So as a fun tribute post, I'll be picking out some developments that occurred since my last post.

Right before I stopped, my profile looked like this:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/p2tg9x0ru7ngii1u0s63.png)
I'm fairly certain this was before you can change the UX of DEV, and before the actual app on the iPhone (both of which are amazing btw, thank you to everyone that made that possible.) A big change is: I'm no longer a mobile researcher anymore! I've actually rotated in research fields quite a bit, testing the waters of wearable technology, natural language processing, and computer vision, with computer vision being my primary focus. I'm still in my undergrad with a year to go before I apply to grad school for my PhD so there's quite some time until then. I actually have not touched Kotlin or anything Android related since then.

The primary thing that has remained consistent throughout my progress is machine learning and finding optimal ways to use machine learning models. This has largely become a big focus for me and it is something I plan on continuing in graduate school. Some fun little achievements I've made in that two year span include:
- My first conference presentation
- A few academic posters
- Experimentation in different fields
- And a clear long-term goal

The title of this post is "Coming back to DEV" and I mean it in the lightest sense. I'm not sure how often I plan to post but I have been taking up some work to keep me busy during the Stay-Home order which I hope to write about in the near future. Thanks to DEV for keeping the community interesting and reeling me back in with that Two-Year badge :~)
Common errors when learning rails!!!!
Tags: rails
Published: 2020-04-10 03:19:53

---
title: Common errors when learning rails!!!!
published: true
description: This short post will talk about of some of the most common errors when working with rails
tags: rails
cover_image: https://hackernoon.com/drafts/3b3t3yqt.png
---

#Most common errors in rails#
Hi everybody, this is my second post and since we already completed the rails module in Flatiron School, i would like to talk about some of the most common errors that i face when i was learning and working with labs.

##Number 1##
**NoMethodError: undefined method '[]' for nil:NilClass**
I face this error a lot, when i was working with forms and i was using another model collection to create a drop-down, and basically tell us that we are trying to use a square bracket notation to read a property from an object, but the object is missing, or nil, in my case was because usually i forgot to get the instance variable in the action, lets say in the create action and the validation to save failed, then render the new form again, and is when the error came.

##Number 2##
**ActionController::RoutingError**
This error basically is telling us that the user made a request to a specific URL that doesn't exist in our routes file, so when the router try to match with a controller action, i will throw the error.

##Number 3##
**ActionController::ParameterMissing**
This error is related to the strong parameters and the way that we construct the params, probably we miss to add the :key for the params hash.

##Number 4 & last one##
**ActionView::Template::Error: undefined local variable or method**
This error basically means that we are missing the view for the action that was call, and the easy fix is by only create the file under the folder.

Thats all for this post, hope is useful :)!
State Management in Pure React with Hooks: useEffect
Tags: react, beginners, webdev, tutorial
Published: 2020-04-10 03:15:54

Hello, everyone 👋, I hope you are doing great 😊.

So, today you are going to learn all the fundamental concepts of ``useReducer()`` Hook in this article.

Before you start, there are some rules you need to follow to use Hooks 😟. Thankfully the React Team has provided an ESLint Plugin called [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks) that will help enforce these rules when using Hooks 🤩.

#useEffect Hook
The ``useEffect()`` Hook allows you to perform side effects in the functional component. The side effects could be data fetching, setting up a subscription, and manually changing the DOM to React components.

The ``useEffect()`` Hook takes two arguments. The first argument is a function in which you can perform your side effects, and the second argument is an array of variables (optional).

![](https://res.cloudinary.com/dqhskqqa6/image/upload/v1586458182/state-management-in-pure-react-with-hooks/nx2oyxkax8iqqpdwrekz.png)

If you do not provide the second argument, then the ``useEffect()`` Hook runs after every render.



{% gist https://gist.github.com/bipinrajbhar/0188a257ddb6430d5947e9eeeb8ff112.js %}

**Example**
{% codesandbox state-management-in-pure-react-example-1-tvr1b %}

If you have noticed, the example given above behave similarly as ``componentDidUpdate()`` 

If you provide an empty array in the second argument, then the ``useEffect()`` Hook run only one time.

{% gist https://gist.github.com/bipinrajbhar/f6bd7da1331d332069fa53b1f3e5686b.js %}

**Example**
{% codesandbox state-management-in-pure-react-example-3-dwykr %}

If you have noticed, the example given above behave similarly as ``componentDidMount()`` 

If you provide an array with a variable in the second argument, then the ``useEffect()`` Hook run only when the variable change.

{% gist https://gist.github.com/bipinrajbhar/0eee363ca33c9dd43242b54d7995c894.js %}

**Example**
{% codesandbox state-management-in-pure-react-example-2-6x9g9 %}

If you have noticed, the example given above behave similarly as ``componentDidUpdate()``

Before we end this article, I want to mention that you can also mimic the behavior of ``componentDidUnmount()`` by simply returning a function.

{% gist https://gist.github.com/bipinrajbhar/0eee363ca33c9dd43242b54d7995c894.js %}

**Example**
{% codesandbox state-management-in-pure-react-example-4-x914p %}

> If you are family with React class lifecycle methods, you can think of ``useEffect()`` Hook as ``componentDidMount()``, ``componentDidUpdate()`` and ``componentDidUnMount()`` combined.

Now, you have learned all the fundamental concepts of ``useReducer()`` Hook 🤘.

Thanks for reading! My name is Bipin Rajbhar; I love helping people to learn new skills 😊. You can follow me on [Twitter](https://twitter.com/Bipin_1598) if you’d like to be notified about new articles and resources.
If the COVID-19 stimulus package was stacked as $100 bills
Tags: covid19, visualisation
Published: 2020-04-10 02:34:24

---
title: If the COVID-19 stimulus package was stacked as $100 bills
published: true
description: Visualisation of the COVID-19 stimulus package (2.2 trillions)
tags: COVID-19, visualisation
---

# How tall is 2.2 trillions stacked as $100 bills?

After debating with friends how tall $1 million USD stacked as $100 bills would be, I decided to run the actual math. Assuming a thickness of 0.010922 centimeters, or 0.0043 inches per bill, it turns out to be just above 1 meters (1.09m | 3.58ft), or about the height of a normal, adult size bicycle.

I've decided to create a little ELM application with a slider for 1M, 10M, 100M etc. all the way to 2.2 trillions, which is how much the Reserve Bank decided to inject into the economy to fight COVID-19. Each step has an image representing how high the stack would be to make it easier to visualise.

Here it is: [COVID-19 stimulus stacked as $100 notes](https://lottosimulation.com/covid-19/us)

On the development side of things, the part that took the most time, by far, was making it work on mobile and desktop. On desktop, the slider sits at the bottom and is displayed horizontally, while on mobile the slider sits at the left and is displayed vertically. Keeping the numbers aligned with the slider was definitely a challenge.

![Desktop slider](https://dev-to-uploads.s3.amazonaws.com/i/91wegxs1yawyqkagdi1h.png)

![Mobile slider](https://dev-to-uploads.s3.amazonaws.com/i/37m1f7u5uoqpn59d5dor.png)

For anyone wondering, it is a HTML slider (input type="range") with a datalist. You can style the slider by removing the default styles with appearance: none (needs prefixes, I use autoprefixer with postcss to automatically prefix anything that needs it).

While it is not incredibly useful or beautiful (you can probably tell that my photoshop skills are subpar), took a lot of time fiddling around with styles, I am still pretty happy with the result.
Risky Phone Numbers Lookup API
Tags: api
Published: 2020-04-10 02:18:37

Find out more information about a phone number before answering or making a call routing decision.


## API Call:

```shell

curl --location --request GET 'https://apiv2.telecomsxchange.com/buyers/tools/numberscore/?cld=19542301111'

```

## Example Response

```shell

{
  "status": "success",
  "country_code": "ua",
  "phone_number": "+380913104000",
  "carrier": {
    "country_code": "ua",
    "country_name": "Ukraine",
    "description": "Ukr Telecom Mobile",
    "prefix": "38091",
    "number_score": "Risky number"
  }
}

```

### Good

The number has been seen in TCXC network before and had high durations and most probably a good number that belongs to a real person.

### Risky
TCXC have never seen this number before or it had too many incomplete calls that never connected. Answer at your own risk.