teleren/devto huggingface dataset:
Chatbots: Digital assistant at your fingertips
Tags: chatbotsupport, chatbotcompanies, chatbotservices
Published: 2020-01-30 04:53:03

As more & more businesses are utilizing virtual assistants for resolving consumer issues or assisting internal stakeholders — Chatbots are witnessing greater user acceptance. The shift towards “conversation” with non-human is on the rise as reported by several independent research. As chatbots essentially mimic human-like conversations with their users — their effectiveness depends on the user experience it provides and how effectively it understands and guides toward the right solution.

Hey there, I am happy to help you anytime.

ChatBots are always ONLINE. Once deployed, they are always active to help their users. Be it accessing data, gathering data or understanding consumer issues and resolving them, they are available on the click of a button. It is a perfect tool to quickly identify the problem faced by the consumer or in some cases even completely resolve the problem, all without human involvement.

The Need for SPEED. Resolving consumer issues quickly goes a long way in keeping customers happy. A chatbot powered by Machine Learning achieves this objective: and it gets better at it over time.

Being always ONLINE and faster SPEED of response combine to make chatbots a great assistant for self-service in simple scenarios, gathering information and providing guidance and recommendations.

ValueLabs’ Configurable Chatbots: Configure, Integrate, Deploy
What if business users could create a chatbot without any coding? Create the rules of conversation themselves? And even change the conversation flow on their own to reflect the changes in the business processes?


ValueLabs’ Configurable Chabots gives business users the ease to create their own chatbots — without any coding. Through Drag and Drop and just a few clicks one can create rule-based chatbots and publish them across platforms.

Configurable Chatbots can also be integrated with databases and APIs to deliver Real-Time data. Thus, ensuring the task remains on track without any human interference with greater accuracy and consistency.

By giving complete control to business owners our solution ensures that chatbots achieve the objective of seamless consumer experience while adapting rapidly to constantly changing business scenarios.

Written by Rakshit Chaudhary, Associate Director, Sales at ValueLabs
Using maven to publish artifact on Nexus using maven profile
Tags: devops, maven, nexus, deploy
Published: 2020-01-30 03:01:55

Here is the below link that help in publishing the artifact to nexus repository manager on dev box. This tutorial introduces concept of profile in maven which is very handy to cater multiple releases like snapshot and final release. It also discusses about necessary settings needed to configure maven for using nexus as its repository manager. 

Last but not the least every story starts with developer box :). I hope you will enjoy this post.

{% youtube RcWSch8r3Zw %}
How to setup nexus repo
Tags: devops, nexus, maven, setup
Published: 2020-01-30 02:56:33

I am a firm believer of the fact that everything starts with dev box. In order to reaffirm this thought. I started publishing working byte sized videos that will help in achieving things end to end no more than 5-8 minutes. 

Here is the below link that help in setting up nexus repository manager on dev box, you can publish all type of content here be it jar, npm, docker images what not. Choose the right recipe and you are at it all in one. Please share, like review so i can improvise for future work.


{% youtube A8nAPgoI2hY %}
Setting up a MongoDB backup on Google Drive
Tags: mongodb, backup, gdrive, digitalocean
Published: 2020-01-30 02:50:20

_TL;DR_: Script is on [this gist](https://gist.github.com/lucis/74954565122710a690bfa5a4c9ca2e9b)

I have an app deployed on **Digital Ocean** that uses the stack Node.js + MongoDB, and when I first started setting this up (3~4 years ago) I had almost no idea about CI, CD, and managing "big-apps-stuff", so, for most of these problems, I've had to **implement a solution from scratch**, like a Github push listener that deploys my application on the cloud _(more on that later)_.

Dealing with real data, one thing I had to worry about was **backups**, and outsourcing that to Digital Ocean was a bit expensive, so I had to project a solution.

These were my requirements:
- It had to store the backups **outside my cloud provider**
- It had to be run in a **daily basis**
- A _nice-have_ was to have the data compressed

After a bit of research, it was not hard to setup that solution. MongoDB already comes with a handy `mongodump` CLI that **is easy configurable** and also **already supports gzip compression**. After my first tests, my database backups generated by the tool were quite small. Its documentation is [here](https://docs.mongodb.com/manual/reference/program/mongodump/).

The first solution I looked for regarding storage was **Google Drive,** since I had plenty of quota available on my account, and I found this great `gdrive` tool (install it [here](https://github.com/gdrive-org/gdrive)). One thing to notice here is that, for _server-to-server_ applications like this where there's no human involved on the auth, you need to **setup a Service Account**, but it's [not hard](https://developers.google.com/identity/protocols/OAuth2ServiceAccount). 

For running it on a daily basis, I've **configured a simple cronjob**. If you don't know how to, just [read here](https://dev.to/brumor/automating-stuff-on-your-computer-with-cron-jobs-with-any-language-1eoc)

Before showing you my final shell script that glued all of this together, I must tell that I've also configured my solution to **always have the last backup available on my cloud machine**, just for redundancy.


So, here it is:
{% gist https://gist.github.com/lucis/74954565122710a690bfa5a4c9ca2e9b %}

Feel free to reach me :)
Solved! Mongoose Unique Index Not Working
Tags: mongodb, mongoose, database, javascript
Published: 2020-01-30 02:23:49

I was working on a project for an organisation I volunteer for, I encountered some difficulties in making the **email** field in my database schema to be unique, below is a sneak peek into my database schema, it's a typical database schema anyway.

```javascript
import mongoose from 'mongoose'

const { Schema } = mongoose

const value = {
  type: String,
  required: true,
  trim: true,
  unique: false
}

const UserSchema = new Schema({
  fname: value,
  lname: value,
  email: {
    type: String,
    required: true,
    trim: true,
    unique: true
  }
}, {
  timestamps: true,
  get: v => v.toDateString()
})

const User = mongoose.model('User', UserSchema)
export default User
```

and when I started my server and did my API test using Paw (REST Client like Postman), I found out that I could enter the same email again and again and that was not what I wanted.

I went to Google as usual to seek solution to this abnormality, here are the thing I tried that didn't work:

> Restarting MongoDB
and then doing the following:
mongo mydb
db.users.reIndex()

when this one above did no work out, I this one below



```UserSchema.index({ username: 1, email: 1 }, { unique: true});```

when this one too didn't work, I was also asked to do modify my code with this:

```javascript
import uniqueValidator from 'mongoose-unique-validator'

// UserSchema = Schema({}) etc...

UserSchema.plugin(uniqueValidator)
```javascript

I didn't do this because I felt so uncomfortable using a plugin to enforce a unique constraint on a particular field.

I really don't know why the aforementioned solutions didn't work for me at all. However, I stumbled upon a solution that did the magic, and I think this method is the best approach in my opinion.

I had to do this at the connection level:

```javascript
'use strict'
import 'dotenv/config'
import db from 'mongoose'

const options = {
  useNewUrlParser: true,
  useCreateIndex: true,
  autoIndex: true, //this is the code I added that solved it all
  keepAlive: true,
  poolSize: 10,
  bufferMaxEntries: 0,
  connectTimeoutMS: 10000,
  socketTimeoutMS: 45000,
  family: 4, // Use IPv4, skip trying IPv6
  useFindAndModify: false,
  useUnifiedTopology: true
}

db.connect(process.env.DB_URI, options)
  .then(() => console.log('> Successfully connected to DB'))
  .catch(err => console.log(err))

// syntactic sugar for { db: db }
export default { db }
```

what happens when you add ```audoIndex: true``` is that when you run your code it will create empty collection(s) and the corresponding index(es) which won't happen if you didn't add it.

MongoDB together with Mongoose can be pretty weird
git naming conventions
Tags: git, naming, discuss
Published: 2020-01-30 01:47:06

theres plenty of discussion on DEV.TO about git branch naming and git commit 'commenting' but what about git repo naming ?

my repo names (and forks) are a mess with prefixes and suffixes all over the place 

ive tried all sorts of variations of author, site, technology & platform but im not happy with any of them 

here are some examples
* AUTHOR-ORG-NODE-EXPRESS-PUG-GLITCH 
* GLITCH-MYSITE-ORG-NODE-EXPRESS-PUG
* NODE-EXPRESS-PUG-MYSITE-ORG-GLITCH 

but all these lock me in !

any ideas ? and any tips for prefixes and suffixes to use for forks so they dont get mixed up with my repos ?
How to make a user friendly select when using React, Redux, and Firebase (Part 1) - Goal
Tags: react, redux, firebase, select
Published: 2020-01-30 01:47:00

---
title: How to make a user friendly select when using React, Redux, and Firebase (Part 1) - Goal
published: true
description: This is just documentation so far. So there's no hand holding. I have a goal in mind on how the finished feature will be.
tags: react, redux, firebase, select
series: How to make a user friendly select when using React, Redux, and Firebase
---

This is just documentation so far. So there's no hand holding. I have a goal in mind on how the finished feature will be.

I am working on an app https://www.tft-helper.com/. It helps users play TFT (Teamfight Tactics). I have received a lot requests for the champions to have item recommendations. TFT updates very quickly and even had a whole new set of champions and items recently. I used to have item recommendations in Set 1, but I removed it in Set 2 because it was too much of a hassle to manually update.

Item recommendations need to be up to date. Instead of me updating the database manually for it. I am going to add a new feature. This feature will allow me and users (if they pay me, because I'll give them admin access) to easily update the item recommendations to our liking.

Breakdown of my goal:
- this is a tooltip for a champion
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/z688f2jrlrpdtfp2i0aq.png)
- I want 3x item slots at the bottom
 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4hfzwwgpekyvv6en28up.png)
- that when clicked opens an item table to select from
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/018v7d777ry5vo0ghh36.png)
- the item slot is then updated to the selected item
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/grp1222kyuuh7puqcaj6.png)
/why I want to code
Published: 2020-01-30 01:21:06

I decided I wanted to learn to code after years in the electronics industry helping people trouble shoot their issues. I have always had a passion for video games and computers and I would love to make video games at some point. Coding is a skill that will be useful for the rest of our lives and I wanted to learn something that will keep me continually challenged and allow me to learn new things daily.  I am currently a sales represntative for a Verizon Wireless retailer and I have realized I am better with the systems and the technical side of things than most others that I work with so I have finally decided to learn to code.
How to make code reviews developer-conflict free?
Tags: help, pullrequests, codereview
Published: 2020-01-30 00:48:26

---
title: How to make code reviews developer-conflict free?
published: true
tags: help, pull requests, code review
---


Code reviews seem to be a blocker on our team ever since. It is big, it takes time and it slows our delivery. Personally, I am having difficulty giving feedbacks and comments. I am torn on enforcing code standards and suggesting practices, and reducing frustrations for the developer. We are , most of the time, fast-paced so the developer usually have another task to work on. I feel like I am being the blocker by giving too many feedbacks when the developer should have moved on to another task.

How do you do it with your team? Quality of the code or quality of the human code? Where is the balance?
Productivity Pixel - Manage Information Overload
Published: 2020-01-30 00:02:44

With technology today, we are flooded with information. To help me navigate this flow of information every day, I try to follow these tips:

## 1 - Get on top of things

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

I try to compartmentalize my time every day to tackle the tasks that have potential information overload, like reading emails, meetings, actual coding etc…. 

For more context: I live with a sleep disorder, Delayed Sleep Phase Disorder, or DPSD for short. This prevents me to sleep on a «socially-accepted» schedule. 9 to 5 just is just impossible for me. 

So the first part of my day is between 12 pm-5 pm, then break, resume for 2/3 hours in the evening, then relax. I sleep at around 3/4 am, sometimes later. So I can split my day in two: the social aspect of my job and the focus aspect.

## 2 - Categorize my day. 

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

1. Read emails and look at my project management software. 
2. Manage my pull requests, code review, merging, update my repositories to the latest version, etc. 
3. Upcoming tasks, ask questions, go to meetings, attend standup. 
4. Coding and documentation.

## 3 - Alternate between large and small tasks

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

I try to alternate between large tasks and smaller ones, to give myself a break. Working on a large task can require me to maintain a ton of information in my brain for a few hours, sometimes days. 

After a task like this, I want to give my brain a break and not force it to ingest a ton of information again working on a large task again, so I pick up the small task that doesn’t require loading a lot of information in my brain.

## 4 Take a break

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

This one is a recurring tip, and will probably show up in a lot of Pixels! I try to take multiple breaks every day if I can. 

I go for lunch/coffee outside with co-workers/friends, watch something on Netflix if I don’t feel like moving. But I try not to keep using my brain during my break. My brain needs a «reset» to tackle new information.

---

You can also find these pixels on my Instagram: https://instagram.com/valentinprgnd. I will publish Pixels every Monday, Wednesday, and Friday about career development in tech, code, mental health and health for developers. Follow me for more tips @valentinprngd and check out my podcast https://rebased.whatdafox.com.
Renaming properties in a destructuring assignment
Tags: es6, javascript
Published: 2020-01-30 00:00:00

---
title: Renaming properties in a destructuring assignment
date: "2020-01-30T00:00:00.000Z"
tags: ["ES6", "JavaScript"]
---
[Destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) is one of the more useful language features added in ECMAScript 6 (ES6). Destructuring allows you to _unpack_ values from arrays, or properties from objects, into distinct variables.

Consider the following object:

~~~javascript
const user = {
	emailAddress: "billg@microsoft.com",
	nickName: "Bill G"
}
~~~

Pre-ES6 you would typically access the object property values directly or assign e.g. 

~~~javascript
console.log(`${ user.nickName } (${ user.emailAddress })`); // "Bill G (billg@microsoft.com)"

const emailAddress = user.emailAddress
const nickName = user.nickName;
console.log(`${ nickName } (${ emailAddress })`); // "Bill G (billg@microsoft.com)"
~~~

ES6 introduced destructuring, enabling you to unpack into new variables in one assignment expression:

~~~javascript
const { emailAddress, nickName } = user;
console.log(`${ nickName } (${ emailAddress })`); // "Bill G (billg@microsoft.com)"
~~~

One awkward scenario is where you want to destructure an object but the resultant variable(s) already exist in scope. Here, the unpacked variables collide with the function arguments:

~~~javascript
const getDetails = (emailAddress) => {
	return user; // Fetch existing details from a database, etc.
}

const updateDetails = (emailAddress, nickName) => {
	const { emailAddress, nickName } = getDetails(emailAddress);

	console.log(`${ nickName } (${ emailAddress })`);
}

updateDetails("steveb@microsoft.com", "Steve B"); // Uncaught SyntaxError: Identifier 'emailAddress' has already been declared
~~~

Fortunately, this scenario was anticipated and __you can rename variables in a destructuring assignment__:

~~~javascript
const updateDetails = (emailAddress, nickName) => {
	const { emailAddress: currentEmailAddress, nickName: currentNickName } = getDetails(emailAddress); // Renaming

	console.log(`${ nickName || currentNickName } (${ emailAddress || currentEmailAddress })`);
}

updateDetails(); // "Bill G (billg@microsoft.com)"
updateDetails("steveb@microsoft.com", "Steve B"); // "Steve B (steveb@microsoft.com)"
~~~
10 YouTube Channels I enjoy as a Developer
Tags: youtube, webdev, developer, communnityy
Published: 2020-01-29 23:26:47

Here is a curated list of 10 YouTube channels, I used to watch and enjoy as a developer.

YouTube became one of my main stream tool to learn technology. This post can be act as a bookmark for myself or helpful blog for you.

Watch more! Learn more! Spread positivity 🔥

Traversy Media – https://www.youtube.com/user/TechGuyWeb

FunFunFunction – https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q

DevTips – https://www.youtube.com/user/DevTipsForDesigners

Wes Bos – https://www.youtube.com/user/wesbos

DesignCourse – https://www.youtube.com/user/DesignCourse

Codegrid – https://www.youtube.com/channel/UC7pVho4O31FyfQsZdXWejEw

ng-conf – https://www.youtube.com/user/ngconfvideos/featured

The Practical Dev – https://www.youtube.com/channel/UCQjqsJDbo-sLRMKPVOMrvQQ/featured

JSConf – https://www.youtube.com/user/jsconfeu

Dev Ed – https://www.youtube.com/channel/UClb90NQQcskPUGDIXsQEz5Q

If you reach till here, feel free to check out my YouTube channel as well.

Efficient User – https://www.youtube.com/efficientuser

#peace #SpreadLove
Day 76 : The Life
Tags: hiphop, code, coding, lifelongdev
Published: 2020-01-29 23:11:43

_liner notes_:
- Professional : Today was a rough one. Had some pretty bad news the past couple of days and been kind of hard to focus. I did attend the talk prep sessions today, had a meeting with my manager, reviewed some JavaScript guides and worked on my Web Component project. I think I may have found a bug. I was able to recreate it. Going to have a coworker see if they can get it to happen on their end as well. Hopefully it's just something I'm missing or something. Pretty much got all the Web Components created, just need to clean some things up and figure out what's up with the bug I'm running into.

- Personal : Went to the Black Orlando Tech panel discussion last night and had a really good time. I also heard some pretty hard news. I don't know. Life is funny. Going to another event tonight. I was kind of hesitant at first, but with how things are going, I think it's important to go.

![Lakeland, England countryside with a valley and mountains](https://dev-to-uploads.s3.amazonaws.com/i/r5vjn7ttle25eqnqo8o6.png)

Hoping tomorrow goes a little better. Want to write up some tests for my web components and get everything pushed to GitHub so that my teammates can take a look at them and let me get some feedback. Going to see if I can get some work in for this week's radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube CkrdiABTcaI %}
💻💨 Quick TypeScript - Make Object Literal Properties Read-only
Tags: typescript, webdev, snippet
Published: 2020-01-29 22:47:11

---
title: 💻💨 Quick TypeScript - Make Object Literal Properties Read-only
published: true
description: Quick hack from typescript to make object literal properties read-only using const assertions (as const).
tags: typescript, webdev, snippet
---

Have you ever found yourself declaring a variable (for an object literal) using the `const` keyword and then assume those properties within that variable were read-only?

```typescript
const person = {
  firstName: 'Carl',
  lastName: 'Saunders'
};
```
In the above example most developers would assume the *firstName* and *lastName* properties cannot be changed and are read only. **WRONG!**

The below code is perfectly valid and can lead to bugs and these won't be caught until your code is production.
```typescript
person.firstName = 'Joe'; // valid assignment, even though const was used
person.lastName = 'Bloggs'; // valid assignment, even though const was used
```
# Const Assertions (as const keyword)

TypeScript has built-in support for guarding against this and can be achieved by using the const assertions. Behind the scenes TypeScript is converting all those properties defined on the object literal into read-only versions.

```typescript
const person = {
  firstName: 'Carl',
  lastName: 'Saunders'
} as const;
```

Now if we tried to assign *firstName* property a new value the compiler would report the following error.

```
Cannot assign to 'firstName' because it is a read-only property.
```

**Note:** The const assertion `as const` feature is supported in TypeScript 3.4+. Also only works when you haven't already typed the object.

## More Info
[TypeScript Docs - Const Assertions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions)
🤔 How to create a MySQL connection and run queries with Python3
Tags: python, beginners, database, sql
Published: 2020-01-29 22:25:25

Want to get better at Web Development 🚀🚀🚀? Subscribe to my weekly newsletter at **[https://codesnacks.net/subscribe/](https://codesnacks.net/subscribe/)**

---

We will use [pymysql](https://pypi.org/project/PyMySQL/) to connect to MySQL in Python3. First, you have to install the module using *pip* or *pip3*:

```python
pip install -U pymysql
pip3 install -U pymysql
```

Then you can use this code to connect to your database and do a simple query:

```python
import pymysql

conn = pymysql.connect(host='127.0.0.1', unix_socket='/tmp/mysql.sock',
                       user='root', passwd="your_pw", db='your_db')
cur = conn.cursor()
cur.execute("SELECT * FROM your_table")
for r in cur:
    print(r)  # print whole row
    print(r[0])  # print first column of result

print(cur.description)  # gives a description of the table including all columns

cur.close()
conn.close()
```

If you don't want to access columns by index, but by name, you need to pass `cursorclass=pymysql.cursors.DictCursor` to the connection.

```python
import pymysql

# add cursorclass to access columns by name
conn = pymysql.connect(host='127.0.0.1', unix_socket='/tmp/mysql.sock', user='root',
                       passwd="your_pw", db='your_db', cursorclass=pymysql.cursors.DictCursor)
cur = conn.cursor()
cur.execute("SELECT * from your_table")
for r in cur:
    print(r["id"]) # now you can access columns by name (assuming you have an id column)
print(cur.description)
cur.close()
conn.close()
```