teleren/devto huggingface dataset:
Best Programming Memes of the Week #1
Tags: meme, webdev, programming, javascript
Published: 2023-04-30 18:47:57

## Introduction:
There is no real benefit from this article, but despite that, you chose to read it

but there is no better feeling than laughing at a meme that shares your suffering with a Programming language, and if you understand the meme, you understand the language!

therefore Here's the 'Best Programming Memes of the Week' I found.

## First time using js Regex be like:

![js regex meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdq5ln1tqj8y4z8ixdr4.png)

---


## Every front-end dev's friend:

![debug meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/os16v1a9unbx8f0msyin.jpg)

---

## using while be like:

![loop meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cttni0d8ua0vv9be85pt.jpg)
This image will take time to load

---

## Every developer's nightmare:

![js and java meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5oonqsicasvwa9opuy88.jpg)

---

## my in any work group:

![for loop meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6n7glapiok0k78t8sd3.jpg)

## Conclusion:

If you have reached this stage, you should at least go read something useful, I suggest you one of my last article:

- [Top 5 websites to sharpen your front-end skills.](https://dev.to/ymhaah/top-5-websites-to-sharpen-your-front-end-skills-3ao0)

- [30-Day React Learning Journey](https://dev.to/ymhaah/30-day-react-learning-journey-part-1-14od)

- [How To Build An Advanced Light/Dark Theme Website](https://dev.to/ymhaah/how-to-build-an-advanced-lightdark-theme-website-gke)

I hope you will share your opinion about the best meme and share with me if you find a new meme.

## Author

- professional links:
    - [Twitter](https://twitter.com/hafanwi)
    - [LinkedIn](https://www.linkedin.com/in/youssef-hafnawy/)
    - [GitHub](https://github.com/ymhaah)
- Hire me:
    - [UpWork](https://www.upwork.com/services/product/development-it-a-custom-and-responsive-websites-in-wordpress-1577236892828233728?ref=project_share)
    - [Freelancer](https://freelancer.com/u/ymhaah)
- Blog:
    - [HashNode](https://hafnawi.hashnode.dev/)
    - [Dev.to](https://dev.to/ymhaah)
    - [Medium](https://medium.com/@ymhaah250)
Simplicity
Published: 2023-04-30 18:28:06

Sometimes the best answer is the simple answer. I know we all know this but according to André Gide, a French author and Nobel Prize winner in literature, 

> "Everything that needs to be said has already been said. But since no one was listening, everything must be said again."

So, my friends, I'm here to say it again. Last week, I was working on a app and I ran into a case where I wanted users to login first before taking a course. In the event that they are not already logged in, they should be redirected to the login page. If they login successfully, I want to redirect them back to the page they were.

I'm sure this is easy peasy for some of you. Please bear with me. So, I thought about different ways to go about this. I even checked stack overflow. Some people recommended creating a custom hook and writing some mad ass code. Others recommended a library.

At first, I went with the custom hook route. But things got complicated real quick. Incase you haven't figured it out, yes, I am a lazy developer. I figured maybe I'll pickup another task. 

While working on the other task, it dawned on me that I can simply pass a parameter in my URL that stores the previous route. So let's say I am in the `\courses\:id\` route, when I get redirected to the login page, the URL becomes `\login\?next=\courses\:id\`

How did I think of this? Anyways, you get the point. 

Bye for now,
Introduction to Test-Driven Development (TDD)
Tags: webdev, productivity, devops, learning
Published: 2023-04-30 18:23:13

**Test-Driven Development (TDD)** is a software development approach that emphasizes writing automated tests for code before actually writing the code itself. TDD involves writing a test case that specifies the behavior of the code to be developed, running the test, and then writing the minimum amount of code required to pass the test. The process is then repeated for each new feature or modification to the codebase.

The TDD approach has several benefits. By writing tests before writing code, developers are forced to think carefully about the requirements and expected behavior of the code. This can help to catch potential bugs and edge cases early in the development process, reducing the cost of fixing them later on. TDD also helps to ensure that the code is modular, reusable, and maintainable, since each new feature is developed in isolation and must pass a set of tests before it can be integrated into the main codebase.

The TDD approach consists of three stages:

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

**_1. Write a test case:_** The first step in TDD is to write a test case that specifies the behavior of the code to be developed. The test case should be written in a way that can be automated, and it should be clear and unambiguous.

**_2. Run the test:_** After writing the test case, the developer runs the test to ensure that it fails. This step is important because it ensures that the test is actually testing what it is supposed to test.

**_3. Write the minimum amount of code required to pass the test:_** The next step is to write the minimum amount of code required to pass the test. This code should be simple, clear, and focused on passing the test.


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

The process is then repeated for each new feature or modification to the codebase.

The TDD approach is often used in combination with other software development practices, such as Agile development and Continuous Integration/Continuous Deployment (CI/CD). TDD helps to ensure that code is thoroughly tested and ready for integration into the main codebase, making it a valuable tool for any software development project.
Do you want to publish your own npm package ?
Tags: npm, javascript, node, opensource
Published: 2023-04-30 18:17:01

Hey everyone! Have you ever used an open-source package for your project and thought to yourself, "I could create something like this"? or you want to publish your own npm package but you're not sure where to start? Well, you're in luck because I'm here to walk you through the process step-by-step. By the end of this guide, you'll be able to confidently create and share your very own JavaScript module with the world. Let's begin!

First things first, let me explain what npm is. Npm stands for Node Package Manager, which is a tool used by developers to download, install, and manage packages. These packages are essentially modules of reusable code that you can use in your projects, making your work more efficient and organized.


Now, let's deliver the package!!

> Hope you already have a package that need's to be published.

## Step 1 - Setup an NPM account

Before you can publish an NPM package, you need to create an account on the NPM website. If you already have an account, you can skip this step.

## Step 2 - Create your package files

While createating the package make sure to edit the name and version in the package.json ```
{
  "name": "my-package",
  "version": "1.0.0",
  "description": "My first NPM package",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Your Name",
  "license": "MIT"
}
```

Here in the name field make sure to give a unique name because you cannot publish a package if the name already exsist.

## Step 3 - Test your package 

It is not a necessary part but before you publish a package make sure that its working as expected. 

## Step 4 - Publish your package 
Once you've tested your package and you're ready to publish it, run the following command in your package directory:
```
npm publish 
```

## Step 5 - Updating your package

If you need to make changes to your package, such as adding new features or fixing bugs, you can update your package.json file and run the `npm version` command to update the version number. You can then run the `npm publish` command again to publish the updated package.



---


In conclusion, publishing your own NPM package can be an exciting and rewarding experience. By following these simple steps, you can share your code with the world and contribute to the open-source community. So go ahead, create something awesome and share it with the world!
Unicode bug on macOS
Published: 2023-04-30 18:13:37

A diacritical mark is a mark on letter that conveys meaning like a change in pronunciation, like an accent. Diacritical marks in Unicode can have one or more encodings.

For example the letter c with a cedilla (ç) can be the single character:

| Character | UTF-8 encoding | Name |
|-----------|----------------|------|
| ç         | 0xc3 0xa7      | LATIN SMALL LETTER C WITH CEDILLA |

or as two:

| Character | UTF-8 encoding | Name |
|-----------|----------------|------|
| c         | 0x63           | LATIN SMALL LETTER C |
|          | 0xcc 0xa7      | COMBINING CEDILLA |

The first is known as "normal form C" (NFC). The second is called "normal form D" (NFD) -- it is the *canonical decomposition* of normal form C.

Something interesting happens when you save a file with a name in NFC: macOS will not open it.

For example:

    filename = 'français.txt'
    with open(filename, 'wt') as f:
        print('Bonjour!', file=f)

Try to double-click this file in Finder. TextEdit will show in the Dock, but nothing else happens.

Now close TextEdit, delete the file, and change the file name to its canonical decomposition (NFD):

    import os
    import unicodedata
    
    filename = 'français.txt'
    filename = unicodedata.normalize('NFD', filename)
    
    try:
        os.remove(filename)
    except FileNotFoundError:
        pass
    with open(filename, 'wt') as f:
        print('Bonjour!', file=f)

TextEdit will open this file just fine.

If you're wondering why a bunch of your files stopped opening after the latest upgrade to macOS (13.3.1), this is why...
SteamWorks SteamPipe HTTP API docs?
Tags: steam, valve
Published: 2023-04-30 18:12:46

Is the SteamPipe HTTP API documented anywhere?

The [SteamPipe](https://developer.valvesoftware.com/wiki/Steam/SteamPipe) wiki page links to some configs for using nginx to cache content, but the link is broken, and I'm looking for authoritative content.

I could possibly read the source for their SDK, but I'd love to see if there are official docs.
Query Processing in PostgreSQL
Tags: postgres, sql, database
Published: 2023-04-30 18:00:41

This chapter discusses query processing in PostgreSQL, focusing on query optimization, single-table and multiple-table queries, and features like Foreign Data Wrappers and Parallel Query. PostgreSQL's backend comprises five subsystems: Parser, Analyzer/, Rewriter, Planner, and Executor. Query optimization is based on cost estimation for operations, and the planner generates the most effective plan tree from the query tree.
The planner creates a plan tree for single-table queries through preprocessing, finding the cheapest access path, and creating the plan tree from the cheapest path. Access paths are units of processing for estimating costs, and the planner uses a PlannerInfo structure to hold the query tree, relations, and access paths. To get the cheapest access path, the planner estimates costs for all possible access paths and selects the least expensive one.
The executor in PostgreSQL performs single-table queries and join operations, including nested loop join, merge join, and hash join. PostgreSQL supports three join operations: nested loop join with five variations, merge join with four variations, and hash join with a focus on hybrid hash join with skew. Hash join can be used in natural joins and equi-joins and involves a build and probe phase. Hybrid hash join with skew is employed when the inner table is too large to fit in one batch in work_mem.
In multiple-table queries, if the number of tables is less than 12, the planner uses dynamic programming to get the optimal plan; otherwise, it employs the Genetic Query Optimizer. Determining the optimal plan tree through dynamic programming involves creating and estimating costs for RelOptInfo structures in each level. The cheapest paths are calculated efficiently, and examples and explanations for obtaining the cheapest path in a triple-table query are provided.
Process and Memory architecture in PostgreSQL
Published: 2023-04-30 17:57:32

The chapter provides an overview of PostgreSQL's process architecture, which follows a client/server model and multi-process architecture, running on a single host. A 'PostgreSQL server' comprises multiple processes managing a database cluster, including a postgres server process, backend processes, various background processes, replication-associated processes, and background worker processes from version 9.3.
The postgres server process is the parent of all processes related to database cluster management. It starts by executing the pg_ctl utility, allocating shared memory, and waiting for client connection requests. PostgreSQL listens to one network port (default 5432) and can run multiple servers on different port numbers.
Backend processes handle queries and statements from connected clients. PostgreSQL allows multiple simultaneous client connections, with the max_connections parameter controlling the maximum number (default is 100). To address connection and disconnection costs, pooling middleware like pgbouncer or pgpool-II is often used.
Background processes are responsible for different functions like writing dirty pages to persistent storage, performing checkpoints, invoking autovacuum workers, writing and flushing WAL data, collecting statistics, writing error messages into log files, and executing archiving logging.
PostgreSQL's memory architecture is divided into two main categories: local memory area and shared memory area. The local memory area is allocated by each backend process and contains sub-areas for query processing, maintenance operations, and temporary tables. The shared memory area, allocated during server startup, includes sub-areas for shared buffer pool, WAL buffer, commit log, access control mechanisms, background processes, and transaction processing.
In summary, the chapter explains PostgreSQL's process architecture, which includes various types of processes and memory areas for managing database clusters and handling client connections, queries, and statements.
An Introduction to PostgreSQL
Published: 2023-04-30 17:54:47

This chapter provides an overview of PostgreSQL's database cluster structure, which includes both logical and physical aspects. A database cluster is a collection of databases managed by a PostgreSQL server, and it does not refer to a group of database servers.
The logical structure consists of database objects such as tables, indexes, sequences, views, and functions. PostgreSQL internally manages these objects using object identifiers (OIDs), which are unsigned 4-byte integers. The relationships between these objects and their OIDs are stored in system catalogs based on the object type.
The physical structure of a database cluster is primarily composed of one base directory containing subdirectories and files. Each database is a subdirectory under the base subdirectory, and tables and indexes are stored as files within their respective database subdirectories. PostgreSQL also supports tablespaces, which are directories containing data outside the base directory.
Files associated with tables and indexes are managed by the relfile node variable. When a table or index file size exceeds 1GB, PostgreSQL creates new files with incremented numbers (e.g., relfilenode.1, relfilenode.2) to accommodate the larger size. Tables have associated free space maps and visibility maps, while indexes only have free space maps.
Tablespaces in PostgreSQL are additional data areas outside the base directory, created under a specified directory when a CREATE TABLESPACE statement is issued. The tablespace directory is addressed by a symbolic link from the pg_tblspc subdirectory, and its link name is the same as the tablespace's OID value.
Heap table file in PostgreSQL is divided into fixed-length pages or blocks of 8192 bytes (8 KB). Each page has a sequential block number, and the internal layout of these pages depends on the data file types. In a heap table file, a page contains three types of data: heap tuples, line pointers, and header data.
Heap tuples are the record data itself, line pointers are 4-byte long pointers to each heap tuple, and header data contains general information about the page. To identify a tuple within the table, a tuple identifier (TID) is used, which consists of the block number and the offset number of the line pointer pointing to the tuple.
The content also explains the writing and reading methods of heap tuples. When writing, the tuple is placed after the previous one, with line pointers and header data updated accordingly. Reading tuples can be done either through a sequential scan, where all tuples in all pages are sequentially read, or through a B-tree index scan, which uses index tuples to find the target heap tuple without unnecessary scanning.
Recursive GPT and multiple AI-Powered Prompters - Check out these creative projects! 🤖🔥
Tags: javascript, ai, openai, opensource
Published: 2023-04-30 17:40:35

What's up?!

I've created 2 apps using the GPT API and want to share them with y'all.

**Recursive G:**
It's like an autoGPT but web-based, where you set a main goal and watch AI characters work towards achieving it. They intelligently interact, remember past events, and adapt their actions to achieve the goal and more...

It's in alpha, but I've open-sourced it on Github and I'm looking to enhance it quickly....
The neat thing is that you can customize the prompts that make things work directly from the browser.

You can check it out here: [recursiveG](https://recursive.g-prompter.com/)



**G-Prompter:**

A website with preset prompters for specific tasks. Like getting sweet prompts for Midjourney, having two AIs discussing, redactor prompter and much more.

This one was the first thing I did to try to learn working with chatGPT and GPT API all together. It's a fun project and I'm looking to add more prompter along the way that will be useful for all.

Here is the link: [G-Prompter](https://www.g-prompter.com/en)



Both project are creative projects that I do by night once my daily job is done and kids are sleeping 😅 but it's crazy addictive and I love it so much!!!!

I'm new to social media and self-promotion game, so be gentle, haha.
I'd appreciate any feedback, suggestions, or comments.

Please give me feedback, suggestion, comment or whatever I'm eager to hear and learn from you all.

Thank you so much for your time and feedback y'all.



Signed: a nerd.
K8s and AKS Interviewer Questions : ChatGPT Answers
Tags: devops, kubernetes, aks, programming
Published: 2023-04-30 17:21:11

> **Original Post : **
> https://medium.com/@mmmsonu/k8s-and-aks-interviewer-questions-chatgpt-answers-8f24a64d7aee

{% embed https://medium.com/@mmmsonu/k8s-and-aks-interviewer-questions-chatgpt-answers-8f24a64d7aee %}
AI tools to try
Tags: ai, tooling
Published: 2023-04-30 17:19:55

https://learnprompting.org/ - how to write good prompts to get best results from AI chatbots.
https://www.perplexity.ai/ - AI powered search engine.
https://consensus.app/ - AI powered search engine in the research papers.
https://www.d-id.com/ - animated avatars from text to image without any technical knowledge.
https://paintbytext.chat/ - edit images by text.
https://this-person-does-not-exist.com/ - generate random face photo of person.
https://askyourpdf.com/ - upload PDF and ask any questions about its content.
https://lexica.art/ - generate or search previously generated images.
https://play.vercel.ai/ - try and compare the prompt by different models.
Zero Knowledge Hackathon
Published: 2023-04-30 16:57:32

A group of us from the https://zk-learning.org MOOC decided that we will form a team and participate in the hackathon - https://zk-hacking.org

The fun part was the research into various zk-bridges including https://rdi.berkeley.edu/zkp/zkBridge/zkBridge.html - and juggling the time zones of team members.

We did not finish our project but we submitted it just for the experience - https://turing-bridge.com

Unfortunately we did not make it to the final but the experience has given me the motivation to participate in more hackathons and to keep learning.

The final event is going to be exciting - demos, prizes, awards ceremony and a Career Fair - https://www.eventbrite.com/e/zkp-workshop-hackathon-demos-awards-ceremony-plus-career-fair-dev-info-tickets-602843139057

My interest in web3 security continues.
Arthur's tips
Published: 2023-04-30 16:41:16

[https://www.bankfanz.com/kuda-bank-transfer-code/](https://www.bankfanz.com/kuda-bank-transfer-code/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)
https://plaza.rakuten.co.jp/kudabank2023/diary/202304300002/
https://peatix.com/user/17101121/
https://www.provenexpert.com/what-is-kuda-ussd-code-2023/
https://www.producthunt.com/@arthurgreg64985
https://www.divephotoguide.com/user/Kudaussdcode35
https://vocal.media/authors/arthur-gregory
https://www.lifeofpix.com/photographers/kudaussdcode35/
https://seedandspark.com/user/kuda-ussd-code-2023-3
https://rosalind.info/users/Kudaussdcode35/
http://phillipsservices.net/UserProfile/tabid/43/userId/216725/Default.aspx
https://app.roll20.net/users/11924553/kuda-ussd-code-2
https://speakerdeck.com/kudaussdcode35
https://camp-fire.jp/profile/Kudaussdcode35
https://plazapublica.cdmx.gob.mx/profiles/Kudaussdcode35/activity
https://www.metal-archives.com/users/Kudaussdcode35
https://storium.com/user/kudaussdcode35
https://trabajo.merca20.com/author/kudaussdcode35/
https://www.intensedebate.com/people/Kudaussd35
https://www.mifare.net/support/forum/users/kudaussdcode35/
https://pinshape.com/users/2624810-kudaussdcode35
http://foxsheets.com/UserProfile/tabid/57/userId/130013/Default.aspx
https://www.kompasiana.com/kudaussd35
https://leanin.org/circles/what-is-kuda-ussd-code-2023-35
https://www.credly.com/users/kuda-ussd-code-2023.3cdf2584/badges
https://www.myminifactory.com/users/Kudaussdcode35
https://www.sqlservercentral.com/forums/user/kudaussdcode35
https://www.longisland.com/profile/Kudaussdcode35
https://guides.co/a/arthur-gregory
https://myanimelist.net/profile/Kudaussdcode35