teleren/devto huggingface dataset:
Wednesday Links - Edition 2023-07-12
Tags: java, jvm, kotlin, gradle
Published: 2023-07-12 11:19:52

Garbage Collection and P99 Latency (6 min)🗑️
https://www.javaspecialists.eu/archive/Issue310-Garbage-Collection-and-P99-Latency.html

Active Health Check strategies with Spring Cloud Gateway (8 min)❤️
https://spring.io/blog/2023/07/05/active-health-check-strategies-with-spring-cloud-gateway

Reactive Programming Made Easy (3 min)👯
https://blog.jetbrains.com/idea/2023/06/reactive-programming-made-easy/

Awesome AssertJ: Check Base64 Encoded Strings (1 min)🔣
https://blog.mrhaki.com/2023/07/awesome-assertj-check-base64-encoded.html

Awesome AssertJ: Use String Template To Verify String Value (1 min)📝
https://blog.mrhaki.com/2023/07/awesome-assertj-use-string-template-to.html

Simpler Kotlin DSL Property Assignment (3 min)🟰
https://blog.gradle.org/simpler-kotlin-dsl-property-assignment

Kotlin Context Receivers: A Comprehensive Guide (14 min)📞
https://blog.rockthejvm.com/kotlin-context-receivers/

Kotlin 1.9.0 Released (3 min)🎉
https://blog.jetbrains.com/kotlin/2023/07/kotlin-1-9-0-released/

The Code Review Pyramid (30 sec)🔺
https://twitter.com/alexxubyte/status/1677334523892338688/photo/1
[Summary] Chapter#10 "The Internals of PostgreSQL" Base Backup and Point-in-Time Recovery
Tags: postgres, apacheage, devcommunity, bitnine
Published: 2023-07-12 11:14:53

Database is classified into two categories:
- Logical Backup 
- Physical Backup
Both has there advantages and disadvantages and one of the disadvantage of logical Backup is it takes too much time for its performance, but physical Backup takes relative shorter time for to restore large databases.
**Point-in-time architecture** is feature to restore cluster to any point in time using base backup and archive logs.

**Base Backup**
Following the standard procedure for base backup using low level commands:
- Issue the pg_backup_start Command.
- Take a snapshot of database clusters with the archiving command you want to use.
- Issue the pg_backup_stop command.

**How Point-in-time recovery Works:**
PostgreSQL in PITR-mode replays WAL data of the archive logs on the base backup, from the redo point created by the pg_backup_start up to the point you want to recover. In PostgreSQL point to be recovered is referred to as a recovery target.

**TimelineId and timeline history file**
To distinguish between original database clusters and recovered database cluster PostgreSQL use Timeline and it is central concept of PITR.
Two associated things are following:
- TimelineID
Each timeline has its timelineId which is 4-byte unsigned Integer starts from 1.
TimelineId for original database cluster is 1, and when database cluster recovers, timelineId will be increased by 1.

- Timeline History
When PITR process completes a timeline history file names like "00000002.history" is created under the archival directory and pg_xlog subdirectory. This file records which timeline is branched off from and when.

Timeline history contain atleast one line and each line is composed of the following three lines:
- TimelineID: It is used to recover.
- LSN logs: LSN location where WAL segment switches happend.
- Reason: Human readable explanation of why the time was changed.

**Point-in-time Recovery with Timeline History File**
It is used when Second time recovery happen. Suppose you have made mistake at 12:15:00 in the recovered database cluster whose timelineId is 2, to recover database cluster, you should create a new recovery.conf.

[Reference](https://www.interdb.jp/pg/pgsql10.html)
International Conference On Machine Learning
Tags: webdev, research, devjournal, abcdindex
Published: 2023-07-12 11:10:02

**


Conference is a place where scholars, researchers, fellow researchers, academicians and other individuals can represent their work, meet people having similar goals, discuss the problems, progress and outcomes of their research, accept suggestions and get new ideas to conduct further research. In the present scenario, finding information regarding conferences is not a hard nut to crack, but finding valid information is still not an easy task. To make this as easy as cakewalk for students, scholars and for other institutions or individuals,  ABCD Index provides a list of conferences according to the need and preference of individuals.

[International Conference On Machine Learning
](https://abcdindex.com/blogs/international-conference-on-machine-learning)
To get the list of conferences on ABCD Index kindly follow the steps given below –
 
Step 1 – open the home page of ABCD index. (to access the homepage of ABCD Index kindly type ABCD Index on the search bar of browser or click on the link - https://abcdindex.com/blogs/how-to-submit-a-paper-to-a-conference
 
Step 2 -  on the homepage of ABCD index platform you can see some menus on the top of the window like home, about, publishers, reviewer etc. to get list of conferences going to held, ABCD Index provides two types of way for getting the list you are looking f kindly go to reviewer or publishers tab.
1.  Way to reach conference by reviewer menu –
-       click on the  reviewer menu, a drop down list will pop up on the screen; kindly look for the  ‘conference’ in the list and select it by clicking on the conference option.
-       By doing as directed above, a list of conferences will be visible on your screen.
 
2.   Way to reach conference by publishers menu
 
-        click  on the publisher menu , a list of options will be visible on the screen, now select ‘conference’ from the list; this will lead you to the list of conferences.

One can also click on the link to get the list of conference- https://abcdindex.com/blogs/how-to-publish-a-conference-paper
Linux'ta TCPDump ve Wireshark Kullanarak Ağ Trafik Analizi
Tags: wireshark, capturing, network, linux
Published: 2023-07-12 11:04:57

Linux'ta TCPDump ve Wireshark kullanarak ağ trafiğini analiz etmek, veri iletimini izlemenin ve ağ hatalarını veya güvenlik ihlallerini belirlemenin etkili bir yoludur.


#Wireshark ile Paket Analizi

**Wireshark Kurulumu**

Debian tabanlı dağıtımlarda Wireshark'ı yüklemek için aşağıdaki komutları kullanabilirsiniz:

```
sudo apt-get update
sudo apt-get install wireshark
```

Red Hat tabanlı dağıtımlarda ise şu komutları kullanabilirsiniz:

```
sudo yum install wireshark
```

**Wireshark Kullanımı**

Wireshark'ı başlattıktan sonra, TCPDump ile oluşturulan veya herhangi bir şekilde erişilebilinen .pcap dosyasını açabilirsiniz. "File" menüsünden "Open" seçeneğini tıklayın ve .pcap dosyanızı bulun.


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


Dosyayı açtıktan sonra, paketlerin listesini ve her bir paketin detaylarını görürsünüz. Bir paket seçtiğinizde, paketin ayrıntıları alt panellerde görünür.


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


Wireshark ayrıca gelişmiş filtreleme seçenekleri sunar. Bu filtreler, belirli bir protokol, IP adresi veya port numarası gibi özelliklere göre paketleri filtrelememizi sağlar. Bu, geniş veri setleri arasında belirli bilgileri bulmayı kolaylaştırır.

Wireshark'ta "Display Filter" bölümüne yazarak paketleri filtreleyebilirsiniz. Örneğin, SSH paketlerini görmek için "ssh" yazabilirsiniz.


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


"Statistics" menüsünden erişilebilecek bir dizi istatistik ve grafik sunar. Bu özellikler, ağ performansı, TCP akış analizi, protokol hiyerarşisi ve daha fazlası hakkında bilgi sağlar.

Sonuç olarak, TCPDump ve Wireshark, Linux'ta ağ trafiğini analiz etmek için oldukça etkili araçlardır. TCPDump, komut satırı tabanlı bir paket yakalama aracıdır ve hafifliği ve esnekliği nedeniyle popülerdir. Wireshark ise grafiksel bir kullanıcı arayüzü sunar ve ayrıntılı ağ analizi ve filtreleme yetenekleri ile bilinir. Bu iki araç birlikte kullanıldığında, ağ trafiğini detaylı bir şekilde analiz etmek mümkün hale gelir.
comment utiliser la balise img et ses attributs afin d'ajouter des images sur une page html?
Tags: html, img
Published: 2023-07-12 11:01:53

1.Insertion des images aux pages html
 Pour insérer une image en HTML, il faut utiliser la balise < img > et préciser la source du fichier image avec l'attribut « src ». Le code HTML est le suivant : < img src="URL source" >.
2.les attributs de la balise “img”
  a.L'attribut src
L'attribut src est le seul attribut indispensable pour faire fonctionner la balise HTML : il est nécessaire et suffisant. C'est en effet l'attribut source qui permet d'indiquer à la machine le chemin à suivre pour récupérer le fichier image à afficher sur la page web. La source est au choix : l'URL du site tiers d'où provient l'image, ou le nom du fichier image préalablement enregistré dans le répertoire ou un sous-répertoire de la page HTML. 
Exemple de code pour insérer une image issue d'une banque d'images, avec la balise img src HTML, sous un paragraphe de texte :
< p >Voici le paragraphe de texte< /p >
< img src="https://banque.images.com/image-de-paragraphe.jpeg" >
  b.L'attribut alt
L'attribut alt n'est pas nécessaire, mais recommandé.
Cet attribut permet d'afficher du texte lorsque l'image ne se charge pas, quelle qu'en soit la raison.
Le texte alternatif décrit l'image, permettant aux logiciels de lecture d'écran de traduire le visuel à l'oral à destination des visiteurs malvoyants.
L'attribut alt permet à Google Images d'indexer le visuel sur les mots-clés renseignés, contribuant ainsi à améliorer le référencement naturel de la page web. À noter que dans le même objectif, il est judicieux de nommer le fichier image source à l'aide de mots-clés pertinents.
Pour insérer une image HTML avec un texte alternatif : < img src="https://banque.images.com/image-de-paragraphe.jpeg" alt="texte alternatif" >
  c.Les attributs height et width
Ces attributs permettent de changer la taille de l'image, en hauteur et en largeur. Pour redimensionner l'image en langage HTML, il faut renseigner les valeurs en pixels ou en pourcentage dans la balise img src : < img src="https://banque.images.com/image-de-paragraphe.jpeg" alt="texte alternatif" width=100% height=10% >.
  d.L'attribut title
L'attribut title permet d'animer l'image : tant que le visiteur du site pointe sa souris sur le visuel, une bulle d'information apparaît. Pour afficher du texte au survol de l'image : < img src="https://banque.images.com/image-de-paragraphe.jpeg" alt="texte alternatif" width=100% height=10% title="bulle d’aide" >.
Unique and Random Pixel Profile Picture for Anonymous User
Published: 2023-07-12 11:01:14

## Live Preview

Live preview available on : https://rizmyabdulla.github.io/Anonymous-dp/

## Anonymous-dp Intergration via CDN

import javascript code via : https://cdn.jsdelivr.net/gh/RizmyAbdulla/Anonymous-dp@main/index.js

```
<script src="https://cdn.jsdelivr.net/gh/RizmyAbdulla/Anonymous-dp@main/index.js"></script>
```

## Using Anonymous-dp in HTML webpage

create `canvas` element with id `profile-picture` with `width` 200 and `height` 200

```
<canvas id="profile-picture" width="200" height="200"></canvas>
```

you can save profile image by a creating a `button` Element with id `save-dp`

```
<button id="download-dp">Download dp</button>
```

if you want to generate DP with a button Element,use id `generate-dp`.

```
<button id="generate-dp">Generate dp</button>
```

if you want to submit this Profile picture in `form`, use class name `submit-dp` to a `input` button type Element.

```
<form action="post">
   <input type="button" class="submit-dp" value="Submit" />
</form>
```
How the Immune System Can Inspire New Cyber Security Defenses
Published: 2023-07-12 10:49:53

<u>**Five concepts from the immune system that can be applied to cyber security**</u>



```
1.Pattern recognition:
```
 

> The immune system is able to recognize patterns in invaders, such as viruses or bacteria. This allows it to mount a targeted attack against the invader. In cyber security, **pattern recognition can be used to identify malicious code or patterns in network traffic**. For example, an intrusion detection system (IDS) might be able to identify a pattern that is indicative of a denial-of-service attack.

```
2.Adaptation
```

> The immune system is able to adapt to new threats. This is because it learns from previous encounters with invaders. In cyber security, **adaptation can be used to develop systems that can learn from previous attacks and become better at detecting and preventing new attacks**. For example, a machine learning model could be trained to identify malicious code based on a dataset of previously seen attacks.

```
3.Self-healing:
```

> The immune system is able to repair itself after an attack. This is because it has cells that are specifically designed to repair damaged tissue. In cyber security, **self-healing can be used to develop systems that can repair themselves after an attack**. This can help to prevent an attack from spreading or causing damage. For example, a self-healing system might be able to identify and repair a file that has been infected with a virus.

```
4.Memory:
```

> The immune system remembers previous encounters with invaders. This allows it to mount a faster and more effective attack against the invader on subsequent encounters. In cyber security, memory can be used to develop systems that **can remember previous attacks and be better prepared to defend against them**. For example, a system could be designed to store information about previous attacks, such as the type of attack, the time of day it occurred, and the IP address of the attacker. This information could then be used to detect and prevent future attacks.

```
5.Diversity:
```

> The immune system is made up of a diverse range of cells and proteins. This diversity helps it to protect against a wide range of threats. In cyber security, diversity can be used to develop systems that are more resistant to attack. **For example, a system could be designed to use a variety of different security measures,such as firewalls, intrusion detection systems, and antivirus software**. This would make it more difficult for an attacker to breach the system.

Let me hear what you think in the comments.
Perl Weekly Challenge #225 - Words to the Max and Diff Sum
Tags: perl, perlweeklychallenge, words
Published: 2023-07-12 10:38:28

Hi all! Back this week with both solutions to The Weekly Challenge for once. We've got a word counting challenge and one that I really don't know how to explain. You have to see the challenge to understand it.

#### Max Words

So this challenge is just to tell us what the longest sentence in a set of sentences is. How many words does it have? A very simple easy solution can follow:

    my $highest;
    foreach (@ARGV) {
        my @words = split(/ /, $_);
        shift @words if !$words[0];
        $highest = scalar @words if scalar @words > $highest;
    }
    say $highest;

We take the input sentences (in quotes) and split them by spaces. Now, I tested and splitting by space puts an empty element at the start of the array, so if there is such an empty element we remove it with the shift. Then we check the number of words in this sentence and replace the existing champion if this one is the highest. That one's pretty simple and took just about 15 minutes to write and test.

#### Left Right Sum Diff

No idea what the actual practical purpose of this one is, but it's an interesting challenge and a lot simpler than I initally thought, although I realized in the middle there were some additional cases to handle from what I was thinking.

The goal is to split a list of integers into `@left`, made of `(0, $ints[0], $ints[0] + $ints[1], etc.)` and `@right`, made of 'etc., $ints[-2] + $ints[-1], $ints[-1], 0)`. Then we iterate through and for each pair we take the absolute difference between `$left[$_]` and `$right[$_]`.

So here's the code:

    my @ints = @ARGV;
    my (@left, @right, @diff);
    push @left, 0;
    unshift @right, 0;
    if ($#ints) {
        foreach (1..$#ints) {
            push @left, $left[$_ - 1] + $ints[$_ - 1];
            unshift @right, $right[-$_] + $ints[-$_];
        }
    }
    foreach (0..$#ints) {
        $diff[$_] = abs($left[$_] - $right[$_]);
    }
    say $_ for @diff;

First we put the zeros on each list. That's just in case we have a integer list like the second example, with just one number in the list. Then if we have additional integers we count and add numbers to the right side of the `@left` list and the left side of the `@right` list.

We loop through both completed lists and we compute the absolute difference, then print the list one-by-one. Voila! Again, not sure what the practical application is, but an interesting challenge. Many thanks to Mohammad and an enjoyable pair of challenges. I also appreciate being the June champion, so you'll hear more of my bio when it's released.

Have a great week! See you next week.
How to Ace the SAT with Proven Techniques with Tesprepkart
Published: 2023-07-12 10:30:57

Tesprepkart online platform offers high-quality and personalized **[SAT coaching](https://www.testprepkart.com/sat/blog-single.php?id=513/sat-preparation-online-[digital-sat-preparation])**. Learn how to plan and start early, understand and apply concepts, learn and use tips and tricks, practice frequently and under time review and improve your errors, and keep a positive and motivated attitude. Visit our website testprepkart.com to ace yourself in SAT Examination.
Show loading state until actual rendering is finished (rendering CPU bottleneck)
Tags: react
Published: 2023-07-12 10:30:17

Hello everyone!

We've been using React at [Orderlion](https://orderlion.com) for a very long time.

Lot's of our UI consists of pretty big tables with up to 100 rows and lot's of tooltips, inputs, svg icons, ... per table row.

We are using React Query to fetch the data and TanStack/table for our tables. The inputs, icons, tooltips etc. come from Mantine.

In general we are very happy with this stack, but we are running into **issues/bottlenecks with actual rendering times**.

Especially slower Windows machines need up to 3 seconds (in extreme cases up to 10 seconds!) to render one table page (we have pagination in place).

The issue is NOT the data fetching, the data is loaded almost instantly, the issue is the actual RENDERING of the table. We are very surprised by this!

We did check that there are NO unnecessary re-renders, so this is not the cause of the problem. Due to restrictions with older packages, we are still on **react 16.13.1**.

Can someone help on what we could do about this? I am not sure if `<Suspense/>` would be of any help, but I doubt it. Since the actual rendering of the components seems to be the bottleneck I am a bit out of ideas at the moment.

Has anyone encountered actual React rendering bottlenecks in the past? Until now, we only had these issues with very complex components, which is not the case here.

Thanks for your help in advance,
best, Patrick
A Brief Overview of Buffer Manager in PostgreSQL
Published: 2023-07-12 10:22:37

The job of a **buffer manager** is to manage and oversee the data transfers that take place persistent memory and shared memory and thus, this part of the DBMS can have a significant impact on the performance and working of the RDBMS. In PostgreSQL however, the buffer manager works very well and efficiently.

In this brief overview, we will take a look at the following sections and get an understanding of the topics:

**- Buffer manager structure**
  The buffer manager in postgreSQL consists of a _buffer descriptor_, a _buffer table_ and a _buffer pool_. Things like the data file pages e.g. the tables and indexes and the _freespace maps_ and _visibility maps_ as well. Next, the buffer pool is in the form of an array which basically entails that each of the slots store a single page of the data file. The indices of a buffer pool array are known as **buffer_ids**


**- Buffer manager locks**
  The buffer manager locks are used for many different purposes and uses many different locks. Now, we will look at the locks that are necessary for understanding the upcoming sections.

Firstly, there are **Buffer Table Locks** which help protect the integrity of the data that is contained in the entire buffer table. This can be used in both the exclusive and shared modes and is considered a relatively light weight lock. Whenever an entry is inserted or deleted, an exclusive lock is held by a backend process.




**- How the buffer manager works**
  A buffer manager works whenever a backend process wants to access a desired page. When this task is to be performed, is uses a _ReadBufferExtended_ function.
How the _ReadBufferExtended_ function behaves depends on three different logical cases. Additionally, we will look at the PostgreSQL _clock sweep page replacement algorithm_ in the final section.


**- Ring buffer**
  Whenever PostgreSQL is reading or writing a very large table, a ring buffer is used instead of a buffer pool. A small and temporary buffer area is assigned as a ring buffer in the main memory. Bulk reading, bulk writing and Vacuum-processing are the three main operations where ring buffer is used.


**- Flushing of dirty pages **
  The background writer and check pointer does processing of flushing dirty pages to storage. Both of these processes perform the same function however, each have different behaviors and roles.

The role of the background writer is to decrease the influence of large scale writing of checkpointing. Whereas the checkpoint process writes a checkpoint record to the WAL segment and whenever the checkpointing starts it flushes the dirty pages.
The Immune System as a Model for Cyber Security
Tags: ai, programming, tutorial, discuss
Published: 2023-07-12 10:20:48

The human immune system is a **complex network of cells**, **proteins**, and **organs that work together to protect the body from harmful invaders**. This system can be used as an inspiration for developing new **cyber security defenses.** 
One way to use the immune system as inspiration for cyber security is to develop intrusion detection systems that work like B cells. B cells are a type of white blood cell that produces antibodies. Antibodies are proteins that bind to specific invaders, such as viruses or bacteria. Intrusion detection systems work in a similar way. They look for patterns in network traffic that are indicative of an attack. When they find a suspicious pattern, they can alert the system administrator so that the attack can be stopped.

Another way to use the immune system as inspiration for cyber security is to develop self-healing systems that work like T cells. T cells are a type of white blood cell that attacks infected cells. Self-healing systems work in a similar way. They can identify and repair infected files or systems. This can help to prevent an attack from spreading or causing damage.

The immune system is a complex and powerful system. By understanding how it works, we can develop new and innovative cyber security defenses.

---
<u>Examples</u>


> 1.**Anomaly detection**
: This is a technique that looks for patterns in network traffic that are outside of the norm. This can be used to identify potential attacks, such as a large number of login attempts from a single IP address.



> 2.**Machine learning**
: This technique can be used to train models to identify malicious code or patterns in network traffic. This can be used to prevent attacks before they happen.



> 3.**Bioinspired security**
: This is a field of research that uses principles from the immune system to develop new cyber security defenses. For example, some researchers are working on developing systems that can identify and repair infected files or systems, similar to **how T cells attack infected cells in the human body.**

What do you think?