Fading Coder

One Final Commit for the Last Sprint

Implementing UDP Unicast, Broadcast, and Multicast in Qt

Overview of UDP Communication Modes User Datagram Protocol (UDP) is a connectionless and unreliable protocol. In Qt development, implementing UDP requires understanding three primary transmission modes: Unicast, Broadcast, and Multicast. Effective implementation often depends on how network interfac...

Building Template-Driven Hash Containers in C++: From Core Implementation to Standard-Like Wrappers

Core Bucket Architecture Hash tables relying on chaining require a lightweight link node structure. Each node stores the payload and a pointer to the subsequent element within the same collision bucket. template <typename Payload> struct ChainLink { Payload data; ChainLink* next_node; ChainLin...

C++ Variable Types and Data Storage Fundamentals

Basic Variables Variable Naming Conventions C++ encourages meaningful variable names that follow specific naming conventions: Names can only contain alphabetic characters, digits, and underscores (_) The first character cannot be a digit Case sensitivity applies (uppercase and lowercase differ) C++...

C++ Multiple Inheritance Memory Layout and the Necessity of Virtual Destructors

Class Hierarchy and Memory Layout Consider the following class definitions: class CBase { public: int Data; CBase() = default; ~CBase(); }; class CTEST { private: int PrivateData1; int PrivateData2; public: int Data; CTEST() = default; ~CTEST(); void PrintData(); }; class CTest2 : public CBase, publ...

Recursive Algorithm Implementations in C++

Collatz Conjecture Verification The Collatz conjecture states that for any positive integer, if it's even divide by 2, if it's odd multiply by 3 and add 1, eventually the sequence will reach 1. This program calculates the number of steps required. #include <iostream> using namespace std; int c...

Printing Payment Program v1.1 with Delivery Service

This program optimizes some code from the original v1.0. Considering market adaptability, a delivrey service has been added. Charges range from 0.5 to 2.1 yuan based on distance from the starting point to the destination. To better serve student consumers, I will continue updating this system. Feel...

Managing Threads with POSIX Threads (pthreads)

Thread management involves creation, termination, and synchronization. In Linux, the operating system kernel views threads as lightweight processes sharing the same address space. Since the standard system libraries do not provide a dedicated threading interface, developers rely on the POSIX Threads...

C++ STL List Container Fundamentals and Operations

Overview of List Container The list container implements a doubly linked circular list structure where each node contains both data fields and pointer fields: Key terminology: start and finish are iterators that function like pointers start points to the first element while finish points to the posi...

Competitive Programming Problem Set and Solutions

L1-1: Print Greeting Print a fixed greeting message. print("yuan shen, qi dong!") L1-2: Value Comparison Given a real number x, compare it to 1 and print the appropriate relational operator. #include <iostream> using namespace std; int main() { double val; cin >> val; if(val &l...

GPU-Accelerated ONNX Runtime Inference in C++ on Windows

Prerequisites Install CUDA Toolkit and cuDNN. Download the prebuilt ONNX Runtime binaries that match your CUDA major version—for example, use the CUDA 12.x package when your toolkits 12.1. Extract the archive and register the library folder in your system PATH. For GPU execution, the following dynam...