-
Understanding and Preventing Race Conditions in Web Applications
This article explores race conditions in database operations using Python, FastAPI, and PostgreSQL. It demonstrates common pitfalls in handling concurrent requests, particularly for counters and resource management. The piece offers practical solutions, including atomic updates and database constraints, while emphasizing the importance of understanding concurrency issues in software development.
-
This article demonstrates implementing generic return types in Python for RPC calls, inspired by Rust's approach in the gramme.rs library. It presents a solution using Protocol classes and TypeVars that eliminates manual type hinting in API interactions. Through concrete examples, it shows how to statically bind return types to function calls, offering both simple and advanced implementations that enhance code quality and static analysis while working within Python's type system limitations.
-
JavaScript Obfuscation Through File Stream Side-Channel
This article discusses a novel approach to obfuscating JavaScript code in web pages using file stream side-channel techniques. It explains how to encode JavaScript into binary code, translating it into delays that can be measured and decoded back into executable code. The article includes a demo and explores potential improvements and issues with this method.
All my articles contained in this repository are licensed under the CC0 1.0 Universal license.