Techniques for Inspecting C++ Auto Type Deduction Results
When writing code, you might want to verify what type the compiler deduced for a variable. Modern IDEs like Visual Studio and VS Code provide this capability directly. Simply hover your mouse over the variable in question, and a tooltip will display its type. For this to work, your code should be syntactcially correct since the IDE performs sta ...
Posted on Mon, 28 Sep 2026 16:42:08 +0000 by brem13
Qt Window Drag and Resize with Rubber Band Effect
Recently, the project required implementing a rubber band affect on Windows, so I did some research and want to share it.
Windows system supports the rubber band effect, which can be achieved using Win32 methods: SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, showFullWindow, NULL, 0); showFullWindow is a variable. If you need the default Windows ...
Posted on Mon, 28 Sep 2026 16:31:57 +0000 by djp120
Fundamental Algorithms and Data Structures for Problem Solving
Sorting Techniques
Bubble Sort Implementation
class Solution {
public:
void sortColors(vector<int>& arr) {
performBubbleSort(arr);
}
private:
void performBubbleSort(vector<int>& data) {
int length = data.size();
for(int i = 0; i < length - 1; i++) {
for(int j = 0; j < ...
Posted on Mon, 28 Sep 2026 16:25:39 +0000 by lehara
Numeric Template Parameters and Array Class Templates in C++
Tmeplate parameters in C++ are not limited to types—they can also be compile-time constants, known as non-type (or numeric) template parameters. These enable powerful compile-time computations and fixed-size data structures.
Constraints on Non-Type Template Parameters
Must be compile-time constants—variables are not allowed.
Floaitng-point val ...
Posted on Mon, 28 Sep 2026 16:20:56 +0000 by foevah
Solutions and Analysis for AtCoder Beginner Contest 311
A - First ABC
The problem requires identifying the minimum 1-indexed position within a given string S where the characters 'A', 'B', and 'C' have all appeared at least once. The string length N is also provided.
To solve this, we can iterate through the string from its beginning. As we process each character, we need a way to track whether 'A', ...
Posted on Mon, 28 Sep 2026 16:13:09 +0000 by cpd259
Mastering std::vector Operations in C++
Instantiation and Initial Setup
Creating an empty dynamic array:
std::vector<int> emptyVec;
Initializing with a predefined set of values:
std::vector<int> initialVec = {10, 20, 30, 40};
Setting a predefined size with a uniform default value:
std::vector<int> sizedVec(5, -1); // Generates a vector with 5 elements, all set to -1 ...
Posted on Sun, 27 Sep 2026 16:46:14 +0000 by SoreE yes
C++ Design Patterns: Inheritance vs Composition, Templates, and Standard Library Integration
Inheritance vs Composition for Data Management
Consider a scenario where a class is designed to manage student grades. A common design mistake is inheriting from a standard container. Below is an implementation of VectorGradeAdapter, which inherits publicly from std::vector<int>.
#include <iostream>
#include <vector>
#inclu ...
Posted on Sun, 27 Sep 2026 16:39:09 +0000 by mackevin
Architectural Fundamentals and Implementation Essentials for ROS2 on Linux
Linux Environment Preparation
Efficient interaction with the operating system is critical for robotics development. Launch the terminal using Ctrl + Alt + T. Core navigation commands include:
cd ~ # Navigate to home directory
cd / # Access root directory
Use pwd to verify the current path, mkdir -p catkin_ws/src to prepare the work ...
Posted on Sun, 27 Sep 2026 16:30:56 +0000 by bznutz
Launching and Managing Threads with C++11's Standard Thread Library
Concurrency and Threads
Concurrency describes the simultaneous execution of several independent activities within one system. On a single-core CPU, only one instruction stream can run at any instant, yet the operating system rapidly switches among tasks, giving the illusion of parallelism. Each switch incurs a context-switch cost: the current s ...
Posted on Sun, 27 Sep 2026 16:21:35 +0000 by zhabala
Common C++ Templates for Competitive Programming
Number Theory Utilities
Greatest Common Divisor
int gcd(int a, int b) {
while (b) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
Least Common Multiple
int lcm(int a, int b) {
return a / gcd(a, b) * b;
}
Fast Exponentiation
long long power(long long base, long long exp) {
long long result = 1;
...
Posted on Sun, 27 Sep 2026 16:13:40 +0000 by spambadger