Python Dictionary Storage of Custom Objects: The Importance of References vs. Deep Copies
In Python programming, a dictionary is a very powerful data structure that allows us to associate key-value pairs and efficiently search and manipulate these data. When we try to store custom objects in a dictionary, we often encounter a crucial concept: In Python, object assignment is actually reference assignment, not a deep copy of the object itself. This means that when you put a custom object into a dictionary, the dictionary stores a reference to that object, rather than a brand new copy of the object.
Why does a newly installed gigabit fiber to the home (FTTH) connection only test at 100 Mbps?
Want your home network to be lightning fast? The key is understanding cable selection, optical terminals (ONTs), and router configuration, as well as those seemingly insignificant details. This blog post will guide you through easily learning how to build a gigabit network using six types of cables, and how to ensure your network speed isn’t restricted by simple device checks and configurations. Let’s explore together and make your home network fly!
WPF UI Thread Blocking Issues and Solutions
When developing desktop applications, particularly when using the Windows Presentation Foundation (WPF) framework to build rich client applications, properly handling the user interface (UI) thread is crucial for ensuring the application’s smoothness and responsiveness. The UI thread, also known as the main thread, is the core thread responsible for processing window and control events, layout calculations, and rendering the UI. Any interaction with UI elements should be executed on the UI thread; this is a fundamental principle followed by WPF and most other GUI frameworks.
Upgrading the GCC version caused program crashes: hidden issues due to code non-compliance.
In the same business code scenario, the program compiled and ran normally in a CentOS 7 environment. However, when switching to CentOS 8 and using an updated version of GCC for compilation, the program crashed. It’s worth noting that the issue only occurs in Release mode, while Debug mode does not exhibit any problems. This is the first time we’ve encountered a situation like this; after three days of investigation, we finally identified the root cause.
VMware Virtual Machine CPU Resource Usage Anomaly
Background: The business system, running in Windows version, is deployed locally and consumes approximately 5% of CPU resources. The Linux version of the business system, deployed within a VMware-installed CentOS8 environment, exhibits abnormal resource consumption.
Problem Description Host Machine: Windows 10 Enterprise VMware: 17.5 Virtual Machine: CentOS8 The virtual machine resource allocation is 4C8GB, running the business system. The business system is deployed in the Linux system within the virtual machine, and the internal top command observes system resource usage.
C++ Programming Traps: A Detailed Explanation of Program Crashes Caused by Improper Use of `std::map`
pstack troubleshoot a hung process
In software development and operations, deadlocked processes are frequently encountered. This situation can lead to performance degradation or service unavailability. This article introduces how to use the pstack tool to troubleshoot deadlocked process issues by analyzing process stack information to identify the root cause and resolve it.
Background: A child service within the risk control system experienced a deadlocked state, resulting in the unavailability of the risk control service. Due to the lack of service availability monitoring, the deadlocked process situation was not detected in a timely manner, leading to system unavailability.
C++ Function Call Latency
Designed a行情 SDK, implementing different callback function implementations, and performed an extensive test. Recently I’ve been looking into C++ function programming, where functions have become first-class citizens, flowing within the program internally – what’s the difference in performance?
Previous article link: Compiler, Callback Functions, Performance Testing
leimao大佬 also did similar tests, so I borrowed their code.