teleren/devto huggingface dataset:
5 Rust Project Ideas for Absolute Beginner Devs🦀
Tags: rust
Published: 2024-02-17 17:58:55

---
title: 5 Rust Project Ideas for Absolute Beginner Devs🦀
published: true
date: 2024-02-17 16:24:07 UTC
tags: Rust
canonical_url: https://eleftheriabatsou.hashnode.dev/5-rust-project-ideas-for-absolutely-beginners-rust-devs
---
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhts1w7masodhnlym23u.jpeg)

Hey there! 👋

If you're learning Rust now for the very first time I want to introduce you to 5 simple yet practical projects that will help you later in bigger projects.

The concepts I'm presenting below are pretty basic and every Rust developer should be familiar with them.

## Project Idea 5: Files Decompression

{% embed https://twitter.com/BatsouElef/status/1755596349662498871 %}

Check it on [GitHub](https://github.com/EleftheriaBatsou/decompression-project-rust).

## Project Idea 4: File Compression

{% embed https://twitter.com/BatsouElef/status/1755248189249114517

Check it on [GitHub](https://github.com/EleftheriaBatsou/compression-project-rust).

## Project Idea 3: Reading From a CSV File

{% embed https://twitter.com/BatsouElef/status/1756299481773994457 %}

Check it on [GitHub](https://github.com/EleftheriaBatsou/csv-reading-rust-project).

## Project Idea 3: Reading From a CSV File

{% embed 
 https://twitter.com/BatsouElef/status/1756299481773994457 %}

Check it on [GitHub](https://github.com/EleftheriaBatsou/csv-reading-rust-project).

## Project Idea 2: Reading JSON Data

{% embed https://twitter.com/BatsouElef/status/1756653225477083521 %}

Check it on [GitHub](https://github.com/EleftheriaBatsou/read-json-data-rust).

## Project Idea 1: Writing JSON Data

{% embed https://twitter.com/BatsouElef/status/1758880625480679847 %}

Check it on [GitHub](https://github.com/EleftheriaBatsou/write-json-rust).

## Notes

I'm new to Rust and I hope these small projects will help you get better and improve your skills.

If you're now learning Rust too, I'd also suggest you check out [CrabNebula](https://hashnode.com/@CrabNebula)'s content on X (Twitter) and [Francesco Ciulla](https://hashnode.com/@FrancescoCiulla)'s content on YouTube.

* * *

👋 Hello, I'm Eleftheria, **Community Manager,** developer, public speaker, and content creator.

🥰 If you liked this article, consider sharing it.

🔗 [**All links**](https://limey.io/batsouelef) | [**X**](https://twitter.com/BatsouElef) | [**LinkedIn**](https://www.linkedin.com/in/eleftheriabatsou/)
Asynchronous Loading in Vue
Tags: tutorial, vue, javascript, beginners
Published: 2023-06-16 20:12:30

Recently, I came across a performance issue on a Vue webpage where the loading time was excessively long. Upon thorough investigation, it became evident that several functions were being loaded simultaneously in the mounted lifecycle hook. While these functions were necessary for the page, it was not essential for all of them to be called simultaneously. This simultaneous loading was causing a slowdown in the page's performance.

To address this issue, one approach is to load specific functions asynchronously. By leveraging the power of async/await, along with Promise and setTimeout, we can achieve asynchronous loading and execution of the required functions within the mounted lifecycle hook of our Vue component. This ensures that the functions are loaded and executed in a non-blocking manner, enhancing the overall performance of the page.

For example,

```
mounted() {
  this.synchronousFunction();
  this.loadAsyncFunctions();
},

methods: {
  async loadAsyncFunctions() {
    await this.delay(1000); // Delay for 1 second
    await this.asyncFunction();
    await this.delay(2000); // Delay for 2 seconds
  },

  async delay(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
  },

  synchronousFunction() {
    console.log('This function is called synchronously');
  },

  async asyncFunction() {
    console.log('This function is called asynchronously');
  },
}
```

In the code snippet above, we have a mounted lifecycle hook in a Vue component. Inside the mounted hook, we call a synchronous function synchronousFunction() and an asynchronous function loadAsyncFunctions().

The loadAsyncFunctions() method utilizes the async/await syntax to load and execute functions asynchronously. It uses the delay() function, which returns a promise that resolves after a specified delay (in milliseconds). By awaiting the delay() function, we can introduce delays between the execution of different async functions.
The delay method is a utility function that returns a promise which resolves after the specified delay using setTimeout.

The synchronousFunction() is a regular synchronous function that is called immediately.

The asyncFunction() is an example of an asynchronous function that is also called within the loadAsyncFunctions() method. It showcases the asynchronous nature of the function.
Each async function is invoked using await, which ensures that the subsequent function is only called after the previous one has completed.

By using this approach, the synchronous function is called immediately, while the asynchronous functions are executed with delays, allowing for smoother performance and better user experience.
Unleashing Your Product Launch Strategy with the Best PPT Maker
Tags: productlaunchstrategy, freeproductlaunchstrategymaker
Published: 2024-02-17 16:02:45

Dive into the world of product launch strategy with [Simplified's innovative PPT maker](https://simplified.com/ai-presentation-maker/product-launch-strategy). Our comprehensive tool is designed to elevate your product launch strategy to new heights, providing dynamic features and intuitive functionality.
Kepler's Laws
Tags: codepen, beginners, physics, ai
Published: 2024-02-17 15:52:48

I'm truly captivated by the elegance of Kepler's Laws within the realm of physics. The allure of geometric algebra and the enchanting tales of how star positions were meticulously charted have significantly shaped my appreciation for data science.

---
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ni4v7vzqkveali6s3l50.png)
1. **Law of Ellipses:** the orbit of every planet is an ellipse with the Sun at one of the two foci
2. **Law of Equal Areas Over Equal Times:** a line joining a smaller mass and a larger mass sweeps out equal areas over equal times
3. **Law of Harmonics:** the square of the orbital period {% katex inline %}T{% endkatex %} of a planet is directly proportional to the cube of the semi-major axis, {% katex inline %}a{% endkatex %} of its orbit ** {% katex %}
 T^2 = \frac{4\pi^2}{\mu}a^3
{% endkatex %}

Check out this Pen I made! Here, I use a simplified model to adjust the speed of the planet's (blue circle) orbit based on the semi-major axis length {% katex inline %}a{% endkatex %}, keeping in mind the spirit of Kepler's Third Law. 

{% codepen https://codepen.io/lshriver/pen/BabMeoz %}

📝 Note: I used my AI and some previously made backbone code to come up with the CodePen code. I am WAY too inexperienced to come up with the simplified Kepler's Laws code on my own. My goal at the moment is to provide myself with intellectual stimulation for future projects. I'm not trying to reinvent the wheel. My background is in science -- not computer science, so I feel justified in using the AI to help me come up with pretty CodePen projects 🩵
muahostingcom
Tags: webdev, tutorial, productivity, programming
Published: 2024-02-17 15:44:51

Mua Hosting là website review, giới thiệu các chương trình khuyến mãi hosting Việt Nam, nước ngoài, uy tín và cập nhật liên tục hàng ngày #muahosting Phone: 0325862721 Địa chỉ: 1 đường số 59 Phường 14, Quận Gò Vấp, Thành phố Hồ Chí Minh [https://muahosting.com/](https://muahosting.com/)
2024-02-17 Multics Hang at 'CPU Add' During Boot, Part 1
Tags: multics, dps8m, simulator
Published: 2024-02-17 15:35:40

Multics implementation has a subtle but problematic assumption: that all of the CPU's run about the same rate.

For the DPS8/M simulator's running of CPUs in individual threads, this can be problematic. For example, during boot the bootload CPU will start the additional configured CPUs something like thus:

```
Signal all other running CPUs to idle
Set up fault vectors to direct interrupted CPU to start-up code
Clear "I am running flag"
Interrupt new CPU 
Count to 5000
Check "I am running flag", if not set, the new CPU failed to start
...
```
and
```
interrupt_handler:
Check CPU configuration; if ok, set "I am running flag"
Continue with initialization code...
```

Because the CPU threads run at different rates, and because the newly started thread has more initial overhead (thread creation time, cache misses), it can be the case that it does not reach "set flag" before the bootload processor has counted to 5000, leading to Multics chaos where Multics believes that the added processor is not running, yet that processor is in the scheduler code looking for work to do.

The correct solution is to load balance the CPU threads so that they work at the same pace, but that is a hard problem.

The short term solution was to add "stall points"; the simulator CPU threads watch specified instructions in the Multics executable and suspend themselves for a short time before executing the instruction, allowing other CPU threads time to catch up. For the above case, a stall point is set at the start of the "Count to 5000" code; the causes the boot CPU thread to suspend, giving the new CPU thread time to get to the "set the flag" state before the "count to 5000" loop runs.

This problem is believed to be only in the Multics CPU start up code, whereas the rest of Multics follows much more rigorous synchronization practices. The code that handles CPU start up was reviewed and potential race conditions identified, and stall points added to the simulator configuration to forestall problems.

This has fixed the problem for nearly all cases, but a few corner cases remain.  Heavily loaded systems may experience wait times exceeding the specified stall times, and very low-end systems (fewer host CPUs then the simulator CPU threads or insufficient cache for example) have been know to encounter occasional intermittent problems.

However, a reliable fail scenario was recently characterized, and tweaking stall point settings has proven ineffective, prompting a deeper examination into the issue.
React's checked/defaultChecked handling is wrong
Published: 2024-02-17 15:31:55

HTML forms have a very **logical and useful** behavior about how form values and default values are handled. For inputs whose value is equal to default value, changing default value automatically updates value too.

However, React breaks that behavior. It actually applies the correct DOM attribute/property, but overrides browser's behavior of setting DOM value automatically even for uncontrolled inputs.

Comparison of React vs Vanilla JS:

React: 

```js
import React from 'react';

export function App() {
  const [isDefaultChecked, setIsDefaultChecked] = React.useState(false);

  React.useEffect(() => {
    const id = setTimeout(() => setIsDefaultChecked(true), 100);
    return () => clearTimeout(id);
  }, []);

  return <input type="checkbox" defaultChecked={isDefaultChecked} />;
}
```

Vanilla JS:

```js
document.body.innerHTML = '<input type="checkbox" />';
const input = document.querySelector('input');

setTimeout(() => {
  // either set prop
  input.defaultChecked = true;
  // or add it as attr
  input.setAttribute('checked', '');
}, 100);
```
Reimplementar a API de Servlets em Rust?
Tags: java, rust, webdev
Published: 2024-02-17 15:16:17

Ontem à noite, estava eu confabulando em reimplementar toda a especificação de Servlets do Jakarta EE em Rust, porém existem desafios em Rust que já estão resolvidos em Java.

Quando falamos da especificação de servlets, como consta no livro (no PDF no caso), temos que prever duas entidades em separado:

1 - O Servlet em si
2 - O Container de Servlets


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

Esse é um pattern bem consolidado em Java, tanto que muitos frameworks em Java se utilizam do Pattern de uma forma ou de outra

- Spring, usando embedded containers
- Eclipse Jersey
- Akka HTTP (usa Eclipse Jetty por baixo)

Porém, para implementar isso como manda no livro, eu teria que implementar as duas entidades em separado e me apoiar em um sistema de plugins para conseguir prover o funcionamento dos servlets de forma plugável. 

Isso no Java já está superado faz tempo. Você pode implementar seu próprio classloader para isso ou se apoiar no URLClassLoader para encontrar as classes dinamicamente no file system. Já escrevi um blog post sobre isso.

https://dev.to/eronalves1996/how-classpath-scanning-works-behind-the-scenes-564b

Tecnicamente, você poderia fazer isso em qualquer runtime capaz de ler código dinamicamente. Porém em Rust isso é mais difícil. Temos que encarar alguns fatos

1 - Rust tem sua compilação padrão estática. Isso significa que ele produz um fat bundle com tudo que precisa.
2 - Podemos mudar a compilação para dinâmica, mas muita coisa não pode ser garantida nesse momento, pois Rust tem uma ABI instável.
3 - Apoiar-se na ABI de C significa perder muitos recursos e navegar em águas muito perigosas.

Este último fato significa que podemos ler shared objects compilados para a ABI de C, só que é bom lembrar que qualquer leitura de símbolo é uma operação unsafe e não temos qualquer garantia de que o símbolo existe no .so 

4 - Perda de performance.

Leitura e carregamento de um .so tem overhead de carregamento do arquivo em memória e o overhead associado ao ffi.

Existem outros perigos associados a isso, mas reimplementar a API de Servlets em Rust requer algumas adaptações para conseguirmos uma interface mais familiar para quem programa. Porém classifico muito mais como uma tarefa de aprendizado do que algo que tenha realmente utilidade.
Display: contents
Tags: css
Published: 2024-02-15 09:33:10

Из документации:
> display: contents;
> Браузеры удаляют любой элемент со свойством display, имеющим значение contents из дерева доступности. Это приводит к тому, что элемент (но не его дочерние элементы) больше не будут восприниматься технологиями чтения экрана. Дочерние элементы становятся дочерними элементами элемента следующего уровня в DOM.

**Пример использования**
В блоке располагаются строковые элементы двух типов. 
В целях тестирования понадобилось обернуть набор элементов каждого типа отдельным span (у которого проставлен data-testid для тестирования). При этом требуется, чтобы верстка эти span как бы не учитывала и вела себя так, будто их вовсе нет, что бы элементы двух типов просто шли друг за другом. Для этого у span-оберток достаточно проставить свойство [display: contents;](https://developer.mozilla.org/ru/docs/Web/CSS/display#display_contents)
Aliasing modules in Node.js
Tags: javascript, node
Published: 2024-02-17 15:05:17

## Issue

Importing modules in projects with extensive directory structures can become burdensome. This issue often arises due to file paths that might look like this: `require('../../../../some/very/deep/module')`.


## CommonJS Module Solution

To address this issue in the CommonJS module system, one can use the npm package module-alias. It helps to create path aliases. The usage is pretty straightforward:

Install the npm package and require it using `require('module-alias/register')` at the top of the main application file.
In package.json, create an object with mapping aliases, e.g., `"_moduleAliases": {"@root": "."}`.
Use the alias in the module like `const module = require('@root/some-module')`.

However, this approach [doesn't work with ES modules](https://github.com/ilearnio/module-alias/issues/59).


## ES Module Solution

For ES modules, native Node.js subpath imports can be used. To implement this, first create an imports field in package.json like `"imports": {"#*": "./src/*"}`.

To make this work with [Intelli-sense in VS Code](https://github.com/microsoft/TypeScript/issues/52460), add a paths section with mapping in jsconfig.json: "paths": `{"#middlewares/*": ["./middlewares/*"]}`.
Best Python Libraries for Automation and Efficiency!
Tags: pandas, tensorflow, python
Published: 2024-02-17 14:57:26

Python offers a wide range of libraries that empower developers to automate tasks seamlessly and unlock the full potential of their projects.

Discover the following 6 Best Libraries;

1. Pandas:
- Pandas is a powerful tool for data manipulation and analysis.
- Its DataFrame structure simplifies tasks like cleaning, filtering, and transforming data.
- It is indispensable for automation involving large datasets.

2. Selenium: Web Automation Made Effortless:
- Selenium is a popular library for web automation.
- It allows developers to control browsers and automate tasks like web scraping, testing, and repetitive workflows.
- Selenium's cross-browser compatibility enhances its appeal.

3. Beautiful Soup:
- Beautiful Soup excels in HTML and XML parsing.
- It is a formidable tool for extracting relevant information from websites.
- ideal for web data extraction in automation projects.
- Its intuitive syntax and flexibility make it a favorite among developers.

4. Requests:
- Requests simplify handling HTTP requests, making interactions with web APIs seamless.
- It provides a straightforward syntax and extensive functionality for tasks like data retrieval, authentication, and interaction with web services.

5. NumPy:
- NumPy is a fundamental library for numerical computing.
- Its array of operations and mathematical functions make it essential for automation projects involving scientific calculations, simulations, and data analysis.

6. TensorFlow:
- TensorFlow is an open-source machine learning library.
- It enables the development of models for tasks like image recognition and natural language processing.
- TensorFlow is a cornerstone for automation in the AI domain.
How to stream data over HTTP using Node and Fetch API
Tags: webdev, javascript, beginners, programming
Published: 2024-02-17 14:54:14

Introduction:

In the realm of web development, handling large datasets or real-time information can be a challenge. Traditional request-response patterns might not be the most efficient way to transfer data in such scenarios. This is where data streaming comes into play, providing a more responsive and resource-efficient approach. In this article, we will delve into the world of data streaming over HTTP using Node.js on the server side and the Fetch API on the client side.

The Motivation for Data Streaming:
Before we dive into the technical aspects, it's essential to understand why data streaming is crucial. In scenarios where data is continuously generated or fetched in chunks, streaming enables a more seamless and responsive user experience. Consider applications dealing with live updates, real-time analytics, or multimedia content; traditional request-response cycles might introduce latency, affecting performance and user satisfaction.

Setting up the Node.js Server:
To initiate data streaming from the server, we'll use Node.js with the Express framework. The first step involves creating a simple Express server and defining an endpoint for streaming data. This server will send a stream of numbers as an example. Utilize the Fetch API on the client side to consume this stream.

Implementing Data Streaming on the Server:
Node.js provides a powerful stream API. In this example, we'll create a custom Readable stream that generates a sequence of numbers. This stream is then piped to the response object, enabling a continuous flow of data to the client. This server-side setup is fundamental to the success of the streaming process.

Consuming the Stream on the Client Side:
On the client side, we'll use the Fetch API to initiate a request to the streaming endpoint. Unlike traditional fetch requests, where the entire response is loaded at once, we'll leverage the response.body.getReader() method to obtain a readable stream. Through asynchronous iteration, we can process the stream in chunks as it arrives, providing a real-time display of the streaming data.

Benefits of Data Streaming:
Efficiency: Data streaming minimizes the need for buffering large datasets, optimizing memory usage and improving overall performance.
Real-time Updates: Applications requiring real-time updates benefit from data streaming, ensuring users receive the latest information as it becomes available.
Reduced Latency: By transmitting data in smaller, manageable chunks, streaming reduces latency, enhancing the user experience.
Challenges and Considerations:
While data streaming offers numerous advantages, it's essential to be aware of potential challenges. Ensuring compatibility across different browsers, handling errors during streaming, and implementing proper cleanup mechanisms are aspects to consider when integrating streaming into your application.
RECOVER YOUR BITCOIN
Published: 2024-02-17 14:46:23

The Space Spy Recovery company still leaves me in a state of "wow," as I find it hard to believe how it was possible, but that is undoubtedly why they are tech specialists and are more knowledgeable than everyone else. It's almost like they are in a dream, or rather a trance. After my husband suggested that I get in touch with Space Spy Recovery, I painfully lost what felt like $316,000 before they surprisingly and cheerfully helped me get my money back while also providing expert advice on how to properly secure my account. They are indeed quite helpful, and you can reach them at:
 Email: soacespy@hackermail.com 
WhatsApp: +1 (458) 313 9075
Telegram: @spacespy65
Skype: live:.cid.2b75b0cf1ce9bf69
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/selcxt1z6hfejwo1gvyg.jpeg)
Types of Elastic Load Balancing (ELB)
Tags: aws, certification, elb, beginners
Published: 2024-02-17 14:41:39

When I was preparing for my AWS Solutions Architect - Associate (SAA-C03) exam, I found so many good topic that I want to share. One of them is Types of ELB.

So here are few question that click in my mind:
What is ELB ??
Are there 3 or 4 types of ELB ??. 
Do we use all types, when and where ??

So here are my finding on this topic.

**ELB** - Elastic Load Balancing. ELB automatically distributes incoming applications traffic across multiple targets such as Amazon EC2 instances. This can be done across multiple AZs.

Types: 3 or 4 ??

**There are 4 types of ELB.**

Application Load Balancer - ALB
Network Load Balancer - NLB
Gateway Load Balancer - GWLB
Classic Load Balancer - CLB
Are we using all ???

No CLB is a Legacy and so it is deprecated. But AWS encourages users to migrate to ALB or NLB - Why ?? See Details of each LB.

**Application Load Balancer - ALB :**

1. Routing HTTP/HTTPS traffic
2. Support Websocket
3. ALB Operate on Layer 7 of OSI Model. 7th Layer is Application Layer of OSI Model.
4. Intelligent Load Balancers

**Network Load Balancer - NLB :**

1. Routing TCP,TLS,UDP,TCP_UDP traffic
2. NLB operates on Layer 4 of OSI Model. 4th Layer of OSI model is Transport Layer.
3. It can handle millions of request per second. So when a user need to route thousands or ten thousands of concurrent connections they need NLB.
4. Performance Load Balancer

**Classic Load Balancer - CLB :**

1. Legacy load balancer.
2. Load Balance for HTTP/HTTPS traffic.
3. Use Layer 7 OSI Model specific features such as X-Forwarded & sticky sessions
.

**Gateway Load Balancer - GWLB :**

1. Routing IP traffic
2. GWLB operates on Layer 3 of OSI Model. 3th Layer of OSI model is Network Layer.
3. GWLB used to deploy, scale and run third-party virtual appliances like custom firewalls. More details on third-party appliances can be found here:{% embed https://dev.to/komallm/third-party-virtual-appliances-2j56 %}



**Key Differences :**

![Key Differences](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq2hlftx9g3a6pj7ovk0.png)