Fading Coder

One Final Commit for the Last Sprint

Core Sorting Algorithms and Lua Patterns for Unity Engineers

Bubble Sort Implementation This algorithm iterates through the dataset multiple times, swapping adjacent elements if they are in the wrong order. An optimization flag is included to terminate early if the list becomes sorted before all passes complete. public static void ExecuteBubbleSortion(int[] d...

Mastering Task-Based Asynchronous Programming in C#

Understanding Task Parallel Library Fundamantals Task Parallel Library (TPL) addresses critical limitations of traditional thread pool usage. While thread pools optimize resource utilizasion by abstracting thread management complexities, they present challenges in result retrieval, exception propaga...

Core Object-Oriented Design Principles in C#

1. Single Responsibility Principle (SRP)The Single Responsibility Principle states that a class should have only one reason to change. In practical terms, this means a module should be responsible for a single functional area or logic within the application. This principle serves as a foundation for...

Fixing Permission Check Errors in NFine When Switching Tabs

When logging into NFine (except with the admin account, which bypasses permisions), clicking on Menu 1 opens Window 1, and clicking on Menu 2 opens Window 2. However, when switching back to Window 1 and performing an operation, no permissions are detected. Debugging reveals the issue in the HandlerA...

C# Threading Fundamentals: Mastering System.Threading.Thread

Instantiating and Launching Workers Threads execute concurrently with the main application flow. By default, a newly created thread begins execution immediately upon calling Start(), allowing it to run in parallel with the primary process. using static System.Console; using static System.Threading.T...

Implementing Thread-Safe Collections in C# for Concurrent Programming

The System.Collections.Concurrent namespace provides data structures designed for multi-threaded scenarios, offering scalability and thread safety while minimizing locking. These collections are essential for efficient parallel programming. ConcurrentQueue ConcurrentQueue implements a thread-safe fi...

Common Pitfall: Why DateTime.Now Returns an Incorrect Past Date

When validating a user's date of birth with FluentValidation, comparing the input against DateTime.Now.Date can produce unexpected results: an error may incorrectly state that the input date (e.g. 2020-07-06) cannot be after the current date, even when the actual current date is 2020-07-08, and the...

Understanding the ref and out Keywords for Parameter Passing in C#

In C#, the ref and out keywords are used for parameter passing, enabling a method to modify the values of variables passed to it. However, they follow different rules and are suited for distinct scenarios. ref Keyword ref indicates pass-by-reference. Modifications to the parameter within the method...

Implementing Undo/Redo Functionality with the Generic Stack in C#

The .NET framework includes various generic collections, such as Stack<T> for last-in-first-out operations, Queue<T> for first-in-first-out, List<T> for ordered and indexed elements, LinkedList<T> for doubly linked lists without indexing, and ISet<T> implementations lik...

Building a C# Remote Directory Explorer with Telegram Integration

System Architecture The solution consists of two distinct C# applications: a Controller application running on the local machine, and a Bot agent executing on the remote target machine. The Controller issues commands serialized as JSON, transmits them through the Telegram cloud, and waits for the Bo...