teleren/devto huggingface dataset:
How does a password manager work?
Tags: passwordmanager, password, masterpassword, cybersecurity
Published: 2019-09-03 07:52:38

For anybody wondering, how does a password manager work, [here is an explanation](https://nordpass.com/blog/how-does-password-manager-work/). This article answers all the basic questions, when it comes to password managers operating all your saved passwords. 
After reading this such terms as "master password" or "built-in managers" will no longer be a mystery to you.
Handling IP addresses using PostgreSQL
Tags: postgres
Published: 2019-09-03 07:52:22

PostgreSQL provides a `inet` and `cidr` datatypes for storing net addresses and proceed operations with them.

Host address and it's subnet can be stored with `inet`, while `cidr` can contain only network address:
```sql
select inet '192.168.0.1/24';
      inet
----------------
 192.168.0.1/24
```
```sql
select cidr '192.168.0.0/24'; -- valid cidr
      cidr
----------------
 192.168.0.0/24
```
```sql
select cidr '192.168.0.1/24'; -- invalid: cidr must not be a host address
ERROR:  invalid cidr value: "192.168.0.1/24"
LINE 1: select cidr '192.168.0.1/24';
                    ^
DETAIL:  Value has bits set to right of mask.
```
In case there's no number after slash in `cidr` address the netmask is to equal 32:
```sql
select cidr('127.0.0.1');
     cidr
--------------
 127.0.0.1/32
```
The value above represents a subnet address, while the same value passed to `inet` represents a host:
```sql
select inet('127.0.0.1');
   inet
-----------
 127.0.0.1
```
Checking inclusion or equality can be performed with `>>=` and `<<=` operators:
``` sql
select inet '192.168.0.1/24' >>= inet '192.168.0.0'; -- returns true
select cidr '192.168.0.0/24' >>= inet '192.168.0.0/12'; -- returns false
select cidr '192.168.0.0' >>= cidr '192.168.0.0'; -- returns true
```
And getting a netmask by a net address can be performed with `netmask`:
```sql
select netmask(inet('192.168.0.0/24')); -- returns 255.255.255.0
select netmask(cidr('127.0.0.1')); -- returns 255.255.255.255
```
Exercism - no evil spirits
Tags: todayilearned, languages
Published: 2019-09-03 07:40:06

I am really enjoying [Exercism](https://exercism.io/profiles/axtens). Thanks to @2lach for pointing at it. The link is to my profile on Exercism. As you can see, I've got a few languages on the stove at the moment, and they tell me that Tcl/Tk is coming soon!
Is it still safe for large production applications with a large user base to use bcrypt as the password hashing algorithm ?
Tags: discuss, security, encryption, explainlikeimfive
Published: 2019-09-03 06:43:44

---
title: Is it still safe for large production applications with a large user base to use bcrypt as the password hashing algorithm ?
published: true
description: 
tags: discussion, security, encryption, explainlikeiamfive
---

I have been doing backend dev for 3 years now, i read couple of articles recently which says argon2 is much more safer than bcrypt everyone should switch to it.

Is it still safe for large production applications with a large user base to use bcrypt as the password hashing algorithm or should it switch ?
The list::swap() function
Tags: cpp
Published: 2019-09-03 06:05:18

---
title: The list::swap() function
published: true
description: When and how the swap function in c++ is being used
tags: c, cpp
---
The list swap function is used in c++ to swap the values of two lists with the same size and type.
```c
std::list<int> a{1, 2, 3, 4, 5};
std::list<int> b{6, 7, 8, 9, 10};
a.swap(b);
//from here the content of a is in b and vice-versa
```
Upgrade from OpenCart 1.5 to OpenCart 3 in a few minutes
Tags: opencart, upgrade, update, datamigration
Published: 2019-09-03 05:47:39

# Step by step guide on how to upgrade OpenCart 1.5 to OpenCart 3

1. Install OpenCart 3 on your server (point subdomain or sub directory to it)
2. Use [OpenCart to OpenCart migration tool](https://next-cart.com/product/opencart-to-opencart/) to migrate CMS and eCommerce data from OpenCart 1.5 to the new OpenCart store.
3. Install 3.x version of the extensions and into OpenCart 3 store.
4. Choose your desired theme in [themeforest](https://themeforest.net/category/ecommerce/opencart) or [OpenCart theme market](https://www.opencart.com/index.php?route=marketplace/extension&filter_category_id=1).
5. Point your domain name to the new OpenCart 3 store.

# What data can me migrated from OpenCart 1.5 to OpenCart 3

### Products
1. Product Informations, e.g. Name, Description, Prices, Images, Meta, SEO URLs (301 Redirects or Rewrite), etc.
2. Product Options. All option types supported by Opencart 3.
3. Product Links, e.g. Manufacturer, Categories, Downloads, Related Products.
4. Product Attributes.

### Product categories
1. Category Informations, e.g. Name, Description, SEO URLs (301 Redirects or Rewrite), etc.
2. Category Parents

### Customers
1. Customer Informations, e.g. First Name, Last Name, Email, etc.
2. Customer Addresses. All addresses with full informations.
3. Customer Groups mapping.

### Orders
1. Order General Informations, e.g. Status, Currency, Total, History, Notes, Date, etc.
2. Product Details, e.g. Name, Model/SKU, Quantity, Price, Tax, Option Details, etc.
3. Customer Details, e.g. First Name, Last Name, Email, Billing/Payment and Shipping Addresses.

### Taxes
1. Tax Class, Tax Zones and Rates.

### Reviews
1. Reviews of migrated Products. Review Details, e.g. Customer, Comment, Rating, Status, Date.

# How to migrate OpenCart 1.5 to OpenCart 3 with Next-Cart

Next-Cart is a shopping cart migration service allows you to migrate data from your current store to another eCommerce platform. The whole procedure can be taken in 3 simple steps:

1. Upload Kitconnect to the root folders of OpenCart 1.5 and OpenCart 3 stores.
2. Choose the data you want to migrate
3. Perform the migration

{% youtube EwNShcUEL9A %}

Try the Free Demo migration tool at: [OpenCart to OpenCart Migration](https://next-cart.com/product/opencart-to-opencart/)

# Thank you
If you have any questions, feel free to contact us at [https://next-cart.com/contact/](https://next-cart.com/contact/), our technicians are always ready to help you 24/7. Don’t forget to like and share the guide with others if it’s useful for you.

Have a nice day!
Deep Learning Style Transformations in Ruby
Tags: ruby, machinelearning, tutorial
Published: 2019-09-03 05:35:58

---
title: Deep Learning Style Transformations in Ruby
published: true
description: Deep Learning Style Transformations in Ruby
tags: ruby, machinelearning, tutorial
cover_image: https://thepracticaldev.s3.amazonaws.com/i/hrret7994gavuhkcp8l1.jpg
---

Want to do DeepLearning inference in Ruby?
Yes, you can!

### Requirement

* [ONNXRuntime](https://github.com/microsoft/onnxruntime) and its [Ruby binding](https://github.com/ankane/onnxruntime) created by Andrew Kane.
{% twitter 1166468465126830080 %}

* [Magro](https://github.com/yoshoku/magro) and [NArray](https://github.com/ruby-numo/numo-narray).
* [Fast Neural Style Transfer Model](https://github.com/onnx/models/tree/master/vision/style_transfer/fast_neural_style) in [ONNX Model Zoo](https://github.com/onnx/models).

`st.rb`

```ruby
require 'magro'
require 'onnxruntime'

model = OnnxRuntime::Model.new('')

input = Magro::IO.imread(ARGV[0])
                 .transpose(2, 0, 1)
                 .expand_dims(0)
                 .to_a

output = model.predict(input1: input)

result = Numo::Int32[*output['output1'][0]]
                    .clip(0, 255)
                    .transpose(1, 2, 0)
                    .cast_to(Numo::UInt8)

Magro::IO.imsave(ARGV[1], result)
```

### Run

Input image size should be a multiple of 4
```bash
ruby st.rb in.jpg out.jpg
```

### Generated images
https://commons.wikimedia.org/wiki/File:Arimatsushibori.JPG [^1] 

![Arimatsushibori](https://thepracticaldev.s3.amazonaws.com/i/ndojt1rtihn621le74ti.jpg)

candy
![candy.jpg](https://thepracticaldev.s3.amazonaws.com/i/jjltuq897i1g458feimc.jpg)

mosaic
![mosaic.jpg](https://thepracticaldev.s3.amazonaws.com/i/ubgd9uirx4cslwkgylmx.jpeg)

pointilism
![pointilism](https://thepracticaldev.s3.amazonaws.com/i/sxubdn3pkjxg9xsqm9c3.jpg)

rain_princess
![rain_princess.jpg](https://thepracticaldev.s3.amazonaws.com/i/3hjsqhpg4vq7tqw62mal.jpg)

udnie
![udnie.jpg](https://thepracticaldev.s3.amazonaws.com/i/yhqjpfmhf4g558bnncd8.jpg)

Beautiful.

Other posts
* [YOLO object detection using ONNXRuntime with Ruby ](https://dev.to/kojix2/yolo-object-detection-using-onnxruntime-with-ruby-1ap0)
* [NArray - Ruby equivalent of NumPy](https://dev.to/kojix2/narray-ruby-equivalent-of-numpy-30ji)

[^1]: Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Forget that TODO app, this repo will teach you real-world dev skills 
Tags: javascript, github, bestofgithub, webdev
Published: 2019-09-03 04:37:49

---
title: Forget that TODO app, this repo will teach you real-world dev skills 
published: true
description: Tired of TODO apps and looking for a challenge? You've come to the right repo! 
tags: JavaScript, GitHub, bestofgithub, webdev,
---


##In today's Best of GitHub segment, we're taking a look at "the mother of all demo apps" known as _realworld_. 

This repo lets you combine any frontend of your choosing with any backend of your choosing. 

Whether you want to go with something like React and Node or mix things up and go super Frankenstein crazy with Hyperapp and Ruby on Rails, they all adhere to the same API spec so you are free to mix and match! 

###The realworld repo was spearheaded by gothinkster and is available here: https://github.com/gothinkster/realworld

***  

_This video originally appeared on www.youtube.com/realtoughcandy_.
Come follow me there!
Optional HTML
Published: 2019-10-21 18:52:11

---
title: Optional HTML
published: true
date: 2019-09-03 05:00:00 UTC
tags: 
canonical_url: https://stolley.dev/linked/optional-html/
---

Jens Meiert is a big fan of omitting optional HTML. He’s assembled [a pretty exhaustive guide](https://meiert.com/en/blog/optional-html/) covering what can be omitted and when. From there he’s also linked to other posts where he’s run the tests and developed the metrics that illustrate the performance gains from leaving out optional HTML (everything from optional closing tags to quotes around single-word attributes).

The problem I have is that optional rules come with no small amount of caveats and contextual issues. As a developer, I want a readable, consistent code base. Quote your attributes, for example, always. I still write HTML in XHTML-strict style. I don’t want the ambiguity of some attributes being enclosed in quotation marks, and others not. Quote them all.

Plus there’s always the possibility of being burned by a change in content forcing a change in context, and therefore a different rule. For a dumb example,

```
<aside class=summary>A summary</aside>
```

That’s legal. But the second an additional class gets added, it’s not:

```
<!--Invalid-->
<aside class=summary review>A summary and review</aside>
```

By inserting quotation marks and reducing ambiguity from the get-go, later adjustments are potentially less error-prone, simply by a reduced cognitive load of changing the content while maintaining the operative rule:

```
<aside class="summary">A summary</aside>
<!-- becomes: -->
<aside class="summary review">A summary and review</aside>
```

Although as Jens himself notes in his guide’s appendices, it’s essential to validate.

A possible compromise: Write the verbose, strict style in HTML or any other language. Then leave it to a piece of tooling to remove the optional stuff. And even then, it’s essential to validate.
How do you nudge developers on your team to adopt modern development practices?
Tags: discuss, vue, webdev, vscode
Published: 2019-09-03 04:48:12

I believe as web development continues to evolve, it's in an organization or an individual developers interested to keep up.

There seems to be a trend where many developers tend to settle with the skills they have rather than evolving because they're comfortable with what the tooling they work with and are pretty hard to convince to implement a solution or build a product a certain way.

Is your team currently going through that phase ? If so, how do you deal with it?
CSS Smooth Scroll Behavior
Tags: css, sass
Published: 2019-09-03 03:01:11

---
title: CSS Smooth Scroll Behavior
description: Learn how create smooth scroll effects with only CSS.
keywords: CSS, HTML, Cory Rylan
tags: css, sass
canonical_url: https://coryrylan.com/blog/css-smooth-scroll-behavior
published: true 
---

I recently wanted to add a smooth scroll effect on one of my websites and went searching for a JavaScript plugin to achieve it. To my surprise a newer CSS Scroll Behavior API is available in many browsers! With the CSS Scroll Behavior API we can link to inner parts of a HTML page and have the browser scroll to the part of the page instead of immediately jumping to it. I thought this was pretty cool so I wanted to write up a little demo of how it works.

In the past if we wanted to have a smooth scroll to a certain part of the page we would have to use JavaScript to accomplish this. Now with CSS Scroll Behavior we can do it with just a single line of CSS. Using a link I can link to inner parts of my HTML page.

```html
<a href="#some-content">jump to some content</a>

...

<p id="some-content">
  some content
</p>
```

With this little bit of HTML the user can click the link and have the page jump to the `some-content` paragraph below. This jumping effect can be a helpful shortcut but also jarring to suddenly move to a completely different part of the page. To make this a better experience we can add the following CSS:

```css
html {
  scroll-behavior: smooth;
}
```

Now when we click the link, the browser will scroll to the content and not immediately jump to that part of the page. Because the smooth scroll behavior is applied via CSS we can manipulate the scroll position with JavaScript and still get the same nice smooth scroll effect.

```javascript
const button = document.querySelector('button');
button.addEventListener('click', () => window.scrollTo(0, 1400));
```

The [browser support](https://caniuse.com/#search=scroll-behavior) for CSS Scroll Behavior is pretty good, as it works in the next version of Edge, Chrome and Firefox. You can also checkout the a full working [demo](https://stackblitz.com/edit/js-diczif)
How to survive in a tech company if you're non tech savvy?
Tags: discuss
Published: 2019-09-03 04:08:19

I'm a non tech savvy person, which means the most advanced thing I've ever encountered in my life is Microsoft Excel. 

I just applied for a job as a PR Specialist in a technology company and as much as I'm excited for the job, I'm terrified as well.

During the weekly session, they're talking about Java Script, Python, Framework, and tons of other words that I have absolutely no idea about. 

I want to do well for my job, but I'm not sure where to start. 

Is there anything that I can start doing to get adapted to the new environment?
Just another React Template 🤷‍♂️
Tags: react, webdev, discuss, showdev
Published: 2019-09-03 03:46:25

---
title: Just another React Template 🤷‍♂️
published: true
description: features that you thought if create-react-app would have had
tags: react, webdev, discuss, showdev
---

Hey Dev People 👩‍💻👨‍💻,

It's been a while since I wrote something. There have been lots of things going on like, It's been a roller coaster I should say yet I'm not even halfway through it. So thought I might post something that if / may some of you might find it useful of any sort.

[react-template](https://github.com/droidMakk/react-template)

Maybe just yet an another react template. Where I'm adding features that I feel are interesting and easy to develop. where I found this plugin called [craco](https://www.npmjs.com/package/@craco/craco) which can extend the create-react-app's config without ejecting the app 😱. That's another level 😎. 

Have configured different scripts that are mostly used by the devs around the world. Some other features which I found interesting were something like,

- [storybook](https://storybook.js.org/)
- [nodemon](https://nodemon.io/)
- [PM2](http://pm2.keymetrics.io/)
- [react-router](https://reacttraining.com/react-router/web/guides/quick-start) replacing with reach-router
- [Lighthouse 🚨 CLI](https://github.com/GoogleChrome/lighthouse/tree/master/lighthouse-cli)
- [Gitlab Pipeline](https://docs.gitlab.com/ee/ci/pipelines.html)

I'm planning to add more features which involve like,
- [webhint](https://webhint.io/) reports in pipeline
- [Dockerfile](https://docs.docker.com/engine/reference/builder/) to host using pm2 / Nginx
- Extend service worker
... more to come

Let me know if there's something you want me to add or you find it interesting. I will jump into it and if we're on the same page will simply put on the list and later will be merged into the base.

The folder structure itself is what I found interesting is that after working through several projects found it compulsive that **data-service-view layers** are doing a great job and **looks like components are becoming the future of the web**. So it's better to have a standard folder structure like

```
src/
	|--components/
		|-- ComponentName/
			|-- index.js ( adding mappers and context )
			|-- Component.js ( your component's code )
			|-- componentname.(css|scss) ( Your component's styling )
	| --screens/
		|--ScreenName/
			|--index.js ( mapper and context )
			|--Screen.js ( your screen's code )
			|--components/ ( screen specific code )
				|-- ComponentA.js
				|-- ComponentB.js
			|--screenname.(css|scss) ( Screen's styling / overrides )
```

Let me know if there's something more to it, so I would simply merge into the base and use it for future iterations.

Buenos Dias, Amigos!
Feel free to dm/Whatsapp/mail me in case of any suggestion you would want me to add.
🤙 + 91 - 8939717211 | [@droidmakk](https://twitter.com/droidmakk) |
Gamedev, Where should I start?
Tags: gamedev, discuss, beginners
Published: 2019-09-03 02:46:00

### Hi! I was hoping to get started on Game Development.

I'm currently a web developer and is decent in javascript. I've tried Unity before and made an incomplete but working Endless Runner Game.

*Since I have confidence in my javascript coding skills,* **I'm hoping to learn gamedev on web** and I have my sight on PhaserJs. Do you have any tips or links on resources I could use? Or any suggestions for another framework in gamedev on web? If you have any-, anything at all. 

**I WOULD LOVEEEEE IT** if you could share. ^^ 

Also if you would be so kind as to mentor me on the steps, I would gladly appreciate it.

**Hoping to see great comments and suggestions. Thanks!**
Calculate Derivative Functions in Python
Tags: python, tutorial, math
Published: 2019-09-03 02:45:17

There are so many cool things you can do in Python, and today we're going to learn about calculating derivatives.

# What's a Derivative
Remember Calculus 1? Me neither, so let's do a quick refresher.

Derivatives are how you calculate a function's rate of change at a given point. For example, acceleration is the derivative of speed. If you have a function that can be expressed as `f(x) = 2x^2 + 3` then the derivative of that function, or the rate at which that function is changing, can be calculated with `f'(x) = 4x`.

*Note: In case you don't know, the `f'(x)` is pronounced "f prime of x"*

Derivatives have a lot of use in tons of fields, but if you're trying to figure out how to calculate one with Python, you probably don't need much more explanation from me, so lets just dive in.

# Fire up that Python Console
If you don't already have the SymPy library, go ahead and run `pip install sympy`. [SymPy](https://www.sympy.org/en/index.html) is a Python library aiming to become a full fledged Computer Algebra System (CAS) which is a really freaking cool thing in its own right, but lets press on. First, let's get everything set up:
```
>>> from sympy import *
>>> # We have to create a "symbol" called x
>>> x = Symbol('x')
```
Now that we've imported the library and created a symbol, let's make the function  for `2x^2 + 3` (the math function, not a Python function):

```
>>> f = 2*x**2+3
>>> f_prime = f.diff(x)
```
And what do these look like?
```
>>> f
2*x**2+3
>>> f_prime
4*x
```
And that's all there really is to it. But those aren't actual functions, so what good are they to me unless I'm just trying to cheat on my homework? If I were writing a program that went through the trouble of finding a derivative, I'm probably intending to use it as a function, right? Well, SymPy has your back with a handy function called `lambdify` in which we pass our symbol and (math) function:

```
>>> f = lambdify(x, f)
>>> f_prime = lambdify(x, f_prime)
>>> # Let's test it out
>>> f(3)
21
>>> f_prime(3)
12
```
And there you have it. So easy, right??

# Conclusion

If you made it this far into the article and you're thinking to yourself "I will literally never use this" consider this: If there is a Python library for finding derivatives and then turning them into functions, there is probably a library for anything you might need. If you ever find yourself about to take on a really complex task, or you have a great idea for an application but are afraid the underlying implementation will be too much to write on your own, do a quick Google search and see if there isn't something out there already.

Happy coding! And as always, let me know if you have any questions.
What's on deck for my tech leads this week - September 2, 2019
Tags: leadership, management, career
Published: 2019-09-03 02:17:38

---
title: What's on deck for my tech leads this week - September 2, 2019
published: true
description: What we're going to talk about intentions as greater than goals
tags: leadership, management, career
---

Hey Tech Leads,

For those of you coming off the three day weekend here in the States with me, I hope you had a good one. You can see I managed to walk away with a light (and somewhat cliche) sunburn--but I guess that's the price you pay for hanging out in the pools and on the beach for four days straight!

![Michael Rice's Sunburn](https://thepracticaldev.s3.amazonaws.com/i/7y7r4ajm4t5z6h3japhh.jpg)

Anyway, this week, here on Dev.to and on my [email list](https://michaelrice.substack.com/), I'm going to focus on **intentions**. By that I mean, I want to try to shift your thinking away from goals to your broader intentions for your tech leadership. 

I'm doing it on [the podcast]() and the [tech lead mailing list](https://michaelrice.substack.com/). The podcast is a forum where I riff on some issues, but the real content shows up in the writings.

**Monday's** [issue](https://michaelrice.substack.com/p/whats-your-intention-tech-leads-no) (No. 49) already went out along with [its companion podcast](https://anchor.fm/techleadcoaching/episodes/No--49---Monday-Motivation-whats-your-INTENTION-tech-leads-e56kh2). In it, I explain in more detail what I mean by intentions and why I think they're more important than goals, even though goals are so critical to making our work world *work*.

On **Wednesday**, I'm going to focus on a few specific intentions that I tend to gravitate towards, especially commitment and follow through, which I think are good things to focus on mid week. **Results**: [Podcast No. 50](https://anchor.fm/techleadcoaching/episodes/No--50---How-To-Use-This-Intention-Thing-In-Your-Tech-Leadership-e57fmd) is up, and so is the letter, [Commitment is a great type of intention](https://michaelrice.substack.com/p/commitment-is-a-great-type-of-intention).

On **Friday**, we're going to finish strong with some ideas about intentions and reflect on the week. 

Follow me here on dev.to or, even better, subscribe to my three times a week email blast!