teleren/devto huggingface dataset:
Personal website template - an open source project
Tags: javascript, react, node, showdev
Published: 2019-12-31 23:21:19

---
title: Personal website template - an open source project
published: true
description: I built my personal website and I made it customizable to anyone who wishes to use it.
tags: javascript,react,node,showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/v72y5yxz5cme6drnmrho.png
---

## The idea

A few months ago I started looking for a new job and one of the first steps I took was to build my personal webpage with my CV information.

## How I did it?

I'm mostly a backend developer so I wanted to explore one of the popular JS frameworks, as I don't have that opportunity at work.

So I decided to go with [ReactJS](https://reactjs.org/) and the CSS framework [Bulma](https://bulma.io/) for styling.


And here it is the final result: https://jcoelho93.netlify.com

### Dev.to latest articles

This app uses the Dev.to REST API to display my latest published articles, so this is a perfect template for anyone who's part of this community ;)

### JSON Resume open source initiative standard

One of the requirements I had in mind was that the application should load all the personal information from a json file so that I could easily update the website with my most recent information.

So I found this open-source initiative called [JSON Resume](https://jsonresume.org), that sets a standard for representing resumes as json. So my app expects the json file to follow this standard.


## Make it your own

Recently someone forked my project on GitHub, updated the json file with their personal information and made their own personal webpage.
This made think about promoting my project to anyone who wishes to use it as a base for their own website and make it truly open source community driven.

So here is my project
{% github jcoelho93/personal-website %}

**What do you think of the project? And the webpage itself?**

**If you want you can fork it and make it your own, then send me the link I'd love to have a look at what you did.**

**Also if you make any improvements on the app a PR would be very appreciated. :)**
dev.to posts tagged 'beginners' considered harmful
Tags: beginners
Published: 2019-12-31 22:26:59

---
title: dev.to posts tagged 'beginners' considered harmful
published: true
description: 
tags: beginners, discussion
---

About 10 years ago I made my transition from full-stack web developer (though the term wasn't in use at the time) to front-end-focused.  I had no prior ExtJS experience but was hired on the strength of my Javascript experience in general.

Prior to my first day I bought a book on ExtJS.  I could not have succeeded at that position the way I did if not for the book, but still it contained at least one glaring mistake -- it referred to the configuration object literal used to create an ExtJS instance, as JSON.

What's the harm?  Well to this date you will see questions on StackOverflow where the uninitiated think any old Javascript object is JSON and can't understand why parsing a string representation of the same fails.

Just within the past 7 days I started writing on dev.to again, after a hiatus stretching back to February.  One of the more recent posts has to do with not blindly following the suggestions of *known experts*: https://dev.to/dexygen/linus-borg-s-nor-other-expert-s-advice-not-to-be-followed-blindly-1712

Well I'm seeing content in dev.to's beginners tag that is far more egregiously wrong than that ExtJS book about JSON, or LinusBorg about removing event listeners in Vue.js instances' destroyed hooks.  Remember beginners, *anybody* can post *anything* on dev.to and unlike books for instance, it is *not* curated.  Therefore I implore you, everything that you read targeting beginners on this platform, do so with a critical eye -- don't simply trust it to be correct.

Interestingly it is ironic that, the beginners being targeted are at the "don't know but know that they don't know" stage of their accrual of expertise, and that is why they are reading these articles, to try to learn more.  But as long as the beginner's content is not curated (and I have now come to believe that it absolutely should be), you will have content authored by those who "don't know, and don't know that they don't know", which is at the previous, initial, stage.

There's even a term for "don't know and don't know that they don't know", Dunning-Kruger effect: https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

The last two stages are "know but don't know that you know" and "know and know that you know".  I like to think that depending on the technology involved I'm at the 2nd, 3rd or 4th step.  Or that if I am at the 1st step, I can at least be disabused of my ignorance through logical argument.  I suspect however that those suffering from the Dunning-Kruger effect probably cannot be persuaded.

Yet I digress.  My main point is, to reiterate, that beginners need to read everything critically; research what you read and/or seek out clarification from other seeming experts.
What Are Your Plans for 2020?
Tags: watercooler, discuss, newyear, learning
Published: 2019-12-31 23:12:51

First of all, Happy New Year's Eve! 🎉🎉🎉 As for those of you already in 2020, Happy New Year!

Over this past year, I've learned so much about software development, and improved my skills as a developer. However as we move into the new year, I feel it's important to have a (general) idea of what I plan to accomplish and learn.

I've outlined a few rough goals I aim to accomplish in this fast-approaching new year:
- Learn game development with Unity, and possibly launching some kind of small indie game.
- Continue learning language design / compiler design.
- Incorporate machine learning into a project in some way.
- Step up my development skills by learning and implementing more design patterns.

I'd love to hear your goals for the new year!
Working on New Years Eve: Dappity and dCrypt
Published: 2019-12-31 22:35:50

It's New Years Eve and here I am on the last day of 2019 working on all 10 of our products! While I've mostly been working on content and marketing, we are pushing some new features on a number of products.

###Dappity

Dappity is one of our top apps. It was a Grand Prize winner in Blockstack's Can't Be Evil 2 Hackathon back in September 2019. Since it is my first solo project, I am really proud of it.

Dappity is a launchpad for Blockstack apps. Our top feature is the recall of previously used Blockstack apps. Users really love logging into to Dappity and seeing all the apps that they have used in the past.

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

Our latest feature is new search that allows you to find any Blockstack app. We are pushing this today so feel free to check it. Would really love feedback on the app if you have a chance. Go to [Dappity](https://dappity.app/)

###dCrypt

dCrypt is a Blockstack app that makes public-key cryptography easy. It provides a short primer in the About section with an overview on end to end encryption. Once you log in with your Blockstack ID there is a short tutorial. After you finish the tutorial, you can encrypt, decrypt and share an encrypted file. 

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

We've also been working on new features for dCrypt app. The latest is the share feature. So if you are interested in public-key encryption you might enjoy taking a look at it. Of course, we would love your feedback. Go to [dCrypt](https://dcrypt.app/home)

Happy New Year!
v-date-picker not opening on first available date
Tags: vuetify
Published: 2019-12-31 22:24:20

Hello,

I'm working with a v-date-picker in my vue.js application. I'm trying to get it to open on a specific month. I set the min prop to a certain date in order to disable any date before the min date. If this min date is on a future month, it would be nice if the date picker would open on that month instead of the current month. I'm not able to get it to do this.

There is this discussion:

https://github.com/nathanreyes/v-calendar/issues/113

...which says that there is a bug in the v-date-picker for setting the month it opens on, but none of the solutions or work arounds work for me.

I put an example up here: 35.232.230.0:81

I posted my code here:  35.232.230.0:81/code

Any help would be much appreciated. Thanks.
Looking for a helpful dotnet library
Tags: help, dotnet, csharp
Published: 2019-12-31 22:17:17

Hello **DEV** community.
I'm writing some code in C# using the .NET Core version 3.1 
I need to communicate with another host which runs an old program on a TCP port that is using a custom byte-oriented protocol.
My side will be the client, since the other is a server listening on a specific port number.

I know I will need a `TCPClient` function to open and establish a stream between the 2 hosts.
I have looked around for a NuGet package to help and I've found two: NetCoreServer and WatsonTcp.

Since this server is not always available, I might have to build a quick simulator app, so I'll have to do a `TCPListener` function for that side too.

My question is: has anyone used these before or is there another I haven't found yet? Or maybe just use the classes already in the `System.Net.Sockets` namespace (Microsoft provides examples that look fairly easy).

Any help from those with a lot more experience than me would be greatly appreciated.
Simple Queue  in PostgreSQL
Tags: postgres, sql
Published: 2019-12-31 22:08:06

Sometimes you need a simple job queue to enable offline or deferred processing of data. While this is not a pub/sub system which is what a lot of people us Queues for, you could expand upon it.

I will be using Postgres as  the database (you could apply the concepts in this post to other RDMS). What this is not is a tutorial in SQL, I assume you know how to write and understand basic sql(select, insert, update, and delete).

Let's start with the definition of our table. One thing you will notice is that we have a column called *jobData* of type json, this is so that you store the data need to process a job in a structured way. Feel free to change it to TEXT or anything else.
```

CREATE TABLE public."jobQueue"
(
    "jobId" serial NOT NULL ,
    "jobData" json NOT NULL,
    status character varying ,
    added timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
    started timestamp without time zone,
    ended timestamp without time zone,
    CONSTRAINT "jobQueue_pkey" PRIMARY KEY ("jobId")
)
```

Now the secret to using a database table as a queue, is to lock the row for updates while you're getting a job from the queue.

Let's create a function that will take as an argument the number of jobs to pull off the queue. 

```

CREATE OR REPLACE FUNCTION public."jobQueue_getJobs"(
	"_numJobsToGet" integer)
    RETURNS TABLE("jobId" integer, status character varying) 
    LANGUAGE 'plpgsql'

    
AS $BODY$

DECLARE _jobId int;
DECLARE _status character varying;

BEGIN
   FOR _jobId,_status   IN
             SELECT jq1."jobId", jq1.status, jq1.type
                FROM "jobQueue" jq1
               WHERE 
		jq1.status = 'new'
		and
		jq1.added < NOW() 
		ORDER BY added
               LIMIT "_numJobsToGet" FOR UPDATE SKIP LOCKED
   LOOP
      UPDATE "jobQueue" jq2 SET jq2."status" = 'pickedup'
         WHERE jq2."jobId" = _jobId;
      RETURN NEXT ;
   END LOOP;
   RETURN;
END
```

So executing this function will return a list of jobIds' that then you can be used to select and update the jobQueue table without any other process stepping on your jobs.

One thing about this process is that if a process dies and a job is stuck in limbo you can restart it without any data loss.

Once your done processing the job you can mark it as done or remove it from the queue if you are space constrained.
How to Setup SSH Authentication for Git Bash on Windows
Tags: git, windows, ssh, tutorial
Published: 2019-12-31 21:44:19

> _I originally created this as a [Gist on GitHub](https://gist.github.com/bsara/5c4d90db3016814a3d2fe38d314f9c23) to be shared with some co-workers who were struggling to set up SSH on Windows. It seems to have been helpful to a lot of others as well; so, I'm posting it here so that it can benefit even more people._


## Preparation

0. Create a folder at the root of your user home folder
   _(Example: `C:/Users/uname/`)_ called `.ssh`.
1. Create the following files if they do not already
   exist (paths begin from the root of your user home
   folder):
    - `.ssh/config`
    - `.bash_profile`
    - `.bashrc`


## Create a New SSH Key

Follow the steps in the section named "Generating a new SSH Key" found in the following documentation from GitHub:
*[Generating a new SSH key and adding it to the ssh-agent](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-windows)*


## Configure SSH for Git Hosting Server

Add the following text to `.ssh/config` (`.ssh` should be found in the root of your user home folder):

```
Host github.com
 Hostname github.com
 IdentityFile ~/.ssh/id_rsa
```


## Enable SSH Agent Startup Whenever Git Bash is Started

First, ensure that following lines are added to `.bash_profile`, which should be found in your root user home folder:

```sh
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
```

Now, add the following text to `.bashrc`, which should be found in your root user home folder:

```sh
# Start SSH Agent
#----------------------------

SSH_ENV="$HOME/.ssh/environment"

function run_ssh_env {
  . "${SSH_ENV}" > /dev/null
}

function start_ssh_agent {
  echo "Initializing new SSH agent..."
  ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  echo "succeeded"
  chmod 600 "${SSH_ENV}"

  run_ssh_env;

  ssh-add ~/.ssh/id_rsa;
}

if [ -f "${SSH_ENV}" ]; then
  run_ssh_env;
  ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
    start_ssh_agent;
  }
else
  start_ssh_agent;
fi
```

## You're Done!

Please, feel free to ask any questions that you may have in the comments, I’m more than happy to help.
Install PHP 7.4 on Ubuntu
Tags: php, ubuntu
Published: 2019-12-31 15:22:52

## What's new?
There are countless articles about the changes php7.4 brings. Feel free to get an overview [here](https://dev.to/pushkaranand/upgrading-to-php-7-4-26dg).

## Installation

Regardless of whether you want to upgrade or install, let's first adhere to the general recommendation you will find anywhere. Namely, make sure we are up to date: `sudo apt-get update`.

Then, we want to add Ondrej Sury's repository:

```shell
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
```

Now we are ready to install php 7.4. 
```shell
sudo apt -y install php7.4
```

You might want to test the success with `php -v`, which will give you an output about the version.

## Extensions

I don't know which extensions you might need, but the format is very intuitive and with the example of mbstring looks like this:

```shell
sudo apt-get install php7.4-mbstring
```
***Tip: you can install multiple extensions with the following format:***

```shell
sudo apt-get install -y php7.4-{mbstring,mysql}
```

_NOTE_: We are happy with the shipped Apache here, but be sure to install php7.4-fpm if you are aiming for NGINX after stopping apache `sudo systemctl disable --now apache2`

### Old installations

In the case of former installations, you will want to purge the old version of php (assuming php 7.3):

`sudo apt purge php7.3 libapache2-mod-php7.3`
Happy New Year Everyone!
Tags: dotnet
Published: 2019-12-31 21:33:50

---
title: Happy New Year Everyone!
published: true
description: RepoDb greetings for the year 2020 to DEV community.
tags: csharp, dotnet
---

We are looking forward for a great year 2020.

We will be spending most of our time at DEV.to by next year (or years to come). We are eager to collaborate further.

Cheers! Mabuhay! Skål!

Mvh!
Changelog: New settings/ux tab
Tags: meta, changelog
Published: 2019-12-31 21:22:55

If you go to [/settings/ux](/settings/ux) you will see a bunch of options that used to be in [/settings/misc](/settings/misc), now with more interactive visuals.

The upgrade from the "misc" area of settings is a commitment to keep up with the user experience configurations which should help everybody experience DEV on their own terms.

Thank you to to @link2twenty for proposing the theme selector and @johncurcio for building it!

{% github https://github.com/thepracticaldev/dev.to/pull/5121 %}

Next steps could include more interactive design upgrades and/or live previews.

Happy coding, and happy New Year! 🎉
Datatypes in array object
Tags: python, career, tutorial, beginners
Published: 2019-12-31 20:57:46

<html>
<body>
<h3><b>1D Image:<b></h3>
<div><p> One-dimensional pictures are those containing only one dimension. This is only possible when you're dealing with a line, as the only dimension you have is length, defined by a single array.When data objects are stored in an array, individual objects are selected by an index that is usually a non-negative scalar integer. Indexes are also called subscripts. An index maps the array value to a stored object.

There are three ways in which the elements of an array can be indexed:

<li>0 (zero-based indexing): The first element of the array is indexed by subscript of 0.</li>
<li>1 (one-based indexing): The first element of the array is indexed by subscript of 1.</li>
<li>n (n-based indexing): The base index of an array can be freely chosen. Usually programming languages allowing n-based indexing also allow negative index values and other scalar data types like enumerations, or characters may be used as an array index.</li></p></div>
```javascript
import numpy as np
a = np.array([1, 2, 3,4,5])
a
a.ndim
a.shape
len(a)
Out[69]: 5
}
```![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/fy3nu1ut3bmlpy3jwl9n.jpg)

<h3><b>2D Image:<b></h3>
<div><p>The two dimensions depicted are length and width and the objects on the picture are flat. one of the examples of 2D images are gray scale images, a kind of black-and-white or gray monochrome.</p></div>```javascript
import numpy as np
b = np.array([[0, 1, 2], [3, 4, 5]])    
b
b.ndim
b.shape
len(b)
Out[67]: 2
```![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3d6c8pb395uylutyb0jr.jpg)


<h3><b>3D Image:<b></h3>
<div><p>Three-dimensional pictures contain yet another dimension can be a color image. Information in 3-D coordinates can also be objects that have less than three spatial dimensions and in which the third coordinate describes another property, such as time, color or a color channel.</p>```javascript
import numpy as np
c = np.array([[[1], [2]], [[3], [4]]])
c
c.shape
Out[70]: (2, 2, 1)
```
#100DaysOfJavascriptTeaching
Tags: javascript, 100daysofcode, tutorial, teaching
Published: 2019-12-31 20:26:07

As there are many of my friends & developers who have asked me to teach JavaScript. Here's how I will do it. I am starting an Initiative for creating JavaScript Tutorials for those, who really want to learn JavaScript in 2020.

In this course, I will do cover JavaScript topics from basics to advanced for 100 days as it will be my #100DaysOfCode challenge as well, so nothing could be better for me to teach & contribute at the same time.

Here' the [Official Repo](https://github.com/Mohammad-Quanit/Javascript-Maniac) for my course.


<b>Contributor/Teacher</b>: [Mohammad Quanit](https://mohammad-quanit.github.io/)
Day29:an echo server with tokio - 100DayOfRust
Tags: rust, tokio
Published: 2019-12-31 19:08:13

[Tokio](https://tokio.rs/) provides asynchronous runtime which you can spawn tasks into runtime, the runtime will schedule them to run. It is similar to how Golang run goroutines. This makes writing fast and reliable network applications easy in Rust.

In the [previous post](https://dev.to/0xbf/day24-multi-thread-100dayofrust-4nc), I wrote how to use thread pool in Rust with the `threadpool` crate. With tokio, we don't need to worry about how to assign tasks to thread pool, tokio's runtime will automatically schedule them for us.

### Task Scheduler

> ... the basic_scheduler configuration will block the current thread and process all spawned tasks in place. The threaded_scheduler configuration uses a work-stealing thread pool and distributes load across multiple threads. The threaded_scheduler is the default for applications and the basic_scheduler is the default for tests.


### Echo Server

Write a multi-thread + async echo server with Tokio.

In `Cargo.toml`:

```
[dependencies]
tokio = { version = "0.2", features = ["full"] }
```

In `main.rs`:

```rust
use std::error::Error;

use tokio::io::copy;
use tokio::net::TcpListener;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let addr = "127.0.0.1:6143";
    let mut listener = TcpListener::bind(addr).await?;
    println!("Listen on {}", addr);
    loop {
        let (mut sock, _) = listener.accept().await?;
        tokio::spawn(async move {
            let (mut reader, mut writer) = sock.split();
            copy(&mut reader, &mut writer).await.unwrap();
        });
    }
}
```

In the code we first bind the listen port, and in the loop once we accepted a client connection, we use `tokio::spawn` to put an async task to tokio's runtime. In the task we read bytes from client and send the same bytes to client (copy bytes from reader to writer). Thanks to tokio, with only around 10 lines code, now we have a fast, multi-thread, async echo server.

Now let's test it. We can run the code in terminal:
```bash
$ cargo run
Listen on 127.0.0.1:6143
``` 

Now open another terminal to use `telnet` connect to our server:
```bash
$ telnet 127.0.0.1 6143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
echo
echo
asdf
asdf
```

We typed "echo" then we got "echo" back, we typed "asdf" then we got "asdf" back. The echo server works!


### Reference
* [Tokio Runtime](https://tokio.rs/docs/getting-started/runtime/)
* [Example: An Echo Server](https://tokio.rs/docs/getting-started/echo/)
* [echo.rs](https://github.com/tokio-rs/tokio/blob/master/examples/echo.rs)
Jason Turner's gift C++ tutorial for Christmas
Tags: cpp, tutorial, beginners, lambdas
Published: 2019-12-31 20:13:54

Jason Turner has hit a 200 informational videos on modern C++ features this Christmas season. He's a multiple time speaker at CppCon—the biggest C++ conference and does industrial trainings on C++. He just came up with a tutorial series on C++ available on his YouTube channel. I personally enjoy watching his C++ weekly series, but never am able to catch up will all the episodes anyway. I highly recommend any adept of programming in C++ to take a look and hopefully stay for longer.

https://youtu.be/3hGSlUGEXtA

Happy learning.