teleren/devto huggingface dataset:
[DEV] AGE 16 with Postgres 16
Tags: beginners, database, postgres, apacheage
Published: 2023-06-14 22:13:13

## Hello 
### The following blog is for AGE developers
In the following post I will introduce you to a starter guide for **PG-16 project**. I am currently starting as well and got into some **troubles** I would like to save your time from **getting into there**.

Firstly we are going to work in making **Postgresql v16 beta** _compatible_ with our **AGE extension**; **That is our goal**.

THE **SCRIPT** to get started read comments carefully :

```sh
# Download
wget https://ftp.postgresql.org/pub/source/v16beta1/postgresql-16beta1.tar.bz2
# Extract
tar zxf postgresql-16beta1.tar.bz2
# Get into the postgresql directory
cd postgresql-16beta1
# Make sure there is no postgresql servers are opened
pkill postgres
# start the installation
# packages needs for pg16
sudo apt install pkg-config
sudo apt install libicu-dev
# make sure your bison version is above 3.2
bison --version
# if below upgrade it
sudo apt remove bison
sudo apt install bison
# recheck
bison --version
./configure --prefix=$(pwd) --enable-cassert --enable-debug
make
make install
mkdir data
chown $(whoami) ./data
./bin/initdb -D ./data
bin/pg_ctl -D ./data -l logfile start
./bin/createdb test
./bin/psql test
\q
export PG_PATH=$(pwd)
cd ..

# Install age 
git clone  https://github.com/panosfol/age
git checkout PG16
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(PG_PATH)/lib
make install PG_CONFIG=$(PG_PATH)/bin/pg_config
make installcheck PG_CONFIG=$(PG_PATH)/bin/pg_config
# you will get some errors don't worry that would be our work solving them

```

Have a nice day :)

### References 
- Postgresql : https://ftp.postgresql.org/pub/source/v16beta1
- AGE : https://github.com/panosfol/age/tree/PG16
- APACHE AGE: https://age.apache.org/
Day 762 : Enough
Tags: hiphop, code, coding, lifelongdev
Published: 2023-06-14 22:12:53

_liner notes_:
- Professional : Had a company wide meeting. Cool to hear what's going on. Then had a meeting with my manager. Went over what I've been working on and what I'll be doing for the rest of the week. Spent the rest of the day updating some API specs and old demos I've been refactoring. I'm so close to getting these demos to work. I reached out to some folks to get their thoughts.

- Personal : Made a good amount of progress on my side project. Got a lot of the parts to create a session worked out. Worked on the stuff I don't need to rely on a third party to generate. Also went through some tracks for the radio show and looked at some land. Didn't watch any anime. haha

![Aerial view of Celano, Abruzzi, Italy with a bunch of buildings and mountains in the distance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9di7ij1jny7vvorlyfe8.jpg)

My plan is go through more tracks. Also look at some land. Get a couple of more features working to start to be able to save sessions before working on the stuff I'll need a third party service. If I have time, I want to get everything needed to saving the sessions to the backend. I think there's like 3 things to get working before I can start saving. Maybe I'll watch some anime if I finish up early enough.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 40REygCgURw %}
Java 17 - Records
Published: 2023-06-14 21:30:58


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

**Hoje vamos falar da feature Record. :)**

A funcionalidade de record no Java 17 é uma nova adição à linguagem que simplifica a criação de classes de dados imutáveis. Ela combina várias características, como geração automática de campos, geração de construtores e implementações padrão de métodos comuns como equals(), hashCode() e toString(). Records são declarados usando a palavra-chave "record", seguida pelo nome e uma lista de componentes.

Abaixo está um exemplo de declaração simples de um record:

```
record Pessoa(String nome, int idade) {
 // Corpo do record (opcional)
}
```

No exemplo acima, declaramos um record chamado "Pessoa" com dois componentes: um campo de string "nome" e um campo de inteiro "idade". O record gera automaticamente um construtor, getters para cada componente e implementações padrão de equals(), hashCode() e toString().
Você pode criar uma instância de um record usando o construtor como qualquer outra classe:

```
Pessoa pessoa = new Pessoa("Thiago", 35);
```

Records são imutáveis por padrão, o que significa que seus campos não podem ser modificados depois de inicializados. No entanto, você ainda pode atualizar uma instância de record criando um novo record com valores atualizados usando a palavra-chave "with":

```
Pessoa pessoaAtualizada = pessoa.withIdade(31);
```

Nesse exemplo, uma nova instância de record chamada "pessoaAtualizada" é criada com o mesmo nome do record original, mas com a idade atualizada para 31. O método "withIdade()" é gerado automaticamente pelo record.
Records também podem ser usados em declarações de switch:

```
public String obterDescricaoPessoa(Pessoa pessoa) {
 return switch (pessoa.idade()) {
 case 0 -> "Recém-nascido";
 case 18 -> "Adulto";
 default -> "Desconhecido";
 };
}
```

Nesse exemplo, o método "obterDescricaoPessoa" recebe um record de pessoa como parâmetro e usa uma declaração de switch para retornar uma descrição com base na idade.

**Conclusão: **
No geral, a funcionalidade de record no Java 17 oferece uma forma conveniente de criar classes de dados imutáveis e com um código de fácil manutenção. Ela melhora a legibilidade do código e reduz o esforço necessário para criar e usar tais classes.
Algorithm Problem Set
Published: 2023-06-14 21:26:17

# Next Permutation -- Math Problem
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3g6t6yr3kbc7z793ypr.png)
- put first pointer i at the second last position.
- put second pt j at the last position and judge if the val at j is greater than it is at i do the while judge each time until the position of j == i.
- in each While iteration, judge if the val at j is greater than it is at i. if so, break the inner while-loop, or j--.
- if the inner while loop is done, then swap the var at i and j and break the outer while loop.
- reverse all elems from i+1 to the end at the nums;
making fast sites even faster
Tags: solidjs, performance, angular, webdev
Published: 2023-06-14 21:05:03


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zubgiwz0bc231mah8g7z.png)
I began the rewrite of my quiz web app called "et3allim" (which means "learn" in arabic) in solidjs. It was originally written in angular without paying much mind to performance. The goal of this rewrite was to make the site much faster and more responsive. I'm still in the beginning stages but I can already notice a 3.5 times (or 111.11%) difference in page load time. There are three reasons for this.
##1. Web Framework##
Angular is much slower than solidjs and updates in the UI take longer. I was using lazy loading and other best practices in angular but it just couldn't compete with the performance of solidjs.
##2. UI Frameworks##
In the older version, I was using bootstrap and material UI. Both have a combined size of 147kb + 90kb = 236kb. This is not small. You could compress it with gzip but it's still a heavy load on your page. Instead, I just didn't use a UI framework and wrote my own css. I did use skeleton css which is 170 bytes only, and just wrote my own css for the styling. This makes the site's css much smaller
##3. Hosting##
The old site was hosted in a vps (linux server) using digital ocean. This server is located in north america which means if someone opens the site from the other side of the world, the site will take longer to load. Instead, the new site is hosted on cloudflare pages which uses a cdn. They have many servers around the world and will deliver the page from the closest location to you.
##A word on solidjs##
I have nothing but great things to say about this amazing and minimal framework created by Ryan Carniato. It does everything perfectly, and once you understand the core concepts, you can create extremely fast reactive web apps.
Good logging library for node.js?
Published: 2023-06-14 20:53:16

Hi, I recently created a library for logging. I wanted to share it with you and show you how it works.

First you have to install it:
```bash
npm install prime-console
```

### Now we can initialize the Logger class.
```js
import { Logger } from 'prime-console';

const logger = new Logger({
   logLevel: 5
});
```

`By deafult, it will only log error messages. To change that set logLevel to 5.`

### Here you will find all available options:
```js
import { Logger, LoggerOptions } from 'prime-console';

const options: LoggerOptions = {
  config: {
    info: {
      color: "blue",
    },
    error: {
        color: "#e17607",
    },
    warning: {
      color: "yellow",
    },
    debug: {
      color: "magenta",
    },
    verbose: {
      color: "cyan",
    },
    silly: {
      color: "green",
    },
  },
  format: "[%t] %d %m",
  logFile: "./log.txt",
  logLevel: 5,
  logFileFormat: "json",
};

const logger = new Logger(options);
```
- format - way of message being displayed
    - %t - type
    - %d - date/time
    - %m - message

### CLI
```npx prime generate``` - run this to easily generate Logger config

### You can save your logs to text file:
```js
import {Logger} from 'prime-console';

const logger = new Logger({logLevel: 5, logFile: 'log.txt'});

logger.info('test file log message');
```
or save to json
```js
import {Logger} from 'prime-console';

const logger = new Logger({logLevel: 5, logFile: 'log',  logFileFormat: "json"});

logger.info('test file log message');
```

### Don't forget about custom colors and log levels:
```js
const options: LoggerOptions = {
  config: {
    error: {
        color: "#e17607",
    },
  },
  logLevel: 5
}

const log = new Logger(options)

logger.addCustomLevel('custom', 3, 'blue');
logger.custom('test custom message', 'custom');
```

### Clear function:
```js
import {Logger} from 'prime-console';

const logger = new Logger({logLevel: 5});

logger.clear() or logger.clear(true)
```
- Clear function will clear the console. If true is provided as first argument, function will also clear the log file.

You can find source code here: https://github.com/malezjaa/prime-console If you want you can give it a star.
Academic Research Survey
Tags: scrum, softwareengineering, security, webdev
Published: 2023-06-14 20:12:37

📣 Calling all community members! Your insights matter! 🌟

Dear Community Member,

I hope this post finds you in good health and high spirits! 🤗

I am excited to announce that I am currently conducting an academic research survey, and I would be honored if you could lend me a few minutes of your valuable time. 📚🔍

My research focuses on developing secure software with Scrum. As a passionate academic, I believe real progress comes from collective knowledge and diverse perspectives. Participating in this survey will contribute to advancing our understanding of this field and shaping future strategies and solutions. 🌍💡

Whether you are an expert or simply curious about the subject matter, your opinion matters! 🤝 The survey is designed to be accessible to every software and security engineer, regardless of their level of expertise. Your unique experiences and insights will help enrich the data and provide a comprehensive understanding of the topic.

The survey is anonymous and confidential, ensuring your privacy throughout the process. Rest assured; your information will be used solely for academic purposes and handled by strict ethical guidelines. 🔒

To participate, click on the following link: https://survey.phonic.ai/6486c6804873438d1c8c8f2a. It will only take a few minutes of your time, but the impact of your contribution will resonate far beyond. 🌟

Additionally, if you know anyone within your network who might be interested in this research, I would greatly appreciate it if you could share this post or forward the survey link to them. The more diverse perspectives we can gather, the more meaningful and robust our findings will be! 🤝📈

Thank you in advance for your time and support. Your participation in this research is invaluable, and together, we can drive positive change in our field. If you have any questions or would like further information, don't hesitate to contact me directly.

Let's embark on this knowledge-sharing journey together and make a difference! 🚀

Best regards,
M. Dib
University of Wollongong in Dubai
md546@uowmail.edu.au
Please Be More Physically Active
Published: 2024-01-29 04:46:50

---
title: Please Be More Physically Active
published: true
date: 2023-06-14 20:10:06 UTC
tags: 
canonical_url: https://alex.party/posts/2023-06-14-please-be-more-physically-active/
---

Alright, I’ll admit I am the least qualified person to talk about this. But as a mediocre white guy in tech on the internet, I’m going to share my experience.

### A bit of backstory

I don’t work out. I should. All of my doctors agree on that point. In fact, all of those doctors would be pleased if I just started walking a little each day. But my brain is bad, and it thinks that taking a walk is the equivalent of summiting Everest. Everytime I consider any form of physical activity, my brain goes “Ew, no.”

In a previous career, I spent lots of time pushing boxes, climbing ladders, regularly lifting 20lb lighting fixtures over my head, and this type of activity kept my body in pretty okay shape. Was I the most fit? No. But at least i was moving. A lot.

Moving over into the Web Dev space, I stopped moving. Like, pretty much entirely. This was/is my downfall.

A year+ ago I went to see a physical therapist (PT) for the first time. My wrist was always in pain, and I figured it wouldn’t hurt to talk to a professional (let’s be honest) my wife told me to go see her PT. We worked through some stuff, the wrist got better, cool. Then, other things started to hurt.

### Reality sets in

The way my PT at the time explained it to me was this: Most people end up in physical therapy because they have over-extended something. They’ve done too much. And in doing so, they’ve hurt themselves.

_ **However** _, There is also the other end of the spectrum, where someone does absolutely nothing at all to the point where the body starts falling apart (not literally, I hope). _This is where I am, and let me tell you, it sucks._

### Whatcha gonna do?

This is where I’m supposed to be inspirational and stuff, right?

> “Just lift one thing at a time!”

or maybe:

> “No one ever regrets working out!”

Most platitudes don’t work when your brain won’t cooperate. I genuinely have no idea what I’m gonna do, nor do I have any life altering advice I can give. The only thing I can tell you is what I get told by everyone:

> “Please, just move more.”

Don’t let your body fall apart.
NextJs TypeScript setup with Prettier, Husky.
Tags: nextjs, webdev, typescript
Published: 2023-06-14 20:06:07

Let's get started with the NextJs setup with TypeScript. The configuration will be scalable with added configurations.

Let's create our app first by running the following command:
```
npx create-next-app@latest
```
You'll be presented with options. You can select each according to your preferences.
```
What is your project named? nextJs-awesome-setup
Would you like to use TypeScript with this project? No / Yes
Would you like to use ESLint with this project? No / Yes
Would you like to use Tailwind CSS with this project? No / Yes
Would you like to use `src/` directory with this project? No / Yes
Use App Router (recommended)? No / Yes
Would you like to customise the default import alias? No / Yes
```

Till now every step was generic which you can also find from [here](https://nextjs.org/docs/getting-started/installation).

Deleting `package.lock.json` file and `node_modules` folder.

Then run:

```
yarn
```

We have now converted our app to support `yarn` instead of `npm`. Which will be quite beneficial in the longer run.

Try running `yarn dev` to check if everything is working as expected.

```
yarn dev
```

**Prettier configuration**

```
yarn add -D prettier
```

This will install the required dependencies

```
touch .prettierrc
```

This will create configuration file for Prettier where you can define your own custom rules.
Some common rules:

```
{
  "semi": true,
  "trailingComma": "none",
  "singleQuote": true,
  "printWidth": 80
}
```

Paste these rules as is in the `.prettierrc` file we have just created.

_Create `.prettierignore` to ignore certain files and folders_

```
touch .prettierignore
```
Add `node_modules` and `.next` folders

Add this line in `package.json` under scripts

```
"format": "npx prettier --write ."
```

Now you can finally test if it works, run
```
yarn format
```

Hope, it worked.

**Husky configuration**

Some information about [husky](https://typicode.github.io/husky/)

1. Install `husky`
```
npm install husky --save-dev
```
2. Enable `git` hooks
```
npx husky install
```
3. To automatically have Git hooks enabled after install, edit `package.json`
```
npm pkg set scripts.prepare="husky install"
```

After running this you should have this in your `package.json`

```
{
  "scripts": {
    "prepare": "husky install" 
  }
}
```

_Create a hook_ which gets triggered whenever you make a commit
```
npx husky add .husky/pre-commit "yarn format"
git add .husky/pre-commit
```

Now whenever you do a new commit, your code should format itself before commit.

Bonus point: You run any script here using `&&` and it will execute whenever you make commit for example your can run test every time before you make commit by adding:
```
yarn format && yarn test
``` 


TLDR! This setup guide offers you code formatting and check before making a commit, so that you don't push anything that looks bad.

Happy Coding!
Some More JavaScript Array Methods #15
Tags: javascript, beginners, tutorial, react
Published: 2023-06-14 19:39:04

// delete Object
// let num = [1, 2, 3, 4, 5, 6, 7, 8]
// console.log(num.length)
// delete num[0]
// console.log(num) 

// concat 
 // let num_more = [11, 21, 31, 41, 51, 61, 71, 81]
 // let newArray = num.concat(num_more)
 // console.log(newArray)
 // console.log(num,num_more)

// sort method 
// let num = [169, 2, 35, 4, 65, 61, 70, 298]
// num.sort()
// console.log(num)

/*sort() take an optional compare function .if this function is provided as the first argument the sort() function will consider these value (the value returned from the compare function) as the basis of sorting */ 

// for Example 

// let compare = (a, b)=>{
//   return a - b
// }
// let num = [169, 2, 35, 4, 65, 61, 70, 298]
// num.sort(compare)
// console.log(num)

// // reverse() it will reverse the array 

// splice (splice can be used to add new item to an array )
//slice (slice out a piece from an  array ,it create a new array )

let num = [169, 2, 35, 4, 65, 61, 70, 298]
// num.splice(2, 4, 787, 998, 945, 66,)
// let deletedValue = num.splice(2, 4, 787, 998, 945, 66,)
// console.log(num)
// console.log(deletedValue)

// let numNew = num.slice(3)
let numNew = num.slice(3, 5)
console.log(numNew)

[](https://replit.com/@SkSage/Some-More-JavaScript-Array-Methods-18#index.js)
Azure mobile App
Published: 2023-06-14 19:28:08

Azure mobile app helps you manage your azure environment easily, optimized for android and IOS devices.

Azure mobile App is designed to work with Azure App services, its based on ASP.net. 6, it can also be run as a container in Azure container App or App Kubernetes.

Azure mobile App (also known as the Microsoft Data-sync Framework) gives enterprise developers and system integrator a mobile-application development platform that is highly scalable and globally available.

**The benefit of using Azure mobile App** 
1 Helps you access all the azure resources from the convenience of your phone.
2 Quickly diagnose and fix issues that may arise from your azure environment.
3 Helps with alerting and monitoring from your amobile device.
4 It gives you the full power of the cloud shell experience to your mobile device.
My first database: Christian Church
Tags: postgres, beginners, programming, database
Published: 2023-06-14 19:15:37

I created a database modeling the hierarchy of a christian church because I wanted to get some experience with database with a topic I don't know. The hierarchy of the christian church is shown below.


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

The image below shows my schema for my database.

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

If you would like to know more about this database or how I made the database follow the link below to my github for a more in depth look at my first database.

[https://github.com/froglegs1/first-database](url)
Walkthrough- create a storage account with a bolb container on Azure.
Published: 2023-06-14 18:38:23

1. open your Azure portal and search storage accounts, click and open the storage account then click on create to create a new storage account.

2.after clicking on create, on this next page you are required to enter information like: subscription, Resource group, storage account name, Regions, Performance etc. 
then click on Review and click on create after reviewing your information.

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

3. After your deployment is complete click on go to Resource.

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

4. The next step would be to create a container for your storage. on this new page In the left menu for the storage account, scroll to the Data storage section, then select Containers. then select **+ Container button.**
Type a name for your new container, Set the level of public access to the container (default access is private you will have to select bolb if you want someone else to access files uploaded to this storage, and then click on create.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17d3jfn6xhj30n6mm3mw.jpg)

5. To upload a file to the bolb storage you've just created, click on upload after opening the container.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4e144w7uokno5t7nloi3.jpg)

-It is important to note that after uploading a file of your choice you need to set the preferred access tier which will determine how long the file is stored for and how often you can access this files.
there are 3 types of access tier which are: 

HOT: Optimized for storing data that is frequently accessed.

COOL: Optimized for storing data that is infrequently accessed and stored for at least 30 days.

ARCHIVE: Optimized for storing data that is rarely accessed and stored for at least 180 days with flexible latency requirements.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rb5es04j76cfted6mhs.jpg)

6. After uploading the file of your choice you can copy the link to access the file on web by you or others. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ksxfcjvhqfo7bx40mvt.jpg)