teleren/devto huggingface dataset:
Python: Bitcoin price trend with Matplotlib
Tags: bitcoin, blockchain
Published: 2019-09-15 19:23:32

If you are a long term trading, you are not interested in the day-to-day rates. You can get the historic price of bitcoin by year. 

I pick Python because that's my go to language for quick scripts.


## Collect data

You can get the JSON formatted data and parse it into a Python list. In the code below we use the requests module to do that.

We are only interested in the same day in each year, everything else is noise.I picked the day September 10. The data itself starts from 2014, you can't go further back than that, because they don't have that data.

    #!/usr/bin/python3
    import json
    import requests
    from bs4 import BeautifulSoup
    import csv
    import sys
    from time import sleep
    from time import gmtime, strftime
    import matplotlib.pyplot as plt
    import seaborn as sns
    
    enddate = strftime("%Y%m%d", gmtime()) 
    r  = requests.get("https://coinmarketcap.com/currencies/bitcoin/historical-data/?start=20140101&end={0}".format(enddate))
    data = r.text

    soup = BeautifulSoup(data, "html.parser")
    table = soup.find('table', attrs={ "class" : "table"})

    prices = []

    for row in table.find_all('tr'):
        addPrice = False
        tag = row.findAll('td')
        for val in tag:
            value = val.text

            if "Sep 10" in value:
                print(value)
                addPrice = True

        if addPrice == True:
            prices.append( tag[3].text )

    # flip list, months are in reverse order
    prices = prices[::-1]
    print(prices)

We flip the pricing data, because the months start returning in reverse order.
 
    Sep 10, 2019
    Sep 10, 2018
    Sep 10, 2017
    Sep 10, 2016
    Sep 10, 2015
    Sep 10, 2014

## Create plot

Ok so now that you have the pricing data you can create the plot.

    x = list(range(0, len(prices)))

    plt.title('Bitcoin price from 2014')
    plt.ylabel('Price in USD')
    plt.xlabel('Years from 2014')
    plt.bar(x, prices)
    plt.show()

That gives us:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/277mcbqcufuh7p812xri.png)

So is it a good investment? That's for you to decide, this is not financial advice.

Related links:

* <a href="https://coinmarketcap.com/currencies/bitcoin/#charts">Bitcoin price normal chart</a>
* <a href="https://pythonbasics.org/">Learn Python programming</a>
* <a href="https://github.com/codesharedot/bitcoin-price-trend">Code on github</a>
Installing Xdebug on PHPStorm for dummies
Tags: php, phpstorm, xdebug, wamp
Published: 2019-09-15 19:12:19

When I was asked to install Xdebug on my environment at work, I found multiple guides on the web. None of them were exactly what I needed.
At my workplace, we use *PHPStorm* as an IDE, and our local environment is *Wamp* (the headline says **for dummies**).

So, after scavenging information from multiple guides, I finally got it to work, and wrote it in a document for my teammates.

Lucky for you, I like to share!


##Step by step:

1. Go to *php.ini* file, make sure that **xdebug.remote_enable = 1**.
if you are not sure where is your *php.ini* file is, and you are using Wamp, you have shortcut from your taskbar:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5hog9bfsirmznk4iqpmf.jpg)
Then:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/0lwfw01361q4vherp31c.jpg)

2. In PHPStorm, go to  **File | Settings | Languages & Frameworks | PHP** and
choose:
  * PHP level => 5.5 in my case. if you are not what is your PHP version, echo [phpinfo()](https://www.php.net/manual/en/function.phpinfo.php). 
  * CLI interpreter => add a new interpreter from a Local
Path with the following definitions:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/hfe9lvke4zxfchof43cc.png)
  If you are using *Wamp*, I assume you have that file in the Wamp folder like i did.

3. In **File | Settings | Languages & Frameworks | PHP | Debug**
make sure the Xdebug definitions are as following:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/rgab08yukzjoht2l488t.png)

4. Go to **Run | Edit Configurations** and add a new *PHP Web Page*
configuration with the following definitions:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/nqq6t07vab89e9pv7cpn.png)
 * define a *localhost server* if needed
 * *Start URL* is the address of the page you would like to start the debugging.

5. Go to **Run | Web Server Debug Validation** and make sure the
debugger is configured properly:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/d69fvs22t2waf8jxvszk.png)

6. And finally, start debugging:
 * Press the **Start Listening for PHP Debug** Connections:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8m4vcqthqn01jlrdwi3o.png)
 * Press the **Debug** button, or **Shift + F9**
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/07xhqotb86t3mvg7rgb3.png)


Happy Debugging!
Awesome hiring process
Tags: showdev, career
Published: 2019-09-15 19:07:17

---
title: Awesome hiring process
published: true
tags: [showdev, career]
description: "The current recruiting process in IT is a mess. It doesn't have to be that way"
cover_image: https://thepracticaldev.s3.amazonaws.com/i/p9p8i5gszwwoqtd9p0qi.jpg
---

**The current recruiting process in IT is a mess.**

There is no standardized definition of positions. The same position in different companies can assume two different skill sets.

There is no single approach to the hiring process, so each time this is a surprise for the candidate. All ask different questions from "dog or cat" to "rebalance red-black tree on the whiteboard".

Because the hiring process is so chaotic often happens that decision is random or biased. Often there is no feedback, so no hope for improving the situation.

Recruiters struggle to understand if a person is a good fit for the position, for the team. The risk for them is that one bad hire can "destroy" the team. It is easy to hire someone and harder to fire.

Applicants struggle because the interview is a stressful process. And often they don't get an explanation of why they were rejected.

Both sides lose a lot of time.

**It doesn't have to be that way. In my opinion, the hiring process is about finding a match.** The company wants to find the person who will fit into the team and will get the job done. The applicant wants to find a good team and place where they will get compensated for the work.

There are a lot of good people. There are a lot of good companies. Can't we make it easier for everybody?

**Note**: There are bad actors e.g. people who don't care about their job or team (toxic people) or companies who don't care about their workers and simply want to extract as much as possible value and don't want to build a healthy relationship. I'm talking about the ideal situation. Can we improve the process for good actors?

## The project

I started the "awesome" list to collect links about the hiring process. Please help by sharing your links and ideas.

{% github stereobooster/awesome-hiring-process %}

> Photo by Clem Onojeghuo on Unsplash
Tweaking less(1) for JSON parsing
Tags: bash, linux, sysops
Published: 2019-09-15 16:59:51

I use `less` pretty frequently (and I'll bet [you do too](https://dev.to/ecologic/what-are-your-five-most-used-terminal-commands-1hmd)) because `less` can read your mind:

* Run it against a text file and it displays it neatly a-page-at-a-time. 
* Run it against a gzipped tarball and it displays an index of the files inside. 
* Run it against an RPM and it displays the file index and changelog.
* Run it against a flat JSON file and it displays:

<pre>
{"data":{"__schema":{"queryType":{"name":"Query"},"mutationType":{"name":"Mutation"},"subscriptionType":null,"types":
[{"kind":"SCALAR","name":"Boolean","description":"Represents `true` or `false` values.","fields":null,"inputFields":null,
"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"String","description":"Represents 
textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable 
text.","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"OBJECT",
"name":"Query","description":"The query root of GitHub's GraphQL interface.","fields":[{"name":"codeOfConduct",
"description":"Look up a code of conduct by its key","args":[{"name":"key","description":"The code of conduct's key",</pre>

...a wall of un-parsed JSON data. 

*Let's teach this faithful dog some new tricks with a shell script edit and a simple function.*


### less and flat JSON files

A really cool feature of the `less` utility is the shell script `lesspipe.sh` that substitutes input file *contents* with *output from a command* run on the input file, with rules selected based on that input file's extension. We can easily add another extension handler to the rules for ".json" files to replace raw data with the output of a `jq` run like this:

`*.json) jq . < "$1";  handle_exit_status $? ;;`

Now we can update our own `$LESSOPEN` by running `export LESSOPEN="||$HOME/lesspipe.sh %s"`


### less and streaming JSON

The trouble with tweaking `lesspipe.sh` is that it doesn't do anything for paging STDOUT, which is my usual workflow for exploring a REST or GraphQL endpoint. Rather than buffering potentially huge chunks of JSON and using a "big" tool to determine the file type, we can make a best-effort check by seeing if the first 2 characters are legal starts to a JSON document ('"', '[' or '{'). If STDOUT starts as legal JSON we will try feeding it to `jq | less` and just pushing it to `less` if `jq` chokes. This approach will cost us a few extra forks, but I think the simplicity is worth it.


```bash
function jqless() {
    if [[ -e "$1" ]]
    then
        /bin/less "$@"
    else
        read -u 0 -n2 X
        [[ $(echo "$X" | tr -d [:space:] | cut -c1,2 | egrep "\[|\"|{"{2}) ]] &&\
        (((echo -n "$X" && cat) | jq . | /bin/less ) || (echo -n "$X" && cat) | /bin/less ) ||\
        (echo -n "$X" && cat) | /bin/less
    fi
}
```
Five Pieces of Software I Install to Boost Dev Productivity
Tags: productivity
Published: 2019-09-15 19:00:45

As an iOS dev, whenever I get a new dev machine, I need Xcode, homebrew, rbenv (many iOS tools are written in ruby), and some kind of extra code editor (currently I use Sublime).

But, there are a few other things that I find really help me be productive.

### #1: RescueTime: https://www.rescuetime.com/

RescueTime monitors the time you use any app or website. Then, it categorizes your time based on what that app or site is usually used for (and is very customizable).

I monitor my own productivity to make sure I keep myself honest. This is because I think of [my dev machine as factory equipment](https://loufranco.com/blog/deep-work-for-programmers). If I find that a site is distracting, I add it to SelfControl (next tip) or to the hosts file directly (depending on how bad it is).

### #2: SelfControl: https://selfcontrolapp.com

This app temporarily blocks websites by editing the `/etc/hosts` file and reapplying the change if you reverse it. Of course, you could stop it if you want, but it's enough to augment your willpower.  What do I block? All social media, but also anything that I personally visit when I want to be coding.

Over time I just added many of these sites to my `/etc/hosts` file permanently.

I elaborated on [SelfControl on my personal blog](https://loufranco.com/blog/self-control).

### #3: Pastebot (or any clipboard manager): https://tapbots.com/pastebot/

The macOS ~~and Windows~~ ([thanks xz](https://dev.to/limxingzhi/comment/fc49)) clipboard only has one slot—if you copy twice, you lose the first one.  With a clipboard manager, you keep as many copied things as you want (and can easily manage, search, and paste from it.)

### #4: gitprompt / bash_completion (install via Homebrew): https://github.com/magicmonty/bash-git-prompt

I use git mostly from the command-line. These tools allow me to have a custom (informative) shell prompt that shows the git status/branch and completes common git commands.

### #5: imagemagick / gifsicle / ffmpeg (install via Homebrew)

I constantly need to convert, resize, or otherwise edit images. This allows me to script them rather than do what I need manually in an image editor. I also frequently post small animated GIFs of my work in Slack or in pull requests (for those that need a visual)—gifsicle/ffmpeg let me easily resize/resample them to keep their size down.

Honorable mentions: Keyboard Maestro, Gimp, Sourcetree

What do you use?
10 Satisfying CSS Animations for relaxation 💆
Tags: css, webdev, satisfying
Published: 2019-09-15 18:26:00

_Sometimes after a long, exhausting day it is enough to look at something beautiful. Therefore "satisfying" videos or pictures are very good. You can see in this article that this is also possible with CSS and JavaScript!_

---
###➡️ _[Update with more animations available (click)!](https://webdeasy.de/en/css-animations/?action=updated) 🚀_
---


Such satisfying animations are simply beautiful and soothing to look at. It's ingenious when you have a deeper use, like the first example as load animation. Just let yourself be surprised what the web has to offer.

__Some animations are interactive. Just hover over it and click on it with your mouse.__

_**Attention:** The single pens are not from me!_

#1. Oddly satisfying loading indicator (CSS only)
{% codepen https://codepen.io/eight/pen/LyrPXJ %}

#2. Oddly satisfying CSS Only animation
{% codepen https://codepen.io/eight/pen/MpeayB %}

#3. The Last Experience
{% codepen https://codepen.io/byteknight/pen/XeVBbb %}

#4. Campfire
{% codepen https://codepen.io/byteknight/pen/VMyBwb %}

#5. Growing pastel dots
{% codepen https://codepen.io/rachsmith/pen/eNgvvx %}

#6. Rainbow lines
{% codepen https://codepen.io/byteknight/pen/eGyKXw %}

#7. Mesmerizing
{% codepen https://codepen.io/xposedbones/pen/aOrQVy %}

#8. Animation Test
{% codepen https://codepen.io/xposedbones/pen/VgrmpE %}

#9. Musical background on mousemove
{% codepen https://codepen.io/byteknight/pen/GMyGeM %}

I hope the animations have calmed you down a bit or have partially fascinated and motivated you for new projects. Creative phases are important for us and we should take our time every day to switch something off. 💆

Thanks for reading! If you liked this article, please let me know and share it! If you want to you can check out [my blog](https://webdeasy.de/) and follow me on [twitter](https://twitter.com/WebDEasy/)! 😊
Who are some good techies to follow on Twitter for cool/fun(ny) stuff?
Tags: watercooler, discuss
Published: 2019-09-15 17:06:50

---
title: Who are some good techies to follow on Twitter for cool/fun(ny) stuff?
published: true
description: 
tags: watercooler, discussion
---

I believe I follow a fairly diverse group of people on Twitter. That way, it helps me understand the perspective of different people in the community. But lately I've felt like twitter has only been showing me what's bad and unjust.

So I'd like to follow some people who regularly post cool or funny stuff, to brighten up my twitter feed a little.


Some examples:

Cassidy Williams posts these wonderful little videos every once in a while:
{% twitter 1172570005986086913 %}

Julia Evans makes these explanatory cartoons that teach me new stuff in a quick, visual way:
{% twitter 1172872684327383040 %}
JAVASCRIPT STRENGTH
Tags: javascript, node
Published: 2019-09-15 17:40:31


Like every programming languages, Javascript also has its own strength and weakness. In my previous blog, I have written about the [failures of Javascript](http://rsagames.com/blog/2019/09/12/javascript-issues/) and it is true. In this blog, I am going to discuss Javascript advantages.

Javascript is the platform for all the client-side languages. Now it is used in the server-side also with Node.js tools.

Javascript does not make any load to the server since it is running in client-side, it will validate the inputs before it reaches the server and block if it’s not valid input. [XMLHttpRequest](https://javascript.info/xmlhttprequest) is a raw browser object to make the Http request from the browser, later it wraps up by JQuery and made the code simple and reliable.

Basic Javascript language is simple and easy to learn. But, to learn Advanced Javascript, we should know some knowledge about the basic Javascript.

Some of the Javascript Advantages are as follows below,

Interoperability
Since Javascript can play nicely with other languages like [PHP](https://www.php.net/manual/en/intro-whatis.php), [Asp.Net](https://dotnet.microsoft.com/apps/aspnet), etc.., most of the applications are using Javascript for their client-side validations.

Browser Support
Since Javascript is a base for all the modern tools and frameworks, it does support by all the modern browsers. Some of the extended functions wrap with Javascript functions in other tools or frameworks are having cross-browser compatibility issues.

Javascript Applications
Nowadays, we can use the node.js as server-side and Javascript as client-side to make the Javascript applications. It will be the lightest weighted application compared to the other language applications.

This blog was posted by RSA Games and you can refer the [original post here](http://rsagames.com/blog/2019/09/14/javascript-strength/) at http://rsagames.com
Flutter Challenge #2 - Perspective Animation
Tags: flutter, ui
Published: 2019-09-15 17:10:05

# Who am I?
My name is Fawaz Joseph. I am mainly a Java developer who came across Flutter and fell in love. I am still learning the ins and out of Flutter and I am documenting any challenges I come across for a couple of reasons.

1. To see if there is a better way to do it.
2. To make sure I know it since I will be at the mercy of strangers
3. To help people who are learning Flutter as well

# The Challenge
The current challenge is [Social Share](https://uimovement.com/design/social-share-7/)
![Challenge.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1568566024855/tSV3d1YsB.png)

This is my first attempt at perspective animation and It was a blast. I learned a lot about  [Matrix4](https://api.flutter.dev/flutter/vector_math_64/Matrix4-class.html) and the  [Transform ](https://api.flutter.dev/flutter/widgets/Transform-class.html) class. I am also trying out a new format for my videos where I explain a finished codebase instead of coding it from the start

Without further ado:

{% youtube BxUY9qp8Yh4 %}

Look out for more stuff from me
 [Twitch stream ](https://www.twitch.tv/alaomo) - Where I practice the challenges
 [Flutter Newsletter ](https://us3.campaign-archive.com/home/?u=567cd5f2715594b7486f9baf4&id=65622bdb17) - Weekly Roundups of Interesting Flutter news, articles, videos, e.t.c
 [YouTube Channel ](https://www.youtube.com/channel/UCLbzxvsvm9ROJwmAzMtWNGg) - Flutter Challenges
What's the RxJs/ NgRx code bit that you are most proud of? (Round 2)
Tags: discuss, rxjs, angular, react
Published: 2019-09-15 15:43:47

---
title: What's the RxJs/ NgRx code bit that you are most proud of? (Round 2)
published: true
description:  Share your rxjs/ngrx knowledge!
tags: discuss, rxjs, angular, react
cover_image: https://thepracticaldev.s3.amazonaws.com/i/hh13r3flom2tb1veisw6.jpg
---

I love RxJs! It allows you to do powerful stuff in just a couple lines of code, which can feel like solving a very complicated puzzle. 

**What is the RxJs bit you implemented that you are most proud of?**

So ideally I'd like this post to develop into a little collection [like this one](https://www.learnrxjs.io/recipes/) but only for the shorter bits of fun, because let's face it: How often does your boss want you to make a flappy birds clone? Mine never asked (thanks for nothing, boss!). This is probably a bit to much to hope, but I'm an optimist (sometimes)!

Note: I [tried this before](https://dev.to/johannesjo/what-s-the-rxjs-ngrx-code-bit-you-are-most-proud-of-97c), but to no avail. Probably used the wrong tags. Please don't hate me for trying again!
What should a good technical CV include?
Tags: career, help, cv, development
Published: 2019-09-15 14:54:34

Hello fellow developers!

I've created an HTML version of my CV, based on some information I have on LinkedIn. However, while making this, I couldn't really come up with more things to add than:
- my name
- my current job title
- email
- link to my portfolio
- my past jobs
- education
- my skills

Is there anything you miss that you think should be added to this? And specifically, is there anything you're missing on my CV as a developer?

Thank you for your time in advance!

Link to my CV in case you want a visual reference: [my CV](https://roelofjanelsinga.com/resume)
What's your college drop out story?
Tags: discuss, college, degree, education
Published: 2019-09-15 14:44:32

---
title: What's your college drop out story?
published: true
description: 
tags: #discuss, #college, #degree, #education
---
I've been planning to drop out of college because I feel like it's wasting my time and I could do a whole lot better without college. But convincing my parents would be the hardest part.

What's your story? What struggles did you have and where you are now?
What would be the most useful giveaway I can give developers?
Tags: giveaway, developer
Published: 2019-09-15 13:17:22

Hi, I'm preparing a giveaway for developers that I meet in events and focus groups, and I was wondering what is the most useful thing that you would like to receive as a gift? Laptop stickers, Bluetooth speaker, Notebook, Webcam cover, Laptop sleeve, thermal bottle, T-shirt, etc ...
How did I learn this.reduce();
Published: 2019-09-15 12:38:42

Javascript is so amazing to learn. I learn few things on the fly to fix some error or try {} catch way (basically fail and understand better). One among them is `this.reduce();`.


`this.reduce()` takes array and gives back single value. Let's take an example

Before going further to understand about reduce, let's take a look at it's arguments. Reduce takes 4 arguments.

1. total //!req a + b, it returns either initial value or summed value
2. currentValue //!req value of the current element
3. currentIndex //!opt
4. arr //!opt array


Example with just number of arrays

```js
let arr = [1, 2, 3, 4, 5, 6];

let ans = arr.reduce( (a, b) => a + b ); // 21

```

Example with objects
```js
let movies = [{ title: 'Cars', part: '1', views: '400' },
              { title: 'Cars', part: '2', views: '300' },
              { title: 'Cars', part: '3', views: '100' },
              { title: 'Planes', part: '1', views: '800' },
              { title: 'Planes', part: '2', views: '500' }];

let total = { cars: 0, planes: 0 };

let totalviewsmovies = movies.reduce( (a, b) => {
    total[b.title.toLowerCase()] += parseInt(b.views, 10);
});

console.log( total ); // { cars: 400, planes: 1300 }
```

Okay, there might be a question? How this is hard for you?. 

Answer: I didn't know this much detail of arguments and how it works until I recently got interviewed in some company.

Thanks to him!

Let me know what you think.
Show Dev: Top HN stories sorted by votes
Tags: showdev, sideprojects, productivity, javascript
Published: 2019-09-15 10:55:25

---
title: Show Dev: Top HN stories sorted by votes
published: true
description: Top 10 HN stories sorted by votes
tags: showdev, sideprojects, productivity, javascript
---

Hey devs

Just hacked a small project in a weekend.

https://srebalaji.github.io/top-hn/

Top-HN shows the top 10 HN stories sorted by votes. So if you got limited time to read quality articles, it is for you :) :)