teleren/devto huggingface dataset:
CodeStream for JetBrains is Here
Tags: discuss, productivity
Published: 2019-07-16 14:31:16

---
title: CodeStream for JetBrains is Here
published: true
description: CodeStream is now available for the JetBrains family of IDEs
tags: discuss, productivity, 
canonical_url: https://www.codestream.com/blog/codestream-for-jetbrains-is-here
cover_image: 
---

CodeStream is now available for the [JetBrains family of IDEs](https://plugins.jetbrains.com/plugin/12206-codestream)!

CodeStream make it easy for developers to review, discuss, and understand code. Conversations about code are saved with your code, so that a knowledge base builds up over time, with zero additional effort. Watch the following short video to see how all of this magic happens right inside your favorite JetBrains IDE.

{% youtube F6y4nrIy4es %}
Daily Challenge #16 - Number of People on the Bus
Tags: challenge
Published: 2019-07-16 14:29:15

---
title: Daily Challenge #16 - Number of People on the Bus
published: true
description: Part of "Daily Challenge" series
tags: #challenge
series: Daily Challenge
---

Today's [challenge](https://www.codewars.com/kata/5648b12ce68d9daa6b000099) comes from aryan-firouzian on Codewars. You are to figure out how many people are on the bus given the following scenario: 

>There is a bus moving in the city, and it takes and drop some people at each bus stop.

> You are provided with a list (or array) of integer arrays (or tuples). Each integer array has two items which represent the number of people that get on the bus (The first item) and the number of people that get off the bus (The second item) at a bus stop.

> Your task is to return number of people who are still left on the bus after the last bus station (after the last array). 

Good luck, and happy coding!

***
_Thank you to [CodeWars](https://codewars.com/), who has licensed redistribution of this challenge under the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause)!_

_Want to propose a challenge for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Logical Components in blockchain
Tags: blockchain, dlt, distributed
Published: 2019-07-16 13:54:27

---
title: Logical Components in blockchain
published: true
tags: blockchain,DLT,distributed
description:
---

This article points out and gives an outline of the various logical components in the blockchain.

When one takes a first look in Blockchain space it looks very confusing and complicated and there is no doubt about it, as the low-level programming and mathematics involved to create and implement blockchain ecosystem come with difficulty.

In this article, I will explain the purpose of the individual logical component that makes up any blockchain ecosystems.

To understand how blockchain technology works irrespective of its flavor or application, it is necessary to understand the logical component of blockchain ecosystem and their role.

The Blockchain Ecosystem can be logically segregated in these 4 logical components.

- node application
- shared ledger
- consensus algorithm
- virtual machine

1. Node Application
Any Machine who want to be part of the blockchain ecosystem, need to run a node of the specific Blockchain. Using bitcion as an example , the machine must be running Bitcion wallet Application.

2. Shared Ledger
Consider it as a data structure, which is inside the node application. If you are running the Ethereum client, you can see the Ethereum ecosystem ledger and interact according to the rules of that ecosystem (smart contracts, payments, etc.). If you are running the Bitcoin client, you can participate in the Bitcoin ecosystem, according to the rules set out in the program code of the Bitcoin node application.
You may run as many node application of any blockchain ecosystem, but there will be only one shared ledger of the particular blockchain ecosystem.

3. Consensus Algorithm
This logical component provides the "rules and regulation" on how the single view of the shared ledger will be reached in blockchain ecosystem.Different ecosystems have different methods for attaining consensus depending on the desired features the ecosystem needs. The various famous consensus algorithms are - Proof of Work, Proof of Authority, Proof of Stake, Proof of Elapsed Time.

4. Virtual Machine
This is the final logical component of the blockchain ecosystem. It acts a bucket or container where all the logical components rest, act and interact.

A virtual machine is a representation of a machine (real or imaginary) created by a computer program and operated with instructions embodied in a language.It is an abstraction of a machine inside a machine.

This post was first originally posted here - https://www.linkedin.com/pulse/logical-components-blockchain-ajay-singh/
How to Keep Up with Microsoft
Tags: help, discuss, career
Published: 2019-07-16 13:48:37

Microsoft is massive. Hell, if you only narrowed it down to only Azure, I feel there must be more teams than the MLB and NBA combined. Each team seems to have it's own way of sharing news, like [this twitter feed from Cloud Advocates](https://developer.microsoft.com/en-us/advocates/tweets). 

I want to explore, and I'm wondering if there is a page somewhere that aggregates all of this information, or if randomly discovering folks on Twitter is still the best way to find out that someone is out there bulding IoT projects for Azure on a daily basis.

These are the resources I've found so far:
* Twitter
* Twitch (Stumbled on this [Visual Studio](https://www.twitch.tv/visualstudio/videos) feed recently)
* [Channel 9](https://channel9.msdn.com/)
* [Cloud Developer Advocates](https://developer.microsoft.com/en-us/advocates/index.html)
Bootcamp Outcomes by the Numbers
Tags: career, beginners, bootcamp, discuss
Published: 2019-07-16 13:44:02

![](https://thepracticaldev.s3.amazonaws.com/i/5688dm7ytl3fm0e67x9p.png)

Actual google sheet can be found [here](https://docs.google.com/spreadsheets/d/1w55YZHZMamqdFiF3YLJygJlCFvaGaG-Y8xR415ueCPw/edit#gid=0).

So what is this? 

There is a group of bootcamps that, biyearly, report their results in a mutually agreed upon format. These are the results reported by that set of bootcamps from the first half of 2018. 

That group is the [CIRR](https://cirr.org) (Council on Integrity on Results Reporting) and that data can be found [here](https://cirr.org/data).

## Key Takeaways

- 79.3% of graduates get jobs
- 76.9% of attendees graduate
- 60.7% of attendees get jobs

## Keep in mind

#### 1) Some bootcamps "fire" students
Some bootcamps part ways with underperforming students prior to graduation to ensure their graduate employment rates are reflective of results for people who have mastered their curriculum. 

#### 2) Employment is broadly defined
Employment includes full time work, part time work, contract work, and internships as its used here. 

#### 3) Online programs have lower graduation rates
If you see a really low graduation rate, it's likely for an online program. 

#### 4) These averages are depressed by online programs
The presence of online programs in this data drags down the quoted averages.

#### 5) Employment numbers are reported 6 months post graduation
A program's employment rate reflects the number of graduates that are employed 6 months after having completed the program. This is because it often takes bootcamp graduates 3-6 months to find a job. 

#### 6) These results are likely better than average
In general, companies tend to share good news when they have it and keep quiet about bad news. By virtue of the fact that they're getting reported, it's likely that these results are better than average.
Soul in the Machine – Can we avoid the Google Duplex outrage in Conversational AI development?
Tags: ethics, ai, machinelearning
Published: 2019-07-17 11:59:03

---
title: Soul in the Machine – Can we avoid the Google Duplex outrage in Conversational AI development?
published: true
tags: Ethics,ai,machinelearning
canonical_url: https://jasonstcyr.com/2019/07/16/soul-in-the-machine-can-we-avoid-outrage-in-ai-development/
---

This is Part 5 in the Soul in the Machine series. In the Soul in the Machine series, I will be delving into our collective responsibility to ensure that computing systems are treating users fairly and responsibly. Specifically, I will be raising the ethical questions around current trends such as data privacy regulations and machine learning capabilities. … [Continue reading Soul in the Machine – Can we avoid the Google Duplex outrage in Conversational AI development? →](https://jasonstcyr.com/2019/07/16/soul-in-the-machine-can-we-avoid-outrage-in-ai-development/)
Painless Synchronization of Azure Blob Storage with AWS S3
Tags: tech, development, azure, aws
Published: 2020-11-12 04:11:18

---
title: Painless Synchronization of Azure Blob Storage with AWS S3
published: true
date: 2019-07-16 13:00:00 UTC
tags:
- tech
- development
- azure
- aws
canonical_url: https://www.sheldonhull.com/blog/painless-synchronization-of-azure-blob-storage-with-aws-s3/
---

## Synchronization

Moving data between two cloud providers can be painful, and require more provider scripting if doing api calls. For this, you can benefit from a tool that abstracts the calls into a seamless synchronization tool.

I've used RClone before when needing to deduplicate several terabytes of data in my own Google Drive, so I figured I'd see if it could help me sync up 25GB of json files from Azure to S3.

Very happy to report it worked perfectly, and with only a couple minutes of refamilarizing myself with the tool setup.

## Install RClone

For windows users, it's as easy as leveraging Chocolatey and running

```
choco upgrade rclone -y

```

## Setup Providers

Go through `rclone config` dialogue and setup your cloud provider. In my case, I setup Azure as a provider to connect to blob storage, and then AWS with s3.

Cloud to Cloud

Providers that support cloud to cloud based calls without copying locally are provided in the section for [Optional Features](http://bit.ly/2LEOSrR) where you can view the operations that support calls

## Initialize Sync

```
rclone copy azure:containername s3:bucketname/keyprefix --log-level ERROR --progress --dry-run

```

## Wrap-up

Take a look at this if you need a simple way to grab some data from one provider and leverage in another and you might want to save yourself some time on learning provider specific api calls. I've found tools like this, Terraform, and others that help abstract the api calls can be a great resource as you can leverage one syntax to work with two completely different providers and eliminate a lot of effort in coding.
Get youtube video title on termux
Tags: termux, android
Published: 2019-07-16 12:30:06

---
title: Get youtube video title on termux
published: True
description: Easy get youtube video to use somewhere else
tags: termux, android
---

# Intro
The main reason of this tutorial is to share an akward experience I used to have on android and solve it. Sometimes when I share a video from youtube on twitter it only shares the url for the video. I wanted also get the title, so I wrote this script

```sh
#!/data/data/com.termux/files/usr/bin/bash

URL=$(termux-clipboard-get)

TITLE=$(youtube-dl --skip-download --get-title --no-warnings $URL | sed 2d | awk '{print tolower($0)}')

echo "$TITLE' '$URL"  | tee termux-clipboard-set


```

## Setting pbcopy and pbpaste using termux

Open your termux and run

    apt install termux-api neovim

Now on your termux edit your ~/.bashrc

```sh
alias pbcopy='termux-clipboard-get'
alias pbpaste='termux-clipboard-set'
```
Closures: Debouncing
Tags: javascript, webdev, beginners
Published: 2019-07-16 11:57:12

In the previous article in this series, we looked at a practical use of closures called memoization. In this post we're going to briefly look at closures in action through a debounce function.

A debounce delays the processing of a function for a certain amount of time. It can be very useful with things like forms, buttons, or mouse events--anytime there is a lot of user input possible. It can help prevent rapid fire re-rendering of the DOM by introducing a "cooldown" period, to use gaming terminology.  

```html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Practice</title>
</head>
<body>
    <button id="button">Click Me</button>

    <script>
        const debounce = (func, delay) => {
            let inDebounce
            return function () {
                const context = this
                const args = arguments
                clearTimeout(inDebounce)
                inDebounce = setTimeout(() => func.apply(context, args), delay)
            }
        }

        const button = document.getElementById('button')
        button.addEventListener('click', debounce(() => {
            console.log('Hey! It is', new Date().toUTCString())
        }, 3000))
    </script>
</body>
</html>
```

My goal here isn't to teach you how to write the debounce. There's plenty of resources (you could literally copy paste a generic debounce function, like I did here). More so, I want you to spot the closure in there and have that "ah-ha" moment. If you want a guide or to get in depth on this function, check out the [source] (https://codeburst.io/throttling-and-debouncing-in-javascript-b01cad5c8edf) I used.

The key here, from a closure standpoint, is our `inDebounce` variable. As a closure, returned function "remembers" whether or not it the variable is running a timeout. If we fire it off while it's still in the timeout, it will `clearTimeout`, thus restarting it.

Another instance of a closure in action.

Have you guys used debounces before? Are there different variations or use cases where its been super helpful?
Dummy data generation with Python
Tags: python
Published: 2019-07-16 11:40:27

---
title: Dummy data generation with Python
published: true
description: python 
tags: python
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o751RRF3SwRb6dFDi%2Fgiphy.gif&f=1
---
Do you need Dummy data for your app? You can do that with the <a href="https://pythonprogramminglanguage.com/">Python programming language</a>. The module Faker lets you generate fake data.

That is very useful when you are just starting out building an app and do not have any data yet.

    #!/usr/bin/python3
    from faker import Faker
    fake = Faker()
    
    print(fake.name())

It will generate a new name each run:

    λ  python3 test.py  
    Sean Weber
    λ  python3 test.py
    Angelica Watson

It can automatically generate an address to:

    #!/usr/bin/python3
    from faker import Faker
    fake = Faker()
    
    print(fake.name())
    print(fake.address())

Example run:

    Dr. Derek Scott
    010 Ortega Spring
    Samanthaburgh, CT 36146

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FDCp4s7Z1FizZe%2Fgiphy.gif&f=1">

These are all English names and addresses. It works for international fake data too:

Just add the locale, for Italy:

    fake = Faker('it_IT')

If you need many fake names and addresses, use a for loop to wrap it in.

Related links:
* <a href="https://github.com/joke2k/faker">Fake module</a>
* <a href="https://pythonprogramminglanguage.com/">Learn Python Programming</a>
Web Development with Python Flask
Tags: python, flask
Published: 2019-07-16 11:16:36

---
title: Web Development with Python Flask
published: true
description: python, flask
tags: python, flask
---
Flask lets you do web development in <a href="https://pythonprogramminglanguage.com/">Python</a>. Python can run the web server that returns HTTP responses.

So what is Flask? Flask is a micro framework. A Python module that assists you in building your web app.

### The Code

First install Flask with pip,

    pip install flask

We'll import the module in our Python script:

    #!/usr/bin/python3                                                                                                                                                  
    # -*- coding: utf-8 -*                                                                                                                                              
    from flask import Flask
    from flask import request
    from flask import make_response

Then run the program below
                                                                                                                          
    #!/usr/bin/python3                                                                                                                                                  
    # -*- coding: utf-8 -*                                                                                                                                              
    from flask import Flask
    from flask import request
    from flask import make_response


    app = Flask(__name__)

    @app.route('/')
    def hello_world():
        return 'Hello World!'

    @app.route('/browser')
    def index():
        user_agent = request.headers.get('User-Agent')
        return '<p>Your browser is %s</p>' % user_agent

    if __name__ == '__main__':
        app.run()

In your browser you'll be able to open http://127.0.0.1:5000/  and http://127.0.0.1:5000/browser.

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl1J9COxiSAD6xyx20%2Fgiphy.gif&f=1">

The method @app.route() links a web browser url to a Python function. The Python function can do anything you want.

The response can return both plain text and html responses. The call app.run() starts the server.

Related links:
* <a href="https://gumroad.com/l/IMzBy">Flask Web Apps Course & Examples</a>
* <a href="http://flask.pocoo.org/">Flask module</a>
* <a href="https://pythonspot.com/flask-web-app-with-python/">Flask article</a>
* <a href="https://pythonprogramminglanguage.com/">Learn Python Programming</a>
Get HTTP response codes with Python
Tags: python, http
Published: 2019-07-16 10:51:30

---
title: Get HTTP response codes with Python
published: true
description: python, http
tags: python, http
cover_image: https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fimages.mentalfloss.com%2Fsites%2Fdefault%2Ffiles%2Fnetscape-hero.jpg%3Fresize%3D1100x740&f=1
---
You can get HTTP response codes with Python. This is great to find broken urls or redirects. 

The web is dynamic. It's ever changing. Today the popular browsers are Chrome and Firefox. It used to be Netscape and Internet Explorer.

<img src="https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fi.giphy.com%2F3o6ozkyIzGJHula8i4.gif&f=1">

Because it's ever changing, you want to test a website for broken links (404), redirects and other errors. You can do this in Python.

To speed up testing, you want to be using threading. A thread allows you "parallel" execution. Parallel is between quotes because it's not really parallel, but multi-threaded.

So what does that look like in code?

    #!/usr/bin/python3
    import time
    import urllib.request
    from threading import Thread
    
    class GetUrlThread(Thread):
        def __init__(self, url):
            self.url = url
            super(GetUrlThread, self).__init__()    
    
        def run(self):
            resp = urllib.request.urlopen(self.url)
            print(self.url, resp.getcode())
    
    def get_responses():
        urls = ['https://dev.to', 'https://www.ebay.com', 'https://www.github.com']
        start = time.time()
        threads = []
        for url in urls:
            t = GetUrlThread(url)
            threads.append(t)
            t.start()
        for t in threads:
            t.join()
        print("Elapsed time: %s" % (time.time()-start))
    
    get_responses()

Run to test every url in urls:

    https://www.github.com 200
    https://dev.to 200
    https://www.ebay.com 200
    Elapsed time: 0.496950626373291

A response of 200 means everything is okey. If a page is not found it returns 404. Basically every code other than 200 means there's a problem.

Related links
* <a href="https://pythonprogramminglanguage.com/">Python programming tutorial</a>
* <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">The Web Protocol (HTTP)</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
* <a href="https://pythonbasics.org/exercises/">Python Exercises</a>
React UI Lib Experiences
Tags: react, nextjs, styledcomponents, ui
Published: 2019-07-16 10:49:33

---
title: React UI Lib Experiences
published: true
description: 
tags: react, nextjs, styled-components, ui
---

Hi,

I am currently working on an idea and would like to speed up my development. So I am searching a for opinions and experiences with either `antd` or `materialUI`. 

For my setup I am using NextJS & Styled-Components. Maybe somebody already has experience with this setup and could tell me something about some pitfalls to help me decide between the two!

Thanks!
Run JS ES6 & Reactjs in the browser.
Tags: react, javascript
Published: 2019-07-16 10:41:49

While I was building a reactjs package and just after finishing it. I wanted to test it in browser - not just unit test! I was lazy to install webpack dev server or other tools to compile my code and run dev server with hot-reload, so I went to try running it directly in the browser! and yaay it worked! and here is few things I learned:
- UMD - Universal Module Definition
- AMD - Asynchronous Module Definition
- CJS - CommonJS Modules
- You can run es6 code in the browser with script type text/babel and include babel Stand alone in the browser to transpile your es6 code - so cool!
- You can see how babel transpile your code just in the browser here: https://babeljs.io/en/repl
- You can include almost all the JS libraries directly in your browser with umd bundles.
- Rollup and Typescript build is just so easy as 1-2-3! and there is 2 great literary starters 
  - https://github.com/Hotell/typescript-lib-starter 
  - https://github.com/alexjoverm/typescript-library-starter
- Being more inclined to be lazy is a good thing, as long as you use this to read and re-discover another ways to solve your problems.

- Keeping up to date with tech is hard as tech moving at super speed and everyday there is always a new thing! so try as much as you can Un-learn and Re-learn things you were used to do before as there might be other solutions developed.

Screenshot and code are below: 
 
![index.html](https://meabed.com/content/images/2019/07/image-7.png)
![app.jsx](https://meabed.com/content/images/2019/07/image-8.png)


HTML preview: https://codesandbox.io/s/currying-fire-rm55g

Github repo link: https://github.com/meabed/reactjs-slot-layout

A few helpful links:
- https://www.davidbcalhoun.com/2014/what-is-amd-commonjs-and-umd/
- https://www.freecodecamp.org/news/anatomy-of-js-module-systems-and-building-libraries-fadcd8dbd0e/
- http://unscriptable.com/2011/09/30/amd-versus-cjs-whats-the-best-format/


If you have comments or thoughts, I would love to hear it, discuss it and share it, please feel free to leave it in the comment or reach out [@meabed](https://twitter.com/meabed)

Happy coding 🤞
deploying rails showing error "Missing encryption key".
Tags: help, rails, ruby, digitalocean
Published: 2019-07-16 10:26:46

---
title: deploying rails showing error "Missing encryption key".
published: true
tags: help, #rails, #ruby, #digitalocean
---

Hello,
I am using rails credentials in production. Like the following image. But when i am trying to upload it to digitalocean, it is showing errors ```Rake aborted!
01 NoMethodError: undefined method `[]' for nil:NilClass```
Where is the problem in this code?

This is my credential structure, and i am calling those credentials with the following.
```:user_name => Rails.application.credentials.sendgrid[:user_name],
:password => Rails.application.credentials.sendgrid[:password],```

How can i solve this problem?