teleren/devto huggingface dataset:
Does anyone else feel bothered when people term us as coders instead of developers or programmers..?
Tags: discuss
Published: 2018-06-17 18:13:06

---
title: Does anyone else feel bothered when people term us as coders instead of developers or programmers..?

published: true
tags: discuss
---
Should i be concerned about what people think about my job ? Because i think ' a coder ' and ' a developer ' sound a lot different .

I have seen the overuse of the word coder recently in a series called 'Silicon Valley' and was intimidated by them.
Do You Know Mental Models in IT?
Tags: ledger, finance, banks
Published: 2018-06-17 16:29:04

---
title: Do You Know Mental Models in IT?
published: true
description: 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/6r3fd7ao2w67tdrbcvpw.jpg
tags: ledger, finance, banks
---
It's been 17 years since I started working in my 1st real job. It was in a bank and it was introduction week. There were 50 other students in the same situation as I and we were all sitting in an awe inspiring room full of ornaments. We were waiting for the next speaker. An elderly man entered the stage. The experience of decades could be seen in the wrinkles in his face. And I will never forget what he told us:

> No matter what kind of business department you will work in, always remember that it's all about ledgers.

So this old banker's mental model was the ledger. Actually he was using the [T account representation](https://www.accountingtools.com/articles/what-is-a-t-account.html) of a ledger in his presentation. And he explained, that no matter what kind of financial business he was working on, he always transferred it on ledgers in his mind. Retail credit, cash transfer, trade finance, lending, money market, funding, ... you name it. By applying all problems on ledgers he could easily understand the business of each and every department in the bank.

# Are there Mental Models in IT?

After reading [James Clear's article about mental models (and Richard Feynman)](https://jamesclear.com/feynman-mental-models) I asked myself what mental models we have in IT. What abstractions can we use to reason about any kind of problem we're confronted with? Whenever I reason about a new system I instantly think about its data modelling, so I guess these 2 might qualify as mental models in IT:

- Entity Relationships (ER)
- Object Oriented Programming (OOP)

Are design patterns a mental model? I don't think so. Each pattern suits a special problem, so a pattern is by far not generic enough to work as a mental model. And what about the sum of all patterns? No, I think trying to find patterns is just human behaviour.

What about Functional Programming (FP)? Since I'm not proficient in FP I don't know if it can work as a mental model. Does it?
What's a good light weight library to handle inputting text that also supports file uploads?
Tags: discuss, opensource
Published: 2018-06-17 14:43:04

---
title: What's a good light weight library to handle inputting text that also supports file uploads?
published: true
tags: discuss, opensource
---

What I'm really looking for is almost a clone of GitHub's issue comment box.

Key features are:

- Works in all major browsers (very important)
- Upload files by drag / drop, clicking a link, or pasting (very important)
- Icon support for common formatting (nice but not necessary)

Also for the file uploader, it's really important that it works similar to GitHub where after supplying the file, it will inject the markdown image syntax with the absolute URL to the uploaded file directly into the editor.

jQuery dependency would also be fine if it comes down to it.
Customize parsing and formatting of dates in Java 8
Tags: java, coding
Published: 2018-06-17 11:24:54

---
title: Customize parsing and formatting of dates in Java 8
published: true
tags: java, coding
---

In Germany, dates have the format dayOfMonth.month.year.
So the day of writing this article is: 17.06.2018

How do you deal with such custom date formats in Java, taking the new DateTime API of Java 8 into account?

Here's a complete listing that first turns a string into a `LocalDate`, then transforms it back to a string:

``` java
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class DateTimeParsing {
	public static void main(String[] args) {
		// Parse the date from string, to LocalDate
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
		LocalDate localDate = LocalDate.parse("17.06.2018", formatter);
		System.out.println("The date is (default formatting): " + localDate);
		
		// Turn a local date into a string
		String formattedDateString = localDate.format(formatter);
		System.out.println("The date is (formatted): " + formattedDateString);
	}
}
```
How to use zsh in VS Code for Mac
Tags: vscode, zsh, shell, mac
Published: 2018-06-17 11:03:42

---
title: How to use zsh in VS Code for Mac
published: true
description: 
tags: #vscode #zsh #shell #mac
---

Today I will show you how to use .zsh in VS Code terminal. 

First of all, you need to install .zsh. Follow the instructions here: {% github robbyrussell/oh-my-zsh %}

Then open the settings pane of VS Code and find this property: _"terminal.integrated.shell.osx"_. Tap on the edit button and set the value to _"zsh"_

Now you have zsh in your VS Code
Vue.js Component Props
Tags: javascript, vue
Published: 2018-06-20 04:31:31

---
title: Vue.js Component Props
published: true
tags: javascript, vue
canonical_url: https://flaviocopes.com/vue-props/
---

When a component expects one or more prop, it must define them in its `props` property:

```js
Vue.component('user-name', {
  props: ['name'],
  template: '<p>Hi {{ name }}</p>'
})

```

or, in a Vue Single File Component:

```html
<template>
  <p>{{ name }}</p>
</template>

<script>
export default {
  props: ['name']
}
</script>

```

You can have multiple props by simply appending them to the array:

```js
Vue.component('user-name', {
  props: ['firstName', 'lastName'],
  template: '<p>Hi {{ firstName }} {{ lastName }}</p>'
})

```

You can specify the type of a prop very simply by using an object instead of an array, using the name of the property as the key of each property, and the type as the value:

```js
Vue.component('user-name', {
  props: {
    firstName: String,
    lastName: String
  },
  template: '<p>Hi {{ firstName }} {{ lastName }}</p>'
})

```

The valid types you can use are:

- String
- Number
- Boolean
- Array
- Object
- Date
- Function
- Symbol

When a type mismatches, Vue alerts (in development mode) in the console with a warning.

Prop types can be more articulated.

You can allow multiple different value types:

```js
props: {
  firstName: [String, Number]
}

```

You can require a prop to be mandatory:

```js
props: {
  firstName: {
    type: String,
    required: true
  }
}

```

You can specify a default value:

```js
props: {
  firstName: {
    type: String,
    default: 'Unknown person'
  }
}

```

For objects:

```js
props: {
  name: {
    type: Object,
    default: {
      firstName: 'Unknown',
      lastName: ''
    }
  }
}

```

`default` can also be a function that returns an appropriate value, rather than being the actual value.

You can even build a custom validator, which is cool for complex data:

```js
props: {
  name: {
    validator: (name) => {
      return name === 'Flavio' //only allow "Flavios"
    }
  }
}

```

> I'm working on a Vue.js course. If you're interested in learning Vue, [get on the list](https://flaviocopes.com/course/vue/) to get a free 100+ pages ebook about the Vue fundamentals next week!
BxJS Weekly Ep. 15 - javascript news podcast
Tags: javascript, node, podcast, news
Published: 2018-06-17 10:04:35

---
title: BxJS Weekly Ep. 15 - javascript news podcast
published: true
description: Listen to the best javascript news of the week in a podcast form
tags: javascript, node, podcast, news
---

Hey dev.to community!

BxJS Weekly Episode 15 is now out! 🚀
Listen to the best javascript news of the week in a podcast form right here.
You can find all the mentioned links [here on github](https://github.com/BuildingXwithJS/bxjs-weekly/blob/master/episodes/Episode-15-2018-06-16.md).

You can also watch [this episode on youtube](https://youtu.be/Rj4c1dqFInU).

Any feedback is appreciated 😁

Additional stuff:
- [Twitch channel](https://www.twitch.tv/yamalight)
- [Discord server](https://discord.gg/hnKCXqQ)
- [BxJS Weekly github repo](https://github.com/BuildingXwithJS/bxjs-weekly)
A Personal MOTD
Tags: linux, raspberrypi, motd
Published: 2018-06-17 09:41:02

---
title: A Personal MOTD
published: true
description: Learn how to create a custom MOTD
tags: linux, raspberrypi, motd
---
![A custom MOTD](https://i.imgur.com/x3VM2ye.png)

Today, we are going to modify the MOTD that appears when we connect SSH to our server. Generally, it gives you some general information about your machine. You can display the server's uptime, RAM consumption, ...

Personally, I did something simple. It only displays me a logo and text.
To make a custom MOTD, there are many different ways to do it. Personally, I chose the method where we write a basic script that we execute so that it can edit the `/etc/motd` file alone.

## Writing the script

As said above, I wrote a small script (koff, koff,... it's internet that wrote it for me) that I saved in a file `raspi-motd.sh`. If you want the same MOTD as I do, you can find the code here: [https://gist.github.com/piksel/3023588](https://gist.github.com/piksel/3023588)

![A custom MOTD: code](https://i.imgur.com/hLgD8ip.png)

I slightly modified the script as explained in the comments below. You just have to change the line 20 `echo "$logo" > /etc/motd.tail to echo "$logo" > /etc/motd`.

Then I saved the file and executed it. Being a beginner with Linux, I had a little trouble running the file. Finally, two solutions are offered to me.
Either:
Allow the script to run,
run it with `bash /path/to/script.sh` command

I first chose the first option (hehey I said I didn't understand anything) and then I thought it was time to try the second one anyway. (spoiler! The second one is faster)

First solution:
`chmod +x raspi-motd.sh` gives the script execution rights
`raspi-motd.sh` script is executed
Second solution
`bash raspi-motd.sh` simply execute the script

![A custom MOTD: bash](https://i.imgur.com/zuysiFR.png)

Unfortunately, I have a small error, because it doesn't find the `bootlogs` file in `/etc/init.d/` but no worries it still works. Finally, all you need to do is reconnect and the custom MOTD will appear.

-----

## Sources:

[L4p1n's blog](https://l4p1n.met-hardware.fr/tutoriel/2017/09/04/motd-personnalise-sur-son-serveur.html)
[Source code](https://gist.github.com/piksel/3023588)
[How to run. sh file](https://www.cyberciti.biz/faq/run-execute-sh-shell-script/)

## Images:

By myself
SOCKET.IO real time notificaion 
Tags: discuss
Published: 2018-06-17 08:20:20

---
title: SOCKET.IO real time notificaion 
published: true
tags: discuss
---
what i am trying to implement is the real time notification.

Things which are working accordingly are

1.Able to send request
2.Data fetched by server and hence db updates
3.Notification is real time

The problem I am facing is:
Once the user is connected to a particular room say  localhost:3000/user/user123 then the user123 (logged in user) is able to get its notification for the request but once i change the room say i visit localhost:3000/ the notification vanishes.

What I expect it to be doing:
I want that irrespective of the room or any page in the website the user is at he should get the notification.

Here is the code:
server side-https://pastebin.com/cAAKwMXj
client side-https://pastebin.com/yeVgP5vW
Back to basics: Naming
Tags: naming, javascript, programming, discuss
Published: 2018-06-17 08:12:11

---
title: Back to basics: Naming
published: true
description: How to get naming right.
tags: naming, javascript, programming, discuss
---

Between these functions which one do you feel is appropriately named?

{% gist https://gist.github.com/sadick254/eaf34bc5cd4a419d06d229ef885cf7b1 %}
Oh Javascript... 🙄
Tags: javascript, badparts
Published: 2018-06-17 04:31:14

---
title: Oh Javascript... 🙄
published: true
description: The terrible tool we must use.
tags: #javascript #badparts
---

Just ran across this little gem.

```javascript
new Date('2018-01-01')
<- Sun Dec 31 2017 18:00:00 GMT-0600 (Central Standard Time)

new Date('2018/01/01')
<- Mon Jan 01 2018 00:00:00 GMT-0600 (Central Standard Time) 
```

The reason this happens (I think) is because JS parses the first date as ISO 8601 format. And since no timezone offset is specified it assumes UTC. However, JavaScript will only create Dates in local time. So after applying the local time zone, it is 6pm the previous day.

The second one uses a `/` separator, so it does not trigger the ISO parse branch. Instead it sensibly presumes I am interested in a date in the current time zone.
Cross-Platfrom Dev with RAD Studio
Tags: crossplatform, delphi, mobile
Published: 2018-06-16 23:06:06

---
title: Cross-Platfrom Dev with RAD Studio
published: true
tags: cross-platform,delphi,mobile
canonical_url: https://www.codingblocks.net/videos/community-talk/cross-platfrom-dev-with-rad-studio/
---

Coding Blocks just released our second Community Talk where we have gathered 5 of our favorite devs to talk about Cross Platform Development, focusing on RAD Studio.

Check out the video and let us know what you think!

Bonus: There's a contest, watch the video for more info ;)

{% youtube doc4AkJG5Kg %}
Impact of org structure on development
Tags: discuss
Published: 2018-06-16 21:54:10

---
title: Impact of org structure on development
published: true
tags: discuss
---
How much does the organizational structure affect the successful delivery of software?

By org structure, I mean:
* Who makes scope decisions?
* Are QA and UX separate departments, or integrated in the development team?
And so on.

My personal opinion, after years of consulting: it can make a huge difference.
What are your thoughts?
Becoming a better programmer
Tags: learning
Published: 2018-08-30 19:37:09

---
title: Becoming a better programmer
published: true
tags: learning
canonical_url: https://on-sw-integration.epischel.de/2018/06/16/becoming-a-better-programmer/
---

Henry Stanley wrote a blog post “[Becoming a dramatically better programmer](https://recurse.henrystanley.com/post/better/)“. He outlines areas where programmers who want to get better can focus on. That is learning skills directly on the one side and learning meta-skills on the other side. Meta-skills: learn about “deliberate practice” – do things that challenge you and get feedback -, identify common mistakes you make and learn to do deep work – focus on work with no distractions.

My advice for deliberate practice are sites like [CodeWars](http://codewars.com) where you can solve exercises (“katas”) in a couple of programming languages. It is challenging (CodeWars has martial art like grades of mastery) and you get feedback by being able to look at solution by other users and thus being able to compare them to your solution.

 ![](https://www.epischel.de/analytics/piwik.php?idsite=3&rec=1&url=https%3A%2F%2Fon-sw-integration.epischel.de%2F2018%2F06%2F16%2Fbecoming-a-better-programmer%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dbecoming-a-better-programmer&action_name=Becoming+a+better+programmer&urlref=https%3A%2F%2Fon-sw-integration.epischel.de%2Ffeed%2F)
Password encoder in Spring Boot 2
Tags: spring, java, springboot2
Published: 2018-06-16 18:48:28

---
title: Password encoder in Spring Boot 2
published: true
description: How to encode passwords in Spring boot 2
tags: spring, java, spring boot 2
---

Hi, Since Spring boot 2.x there was a few changes in Spring Security, so, I will show you how to encode passwords in Spring boot 2 (which comes with new Spring Security 5).

Most important change: 

`DelegatingPasswordEncoder` it's the new default password encoder (which not tie you to a specific encoder implementation, like `BcryptPasswordEncoder`)

`NoOpPasswordEncoder` is considered as deprecated now.


* How to create password encoder bean:
```java
    @Bean
    public PasswordEncoder passwordEncoder() {
        return PasswordEncoderFactories.createDelegatingPasswordEncoder();
    }
```

* How to encode a password (Bcrypt implementation will be used underneath):
```java
        String encodedPassword = passwordEncoder.encode(rawPassword);
```

* How the encoded password looks like:

`{bcrypt}$2a$10$GJpYuiP0cDOcE.WRlctpHOC1ROz35m9jCJ5BXFoMgnzkUjsxc6yHS`
Where '{bcrypt}' determines which encoder used for encoding.

* How to check if raw password matches encoded:
```java
    if (!passwordEncoder.matches(rawPassword, encodedPassword)) {
        throw new BadCredentialsException("Bad password");
    }
```
When is code "too clever" / how do you think about readability/cognitive load?
Tags: discuss
Published: 2018-06-16 16:21:09

---
title: When is code "too clever" / how do you think about readability/cognitive load?
published: true
tags: discuss
---

Usually, it's quite clear to me whether code I'm writing is clean and easy to understand, but lately, I find myself doing the following a lot in JavaScript:

When a function needs to do something only when a certain option is passed in, I do this:

```js
function foo(shouldBar){
    //...
    
    shouldBar && bar();
}
```

I find it quite clear, but I'm probably going to try to kick this habit because

```js
if(shouldBar){
    bar();
}
```

  - is more explicit,
  - is easier to understand or devs with less JavaScript experience.

How do you decide whether a particular line of code is "too clever"?
We Were Hired For A Hidden Agenda
Tags: culture, agile, career, consulting
Published: 2018-06-16 14:43:24

---
title: We Were Hired For A Hidden Agenda
published: true
description: Ever been on a software development project where one team is putting pressure on another because of a hidden agenda?
tags: #culture #agile #career #consulting
---

I was once asked to investigate two teams that worked together to build a software product for doing taxes.

The first team said they needed help with releasing software better.

So I planned to use an interview I'd come up with over the years.

It had questions I could ask people about how they work together.

Things like how they gather requirements, test the software, and approve releases for example.

While interviewing the first team, **it became clear that they didn’t  like the second team**.

The first team was following scrum, while the second team was not.

However after interviewing many people on both teams, we realized _the second team was following kanban_.

But they were doing it for a good reason - to respond to unpredictable changes in tax code.

So eventually we presented our findings, and though many people were pleased - _our client was disappointed that we handn't found only issues with the second team_!

In this video, I share some things to consider that might help you avoid being used as a pawn in corporate politics.

I hope it helps you if you're ever pressured to side with a group of people to force another to change unwillingly!

Visit my site to watch the full video (or listen as a podcast):

# [📺 Watch or 🎧 Listen](https://jaymeedwards.com/2018/06/12/we-were-hired-for-a-hidden-agenda/)

<hr />[🔔 Subscribe for over 100 videos on healthy software development](https://YouTube.com/c/JaymeEdwardsmedia?sub_confirmation=1)
Concurrent Iteration
Tags: async, javascript, promise
Published: 2018-06-16 11:16:11

---
title: Concurrent Iteration
published: true
description: How to iterate in Async Land
tags: async,javascript,promise
---


The concept of iteration intuitively seems to be synchronous — when the iteration completes we will have our results ready.

There are many native array methods which helps us iterate over an array.

Lets say we have an array of student details. Each student has a field which states their date of birth and now we want to calculate their age.

```javascript
const ageOfStudents = studentDetails.map(({dob}) => calculateAgeFromDOB);
```

The `ageOfStudents` will be ready for us immediately.

`calculateAgeFromDOB` is a synchronous operation. So, we will calculate the age of each student _strictly_ one after the other.

**But what if the operation to be applied to each student does not resolve synchronously**.

Lets say, we need yearly performance record for each student. And each yearly performance record of a student is a network request.

```javascript
const studentPerformanceRecordsPromises = studentDetails  
  .map(({id}) => getPerformanceRecordOfStudent(id));
```

Each iteration will spawn a _concurrent_ task. And these tasks will resolve in their own arbitrary order.

We have to wait for the performance records _even after_ the iteration completes. This is the critical distinction between ordinary iteration and concurrent iteration.

If `getPerformanceRecordOfStudent` returns a Promise which resolves after a successful network request, `studentPerformanceRecordsPromises` will be an array of Promises.

We can use `Promise.all` to wait on an array of Promises.

```javascript
Promise.all(studentPerformanceRecordsPromises)  
   .then(doSomethingWithPerformanceRecordsOfAllStudents)
```

Since we are contrasting synchronous and asynchronous iteration, it will be good to have an async counterpart of our `Array.map`.

We will like to use it like this

```javascript
Promise  
.map(studentDetails, getPerformanceRecordOfStudent)  
.then(doSomethingWithPerformanceRecordsOfAllStudents)
```

And here is how a trivial definition of `Promise.map` will look like

```javascript
if (!Promise.map) {  
 Promise.map = function(vals,cb) {  
  return Promise.all(  
   vals.map( function(val){  
      // we are expecting \`cb\` to return a promise  
      // even if it does not we are converting it in to  
      // a promise using \`Promise.resolve\`  
      return Promise.resolve(cb(val))  
   } )  
  );  
 };  
}
```

- - -

This thought was _spawned_ while I was reading [YDKJS](https://github.com/getify/You-Dont-Know-JS) by [@getify](https://twitter.com/getify). Particularly this part aptly titled [_Concurrent Iterations_](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch3.md#concurrent-iterations). 

I was scratching my head for a little while. So thought of sharing my _resolved_ understanding. Maybe this will help somebody.

Thanks for reading.

I am a big fan of YDKJS. Highly recommend it!

Resolve your relationship with JavaScript. _Sorry_!
What are the first differences you noticed in GitHub after Microsoft bought it? Post here yours!
Tags: github, microsoft, discuss
Published: 2018-06-16 07:52:10

---
title: What are the first differences you noticed in GitHub after Microsoft bought it? Post here yours!
published: true
description: 
tags: github, microsoft,discuss
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/ubh8ib6xbd37ux0wh1u3.png">

[EDIT] It shows "open in VS" because I have vs installed on my pc, didn't know that lol. I would keep this post for the future when actual changes will appear in github. If you ever notice one just write here a comment.
azssh: Easily manage EC2 instances
Tags: aws, go
Published: 2023-04-29 21:21:51

---
title: azssh: Easily manage EC2 instances
published: true
date: 2018-06-16 07:14:09 UTC
tags: aws,go,golang
canonical_url: https://mikestaszel.com/2018/06/16/azssh-easily-manage-ec2-instances/
---

[azssh](https://github.com/mikestaszel/azssh) is a small commandline utility I wrote a few months ago to help with managing EC2 instances.

My workflow on EC2 consists of starting and stopping instances and sometimes SSHing in to run some commands. That’s what this utility does – starts and stops EC2 instances, tells you the public DNS address, and runs an SSH command.

Check out the source code and releases at the GitHub page at: [https://github.com/mikestaszel/azssh](https://github.com/mikestaszel/azssh)

 

<!--kg-card-end: html-->