teleren/devto huggingface dataset:
3 ways to retain your dev flow between sessions 💪
Tags: productivity, programming, devtips
Published: 2019-01-17 15:27:58

---
title: 3 ways to retain your dev flow between sessions 💪
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/yc77mo8nphic8jcqlhjq.png
canonical_url: https://jerodsanto.net/2011/01/three-ways-to-retain-your-dev-flow/
description: There are times when we absolutely must leave our development context behind and pick it back up later.
tags: productivity, programming, devtips
---

Context switching. Computers are great at it, _humans suck at it_.

Every time we developers lose the context of our current task we're forced to waste precious time getting it back. The harder the problem we're trying to solve, the longer it takes to reinstate its context in our mind. This is why many developers strive to reduce interruptions, set aside large blocks of time, and create an environment that helps them get into the [flow][flow] _and stay there_.

The problem is, there are times when we absolutely must leave our development context behind and pick it back up later. Sometimes it's 30 minutes, sometimes it's overnight. I find these times very frustrating and have found a few techniques that help me quickly get my flow back upon returning.

## 1. Note to self

Leave yourself a little note saying what you were up to. This is probably the most obvious technique, and can be quite effective. The problem I've found with this is that I often forget to do it or am just too tired/lazy at the end of the day to do it consistently.

I need to write myself a note to remind myself to write myself notes. Guh, yeah.

## 2. Always be failing

Leave one or more tests in your test suite failing (you are writing tests, yes?). When you return to the project your first step is to run the test suite and you'll see the failing test(s). This one works really well, but much like leaving yourself notes it's something that you have to actively participate in. It can actually take more time and effort to employ than leaving notes.

## 3. Git dirty

This is my favorite and most oft used technique. Leave your Git (or the DVCS of your choice) staging area in a dirty state.

![git dirty][dirty]

When you return, you'll see all the changes you most recently made before you left off. This, combined with a quick perusal of the commit log will quickly bring your context back. The advantage of this over the others is that it is somewhat participation-free. Simply _fail to_ commit your last changes and they'll be there waiting for you. At least for me, this is far more likely to happen than technique #1 or #2.

## 4. ???

Those are a few things I've been doing to get my dev flow back quickly, but I'm sure there are others. Do you have any tricks up your sleeve? I'd love to hear 'em!

[flow]:https://amzn.to/hL0XDk
[dirty]: https://thepracticaldev.s3.amazonaws.com/i/kwu7rfdqtcdch2zndyb3.jpg
Open source contribution for beginners?!
Tags: opensource, javascript, beginners, help
Published: 2019-01-17 15:21:13

---
title: Open source contribution for beginners?!
published: true
description: Open source starting point?!
cover_image: https://thepracticaldev.s3.amazonaws.com/i/1ziqa02krq9xho1mba1l.jpg
tags: #opensource, #javascript, #beginner, #help
---


Hi! I'm an amateur developer looking for a starting point to begin contributing to open source projects, I have a reasonable understanding of OOP 

I work as a web assistant for a university in the UK so currently use Bootstrap, ASP.NET, HTML, Javascript, and CSS confidently on a daily basis.

Currently studying *React* along with topping up on *ES6* and using other frameworks such as PixiJS.

I've also used VB.net, C#, and Python at an amateur level

I'd like to start very simple and work my way up in complexity and build my experience in helping out and improving my development skills.

I have a background in Games Development (UDK and Unity) so helping out with something along those lines would also appeal to me!

Are there any recommendations for projects I can easily get stuck in to?

##Thanks in advance guys!
Launch .Net Core with VSCode for starters
Tags: vscode, dotnet, dotnetcore, debugging
Published: 2019-01-17 14:23:07

To use VSCode for .net core you would need [Omnisharp](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp) extension so that we can debug our application just like as in Visual Studio.
Using the [dotnet new command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new?tabs=netcore21) we create a web and an API project

*dotnet new webapp appname.web
dotnet new webapi appname.api*

Create a solution so that it wraps all the projects in one place

*dotnet new sln appname
dotnet sln add appname.web appname.api*

After building the Web and the API projects we need to create the launch.json which VScode refers to build and debug the application. For a complete reference on doing these projects consider this [great resource](https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/?view=aspnetcore-2.2).

You can always use VSCode terminal to run these above commands as well, also note you can open multiple terminals the same VSCode instance [like this](https://code.visualstudio.com/docs/editor/integrated-terminal#_managing-multiple-terminals).

![](https://thepracticaldev.s3.amazonaws.com/i/bhvammqwn0ne89v4lfh0.png)

Setup the launch.json by clicking on add configuration and select .Net core web app. we will need to add two such configurations one for web and another for web api. 
For web api you need to launch the browser on running the app, disable 

*launchBrowser.enabled: false*

we need to update the Url's for both our applications with different ports

*env.ASPNETCORE_URLS: "https://localhost:5001"*

The build task for the project is defined in tasks.json to which the preLaunchTask references. In below example launch.json I have created two tasks to be executed before running the application. This is how we execute multiple tasks we need to chain each task with the first task name mentioned in *preLaunchTask* and the rest in tasks.json *dependsOn* property.

F5 and launch with debug mode on!

Below are the complete launch.json and tasks.json

{% gist https://gist.github.com/unrealnerd/5e26ebb734e495032ece48bd7d8295a9 %}

{% gist https://gist.github.com/unrealnerd/b03f0fcec07ae5cae94e1985f9e7fc25 %}

-originally posted on [Bitsmonkey](https://bitsmonkey.blogspot.com/2019/01/launch-net-core-with-vscode-for-starters.html)
Welcome Thread - v27
Tags: welcome
Published: 2019-01-17 14:19:10

---
title: Welcome Thread - v27
published: true
description: Introduce yourself to the community!
tags: welcome
---

Hey there! Welcome to dev.to!

![An orange clay person enthusiastically waves hello!](https://media.giphy.com/media/l0MYPVhG6OKv9yivm/giphy.gif)

Leave a comment below to introduce yourself to the community! ✌️

Here are some ideas to get you started:

1. You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment and say hello or ask them a question. 👋

3. Or answer this question: what's one post or article you would recommend to someone?
Simple solution for generating forms in Laravel
Tags: laravel, webdev, php
Published: 2019-01-17 14:19:00

Hi There. I wanted to share with you my solution for generating form elements quickly in Laravel. Without the use of any external library or packages, just using simple Blade directives.

I am not a huge fan of working with html forms, they are messy and complicate things. So I usually would use a package like `laravelcollective/html` to generate forms. Since my need was pretty basic I wanted a basic solution so I made my own form package, sort of. I will explain along the way. Let's get going.

> *Check out my side project [LaravelCollections.com](https://laravelcollections.com/?utm_campaign=form-article) - it's a growing collection of great resources for Laravel developers.*

### Solution
You may know that you can `include` partials in your Blade layout file. So, I made a bunch of form components that can be customized (to a degree) and included anywhere in your Laravel app. Let's go through what I did.

First off, this is a default bootstrap form element.
![A Bootstrap email input](https://imgur.com/K0MYH6Z.png)

I copied this code into a file named `input.blade.php` under the folder `resources/views/form`. Now, I can include this input file in my form using `@include('form.input')`, but it will not be of any use if we cannot customize some attributes. So to allow changes to the attributes, I introduced variables in my file.

![Adding customization to basic input](https://imgur.com/DxU2qR9.png)
As you can see, I make use of variables to populate various attributes. So, if I set `$l`, it will be the label for my input. We can pass extra data into this partial using `@include('form.input', ['$l' => 'Email', $n => 'email', $p => 'Enter you email' ....])`. There's a catch when using variables in a partial, they all have to be set, otherwise, Laravel throws an error.

We need to be able to set default values in case they are not set from the parent view. So to do this, I used the `@php` directive in Blade, this way we can check the variables values and set them if they are empty.

![Setting default values for the variables](https://imgur.com/9vWYawp.png)

You might have notices that I left out `$n` and `$l`, because they are important, we need to know if they are not set, the form will not submit without setting them.

Below is an example of how I would use this component in a form.
![Using the components in a form](https://imgur.com/nF0lW3R.png)

Using the same technique, I have created multiple types of input elements like `select`, `textarea`, `checkbox`, `submit`, even one for jQuery Select2 plugin and so on.

### Conclusion
I hope this solution is of some use in your development. I have created a [Github Gist](https://gist.github.com/skadimoolam/f2afa4a2a036ce62e0280be056d164de) with the different components I use, if you are interested, do take a look.

If you have any doubts or questions or have an improvement do let me know.
Thank You.

Adi - [Simplest Web](https://simplestweb.in/?utm_campaign=form-article)
Git: Backup and Restore GPG and SSH Keys
Tags: tutorial, linux, git
Published: 2019-01-17 14:14:36

---
title: Git: Backup and Restore GPG and SSH Keys
published: true
description: Instructions to back up and restore your Git keys
tags: #tutorial #linux #git
---

To sign your commits, you can use SSH (as explained in [this article](https://dev.to/mattdark/gitlab-authentication-and-signing-with-ssh-keys-2dal)) or [GPG](https://docs.gitlab.com/ee/user/project/repository/signed_commits/gpg.html) keys.

Through this blog post, you will learn how to back up and restore your keys in case of changing device or reinstalling operating system.

## Backup and Restore

### SSH

To back up your keys:

* Copy both `id_x` and `id_x.pub` from `~/.ssh/` to a USB drive

Where `x` is any of the [supported SSH key types](https://docs.gitlab.com/ee/user/ssh.html#supported-ssh-key-types) by GitLab, as shown in the following table:

Algorithm | Public key | Private key
---|---|---
ED25519 (preferred) | id_ed25519.pub | id_ed25519
ED25519_SK | id_ed25519_sk.pub | id_ed25519_sk
ECDSA_SK | id_ecdsa_sk.pub | id_ecdsa_sk
RSA (at least 2048-bit key size) | id_rsa.pub | id_rsa
DSA (deprecated) | id_dsa.pub | id_dsa
ECDSA | id_ecdsa.pub | id_ecdsa

To restore your keys, follow the instructions:

* Copy both `id_x` and `id_x.pub` to `~/.ssh/`
* Change file permissions and ownership of both files

```bash
$ chown user:user ~/.ssh/id_rsa*
$ chmod 600 ~/.ssh/id_rsa
$ chmod 644 ~/.ssh/id_rsa.pub
```

Where `user` is the username that you log in to your system with.

* Start the `ssh-agent`

```bash
$ exec ssh-agent bash
```

* Add your SSH private key to the `ssh-agent`

```bash
$ ssh-add ~/.ssh/id_rsa
```

### GPG

* Identify the private key by executing the following command.

```bash
$ gpg --list-secret-keys --keyid-format LONG
```

It will show something similar to this.

```bash
sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
```

Characters after the slash are the ID of the private key.

* Export the private key.

```bash
gpg --export-secret-keys $ID > my-private-key.asc
```

`$ID` is the value of the ID of your private key, that was obtained previously.

* Copy my-private-key.asc to a USB drive.

To restore:

* Copy the `my-private-key.asc` file from the USB drive and paste it in the device where you want to import it

* Import your GPG key

```bash
$ gpg --import my-private-key.asc
```

Once the keys are imported, you can continue siging your commits.

---

[![Support me on Buy Me A Coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzx9uenqvwqv1vp8ub5d.png)](https://buymeacoffee.com/letstalkoss)
Which tool/s do you use to test react projects and why ?
Tags: discuss, experience, testing, react
Published: 2019-01-17 13:39:57

This is a discussion.

Which toolset you use in your react projects for unit test, code coverage and e2e test and why ?

Did you ever face a serious problem which made you think to switch other option/alternative?
If yes, what did you do ?

Have you ever went deep into the module and contributed for new issue which nobody else logged (like creating an issue and pull request for it) ?

Please share your experiences. Let's go dev.to learn and share.
How do you publish iOS apps which developed by another company?
Tags: ios, publisher, discuss
Published: 2019-01-17 13:09:07

---
title: How do you publish iOS apps which developed by another company?
published: true
description: Imagine that you are a publisher and there is a company that wants to publish their app with you. Would/do you access their codes and build yourself or grant them some permissions from your developer account? If you prefer the second one, which permissions are enough and how do you manage the process?
tags: ios,publisher,discussion
---

Imagine that you are a publisher and there is a company that wants to publish their app with you. Would/do you access their codes and build yourself or grant them some permissions from your developer account? If you prefer the second one, which permissions are enough and how do you manage the process?
Mobile App Freelancer in India 
Tags: freelancermobileappi
Published: 2019-01-17 11:33:20

---

title: Mobile App Freelancer in India 
published: true
description: proficient web developer specializing in creating IOS, Android and web application development from complete scratch. Based in India, I spend my days working on different modules of application development. Things like back-end programmingwithadvancedlanguagelikeMySQL,CodeIgniter,Angularjs,Symphony,Slim,Zend,Laravel, Cake Php, ASP .NET,PHP, Python, etc, also front-end engineering of web and application development like HTML5, Less CSS, Sass, Xamarin, Android, iOS and MEAN Stack, along with digital accessibility, visual design and user experience of every app project is taken care of by me.


tags: Freelancer Mobile app I
---
Error: Your render method should have return statement
Tags: react, render, state
Published: 2019-01-17 10:58:09

---
title:  Error: Your render method should have return statement
published: true
description: 
tags: React, render, state
---

React complains about the following code with the error:  Your render method should have return statement. 

Could you please explain what is exactly wrong with my code inside ToDoItems.js?

**ToDoItems.js**

```
import React, { Component } from 'react';

class Kir extends Component {
  state = {
    todos: [
      {
        id: 1,
        text: 'Take out the trash',
      },
      {
        id: 2,
        text: 'Grocery shopping',
      },
      {
        id: 3,
        text: 'Clean gecko tank',
      }
    ]
  };

  render() {
    const todoItems = this.state.todos.map((todoItem, index) => {
      return (
        <div key={index}>
          <label>
            <input
              type="checkbox"
              value={todoItem.text}
            />
            {todoItem.text}
          </label>
        </div>
      );
    });
  }
}

export default todoItems;

```


**ToDo.js**

```
import React, { Component } from 'react';
import todoItems from './ToDoItems';

class ToDo extends Component {
  render() {
    return (
      <form>
        {todoItems}
      </form>
    );
  }
}

export default ToDo;

```
YaneuraOu NNUE-K-P-256-32-32用評価関数バイナリの使い方
Tags: shogi, engine, nnue
Published: 2019-01-17 10:17:45

---
title: YaneuraOu NNUE-K-P-256-32-32用評価関数バイナリの使い方
published: true
description: 
tags: shogi, engine, nnue
---

1. [YaneuraOu NNUE-K-P-256-32-32用評価関数バイナリ nn.bin](https://github.com/yaneurao/YaneuraOu/releases/tag/20190115_k-p-256-32-32)から
`20190115_k-p-256-32-32.zip`と`Source code (zip)`をダウンロードする。
2. `Source code (zip)` を unzipし、sourceフォルダーに入る
3. `nnue/nnue_architecture.h`の
#include "architectures/halfkp_256x2-32-32.h"
をコメントアウト。代わりに
#include "architectures/k-p_256x2-32-32.h"
とする。
4. `Makefile` で `YANEURAOU_EDITION = YANEURAOU_2018_TNK_ENGINE`を有効にする
5.  `make` 実行し、実行バイナリ `YaneuraOu-by-gcc` を作成
6. `mkdir -p eval` の上、 `20190115_k-p-256-32-32.zip`に含まれる `nn.bin` を取り出して、 `eval` フォルダーに置く
Fix of Angular-cli 'JavaScript heap out of memory' error while running 'ng serve'
Published: 2019-01-17 10:11:42

---
title: Fix of Angular-cli 'JavaScript heap out of memory' error while running 'ng serve' 
published: true
description: 
tags: 
---

__First option:__
Run `node` command as:
`node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve`
where _8048_ is new memory limit in megabytes (by default it's ~_1500_).

Or add the command to _package.json_ file:

`"build-serve": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve"`

and run as `npm run build-serve`

__Second option:__
The quick and effective solution for _Windows_
Open `C:\Users\userName\%AppData%\Roaming\npm`
Copy/paste the following code into `ng.cmd`:
```
@IF EXIST "%~dp0\node.exe" (
    "%~dp0\node.exe" --max_old_space_size=8048 "%~dp0\node_modules\@angular\cli\bin\ng" %* 
) ELSE (
    @SETLOCAL 
    @SET PATHEXT=%PATHEXT:;.JS;=;% 
    node --max_old_space_size=8048 "%~dp0\node_modules\@angular\cli\bin\ng" %* 
)
```

UPD (7 May 2020)
__Third option:__
Set it as an environment variable.
`SET NODE_OPTIONS=--max_old_space_size=8048`
Thanks to @jonyadamit for sharing

__Cheers!__
Dapp.com 2018 Dapp Market Report
Tags: dapps, marketreport, blockchain
Published: 2019-01-17 05:32:48

---
title: Dapp.com 2018 Dapp Market Report
published: true
description: Dapp.com's 2018 dapp market report summarizes data and provides insights into 4 mainstream blockchains - Ethereum, EOS, TRON, and Steem. 
tags: dapps, marketreport, blockchain
---

Some highlights:

- 2018 was the first year of the “dapp movement”, although the cryptocurrency market was bumpy, the entire dapp market was flourishing and it contributed $6.7 billion throughout 2018. A fun fact - compared to 2009, the year Apple opened its App Store, there were over 65,000 mobile apps built on iOS and generated $4.2 billion in revenue. 
 

- In 2018, DEX is the core contributor to the dapp market with almost 40% of the total transaction volume. Cryptocurrency trading was still in high demand and decentralized exchanges had proven to be one successful use cases of dapps.

 
- Betting dapps took over the dominating role in the market since Q4 last year. There was a total transaction volume of almost $3 billion in Q4, almost 44% of the total volume in 2018. Betting has become the “killer apps” on blockchain due to proven fairness. The booming betting dapp market was mainly contributed by EOS and TRON, the two high-speed DPoS blockchains built for decentralized apps.

 
- The number of blockchain gaming dapps was still leading with a large proportion of 35%, following by pyramid (20%) and betting (around 20%). Overall, the dapp market is still driven by entertainment and gambling.


You can read the full report here - https://www.dapp.com/article/annual-dapp-market-report-2018

Let us know your feedback and thoughts!
Socket Programming in C: What is a Socket?
Tags: c, sockets, networking
Published: 2019-01-16 19:35:01

This is the post that marks the beginning of this series. A journey, when arrived at the end, will give you control over sockets. No longer will they be disorderly or out of your reach because you will be the one to have dominion over them. Bending their will to yours and serving your every whim.

People dream to have this kind of power and you can be the one to achieve it only if you read this series to its conclusion.

Of course, you can still get this kind of power from other great tutorials out on the internet but it would be appreciated if you stuck till the very end.

Let us begin this journey!

What is a socket? Simply put, a socket is an endpoint for where the data will be sent to and received. Sockets are used as a generalized means of communication between different processes on the same computer or one on the same network. Because everything in a Unix based OSes is a file or can be represented as one, processes identify sockets by their file descriptor.

Sockets come in different flavors. Each flavor specifies the guarantees and leniency that is given. From now on this will be known as communication styles. Next, what protocol is used? This is where the low-level details and mechanisms tell how the data is transmitted and received.

Communication styles can be thought of as a series of questions that are given a different answer depending on the socket's communication style.

* Units used?

Some styles regard data as simply bytes with no structure whatsoever. Others think data as being grouped into a structure determined by the style.

* Loss during transmission?

Will the occasional drop of a packet matter overall? Will the packets received on the other end be in the same order as it was sent? Some styles guarantee that all packets transmitted will be retrieved in the same order and that if a packet is dropped, it is resent. Other styles of communication may allow some packets to drop. Packets may also arrive more than once and out of order. Programmers who use such sockets must place safeguards in their code to accommodate for the unreliability of this communication style.

* Partner?

The traditional way of thinking a socket is similar to the client-server relationship, where both parties can freely exchange data with each other. There is also a one-sided version: stamp the address and send the data on its way.

How do we set the endpoint for a socket? Each socket is paired with a socket address, or in other words, the IP address and a port number. Setting a socket's address is called binding.

## Next

For the next article, we will discuss the different kinds of communication styles that we can use.
Do the developer's rights exist? 
Tags: discuss
Published: 2019-01-17 03:09:20

---
title: Do the developer's rights exist? 
published: true
tags: discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wt4kpmmm0aq1z7sh29ln.png
---


#Why rights?
In many countries and in many companies the conditions in which developers work are not the most appropriate like bad hardware, bad salaries, a toxic work environment, etc.
What do you think would be the rights that a programmer should have to be able to do their job well and the optimal conditions to do it.
Advice for first-time conference applicant 
Tags: discuss, conference
Published: 2019-01-17 02:42:37

---
title: Advice for first-time conference applicant 
published: true
description: 
tags: discuss, conference
---

I've got a few different ideas rolling around in my noggin that could potentially be turned into conference talks.  Anyone have any advice on writing/giving talks on technical subjects? 

![thanks](https://media.giphy.com/media/3oEdva9BUHPIs2SkGk/giphy.gif)