- 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.
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.
Back then, as a young boy, he might have had talent, but it wasn’t common.
It’s my seventh year in the job, and I’m not getting as much positive feedback on the code I write. Let me reflect on how I ended up on this coding path. People’s choices, especially when they’re younger, tend to follow positive reinforcement more closely – actively avoiding harm and seeking benefit.
China’s COVID-19 lockdown easing
The policy announcement was incredibly sudden, and its implementation was swift – the Health Code QR code was lifted, and checks for green codes in public places ceased. Browsing the Chinese-language version of The New York Times, the entire front page was dominated by discussions about China’s reopening.
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.