teleren/devto huggingface dataset:
On .NET Episode: IoT support for .NET Core
Tags: iot, dotnet, csharp
Published: 2019-10-09 04:58:42

Internet of Things (aka IoT) has been a topic I've been casually paying attention to over the past year. There are so many interesting projects that use IoT, but to be honest I've had a bit of envy.

Why? Because I'm a .NET developer. Sure, I can code in other languages but C# (and Python) is usually what I reach for first. That's why I was beyond excited when this this On .NET video came out!

In this episode, Richard Lander and Jose Perez sit down with Christos to talk about the work they've been doing to add support for IoT development with .NET Core.

{% youtube I7mV9ufkyFU %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [.NET Developers YouTube Channel](https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw) or leave a comment below.


## Useful Links

* [.NET Core IoT libraries](https://github.com/dotnet/iot)

* [Cross-Platform IoT Programming with .NET Core 3.0](https://msdn.microsoft.com/magazine/mt833493?WT.mc_id=dotnet-c9-cephilli)

* [.NET Core Guide](https://docs.microsoft.com/dotnet/core?WT.mc_id=dotnet-c9-cephilli)
Publishing npm package to Github package repository
Tags: github, npm, career, resume
Published: 2019-10-09 04:13:02

Github package repository is where you can publish npm, gem, mvn, nuget, gradle, docker packages and is currently now in beta. In this tutorial, we will see how we can publish an npm package to the github package respository. 

- Code the node.js project you want to publish as npm module in github repo. 

- Create a github repository in which you will be publishing the package.

- After you have done the programming for the node.js project, modify the name field and add the fields bin, repository and publishConfig to the package.json as shown below.

    ```javascript
    "name": "@github_user/npm_module_name"
    "bin": {
        "<cli_command_name>": "./<name_of_the_index_script>"
    },
    "repository": {
        "type": "git",
        "url": "<git_repo_link>"
    },
    "publishConfig": {
        "registry": "https://npm.pkg.github.com/"
    }
```


*cli_command_name* is the cli command for invoking your module. *name_of_the_index_script* is the script that will be called when *cli_command_name* is invoked. It is the main script in your project.  *git_repo_link* is the git repo you have created for publishing the npm module. *npm_module_name* is the name of the npm module to be published.

- Login to the github npm registry from the console using the below command
```
    npm login --registry=https://npm.pkg.github.com --scope=@github_user
```
*github_user* is the username of your github account.
Executing this query will ask for username and password. Username is your github username. Password is Personal Access Token which can be generated from your github account settings page.

- Run *npm publish* command from the project directory. This will publish your node.js project as npm module to github repository. The github repository link is *git_repo_link/packages* . The module will be published in the scoped mode.

- A git push will push the project to the git repo mentioned in the package.json file, *git_repo_link*

Now the module can be installed by anyone from this repository. To do this, the user who intends to install the module should set the npm registry in .npmrc file as *registry=https://npm.pkg.github.com/github_user* . Once this configuration is done, the npm module can be installed by running the command *npm install @github_user/npm_module_name*

You can find my github repo and github npm module at https://github.com/sijils/resume and https://github.com/sijils/resume/packages respectively for reference.
How to prevent readline in Node from exiting on line event?
Tags: node, javascript, help
Published: 2019-10-09 03:47:50

I'm working on a command line tool using Node and I'd like to prevent it from exiting when using the `readline` module when the user inputs the "Return" key or something that indicates a new line. I saw that [readline has an event handler for `line`](https://nodejs.org/api/readline.html#readline_event_line) but can't figure out how to prevent it from exiting. Meaning I'd like to allow for the user to be able to use the return and it adds a carriage return to the input for readline instead of exiting it.

I'd like to exit readline only when the user uses `control-C` or `control-D`.
NodeJS API Setup Shell - Open Source
Tags: hacktoberfest, node, javascript
Published: 2019-10-09 03:18:40

Hi Everyone,

A few days ago I made a video about my NodeJS API Setup Shell project. This video will be publish very soon by the company where I work @ThisDot. After creating the video I decided that it will be a good idea to open source the code.

It's Hacktoberfest month, is there anything better to do than Open Source?

<h2>What Is This Open Source Project About?</h2>

How many times is has happen to you that you are going to work on a NodeJS API project whether you are a beginner on NodeJS or not and you have to setup your project from scratch, many right? if you aren't using something like loopback or any other library or framework of this kind, this process can be very annoying. I have decided to create this shell project where all you have to do is clone the repo and start working with it by expanding the code to your needs. 

The NodeJS API Shell project already has a few things setup for you like scripts from the package.json

   ```javascript
   "scripts": {
    "test": "mocha -w './src/**/tests/**/*.js'",
    "coverage": "nyc --reporter=html npm run test",
    "start": "nodemon server.js"
   }
   ```

I have installed also some of the most common middleware like:
   
   ```javascript
   const body_parser = require('body-parser');
   const cors = require('cors');
   ```

I have also setup the MongoDB Connection, a Config file with your basic Dev and Prod configurations, create an .ENV file, GRUNT and many other little things that you potentially will need in your NodeJS API project.

The implantation of the Shell is very basic with the purpose of beginners or experts to be able to use it.

<h2>Project Structure</h2>
<img src="https://thepracticaldev.s3.amazonaws.com/i/zxii3jcmbjtdlr9q2f3p.png" />


<h2>Tools The Project Has</h2>

-NodeJS
-ExpressJS
-MongoDB Connection
-Moca/Chai
-Grunt
-Nodemon
-Mongoose
-Test coverage with NYC


<h2>Contribute</h2>

![Open Source Love](https://img.shields.io/badge/Open%20Source-%E2%9D%A4-red.svg)

If you are into NodeJS and have seen repetitive things that you add to your NodeJS API setups all the time, feel free to add them to the repo.

-Fork the repo: https://github.com/thisdot/node-enterprise-setup-shell
-Star the repo.
-Add some code.
-Submit a PR.


<img src="https://thepracticaldev.s3.amazonaws.com/i/5a87eog40zvcsimuaew4.png" />
Should I learn react before trying to learn Gatsby?
Tags: help, javascript, react, webdev
Published: 2019-10-09 03:13:40

---
title: Should I learn react before trying to learn Gatsby?
published: true
description: Open question about learning gatsby without knowing react.
tags: help, javascript, react, webdev
---

I'm new-ish on the web development front, haven't done anything in years and even then I was primarily focused on learning fundamentals of html, css, js, jquery and the like. I never really had exposure to some of the front end frameworks that are so popular today.

I recently started a little side project to build a portfolio page for a family member, and I was going to use Gatsby because it seems like it'd suit the project well. I'm not sure if my inexperience with React is going to bite me in the butt though. 

Almost all of my experience with professional software is with Android development so this is out of my wheelhouse. Would love some insight!
How To Handle Chat Bot in Selenium WebDriver using Java
Tags: selenium, chatbot, java, ai
Published: 2019-10-09 02:53:03

A chatbot is an artificial intelligence (AI) software service that can simulate a conversation or chat. Natural Language Processing is used in this. Now a days they are frequently used in messaging applications, websites, mobile apps and on telephone.

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


The problem is if you don't handle them, sometimes, they may get overlapped with application pages, and that will not allow Selenium to perform any activity on web page causing, scripts may fail.
We will talk about approaches to deal with chat bot in Selenium.

Usually, chat bots gets popped up automatically on launching the application or website. Sometimes, it takes few seconds to get it on the page. So, the behavior will be :
1. Website/ application page gets displayed
2. Chat bot gets displayed.
One thing to observe here is, usually chat bots has a close button. So, in Selenium how we are going to handle is as follows:
1. Navigate to the website/ application.
2. Explicitly Wait for 60 seconds to get Chat Bot displayed.
3. Once it pops up, click on close button.

Here is a sample code in Selenium Java to handle Chat Bot displayed on Lazada(Shopping website).

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class Homepage {
    public static void main(String[] args) {
    	System.setProperty("webdriver.firefox.marionette","C:\\geckodriver.exe");
    	WebDriver driver = new FirefoxDriver();
        String baseUrl = "https://www.lazada.sg/helpcenter/?spm=a2o42.home.header.5.654346b5LPMwYS";
        driver.get(baseUrl);
        driver.findElement(By.xpath("//span[text()='Chat Now']")).click();
        WebDriverWait wait = new WebDriverWait(driver,60) ;
        wait.until(ExpectedConditions.presenceOfElementLocated(By.id("alime-header-close-button")));
        driver.findElement(By.id("alime-header-close-button")).click();
        System.out.println("Found Closing button for Chat Bot, clicked on that...");
        driver.close();
        System.exit(0);
}
}

I hope this was helpful. If you have any queries or questions please let me know through comment section.
Illustrating Stack Data Structure and the pop operation on Stack
Tags: computerscience, webdev, javascript, algorithms
Published: 2019-10-09 01:41:34

Simple illustrations to demonstrate what stack is and how pop operation works on stack.

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



![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8mmbd8cie92dzm8e7krc.gif)
People shouldn't code
Tags: healthydebate
Published: 2019-10-09 01:37:17

---
title: People shouldn't code
published: true
description: Coding is good, but...
tags: healthydebate
---

The most important thing I've realized after 18 years of coding: people shouldn't code. Machines should code. People should use the result.

I extremely love coding. But I code to bring the moment when people start to enjoy the life instead of sitting behind computers.

Why do you code, what’s your big goal?
Day 7 : reBase For Your Face
Tags: hiphop, code, coding, lifelongdev
Published: 2019-10-09 01:28:56

_liner notes_:
- Professional : Watched some tutorials and read through some documentation about React Hooks. I can see what all the hub-bub was about. Other than that, I got a React app working on my local machine. Also set up an Express app on Glitch. Then, I successfully made a call from the React front end to the Express backend that created a new user. There's a few more things I want to get working before I call it a night.  Really enjoying this project. It's challenging and getting me to understand our SDK better.

- Personal : So last night, stayed up late to work on my personal site. I was messing around with Git to clean up some things. There was a commit I wanted to delete. So, I did a rebase and everything seems to have gone through successfully. Tell me why I can't push to my branch anymore. Lesson learned: Never Git late at night. haha Good thing I already had everything I wanted deployed. Going to investigate more this weekend when I have time.


![Photo of clouds](https://thepracticaldev.s3.amazonaws.com/i/1uh3nbz5cfkr0wpx53fq.jpg)
Not staying up too late. Got an early morning. I'm going to sit in on some more talk preparation sessions. I believe the folks are in Europe, so it's like 4:30am for me! haha

Also got meetings with my manager and his manager. Need to make sure I'm rested.

Pretty much it.

Have a great day tomorrow!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube sJfBV_OQ-T4 %}
Developing for Android on Android.!!
Published: 2019-10-09 01:13:56

Woth tools such as termux installing python and code editors got easy and even running  https://19216801.onl/ programs https://routerlogin.uno/ from github is as easy as ". /program. Py" with this in mind do you see any future for development on mobile devices, will there be any libraries to access for example the default texting app to send infinite messages to someone as means to joke around or whatever? Of course there might be more useful ways to use such great technology, what do you think of this? https://openweb.vip/whatsapp-web/
Nice little ComboBox
Tags: select, datalist, combobox, javascript
Published: 2019-10-09 01:12:19


---
title: Nice little ComboBox
published: true
description: Creating a customizable &#60;datalist&#62; HTML5 element with JS and CSS
tags: select, datalist, combobox, javascript
---

<h1>Nice little ComboBox</h1>

Hey devs!

I've made a little and very simple ComboBox, I was trying to find a way to customize the &#60;datalist&#62; element and after spending some valuable time on it I just gave up and decided to create my own.

Since I could find very little about this subject on the internet I thought it would be nice to share. Please, tell me what you think, I'm just a Junior JS Dev so any feedback is greatly welcome :).

If you want to clone this little project:
https://github.com/Xenosgrilda/html-js-combobox

{% codepen https://codepen.io/Xenosgrilda/pen/ZEEGpvG %}
What database do you use?
Tags: discuss
Published: 2019-10-09 01:01:05

I'm curious what databases people are using for their projects, and why you might have decided on that.

I'll list some of the databases I've used and my experiences with them.

### PostgreSQL

I'm using PostgreSQL for a Python project, alongside SQLAlchemy as the ORM.  The data model for the project is fairly complex, so it's been good to have SQL for the flexibility.  

One downside so far has been that some of the queries have gotten pretty gnarly, and modifying them can feel like moving blocks in a Jenga tower.  

Performance can also be a little unpredictable.  For instance, one query either took ~400ms or 20 seconds to execute.  In that case, the query was executing immediately after a big insert, and the table statistics were out of date, causing the planner to generate a really poor plan.  

Issuing an ANALYZE command refreshed the table stats, and the planner started producing the 400ms version of the query.  As far as I know, it's not possible to pin a query plan in PostgreSQL.

### Cassandra

My experience with Cassandra was mixed.  I think this was because the project was not well suited to an eventually consistent key-value store.  The application developers spent a lot of time coming to terms with eventual consistency, lack of transactions, and the rigidity of the data model.

Cassandra can, however, support an amazingly high write through-put.  If you don't need the flexibility of SQL, and a single machine can't support your demands, then Cassandra might be a viable option.

### What are you using?

I'd love to hear what databases you're using, as well as the positives and negatives that come with them.
Mobile cross-platform code using C/C++ and ezored
Tags: mobile, cpp, android, ios
Published: 2019-10-09 00:17:11

**Write once. Compile anywhere.**

C++ cross-platform development toolkit. Use the same code on mobile and desktop applications.

Ezored is the most convenient and fatest way to start your C++ project for mobile and desktop.

**Toolkit background:**

You don't need stop write your user interface code into your already used platform code like swift or kotlin.

Don't reinvent the wheel, adopt new tools or use new editors, only use what your systems already support that is compiled code into your current or new projects.

It has a simple but well designed structure of scripts and folders that make this work very easy, leaving you thinking about your project instead of strucute it. Download this repository and start use current samples to test and see it working.

Write C++ code and build shared libraries for mobile (Android is AAR and iOS is Framework) and binary executables for desktop (Linux, macOS and Windows).

Don't think about how you will start your C++ project for mobile and desktop, use ezored as a quick start toolkit.

Website: https://github.com/ezored/ezored

**Training:**

On Udemy has a course on mobile development using default implementation and using ezored and the difference:

https://www.udemy.com/course/desenvolvendo-aplicativos-mobile-com-cpp-para-android-e-ios/

Maybe it help developers.
11ty Hosted on Netlify
Tags: eleventy, netlify
Published: 2019-10-18 15:53:32

---
title: 11ty Hosted on Netlify
published: true
date: 2019-10-09 00:00:00 UTC
tags: eleventy, netlify 
canonical_url: 
---

Yesterday I wrote a long [article](https://hiltonmeyer.com/articles/travis-automatic-build.html) on how to get my site built and deployed using [Travis-CI](https://travis-ci.org/). I learnt quite a bit in the process but it all actuality I could have had this up and running in no time using Netlify and skipped the whole cutomization steps to get everything playing nice. With the simple setup of the toml file as seen below I would have achieved the same result:

_netlify.toml_

```
[build]
  publish = "_site"
  command = "DEBUG=* eleventy"

```

So the modern tools don't actually need to be more complicated and time consuming to get up and running. The old saying of when you have a hammer everything is a nail still stands true. The trick is to try and fill your toolbox with tools that can help without causing you too much of a sore thumb in the process, excuse my abuse of the pun.
Como configurar un path global de NPM con zsh
Tags: npm, node, bash, terminal
Published: 2019-10-08 23:19:00

# Como configurar un path global de NPM con zsh
Hace pocos días salió la actualización del sistema operativo para Mac *Catalina*.  Esto me trajo errores con mi instalación de *Node* que se solucionaron fácilmente pero aún así dejo este tutorial para quien esté experimentando lo mismo.

## Antecedentes
Cuando instalo *Node* me gusta dejar una ruta personalizada para las instalaciones globales, esto para evitar hacer uso de _sudo_ cada vez que instalo algo globalmente. Ademas si instalo desde mi respaldo de **Time Machine** en una nueva maquina, esta configuración se respetará. Dicho esto, me gustaría mostrar cómo lograr esta configuración, en caso de que aún no sepas hacerlo. 
Primero vamos a crear una carpeta en raíz llamada _.npm-global_, aunque puede llamarse como prefieras,  ejecutando el siguiente comando desde la terminal:

```bash
$ mkdir ~/.npm-global 
```

Ahora, vamos a necesitar decirle a nuestro sistema en donde buscar nuestros paquetes de *Node* haciendo lo siguiente:
Creamos un archivo llamado _.bash_profile_, en caso de no existir, con el siguiente comando
```bash
$ vim ~/.bash_profile
```
se puede usar cualquier otro editor, pero a mí me gusta **VIM**.
Agregamos la siguiente linea:
```bash
export PATH=~/.npm-global/bin:$PATH
```
guardamos los cambios y cerramos el documento.
En caso de no tener **zsh** solo basta con que ejecutemos un comando más;
```bash
$ source ~/.bash_profile
```
y nuestro ambiente estará trabajando correctamente. Si como en mi caso, estas usando **zsh** que por cierto viene por defecto en la versión 10.15 de **MacOS** , entonces tendremos que crear otro archivo, como lo explico a continuación.
Creamos un archivo llamado _.zshrc_  y ponemos la siguiente linea
```bash
$ source ~/.bash_profile;
```
guardamos y volvemos a ejecutar
```bash
$ source ~/.bash_profile
```
con eso deberíamos tener nuestro **NPM** funcionando correctamente.

## Aclaraciones
Puede ser que el archivo _.bash_profile_ no funcione, para ello te recomiendo leer el siguiente post [What is the difference between .bash_profile and .bashrc?](https://medium.com/@kingnand.90/what-is-the-difference-between-bash-profile-and-bashrc-d4c902ac7308)
5 Mongo shell methods to get you started
Tags: mongodb, beginners, tutorial
Published: 2019-10-08 22:45:02

Along my journey to become a JavaScript ninja, I recently started learning MongoDb (the M in the "MERN" stack). Coming from relational databases like MySQL and PostgreSQL, it's been a challenge to get started. 

Dynamic schemas are great until you sit down to design your schema and realize that the way you think about schemas doesn't work in a NoSQL world. My initial approach to MongoDB was ineffective. Instead of jumping right into a project, it makes more sense to get the basics down, which is why I'm writing this blog.

I downloaded the community version for MongoDB, which honestly requires its own blog for getting set up. But to get more comfortable with MongoDB, I recommend getting the following programs:
- [mongodb-community](https://github.com/mongodb/homebrew-brew)
- Atlas ([MongoDB in the cloud](https://www.mongodb.com/cloud/atlas)
- Compass ([a MongoDB GUI](https://docs.mongodb.com/compass/current/))


#####Getting started and navigating databases:
I set up a test cluster sample information in Atlas.

- `show dbs` to view the databases in my cluster:

```python
admin               0.000GB
local               4.957GB
sample_airbnb       0.053GB
sample_supplies     0.001GB
```
- `use sample_supplies` to select and switch to the sample_supplies database

- `show collections` to view the collections i.e. data records in the sample_supplies database:

```python
sales
```


- `db.collection.find()` to view records in a collection
-  `db.sales.find({ })` would return all of the records in the sales collection
  -  attaching `.pretty()` to the end will format the results as shown
```python
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db.sales.find({ }).pretty()
{
	"_id" : ObjectId("5bd761dcae323e45a93ccfe8"),
	"saleDate" : ISODate("2015-03-23T21:06:49.506Z"),
	"items" : [
		{
			"name" : "printer paper",
			"tags" : [
				"office",
				"stationary"
			],
			"price" : NumberDecimal("40.01"),
			"quantity" : 2
		},
		{
			"name" : "notepad",
			"tags" : [
				"office",
				"writing",
				"school"
			],
		},
	"couponUsed" : false,
	"purchaseMethod" : "In store"
},
{
...
```
- `db.sales.find({ "couponUsed" : false })` would return all of the records that match the query

- `db.help()` returns a list of common MongoDB methods

While this isn't a list of methods to perform full CRUD actions, these 5 methods were enough to keep me busy using the mongo shell for a couple of hours. I use these methods to move between databases, get familiar with the mongo shell syntax and to get a sense of how collections are structured.

While NoSQL is uncomfortable for someone who's only used SQL databases, this is an easy way to get started with MongoDB. I would highly recommend downloading the 3 tools at the start of this post and jumping right in.

But for anyone interesting in learning more about performing CRUD actions in the Mongo shell, checkout this 30 minute [Traversy Media tutorial](https://www.youtube.com/watch?v=pWbMrx5rVBE).