teleren/devto huggingface dataset:
Understanding Garbage Collection: Simplified
Tags: beginners, learning, performance, garbagecolection
Published: 2023-05-15 10:03:44

## Introduction
Garbage collection is a crucial concept in programming that manages memory and reclaims resources. In this article, we will explore two common garbage collection algorithms: "copy" and "marksweepcompact." Even if you are new to programming, we will break down these concepts in a clear and accessible manner.

## The Toy Room Cleanup Analogy
Imagine you have a room filled with toys, some broken or forgotten. Cleaning up the room and making space for new toys mirrors the memory management process in programming.

## The Copy Algorithm - Organizing Objects
One method to tidy up the toy room involves dividing it into two sections. You select the toys you want to keep and move them to one side, leaving behind the broken or unused ones. This method is similar to the "copy" algorithm in programming. It entails creating a copy of the desired objects and discarding unnecessary ones, freeing up memory.

## The Marksweepcompact Algorithm - Sorting and Optimizing Objects
Another approach to cleaning the toy room involves marking the toys you want to keep and then removing the unmarked ones. Once the unwanted toys are gone, you push the remaining toys together to maximize space. This technique aligns with the "marksweepcompact" algorithm in programming. It involves marking the objects to retain, removing the unused ones, and optimizing memory usage by reducing fragmentation.

## When are these algorithms used?
For the "copy" algorithm, the JVM divides memory into different areas. Objects are initially allocated in one area, and when that area becomes full, the JVM copies the live objects to another area, leaving behind the unused ones. This happens more frequently for newer objects.

The "marksweepcompact" algorithm is used less often. It looks at all the memory and marks the objects that are still in use. Then, it clears the unused objects, creating more space. This algorithm is used for all objects, not just the newer ones.

The JVM decides when to perform garbage collection based on factors like memory usage and pressure. It may happen when the memory reaches a certain threshold or when the application needs more space.

An example of this in Grafana would look something like this

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

## Application of Garbage Collection in Programming
While the toy room analogies simplify the concepts, garbage collection extends far beyond cleaning up toys. It plays a vital role in programming languages and runtime environments like the JVM (Java Virtual Machine) and others. Each language or platform may employ specific garbage collection strategies, but the ultimate goal remains efficient memory management and resource reclamation.
Integrating the GitHub action to make yt-dlp-api tests automated!
Tags: githubhack23, github, opensource, showdev
Published: 2023-05-15 09:56:22

--- 
title: Integrating the GitHub action to make yt-dlp-api tests automated!
published: true
description: My test action submission to the GitHub + DEV Hackathon 2023!
tags: githubhack23, github, opensource, showdev
---

## What I built 

- I developed a YouTube API service with the yt-dlp and Fast-API and it can give the YouTube video link to extract the video information.

### Category Submission

- The category is for the DIY deployments.

### App Link

{% embed http://yt-dlp-api.peterli.website %}

{% embed http://youtube.peterli.website %}

### Screenshots

The demonstration website is as follows:

![Demonstration website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0buri3r5qafnpvjlign.png)

The Swagger API doc website is as follows:

![Swagger API doc website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kipqb6zrseddju3hherg.png)

### Description

The simple yt-dlp-api server is to extract YouTube video URL easily.

### Link to Source Code 

{% embed https://github.com/peter279k/yt-dlp-api %}

### Permissive License 

The open source project is under the MIT license.

The LICENSE details is available [here](https://github.com/peter279k/yt-dlp-api/blob/master/LICENSE).

## Background

My aunt likes to watch the Japanese music video and she wants to use the video to make her own music video.

However, many on-line YouTube video downloader websites are not convenient for people because they contain some advertisements. And she usually clicks the wrong place before downloading the YouTube video via the website.

Due the above reason, I determine developing the YouTube video downloading website and it can resolve the above issue currently.

### How I built it

- For integrating the GitHub action setting, it's available [here](https://github.com/peter279k/yt-dlp-api/blob/master/.github/workflows/tests.yml).
  - I use the GitHub action to setup the Python 3.8 environment and make some tests automated with pytest.

I use the following techniques to complete above website development:

- Python 3.8+
- FastAPI
- Bootstrap 4

I use the following techniques to complete the unit tests:

- pytest
- pytest-mock
- Fast API testing

I learn how to use above packages to complete unit tests. And it includes mocked test approaches.

### Additional Resources/Info

Here are some useful references I found and it's helpful for me to complete this open source project:

- [pytest-mock](https://changhsinlee.com/pytest-mock)
- [Fast API testing](https://fastapi.tiangolo.com/tutorial/testing)
- [how-to-use-pytest-mock-to-simulate-responses](https://medium.com/analytics-vidhya/how-to-use-pytest-mock-to-simulate-responses-1ea41e964161)
Why I Chose to Start My Career in Frontend Development: A Personal Journey
Tags: frontend, javascript, webdev, career
Published: 2023-05-15 09:28:41

From a young age, I’ve always been fascinated by design.:art: 

I found joy in drawing pictures, creating handmade cards, and experimenting with different fonts and colors on my computer. I was always seeking out new ways to express my creativity. As I grew older, this passion only intensified, and it eventually led me down the path of becoming a front-end developer.:boom: :boom:

Growing up, I was constantly creating things with my hands. I loved drawing, painting, and making crafts, and I was always eager to learn new techniques and styles.

While studying computer science in college, I discovered the world of frontend development and was immediately hooked. The ability to create beautiful, interactive interfaces using code was like magic to me. I loved being able to take my designs and turn them into fully functioning websites and applications. I began experimenting with different software programs and online tools.

After completing my graduation, I pursued my post-graduation. During this time, I became increasingly interested in frontend development. I was fortunate enough to be placed through college placements as a trainee software engineer and **Guess what happened next!!** :rocket::rocket:

I got my first opportunity to work in frontend development. It was an exciting and challenging experience, as I was tasked with creating interfaces that were not only aesthetically pleasing but also user-friendly and accessible. I spent countless hours researching and experimenting with different design principles, tools, and techniques to improve my skills and create better designs.

Over the years, I’ve honed my skills in frontend development, working on a wide range of projects and collaborating with talented designers and developers. It has allowed me to combine my passion for design and technology, and has provided me with endless opportunities for growth and learning. I love being able to make someone’s experience online more enjoyable and seamless. The thrill of seeing a design concept come to life through code was unparalleled, and I knew that this was the career path I wanted to pursue.

One of the things I love most about frontend development is the constant evolution of technology. There is always something new to learn, whether it’s a new JavaScript framework or a new design trend. It’s a field that requires both creativity and technical skill, which keeps me engaged and challenged.

Reflecting on my journey, I’m thankful for the first chance I had to work in frontend development. It not only allowed me to gain new skills, but also opened up a world of possibilities that I could never have imagined. For anyone considering a career in this field, I urge you to take the leap and discover the exciting opportunities that await you. You never know, you might just find your true calling as I did!

Thank you for reading!! :smiley:
Salable was created by developers, for developers
Tags: saas, developers, github, beginners
Published: 2023-05-15 09:21:38

Did somebody say an all in one SaaS platform? That's us 🙌

Flexible licensing ✔️
App monetisation✔️
Subscription management✔️
and lots more! ✔️✔️✔️

We do all the heavy lifting and help you turn your product concept into a successful revenue-generating business. Sound exciting? 

We understand the frustrations that come with existing commercial solutions, which is why we set out to build an easy-to-use tool that simplifies the process of setting up a SaaS business.

Salable is designed for app creators, small app vendors, and SaaS start-ups who want to turn their product concept into a successful revenue-generating business.

With Salable, you'll only need to learn one efficient tool to manage, monetise, and develop your business. Our platform streamlines the integration of payment providers, analytics tools, marketing, and other business tools, so you can focus on building your business while we do the heavy lifting. Trust Salable to take care of the hard work and help you succeed...

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

https://www.salable.app/
Does eBay Accept Cash App? Exploring the Integration of Two E-Commerce Giants
Tags: finance
Published: 2023-05-15 09:20:02

In today's digital era, online shopping has become increasingly popular, with platforms like eBay and payment services like Cash App revolutionizing the way we buy and sell goods. As both eBay and Cash App continue to gain momentum, it's natural for users to wonder if these two e-commerce giants have joined forces. In this blog post, we will delve into the topic and explore [**Does eBay Accept Cash App**](https://www.cashappmonks.com/blog/does-ebay-accept-cash-app/) as a payment method. So, let's unravel the truth behind this intriguing question.

## Understanding eBay's Payment Options

eBay, one of the world's largest online marketplaces, offers a wide range of payment options to cater to the diverse needs of its users. Traditionally, eBay transactions were primarily conducted through PayPal, a popular online payment platform. However, in recent years, eBay has expanded its payment options to include alternatives to PayPal, aiming to provide more flexibility and convenience to its users.

**The eBay-Cash App Connection**

At the time of writing this blog (September 2021), eBay does not directly accept Cash App as a payment method. However, it's important to note that eBay frequently updates its payment options to adapt to changing trends and customer demands. While Cash App is not currently integrated into eBay's checkout system, there are potential workarounds that allow users to utilize Cash App indirectly for eBay transactions.

**Indirect Use of Cash App on eBay**

•	Users can indirectly utilize Cash App for eBay transactions through workarounds.
•	One approach involves transferring funds from Cash App to a linked bank account and using that account for eBay payments.
•	Peer-to-peer transactions outside of eBay's platform can also involve Cash App as a payment method.

If you find a seller on eBay who is willing to accept payment via Cash App, you can communicate with them privately and arrange the transaction outside of eBay's platform. However, it's important to exercise caution when engaging in such transactions and ensure that you follow eBay's policies and guidelines.

**Future Possibilities**

•	E-commerce platforms are always seeking ways to enhance user experiences.
•	It is possible that eBay may consider integrating Cash App as an official payment method in the future.
•	Adapting to emerging customer preferences is a crucial aspect of e-commerce growth.

**Conclusion:**

While eBay does not currently accept Cash App as a direct payment method, users can still find ways to incorporate Cash App into their eBay transactions indirectly. By leveraging existing bank accounts or engaging in peer-to-peer transactions, users can tap into the features and convenience offered by Cash App. As e-commerce platforms continue to adapt and innovate, we may witness changes in eBay's payment options, including the potential integration of Cash App. Until then, exploring the available alternatives can help users navigate the e-commerce landscape and make secure and convenient transactions on eBay.
proposal เรื่อง loop variable scoping ที่จะมาใน go 1.22
Tags: go
Published: 2023-05-15 09:10:16

มีประเด็นน่าสนใจที่จะถูกเปลี่ยนแปลงใน go1.22 ที่จะมาถึงนี้เรื่องนึง สามารถดูอ้างอิงได้ที่นี่ [https://github.com/golang/go/issues/60078](https://github.com/golang/go/issues/60078)

โดยเนื้อหาคร่าวๆคือ เรื่อง scope ของตัวแปรที่เราสร้างใน loop เช่น

```go
func TestAllEven(t *testing.T) {
	testCases := []int{0, 2, 4, 6}
	for _, v := range testCases {
		t.Run("sub", func(t *testing.T) {
			t.Parallel()
			if v&1 != 0 {
				t.Fatal("odd v", v)
			}
		})
	}
}
```

ใน proposal บอกว่าเทสนี้ ความจริงอยากทดสอบว่าตัวเลขในลิสต์ 0,2,4,6 ทั้งหมดนี้ เป็นเลขคู่หรือไม่ ซึ่งถ้าพบเลขคี่ในลิสต์มันจะพิพม์ออกมาว่า `odd x` แทนที่ x ด้วยเลขคี่นั้นๆ

แต่ในปัจจุบัน go จะสร้าง instance ของ v เพียง 1 instance ต่อ loop ทั้งหมด นั่นหมายความว่า เมื่อเรารันเทสนี้ มันจะเทสที่เลข 6 เลขเดียวทั้ง 4 loop เนื่องจากเราสั่งให้มันรันแบบ parallel

โดย proposal นี้จะทำการแก้ไขให้มันสร้าง instance ใหม่ในทุกๆ iteration แทนที่จะสร้างเพียงแค่ 1 instance ให้ทุกๆ iteration ซึ่งจะมีผลทำให้เมื่อเราเอาเทสนี้ไปรันใน g1.22 มันจะสามารถเช็คเลขครบทุกตัว ตั้งแต่ 0, 2, 4 และ 6 ได้ตามที่เราคาดหวัง

ทีนี้ก็มีคนเอา code อีกชุดนึงมาเสนอว่าถ้าเป็นแบบนี้ล่ะ ใน go1.22 มันจะเปลี่ยนไปเป็นอย่างไร อ้างอิงจาก [https://twitter.com/go100and1/status/1657230061777592320](https://twitter.com/go100and1/status/1657230061777592320)

```go
package main

func main() {
  for counter, i := 0, 0; i < 3; i++  {
    defer func() {
      counter++
      print(counter)
    }()
  }
}
```

จากโค้ดชุดนี้เมื่อนำมารัน จะได้ผลลัพธ์ `123` เนื่องจาก counter ถูกสร้างเพียง 1 instance สำหรับทุก iteration แต่เมื่อเรานำโค้ดนี้ไปรันใน go1.22 มันจะได้ผลลัพธ์เป็น `111` แทน

โดยการเปลี่ยแปลงนี้น่าจะ apply เฉพาะโค้ดที่ระบุ Go version ที่ใหม่พอ (เดาว่า  g0 1.22) ไม่งั้นอาจจะกระทบโค้ดเก่าๆของเราเยอะพอสมควรเลยดีเดียวครับ
Key elements of excellent UI
Tags: ui, uidesign, uiweekly, ux
Published: 2023-05-15 08:39:24

A well-designed user interface (UI) is the key to creating outstanding digital experiences that captivate and engage users. From intuitive navigation to visually appealing aesthetics, there are several essential elements that contribute to the success of a UI. In this article, we will explore the key components that make up an excellent UI, providing insights and practical tips for UI designers. Whether you're a seasoned professional or a newcomer to UI design, understanding these key elements will empower you to craft interfaces that are intuitive, visually pleasing, and highly user-friendly. Join us as we uncover the secrets behind creating exceptional UIs that leave a lasting impact on users.

Read the article on [Liki Blog](https://likims.com/blog/key-elements-of-excellent-ui).
Introducing ReactAgent: The open-source React.js Autonomous LLM Agent
Tags: webdev, opensource, openai, react
Published: 2023-05-15 08:33:46

Hello, fellow developers!

I've been working on an exiting project that I'm sure will help many of you save a lot of precious time - ReactAgent, an experimental autonomous agent that uses GPT-4 language model to generate and compose React components from user stories. Built with technologies like React, TailwindCSS, Typescript, Radix UI, Shandcn UI, and the OpenAI API, this project aims to revolutionize how we write and understand code.

<p align="center">
    <a href="https://reactagent.io">Website</a>
    ·
    <a href="https://www.loom.com/share/658adb2869174e81a39a0a2cdcfec4eb">Watch Demo</a>
    ·
    <a href="https://github.com/eylonmiz/react-agent">Github Repo</a>
    ·
    <a href="https://docs.reactagent.io">Docs</a>
    ·
    <a href="https://discord.gg/57JjYNKe">Discord</a>
</p>

## 🚀 Features

ReactAgent comes with a variety of features that make coding in React more intuitive and efficient:

- **Generate React Components from user stories:** No more manually coding every single component. Just provide a user story, and ReactAgent will do the rest.
- **Compose React Components from existing components:** Leverage your existing components to create new ones.
- **Use a local design system to generate React Components:** ReactAgent can tap into your local design system to generate components that align with your style guide.
- **Use React, TailwindCSS, Typescript, Radix UI, Shandcn UI:** ReactAgent is built with popular and modern technologies to ensure compatibility and efficiency.
- **Built with Atomic Design Principles:** We've incorporated atomic design principles into ReactAgent to enhance the cohesiveness and consistency of your designs.

## 📦 Next Steps

We're continually working to improve ReactAgent and add more features. Here are some of the things we're planning for the future:

- **Edit existing components:** Make changes to your existing components directly within ReactAgent.
- **Test Components after generating:** Immediately test your new components to ensure they're working correctly.
- **Wireframe image to skeleton code:** Convert your design wireframes into code skeletons.
- **Remote design system to generate React Components:** Use a remote design system to generate components.
- **Use of external libraries:** Integrate external libraries into your components.
- **Component logic control (state, props, context, effects, API calls, etc.):** More control over your component logic.

We're excited to see where ReactAgent goes from here, and we hope you are too! Remember, this is an open-source project, and we welcome all kinds of contributions. Whether you're a developer who wants to code, a designer who can help with the UI, or just a user who wants to share feedback and ideas, we'd love to hear from you.

Let's build the future of web development together!

Happy coding,

[Eylon](https://github.com/eylonmiz)
How Devler.io Can Save You Time and Money?
Tags: hiring, developer, softwareengineering, employing
Published: 2023-05-15 08:31:33

Whether you're a startup or an established #business, it can be hard to spend countless hours searching for the right #software_developer for your project needs. And here Devler.io can give you a hand. How? Let’s get started 👇 

🔵 Devler.io simplifies the process of matching between developers and clients with its user-friendly interface and advanced search algorithms. Clients can easily post their project requirements, and developers can search for projects that match their #skills and #experience. Devler.io ensures that the best possible matches are made between developers and clients, to be sure that projects are completed most efficiently.  


🟡 The platform provides clients with access to a wider talent pool of highly skilled and vetted engineers from Europe. This means that the #platform only accepts developers who have undergone a rigorous vetting process, ensuring that clients have access to a pool of highly qualified and experienced software engineers. This not only saves clients time in #searching for the right developer but also ensures that they get quality work that meets their expectations. 


🔵 Devler.io enables clients to shorten the hiring time by easily #employing one of the devlers within a few days. Unlike traditional #hiring methods that can take weeks or even months to find the right developer for the project, Devler.io's advanced search algorithms match the client's project requirements with developers' skills and experience. This ensures that clients can quickly find the perfect developer for their project.  


🟡 Developers from Dev’s #Network enable faster project completion times. This fosters a collaborative environment that enables developers to work efficiently, and clients to monitor their progress easily. The Devler.io platform's efficient hiring process and the quality of its vetted software #engineers from Europe leads to faster project completion times, which is crucial in today's fast-paced business environment. 

Devler.io provides you with access to a wider #talent pool of vetted software engineers from Europe, streamlines the hiring process, and ultimately helps you complete your project efficiently and cost-effectively. Would you like to try? Fill the contact form or visit the page to get more info  🚀
Italian Toolkit - developizza and maindolino
Tags: githubhack23
Published: 2023-05-15 08:11:35

## What I built 

A collection of helper methods and classes for .NET for common Italy-related data management packed in a single library to avoid code duplication.

### Category Submission: 

DIY Deployments

### App Link

https://www.nuget.org/packages/ItalianToolkit/

### Screenshots 

n/a

### Description 

This library contains a collection of helper methods and classes for .NET for common Italy-related data, like fiscal codes, car plates, and so on.

### Link to Source Code 

https://github.com/Defkon1/italian-toolkit

### Permissive License 

MIT

## Background (What made you decide to build this particular app? What inspired you?) 

In my daily job I often need to manage and validate the same kind of data, so I choose to create a single library to avoid code duplication.

### How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?) 

This repo shows how to use the following Github Actions:
 * [CodeQL](https://github.com/Defkon1/italian-toolkit/blob/maindolino/.github/workflows/codeql.yml)
 * [Linter](https://github.com/Defkon1/italian-toolkit/blob/maindolino/.github/workflows/linter.yml)
 * [Build and push to NuGet](https://github.com/Defkon1/italian-toolkit/blob/maindolino/.github/workflows/publish-to-nuget.yml)
 * [Update README with blog posts](https://github.com/Defkon1/italian-toolkit/blob/maindolino/.github/workflows/blog-posts-workflow.yml)

and many more are coming!

### Additional Resources/Info