teleren/devto huggingface dataset:
Handling multiple implementations of a product
Tags: discuss, git, help
Published: 2018-07-30 12:17:44

---
title: Handling multiple implementations of a product
published: true
description: Discussion of how to handle different language implementations of a project
tags: discuss, git, help
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9ss670wghlovwndwf45v.png
---

> While I'm aiming for general, non-specific solutions, I am using the real example of wanting to re-write my [Java logging library](https://github.com/logdyn/logdyn-api)


## So you want to rewrite your Java library in Node...


I've recently run into the case where I want to reimplement an existing project in a new language, and I'm trying to decide how best to manage the new code in relation to the existing product.

My initial thoughts were to simply create a new repository; this having the advantage of clear distinctions between project history and issues.
```
java-repo
    > master
        - dir1
        - dir2
node-repo
    > master
        - dir1
        - dir2
```
I have seen arguments made for keeping all the code in one repository, such as being able to change an algorithm and having all the languages changed in one commit.
```
project-repo
    > master
        - java
            - dir1
            - dir2
        - node
            - dir1
            - dir2
```
The last suggestion I saw was that you could have a 'master' branch for each language, but I think that's a bit too unconventional for my taste...
```
project-repo
    > master-java
        - dir1
        - dir2
    > master-node
        - dir1
        - dir2
```

What are your thoughts on this? Is there some hot new methodology that I've missed, or is keeping it old-school with separate repos the way to go?

> I might be doing a post about the re-write process at some point, so even if it fails horribly it should at least be interesting! 😄
JS Algorithms Repo is Over 30K Stars Now
Tags: javascript, computerscience, webdev, programming
Published: 2018-07-30 12:06:43

---
title: JS Algorithms Repo is Over 30K Stars Now
published: true
description: I’m glad that so many developers found it helpful!
tags: javascript, computerscience, webdev, programming
---

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

It’s over **30k** starts now! Two months ago I couldn’t even believe that [JavaScript Algorithms](https://github.com/trekhleb/javascript-algorithms) repository would become that popular and thus that useful! I’m glad that so many developers found it helpful!

[37 contributors](https://github.com/trekhleb/javascript-algorithms/graphs/contributors) have created 75 pull request, submitted 5 translations to make the repository more clean, stable and available for community. Thank you all for your effort!

![](https://thepracticaldev.s3.amazonaws.com/i/ssj05hk61h7bf288qy1s.png)
Future of Mobile App Development for the IoT
Tags: mobileappdevelopment, madpplatforms
Published: 2018-07-30 11:11:04

---
title: Future of Mobile App Development for the IoT
published: True
description: The future of mobile app development isn’t simply relating to our mobiles and tablets anymore. We’re going straight into a period of cloud computing running 
tags: Mobile App Development, MADP platforms
---
The future of mobile app development isn’t simply relating to our mobiles and tablets anymore. We’re going straight into a period of cloud computing running Smart-Everything then one in which our smart devices do not simply reside in isolation. Mobile app development for the Internet of Things is going to be even bigger soon, even though current work aren’t paying off however. 

With the increasing reputation of Android Put on and the classy 2015 entry of the Apple Watch into the smartwatch market, we’re viewing a move away from phones and tablets. We’ve barely started to take into dangerous consideration the true potential of wearables. However, wearables are but one of the product categories in which IoT houses. 

We’ve observed samples of other IoT products such as the self-driving car by Google, the Nest thermostat, the Ring that handles everything, the fridge that reads your tweets or anything else. As devices start to get even more interrelated , the opportunity for software to add value to these smart devices evolves into previously greater. Hopefully, the competition between these types of devices will be mainly based on which has the finest quality software. This is where the future of mobile app development gets a mine of opportunity. 

This research by Vision Mobile posted in earlier this year on the state of **[mobile app development platforms](https://www.hokuapps.com/products/mobile-application-development-platform/)** shows that about 53% of mobile developers are working on IoT projects, with most of them doing so as an activity or side project. Mobile developers looking to catch an early journey on this upcoming wave into the future of mobile app development should certainly explore IoT projects. 

	 	 	
For more information on mobile app development for the IoT, write to us at sales.sg@hokuapps.com or call us on +65 8813 8839.
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2018-07-30 11:03:52

---
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. 😱😱😱

An exaggerated post on the evils of web frameworks to deliver on important message: make sure you understand the basics before defaulting to web frameworks without consideration.

{% link https://dev.to/gypsydave5/why-you-shouldnt-use-a-web-framework-3g24 %}

# 2. 😍 Git Alias 😍 

Christine shares her git workflow and some of her favorite git aliases. The community chimes in on their workflows and aliases as well. Do you use any of these?

{% link https://dev.to/cseeman/git-workflow-and-my-new-love-of-git-alias-38kj %}

# 3.👍 Rules of Thumb 👎

Despite the article title, this post has helpful tips for non-newbies as well!

{% link https://dev.to/jsguru_io/dos-and-donts-for-javascript-newbies--5dkl %}

# 4. 🤩 Obsessed with clean code ✨ 

Ali keeps her code clean by obsessing over 7 practices so future developers (and herself) can maintain her applications with ease. 

{% link https://dev.to/aspittel/extreme-makeover-code-edition-k5k %}

# 5. 😕 Missed Opportunities 😕

Clean architecture is always at the top of reading lists for software developers. In this post, Blaine goes against the norm and tells us the major teaching opportunities the author missed and how the book just didn't meet his expectations. 


{% link https://dev.to/bosepchuk/why-i-cant-recommend-clean-architecture-by-robert-c-martin-ofd %}

# 6. ⏭ One Pass Only ⏭

A list of useful tricks with the `Stream Editor`, a text transformation tool that comes bundles with every unix system.

{% link https://dev.to/shamilchoudhury/processing-text-with-linux-shell---part-1-4ajd %}

# 7. 📺 Your life will be so much easier! 📺

>You, yes, you, can become the proud owner of a brand-spanking-new automatic interactive pre-commit hook checklist! 

'nuff said, sign me up.

{% link https://dev.to/vickylai/an-automatic-interactive-pre-commit-checklist-in-the-style-of-infomercials-14i7 %}
Backticks in browser scripts
Tags: question, javascript, help
Published: 2018-07-30 10:15:45

---
title: Backticks in browser scripts
published: true
description: 
tags: question, javascript, help
---

Do all browsers (IE doesn't matter) support use of backticks in javascript

Eg; can I use 
```
console.log(`Prics is Rs. ${price}`);

```

Instead of
```
console.log('Prics is Rs.'+ price);
```
Create A Classic Snake Game Using HTML5 and JQuery
Tags: html, javascript, css, webdev
Published: 2018-07-30 08:52:16

---
title: Create A Classic Snake Game Using HTML5 and JQuery
published: true
description: Create A Classic Snake Game Using HTML5 and JQuery
tags: #html #javascript #css #webdev
---

Post Link : https://www.skptricks.com/2017/12/html5-snake-game.html

Today's Post we are going to share a code related to A Classic Snake Game. we have implemented this using HTML5 and JQuery.

<a href="https://www.skptricks.com/2017/12/html5-snake-game.html" >Create A Classic Snake Game Using HTML5 and JQuery </a>

<img src="https://4.bp.blogspot.com/-Z-NQIpBxjkI/WiQj2jcyRuI/AAAAAAAABDs/so6g68L4ou4y9ck-4wBEePNi4lnuPO1QwCPcBGAYYCw/s320/Capture12.PNG" title="Create A Classic Snake Game Using HTML5 and JQuery" />


{% youtube 9C5RANXVaTY %}
The database that can store the Internet
Tags: showdev, database, satirical, go
Published: 2018-07-30 07:22:51

---
title: The database that can store the Internet
published: true
tags: [“showdev”, "database", "satirical", "go"]
---

Wouldn't it be awesome if you could save the entire Internet into a database? Well, you can now do so! Infinite exploits a simple loophole in your operating system to enable you to store an infinite amount of data, without using a single byte.

## How it works

A file contains data, which is measured in bytes. If a file contains `Hello!`, it takes up 7 bytes (remember to count the newline character). If a file contains `Bye bye~`, it takes up 9 bytes. _Simple_.

Now what if a file contains nothing? How many bytes would the file take up? That's right, 0! But a file can still store data, even if it contains nothing. Where? In its _name_ of course! If we store data in its name, we can now have a file that stores data, but contains nothing, and thus takes up 0 bytes!

Here, have some evidence.

![Evidence](https://raw.githubusercontent.com/ravernkoh/infinite/master/assets/how-it-works.png)

## I like it!

The source code for this project can be found [here](https://github.com/ravernkoh/infinite). Feel free to give it a ⭐️ and use it in production 🤪!
Machine Learning Basics with ml5js
Tags: javascript, howto, machinelearning, example
Published: 2018-07-30 07:19:52

---
title: Machine Learning Basics with ml5js
published: true
description: We look at an example from ml5js to load images and predict them
tags: javascript, how-to, Machine learning, example
---

{% youtube NUoICjm5mdI %}
GIT Commands: Desktop App built with ElectronJS and ReactJS to be cross-platform.
Tags: react, electronjs, git, github
Published: 2018-07-30 01:10:51


---
title: GIT Commands: Desktop App built with ElectronJS and ReactJS to be cross-platform.
published: true
description: GIT Commands is a desktop app built with ElectronJS and ReactJS to be cross-platform
tags:  reactjs, electronjs, git, GitHub
cover_image: https://thepracticaldev.s3.amazonaws.com/i/dmqyxw1aobscgqpp0fs4.png
---

## Screenshot

![Git Comannds](https://thepracticaldev.s3.amazonaws.com/i/dmqyxw1aobscgqpp0fs4.png)

# Git Commands

GIT Commands is a desktop app built with ElectronJS and ReactJS to be cross-platform, providing quick access to the main Git commands and with direct links to the documentation.


## Prerequisites

* **Requires a node version >= 7 and an npm version >= 4.**
* **If you have installation or compilation issues with this project, please see [our debugging guide](https://github.com/chentsulin/electron-react-boilerplate/issues/400)**

## Install

First, clone the repo via git:

```bash
git clone --depth=1 https://github.com/mariorodeghiero/git-commands.git your-project-name
```

And then install dependencies with yarn.

```bash
$ cd your-project-name
$ yarn
```

**Note**: If you can't use [yarn](https://github.com/yarnpkg/yarn), run `npm install`.

## Run

Start the app in the `dev` environment:

```bash
$ npm run dev
```

## Packaging

To package apps for the local platform:

```bash
$ npm run package
```

To package apps for all platforms:

First, refer to [Multi Platform Build](https://www.electron.build/multi-platform-build) for dependencies.

Then,

```bash
$ npm run package-all
```

To package apps with options:

```bash
$ npm run package -- --[option]
```

## Tip

To improve the usability of this App, you can create keyboard shortcuts to start quickly.
- For Mac_OS use "Automator".
- For Windows access "Properties" of the App.

If you liked this project, contribute improvements or give me a star ⭐️ on  [GitHub.](https://github.com/mariorodeghiero/git-commands.git)

Thanks!
Tactical or Strategic?
Tags: strategy
Published: 2018-07-30 00:41:01

---
title: Tactical or Strategic?
published: true
description: By adopting Agile have we given over to short term tactical projects rather than strategic capability development?
tags: strategy
---


With the advent of Agile there has been a move towards adaptive change over time, responding to the environment. The focus is on addressing short term business needs. It is the fate of many developers to maintain systems in a more or less constant state of churn, where ongoing business needs drive short term tactical modifications to address specific short term targets or goals.

So what is wrong with meeting the needs of business? Nothing of course! That is our job. The problem is that a exclusive focus on short term tactical decisions reacting to the environment prevents a more strategic approach of developing capabilities which are better able to adapt to changing business needs. We can't ignore the immediate needs of the business, but we should aim for a balance between the short term changes that are the bread and butter of many shops to broader capability building efforts which can improve delivery times and adaptability.

The reality however is that communicating the importance of this balance to businesses can be challenging. There is always the priority of the moment which diverts resource from the longer term strategic project. The important thing to communicate to business leadership is that building capability will allow you to move faster, deliver more and improve reliability and quality.

Strategic development also requires far more discipline and architectural vision. Any coder can be told to hack out a form or statically coupled database app. The aim of strategic projects is to build a capability that improves the ability for the business to adapt to short term environmental opportunities. This is important, as I am not advocating a return to monolithic waterfall development. In fact where possible you should buy rather than build applications. But if you are spending a ton of cash on development time without seeing much in the way of increasing functionality it might be time to evaluate how you can build systems that are able to adapt without code modification.
How would you create a translator app?
Tags: help, javascript
Published: 2018-07-30 00:11:34

---
title: How would you create a translator app?
published: true
tags: help, javascript
---

With the summer coming to a close, I'll be having more free time opening up. I was thinking of picking up the most recent item on my Side Projects of Doom list: a translator. 

***

Things I would want:

* English to a singular specific language
  * No English to Thing and Thing to English like Google/Bing. Just one way.
  * No English to ALL THE THINGS like Google/Bing. Only focused on the one path.
* Not needed to be pretty and scalable
  * This is not a commercial venture -- I'll just be playing
  * The only user is me... and whoever may click on the link to it when I post in #showdev
  * It'll be open sourced and search engine indexed, but since it's a niche use case and not unique, I really doubt anyone will care but me

***

Keeping those two things in mind, the big sexy option of getting into an NLP solution seems excessive to me. I don't have an army of computers to train with and don't see the need to bring in AWS when the only person using the fine-tuned ML algorithm would be me. 

Yes, I could use Google Translate and be done with it, but where's the fun in that?  Now I can learn new tech AND a new language. I can leave the natural language processing to the Googles and Bings of the world.

Initial thoughts would be to do it in JavaScript to keep in the realm of what I know while just adding to my skills, as to not create barriers due to needing to learn fundamentals, but I don't know if that's the right tech for the job. I'd just do straight if this than that with objects or something. First match on sentences, then phrases, then words, then just end up keeping the original word if unknown. Maybe learn ES6+ and more TypeScript.

***

So... keeping in mind that this is fun learning rather than an enterprise project, what would you do if you were in my place? I've only gotten as far as making a Duolingo account to start learning some grammar :)
Summer 2018: Massive, Twice Over
Tags: database, javascript, node, speaking
Published: 2018-07-30 22:37:00

---
title: Summer 2018: Massive, Twice Over
published: true
tags: database,javascript,node,speaking
canonical_url: https://di.nmfay.com/summer-2018
---

[NDC talks are up](https://vimeo.com/281409168)!

There's also the [FullStack London](https://skillsmatter.com/skillscasts/12008-database-as-api-with-postgresql-and-massive-js) version which is slightly condensed for a shorter timeslot, if you have a SkillsMatter account and want to get right to the fun parts.

If you've read (almost) anything I've written, text or code, odds are you've run into [Massive.js](https://github.com/dmfay/massive-js). On the off chance you haven't, the elevator pitch is that PostgreSQL exclusivity lets you get a lot more mileage out of your database (as long as it's Postgres) and JavaScript being a dynamically typed, functional-ish language lets you get away with it really easily.

This talk goes over Massive in much more depth: first laying out a case for alternatives to the dominant object-relational mapping data access technique, in general and especially in JavaScript; and then diving into the architecture of Massive itself with plenty of examples. Also, there's some trivia about early 20th century Russian avant-garde art and another bit poking fun at French modernist architect Le Corbusier.

It's the second talk I've done, and overall I was pretty happy with how it went in Oslo and London both! I'm the furthest thing from a natural public speaker but I covered what I wanted to cover, finished at a reasonable time, and didn't screw anything up too badly -- so that's a success in my book. And after all, the only way to improve this particular skill is to keep doing it.
System Python is not for you
Tags: python
Published: 2018-04-15 13:32:15

---
title: System Python is not for you
published: true
description: 
tags: python
canonical_url: http://k4ml.me/system-python-is-not-for-you/
---

If you already did some python development or just getting started, one of the advice you would always get is to never mess with the system python - the python version that come with your distro. For example on Ubuntu or Debian based system, python that was installed by `sudo apt-get install python`. At first I didn't really understand what this mean, why you can't use something that already comes for free ?

The answer to that question is because that version of python actually meant for the distro itself. Most distro would in some place used python, maybe for some configurations script. In Ubuntu, lot of their own applications are written with python. If we upgrade some of the libraries not through the standard package manager, there's a chance it would break these apps. So that's what the python they provided is for. It's for their own use, not us. Once I realized this, I have a feeling that distro should ship the python that they need separately from the python that would be used by the users.

~~For development purpose, I always run `virtualenv $HOME` to setup virtualenv environment in my home directory. Under Ubuntu, `$HOME/bin` is under `$PATH` so `which python` would always point to `/home/kamal/bin/python` rather than `/usr/bin/python`. This allow me to freely use easy_install and it would install it to my `$HOME/lib/python2.5` instead of system wide lib directory. For something specific like developing a django project, I prefer to use [Buildout][1] to further isolate the environment. More on [Buildout][1] later.~~

To 'get' your own Python, you can use tools that provide multiple python interpreter such as Conda, Pyenv or [Nix](https://ariya.io/2016/06/isolated-development-environment-using-nix) package manager.

There's one exception. If you're fine with the Python version that come with your OS and only care about the packages that you install, `pip` has `--user` flag that install all the packages to your `$HOME` directory. Just make sure your `$HOME/.local/bin` in your `$PATH` and `$HOME/.local/lib/python3.x/site-packages` appeared first in `sys.path`, you pretty much have an isolated environment from the system python. In fact, this is my current setup so far as I don't need much a fancy python other than the system python.

[1]:http://www.buildout.org/
How to debug Drupal 8 Functional tests with XDebug
Tags: xdebug, phpstorm, phpunit, drupal
Published: 2020-01-30 17:23:15

---
title: How to debug Drupal 8 Functional tests with XDebug
published: true
date: 2018-07-29 19:12:18 UTC
tags: ['xdebug', 'phpstorm', 'phpunit', 'drupal']
canonical_url: https://blog.riff.org/2018_07_29_how_to_debug_drupal_8_functional_tests_with_xdebug
---

How to debug Drupal 8 Functional tests with XDebug

### The problem

While converting the old-style functional tests in the [MongoDB project](https://drupal.org/project/mongodb) from `WebTestBase` to `BrowserTestBase`, I stumbled upon a problem: after following the drupal.org instructions to [run PHPunit tests from PhpStorm](https://www.drupal.org/docs/8/phpunit/running-phpunit-tests-within-phpstorm), doing step-by-step debugging in the IDE worked nicely, but then stopped at the first `$this->drupalLogin();` call, returning a 404 after a very long delay, although the same call running without debugging worked normally. What could be going on ?

### The diagnostic

Stepping into `UiHelperTrait::drupalLogin()`, I noticed the delay occurent during the `drupalGet('user/login')` call early in the method, before submitting the account identification. Could it be the issue ?

Indeed, evaluating the result of the call via `$this->getSession()->getStatusCode();` after that call returned show a 504 Timeout HTTP status code. And indeed, dumping the page with `$this->getSession()->getPage()->getContent()` show it to contain a typically timeout page.

Examining the logs showed the timeout happened at the PHP level, during the opposite direction call performed by Xdebug towards the debugging client, although such calls obviously worked since I'd been stepping through code for hours before that.

### The solution

The solution was suggested by the always helpful and knowledgeable [@berdir](https://www.drupal.org/u/berdir) : PhpStorm happens to set a limit to the number of simultaneous connections it will accept for debugging, and that limit is 1 by default.

All of a sudden, it made sense: during classical debugging, the PHP interpreter from the host site establishes one connection to the client (the PhpStorm IDE), but when invoking the child site during such a call, a second instance of the interpreter is started and tries to connect too... but is blocked by the single connection limit of the default configuration.

![Screenshot from the XDebug preferences in PhpStorm 2018.1.2](https://blog.riff.org/sites/default/files/inline-images/phpstorm-xdebug-connections_0.png) So all it takes is increase the number of connections!

In PhpStorm 2018 and 2019 macOS, the settings can be found at _PhpStorm / Preferences / Languages & Frameworks / PHP / Debug_ in the `External connections` part of the right pane, as shown below.

No need to restart the IDE or PHP, just restart the debugging run configuration, and it works beautifully.