teleren/devto huggingface dataset:
Mastering Ether Units: A Guide to Solidity Conversions
Tags: web3, blockchain, solidity, ethereum
Published: 2023-02-04 16:26:43

>Ether Units in Solidity are a way to handle and express values in ETH

Ether is the name of the currency that is used in the Ethereum blockchain. It is used to pay for work done in the EVM. A way to do this is to buy gas for ether. This is done as explained in the gas section.

Transactions are paid with ether. Similar to how one dollar is equal to 100 cent, one ether is equal to 1018 wei.

##Denominations:

Metric units are used to measure how much ether there is in each type of unit. There is a name for each denomination that is different from the rest (some bear the family name of seminal figures playing a role in the evolution of computer science and cryptoeconomics). You can think of Wei as being the smallest amount of ether that you can get. Below is a list of the denominations and the value in Wei for each one of them. Following a common pattern, ether also refers to a unit of the currency, which is 1e18, or one quintillion Wei. The currency is not called "Ether," as many people think, and it is not a unit called "Ether."


![Values](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssn8yevq2mhlbk2qhbhb.jpeg)
 

##Solidity Program to understand Ether units:
```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

contract EtherUnits {
    uint public oneWei = 1 wei;
    // 1 wei is equal to 1
    bool public isOneWei = 1 wei == 1;

    uint public oneEther = 1 ether;
    // 1 ether is equal to 10^18 wei
    bool public isOneEther = 1 ether == 1e18; 
```
**All of the following assertions in Solidity will be equivalent to true**
```
assert(1 wei == 1);
assert(1 szabo == 1e12);
assert(1 finney == 1e15);
assert(1 ether == 1e18);
assert(2 ether == 2000 fenny); 
```
 For more content, follow me on - https://linktr.ee/shlokkumar2303
🔀: Reverse String using HTML Tag Only
Tags: html, css, string, reverse
Published: 2023-02-04 16:23:17

# 👩‍💻: Code

```html
<div>
	<bdo dir="ltr"> Normal Text </bdo>
	<bdo dir="rtl"> Reversed Text </bdo>
</div>
```

# 🖥️: Output

{% codepen https://codepen.io/withrvr/pen/bGjzJXb %}
The Best Way to import images in ReactJs, and NextJs 🚀
Tags: webdev, react, nextjs, javascript
Published: 2023-02-04 16:20:54

Importing images was always a pain in the neck 👔 especially importing them with long paths in multiple lines, so I searched 🔎 a lot to find the best ones and then tested them to ensure, they were the best to use in daily projects 👍. So after spending hours 🕝 using it on different projects, I finally discover the answer for daily usage. 😀 

certainly, it's not the best answer for use in different projects, so I will create posts for each situation soon.

without any interrupting let's get into it. ✍️

## Make Index file
In the public folder create a new file `index.js`, or `index.tsx`, or any folder you want to export its existing images.

> there are lots of third packages, which you can use to import, but I prefer to import them manually! lightness.

## Import/Export Images

then export them like below:

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

## Import In React Components
and instead of importing images with long paths, now you import them like below:

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

## SVGs
You can also make file SVGs, and return SVG elements like react components.

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

# Conclusion
It may not be the best for specific projects ⚠️, but for regular react projects is OK. 

If you know a better way than this one 🕵️. please 🙏 comment it 💭 below to let others and I know 👍. 

[keep in touch](https://vito-dev.ir) 👋

Keep Coding Y'All 👨🏻‍💻
Android wireless debugging with adb-wifi
Published: 2023-02-04 16:18:38

---
title: Android wireless debugging with adb-wifi
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-02-04 16:05 +0000
---


From Android 11 onwards, the adb-wifi tool is no longer needed to enable wireless debugging. Instead, you can use the built-in wireless debugging feature. This is a great improvement, as it means you no longer need to install a third-party tool to enable wireless debugging. you can find more information about this feature in the [official documentation](https://developer.android.com/studio/command-line/adb#wireless). 

For connecting to a device, you'll need open Android Studio. I have created a simple command line tool to make this easier. You can find it on [GitHub](https://github.com/saleehk/adb-wifi). It'll display QR code in terminal 

![QR code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ibl4uf0tv9bopc56rj7.png)



### Installation

You can install the tool using the following command:

`npm install -g adb-wifi`

### Usage

To connect to a device, you can use the following command:

`adb-wifi`

This will display a QR code in the terminal. You can scan this with adb-wifi on your device to connect to the device.
Rust and its friendly crates: Don't miss out on them!
Tags: rust, crates
Published: 2023-02-04 16:05:39

🦀Hello to all Rust lovers!

You're probably here because you already know about the myriad wonders the Rust programming language has to offer. It's true that Rust is a powerful language on its own, but with the help of friendly libraries it's even more!

That's why I decided to put together a list of the most useful Rust libraries you should know about. Let's get started!

## [**serde**](https://crates.io/crates/serde)
Tired of writing code to serialize and deserialize data? Serde makes it easy and efficient.

## [**actix-web**](https://crates.io/crates/actix-web)
Need to build fast and scalable web applications? Actix-web is the library you need.

## [**diesel**](https://crates.io/crates/diesel)
Want to query your database without writing manual SQL code? With Diesel, you can do all that and more.

## [**regex**](https://crates.io/crates/regex)
Need to perform search and replace operations on strings in a simple and efficient way? Regex is the perfect library for you.

## [**log**](https://crates.io/crates/log)
Need an easy and flexible way to log your application's debug messages and errors? Log is the library you're looking for.

## [**Hyper**](https://crates.io/crates/hyper)
Hyper is an HTTP client and server library for Rust. It provides a fast and efficient way to make HTTP requests and handle HTTP responses, making it a great choice for building web services and applications.

## [**Rocket**](https://crates.io/crates/rocket)
Rocket is an open-source web framework for Rust. It's designed to be simple, fast, and secure, and it makes it easy to build web applications and services with Rust.

## [**Tonic**](https://crates.io/crates/tonic)
Tonic is a library for developing gRPC services in Rust. gRPC is a high-performance, open-source framework for building remote procedure call (RPC) APIs, and Tonic makes it easy to create gRPC services in Rust.

## [**Warping**](https://crates.io/crates/warping)
Warping is a web application framework for Rust. It provides a simple and efficient way to build web applications, and it makes it easy to handle HTTP requests and responses.

## [**Amethyst**](https://crates.io/crates/amethyst)
Amethyst is an open-source game engine for Rust. It provides a powerful and flexible framework for building games, and it makes it easy to create games that run on a variety of platforms.

## [**Bevy**](https://crates.io/crates/bevy)
Bevy is a Data-Driven (ECS) game engine for Rust. Your project can be structured in plugins. Also, you can install community plugins from GitHub.

## **Conclusion**
In conclusion, Rust has a vast and thriving ecosystem of libraries that can help you build fast, reliable, and efficient applications and services. Whether you're building a web application, a game engine, or a microservice, Rust has the tools you need to get the job done. So, don't miss out on these friendly Rust libraries, and start building amazing things today!
The story about polymorphism
Tags: programming, computerscience, writing
Published: 2023-02-04 15:57:42

Do you want to magically put things in order in your head, and quickly?
Polymorphic variable == variable that can take values of different data types.
Polymorphic function == a function whose at least one argument is a polymorphic variable.

There are two types of polymorphic functions.

1. **Ad-hoc polymorphism** - a function behaves differently for different types of arguments. For example, the function "draw()" - draws different geometric shapes in different ways for different objects.
2. **Parametric polymorphism** - a function behaves the same for arguments of different types. An example is the "put an element in a container" function.

Polymorphism can be natural or artificial.
1. Natural - when type information passes automatically, along with the value. And the language explicitly supports Ad-hoc polymorphism.
2. Artificial polymorphism - when type information is dragged by separate parameters. For example, printf is a polymorphic function. Information about the type of arguments goes in the format string - the first argument.

Also, should distinguish **static and dynamic polymorphism**, when the type is resolved at compile time, or at run time.

Please pay attention - the word "class" and nothing related to OOP are not mentioned. 

## About OOP.

When you call a class method, it is a call to a function whose zero (implicit) argument is an object (this argument is referred to as this).

Consider natural polymorphism as an example.

Compile time:
Function overloading. The type of argument is part of the signature, that's why we have Ad hoc polymorphism.

Runtime:
1. The pointer to the base class is a polymorphic variable. Any function that takes such an argument will have parametric polymorphism.
2. A virtual function is ad-hoc polymorphic because of the presence of a single implicit argument. This is a weak property of the OO model in general, forcing scary patterns such as Visitor when ad-hoc polymorphism is required not on one argument, but on several. The solution to this problem is multi-methods, which are available in some object-oriented languages.

Seems to have missed nothing about polymorphism. So you can decompose any language yourself.
Svelte Email - Build and design emails with Svelte
Tags: svelte, webdev, javascript, opensource
Published: 2023-02-04 15:47:33

Email is one of the most widely used forms of communication in the modern world, but developing them can be a real pain in the ass. Whether it's formatting issues, limited design options, or simply struggling to come up with compelling content, the process of creating an effective email can be frustrating and time-consuming.

[React Email](https://react.email/) has made the experience a lot better, so I've decided to build something similar for Svelte.

With [Svelte Email](https://github.com/carstenlebek/svelte-email) you can start building, designing and sending emails in your SvelteKit project in literally three easy steps.

## Step 1: Installation
Install the package to your existing SvelteKit project:
```bash
npm install svelte-email
```
```
pnpm add svelte-email
```

## Step 2: Create an email template using Svelte
`src/$lib/emails/Hello.svelte`

```html
<script>
	import { Button, Hr, Html, Text } from 'svelte-email';

	export let name = 'World';
</script>

<Html lang="en">
	<Text>
		Hello, {name}!
	</Text>
	<Hr />
	<Button href="https://svelte.dev">Visit Svelte</Button>
</Html>
```
## Step 3: Send an email

This example uses [Nodemailer](https://nodemailer.com/about/) to send the email. You can use any other email service provider.

`src/routes/emails/hello/+server.js`

```js
import { render } from 'svelte-email';
import Hello from '$lib/emails/Hello.svelte';
import nodemailer from 'nodemailer';

const transporter = nodemailer.createTransport({
	host: 'smtp.ethereal.email',
	port: 587,
	secure: false,
	auth: {
		user: 'my_user',
		pass: 'my_password'
	}
});

const emailHtml = render({
	component: Hello,
	props: {
		name: 'Svelte'
	}
});

const options = {
	from: 'you@example.com',
	to: 'user@gmail.com',
	subject: 'hello world',
	html: emailHtml
};

transporter.sendMail(options);
```

Congratulations 🎉 You have just sent an email from a server route in your SvelteKit project, without ever having to touch the HTML of the email.

Sending emails arguably can't get easier than this.

Check out the docs for Svelte Email and start building emails with ease! [Documentation](https://svelte-email.vercel.app/docs/overview/svelte-email)
Hi There, Can you please help me , how to change a particular portion of an image. PFA images and help to write code.
Tags: react
Published: 2023-02-04 15:46:49


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ij1j4c0ql6wwjaklais4.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3yydc4tj0mqhhlvy9as4.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bx1hasn8p6e277wdygl.png))
Getting Started with PHP 8 on Ubuntu: A Step-by-Step Guide
Tags: php, beginners, programming, tutorial
Published: 2023-02-04 15:35:03

---
canonical_url: https://baransel.dev/post/how-to-install-php8-on-ubuntu/
---
## Installing PHP 8 on Ubuntu 18.04

To install PHP 8 on Ubuntu 18.04, follow these steps:

1. Update your system's package list by running the following command:

```bash
sudo apt-get update
```

2. Add the Ondřej Surý PPA to your system. This PPA provides updated versions of PHP for various Ubuntu releases:

```bash
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
```

3. Update the package list again to reflect the changes made in step 2:

```bash
sudo apt-get update
```

4. Finally, install PHP 8 by running the following command:

```bash
sudo apt-get install php8.0
```

5. Confirm that PHP 8 is installed by checking the version:

```bash
php -v
```

You should see output similar to the following:

```bash
PHP 8.0.0 (cli) (built: Jan 18 2021 08:56:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
```

## Installing PHP 8 on Ubuntu 20.04

The process of installing PHP 8 on Ubuntu 20.04 is similar to the steps outlined for Ubuntu 18.04. Simply follow the steps listed above, starting from step 1.

## Installing PHP 8 on Ubuntu 22.04

To install PHP 8 on Ubuntu 22.04, follow the same steps as outlined for Ubuntu 18.04 and 20.04. The process is the same for all three Ubuntu releases.

In my opinion, everyone should upgrade to PHP 8 for several reasons. Firstly, PHP 8 offers significantly improved performance over previous versions, which means that your applications will run faster and more efficiently. Secondly, PHP 8 includes several security enhancements that make it more secure to use, giving you peace of mind when building and deploying your applications. Finally, PHP 8 includes many new features and improvements that make it easier and more enjoyable to write code. Whether you're building a simple website or a complex web application, PHP 8 provides a modern and powerful platform for developing and deploying your applications.

In conclusion, if you're currently using an older version of PHP, now is the time to upgrade to PHP 8. The benefits of improved performance, increased security, and new features make it a no-brainer. Don't miss out on the latest and greatest in PHP development, upgrade to PHP 8 today!
Testing for CI
Tags: osdc, ci, opensource
Published: 2023-02-04 15:15:54

---
series: OSDC
---
## Slides & Examples
Check out [testing demo in Python](https://code-maven.com/slides/python/testing-demo) by @szabgab

## Fixture
Is the testing environment prior to running the tests

## Create a test
Create a new python script with a name starting with **test_**
```
vi test_myfunc.py
```
The python script should include
```
import mymodule # the mymodule file containing the myfunc function I want to test

def test_myfunc1():
    assert mymodule.myfunc("some input") == "some expected result"

def test_myfunc2():
    assert mymodule.myfunc("other input") == "other expected result"
```
I can add more **test_** functions where each function is a test case.

Run the test
```
pytest test_myfunc.py
```
This will run all the **test_** functions in **test_myfunc.py** and show whether the tests passed or failed, based on the expected results, per test function.

Tell `pytest` to run the tests in random order to make sure that the tests are independent of each other

```
pytest --rendom-order test_myfunc.py
```
Understand Javascript Call, Bind, and Apply in the Simplest and Easy Way Possible!!🔥
Tags: javascript, webdev, beginners, programming
Published: 2023-02-04 15:08:31

We all know how much these Javascript methods are confusing to understand. But there is always a simple way to explain complex things. Close your eyes and imagine yourself in the vast universe! You have an amazing spaceship and you are on a mission to explore different planets in the universe 💥

On each planet, you have to collect energy crystals to power your spaceship, like we play in the game 'No Mans Sky'!! The energy crystals are in different shapes and sizes, and you have to add their values to see how much energy you have collected.

Let's start with Call:

**_"Call"_** is like giving a direct command to your spaceship computer to perform a specific task. In our case, you want to ask the computer to add the values of the energy crystals you have collected.

Here's an example of what that would look like in code:


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

With "Call," you can ask the computer to add the values of the energy crystals in a straightforward and direct way. The computer will instantly perform the task and give you the result.


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

Now let's move on to Bind:

**_"Bind"_** is like telling your spaceship computer ahead of time that you want to add the values of energy crystals, but also giving it one of the values.

Here's an example of what that would look like in code:

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

With "Bind," you can tell the computer ahead of time that you always want to add a specific value to the energy crystals, and the computer will remember that. The next time you want to add values, you can just give it the second value, and the computer will do the rest.

Finally, let's talk about Apply:

**_"Apply"_** is like giving your spaceship computer a group of values to add together, instead of giving them one by one.

Here's an example of what that would look like in code:

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

With "Apply," you can give the computer all the values of energy crystals at once, and the computer will add them up quickly and efficiently. This is a great option when you have a lot of values to add.

So, there you have it! With Call, Bind, and Apply, you can ask your spaceship computer to add the values of the energy crystals in different ways and complete your mission to explore the universe with ease! 

**Hope this was helpfull!!**😊😊
Flowchart editor dgrm.net / announcement / sequence diagrams support
Tags: webdev, javascript, programming, design
Published: 2023-02-04 15:04:08

[dgrm.net](https://dgrm.net/) | [GitHub](https://github.com/AlexeyBoiko/DgrmJS)

Just want to announce that dgrm.net now support sequence diagrams.

![Sequence diagrams editor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/muwdr0qy463l8f2vxys0.gif)
[Try it yourself](https://app.dgrm.net/?k=202302ba45529b)

Note: you can move part of the diagram to insert new steps.

To make work with sequence diagrams more useful I implemented original idea of my friend. He suggested to select multiple line ends, and move them.

To support the project give it a star on [GitHub](https://github.com/AlexeyBoiko/DgrmJS).
Creating Complete Management Software - #2
Published: 2023-02-04 14:44:09

It's been a week since I started working on my own complete management software to be used in my company, which could be used by the employees, HR, business executives, CEO, CTO etc, differently.

## My 1st week milestone

![first week milestone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4l00y7aszk8r8s06z9s.png)

I focused on creating and finishing the authentication parts first, by creating all the possible and important API's and pages to apply it in frontend at first, as its the most needed and the most imporant part of every website. 

## Challenges I faced for creating it. 
Finalising a DB structure and frontend designs is the toughest thing I faced. As, I want to create an organisational based software to keep everything only to a specific organization, and all the people to have the access of that organization and still restricting them according to their role. 


![DB Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i1ytbgipvu1gm1me6fsf.png)

Currently, for my authentication part, I created and followed the above DB structure. Having a common user table, with a seperate OTPMech table and PasswordMech Table, to save it differently. So, that it will be easy to delete OTP from the table, after verifying, and changing password for a specific user(user_id) when calling forget password API.

## It's time to have a look over frontend. 

{% youtube opOTTP2jSXY %}

This week I am trying to focus on creating the frontend sidebar,  dashboard, general settings page with user-access, and a user customization page as a priority. 

Let's wait for a week and check out my progress over here and linkedin. 

Linkedin: [Click Here](https://www.linkedin.com/in/manas-mishra-768a7a24b/)
DEWABANDAR -Situs taruhan bola & slot games terbaik dan terbesar di indonesia
Tags: judionline, slotgacor, dewabandar, slotonline
Published: 2023-02-04 14:38:43

AYO DAFTAR DI DEWABANDAR SEKARANG JUGA.
DAPATKAN PROMO SPECIAL 100% NEW MEMBER KHUSUS GAME SLOT & BEBAS IP
MINIMAL DEPOSIT 25.000
MINIMAL WITHDRAW 50.000
PROSES DEPOSIT / WITHDRAW TERCEPAT
1 USER ID BISA MAIN DI SEMUA PERMAINAN
REGISTER AKUN VIP : https://solo.to/dewabandar888
Paracetamol.ts💊| #03: Explica este código TypeScript
Tags: typescript, spanish, webdev, programming
Published: 2023-02-04 14:38:12

## **<center>Explica este código TypeScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark> </center>

```ts
enum Helados{
  Crema = 10,
  Agua,
}

let miHeledo: Helados = Helados.Agua;
console.log(miHeledo)
```

- A. `10`
- B. `11`
- C. `ReferenceError`
- D. `RangeError`

Respuesta en el primer comentario.

---
Website to Learn Web Technologies for Free
Tags: webdev, career, beginners
Published: 2023-02-04 14:07:00

Are you looking for ways to learn web technologies? This blog post is about websites which can help you learn web technologies.

1. HTML: https://html.com/

2. CSS Tricks: https://css-tricks.com/

3. JavaScript: https://javascript.info/

4. Bootstrap: https://getbootstrap.com/docs/

5. React: https://react-tutorial.app/

6. PHP: https://www.php.net/

7. Algorithms: https://algorithm-visualizer.org/

8. APIs: https://rapidapi.com/learn

9. Git & GItHub: https://learngitbranching.js.org/

10. MySQL: https://dev.mysql.com/doc/

11. NodeJs: https://nodejs.dev/en/learn/

12. MongoDB: https://learn.mongodb.com/

---

**_NOTE:_** If you found this help. Like and share. Thanks, Happy Learning!

---

### Let's connect 💜

You can follow me on [Twitter](https://twitter.com/MrDanishSaleem), [Instagram](https://www.instagram.com/mrdanishsaleem/), [LinkedIn](https://www.linkedin.com/in/mrdanishsaleem/) & [GitHub](https://github.com/mrdanishsaleem/)

### Support Me

If you like this post. Kindly support me by [Buying Me a Coffee](https://www.buymeacoffee.com/mrdanishsaleem)