Articles

Long-form writing on mathematics, algorithms, and software.

Filter by tag

▦
mi-align: Brute-Force Affine Alignment on the GPU
·10 min read

mi-align: Brute-Force Affine Alignment on the GPU

A technical note on brute-force affine alignment: canonical coordinates, NCC and mutual-information scoring, when feature matching fails, and a WebGPU compute kernel that scores a whole grid of transforms at once.

⬢
Paraplot: From Scene Code to a Draw Call
·15 min read

Paraplot: From Scene Code to a Draw Call

How a browser CAD toy compiles a JavaScript scene into a scene graph, one fragment shader and a uniform pool — and where late-bound edits and each kind of variable enter the pipeline.

∧
·18 min read

Conformal Clifford Algebra: Points, Rotors and a Robot Arm

Embed 3D geometry in a 5D Clifford algebra where points, circles, spheres, planes and lines are all blades. A playground for N-joint inverse kinematics, curve and surface intersections.

▰
·22 min read

Ribbon Filters: Smaller Than Bloom, Faster Than Peeling

A visual tour of Ribbon filters — how a band-shaped linear system over GF(2) gives static set membership in near-optimal space, and how on-the-fly Gaussian elimination makes it practical.

◎
Hamilton: A Phase-Space Playground
·3 min read

Hamilton: A Phase-Space Playground

Type a Hamiltonian or Lagrangian, integrate it in the browser, and watch an entire phase space evolve. A WebGL2 playground with RK4, symbolic derivatives and 21 built-in systems.

◠
·10 min read

Modern Portfolio Theory and the Efficient Frontier

Markowitz's mean-variance framework in one picture: why correlation, not just volatility, determines what a portfolio can achieve — and why the frontier is a map, not a money machine.

⇄
·9 min read

Shannon's Demon: Volatility Harvesting and the Loss Bias of Leverage

A fair coin that moves ±10% a round already loses 0.5% a round. Rebalancing half against cash cuts that loss; a small edge turns it into a positive harvest. The same arithmetic explains why leveraged ETFs bleed.

⚖
·10 min read

The Kelly Criterion: How Much to Bet When You Have an Edge

Sixty-one finance professionals, a coin that lands heads 60% of the time, and a formula for bet sizing. Why maximizing expected value can bankrupt you, why 20% beats 40%, and why most professionals bet half Kelly.

∮
·15 min read

Conformal Maps: When Complex Functions Preserve Angles

A conformal map preserves angles: near every point it behaves like a rotation followed by a uniform scaling. Explore them in a playground that warps grids and images — written with complex numbers, 2D vectors, and dual numbers.

ℯ
·9 min read

EML: One Operator Is All You Need

How a single binary operator — eml(x,y) = exp(x) − ln(y) — can generate every elementary function a scientific calculator knows, from addition to trigonometry.

▤
·9 min read

The Order Book: How Price is Actually Born

A hands-on look at how a limit order book works — matching engines, price discovery, support and resistance zones — with a live simulation you can drive yourself.

◆
·12 min read

The Challenges of WebGL

WebGL lets you run shaders in the browser — and that's genuinely magical. But using it for arbitrary GPU computation quickly reveals a thicket of constraints that OpenCL and WebGPU were designed to escape.

◆
·6 min read

The Bertrand Paradox: When Randomness Needs a Definition

A deceptively simple question — what is the probability that a random chord of a circle is longer than the side of its inscribed equilateral triangle? — has three different correct answers depending on what 'random' means.

⌁
·16 min read

Generating Fake Stock Charts: From Random Walks to Order Books

A deep dive into synthetic stock price generation — from naive coin-flip random walks, through Gaussian distributions and fat tails, to a simulated order book — and how candlestick pattern analysis reveals the gap between each model and reality.

◆
·18 min read

Automatic Differentiation

A deep-dive into automatic differentiation: symbolic vs. numerical vs. AD, AST transformation, dual numbers, tapes, hybrid methods, and a generic C++ implementation that computes gradients and solves optimisation problems.

◆
·9 min read

Why Tuning a Piano is Mathematically Impossible

Perfect harmony is a mathematical impossibility. Here's the beautiful, maddening reason why — and how piano tuners have learned to live with it.

◆
·9 min read

The Abelian Sandpile: A Group Hiding in a Pile of Sand

The Bak–Tang–Wiesenfeld sandpile model (ASM) is a deceptively simple cellular automaton that conceals a rich algebraic structure — an abelian group whose identity element is a non-trivial fractal-like configuration.

◆
·11 min read

Detecting Hallucinations in LLM Summaries

LLMs write convincingly but fabricate facts. A practical tour of automated detection techniques: BERTScore, embedding similarity, ROUGE/n-gram overlap, NER-based cross-referencing, and QAEVAL.

◆
·9 min read

React vs SolidJS: Dynamic Graphs, Static Graphs, and the Price of Flexibility

React and SolidJS share JSX syntax but are built on fundamentally different computational models. Understanding why illuminates a much older tension in functional programming — and an eerily similar split that once divided PyTorch from TensorFlow.

◎
·9 min read

From Regex to Automata to Generators

How regular expressions compile to deterministic finite automata — with an interactive visualizer, a DFA-powered string generator, and a note on closing the loop with property-based testing.

#
·8 min read

Perfect Hash Functions: Collision-Free by Design

A deep dive into perfect hash functions — what they are, why they matter, how to find one efficiently with parallel search, and how they compare to JavaScript's built-in Map.

⬡
·13 min read

Raft: Consensus, Visualized

An interactive deep-dive into the Raft consensus algorithm — leader election, log replication, snapshots and truncation — with two live simulations you can explore and break.

∿
·15 min read

The Fourier Transform: From Sines to Signals

A visual and mathematical journey through one of the most beautiful ideas in all of mathematics — decomposing any signal into its frequency components.

⊞
·11 min read

From DIY Monorepo to Nx: Lessons from a White-Label Credit Card Platform (2024)

Part 2 of a multi-year migration case study. After building a homegrown monorepo toolchain, we adopted Nx — and discovered that its opinionated approach solves some problems elegantly while creating new ones when your apps can't truly be isolated.

⧉
·20 min read

Solving the Wrong Problem: Knapsack vs. Distributed Worker Queues

We cut a 45-minute CI pipeline to 12 minutes by measuring every task and solving a knapsack problem to distribute builds across GitHub Actions workers. It worked. It was also the wrong problem: a static assignment is a bet placed before the run, and it cannot stay optimal once the run has better information.

◳
·18 min read

From Legacy to Monorepo: Migrating a White-Label Credit Card Platform (2021–2024)

A four-year case study of migrating a white-labeled credit card platform from a legacy Angular/C# stack to a React monorepo with single-spa — covering GraphQL BFFs, micro-frontends, build parallelization, and the people problems that matter more than the tech ones.

▲
·11 min read

Optimizing CI Builds with Docker Layer Caching on TeamCity

How we cut build times from 45 minutes down to 3–10 minutes on an on-premise TeamCity cluster using multistage Docker builds, content-addressed cache keys, and shared filesystem volumes — plus what modern BuildKit unlocks today.

⊛
·4 min read

buckaroo.pm - Find C++ packages

A companion website for the Buckaroo package manager — browse ~400 C++ packages from GitHub, explore the dependency graph, and find what you need instantly with precompiled fuzzy search.

◆
·6 min read

Buckaroo: Conflict-Driven Dependency Resolution for C++

How Buckaroo's dependency resolver borrows ideas from SAT solvers — using conflict-driven clause learning to prune the search space and resolve C++ packages blazingly fast.

⟳
·7 min read

Taming 200k Lines: Refactoring a Redux & RxJS Codebase

How static and dynamic code analysis helped delete over 200,000 lines of dead code from a large-scale train ticketing app built with Redux, RxJS, and normalizr — before React Hooks existed.

■
·5 min read

Experimenting with Small-Buffer Optimization

We implemented SmallFun, an alternative to std::function using fixed-size capture optimization (a form of small-buffer optimization) that is 3–5x faster in benchmarks.

⋯
·4 min read

Introducing Conduit: Lazy Sequences for C++

Conduit is a header-only library that leverages the Coroutine TS to introduce lazy sequences to C++, enabling concise infinite-sequence programming with zero-cost abstractions.

≋
·4 min read

C++ Coroutine TS — It's About Inversion of Control

One motivating example where lazy sequences enable you to separate your concerns and maximize code reuse — without increasing complexity.

→
·5 min read

value_ptr — The Missing C++ Smart-Pointer

Use value_ptr to get value semantics on a heap resource. At the cost of some extra copying, your code will be simpler and easier to reason about.