Introducing EasyCoda
EasyCoda is a learn by doing platform build by our team for developers and programmers. We have added some cloud native courses and will contine add more in the future. We also bring AI capability to learning, in each course/toturials, you can ask AI for help of unaware concepts, or problem solving. And we hope it can give you a…
Understanding Method Sets in Go
As a Go programmer, I’ve encountered numerous scenarios where understanding method sets has been crucial. Today, I want to share insights into this fundamental concept, which often confuses newcomers and occasionally trips up experienced developers. Table of Contents What are Method Sets? The Rules of Method Sets Regular Structs Embedded Structs Interface Access Example A Common Pitfall: Pointer Receivers and…
DateTime Parsing in Go
As software engineers, we often deal with time-related operations in our code. Whether it’s parsing user input, working with APIs, or handling database timestamps, dealing with time is a ubiquitous task. However, even seasoned developers can sometimes stumble upon unexpected behavior when working with time parsing, especially in languages like Go that have their own unique approach. Today, I want…
The Power of Struct Tags in Go
As a Go developer, I’ve come to appreciate the subtle yet powerful features that make this language stand out. Today, I want to dive deep into one such feature that often flies under the radar but packs a punch when it comes to writing clean, flexible, and maintainable code: struct tags. Table of Contents What Are Struct Tags? The Power…
Understanding Slice Type Conversions in Go
In the world of Go programming, type safety is a cornerstone principle that helps developers write robust and error-free code. However, this strictness can sometimes lead to situations that may seem counterintuitive at first glance. Today, we’re going to explore one such scenario: converting a slice of a specific type to a slice of interfaces. The Problem: Type Mismatch Consider…
Understanding io.Copy in Go: File Positions and Efficient Data Transfer
In the world of Go programming, efficient file operations are crucial for developing robust applications. One of the most commonly used functions for file manipulation is io.Copy. In this blog post, we’ll dive deep into how io.Copy works, with a particular focus on its effect on file positions and its role in streamlined data transfer. What is io.Copy? io.Copy is…
Deploy and setup jmeter cluster on kubernetes
Deploying JMeter on Kubernetes can significantly enhance your performance testing capabilities, enabling you to scale effortlessly and manage your test infrastructure efficiently. In this guide, we’ll walk you through the steps to deploy JMeter on Kubernetes. We will deploy a one master/two slaves jmeter service on kubernetes cluster v1.30. Introduction Apache JMeter is a popular open-source tool for performance testing,…
Disable URL Encoding In Spring WebClient
In Spring, the WebClient class does not provide a direct way to disable URL encoding globally because encoding is generally required to ensure that URLs are correctly interpreted by servers. However, you can manage encoding at the point of specifying URI components when building the request. This allows you greater control over which parts of the URL should be encoded.…
How to configure huge pages for pod?
Recently, I build a Kubernetes AI Assistant(chat bot) with knowledge from kubernetes docs website using RAG technology. And I ask this assistant a common question for test case. The result is well performed. Here is the result from the assistant: To configure huge pages for a Pod in Kubernetes, you need to follow these steps: After updating the configuration file,…
Squid Username/Password Configuration
Configuring password authentication for Squid, a popular open-source proxy server, involves several steps. Here’s a basic guide on how to set up username and password authentication in Squid: This command will prompt you to enter and confirm the password for the specified username. The -c flag is used to create a new file. Adjust the paths and settings according to…
NPM Proxy / Registry Configuration
When working with npm (Node Package Manager), you might need to configure a proxy if you are behind a corporate firewall or if you’re accessing the internet through a proxy server. Here’s how you can configure npm to use a proxy, such as http or https, socks5,.etc, Also, you can set a custom or private local registry for npm. Setting…
Fixing gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory
When you build cpp files on centos/fedora os, invoke gcc with the following command will through error: gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory, To sove this, for Centos/Fedora, Run the following command to install c++ for gcc: For ubuntu, run the following command:
ImportError: cannot import name ‘url_quote’ from ‘werkzeug.urls’
when you run your python app with flask and werkzeug packages, if the version do not match, it will through the following error: It is because Werkzeug 3.0.0 was released and Flask doesn’t specify the dependency correctly (requirements says Werkzeug>=2.2.0). This is why, Werkzeug 3.0.0 is still installed and Flask 2.2.2 isn’t made for Werkzeug 3.0.0. to resolve this issue, just reinstall werkzeug with version 2.2.2 if your…
Configure socks proxy for Python pip
To setup a socks5 proxy for python pip, you need to install pysocks package, otherwise the following error will be occured: and run following command to install pysocks and then run pip with socks5 proxy settings:
Understanding goroutine in Go
The biggest feature of Go language is that it supports concurrency (Goroutine) from the language level. Goroutine is the most basic execution unit in Go. In fact, every Go program has at least one Goroutine: the main Goroutine. It is created automatically when the program starts. In this article, we will talk about the the detail of goroutine, including what…
How to Read and Parse RSS Feeds with Rome in Java
Introduction RSS (Really Simple Syndication) feeds are a valuable source of information for both content creators and consumers. In the world of software development, you may find yourself needing to read and parse RSS feeds to extract valuable data for your projects. Fortunately, Java provides a powerful library called Rome that makes it easy to work with RSS feeds. In…
Read PDF file in java
PDF (Portable Document Format) is a popular file format for sharing documents. We will use pdfbox to read texts from pdf and extract images from pdf in java. Apache PDFBox is an open-source Java library that provides a wide range of features for working with PDF documents. To get started, we need to add PDFBox as a dependency in our…
How to read csv file in java?
To read a CSV file in Java, you can use the OpenCSV library, which is a very simple and easy to use library that allows you to work with CSV files in Java. Here’s a basic example of how you can read a CSV file: This will read the CSV file line by line and print out the first two…
Mastering HTTP Requests with WebClient in Spring WebFlux
Introduction In the world of web development, making HTTP requests is a fundamental operation. In this comprehensive guide, we’ll explore how to make HTTP requests with WebClient in Spring WebFlux, including how to set custom http headers, proxy setting, rate limit and retry, error handling, and sse(server sent event) requests, making post requests with multipart Table of Contents Introduction 1.…
How to delete a directory and its sub directories in Java?
Introduction Deleting directories and their subdirectories is a common task in Java programming, especially for developers managing files and directories in their applications. Whether you’re building a file management system, a cleanup utility, or just need to remove unwanted folders, it’s crucial to understand the proper techniques for handling this task efficiently. In this blog post, we’ll explore various methods…
How to download and save file with apache httpclient in java?
Apache HttpClient is a robust and efficient library for making HTTP requests in Java applications. It provides a wide range of features for working with HTTP, including making GET and POST requests, handling cookies, and managing connection pooling. In this blog post, we will focus on using Apache HttpClient to download files from a remote server. We also cover an…
Merge fine-tuned checkpoint with base model
if you have fine-tuned an open source model, such as llama or llama2 with lora or qlora, you can only public the fine-tuned checkpoints or merge the checkpoint into the base model, the public the new fine-tuned model. here is the code: check_point_dir is the directory where your fine tuned checkpoints located, the contents looks as below, you can also…
Size Mismatch In Lora Fine Tuning
When you fine tuning a model with lora or qlora methods, the lora_r(lora rank) parameter is important, it will define the saved checkpoint size, for example, with lora_r = 8, the saved checkpoint shape size is [8, 4096], if the lora_r is different with the saved checkpoint size, you will get an size mismatch error as below: it mentions that…
Mastering Kubernetes VolumeMount: User Groups and File Permissions
Introduction Kubernetes is a powerful container orchestration platform that helps developers manage and deploy applications at scale. While it simplifies many aspects of application management, handling file permissions and user groups within Kubernetes can be a challenge. In this blog post, we’ll delve into the intricate details of Kubernetes VolumeMount user groups and file permissions, and how to manage them…