teleren/devto huggingface dataset:
Book Club: "Test Driven Development: By Example" #15 - Abstraction By Example
Tags: books, tdd
Published: 2022-08-30 11:07:05

---
title: Book Club: "Test Driven Development: By Example" #15 - Abstraction By Example
published: true
description: A chapter by chapter discussion of "Test Driven Development By Example" by Kent Beck
tags: books, tdd, discuss
series: Book club TDD By Example
---

## Book Club: "Test Driven Development: By Example" #15
### Chapter 16: Abstraction, Finally

Now we're coming to the end of this example!
We want to test the `plus()` method on `Sum`, and Beck calls our test code a Rosetta Stone. It should read clearly, and be close to our actual design, ie we create a Sum explicitly that we can use to get the result we assert on. We don't _have_ to do that, but we will, to illustrate how the code is intended.

Beck talks about economy, saying that tests written with TDD will be about as long as the code itself and thus to maintain economic sense, you need to write code faster, or use less code for your purpose. Perhaps this is true, although... we're working without refactoring the tests to DRY up the test set up so perhaps not. But, I find it a weird thing to say, since the economy of _writing_ and _having_ lines of code isn't the measure of successful software.
People who aren't convinced by TDD tend to complain that the cost of TDD is too high because writing code for the tests is slow. But, since the tests are a side-effect of _driving design_, TDD keeps you and your team working faster _long-term_; even if you are maintaining twice as many lines of code.

There's one chapter left in Part One of the book, which retrospects on the Money example.


🔎 View my code-along repo at https://github.com/ruthmoog/test-driven-development-by-example 

-----

![Book cover](https://learning.oreilly.com/library/cover/0321146530/250w/ ) Kent Beck's "[Test Driven Development: By Example](https://www.oreilly.com/library/view/test-driven-development/0321146530/)" was released in 2002. The book aims to explain how to use TDD to write quality code that works.
Cloud-based Security Solutions Can Help Keep Your Business Secure!
Tags: security
Published: 2022-08-30 10:48:11


![Cloud-based security solutions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgzc62ecis895f2bu3ud.jpg)
As more and more businesses move to the cloud, it's essential to consider the Security of your data. Cloud-based security solutions can help keep your business secure by providing data centres, data encryption, user verification, and activity monitoring. [Read More](https://expertsecuritycamerasystems.wordpress.com/2022/08/30/how-maglock-systems-can-help-your-facility-stay-secure/)
What is html headings
Tags: html, htmlheadings, learnhtml
Published: 2022-08-30 10:25:19

The heading elements H1, H2, H3, H4, H5, and H6 are defined in HTML as six levels of headings. The highest or most important level is H1, and the lowest or least important level is H6. [Learn More](https://www.tutorialwithexample.com/html/html-headings)
How to access EFS folders from the Windows File Explorer using WSL2
Tags: aws, efs, windows, ubuntu
Published: 2022-08-30 10:16:00

EFS is the default place for storing your volumes when you use Fargate and ECS in AWS. This is fine when your main workstation is any Linux distro, but what happens when you work in Windows?

The easy option is to use **Windows Subsystem for Linux** (Ubuntu, in my case) and [mount your EFS](https://docs.aws.amazon.com/efs/latest/ug/installing-amazon-efs-utils.html):

> sudo mount -t nfs4 -o rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport MY_IP_ADDRESS:/ efs

This is fine if you just want to access your files or folders from your **console**, and you don't need to do anything more complex with them. However, if you want to map it as a "regular" **Network Drive** and/or access it from the **Windows File Explorer** can be tricky. This is how I accomplished it:

**Step 1.** Create your `efs` folder in this location `/mnt/wsl`.
**Step 2.** Mount your `efs` using the previous command.
**Step 3.** Go to this location `\\wsl$` in the File Explorer, and get your Distro's root. In my case, `\\wsl$\Ubuntu`

![wsl location](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft7wex0oeh4z5hfvpiwt.png)

**Step 4.** Copy your Distro's path and map it as your new Network Drive in Windows:


![mount path](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v71006rlarv3fp97moxx.png)

![mount drive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7mwxk5ygzqhowx5m72ej.png)

![mounted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cslgnd67qpnmkbcfqgtc.png)

And that's all. Now you can access your EFS from your **Network Drive**, for example, `Z:\mnt\wsl\efs`

### Follow me on:

|  Personal  |  LinkedIn  |YouTube|Instagram|Cyber Prophets|Sharing Your Stories|
|:----------|:----------|:------------:|:------------:|:------------:|:------------:|
|[![Personal](https://raw.githubusercontent.com/FANMixco/federiconavarrete/master/img/favicons/favicon.png)](https://federiconavarrete.com)|[![LinkedIn](https://i.stack.imgur.com/idQWu.png)](https://www.linkedin.com/in/federiconavarrete)|[![YouTube](https://i.stack.imgur.com/CFPMR.png)](https://youtube.com/c/FedericoNavarrete)|[![Instagram](https://i.stack.imgur.com/PIfqY.png)](https://www.instagram.com/federico_the_consultant)|[![RedCircle Podcast](https://i.stack.imgur.com/4XICF.png)](https://redcircle.com/shows/cyber-prophets)|[![RedCircle Podcast](https://i.stack.imgur.com/4XICF.png)](https://redcircle.com/shows/sharing-your-stories)|

[![sponsor me](https://raw.githubusercontent.com/FANMixco/Xamarin-SearchBar/master/bmc-rezr5vpd.gif)](https://www.buymeacoffee.com/fanmixco)
Stremio add-ons not found /not working/ take to much time to load
Tags: stremio, opensource, entertainment, tutorial
Published: 2022-08-30 10:10:00

## What is Stremio?

![stremio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugc5toqjzjft5byzwyot.png)

Stremio is a modern media center that's a one-stop solution for your video entertainment. You discover, watch and organize video content from easy to install addons.

If you familiar with stremio. I hope recently you face some issue. Like there is no add-ons or available add-ons not loading properly. Then you have to do just one thing <span class="emoji-outer emoji-sizer"><span class="emoji-inner" style="background: url(chrome-extension://gaoflciahikhligngeccdecgfjngejlh/emoji-data/sheet_apple_32.png);background-position:59.9882491186839% 85.95769682726204%;background-size:5418.75% 5418.75%" data-codepoints="1f60e"></span></span>

Just go to the link - 
[https://torrentio.strem.fun/configure](https://torrentio.strem.fun/configure)

Then click install 

![stremio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32xrz2f1bk88bv8mmg0p.png)


and it will redirect to your stremio application. Voila... 
![stremio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q42i9py6vjgxksoiap3s.png)

Enjoy your shows. Thank you
Digital Collectibles and NFTs
Tags: nft, web3, beginners, crypto
Published: 2022-08-30 09:32:00

If you've been wondering why i call myself **The Non Fungible Human**, read on!🙃

**Digital Collectibles**

Collectibles have been around for centuries, with people collecting everything from stamps and coins to baseball cards and action figures. But what happens when the collectible is digital? 

That's where the world of digital collectibles comes in.

Digital collectibles are items that exist only in a digital form and can be collected, traded, or sold like any other item online.

**NFTs**

A non-fungible token, or NFT, is a digital asset that is unique and cannot be interchangeable with another unit of the same type. This makes them perfect for representing digital collectibles or scarce items in online games.

For example, you could create a limited edition set of NFTs to represent an event or character in your game.

In other words, each NFT is a distinct and individual item. This makes them perfect for representing digital collectibles, as no two items are alike.

NFTs are created on blockchain platforms like Ethereum and EOS using smart contracts. This allows for trustless ownership and easy transfer between users. 

It also means that the assets can be stored securely on the blockchain and used as collateral for loans or betting exchanges.

**6 NFT Use Cases**

**1. Collecting and Trading:** One of the most popular uses for NFTs is collecting and trading them with other people.

**2. Loyalty Programs**: Many businesses use loyalty programs to reward customers for their loyalty. With NFTs, these programs can be digitized and made much more efficient and user-friendly.

**3. Charitable Donations**: Non-profit organizations can also benefit from using NFTs as a way to accept donations from supporters around the world. This not only makes it easier for donors to donate money, but it also allows them to track how their donation is being used.

**4. Event Ticketing**: Tickets to events often sell out quickly, so having an online system that uses NFTs can help ensure that everyone has a fair chance at getting tickets without having to queue up in person hours before the event starts!

In addition, this system can also help reduce ticket fraud since each ticket would be linked specifically to the owner’s unique ID number)..

**5. Online Gaming Items**: Online gamers have been using virtual items (like swords and armor) as an alternative form of currency for years now!.

By using NFTs instead of virtual items though, gaming platforms could create a more secure system where gamers know that they will always own the items they purchase regardless of what happens to the game server itself).

**6. Digital Art Assets**: Just like physical art pieces appreciate in value over time, digital art assets hold similar potential thanks to blockchain technology!

Artists who create digital artwork could use blockchain technology as a way to store their work securely while allowing buyers access 24/7 from anywhere in the world).

You know other NFT Use Cases, drop them below 👇

You should literally know what **The Non Fungible Human** means now🙂
how to search jsonb column in Postgresql ( not nested column )
Tags: sql, postgres, help
Published: 2022-08-30 09:24:38

my schema :
```
create table blog (
  id  SERIAL PRIMARY KEY,
  title varchar,
  tags jsonb
);
```
my db:
[![enter image description here][1]][1]

my query:
```js
const tags = "horr";
const query = `SELECT * FROM blog where tags like '%${tags}%'`;
```

what I am  want: 

now I am want to get only "tags" column include **"horror"**. but I wanna use just **"horr"**

I know this query is not work. but wanna do like this bellow 

```json
"rows": [
    {
      "id": 1,
      "title": "horror stroy",
      "tags": [
        "sad",
        "horror"
      ]
    }
  ]
```



  [1]: https://i.stack.imgur.com/r4boF.png
Nuxtjs on Heroku
Tags: nuxt, heroku, paas, javascript
Published: 2022-08-30 09:17:00

I've been developing a **Nuxtjs application** on **node.js**. I have developed the app on my local computer. Because the client has been needed to see it well functioning before to allow some space on their server I had to find a solution to show them how it is working. And to test it before.

For this scope I found that it is good to put it on Heroku. This way the client, which is not in my city, can test the webapplication.

You perhaps know that the **Nuxtjs** is based on **Vue.js framework**. And you can see details about what it is and how functions here: [https://nuxtjs.org/](https://nuxtjs.org/).

About **Heroku** you maybe know that it is a cloud/PaaS platform which offers to the companies the possibility to build, deliver, monitor and scale apps — we're the fastest way to go from idea to URL, bypassing all those infrastructure headaches. And you can get a free DYNO to deploy your application. And this is the best thing on [Heroku](https://www.heroku.com/).

Let's get back to my challenge with Heroku and my app. I've created the dyno for my app and I put the code on it. I pushed the code with git on **master** branch first, 

```
$ git push heroku master
```

The dyno startet to deploy the app, but I got this error:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ir7mjwmorolsn15c12o2.png)

And then, I thought that it is happening because of the **master/main** problems in git. And I run then:


```
$ git push heroku master:main
```
But the problem have persisted. And I found this [Stackoversflow - Delete package-lock.son can solve your problem](https://stackoverflow.com/questions/54124033/deleting-package-lock-json-to-resolve-conflicts-quickly). So, I have deleted the `package-lock.json` file and the error disappeared. But I still had on problem. The deploying of the code generated a fail in the app. I had to dig more. 

In package.json I had this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wgfojmr5lqws82n9bren.png)

And then, I added this: `"dev": "NUXT_PORT=process.env.PORT nuxt",` s.u.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a3fqc63fffvcbg9jxxt.png)

And it was not enough. I heroku concole I run:

```
$ heroku config:set NPM_CONFIG_PRODUCTION=false
```
and 

```
$ heroku config:set HOST=0.0.0.0
$ heroku config:set NODE_ENV=production
```
After this I added this line in package.json:
```"heroku-postbuild": "npm run build"```

And I run this

```$ git push heroku master:main```

The deploy went well, so I have now the app up and running.

###Latest:

Heroku will not be free anymore. This is a bit sad. 
[https://dev.to/lukeecart/more-heroku-changes-that-will-definitely-affect-you-10o8](https://dev.to/lukeecart/more-heroku-changes-that-will-definitely-affect-you-10o8)
Who Are The Various Actors in the Web3 Ecosystem?
Tags: web3, beginners, blockchain, tokenomics
Published: 2022-08-30 09:06:53

There are a lot of actors on the web3. we'll be looking at the most important ones:
**- Crypto Exchanges**
**- Crypto Wallets**
**- Validator**
**- Crypto Custody**
**- Cryptocurrency on-ramps and off-ramps.**

**1. Crypto Exchanges**
A crypto exchange is a digital marketplace where people can buy and sell cryptocurrencies. They are similar to traditional exchanges such as the New York Stock Exchange, but instead of stocks and shares, people trade cryptocurrencies like Bitcoin and Ethereum

Crypto exchanges allow you to buy coins at the current market price, or to place limit orders that will be executed when the price reaches a certain point. They also offer margin trading which allows you to borrow money from the exchange in order to trade with more capital.

**2. Crypto Wallets**
A crypto wallet is a digital storage device for your cryptocurrency. It stores the public and private keys needed to access and send your funds. Wallets come in many different forms, including desktop, mobile, and online wallets.

There are many different types of wallets, so it's important to do some research before choosing one.

**3. Crypto Validator**
A crypto validator is a computer system that checks the validity of digital signatures and other cryptographic data. By ensuring the accuracy of this data, crypto validators help protect against fraudulent activity online.

A validator in web3 is an important part of the network because it helps to maintain the integrity of the blockchain. Validators are responsible for verifying transactions and adding them to the blockchain.

Two validation protocols are proof of work (POW) and proof of stake (POS) more like a banker responsible for verifying a transaction.

**4. Crypto Custody**
Crypto custody is a way to keep your cryptocurrency safe. You can use crypto custody to store your coins in a secure location, so you don't have to worry about them getting stolen or lost.

**5. Cryptocurrency on-ramps and off-ramps**

Cryptocurrency on ramps and off ramps are digital platforms that allow users to buy or sell cryptocurrencies. On ramps allow users to buy cryptocurrencies with traditional currency, such as dollars or euros.

Off-ramps allow users to sell their cryptocurrency for traditional currency. Some on ramps and off ramps also offer other services, such as wallets that store cryptocurrencies and exchanges where users can trade different types of cryptocurrencies.

There are many different on-ramp and off-ramp platforms available today. Some of the most popular ones include Coinbase, Gemini, Bitstamp, Kraken, Binance, and Poloniex. Each platform has its own unique features and benefits.

They are the key to bridging the gap with the traditional financial world and for bringing in new users and money into the crypto market.
📊 From API to csv... then datascience with Jupyter
Tags: datascience, beginners, showdev, python
Published: 2022-08-30 08:57:24

## ❔ About

Now that we have an API... is it possible to build some reporting or even better create intelligence on top of it ?

This question will be covered from the ground up in this post.

You'll see, how, with a simple **- yet clean -** `csv` you can build really nice and useful reporting contents... and how to share them around you.

Enough talk now, let's dive head first into the demo !

## 🍿 Demo

{% youtube Bf2I6nhN36w %}

## 🔖 Ressources

- [JupyterNotebook source code (and `csv`)](https://github.com/opt-nc/domaine-nc-jupyter-notebook)
- [API on Markeplace](https://rapidapi.com/opt-nc-opt-nc-default/api/domaine-nc)

## 🧑‍🤝‍🧑 Acknowledgements

- @mbarre & @spencer_forrest_opt for implementing the endpoints that made it possible
- @olivierruineau for the kind prototyping, knowledge sharing and his nice data storytelling
- [`opt-nc`](https://dev.to/optnc)'s team for the data storytelling review process
Data Protection: Major differences between Encryption, Hashing and Salting.
Published: 2022-08-30 08:56:37

Web security is an important concept that a developer must have in consideration when building a website. It's a parameter for assessing the quality of the site built. Web security simply means ensuring that business and users data are protected and the integrity of the site is not easily compromised.

Ensuring web security and users' data protection can be achieve in so many ways. In this article, we will explore the concept of encryption, hashing and salting as methods of data protections and highlight the differences between these concepts. 


Encryption
Encryption is the process by which a piece of data/information is converted into secret code that hides the information's true meaning. The science of encrypting and decrypting information is called cryptography.

In computing, unencrypted data is also known as plaintext, and encrypted data is called ciphertext. The formulas used to encode and decode messages are called encryption algorithms, or ciphers.

In programming, encryption can be done in several ways and the most popular form of encryption are hashing and salting. Encryption helps us hide the user passwords by converting the plain text into secret keys that can not be easily decoded.  

Hashing 
Password hashing is used to verify the integrity of your password, sent during login, against the stored hash so that your actual password never has to be stored.

Salting
Password salting is a technique to protect passwords stored in databases by adding a string of 32 or more characters and then hashing them. Salting prevents hackers who breach an enterprise environment from reverse-engineering passwords and stealing them from the database.

#Encryption Packages.
Popular packages used for achieving this are JsonWebtoken, Crypto and Passport. These are the popular packages used in Node, there are others that can be explored depending on the project and programming language being used. 

#Conclusion
In this short article, we have try to explain the difference between encryption, hashing and salting. We have identified them as methods of ensuring web security and means of protecting user and business data. However, while Encryption is a broad term that refers to the process of hiding data by converting data from plain text to ciphertext, salting and hashing are instances of encryption that apply to password encryption.
Fast IP 🚀 | IP infos, nothing else.
Tags: vite, react, leaflet, javascript
Published: 2022-08-30 08:37:00

## What about it?

<br>

I had trouble to find a website that just shows me my IP infos.
All i wanted to have was my IP Address and some basic informations like localisation, server...
Websites about IP Addresses are full of advertising, products to sell and other functionnality that i did not need.

<br>

## Features

<br>

A picture paints a thousand words

<br>

<a href="https://fastip.qweit.com/"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bzRPlmMd--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1kdeow59esghzk05odbk.jpg"></a>

<br>

## Stack

<br>

- Vite
- React
- react-leaflet

<br>

## API

<br>

- api.ipify.org
- ipinfo.io

<br>

## Troubleshooting

<br>

If the website keeps showing "searching", try to disable your Adblocker and hard refresh with "ctrl + F5".

<br>

## Contributions

<br>

Feel free to fork the project and add features, the only thing i want is that the website keeps it simplicity.
Web3 Explained like you're 5!
Tags: web3, crypto, beginners, career
Published: 2022-08-30 08:32:43


**Web3, The Internet of Value and Distributed Ledger.**

**What is Web3?**
Web3 is a term used to describe the third generation of the World Wide Web, which is still in development. The first generation of the web was made up of static pages that were published online.

The second generation allowed users to interact with these pages through dynamic content and user-generated content.  E.g Facebook and Twitter.

Web3 aims to take this one step further using blockchain technology and decentralized applications (dapps) to create a more secure and efficient internet.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ni58t4fomd7q3ow15d1.jpg)
This will allow for more trustless transactions between users and enable them to control their own data without relying on third-party providers.
Web3 aims to give the power of the internet to YOU!

**THE INTERNET OF VALUE**
The internet of value is a relatively new term that refers to the potential for blockchain technology to revolutionize how we interact with the digital world.

The basic idea is that by using blockchain technology, we can create a more secure and efficient way of exchanging value online. 
This could potentially have a huge impact on everything from e-commerce to international payments.

For example, right now if you want to buy something from an overseas vendor, it can be difficult and expensive because you have to go through a third party like PayPal. With the internet of value, you could directly exchange currency with the vendor without having to pay fees.

**DISTRIBUTED LEDGER**
A distributed ledger is a database that is spread across many different locations and computers. This type of database allows for secure, transparent transactions between different parties.

Because the data is distributed, it is not stored in one place and can be accessed by anyone who has permission to do so. This makes it a great choice for businesses that need to share information securely or want to reduce the risk of fraud.

Blockchain has become so popular that people have forgotten about the parent, distributed ledger. All Blockchains are distributed Ledgers but not all distributed ledgers are Blockchain

Blockchain is merely a subset of Distributed Ledger.
A Blockchain is a shared database filled with entries that must be confirmed and encrypted. The name Blockchain refers to blocks that get added to a chain of transaction records using cryptographic signatures called hash.

And that's it! Done with the basics!✅

Image credit: @suhailkakar 
You can find this as a thread on [Twitter](https://twitter.com/Thenfh_/status/1555622243371196417?t=bx9lZ3ecoEEoZBFYe5QA5w&s=19)