teleren/devto huggingface dataset:
Hashing Password combining with Salt in C# and VB.NET
Tags: csharp, dotnet, password, security
Published: 2021-02-22 14:47:08

In this post, I show you how to protect password using hash-salt mechanism.

Hashing password using salt is one of the best practices in protecting user accounts from hackers and who you don't want anyone to see plain-text passwords in databases or text files. This is really great. In case hackers have stolen databases, they also need more time to decryte them. It won't be easy at all. At the same time, you have time to reset all passwords or suggest users to change passwords right away.

My background is .NET developer. That's why I have written two simple functions in C# and VB.NET as below.

C#
```csharp
public class SecurityHelper
{
    public static string GenerateSalt(int nSalt)
    {
        var saltBytes = new byte[nSalt];

        using (var provider = new RNGCryptoServiceProvider())
        {
            provider.GetNonZeroBytes(saltBytes);
        }

        return Convert.ToBase64String(saltBytes);
    }

    public static string HashPassword(string password, string salt, int nIterations, int nHash)
    {
        var saltBytes = Convert.FromBase64String(salt);

        using (var rfc2898DeriveBytes = new Rfc2898DeriveBytes(password, saltBytes, nIterations))
        {
            return Convert.ToBase64String(rfc2898DeriveBytes.GetBytes(nHash));
        }
    }
}
```
VB.NET
```vb
Public Class SecurityHelper
    Public Shared Function GenerateSalt(ByVal nSalt As Integer) As String
        Dim saltBytes = New Byte(nSalt) {}

        Using provider = New RNGCryptoServiceProvider()
            provider.GetNonZeroBytes(saltBytes)
        End Using

        Return Convert.ToBase64String(saltBytes)
    End Function

    Public Shared Function HashPassword(ByVal password As String, ByVal salt As String, ByVal nIterations As Integer, ByVal nHash As Integer) As String
        Dim saltBytes = Convert.FromBase64String(salt)

        Using rfc2898DeriveBytes = New Rfc2898DeriveBytes(password, saltBytes, nIterations)
            Return Convert.ToBase64String(rfc2898DeriveBytes.GetBytes(nHash))
        End Using
    End Function
End Class
```

For example:
```csharp
string pwd = "123Abc#@";
string salt = SecurityHelper.GenerateSalt(70);
string pwdHashed = SecurityHelper.HashPassword(pwd, salt, 10101, 70);
Console.WriteLine(pwdHashed);
Console.WriteLine(salt);
```

Hope you enjoy this post.

Happy coding :)
GitHub Actions for FFmpeg
Published: 2021-02-22 14:42:49

I wanted to use FFmpeg to create gif files to attach to GitHub, but I didn't want to install FFmpeg on my local machine. So I made it possible to run FFmpeg on GitHub Actions.

#### GitHub
https://github.com/katsuhisa91/just-ffmpeg-actions

## How to use
### 1. clone this repository & put your movie file in `origin` folder

### 2. update env about video file names

CAUTION: Overwrite an exist video file if same `AFTER_PROCESSING_FILE` name is exists.

```yaml
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      BEFORE_PROCESSING_FILE: shortcut-to-github1s.mov
      AFTER_PROCESSING_FILE: shortcut-to-github1s.gif
```

### 3. update FFmpeg options if you need

```yaml
      - name: Execute ffmpeg
        run: ffmpeg -y -i origin/${{ env.BEFORE_PROCESSING_FILE }} -vf scale=800:-1 -r 10 processed/${{ env.AFTER_PROCESSING_FILE }}
```

By the way, the default option is optimized for converting to gifs from .mov extensions.

### 4. commit & push

### 5. GitHub Actions bot commit a processed video file into `processed` folder
How I can load balance Postgresql read connections?
Tags: help, postgres, loadbalance
Published: 2021-02-22 14:27:42

As I asked upon https://dba.stackexchange.com/q/285811/118215

I am looking for an reverse-proxy implementation in order to load balance any read postgresql connection. I want during load balance to retrieve information regarding CPU usage and use the least used Database.

Can you suggest me an already implemented load-balancer for postgresql?
JavaScript Bubble Sort
Tags: beginners, algorithms, javascript, codenewbie
Published: 2021-02-22 14:26:15

Sorting is the process of arranging a sequence of objects in a particular order. You can sort any entities that can be compared.

Imagine an online store. You enter your query into the search bar and you get a list of results. To find the cheapest item, you need to sort the list in ascending order of price.

If you're looking at your spending with a credit card and want to start with the largest, you need sorting too.

Under the hood of many computer programs, sorting is used to increase the efficiency of other algorithms, such as search.

## Bubble Sort

One of the simplest sorting algorithms is bubble sort. In it, all objects are treated like air bubbles that float up to the surface of the water.

We compare adjacent elements of the array and swap them if the current element is greater than the next one.

When we reach the end of the array, the very last element is guaranteed to be in place. The biggest bubble has floated all the way up.

We repeat the whole process one more time, but this time up to the penultimate element.

After the second iteration, the last 2 elements will be in their positions. We will repeat the algorithm until we have only one element left in the array.

```js
const bubbleSort = (arr) => {
  for (let i = 0; i < arr.length; i++) {
    for (let j = 0; j < arr.length - i; j++) {
      if (arr[j] > arr[j + 1]) {
        let tmp = arr[j];
        arr[j] = arr[j + 1];
        arr[j + 1] = tmp;
      }
    }
  }
  return arr;
}
```

For testing purposes, let's create an array and call it `testData`. We print this array to the screen in the initial state, then sort it and eventually call `console.log` once more to verify the result.

```javascript
const testData = [0, -1, 4, 5, 2, -3];

console.log(testData);  // [ 0, -1, 4, 5, 2, -3 ]
bubbleSort(testData);   // we call the sort function here
console.log(testData);  // [ -3, -1, 0, 2, 4, 5 ]
```

Bubble sort can be optimized in a number of different ways. For example, if there were no exchanges, then the array is already sorted and we can stop the execution.

Another alternative is [Cocktail Sort](https://learn.coderslang.com/0037-javascript-optimized-bubble-sort.-coctail-sort/), which first pushes up the biggest element and then moves down the smallest one.

[Learn Full Stack JavaScript](https://js.coderslang.com)
Kraft Paper Samadhan ERP - A Proven Solution For Your Business
Published: 2021-02-22 14:24:40

<div id="post-body-1825589100377417040" class="post-body entry-content float-container">
<p style="text-align: justify;">Procurement of the raw material (waste paper) needs a special management in these units. Myriad source (including imports) are there and a large range of qualities. A fool proof system is required not only to manage the contracts but also to keep a close watch on what is delivered to claim the monetary impact of any deviation. A well managed system will deliver huge financial dividends.</p>
<p style="text-align: justify;"><br />The customers at the other end need material of varying BF, GSM, Shades and different tonnages in different deckle (reel width) sizes. Marrying the production plan to meet the exact requirement of customer and yet minimize the trim-wastage and obliterate the cutting of odd deckle size is another challenge the industry faces.</p>
<p style="text-align: justify;">A typical unit runs many systems to manage the affairs of the unit and that includes an accounting system and a lot of manual work done through spreadsheets. These sub-systems do not talk to each other and makes getting exact information for decision making a herculean task. Failed deliveries, low customer satisfaction, wasted claim opportunities and paper wastage (trim and odd size deckles) is a huge drain on bottom line.</p>
<p style="text-align: justify;"><strong><a href="https://www.samadhanindia.com/kraft-paper-manufacturing-software.html" target="_blank" data-cke-saved-href="https://www.samadhanindia.com/kraft-paper-manufacturing-software.html">Erp Software For Paper Industry</a></strong>&nbsp;By Samadhan ERP - A proven solution for your business</p>
<p style="text-align: justify;">Integrated information in a robust international platform is a crying need.</p>
<p style="text-align: justify;"><strong>Solution</strong></p>
<p style="text-align: justify;">A specialized integrated software solution created for kraft paper manufacturers, on a world class business suite, Microsoft Dynamics NAV addresses the unique needs of a typical company. It gives full control on the operations from the time they get an enquiry to getting a satisfied and happy customer.</p>
<p style="text-align: justify;"><br />While the software is used for the day to day working, Microsoft Dynamics NAV as a reliable and integrated framework manages the inventory, purchase, sales, customer relationships, finance &amp; account and production. The natural integration of the solution with Microsoft Office which includes Microsoft Excel and Microsoft Outlook (the communication interface) helps the organization in leveraging the information in the integrated solution in multiple ways.<br /><br /></p>
<p style="text-align: justify;"><a href="http://samadhanindia.com/contact_us/" target="_blank" data-cke-saved-href="http://samadhanindia.com/contact_us/"><em><strong>Connect now for free consultation</strong></em></a><br /><br /></p>
<p style="text-align: justify;">#Erp_Software_For_Paper_Industry</p>
</div>
Part 1: Introduction to Cloud Computing with AWS 
Tags: beginners, aws, webdev, tutorial
Published: 2021-02-22 14:23:22

Cloud computing is an ocean and finding the right learning resources in a single place is a challenge. 

I'm creating a series of Human understandable short articles on AWS from my own learnings over the years. - Cloud Fundamentals with AWS.

I hope this saves you time and helps you get from beginner to expert on AWS.

Here is [Part 1: Introduction to Cloud Computing](https://medium.com/katte-io/introduction-to-cloud-computing-128b07e15e5?source=friends_link&sk=6f726de8f58f8c31bc233020997ddefd) 

Next posts on Cloud servers and Storage coming soon.
Using CSS keyframes with images to create unique website header
Tags: wordpress, css
Published: 2021-02-22 14:14:40

I recently launched a rebuild of [1800 Printing](https://1800printing.com), one of the big printing stores in New York.

For the homepage hero section, our team made a design where the business cards and print materials load first, then the designs fade in later to show how the cards look before and after printing. 

The effect looks cool, but is in fact, very very simple. It's just 2 images, with the second one containing the design on the cards, fading in over the top using some quick CSS tricks.

Stack 2 identical sized images on top of each other using position: absolute; 

Then the second img (#img2) we've used this CSS keyframe sequence, to fade in and out:


```
#img2 {
  animation-name: fade;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  animation-duration: 16s;
  animation-direction: normal;
}

@keyframes fade {
  0% {opacity: 0; }
  15% {opacity: 0; }
  28% {	opacity: 0;	}
  40% {	opacity: 1;	}
  65% {	opacity: 1;	}
  73% {	opacity: 0;	}
  100% {opacity: 0;	}
}
```

That's it!

See it in action:
[Large Format Printing](https://1800printing.com/c/large-format/)
[Poster Printing](https://1800printing.com/p/wheatpaste-posters-wild-posting/)
[Menu Printing](https://1800printing.com/menu-printing/)
[Online Printing Services](https://1800printing.com/)
How to save Google search images with a single command
Tags: python, ubuntu, linux
Published: 2021-02-22 13:58:28

Around August 2020, the method of providing results in Google search seems to have changed significantly, and the Windows software **"ImageSpider"** can no longer be used. (It was quite convenient, though ...)
So from now on, I decided to use the Python library "google_images_download".

# Installation
> [Caution] Do not install with pip!
The version in PIP does not support changes on the Google side, so it cannot be used even if it is installed.
So install it directly.

```
git clone https://github.com/Joeclinton1/google-images-download.git
cd google-images-download && sudo python setup.py install
```

This completes the installation.

# How to use
Here, as a typical usage, the usage method on the command line is listed.

```
googleimagesdownload --keywords "apple" --limit 20
```

In the above example, 20 search results for "apple" will be saved in the current directory.

Please see [official document](https://google-images-download.readthedocs.io/en/latest/examples.html) for how to use it on Python and other condition settings.

# When acquiring 100 or more
If you want to get more than 100 images, you need to install chrome driver.
* This is the operation method for Ubuntu 20.04 LTS. For Windows, please check by yourself m (_ _) m

**First check the latest version of the driver**
Please go to the following site and copy the latest version of "chromedriver_linux64.zip" URl.
* [https://sites.google.com/a/chromium.org/chromedriver/downloads](https://sites.google.com/a/chromium.org/chromedriver/downloads)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uuwuc9plti94u3xhhu2h.png)
By the way, as of January 6, 2021, it was https://chromedriver.storage.googleapis.com/88.0.4324.27/chromedriver_linux64.zip.

**Then enter the following command in succession.** (I referred to this article.)

```
sudo apt install unzip
cd /tmp/
curl -O <<<<<Enter the URL you just confirmed here>>>>>
unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin/
rm chromedriver_linux64.zip
```

This completes the installation.

**Command to get 100 or more**

```
googleimagesdownload --keywords "apple" --limit 120 --chromedriver /usr/local/bin/chromedriver
```

Just select the installation destination with the --chromedriver option for the one I introduced earlier.

↓ Acquisition result
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/90o6iwqu01sy6py9hlib.png)

You have obtained it properly.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sex5src2j00nk5wz4w9t.png)

I've written a lot, so please take a look at [my blog](https://0115765.com).
Top Manual Testing Interview Questions to Looking Before Start Your Career
Published: 2021-02-22 13:57:09

In this digital world, Software Manual Testing is the crucial and most important part of product development. During development process Manual Testing play’s an important role where you cannot implement automation testing.

As a part of leading <a href="https://www.testrigtechnologies.com/hire-manual-tester/">Manual Testing Company in USA,</a>Today I would to list out the most frequently asked Interview Questions that interviewer asked during Software Testing. My list covered top basic interview questions to help you clear the manual testing job interview easily.

If you want to take next step in your Software Testing career then try to prepare with below questions or if you have anything to add just let me know in the comment session

<b>Manual Testing Interview Questions [General Question]</b>

1-What is Software Testing in your words?
2-When should you start Manual Testing or When should you start Automation Testing?
3-What is Quality?
4-What is white box testing?
5-What is the difference between static and dynamic testing?
6-What is Test Plan
7-What is different between Test Cases and Test Scenarios 
8-What is Bugs?
9-Top 5 Automation Testing tools? Why
10-Explain the difference between alpha testing and beta testing.
11-Explain the process of Manual Testing
12-What is Quality Control
13-Why Manual Testing is needed?
14-Explain the types of manual Testing
15-What is Difference quality control differ from quality assurance?
MongoDB Cheat Sheet Part 1: Basics
Tags: mongodb, cheatsheet, tutorial
Published: 2021-02-22 13:44:53

###Start MongoDB

```mongodb
sudo systemctl start mongod
```

###Stop MongoDB

```mongodb
sudo systemctl stop mongod
```

###Restart MongoDB
```mongodb
sudo systemctl restart mongod
```

###MongoDB Status
```mongodb
sudo systemctl status mongod
```

###Enter Mongo Shell

```mongodb
mongo
```

###Connect to remote host

```mongodb
mongo --host <hostname or ip address> --port <port>
```
Example:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77s99zpbwsfe6lxxprnl.png)

###Connect to a specific database

```mongodb
mongo <host>/<database>
```

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

###Log Into MongoDB

```mongodb
mongo -u <username> -p <password> --authenticationDatabase <dbname>
```

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

###Create, select or switch database

```mongodb
use <database name>
```

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

###Show current database

```mongodb
db
```
###Show all databases

```mongodb
show dbs
```

###Show all users on current database

```mongodb
show users
```

###Show all roles on current database

```mongodb
show roles
```
###Further Reading
* [Install MongoDB](https://docs.mongodb.com/manual/installation/)
* [MongoDB Node Driver](https://docs.mongodb.com/drivers/node/)
* [Performance Best Practices](https://www.mongodb.com/blog/post/performance-best-practices-mongodb-data-modeling-and-memory-sizing)
* [MongoDB Schema Design Best Practices](https://developer.mongodb.com/article/mongodb-schema-design-best-practices/)
* [Mongoose](https://mongoosejs.com/docs/)
I Built and Published an iPhone App
Tags: ios, showdev, swift
Published: 2021-02-22 13:37:55

---
title: I Built and Published an iPhone App
published: true
tags: [ ios, showdev, swift ]
description: What it's like to develop and publish an iOS app.
canonical_url: https://thomasstep.com/blog/i-built-and-published-an-iphone-app
---
Well, this is fun. A few months ago I got an idea for an app and a few days ago I [launched it on the App Store](https://apps.apple.com/us/app/pomodoro-noise/id1548584359). There are two productivity tools that I use to help me stay focused, which are the Pomodoro technique and brown noise. The [pomodoro technique](https://francescocirillo.com/pages/pomodoro-technique) is a way to view work as cycles of focus and taking a break, and brown noise is a more soothing version of white noise that blocks out other noise and helps me focus. Either one works well on its own, but I had never once seen anything about combining the two, which is what I wanted to do. Around the same time, I read a post on Indie Hackers about someone who built and released an app on the App Store. I wish I still had a link to the post, but he basically said that he built a small app, launched it, and came back a few months later to realize that he had some users that ended up appreciating his work. I was inspired by his post, so I started building a mash-up of my two favorite productivity tools. I had never written an app much less used Swift or Objective-C before. After a few late nights and a few months, I finally came up with a product. Along the way, I had some friends and family buy into my idea and support it. I gave them early access and tweaked the app according to their feedback. Soon enough I had approval. I went down the path of launching it on the Apple App Store so others could use it too. I filled out some paperwork, wrote some copy for my app's page, and polished up my submission. When I submitted for review, I crossed my fingers and waited to hear back from Apple. Only a few hours later, and I had their approval. I am proud to say that I have developed and launched an app! I welcome everyone to try it out. It is called Pomodoro Noise and is currently available for the iPhone and iPad. I have plans to also release a similar app on Google Play shortly.

![Screenshot of Pomodoro Noise in the Apple App Store](https://thomasstep.dev/assets/img/pomodoro-noise-in-app-store.png)

I learned a lot about what it takes to put an app up on the App Store. There are guidelines, paperwork, and a quality review before an app is accepted by Apple. There were some hoops I had to jump through, but ultimately, I am proud of myself and my work for being accepted by a company known in our industry for high engineering standards. Another fun takeaway from building the app was learning Swift. While I didn't get too deep into the ecosystem, it was fun to experiment and learn a few nuances of a new language and system. I am sure that this won't be the end of my app developing career, and I am glad that I had such a positive experience the first time around.
Introduction to Vue Watchers
Tags: javascript, vue, beginners, webdev
Published: 2021-02-22 13:36:47


In this article, we will be discussing watchers, one of the core concepts in Vue.js.

Watchers, just as the name implies are used to watch out for changes in a property previously defined in the data object. It is triggered whenever the value of that property changes.

Let's create a watcher for an "answer" property below. The watcher must have the same name as the property being observed.

```js
export default {
  data() {
    return {
      answer: ''
    }
  },
  watch: {
    answer: function() {
      console.log(this.answer)
    }
  },
}
```
The Watcher above will log the "answer" property to the console anytime its value changes.

We can also access the old property value and new property value in a Watcher by adding two optional parameters as shown below.

```js
export default {
  data() {
    return {
      answer: ''
    }
  },
  watch: {
    answer: function(oldAnswer, newAnswer) {
      console.log(`The answer has been changed from ${oldAnswer} to ${newAnswer}`)
    }
  },

}
```

If we want to monitor the changes of items within an array or the properties of an object we use "deep". Let's watch out for changes in the "person" Object below.

```js
export default {
  data() {
    return {
      person: {
          name: 'Linda',
          gender: 'Female',
          signedIn: false
      }
    }
  },
  watch: {
    person: {
      deep: true, // Vue now watches for changes within the person Object
      handler() {
        if (this.person.isSignedIn) this.records++
      }
    }
  },

}
```
As a practical example, I have created a simple "App" where we use a Watcher to monitor the number of times a user has signed.

{% codepen https://codepen.io/LindaOjo/pen/qBqPZYm %}


That's all folks, See you next week!
Low-code connectors
Tags: dronahq, integrations, api, connectors
Published: 2021-02-22 13:33:11

Hi everyone!

I have published an article about connectors/integrations on Medium.
[Read Here](https://ambar-04.medium.com/why-dronahq-low-code-connectors-7b77abf051c5)

Check it out and let me know what you think about it!