teleren/devto huggingface dataset:
A quick recap for chapter 1 in "The Internals of PostgreSQL" book
Tags: postgres, apacheage, age
Published: 2023-04-10 21:33:39

To understand how PostgreSQL works, it's important to have a grasp of its logical and physical structures, as well as its internal layout. This article will provide an overview of the logical and physical structures of a PostgreSQL database cluster, as well as the layout of heap table files.

## Logical Structure of Database Cluster
A PostgreSQL database cluster is a collection of databases, each containing a variety of database objects like tables, indexes, sequences, and views. These objects are internally managed by object identifiers (OIDs), which are unsigned 4-byte integers. The relations between database objects and their respective OIDs are stored in system catalogs, like pg_database and pg_class. PostgreSQL servers run on a single host and manage a single database cluster.

![Logical structure of a database cluster](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3tjm8zfd8rax9oubphx.png)


## Physical Structure of Database Cluster
A PostgreSQL database cluster is comprised of a base directory, subdirectories, and lots of files. When initializing a new database cluster, a base directory is created under the specified directory, and a database is a subdirectory under the base subdirectory. Tables and indexes are stored as files under the subdirectory of the database to which they belong, and there are several other subdirectories containing particular data and configuration files.

![An example of database cluster](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnwam67l1tfnjyc8cd5h.png)


## Layout of Files Associated with Tables and Indexes
Each table or index whose size is less than 1GB is stored as a single file under the database directory it belongs to. Tables and indexes are managed by individual OIDs, while their data files are managed by the variable relfilenode. The relfilenode values of tables and indexes generally match their respective OIDs.

## Internal Layout of a Heap Table File
Inside the data file (heap table and index, as well as the free space map and visibility map), it is divided into pages (or blocks) of fixed length, the default is 8192 byte (8 KB). Each page within a table contains three kinds of data: heap tuples, line pointers, and header data. Heap tuples are the record data itself, and they are stacked in order from the bottom of the page. Line pointers hold a pointer to each heap tuple and form a simple array, which plays the role of an index to the tuples. Header data, defined by the structure PageHeaderData, is allocated in the beginning of the page and contains general information about the page.

![Page layout of a heap table file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0hpeketsn4pf2boajyx8.png)

## Conclusion
Understanding the logical and physical structures of a PostgreSQL database cluster, as well as the internal layout of heap table files, is crucial for developers With this knowledge, you'll be well-equipped to work with and manage PostgreSQL databases with ease.
How does ArcadeDB make data FAIR?
Tags: fair, nosql, database, arcadedb
Published: 2023-04-10 21:20:11

The [FAIR principles](https://www.go-fair.org/fair-principles/) for research data (Findability, Accessibility, Interoperability, Reusability) are a set of guidelines to facilitate sustainable availability of (research) data. 

Inspired by [Fluree's "Making Data FAIR"](https://flur.ee/2020/07/08/making-data-fair/), I decided to look at [ArcadeDB](https://arcadedb.com) in terms of FAIRness.

So, to check whether a tool _X_ helps making (research or enterprise) data (more) FAIR, I ask for each principle _Y_: **How does _X_ make data _Y_?**

## How does ArcadeDB make data findable:

* A unique identifier is assigned to each record and never reassigned.
* Custom metadata for types and properties beyond SQL `COMMENT ON`.
* The identifier is a mandatory property of every record.

## How does ArcadeDB make data accessible?

* Query Languages: **SQL dialect**, Cypher, Gremlin, GraphQL, MQL (MongoDB), SPARQL (via Gremlin plugin)
* Interfaces: HTTP, Java, JDBC, MongoDB, Redis, Postgres
* Drivers: CHICKEN Scheme, .NET, Ruby, Rust

## How does ArcadeDB make data interoperable?

* The native data format is JSON.
* Data types map to standard Java data types.
* Links between records are based on unique identifiers.

## How does ArcadeDB make data reusable?

* Property fields (i.e. for licenses) can be made mandatory.
* Provenance can be enforced by immutable records.
* Export formats: JSONL, GRAPHSON, GRAPHML

So overall, ArcadeDB makes data fair by its feature set. While this feature configuration is likely not unique, a polyglot multi-model NoSQL/NewSQL database is [rare](https://dbdb.io/browse?os=all-os-with-java-vm&data-model=document-xml&data-model=graph&query-interface=http-rest&query-interface=sql&q=).
A quick recap for chapter 2 in "The Internals of PostgreSQL" book
Tags: apacheage, age, postgres
Published: 2023-04-10 21:10:28

To help you better understand the inner workings of this powerful tool, we'll provide an overview of the process architecture and memory architecture in this article.

## Process Architecture
The process architecture of PostgreSQL follows a multi-process model, where a collection of multiple processes collaboratively manage a single database cluster. These processes can be categorized into four types: postgres server process, backend process, background process, and replication associated process. The postgres server process is the parent process of all the other processes in a PostgreSQL server. It listens to one network port, allocates a shared memory area in memory, starts various background processes, and waits for connection requests from clients.

![the process architecture in PostgreSQL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ia92jkktzp453tyl5p2t.png)

The background processes in PostgreSQL perform a variety of functions, such as writing dirty pages on the shared buffer pool to persistent storage, performing checkpoint processes, collecting statistics information, and executing archiving logging. These processes work in the background (i.e. WAL writer, autovacuum launcher, checkpointer, background writer) and do not require user intervention. However, it is crucial to understand their role in the system to optimize PostgreSQL's performance.

## Memory Architecture
The memory architecture in PostgreSQL can be classified into two broad categories: local memory area and shared memory area. The local memory area is allocated by each backend process for its use and is divided into several sub-areas with fixed or variable sizes. On the other hand, a shared memory area is used by all processes of a PostgreSQL server and is also divided into several fixed-sized sub-areas. The shared buffer pool is used to store and operate pages within tables and indexes from a persistent storage, while the WAL buffer is used for buffering WAL data before writing it to persistent storage.

![Memory architecture in PostgreSQL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dn5xfzz9hefywkcoh6kv.png)

**In summary**, understanding the process architecture and memory architecture of PostgreSQL is essential for developers and database administrators to optimize the performance and scalability of their PostgreSQL deployments. This article provides an excellent starting point for exploring these topics in-depth.
What's your bread and butter?
Tags: hobby, extracurricular, experiment
Published: 2023-04-10 21:04:19

Despite the idiom used, I'm not asking about your job. The very opposite of it, actually. Is there something you do in your spare time that has nothing to do with coding, and yet satisfies the same drive and passion.
For me that's my kitchen experiments:

Bread:
- plain wheat, crazy shapes 
![A loaf of plain wheat bread composed of small balls of dough](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8ztlyjxho40iy9k1vp7.jpg)
- chickpea/lentil bread (that's crazy enough in itself)
![A loaf of chickpea and lentil gluten-free bread](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rd519ermjdb7i57sta9g.jpg)
That's what started my foodie passion. I needed to learn to make my own gluten-free bread because those cost an arm and a leg back in the day. I developed my own buckwheat bread recipe. And while I can't eat gluten, I love the texture, the stretchiness and the maleable nature - so I'm happy to make wheat and rye breads for my family.
A couple years later I needed to make another switch, to low-oxalate diet - and ditch my buckwheat bread entirely. Enter chickpea and lentils.
While researching low-oxalate options I read somewhere that while walnuts are a no-no, the oil is fine. Not a super fan of walnuts, and never had walnut oil before - but I had to try.
Now I'm absolutely obsessed with it - and while I can't eat walnuts, my family love walnut cakes, and so I'm more than happy to make them:
![Walnut cake and a bottle of walnut oil, bot of my own making](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfcnuvi8dk3qpgiyxglo.png)
Those are just the tip of the iceberg of what I do in the kitchen. Yogurt, sourdough bread, flax gel, flax butter, custard... Any simple, basic dish that I can try, tweak, re-interpret - sometimes just for the sake of trying rather than any practical use. Which mirrors my aprroach to coding. Webdev is not my actual job, just a hobby - and rather than proper websites or apps I mostly experiment with 3D shapes coded in pure CSS. It's not useful or practical - but it's just so much FUN:
{% codepen https://codepen.io/MackFitz/pen/jOxzKmL %}

What's *your* chickpea bread and flax butter?
Resolvendo problemas no HackerRank: Organizando bolinhas em um container
Published: 2023-04-10 20:29:51

Olá, seja bem vindo a mais um Resolvendo problemas no HackerRank: No caso de hoje, organizar bolas que estão dentro de caixas, baseado em alguns parâmetros. Vejamos mais informações com a explicação detalhada e sua resolução.

**Organizing Containers of Balls -**

David tem vários recipientes, cada um com um número de bolas. Ele tem recipientes suficientes para separar cada tipo de bola que possui em seu próprio recipiente. David quer classificar as bolas usando seu método de classificação.

David deseja realizar algumas operações de swap de modo que:

- Cada recipiente contém apenas bolas do mesmo tipo.
- Não há duas bolas do mesmo tipo localizadas em recipientes diferentes.

Vejamos o código:

```
function organizingContainers(container) {
    // Write your code here
  let obj1 = {};
  let obj2 = {};
    for (let i = 0; i < container.length; i++) {
        obj1[i] = container[i].reduce((a, b) => a + b);
        obj2[i] = 0;
        for (let j = 0; j < container.length; j++) {
            obj2[i] += container[j][i];
        }
    }

    let x = Object.values(obj1).sort((a, b) => a - b);
    let y = Object.values(obj2).sort((a, b) => a - b);
    if(JSON.stringify(x) === JSON.stringify(y)) {
        return "Possible"
    } else {
        return "Impossible"
    }
}
```

O valor adicionado a obj1[i] é a soma dos elementos no array container[i], que é obtido usando o método reduce(). Enquanto o valor adicionado a obj2[i] é a soma dos elementos na coluna i em todos os arrays de container. Isso é feito usando um loop for interno, que percorre o array container novamente e soma os valores em cada coluna i.

Após o loop for, o código converte os valores em obj1 e obj2 em arrays usando o método Object.values(). Em seguida, ele classifica os dois arrays usando o método sort(), com a função de classificação que classifica em ordem crescente.

Por fim, o código verifica se os dois arrays classificados são iguais usando o método JSON.stringify(). Se eles forem iguais, o código retorna "Possible", caso contrário, retorna "Impossible".

O resultado final será:

```
2
2
1 1
1 1
2
0 2
1 1

Possible
Impossible
```
Assim, concluímos mais um _Resolvendo problemas no HackerRank:_ até a próxima.
Interesting facts about the C++ labor market
Published: 2023-04-10 20:20:40

As many hiring teams teams know, finding an experienced C++ developer willing to commit to a new company is challenging right now. Between high frequency trading, virtual reality, and autonomous vehicles, the demand for skilled C++ developers is increasing yearly. There's just not enough developers that can code in C++.

To figure out a solution to this problem, we asked our data team to investigate how scarce C++ developers are in the U.S. and Canada with our AI-powered Talent Graph, and they found some interesting results:

- How many C++ developers are located in the U.S and Canada
- The states/provinces where they can be found
- The percentage of C++ developers who are women
- Which companies and industries have the highest number of C++ developers
- The education and experience levels of the C++ developer population
Here's the full results and tips.

https://www.celential.ai/blog/hire-c-plus-plus-developers/
DEB package and strange dkms dependencies on Debian 10.10
Tags: debian, dkms, bug
Published: 2023-04-10 20:18:29

---
title: DEB package and strange dkms dependencies on Debian 10.10
published: true
description: build dkms module bug
tags: debian, dkms, bug
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-04-10 20:06 +0000
---
Imagine that you have Debian 10, kernel version 5.10, and a self-made DEB package that compiles and installs a kernel module using the dkms subsystem. As expected, the package has a dependency on dkms. However, when you tried to install this package with the command
```
apt install -y ./my-dkms-package.deb
```
you found that the installer sees that dkms is missing from the system and started its installation. However, dkms also has its dependencies, one of which is linux-headers-common for kernel version 4.19!

Thus, despite having only the active kernel version 5.10 in your system, dependencies for kernel version 4.19 are being installed. 
And here comes the strange part - during the package installation and module compilation, headers from kernel version 4.19 are being used!

After that, you see that an error occurs during compilation because (make.log)
```
/lib/module/linux-4.19 is not found
```
and the installation cannot be completed. 

But as it turns out, there is a way to solve this problem! 

If you install dkms separately with the command 
```
apt install dkms
```
the installed dependencies from kernel version 4.19 will no longer interfere. And after that, you can install your package with the command 
```
apt install -y ./my-dkms-package.deb
```
and all headers will be correct, i.e., for kernel version 5.10.

So if you encounter such a problem, don't despair! Just install dkms separately, and everything will be fine.

[My original topic](https://memos.rpod.club/m/36)
Interesting facts about the Ruby developer market
Published: 2023-04-10 20:15:43

There's still plenty of demand for Ruby developers. For example, Hired found that Ruby on Rails developers receive 1.78 more interview requests on average than other software engineers.

It's not an easy time to hire developers right now, between the talent shortage, budgets being cut and engineers nervous about making a move in uncertain times. That's why our Data Team decided to do a deep dive into the Ruby developer market to find some data-driven insights on how hiring teams can most effectively target Ruby developers. They found some interesting results, including:

- The number of Ruby on Rails Developers in the U.S. and the cities where they are most concentrated
- The percentage of Ruby Developers without a degree
- The average number of experience Ruby on Rails Developers have
- What industries and companies they prefer working at
- The typical roles they take on engineering teams

Our Data Team achieved these learnings by tapping into our Talent Graph of 10million+ software engineering profiles in the U.S. and using our state-of-the-art deep learning methods. For the full results and tips, here's the article:
https://www.celential.ai/blog/how-to-hire-a-ruby-on-rails-developer/
Hello World: My First Blog Post
Published: 2023-04-10 19:48:11

![                                                *Image by [Clark Tibbs](https://unsplash.com/photos/oqStl2L5oxI?utm_source=63921&utm_medium=referral)*](https://images.unsplash.com/photo-1504805572947-34fad45aed93?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb)

*Image by [Clark Tibbs](https://unsplash.com/photos/oqStl2L5oxI?utm_source=63921&utm_medium=referral)*

Hello, and welcome to my blog! This is my very first post, and I'm excited to start sharing my thoughts and ideas with you all. And if you don't find my jokes funny, don't worry, I'm a software developer, not a comedian.

First things first: let me introduce myself. My name is [Franklin Osei](https://franklinosei.onrender.com), and I'm a **Software Developer**. I'm passionate about **Software Engineering**, and I'm always looking for new ways to learn and grow in my field.

I’m writing these blogs as a way to share my experiences and insights with others. I believe that blogging is a great way to connect with like-minded people, share ideas, and inspire others. Plus, it's a great way to improve my writing skills and express my creativity.

Now, I have to admit that I'm a bit nervous about starting this blog. It's a big step for me, and I'm still learning the ropes. But I'm also excited about the possibilities. I can't wait to start sharing my knowledge, experiences, and insights with you all.

## What to expect?

So, what can you expect from this blog? Well, I plan to write about a wide range of topics related to **Software Engineering**. I'll share my thoughts on industry trends, discuss the latest tools and technologies, and share tips and advice based on my own experiences.

I'll also share my personal journey and the challenges I've faced along the way. I hope that by sharing my experiences, I can inspire others to pursue their passions and achieve their goals.

In short, I'm here to share my story, my ideas, and my passion with you all. I hope that you'll join me on this journey, and I promise to make it worth your while. So, keep an eye out for exciting content from me in the coming weeks and months!

Thank you for reading, and I look forward to connecting with you all soon.

You can connect with me on my socials: [Portfolio](https://franklinosei.onrender.com), [LinkedIn](https://www.linkedin.com/in/franklin-osei-258b7210a/), [Twitter](https://twitter.com/iamdveloper?t=8ULTGF00kLF3KXppTscEhA&s=09) or check my [Github](https://github.com/franklinosei).
Mage Battlegrounds: Craft insights from real-time customer behavior analysis
Tags: dataengineering, hackathon, mage, mageai
Published: 2023-04-10 19:45:25

You're invited to participate in the very first [Mage](https://www.mage.ai) **Battlegrounds: Craft insights from real-time customer behavior analysis**, a 24-hour virtual hackathon hosted by [Shashank Mishra](https://www.linkedin.com/in/shashank219/)! This data engineering competition will take place on **Saturday, April 15, 2023 beginning at 11am (PST)**. This will be a global event open to all participants who [register](https://forms.gle/BGnB2grF8S2HTPCn8).

## Event details

- Starts Saturday, April 15, 2023 | 11am (PST) with an opening ceremony and ends Sunday, April 16, 2023 | 11am (PST) with a closing ceremony.
- [Register here](https://forms.gle/BGnB2grF8S2HTPCn8). Registration will be closed at 11am (PST) on Saturday, April 15, 2023.
- You may register as a solo participant or a team of max two (2) members. Upon registration, you will receive a confirmation and a follow-up email on the day of the event with details on the challenge, requirements, and additional resources to help you successfully complete and submit your project.
- You can check out Mage [here](https://github.com/mage-ai/mage-ai).
- For questions prior to this event, please visit the Mage community slack: [https://www.mage.ai/chat](https://www.mage.ai/chat)

## Prizes
![Mage hackathon prizes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnjpnbci1s18cimfwjk7.png)
The following prizes will be awarded for this event:
Seven (7) Amazon gift cards (valued at INR 2,500 each) & Mage swag for honorable mentions (Loot).
- Cash prize of INR 10,000 & Mage swag for 2nd Runner up (Grand Mage).
- Cash prize of INR 20,000 & Mage swag for 1st Runner up (Sorcerer Supreme).
- Cash prize of INR 35,000 & Mage swag for the Grand Prize winner (Archmage).
Lowongan Kerja PT Eka Bogainti (HokBen)
Published: 2023-04-10 19:24:33

Informasi Persyaratan serta Alur Pendaftaran, masuk Melalui LINK dibawah ini

https://bit.ly/3KiOOuH?-pt-eka-bogainti-hokben

Note: Penerimaan tanpa dipungut biaya
Semoga Sukses dan berhasil
This is the best way to compress images on a website.
Tags: javascript, webdev, beginners, tutorial
Published: 2023-04-10 19:16:28

Any website or app that allows users to upload their own photos needs to have a compression system in place. Which one should I use? I tried out different packages so you wouldn’t have to.

## Why do you need a compression system?
The real question is, why wouldn’t you? Due to improvements in camera quality comes larger photo sizes. I saw this firsthand in my latest project that allows a user to upload images to their blog. During tests, I realized that from an IPhone 14, photos could easily reach 8 to 11 Megabytes. That’s massive, and too big to be serving to visitors on a website. A compression system can 
take your photo and reduce the quality within a certain threshold as well as apply image dimension restraints to save that precious storage.

## How you can implement this system.
I tried a few different frameworks and came to the conclusion that this one was the easiest to use and provided the desired settings. Image Resize Compress can be installed through NPM if you’re familiar with it `npm i image-resize-compress`, or you can simply include the package’s CDN to use the script `<script src=”https://cdn.jsdelivr.net/npm/image-resize-compress@1/dist/index.js"></script>`. The settings are really straightforward so I wrote up a quick function for you to get started quickly.

```javascript
async function compressImage(image, settings){
    const curSettings = {
        quality: 75,
        width: "auto",
        height: "auto",
        format: "jpg",
        ...settings
    }
    const compressRes = await fromBlob(image, curSettings.quality, curSettings.width, curSettings.height, curSettings.format);
    return compressRes;
}


// Using The Function
compressImage(file, {quality: 80, height: 720})
.then((res)=>{
    const compressedImage = res;
})
```
You simply call the function with the input image as the first parameter, and then any settings you want to alter as an object in the second parameter. The default quality is 75, or 75%. the height and width settings are set to auto meaning that the original dimensions will be used, and the default format is _**jpg**_ but _**webp**_, _**png**_, _**bmp**_, and _**gif**_are also available.

You do have to keep in mind that this function returns a Promise. Which is why I used `.then()` to access the resolution (aka the data).

This package is really easy to use and allows you to not only compress the image but to also resize extremely large images to preset dimensions. If you want to learn more about the package, check out its documentation here.

Thanks for reading! For more tips, tricks and tutorials follow me on [YouTube](https://www.youtube.com/@growincode) or [Instagram](https://www.instagram.com/growincode/).

Make sure and leave a comment if you want to see me cover something specific.

Thumbnail: [https://freeicons.io/profile/6156](https://freeicons.io/profile/6156)