teleren/devto huggingface dataset:
Distributed PostgreSQL with YugabyteDB Multi-Region Kubernetes / Istio / Amazon EKS
Tags: yugabytedb, aws, kubernetes, postgres
Published: 2024-05-28 14:14:31

YugabyteDB, an open-source PostgreSQL-compatible distributed SQL database, can be deployed on Kubernetes. When deploying across multiple regions, a service mesh helps manage the traffic, and **Istio** is a great solution for Kubernetes. Here's a guide on fully deploying the solution, from provisioning an **Amazon AKS** **Kubernetes** cluster on AWS to running **YugabyteDB** in a **multi-region** setup.

I'm following instructions from Vishnu Hari Dadhich:
[MULTI-REGION YUGABYTEDB DEPLOYMENT ON AWS EKS WITH ISTIO]
(https://dvops.wordpress.com/2024/04/27/multi-region-yugabytedb-deployment-on-aws-eks-with-istio)

{% embed https://dvops.wordpress.com/2024/04/27/multi-region-yugabytedb-deployment-on-aws-eks-with-istio  %}

Notes:
- I have AWS CLI, Kubectl, Help, and EKSCTL installed (see [here](https://dev.to/aws-heroes/yugabytedb-on-amazon-eks-3206))
- I did not use Persistent Volumes but ephemeral storage (this is a lab), by adding `--set storage.ephemeral=true` to the `helm upgrade --install` commands.

Here are the first commands, all details are in Vishnu's article.

```sh
-- get the repo
git clone https://github.com/vishnuhd/yugabyte-multiregion-aws-eks-istio.git
cd yugabyte-multiregion-aws-eks-istio

-- deploy EKS clusters
eksctl create cluster -f    mumbai/cluster-config.yaml &
eksctl create cluster -f singapore/cluster-config.yaml &
eksctl create cluster -f hyderabad/cluster-config.yaml &
wait
-- update Kubernetes configuration
aws eks update-kubeconfig --region ap-south-1     --name yb-mumbai    --alias Mumbai &
aws eks update-kubeconfig --region ap-southeast-1 --name yb-singapore --alias singapore &
aws eks update-kubeconfig --region ap-south-2     --name yb-hyderabad --alias hyderabad &
wait
-- upgrade Kubernetes
eksctl upgrade cluster -f mumbai/cluster-config.yaml --approve &
eksctl upgrade cluster -f singapore/cluster-config.yaml --approve &
eksctl upgrade cluster -f hyderabad/cluster-config.yaml --approve &
wait
```
You can continue with Vishnu's instructions, or follow his demo at the YugabyteDB Community Open Hours: 
{% embed https://www.youtube.com/live/G4mK20q95Sw?si=qeBx1STLhaOK6hjj&t=782 %}

When you are done, don't forget to terminate the cluster. Here was the cost when I tested it:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4ih038g4waizxm4dnp1.png)
Some notes on Dart package encapsulation
Tags: dart, objectorientated, encapsulation, directedgraph
Published: 2024-05-28 14:11:48


This is a short note showing how I use dart package encapsulation to manage the dependency in a dart/flutter application.    
If you are new to creating your own dart package there is a great post here on dev to help u get started [How to Create Dart Packages in Flutter: A Step-by-Step Guide](https://dev.to/aaronreddix/how-to-create-dart-packages-in-flutter-a-step-by-step-guide-1f5a)    
Dependencies are always an issue and need to be managed carefully to avoid cycles among other things, Golang helps by throwing a compilation error if u have any Cyclic dependencies in your code. Creating acyclic dependency trees(graphs) preferably Directed [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph) is what you want, you can research the details if u r interested.  

Say you have a project with a few packages like below  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qge3r2m87rksdp4jbzia.png)  

Here I have a rest_client package among others, the rest_client package will use other dependency packages like [Dio](https://pub.dev/packages/dio).  
I want to use Dio response types in the main code.  
To keep the dependency tree clean I dont want to import Dio types  in the main source as well as the rest_client package, so I export Dio from the rest_client package as so  

```
library rest_client;

export 'package:dio/dio.dart';
```
 
In the main source code I import any needed Dio artifact from my rest_client package like  

```
import 'package:rest_client/rest_client.dart' as transport;
class FreeAuthService  {

  final transport.Dio _dio = transport.Dio();
}
```
now I am free to encapsulate all my related http transport code in the rest_client package and just return the Dio responses into the main source code.

Here are some minor details  
- packages are imported in pubspec like

```
  rest_client:
    path: packages/rest_client
```

- in the package directory source you need a top level file where you export the package dependencies you wish to expose like


```
library rest_client;

export 'package:dio/dio.dart';
```
Mousse vs. Gel for Wavy Hair
Published: 2024-05-28 14:02:57

Wavy hair needs the right products to look its best. Mousse and gel are popular choices, but they serve different purposes. Knowing the differences can help you choose the right [product for your waves](https://curlyhairglow.com/mousse-vs-gel-for-wavy-hair/).

What is Mousse?
Mousse is a lightweight, foam-like product. It adds volume and body without weighing hair down. Mousse works well for fine to medium hair. It provides a natural, flexible hold. You can use mousse on damp hair. Apply it from roots to ends, then scrunch or style as desired.

Benefits of Mousse
Volume: Mousse boosts volume, making hair look fuller.
Flexibility: It offers a soft, touchable hold.
Lightweight: Mousse doesn't weigh hair down, ideal for fine hair.
What is Gel?
Gel is a thicker, more concentrated product. It provides a strong hold, great for controlling frizz and defining curls. Gel works well for medium to thick hair. Apply gel to damp hair. Distribute it evenly, then scrunch or style as desired. Let hair air dry or use a diffuser.

Benefits of Gel
Strong Hold: Gel keeps hair in place, even in humidity.
Definition: It defines curls and waves, enhancing texture.
Control: Gel tames frizz and flyaways, giving a sleek look.
Mousse vs. Gel: Which to Choose?
For Volume: Choose mousse. It adds lift and body without heaviness.
For Definition: Choose gel. It enhances and defines natural waves.
For Flexibility: Mousse offers a soft hold, ideal for natural looks.
For Control: Gel provides strong hold, perfect for structured styles.
Combining Mousse and Gel
You can use both products together. Apply mousse first for volume, then gel for hold and definition. This combination works well for many hair types. It gives you the best of both worlds.

Conclusion
Both mousse and gel have their benefits. Choose based on your hair type and desired style. Experiment to find the perfect balance for your waves. Whether you want volume, definition, or control, there's a product that will help you achieve your best hair day.
What is the Best way to Learn to Think Like a Programmer?
Tags: discuss, learning, programming
Published: 2024-05-28 14:00:00

Coding jargon, coding questions, code logic, problem-solving skills, logical thinking, creative skills, see things from different angles and thinking outside of the box come to mind. I want to improve and become the best programmer I can be, so I would like to know the best way to learn to think like a programmer. 

What would you say is the best way to learn to think like a programmer?
Variable-Length Argument Lists
Tags: java, programming, learning, beginners
Published: 2024-05-28 13:59:25

A variable number of arguments of the same type can be passed to a method and treated as an array. You can pass a variable number of arguments of the same type to a method. The parameter in the method is declared as follows:

`typeName... parameterName`

In the method declaration, you specify the type followed by an ellipsis (**...**). Only one variable-length parameter may be specified in a method, and this parameter must be the last parameter. Any regular parameters must precede it.

Java treats a variable-length parameter as an array. You can pass an array or a variable number of arguments to a variable-length parameter. When invoking a method with a variable number of arguments, Java creates an array and passes the arguments to it. The program below contains a method that prints the maximum value in a list of an unspecified number of values.

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

Line 6 invokes the **printMax** method with a variable-length argument list passed to the array **numbers**. If no arguments are passed, the length of the array is **0** (line 14). Line 7 invokes the **printMax** method with an array.
Returning an Array from a Method
Tags: java, programming, learning, beginners
Published: 2024-05-28 13:53:36

When a method returns an array, the reference of the array is returned. You can pass arrays when invoking a method. A method may also return an array. For example, the following method returns an array that is the reversal of another array.

```
public static int[] reverse(int[] list) {
  int[] result = new int[list.length];

  for (int i = 0, j = result.length - 1;
  i < list.length; i++, j--) {
  result[j] = list[i];
 }

  return result;
}
```

Line 2 creates a new array **result**. Lines 4–7 copy elements from array **list** to array **result**. Line 9 returns the array. For example, the following statement returns a new array **list2** with elements **6**, **5**, **4**, **3**, **2**, **1**.

`int[] list1 = {1, 2, 3, 4, 5, 6};
int[] list2 = reverse(list1);`
Understanding CSS Box Model
Tags: webdev, css, boxmodel
Published: 2024-05-28 13:46:35

**CSS** Box Model is a fundamental concept in web development that plays a crucial role in how elements are displayed and laid out on a webpage. In this blog, we will explore the CSS Box Model, its components, and how it affects the layout and sizing of HTML elements.

## What is the CSS Box Model?
The CSS Box Model is a way of representing every HTML element as a rectangular box showing it's occupancy and position on the web page. This model consists of four essential components as shown in the above picture:

1. **Content**: The actual content of the element, such as text or an image.
2. **Padding**: The transparent space around the content inside the box.
3. **Border**: A line that surrounds the padding and content.
4. **Margin**: The transparent space outside the border, creating space between elements.

## Understanding Each Component:
Let's take a closer look at each component of the CSS Box Model:

- **Content**: The content area is where the actual content of the element resides. Its size is determined by the element's width and height properties.

- **Padding**: Padding is the space between the content and the element's border. It can be set using the 'padding' property and is useful for creating space within an element.

- **Border**: The border surrounds the padding and content, acting as a visible boundary for the element. You can define the border's size, style, and color using the 'border' property.

- **Margin**: The margin is the transparent space outside the border, creating the space between elements. It can be set using the 'margin' property.

## Box Model Illustration:
Consider the following example:

_HTML_
```
<div class="box">
    This is the content of the box
</div>
```

_CSS_

```
.box {
     width: 10rem;
     height: 3rem;
     padding: 1rem;
     border: 5px solid blue;
     margin: 2rem;
}
```
_Output_

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

Here, in the above example we have created a container using `'div'` tag in `HTML` and added a `CSS` stylesheet to it having properties width, height, padding, border and margin respectively set to it's perticular given values.

**To understand the specific style given to it, consider the following picture:**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hynj410kdcnzdhxwjcv.png)
Here, the blue colored area shows the `width` and `height` of the actual content. The green colored area shows the `padding` given to it. The purple outline is the `border` and lastly the orange colored area outside the border is the `margin` applied to it.

## Conclusion:
So, the next time you find yourself grappling with layout challenges, remember that the CSS box model is your trusty toolkit for building pixel-perfect designs that leave a lasting impression.

For more such blogs [click here](https://amolsasane.netlify.app/blogs.html)
Smooth Sailing: Abu Dhabi Immigration Consultancy
Published: 2024-05-28 13:37:50

Embarking on your immigration journey from Abu Dhabi? Look no further for expert guidance and support. Our [Abu dhabi immigration consultancy](https://yellowboximmigration.com/) is your trusted partner in navigating the complexities of relocation, residency, and citizenship processes.

Why choose our consultancy? We're dedicated to providing comprehensive and personalized services tailored to your specific needs. With a deep understanding of Abu Dhabi's immigration laws and procedures, as well as international requirements, we ensure a smooth and efficient experience for our clients.

From initial consultations to document preparation, application submission, and follow-up, we handle every aspect of the process with meticulous attention to detail. Whether you're relocating for work, family reunification, or seeking new opportunities abroad, our team is here to guide you every step of the way.

What sets us apart is our commitment to client satisfaction. We prioritize clear communication, transparency, and responsiveness, ensuring that you're kept informed and supported throughout your entire immigration journey. Our friendly and knowledgeable consultants are always available to address your questions and concerns, providing reassurance and peace of mind.

With our expertise and personalized approach, you can embark on your immigration journey from Abu Dhabi with confidence, knowing that you have a dedicated team of professionals by your side. Contact us today to learn more about how our immigration consultancy services can help you achieve your goals and make your transition as seamless as possible. Let's navigate the path to your new beginning together!
What are your goals for week 22 of 2024?
Published: 2024-05-28 13:37:10

 It's week 22 of 2024. Yesterday was Memorial Day in the US. I'm not normalizing working on a holiday. Be nice to anyone working service or entertainment on holidays.  

## What are your goals for this short week? 

- What are you building? 
- What will be a good result by week's end?
- What events are happening this week? 
  * any suggestions for in person or virtual events?
- Any special goals for the quarter?


### Last Week's Goals
 
- [:white_check_mark:] Continue Job Search. 
- [:white_check_mark:] Project work. 
- [:x:] Blog.
- Events.
  * [:x:] Thursday Virtual Coffee. * Gonna miss Thursday Virtual Coffee. It's the last day of school and a short day so I'll be heading to pick up.
- [:white_check_mark:] Run a goal setting thread on Virtual Coffee Slack.
- [:white_check_mark:] Went to the ren faire again need to edit my photos.



 
### This Week's Goals


- Continue Job Search. 
- Project work.
- Blog.
- Events.
  * Thursday Virtual Coffee.
- Run a goal setting thread on Virtual Coffee Slack.
- Clean up from Renaissance Faire
- Yard Work


### Your Goals for the week 

Your turn what do you plan to do this week? 

- What are you building? 
- What will be a good result by week's end?
- What events are happening any week? 
  * in person or virtual?
- Got any Summer Plans?
_ How do you modify your schedule when the kids are out of school?

{% embed https://www.youtube.com/watch?v=vmewc2Uqon4 %}


```html
-$JarvisScript  git commit -m "School's out for summer!"
```
My First Billion (of Rows) in DuckDB | By João Pedro
Tags: dataengineering, python, duckdb, bigdata
Published: 2024-05-28 13:22:18

When you want to process 450Gb/1billion rows of data we think in all the directions like PySpark, Bigquery and etc. If someone says it can be processed with one Python package(DuckDB) without using/installing any fancy tools can you believe it? That’s what João Pedro did and explained in this article.

{% embed https://towardsdatascience.com/my-first-billion-of-rows-in-duckdb-11873e5edbb5 %}
How to boost your team’s productivity with custom ERP software development
Tags: productivity, softwaredevelopment, saas, development
Published: 2024-05-28 13:19:03

In today's fast-paced business environment, enhancing team productivity is crucial for success. Custom ERP (Enterprise Resource Planning) software development offers a powerful solution by streamlining operations, improving communication, and providing real-time data insights tailored to your specific business needs.

This blog explores the key benefits of custom ERP software, including:

**Streamlined Workflows:** Automate routine tasks and integrate various business processes to reduce manual effort and minimize errors.

**Enhanced Collaboration:** Improve communication across departments with centralized information and collaborative tools.

**Data-Driven Decisions:** Gain access to real-time data analytics, enabling informed decision-making and strategic planning.

**Scalability and Flexibility:** Customize the software to grow with your business and adapt to changing requirements.

By investing in custom ERP software, businesses can significantly boost productivity, optimize resources, and maintain a competitive edge. 

Discover how tailored ERP solutions can transform your operations and propel your team to new heights of efficiency.

## Exploring the Diversity in ERP Development
Different types of ERP systems can be implemented depending on various aspects of business requirements. ERP software developers and consultants can provide you with proper suggestions for which ERP system is best suitable for your business. Here is the list of different types of ERP systems:

1. On-premise ERP
2. Cloud-based ERP
3. Hybrid ERP
4. Open Source ERP

Read full article here: [https://bit.ly/3R0HVC8](https://bit.ly/3R0HVC8)
How to import all components from a folder?
Tags: vue, bash
Published: 2024-05-28 13:18:17

While developing with [Vuetify.js](https://vuetifyjs.com), I found the **`<v-icon>`** component incredibly convenient. This inspired me to create my own icon components, allowing me to easily access all of my favorite icons. I eagerly gathered all the SVG files into a folder, only to realize… I had to manually import each icon as a component, one by one. 🤦🏽‍♂️

My initial attempt to streamline this process was with **`import * from './svg'`**, 
but I quickly hit a roadblock: 
**`Failed to resolve import "./svg" from "./svg/index.js". Does the file exist?`**. 
It dawned on me that I needed an **`index.js`** file in the folder, exporting every component. So, I was back to square one, facing the tedious task of manually importing and exporting each icon component.

A quick search on [Stack Overflow](https://stackoverflow.com/questions/42199872/is-it-possible-to-import-vue-files-in-a-folder) seemed to offer a promising solution. 
```javascript
const files = require.context('.', false, /\.vue$/)
const modules = {}
files.keys().forEach((key) => {
     if (key === './index.js') return
     modules[key.replace(/(\.\/|\.vue)/g, '')] = files(key)
})
export default modules
```
However, my excitement was short-lived when the browser console threw up **`Uncaught ReferenceError: require is not defined at index.js`**. I discovered that **`require()`** is not a valid function in client-side JavaScript.

Determined to find a workaround, I decided to auto-generate the **`index.js`** file with a bash script. Although this approach still involves a bit of manual effort (I need to run the script each time I add a new component), it significantly reduces the hassle of individually verifying each filename.

Here’s the script I crafted:

```bash
# Navigate to the script's directory
cd "$(dirname "$0")"

# Get a list of icon files, excluding index.js and import.sh
icons=$(ls --hide=index.js --hide=import.sh --format=single-column)

# Define the output file
output_file="index.js"

# Clear the output file
> $output_file

# Generate import statements
for icon in $icons
do
    name=$(basename -- "$icon")
    name="${name%.*}"
    echo "import $name from './$icon'" >> $output_file
done

echo "" >> $output_file
echo "export {" >> $output_file

# Generate export statements
for icon in $icons
do
    name=$(basename -- "$icon")
    name="${name%.*}"
    echo "  $name," >> $output_file
done

echo "}" >> $output_file
echo "" >> $output_file
```

With this script in the subfolder, I simply run **`sudo ./import.sh`** and all my components are imported and exported in **`index.js`**. This allows me to use **`import * from './svg'`** seamlessly in other files.

That’s my solution. I’m eager to hear your thoughts and suggestions on how to improve this process!
Day 5 of my progress as a vue dev
Tags: webdev, vue, typescript, tailwindcss
Published: 2024-05-28 13:17:10

**About today?**
So, I finally implemented the review feature on my quiz app and after testing through every use case my app seems to be working just fine. I have pushed my code on github repository, for anyone who wants to check it out can do that through zain725342 on github. It was a basic but fun project and I really enjoyed going back to the roots and developing something out of pure thoughts and without any specific guideline. Feel free to add your take on the project as the repository is public.

**What's next?**
I have another vue project in my mind that I want to work on first before moving to the laravel and start dealing with backend. I want to work on a DSA Visualizer that will help me  polish my DSA concepts as well I want to make it fun visually so that will be an experience.

**Improvements required**
There is still some refactoring required on the published project which I will be coming back to on the weekend to really brush things up and push that in a separate branch on github.

Wish me luck!
SharePoint Rest API Formatter
Tags: sharepoint, spfx
Published: 2020-04-21 04:55:45

Before stumbling across the article, [Userscripts Are Fun And Are Still Very Much Relevant](https://dutzi.party/userscripts-are-fun/), I had never heard of Userscripts. They are pretty useful; kind of like a bare bones browser extension.

The first thing I created was a helper to format and syntax highlight the XML that comes back when navigating to a SharePoint REST endpoint in Chrome or Edge.

*Userscript automatically kicks in on all REST API urls*
![End Result](https://res.cloudinary.com/droopytersen/image/upload/v1587443821/blog/restapiformatter.gif)


*Without it, it'd look like this*
![Raw XML Response](https://res.cloudinary.com/droopytersen/image/upload/v1587443317/blog/restxml-unformatted.png)

### Previous Solutions/Attempts

- I've installed Chrome Extensions to automatically format/syntax highlight XML, but they perform mediocre at best
- I've experimented with Chrome Extensions to automatically set the request headers to `application/json`, but that inevitably causes problems when I forget to turn it off, and sometimes I prefer the ATOM/XML response because it shows you what child properties you can expand on.

### Goals

1. Format and syntax highlight the XML response
2. Provide a toggle to switch between XML or JSON response



## Install Steps

1. Install the [ViolentMonkey Chrome Extension](https://chrome.google.com/webstore/detail/violentmonkey/jinjaccalgkegednnccohejagnlnfdag)
  - This is what manages all your Userscripts.
  - It's a weird name, but it has worked great so far. 
2. Add a new User Script from URL
  - Open the ViolentMonkey extension Dashboard, 
  - Then click "New Script from Url" and paste in the following url. 
  - It's the raw url to [this Gist](https://gist.github.com/DroopyTersen/7234e172ba004a5689910f05822a1b95), which is the result of my efforts. Definitely take a look at the code if you're interested.

```
https://gist.githubusercontent.com/DroopyTersen/7234e172ba004a5689910f05822a1b95/raw/a0a7e03c47daa55ef7a34ac433f6231fdb0e9bb5/REST%2520API%2520Formatter%2520Userscript
```