teleren/devto huggingface dataset:
The Art of Writing Clean Code: Craft Clear and Maintainable Software
Tags: coding, cleancode, programming, softwaredevelopment
Published: 2024-05-28 07:01:26

## Introduction

---

In the world of software development, clean code is like a well-written piece of music. It's not just functional, it's beautiful and easy to understand. But what exactly is clean code, and why is it important?

## **Clean code is code that is:**

---

- **Readable:** Anyone, not just the original programmer, can easily understand what the code is doing.
- **Maintainable:** The code is easy to modify and update without introducing errors.
- **Efficient:** The code avoids unnecessary complexity and runs smoothly.

## **Why Write Clean Code?**

---

There are many benefits to writing clean code. Here are a few:

- **Saves time and money:** Clean code is easier to debug and fix, which saves developers time and money.
- **Reduces errors:** Clean code is less likely to contain errors, which leads to more stable and reliable software.
- **Improves collaboration:** Clean code makes it easier for developers to work together on projects.

## **Tips for Writing Clean Code:**

---

- **Use meaningful names:** Give variables and functions names that clearly describe what they do.
- **Write clear and concise comments:** Comments should explain the code's purpose, but not repeat what the code itself is doing.
- **Format your code consistently:** Use consistent indentation and spacing to make your code easier to read.
- **Break down complex code:** Large functions can be difficult to understand and maintain. Break them down into smaller, more manageable functions.
- **Follow coding standards:** Many programming languages have established coding standards. Following these standards can help improve the readability and maintainability of your code.

## **Conclusion**

---

Writing clean code is an art form that takes practice and discipline. However, the benefits of clean code are well worth the effort. By following the tips above, you can start writing code that is clear, maintainable, and efficient.

## **Ready to learn more?**

---

Check out these resources to take a deeper dive into the art of clean coding:

- A book: "The Art of Clean Code " by Robert C. Martin
- A website: "[Clean Code Practices](https://www.cleancoders.com/)"
Uncontrolled vs Controlled React Components
Tags: webdev, javascript, react, beginners
Published: 2024-05-28 07:00:00

Today, we'll explore the nuanced differences between uncontrolled and controlled components in React.

Grasping these concepts is crucial for any React developer. It enhances your ability to create robust, user-friendly interfaces and ensures seamless state management across your apps.

Many developers struggle with these concepts, leading to inefficient code and unpredictable UI behavior. Understanding their proper use is key to avoiding these pitfalls.

## Mastering uncontrolled and controlled components is a pivotal step in becoming an adept React developer, as it directly impacts the performance and reliability of your apps.
- Uncontrolled Components: These components store their state internally and update it based on user input. They are similar to traditional HTML form elements.

- Controlled Components: Contrastingly, controlled components do not maintain their state. They receive their current value as a prop from their parent component and a callback function to update the value.

## Bulleted List of Takeaways

- Uncontrolled components offer a simpler approach for implementing form inputs but less control over their state.

- Controlled components provide more predictability and align with React's philosophy of stateful DOM management.

- Understanding when to use each type leads to more efficient code and better performance.

## Understanding Uncontrolled Components

Uncontrolled components are like traditional HTML form elements. They remember what you input without any additional code. Here's a simple example:

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

## Understanding Controlled Components

Controlled components, on the other hand, render forms elements whose values are controlled by React, as shown here:


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

## Conclusion

Understanding and correctly implementing uncontrolled and controlled components in React is vital for developers creating intuitive and responsive user interfaces. While uncontrolled components provide a quick and easy solution for simple scenarios, controlled components offer a higher level of control and integration with React's state management, leading to more predictable and manageable code. The choice between them should be guided by the specific needs of your project and your desired level of control over the component's state.

I hope you enjoyed the article.

See you in the next post.

Have a great day!
Game Development Diary #8 : Still Second Course
Tags: gamedev, godot, godotengine, newbie
Published: 2024-05-28 07:00:00

28/05/2024 - Tuesday

#Clicks and Cursors
Learning how to change the mouse cursor and detecting mouse clicks from the player

#Building Towers
Creating a scene for defensive towers and learning how to spawn new scenes in code.

#Picking Turret Positions
Connecting the RayPickerCamera and the TurretManager, so we can place the new turret scene onto tiles in the GridMap.

#Making Projectiles
Learning about the Area3D and making the turrets able to fire them in a given direction.

#Introducing Timers
Introducing the Timer node as a tool for making events happen at specific times. This lets us fire the turrets at regular intervals.

#Aiming the Turrets
Using the look_at function and the towers basis, to aim the turrets at enemies on the Path3D.

#Damaging Enemies
Using the Area3D node and variables to give the enemies health that is whittled away by projectiles until they are defeated.

#For Loops and Targeting
Learning how to use loops to identify the best target for each turret.

#Introducing Animations
Learning how to use loops to identify the best target for each turret.

#Instantiating Enemies
Ung what we have learned from spawning projectiles to spawn endless waves of enemies.

#Control Nodes and UI
Introducing Control nodes to create user interfaces. Adding a label to track the players gold count and positioning it with a container.

#Earning and Spending Gold
Finalizing the bank, making the player earn gold when they defeat enemies, and making them spend gold in order to buy turrets.

#Plans for Next Session:
Completing GameDevTV's course
投資界の大家佐藤 光信（Sato Mitsunobu）が語る財産管理の智慧
Published: 2024-05-28 06:56:35

佐藤 光信    Sato Mitsunobu

プロフィール：
早稲田大学高等学院卒業後高校、1996年に早稲田大学 政治経済学部を卒業。
卒業後、ヤマト証券の仕事に従事し、主に信託の販売を担当。
2003年、米国に渡り、アメリカ銀行メリルリンチに入社 ファンドの確立、取引構造と実行、投資評価、コンプライアンス管理など、ファンド管理と販売を担当する。
その他のビジネスとして、ビジネス開発コンサルティングに加えて、ベンチャーキャピタル、合弁、スピンオフ、および米国と英国の投資にも関与。
2018年、藤田雄一氏の招きにより、アジア太平洋地域基金部シニアアナリストとしてマッコーリー・アセット・マネージメン社に入社。

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzmuu8t1d7yuzrpqx0rl.jpg)
日本の金融業界で20年近くの経験がある、主に日本政府の資金、債券、株式市場に参加しており、販売から取引までのさまざまな市場関連のポジションを任される。

スを蓄積し、資本および経済市場の運営に精通していました。
同時に、様々な金融投資市場にも精通しており、投資市場における鋭い嗅覚を有し、資産運用の経験も豊富です。
投資テクノロジーの面では、ギャン理論、ボルインデックス、SMAチャートパターン分析などのテクニカル分析に関する高い実績と知識を持ち、市場動向の調査と判断に非常に精通しています。


人生の信条：財産管理は、単なる金融数字の積み重ねではなく、綿密に設計され、卓越した実行を行う認知芸術である。
ポジティブ思考は、ポジティブ人生をもたらし、ネガティブ思考は、ネガティブ人生をもたらす。
Tokenization of RWA (Real-World Assets): A Comprehensive Guide
Tags: tokenization, cryptocurrency, blockchain, beginners
Published: 2024-05-28 06:51:05

The digitization of assets through blockchain technology is transforming the financial landscape. Tokenization involves converting tangible and intangible RWA (real-world assets) into digital tokens on a blockchain using [crypto development services](https://blockchain.oodles.io/cryptocurrency-development-services/?utm_source=devto), enhancing their accessibility, liquidity, and divisibility. This comprehensive guide explores asset tokenization's concept, benefits, challenges, and future potential.

## What is Tokenization?
Tokenization is converting ownership rights to an RWA (real-world asset) into a digital token on a blockchain. This creates a digital representation of an asset that can be traded and managed on a blockchain. These tokens represent anything from real estate and art to commodities and intellectual property.

This comprehensive guide explores the concept, benefits, challenges, and future potential of RWA (real-world asset) tokenization: [Tokenization of RWA (Real-World Assets)](https://blockchain.oodles.io/blog/real-world-asset-rwa-tokenization/?utm_source=devto)
Building a Command-Line Interface (CLI) Application with Click in Python
Tags: python, cli, click, programming
Published: 2024-05-28 06:45:42

## **Building User-Friendly CLIs with Click in Python**

---

Command-line interfaces (CLIs) can be powerful tools, but they can also be intimidating for new users. Click is a Python library that makes it easy to create user-friendly CLIs with rich features.

In this blog post, we'll explore the benefits of using Click and walk through the steps to build a simple CLI application.

## **Why Click?**

---

Click offers several advantages for CLI development:

- **Simple and intuitive:** Click uses decorators and Pythonic syntax, making it easy to learn and use.
- **Feature-rich:** Click supports a wide range of features, including arguments, options, subcommands, help messages,and more.
- **Elegant output:** Click helps you format output for readability and can generate helpful error messages.
- **Testing support:** Click provides tools to simplify testing your CLI application.

## **Building a Basic CLI App**

---

Let's create a simple CLI tool that greets the user by name. Here's what our Python script might look like:

```python
import click

@click.group()

def cli():

pass

@cli.command()

@click.argument('name', prompt='What is your name?')

def greet(name):

click.echo(f"Hello, {name}!")

if __name__ == '__main__':

cli()
```

**Explanation:**

1. We import the click library.
2. We define a Click group using the @click.group() decorator. This serves as the main entry point for our CLI application.
3. We define a command called greet using the @cli.command() decorator.
4. The @click.argument('name') decorator defines an argument that the user can provide when running the command. The prompt argument specifies what to display to the user if no name is provided.
5. The greet function takes the name argument and prints a greeting message.
6. The if __name__ == '__main__': block ensures that the cli function is only called when the script is executed directly, not when imported as a module.

## **Running the CLI**

---

Save this code as greet.py and run it from the command line:

```bash
python greet.py
```

The script will prompt you for your name and then print a greeting message.

## **Adding Features**

---

Click allows you to add many features to your CLI application, such as:

- **Options:** You can define options using the @click.option decorator to provide additional configuration to your commands.
- **Subcommands:** Click supports creating nested subcommands for complex applications.
- **Help messages:** Click automatically generates help messages for your commands and options. You can customize these messages to provide clear instructions to your users.

By leveraging Click's features, you can build powerful and user-friendly CLI applications in Python.

## **Next Steps**

---

This is a basic introduction to Click. To learn more about Click's features and explore advanced usage patterns, refer to the Click documentation: [Click Documentation](https://click.palletsprojects.com/en/7.x/).

Happy Clicking!
Template Kubernetes manifests with dynamic data using Gomplate functions
Tags: kubernetes, gitops, aws
Published: 2024-05-28 06:39:44

**TL;DR:**

- TargetGroupBinding AWS Load Balancer Controler custom resource requires TargetGroup ARN to be specified
- TargetGroup ARN includes a random ID at the end of ARN to uniquely identify a target group — like: 
```
arn:aws:elasticloadbalancing:eu-west-1:<account-id>:targetgroup/<target-group-name>/ba7a3694de41e946
```
- To deploy multiple TargetGroupBindings user is forced to copy & paste TargetGroupARNs from AWS
- Gomplate functions can use TargetGroupName to TargetGroupARN mapping from AWS and template Kubernetes resources in git
- GitHub Actions can be used to automatically prepare a PR if new manifests are supplied or TargetGroup will be recreated on AWS

**To learn how to implement that, read the full story:**

https://blog.windkube.com/template-kubernetes-manifests-with-dynamic-data-using-gomplate-functions/
Learn about the Best Social App for Chat
Published: 2024-05-28 06:34:22

Is it not fun to be friends with new people online and share new experiences with each other? Various social apps help you befriend people from all over the world and learn about them. These platforms offer an easy-going registration process and are entirely free to use. Many prominent social apps provide other means of entertainment, such as games, movies, and songs. In addition, some of the [**best social app for chat**](https://limelitevibe.com/) also offer numerous job opportunities. You can choose any platform for yourself which seems helpful for you.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75z6p841n6lro3utct7k.jpg)
Life [1]- Daily update
Tags: life
Published: 2024-05-28 02:27:12

As mentioned in my [previous post](https://dev.to/fadhilsaheer/aah-here-we-go-again-1k08) I'm going to write my everyday progress here.

And today is May 27, and here is what I did.

There was specific bug in a project which I was working on. For this app I used `radix-ui/scrollarea` to be exact I used shadcn-ui scroll area which uses radix ui, the problem was while centering content vertically the scroll wont work. The overflowing content (which is expected to scroll) gets hidden.

I refered many stackoverflow posts & docs, many of them mentioned to use `margin: auto;` for the content inside flexbox (which I used to center). But it didn't work. The more I worked on the more I felt terrible.

At last I created another scrollarea, which centers content with fixed height (in vh) not very appropriate but it is what it is.
Digital Experiences: A Catalyst in the Business Growth
Tags: liferaydxpexperts, liferaydxpconsultingcompany, liferayplatforms, liferayservicescompany
Published: 2024-05-28 06:32:36

Not every door opens on its own. Today, you need the assistance of AI and Digital Experience to open the numerous doors on the path of your business. In this era, brands are undergoing personalized and relevant. The reasons for it are inevitable, which include wanting incredible opportunities to grow and connect with customers.
Digital experiences have become an essential part of business and personal interactions. The advent of digital experience platforms has revolutionized the way organizations engage with their customers. These platforms serve as a bridge between businesses and consumers, enabling a seamless, integrated, and personalized experience across various digital platforms. **[Digital Experience Platforms](www.adjecti.com)** (DXPs) and a focus on Digital Customer Experience (DCX) empower businesses to cultivate meaningful customer interactions to contribute to business growth.
day 09
Tags: python, oop, newbie, beginners
Published: 2024-05-28 06:30:40

date:- 28 May, 2024.

Procedural programming:- This is just how we structure our code. This is an old way of coding. In this, we divide our program into the logical sequence of steps it needs to follow to do the task.

**Object-oriented programming**:- This is another and more modern way of structuring the code. In this, we divide programs into different groups called object, where each object is responsible for a specific job. By this, we try to model objects as real-world entities. They can have their own attributes(properties/variables) and methods(functions).

In OOP, we create a standard description(properties and methods) of a group. This is called class. This class is used to make other objects which have the same description and some additional properties and methods. For eg we make a teacher as a class, knowledge of a subject can be its properties and functions including teaching, homework, test etc. Now, object will be real life people like Ramesh sir, Asha madam who will have knowledge and functions like teaching, giving homework etc plus additional functions/properties like storytelling, name which can be unique. 
To make an object from class: object_name = ClassName()
We use Pascal case(each letter capital) for class names and we have to use ().
Now object_name is the object we created and it will get attributes and methods of the "ClassName" class. To access attributes or functions, we use object_name.attribute_name or object_name.function_name()

Other things I learned today:- 
1. To use a global variable in local scope, we have to use code global variable_name. But in the case of dictionaries, we don't have to write this.

Project I made:-
1. Coffe machine
https://replit.com/@rohitrj332024/Coffee-machine-day-09#main.py

----------------------------------------------------------
Somehow theory took much of my time. I am practicing oop with turtle module. Time for the rest. Thank you see you tomorrow.
佐藤 光信（Sato Mitsunobu）| 市場トレンドと投資戦略の深堀り
Tags: 佐藤光信satomitsunobu
Published: 2024-05-28 06:24:21

佐藤 光信 Sato Mitsunobu
プロフィール：
早稲田大学高等学院卒業後高校、1996年に早稲田大学 政治経済学部を卒業。
卒業後、ヤマト証券の仕事に従事し、主に信託の販売を担当。
2003年、米国に渡り、アメリカ銀行メリルリンチに入社 ファンドの確立、取引構造と実行、投資評価、コンプライアンス管理など、ファンド管理と販売を担当する。

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh8s4vbp35xom90iiabv.jpg)
その他のビジネスとして、ビジネス開発コンサルティングに加えて、ベンチャーキャピタル、合弁、スピンオフ、および米国と英国の投資にも関与。
2018年、藤田雄一氏の招きにより、アジア太平洋地域基金部シニアアナリストとしてマッコーリー・アセット・マネージメン社に入社。
日本の金融業界で20年近くの経験がある、主に日本政府の資金、債券、株式市場に参加しており、販売から取引までのさまざまな市場関連のポジションを任される。
スを蓄積し、資本および経済市場の運営に精通していました。
同時に、様々な金融投資市場にも精通しており、投資市場における鋭い嗅覚を有し、資産運用の経験も豊富です。
投資テクノロジーの面では、ギャン理論、ボルインデックス、SMAチャートパターン分析などのテクニカル分析に関する高い実績と知識を持ち、市場動向の調査と判断に非常に精通しています。
人生の信条：財産管理は、単なる金融数字の積み重ねではなく、綿密に設計され、卓越した実行を行う認知芸術である。
ポジティブ思考は、ポジティブ人生をもたらし、ネガティブ思考は、ネガティブ人生をもたらす。
How To Spend Less Time On Sweet Potato Planter
Published: 2024-05-28 06:18:40

To spend less time on sweet potato planters and increase efficiency, follow these steps:

Preparation: Prepare the field well in advance by clearing debris and ensuring soil is adequately fertilized and irrigated.

Machine Setup: Before planting, calibrate the sweet [potato planter](https://mahindrafarmmachinery.com/products/mahindra-potato-planter) according to the desired planting depth and spacing.

Optimal Conditions: Plant during favorable weather conditions to minimize delays and ensure proper soil conditions.

Efficient Operation: Operate the planter at a steady pace, maintaining control over the planting depth and spacing to avoid overlap or gaps.

Regular Maintenance: Perform regular maintenance on the planter, including cleaning and greasing parts, to prevent breakdowns and ensure smooth operation.

Training: Ensure operators are well-trained to use the planter effectively and troubleshoot minor issues independently.

By implementing these strategies, you can streamline the planting process and spend less time overall on sweet potato planting, increasing productivity and reducing operational costs.
B2B Order Validation
Published: 2024-05-13 13:56:37

Order validation process for a  B2B Website.

Create  a list of  validators for each customer,  that will validate his orders .

The order will be Valide only if  all of them have validate the order positively.

You  add to  each of your  customer (B2B  partners)   a list  of  validators  that will receive  an email once the  customer  mange has  placed an order.

They  will then  valide  or  refuse  the   order  accordingly .

The  module  works this way:

- A B2B  placed  an order ,  the  Order  remains in the  status of  “In Validation”    until  all the validators of  this particular  clients  have  validate  one by  one the order.

-  If  all the  Validators  Validate the Order positively  the  Order will  pass to the status  "  Order Validated"  and  the customer can receive  the products he ordered.

-If  only  one of  the Validators  refuses the Order,  the status of order  will pass to  "Order Refused"  and  a message will be sent  to  the customer explaining him why his order  was refused.

-The  validator  who refuses an  order should  write  a message to justify  his decision.

PrestaShop Version   : 1.6 ; 1.7  and 8

[B2B ORDER VALIDATION](https://prestatuts.com/store/home/41-b2b-order-validation.html)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6tpnj7wmaksg4yrwu05.jpg)
Using WSL2 as primary driver for 3 months with Fedora
Tags: wsl, wsl2, fedora
Published: 2024-05-28 06:12:39

### Introduction
It all started when I stumbled upon an article about Windows Subsystem for Linux being released and is fun. I wanted to give it a try and I installed Ubuntu 18.04 and started using it on and off. I immediately fell in love with the way it works. After that I had to get OS reinstalled for some reason and left at it. Couple of months later, I wanted to give it a try again but Fedora this time. Whey Fedora? you may ask. Since most time we use Red hat, Amazon Linux in our deployments I wanted to have familiar commands and add to that we all know Fedora is cutting edge latest. 

**Fedora Article:** [Install Fedora On WSL] (https://dev.to/bowmanjd/install-fedora-on-windows-subsystem-for-linux-wsl-4b26)

I followed the steps and bam. Fedora 39 running on my Windows 11 like native OS. I could access files directly using File Explorer. 

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

I quickly installed npm, .NET, git and started using it as daily driver. However, when I go home the WSL would lose internet connection. I found out I needed to edit `/etc/resolv.conf` and add nameservers of my organization and Google DNS. 

Git commit and sync took quick 1 to 3 to seconds that used to take 5 to 10 seconds on the Windows machine. `npm install` was way faster than what Windows used to take. It was like getting an upgraded machine without any money spent. 

#### Pros
1. **Windows-Linux interoperability**: Most organizations use Windows for mail, teams and are easier to maintain with AD connectivity and windows updates. Linux running natively on Windows is a boon.
2. Linux file system being generally faster improves performance by 10 to 30%
3. Familiar commands during dev and prod deployments. 
4. Windows ports are forwarded automatically to Linux Processes.
5. Windows can still scan the Linux folders for vulnerabilities
6. I can run docker/podman (we all know Docker Desktop needs a license to run on Windows)

#### Cons:
1. The only issue I am facing right now is that the longer I use, feels the WSL is slowing down.
Software testing techniques
Published: 2024-05-28 06:11:01

Testing of data is done based on boundary values or between two opposite ends where the ends may be like from start to end, or lower to upper or from maximum and minimum.

Decision table testing

Decision table is one of the testing techniques which will help us to test the systems with various sets of inputs. It is also called as cause and effect table.
****
Use case testing

It explain the functionality or requirement can be specify in the use case. It is a techniques that used to identity the test case.

LCSAJ testing(linear code sequence and jump)

White box testing techniques  to identify the code distance which begins at the start of the Programe or branch and ends at the end of the program.