Fading Coder

One Final Commit for the Last Sprint

Configuring ESLint and Prettier for a Next.js TypeScript Project

Integrating ESLint and Prettier This guide details the setup for integrating ESLint for code quality analysis and Prettier for code formatting with in a Next.js project using TypeScript. The configuration enables automatic formatting and linting on file save in VS Code. Required VS Code Extensions E...

Algorithm Competition Problem Patterns and Templates

The following represents commonly encountered algorithmic challlenges during competitive programming practice, documented for reference purposes. Basic Algorithms Binary Search and Extremal Optimization Binary search can be applied beyond sorted arrays. When elements on one side of an array satisfy...

Shortest Path with Color Transformations: Solving the JOI 2021 Final Robot Problem

We are given a connected undirected graph (or possibly disconnected) with N vertices and M edges. Each edge e connects u and v, has an integer color c, and a cost p for traversing it. However, at any vertex, if multiple incident edges share the same color, the robot cannot decide which path to take....

Spring Boot Core Concepts and Development Foundations

Web Development: Spring Web MVC, Spring MVC, Spring WebFlux for building reactive and traditional web applications. Data Access: Spring Data, Spring Data JPA, Spring Data Redis, Spring Data MongoDB streamline interaction with different data stores. Security: Spring Security provides robust authenti...

Running Home Assistant in Docker with macvlan Network on CentOS

Environment Setup Running Home Assistant in Docker requires network configuration that allows the container to appear as a standalone device on the network. This setup uses macvlan to assign a dedicated IP address to the Home Assistant container. Known Issues Several installation attempts failed: Na...

Understanding the Decorator Pattern with Phone Renovation Example

Overview The Decorator Pattern enables dynamic extension of an object's functionality without altering its structure. This pattern offers two primary implementation strategies: Approach 1: Extend the original class through inheritance to add supplementary features while preserving existing functiona...

Implementing the Bridge Design Pattern in Python for Decoupled Architectures

The Bridge pattern addresses the problem of exploding class hierarchies by decoupling an abstraction from its implementation. Instead of binding these two dimensions together at compile time, the pattern introduces a composition relationship that allows both sides to evolve independently. This struc...

Setting Up HTTP/3 with Caddy Server

Prerequisites HTTP/3 operates over QUIC (UDP-based) instead of TCP, making the setup more demanding than HTTP/2. HTPS Certificate HTTP/3 requires a valid security certificate. Unlike HTTP/2, insecure certificates will not work at all. Install mkcert for local development: winget install mkcert Initi...

JavaScript Variable Declarations: let vs var Deep Dive

Block-Level Scoping with let Before ECMAScript 6, JavaScript lacked block-level scope. Variables declared with var inside blocks remained accessible outside them: { var score = 95; } console.log(score); // 95 The let keyword introduced true block scoping: { let score = 95; } console.log(score); // R...

Django Project Setup with Database Routing and Custom Models

Initialize Project Structure Begin by scaffolding a new Django project. Navigate to your desired workspace and run the following command: django-admin startproject marketplace To integrate MySQL as the database backend, ensure pymysql is configured in your project's __init__.py file: import pymysql...