teleren/devto huggingface dataset:
Learn react first or backend?
Tags: javascript, webdev, react, beginners
Published: 2022-03-10 06:07:41

So I'm a bit new in webdev. I know JS and little bit of backend (Node and Express). I'm learning MongoDB now. But wherever I go, I see that they React is must. So this made me confused whether I should be full-stack first then learn React or learn React then go to backend. Someone help me please.
How Is Ethereum Similar to Bitcoin?
Tags: blockchain, ethereum, bitcoi, cryptocurrency
Published: 2022-03-10 06:01:59

## **Ethereum Has an Inbuilt Cryptocurrency
**
Ethereum's token is called Ether, shortened to ETH. This is a cryptocurrency that can be traded for other cryptocurrencies or other sovereign currencies, just like BTC. ETH ownership is tracked on the Ethereum blockchain, just like BTC ownership is tracked on Bitcoin's blockchain.

## **Ethereum Has a Blockchain
**
Like Bitcoin, Ethereum has a blockchain, which contains blocks of data (Pure ETH payments as well as smart contracts). The blocks are mined by some participants and distributed to other participants who validate them. You can explore this blockchain on etherscan.io.

Like Bitcoin, Ethereum blocks form a chain by referring to the hash of the previous block.

## **Ethereum is Public and Permissionless
**
Like Bitcoin, the main Ethereum network is a public, permissionless network. Anyone can download or write some software to connect to the network and start creating transactions and smart contracts, validating them, and mining blocks without needing to log in or sign up with any other organisation.

When people talk about Ethereum they usually mean the main public permissionless version of the network. However, like Bitcoin, you can take Ethereum software, modify it slightly, and create private networks that are not connected to the main public network. The private tokens and smart contracts won't be compatible with the public tokens though, just like private Bitcoin networks.

## **Ethereum Has Proof-of-Work (PoW) Mining
**
Like Bitcoin, mining participants create valid blocks by spending electricity to find solutions to a mathematical challenge, called Ethash, works slightly differently from Bitcoin's, and allows more common hardware to be used. It is deliberately designed to reduce the efficiency edge of specialised chips called ASICs, which are common in Bitcoin mining. Commodity hardware is allowed to compete efficiently, and this allows for a greater decentralisation of miners. In practice though, specialised hardware has been created and so most blocks in Ethereum are created by one of a small group of miners.
Integrating CircleCI Pipeline With LambdaTest | CircleCI Tutorial | Part II
Tags: devops, cicd, tutorial, circleci
Published: 2022-03-10 05:49:11

{% youtube X9uIlCcP5Zo %}


Learn “how CircleCI pipeline works” and “how to integrate your CircleCI Pipeline with LambdaTest”
 
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=mar_10&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

In this part of the CircleCI Tutorial for Beginners, you will get to learn how to build a CircleCI pipeline with the help of a demo. You’ll also learn how to run multiple tests in parallel on the LambdaTest Platform.
This video will help answer the following questions 🎫 -: 
🔹What is CircleCI used for?
🔹What is a pipeline in CircleCI?
🔹What are environmental variables in CircleCI
🔹How do I create a pipeline in CircleCI?
🔹How do CircleCI pipeline works?
Binary Search with JavaScript
Tags: javascript, ds, algorithms, programming
Published: 2022-03-10 05:32:00

Binary Search is one of the most intuitive and optimal algorithms for finding an element in a sorted array.

**A quick look at binary search**
1. To implement binary search, the array must be sorted
2. Much Faster than linear search.
3. Has a time complexity of O(logN).
4. Rather than eliminating one element at a time, it can eliminate half of the remaining elements at a time.

**Execution Methodology :**
Binary search algorithm makes use of the "Divide and Conquer" approach.

**Binary Search pseudocode:**
1. This function accepts a sorted array and a value.
2. Create a left pointer at the start of the array, and a right *pointer at the end of the array.
3. 0 index is the left pointer and the end of the array is the right pointer.
4. Pick a middle pointer. Typically, an average of the left and right pointer. If the middle point is a fraction number, we round it up or floor it down.
5. While the left pointer comes before the right pointer:
a) Create a pointer in the middle.
b) If you find the value you want, return the index.
c) If the value is too small, move the left pointer up.
d) If the value is too large, move the right pointer down.

6. If you never find the value, return -1

**Code in JavaScript :**

```
function binarySearch(arr, value) {
  // setting the lest pointer at the start of the array
  let left = 0;
  // setting the left pointer at the end of the array
  let right = arr.length - 1;
  // picking the middle of the array for even and odd number of elements
  let mid = Math.floor((left + right) / 2);
  while (left <= right) {
    //   If the value is too small, move the left pointer up.
    if (arr[mid] < value) {
      left = mid + 1;
      mid = Math.floor((left + right) / 2);
    }
    // If the value is too large, move the right pointer down.
    else if (arr[mid] > value) {
      right = mid - 1;
      mid = Math.floor((left + right) / 2);
    } else {
      return mid;
    }
  }

  // If you never find the value , return -1
  return -1;
}

console.log(binarySearch( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,], 15)); // returns 14

console.log(binarySearch([2,6,25,89,100,110,120,127,150],2)); //returns 0
```
Laravel 9 Resize Image Before Upload Tutorial
Tags: laravel
Published: 2022-03-10 05:46:47

Hello Dev,

This tutorial shows you laravel 9 resize image before upload example. This post will give you simple example of laravel 9 generate thumbnail image. you will learn laravel 9 resize image before upload. In this article, we will implement a laravel 9 image intervention example. Let's get started with resize and upload image in laravel 9.

In this example, we will install the intervention/image composer package. intervention/image provides to resize image using resize() method. we will create a simple form with the input field. you can choose an image and then you will see a preview of the original and thumbnail images.

So, let's follow the below steps to generate a thumbnail image in the laravel 9 application.

[Laravel 9 Resize Image Before Upload Tutorial](https://www.codecheef.org/article/laravel-9-resize-image-before-upload-tutorial)
What Is CircleCI? | Getting Started With CircleCI | CircleCI Orb | CircleCI Tutorial | Part I
Tags: circleci, devops, tutorial, cicd
Published: 2022-03-10 05:45:46

{% youtube 8yyfm8l_G2o %}


CircleCI is a continuous integration and continuous delivery (CI/CD) platform installed inside the private cloud or data center.
 
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=mar_10&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

CircleCI helps you automate the testing and development of a project through a continuous integration and deployment platform. It connects to your GitHub repository, creates a new build when you push code, and sets up an environment for testing whenever you move from one branch to another.

In this part of CircleCI Tutorial for Beginners, Michael Vinny Thanh, a Solutions Engineer
of CircleCI, helps to understand the basics of CircleCI by explaining what is CircleCI and how to get started with CircleCI with a basic demo. You will also get to learn what are CircleCI Orbs and how to write the yml. configuration for your jobs.


This video will help answer the following questions 🎫 -: 
🔹What is CircleCI?
🔹What is CircleCI used for?
🔹What is a CircleCI Orb?
🔹What is CircleCI config .yml?
🔹How do you set up a CircleCI?
記錄:SVG to JPG
Published: 2022-03-10 05:44:50

記錄：SVG to Jpg

這個其實很容易使用到
上網g一下看到一樣是透過Node的去處理

SVG > canvas > png


[參考資料](https://ourcodeworld.com/articles/read/1456/how-to-convert-a-plain-svg-string-or-svg-node-to-an-image-png-or-jpeg-in-the-browser-with-javascript)
NSF to PST converter
Tags: nsftopstconverte, pstconvertertool, tooling, nsftopstconvertertool
Published: 2022-03-10 05:43:28

Weeom [NSF to PST converter](https://www.weeom.com/nsf-to-pst-converter.php) tool is the latest best software that is used in the whole world. It is able to convert multiple NSF files to PST file format in one way without any restrictions. The software is very smooth and quick for converting NSF to PST, EML and MSG file formats. During the converting files, the software does not change its hierarchy.  It supports all the versions of Lotus Notes, IBM Domino server, and Windows Operating System.

 Key Features 

•	It has advanced options like Email translation and folder mapping.
•	It has a PST splitter option to split Resultant PST files.
•	The software provides users to download a free version to explore more. 

Visit for more information : https://www.weeom.com/nsf-to-pst-converter.php
Getting a CSV from internet with Pandas
Tags: python, pandas, computerscience
Published: 2022-03-10 05:33:04

Hi everyone. 
Yesterday, I came across a challenge while I applying my studies od Pandas library.

I usually use CSV files I download to do my analysis, but this time my data was in an online CSV file that was constantly updated by other people. So, at least for me, is pretty boring to have to download every time the file and use it on the code.

So, here I am to show you how I solved this problem and managed to collect the data directly from the internet:

### Case 1: CSV directly from a link

I have gotten this link to download a CSV file from G Drive:
https://drive.google.com/uc?authuser=0&id=1UzlPy6CZQeAzDXhfc_2sHEyK_Jb50vJs&export=download

If you click will download a file of the price of the dollar to Real.
##### Code:

```
import pandas as pd
url from the file you wanna download
#url ='https://drive.google.com/uc?authuser=0&id=1UzlPy6CZQeAzDXhfc_2sHEyK_Jb50vJs&export=download'
#Creating a dataframe to get the file
price_df = pd.read_csv(url)
price_df 
```

Pretty easy ;)

But, sometimes you don't be so easy. You will have to format the file.

---

### Case 2: CSV in a request that needs to be handled

This link is a history of coffee price in Brazil I found on Google:
http://portalweb.cooxupe.com.br:8080/portal/precohistoricocafe_2.jsp

At the end of the page you will see a link to download the file: 
![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmuj9oj4xa1koi9z7msx.png)
If you copy the URL, you will get that link:
http://portalweb.cooxupe.com.br:8080/portal/precohistoricocafe_2.jsp?d-3496238-e=2&6578706f7274=1

Let´s apply the same code:

```
coffe_url = 'http://portalweb.cooxupe.com.br:8080/portal/precohistoricocafe_2.jsp;jsessionid=FDD4F9458CC173838FCDE86C02BF6349?d-3496238-e=2&6578706f7274=1'
coffe_df = pd.read_csv(coffe_url)
coffe_df
```
And... Ops... Doesn't work.
Don't work because that link is not with the format like the other file of GDrive.

To solve that problem, we have to import two libraries:
`Import requests
Import io`

```
import requests
import io

coffe_url = 'http://portalweb.cooxupe.com.br:8080/portal/precohistoricocafe_2.jsp;jsessionid=FDD4F9458CC173838FCDE86C02BF6349?d-3496238-e=2&6578706f7274=1'
# Doing a request from website 
content_url = requests.get(coffe_url).content
file = io.StringIO(content_url.decode('latin1'))
coffe_df = pd.read_csv(file, sep='\t')
coffe_df
```

And now we did it!!!

Notes: I use decode 'latin1', because the file has some special characters.
Note2: the separators of the file aren't a common separator. Is \t for some reason.
Note3: The file download like a text, the library io is to transform to file.
![Text file before convert to file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5j0lihw4wf6p1cqypepc.png)
You also can use the strings methods, but more simple use IO library
A Big Giant of Ecommerce Planned to Add Crypto Payments
Tags: ecommerce, cryptocurren, crypto, cryptopayments
Published: 2022-03-10 05:11:18

The e-commerce giant aspires to evolve the marketplace for Millennials and Gen Z. The rising attractions in crypto, add new payment options to attract the customer base.

Jamie Iannone, CEO of e-commerce marketplace eBay is planning to incorporate crypto payments shortly. 

eBay is among the oldest e-commerce platforms, now glancing to evolve the go-to platform for Gen Z and Millennials. 

eBay CEO a discussion with The Street reports that they are planning to integrate crypto payment, planned to officially announce on upcoming investor’s day on March 10.

Iannone informed that eBay is glimpsing to new payments methods as they are already handling $85 billion on their platform instantly.

**Online marketplace eBay to allow NFT sales**

An envoy said that eBay "will add new credentials that bring blockchain-driven collectibles" to the platform.

eBay has presented auctions for nonfungible tokens, or NFTs, to its platform. eBay users who satisfy specific criteria on the platform will be [permitted](https://www.reuters.com/business/retail-consumer/ebay-taps-into-nft-frenzy-allows-sale-platform-2021-05-11/) to list NFTs. eBay extends its policies and tools wrapping digital collectibles in the future.

eBay will add new credentials that obtain blockchain-driven collectibles to our platform," said eBay's North America senior vice president, Jordan Sweetnam.

The CEO said buyers and sellers can deal in NFTs on eBay but that the platform had not yet facilitated the process. New projects are emerging on NFTs, evolving the crypto space over the past few months. Enabling crypto payments for NFTs marketplace will be an additional benefit for a platform like eBay. 

eBay has rewritten company policies to make a platform that readily provides services for both physical and digital goods with comfort. 
 
The rise in trend and market for cryptocurrencies has driven several online platforms to add crypto payments options. 

eBay emphasis grabbing Millennial and Gen Z customers. Regardless, it won’t be the company’s first try at crypto payments — eBay first tried [integrating](https://www.cnbc.com/2014/01/23/ebay-considering-accepting-bitcoin-as-payment.html) BTC payments in 2014.

Cryptocurrency investment is boosting among global investors. More and more people are interested in cryptocurrency and NFTs. Starting a cryptocurrency-based business like a crypto trading platform would be futuristic. 

Peer-to-peer cryptocurrency exchanges like localbitcoins would be a hassle-free trading platform. One can start a cryptocurrency exchange with a [LocalBitcoins clone](https://www.cryptocurrencyscript.com/localbitcoins-clone-script).
the journey to accessible websites — coming soon
Published: 2022-03-10 05:02:37

![1) learning so many neat things about building accessible websites 2) “how accessible are my projects, anyways?” 3) “lemme just do a quick scan here” 4) 972 total issues; 631 critical issues; 100 serious issues; 207 moderate issues; 34 minor issues 5) *concerned face, slowly putting down the scanning tool*](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zjyh6t1peaoiz15ojty2.png)
Como crear tu primer script en bash
Published: 2022-03-10 04:33:04

Linux es increíble, aun recuerdo la primera vez que vi la terminal no entendía nada, pero poco a poco fui amándola

### Empecemos creando nuestro archivo


Primero me ubicare en mi directorio personal con el siguiente comando

```zsh
cd /home/tathan
```

luego creare un directorio donde guardare todos mis scripts en bash 

```zsh
mkdir scripts
```

seguido ingresare a mi nuevo directorio scripts

```zsh
cd scripts
```

ya teniendo mi directorio de scripts, creare con touch un archivo con el nombre de *hola_mundo.sh* y a su vez lo abriré, para esto utilizare el editor vim

```zsh
touch hola_mundo.sh && vim hola_mundo.sh
```

En la primera línea indicaremos que se comporte como un archivo bash

```bash
#!/bin/bash
```

ya teniendo esto podremos empezar a escribir la lógica de nuestro script, como es nuestro primer script bash vamos hacer algo sencillo como indicar que cuando llamemos a nuestro script nos retorne *Hola mundo, este es mi primer script en bash*, entonces nuestra segunda línea seria

```bash
 echo 'Hola mundo, este es mi primer script en bash' 
```

Guardaremos y nuestro script quedaría de la siguiente manera

```bash
#!/bin/bash
echo 'Hola mundo, este es mi primer script en bash' 
```

ahora para ejecutarlo solo debemos correr el siguiente comando

```bash
sh hola_mundo.sh
```

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

ya hicimos nuestro primer script en bash y lo podemos ejecutar desde nuestra carpeta de scripts pero que sucede si nos salimos de nuestra carpeta y ejecutamos nuestro script?

```zsh
sh: 0: can't open hola_mundo.sh
```

Para poder utilizar nuestro script desde cualquier parte de nuestra maquina tenemos que hacer lo siguiente

- Vamos a copiar nuestro script en la carpeta ```/usr/bin```

```zsh
sudo cp /home/tath4n/scripts/hola_mundo.sh /usr/bin
```

- Luego debemos darle permisos de ejecución a nuestro script

```zsh
sudo chmod o+c /usr/bin/hola_mundo.sh
```

- con esto ya podemos ejecutar nuestro script desde cual quier parte de nuestra maquina


```zsh
cd /home/tath4n/Documents && sh hola_mundo.sh
```

o también lo podemos ejecutar de la siguiente manera

```zsh
hola_mundo.sh
```

para el ejemplo hicimos algo muy sencillo pero se imaginan tener un script para automatizar una tarea muy recurrente que realicemos y que nos tome mucho tiempo, lo ejecutaríamos cuando deseemos y nos ahorraríamos ese tiempo para realizar otras labores.

### Como por ejemplo crear múltiples usuarios

```bash
#!/bin/bash

userfile=/home/tath4n/userlist 
username=$(cat /tmp/userlist | tr 'A-Z'  'a-z')
password=$username@123

for user in $username
do
       useradd $user
       echo $password | passwd --stdin $user
done

echo "$(wc -l /tmp/userlist) usuarios creados" 
tail -n$(wc -l /tmp userlist) /etc/passwd
```

hasta la proxima...
NetBSD basic internet configuration
Tags: netbsd, dhcp, internet, configuration
Published: 2022-03-10 04:23:08

# Summary

In this part i'll show you how to enable NetBSD dhcp daemon for internet connection. Most of the time there is already a dhcp service in your network (your router, virtualbox). So there is no need for manual ip configuration. 

If you need to set manual ip configuration for your network or enabling dhcp daemon did not work for you, please visit this website for more information: [Setting up TCP/IP on NetBSD in practice](https://www.netbsd.org/docs/guide/en/chap-net-practice.html)

--------------------

# Instructions

1- Start and login to your system.

![netbsd-dhcp-001](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/303igshi436peu8slupg.png)

2- Switch to **`root`** user with **`su`** command.

![netbsd-dhcp-002](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqlc9kc7aus2tg77mqft.png)

3-Open **`/etc/rc.conf`** configuration file with **`vi`** program.

![netbsd-dhcp-003](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebr0f5kcmksq0jmcpd5v.png)

4- At the end of the file, add **`dhcpcd=YES`** configuration and save the file.

![netbsd-dhcp-004](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/777csskku80y7ba10ba3.png)

5- Restart your system with **`shutdown -r now`** command.

![netbsd-dhcp-005](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6fengifw52mwt7byxcmb.png)

![netbsd-dhcp-006](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ym9sztfxe1xcuzmwk2m.png)

6- When your system starts again login and try to ping google with command **`ping google.com`** . If you are getting any response, you're connected to internet.

![netbsd-dhcp-007](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zl9d9tff0y0a1uvdf06o.png)
Quick and Dirty ERB Conditionally Rendering 🤭
Tags: 100wordsaday, inkedin, ruby, rails
Published: 2022-03-10 03:39:45

>**Note: We are using this `if` statement within a `form_for` or a `form_with`, Rails Form builders.**

- While working on one of my project, I needed to show a link to edit or delete a resource or objects only if they belong to the user that created that object. So I Know about if statement and unless method, But I do not need to render and else part of the statement, just the if.  

```ruby
	<% if tag.user == current_user %>
			<%= link_to 'Edit', edit_tag_path(tag), method: :get %>
			<%= link_to 'Delete', tag_path(tag), method: :delete, data: { confirm: 'Are you sure?' } %> <br>
	<% end %>
```

**This is not even a do block, this block of code will only run if the condition set inside the  `if` is true**

- So basically if the user that created the tag is equal to the `current_user` currently log in them, it will render this links into the view.

**Another shorter way to do this would be just passing an `if` at the end of the `link_to` block.**

```ruby 
			<%= link_to 'Edit', edit_tag_path(tag), method: :get, if tag.user == current_user %>
			# This link_to would only render if the IF Statement is true else It would not Render.
			
```

>**Note: Ruby would read the view or any file from the top to bottom. This mean that if something evaluate to false like this it would be skipped and not rendered and the next action or block after this one would run.**

> - **NOTE: This is one of 30 blogs that I would be attempting to write over the next 30 days to improve my writing skills.**
Snippet... Working with CSV in Javascript with PapaParse
Tags: javascript, papapars, csv, apps4developers
Published: 2022-03-10 03:33:41

**https://www.apps4developers.com/csv/**

## Installing `papaparse`

Install PapaParse library from [npm](https://www.npmjs.com/package/papaparse).

```shell
npm install papaparse
```

Learn more about PapaParse [here](https://www.papaparse.com/docs).


### CSV to JSON With Header

```javascript
import Papa from 'papaparse';

const csvString = `Column 1,Column 2,Column 3,Column 4
1-1,1-2,1-3,1-4
2-1,2-2,2-3,2-4
3-1,3-2,3-3,3-4
4,5,6,7`;
const jsonObj = Papa.parse(csvString, { header: true })

console.log(jsonObj);
```

### CSV to JSON Without Header

```javascript
import Papa from 'papaparse';

const csvString = `1-1,1-2,1-3,1-4
2-1,2-2,2-3,2-4
3-1,3-2,3-3,3-4
4,5,6,7`;
const jsonObj = Papa.parse(csvString, { header: false })

console.log(jsonObj);
```


### Convert JSON to CSV


```javascript
import Papa from 'papaparse';

const jsonObj = [
	{
	    "Column 1": "1-1",
	    "Column 2": "1-2",
	    "Column 3": "1-3",
	    "Column 4": "1-4"
	},
	{
	    "Column 1": "2-1",
	    "Column 2": "2-2",
	    "Column 3": "2-3",
	    "Column 4": "2-4"
	},
	{
	    "Column 1": "3-1",
	    "Column 2": "3-2",
	    "Column 3": "3-3",
	    "Column 4": "3-4"
	},
	{
	    "Column 1": 4,
	    "Column 2": 5,
	    "Column 3": 6,
	    "Column 4": 7
	}
];
const csvString = Papa.unparse(jsonObj, { header: false })

console.log(csvString);
```