teleren/devto huggingface dataset:
Create IMG file by a url link - Python
Tags: python, tutorial, computerscience
Published: 2022-03-06 20:05:28

Hey ! In this post, I'll show you how to create an IMG file, like a png or jpg file, with a url link in Python. Even if it seems difficult, it isn't !

## <u>The import :</u>
Yeah for sure, we must to import a package that will scrap informations from the img link you want. And this package is : **_[requests](https://docs.python-requests.org/en/latest/)_**

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

<u>So, let's go :</u>

1) First open a new terminal and run the command :
```
pip install requests
```
If it's not already installed.

2) Now create a new file, with the name you want and the `.py`
 extension.


## <u>The script :</u>

```python
import requests, os
url = "https://mywebsite.com/image.png"
with open("myIMG.png", "wb") as img_file:
    img = requests.get(url)
    img_file.write(img.content)
```
So as you see, the script is 5 lines long. It's nothing !

First we import the package we installed before and the os package to open files.
Then, we open the file `myIMG.jpg` in <u>write byte</u> mode, and store it in img_file variable. _The name and the extension of the img file can be modify for sure._

Inside the 'with', we make a request that get the content of the page from the url `https://mywebsite.com/image.png`. And after that, we simply write the content of this request in the file with the write method.

## <u>Summary :</u>

As you see, to scrap an image and 'download' it by a python script isn't difficult. You just need of a package and a file where you write the content of the image you scraped.

If you want to know more about the requests package, check this out : <u>https://docs.python-requests.org/en/latest/</u>

So nice to see you ! And see you in the next post. Bye bye 👋👨‍💻
Introduction to React.js
Tags: react, beginners, javascript
Published: 2022-03-06 19:50:02

This article covers a brief introduction to the React library as I dive more into it in the coming weeks.
This is part of my #100DaysofCode challenge

**React** is a JavaScript library which builds user interfaces. Mostly used and run by Facebook.

## Features of React
**JSX**
This is JavaScript XML. It is JavaScript syntax extension which combines JavaScript and XML language.

**Virtual Document Object Model (DOM)**
React library generates an in-memory data structure cache which computes changes then updates the browser. Any corrections made, are compared it to its previous state and only updates objects in the real DOM instead of updating all of the objects.

**Components**
React is made up of several building blocks with their own distinct functions. 

**One-way Data Binding**
The data flow is in one direction, done by Flux. The callback of components is done after they are edited. This is as the data in the components is immutable (cannot be changed). 

## Advantages of React?

- It is straightforward making it easy to learn and use
- It utilizes Native approach-reusable code supported throughout Android, IOS and Web applications

## Disadvantages of React

- It is a library and not a complete framework-makes it less useful as it depends on external libraries
- It is relatively new and is constantly changing and updating which maybe a hassle to some.
Women in Tech
Tags: womenintech
Published: 2022-03-06 19:49:47

With International Women's Day coming up there's a lot of talk about women in tech. [dev.to has a hashtag for it.](https://dev.to/t/shecoded) I felt like I should write something, being a woman and in tech.

I saw something years ago to do with women and at the end of the list was "if you consider yourself a minority then you count". It was supposed to be all-encompassing but I found it limiting because I don't consider myself to be a minority.

Let's jump back a bit.

At university I did physics. Most of the students in physics lectures were men. Most of the lecturers were men. I don't think I knew there was a woman in the department at all until my second year.

The clubs and societies I joined had members that were mostly men. I ended up with most of my friends being men. I never felt like a minority. I was just one person in a group of people.

Where I work it's mostly men doing development. I don't feel like a minority there either. No one treats anyone differently for being a woman. Or being a man. (Or if they are I haven't noticed)

In summary, if you are a minority in tech - whether you consider yourself to be or not - don't worry, it doesn't matter. And if you find it does matter, you've surrounded yourself with the wrong group of people and need to find a different group.
GitLab e SSH key eklemek
Published: 2022-03-06 19:41:00

> Host key verification failed.
> fatal: Could not read from remote repository.
> Please make sure you have the correct access rights
> and the repository exists.


Gitlab'de kayıtlı key yokken, SSH key kullanarak repository'i klonlamak istediğimizde üstteki hatayı alırız. 

Amaç: Bilgisayarımızda bir karmaşık bir anahtar oluşturmak ve bu anahtarı Gitlab'e kaydetmek. Sonrasında editörümüzün (Webtorm/Visual Studio Code...) bu anahtarı kullanarak (kullanıcı adı - parola sormadan) gitlab ile iletişim kurması. 

**SSH Key Nedir?**

SSH Secured Shell'in kısaltmasıdır. Daha detaylı bilgi için: https://www.hostinger.web.tr/rehberler/ssh-nedir

**GitLab'e nasıl entegre edilir?**

1. Terminale aşağıdaki komutu yazın:

```
ssh-keygen
```

```
Enter file in which to save the key
```
Key'i nereye kaydetmek istediğimizi soracak. Bir dosya adı yazın veya enter'a basın.

```
Enter passphrase (empty for no passphrase):
```
Eğer birisi bilgisayarınıza erişirse, SSH key kullandığınız her sisteme de ulaşabilir. Bu sebeple, extra güvenlik adımı için, isterseniz SSH key'lerinize de bir parola belirleyebilirsiniz. 

dosya belirtmediğimiz için alttaki directory'e key eklendi.
cd /Users/username/.ssh (kendi username'iniz ile)

ls -a ile dosyalara bak


cat id_rsa.pub

"cat [dosya-adi]" komutunun amacı belirtilen dosyayı metin olarak dökmektir. Bu komutu kullanarak is_rsa.pub dosyasının içindeki key'i terminal'e yazdırırız. 

Çıkan sonucu kopyalayıp, GitLab daki SSH key alanına kaydedin.
#66 Days of Data
Tags: python, datascience, 100daysofcode, ankitgupta
Published: 2022-03-06 19:28:36

> **Writing my 1st Dev post with starting learning Python** 👨‍💻

D 21 | 22 of #66daysofdata 📈

Today done with Python basics - Features Applications, Python 2 vs Python 3, Libraries uses, Interpreter Prompt, Script mode programming, IDE Features, Compiler vs Interpreter✌️

I'll be glad to connect & learn with like goal centric people on 👇

**Github** @ [MrAnkitGupta](https://github.com/mrankitgupta)

**Twitter** @ [Mr_AnkitGupta01](https://twitter.com/Mr_AnkitGupta01)
Hacktoberfest Swags
Tags: github, hacktoberfest, opensource
Published: 2022-03-06 19:25:50

Hey there !!

I am excited to share that I have received the Hacktoberfest 2021 swags. Marking the beginning of my open source journey.

Thanks to DigitalOcean, Appwrite, Intel Corporation, GitHub, Hacktoberfest & DeepSource for organising such an amazing event.

Connect with me on:- https://linktr.ee/iarchitgupta


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/15ikl64lr8lr8l156utu.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jn63w7vpmbzkry4yzvpk.jpg)
ES2022 Features
Tags: javascript, webdev, news, node
Published: 2022-03-06 18:57:46

Javascript keeps on evolving and the new syntaxes has been followed in ES2022. Some of them are 👇

**1) Private Class fields**

In olders ways we can make a class variable as private. We use the # to determine that it is private.

`class Hello {
	name = "Dhanush",
	#work ="Engineer"
}`

`console.log(Hello.name) // Prints "Dhanush"
console.log(Hello.#work) // Cannot be read from outside`

**2) Top Level Await**
 
 We can do a await call directly in a javascript file, without defining an asynchronous function
 
` await db.collection();`
 
 Previously
 
` async function result(){
	await db.collection();
 }`
 ` await result()`

 Top level await works only when the script type is module
 
**3) Accessing arrays**

The at method for accessing array elements, which also helps to access elements from the last by providing negative indices

`const array = [1,2,3,4,5]

array.at(2) // 2
array.at(-1) // 5`

**4) Object.hasOwn**

Used to find whether the property exists in an object

Syntax: `Object.hasOwn(<object>, <object_property>)`

**5) Regex Indices**

 New feature in regex which adds a d flag in regex expression
 
In the output you would get an array of indices, which contains the starting point to the ending point of where the keyword is found in the regular expression match.

Any inputs or additions feel free to add below 👇

For more insights & tech  lets stay connected via [Twitter](https://twitter.com/Dhanush_Nehru)
5g and 6g applications
Tags: 5g, 6g
Published: 2022-03-06 18:41:36

Contributing to a book on chapter  - 5g and 6g applications.

Applications which existed in 4g will become 10 times faster in 5g and  100 faster in 6g in terms of handling uploads and downloads. The key reason is the communication infrastructure which is going to change in the internet backbone. The devices will be upgraded to 5g and 6g soon. In some of the countries it is happening now. This will change how the locational intelligence and real time streaming applications perform and how they are being used.  Roadside traffic and wealth management applications will have new use cases as features.  The other AI applications related to NLP, NLU, Clustering, Supervised and Unsupervised learning ML algorithms will work in real time by using the historic data available on the cloud. Scalability and reliability of the AI applications and solutions will improve with 5g and 6g implementations. Conversational AI solutions which helped to automate customer service will work more efficiently and substituting human for monotonous and frequently asked queries.
How to Create Responsive Landing Pages with FREE Tailwind Components
Tags: webcomponents, uiweekly, webdev, design
Published: 2022-03-06 18:41:01

Now you can easily create beautiful responsive landing pages, product pages, contact pages & more in just 5 minutes.

Recently, I got to know about Tailwind CSS. It's a highly customizable low-level CSS framework that can help you to create beautiful websites quickly and easily, according to them.

They have a ready to use block building tool named TailBlocks and this article is all about it.

## How to use
To use TailBlocks first, you have to add the Tailwind CSS file to your Html code. Or you can add their CDN build.

### Step 1:
Add this code to your HTML.
```
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
```
Or, go to this page for all links: [tailwindcss.com/docs/installation](https://tailwindcss.com/docs/installation)

### Step 2:
Go to [tailblocks.cc](https://tailblocks.cc) and choose a block.

### Step 3:
Click on the View Code button and copy the code of that block.

Then, paste the code inside `<body>` tag.

To add another block, do the same procedure again.

{ [View Demo](https://codepen.io/knyttneve/full/ZEbQepZ) }

## Video Tutorial
After watching this video, you can easily create & deploy beautiful websites for 100% free of cost.

{% embed https://www.youtube.com/watch?v=BQqzZ5HTW-Q %}

## Best Themes & Web Components
Here are some of the best themes & web components you can also consider if you're building commercial websites & web applications.

- [Elemento UI Kit (3000+ UI Components)](https://bit.ly/3vIqVGZ)
- [Aveit - Professional Business Landing Page](https://bit.ly/3ts0L8E)
- [SAAS Landing Page with 98+ Demos](https://bit.ly/3HTyuNO)

## Disclaimer:
This technique can never replace traditional web development. But, if you know HTML, CSS very well, you can use Tailblocks to deploy your/your client's sites quickly and easily.
How to become a Blockchain Developer ?
Tags: javascript, blockchain, beginners, react
Published: 2022-03-06 18:40:23

### 


## Who is a Blockchain Developer ?

blockchain developer is a developer that takes care of optimizing and developing blockchain-related dApps, smart contracts, protocols, and architecture.

It is a responsible position which requires attention to detail, knowledge, and ability to overcome challenges.

## Types of Blockchain Developers

### Core Blockchain Developers

- The core blockchain developers are responsible for architecture development.

### Blockchain Software Developer

- Blockchain Software Developer works differently. His role is to develop and implement the blockchain using the designs created by the core blockchain developers.

## Technical Skills Required

- Understanding blockchain architecture
- Data Structures
- Smart contract development
- Basic understanding of cryptography

## How to become a Blockchain developer ?

Finally , let’s dive into the **steps to become a blockchain developer.**

## Step 1: Learn basics

- Learn about what is decentralization, the use of consensus, also dive deep into cryptography. L
- Lastly, you should learn about the blockchain ecosystem.
    - Enterprise blockchain platforms
    - Blockchain as a Service(BaaS) such as Hyperledger, quorum, Corda and Ethereum Enterprise
    - Learn about popular dApps.

## Step 2: Learn how the blockchain process works.

- With basics complete, now you need to get familiar with **real-world implementation.**
- To get started, start by working through **basic cryptocurrency,** you will be able to appreciate what blockchain has to offer.
- Remember, **cryptocurrency is just one use-case of blockchain**. It is the first use-case of blockchain.
- By going through the whole process, you can **understand how cryptocurrency**, one of the most significant use-cases of blockchain works.

## Step 3: Start coding - Learn from blockchain tutorials

it is now time to dive deep into coding.

For beginners, I would learning Solidity. It will help you create and developer dApps and smart contracts on Ethereum blockchain.  

- Create a simple block
- Create a blockchain out of it
- Understand what is genesis block and implement it
- Adds the blocks to the blockchain
- Validate the chain
- Use it by doing test runs.

If you do everything correct, you will have a basic
working blockchain!

## Step 4: Learn Smart Contracts

A smart contract is also one of the vital blockchain concepts that you need to learn.

- You can use it to automate or add functionality to your dApps.

## Step 5: Read Blockchain Related Content

**Keep reading** blockchain-related content. Many websites offer high-qualíty, blockchain content. I recommend checking out **BlockGeeks** and [**101Blockchains.com](http://101blockchains.com/).**

## Step 6: Keep improving !

There is no end to learn!
What things should i consider before building a gaming site?
Tags: advice, game
Published: 2022-03-06 18:36:41

Hi everyone, am self taught and still in high school and for the last 2 years, i have been teaching myself how to code and now i feel am ready to put what i have learnt to use. The reason why i wanted to code in the first place, was to build games, i built some few games and shared them with my friends during the lockdown, they were just small 2d games i built with **phaser 3**.I felt like i needed to do more than just games so i want to build a gaming site where one can play and download games from. I know how to write code in;

- Javascript
- html
- css
- Python (my first to learn)
- C

what else do i need to know before starting?
Passo a passo para começar a escrever artigos
Tags: braziliandevs
Published: 2022-03-06 18:33:13

Você já pensou em começar a escrever artigos, mas ficou com insegurança, ou medo?

Caso sim, esse artigo busca te ajudar e incentivar a começar a escrever artigos em um curto passo a passo!

## 1. Defina seu assunto

Primeiramente, é necessário que você defina o tema para o seu artigo. Esse assunto não precisa ser algo que você tem total domínio, pode até mesmo ser algo que você ainda está aprendendo, ou que você tem interesse de aprender. Pois assim, você irá aprender sobre o tema, enquanto você produz conteúdo sobre o mesmo.

## 2. Escreva tópicos sobre o assunto

Agora, em um papel ou um bloco de notas virtual, escreva tópicos que você deseja abordar sobre o assunto. Caso o seu assunto por exemplo, seja **Javascript**, seus tópicos podem ser:

- O quê é Javascript?
- Origem
- Características
- Fontes para estudar Javascript
- ...

Essa parte é muito importante, pois cada tópico pode ser uma parte do seu texto, logo você já terá o seu texto mapeado antes mesmo de começar a escrever.

## 3. Começando a escrever

Para começar a escrever, primeiro você precisa criar um introdução. Essa introdução pode ser uma pergunta (como eu geralmente faço), ou um texto que leva ao seu assunto.

A introdução é algo muito pessoal, e que até mesmo pode virar uma marca sua dependendo de como você cria ela. Por isso, é importante tentar. Mesmo que soe estranho ou confuso, mas continue, que ao longo do tempo você vai pegar o jeito.

## 4. Desenvolvimento

o desenvolvimento é a maior parte do seu texto. Nesse parte, busque seguir os tópicos que você anotou, mas fazendo algumas adaptações caso seja necessário, porquê os seus tópicos são apenas um caminho, não uma régua.

## 5. Finalização

Para finalizar o seu artigo, busque fechar todos os pontos que você abriu durante o texto, e pessoalmente, eu sempre escrevo um último tópico chamado **Finalização**, onde eu dou uma leve recapitulada no artigo, e agradeço pela leitura.

## 6. Postagem

O lugar onde você irá postar o seu artigo é algo completamente pessoal. Mas eu sempre escolho postar meus artigos no [dev.to](https://dev.to/), que é o site que você está lendo esse artigo.

## 7. Divulgação

Para divulgar seu artigo, você pode utilizar as suas mídias sociais, e caso você participe em comunidades, divulgue nelas também!

Caso você se identifique no feminino ou é uma pessoa não binárie, você pode divulgar seu artigo dentro da [Feministech](https://feministech.github.io/). Caso ainda não participe, envie uma DM no nosso twitter [@feminis_tech](https://twitter.com/feminis_tech/)

## Finalização

Nesse artigo, você aprendeu sobre como começar a criar seus artigos, em um curto passo a passo!

Bora escrever?

Muito obrigada por ler ❤️🏳️‍⚧️ e me segue nas redes, é tudo [@lissatransborda](https://twitter.com/lissatransborda) 👀
What is Peer-to-Peer(P2P) Network?
Tags: networks, blockchain, security
Published: 2022-03-06 16:06:00

A Peer-to-Peer (P2P) network is a network in which no separate server or computer/node controls the network Rather, everyone has the same permissions and responsibilities. Each computer in this network is called a peer, and all these peers are connected with each other. Unlike client/server network, each peer in P2P network act sometimes as a client and sometimes as a server. This network is mostly used for file/resource sharing purposes.


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


**Applications**

- Bitcoin
- Content Delivery 
- File Sharing 

**Advantages**

- Does not need an expensive server because individual nodes are 
  used to access the files
- If one computer fails it will not disrupt any other part of the 
  network
- Much easier to set up than a client-server network

**Disadvantages**

- Files and folders cannot be centrally backed up
- it can slow down the performance because each computer might be 
  accessed by others.



Thanks for reading
quickstart.js demo: a micro-form for user-specific installation instructions
Tags: codepen
Published: 2022-03-06 18:18:35

<p>This is a demo of quickstart.js, a micro-form for user-specific installation instructions.  For more info, see:  <a href="https://quickstart.harunpehlivanitdew.repl.co/" target="_blank">https://quickstart.harunpehlivanitdew.repl.co/</a></p>

{% codepen https://codepen.io/harunpehlivan/pen/Rwjdegy %}
How to send data query to the route in NEXT.Js
Published: 2022-03-06 18:12:14

It's very simple to pass the data query to the route in NExt.js 

At first you need to initialize it:

```
const router = useRouter();
```
and import from next/router

```
import { useRouter } from "next/router";
```
Then you can use it like:
```
router.push({
 pathname: "/list",
 query: { search: "support" },
});
```
The following code results to:

```
http://localhost:3000/list?search=support
```

## Pass multiple queries

```
router.push({
 pathname: "/list",
 query: { search: "support", limit: 10 },
});
```

This results to: 
```
http://localhost:3000/list?search=support&limit=10
```

You can pass multiple parameters as well might be integer, string, boolean.
 
you can pass dynamic data as well.

## Dynamic pass route

```
var searchData = "elonmusk";
var limitData = 15; 
router.push({
 pathname: "/list",
 query: { search: searchData, limit: limitData },
});
```
This results to: 
```
http://localhost:3000/list?search=elonmusk&limit=15
```

Follow me @[slimpotatoboy](https://twitter.com/slimpotatoboy) at twitter
How to use PAGINATION on React
Tags: javascript, react, tutorial, html
Published: 2022-03-06 18:04:03

To use pagination on the react app, there is this npm package called  [react-js-pagination](https://www.npmjs.com/package/react-js-pagination) which is very easy to use and effective as well.

Prerequisite
-Create-react-app
-Bootstrap

I won't be teaching how to create react-app .

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

## Install React-js-Pagination

Install with npm:

```
npm i react-js-pagination
```
OR Install with yarn:

```
yarn add react-js-pagination
```

## Import Pagination

```
import Pagination from "react-js-pagination";
```

## Setting Up Active Page

``` 
const [activePage, setActivePage] = useState(1);
```

## Creating Pagination Component

```
<Pagination
 activePage={activePage}
 itemsCountPerPage={10}
 totalItemsCount={data.count}
 pageRangeDisplayed={5}
 onChange={onChangePaginate}
 innerClass="pagination"
 itemClass="page-item"
 activeLinkClass="page-link active"
 linkClass="page-link"
 prevPageText="Previous"
 nextPageText="Next"
/>
```

## setting onchange function

```
const onChangePaginate = (pageNumber) => {
    setActivePage(pageNumber);
    // to set offset
    console.log(pageNumber * 10 - 10)
  };
```

Visit [React-JS-Pagination](https://www.npmjs.com/package/react-js-pagination) for more information.
termynal.js: A lightweight and modern animated terminal window
Tags: codepen
Published: 2022-03-06 17:58:07

<p>Termynal uses async and await, which is now supported pretty much across all major browsers. Termynal lets you write all input and output in plain HTML, and all styling in plain CSS. Non-JS users will still see the complete code, just no animation. It also comes with a flexible HTML API</p>

<p>Details: <a href="https://termynal.harunpehlivanitdew.repl.co/          " target="_blank">https://termynal.harunpehlivanitdew.repl.co/          </a> </p>

{% codepen https://codepen.io/harunpehlivan/pen/NWwJLEB %}