teleren/devto huggingface dataset:
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2018-05-07 15:52:26

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

#1. Hey uh, you got a sec?

Programmers are adverse to interruptions, but aren't we all? Suggestions on how to improve your resilience to interruptions. 

{% link https://dev.to/_bigblind/are-interruptions-really-worse-for-programmers-than-for-other-knowledge-workers-2ij9 %}
 
#2. We're the elitist of elite!

Even top performers are bound to mess up 22% of the time. Amanda reports on the deeply rooted problems with the technical interviewing process. She analyzes the cost of traditional interviews and also takes a look at alternative methods. 


{% link https://dev.to/amandasopkin/are-technical-interviews-a-good-measure-of-software-engineering-ability-1cp9 %}

#3. Frequently Asked Questions

From picking to work at a startup or corporation to understanding how developers are 'ranked', Ivan responds to the questions he had when he first started his career in programming. 

{% link https://dev.to/ivancrneto/what-id-like-to-hear-from-an-experienced-developer-when-i-was-a-beginner-438g %}

#4. No conflicts please 🙈

A guide to `git merge` -- from how to prepare for a merge to understanding three-ways, fast-forwards, and dealing with conflicts. 

{% link https://dev.to/neshaz/how-to-use-git-merge-the-correctway-25pd %}

#5. Great walkthrough 👌

Samuel helps us understand _what_ docker is, and then provides a step-by-step walkthrough of composing multi-container applications with docker-compose. This tutorial is for a laravel application that uses a MySQL database and Redis for caching.

{% link https://dev.to/abiodunjames/why-docker-creating-a-multi-container-application-with-docker--1gpb %}

#6. Is it art? or a lifestyle?

In this post, we learn about minimalism and different laws of UX (Fitt's, Hick's, Miller's, Jackobs's). 

{% link https://dev.to/oninross/the-art-of-minimalism-with-ux-4ppd %}

#7. What's the news today?

A tutorial on how to build a news app with Node.js & React Native. 

{% link https://dev.to/msal4/how-to-build-a-news-app-with-react-native-4ifd %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Angular 6 Release: What’s New?
Tags: javascript, angular, angular6, webdev
Published: 2018-05-07 15:46:53

---
title: Angular 6 Release: What’s New?
published: true
description: 
tags: #javascript #angular #angular6 #webdev
canonical_url: https://auth0.com/blog/whats-new-in-angular6/
---

Fresh out the oven is Angular 6. It brings some new features and enhancement to one of the most popular JavaScript frameworks for crafting mobile, desktop and web applications. 

[Learn what's new in Angular 🅰️🆕](https://auth0.com/blog/whats-new-in-angular6/?utm_source=dev&utm_medium=sc&utm_campaign=new_angular6)

![Angular 6 Release: What’s New?](https://thepracticaldev.s3.amazonaws.com/i/pp1e2143rw2vlvjqjqid.png)
OpenShift for Mere Mortals Part Two: Images
Tags: docker, openshift, containers, kubernetes
Published: 2018-05-07 15:10:28

---
title: OpenShift for Mere Mortals Part Two: Images
published: true
description: part two of the blog series on OpenShift
tags: docker, openshift, containers, kubernetes
cover_image: https://thepracticaldev.s3.amazonaws.com/i/407rjiu3x9beablbws5j.png
---

Just published part 2 of my blog series on OpenShift. This week focuses on container images:

https://vault.osninja.net/openshift-for-mere-mortals-part-two/
Looking at the stack trace for `ls`
Tags: unix, linux
Published: 2018-05-07 12:58:01

---
title: Looking at the stack trace for `ls`
published: true
tags: unix,linux
canonical_url: 
---

You know what Mondays mean. A new blog post!

I’m trying something new this week. Instead of writing my thrice-weekly blog posts on my commute to and from work, I’ll write all of them on a single day over the weekend.

Today, I’m going to be looking at a command that I previously looked at the codebase for, the `ls` command. To be honest, it feels like that happened so long ago I don’t even remember it. In any case, I hopped over to my Debian VM instance on Google Cloud and ran `strace` on the `ls` command in my home directory.

It starts off by running the `open` system call on the current working directory. It’s passing quite a few flags to the call. Some I already knew about and some I didn’t. Nonetheless, here’s a breakdown of what all those flags are doing.

1. `O_RDONLY`: Open the file for reading only. No file modifications allowed!
2. `O_NONBLOCK`: Return from the `open` call without any delay.
3. `O_DIRECTORY`: Open a directory with the intent of examining its contents.
4. `O_CLOEXEC`: Automatically close the file descriptor when the current process being `exec`ed returns.

```
[pid 13721] open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
[pid 13721] fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

```

The next system call invoked is the `getdents` system call which, according to [the docs](https://linux.die.net/man/2/getdents), returns the contents of a directory.

```
[pid 13721] getdents(3, /* 13 entries */, 32768) = 400

```

The next couple of lines are invocations of the `lstat` function on each of the contents of the directory. This is used by `ls` to determine the size of the file and the owner and so on. This is the kind of information that you would see when you run `ls` with the `-l` flag.

```
[pid 13721] lstat("test-4.txt", {st_mode=S_IFREG|0644, st_size=13, ...}) = 0

```

The last two calls in the stack trace did mystify me a bit. The function makes _another_ call to the `getdents` system call. Why is it doing this? I tried to spot the differences between the two system calls. In the first one, the second parameter points to a list of 13 directory entry structs and the system call returns 400. In the second call listed below, the second parameter points to a list of 0 directory entry structs and returns 0. I figured that perhaps the invocation was made twice because there was some for-loop iterating until the `getdents` function returned 0.

```
[pid 13721] getdents(3, /* 0 entries */, 32768) = 0
[pid 13721] close(3)

```

The last line in the stack trace closes the file descriptor associated with the current directory that we are reading.

And with that, I close off this blog post! I know this blog post is short, but that’s because I’m preparing you for what’s coming later this week. It’s gonna be a doozy…
Casting and Converting between types
Tags: softwaredevelopment, c, cast, convert
Published: 2019-10-29 21:49:30

---
title: Casting and Converting between types
published: true
date: 2018-05-07 07:00:59 UTC
tags: SoftwareDevelopment,c#,cast,convert
canonical_url: https://www.funkysi1701.com/posts/casting-and-converting-between-types-4g3a
---

Recently I was asked how to convert a number to a string. Let’s look at a few ways of approaching this problem.

Most objects in c# have a method called ToString() which displays the string representation of that object. This is because of inheritance, all objects inherit from System.Object which defines ToString().

Int32 is a struct so it inherits from System.ValueType which also inherits from System.Object

so in code

int a = 9;  
string b = a.ToString();

Now let’s look at the reverse. However the reverse runs the risk of throwing an error, let’s look at why.

string b= “9”;  
string c =”a”;  
string d = “two”;

All are valid strings but only one can be converted to a number. Use the TryParse method to convert to a number.

int.TryParse(“9”, out int e);

TryParse will not throw an exception if the conversion fails, if it succeeds variable e will contain the result. Note an earlier version of c# required you to define the out parameter before using it with TryParse.

int.Parse exists to do the same thing however it will throw exceptions if a conversion is not possible. The same is true if you use Convert.ToInt32(“two”);

#### Casting

Casting is a way to explicitly telling the compiler that a type is actually another type and you are aware data loss will occur.

double x = 4.5;  
int y = (int)x;

However it is not possible to cast a string to a number format as a string can contain any character not just number characters.

The post [Casting and Converting between types](https://www.funkysi1701.com/2018/05/07/casting-and-converting-between-types/) appeared first on [Funky Si's Tech Talk](https://www.funkysi1701.com).
Testing tools to track my work activity
Tags: productivity, tracking
Published: 2018-05-07 15:01:30

---
title: Testing tools to track my work activity
published: true
tags: productivity, tracking
canonical_url: https://leonardofaria.net/2018/05/06/testing-tools-to-track-my-work-activity/
---

*[Original posted on my blog](https://leonardofaria.net/2018/05/06/testing-tools-to-track-my-work-activity/)*

For a few weeks I have been using two tools to map my work activity. Since my work involves [manager and maker modes](https://www.learningapprentice.com/maker-mode-manager-mode/), I am trying to figure out how much time I spent in each of them and possibly how to remove distractions. A co-worker recommended [RescueTime](https://www.rescuetime.com/ref/1808210) and [WakaTime](https://wakatime.com/i/cbdf18ed-26ac-43b6-936c-d006efa2bec0) and here are my comments.

### RescueTime

RescueTime home page says _“With so many distractions and possibilities in your digital life, it’s easy to get scattered”_ – yes, I know – and _“RescueTime helps you understand your daily habits so you can focus and be more productive”_. Yes, they really helped me understand my daily habits.  
  
I am using the Lite version of the app. Every week I get an email like the image below:

[![](https://leonardofaria.net/wp-content/uploads/2018/05/rescuetime-1024x854.jpg)](https://www.rescuetime.com/ref/1808210)

This email _per si_ gives me a lot of detailed information. You can schedule when the app tracks your activity – in my case is between 8AM and 6PM, which gives me good coverage of my routine. After a few weeks, you unlock new reports, analyzing communication and most productive vs less productive days.

[![](https://leonardofaria.net/wp-content/uploads/2018/05/rescuetime-report-1024x508.png)](https://www.rescuetime.com/ref/1808210)

We never know how much time we spend on Slack and similar apps. Now we know the exact impact of these tools in our routines.

### WakaTime

While RescueTime tracks your apps and websites, WakaTime tracks your code activity. You install a plugin in your favourite editor and done! After a while you will receive weekly emails and your data will be organized in a nice dashboard per date/time, project, language, editor and even OS.

[![](https://leonardofaria.net/wp-content/uploads/2018/05/wakatime-1024x885.jpg)](https://wakatime.com/i/cbdf18ed-26ac-43b6-936c-d006efa2bec0)

I have no information here to change my work but at least it is interesting to see how I spend my time coding.

*Note: This is a not paid post and I am not affiliate to any of the tools described here but both links have referral information. They won't make me rich but they will give me free service from the tools of the post.*
Pusher Project - Why I'll Never Be Devops
Tags: pushercontest, inprogress
Published: 2018-05-06 23:33:05

---
title: Pusher Project - Why I'll Never Be Devops
published: true
description: Pusher works out of the box. AWS... not so much 
tags: pushercontest, inprogress
---

We are now 12 hours into Sunday. The last day before the work week restarts. The last day of finals week at my university. Also, the day of my city's massive marathon (of which I live near the main drag... silly loud healthy people).

And what have I doing? Cursing out AWS. **Repeatedly.**

My workflow when it comes to AWS is that if something doesn't work, I nuke it and try again. So I've nuked my AWS resources about... 4 times today. This is what I have now:

![Blank page with Pusher running](https://thepracticaldev.s3.amazonaws.com/i/or7j0rms75s13s91uq47.png)
*You know what this is? Progress*

***

I initially set up a CodeStar instance, which automagically sets up every part of the build pipeline and even will set a Github repo for you. Then I took on too much too fast and borked that build pipeline. Nuke, try again.

Second instance was trying to get environment variables set up properly. Broke that pipeline, nuke, try again.

Third instance was trying to set up a some of the Elasticbeanstalk project templates myself and try to build off that. Nope, nuked.

Fourth instance was taking that further by thinking I'd try actually understanding the CodeStar tech stack and manually make it all myself. That's terribly painful. Permissions, S3, pipeline, codebuild... yeah, no.

Fifth instance: back to the beginning. Took my default Node Lambda CodeStar fresh build, added Pusher's default JS they have in Getting Started, then tried to build it. Was a little fancy at first which failed, so I deleted that code and rebuilt. Looks like this works now! Though I had to set up this CodeStar repo as a private one since I can't yet figure out how environment variables work, and you all on the Internet aren't getting my secret.

***

## Cost Breakdown thus far

* Domain name (not used yet) - $12/yr
* Python Dev Humblebundle so I could get a cheap egghead.io license for their AWS videos - $20
* AWS student perks and free tier stuff - Free!
* Pusher default sandbox tier - Free!
* My entire Sunday - priceless (not really -- I would have been doing chores or Fallout 4)

***

## Stuff still to do

* An entire front end. It's a blank page.
* Pretty much an entire back end

## Stuff not left to do
* A deployment stack!
* Pick a name for the app -- I told my boyfriend that it was a shop where you sell emojis so he named it **Shopoji**.

## Nice to haves
* Figure out how to pass in info like the secret key at build time so I can open source again
* Get the DNS settings right to use my domain name
* Actually read and watch the stuff I bought for Python just to get that egghead.io key

*** 

Previous posts

{% link https://dev.to/itsasine/pusher-shopkeep-game---initial-idea-36po %}
Computer Security Algorithms package in csharp
Tags: security, computerscience, showdev, csharp
Published: 2018-05-06 22:39:29

---
title: Computer Security Algorithms package in csharp 
published: true
description: Computer Security algorithms in Csharp
tags: security, computerscience, showdev, csharp
---

Hello everyone, In this year of college we created a package of some computer security algorithms, I delivered it to my TA, so it's mine and public today and the degrees won't updated anymore :D, so if you're interested and have time you can contribute to it, add more security algorithms, update existing, practise using c#, add README.md files explains this algorithms etc...

[This is the GitHub of the repository](https://github.com/zeyadetman/Computer-Security-algorithms).

HappyCoding
What hobby/skill do you wish you pursued more regularly?
Tags: discuss, hobbies, music
Published: 2018-05-06 18:41:44

---
title: What hobby/skill do you wish you pursued more regularly?
published: true
tags: discuss, hobbies, music
description: What activity deserves more time than you can give it?
---

Today I played my upright bass for the first time in a couple years. I'm always pleased to get it out and find that my skill on it isn't completely gone, but I'm always bummed that I don't get to give it the time that it deserves.

What skill/hobby do you always wish you were pursuing more regularly?

(My honorable mention: building guitar effects)
How do you encourage clients or employers to open source?
Tags: opensource, business, discuss
Published: 2018-05-06 18:26:56

---
title: How do you encourage clients or employers to open source?
published: true
description: The business benefits of OSS
tags: oss, business, discuss
---

I just got a new job building an MVP for a small startup. We're building an interactive web-based app to be used in K-12 education - something that is fun and engaging for students, and helpful for educators to build in lesson plans and view their students' engagement.

As a developer, I'd like it to be open-source. I don't expect that it's a project that the community would be contributing to - as our use case is somewhat specific - but, I'd like to be able to keep a public journal of my experience working on the project, and allow others to see how I am approaching problems with a production-scale app. [Spectrum](https://spectrum.chat) recently [open-sourced their platform](https://github.com/withspectrum/spectrum) and looking through it has been illuminating.

In short: I couldn't be where I am now without learning from open source software, and I'd like to find ways to share what I have learned in the context of a "real" production app.

I think many business owners would err on the side of closed source, the most obvious reason being that they wouldn't want to provide any benefits for competitors.

🤔**Has your business or the business of your client benefitted from open-source?**

🤔**Have you had this kind of conversation with your client or employer?**

🤔**If you've thought about this for your business, what went into your decision making, and which route did you take?**
Tell me a story I could code
Tags: story, code, rust, discuss
Published: 2018-05-06 17:57:21

---
title: Tell me a story I could code
published: true
description: A code of which you are the hero
tags: Story, code, rust, discuss
---
*Originally post on my [blog](https://www.mathieu-nivoliez.com/posts/2018-05-06-tell-me-a-story-i-could-code)*

Hello everyone! Today one colleague and friend of mine, Gaetan, would like to propose you a simple (or not) concept!

It's a code of which you are the story teller!

## "Whaaaaat?"
![whaaaaat](http://i0.kym-cdn.com/photos/images/newsfeed/000/768/057/7e2.gif)

Let me explain! We propose you to tell a story (a little one), sentence by sentence. Each time a sentences is selected, we will try to express the story into code.

An exemple is worth 1000 speech so here is the start of our story:

### "Once upon a time, a young knight name Bob found a penny!"

```rust
#[derive(Debug)]
struct Story {
    pub time: &'static str,
    pub main_character: Character,
}

#[derive(Debug)]
struct Character {
    pub name: &'static str,
    pub money: i32,
}

fn found_a_strange_penny(character: &mut Character) {
    character.money += 1;
    println!("Oh a penny! \" said {}.\"", character.name);
}

fn main() {
    let mut story = Story {
        time: "Once upon a time",
        main_character: Character {
            name: "Bob",
            money: 0,
        },
    };

    found_a_strange_penny(&mut story.main_character);
}
```
All the code will live in this [repository](https://gitlab.deep-nope.me/mnivoliez/tell-me-story-i-could-code).

So, it's up to you, reader, to continue the story.
Post a comment with one sentence or two and we will try to code that.
We will choose the comment that appeal us the most!

Start :p

--
Gaetan and Mathieu
Singapore 🇸🇬
Tags: cdn, pop, edge
Published: 2018-05-06 17:04:32

---
title: Singapore 🇸🇬
published: true
description: Second CDN PoP edge server
tags: cdn, pop, edge
---

The second [Commons Host](https://commons.host) point of presence (PoP) launched this weekend. This is an important milestone in realising the *Network* aspect of a *Content Delivery Network* (CDN).

This new PoP is the first live deployment of a [Little Lamb Mk I](https://dev.to/commonshost/little-lamb-mk-i-5gf3) server.

![Two Little Lambs](https://thepracticaldev.s3.amazonaws.com/i/55e0wjq6sfamzqe7s4tg.jpg)
<center>Photo: [Ben (seabirdnz)](https://www.flickr.com/photos/seabirdnz/15509455436)</center>

The second Commons Host PoP, like the first, is hosted on a residential fibre Internet connection in Singapore. Both servers are part of the same *pool*. Traffic is balanced within a pool according to the capacity of each server. For upcoming deployments in other locations new pools can be created per country, city, ISP, and more.

Automatic failover provides improved availability of the overall static hosting & CDN service. All PoPs are continuously monitored and automatically taken out of the pool while they are unavailable.
100 Days of Code, Part 1
Tags: coding
Published: 2018-10-17 18:49:32

---
title: 100 Days of Code, Part 1
published: true
tags: #coding
canonical_url: https://distort-roving.blogspot.com/2018/05/100-days-of-code-part-1.html
---

 [![](https://www.businessinsider.in/thumb/msid-21061818,width-640,resizemode-4/Besides-showcasing-coding-talent-the-Flatiron-School-laid-out-delicious-snacks-at-the-job-fair-.jpg?356728)](https://www.businessinsider.in/thumb/msid-21061818,width-640,resizemode-4/Besides-showcasing-coding-talent-the-Flatiron-School-laid-out-delicious-snacks-at-the-job-fair-.jpg?356728) 
 _Image courtesy Business Insider - Flat Iron Schools India_ 

Setting short-term goals is how a Sandwich lives: something that we can fit into the myriad of interruptions that are our days. Some of them are tasks - empty one rack of dishwasher, check for issues, then continue. Others are more important.  
  
Planning time to fill out an application can be the most difficult thing. I love the ones where it says "Submit a resume and cover letter." I can **do**  this: if it takes me seven or eight attempts to write a letter, they need not know.  
  
But, often times the goals have a larger purpose - I'm currently doing the 100 Days Of Code, as a goal to both make sure I move forward daily with getting a job, as well as completing classes and a couple of projects. I will try and share some of my thoughts on it as I go.  
  
As a part of 100 Days, I'm using Twitter more (if you use Twitter, change your password!) There is a marvelous supportive group there, and a lot of sharing. I have spoken to many of the people in less than 200 words, and shared their accomplishments. And had the delight of getting the same back.  
  
Okay, so the 100 Days is supposed to let you get the habit of working on something every day, even if it's just for a few minutes. So, I failed at that - I'm using it to get things done. This seems to be that larger failing in the world of code, at the moment.  
  
My mentor, great man that he is, is giving me huge amounts of the encouragement and support I feel I need, and the ones that I speak to on Twitter and elsewhere are also encouraging, and share thoughts and ideas (and code reviews) that help so much. Thanks to them, I have moved to a more-productive mindset, when I get the chance.
Squid Linux Proxy Server
Tags: linux, beginners
Published: 2018-05-06 11:49:59

---
title: Squid Linux Proxy Server
published: true
description: 
tags: #linux #beginners
---

1 Install squid
2 Allow IP Address Range
3 Allow Specific Ports
4 Authenticating Users
5 Block Websites
6 Modify Content
7 Anonymous Browsing
8 Connecting Squid Servers
9 Squid Log Files

https://likegeeks.com/linux-proxy-server/

Hope you like it.
Regards,