Fading Coder

One Final Commit for the Last Sprint

Working with Ranges in Kotlin: Integers, Characters, and Custom Steps

A Range in Kotlin is a closed interval between two ednpoints. It is created with the .. operator and supports the membership checks in and !in. Any value that is greater than or equal to the lower bound and less than or equal to the upper bound is considered part of the range. val lowercase = 'a'..'...

Core Mathematical Operations in Python: Built-in math Module and NumPy Essentials

Constants and Elementary Functions in math The math module ships with Python's standard library and exposes fundamental mathematical constants alongside a broad set of floating-point operations. Access constants like π and e directly: from math import pi, e circle_radius = 5 area = pi * (circle_radi...

Solving the Binary Land Problem Using Breadth-First Search

This problem can be effectively solved using a Breadth-First Search (BFS) algoritmh. The core idea is to explore possible states, where a state is defined by the positions of two characters and the number of steps taken to reach that state. We can represent a state using a structure that stores the...

Iterative Depth-First Traversal of Binary Trees

Introduction Depth-First Search (DFS) is a fundamental algorithm for traversing or searching tree structures. While recursive implementations are often elegant and concise, they can lead to stack overflow errors with very deep trees. An iterative approach using an explicit stack is a robust alternat...

Implementing Thread Synchronization in Java

Java provides synchronization mechanisms to prevent resource access conflicts in multi-threaded applications. Thread Safety Issues Real-world applications like banking systems or ticket booking systems often encounter problems when multiple threads access shared resources simultaneously. Consider a...

Installing and Configuring PostgreSQL 15 with Streaming Replication on Rocky Linux 9

1. Enable EPEL and CRB Repositories dnf config-manager --set-enabled crb dnf -y install epel-release epel-next-release If the command dnf config-manager is not found, run: dnf install 'dnf-command(config-manager)' -y 2. Install PostgreSQL 15 dnf module -y install postgresql:15 3. Initialize the Data...

C++ Function Fundamentals for Competitive Programming

Essential C++ Function Concepts When preparing for coding competitions like LeetCode, understanding C++ function mechanics is crucial. This guide covers four fundamental function concepts that frequently appear in competitive programming scenarios. 1. Inline Functions An inline function is declared...

Configuring NOI Linux for Competitive Programming

System Setup Setting up a productive environment on NOI Linux requires several key modifications. First, configure language settings and update package sources. The system includes backup source lists, making it easy to switch repositories using sudo cp. Install additional software packages includin...

Binary BIN File Merging Utility for Flash Layout Composition

Overview This utility merges multiple binary (.bin) files into a single output file based on their designated flash memory offsets. It is particularly useful in embedded systems where firmware components—such as bootloadres, SPLs, or differential updates—are stored at specific addresses in flash mem...

Python Logging Module Implementation

Logging Fundamentals Logging provides a mechanism to track software runtime events. Developers instrument their code with logging calls to capture system activities. Each event consists of a descriptive message that may include variable data and is assigned a seveirty level. Log Severity Levels Log...