teleren/devto huggingface dataset:
Organizing the first GopherCon in Vietnam
Tags: go, gophercon
Published: 2018-07-23 01:58:27

---
title: Organizing the first GopherCon in Vietnam
published: true
description: GopherCon Vietnam 2018
tags: go, gophercon
---
![gophercon](http://pliutau.com/gopher-mic.png)

Hi Gophers!

We're working hard to organize the first GopherCon in Vietnam, HCMC this year. The expected date is November 2018.

GopherCon Vietnam is organized by a community of a passionate Gophers on a volunteer basis.

Be part of the first GopherCon in Vietnam, join our team:

 - [Landing](http://gophercon.vn/)
 - [Slack channel](https://gophers.slack.com/messages/gophercon-vn)
 - [Twitter](https://twitter.com/gopherconvn)
 - [Facebook](https://www.facebook.com/GopherCon-Vietnam-260681794517858/?modal=admin_todo_tour)
 - [For Speakers](https://www.papercall.io/gopherconvn2018)
 - [For Sponsors](https://docs.google.com/document/d/1yOfaoUAI2geZvu5Zxp6cX-4g48nJ-KxgTVz55ays5Fc)
Software Architecture "Virtues"
Tags: architecture
Published: 2018-07-23 00:14:22

---
title: Software Architecture "Virtues"
published: true
description: A shortlist of architectural virtues to think through when evaluating various architectural patterns and frameworks
tags: architecture
---

Software architecture is all about appropriate compromises. For small projects, having a highly involved software architecture is probably an overkill. For large enterprise applications, it becomes a necessity.

Finding a suitable software architecture for a project requires both technical and domain knowledge: you need to have a solid grasp on the problem your client needs you to solve AND understand the technical trade-offs involved.


Here is a shortlist of architectural virtues to think through when evaluating various architectural patterns and frameworks:

**1. System Comprehensibility**

Does this architecture enable developers and business owners explain, understand and collaborate well? Does it hide away less-important implementation details and help accurately frame the problem domain?

**2. Modularity (Separation of Concerns)**

Does this architecture allow for the problem domain to be broken out into smaller, more easily managed parts? Does it promote the healthy isolation of components? Does this allow component reuse and recombination? Does it reduce unnecessary coupling and make dependencies explicit?

**3. Testability (Mockable Dependencies)**

Does the software architecture facilitate testing at the unit, integration and system level? Does it allow mocking and stubbing of services and infrastructure? Does it allow testing failure modes?

**4. Hexagonality (Infrastructure Agnosticism / Domain Isolation)**

In this architecture, is possible to isolate the domain (or business) logic from implementation details? Can you segregate and swap out the transport or persistence layer without needing to make major internal changes to the system?

**5. Aspect-orientation (Cross-cutting concerns)**

Does the architecture allow for uniform, centralized handling of cross-cutting concerns? Can logging, caching, authorization, serialization etc be handled independently from the core logic?

**6. Plugin-orientation**

Does the architecture allow decoupled and optional processing? Does it allow for integration with external systems as and when needed? Does it offer hooks into it's internal operations without compromising security?

**7. Scalability**

Does the architecture framework allow for room for growth at least for the foreseeable future? Does it facilitate the measurement and monitoring of system performance?

There are, of course, many more issues to think about... but this is a pretty good set of parameters to think through while making architectural choices.
Keep Your Example Code Green
Tags: documentation, ruby, markdown, github
Published: 2018-07-22 22:40:52

---
title: Keep Your Example Code Green
published: true
description: How to avoid stale (or broken) example code.
tags: documentation, ruby, markdown, github
---

Showing example code in your documentation is immensely helpful to your user -- unless the example code is stale or, much worse, broken.

If users runs your example code and it gives errors, how can they have *any* confidence in the rest of your code.

Question:  What to do?

Answer:  Run your example code before every commit. (Just like your tests, right?)

Question:  How?

Answer:  Use a build procedure and file inclusion:

- Store each example code snippet is in a separate file.
- In your main document, specify file inclusions for each example code and its output.
- Have the build procedure (Makefile, Rakefile, Ant, whatever):
  1. Execute each example, capturing its output to a separate file.
  2. Run a file inclusion process that merges each code snippet and its output into the main document (README, whatever).

So far, so good.

But over at GitHub, the markdown processing does not support file inclusion.

Shameless plug:  My Ruby gem [markdown_helper](https://rubygems.org/gems/markdown_helper) is a markdown pre-processor that does support [file inclusion](https://github.com/BurdetteLamar/markdown_helper#file-inclusion).  In fact, the project's [front page](https://github.com/BurdetteLamar/markdown_helper#markdown-helper) itself makes extensive use of the feature.

So if your project is on GitHub, you can use <code>markdown_helper</code> to merge code and output into your markdown pages.

And, by the way:

- Your project need not be coded in Ruby.  The <code>markdown_helper</code> has a command-line interface that your non-Ruby build procedure can use.
- File inclusions can be nested:  your included files can include still more files.

Check out the [use cases](https://github.com/BurdetteLamar/markdown_helper/blob/master/markdown/use_cases/use_cases.md#use-cases).
Codefights alphabeticShift
Tags: codefights, algorithims
Published: 2018-07-22 22:28:35

---
title: Codefights alphabeticShift
published: true
description: 
tags: ["codefights", "algorithims"]
---

Solutions for this codefight problem solution 
https://app.codesignal.com/arcade/intro/level-6/PWLT8GBrv9xXy4Dui/description


> Given a string, replace each its character by the next one in the English alphabet (z would be replaced by a).

> Example

> For inputString = "crazy", the output should be
alphabeticShift(inputString) = "dsbaz".




First Pass with mutuable memory 

```python
def alphabeticShift(inputString):
    
    new_word = []
    for i in inputString:
        current = ord(i)
        print (current)
        current = (current + 1)
        if current > 122:
            current = current - 26
            
        new_word.append(chr(current))
        
    return ''.join(new_word)
```


second pass a bit cleaner using lambdas
```python


def ordshift(i):
    current = ord(i) + 1
    if current > 122:
        current = current - 26
    return chr(current)

def alphabeticShift(inputString):
    
    new_word = list(map(ordshift, inputString ))
    return ''.join(new_word)

```
chessBoardColorCalculator
Tags: codefights, algorithims
Published: 2018-07-22 21:53:13

---
title: chessBoardColorCalculator
published: true
description: 
tags: ["codefights", "algorithims"]
---

my solution to this code fights problem
https://app.codesignal.com/arcade/intro/level-6/t97bpjfrMDZH8GJhi/description

generates an odd and even offset board and checks their reference values


> Given two cells on the standard chess board, determine whether they have the same color or not.


```python
def chessBoardCellColor(cell1, cell2):
    [fooa, foob] = cell1
    [bara, barb] = cell2
    
    fooa = ord(fooa) % 2 
    foob = int(foob) % 2

    bara = ord(bara) % 2 
    barb = int(barb) % 2
    
    board = [[(i+1)%2 for i in range(0,9)], [i%2 for i in range(0,9)]]
    
    return True if board[fooa][foob] == board[bara][barb] else False

```
chessBoardColorCalculator
Tags: codefights, algorithims
Published: 2018-07-22 21:52:51

---
title: chessBoardColorCalculator
published: true
description: 
tags: ["codefights", "algorithims"]
---

my solution to this code fights problem
https://app.codesignal.com/arcade/intro/level-6/t97bpjfrMDZH8GJhi/description

generates an odd and even offset board and checks their reference values

```
Given two cells on the standard chess board, determine whether they have the same color or not.


```` 

```
def chessBoardCellColor(cell1, cell2):
    [fooa, foob] = cell1
    [bara, barb] = cell2
    
    fooa = ord(fooa) % 2 
    foob = int(foob) % 2

    bara = ord(bara) % 2 
    barb = int(barb) % 2
    
    board = [[(i+1)%2 for i in range(0,9)], [i%2 for i in range(0,9)]]
    
    return True if board[fooa][foob] == board[bara][barb] else False

```
BxJS Weekly Episode 20 - javascript news podcast
Tags: javascript, node, podcast, news
Published: 2018-07-22 20:49:26

---
title: BxJS Weekly Episode 20 - 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 20 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-20-2018-07-22.md).

You can also watch [this episode on youtube](https://www.youtube.com/watch?v=fql6M8hLaw8).

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)

Social media links:
- [Twitter](http://twitter.com/yamalight)
- [Medium](https://medium.com/@yamalight)
- [Github](http://github.com/yamalight)

If you enjoy my content, please consider [supporting me](https://codezen.net/support.html) 😉
TIL: Slimming bash History
Tags: bash, tip, todayilearned, history
Published: 2018-07-22 19:37:19

---
title: TIL: Slimming bash History
published: true
description: filter out basic commands from your bash history
tags: bash, tip, til, history, todayilearned
---

# Slimming bash History

If you want to have history from your shell with some more value ignoring all of the basic commands have a look at setting the environment variable: `HISTIGNORE`.

This is based on the example by Kenneth Geisshirt from [his slidedeck](http://www.slideshare.net/geisshirt/unleash-your-inner-console-cowboy-47244006) available at SlideShare, with my own addition.

```bash
$ export HISTIGNORE="pwd:ls:ls -l:cd:clear"
```

[Source: SlideShare](http://www.slideshare.net/geisshirt/unleash-your-inner-console-cowboy-47244006)

Originally posted in [my TIL collection](https://jonasbn.github.io/til/)
what to do when you feel stupid?
Tags: discuss, career, advice
Published: 2018-07-22 17:51:16

---
title: what to do when you feel stupid?
published: true
description: 
tags: #discussion #career #advice
---
a couple of days ago I had a recursion problem that drove me crazy, and I have never felt that stupid before, so what you do when you feel stupid not because of lack of knowledge, you know the logic but you just can't apply it.
thanks
I am afraid that i will fail
Tags: help, suggestion
Published: 2018-07-22 17:11:56

---
title: I am afraid that i will fail
published: true
description: 
tags: #help #suggestion
---

I am unable to make a change or to learn new technologies because i am pretty much confident that i am gonna fail big time. Say like, i am very much interested to learn react but when i see some amazing websites built using react, deep in my heart i know that even if i put effort and learn react or any other framework, i will never be able to build something like that. so this one thought is preventing me from learning anything new. But i really want to learn stuff. how can i come out of these thoughts and or these thoughts common to all ? i know that i have good potential inside me,but i am not able to put it to good use. need some good ideas and suggestions on how i can overcome these thoughts and put my life back in track.
Explain it to me like I'm five: .map, .reduce, & .filter edition
Tags: explainlikeimfive, javascript, arrays
Published: 2018-07-22 17:11:21

---
title: Explain it to me like I'm five: .map, .reduce, & .filter edition
published: true
description: Need help understanding map, reduce, and filter 
tags: explainlikeimfive, javascript, arrays
---

I'm having trouble understanding how to use map, reduce, and filter to iterate over an array (or an array of objects for that matter 🙄).

I generally use for loops (and nested for loops if needed), but would really like to switch over to map, reduce, and filter for various things. I just can't wrap my head around how it works and what it's doing.

Here's a sample bit of code where I think I could use map/reduce/filter to achieve the same results a bit cleaner.

```javascript
const jsIngredients = [
    {"ingredient-1":"chicken"},
    {"ingredient-2":"brocolli"},
    {"ingredient-3":"cheese"}
];

let ingredientString = "";

for (let k = 0; k<jsIngredients.length; k++) { 
    if (jsIngredients[k].value) { // if non-empty
        ingredientString +=  `${jsIngredients[k].value},`;
        // ingredientString = "chicken,brocolli,cheese," 
        }
    }
ingredientString = ingredientString.slice(0,ingredientString.length-1);
// ingredientString = "chicken,brocolli,cheese" 
```

Any help? 
🍻
Google Maps Distance
Tags: showdev, javascript, googlemaps, frontend
Published: 2018-07-22 17:09:31

---
title: Google Maps Distance
published: true
description: Multiple addresses (place autocomplete) with address number validation and distance calculation (distance-matrix).
tags: #showdev #javascript #google-maps #frontend
---

Multiple addresses ([place autocomplete](https://developers.google.com/places/web-service/autocomplete)) with address number validation (Brazilian address) and distance ([distance-matrix](https://developers.google.com/maps/documentation/distance-matrix/start)).

![screenshot](https://thepracticaldev.s3.amazonaws.com/i/erfiuf0en4tb9a21ghoy.gif)

## Github
https://github.com/wgenial/googlemaps-distance

## Preview
http://htmlpreview.github.io/?https://github.com/wgenial/googlemaps-calculate-distance/blob/master/index.html
Working With TextInput Component In React Native
Tags: react, reactnative, mobile, android
Published: 2018-07-22 16:41:28

---
title: Working With TextInput Component In React Native
published: true
description: Working With TextInput Component In React Native
tags: #react #reactnative #mobile #android
---

# Working With TextInput Component In React Native

Post Link : http://www.skptricks.com/2018/07/working-with-textinput-in-react-native.html

This tutorial explains how to use TextInput Component in react native application. This Component helps to inputting text into the application text area field via a keyboard and also in this example we are going to display the entered text value of TextInput Component in the Text component with the help of States and Props.
Props provide configurability for several features, such as auto-correction, auto-capitalization, placeholder text, and different keyboard types, such as a numeric keypad.

<a href="http://www.skptricks.com/2018/07/working-with-textinput-in-react-native.html" > Working With TextInput Component In React Native </a>

<img src="https://2.bp.blogspot.com/-ACfY4P_1X0g/W1SsljvKUuI/AAAAAAAABuk/tiyekV5MMocNKAXIg8ESjVbuiCZcKrlyQCLcBGAs/s400/useri.jpg" title="Working With TextInput Component In React Native" />

Demo Link : 
https://youtu.be/ZcERK3d_e54
Startup Marketing Dilemma
Tags: startup
Published: 2017-06-03 14:27:54

---
title: Startup Marketing Dilemma
published: true
description: Build better Product Development Team than just a Marketing Team for your startup
tags: startup
---

Many Tech-Startups start spending and focus heavily on Marketing and Sales activities early on, while their product/services platform suffers because of lack of features, and iterative improvements based on customers feedback. Some start marketing the product even when it has not reached the MVP level.

Marketing is necessary evil! And, it should be handled simultaneously. The argument here is – what if startups focus more on improving the product, making it more user-friendly, intuitive, and engaging - allowing it to grow naturally with minimal effort on marketing and sales activities.

I believe that ‘Word of Mouth’ publicity is more valuable in the early iterations; it attracts new customers to the platform and retains them for a longer period. In this highly competitive and quick evolving landscape; Customer engagement and retention is the key to success. If customers find a product/platform valuable, engaging, with superb UI/UX, and usable, they will most likely reuse it, pay for it and recommend to their connections of the world to use it.

Purpose of building a product/platform for a customer fails if they cannot use it due to complexities or bugs in the system. Our inherent trait is, we do not ask for help unless in dire situation. Similarly, If customers cannot figure out how to use the product for themselves, then they would be reluctant to ask for help. Few adventurous/experimental types may contact help-desk. Besides, you need to allocate more time and valuable resources on keeping a large team of customer support executives to provide help to customers, or to complete the process on behalf of them.

I think, instead of increasing the Marketing/Sales/BD budget and effort; startups should focus more on agile (fast-paced) improvement of their product to make it more usable than their competitors. They should hire more Tech Personnel (programmers, testers, and designers) to fast-track the iterative improvements of the product to make it more usable; instead of hiring more Marketing/Sales/BD people to sell vaporware.
I made an app that gives you access too 20,000 plus hidden Netflix categories
Tags: showdev, netflix, javascript
Published: 2018-07-22 14:58:44

---
title: I made an app that gives you access too 20,000 plus hidden Netflix categories
published: true
description: Made an app that allows you to access 20,000 plus hidden Netflix categories. Plus more features.
tags: showdev, netflix , javascript
---



![alt text](https://thepracticaldev.s3.amazonaws.com/i/6cln46t2nk6runeb25m2.png "Logo Title Text 1")


Anyone who follows me on [Twitter](https://www.twitch.tv/robertjamesgabriel) or [Github](https://github.com/RobertJGabriel/) knows I work on my own startup Idea and a few pet projects. One of these includes this.  A chrome extension that searchs and finds Netflix's Hidden Categories and grows with them. It was built with Vue, Bem and Mocha.

Netflix has thousands of hidden categories. This extension I made helps you unlock many of those secret categories.

Features:
-  Search verified hidden categories
- Small size ~ 0.02 MB
- Favourite categories
- Syncing across browsers

Privacy:
- No  permissions required to install
- No data is sent


[You can see a video demo here](https://www.youtube.com/watch?v=V_L-SO4IDoI)

[You can download it here free for a week on Google Chrome. (1.99 after that)](https://chrome.google.com/webstore/detail/netflix-hidden-categories/pajmfnmlmcknmehpcklomlblpdcpdmgg/related)

Any feedback or questions I would love to answer. Like how do I get the new catorgories? The money on this covers the costs :)
Routing restify app, the lazy way.
Tags: javascript, webdev, productivity
Published: 2018-07-22 06:32:44

---
title: Routing restify app, the lazy way.
published: true
description: better way to route your restify / express app using the tool I made.
tags: javascript, webdev, productivity
---

Hi, I've worked on restify and express few months ago, and I find it hassle to route my app in such way that I have to order them manual. So, I started working on a small tool that would sort routes for me and manage all of my middlewares.

Behold, [restify-router-config](https://github.com/yakovmeister/restify-router-config).

It lets you handle various routing task in more efficient way e.g. (nested groups, middleware management, sorting routes based on wildcards)

Here's a simple usage example:

```javascript
/**
 * Note that the goal of this snippet is to showcase the usage of the 
 * tool, code provided is not from actual project.
 */
const router = require('restify-router-config')
const restify = require('restify')

const server = restify.createServer()

const apiAuth = (req, res, next) => {
  console.log('authed!'); 
  next()
}

const loggingMW = (req, res, next) => {
  console.log(req._timeStart)

  next()
}

const logDone = (req, res, next) => {
  console.log('done!')

  next()
}


router(server, true) ([
  {
    group: 'api/v1',
    middleware: apiAuth,
    routes: [
      {
        match: '/hello',
        method: 'get',
        action: (req, res, next) => res.send('hello')
      },
      {
        group: 'users',
        middleware: [
          ['before', loggingMW],
          ['after', logDone]
        ],
        routes: [
          {
            match: '/:id',
            method: 'get',
            action: (req, res, next) => {
              res.send('hello')

              next()
            }
          },
          {
            match: '/:id/friends',
            method: 'get',
            action: (req, res, next) => {
              res.send('hello')

              next()
            }
          },
          {
            match: '/',
            method: 'get',
            action: (req, res, next) => {
              res.send('hello')

              next()
            }
          }
        ]
      }
    ]
  }
])

server.listen(4000)
```

If you think this tool is useful or not, please let me know, I really think it's convenient but what do you guys think? BTW The usage shown from above is using restify, this tool is also compatible with express but some usage may vary.
Finding duplicates algorithm series-  A given range of elements as an input.
Tags: array, algorithms, programming
Published: 2018-07-22 05:09:15

---
title: Finding duplicates algorithm series-  A given range of elements as an input.
published: true
description: 
tags: array, algorithm, programming    
---

In my previous posts in __finding duplicates__ series [here](https://dev.to/s_awdesh/check-if-duplicate-exists-inside-a-sorted-array-3aa5) and [here](https://dev.to/s_awdesh/finding-duplicates-inside-an-array---easy-version-37la) we have seen different variation of this problem. This is another interesting twist in the problem as now we have given input which falls in a given range.

Let's walk through an example-:

Below we are given an example where an array given contains elements that are in range 1-10. 

![problem](https://thepracticaldev.s3.amazonaws.com/i/sz769vzu3mhnu58q2xqp.jpeg)


![hint](https://thepracticaldev.s3.amazonaws.com/i/ov23mr6kllun9x2dxlzu.jpeg)

When we have given input in a range, **counting sort** like algorithm is the best we can implement. More on counting sort is [here](https://www.geeksforgeeks.org/counting-sort/)

Inspired from counting sort algo, to solve this algorithm we’ll create another count array in which we store count of each item at the index i.e. at index 2 we’ll store item 2 in the count array.



![Algo](https://thepracticaldev.s3.amazonaws.com/i/gpq0js3dt96en4ytqqcx.jpeg)

Here is repl in Java.

{% replit @AwdeshSharma1/OutrageousDirectModem %}


We have learnt another variation of **finding duplicate** problem plus we also learnt about counting sort. In coming posts I want to work on String related problems.

Happy coding. Cheers.