teleren/devto huggingface dataset:
2024-05-03 my weekly dev.to recommendation
Tags: community, bestofdev, workplace, devto
Published: 2024-05-03 16:00:00

Many articles but also topics in my weekly dev.to recommendations.

These are the articles I liked and recommend you reading

## you are your own maintainer

{% embed https://dev.to/fermyon/it-took-me-20-years-to-learn-this-lesson-about-dev-1mep %}

I would sum up like this: your today's code is your future legacy code.

Thanks @technosophos for sharing your thoughts on dev and work

{% spoiler Here are the articles I wrote about same topics _(click to unfold)_ %}

{% embed https://dev.to/ccoveille/how-to-be-a-better-developer-for-you-and-the-others-1244 %}

{% embed https://dev.to/ccoveille/know-your-cognitive-biases-know-yourself--2iom %}

{% endspoiler %}

## why and when automating things

{% embed https://dev.to/grayside/why-automate-1fac %}

Thanks @grayside, I can see your passion to XKCD

## a good article about password management

{% embed https://dev.to/gearoidotreasaigh/password-management-the-basics-4d40 %}

Thanks @gearoidotreasaigh

## An interesting and detailed article about code review.

I approve and second author's guidelines and ideas:
{% embed https://dev.to/tassiofront/mastering-code-review-a-guide-for-reviewers-and-pr-creators-ac6 %}

Thanks @tassiofront 

## The story behind gzip

{% embed https://dev.to/huizhou92/the-magical-algorithms-written-by-two-old-men-dominating-the-world-3h12 %}

Thanks @huizhou92 

## why you need a rubber duck

The amazing rubber duck techniques I use for years now, explained and discussed in this post

{% embed https://dev.to/anitaolsen/are-you-into-rubber-duck-debugging-3ndm %}

Thanks @anitaolsen 

## an interesting alternative to classic Readme profile on GitHub

{% embed https://dev.to/tungbq/github-create-your-own-repository-landscape-16i5 %}

Thanks @tungbq 

## a good article article about email protection behind tools, but also privacy

{% embed https://dev.to/devh0us3/protect-your-emails-short-note-4k4e %}

Thanks @devh0us3
Conditional Expressions
Tags: java, programming, learning, beginners
Published: 2024-05-03 15:57:47

A conditional expression evaluates an expression based on a condition.
You might want to assign a value to a variable that is restricted by certain conditions. For example, the following statement assigns **1** to **y** if **x** is greater than **0**, and **-1** to **y** if **x** is less than or equal to **0**.

```
if (x > 0)
 y = 1;
else
 y = -1;
```
Alternatively, as in the following example, you can use a conditional expression to achieve the same result.

```
y = (x > 0) ? 1 : -1;

```
Conditional expressions are in a completely different style, with no explicit **if** in the statement. The syntax is:

```
boolean-expression ? expression1 : expression2;

```
The result of this conditional expression is **expression1** if **boolean-expression** is true; otherwise the result is **expression2**. Suppose you want to assign the larger number of variable **num1** and **num2** to **max**. You can simply write a statement using the conditional expression:

```
max = (num1 > num2) ? num1 : num2;

```
For another example, the following statement displays the message “num is even” if **num** is even, and otherwise displays “num is odd.”

```
System.out.println((num % 2 == 0) ? "num is even" : "num is odd");

```
As you can see from these examples, conditional expressions enable you to write short and concise code.
The symbols **?** and **:** appear together in a conditional expression. They form a _conditional operator_ and also called a _ternary operator_ because it uses three operands. It is the only ternary operator in Java.
Fun popping text
Tags: codepen
Published: 2024-05-03 15:40:54

Hello All! 

This is my first post. I just thought this was neat enough to share. 

[Poppin' text](https://codepen.io/EricAlain/pen/eYXPbNr)

I wanted to play around and practice with JavaScript request animation loops, math and classes while also making something fun in the process. 

It hope that it brightens your day a little bit, if nothing else! 

Eric
Day 33/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-05-03 15:38:43

🚀 **Today's Learning:**

🌟 DSA
- Reverse words in a given string
- Longest common prefix

🌟 Dev
- SSR vs CSR

🔍 **Some Key Highlights:**

DSA

To reverse words in a given string, start by splitting the string into words. Then, iterate through the words in reverse order and append them to form the reversed string, ensuring to add spaces between words. Finally, return the reversed string. This process effectively flips the order of words while maintaining their individual characters' order within each word.

For finding the longest common prefix among an array of strings, first, set the prefix as the first string in the array. Then, iterate through the remaining strings and compare each character of the prefix with the corresponding character of the current string. If there's a mismatch or if the prefix length exceeds the length of the current string, trim the prefix accordingly. Repeat this process until the prefix is the longest common prefix among all strings in the array, then return the prefix.

DEV

Server-Side Rendering (SSR) involves rendering the web page on the server and sending a fully rendered page to the client. When a user requests a page, the server processes the request by executing the JavaScript code and generating the HTML content to be sent back to the browser. This approach provides faster initial load times and better SEO because search engine crawlers can easily parse the HTML content.

Client-Side Rendering (CSR), on the other hand, involves sending a minimal HTML document to the client, which includes links to JavaScript and CSS files. The browser then downloads these files and executes the JavaScript code to render the page dynamically. This approach provides a smoother and more interactive user experience, as the page can update without full page reloads. However, initial load times may be slower, and SEO can be more challenging since search engine crawlers may not execute JavaScript.

 #100daysofcode #1percentplusplus #coding #dsa
Meetup Online de Elixir no dia 21/05/2024
Tags: elixir
Published: 2024-05-03 15:33:19

Vamos realizar um Meetup Online no dia 21/05/2024, terça-feira, à noite (ou no fim da tarde). Este formulário é para consultar se você tem interesse em participar e para fazer uma enquete sobre o horário. A duração do encontro deverá ser entre 1 e 2 horas e será realizado na plataforma Google Meet (com gravação).

Formulário: 

<https://docs.google.com/forms/d/e/1FAIpQLSdDSImogMe0Jv4IJvYVy6oN5stu7Cx8ctJiASaHG4NMi_7CXw/viewform?usp=sf_link>

Vamos tentar trazer palestrantes da Elixir Days para uma Mesa Redonda.Para saber mais sobre a Elixir Days, acesse 

<https://www.elixirdays.com/>

 Para saber mais sobre o ELUG CE, acesse 

<https://elug-ce.github.io/>

 Aceitaremos respostas até 06/05/2024.
PrestaShop Module : Car Filter
Published: 2024-05-03 15:15:13

A car Filter in your Shop.

Filter  by  Make, Model, Carburant,  Motor  Volume, Carburant, Year  etc.

Add   a  Filter   for   cars  in  your   website.

This   module  will  allows   your  customers   to   search  for   a  Car  by  Make,  Model, Type, Year  etc.
https://prestatuts.com/store/home/20-car-filter.html
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3bqw93sxtdtywlx3wwd.jpg)
Computer Networks: What is Protocol?
Tags: networking, network
Published: 2024-05-03 15:12:10

'Protocol' is a term frequently used in discussions about computer networks, but have you ever paused to consider what it signifies and how it functions? 
In this article, I will write about the very basic concept of 'protocol'.


1. [What is the protocol?](#what-is-protocol?)
2. [Various Types of Protocols](#various-types-of-protocols)
3. [Protocol for Packet Switching](#protocol-for-packet-switching)

## What is the protocol?
In short, a protocol is a set of rules that computers follow to communicate. Just as you use English with your friends, knowing the rules of grammar, vocabulary, and pronunciation, computers also use specific rules for communication, which we call protocols.

If the protocol is different between computers, they cannot do data communications like you cannot communicate with people who use a different language.


## Various Types of Protocols
Here are some examples of protocols: 
### 1. IP (Internet Protocol)
Rules used for Internet-like communications
### 2. FTP (File Transfer Protocol) 
Rules used for transferring files
### 3. SMTP (Simple Mail Transfer Protocol)
Rules used for sending emails
### 4. POP (Post Office Protocol)
Rules used for retrieving emails
### 5. IMAP (Internet Message Access Protocol)
Rules used for accessing emails
### 6. HTTP(Hypertext Transfer Protocol)
Rules used for viewing web pages
### 7. TCP (Transmission Control Protocol)
Rules used for secure communications
### 8. UDP (User Datagram Protocol)
Rules used for fast communications


## Protocol for Packet Switching
Packet switching is the transfer of small pieces of data across various networks.

![Packet Switching](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6kglx58ubm9pme034e71.png)

The process of packet switching in network communications is quite similar to the way parcels are handled in postal services. When sending data, attach a header to each packet of data, which contains not only the addresses but also a sequence number. These packets are easier to send across the network because they can travel independently of each other. Upon reaching their destination, these packets are then reassembled into their original form.


In my next post, I will write about the concept of protocol layering. This is a model that simplifies network protocols by dividing the necessary functions into seven distinct layers. By segmenting functions, this model helps to manage and optimize communications more efficiently.
SQLServer service status monitoring on Windows with Prometheu.
Tags: sre, monitoring, prometheus
Published: 2024-05-03 15:07:31

This is the procedure for monitoring the service status of SQLServer on Windows with Prometheu.

++++++++++++++++++++++++++++++++
[environment].
prometheus : Ver. 2.23.0
prometheus-alertmanager : Ver. 0.15.3
++++++++++++++++++++++++++++++++

Describe the SQLserver service monitoring rules in the yml file (rules.yml by default) where the monitoring rules are set.
In this case, we will describe a configuration that alerts when the state of the SQLServer service is anything other than ‘started’.

```yaml
- alert: SQLServer-ServiceDown
  expr: windows_service_state{job="[job name]", name="[target instance service name]", state="running"} == 0   #1 is running, 0 is not running
  for: 7m   #If this duration is exceeded, the alert will change from Warning to Critical. s(seconds) m(minutes)
  labels:
      AlertGp: [alert group name]  #This name is arbitrary. You can set any group label for the alert. This label can be used in alertmanager.yml.
```
165. Compare Version Numbers
Tags: php, leetcode, algorithms, programming
Published: 2024-05-03 15:05:45

165\. Compare Version Numbers

Medium

Given two version numbers, `version1` and `version2`, compare them.

Version numbers consist of **one or more revisions** joined by a dot `'.'`. Each revision consists of **digits** and may contain leading **zeros**. Every revision contains **at least one character**. Revisions are **0-indexed from left to right**, with the leftmost revision being revision 0, the next revision being revision 1, and so on. For example `2.5.33` and `0.1` are valid version numbers.

To compare version numbers, compare their revisions in **left-to-right order**. Revisions are compared using their **integer value ignoring any leading zeros**. This means that revisions `1` and `001` are considered **equal**. If a version number does not specify a revision at an index, then **treat the revision** as `0`. For example, version `1.0` is less than version `1.1` because their revision 0s are the same, but their revision 1s are `0` and `1` respectively, and `0 < 1`.

_Return the following:_

- If `version1 < version2`, return `-1`.
- If `version1 > version2`, return `1`.
- Otherwise, return `0`.


**Example 1:**

- **Input:** version1 = "1.01", version2 = "1.001"
- **Output:** 0
- **Explanation:** Ignoring leading zeroes, both "01" and "001" represent the same integer "1". 

**Example 2:**

- **Input:** version1 = "1.0", version2 = "1.0.0"
- **Output:** 0
- **Explanation:** version1 does not specify revision 2, which means it is treated as "0".

**Example 3:**

- **Input:** version1 = "0.1", version2 = "1.1"
- **Output:** -1
- **Explanation:** version1's revision 0 is "0", while version2's revision 0 is "1". 0 < 1, so version1 < version2.

**Constraints:**

- <code>1 <= version1.length, version2.length <= 500</code>
- `version1` and `version2` only contain digits and `'.'`.
- `version1` and `version2` **are valid version numbers**.
- All the given revisions in `version1` and `version2` can be stored in a **32-bit integer**.


**Solution:**

```
class Solution {

    /**
     * @param String $version1
     * @param String $version2
     * @return Integer
     */
    function compareVersion($version1, $version2) {
        $levels1 = explode('.', $version1);
        $levels2 = explode('.', $version2);
        $length = max(count($levels1), count($levels2));

        for ($i = 0; $i < $length; $i++) {
            $v1 = isset($levels1[$i]) ? (int)$levels1[$i] : 0;
            $v2 = isset($levels2[$i]) ? (int)$levels2[$i] : 0;
            if ($v1 < $v2) {
                return -1;
            }
            if ($v1 > $v2) {
                return 1;
            }
        }

        return 0;
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
How to Visualize VRS Files
Tags: cpp, ai, tutorial, opensource
Published: 2024-05-03 15:04:04

{% cta https://www.rerun.io/examples/spatial-computing/vrs %} Source Code {% endcta %} {% cta https://www.rerun.io/examples %} Explore Other Examples {% endcta %}

This C++ example demonstrates how to visualize VRS files with Rerun. VRS is a file format optimized to record & playback streams of sensor data, such as images, audio samples, and any other discrete sensors (IMU, temperature, etc), stored in per-device streams of time-stamped records.

# Logging and visualizing with Rerun

The visualizations in this example were created with the following Rerun code:

---

## 3D arrows 

```cpp
void IMUPlayer::log_accelerometer(const std::array<float, 3>& accelMSec2) {
    _rec->log(_entity_path + "/accelerometer", rerun::Arrows3D::from_vectors({accelMSec2}));
    // … existing code for scalars …
}
```

---

## Scalars 

```cpp
void IMUPlayer::log_accelerometer(const std::array<float, 3>& accelMSec2) {
    // … existing code for Arrows3D …
    _rec->log(_entity_path + "/accelerometer/x", rerun::Scalar(accelMSec2[0]));
    _rec->log(_entity_path + "/accelerometer/y", rerun::Scalar(accelMSec2[1]));
    _rec->log(_entity_path + "/accelerometer/z", rerun::Scalar(accelMSec2[2]));
}

void IMUPlayer::log_gyroscope(const std::array<float, 3>& gyroRadSec) {
    _rec->log(_entity_path + "/gyroscope/x", rerun::Scalar(gyroRadSec[0]));
    _rec->log(_entity_path + "/gyroscope/y", rerun::Scalar(gyroRadSec[1]));
    _rec->log(_entity_path + "/gyroscope/z", rerun::Scalar(gyroRadSec[2]));
}

void IMUPlayer::log_magnetometer(const std::array<float, 3>& magTesla) {
    _rec->log(_entity_path + "/magnetometer/x", rerun::Scalar(magTesla[0]));
    _rec->log(_entity_path + "/magnetometer/y", rerun::Scalar(magTesla[1]));
    _rec->log(_entity_path + "/magnetometer/z", rerun::Scalar(magTesla[2]));
}
```

---

## Images 

```cpp
_rec->log(
    _entity_path,
    rerun::Image({
    frame->getHeight(),
    frame->getWidth(),
    frame->getSpec().getChannelCountPerPixel()},
    frame->getBuffer()
    )
);
```

---

## Text document 

```cpp
_rec->log_timeless(_entity_path + "/configuration", rerun::TextDocument(layout_str));
```

---

## Join us on Github
{% github https://github.com/rerun-io/rerun %}
Why is a web data scraper necessary in the age of AI?
Tags: data, scraping, scraper, scrapingtool
Published: 2024-05-03 15:00:34

## Before we delve into why one might need a data scraper in the age of AI, let’s first understand what data scraping and AI are.

Data scraping is a technique used to gather data. A data scraper collects, organizes, and stores data in a pre-determined format, and customized file format (link) as per the user’s requirements.

On the other hand, Artificial Intelligence (AI) is a field that utilizes such data to make intelligent decisions and predictions through pre-modeled data.

In those cases, Data Scrapping SaaS Web Tools/Software, Octoparse helps the AI Engineer figure out the actual data, suggest through collective data, and break the barriers in a miss leaded data that is so while needs data accuracy in AI use cases Octoparse, undoubtedly a market leading Web Data, Apps Data solutions for your AI-based IT Firms and Company, Whether it’s a SMBE’s like us or an Iconic Business Leader in the world.

Now delve into data scraping in the AI age, Data scraping plays a vital role in the age of AI for these desired reasons;

Training AI Models: As the Data Scrapping Tool is a well-researched data industry solution that is so it’s a complete solution for any AI Model, and no need of wasting to training AI models to collect large amounts of data for training because the best AI-Driven Data Scrapper the Octoparse collect any amounts of data from various sources with accuracy and, good as the quality of its data.

Efficiency and Speed: Suggestive, generative, and collective with potential efficiency and speed, goodies to mention; time-consuming, accuracy, and deliveries data without any breakout, as you command as exactly you get.

Quality and Consistency: As a Quality Data Scraper, Octoparse provides all scraped data with 100% accuracy and deliveries data without any breakout, so you command as exact as you get, and provide data with 100% accuracy, there is no chance of any data inconsistency because of pre-module data automation and well-structured data filtering process (coherent and noncoherent).

Cost-Effective: Quality and accurate data we generate with the highest speed through multitasking on one platform because it’s time-consuming and cost-effective.

Competitive Advantage: Compressional with competitive features in data scraping industry tools, Octoparse’s Updated features are fully extended for any type of data scraping solution seekers, i.e.: Read more- [Octoparse that since a long contributing us to business growth](https://www.quora.com/Why-is-a-web-data-scraper-necessary-in-the-age-of-AI/answer/Momenul-Ahmad)
Day in the Life of a Microsoft Software Engineer | Vancouver 2024
Tags: career, microsoft, webdev, developer
Published: 2024-05-03 14:59:40

I love making these Day in the Life videos for myself so that I have something to look back on. That is one reason why I keep these videos very authentic.

This video is for anyone interested in what the daily routine looks like of a front-end software engineer working at Microsoft. Some days/weeks are more busy than others, but I purposely made this during one of the lighter days so that I had time to record stuff.

I filmed this on April 30th, 2024 in Vancouver, BC, Canada.

{% youtube KNMBqgX-eGg %}

Thanks for checking it out!
Install Java in macbook M1/M2/M3
Published: 2024-05-03 14:58:00

Install Homebrew: If you haven't already installed Homebrew, you can do so by opening Terminal and running the following command:
bash

```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    

```
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/user_name/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
```
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

Install JDK using Homebrew: Once Homebrew is installed, you can install the JDK for ARM-based Macs by running the following command:
bash

```
brew install --cask temurin
```
This will install the Temurin JDK, which is compatible with ARM-based Macs.
Verify Installation: After installation, you can verify that Java is installed by running:
bash

```
java -version
```
This command should display the version of Java installed on your system.
Introduction to Appwrite: A Comprehensive Overview
Tags: cms, webdev, inivac
Published: 2024-05-03 14:54:25


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

In the ever-evolving landscape of web and mobile app development, having a robust backend service is crucial for efficient and secure operations. One such platform that has been gaining traction in the developer community is Appwrite. Appwrite is an open-source backend server that simplifies the process of building and managing web and mobile applications. In this article, we will delve into the features, benefits, and use cases of Appwrite, shedding light on why it has become a popular choice among developers.
What is Appwrite?
Appwrite is a self-hosted backend server that provides a set of easy-to-use APIs for developers to build secure and scalable applications. It offers a range of features including user authentication, database management, file storage, and more. With Appwrite, developers can focus on creating innovative frontend experiences without worrying about the complexities of backend infrastructure.
.... go to follow link to continue reading [](url)(https://blog.inivac.co/2024/05/introduction-to-appwrite-comprehensive.html)
small/forms
Tags: php, symfony, showdev, api
Published: 2024-05-03 14:52:47

Here is a small library to validate and transform api data.

It can read Symfony atrtributes and you can normalize input data with modifiers like this :
```php
namespace App\DTO;

use Small\Forms\Modifier\NullIfEmptyModifier;use Small\Forms\ValidationRule\ValidateNotEmpty;
use Small\Forms\ValidationRule\ValidateGreaterOrEqual;

class Person
{

    #[ValidateNotEmpty]
    private string $name;
    #[ValidateGreaterThanOrEqual(18)]
    #[NullIfEmptyModifier]
    private int $age;

}

try {

    $form = \Small\Forms\FormBuilder::createFromAdapter(
        new \Small\Forms\Adapter\AnnotationAdapter($person)
    )->validate($messages = new \Small\Collection\Collection\StringCollection())
    ->hydrate($employe = new App\Entity\Employe());

} catch (\Small\Forms\ValidationRule\Exception\ValidationFailException) {
    return new \Symfony\Component\HttpFoundation\JsonResponse($messages, \Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST);
}
```

You can check it on on my gitlab server : [https://git.small-project.dev/lib/small-forms](https://git.small-project.dev/lib/small-forms)
And packagist : [https://packagist.org/packages/small/forms](https://packagist.org/packages/small/forms)
Kubernetest (on-prem) master node and worker node associations.
Tags: sre, k8s
Published: 2024-05-03 14:14:10

Procedure for reassociating worker nodes with the master node in on-premise Kubernetes after restarting the worker nodes.
++++++++++++++++++++++++++++++++
[Environment]
Ubuntu 20.10
Cluster Version 1.22.2
++++++++++++++++++++++++++++++++

#1) Reset the state of kubelet using kubeadm. (on the worker node)
```
$ kubeadm reset
```


#2) Generate the --discovery-token-ca-cert-hash (on the master node)
```
$ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
```
Paste the output hash into a notepad for later use.


#3) Generate a --token (on the master node)
```
$ kubeadm token create
```
Copy and paste the output token into a notepad.


#4) Reassociate with the master node (on the worker node)
Use the values output in steps 2) and 3).
```
kubeadm join [Master Node IP]:6443 --token [token created on master node] --discovery-token-ca-cert-hash sha256:[hash value created on master node]
```