teleren/devto huggingface dataset:
Evening Rust: Episode 9: Tron Gold!
Tags: video, coding, rust, competition
Published: 2018-02-03 08:04:53

---
title: "Evening Rust: Episode 9: Tron Gold!"
published: true
description: Our trong bot made it too gold!
tags: video, coding, rust, competition
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ng268eutp1rgijxxa3j9.png
---

{% youtube qtDL9vt5PhA %}

Fighting to get higher in Tron gold. We had something that worked okay, but then screwed it up. Watch to see what I blame it all on! :) 

Subscribe to my [Twitch Channel](https://www.twitch.tv/mortoray) to watch live.
How to involve internal QA team in Software Development Process without disrupting the Dev team process?
Tags: discuss, softwaredevelopment, qa
Published: 2018-02-03 07:37:57

---
title: How to involve internal QA team in Software Development Process without disrupting the Dev team process?
published: true
description: 
tags: #devdiscuss #softwaredevelopment #qa
---

Situation: So, we are now doing daily stand ups and did the first retrospecive after a long time. Each team member was asked to put out their Sads ☹️ and Glads 😊 for the past sprint. But because it was the first time in a long time, we came up with a really long list from since the beginning. But the most Sad that I think needs to be addressed first was:

<h2>The QA team feels their role is neglected<h2/>

Currently, we have three teams, i.e. devs, qa, implementors. QA team is supposed to be the bridge for the devs and implementors. QA files the feature requests and bugs found by them and implemetors. Devs deliver the updated version then QA performs tests and, if pass, releases to the implementors. What currently happens is that because of strict deadline, implementors are forced to use untested versions. I know. I know, sorry. But also, when the user discovers a bug, which is expected, the QA team takes the blame from the Project Manager. 🤢

<h2>What's the solution?<h2/>

It's obvious that our process flow needs to be reconstructed. So I'm thinking of taking the QA team as the internal QA with the devs which will comprise the whole R&D team. Devs and QA are to work closely together to deliver the software. QA are to perform integration and funtional testing before devs can merge their changes to master repository (we are using git, btw). But. But. But I am thinking, as a dev, what a setback! Now, I need code review and QA approval to complete my pull request. I know I said 'work closely together', but still. Maintaining a develop branch also looks like an option. But I think that's just putting the load somewhere else on someone else. I know there should be something we can do about this. Maybe a new process flow? Maybe just restricting the implementors to access the builds? Help. 🙏
How useful are documentation and examples in your own native language to you?
Tags: discuss, translation
Published: 2018-02-03 07:31:40

---
title: How useful are documentation and examples in your own native language to you?
published: true
tags: discuss, translation
---

Occasionally I consider writing an article in Dutch (my language) but then decide that I reach a larger audience when it is in English and "besides, every Dutch person speaks English, especially developers".

Do you prefer to read stuff in your own language? Does it add anything for you? Or is it the other way around  and do you prefer it in English because most of the terminology consists of English words anyway?

Enlighten me, please. Thanks.
Making the web great again
Tags: javascript, heavywebsites
Published: 2018-10-06 01:42:53

---
title: Making the web great again
published: true
tags: javascript, heavy websites
canonical_url: http://www.hpcoders.com.au/blog/?p=112
---

After a number of years getting increasingly frustrated at how slow websites were on my phone, I finally bit the bullet and **disabled Javascript**.

I mostly use my phone to read news websites/aggregator such as slashdot, which are text heavy. Javascript really only serves the useless function of serving ads, which I don’t read. I really only kept Javascript on because many sites do not work properly without it.

When I open up slashdot with Javascript disabled, I get the message:  
`
It looks like your browser doesn't support Javascript or it is disabled. Please use the desktop site instead.
`  
The link to the desktop site just takes you back to the same address, but in the web browser (using just the standard Android browser, as Chrome is rather heavy weight), there is the option “Desktop view”. Setting this now takes one to the desktop version of the Slashdot website. And apart from having to zoom in a bit to be able to read the text, load times are, well, blisteringly fast. Pages load in seconds, rather than minutes. And no more browser crashes. Bliss!!!!

So I’m going all retro, and reading the web like its 1996. And it is so much better!
Learn Vue Router Navigation Guards [VueJS]
Tags: javascript, vue, tutorial
Published: 2018-02-03 03:31:04

---
title: Learn Vue Router Navigation Guards [VueJS]
published: true
description: Navigation guards are a powerful way to hook into your application code. Video tutorial with codepen provided so you can follow along!
tags: javascript, vue, tutorial
cover_image: https://thepracticaldev.s3.amazonaws.com/i/d0d8j50hribyd8o5winr.png
---

> Subscribe to my YouTube channel for [more tutorials on working with VueJS and AdonisJS -- an MVC framework for NodeJS](https://www.youtube.com/channel/UCF5w1QdWroWOoxxXMgp88AQ?sub_confirmation=1)!

## Watch the Video + Fork the Pen


{% youtube mts37TpiScM %}

Check out the CodePen here:

{% codepen https://codepen.io/patrickodacre/pen/owjVNK %}

Navigation Guards are a very useful tool; they can help you to pull off some really complicated UI work.

## The Guards

Looking at the [documentation here](https://router.vuejs.org/en/advanced/navigation-guards.html), you see that Vue Router offers a series of guards:

### Global Guards
* beforeEach()
* afterEach()
* beforeResolve()

Found on the ‘router’ object.

### Per-Route Guard
* beforeEnter()

Found on each individual `route` definition object.

### In-Component Guards
* beforeRouteEnter()
* beforeRouteUpdate()
* beforeRouteLeave()

Placed on the individual component’s `option` object.

Each guard allows you to interject some work at specific points as you go from route to route.

To really get to know which to use in a given situation, it helps to understand the order of events when navigating to a given route:

## The Full Navigation Resolution Flow

* Navigation triggered
* Call leave guards in deactivated components
* Call global `beforeEach` guards
* Call beforeRouteUpdate guards in reused components (2.2+)
* Call beforeEnter in route configs
* Resolve async route components
* Call beforeRouteEnter in activated components
* Call global beforeResolve guards (2.5+)
* Navigation confirmed.
* Call global afterEach hooks.
* DOM updates triggered.
* Call callbacks passed to next in beforeRouteEnter guards with instantiated instances.

## Found this helpful?

Let me know if this has helped you! Post a comment below, and [**subscribe** to my YouTube channel](http://buildtolearn.io/youtube-dt) to make sure you don't miss my future tutorials on VueJS and NodeJS.
EC2にEthereumメインネットのparityノードを立てる
Tags: geth, parity, ethereum, blockchain
Published: 2018-02-03 03:08:42

---
title: EC2にEthereumメインネットのparityノードを立てる
published: true
description: 
tags: geth,parity,ethereum,Blockchain
---

AWSのEC2インスタンスにメインネットのparityのノード(light client mode)を構築して開発に使用する手順を記載する。
最短で構築するために意識は低くマネコンから作業。以下のビデオを参考にする。
- https://youtu.be/4ac5ZeTveSs


# インスタンスを立てる
ビデオを参考に以下の設定を行ったインスタンスを立てる。
- AMI: `Canonical, Ubuntu, 16.04 LTS, amd64 xenial image build on 2017-11-21`
- ポート解放: `8545`
- ストレージ容量確保: `20GB`


# parityをインストール
ビデオを参考にSSH接続してparityをインストール。
- `bash <(curl https://get.parity.io -kL)`

# parityを起動
ここはビデオと異なり、`--light`オプションを付加してlight client modeとする。
- `parity --jsonrpc-hosts all --jsonrpc-interface all --light`

# クライアントから接続して同期状態を確認
ビデオを参考にインスタンスのipを取得し、以下のようなスクリプト(`getBlockNumber.js`)を記載(`xx.xx.xx.xx`は取得したipに書き換え)

```javascript
W3 = require('web3')
web3 = new W3(new W3.providers.HttpProvider('http://xx.xx.xx.xx:8545'))
web3.eth.getBlockNumber().then(result => {console.log(result)})
```
- 実行

        node getBlockNumber.js

- 以下のようにブロックナンバーが出力されれば同期が成功し、進行している。

        308485

- 最新のブロックがいくつかは[ethstats](https://ethstats.net)をチェック。2018/02時点で500万ブロックくらい。
    - light client modeでも完全同期まで数日かかる。

# parityが途中で落ちる場合はデーモン化する
parityをlight client modeで動かしているとしばらく同期したあとで落ちる場合がある。
その場合はデーモン化すると良い。supervisorを使用してデーモン化する手順をまとめる。

1. supervisorをインストール
    
        sudo apt-get update
        sudo apt-get install supervisor
        sudo mkdir /var/log/supervisor/jobs    

1. 以下のような設定ファイルを `/etc/supervisor/conf.d/` 以下に`parity.conf`として配置。 
    
        [program:Parity]
        command=/usr/bin/parity --jsonrpc-hosts all --jsonrpc-interface all --light
        user=root
        autorestart=true
        stdout_logfile=/var/log/supervisor/jobs/parity.log
        stdout_logfile_maxbytes=1MB
        stdout_logfile_backups=5
        stdout_capture_maxbytes=1MB
        redirect_stderr=true

1. supervisorを起動
    
        sudo supervisord
        sudo supervisorctl start all

1. ログを確認しparityが同期を開始していればOK。
    
        tail -f /var/log/supervisor/jobs/parity.log

- 落ちても再度立ち上がる。
  ![](https://thepracticaldev.s3.amazonaws.com/i/t753n0ajfd5b0z4fv0s2.png)

- ちゃんとやるならsupervisor自体をサービス化しておく(割愛)。

# 備考
- Parity: `v1.9.0-beta`
- 2018/02現在、上記手順で最新のブロックまで同期できることを確認(数日かかる)。
- gethでも良いが、parityはまだ多少安定している印象。しかしフルノード(非light client mode)だと完全に同期するまで何週間も待つ場合がある。
- light client modeはまだ実験段階なので本番運用は要注意。
How to use multiple files in C++
Tags: beginners, cpp
Published: 2018-02-03 03:07:37

---
title: How to use multiple files in C++
published: true
description: Brief guide on how to utilize multiple files in a C++ Project
tags: beginners, cpp
---

When I was a newcomer to the C++ scene, I personally, had a fair bit of trouble trying to figure out how to keep classes separate from the main.cpp file.

So I figured I would pass my knowledge around on here to help others who are starting to learn C++ - we will use a "Person" class as an example.

Technically, you could use a single file to hold the generic "Main" class and the "Person" class - but that would make re-usability difficult to organize and understand. So it is generally a good example to keep classes as finely grained as possible, and by that, I mean a single class per file.

To give you an idea of what it would look like when you have both classes in the same file, turn your attention to the code below:

```C++
int main(int argc, char** argv) {
    std::cout << "Hello World" << std::endl;
}

class Person
{
private:
    std::string m_givenname;
    std::string m_familyname;

public:
    Person() {};
    ~Person() {};
    
};
```

With the way our code is set up above, we can only access the class inside this one file. Not to mention Visual Studio will throw up a few errors when you attempt to use classes this way. It is inevitable that larger C++ applications will grow to be more than one file, so creating classes that can be expanded easily will be very useful later on when creating more complex software.


There are two files that need to be created (which are simple to create if using Visual Studio), those are a Header file which holds all of the predefined function prototypes - which is similar to an initial planning of the functions names and their arguments; and a CPP file which holds the guts of the functions themselves.

Using our "Person" class as an example again, I will show examples of the files below:

"Person.h" (Header file)
```C++
#include <iostream>

class Person
{
private:
    std::string m_givenname;
    std::string m_familyname;

public:
    Person();    //Constructor prototype
    ~Person();   //Destructor prototype
};
```

"Person.cpp" (CPP File)
```C++
#include "Person.h"

Person::Person()
{
    
}

Person::~Person()
{
    
}
```

Now, with this configuration for a class - all you need to do when you wish to use the class is to include a (class name may differ in your situation) ```#include "Person.h"``` Then just proceed to create an instance the way you usually would.

This prevents the class files from being loaded on every single file the software works with, which will save time and system resources, as you decide when and where to use it.
I need to build an SSO solution for my company, which programming language should I use?
Tags: php, node, help, sso
Published: 2018-02-03 01:47:14

---
title: I need to build an SSO solution for my company, which programming language should I use?
published: true
description: 
tags: php, node, help, sso
---

I've been assigned to a new project at my company and they told me I have 100% freedom on the tech I can use to create a new SSO (Single Sign-On) solution for many websites that we manage. It's kind of a baby step towards building a pseudo social network with our websites.

My rationale here is that while I'm pretty familiarised with PHP and its whole stack (nginx, MariaDB, etc), I'm curious about the performance "risks" it has.

I'm currently looking for comparisons between NodeJS and PHP, specifically concurrency benchmarks, because we're expecting to have lots of traffic. I know some ways to handle this in PHP, but I'm not a NodeJS developer, this would be my first project.

I'm also aware that other languages such as Go can handle high amounts of concurrency easily, but I'm new on that front as well.

So what would you do? Code in the language you're familiar with, or take the high road and learn another one for the sake of the project's longevity and better performance?
Which Pi?
Tags: raspberrypi, javascript, node, discuss
Published: 2018-02-03 00:19:25

---
title: Which Pi?
published: true
canonical_url: https://www.iamdeveloper.com/posts/which-pi-43hf/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/tadmw01k5oxmpefz6np6.jpg
description: Need help deciding on a Pi brand/model.
tags: raspberrypi, javascript, node, discuss
---

Hey all. I'm looking at purchasing a Pi, but I'm honestly overwhelmed with [all the models](https://www.amazon.ca/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=pi). There's even "Orange Pi"s!

![](https://thepracticaldev.s3.amazonaws.com/i/xdb6wcxn99jdhflollrg.jpg)

I don't know what I want to do with it quite just yet, but will most likely program it in Node.

If anyone whose done work with a Pi has suggestions for a starter model, it'd be greatly appreciated.

Cover image courtesy of Flickr user [Ginger](https://www.flickr.com/photos/deepfriedkudzu/34339030392/in/photolist-STLugb-6SrEeC-5toss2-5n38vH-5mPF1e-5gdYwJ-5cCjeM-DVVPU-adDyMP-4UgQRL-adDuua-4E76i7-aiwjsd-6PcUSa-6t8PPo-qpajp-hSkn3-WhDTnm-fQuhdK-oStXSc-6jJemJ-c69gkw-2mknJP-41Pmu1-6SmN8P-kYcZh-zxgKr-cvFZbQ-73XzKX-VhkiC8-ouRjq4-9E7HtA-6Snpjg-vZUzb-W8u9kt-96PKyz-z642kB-5Rkgxz-9dtyu1-twi5w-8HBB5z-Ujqvo9-6Srs91-nvG8T-6SnNxk-8ARkk-bcUYW-5L9zSY-Wk3FWM-64N9G8)
Stop with the unhelpful loading spinners
Tags: ux, loaders, javascript
Published: 2018-03-08 23:09:59

---
title: Stop with the unhelpful loading spinners
published: true
tags: UX, loaders, javascript
canonical_url: https://samturrell.github.io/2018/02/03/contextual-loading-states/
---

I get a train to work every day and have recently renewed my season ticket for a new e-ticket directly on my phone. I no longer have to carry around a ticket wallet, I just flash my phone when needed. Very convenient. However, when the ticket man comes by I load up the TPExpress app, go to my tickets and BOOM, get hit with a loading spinner as the ticket man looms over me impatiently waiting. It usually loads for ~5 seconds - but why? What is it doing? The ticket can be used offline, what on earth is it checking for? And why does it take so long?

The problem here isn’t so much the wait. It’s the lack of feedback to the user of what’s going on. I see it a lot in apps and on websites that just hang on loading screens when you open them or when you perform some kind of action such as on a form or checkout process.

What I like to do is actually inform the user of what’s going on and avoid unhelpful loading spinners at all costs. This is especially handy for multi-step processes such as payment forms where you might have to:

1. reserve the items
2. create a user
3. create a new card
4. create a payment token with stripe
5. and finally send the payment request to the backend to handle

Each of these steps are an API call that take time to complete. If you simply show the same “loading” indicator for all of these steps, it just looks like your platform is extremely slow. The user isn’t aware of that multi step process. If these APIs are somewhat slow, a slightly impatient user might even exit out or refresh because they think it’s broken.

It something in that process fails, it’s also less indicative of _where_ it failed. You’ll thank yourself when you’re sent screenshots from QA/users with the specific text of the step it’s hanging on.

I’m not saying you have to tell the user exactly what’s happening at each step, but give some kind of indication to the user of why things are taking so long to load and that something is actually happening. Your process will feel a lot more responsive and users (me) will be a lot happier.
Will Progressive Web Apps overcome Native?
Tags: discuss, native, webdev, javascript
Published: 2018-02-02 21:52:38

---
title: "Will Progressive Web Apps overcome Native?"
published: true
description: We're reaching a boom of apps in app store's!
tags: #discuss #native #webdev #javascript
---

In my opinion, this discussion is about culture, have we already passed the time of downloading apps and being use to always search for new things on App Store or Google Play? For me, no.

I live in a "third world country", so when people here discover new things like Spotify for an example (no, Spotify isn't new here), they rather search Spotify at their device app store than go to spotify.com.

I think PWA (Progressive Web Apps) are much better, unfortunately we are not prepared for it, yet. We already have very good examples of PWA such as <a href="mobile.twitter.com">Twitter Lite</a> with very good devs working on it. Now that Apple is also working with PWA following Steve's speech almost 11 years ago:

{% youtube ZlE7dzoD6GA %}

Despite all that, I don't know how are we going to organize our apps inside the browser!

The question is, with PWA, will IOS and Android developer jobs die? We as consumers, must get ready for a new app Era where we don't download apps?

Some final considerations, this is my first article so I'm sorry about anything.

Please leave a comment below with your opinion!
Debugged
Tags: career
Published: 2018-02-02 20:52:10

---
title: Debugged
published: true
description: Just a typical day.
tags: career
canonical_url: https://listed.standardnotes.org/@mo/799/spinning
---

I’m feeling a little delirious today, after having fully exhausted myself the past two days hunting down a dreadful bug. The most dreadful of all bugs: mobile crashes that occur on launch. Fortunately, this was just a beta build, and it was detected quickly by early testers. But, I was absolutely bewildered. What could it possibly be? The crash reports showed nothing. The changes I made in all were inconsequential. So unaffecting, in fact, that I pushed them straight to master. What could possibly go wrong?

I spent the next few days agonizingly trying to reproduce this bug, but no matter what I tried, no matter how much I tortured the application to show any signs of weakness, it excelled. I was actually impressed. Of course, it’s all a front by the application, which knows it’s being observed, so puts on its best behavior.

This bug, I was certain, would be my last. My entire life flashed before me. What if I never figure this out? I know you say that every time, but for real this time. I began carrying a heavy and fearful state of mind, overly sensitive and prickly to every negative thought. During times like these, it’s best to avoid introspection. Your incisions will be harmful. I went home early, and seriously began asking myself, what am I going to do? I’ve done everything I could.

I decided, out of raw desperation, to just brute force it, by walking through every single new line of code and interrogating it. First, I needed to undo the biggest wrong of all, and redirect the new version commits from master into their own branch, so I can easily review the changes. I thought this would be a catastrophic task, but turned out to be as simple as `git branch 2.1, git reset HARD~12 (remove 12 commits), git checkout 2.1`

I went through every line, tweaking it around to see if making it behave at its worst would have any fatal repercussions. Almost nothing did. But then I found [it.](https://github.com/standardnotes/mobile/commit/7abb203d3411eac9efaa0bb3318413e75d2e2904#diff-b1b5f9e1e6b36c77a06281efea898661L102)

And really, that’s the end of the story. I’ll repeat this episode probably some time in the next few months. Each of these lucid nightmares instantly takes years off my lifespan, and propagates powerful seeds of negativity that, if not immediately severed, stand to contaminate your future. It’s a subtle, but beating effect.

---

_Originally published on [listed.standardnotes.org](https://listed.standardnotes.org/@mo)_