teleren/devto huggingface dataset:
"The Internals of PostgreSQL" chapter #4
Tags: postgres, database
Published: 2023-06-28 11:44:30

## **Foreign data Wrappers (FDW)**

* PostgreSQL's Foreign Data Wrappers (FDW) are a feature that uses SQL/MED to manage foreign tables, which are similar to local tables. SQL/MED is a specification that allows for accessing remote data, and PostgreSQL has implemented a portion of it since version 9.1. FDWs allow PostgreSQL to access data stored in other databases or systems as if it were a local table in PostgreSQL. This feature provides greater flexibility and interoperability for PostgreSQL, making it easier to integrate with other systems.

##

* To use the FDW feature, you need to install the appropriate extension and execute setup commands, such as CREATE FOREIGN TABLE, CREATE SERVER and CREATE USER MAPPING

##

* To use foreign tables in PostgreSQL, the analyzer/analyser creates a query tree based on their definitions stored in the pg_catalog.pg_class and pg_catalog.pg_foreign_table catalogs. The planner or executor then uses a specific library to connect to the remote server, with connection parameters stored in the pg_catalog.pg_user_mapping and pg_catalog.pg_foreign_server catalogs. The use_remote_estimate option can be set to on to obtain statistics for planning using the EXPLAIN command, with postgres_fdw being the only extension to reflect the results. Finally, the planner generates a plain SQL statement from the plan tree's scan paths of the foreign tables using deparsing.

##

* After deparsing, the executor sends the SQL statements to the remote server and receives the result. The method for sending the SQL statements to the remote server varies based on the developer of each extension. For instance, mysql_fdw sends SQL statements without using a transaction. This process allows PostgreSQL to access and manipulate data in foreign tables as if it were a local table, making it a powerful tool for data integration and migration across different systems.

##

* When executing a multi-table query, postgres_fdw fetches each foreign table using a single-table SELECT statement and then joins them on the local server. In version 9.5 or earlier, even if the foreign tables are stored in the same remote server, postgres_fdw fetches them individually and joins them on the local server. However, in version 9.6 or later, postgres_fdw has been improved and can execute the remote join operation on the remote server when the foreign tables are on the same server and the use_remote_estimate option is on. This improvement can significantly improve the performance of multi-table queries involving foreign tables on the same server.

##

* In version 9.5 or earlier, the sort operation, such as ORDER BY, is processed on the local server, i.e. the local server fetches all the target rows from the remote server prior to the sort operation.
PHP shortcode with multiple parameters
Tags: php, backend, webdev, wordpress
Published: 2023-06-28 11:44:24

```php
// PHP Function
function custom_greeting($atts) {
    // Extract shortcode attributes
    $atts = shortcode_atts(
        array(
            'name' => 'Guest',
            'age' => 0
        ),
        $atts
    );

    // Generate custom greeting
    $greeting = "Hello, {$atts['name']}! ";
    if ($atts['age'] > 0) {
        $greeting .= "You are {$atts['age']} years old.";
    } else {
        $greeting .= "We don't know your age.";
    }

    return $greeting;
}

// Shortcode
add_shortcode('greeting', 'custom_greeting');
```
In the above code, we have a PHP function called **custom_greeting** that accepts an array of attributes ($atts) as a parameter. This function uses the **shortcode_atts()** function to merge the provided attributes with default values (**'name'** => **'Guest'** and **'age'** => **0**). The function then generates a custom greeting based on the provided attributes.

To create the shortcode, we use the **add_shortcode()** function. The first parameter of **add_shortcode()** is the name of the shortcode, in this case, '**greeting**'. The second parameter is the name of the PHP function to be executed when the shortcode is encountered, which is **custom_greeting** in this example.

Now, you can use the shortcode **[greeting name="John" age="25"]** in your WordPress content to display a custom greeting. The **name** attribute specifies the name of the person, and the age attribute specifies their age. If the **age** attribute is not provided, it defaults to 0.
Starting Ukelele challenge
Tags: life, programmers, hobbie, relax
Published: 2023-06-28 11:32:17

Hello, everyone! I have some exciting news to share with you today. No, everything is about programming and working. I don't have any problems or worries at all, wait... I have big problems and some stress that I need to relax. In fact, I'm feeling so happy and grateful that I decided to take up a new hobby: learning the ukelele! I don't play any instrument, just my computer keyboard Lol.

You might be wondering why I chose the ukelele out of all the musical instruments out there. Well, let me tell you, it's such a fun and easy instrument to play and I have kids so I will learn with them. It only has four strings, so you don't have to worry about complicated fingerings or chords. It's also very portable and lightweight, so you can take it anywhere you go. And best of all, it sounds so cheerful and uplifting, just like how I feel right now.

I've always wanted to learn how to play a musical instrument, but I never had the time or the motivation before. But now that everything is working so well for me, I feel like I can do anything I set my mind to. I'm ready to challenge myself and learn something new. I've already ordered a ukelele online and I can't wait for it to arrive. I've also found some online tutorials and songs that I want to try out.

I'm so excited to start this new journey and share it with you all. I hope you'll join me in this adventure and maybe even pick up a ukelele yourself. Trust me, it's a lot of fun and it will make you feel happy too. No matter what's going on in your life, playing the ukelele will always brighten up your day. I will order my Ukelele, and I will share my progress in the next coming weeks. I will probably do the 30-day ukelele Challenge, see link below.

Thank you for reading this blog post and stay tuned for more updates on my ukelele progress. Until next time, keep smiling and keep strumming!

[Ukulele Tutorials and Play-Alongs](https://www.youtube.com/watch?v=EcDZ4kA8bSI&list=PL5PNXIkCYncg7NrkLAxj95I_ZRXLk7uIO&index=93)

[Dylan Laine Music](https://www.patreon.com/dylanlaine)

[Ukelele tips](https://ukutabs.com/ukulele-guides/ukulele-tips-for-beginners/)

[30 day Ukelele Challenge](https://www.youtube.com/playlist?list=PLJFa3EaocfZkPvRqVaUf6pFuPxiLo0uWZ)
Coreball puzzle game
Tags: gamedev, online, beginners
Published: 2023-06-28 11:20:53

The timeless arcade game AA served as the basis for the captivating and addicting online game [Coreball](https://coreball.co). Do you now hold the title of having the highest score on the leaderboard? Sign up right this minute!

The aim of Coreball is easy to understand: all you have to do is throw the ball into the coreball without touching any of the other balls. You will be able to go on to the next level of the game if you can properly throw the ball. When it was first released, this game had a simple concept, which consisted of a center ball that rotated in the centre of the screen. In order to get the gadget to spin, the "coreball" has to be pitched over a number of other balls. It is possible to make progress through all sixty of the game's levels. Despite this, the game has recently received a revamp and enlargement, expanding in size to a staggering 91 levels that are filled with a wide variety of landscapes that are both interesting and challenging. Would you want to see how well your talents stack up?
Organizing a Large Number of Scripts in Package.json
Tags: javascript, programming, codenewbie, development
Published: 2023-06-28 11:06:04

**When it comes to managing a large number of scripts in your project's package.json file, it can quickly become challenging to navigate. However, there are simple steps you can take to make your scripts more organized and easier to read. In this short tutorial, we'll explore how adding separators can improve the readability of your package.json.**
﻿
Using separators in your scripts object helps create clear sections and group related scripts together. Let’s do it in a few simple steps:
﻿
## “Scripts” object with no separators:
```javascript
"scripts": {
    "help": "scripts-help -w 40",
    "tsc": "tsc",
    "tscwatch": "tsc --watch",
    "serve": "serve ./site/"
  },
```
Prints the available commands with `npm run` as:
﻿
Scripts available in dev-tips@1.0.0 via `npm run-script`:
```javascript
  help
    scripts-help -w 40
  tsc
    tsc
  tscwatch
    tsc --watch
  serve
    serve ./site/
```
## But when separators are used like so:
```javascript
"scripts": {
    "help": "scripts-help -w 40",
    "\n========== Building ==========": "",
    "tsc": "tsc",
    "tscwatch": "tsc --watch",
    "\n========== Serving ==========": "",
    "serve": "serve ./site/"
  },
```
## The available commands are printed in a much more readable form:
﻿
Scripts available in dev-tips@1.0.0 via `npm run-script`:
```javascript
  help
    scripts-help -w 40
  
========== Building ==========
    
  tsc
    tsc
  tscwatch
    tsc --watch
  
========== Serving ==========
    
  serve
    serve ./site/
﻿
```
Check out [Github repository](https://github.com/bright/dev-tips/blob/main/javascript/grouped-commands-in-package.json).
﻿
---

By Radosław Landowski, Backend Developer @ [Bright Inventions](https://brightinventions.pl/)
Clean Coding: The Drawbacks
Tags: cleancode, softwareengineering, codingprinciple
Published: 2023-06-28 10:58:22

While clean coding practices have numerous benefits, **it's important to acknowledge that there can be some potential drawbacks** or challenges associated with them. Here are a few drawbacks or considerations related to clean coding:

1. Time and effort: Writing clean code often **requires additional time and effort** compared to writing code that merely works. Adhering to clean coding principles may involve more careful planning, refactoring, and attention to detail. This can potentially slow down the development process, especially when working under tight deadlines.

2. Subjectivity: Clean coding practices are **subjective to some extent**. Different developers may have different interpretations of what constitutes clean code, leading to potential disagreements or conflicts within a team. Finding a balance between personal preferences and team conventions can be challenging.

3. Learning curve: Embracing clean coding principles requires developers to **learn and adapt to new practices and techniques**. It may take time for team members to understand and internalize these principles, especially when transitioning from less disciplined coding practices. This learning curve can impact initial productivity.

4. Over-engineering: In some cases, an excessive focus on clean code **can lead to over-engineering**. Developers may spend too much time optimizing and refactoring code that does not necessarily require it. Over-optimization can introduce unnecessary complexity and decrease overall efficiency.

5. Trade-offs with performance: While clean code can indirectly contribute to performance improvements, there might be situations where highly optimized, but less readable or less maintainable code is necessary for specific performance-critical sections. Balancing performance requirements with clean coding practices **may require careful consideration**.

6. Balancing pragmatism: Clean coding principles should be applied with pragmatism. In certain situations, due to time constraints or specific project requirements, it **may not be feasible or practical to adhere strictly to all clean coding practices**. Finding the right balance between clean code and meeting project needs is crucial.

It's important to note that **these potential drawbacks should not undermine the overall value of clean coding**. The benefits of clean code often outweigh the challenges, and the drawbacks can be mitigated through effective team communication, education, and a pragmatic approach to applying clean coding principles.

> _"Clean code is not a project; it's a way of life."_

_...always_ Happy Coding! :fire:
Developing with Nextcloud - Part 1 -Setting up for development
Tags: tutorial, vue, beginners, nextcloud
Published: 2023-06-28 10:36:28

## Who is Nextcloud?

Nextcloud is a team of enthusiastic open source developers who love to create a fully open source file sync-and-share solution. We love our Nextcloud community and a lot of our drive comes from giving the people what they need, and a lot of the PR's and apps come from our community and they develop brilliant things. 😉 

We also make sure that Nextcloud works on a Raspberry Pi as well as on a Galera Cluster so everyone can benefit from the project. 


## Why develop with Nextcloud?

Whether it's getting a handle on your photos, your budget or your recipe collection, Nextcloud is your one stop shop for degooglifying yourself.  But there are as many needs for applications as there are people in the world. Nextcloud offers you the basics to build your app upon. Authentication, file handling and sharing, access control, mobile and desktop clients - don't worry about that, we got you covered! All you need to do is think of an app that you'd like to have and start coding. Or if you've already found an app that you love but it misses stuff you'd like to see, go ahead - all code is open source and available on GitHub and you can easily open a PR to add your feature.


We develop with PHP and VueJS. So whether you're frontend, backend or full-stack, I'm sure you can find some fun challenges to work on. We offer a large library of ready- to use Vue components too, so you can pick and choose.

## Part 1: Setting up your development environment

We created an easy to follow tutorial to set up your development environment for Nextcloud using docker. 

This tutorial is perfect for you if you wish to set up a locally running development environment for Nextcloud development and Nextcloud app development. It will take you, depending on your operating system, half an hour to a few hours to set up.

If you are just looking for something quick for a little bit of experimenting or a workshop, you might prefer to use the DevContainer instead in combination with GitHub Codespaces. That would give you a development environment with just a few clicks in which you can also start the app tutorials. 

In this tutorial you will learn how to set up your development environment using docker. After this tutorial you will know:

* How to install the docker desktop app on your machine

* How to run Nextcloud locally

* How to add a template app to your local Nextcloud

The steps of the tutorial are different depending of your operating system, so we provided a tutorial for Ubuntu users, Mac users, and Windows users.

You can find the tutorial here: https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa?path=%2F1%20Setting%20up%20a%20development%20environment

## 🤔 Do you have questions?

Just post your questions below this post and we will try to see if we can help you further!

## More tutorials

If you would like to go through more tutorials, we have collected them here: 

https://www.nextcloud.com/developer

Next week we will post the second part of the tutorial for your first simple app.
Migrate VuePress to Docus
Published: 2023-06-28 10:33:06

**Step 1.** Make a copy of VuePress Folder
**Step 2.** Remove all files related to `VuePress`
**Step 3.** Run `npx nuxi@latest init docs -t themes/docus`
**Step 3.** Move all files from `docs` folder to root of the project
**Step 4.** Run `npm install`
**Step 5.** Run `npm run dev`
**Step 7.** Copy folders from your VuePress from `src` folder except the `assets` and  `.vuepress` to the Docus's `content` folder
**Step 8.** Copy VuePress `/src/assets` folder in the `public` folder of Docus
**Step 9.** Open `src/.vuepress/config.js` from VuePress folder and rename Docus folder and files according to the sequence of `config.js`, you should add prefix number in the folder and files name as per the sequence. 
Example:
`src/.vuepress/config.js`
```js
sidebar: {
'/flutter/': [
        {
          title: 'Overview',
          children: [
            'brief',
            'introduction',
        },
'/nuxt/': [
        {
          title: 'Overview',
          children: [
            'guide',
            'setup',
        }
}
```
Then your folder names in docus should be
```
1.futter
   1.brief.md
   2.introduction.md
2.nuxt
   1.guide.md
   2.setup.md
```
**Step 10.** Update TOC
Replace
```md
[[toc]]
```
with 
```md
---
toc: true
---
```
at the top of the file.

**Step 11.** Update Components
Replace
```md
::: tip
example
:::
```
with
```md
::alert{type="info"}
example
::
```
read more at: https://docus.dev/api/components 
**Step 12.** Update Images
Replace
```
<img src="~@assets/flutter/cicd/preprod.png" width="300">
```
with
```
<img src="/assets/flutter/cicd/preprod.png" width="300">
```
Getting Started with the Angular Maps Component
Tags: webdev, angular
Published: 2023-06-28 10:20:44

Learn how to create and configure the Syncfusion Angular Maps component using the Angular CLI tool and the Syncfusion EJ2 Angular Maps package. Using the Maps component, you can visualize the Earth's surface and display static or interactive regions, zones, boundaries, or any geographic area on the land. The Syncfusion Blazor Maps component offers a rich set of features, including markers, navigation lines, bubbles, zooming, panning, and drill-down functionality, allowing you to explore interactive zones with ease. 

In this video, you will learn how to provide a visual representation of the map elements by enabling the legend. You can also enable data labels to display additional information or values associated with the map elements. Additionally, you can enable tooltips to provide further details about specific map elements when you hover over or interact with them. 

_Product overview_: https://www.syncfusion.com/angular-components/angular-maps-library

_Download an example from GitHub_: https://github.com/SyncfusionExamples/getting-started-with-the-angular-maps-component

_Refer to the following documentation on the Syncfusion Angular Maps component_: https://ej2.syncfusion.com/angular/documentation/maps/getting-started 

_Check out this online example of the Angular Maps component_: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/maps/default

{% youtube NSr4LoVe6wA %}
Bulk edit Azure DevOps work items using Excel
Tags: devops, azuredevops
Published: 2023-06-28 10:10:00

 ![Bulk edit Azure DevOps work items using Excel](https://www.techielass.com/content/images/2023/04/Bulk-edit-Azure-DevOps-work-items-using-Excel.png)

There are times when you need to do bulk edits of work items within [Azure DevOps Boards](https://www.techielass.com/what-are-azure-devops-boards). Excel supports adding work items, updating existing work items, adding links or attachments to multiple work items and much more.

### Prerequisites

- Install Microsoft Excel 2010 or later
- Install [Azure DevOps Office Integration 2019 (free)](https://visualstudio.microsoft.com/downloads/?ref=techielass.com#other-family)
- Be a member of the project you want to edit
- You should have permissions set to **Allow: View work items in this node** and **Edit work items in this node**
- If you want to add or modify work items, you should have **Stakeholder access or high**

### Setup

Once you have all the necessary prerequisites set up, it’s time to get started.  

- Open up Excel
- Click on Team on the top menu

![Bulk edit Azure DevOps work items using Excel](https://www.techielass.com/content/images/2023/04/excelplugin.png)
_Azure DevOps plug in Excel_

You will see a lot of options greyed out.  You need to connect the Excel plugin to your Azure DevOps environment.

- Click on New List
- This will activate a pop up box asking to Connect to an Azure DevOps Server.
- Click on Servers
- Now click on Add
- Enter the URL of your Azure DevOps server
- Then click OK
- It will prompt you for authentication to the Azure DevOps server
- Now click on Close

![Bulk edit Azure DevOps work items using Excel](https://www.techielass.com/content/images/2023/04/connectionsetup.png)
_Connect to Azure DevOps within Excel_

- The plugin will now pull in information about your Team Projects  

### Make bulk changes

![Bulk edit Azure DevOps work items using Excel](https://www.techielass.com/content/images/2023/04/connection-1.png)
_Azure DevOps connection within Excel_

- Select the relevant project and click on Connect
- You will be prompted regarding which items you want to pull from Azure DevOps Boards into Excel.  You can either start a new list or pull in items from a query
- You can now start to make the modifications that you need to make
- Once you have made the changes you need, click on Publish within the Team tab
- If you refresh your Azure DevOps Boards view the changes you have made will now be available  

### Conclusion

In conclusion, bulk editing Azure DevOps items using Excel can save everyone significant amounts of time and effort. By exporting the work items into an Excel sheet, users can quickly make changes to multiple items at once, and then easily import the changes back into Azure DevOps. This feature is especially helpful for larger projects with numerous work items that require frequent updates.
How to Make AI QR code with colab
Tags: ai, colab, stablediffusion
Published: 2023-06-28 10:04:16

I Wrote about how to create AI generated QR code Art with colab. so feel free to try it!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4yeeefw9s5nevz1urr0o.png)
[https://github.com/Nazku-com/AI-QRCodeWithColab](https://github.com/Nazku-com/AI-QRCodeWithColab)
The Boy Scout Rule
Tags: cleancode, softwareengineering, codingprinciple
Published: 2023-06-28 09:56:43

This is one of popular clean code principles from Uncle Bob. You can find it on his book (Clean Code: A Handbook of Agile Software Craftmanship by Robert C. Martin. Chapter 1: Clean Code, page 14.)

> _"Leave the campground cleaner than you found it."_ 

This was adapted from Robert Stephenson Smyth Baden-Powell’s farewell message to the Scouts: “Try and leave this world a little better than you found it . . .”

This principle is often used metaphorically in software development to emphasize the importance of **writing clean, maintainable code and leaving the codebase in a better state than it was before making any changes**.

Like what the scouts did cleanup in campfire, the software developers should implement this principle as well. The cleanup doesn’t have to be something big. Change one variable name for the better, break up one function that’s a little too large, eliminate one small bit of duplication, clean up one composite `if` statement. These improvements will make _"our world"_ a better place.
_...and it will guide us to **clean coding**._

<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbWN3NjFrdmhma2ljYjc5dDZ1N3AybHVtc3RldDh4NHFnOXBncWhjdCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/3o7TKy3KWDYOA7OUSI/giphy.gif">

_Okay, then. Now what?_

Happy Coding, Scouts! :fire: