code-a-day
One program a day — fundamental computing concepts from the 80s to now, in 5–15 lines.
Thread Wraps and Stack Frames
Stack-Based Computation 🔗 Fly TyingFly tying builds outward from the hook shank; Forth builds upward from an empty stack.
Grinding Toward Convergence, One Pass at a Time
Fixed-Point Iteration 🔗 Telescope Mirror GrindingMirror grinding and fixed-point iteration share the same faith: repeat the same operation until the result stops changing.
Remembering What Just Happened
Ring Buffers 🔗 Geophone SeismographySeismometers need to record what happened before the earthquake started.
Finding Treasure in Signal Peaks
Peak Detection Algorithm 🔗 Metal DetectingEvery beep from a metal detector represents a peak in an electromagnetic field—here's how algorithms spot them.
The Crystal Knew About Smoothing Before We Did
Exponential Moving Average 🔗 Crystal Radio RestorationA chunk of galena and a leaky capacitor taught engineers about smoothing decades before DSP existed.
Smoothing What the Sensor Actually Said
Exponential Smoothing 🔗 Weather Station BuildingOne reading is noise. A thousand readings is weather. Exponential smoothing finds the signal in between.
Reducing Tones to Sun and Shadow
Ordered Dithering 🔗 Cyanotype PrintingCyanotype chemistry only knows blue or not-blue — so how do you fake grey?
The Art of Forgetting Most of What You Hear
Exponential Moving Average 🔗 Shortwave ListeningYour radio's S-meter doesn't panic because it's doing math you learned to forget.
Threading Signatures Forward with Pointers
Linked Lists 🔗 Coptic Stitch Flight Logbook BindingThe Coptic stitch loops thread through each signature to the one before it—exactly how a linked list works.
Tap, Hold, or Something Else Entirely
Finite State Machines 🔗 Mechanical Keyboard BuildingA keypress isn't an event. It's the start of a timeline that the firmware must interpret.
Every Edit Keeps the Old Tree Intact
Persistent Data Structures 🔗 BonsaiPruning a branch doesn't destroy the tree that was — it creates a new tree that shares the unchanged parts.
The Pin That Binds First Tells You Everything
Constant-Time Comparison 🔗 LockpickingManufacturing tolerance betrays the lock. Early-exit comparison betrays the password.
Developing the Perfect Curve
Gamma Correction 🔗 Analog Film Photography DevelopmentFilm's response to light isn't linear—and neither should your pixels be.
Finding the Perfect Curve: Newton-Raphson and Pen Turning
Newton-Raphson Method 🔗 Pen TurningLike shaping wood on a lathe, Newton-Raphson iteratively refines guesses until mathematical perfection emerges.
When Enough Waggle Means Go
Quorum / Threshold Logic 🔗 BeekeepingSixty thousand bees make collective decisions the same way distributed systems reach consensus.
The Count That Makes Paper Lie Flat
Constraint Validation 🔗 Origami EngineeringBefore paper folds flat, the creases must satisfy a deceptively simple arithmetic rule.
Accepting Worse Before Better
Simulated Annealing 🔗 Rock TumblingA hot algorithm cools toward order, just like four weeks of grit progression.
Carve the Ones, Print the Zeros
Bitwise Complement (NOT) 🔗 Linocut PrintmakingIn linocut, what you carve away is what stays white. In binary, NOT does the same job.
Every Shade Is a Lie Made of Dots
Error Diffusion Dithering 🔗 PyrographyFloyd and Steinberg figured out what pyrographers already knew: gradients are just distributed mistakes.
Where the Gradient Changes, There Lives the Edge
Edge Detection (Gradient Magnitude) 🔗 Knife SharpeningA blade is just a gradient so steep light gives up trying to cross it.
Vectors Dragged Through Floating Colour
Vector Fields 🔗 Paper Marbling (Ebru)Every marbling comb is just a physical implementation of a vector field.
The Escapement Ticks in Discrete States
Finite State Machines 🔗 Mechanical Watch DisassemblyA Swiss lever escapement cycles through lock, impulse, and drop — a state machine in brass.
Signatures Stitched in Structure
Persistent Data Structures 🔗 BookbindingA bound book cannot be unwritten. Neither can a persistent vector.
Golden Seams in Broken Code
Graceful Degradation 🔗 KintsugiWhen systems break, the most beautiful solutions don't hide the cracks—they highlight them with gold.
False Positives Won't Kill You, But Mushrooms Might
Bloom Filters 🔗 Mushroom Foraging & Spore PrintingWhen foraging, a false negative means missing dinner. A false positive means missing tomorrow.
The Wire That Learned to Listen Selectively
Bandpass Filtering 🔗 Harmonic Telegraph Key RestorationBell's harmonic telegraph worked because tuned reeds ignored every frequency but their own.
Two Oscillators Walk Into a Process
Concurrent Message Passing 🔗 Theremin Circuit VoicingA theremin works because two processes disagree about frequency — and their argument is audible.
Matching Pickup Tones with Cross-Correlation
Cross-Correlation 🔗 Guitar Pickup WindingWhen winding pickups, how do you know if your coil matches the legendary PAF sound? Mathematics has an answer.
Smoothing the Noise in Fermentation Data
Exponential Smoothing 🔗 Fermentation Sensor LoggingWhen fermentation sensors jitter, exponential smoothing turns chaos into trends.
From Temperature Curves to Ceramic Dots
Bresenham's Line Algorithm 🔗 Roasting Profile Curve EngravingWhen your engraving tool can only make dots, how do you draw smooth roasting curves?
Temperature Dance: PID Controllers for Perfect Fermentation
PID Controllers 🔗 Sourdough Bread BakingHow industrial control systems learned from bakers to maintain perfect temperature through mathematical feedback loops.
Four Bits Per Digit, One Glow Per Tube
Binary Coded Decimal 🔗 Nixie Tube Flight Instrument ClocksNixie tubes don't think in binary — they think in BCD, and so did half the computers of 1965.
The Cylinder Knows Where It Left Off
Circular Buffers 🔗 Cylinder Music Box Transcription PunchingA brass cylinder and a ring buffer both solve the same problem: what happens when you reach the end?
The Wind Has to Mean It
Hysteresis Thresholds 🔗 Mechanical Weather Vane InstrumentsWeather vanes ignore gusts for the same reason good code ignores noise: hysteresis.
When Clockwork Meets Logical Time
Lamport Timestamps 🔗 Orrery Clockwork Escapement PrintingEscapement precision in orrery gears mirrors the logical clock synchronisation that keeps distributed systems in harmony.
The Algorithm That Knows When to Walk Away
Backtracking 🔗 Puzzle Box Mechanism DesignPuzzle boxes and backtracking share a philosophy: commit until you can't, then gracefully retreat.
Parity Bites Back at Thirty Kilometres
Checksums and CRCs 🔗 Stratospheric Balloon TelemetryWhen your payload is tumbling through the stratosphere, every bit of redundancy counts.
Every Lunation Ends Where It Began
Modular Arithmetic 🔗 Lithophane Lunar Phase CalendarsThe moon doesn't count to 29.53 and reset — it just keeps going. We're the ones who need the modulo.
Picking Through Possibilities One Pin at a Time
Backtracking 🔗 LockpickingA lock cylinder and a recursive algorithm share the same dirty secret: sometimes you have to undo progress to make any.
The Sine Wave That Never Needed Trigonometry
Lookup Tables (LUTs) 🔗 Oscilloscope Art PortraitureWhen CPUs couldn't afford trig, we memorized the answers in advance.
When the Glider Never Stops Whispering Pressure
Lazy Stream Processing 🔗 Wind-Gradient Glider SonificationA glider's barometer never pauses. Neither should your code — lazy streams process infinity one sample at a time.
Finding the Perfect Nib: A Binary Search
Binary Search 🔗 Fountain Pen RestorationAdjusting a fountain pen nib teaches the elegance of binary search—halving the search space with each careful test.
Predicting the Next Beat in Motion
Frame Prediction 🔗 Flightpath Zoetrope DrumsLike a zoetrope anticipating its next frame, algorithms can predict future states from motion patterns.
Heaping Up the Sky's Appointment Book
Priority Queues 🔗 Orbital Decay Audio NotificationsWhen dozens of satellites jostle for your attention, a heap decides who rings first.
When Meteors Interrupt Your Code
Interrupt Handling 🔗 Meteor-Scatter Shutter TriggersMeteor-scatter detection mirrors how early microprocessors handled sudden, unpredictable events that demanded immediate attention.
Circular Echoes: Ring Buffers in Sound
Ring Buffers 🔗 Generative Soundscape CompositionHow a simple circular data structure became the heartbeat of real-time audio processing.
Watching Chess Moves Flow Like Light
Message Passing 🔗 Chess Move Lighttrail JournalingChess moves traced as light streams reveal the elegant flow of messages between processes.
Once Visited, Never Forgotten
Memoization 🔗 Knight's Tour Choral CanonsHow remembering the past prevents computational mistakes, whether touring chess boards or timing choral entries.
Smooth Curves from Sharp Points
Cubic Spline Interpolation 🔗 Choir Pitch LightpaintingHow discrete choir positions and LED waypoints become fluid curves through mathematical elegance.
Every Square Once: Hamiltonian Paths in Flight Planning
Hamiltonian Path 🔗 VFR Knight's Tour Grid FlightsFinding routes that visit every waypoint exactly once mirrors the mathematical elegance of Hamiltonian paths.
Weather Patterns Make Musical Patterns
Pattern Matching 🔗 METAR Chord BriefingsHow METAR weather codes become musical chords through elegant pattern matching.
When Atmospheric Data Meets Musical Logic
Unification 🔗 Stratospheric Telemetry Chord MapsHigh-altitude balloon telemetry becomes music through pattern matching—the art of making different structures fit together perfectly.
Radials to Rectangles: Navigation Math on Coasters
Polar Coordinate Transformation 🔗 QSO Radial VOR Dial CoastersEvery VOR radial tells a story in degrees, but your 3D printer thinks in millimetres.
When Starlight Becomes Symphony: Harmonic Analysis
Discrete Fourier Transform 🔗 Stellar Spectrum Music Box DiscsConverting stellar absorption lines into music box frequencies reveals the mathematical harmony between light and sound.
Fixed Stars Need Fixed Points
Fixed-Point Arithmetic 🔗 Star-Drift Compass Calibration CardsWhen navigating by starlight, every decimal place counts—and floating-point math wasn't precise enough for Apollo.
Casting Rays Through Chess and Radio Waves
Raycasting 🔗 Antenna Pattern Chess SetHow antenna patterns and chess moves both trace invisible lines through space.
Warping Stratospheric Views Into Perfect Panoramas
Homographic Transformations 🔗 Stratospheric Telemetry Panorama StitchingWhen balloon cameras drift, homographic matrices bring overlapping images into perfect alignment.
Wind-Driven State Machines Parse the Breeze
Finite State Machines 🔗 Callsign Morse Windchime MobileLike morse windchimes swaying between notes, finite state machines elegantly parse sequences one symbol at a time.
Stitching Signals: State Machines in Code
State Machines 🔗 Morse Waypoint Flightpath EmbroideryEvery embroidery stitch and Morse signal follows the same computational pattern: elegant state transitions.
Counting Crossings: The Conductor's Secret Frequency Detector
Zero-Crossing Detection 🔗 Pitch-Tracking Conductor BatonThe simplest pitch detector counts how often sound waves cross silence—elegant math for a conductor's digital baton.
When Propellers Meet Musical Mathematics
Beat Frequency Detection 🔗 Propeller Doppler ArpeggiatorHow detecting the mathematical beating between frequencies turns propeller noise into musical synchronization magic.
Digital Orbits: Phase Accumulation in Polyrhythmic Space
Phase Accumulation 🔗 Holding-Pattern Polyrhythm LoopsHow digital synthesizers learned to juggle multiple rhythms through the elegant simplicity of phase accumulation.
When Pilots Vote: Consensus in the Pattern
Byzantine Consensus 🔗 ATIS Choir HarmonizationATIS broadcasts and choir harmonies both need agreement—but what happens when some voices lie?
Building Solutions One Star at a Time
Lazy Evaluation 🔗 Knight's Tour Starfield MosaicLike long-exposure astrophotography, lazy evaluation reveals computational beauty only when the moment is right.
Mapping Ham Radio Contacts to the Stars
Spatial Indexing with Quadtrees 🔗 QSO Constellation OverlaysHow amateur radio operators efficiently overlay QSO locations on constellation maps using recursive space subdivision.
Echoes in Digital Memory: Ring Buffers
Circular Buffers 🔗 Generative Soundscape CompositionThe elegant data structure that makes real-time audio possible, one sample at a time.
Conducting Digital Orchestras with Actors
Actor Model 🔗 Generative Soundscape CompositionIndependent sound generators coordinate through message passing, just like musicians in an orchestra.
When Voices Overlap: Digital Convolution
Convolution 🔗 Morse Canon Choir LoopsCanon voices weaving together mirror how convolution combines overlapping signals in digital processing.
Turning Radio Coordinates Into Sky Art
Coordinate Transformation 🔗 APRS Skytrace SculpturesAPRS reports positions in degrees, but your sky sculpture lives in metres—here's the mathematical bridge between worlds.
Smoothing the Glow: Interpolating Antenna Patterns
Linear Interpolation 🔗 Antenna Lobe LanternsWhen antenna measurements meet artistic lanterns, smooth curves emerge from scattered data points.
Tactical Frequencies: Huffman's Efficient Chess Beacon
Huffman Coding 🔗 Morse Chess Tactics BeaconWhen every dot and dash counts in tactical transmission, frequency-based encoding saves precious bandwidth.
When Routes Fail: Backtracking Through Sky and Code
Backtracking Search 🔗 VFR Track Relief PrintingSometimes the best way forward is to go back—whether dodging weather in a Cessna or finding valid paths in code.
Smooth Curves for Light-Painting Drones
Bezier Curves 🔗 RC Light-Trace CalligraphyHow mathematical curves turn jerky RC movements into flowing calligraphy strokes.
Building Weather Symphonies with Parser Combinators
Parser Combinators 🔗 METAR Chord BriefingsWeather reports and chord progressions share a secret: both emerge from combining simple patterns into complex, meaningful structures.
Dots, Dashes, and State Machines
Finite State Automata 🔗 Morse Beacon Star-Trail LightpaintingHow Morse beacon timing reveals the elegant mathematics of state transitions.
Mapping Radio Shadows with Flood Fill
Flood Fill Algorithm 🔗 Airborne RF Shadow CartographyWhen your drone finds a signal dead zone, how do you map the entire shadow? The same algorithm that colours pixels.
Dividing the Sky: How Quadtrees Organize Aerial Photos
Quadtrees 🔗 Foam-Wing Orthomosaic MappingWhen your foam-wing RC plane captures 800 overlapping photos, you need quadtrees to make sense of the spatial chaos.
Sliding Through Signal Streams and Stone
Sliding Window Algorithms 🔗 RF Waterfall LithophanesHow radio waterfalls and lithophone depths both rely on the elegant dance of sliding windows through endless streams.
Musical Memory: Teaching Machines to Dream in Sound
Markov Chains 🔗 Generative Soundscape CompositionHow probability and memory create endless, evolving soundscapes that feel both random and inevitable.
Shift Registers Shape Sound Worlds
Linear Feedback Shift Register 🔗 Generative Soundscape CompositionHow 1980s sound chips used mathematical feedback to generate endless musical sequences from just a few bits.
The Gentle Fade of Memory and Light
Leaky Integrator 🔗 Aurora Chorus Sonified TimelapseIn aurora photography and audio synthesis, some signals need to remember the past while gracefully forgetting it.
When Code Grows Like Sound Waves
Cellular Automata 🔗 Generative Soundscape CompositionSimple rules create complex soundscapes—just like Conway's neighbours create emergent life.
Catching Data from the Edge of Space
Ring Buffers 🔗 Stratospheric Balloon TelemetryWhen your balloon transmits telemetry faster than you can process it, circular buffers keep the most recent data alive.