teleren/devto huggingface dataset:
Web 3.0 Day 1
Published: 2022-03-01 06:07:21

**Introduction To Blockchain**
**what is Blockchain**
Basically there are n no of blocks and all of them are connected with each other

**Actual Definition** : A blockchain is a distributed immutable ledger (ledger : a place where transaction information is recorded and the information is immutable and cannot be changed once it is recorded)

Each block of a blockchain contains some data , hash of that block and hash of it's previous block. Data stored in block depends on blockchain.
The first block of any blockchain is called a Genesis block.



**why blockchain is distributed ?** Blockchain is actually distributed all over the network every node/computer of network has the copy of that blockchain



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

**how the distribution of immutable ledgers takes place**
Now consider host 'A' as a miner ( A person who mines a particular block and creates a particular block )
Now A mines a block and added that block to the existing blockchain, once he has completed then he transfer the information of block chain to all the nodes/hosts which are connected to same network after verifying and validating the newly added block all other hosts also include that newly added block to their blockchain.

For instance, Wikipedia is a type of blockchain. The data on Wikipedia is not written by a single person. The information is added and written by various users across different locations and the information added on the Wikipedia page is verified by all the writers of that particular page and then it is validated and added to the page.

**1. blockchain cannot be corrupted**
Each block in the blockchain is linked to the previous block by storing the cryptographic hash function of the parent block. Hence if there is data tamper in any block, there will be a change in the hash in all the subsequent blocks. This way, any user will easily identify tampering at any point of the ledger without having to check each and every block. If anyone wants to tamper with the blockchain data then one would have to make changes in all the other blocks as well without being noticed. This way, blockchain cannot be corrupted.

**2. blockchain is decentralized**
Blockchain is designed in a way that it is distributed and synchronized across networks. This way it is not centrally governed or operated by any single organization. It can be run by a group of users privately connected through LAN or run across with thousands of users over the internet. Every user is informed about the creation of new blocks in the ledger.

**3. Blockchain works on consensus**
To execute any transaction or add information to the blockchain, it is necessary to have validation from all other nodes and after the agreement of all, the new block is added or the transaction is completed. There may be millions of nodes and they might not trust each other, but they trust the algorithms of the system. It works like a voting system. With the ‘consensus’ system, there are no chances of frauds and it helps keep the data most accurate
In Soviet Russia, Namecheap register you
Tags: post, freedom, selfhosting
Published: 2022-03-01 16:58:44

---
title: In Soviet Russia, Namecheap register you
published: true
date: 2022-03-01 06:02:24 UTC
tags: post,freedom,selfhosting
canonical_url: https://bowtiedaztec.com/posts/in-soviet-russia-namecheap-register-you/
---

<p>I was doing a little evening reading in my Mexico City apartment when I stumbled onto this <a href="https://news.ycombinator.com/item?id=30504812">post</a> on hacker news:</p> <blockquote> <p>Dear XXXX,</p> <p>Unfortunately, due to the Russian regime's war crimes and human rights violations in Ukraine, we will no longer be providing services to users registered in Russia. While we sympathize that this war may not affect your own views or opinion on the matter, the fact is, your authoritarian government is committing human rights abuses and engaging in war crimes so this is a policy decision we have made and will stand by.</p> <p>If you hold any top-level domains with us, we ask that you transfer them to another provider by March 6, 2022.</p> <p>Additionally, and with immediate effect, you will no longer be able to use Namecheap Hosting, EasyWP, and Private Email with a domain provided by another registrar in zones .ru, .xn--p1ai (рф), .by, .xn--90ais (бел), and .su. All websites will resolve to 403 Forbidden, however, you can contact us to assist you with your transfer to another provider.</p> <p>Customer Support, Namecheap</p> </blockquote> <p>I think most people can agree that what Russia is doing is terrible, but that's not the point. And clearly so, since this action will have absolutely no impact aside from annoying people who very likely had nothing to do with the invasion (and, per some of the comments in that HN thread, may in fact be using their sites to oppose Russian policy.)</p> <p>So allow me condense and rephrase Namecheap's statement to make it clearer:</p> <blockquote> <p>Must virtue signal. No internet for you.</p> </blockquote> <p>I'm not going to spend any more time bashing Namecheap, if only because a) they don't really matter, and b) <strong>they're not alone</strong>. How many examples have we seen now of centralized (dare I say &quot;legacy&quot;?) tech companies banning something because it crosses their delicate Silicon Valley sensibilities?</p> <p>One more reason to take an inventory of the services you use every day and think about how you would respond if they ever did something like this to you. Do you make your living from....</p> <p>Youtube? Centralized.</p> <p>Instagram? Centralized.</p> <p>Twitter? GTFOH.</p> <p>Hell, even Substack is centralized. And yeah, they say all the right things about respecting free speech, but so did Twitter. Anyone else remember &quot;the free speech wing of the free speech party?&quot;</p> <p>Now's the time to take control of your destiny again and host your own shit. I can help, more posts to come in the near future.</p>
What is React-Redux ?
Tags: react, javascript, webdev, beginners
Published: 2022-03-01 05:45:59

## Predictable state container

- **Redux** is a predictable state container for **JavaScript** apps
- Helps you write apps that behaves consistently, run in different environments, and are easy to test.
- Offers live code editing combined with a time traveling debugger.
- Can be use with **React**, **angular** , or any  other view library.
- Redux is tiny(roughly 2kb), but has a large ecosystem of addons available.

## Central store

- With **Redux**, application state is kept in a store, from which
any component can access any state it needs
- State is kept in a single place, improving predictability and
traceability
- In **React**, for example, state has to live in the parent
component to share data among siblings
- And so, sharing state between components that are far away
from each other is hard state will have to be lifted until a
common ancestor is found
- **Redux** solves this issue by providing a central store holding
the entire application state

## Features of Redux

- Predictable - Redux helps you write apps that behave
consistently
- Centralized application state and logic enables powerful
capabilities, such as undo/redo, state persistence, etc.
- Debuggable - Redux DevTools make it easy to trace state,
changes
- Time-travel debugging is also possible
- Flexible - Redux works with any UI layer

##### Want to check example ? [click here](https://dev.to/shubhamathawane/react-redux-how-its-works--13g6)
Getting Started with the Blazor ProgressBar Component
Tags: blazor, webdev, csharp, dotnet
Published: 2022-03-01 05:37:13

Learn how to get started with the Syncfusion [ProgressBar ](https://www.syncfusion.com/blazor-components/blazor-progressbar)component in a Blazor WebAssembly application. You will also learn how to configure a few of its basic features, like different types, states, ranges, and other customizations.

Product Overview: https://www.syncfusion.com/blazor-components/blazor-progressbar

Download an example from GitHub: https://github.com/SyncfusionExamples

Refer to the following documentation to learn about the Blazor ProgressBar component: https://blazor.syncfusion.com/document

Check out this online example of the Blazor ProgressBar component: https://blazor.syncfusion.com/demos

{% youtube Kf04zbPJmHM %}
Top Seven Reason for using Redux toolkit
Tags: redux, javascript, programming, react
Published: 2022-03-01 05:34:16

**Reason for using Redux toolkit:**
1. A lot lesser boilerplate code is required compared to Redux.

2. Redux hooks like useSelector and useDispatch make things so short and easy to use.

3. We don't need to do manual thunk setup as redux-toolkit comes with out of the box createAsyncThunk which enables we to perform async operations in very hastle free way.

4. getState is also very helpful in obtaining state variables across any of your actions or async operations.

5. Mutability might be considered as advantage or disadvantage, but if you're not too used to writing with spread operators, you might love this feature as well. Do straight assignments and let redux toolkit take care of mutability under the hoods.

6. current can be used to log your state anywhere in case you want to debug and understand where things are going wrong. (Ofcourse, Redux debugger tools are great as well)

7. Prebuilt templates you might want to use npx create-react-app my-app --template redux-typescript or if you're using it with next: yarn create next-app --example with-redux with-redux-app. It gives you a setup ready redux toolkit boiler plate and also contains a boiler plate of most important redux state management applications so that you could refer them to create your own slices very easily.

I have been using a lot of redux and initially it was a bit confusing but once you get a good command over redux toolkit and if you're using a lot of functional components, you probably would never go back to redux again.
Queue Data Structure.
Tags: programming, beginners, tutorial, datastructures
Published: 2022-03-01 05:26:03

Queue follows the FIFO approach, i.e first in first out approach. This is similar to a queue in the banking hall where the first customer in the queue is the first one to be served.

## Queue Operations.

- Enqueue - Adding elements to the end of the queue.
- Dequeue - Removing elements from the Front of the queue.
- Peek - Returning the element in Front of the Queue without removing it.
- isEmpty - Check if the Queue is empty.
- isFull - Check if the Queue is Full.


## Enqueue Operation

- Sent FRONT AND REAR pointer to track first and last elements.
- check if the queue is full using `isFull`.
- Set the FRONT pointer to 0 for the first element.
- Increase the REAR pointer by 1.
- Point the REAR index to the new element. 

## Dequeue Operations.

- Use the `isEmpty` operation to check if the queue is empty.
- Remove the element pointed by the FRONT index.
- Whenever an element is removed from the FRONT index should increase by 1.
- When removing the last element from the queue reset the FRONT and REAR pointer to -1.

## Queue Implementation Using an Array.

```
class Queue:
    
    def __init__(self):
        self.queue = []
        
    def enqueue(self, item):
        return self.queue.append(item)
        
    def dequeue(self):
        if len(self.queue) < 1:
            return None
        return self.queue.pop()
        
    def size(self):
        return len(self.queue)
        
    def display(self):
        return (self.queue)
        
        
q = Queue()

q.enqueue(10)
q.enqueue(20)
q.enqueue(30)
q.enqueue(40)


print(q.display())
```

When using an array to implement the queue data structure, the complexity of the enqueue and dequeue operations is` O(1)`.

## Applications of the Queue Data Structure.

- Handling Interrupts in real-time systems.

- Used in the call center to hold people calling in an order.

- Handling Interrupts in real-time systems.

- Scheduling tasks in CPUs and Disks.


[Isaac Tonyloi](https://www.linkedin.com/in/isaactonyloi/)
My First Post
Published: 2022-03-01 05:16:18

Hello everyone,

I am starting this blog post to share my everyday learning and knowledge. I hope to gain new experiences and learn some cool stuff from here. I am brushing up on my **JS** and **React** skills by creating new projects. I am also aiming to learn Full Stack technologies. 

I am always ready to collaborate with developers and create something new to help solve real life issues. *Feel free to message me, share interesting info, checkout my work and keep supporting/ motivating.*

**My links:**
* [Website](https://www.devsoni.com) 
* [GitHub](https://www.github.com/developer-soni)
* [CodePen](https://codepen.io/developer-soni)
* [LinkedIn](https://www.linkedin.com/in/developer-soni)
* [YouTube](https://www.youtube.com/c/DevSoni1999)
Laravel 9 Ajax Image Upload with Preview Example
Tags: laravel
Published: 2022-03-01 05:16:08

Hi Dev,

This article goes in detail on laravel 9 ajax image upload. you will learn laravel 9 ajax image upload with validation tutorial. This tutorial will give you a simple example of how to upload image using ajax in laravel 9. We will look at an example of jquery ajax image upload laravel 9. So, let's follow a few steps to create an example of laravel 9 ajax post image upload.

In this example, we will create "images" table with a name column. Then we will create a form with file input, when you submit it will send the image via jquery ajax request and store the image into the folder and database.

So, let's see simple example and follow below steps:

[Laravel 9 Ajax Image Upload with Preview Example](https://www.codecheef.org/article/laravel-9-ajax-image-upload-with-preview-example)
I'll start a new JavaScript coding channel. First live stream this Thursday.
Published: 2022-03-01 04:58:07

Hello dev.to community,

I just want to announce that I decided to start a #javascript Youtube channel:

https://www.youtube.com/channel/UCGpMFLPZNWbxtkJ4R8R6j7Q

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

I plan to teach JavaScript to absolute beginners through a series of an interactive live streams.

First live stream: Thursday, March 3rd, 2022.

If you're interested in coding - please join this first stream and send me your feedback.
Is Node.js is good choice for encryption and decryption ?
Tags: javascript, node, programming, discuss
Published: 2022-03-01 04:46:49

Hello world,

Nodejs is the go to option for me while developing several projects.

But, is node.js will be good option for the projects which are built around CPU intensive tasks like 

```bash 

1. Public Key Encryption and Decryption 
2. Asymmetric cryptography

```

?
TypeError in Next.js
Tags: typescript, nextjs, react
Published: 2022-03-01 04:26:52

EveryOne. I am looking for Senior Next.js Developer. I encountered the following problem during development and I am trying to solve it.
Since the exact cause is unknown, the problem has not been resolved. I want to get help from developers with long experience. Please let me know.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t6sjfbah8rn9vbqy7o3a.png)
Make an HTTP GET request in Go
Tags: go, webdev, beginners, tutorial
Published: 2022-03-01 04:15:00

We’ll explore how to make an HTTP GET request in Go. We will fetch the JSON content from an API endpoint and display the results on the console.

Create a new folder called `http-request`.

```bash
mkdir http-request

cd http-request

touch main.go
```

Open the `main.go` and import the necessary packages.

```go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)
```

Make the HTTP request to `https://jsonplaceholder.cypress.io/todos/11`

```go
func main() {
	resp, err := http.Get("https://jsonplaceholder.cypress.io/todos/11")
	if err != nil {
		print(err)
	}

	defer resp.Body.Close()
}
```

Create a struct that models the data received from the API.

```go
type PostResponse struct {
	UserId    int    `json:"userId"`
	Id        int    `json:"id"`
	Title     string `json:"title"`
	Completed bool   `json:"completed"`
}

func main() {
    ...
}
```

Let's decode the JSON response using `json.NewDecoder` function that takes in the response body and a decode function that takes in a variable of type `PostResponse`.

```go
var post PostResponse

if err := json.NewDecoder(resp.Body).Decode(&post); err != nil {
	print(err)
}

fmt.Printf("UserId: %v\n", post.UserId)
fmt.Printf("Id: %v\n", post.Id)
fmt.Printf("Title: %v\n", post.Title)
fmt.Printf("Completed: %v\n", post.Completed)
```

Here is the complete working code.

```go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

type PostResponse struct {
	UserId    int    `json:"userId"`
	Id        int    `json:"id"`
	Title     string `json:"title"`
	Completed bool   `json:"completed"`
}

func main() {
    // Make the http request
	resp, err := http.Get("https://jsonplaceholder.cypress.io/todos/11")
	if err != nil {
		print(err)
	}

    // Close the body
	defer resp.Body.Close()

	var post PostResponse

    // Decode the JSON response
	if err := json.NewDecoder(resp.Body).Decode(&post); err != nil {
		print(err)
	}

    // Print the result on the console
	fmt.Printf("UserId: %v\n", post.UserId)
	fmt.Printf("Id: %v\n", post.Id)
	fmt.Printf("Title: %v\n", post.Title)
	fmt.Printf("Completed: %v\n", post.Completed)
}
```

I hope you found this article insightful.

**Let's connect** 🌎
- My blog [kirandev.com](https://www.kirandev.com/)
- Follow me on [Twitter](https://twitter.com/tokirankrishnan)
- Find me on [Github](https://github.com/devkiran)
[Question] Naming convention for "Class" model
Tags: php, newbie
Published: 2022-03-01 04:05:53

Well, i'm having a hard time to define class name for model "Class". In PHP we can't define like this:
```
class Class {
    //function
}
```
As i learned that model naming is singular nouns.
Does anyone have any good suggestions for this case?
Thank you very much.
First Vue.js Program on Macbook M1
Tags: vue, macbook, node, codewitharjun
Published: 2022-03-01 03:57:17

Before creating Vue.js app you got to make sure that you have properly installed node and npm installed into your system. 

Once you install node and npm you can create the vue.js app in the following way. 

Check out this youtube video for the full description .

{% youtube oxToe-4c6OM %}
SQL-Quick tip #2 - Randomize rows
Tags: tsql, sqlserver, sql, mssql
Published: 2022-03-01 03:50:06

## Sql Server tips and tricks

This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

### Randomize rows

Sometimes you want the returned rows of your query to be randomized. That could be when generating test data. 
The trick is to use `ORDER BY NEWID()`. The `NEWID()` function will generate a new random guid for each row and when sorted the rows will be randomized.
This is not something you should put into your production code unless you have no other way of randomizing you rows, because Sql Server has no way of optimizing this kind of query so if the trick is used on a large table it will take time and computing resources.
```sql
DECLARE @names TABLE ([Name] VARCHAR(50))

INSERT INTO @names (Name) 
VALUES ('Joe'), ('Bob'), ('Anne'), ('Jane')

SELECT Name
  FROM @names
 ORDER BY NEWID() -- By ordering by NEWID() the rows will be randomized
```

![Sql Server Management Studio screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t44oscievp73d909sny4.png)
Add a Local Git Repository to GitHub
Tags: github, gitcli, git
Published: 2022-03-01 03:31:56


You’ve created a project on your local machine, you’ve initialized it as a git repository, and you’re coding along happily.

Now you’ve decided that you’d like to save a copy on [GitHub](http://github.com). Maybe so that you can collaborate with others more easily? Maybe just so that you can save it remotely? Whatever the reason, how do you do it?

It’s easy!

1. Create a blank [GitHub](http://github.com) repository like you normally would by clicking one of the “New” buttons you can find in various places on the website after you’ve signed in.
    
    ![screenshot of new repo button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ix9mbnpp2pitnrzurvlm.png)
    
2. Give your repository a name that makes sense for your project, write a description if you want, and to avoid merge conflicts, leave “Add a README file” and “Add .gitignore” *unchecked* for now. It’s probably better to just create those on your own at this point if they don’t already exist for your project. Then click on “Create repository” at the bottom of the form.
    
    ![screenshot of create new repo form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6sgv0v4mjxogp5m1pucd.png)
    
3. The best part! [GitHub](http://github.com) already has instructions here for you on *exactly* what to do next on your terminal command line! In fact, although we didn’t cover it here, there are even instructions on what to do if you don’t even have a repository at all and how to create one right now if you had not already done so.
    
    ![screenshot of repo quick setup page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7f0c29g57h27dwy1v70t.png)
    
    So let’s go ahead and use the URL that is provided by GitHub (as you can see in the screenshot) for your new online repository and run those three lines in the terminal from the root directory of your local repository. They’ve made it so easy that you don’t even have to plug in the URL; you can simply copy and paste it. So in my case, it would look like this with the URL for the repo I’ve just made:
    
    ```bash
    git remote add origin https://github.com/clendon/practice-repo.git
    git branch -M master
    git push -u origin master
    ```
    

If during step 3, you get the error `fatal: remote origin already exists.`, it’s because your local repository is already associated with a different online repository, but we can remove that association and fix it easily. Do the following:

```bash
git remote remove origin
```

And then attempt step 3 again and that should do the trick.

And there you go, should now be able to `push` and `pull` from/to your remote repository on [GitHub](http://github.com).
PDF OCR Text Extraction
Published: 2022-03-01 03:30:18

---
canonical_url: https://ironsoftware.com/csharp/ocr/examples/csharp-pdf-ocr/
---

Iron Tesseract can read many image formats, and also PDF documents. This feature is not possible with conventional free Tesseract engines.

OcrInput offers the option for PDF characteristics to be automatically corrected if scans are bad quality.

Developers may specify to read and entire PDF, a selection of pages or a single crop area.


**C#:**
```
using IronOcr;
 
var Ocr = new IronTesseract();
 
 
using (var Input = new OcrInput())
{
    // OCR entire document
    Input.AddPdf("example.pdf", "password");
 
    // Alternatively OCR selected page numbers
    Input.AddPdfPages("example.pdf", new[] { 1, 2, 3 }, "password");
 
    var Result = Ocr.Read(Input);
    Console.WriteLine(Result.Text);
}
```

**VB:**
```
Imports IronOcr
 
Private Ocr = New IronTesseract()
 
 
Using Input = New OcrInput()
	' OCR entire document
	Input.AddPdf("example.pdf", "password")
 
	' Alternatively OCR selected page numbers
	Input.AddPdfPages("example.pdf", { 1, 2, 3 }, "password")
 
	Dim Result = Ocr.Read(Input)
	Console.WriteLine(Result.Text)
End Using
```