teleren/devto huggingface dataset:
sudo apt-get install htop
Tags: install, ubuntu, htop
Published: 2017-10-20 17:33:28

---
title: sudo apt-get install htop
published: published
description: Install "htop" on Ubuntu Server 16.04.3
tags: Install, Ubuntu, htop
---

```shell
 Fre 20 Okt - 19:27  ~ 
 @patrick  cd Vagrant/psnc 

 Fre 20 Okt - 19:27  ~/Vagrant/psnc 
 @patrick  vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.28 running --- OK.
==> default: Checking for guest additions in VM...
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /home/patrick/Vagrant/psnc
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

 Fre 20 Okt - 19:28  ~/Vagrant/psnc 
 @patrick  vagrant ssh
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-97-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
Last login: Thu Oct 19 21:23:51 2017 from 10.0.2.2
➜  ~ sudo apt-get install htop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  htop
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 76.4 kB of archives.
After this operation, 215 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 htop amd64 2.0.1-1ubuntu1 [76.4 kB]
Fetched 76.4 kB in 0s (107 kB/s)
Selecting previously unselected package htop.
(Reading database ... 155846 files and directories currently installed.)
Preparing to unpack .../htop_2.0.1-1ubuntu1_amd64.deb ...
Unpacking htop (2.0.1-1ubuntu1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up htop (2.0.1-1ubuntu1) ...
➜  ~ 
```
Languages/Skill sets for an eBook Reader App Embedded with a Store
Tags: opinion, beginners
Published: 2017-10-20 15:33:12

---
title: Languages/Skill sets for an eBook Reader App Embedded with a Store
published: true
description: opinions for languages/skill sets I need to have to develop an eBook Reader app
tags: opinion, beginner 
---

So I intend on embarking on a project to sharpen my programming skills. The project I intend on working on is an eBook Reader app that uses ePub files. The app would have a store/library of books and would allow the user to use it as an app for opening ePub files stored on their device.

I'm a little bit conversant with HTML, CSS and JavaScript. Learning PHP at the moment. What language/skill set/library out there would fasten this project?
Testing keychain in iOS 
Tags: keychain, xctest, testhost, swift
Published: 2017-10-20 10:24:25

---
title: Testing keychain in iOS 
published: true
description: 
tags: keychain, xctest, test host, swift
---

Original post https://github.com/onmyway133/blog/issues/92

Today I was upgrading [Keychain](https://github.com/hyperoslo/Keychains) to swift 4, and take this opportunity to fix the test. The tests pass on macOS, but on iOS, I get `-25300` error for

```swift
var status = SecItemCopyMatching(query as CFDictionary, nil)
```

It is because there is no Keychain entitlement for test target. But this is a framework, how can I add entitlement ðŸ¤” The solution is to use a [Test Host](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/05-running_tests.html) to host the `XCTest` tests. See my [pull request](https://github.com/hyperoslo/Keychains/pull/14)

**Create test host target**

![target](https://user-images.githubusercontent.com/2284279/31816541-059750f6-b591-11e7-9348-4119d07e57ca.png)

First create an iOS app to act as a test host

**Enable Keychain capability**

Then enable Keychain capability to let Xcode automatically create an entitlement file for you. Note that you can just enter the `Keychain group`. You don't need go to `Apple Developer dashboard` to configure anything 

![target](https://user-images.githubusercontent.com/2284279/31816588-37d10d14-b591-11e7-8703-2b4c77fd7c34.png)

**Specify Test Host**

Then in you test target, specify `Test Host` by using `$(BUILT_PRODUCTS_DIR)/TestHost_iOS.app/TestHost_iOS`

![test host](https://user-images.githubusercontent.com/2284279/31816646-68d8c7c6-b591-11e7-8ae8-e04d52e41e09.png)

Now run your test again, it should pass ðŸŽ‰
INTERNATIONAL BUSINESS
Tags: haquotes, internaional, business
Published: 2017-10-20 06:39:38

---
title: INTERNATIONAL BUSINESS
published: HAMZA ASHRAF
description: IMPORTANCE AND THREATS OF INTERNATIONAL BUSINESS
tags: #HAQUOTES #INTERNAIONAL #BUSINESS!!!
---

https://www.linkedin.com/pulse/international-business-hamza-ashraf/
What stack has the highest remote job postings/demand?
Tags: career, discuss
Published: 2017-10-20 05:52:28

---
title: What stack has the highest remote job postings/demand?
published: true

description: I'd really like to become a remote developer, a digital nomad.I am a java developer and I rarely see remote job postings with for Java stack. From the limited research I've done, it seems Ruby on Rails has the highest remote job postings. Anyone have any insight into this? 

tags: #career, discuss
---
Explain Cross Site Scripting(XSS) attacks like I'm Five
Tags: discuss, javascript, xss, explainlikeimfive
Published: 2017-10-20 03:19:07

---
title: Explain Cross Site Scripting(XSS) attacks like I'm Five
published: true
description: Please also mention how to prevent them, if possible.
tags: #discuss, #javascript, #XSS #explainlikeimfive
---
pip install --upgrade pip
Tags: install, ubuntu, pip, python
Published: 2017-10-19 22:14:04

---
title: pip install --upgrade pip
published: published
description: Upgrade "pip" on Ubuntu Server 16.04.3
tags: Install, Ubuntu, PIP, Python
---

```shell
pip install --upgrade pip
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 865kB/s 
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
```

```shell
~ pip -V
pip 9.0.1 from /home/vagrant/.local/lib/python2.7/site-packages (python 2.7)
```

```shell
  ~ python2
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
```

```
➜  ~ python3
Python 3.5.2 (default, Sep 14 2017, 22:51:06) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
```
Django Chat Room App
Tags: python, django, discuss, webdev
Published: 2017-10-19 21:26:11

---
title: Django Chat Room App
published: true
description: 
tags: python,django,discuss,WebDev
---
Can any one help me build a chat room app? Where People will be able to create chat rooms with their desired name and then invite people to chat there. guest and the host of the room should also have the independence of choosing their handles (names). I would prefer python django as I am learning it !! lets see how strong the community is at dev.to :P .


Actually I already found a source [django channels example](https://github.com/jacobian/channels-example) which he deployed on heroku (https://django-channels-example.herokuapp.com/) but god knows why I am having so much trouble with this while deploying locally. Sometimes the messages are not getting stored in the postgresql database resulting in no output in the chat room.
Do you ever find yourself mixing up syntax from other languages?
Tags: discuss
Published: 2017-10-19 20:12:12

---
title: Do you ever find yourself mixing up syntax from other languages?
published: true
description: 
tags: #discuss
---

As someone who started development with iOS i.e. Objective C and Swift, I am working full time as a web developer now and I find myself writing Swift in C# or C# in Javascript. Anyone ever do this?
On immutability and sanity
Tags: javascript, immutability, react
Published: 2017-10-19 18:23:28

---
title: On immutability and sanity
published: true
description: How ignoring the first almost made me lose the second. 
tags: javascript, immutability, react
cover_image: https://pre00.deviantart.net/1d68/th/pre/f/2012/194/1/7/homer_trace_by_deepfry3-d572uif.png
---

## Introduction

This is just a little article to share a problem I encountered. I was tasked with building a CRM and transactions had to be filtered by date. Nothing fancy about all this. You check if the transaction's date is between two other dates the user gives you ( a start date and an end one ).

## The code

Well, here is how the code looked before I managed to solve it. I was using React with this code. I used the popular javascript library *moment.js* to work with dates.

```javascript

renderTransactions(){
    return this.props.transactions.filter( transaction => {
        const start = moment(this.state.startDate)
        const end = moment(this.state.endDate)
        const tDate = moment(transaction.date)

        return tDate.isBetween(start, end) // Compare dates here
    })
    .map( ( transaction, i ) => {
        transaction.date = moment(transaction.date).format('DD/MM/YYYY')
        return (
            <tr key={i}>
                <td>{transaction.amount}</td>
                <td>{transaction.date}</td>
                <td>{transaction.client}</td>
            </tr>
    })
}

// etc.. etc...
```

Ok, can you see where the problem is? The first time the component renders, everything is fine, the dates are properly filtered. But, as soon as I modify the dates, nothing works anymore...

The problem was here:

`transaction.date = moment(transaction.date).format('DD/MM/YYYY')`

See how stupid that is? I *mutate* the state of my array with this line. On the next render, the *date* field is not longer a Date object that the moment library can work with, but a String...

## Solving it, and restoring my sanity...

#### Take one:

Don't use this.props directly. If I used a reference to this.props.transactions in my function, the problem wouldn't have happened. Every time the function would run, a fresh copy of this.props.transactions would be used. Even if I kept the problematic line with the direct mutation, it would work.

#### Take two:

**Immutability.** Don't mutate the state of your application directly. This line would have solved everything:

`const date = moment(transaction.date).format('DD/MM/YYYY')`

Done... Problem solved.

## Conclusion

I'm just writing this to make sure I don't make the same stupid mistake again. I spent way to much time on this... I'm tired and I hate programming.
What makes this site so quick?
Tags: discuss
Published: 2017-10-19 17:49:13

---
title: What makes this site so quick?
published: true
description: 
tags: discuss
---
I have been a frequent visitor of this site for more than a week now. And have to say I am amazed at how snappy this is. What is the secret? Could someone explain.

(I am sorry if this is a stupid question.)
Ultimate Visual Guide to Go Enums
Tags: go, programming, tutorial
Published: 2017-10-19 17:10:45

---
title: Ultimate Visual Guide to Go Enums
published: true
description: Go enums and iota — Full of tips and tricks with runnable code examples.
tags: go, golang, programming, tutorial
---

**Go enums and iota — Full of tips and tricks with runnable code examples.**

* What is an Enum?
* Why do we need enums?
* How can you imitate an enum in Go?
* Creating enum strings automatically
* How to use iota?
* Iota expressions rules with examples
* Iota insights

★ [Click here to read the article](https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3).

![](https://thepracticaldev.s3.amazonaws.com/i/maxotj4gzqbzvckkolhi.png)
Challenge: Write a program that never stops
Tags: discuss, java, python, javascript
Published: 2017-10-19 10:14:42

---
title: "Challenge: Write a program that never stops"
published: true
description: 
tags: discuss, java, python, javascript
---
Write an endless loop, write some confusing gotos...

The rules are simple: **Write a program that never stops.** Language: Any. Try to keep it short and confusing :D

Here is an example:

```Java
for(i=0; i<10; i++){
    for(j=0; i<10; j++){
        System.out.println("Blubb.");
    }
}
```

Post your funny, creative solutions below.
I am an EE student and I am learning to design ASIC. ASK ME ANYTHING!
Tags: ama
Published: 2017-10-19 09:49:40

---
title: I am an EE student and I am learning to design ASIC. ASK ME ANYTHING!
published: true
description: 
tags: ama
---

Hi,
I am just a student with almost no industrial or professional experience. I did an internship once, few group projects, tons of personal fun projects and that's about it.
Mostly I deal with the low-level abstractions starting from Gate-level up to device driver. Which means from designing silicon chips to firmware and driver.

The most noticeable thing in software I have done so far was to make Linux from scratch (not from a tutorial) and a few custom device drivers for an FPGA+ARM board called ZedBoard and fortunately wrote a [How-To](https://superuser.blog/pynq-linux-on-zedboard/).

I am not much of software person yet I know a little about software stuff. I do Python, JS webapps and a bunch of other stuff just for fun.

Yes, I am an unemployed expat student who does hardware for school and software for fun.

I was checking the ask me anything and there was no hardware person so I thought I should represent (at least standup?) for the hardware community.

Ask Me Anything :)
Sharing content from dev.to
Tags: meta, discuss
Published: 2017-10-19 08:01:14

---
title: "Sharing content from dev.to"
published: true
description: 
tags: #meta, discuss
---

Is there an option to share content? I really wanted to my friend on whatsapp. If no, is there a conscious reason behind it. We can leave it to the author the option. They can say shareable: true/false?
分布式事务
Tags: bytetcc
Published: 2017-10-19 06:41:36

---
title: åˆ†å¸ƒå¼äº‹åŠ¡
published: true
description: ä»‹ç» BASE åŽŸåˆ™ï¼ŒCP & APï¼ŒByteTCC æ¡†æž¶
tags: bytetcc
---

> eBay çš„ Dan Pritchard æå‡ºçš„ BASE åŽŸåˆ™ä¸Žä¼ ç»Ÿæ•°æ®åº“çš„ ACID æ„æ€ä¸åŒã€‚åœ¨ä¸åŒäº‹ä»¶å‘ç”Ÿæ—¶ï¼Œä¸šåŠ¡çŠ¶æ€å¯èƒ½åœ¨çŸ­æ—¶é—´å†…ä¸Žäº‹ä»¶ç»“æžœä¸ä¸€è‡´ã€‚

###BASE åŽŸåˆ™
* åŸºæœ¬å¯ç”¨ Basically Available
* è½¯çŠ¶æ€ Soft state
* æœ€ç»ˆä¸€è‡´ Eventually consistent

###CP vs AP
* å¼ºä¸€è‡´
* å¼±ä¸€è‡´/æœ€ç»ˆä¸€è‡´
* æœ¬åœ°äº‹åŠ¡ + å¼‚æ­¥æ¶ˆæ¯ + é‡è¯• + å¹‚ç­‰ => æœ€ç»ˆä¸€è‡´æ€§

###ByteTCC æ¡†æž¶
* æ”¯æŒ Spring å®¹å™¨çš„å£°æ˜Žå¼äº‹åŠ¡ç®¡ç†
* æ”¯æŒæ™®é€šäº‹åŠ¡ã€TCC äº‹åŠ¡ã€ä¸šåŠ¡è¡¥å¿åž‹äº‹åŠ¡ç­‰äº‹åŠ¡æœºåˆ¶
* æ”¯æŒå¤šæ•°æ®æºã€è·¨åº”ç”¨ã€è·¨æœåŠ¡å™¨ç­‰åˆ†å¸ƒå¼äº‹åŠ¡åœºæ™¯
* æ”¯æŒé•¿äº‹åŠ¡
* æ”¯æŒ dubbo æœåŠ¡æ¡†æž¶
* æ”¯æŒ spring cloud
* æä¾›æ¡†æž¶å±‚é¢çš„å¹‚ç­‰æ€§è§£å†³æ–¹æ¡ˆ

###äº‹ä»¶+æ¶ˆæ¯
ï¼ˆæ¥æºï¼š[è¿™é‡Œ](http://skaka.me/blog/2016/04/21/springcloud1/)ï¼‰
![åˆ†å¸ƒå¼äº‹åŠ¡äº‹ä»¶æ¶ˆæ¯](https://thepracticaldev.s3.amazonaws.com/i/q8hd0are69apv44v2gx2.png)
![åˆ†å¸ƒå¼äº‹åŠ¡2](https://thepracticaldev.s3.amazonaws.com/i/r3zuq1w3rh3pzexruifx.png)

###å‚è€ƒ
* [REST å¾®æœåŠ¡çš„åˆ†å¸ƒå¼äº‹åŠ¡å®žçŽ° - åˆ†å¸ƒå¼ç³»ç»Ÿã€äº‹åŠ¡ä»¥åŠ JTA ä»‹ç»](http://codin.im/2017/05/14/rest-micro-services-distributed-trasaction-1-jta/)
* [REST å¾®æœåŠ¡çš„åˆ†å¸ƒå¼äº‹åŠ¡å®žçŽ° - åŸºäºŽæ¶ˆæ¯ä¸­é—´ä»¶](http://codin.im/2017/05/28/rest-micro-services-distributed-trasaction-2-mq/)
* [Spring Cloud ç»¼åˆå®žæˆ˜ - åŸºäºŽ TCC è¡¥å¿æ¨¡å¼çš„åˆ†å¸ƒå¼äº‹åŠ¡](http://www.jianshu.com/p/cf3a2884a8d2)
Оптимизация PHP-FPM: Используем ‘pm static’ для максимальной производительности
Tags: php, performance, fpm, process
Published: 2018-01-27 03:06:11

---
title: "Оптимизация PHP-FPM: Используем ‘pm static’ для максимальной производительности"
published: true
tags: php, performance, fpm, process
canonical_url: http://phpprofi.ru/blogs/post/70
---

Давайте кратко рассмотрим, как лучше настроить PHP-FPM для высокой пропускной способности, низкой задержки и более стабильного использования процессора и памяти. В большинстве дефолтных настроек PHP-FPM&nbsp;есть строка с PM (process manager), установленным в `dynamic`, а также рекомендации по использованию&nbsp;`ondemand`, в том случае если вы столкнулись с проблемами доступной памяти. Однако, давайте взглянем в документацию на php.net и сравним оба варианта управления, а также сравним с моей любимой настройкой под высокую посещаемость... `pm = static`:

Читать далее: http://phpprofi.ru/blogs/post/70
How to make passive income when you are a developer
Tags: discuss
Published: 2017-10-19 02:40:33

---
title: How to make passive income when you are a developer
published: true
tags: discuss
---

![Photo by John Salzarulo on Unsplash](https://thepracticaldev.s3.amazonaws.com/i/wi27qolcoo3rwtc0cmbt.jpg) 
_Photo by John Salzarulo on Unsplash_


Same to you, I'm a developer, I wonder what other people do to make the passive income e.g., write the blog, selling something on the internet... But I really want to use my coding skills to do that, I'm happy to coding and I don't want to change my job just to make the passive income.

What do you think?
The Semi-Colon Error
Tags: coding, beginners
Published: 2017-10-19 01:59:39

---
title: The Semi-Colon Error
published: true
description: If you're going to write bugs, make them easy ones.
tags: coding, beginners
---

*This was originally posted on my personal blog, [here](https://vdubinatorcoder.blogspot.com/2017/06/the-semi-colon-error.html).*

Over the summer, I had the opportunity to work with a few of our summer interns. One day we were helping a coworker implement a story. We were coding, building, and testing in short cycles as we went. One time a build failed. After a few minutes of looking, we found that we'd omitted a semi-colon. We fixed it quickly and got back to work.

This experience and a few others like it caused one of the interns to ask what's the longest that I've spent on a simple error like that. Without thinking too much I'd responded that I've spent a few hours at least once on something so simple. While that seems quite ridiculous, especially to a new-comer, it's not out of the ordinary.

Over the years I've come to prefer simple, stupid mistakes like this. While they can be frustrating to find, they're easy to understand and fix. You find it, you fix it, and you're on your way. Simple. Easy. Quick. This is much preferred to some of the other problems you can fix as a software engineer.

The problems I don't like to encounter are problems with architecture, design, or dirty code. Admittedly these can sometimes be fun to fix, but they're much, much more difficult especially in a system that's been around for a number of years. These problems require a lot of digging, both in the code and with product owners and product managers. When you have a problem like this, not only do you have to find the problem, you have to understand why things are the way they are and derive a solution that both addresses the issue and meets existing needs.

Instead of finding an issue, almost mindlessly typing one character, and continuing on, you now have to find the issue, understand how everything works well enough to describe the issue, talk with a product owner and find out what the code is supposed to be doing, derive a solution, ensure that solution meets all the requirements and fixes the issue, then implement and test it. All-in-all, errors that are more complex than a missing or misplaced character cost a lot more and are a lot more involved.

So, if you're going to put errors and mistakes in your code, try to make them simple and easy. Take the necessary time up front and as you go to make your design right and the errors and bugs you see will be a lot easier and less costly to fix.
Feature or bug
Tags: javascript, angular, discuss
Published: 2017-10-18 21:25:23

---
title: Feature or bug
published: True
description: 
tags: javascript,angular,discuss
---
Hello,
today at work I had a strange situation with javascript. I had two input fields with a checkbox type, and both have an attribute ng-change with a different method.One method is called only when checkbox is checked, while the other method calls for each change of check box.

Has anyone had similar experiences? ☺
It takes time to make a team...
Tags: team, teamwork
Published: 2017-10-18 20:37:38

---
title: It takes time to make a team...
published: true
description: About team building
tags: team, teamwork
cover_image: https://thepracticaldev.s3.amazonaws.com/i/v38lx7hu8om252mwoy78.jpg
---
##Building a team

I went sailing some time ago. For years I used to sail minimum once a year with a group of my friends. But as we got older and built our own lives it became harder to get a group together.

So this year I decided to join another crew. It wasn’t just me thinking that away so we ended up on a boat without knowing each other. Group of total strangers that never met each other before. The only thing we knew about each other was that we all sail. But our skills, sailing knowledge, habits and expectations were completely different. We didn’t know what to expect, what position to take and what responsibilities. Every task was a struggle. The first day was too long and tedious.

It took few days for us to form somehow organized crew. As we got to know each other we started to appreciate and understand other participants. We started to trust. But at first, it was a total disaster.

It’s similar in whenever the team has to form. Also so it is in software development.

##Stages of forming the team

A new team doesn’t perform well when it first comes together. Forming a software team takes time. And there are four noticeable stages of that development process: forming, storming, norming and performing were identified by Bruce Tuckman in 1965. Adjourning, a fifth stage, was added by Tuckman about ten years later.

I'm not going to describe those stages here (this time), but if you're interested you can go on and check the rest of the post on my [blog.](https://jumpstart.blog/2017/10/18/it-takes-time-to-make-a-team/)
Languages Wall, Hello World!
Tags: creative, art, languages, discuss
Published: 2017-10-18 19:09:51

---
title: Languages Wall, Hello World!
published: true
description: A wall using kanban style, in which I keep track of the languages I want to learn and learned.
tags: creative, art, languages, discussion
---

I just wanted to share something I created today, in order to **keep track of the programming languages** I'm interested to learn. The use is simple, there's a part for programming languages **I want to learn** and **learned**, and I use post-its to change languages from one part to another. This way I can keep active in programming learning and remember it every day!

![](https://pbs.twimg.com/media/DMcUICdW0AAqZZ8.jpg)

Do you guys like it? Which other creative ways do you guys have for your developer lifestyle?