teleren/devto huggingface dataset:
How do you handle Burnout(s)🔥?
Tags: discuss
Published: 2019-02-02 11:32:32

---
title: How do you handle Burnout(s)🔥?
published: true
description: How to rejuvenate yourself/others after falling victim to burnouts
tags: discuss
---
![taken from topspeed.com](https://thepracticaldev.s3.amazonaws.com/i/5wzm98aijbivui1m19aa.jpg)
We all get to that point at-least once in a while where the dev life becomes unbearable. The work/hobby you once loved becomes a source of stress and sadness. We loose the zeal and drive to work. How well have you been able to mitigate this or how does the company you work for ensure that developers don't reach a breaking point?
Want to write backend in typescript.
Tags: webdev, career, typescript, meanstack
Published: 2019-02-02 10:44:38

---
title: Want to write backend in typescript.
published: true
description: I code backend using node,express and mongodb and now want to write in typescript so how should I start , can anyone please share some resources to learn backend using typescript, node and mongodb with angular frontend  ?
tags: webdev, career, typescript, mean-stack
---
Five Indications For Makers That You're Doing Fine
Tags: productdevelopment, learning, starting, entrepreneurship
Published: 2019-02-02 08:30:07

---
title: Five Indications For Makers That You're Doing Fine
published: true
description: When you first start out or just shipped product there are lots of indicators that show you if you're doing fine. But not every indicator looks positive at first
tags: productdevelopment, learning, starting, entrepreneurship
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nn86l2th6xpra6tpl8qb.png
---
![Five Indications For Makers That You're Doing Fine](https://thepracticaldev.s3.amazonaws.com/i/nn86l2th6xpra6tpl8qb.png)

There are lots of ways that people start to interact with you as soon as you ship product, or start to share your take on things. Some are good, some are negative. But no matter what side of the coin their on, you can look beyond the interaction itself and even find out that it's a sign that you're doing just fine.

I wrote a post on five indicators that at least show you that you're on a good path and that you're being taken serious.

You can read the full post here: https://www.shipharder.com/five-indications-for-makers-that-youre-doing-fine/

As a short reference, here are the indicators:
1. The Bounce Rate on your (product) page is going down
2. People interact with you or your content online (likes, shares, and comments are increasing)
3. Trolls find you and try to shake up your tree
4. Companies and professionals interact with you and want to share visions or cooperate
5. People are reaching out on a personal note. They relate to what you're saying or your product and want to connect. This last one is very strong 💪🏻

What (hidden) indicators do/did you notice when you're starting out or just launched your product?

Code Hard,Ship Harder - shipharder.com 

If you have a sec and want to support me, please like or share my post 🙌🏻
Goldbach Conjecture And A Simple Approach in C
Tags: goldbachconjecture, goldbach, c, programming
Published: 2019-02-02 07:53:25

---
title: Goldbach Conjecture And A Simple Approach in C
published: true
description: Goldbach Conjecture and Example Solution With C Programming Language
tags: goldbach conjecture, goldbach, c, programming
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ohg55reu888cm3pojue5.jpeg
---

The Goldbach conjecture is the claim that every double integer greater than 2 can be written as the sum of two prime numbers. It is one of the biggest mathematical problems that cannot be proved.

In the original Goldbach hypothesis, Goldbach claims that every integer greater than 2 can be written as the sum of 3 prime numbers. This claim was put forward with the assumption that the number 1 is the prime number. But now 1 is not a prime number. This claim, which we treat as a Goldbach conjecture, consists of Euler's correction that “every double integer greater than 2 can be written as the sum of two prime numbers".

For example; 4,6,8,10 and 12 numbers can be write as 2 prime number pairs.

4 = 2 + 2
6 = 3 + 3
8 = 3 + 5
10 = 5 + 5

This example C code, which allows a double integer greater than 2 to be written as two prime numbers. E.g. 124620; 

124620 = 19 + 124601

```c

#include <stdio.h>

//Function declerations
int is_prime(int n);
void goldbach(int g);

int main(){
	int number = 0;
	while(1){
		printf("Enter even number:");
		scanf("%d",&number);
		if(number>2 && number%2==0){
			goldbach(number);
		}
		else{
			printf("Incorrect number!\n");
		}
		printf("\n");
	}
	return 0;
}


//Check is prime number?
int is_prime(int n){
	int flag = 1;
	for (int j = 2; j < n/2; j++)
	{
		if((n%j) == 0){
			return flag-1;
		}
	}
	return flag;
}


//Goldbach solution of a double integer greater than 2
void goldbach(int g){
	int i = 2;

	for (int j = g-i; j > 2; j--)
	{
		if(is_prime(i) == 1 && is_prime(j) == 1)
		{
			printf("%d = %d + %d\n",g,i,j);
			break;
		}
		i++;
	}
}

```

All two prime pairs. E.g. 16;

16 = 3 + 13
16 = 5 + 11
16 = 11 + 5
16 = 13 + 3


```c
#include <stdio.h>

//Buffer for primes
int primes[100000] = {2};
int j = 0;

//Function declerations
int is_prime(int n);
void goldbach(int g);

int main(){
	int number = 0;
	while(1){
		printf("Enter even number:");
		scanf("%d",&number);
		if(number>2 && number%2==0){
			goldbach(number);
		}
		else{
			printf("Incorrect number!\n");
		}
		printf("\n");
	}
	return 0;
}

//Check is prime?
int is_prime(int n){
	int flag = 1;
	for (int j = 2; j < n/2; j++)
	{
		if((n%j) == 0){
			return flag-1;
		}
	}
	return flag;
}

//Goldbach solutions of a double integer greater than 2.
void goldbach(int g){
	int flag = 0;

	if(primes[j]<g){
		for (int i = primes[j]+1; i < g; i++)
		{
			if(is_prime(i) == 1){
				j++;
				primes[j] = i;
			}
		}		
	}

	for (int i = 0; i < j; i++)
	{
		for (int k = 0; k < j; k++)
		{
			if(primes[i] + primes[k] == g){
				printf("%d = %d + %d\n",g,primes[i],primes[k]);
				break;
			}
		}
	}

}

```
How can i make the same Button to display and hide? 
Tags: javascript, html
Published: 2019-02-02 07:30:43

---
title: How can i make the same Button to display and hide? 
published: true
description: 
tags: #javascript #html 
---
*********************HTML*********************
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Ajax</title>
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
</head>
<body>

<button id=btn>Click It To Display</button>
<button id="btn-2">Click It To Hide</button>

<div id="output">
	
</div>










<script src="app.js"></script>	
</body>
</html>

**************************Javascript******************************
document.getElementById('btn').addEventListener('click', loadFunction);

function loadFunction(){

	let xhr = new XMLHttpRequest();

	xhr.open('GET','Data.txt', true);

	xhr.onload = function(){
		if(this.status === 200){
			document.getElementById('output').innerHTML = `<h1>${this.responseText}</h1>`;
		}
	}
	xhr.send();
	document.getElementById('output').style.visibility = 'visible';
}
document.getElementById('btn-2').addEventListener('click', loadFunction2);

function loadFunction2(){
document.getElementById('output').style.visibility = 'hidden';

}
How do you start your side projects?
Tags: javascript, jamstack, gatsby
Published: 2019-02-02 14:49:52

---
title: How do you start your side projects?
published: true
tags: javascript, jamstack, gatsbyjs
canonical_url: https://www.codingblocks.net/programming/how-do-you-start-your-side-projects/
---

I’ve got a small project that I need to complete for an upcoming presentation on [JAMstack](https://jamstack.org/). Since I was starting the project from scratch I decided to record the process so I could _see_ how I spent my time.

**Here is the video:**

{% youtube eb5wg80FQXM%}

I started out by trying to define my goals for both the presentation and for this coding session. Then I spent some time installing requirements and setting up [Github](https://github.com/codingblocks/dev-conferences) and [Netlify](https://www.netlify.com/). I eventually got around to gathering some data and plumbing it through to the index page which completed my planned goals for the night. 

### So here it is!

![](https://www.codingblocks.net/wp-content/uploads/2019/02/result.png)

Now don’t get me wrong, the project looks awful and it's still full of all the example code that came along with the [starter I choose](https://github.com/konsumer/gatsby-starter-bootstrap-netlify). But because I made my session goals I feel happy about the progress.

I looked at how much actual code I wrote in that ~2 hours: [22 lines](https://github.com/codingblocks/dev-conferences/commit/8e00e091684c5221c7e0e59a7bf29639264239f0) and many of them are just curly braces! I expected that most of my time would be spent setting up my new computer and interacting with 3rd party services and documentation but seeing that number was disheartening. Especially when I felt so good about hitting my goals for the night.

So am I deluding myself? Do I feel good about the project because of the progress or because I checked some boxes? Am I cheating myself?


### ...Maybe?

Maybe I am falsely tripping my [dopamine reward system](https://www.psychologytoday.com/us/blog/wired-love/201507/the-dopamine-reward-system-friend-or-foe) by checking my own made-up boxes but I do think that the bones of the project are solid and I am in a good spot to iterate towards the end state.

Being on time and under budget is unfortunately **NOT** common in software development, so I plan on enjoying this time while it lasts!


* * *

So, what do you think, does this look anything like how you kick off your side projects?


PS: You can check out what the [site looks like now](https://cocky-nightingale-7abbdc.netlify.com/), or clone the project out on [github,](https://github.com/codingblocks/dev-conferences)
Containerize an Application
Tags: dotnetcore, docker, devops
Published: 2019-02-02 05:53:18

Here is how we containerize an application in this example I have chosen a dotnetcore application.

Add a Dockerfile which will be used to create an image for your application. Below is the sample.

{% gist https://gist.github.com/unrealnerd/2464ea3c8d2ff427c64411777e520682 %}

*FROM [microsoft/dotnet:2.2-sdk](https://hub.docker.com/r/microsoft/dotnet/) AS build* this basically says create our application based on this Microsoft image.

Navigate the shell to your application folder and then using *[docker run](https://docs.docker.com/engine/reference/commandline/run/)* create an image for your application.

`docker build -t sampleapp.`

you can see your image using *[docker images](https://docs.docker.com/engine/reference/commandline/images/)*. Finally that you have your image ready we can create as many container we need using this.

There are two options to create a container out of the image you just created either use this below command

`docker run -d -p 8080:80 --name sampleapp appcontainername`

or use the *docker-compose.yml* file from the app folder. Which consists the exact same information as yml file. Then use

`docker-compose up`

in the application folder from the shell.

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

now you must be able to see you web page on docker's ip and your port 8080.

**Some useful docker commands**

*default* is the docker machine's name in this example.

`docker-machine regenerate-certs default`

Every time our machine restarts DOCKER_MACHINE(environment variable) gets new ip and certs needs to be regenerated using this command.

`docker-machine ls`

will list the docker machines.

`docker machine env default`

will list the environment variables required for the machine.

`docker-machine env default --shell bash`

will get the command to run to set the environment variable using bash as shell in this sample.

`eval $("C:\Users\bitsmonkey\bin\docker-machine.exe" env default --shell bash)`

will set the environment variables required for docker to use this machine.

you just Containerized!!!

Photo by frank mckenna on Unsplash
Originally Posted on [BitsMonkey](https://bitsmonkey.blogspot.com/2019/02/containerize-application.html)
For Freelancer Developers/Web Design Companies, do you outsource your hosting or do you use your own Infrastructure?
Tags: discuss, freelance, webagency, help
Published: 2019-02-02 03:10:51

---
title: For Freelancer Developers/Web Design Companies, do you outsource your hosting or do you use your own Infrastructure?
published: true
tags: discuss, freelance, web agency, help
---
<iframe width="560" height="315" src="https://soundcloud.com/icenreyes/rape-project-cold-handsmp3" frameborder="0" allowfullscreen></iframe>

I'm a very ambitious person but I know I'm a still pup surrounded by Great White Sharks and Megalodons so I need your help. 

It's been 2 weeks since I've sent my first proposal to friends' for web design, hosting, management & dev but everyday after I've sent them, I've been very skeptic about the hosting price I've designed for my service.

### Before I've sent those.. I first...

Sent out applications to be an affiliate for hosting companies but was only accepted by two, which I think is still awesome and is a reliable & growing hosting company. Do you think I should just outsource hosting with [BlueHost](https://www.bluehost.com/track/vagrys/) which charges $x.xx/month for the Shared Hosting, [Hostinger](https://www.hostg.xyz/aff_c?offer_id=6&aff_id=10823) which charges $x.xx/month or should I go for the AWS Lightsail Linux/Unix server at $x.xx/month?

Another idea I've got from learning on Udemy is to use a LAMP Server, but as of writing, I think this would be feasible for corporations, not Small Companies. Any idea what the forecasted cost would be on a website with 1000 monthly visitors?

I just want to get a different perspective/opinion on these so won't I zoom in too much on the details of each plan.

Hoping for any thoughts and ideas!

Cheers! :beer:

<iframe width="560" height="315" src="https://soundcloud.com/icenreyes/rape-project-cold-handsmp3" frameborder="0" allowfullscreen></iframe>
Default route not set on Ubuntu VM in Azure (via DHCP)
Tags: dhcp, linux, networking, azure
Published: 2019-02-02 02:01:52

---
title: Default route not set on Ubuntu VM in Azure (via DHCP)
published: true
description: DHCP related issues in bringing up linux VM on various cloud platforms
tags: dhcp, linux, networking, azure
---


## Misadventures in bringing up the same Ubuntu image on different hypervisors

I recently stumbled upon a couple of rather nasty issues when bringing up a server on a variety of hypervisors (and cloud IaaS). Now, admittedly, I was doing something "not normal" - i.e - trying to bring up a VM that was a replica of one that had worked on VMWare ESX (using a `dd` copy of the disk) on other platforms. What struck me was that the VM would:

1. boot up normally on VMWare (obviously), networking configured via DHCP
2. boot up normally on AWS, networking configured, instance was SSH'able
3. boot up normally on Azure, but would not get any default routes, so *no SSH*!

After some poking around, I learnt a couple of lessons

## 1. `dhclient` has multiple ways in which it will set a default route

These are based off the response from the DHCP server. Now,

1. some DHCP servers return `Classless Static Routes` option
2. some DHCP servers return `Router` option

After a lot of debugging (which is excruciatingly painful, since the only real "debug tool" available for these issues is using the `debug` script in `/etc/dhcp/dhclient-exit-hooks`) I figured out that one environment worked fine because it was using the `Router` option whereas on Azure the DHCP server sends back the `Classless Static Routes` option.

And dhclient prefers the `Classless Static Routes` option (see [here](https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1363827.html)

On VMWare, and on AWS the DHCP server actually uses the `Router` option, which is why it worked fine across those 2 environments.

Okay, so that solves one mystery - but given that dhclient should know how to handle both options - why wasn't it working for my VM on Azure?

## 2. `dhclient-exit-hook` scripts are sourced

On further investigation, it turned out that one of my dhclient-exit-hook scripts was doing the "wrong thing" and terminating early due to a misplaced `exit 0`.

It is not clearly mentioned anywhere (neither man-pages, nor on the interwebz) that the dhclient-exit-hook scripts are actually sourced rather than executed.

It turned out that one of my custom scripts was "exiting" the execution, thus causing some of the remaining scripts to not run. Most notably, there is a default script on Ubuntu that deals with the `Classless Static Routes` option (called `rfc3442-classless-routes`) that actually handles this correctly. However since the scripts are sourced in lexicographical order, this script would never run because of my aforementioned problem.

One last thing of note - this [post](https://serverfault.com/questions/780604/dhclient-doesnt-set-default-gateway/780739#780739) on StackExchange was immensely helpful in me finding the root cause of my problems.
Quick and Dirty Aspect Oriented (AOP) Javascript with a Couple Dozen Lines of Code
Tags: javascript, programming, coding
Published: 2019-02-02 00:35:11

---
title: Quick and Dirty Aspect Oriented (AOP) Javascript with a Couple Dozen Lines of Code
published: true
description: 
tags: javascript, programming, coding
---

Aspect oriented programming (AOP): everybody's talking about and nobody's doing it.  Actually, nobody's even talking about it, because they would be if there were sufficient use cases; we will return to that at the end.

A year or two ago though I needed to somehow augment a callback function in Javascript, and when I found [the following Stackoverflow answer](https://stackoverflow.com/a/9828751/34806) I was immediately reminded of AOP.  The code follows:

    var original = callback; //existing function
    callback = function() {
        // Do something with arguments:
        console.log(arguments);
        return original.apply(this, arguments);
    };

In AOP the original function still executes as it normally would, it's just that it gets augmented with other behavior.  I refer you to the [wikipedia article](https://en.wikipedia.org/wiki/Aspect-oriented_programming) for a more formal definition, but will specifically rely on the following use case it mentions: "log all function calls when the function's name begins with 'set'".

I've implemented this at the [following repl](https://repl.it/@dexygen/quickAndDirtyJsAOP); you can go there and click "Run" to see it in action.  The code also follows:

	const myModule = (function() {
	  let result;
	  const my = {
		setResult(x,y) {
		  result = x + y;
		},
		getResult() {
		  return result;
		}
	  }
	  return my;
	})();

	const predecessor = function() {
	  console.log('arguments: ', arguments);
	}

	let precedableFns = {};

	for (let fname in myModule) {
	  if (/^set[A-Z]/.test(fname)) {
		precedableFns[fname] = myModule[fname]; //save original function
		myModule[fname] = function() {
		  predecessor.apply(this, arguments);
		  precedableFns[fname].apply(this, arguments); //run original
		}
	  }
	}

	myModule.setResult(2,3);
	console.log(myModule.getResult());

	myModule.setResult(3,4);
	console.log(myModule.getResult());


There are a lot of possibilities beginning from the above.  For one, you might have a "successorFn" that gets executed from a `setTimeout` immediately before/after (before lexically, after functionally) a function returns.

And a more interesting use case might be to only perform console logging when the server host is `localhost` or some other value you are interested in.  The possibilities are endless, if somewhat arcane.
What was your win this week?
Tags: weeklyretro, discuss
Published: 2019-02-01 22:34:32

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: weeklyretro, discuss
--- 

Let's end the week on a high note. 

Looking back, what was something you're proud of?

All wins count -- big or small!

Examples of 'wins' include:
- Getting to all your meetings on time
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄


🎉
Who in your life deserves a shout out right now??
Tags: weeklyretro, discuss
Published: 2019-02-01 22:26:47

---
title: Who in your life deserves a shout out right now??
published: true
description: What do you want the world/your friends/colleagues to know?
tags: weeklyretro, discuss
---

Leave your shoutouts here! What do you want the world/your friends/colleagues to know?

Shout-out-worthy examples: 

- "Shoutout to everyone on my team for dealing with a crazy outage this week!"
- "I want to wish @my_fellow_bootcamp_grad best of luck on their interview!"
- "I want to celebrate [@andy](https://dev.to/andy) for walking through parts of the codebase I've never had to parse through before! Pun intended ;)
Retired, Apparently
Tags: career, ruby, opensource, github
Published: 2019-02-01 21:23:21

---
title: Retired, Apparently
published: true
description: 
tags: #career #ruby #opensource #github
---
Last week marked the second anniversary of my most-recent paycheck, and next week marks the 76th anniversary of my birth.

So I think I'm retired (unless I get a good job offer).

Now my days are spent working on open-source software on [GitHub](https://github.com/BurdetteLamar), some of which turns up as gems on [RubyGems](https://rubygems.org/profiles/BurdetteLamar).

My career in commercial software began on December 13, 1976, and (apparently) ended on January 27, 2017.  Half of that was in Eastern New England, and half in Houston, comprising gigs in:

- DEC (Digital Equipment Corporation)
- Micrognosis
- DEC (again)
- Di-Tech (not the loan people)
- Alliant Computer Systems
- Interleaf
- Sun Microsystems
- Visual Numerics
- Telescan
- Pentasafe/NetIQ
- Encomia
- Emlogis
- Shell Oil
- Hewlett-Packard
- R1Soft

Three gigs as a documentor, five developing applications, and the rest in test automation.

No regrets.

I've been blessed, truly.

So to all y'all still in the industry:  Carry the torch, move it forward, hold it high.
What is the best Framework for Creating RESTful API: Django vs Flask
Tags: help, discuss, python, framework
Published: 2019-02-01 21:01:22

---
title: What is the best Framework for Creating RESTful API: Django vs Flask
published: true
description: What is the best(Django vs Flask) framework to build just the REST API without UI part, and which one works better with MongoDB.
tags: help, discuss, python, framework
---

What is the best(Django vs Flask) framework to build just the REST API without UI part, and which one works better with MongoDB.
bored adventures: built/programmed an lcd display
Tags: tfhdailystandup, arduino, iot
Published: 2019-02-01 19:52:57

---
title:  bored adventures: built/programmed an lcd display
published: true
description: 
tags: #tfhdailystandup #arduino #iot
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/yzeghgwp2m8n7n755or5.jpg" />

 bored adventures: built/programmed an lcd display

Woke up feeling like I needed to do something with my hands and now we’re here —> built and programmed an LCD, it was a fun colorful time 🌈🤖
ALSO, THOUGH, I video documented the experience🔨😄