teleren/devto huggingface dataset:
Database Cluster Layout
Tags: apacheage, database, agedb, postgres
Published: 2023-03-28 21:22:20

In this post, we will discuss the Cluster Database Layout of PostgreSQL. <br>
The layout of database cluster has been shown below. Main files and subdirectories in a part of the document have been listed here:
![Database Cluster Layout](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87vec0c2jyu9ywnyb25a.png)
In here, **demo** is a database cluster. Under the **Database Cluster** it has 6 files which are:

1. **pg_hba.conf:** Used for PosgreSQL's client authentication.
2. **pg_ident.conf:** Used for controlling PostgreSQL's user name mapping
3. **PG_VERSION:** Containing version number of PostgreSQL
4. **postgresql.conf:**	Used for settin configuration parameters
5. **postgresql.auto.conf:** In ALTER SYSTEM, it is stored configuration parameters. 
6. **postmaster.opts:**	Record the last command line options for the server.


In here, **demo** has 17 directories which are:
1. **base:** _Subdirectory containing per-database subdirectories_. A database is a subdirectory under the base subdirectory; and the database directory names are identical to the respective OIDs. For example, when the OID of the database is 16384, its subdirectory name is 16384.
![base](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ragdvxibfguyx2gah0na.png)
2. **global:** It contains cluster-wide tables, such as pg_database and pg_control.
3. **pg_commit_ts:** Subdirectory containing transaction commit timestamp data. Version 9.5 or later.
4. **pg_dynshmem:**Subdirectory containing files used by the dynamic shared memory subsystem. Version 9.4 or later.
5. **pg_logical:**Subdirectory containing status data for logical decoding. Version 9.4 or later.
6. **pg_multixact:**Subdirectory containing multitransaction status data (used for shared row locks)
7. **pg_notify:**Subdirectory containing LISTEN/NOTIFY status data
8. **pg_replslot:**Subdirectory containing replication slot data. Version 9.4 or later.
9. **pg_serial:**Subdirectory containing information about committed serializable transactions (version 9.1 or later)
10. **pg_snapshots:**Subdirectory containing exported snapshots (version 9.2 or later). The PostgreSQL's function pg_export_snapshot creates a snapshot information file in this subdirectory.
11. **pg_stat:**Subdirectory containing permanent files for the statistics subsystem.
12. **pg_stat_tmp:**Subdirectory containing temporary files for the statistics subsystem.
13. **pg_subtrans:** Containing **subtransaction status data**
14. **pg_tblspc:** Containing **symbolic links to tablespaces**
15. **pg_twophase:** Containing state files for prepared transactions
16. **pg_wal:** Containing **WAL (Write Ahead Logging) segment files**. It is renamed from **pg_xlog** in Version 10.
17. **pg_xact:** Containing **transaction commit state data**. It is renamed from **pg_clog** in Version 10.

## `✔️ References:`

1. https://age.apache.org/ 
2. https://github.com/apache/age
3. https://www.interdb.jp/pg/index.html
Why TypeScript is Essential for Modern Software Development
Tags: typescript, webdev, programming, javascript
Published: 2023-03-28 21:20:23

TypeScript is a popular open-source programming language that has been gaining traction in recent years. It was created by Microsoft and is a superset of JavaScript, which means it builds on top of JavaScript while adding additional features. In this blog post, we'll explore the reasons why we need to use TypeScript.

## Strong Typing
One of the biggest benefits of using TypeScript is its strong typing. In JavaScript, variables are not statically typed, meaning that their data type can change at runtime. This can lead to issues with type errors that can be difficult to debug. TypeScript adds a layer of static typing to JavaScript, which means that variables have a specific data type that is determined at compile time. This helps catch errors early on in the development process and makes code more robust.

## Better Code Organization
TypeScript makes it easier to organize code and keep it maintainable over time. This is because TypeScript introduces features like interfaces, classes, and modules that allow developers to encapsulate code and make it more modular. Interfaces help define the structure of objects, while classes help define the behavior of objects. Modules help organize code into logical units that can be reused across an application.

## Improved IDE Support
Because TypeScript is a statically typed language, IDEs can provide better code completion and error checking. This can help speed up development time and reduce the likelihood of errors. TypeScript also provides better tooling for refactoring code, making it easier to make changes to existing code without introducing new bugs.

## Safer Refactoring
Refactoring code is an essential part of software development. However, it can be difficult to refactor code in JavaScript because of the lack of static typing. TypeScript makes it easier to refactor code by providing a safety net that catches errors that may occur as a result of refactoring. This makes it easier to make changes to code without introducing new bugs.

## Better Documentation
TypeScript makes it easier to document code because it introduces a strong typing system. This means that developers can create documentation that accurately reflects the structure of their code. This can make it easier for other developers to understand the codebase and reduce the likelihood of errors.

//

TypeScript is an excellent choice for developers who want to improve the quality and maintainability of their code. It provides strong typing, better code organization, improved IDE support, safer refactoring, and better documentation. By using TypeScript, developers can catch errors early on in the development process, reduce the likelihood of bugs, and make it easier to maintain code over time. If you haven't already, consider using TypeScript for your next project.
Performance Comparison of Javascript For Loop and Reduce Method for Array Manipulation
Published: 2023-03-28 21:16:05

For some time, I have been working with Data structures in javascript, Array to be precise. As an intermediate developer, I have gotten used to using for and for of loop to iterate the elements in my array, especially when I want to perform simple Arithmetic in my application .

So, I decided to explore further and try something new. In the process I realized that i can easily iterate my arrays and perform easily with some array methods (properties with function values). 

These methods, include:
 1. map() method,
 2. filter() method,
 3.find() method, 
 4. reduce() method,.

All these new found methods have given me an advantage to do better with Data Structure (Array). For performing simple arithmetic, i will be demonstrating the reduce method.

Here is an illustration that demonstrates what I'm talking about.

Using a for of loop to perform simple arithmetic (to Sum the element in my array).
E.g

const newArray = [1,2,3,4,5]
let sum = 0;
for(const mov of newArray){
  sum += mov;
}
console.log(sum);

This will give us the sum of all the elements in the array. Now let me perform the same task with reduce method;

const newArray = [1,2,3,4,5]
let sumArray = newArray.reduce(function(accum, curEl){
  return accum += curtEl;
},0)


console.log(sumArray);


The reduce method takes in two arguments, first a function and second, an initial value of the accumulator. The accumulator is first parameter of the function followed by other paraments (the current array, the index, and the entire array)

Eg: reduce(function(accumulator, current Array, Index, Whole Array){}, initialValue)
With this accumulator, there is no need for the global scoped variable (sum), the entire calculation is done in the reduce method.
FREE AWS Cloud Project Bootcamp Week 5 Part 5
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-03-28 21:13:13

[87/100] #100DaysOfCloud Today, I did a part of the Week 5 of the FREE AWS Cloud Project Bootcamp by Andrew Brown.

Here's what I completed:
- I completed implementing a part of messaging that includes listing the messages and sending messages to a user. It is continuation of Week 5 Part 4 which I had error and I spent days trying to figure it out. The issue was the my environment variables had a problem and I had to set it again for the cognito user pool and also, there was an issue running ./bin/db/setup to create a database and more and I had to run the ./bin/db commands separately to create the database and load the schema , etc

[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/087/Readme.md)

You can watch the Bootcamp through this YouTube playlist : [FREE AWS Cloud Project Bootcamp playlist](https://youtube.com/playlist?list=PLBfufR7vyJJ7k25byhRXJldB5AiwgNnWv)
Building a Microfrontend...
Published: 2023-03-28 20:35:41

### Article 1: 

The tech industry grows and evolves at the speed of light. With that growth comes new ways of development and deliverability of web components. 

Microfrontends are a relatively new way to decompose the front-end application into more individual applications that work loosely together. In simpler terms, it is a way to break up all the web components on the front-end into smaller and easier to manage pieces. There are several benefits to mircofrontend's that include: 
* Reducing the complexity of front-end development and architecture  
* Faster and more effective development 
* Allows multiple teams to "divide and conquer" and work independently on the different web-components that contribute to the greater whole. 

As new learning developers, the knowledge of mircofrontends will be beneficial to be successful in careers of front-end development. These next few articles will be the process of learning how to build and deliver a mircofrontend. 

## What We Will Be Building

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

We will be building a UI that allows a user to search for particular data. 

## Scope Of Work 

###Backend Work: 

###Building Endpoint API
The backend portion of this project will be building an endpoint to obtain the data the user will search for. We will create an API to hold an array of objects in JSON format. The objects we will be constructing will be "badges." 


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


Properties of the Badge: 

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

* Section ("Technology Information")
* Title  ("APA Style Citation: Introductions")
* Symbol (Image to the right of the badge)
* Creator Name ("Creator Victoria Raish)
* Color (Border of the badge)

The badges need to be in a custom API JSON array of objects that we will use to retrieve the data using the fetch operation. 

###Frontend Work 
For our mirco-frontend we will need a few frontend components. 
 1. A search bar for user search 
 2. A button that implements an action listener to trigger the search
 3. A container to load the data retrieved


## Learning from Homework 

GitHub Link: https://github.com/danialamo/my-card-dani

In attempt to learn how to implement the functionalities of a mircofrontend, I decided to build off a previous project and render my "players cards" on the frontend by creating an API endpoint that held the player card data in JSON format.

As a new developer learning the ropes of correct development and deployment, there were a few errors and obstacles in the learning process. Our goal is to learn from prior mistakes as we start and continue the development of our mircofrontend. 

To be continued...
Michters-celebration-sour-mash
Published: 2023-03-28 20:19:32

The range of types, tastes, and qualities of booze have a breadth that might surprise anybody. You without a doubt could never realize all the outstanding versions of "spirits" which might be available. It is pretty frankly a stunning array of whiskeys, vodkas, scotches, and many others. **_[Michters-celebration-sour-mash](https://mcliquorhouse.com/product/michters-celebration-sour-mash/)_** There are excellent excessive end single malt scotch whiskey and coffee cease ones in order to "get the job completed." There is Grey Goose Vodka after which dozens of flavored vodkas to do not forget. If you aren't someone who is aware of their booze just realize there may be a plethora of alternatives you've got likely never even are available touch with.

Understanding alcoholic beverages is a subject it'd take an entire life to master. It isn't always that the complete global of liquor is unknowable however each time you think you have a deal with on it new matters come down the pike. Honestly I'm a reasonably knowledgeable drinker(or so I thought) but Balvenie, Glenrothes, Talisker, Glenmorangie, and lots of other names I these days unearthed have been completely new to me. I need to visit bartender college just to reserve a drink now. I was once the kind of guy who would just order a Disaronno Amaretto at the rocks because I had visible it on a business. What a dunce!

Since getting tipped off to the range and ability quality of different varieties of alcohol I have attempted to get in to single malt scotch whiskey. It seems to be the drink I enjoy the most and I parent since I will never discern out the entirety approximately these kinds of special types of spirits I should stick with one and end up an professional. So I have taken to attempting a huge arrange of unmarried malt scotches and an expansion of whiskeys. I surely am nevertheless too much of a rube to recognise what is correct, what's terrific and what simply undeniable stinks, however I think I've decided I do not enjoy Jack Daniels Whiskey. So at least we are narrowing matters down a few!

Alcohol when drank sparsely may be an great social lubricant and a pleasing nice manner to relax. Alcohol whilst drank in moderation and with a tremendous know-how of its capability can make you appear to be a dignified properly knowledgeable aristocrat.

I in no way idea ingesting nicely could have the sort of fantastic effect on my social lifestyles. Once you begin mastering approximately booze you realise the majority slightly have a hold close of what they're ingesting. Honestly, I am nevertheless no expert but my pals appear to assume I am. We've been out these days and all of sudden I am a taste maker. Here's hoping I am now not leading them the incorrect manner.
Things I wish I knew earlier that would have helped me be a better coder...
Tags: codenewbie, beginners, programming, career
Published: 2023-03-28 20:03:54

It's a new week and I am still learning new things about coding, interspersed throughout my day of reading your articles over at [CodeNewbie Organization](https://dev.to/codenewbieteam)! So here we are, your _themed_ resources of the week from yours truly.

This week, I delved in a more broad search, so we at CodeNewbie could share with y'all some broad learnings to help assist your overall growth mindset as a coder. We wanted to theme this resource-share on how we can open our minds up to failure, to new systems of organization, and to new ways of doing things.

**Here we go, here are some of my top picks of helpful resources or opportunities to learn that I found this week. This week I also wanted to add in some helpful quotes from your articles, ones that helped inspire me to keep reading and learning.**

1. "Did her scoreboard look amazing? No.

Was the code well-structured and bug-free? No.

Did it work? Yes.

That’s when I thought wow look at that, maybe sometimes writing bad code can actually be a good thing." - @evergrowingdev {% embed https://dev.to/evergrowingdev/when-writing-bad-code-is-actually-a-good-thing-2f54 %}

2. "With career fairs and meet-ups just around the corner, have you considered how you will differentiate yourself and leave a lasting impression on recruiters and potential colleagues? What approach do you plan to take?" - @viktoriabors {% embed https://dev.to/viktoriabors/maximizing-your-potential-how-to-prepare-for-career-fairs-as-a-junior-developer-lo8 %}

3. "Almost everything software engineers do requires writing. We need to write when we ask technical questions, comment on code reviews, or create design docs. This is because writing software is collaborative. The better you are at writing, the more effective you will be at building software." - @ryanlpeterman {% embed https://dev.to/ryanlpeterman/why-engineers-need-to-write-32j1 %}


We/I over at Codenewbie hope you are having a great start to a new week. If you feel so inclined, share with us what you are learning this week below!

**Happy coding!** 💜
Session 3 Create Github Site
Tags: osdc, html, markdown
Published: 2023-03-28 20:00:20

The Topics Of the Lesson are:

-  Back to local linux PC
-  Create repository for Github pages site (on Github)
-  Clone for create repository localy (on PC)
-  Download and install the git client from git-scm
-  In Windows, git-bash application
-  Setup local git configure (add, commit, config, etc.)
-  Create private/public key pair
-  Push changes (git push)
-  Congif github.io repository (on Github-settings)
-  Creating the Github page using Markdown
-  Push more changes (git status, add, commit, log. etc.)
-  The Github page after changes
-  Adding images to our Github page (add another file)
-  Push images and more changes (git status, add, commit, etc.)
-  Jekyll (from Markdown to Github)

##[mysite](https://eliyahou.github.io/)
#DEVDiscuss: Design Patterns
Tags: devdiscuss, programming, designpatterns, design
Published: 2023-03-28 20:00:00

*image created by [Margaux Peltat](https://www.patreon.com/margauxpeltat) for the [Chilled Cow YouTube channel](https://www.youtube.com/watch?v=lTRiuFIWV54)*

Time for #DEVDiscuss — right here on DEV 😎

Inspired by @earthcomfy's [Top 7 post](https://dev.to/devteam/top-7-featured-dev-posts-from-the-past-week-53g9), tonight’s topic is...**design patterns!**

{% embed https://dev.to/documatic/from-problems-to-solutions-understanding-design-patterns-3b7i %}

---
Questions:
- **Which design patterns have served you well in your applications?**
- **Which design patterns have stumped you or failed to meet your expectations for problem solving?**
- **Do you usually use design patterns purposefully or accidentally?**
- **Any triumphs, fails, or other stories you'd like to share on this topic?**
GPT is my new BFF (Backend for Frontends)
Tags: gpt3, javascript, react, node
Published: 2023-03-28 19:58:44

As a front-end developer I encountered several types of backend during my career (e.g. GraphQL). They were written with different languages (e.g. Rails or PHP). I don't consider myself as a fullstack developer, I always prefer focusing on crafting the UI.

I saw people asking Chat GPT to answer with a JSON formatted response:

![Screenshot from a discussion with Chat GPT showing a prompt asking o generate a JSON containing a question about French history with four possible answers. The answer contains the expected JSON.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frohx6t2xgp2dixtu17j.png)

This is clearly an example of BFF ([Backend for Frontends](https://learn.microsoft.com/en-us/azure/architecture/patterns/backends-for-frontends)) pattern. 
It means we could now create a lot of projects without having  to worry about having a dedicated backend or database!

This is exactly what I did with [Daily Kanji](https://github.com/sylvhama/daily-kanji). It will [prompt GPT](https://github.com/sylvhama/daily-kanji/blob/main/ssr.ts#L12) to return a random Japanese Kanji and its translation as a JSON. A scheduled [GitHub action](https://github.com/sylvhama/daily-kanji/actions/workflows/render-video.yml) (similar to a CRON job) will create a new video everyday thanks to [Remotion](https://www.remotion.dev/), a React framework to programmatically render videos. The video will then be published [on Instagram](https://www.instagram.com/your_daily_kanji/).

With this kind of setup you don't really need to worry about your [OpenAI API](https://platform.openai.com/docs/introduction) usage since it will only run once a day. During development you should rely on a JSON mock so you don't need to query OpenAI each time. With all my local tests an production runs I did not even reach $1. 

Instead of generating daily videos you could have some sort of daily quiz similar to _Wordle_. Your only limit is your imagination! 
With frameworks such as [Astro](https://astro.build/) you can generate a new static build each day based on data generated by GPT. The data would again be only [fetched once](https://docs.astro.build/en/guides/data-fetching/) at build time via a [scheduled deploy](https://www.netlify.com/blog/how-to-schedule-deploys-with-netlify/). If for any reason the request failed or the data does not have the expected shape then you could cancel / retry the job.

Something that would require further explorations: how to make sure each JSON is unique? For now I am using a little trick where I ask GPT to the the current timestamp as a seed, it seems to work!
Build Something Amazing
Tags: ai, collaborate, programming, team
Published: 2023-03-28 19:52:07

**The year 2023 is when Artificial Intelligence (AI) changes everything, especially in the workplace.** Now more than ever connecting and **collaborating with colleagues and peers**, or even other **skilled hobbyists** is more important than before. 

Collaboration is a superpower, and we will need it to level up past AI. _People effectively **flowing** together can build amazing things and change direction faster than AI alone can today._

The [Twigflo.com](https://www.twigflo.com/blog) application is free and is different. And we need different now more than before.

Create an account and use it today for free.