Categories

127 pages

Computer

AI-assisted programming, the evolution of productivity

“GitHub Copilot” was released less than two years ago, and “ChatGPT” has appeared. I don’t fully understand the underlying principles; I’ve been using them for a while. The two tools’ levels of assistance are completely different, but they have both achieved a significant increase in productivity.

A Collection of Less Commonly Used Git Commands

Less commonly used, but very useful git commands

Reinstalling the system caused changes to folder ownership on Windows.

The new version of git has added security checks, prompting an unsafe state and preventing further operation.

git config --global --add safe.directory
git config --global --add safe.directory "*"

New Computer Saving Account Password Information

git config --global credential.helper store

If the saved information needs to be updated, first clear out the old credentials

- Compiler - Callback Function - Performance Testing

  • Last year, an SDK was designed to handle encapsulating certain events and provide a class interface externally. During service initialization, the caller implements the corresponding classes and passes the object pointer to the module.
  • Familiarity with C11 piqued my curiosity, leading me to explore what would happen if these interfaces were implemented using lambda function objects instead of pure virtual function definitions. Compared to the traditional interface definition method, it seemed more flexible.
  • The question arose: with two different syntaxes, which one is faster from a performance perspective? Not understanding compiler principles, I decided to try out some code to find out.

Introduction

Online website, allowing you to select different compilers, compilation parameters, run code on the linux platform, or view corresponding assembly code.

Host byte, network byte, observe directly through debugger

Throughout the history of computer development, there has been no unified standard for data storage. There are two commonly used rules for byte arrangement. For example, if the low-order bits of a multi-digit number are placed at smaller addresses and the high-order bits are placed at larger addresses, it is referred to as little-endian; conversely, it is called big-endian. In network applications, byte order is a factor that must be considered because different types of machines may adopt different standards, so they are all converted according to the network standard. According to reading habits, big-endian byte order is more consistent with the left-to-right reading order.

C11: sleep for vs yield

While reviewing the code, std::this_thread::yield() suddenly popped into my view, a syntax sugar from C11 that I’d used quite a bit, but hadn’t noticed before.

Linux Server, Reset MySQL Password

I had an idle Tencent Cloud server that was expiring at the end of the year and I hadn’t planned to renew it. So, I decided to deploy a MySQL database for development purposes. When reinstalling the system, I wanted to save time and chose a third-party image provided by Tencent Cloud, which already had MySQL installed. I thought the system should include a Readme file or similar documentation explaining the password and deployment path.

A Brief Overview of Automated Testing

The investment in testing for financial trading systems far exceeded that of other systems, with tedious test steps repeatedly executed and a low ROI. As projects and personnel changed, uncontrollable factors inevitably introduced, a common situation being the modification of a field output from Interface A impacting the results of Interface B. With each version release, risk also accumulated.

Theoretical Knowledge

  • How to Measure the Value of Automation? An automation testing ROI = (Manual Execution Time) * (Number of Runs) / (Development Cost + Maintenance Cost)
  • Which Features Should Be Automated? Frequently used features that are unlikely to change. Writing automated test code for this type of interface yields the highest returns.
  • Why Choose This Timing to Drive Automation Testing? Not appropriate near project launch – distant water doesn’t quench immediate thirst; automation is a long-term return model. It’s most suitable when the project is already in a production environment and within a stable release cycle.

Framework Selection

Given the task of automation testing without prior practical experience, a typical starting point is to open a search engine and find tools and frameworks that can be used with the current system’s technology stack, review the user manuals, and get started. If you can immediately find a suitable tool, congratulations, perfect start!

Why Do We Need to Learn a New Language?

Starting from my academic years, I’ve been working with C++ for over ten years. So, why do I need to learn other programming languages?

Work experience: Lacking experience in elegant module design, C++ syntax is freeform. Learning other languages helps me guide the development of more elegant designs.

I often use them when writing some tools. The design principles for low-level libraries and business modules are also becoming clearer.