teleren/devto huggingface dataset:
Who wants to improve the "pull-to-refresh" on DEV?
Tags: contributorswanted, opensource, javascript
Published: 2020-05-15 14:43:29

Quick update on our project: We are getting _very close_ to generalization where more instances of our community software will be available so you can run your cooking or parenting communities. 🎉

In the meantime, here's a site behavior which I'd love if someone jumped on:

{% github https://github.com/thepracticaldev/dev.to/issues/7886 %}

Basically "pull-to-refresh" pretty much works, but it's not as smooth as a native in the case where you're continuously scrolling to the top and want to keep scrooling, _but it could be_.

This has bugged me for a while and I've looked into it enough that I know it can be fixed, it just needs a deep dive and some quality code.

_P.S. The post title says "on DEV", but it's really "on yet-to-be-publicly-named opens-source forum software" once we release generalization v0."_

Happy coding ❤️
Get CLI command syntax explained, then save and share in a personalized cheatsheet.
Published: 2020-05-15 14:25:53

*The kmdr browser extension leverages a huge, human-validated explanation repository to explain the syntax of CLI commands in any website you find them. We are happy to announce a new feature coming to your browser -  saving commands you've explained to populate a personalized cheatsheet.*

{% youtube ksD5fhvJmmQ %}

Save time and help boost productivity by saving frequently searched commands and their definitions to your custom cheatsheet. Every kmdr account now has a cheatsheet and you can populate yours by hitting the `save command` button on the explanation pop-up window. The explanations on your cheatsheet are embedded in the code blocks on the page and are visible on mouse over. Folks you share your cheatsheet with are NOT required to have kmdr installed so will be able to learn commands right away.

You can see Eddie's cheatsheet here: https://app.kmdr.sh/ediardo 

You can now also see the [list of programs with kmdr definitions](https://app.kmdr.sh/coverage) (currently standing at 425). The kmdr backend contains 1,643 subcommands and 15,320 options for these programs, too. 

Head to the [Chrome Web Store](https://chrome.google.com/webstore/detail/kmdr/lbigelojleemicaaaogihjnabfndkdii?hl=en) to add the kmdr browser extension and let me know what you think!

Ianeta
Calling a stored Procedure SQL Server stored procedure from Spark
Tags: scala, spark, datascience
Published: 2020-05-15 14:21:13

Not really a regular thing people need to do and there are options to insert the record set into a temp table which means that you can go directly into data frame.  But that is an option that you need your DBA's to switch on.

the following uses a jdbc connection and a result set into a RDD then into a dataframe
 
```scala
import java.sql.DriverManager
import java.sql.Connection

import org.apache.spark.sql.types.{StructType, StructField, StringType,IntegerType};
import java.sql.ResultSet

//driver = 'com.microsoft.sqlserver.jdbc.SQLServerDriver' 

val username = ""
val pass = ""
val url = "jdbc:sqlserver://<host>:<port>;databaseName=<db>"

 

val columns = Seq ("DateCreated", "Action", "ServerName", "IPAddress", "Domain")

val schema = StructType(List(
    StructField("DateCreated", StringType, nullable = true),
    StructField("Action", StringType,  nullable = true),
    StructField("ServerName", StringType,  nullable = true),
    StructField("IPAddress", StringType,  nullable = true),
    StructField("Domain", StringType,  nullable = true)
))


def parseResultSet(rs: ResultSet): Row = {
    val resultSetRecord = columns.map(c => rs.getString(c))
    Row(resultSetRecord:_*)
}

def resultSetToIter(rs: ResultSet)(f: ResultSet => Row): Iterator[Row] = new Iterator[Row] {
    def hasNext: Boolean = rs.next()
    def next(): Row = f(rs)
}

def paralleliseResultSet(rs: ResultSet, spark:SparkSession): DataFrame = {
  val rdd = spark.sparkContext.parallelize(resultSetToIter(rs(parseResultSet).toSeq)     
  spark.createDataFrame(rdd, schema)
}

val conn = DriverManager.getConnection(url, username, pass)
val rs = conn.createStatement.executeQuery("exec <sp name>")
val df: DataFrame = paralleliseResultSet(rs,spark)
df.createOrReplaceTempView("df")

spark.sql("""select * from df""").show(10, False)
 
```
Tutorial: Build Personalized Discord Bots with WayScript
Tags: tutorial, beginners, discord, python
Published: 2020-05-15 13:58:13

---
title: "Tutorial: Build Personalized Discord Bots with WayScript"
canonical_url: https://wayscript.com/learn/build-personalized-discord-bots-wayscript
---

##Introduction
Creating bots can be tedious depending on the software you use. Discord bots are no exception to this. While other platforms have unnecessary limitations, WayScript provides a solution that is robust enough to cover every use case. If we don't have it, then we give you the tools to create it for yourself using a programming language. Let's see how we can create custom discord bots using [WayScript](https://wayscript.com/)!

*Prefer to watch vs read, check out the video tutorial at the end of this post.*

##Prerequisites
No prerequisites but some content you might find helpful:
[Working with Discord](https://docs.wayscript.com/library/modules/discord)
[Working with python](https://docs.wayscript.com/library/modules/python)

##Monitoring Discord Messages
In this example, we want an action to occur whenever an event happens in discord. We can accomplish this using the discord trigger provided by Wayscript. We can pull this into the trigger slot of our workflow.

![trigger](https://cdn.wayscript.com/blog_img/83/2.png)

The first time you use discord, you will be accessed to authorize it and choose the channel you want to connect your bot to.

![discord](https://cdn.wayscript.com/blog_img/83/3.png)

You are also able to choose the authorizations you want to provide to Wayscript. Next, we need to configure our discord trigger's settings. We have multiple options here such as mode and the channel we want to monitor.

![](https://cdn.wayscript.com/blog_img/83/4.png)

##Creating Bot Responses
There's several different ways we can create these responses in WayScript. Since we provide fully customizable tools in the programming language modules, you're able to build advanced bots very easily with your programming language of choice. In this example, let's pass the entire message text to a python module, preform some regular expression matching, and return a response.

![](https://cdn.wayscript.com/blog_img/83/5.png)

We're matching these keyword searches against a python dictionary of keywords and actions created with the create variable step. The python code would look something like this:
```Python
keywords = variables['keywords']
import re
​
command = re.compile(r'\![a-z]*')
matches = command.findall(󰀂v.1.message-Discord_Message.message󰀂)
print(matches)

action = keywords.get("matches")
​
variables['action'] = action
```

##Sending back a Discord Response
Once we match keywords to our dictionary of keys and actions, we can write back a discord response as the bot.

![response](https://cdn.wayscript.com/blog_img/83/6.png)

##Need Help?
If there's any questions feel free to message us on discord. We're happy to help! If you want to see this full script template, you can find it [here](https://wayscript.com/user/derricks/rLntoEqY).

Embed YouTube
{% youtube sWpAfML5h0I %}
Вышел Deno 1.0
Tags: webdev, node, deno
Published: 2020-05-14 09:33:20

Вольный перевод статьи [Deno 1.0 is out!](https://dev.to/wobsoriano/deno-1-0-is-out-10p7)

## Что такое Deno? 
Deno - это простая, современная и безопасная среда выполнения для JavaScript и TypeScript, использующая V8 и построенная на Rust.

* Безопасный по умолчанию. Нет доступа по-умолчанию к файлам, сети или среде, если это явно не разрешено.
* Поддерживает TypeScript из коробки.
* Поставляет только один исполняемый файл.
* Имеет встроенные утилиты, такие как инспектор зависимостей (deno info) и средство форматирования кода (deno fmt).
* Имеет набор проверенных стандартных модулей, которые гарантированно работают с Deno: deno.land/std

## Но зачем? 

От Ryan Dahl (создатель Node.js):

JavaScript значительно изменился с момента разработки Node в 2009 году.

* Promises / Async / Await
* ES Modules
* Typed Arrays

Node имеет проблемы:

* Плохо спроектированная модульная система с централизованным распределением.
* Много устаревших API, которые должны поддерживаться.
* Безопасность

(Эти проблемы не являются уникальными для Node. Python и Ruby похожи)

Выступление Ryan Dahl на HolyJS

[![Ryan Dahl — Deno, a new way to JavaScript](http://img.youtube.com/vi/HjdJzNoT_qg/0.jpg)](https://www.youtube.com/watch?v=HjdJzNoT_qg)

## Установка

Используя shell 

```bash
curl -fsSL https://deno.land/x/install/install.sh | sh
```

Используя homebrew

```bash
brew install deno
```

## Hello World 

Простой http сервер

```javascript 
import { serve } from "https://deno.land/std@0.50.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
  req.respond({ body: "Hello World\n" });
}
```

Подробности в [блоге](https://deno.land/v1)
I'm slashing my salary to 1/3 of what I make. Here's why (and ask me anything, ofc):
Tags: discuss, ama, career
Published: 2020-05-15 13:50:32

{% twitter 1261291791078297602 %}

"Really?"

Yes.

"But why?"

I believe the Real Life Value™ of my next job is at least 5x the salary on paper. I'm scaling up.

"What's Real Life Value?"

People you get to meet, network you get to grow, experiences you get to make, lessons you get to teach, and most of all lessons you get to learn. Can you honestly put a price tag on that?

It's time we start changing the language around (tech) salaries.
It's still Friday.
Tags: musing, culture
Published: 2020-05-15 13:41:22

It's still Friday.  That's right.

{% youtube kfVsfOSbJY0 %}

In my blog post, [Take the day off](https://dev.to/azure/take-the-day-off-3242) I tried to share my thoughts on taking time off while dealing with the "sameness" of being in lockdown.

My week as an Azure Cloud Advocate is spent helping others learn about the cloud through videoes, blogs, presentations, and conversations.  My weeks seem longer lately because I am working more.  Not because anyone has demanded I work more, but simply because there's more time to use in my day.

Today is still *Friday*, and for many people, it represents the end of the week.  While we can toil away at our computers on the weekend, it's good to remember that you can relax.  You can take some time off.

Being in New York City, my options are pretty limited.  The weather is looking up and that means the city can become my hangout. My wife, my pug Rico and I will do our best to remind ourselves that there's still a world to enjoy. We'll pop by the local bar for takeout and a cocktail.  I'm hoping for a picnic in the sun in a nice isolated area and enjoying what we still have. 

Then there's some reading I should do.  I have been holding on to a copy of [The Unicorn Project](https://itrevolution.com/the-unicorn-project/) that really could use a read.  Also, I've been watching Ozark on Netflix, compelling stuff.  Even from home, I am able to just relax with a good book or some exciting TV, and some time to think. 

Don't forget to exercise! All the work indoors at your desk, couch or bed can become draining.  Finding an outlet to get the body moving if you are physically capable is helpful!  Even some light stretching, some breathing or some meditation can help you find that balance.  Some friends have taken to yoga classes they see on YouTube.  There are so many options even from your living room to keep yourself occupied and healthy during this strange time.

Mental health is important, your time off is to help benefit your mental health.  Your managers and leaders should encourage you to find this time off and appreciate it.  This is when you rest, recharge and prepare for the best work you can do next week.

I try to find some separation from the work I do.  It's tough too.  How do you know when the day ends?  I continue to find ways to remind myself that there's a big world and I have lots of living to do in it.

What's your plan for the weekend, how will you unwind?

Talk to me about how you plan to walk away from your code and enjoy the world, even from home.  How will you spend your weekend to unwind?


---

Since it's still Friday, that means you can still get some work done before you hit your rest button.  If you'd like to spend some time on cool modules to get started with Azure, check out [Microsoft Learn Azure Fundamentals](https://docs.microsoft.com/learn/paths/azure-fundamentals/?WT.mc_id=blog-devto-jagord).  It's free training and will get you a [$200 free credit and 12 months of free services for Azure](https://azure.microsoft.com/free/?WT.mc_id=blog-devto-jagord).

Go chill afterward though, it IS *Friday*.
Git staging with Tig
Tags: git, tig, workflow, productivity
Published: 2020-05-15 13:39:26

After i saw a few posts here talking about [tig](https://github.com/jonas/tig), i installed and can't live without it anymore, the speed and VIM shortcuts kills any need for GUI clients i used in the past for specific tasks.

But the best feature by far is how easy it is to stage hunks of a file, i use print/Log/console.log/etc way more than i should and is very easy to forgot a useless/dangerous line on production code. Git have a ver useful feature to help commit only what it really       needs to, [git add --patch](https://git-scm.com/docs/git-add#Documentation/git-add.txt---patch). And is here where tig helps me a lot.

![Stage hunk](https://i.imgur.com/c7bGXZZ.gif)

After opening tig, it presents you with the main view, showing the history, pressing "s" it shows the status view, where you can navigate through all staged/unstaged changes, review them and stage/unstage. 

When you press enter on a file, shows a diff on the right/down and you can navigate it using "j" or "k" and Page Up and Page Down. Press "u" on the beggining of diff, it stages the entire file, but if you navigate to a specific hunk and press "u", only this hunk is staged, making it easier to left out all the unnecessary stuff you may include in the file while working on it.
Mailing bot with Python
Tags: python, webdev, beginners, machinelearning
Published: 2020-05-15 13:27:35

Bots are a really cool way to automate boring tasks. To finish this chore i wished to code a mailer bot and i finally succeeded using the Flask-mail library in python. 

I started out by referring to the most commonly available codes for this task, however, the official documentation of the Flask-mail extension did not help me at all. It was just extra. I did refer multiple Youtube tutorials and stumbled upon codes that were perfect... well, almost.

Here's the thing though, SMTP authentication errors are not easy to rectify. What with the TSL AND SSL ports and their never ending expectations, it made me almost want to give up on this task. 

![OnPaste.20200515-165300.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1589541799829/bTSwrTObE.png)
This kept showing up on my window and it got frustrating to work with.

After spending hours staring at the screen, wondering what was wrong and searching for all possible error solutions online i stumbled upon a particular setting that had been from my mail host that had been turned off. 

![OnPaste.20200515-170118.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1589542290979/klmNG32SQ.png)
Such a small thing, and i wasted so much time figuring it out. 
The secret to my success lay not in my code but in the settings of my account! Even after changing the settings, my code, which i had picked up online, wasn't working as expected. I altered and made changes wherever i needed to and fixed it, pronto, and voila! 

My mailer can send mails to as many people as you want, as many times as you'd like it to, (well, of course it's a spam bot ;) ) albeit it is being used as an invitation list tracker. 

Here's the key part of the source code. 

- Importing the right libraries
```
import smtplib, ssl
```
- Setting the right port, according to the mail server you use
```
port = 465
```
- Use the updated version of functions, which are currently supported
```
context = ssl.create_default_context()
```

Head over to my github repository for the whole code. 
> https://github.com/gupta-niharika/Mailer


And that's what i learnt today, that these codes online, may or may not work, but if you code with a purpose, there's nothing that can stop you from doing your tasks satisfactorily.
How to create a node graph editor with #javascript
Tags: javascript, graph
Published: 2020-05-15 13:24:16

Hi, am looking for a way to create a **node graph editor** using **the mouse** then get the **adjacency matrix** and **list** with  **javascript** of course with ability of adding/deleting/editing the vertices and edges and choosing whether the graph is directed or undirected just like the following pictures:

https://i.stack.imgur.com/kwdkK.png

I tried to look for some js libraries (sigmajs, d3js, ...) but all what I could find was a way to draw graphs from an adjacency matrix and not a way to creat an editor to deal with them using the mouse on the browser .
คอร์สสอน NodeJS พื้นฐาน By Coursedex
Tags: programming, webdev, node, coding
Published: 2020-12-03 17:39:35

---
title: คอร์สสอน NodeJS พื้นฐาน By Coursedex
published: true
date: 2020-05-15 13:16:22 UTC
tags: programming,webdevelopment,nodejs,coding
canonical_url: 
cover_image: https://cdn-images-1.medium.com/max/1024/1*evLoLVfBN-FPtjCZRZNl4Q.jpeg
---

### คอร์สสอน NodeJS พื้นฐาน By Coursedex

เป็นคอร์สสอน Api ด้วย NodeJS/Express ออนไลน์ใน Youtube สามารถเข้าไปรับชมได้ฟรี

![](https://cdn-images-1.medium.com/max/1024/1*evLoLVfBN-FPtjCZRZNl4Q.jpeg)

> สอน NodeJS พื้นฐาน EP.1 — การติดตั้ง node และ อื่นๆ

[https://www.youtube.com/watch?v=aNLQsbc4sRU](https://www.youtube.com/watch?v=aNLQsbc4sRU)

> สอน NodeJS พื้นฐาน EP.2 — Vscode Extension และ เริ่มใช้ Express

[https://www.youtube.com/watch?v=Ios6umwtLLQ](https://www.youtube.com/watch?v=Ios6umwtLLQ)

> สอน NodeJS พื้นฐาน EP.3 — การติดตั้ง Nodemon และ Basic HttpReques

[https://www.youtube.com/watch?v=aAlZ9l45TIQ](https://www.youtube.com/watch?v=aAlZ9l45TIQ)

![](https://cdn-images-1.medium.com/max/1024/1*NvmV3bl_a5ZbYmT5OyvL_A.jpeg)

**_website :_** [**_https://thanawatgulati.com_**](https://www.youtube.com/redirect?event=video_description&v=aAlZ9l45TIQ&redir_token=Mn_I2uPLjggkXLuFaDPfDopSwt98MTU4OTYzNDg2N0AxNTg5NTQ4NDY3&q=https%3A%2F%2Fthanawatgulati.com)

**_blog :_** [**_https://blog.thanawatgulati.com_**](https://www.youtube.com/redirect?event=video_description&v=aAlZ9l45TIQ&redir_token=Mn_I2uPLjggkXLuFaDPfDopSwt98MTU4OTYzNDg2N0AxNTg5NTQ4NDY3&q=https%3A%2F%2Fblog.thanawatgulati.com)

**_github :_** [**_https://github.com/thanawatgulati/test\_express_**](https://www.youtube.com/redirect?event=video_description&v=aAlZ9l45TIQ&redir_token=Mn_I2uPLjggkXLuFaDPfDopSwt98MTU4OTYzNDg2N0AxNTg5NTQ4NDY3&q=https%3A%2F%2Fgithub.com%2Fthanawatgulati%2Ftest_express)

* * *
Unittest in Unity3d
Tags: unity3d, test, unittest, code
Published: 2020-05-15 13:12:40

Hey!
Just uploaded another tutorial,
How to unittest in Unity3D Engine

Enjoy :)

{% youtube R3KLWu7wWyo %}

> Like this post? 
> Support me via [Patreon](https://www.patreon.com/eranelbaz)
> Subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCVUNeBGM5wZJKcOx0QwAaTA?sub_confirmation=1)
Why do people use golang? 
Tags: go
Published: 2020-05-15 13:11:14

Imagine one language that does all your needs for server side development. One that is light weight , has garbage collection , has a concurrency model. An easy and fast language. That is where Golang shines.

There are other reasons why people use golang:

* **Performance:**  Usually, the main reason for the switch is performance and memory efficiency
* **Concurrency:** A very hard problem in programming and Golang makes it very easy.
* **Simplicity:** Looks somewhat like the C programming or Java programming languages, but doesn't have OOP.
* **Tooling:** Many great tools to make programming easy
* **Trustworthy Backers:** Backed by Ken Thompson
* **Ecosystem:** Many <a href="https://github.com/golang/go/wiki/GoUsers">companies using Golang</a>

Golang is the open-source and procedural programming language. It was started by Rob Pike, Robert Griesemer, and Ken Thompson in 2009.

Big companies use Golang like; Google, Uber, Twitch, SendGrid, Dropbox, and others.

Golang combines features of other programming languages. 

* It is easy to use 
* Develop an app, spend less time and money.
* High performance and a wider audience for your app
* Golang is <a href="https://golangr.com/">easy to learn</a> 
* Clean and comfortable to read.
* It is more reliable
* Faster than other languages.
* Concurrency
* High-level efficiency
* Advanced performance for networking
Type Of Hackers
Tags: typeofhackers
Published: 2020-05-15 13:06:25


There are many types of hackers in this world

## Black-Hat Hackers

Such hackers often have no particular care for the rule of law, the systems they disrupt, or the ill effects they cause.
Black Hat hackers are criminals who break into computer networks with malicious intent. They may also release malware that destroys files, holds computers hostage, or steals passwords, credit card numbers, and other personal information.

## White-Hat Hackers

White hat hackers choose to use hacking for good rather than evil. Also known as "Ethical Hackers".White hat hackers do hacking with permission, which makes the process completely legal. White hat hackers perform penetration testing, in-place security systems, and vulnerability assessment for companies. There are also courses, training, conferences and certifications for ethical hacking.

## Grey-Hat Hackers

 Grey hat hackers are a  mixture of both black hat and white hat hackers.Grey hat hackers will look for vulnerabilities in a system without the owner’s permission or knowledge. If issues are found, they will report them to the owner, sometimes requesting a small fee to fix the issue. If the owner does not respond or comply, then sometimes the hackers will post the newly found exploit online for the world to see. Their intention is to bring weakness to the attention of the owners and to get praise or little reward from the owners.

## Miscellaneous-Hat Hackers

Apart from these three, the hackers have been divided into different parts.


### Blue-Hat Hackers

A blue hat hacker is someone outside computer security consulting firms who is used to bug-test a system prior to its launch. They look for loopholes that can be exploited and try to close these gaps. Microsoft also uses the term BlueHat to represent a series of security briefing events.

### Red-Hat Hackers

Red hat hackers are a blend of both black hat and white hat hackers. They are usually on the level of hacking government agencies, top-secret information hubs, and generally anything that falls under the category of sensitive information.



###  Script kindle

A script kiddie is a non-expert who breaks into computer systems by using pre-packaged automated tools written by others, usually with little understanding of the underlying concept, hence the term Kiddie.

### Elite-Hat Hackers

This is a social status among hackers, which is used to describe the most skilled. Newly discovered exploits will circulate among these hackers.
͒Neophyte
A neophyte, "Noob" or "NewBie" or "Green Hat Hacker" is someone who is new to hacking or phreaking and has almost no knowledge or experience of the workings of technology and hacking.

### Hacktivist

A hacktivist is a hacker who utilizes technology to announce a social, ideological, religious, or political message. In general, most hacktivism involves website defacement or denialof-service attacks.