teleren/devto huggingface dataset:
How to hash passwords with Python 
Published: 2021-05-19 06:59:32

If you are a web developer working on creating a website, you will need to look into the safe storage of passwords for the site. How can one go about doing this? The answer lies in hashing and verification of passwords. 

In this blog, we shall look at how one can hash passwords with Python. But before that, let us take a quick look at what is hashing. Hashing refers to the process of converting a given key into another value. A hash function is used to generate the new value as per a mathematical algorithm. The result of a hash function is known as a hash value or simply, a hash. 

In Python, hashing can be carried out using Passlib. It is a password hashing library for Python 2 & 3, which offers cross-platform implementations of over 30 password hashing algorithms, and a framework for managing existing password hashes.

Now let us look at the steps involved in hashing passwords in Python. 

Step 1: Install and import
We install Passlib first by typing pip3 install passlib in the terminal.  

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sc765lpd13ob2mwn9wdu.png)

After this, we import a hashing algorithm by typing the code as shown below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nbbv9c6yz8ywrsppdf2q.png)

Step 2: Syntax 
In this stage, we generate a new hash from the string and verify the password as shown below.  

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipj56821jgdbx8uylfer.png)

  
Now let us look at how this can be done in an example. First, the user would need to create an account. We would then ask the user for their email and password. After this, we hash the password and store it (maybe in a database). 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3m56hinyzk1kt1wt3b4z.png)
 

When the user needs to access the account later, we hash what we stored against the hash of the entered password. Upon successful verification, the user can access the account.  

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0385pvha8e0r8bgcx4lm.png)


Now you have successfully hashed and verified a password in Python. 
However, there are other algorithms one can use in addition to the one we have shared above. You can see them below. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x25pvqbq4xpmpz37szo1.png)


This article has been written by Suchin Ravi. Suchin is an experienced educator and technologist. Suchin teaches computer science at YoungWonks https://www.youngwonks.com and works as a lead software developer on many projects at Wonksknow https://www.wonksknow.com/.
Instant test feedback with vscode
Tags: productivity, vscode, ruby, rspec
Published: 2021-05-19 06:54:01

Long story short — I'm trying to switch from vim to vscode. 

I like TDD and run single or all specs lots of times. That way one of the things I love in vim — [instant test feedback with vim-test](https://dev.to/vasily/instant-test-feedback-7j5).

Switching to vscode I discovered how to implement that using user tasks. 

So, open `Tasks: Open User Tasks` with the command palette and paste your test tasks. I use these ones:
```json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Test current file",
      "type": "shell",
      "command": "bundle exec rspec ${relativeFile}",
      "group": "test",
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true
      }
    },
    {
      "label": "Test current line",
      "type": "shell",
      "command": "bundle exec rspec ${relativeFile}:${lineNumber}",
      "group": "test",
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true
      }
    }
  ]
}
```

Also for quick running, I set up hotkeys with vim extension:
```json
  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["<leader>", "t"],
      "commands": [
        {
          "command": "workbench.action.tasks.runTask",
          "args": "Test current file"
        }
      ]
    },
    {
      "before": ["<leader>", "s"],
      "commands": [
        {
          "command": "workbench.action.tasks.runTask",
          "args": "Test current line"
        }
      ]
    }
  ],
```

And that's it!
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3zi5506wszin106pq4g.gif)
6 Ways I Get Things Done Fast As A Bootstrapped Founder
Published: 2021-05-19 06:40:36

Here is the productivity stack I use to get many things done first in my startup Proxies API

1. One of the ways to lose momentum is to forget your original strategy. So you need to load this up into your brain the moment you wake up, so you are not swayed by every blog post, podcast episode, and new growth hack and lose the moment that you have accumulated so painfully.

Remind yourself of the original strategy every day (Refer to the article 40.a)

2. I need to make myself smile every day. And I count them. I need to make sure I have these moments where I am happy with my work in total to about 300 till I can say that I have done an excellent job.

What’s your north star metric? (Refer to the article 40.b)

3. If something takes less than 2 minutes, do it.

The two productivity tip that changed my life (Refer to the article 40.c)

4. If you find yourself exhausted and find yourself cribbing, sulking, you need a break. You are taking access to work for granted. Make it scarce. Just stop working cold turkey. Go away from your computer and enjoy yourself till you feel the guilt. I love guilt. I need the pull of sin to come back to work. Sin is productivity if you do it right.

5. If you are overwhelmed, it probably because you are keeping too many things in your mind. Your brain cannot slow down because it is always going round and round all the things you need to do. It’s time for the brain dump.

The magic of the brain dump (Refer to the article 40.d)

6. If you have lost momentum, let us say after a long break, illness, or a holiday, it is normal for us to fail to pick up the energy we used to have. The more we push ourselves, the more we feel we are rooted to the floor with concrete. So we freeze and do nothing at all. In that case, stop and reduce the expectation to more or less zero. Now tell yourself that you will do the smallest action you can take to get going. This action almost as a rule has to be dumb and make you feel silly. But try it, it works for me. If you have to write a blog post like this one, the action could be to write the headline. Wait even that is too intelligent. The move could be, open the editor and create a new page. That’s it. Now build from there.

The author is the founder of Proxies API, a proxy rotation API service.
5 Ways to Promote Your YouTube Channel For More Views
Tags: design, youtube, tooling
Published: 2021-05-19 06:37:02

**1. Customize Your Thumbnails**

Creating custom thumbnails is one of the simplest yet most effective ways to promote your YouTube channel.

Consider your title and thumbnail as a one-two punch to outrage a viewer's interest.

YouTube automatically grabs a screenshot from any given video and uses it as the thumbnail. Unfortunately, the image it captures is occasionally a hazy photograph of you adjusting the camera or a transition.

Making your own thumbnails by using <a href="https://photoadking.com/design/youtube-thumbnail/" rel="nofollow noreferrer"> thumbnail maker</a> not only makes your movies look more appealing at a glance, but it also conveys a sense of professionalism. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnz2p6zdpmoded5j5l80.jpg)

**2. Run a Contest or Giveaway**

A giveaway is something that YouTube subscribers love. Create a YouTube contest or giveaway to encourage people to subscribe to and interact with your channel.

To join your contests, ask people to like your video, make a comment, and subscribe to your channel.

**3. Create Playlists to Organize Your YouTube Content**

The more videos you make, the more difficult it is for visitors to find their way around your channel.

That is why playlists are so valuable. Playlists not only help you to manage your channel by categorizing your videos, but they also appeal to your viewers' need to binge.

Beardbrand's grooming channel, for example, updates every day and so contains hundreds of videos covering a wide range of themes. The playlists on the channel allow subscribers to find relevant information without having to search for it.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r92vdfxrbywl3k78blp4.png)

**4. Give Live Streaming a Try**

Live video is one of the most popular social media fads, and it isn't going away anytime soon.

With apps like Facebook, Periscope, and Instagram making live video streaming easier than ever, more and more brands are jumping on board.

YouTube has been giving live videos for years, but it has only just begun to gain traction. You can get a sense of how other firms are using the platform by watching some popular YouTube Live videos.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqmtow8inyi3u1olekk3.png)

**5. Collaborate With Other Creators and Brands**

Collaborating with other users is a strategy employed by some of YouTube's top performers to expand their audience. Each cooperation exposes you to a new audience. And the greatest part is that because you're working with a content creator they already know, like, and trust, those new viewers are more inclined to subscribe to your channel.
Ionic tab bar circle middle button
Tags: ionic, ios, android
Published: 2021-05-19 06:32:58

Today I'll be showing you how to make a circle middle button inside a tab bar.

It's a way to make a button stand out more from the tab bar, and it can be your center of attention inside your app.

![Ionic tab bar circle middle button](https://cdn.hashnode.com/res/hashnode/image/upload/v1621167888069/uE8pRg5vI.png)

## Circle middle tab bar button

We won't be making everything from scratch, so if you plan to work with me on this article, download the [Ionic tab bar starter](https://daily-dev-tips.com/posts/creating-segment-tabs-in-ionic/) from [GitHub](https://github.com/rebelchris/ionic-app/tree/segments).

From there, open up the project in your editor of choice.
If we then run the application, we will get a basic tab bar, and we will focus on changing this tab bar.

![Ionic basic tabbar](https://cdn.hashnode.com/res/hashnode/image/upload/v1621167346918/16BpF6X3o.png)

Open up the `tabs/tabs.page.html` file.

For our example, we will make five buttons in our tab bar. The middle one will be outstanding.

Let's start by adding the five buttons and make the middle one an empty one.

```html
<ion-tabs>
  <ion-tab-bar slot="bottom">
    <ion-tab-button tab="tab1">
      <ion-icon name="triangle"></ion-icon>
      <ion-label>Tab 1</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="tab2">
      <ion-icon name="ellipse"></ion-icon>
      <ion-label>Tab 2</ion-label>
    </ion-tab-button>

    <ion-tab-button></ion-tab-button>

    <ion-tab-button tab="tab3">
      <ion-icon name="square"></ion-icon>
      <ion-label>Tab 4</ion-label>
    </ion-tab-button>

    <ion-tab-button tab="tab3">
      <ion-icon name="egg"></ion-icon>
      <ion-label>Tab 5</ion-label>
    </ion-tab-button>
  </ion-tab-bar>
</ion-tabs>
```

This will result in the following:

![Ionic 5 tabs](https://cdn.hashnode.com/res/hashnode/image/upload/v1621167568524/TM72TjTOj.png)

You might think, cool, but we are missing that bottom one!
And you're right, so what we'll do is add a FAB button for that.

It will take place outside of our tabs and look like this.

```html
<ion-fab vertical="bottom" horizontal="center" slot="fixed">
  <ion-fab-button>
    <ion-icon name="leaf"></ion-icon>
  </ion-fab-button>
</ion-fab>
```

And this will give us the following:

![Middle fab button tab bar Ionic](https://cdn.hashnode.com/res/hashnode/image/upload/v1621167818482/9RHxSaLDVq.png)

Cool and simple right?
You can find today's code on [GitHub](https://github.com/rebelchris/ionic-app/tree/circle-middle-button) as well!

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
What I think as True Artificial Intelligence
Tags: ai, machinelearning
Published: 2021-05-19 06:09:52

---
title: What I think as True Artificial Intelligence
published: true
description: Currently AI seems to lack true intelligence, so this article deals with true intelligence of AI
tags:  ai, artificialintelligence, machinelearning 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/teg5queja3ws4ylv2ucs.jpeg
---

When we talk about Artificial Intelligence now a days, for me - it seems pretty dumb intelligence. True intelligence will have the power of inference. For example, from a given training dataset presently the AI may detect a tree (see image below):

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/teg5queja3ws4ylv2ucs.jpeg)

However, it can infer from it's knowledge-base the tree can have more branches (this is knowledge, not trained data), can be without leaves and it can also relate to fruits and the fact that fruit grows on trees. Hence it would be possible for the AI to detect in future - a tree without leaves and only branches, or without branches and only leaves, given no prior training data, but simply from the power of inference. This for me is intelligence.
Python Tips & Tricks: Estimación OLS
Published: 2021-05-19 05:57:03

### Aprende Python

<p>
¿Sabes cómo estimar un modelo OLS con Python? Hoy les traemos cómo hacerlo en unas líneas de código 😎.
<br><br>
Revisa el código completo aquí:
<br>
👉🌐 <a href="https://go.datahacks.ai/repositorio">https://go.datahacks.ai/repositorio</a>
<br><br>
Tenemos un supercurso de Python con un enfoque en Data y Analytics:
<br>
👉🌐 <a href="https://go.datahacks.ai/crece">https://go.datahacks.ai/crece</a>
<br><br>
Únete al #DataHackChallenge: 
<br>
👉🌐 <a href="https://go.datahacks.ai/challenge">https://go.datahacks.ai/challenge</a>
</p>

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fg7nywv43wrrabruqfbt.png" alt="ptt"></img>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqsn29puncwup8ew12l8.png" alt="ptt"></img>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/707j3ojwxtxi9slpwgfh.png" alt="ptt"></img>

Aprende, Aplica y Crece en áreas de Data, Analytics y Cloud.
Bootstrap 5 Responsive Sidebars With JavaScript
Tags: css, bootstrap, html, webdev
Published: 2021-05-19 05:29:04

Sidebar or side navbar is mostly used in web application side in a vertical view with important link/menu. So here we made Responsive Sidebars in Bootstrap 5 With JavaScript.

In this element, we used bootstrap 5 Navs and tabs components in a vertical menu. Also, we used bootstrap grids and utilities class with javascript to make dynamic clickable. Here we modify some bootstrap class and also used own custom class for background-colors. This is fully responsive Sidebars for mobile and tablet views.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source Code](https://w3hubs.com/bootstrap-5-responsive-sidebars-with-javascript/)
How to build Consensus Algorithm for Blockchain Network in Javascript
Tags: consensus, blockchain, javascript, algorithms
Published: 2021-05-19 05:20:37

https://grokonez.com/node-js/how-to-build-consensus-algorithm-blockchain-network-javascript-tutorial

How to build Consensus Algorithm for Blockchain Network in Javascript

During broadcasting Transactions over our Blockchain network, a certain node may not receive a piece of information, or even there is a bad actor who sent out false information or created fraudulent transactions and broadcasts them to the whole network, convinces everybody that they are legitimate transactions. So, the Consensus Algorithm provides us a way to compare one Node to all the other Nodes inside of the network to confirm that it has the correct data. In this tutorial, we're gonna create a Consensus Algorithm that implements the Longest Chain rule.

Previous Post: <a href="https://grokonez.com/frontend/javascript/how-to-synchronize-blockchain-network-javascript-tutorial">How to Synchronize Blockchain Network in JavaScript</a>

Next Post: <a href="https://grokonez.com/frontend/javascript/how-to-explore-data-blockchain-network-javascript-tutorial">How to explore Data inside of Blockchain Network in Javascript</a>

<!--more-->
<h2>Consensus Algorithm</h2>
<h3>Longest Chain rule</h3>
This rule simply compares the chain of the chosen Node with all the other chains inside of our Blockchain network.
If one of the other chains has longer length than the current chain, we simply replace the chain of the Node we are on with the longest chain in the network.

Why we use Longest Chain rule?
>> The longest chain has the most Blocks in it and each of those Blocks was mined by using Proof of Work. We can assume that the whole network contributed to the longest chain because of how much work went into that chain.
<h3>Implement Longest Chain rule</h3>
<h4>Validate chain</h4>
This method validates a Blockchain by comparing all of the hashes of all of the Blocks inside of the chain.
<pre><code class="language-javascript">
class Blockchain {
    ...
    isChainValid(blockchain) {
        // 1- validate Genesis Block

        // 2- forEach block in chain
        // 2.1 validate block Hash
        // 2.2 compare Hash with previous block Hash
    }
}</code></pre>
<h4>Consensus Endpoint</h4>
We add an endpoint GET <code>/consensus</code> to our API. It will:
- make a request to every Node inside of our Blockchain network to get their copies of the Blockchain
- find the longest chain by comparing current chain with these chains
- use <code>isChainValid()</code> function to check if the longest chain found in previous step is valid
- if all things are validated, assign chain & transactions from the longest chain to this Blockchain

More at:

https://grokonez.com/node-js/how-to-build-consensus-algorithm-blockchain-network-javascript-tutorial

How to build Consensus Algorithm for Blockchain Network in Javascript
How to explore Data inside of Blockchain Network in Javascript
Tags: blockchain, javascript, network
Published: 2021-05-19 05:14:24

https://grokonez.com/node-js/how-to-explore-data-blockchain-network-javascript-tutorial

How to explore Data inside of Blockchain Network in Javascript

In this tutorial, we're gonna build API that allows us to explore the data inside of our Blockchain Network. We will have ability to search the entire Blockchain for a specific Block by Hash, for a specific Transaction by Id. We can also fetch data from our Blockchain Network for a specific User/Address.

Previous Post: <a href="https://grokonez.com/frontend/javascript/how-to-build-consensus-algorithm-blockchain-network-javascript-tutorial">How to build Consensus Algorithm for Blockchain Network in Javascript</a>

<!--more-->
<h2>Explore Data Endpoints</h2>
We will make 3 endpoints:

- GET <code>/block/:hash</code>: shows a specific Block by <code>:hash</code>.
- GET <code>/transaction/:id</code>: shows a specific Transaction by Transaction's <code>:id</code>.
- GET <code>/address/:address</code>: shows all Transactions that an <code>:address</code> is related to (address/user is a sender or a recipient).

These endpoints use 3 <code>Blockchain</code> class finder methods:
<pre><code class="language-javascript">
class Blockchain {

    findBlockByHash(hash) { ... }
    findTransactionById(id) { ... }
    findTransactionsByAddress(address) { ... }
}</code></pre>
<h2>Practice</h2>
<h3>Implement Blockchain class Finder Methods</h3>
Inside <strong>blockchain.js</strong> file, add 3 methods to <code>Blockchain</code> class:
<h4>Find specific Block by Hash</h4>
<pre><code class="language-javascript">
class Blockchain {
    ...
    findBlockByHash(hash) {
        let result = null;

        this.chain.forEach(block => {
            if (block.hash === hash) {
                result = block;
            }
        });

        return result;
    }
}</code></pre>
<h4>Find specific Transaction by Transaction's Id</h4>

More at:

https://grokonez.com/node-js/how-to-explore-data-blockchain-network-javascript-tutorial

How to explore Data inside of Blockchain Network in Javascript
SAP Training 
Tags: saptraining
Published: 2021-05-19 05:05:18

SAP Training in Chennai by MNC Expert. TIC Academy is the best SAP Training Institute in Chennai.

We have been into SAP Training for more than a decade. In our training program we cover basic to advanced level topics in SAP.

All the modules are covered completely hands on practical based training
http://www.traininginchennai.co.in/sap-training-in-chennai/
Contributing using the Github website
Tags: github, introduction
Published: 2021-05-19 04:54:30

In this post , I will show you how to contribute to repositories on Github using the Github Website . 

I’ve received the permission of Mashiya to use his [repository](https://github.com/mashiyathussain2/Fork_CPP) for this post . 

### 1) Finding a repository 

Find a repository that you would like to contribute to using the Github Search bar . Now after opening the repository , you should see the given photo .


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbo71l2k13bgsf2mdprx.png)

### 2) Fork the repository 

On top right of the screen , you would see a fork button , click on that to fork your repository and then your webpage should look like this.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlo6z79cs2u9bz664j57.png)

### 3) Adding a File 


After forking the repository , you can add a file to your repository by clicking on “Add File” and then click on “Create new file” or “Upload file” . I’ve clicked on the former and the webpage should look like this . I’ve created a simple Hello World Program .

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rugn4l04ej30grscks6v.png)

After typing your program scroll to the bottom of the screen to commit the change to your repository either on the main branch or to create a new branch for your commit . You can add a title and description to your commit if you want to . 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5dad91y5o7fdl265s30.png)

Now move to the main repository page . 


### 4) Creating a Pull Request for your changes 

If you add commits to any branch other than the main branch , you should see a similar tab on the webpage . 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cv0vyk9cl7rjzubm4ki6.png)

If you do not see the given tab , on the tab of the repository click on Pull Request and then you should see this . Change your branch to the branch where you  added the files .  

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fuhisv3jejwebj0ox8x3.png)

Add a title and a description for your Pull Request and then click “Create Pull Request”. 

You have now successfully contributed to a repository.

Hope this post helps you out and if you feel that I’ve missed anything or could’ve done something better feel free to let me know . I will soon do a post for contributing using Git .