Fading Coder

One Final Commit for the Last Sprint

Implementing Google OAuth2 Authentication on Backend Services

Overview Google OAuth2 can be integrated into backend applications without requiring a Google developer account. This guide covers two authentication flows suitable for server-side implementation. Prereuqisites Obtaining Credentials Navigate to the Google Cloud Console Dashboard to: Enable required...

Building RESTful APIs with ThinkPHP and Resolving Unexpected 500 Errors

When developing RESTful APIs using the ThinkPHP framework, adhering to naming conventions and understanding how to handle different types of HTTP request payloads is essential. Missteps in these areas often lead to unexpected behavior or server errors. For JSON-based APIs, especially in a decoupled...

Counting Islands and Finding Maximum Island Area in Grids

Counting Islands in a Binary Matrix Given a 2D grid consisting of 1 (land) and 0 (water), count the number of islands. An island is formed by adjacent lands connectde horizontaly or vertically, surrounded by water. The grid boundaries are considered water. Input Format: First line: two integers N, M...

Union-Find Data Structure and Weighted Union-Find

Union-Find Structure The union-find data structure is a tree-based structure designed to efficiently manage disjoint sets through two primary operations: Find Operation: Determines which subset a particular element belongs to Union Operation: Merges two subsets into a single set int parent[N]; // Ea...

Windows Firewall Configuration and Network Service Troubleshooting

Windows Firewall Basics Windows firewall is often overlooked in network configuraton, with many users opting to disable it entirely. This guide focuses on practical firewall configuration for development and network services. ICMP/Ping Configuration Network connectivity testing typically begins with...

Java Multithreading Fundamentals and Implementation

Multithreading in Java allows concurrent execuiton of two or more parts of a program for maximum utilization of CPU. Each part of such a program is called a thread, and each thread defines a separate path of execution. Below we explore different ways to implement multithreading in Java: Implementin...

Core Web Development Concepts: HTML5 and Browser Fundamentals

The Role of Web Browsers Browsers act as the runtime environment for web applications. Their primary responsibility is to parse and render code (HTML, CSS, and JavaScript) into a visual interface that users can interact with. The core of any browser is its rendering engine. Because different browser...

Handling Long Text in Excel Export: Overcoming the 32767 Character Limit

Handling Long Text in Excel Export: Overcoming the 32767 Character Limit Error Message java.lang.IllegalArgumentException: The maximum length of cell contents (text) is 32767 characters at org.apache.poi.ss.usermodel.CellBase.checkLength(CellBase.java:309) at org.apache.poi.ss.usermodel.CellBase.set...

C++20 Lightweight Wake-on-LAN Client for Embedded MQTT-Free Cloud Integration

This article documents the design and implementation of a minimal, statically linked Wake-on-LAN client written in C++20, targeting resource-constrained embedded devices such as OpenWrt-based routers. Unlike typical implementations relying on heavy runtimes (e.g., Go) or external libraries (e.g., Pa...

Optimizing Loops for Softmax and FlashAttention in Triton

Puzzle 8: Long Softmax This puzzle implements a batched softmax operation. Given a batch of logits of shape [N0, T], compute the softmax for each row. The spec is: def softmax_spec(x: Float32[4, 200]) -> Float32[4, 200]: x_max = x.max(1, keepdim=True)[0] x = x - x_max x_exp = x.exp() return x_exp...