teleren/devto huggingface dataset:
React and rdbms
Published: 2021-12-23 16:07:41


Crud operations: crud operation has four criteria which are add delete update and read 

Read: in this system, we can get data from the database .which is shown on the frontend page.we can search and filter also is read method. This is the method is GET

Add: add is a method where we can add anything into the database. Method is POST

Delete: delete is a method where we can delete an item from the database. Method is DELETE

Edit /update: we can update existing data. Where the method is PUT

Relational database (MySql):
A relational database is a collection of data items with pre-defined relationships between them. These items are organized as a set of tables with columns and rows.
Tables are used to hold information about the objects to be represented in the database. Each column in a table holds a certain kind of data and a field stores the actual value of an attribute. The rows in the table represent a collection of related values of one object or entity.
 Each row in a table could be marked with a unique identifier called a primary key, and rows among multiple tables can be made related using foreign keys.
SQL or Structured Query Language is the primary interface used to communicate with Relational Databases. SQL became a standard of the American National Standards Institute (ANSI) in 1986. The standard ANSI SQL is supported by all popular relational database engines, and some of these engines also have extensions to ANSI SQL to support functionality that is specific to that engine. SQL is used to add, update or delete rows of data, retrieve subsets of data for transaction processing and analytics applications, and to manage all aspects of the database.

[1]MySQL is the most popular open-source SQL database. It is typically used for web application development, and is often accessed using PHP.
The main advantages of MySQL are that it is easy to use, inexpensive, reliable (has been around since 1995), and has a large community of developers who can help answer questions.
Some of the disadvantages are that it has been known to suffer from poor performance when scaling, open-source development has lagged since Oracle has taken control of MySQL, and it does not include some advanced features that developers may be used to.
Relational databases store data in tables. Tables can grow large and have a multitude of columns and records. Relational database management systems (RDBMSs) use SQL (and variants of SQL) to manage the data in these large tables. The RDBMS you use is your choice and depends on the complexity of your application.
Note
This is from: https://www.codecademy.com/article/what-is-rdbms-sql
Can someone catch me up to speed with quantum-stuff?
Tags: quantum, help, watercooler
Published: 2021-12-23 16:01:24

So, I've been hearing about quantum computers, and I've been kind of out of the loop.

Can anyone give me some good (rich\*) resources that are easy to understand about all the quantum physics, and how they're used with quantum computing.
I've got a start by reading this article; ["What is Quantum COmputing? | IMB"](https://www.ibm.com/topics/quantum-computing).

<b><h1><center>Thanks!<br/>Cheers!</center></h1></b>
JWT Token
Tags: database, programming, beginners, webdev
Published: 2021-12-23 15:55:43

**What is JWT token?**
JWT stands for JSON web Token. It makes a secure way to identify a signed user and serve information to the user. It shares information between two parts. They are server-side and client-side. JWT token saves the information by a special token.
**Why use JWT token?**
JWT is a standard way to make a security system more strong. Now almost every modern app or web authority uses JWT tokens to give security to their users. JWT is a secure way to authenticate a user and share information. JWT saves user information with a secret token. The spatial token carries the information into it.
**How JWT works?**
JWT commonly contains some claims. These claims determine that who uses the token, how long it is valid and what permissions the client will get. The JWT token is made up of three parts and these are separated by dot(.). Once a client will get authenticated a unique token will generate for him. And this unique token saves some information about the authenticated user. When the token will be decoded it gives a JSON string. In this JSON string, we will get three things
1. Header
2. Payload
3. Signature

The **header** contains the type of token

The **payload** contains all claims. This is a JSON object. The information verifies the user and performs the action that the user requests.

The **signature** makes sure that the token has not changed
Living in the Shell #22; md5sum/shasum (Check/Compute MD5/SHA Checksum of Files)
Tags: productivity, linux, beginners, bash
Published: 2021-12-23 15:48:52

## `md5sum`/`shasum` #️⃣

Checks/computes MD5/SHA checksum of files.

## Compute MD5 checksum `md5sum`

```sh
md5sum ~/.bashrc ~/.zshrc ~/.profile
```

> ```text
> fc4231f666b25990eefc1c51917d7bb1  /home/babak/.bashrc
> 6688207953bbd9d20d487a9509a6c297  /home/babak/.zshrc
> 43f7dc02e7bfb5d40703b5cb94e274ce  /home/babak/.profile
> ```

## Compute SHA1 checksum `shasum`

```sh
shasum ~/.bashrc ~/.zshrc ~/.profile
```

> ```text
> 499460ce753fa4b02cbb8c7e0cb61b1a9583bcd9  /home/babak/.bashrc
> 2f195c1d8c86cf34e4bdbd947e76fc9cb0bc900e  /home/babak/.zshrc
> 63d1a74119f9a8a84fd930ed8341395e9ab867f0  /home/babak/.profile
> ```

## Compute other SHA checksums `-a`

```sh
shasum -a 256 ~/.bashrc ~/.zshrc ~/.profile
```

> ```text
> 25d3d9737d0773dd6ece3a3536205784ce099314d68721eb5a865e82af66495c  /home/babak/.bashrc
> 5db662d84b785f026d6613e7e187a4a9c9333c9a38acf49ea7a5e15f4bb203c8  /home/babak/.zshrc
> 4c532d3d8bb0988d61ac334b1ffc6302ba0aac350b0d5c98102c3c4c443602f9  /home/babak/.profile
> ```
>
> ℹ️ Supported SHA types are: 1 (default), 224, 256, 384, 512, 512224, 512256

## Create checksums file for later checks

```sh
shasum ~/.bashrc ~/.zshrc ~/.profile > SHA1SUMS
md5sum ~/.bashrc ~/.zshrc ~/.profile > MD5SUMS
```

## Check checksums `--check`

```sh
shasum --check SHA1SUMS
md5sum --check MD5SUMS
```

> ```text
> /home/babak/.bashrc: OK
> /home/babak/.zshrc: OK
> /home/babak/.profile: OK
> ```
Backend 5 Topics
Tags: node, mongodb, javascript, programming
Published: 2021-12-23 15:47:30

**CRUD Operations**
CRUD means Create, Read, Update, Delete. Create is used to create posts in the Database. Read is used to Read posts in the Database. Update is used to update a post in the database. Delete method is used to delete a post from the database.

**Mongoose**
Mongoose is basically a package. Which serves as a mediator between the NodeJS application and MongoDB server. It is an Object Document Mapper(ODM) that allows us to define objects with strongly-typed-schema that are mapped to a MongoDB document. Mongoose supports all the CRUD operations – Creating, Retrieving, Updating, and Deleting.

**JWT**
JSON Web Token (JWT) is an open standard. Which defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret key.
 
Although JWTs can be encrypted to also provide secrecy between parties, we will focus on signed tokens. Signed tokens can verify the integrity of the claims contained within it, while encrypted tokens hide those claims from other parties. When tokens are signed using public/private key pairs, the signature also certifies that only the party holding the private key is the one that signed it.
 
**Express.js**
Express.js is a back end web application framework for Node.js. It is released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js.
Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
 
**Relational Database**
A relational database is a collection of data items with pre-defined relationships between them. These items are organized as a set of tables with columns and rows. Tables are used to hold information about the objects to be represented in the database. Each column in a table holds a certain kind of data and a field stores the actual value of an attribute. The rows in the table represent a collection of related values of one object or entity. Each row in a table could be marked with a unique identifier called a primary key, and rows among multiple tables can be made related using foreign keys. This data can be accessed in many different ways without reorganizing the database tables themselves.
CRUD
Tags: database, server, javascript, mongodb
Published: 2021-12-23 15:45:30

CRUD, the word is denoting four core operations when it comes to data management in databases. The C stands for create, the R stands for read, the U stands for update and the D stands for delete. So, CRUD operations are fundamental operations of database data management involving create,read,update and delete. 

For instance, if we talk about MongoDB, like any other database, the MongoDB also requires and supports all the crud operations. I'll explain briefly on every crud operations in the MongoDB. 

First, the create operation. The create operation (also called the insert operation) is the operation in MongoDB where we create a document and add it to a certain collection in the database. This is the first and foremost operation in the crud.

    db.collection.insertOne() 
    db.collection.insertMany()

Then comes the read operation. The read operation in a database is based on the idea that when an user query is launched, certain data should be able to be accessed (read) and show accordingly. For this purpose, the read operation is needed in the database. 

    db.collection.find()

In the third scenario, comes the update operation. Often it needs to update the data according to new circumstance and situations. For this case, databases need to support the update operation. MongoDB also supports the update operation. 

    db.collection.updateOne() 
    db.collection.updateMany() 
    db.collection.replaceOne()

Last comes the final of the four operations, the delete operation. It just so happens that delete is a very core operation when it comes to database because often it might be needed to delete the existing data in the database. 

    db.collection.deleteOne() 
    db.collection.deleteMany() 

So, that covers up all the crud operations in a database. This is based on MongoDB but crud is supported by every databases out there.
What I've learned about good UX
Tags: ux, webdev, beginners, javascript
Published: 2021-12-23 15:36:51

There are a lot of websites, apps, and softwares out there. But, what makes them easy to use? Here's what I've seen.

For one, most people go on the web on their cell phone, so creating a product that's mobile friendly seems like a good start.

Also, many of us use our phones with just one hand, so making sure that a website can be accessed and used with one hand is also helpful. 

Another helpful idea is including tooltips in HTML. Many times, a website visitor may want more information on what is shown, so a tooltip where they can hover for more information is helpful.

These are just a few things I've noticed that help make websites and apps easy to use.
CRUD Operations| RESTful APIs | JSON web token| Mongoose
Published: 2021-12-23 15:29:17

CRUD Operations| RESTful APIs | JSON web token| Mongoose
CRUD Operations:
CRUD (Create, Read, Update, Delete) is an acronym for ways one can operate on stored data. It is a mnemonic for the four basic functions of persistent storage. CRUD typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status.
RESTful APIs
The acronym CRUD also appears in discussion of RESTful APIs. Each letter in the acronym may be mapped to a Hypertext Transfer Protocol (HTTP) method:
• CRUD => HTTP
• Create = PUT
• Read = GET
• Update = PUT
• Delete = DELETE
JSON web token
A JSON web token(JWT) is JSON Object which is used to securely transfer information over the web(between two parties). It can be used for an authentication system and can also be used for information exchange. The token is mainly composed of header, payload, signature. These three parts are separated by dots(.). JWT defines the structure of information we are sending from one party to the another, and it comes in two forms – Serialized, Deserialized. The Serialized approach is mainly used to transfer the data through the network with each request and response. While the deserialized approach is used to read and write data to the web token.

Mongoose:
MongoDB is a database that allows you to store documents with a dynamic structure. These documents are saved inside a collection.

Mongoose is a JavaScript library that allows you to define schemas with strongly typed data. Once a schema is defined, Mongoose lets you create a Model based on a specific schema. A Mongoose Model is then mapped to a MongoDB Document via the Model's schema definition.

Once you have defined your schemas and models, Mongoose contains many different functions that allow you to validate, save, delete, and query your data using common MongoDB functions. I'll talk about this more with the concrete code examples to follow.
MongoDB vs MySQL
Tags: mongodb, mysql, webdev, beginners
Published: 2021-12-23 15:28:12


## MongoDB

MongoDB is a cross-platform document-oriented database program. And MongoDB is a NoSQL database program. MongoDB uses documents like JSON with optional schema. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License. 

## NoSQL Database

NoSQL Database is a non-relational Data Management System, that does not require a fixed schema. And NoSQL databases are databases that store data in a format other than relational tables. That's is, A NoSQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. NoSQL database stands for “Not Only SQL” or “Not SQL. 

## MySQL

MySQL is an open-source relational database management system from the Oracle Corporation. Like other relational systems, MySQL stores data in tables and uses structured query language (SQL) for database access. When MySQL developers need to access data in an application, they merge data from multiple tables together in a process. In MySQL, we predefine our database schema and set up rules to govern the relationships between fields in our tables.  

## SQL Database

SQL stands for Structured Query Language which is basically a language used by databases. SQL lets you access and store, manipulate, and retrieve data within relational databases. Data in tables is stored in row and column format at the logical level, but physically it stores data in something called data pages. A data page is the fundamental unit of data storage in SQL Server and it is 8KB in size. Using SQL, you are able to interact with the database by writing queries, which when executed, return any results which meet its criteria. 

## Conclusion

From this tutorial, we have learned about MongoDB vs MySQL



**Learned from the internet.**

## Thanks for reading

**Reach out to me on:**

- [Portfolio](https://nasirul-islam.netlify.app/)
- [GitHub](https://github.com/Nasirul-Islam)
- [LinkedIn](https://www.linkedin.com/in/nasirul866/)
CRUD Operations| RESTful APIs | JSON web token| Mongoose
Published: 2021-12-23 14:14:32

**CRUD Operations:**
CRUD (Create, Read, Update, Delete) is an acronym for ways one can operate on stored data. It is a mnemonic for the four basic functions of persistent storage. CRUD typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status.
**RESTful APIs**
The acronym CRUD also appears in discussion of RESTful APIs. Each letter in the acronym may be mapped to a Hypertext Transfer Protocol (HTTP) method:
•	CRUD	=> HTTP
•	Create = PUT
•	Read = GET
•	Update = PUT
•	Delete = DELETE 
**JSON web token**
A JSON web token(JWT) is JSON Object which is used to securely transfer information over the web(between two parties). It can be used for an authentication system and can also be used for information exchange. The token is mainly composed of header, payload, signature. These three parts are separated by dots(.). JWT defines the structure of information we are sending from one party to the another, and it comes in two forms – Serialized, Deserialized. The Serialized approach is mainly used to transfer the data through the network with each request and response. While the deserialized approach is used to read and write data to the web token.

**Mongoose:**
MongoDB is a database that allows you to store documents with a dynamic structure. These documents are saved inside a collection.

Mongoose is a JavaScript library that allows you to define schemas with strongly typed data. Once a schema is defined, Mongoose lets you create a Model based on a specific schema. A Mongoose Model is then mapped to a MongoDB Document via the Model's schema definition.

Once you have defined your schemas and models, Mongoose contains many different functions that allow you to validate, save, delete, and query your data using common MongoDB functions. I'll talk about this more with the concrete code examples to follow.
Solar System Explorer
Tags: codepen
Published: 2021-12-23 15:16:55

<p>Explore the planets and moons of our solar system in pure CSS. Not a single line of JS used throughout, only images are planet textures taken from royalty free sites. Information about planets taken from space.com.</p>

<p>This works on  opera but is super jerky, Firefox has some issues with z-index. Mobile....no</p>

{% codepen https://codepen.io/harunpehlivan/pen/vYmXxGq %}
JWT (JSON Web Token)
Published: 2021-12-23 15:13:50

JSON Web Token is the full form of JWT. These tokens are created for verifying the integrity of the claims. This information can be verified and trusted because it is digitally signed. There is a structure of the JWT token below: JWT has three parts and each part are separated by a (dot) sign.
Header
Payload
Signature

**Why do we use JSON web tokens?**
It is stateless, so there is no need to run a session.
JWT is inherently decoupled, which means that tokens can be created anywhere on a separate server or origin server.
Due to the low network circuit, JWT also performs well.

**When should we use JWT? **

**Authorization:** Most common scenario for using JWT. When the user logs in, each subsequent request will include a JWT. This gives users appropriate access to authorized methods, services, and resources.
**Information Exchange:** JSON Web Tokens are a great way to send secure information between parties.
Header: The header has two parts. The token is used in JWT and signing algorithm HMAC SHA256 or RSA. Then, this JSON is Base64Url encoded to form the first part of the JWT.
Example:
{
 
 
"alg": "HS256",
 
"typ": "JWT"
 
}

 
**Payload:**
The second part is the payload, which contains the claims. There are three kinds of claims like registered, public, and private claims.
**Registered claims:** It is a set of predefined statements. These statements are not mandatory, but it is recommended to create a set of useful and interacting statements. Some of them are iss, exp, sub, od etc.
**Public claims:** It can be set arbitrarily by the person using JWT. However, to avoid conflict, they must be specified in the IANA JSON Internet Registry or as a URI so that there is a namespace to prevent conflict.
**Private claims:** These are custom statements that you agree to use, for the purpose of sharing information between unregistered parties or general statements.
Example:
{
 
 
"sub": "123456789
 
"name": "Jack",
 
"admin": true
 
}

 
**Signature:** To create a signature section, you need to get and sign specific algorithms in encrypted titles, encrypted payloads, secrets, and headers.
Example:
HMACSHA256(base64UrlEncode(header)  +  “.”  +  base64UrlEncode(payload),  secret)
Node JS
Tags: jwt, mongoose, crud, express
Published: 2021-12-23 15:11:39

## JWT
JWT  means  JSON Web Token. Its used to share secretly information between to parties  client and server.JWT use as a secure way to authentication share user information. JWT mechanism  to verify the owner of JSON.

## How JWT  Token  Work?
JWT token based authentication, and its  stateless. That means the user state is never saved in server memory but  the state is sorted inside the token .  JWT request to other parties.

JWT have of 3 parts .
1.	Header
2.	Payload
3.	Signature 

## JWT Look Likes
Aaaaaaaaaa.bbbbbbbbbbbbb.cccccccccccc
The first part is header and second part is payload and the last part is signature.


## Mongoose
Mongoose  is  a mongodb ODM (object database modeling). Mongoose is a way to make connection  mongodb database. It provide mongodb validation. Its very simple and  it make development first. And it includes  query , validation, and logic hook. 

It work in asynchronous  environment .

**Installation mongoose :** 
npm  install mongoose


## CRUD Operation
Crud  are the four basic operation its create , read, update, delete. The crud operation is refers  to the major operation which are implement by database. It can also describe the user interface  convention that allow searching , modifying  .

**Create** 
The create function allows to user record create in the database. The create function is called INSERT.

**Read** 
The read function is search specific  function  and read there value.

**Update**
The update function is modify existing record that exist in database.

**Delete**
The delete function allows  user to remove record in the database.


## Express of  Node JS
Express js is a back end  web application framework for node js. It’s a free and open source .
It designed for building web application and API.

Following are some of the core feature   of express framework:
•	Respond  HTTP request
•	Allows the middleware
•	Allows to dynamically render to HTML pages.

**Installation command :**
npm  install  express

Example:
const  express= require(“express”);
const  app = express();
User validation with Passport.js and fp-ts
Tags: functional, typescript, passportjs
Published: 2021-12-23 15:10:49

I had a first try on using fp-ts to do user validation with passport.js.

```typescript
import argon2 from "argon2";
import * as E from "fp-ts/lib/Either";
import { flow, pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/lib/Option";
import * as TE from "fp-ts/lib/TaskEither";
import * as passport from "passport";
import * as PassportLocal from "passport-local";
import logger from "./logger";
import {
    UserProfile,
    UserProfileRepository,
} from "../db/entities/user_profile";

const verifyPassport: PassportLocal.VerifyFunction = (
    userName: string,
    password: string,
    done
) => {
    const onUserFound = (optionUser: O.Option<UserProfile>) => {
        const onSome = (user: UserProfile) => () =>
            argon2
                .verify(user.userPassword, password)
                .then((valid) =>
                    valid
                        ? E.right(user)
                        : E.left(new Error(`invalid user name or password`))
                )
                .catch(E.left);
        const onNone = () =>
            TE.left(new Error(`user name ${userName} doesn't exist`));
        return pipe(optionUser, O.match(onNone, onSome));
    };
    pipe(
        userName,
        UserProfileRepository.findOneByUserName /*returns TE.TaskEither<Error, O.Option<UserProfile>> */,
        TE.chain(onUserFound),
        TE.bimap(
            ({ message }) => done(null, false, { message }),
            (user) => done(null, user)
        )
    )();
};

```