Passing a parameter by value instead of rvalue reference

Pass-By-Value Parameter Causes Unintended Copy Operation Summary During optimization of a high-throughput C++ service, we identified severe performance degradation caused by unnecessary object copying in critical path code. The root issue occurred when a struct A was passed by value instead of by rvalue reference to a function spawning asynchronous operations. This resulted in: Unplanned … Read more

How to prevent unnecessary re-renders when passing callbacks to memoized child components?

Summary The issue at hand is preventing unnecessary re-renders in a React application when passing callbacks to memoized child components. The problem arises because functions are re-created on every render, causing the prop reference to change, even if the props used inside the child don’t change. This leads to the child component re-rendering unnecessarily. Root … Read more

JQuery sortable table rows are overflowing their container while moving

Summary When implementing jQuery UI Sortable on table rows within a Bootstrap container, the dragged row (ui-sortable-helper) horizontally overflows its responsive wrapper during drag operations. This occurs when the table’s width exceeds the viewport. Though sorting works functionally, visual overflow compromises UI integrity during drag interactions. Root Cause .table-responsive in Bootstrap uses overflow-x: auto internally, … Read more

Pass a logger to boost::json::tag_invoke

Summary A developer faced a limitation when serializing/deserializing a custom type with boost::json::tag_invoke. Specifically, they needed to pass a logger instance into the tag_invoke function to log warnings about missing JSON fields during permissive deserialization. The issue stems from strict function signature matching required by ADL (Argument Dependent Lookup) in the boost::json namespace. You cannot … Read more

LaTeX Template for book with twoside header and variables

Summary The task at hand involves creating a LaTeX template for a book with a twoside header and variable content, including Japanese text and images. The goal is to achieve a specific design where the left page has a header with numbering and two right-aligned headlines, and the right page has two left-aligned headlines with … Read more

Locking NFC Tag as read only

Summary The locking of NFC tags as read-only is a critical aspect of ensuring the security and integrity of the data stored on these tags. In this article, we will explore the root cause of why locking NFC tags is essential, the real-world impact of failing to do so, and provide an example of how … Read more

Make Playwright MS Edge screenshots stable and platform independent

Summary To achieve stable and platform-independent screenshots with Playwright MS Edge, it’s crucial to understand the factors affecting font rendering. Font rendering variations can lead to differences in screenshots between runs on the same machine and between different machines. Root Cause The root cause of the issue is attributed to: Font rendering differences due to … Read more