teleren/devto huggingface dataset:
Ether.js Overview!
Tags: javascript, beginners, programming, blockchain
Published: 2023-01-15 10:22:48

Here's a quick rundown of what Ether.js is and what it is used for :- 

1. Ether.js is a JavaScript library for interacting with the Ethereum blockchain. It allows developers to easily interact with smart contracts and manage transactions on the Ethereum network.

2. One of the key features of Ether.js is its simplicity. The library abstracts away the complexities of working with Ethereum, making it easy for developers to get started with blockchain development. This is achieved through a simple, intuitive API that is easy to use and understand.

3. Another important aspect of Ether.js is its flexibility. It can be used in a variety of different environments, including browser-based dApps, server-side applications, and command-line tools. This makes it a versatile choice for any developer looking to work with the Ethereum blockchain.

4. Ether.js also has built-in support for Web3.js, which is the most popular JavaScript library for interacting with the Ethereum blockchain. This means that developers can use Ether.js to easily interact with smart contracts written in Solidity, the most popular programming language for Ethereum.

5. In addition, Ether.js has a number of useful features such as built-in support for handling contract events, support for sending signed transactions, and more. This makes it a powerful tool for any developer looking to work with the Ethereum blockchain.

6. Overall, Ether.js is a great choice for developers looking to work with the Ethereum blockchain. Its simplicity, flexibility, and built-in support for Web3.js make it a powerful and easy-to-use tool for any developer.

Hope it helps!
Easy integration of Supabase into your Vue.js application
Tags: vue, database, supabase, javascript
Published: 2023-01-15 10:15:54

[![Substack Newsletter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbg4qlzlytxbzbvj97ia.png)](https://benoitpetit.substack.com/subscribe)

Supabase is a powerful online database tool that makes it easy to integrate a real-time, scalable, and secure database into your Vue.js application. With Supabase, you can easily create, read, update, and delete data in your database without having to worry about managing servers, scaling, or security.

In this article, we will show you how to easily integrate Supabase into your Vue.js 3.0 application using the official Supabase Vue.js library.

First, you will need to sign up for a Supabase account and create a new project. Once you have done that, you can install the Supabase Vue.js library by running the following command:

```shell
npm install --save @supabase/supabase-js
```
Next, you will need to import the library into your Vue.js application and initialize it with your Supabase credentials. You can do this by adding the following code to your main.js file:

```js
import Vue from 'vue'
import Supabase from '@supabase/supabase-js'

const supabase = new Supabase('https://your-project-name.supabase.co', 'your-api-key')
Vue.prototype.$supabase = supabase
```

Now that you have initialized Supabase in your application, you can start using it to perform CRUD operations on your database. For example, you can use the $supabase.from() method to fetch data from a specific table in your database, like this:

```js
mounted() {
    this.$supabase.from('users').select('*').then(response => {
        this.users = response.data
    })
}
```

You can also use the $supabase.insert() method to insert data into a table, like this:

```js
methods: {
    addUser() {
        this.$supabase.from('users').insert({ name: this.newName, age: this.newAge }).then(response => {
            console.log(response)
        })
    }
}
```

In this example, we are adding a new user to the "users" table with a name and age from the template data.

As you can see, integrating Supabase into your Vue.js application is quite easy and straightforward with the official Supabase Vue.js library. With Supabase, you can easily add a real-time, scalable, and secure database to your Vue.js application, making it easier for you to manage and work with data.

---

> 🫶 If you appreciate my posts and would like to support my work, feel free to make a donation by clicking on the Stripe Sponsor link below or by scanning the QR code. [lien Stripe Sponsor](https://donate.stripe.com/00g6pJ6R19MJ15S7ss)

---

[![Stripe Sponsor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ohkf7lrymedkort4w9iz.png)](https://donate.stripe.com/00g6pJ6R19MJ15S7ss)

--- 

👀 See me here : 

- [Substack](https://benoitpetit.substack.com/subscribe)
- [Mastodon](https://piaille.fr/@codingben) 
- [(X) Twitter](https://twitter.com/codingben_)
- [Github](https://github.com/benoitpetit)
- [NPM Packages](https://www.npmjs.com/~codingben)
- [benoitpetit.dev](https://benoitpetit.dev)
- [Dev.to](https://dev.to/benoitpetit)
Unlocking the Power of Recursion
Tags: programming, algorithms, computerscience
Published: 2023-01-15 10:00:00

Recursion is a fundamental concept in computer science that can be used to solve a wide range of problems. It is a powerful tool that allows us to break down complex problems into smaller, more manageable subproblems. In this article, we will explore the importance of recursion, how it affects other computer science fields, and what it is.

---
One of the main reasons why recursion is so important is that it allows us to write elegant and concise code. Recursive algorithms can often be more simple and easier to understand than their iterative counterparts. For example, the recursive implementation of the factorial function is much simpler than its iterative version.

Recursion also affects other computer science fields, such as artificial intelligence and machine learning. In these fields, recursion is often used to solve problems that involve searching through a large tree or graph. It also plays a key role in functional programming, which is a programming paradigm that emphasizes the use of recursion as a way to solve problems.

So, what exactly is recursion? Recursion is a technique in which a function calls itself in order to solve a problem. In order to prevent infinite recursion, a base case must be defined. When a function calls itself, it does so with a slightly simpler version of the original problem. This process continues until the base case is reached, at which point the function returns a result. The results from the base case are then used to solve the original problem.

For example, consider the problem of finding the nth Fibonacci number. One common algorithm used to solve this problem is the recursive algorithm, which is defined as follows:

```python
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
```

In this example, the base case is when n <= 1, in which case the function simply returns n. In other cases, the function calls itself twice, once with n-1 and once with n-2. The results of these recursive calls are then added together to find the nth Fibonacci number.

---

In conclusion, recursion is a powerful technique in computer science that allows us to break down complex problems into smaller, more manageable subproblems. It allows us to write elegant and concise code, and it plays a key role in many areas of computer science, from artificial intelligence to functional programming. Understanding the importance of recursion, and how it affects other computer science fields, is essential for anyone looking to build a career in computer science. Whether you are a student or a professional, mastering the art of recursion will help you to create efficient solutions and take your computer science skills to the next level.
Docker ,Kubernetes, Orchestrations
Published: 2023-01-15 09:55:32

Docker , Kubernetes, Orchestrations let me try to explain these things using a selfie example🙋🏻‍♂️

Using our mobile camera we take selfies, selfies get stored in mobile gallery🤳🏻
Likewise using docker we take selfies of our project & store them in our machine💻

If your selfies are not run/used, they are of no use👾
But when you use/run your selfie, you get a new DP on whatsapp, FB🕺🏻

Likewise when you run docker image, you get a new container 🗳️

Now to handle your so many selfies, we have google photos 🧑🏻‍🎨
To maintain so many containers, we have Kubernetes ☸️

So, let's revise again,

Using Docker as a camera, you take a docker image of your code.🖼️
When you run the docker image, you get a container ☸️
And Kubernetes helps in deleting, updating, and maintaining these 100’s of containers🗳️🗳️🗳️

Kubernetes helps in creating a Cluster, inside the Cluster we have our machines/nodes running our containers in them.

Example of Orchestration:🎼

On hotstar, in a cricket match, in the last 2 3 overs, number of viewers can increase by 10x 📈
So, to suddenly handle these loads of requests, k8s will autoscale or create 100 such more containers🗳️🗳️🗳️🗳️

When match is over, we close the app, so now the number of requests is reduced📉
K8s deletes the newly created containers as they are not required now 🗳️❎
This feature gives auto scaling, high availability, no down time for our application.

Thats all..in the next part will try to explain #kubernetes #architecture in layman term

#docker #kubernetes #orchestration #devops #autoscaling #cloud
Working with Struct in Rust
Tags: rust, struct
Published: 2023-01-15 09:54:39

In this blog post, let us explore how to work with `Struct` in Rust

#### Create Struct type

`Struct` is equivalent to `Class` in Java language. It is a type composed of other types. There are 3 different ways we can create Struct in Rust

###### Named fields

This is more common approach we create Struct. Each field defined has a name and a type. It is possible to declare a field with `pub` and those such fields are visible to other modules

```
struct Employee {
    name: String,
    age: i32,
    dept: String,
}
```

###### Tuple Structs

It is similar to regular structs except they don't have any defined name. The fields can be accessible by using its index position starting with 0

```
struct TupleStruct(String, i32, String);
```

###### Unit Structs

Unit Structs as name implies, it doesn't have any fields and has zero-size and they are commonly used as markers. This can be instantiated. It is useful when you need to implement a trait but don't want to store any data inside it. 

```
struct UnitStruct;
```

#### Constructor method for Struct

Struct can be initialized by assigning values to each of its member fields or add constructor method named `new`. This method takes argument values and returns itself. 

```
impl Employee {
    pub fn new(name: String, age: i32, dept: String) -> Self {
        Self { name, age, dept }
    }
}
```

#### Add Behaviors to Struct

Struct without any methods doesn't make any sense. It is possible to add methods to Struct. Struct can also implement Trait's methods

In this below example, we're implementing `Debug` and `Display` trait for our Struct

```
impl fmt::Debug for Employee {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_struct("Employee")
            .field("Name", &self.name)
            .field("Age", &self.age)
            .field("Department", &self.dept)
            .finish()
    }
}

impl Display for Employee {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(
            f,
            "Employee [Name: {}, Age: {}, Department: {}]",
            self.name, self.age, self.dept
        )
    }
}
```
All the code examples can be found in this [link](https://github.com/sivakumar-sivaprakasam/rust-examples/tree/main/structs)

Please feel free to share your feedback.

Happy reading!!!
CES 2023: The mixed mixed reality and VR
Tags: ces2023, vr, ar, news
Published: 2023-01-15 09:26:33

Currently there are plenty of major game players on the AR/VR market like **Magic Leap 2, Meta Quest Pro, Vive XR Elite** and **PSVR2**. All those devices were available at **CES 2023** and for sure you can notice progress.

In the beginning **Beat Saber** for Quest was super amazing, many hardcore gamers were waiting for something more serious even if Beat Saber is still one of favorite VR games for everybody.

{% embed https://www.youtube.com/watch?v=BUXPOqt4O2E %}

Beat Saber | Announce Trailer | Oculus Quest

Magic Leap 2 is something that is still quite unknown and uncertain even after years and millions of development, Vive is still alive but probably might go to enterprise AR direction, and Sony is successfully fighting Microsoft for player’s attention with their additional gaming experience using PlayStation VR2.

{% embed https://www.youtube.com/watch?v=M_8MjQSjCac %}
 
Horizon - Call of the Mountain

One thing all parties seem to agree on is that everybody is missing the new game changer player. And this year Apple's inevitable entry in the space — if successful — will be an industry booster. It would certainly be validation of the next big thing waiting for decades like. 

I’m super excited to see the outcome of this.
 
What about you?
Solving Apple AirPods Connectivity Issues with Windows 10/11
Tags: airpods, beginners, apple, windows
Published: 2023-01-15 09:20:09

## Table of Contents
1. [Applicable To](#ApplicableTo)
2. [The Guide](#TheGuide)
3. [Disclaimer](#Disclaimer)

Are you having trouble connecting your Apple AirPods to your Windows 10 devices? You’re not alone. Many users have reported connectivity issues when trying to pair their AirPods with non-Apple devices. However, don’t despair — there are ways to fix this problem.

## Applicable To <a name="ApplicableTo"></a>

These connectivity fix should applies to the following Apple AirPods models:

- AirPods 2nd Generation
- AirPods 3rd Generation
- AirPods Pro
- AirPods Pro 2nd Generation
- AirPods Max

## The Guide <a name="TheGuide"></a>

Here’s a step-by-step guide on how to solve the Apple AirPods connectivity problem with Windows 10/11 devices:

- First, update the network adapter driver for Bluetooth and wireless services. This can be done by searching for the exact network card model on [intel.com](https://www.intel.com/content/www/us/en/homepage.html). For example, the network card model is Intel Dual Band Wireless-AC 7260.
- After updating the driver, restart your computer.
- Next, go to the Control Panel and select Administrative Tools.
- In Administrative Tools, select Services.
- In the Services (Local) tab, look for “Bluetooth Support Service”.

![Services.msc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0dp8wy9mj0i6167pe78.png)

- Right-click on “Bluetooth Support Service” and select its properties.
- Under “Startup type”, change it from “automatic” to “manual” and hit apply and OK.
- Right-click on “Bluetooth Support Service” again and hit stop. Wait a few seconds, then start it again.


![Bluetooth Support Service Properties](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f16ds27zj5xolhvasz6t.png)

- In the taskbar, go to Start — Settings — Devices — Add Bluetooth or other devices — Bluetooth. Wait until the AirPods is discovered. Move the AirPods around to help the network card find them.

## Disclaimer <a name="Disclaimer"></a>

This fix will only works if your device comes with Bluetooth 4.0 and above only. Otherwise, you need to upgrade your network card for example Intel AX210 that supports WiFi6E and Bluetooth 5.3. Cheaper alternative would be the standalone USB Bluetooth 5.3 Dongle Adapter.
Let's Create a Face Detector: A Step-by-Step Guide Using OpenCV
Tags: python, ai, webdev, opencv
Published: 2023-01-15 09:19:58

In this article, We'll be diving into the world of computer vision and image processing by using a popular library in Python called OpenCV. OpenCV is a powerful library that allows us to perform various image and video processing tasks, and it has a lot of pre-trained models that can be used for various tasks such as object detection, face detection, and more.

One of the most popular pre-trained models in OpenCV is the Haar cascade classifier for face detection. This classifier is trained to detect faces in images, and it's a very powerful tool that can be used for a wide range of applications, such as security cameras, photo tagging, and more.

Here's an example of how to use the Haar cascade classifier for face detection in Python:

```
import cv2

# Load the cascade classifier
#download this here https://raw.githubusercontent.com/opencv/opencv/4.x/data/haarcascades/haarcascade_frontalface_default.xml just go there and ctrl + s
face_cascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") 

# Read the input image
img = cv2.imread("input.jpg")

# Convert into grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

# Detect faces
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5)

# Draw rectangle around the faces
for (x, y, w, h) in faces:
    cv2.rectangle(img, (x, y), (x+w, y+h), (0, 0, 255), 2)

# Save the output image
cv2.imwrite("output.jpg", img)

```
output: 

![image detection using opencv](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whhcvs7gbgdfrecygvjq.png)


![image detection using opencv](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lx6memrwkshlwa6aldwj.png)



The first step is to import the OpenCV library, and then we load the cascade classifier using the cv2.CascadeClassifier() function. We then read the input image using the cv2.imread() function, and convert it to grayscale using the cv2.cvtColor() function.

Next, we use the face_cascade.detectMultiScale() function to detect faces in the image. This function takes in the grayscale image as well as some parameters such as the scale factor and the minimum number of neighbors.

Finally, we draw rectangles around the detected faces using the cv2.rectangle() function, and save the output image using the cv2.imwrite() function.

In this way, we can use the Haar cascade classifier to detect faces in images. With OpenCV, you can do a lot more things like object detection, image stitching, and more.
Thank you DEV!
Tags: meta, watercooler, community
Published: 2023-01-15 09:07:22

Just wanted to write a quick thank you for the gift you sent me, writing in 2022 was a joy and I intend to write even more!

Love the stickers (though I am running out of laptop real estate)

Most of all thank you for the dev.to community (even if you never read one of my posts LOL), thanks for being a supportive and fun community while still being incredibly proffesional.
Take care, and have a great year from everyone here at BLST security!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/no85nvb306rkbx1olwmu.jpg)
AI Prompt Generator Online
Tags: showdev, ai
Published: 2023-01-15 08:45:54

##Introduction

Are you a writer looking for inspiration? Or a business professional looking for new ideas? Look no further than the AI Prompt Generator Online Tool. This revolutionary tool harnesses the power of artificial intelligence to generate unique and thought-provoking prompts for writing, brainstorming, and more.

##How It Works

The [AI Prompt Generator](https://webutility.io/ai-prompt-generator) Online Tool uses cutting-edge natural language processing techniques to generate prompts based on a wide range of topics. Simply click on the button "Generate New Prompt" to generate the random prompts.

##Benefits of Using the AI Prompt Generator Online Tool

**Save time**: Say goodbye to writer's block and brainstorming sessions that go nowhere. With the AI Prompt Generator Online Tool, you can quickly generate new ideas and get back to writing.

**Improve creativity**: The tool's ability to generate unique and thought-provoking prompts can help you think outside the box and come up with new and innovative ideas.

**Increase productivity**: With a steady stream of ideas at your fingertips, you'll be able to work more efficiently and produce more content.

**Access a wide range of topics**: The AI Prompt Generator Online Tool covers a wide range of topics, from creative writing to business ideas, ensuring that you'll always find a prompt that's relevant to your needs.

##Conclusion

In conclusion, the AI Prompt Generator Online Tool is a powerful tool that can help writers, business professionals, and anyone in need of inspiration to generate unique and thought-provoking ideas. With its ability to cover a wide range of topics and its real-time prompt generation, this tool is sure to help you save time, improve creativity, and increase productivity. [Try it out](https://webutility.io/ai-prompt-generator) today and see the difference it can make in your writing and brainstorming sessions.
JavaScript Objects
Tags: javascript
Published: 2023-03-09 22:27:44

---
title: JavaScript Objects
published: true
date: 2023-01-15 08:00:00 UTC
tags: JavaScript
canonical_url: https://www.90-10.dev/js-objects/
---

In JavaScript, objects are a fundamental data type that represent a collection of properties. A property is a key-value pair, where the key is a string (or symbol), and the value can be any data type.

## Creating Objects

There are 4 ways to create objects:

### 1. Object literal notation

We're creating an object called `person` with three properties: `name` and `age`:

```js
let person = {
    name: 'Paul',
    age: 30
};

```

### 2. Constructor function

A constructor function is a **regular function** that is called using the `new` keyword:

```js
function Person(name, age) {
  this.name = name;
  this.age = age;
};

let person = new Person('Paul', 30);

```

### 3. `Object.create()`

The `Object.create()` method can be used to create an object with a specified **prototype object** and properties:

```js
const personPrototype = {
    sayHello: function() {
        console.log(`Hello ${this.name}`);
    }
};

let person = Object.create(personPrototype, {
    name: { value: 'Paul' },
    age: { value: 30 }
});
person.sayHello(); // prints: Hello Paul
```

### 4. Class Notation

ES6 introduces classes that can be used to create objects. **A class is a blueprint** for creating objects with specific methods and properties:

```js
class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
}

let person = new Person('Paul', 30);

```

## Accessing Properties

You can access an object's properties using dot notation or bracket notation:

```js
let person = {
    name: 'Paul',
    age: 30,
    address: {
        city: 'London'
    }
};

console.log(person.name); // prints: Paul
console.log(person.address.city); // prints: London
console.log(person['age']); // prints: 30
```

In this example, we access the `firstName` property using dot notation and the `lastName` property using bracket notation.

## Modifying Properties

You can modify an object's properties by assigning a new value to the property:

```js
let person = {
    name: 'Paul',
    age: 30
};

person.age = 40;

console.log(person.age); // prints: 40

```

## Adding Object Properties

You can add new properties to an object by assigning a value to a new key:

```js
let person = {
    name: 'Paul',
    age: 30
};

person.twitter = '@90_10_dev';

console.log(person.twitter); // prints: @90_10_dev

```

In this example, we add a new property called `twitter` to the `person` object.

## Take Away

Objects are used extensively in Javascript - they are incredibly flexible and powerful, and they can be used to represent a wide variety of data structures, including arrays, linked lists, trees, and graphs.