teleren/devto huggingface dataset:
Relics of the (programming) past
Tags: discuss, watercooler, programming, history
Published: 2019-10-11 05:27:20

---
title: Relics of the (programming) past
published: true
description: Do you have any relics of programming past to share? Photos, stories, memories, memorabilia, books, gadgets, anything you can think of. Feel free to share your thoughts in the comments!
tags: discuss, watercooler, programming, history
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ykhn5gpz3rs00m9dj1dz.jpg
---

Recently I've stumbled upon a book that reminded me of my programming roots.

It all started out sometime around 2001. or 2002. and I still had my old computer with Windows 98 or Windows Millenium. I started programming when I was in 5th or 6th grade and I was creating simple programs with QBasic. Usually for fun or to help me with my math or physics homework.

During that time, someone gifted me a really cool book: "Basic for microcomputers Commodore 64". It's been published in Yugoslavia in 1985. and it's written in the Serbo-Croatian language. 

Really interesting to flip through the pages and have a window into the past where floppy disks and having 64KB or 128KB of RAM were the best thing since sliced bread. I am including a few interesting photos below (sorry, they're a bit blurry).

### Do you have any relics of the programming past to share?

Photos, stories, hardware, books, gadgets, anything you can think of. Feel free to share them in the comments! Looking forward to reading them.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/231bw899r1c80qdptfne.jpg)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/zlq5dv18cskjh9ywh6xr.jpg)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/14806i66a2soyyu4ys3k.jpg)
Digital Ocean: Setup DNS, Nginx web hosting & G Suite for emails
Tags: digitalocean, nginx, gsuite, devops
Published: 2019-10-11 05:21:36

*Originally posted on [Medium](https://medium.com/@tibotiber/digital-ocean-dns-nginx-web-server-google-apps-for-emails-a2648bd8c47b) on May 8, 2016.*

**YMMV:** The code below is given for the environment and use-case I had at the time of writing, adapt it for your requirements.

## Stack

* Web hosting on a Digital Ocean droplet, running Ubuntu 16.04
* Nginx web server, serving www.planecq.com from `/var/www/planecq.com/html`
* G Suite for email
* DNS settings on Digital Ocean

## 1. DNS

### Forward DNS management to Digital Ocean

Go to your domain name registrar, search for the DNS settings and set the following external nameservers:

```
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
```

This may take a while to propagate, up to 48h, but usually around an hour or two for me.

### Direct web traffic for your domain to your droplet

Login to [cloud.digitalocean.com](cloud.digitalocean.com), go to Networking, then Domains. Add a domain and link it to the relevant droplet. After that, click “view” for your newly added domain and add a CNAME record for `www` pointing towards your main A record, in my case `planecq.com.`, with the trailing dot. You should be good to go.

### Direct email traffic for your domain to G Suite

Login to [cloud.digitalocean.com](cloud.digitalocean.com), go to Networking, then Domains. Click “view” for your domain, then “MX”, then hit the “Add Gmail MX records”. You’re done!

## 2. Web Hosting

### Setup Nginx to host your website

Install Nginx:

```sh
sudo apt-get update
sudo apt-get install -y nginx
sudo update-rc.d nginx defaults
```

It should be running after install, you can check with

```sh
sudo service nginx status
```

Add the site’s config file (/etc/nginx/sites-available/planecq.com)

```
server {
       listen       80;
       listen       [::]:80;
       server_name  planecq.com;
       return       301 $scheme://www.planecq.com$request_uri;
}

server {
       listen 80 default;
       listen [::]:80 default;

       root /var/www/planecq.com/html;

       index index.min.html index.html;

       server_name www.planecq.com;

       gzip_static on;
       gzip_proxied no-cache no-store private expired auth;
       gzip_http_version 1.0;

       location / {
                try_files $uri $uri/ =404;
       }
}
```

Note: you can only have one `default` server, so in case you are co-hosting several websites, remember to choose the one you want.

Enable your site:

```sh
sudo ln -s /etc/nginx/sites-available/planecq.com /etc/nginx/sites-enabled/planecq.com
```

Disable the default Nginx site:

```
sudo rm /etc/nginx/sites-enabled/default
```

You can play around with more settings in your site’s config file or in Nginx config (`/etc/nginx/nginx.conf`) to affect all of your websites.

You can now copy your website’s files to `/var/www/planecq.com/html` and it should work once the DNS is propagated. You can already try to hit the site using the IP of your droplet.
Doing Google's Natural Language ClassifyText() in ASP.NET
Tags: todayilearned, aspdotnet, csharp, googleapis
Published: 2019-10-11 04:54:02

I had a profoundly difficult time installing Google.Cloud.Language.V1 into our ASP.NET site yesterday and today. I used the NuGet route. It didn't work. A DLL, I think it was `Grpc.Code.Api` refused to install properly.

So I wrote a wrapper DLL and installed it as a Reference. In that process all the relevant Google DLLs were copied in. I just needed to manually include `grpc_csharp_ext.x64.dll` and `grpc_csharp_ext.x86.dll`

A JSON credentials file is provided by Google when you request the right to do Natural Language calls. I copied that to the server. Also an environment variable (GOOGLE_APPLICATION_CREDENTIALS) needs to be created on the server, its value being the path to the JSON credentials file. Google.Cloud.Language.V1 does all the authorization [automagically](https://www.urbandictionary.com/define.php?term=automagically) in the background.

This is the wrapper, called [Classification](https://github.com/axtens/Classification) (now available on Github).
```csharp
using Google.Cloud.Language.V1;

using Newtonsoft.Json;

using System;

namespace Classification
{
    internal class JsonResponse
    {
        public string Error { get; set; }
        public object Cargo { get; set; }
    }

    public class Classifier
    {
        public static string Classify(string html)
        {
            var document = new Document
            {
                Type = Document.Types.Type.Html,
                Content = html
            };
            string error;
            object cargo;
            try
            {
                var client = LanguageServiceClient.Create();
                ClassifyTextResponse response = client.ClassifyText(document);
                cargo = response.Categories;
                error = null;
            }
            catch (Exception e)
            {
                error = e.Message;
                cargo = string.Empty;
            }
            return JsonConvert.SerializeObject(new JsonResponse()
            {
                Error = error,
                Cargo = cargo
            });
        }
    }
}

```
I hand over the HTML of the website to that, and I get back a JSON string. This is what I get back from the HTML of [SIL](https://www.sil.org/)
```json
{"Error":null,"Cargo":[{"Name":"/Reference/Language Resources","Confidence":0.56}]}
```
This works for most sites, except [one](https://perdaman.com.au) (so far) that seems to dislike me reading the site source with [RestSharp](http://restsharp.org/). I'm going to have a go with [BrowseSharp](https://www.browsesharp.org/).

__PLEASE NOTE__
I haven't included the source to the ASHX handler file that uses the wrapper. That's left as an exercise for the reader.
How to download , apply, revert patches in wordpress
Tags: wordpress
Published: 2019-10-11 04:49:48

To download a patch , go to plugin trac history and download it,.
it is also called as development blog or changelog.
Today I’m going to patch aregato autoresponder plugin by using its changelogs.

The new version of aregato diff file santizes the input ,.
The previous version had the bug which will be easily hacked by cross side scripting.

Get the diff file from below link .

https://plugins.trac.wordpress.org/changeset?old_path=%2Fbft-autoresponder&old=1943235&new_path=%2Fbft-autoresponder&new=1943235&sfp_email=&sfph_mail=

Change log is 1943235 .

 



Scroll to bottom., click on Unified Diff and download the diff file.

Now move the changeset diff file to your wordpress site where bft autoresponder plugin located.

Now I’m going to patch only one file /views/unsubscribe.html.php file.
Move the diff file to

`wp-content/plugins/bft-autoresponder/views/`
 

Now put the following command and replace the filename.diff with your diff file name.
```
=== $ patch -p0 > filename.diff ===
```
It will run the command and give following lines.
```
== The text leading up to this was: ==
== ————————– ==
== |Index: /bft-autoresponder/trunk/views/unsubscribe.html.php ==
== |=================================================================== ==
== |— /bft-autoresponder/trunk/views/unsubscribe.html.php (revision 1943234) ==
== |+++ /bft-autoresponder/trunk/views/unsubscribe.html.php (revision 1943235) ==
== ————————– ==
== File to patch: unsubscribe.html.php ==
== patching file unsubscribe.html.php ==
 ```

Now check the unsubscribe.html.php file . Line no 3 should be changed .

To revert the patch put the following command.

```
$patch -p0 -R filename.diff
```
Common mistake done while using react hooks 
Tags: react, reactnative, javascript, reacthooks
Published: 2019-10-11 04:30:16

Hi all , Many people started using react-hooks including me . The most common issue people face while using hook is infinite loop 


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/i3i8nci8pyoerbukgng9.png)

To avoid such infinite loop all are aware of using the conditions in the array brackets like 

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/daqmqkfftpqi6pjj66y1.png)

We can also use state variables inside the array brackets
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/mkm52hx36tp9ecmuu05a.png)

Whenever the state value changes the useEffect will be rendered again 
 

Now the issue what I'm trying to represent is giving un predictable values inside the array brackets 
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/d4ediacbw64svlm4xbzk.png)

In the above image I'm having the state variable of the type array which consists of multiple objects , when the changes are made react checks for the condition inside the useEffect, whether to re-render the useEffect or not.

Here is the problem since we didn't mention the particular value inside the array of useEffect , so whenever the value inside the state changes react doesn't find any difference and the useEffect is not rendered again even if I change the object value name:'full stack developer' 

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/eowfcfb1dmb7royvprw9.png)

This happens because react can't predict the value changed inside the particular object inside the array.

**Note:  useEffect will identify the change if any new object is added to the array ** 

Thanks for reading!

Happy Coding !
My Hacktoberfest become valid in 0d:-14h:-43m:-58s
Tags: hacktoberfest, opensource
Published: 2019-10-11 03:59:48

---
title: My Hacktoberfest become valid in 0d:-14h:-43m:-58s
published: true
tags: hacktoberfest, opensource
---

Yeay! Hacktoberfest is coming and I have completed the hacktoberfest challenge.

But wait, what happen with the countdown time in my profile?

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/61ez9p9lgi0urv1ptiou.png)

You can watch the gif version [here](https://thepracticaldev.s3.amazonaws.com/i/jrfghz3mh30kfo9v4xu8.gif)

---

Haha, actually when I refresh the profile page it's will become normal again.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/a5k7wmwvzzwufh8b8m8u.png)

How's about your Hacktoberfest challenge guys?
HTML Assertion in JMeter
Tags: jmeter, java, loadtest
Published: 2019-10-11 02:47:28

What is this?
This assertion will check the format of the response is proper HTML or not. In case, there are issues, it will log errors and warnings. 

How to implement this?
In your JMeter test script Add- > Assertions -> HTML Assertion
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/1of04pmz23i350lmpqqb.png)

We are writing errors and warning logs in a file, open this to see the list.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jcblm8uhqxqbqoqutue6.png)

Note
We can provide threshold numbers for errors and warning in the assertion, in that case this will fail only when number of issues are above threshold.
Portfolio Review?
Tags: help, gatsby, portfolio, webdev
Published: 2019-10-11 02:31:09

Hi, I made a portfolio for the first time. I've used Gatsby to make it. I'd like to hear your thoughts on it!

- [Portfolio](https://sahil.surge.sh)
- [Source Code](https://github.com/godcrampy/portfolio) (In case you are curious)

> Thank you! Have a wonderful day! 😄
Using Multiple Linear regression to solve banknote authentication problem
Tags: machinelearning, python
Published: 2019-10-11 02:11:40

To predict whether a given banknote is authentic given a number of measures taken from a photograph.

Dataset used - [**Banknote Authentication Data Set**](http://archive.ics.uci.edu/ml/datasets/banknote+authentication)

It is binary classification problem. The dataset consists of 5 columns as follows: 

**Attributes:**
1.  Variance of Wavelet Transformed image (continuous).
2.  Skewness of Wavelet Transformed image (continuous).
3.  Kurtosis of Wavelet Transformed image (continuous).
4.  Entropy of image (continuous).

**Labels(Target)**

5.  Output (0 for authentic, 1 for inauthentic).

#### Load the dataset
Load dataset into a pandas dataframe from the csv file.
#### Analyse the data
Using scatter matrix.
#### Prepare the data
Break the data (labels and attributes) into two subsets: a test set and a training set.
#### Create the model
Using Linear Regression.
#### Train the model
Train the classifier using training set.
#### Evaluate the model
Evaluate using test set.
Generate confusion matrix for varying threshold values.
Calculate misclassification rate.
Calculate area under ROC.

### Dependence of Misclassification Error on Decision Threshold
![Error rate vs threshold](https://thepracticaldev.s3.amazonaws.com/i/lfmxthl5t0v6vttj4g6i.png)

### In-sample ROC for banknote classifier
![In-sample ROC](https://thepracticaldev.s3.amazonaws.com/i/cxlu9rsm9clg4k52ckdh.png)

### Out-of-sample ROC for banknote classifier
![Out-of-sample ROC](https://thepracticaldev.s3.amazonaws.com/i/1wmk1src480ihpjai6u9.png)

The entire code to this problem can be found on my github profile-
[Code on GitHub - github.com/penthaapatel/BankNoteAuthentication](https://github.com/penthaapatel/BankNoteAuthentication)
🎥 How to Build Your Own Continuous Automation & Build Server - Using Jenkins & Docker - #1
Tags: devops, docker, testing, tutorial
Published: 2019-10-11 01:48:46

Cloud providers everywhere are trying to get you to use their automation pipelines and services. Let's build our own instead.

# Video
{% youtube sENw9EEU2e4 %} 




#####
Cover Photo by [Christopher Burns](https://unsplash.com/@christopher__burns?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/photos/8KfCR12oeUM)
My Shell Aliases
Tags: zsh, cli, shell
Published: 2019-10-11 02:12:03

---
title: My Shell Aliases
published: true
date: 2019-10-11 01:45:17 UTC
tags: zsh, cli, shell
canonical_url: https://www.iamdeveloper.com/posts/my-shell-aliases-1obk/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/5vnflnscj2k2amsyzwkg.jpg
series: Stuff in My Toolbelt
---

Everyone has their favourite aliases for git and the shell. I have written about my git aliases before but not my shell aliases.

{%link https://dev.to/nickytonline/my-git-aliases-5dea %}

It is not a long list, but I have some that I find useful that you may find useful as well. Currently, my preferred shell is zsh. Here is what I currently have in my config.

```bash
alias rimraf='rm -rf'
alias flushdns='sudo killall -HUP mDNSResponder'
alias zshconfig='vi ~/.zshrc'
alias nr='npm run'
alias ni='npm i'
alias y='yarn'
alias story='yarn storybook'
alias code='code-insiders'
alias tw='yarn test:watch'
alias '$'=''
alias zshconfig='vi ~/.zshrc'
```

What's in your shell aliases?

Photo by [Krzysztof Niewolny](https://unsplash.com/@epan5?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/shell?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
PayPal Money Adder 2020 No Human Verification Survey
Tags: paypalmoneyadder, paypalmoneygenerator
Published: 2019-10-11 01:42:13

paypal money adder 2019 no human verification https://www.validgenerator.com/valid-paypal-money-generator-adder/

paypal money adder 2019 download

free paypal money adder 2019

free paypal money generator 2019 no human verification

paypal money generator download

paypal money adder apk 2019

paypal money adder without human verification

paypal generator 2019
Trying to consume an API using axios
Tags: axios
Published: 2019-10-11 01:30:31

I am trying to use axios in my react page, but I could not get the result of my API on the screen. There is something wrong?

import React from "react";
import axios from "axios";

export default class QuestionList extends React.Component {
  state = {
    persons: []
  };
  componentDidMount() {
    axios.get(`http://localhost:8070/api/v1/surveys`).then(res => {
      console.log(res);
      this.setState({ person: res.data });
    });
  }
  render() {
    return (
      <ul>
        {this.state.persons.map(person => (
          <li>{person.question}</li>
        ))}
        <li></li>
      </ul>
    );
  }
}
Day 3 - Some Early Projects
Tags: codenewbie, selftaught, css, html
Published: 2019-10-11 00:27:50

As I am learning from videos, a lot of the projects have been planned and I don't get to hear the decisions made about the markup. With a code along, you don't think about how you want to approach the project.

After every major concept that I learn, I usually try to find something that I can recreate on my own. The main criteria is that it's a project that I don't have access to solutions or how someone else did it. I would choose a site or think of something and I will start coding.

Here are a few small pages that I have recreated on my own: 

1- Restaurant Homepage
This was inspired by the Bareburger website. I had just started learning CSS and done a few projects with the course. I did this the hard way but this is where I started to really understand how to use divs and positioning.


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/purs8yru0weqpmc38ja9.png)


2- Presentation website
Another project is a presentation site. This was mostly working with media queries, image overlay and CSS variable.

You can find a video here:
https://twitter.com/jojonwanderlust/status/1173079788489183233

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xxw6eymr5uaefxya03tp.png)


3- YouTube Homepage
This last attempt was a little different because I learned Flexbox and CSS Grid and I spent sometime thinking about how I wanted to layout the markup. I wanted to recreate the YouTube homepage. I have not completed it as I want to add more pages and continue to practice. I wanted to add this as I am super proud of how it came out.

I used Font Awesome for the icons and they are wrapped in a tags. As such I created 4 columns to display the different sections. Then for columns 2-4, I displayed them as flex to have the elements lined up in a row.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/rdvafv0dc2q5747oe36i.png)

As I am going on this journey, I get frustrated when something doesn't work and I start to question if I am learning at all. I usually try for a while to solve the issue then I leave it alone and return to it and work through the logic of what I am trying to do.

I never thought I would enjoy puzzles like that but I love trying different solutions and see what changes and how I can fix something.

On to the next one!
Simple React.js Boilerplate
Tags: showdev, react, parcel, boilerplate
Published: 2019-10-11 21:00:23

---
title: Simple React.js Boilerplate
published: true
date: 2019-10-11 00:00:00 UTC
tags: showdev, react, parcel, boilerplate
canonical_url: https://www.dimitrimarion.com/blog/2019/10/11/simple-reactjs-boilerplate/
---

I created a simple React.js boilerplate using Parcel. It’s a simple starter kit that you can easily extend. Only “react” and “react-dom” are installed, you decide which router or state management library or any other libraries you want to use.

**Link to the boilerplate** : [Simple React.js Boilerplate](https://github.com/dimitrimarion/react-parcel-boilerplate)

<!--more-->
## Getting started

You can click on “Use this template” to create another repository or clone the repository:

`$ git clone https://github.com/dimitrimarion/react-parcel-boilerplate.git`

Run the setup:

`$ npm run setup`

Start the development server:

`$ npm run dev`

Bundle the application for production:

`$ npm run build`

## Useful packages

- [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver): this plugin simplifies the import path in your project.

```javascript
// Use this:
import dog from "@images/dog.jpg";
// Instead of that:
import dog from "../../../images/dog.jpg"
```

You just need to add an alias in `.babelrc`:

```
[
   "module-resolver",
      {
        "root": ["./src"],
        "alias": {
          "@images": "./assets/images"
        }
      }
  ]
```

- [@babel/plugin-proposal-class-properties](https://babeljs.io/docs/en/next/babel-plugin-proposal-class-properties.html): this plugin lets you use class properties.

Without class properties:

```javascript
class Button extends Component {
  constructor(props) {
    super(props);
    this.state = { clicked: false };
    this.handleClick = this.handleClick.bind(this);
  }
  
  handleClick() {
    this.setState({ clicked: true });
  }
  
  render() {
    return <button onClick={this.handleClick}>Click Me!</button>;
  }
}
```

With class properties and arrow function, there is no need to bind `this` and the code is shorter:

```javascript
class Button extends Component {
  state = { clicked: false };
  
  handleClick = () => this.setState({ clicked: true });
  
  render() {
    return <button onClick={this.handleClick}>Click Me!</button>;
  }
}
```

## Conclusion

This is a very simple boilerplate, it doesn’t include advanced things like state management or unit testing but I think it’s a good starting point for somebody learning React.js.