jackmckew.dev drafts preview

Blog Drafts

60 posts

60 posts
Python
AI Learns to Play 3D Snake
2026-03-12
The classic 2D Snake game is already a decent RL benchmark - sparse rewards, self-collision, and a growing body that changes the game state. But 2D Snake is one
reinforcement-learningsnake3dneural-networksdqn
Python
AI Learns Acrobat: Teaching a Double Pendulum to Swing Up
2026-03-12
CartPole is a pendulum balancing problem. The AI keeps it upright by applying force.
reinforcement-learningdqnacrobatcontrolpendulumdeep-learning
Python
AI Learns Blackjack: RL Against a Solved Game
2026-03-12
Most RL benchmarks don't have a known optimal policy. You train, you measure win rates, but you never know how far off you are from truly optimal play.
reinforcement-learningmonte-carlodqnblackjackq-learningdeep-learning
Python
AI Learns Breakout: From Missing Every Ball to Clearing the Board
2026-03-12
Breakout is where DeepMind's DQN first shocked the world in 2015. Their agent learned to play Atari games from raw pixels alone, eventually discovering the "tun
reinforcement-learningdqnbreakoutgame-aideep-learningatari
Python
AI Learns Connect 4 Through Self-Play (DQN)
2026-03-12
Tic-Tac-Toe has 255,168 possible games. Connect 4 has 4,531,985,219,092. That's 18 million times more states.
reinforcement-learningdqnself-playconnect4game-aideep-learning
Python
AI Learns Flappy Bird (And Why It's Harder Than It Looks)
2026-03-12
Flappy Bird is a meme. Two pipes with a gap. Tap to survive. A seven-year-old can figure it out in ten minutes.
reinforcement-learningflappy-birddqnreward-shapinggame-ai
Python
AI Learns to Navigate Mazes It Has Never Seen Before
2026-03-12
A rat in a maze learns by trial and error. Put it in a new maze and it explores again. Our DQN agent does the same - except it trains on thousands of random maz
reinforcement-learningdqnmazegeneralisationdeep-learning
Python
AI Learns Pong in 8,000 Episodes (DQN vs Heuristic Opponent)
2026-03-12
Pong is the original video game and arguably the cleanest testbed for learning from interaction. Two paddles, one ball, one rule: don't let the ball past your p
reinforcement-learningdqnponggame-aideep-learning
Python
I Tried to Teach an AI to Land a Rocket. Here's What Actually Happened.
2026-03-12
CartPole solved in 10 generations. Tic-Tac-Toe achieved perfect play. So I built a 2D rocket lander and expected DQN to crack it in an afternoon.
reinforcement-learningdqnrocket-landingdeep-learningreward-engineering
Python
AI Learns to Play the Slots
2026-03-12
The multi-armed bandit problem is where machine learning meets Vegas. You've got a row of slot machines, each with an unknown payout probability. You've got 1,0
reinforcement-learningmulti-armed-banditslotsexplorationexploitation
Python
AI Learns Tic-Tac-Toe Through Self-Play
2026-03-12
Tic-Tac-Toe is a solved game. Give anyone a few minutes with a strategy guide and they'll never lose again. So why train an AI on it?
reinforcement-learningself-playtic-tac-toedqngame-theoryminimax
Python
ML Agents - Teaching a Plane to Drop Packages
2026-03-12
Dropping a package from a moving plane sounds simple. The physics is taught in first-year university: time to fall = sqrt(2h/g), horizontal distance = v t. Tri
reinforcement-learningphysicssimulationdqnparabolic
Python
Evolution Finds Perfect CartPole Balance in 10 Generations
2026-03-12
DQN learns by computing gradients. It adjusts weights in the direction that reduces loss. It requires a differentiable loss function, a carefully tuned learning
reinforcement-learningneuroevolutiongenetic-algorithmcartpoleevolutionary-computation
Python
The Mountain Car Problem: Why DQN Fails and How Reward Shaping Fixes It
2026-03-12
Mountain Car is one of the simplest RL benchmarks: a car in a valley needs to reach a flag at the top of a hill. Two actions: push left, push right. The car isn
reinforcement-learningdqnreward-shapingmountain-cardeep-learning
Python
Teaching an Agent to Play Games Against Itself: Alpha Zero Style
2026-03-11
I built a self-play training loop where an agent starts knowing absolutely nothing about tic-tac-toe, plays itself thousands of times, and emerges with a perfec
pythonreinforcement-learningalphazeromctsself-playgame-ai
Python
Visualising Attention in Transformers
2026-03-11
I implemented multi-head self-attention from scratch three times before I actually understood what was happening. Then I built a visualisation showing which tok
pythontransformersattentiondeep-learningnlpvisualisation
Python
Simulating Flocking Behaviour with Boids
2026-03-11
I've always been fascinated by murmuration - that hypnotic dance thousands of starlings do at dusk, moving like a single organism. Last month I implemented Crai
pythonsimulationboidspygameemergent-behaviour
Python
Convex Hulls: Wrapping Points with Algorithms
2026-03-11
Draw a rubber band around a scatter of points. Tighten it. The polygon that forms is the convex hull - the smallest convex shape that contains all your points.
pythoncomputational-geometryconvex-hullalgorithmsscipymatplotlib
Python
How Diffusion Models Actually Work
2026-03-11
I spent two weeks trying to understand diffusion models by reading papers and getting nowhere. Then I built a minimal DDPM (Denoising Diffusion Probabilistic Mo
pythondiffusion-modelsdeep-learninggenerative-aipytorchddpm
Python
DuckDB: SQL Analytical Queries Without a Server
2026-03-11
I stumbled into DuckDB last month while frustrated with pandas groupby being slow on a 2GB CSV, and it's genuinely changed how I explore data. The hook: it's a
pythonduckdbsqldata-analysisparquetperformance
Python
Simulating Fluid Dynamics on a Grid
2026-03-11
I implemented Jos Stam's "Real-Time Fluid Dynamics for Games" paper and watched ink swirl realistically through water without solving a single differential equa
pythonsimulationfluid-dynamicsnavier-stokespygamephysics
Python
Generating Terrain with Fractals
2026-03-11
Procedural terrain is magic. You start with random values, apply some fractal logic, and out comes mountains, valleys, and coastlines. No artist required.
pythonfractalsterrain-generationnoisematplotlib3d
Python
Drawing Trees with L-Systems
2026-03-11
I've been obsessed with procedural generation lately, and L-systems are the cleanest way I've found to generate plant-like structures. Feed in a rewriting rule,
pythongenerative-artl-systemsturtle-graphicsprocedural-generation
Python
Teaching an RL Agent to Play Carcassonne - Patterns From 1000 Training Iterations
2026-03-11
I trained a PPO agent to play Carcassonne using self-play, then analysed 50 games of the trained model to see what it actually learned. The results are interest
reinforcement-learningppocarcassonneboard-gameaipytorchself-play
Python
Polars vs Pandas: When to Switch and When to Stay
2026-03-11
I've been using pandas daily for six years. Last month I hit a wall with a 2GB dataset taking 45 seconds to pivot, so I tried Polars. It ran in 2 seconds. But I
pythonpandaspolarsdata-analysisperformancedataframes
Software
Tauri vs Electron: Building Desktop Apps in 2026
2026-03-11
I built a small desktop monitoring tool twice - once in Electron, once in Tauri. This isn't a theoretical comparison. I hit the same walls both times, and they'
taurielectronrustdesktop-appsjavascriptperformance
Python
Voronoi Diagrams: Partitioning Space by Nearest Neighbour
2026-03-11
Imagine you scatter points across a map. Every location on that map belongs to the nearest point. Colour each region by which point owns it. That's a Voronoi di
pythonvoronoicomputational-geometryscipymatplotlibgenerative-art
Python
Running Python in the Browser with Pyodide
2026-03-11
I built a small data explorer last month that runs entirely in the browser - no backend server, no API calls, just Python running in a tab via WebAssembly. It's
pythonwebassemblypyodidebrowserjavascript
Python
3D Plotting Techniques - Mesh, Surfaces, Volumes
2026-03-10
3D plotting is one of those things that looks impressive in a paper but can be genuinely hard to get right. I've spent the last year generating 3D plots for sci
3dmatplotlibplotlyvisualisationmeshsurface
Python
3D Point Cloud Classification and Segmentation
2026-03-10
Point clouds are just lists of 3D coordinates. A LiDAR scanner spits out millions of them per second. The challenge: given a chaotic blob of 3D points, figure o
point-cloud3dclassificationsegmentationlidarmachine-learning
Python
Biggest Circle Fitting Within a Country
2026-03-10
I needed to know: what's the largest circle that fits entirely within Australia's borders? Not a theoretical exercise - I was curious about the actual geometry
geospatialoptimisationshapelygeopandasgeometry
Python
Blender and Python
2026-03-10
Blender is a 3D modelling powerhouse, and it has a Python API (bpy). I spent a week learning it, and it's equal parts brilliant and frustrating. You can script
blenderpython3dbpyscriptinggenerative
Python
Bokeh Dashboard
2026-03-10
Built a real-time dashboard with Bokeh last week. It's the kind of project that looks simple until you're debugging the layout for an hour and wondering why the
bokehdashboarddata-visualisationpythonwidgets
Python
Bokeh vs Plotly vs Matplotlib vs RGL vs Altair
2026-03-10
I've spent the last five years fighting with these libraries, and I finally have opinions worth sharing.
bokehplotlymatplotlibaltairvisualisationcomparison
Python
Car Park Simulator - SimPy and JS
2026-03-10
A car park at 80% capacity feels full. At 95%, it feels chaotic. But the maths doesn't match the feeling. I built a simulation to understand why.
simpysimulationdiscrete-eventjavascriptcar-park
Software
Learning Expo - The Book Never Written But The Docs You Need
2026-03-10
I've built a few React Native apps over the years, and every time I'd approach them the same way: set up bare React Native, fight Gradle, compile for two hours,
exporeact-nativemobilebook-review
Python
Teaching SDXL a New Trick - Finetuning Stable Diffusion XL with LoRA
2026-03-10
I spent a weekend fine-tuning SDXL to generate images of a specific style I wanted, and it was weirdly satisfying and deeply frustrating in equal measure. If yo
stable-diffusionsdxlfine-tuningdreamboothloramachine-learning
Python
Image to Single Line
2026-03-10
I wanted to convert photos into single continuous line drawings - the kind of minimalist art where one pen never lifts off the paper. The technical challenge: g
image-processingarttspsingle-linepythonopencv
Python
Interactive Contour to Topographic Map
2026-03-10
I spent an afternoon turning a flat DEM (Digital Elevation Model) into something that actually looks like a map. You know those squiggly lines on topographic ma
topographycontourmatplotlibplotlygeospatialvisualisation
Python
Isochrone Generator from a Location
2026-03-10
An isochrone is the answer to: "How far can I travel in 15 minutes from here?" It's a boundary line (or polygon) that encloses all reachable points. They're use
isochronegeospatialroutingopenstreetmappython
Python
Simulating Kinesis - When Simple Rules Create Emergent Behaviour
2026-03-10
I've been obsessed with emergence lately - how simple rules create complex behaviour. The canonical example is flocking: three rules about separation, alignment
simulationpygamecreaturesemergencekinesis
Python
Lake Size Comparator
2026-03-10
I wanted to build something simple: overlay different lakes on top of each other at the same scale so you can actually compare their sizes. The catch is that la
geospatialgeopandaslakescomparisonvisualisation
Python
Building a Spell Checker From First Principles - Levenshtein Distance and Beyond
2026-03-10
I implemented Levenshtein distance from scratch for a spell checker project, and it's genuinely satisfying how much computer science is contained in a simple gr
levenshteinedit-distancespell-checkeralgorithmsnlp
Python
Maze Generation and Solving
2026-03-10
Mazes are a perfect excuse to implement classic algorithms. You generate them with recursive backtracking, then solve them with A and BFS. The fun part is anima
mazealgorithmspathfindingrecursive-backtrackingastarpython
Software
NEAT Algorithm in Unity - Smart Street Lights
2026-03-10
NEAT (NeuroEvolution of Augmenting Topologies) is wild. Instead of training a fixed neural network, you evolve the network structure itself. Add nodes, add conn
neatneuroevolutionunitystreet-lightssimulation
Python
Pandarallel - Making Pandas apply() Actually Fast
2026-03-10
Pandas is great until you call apply() on a large DataFrame and watch your CPU spin at 25% while the rest of your machine sits idle. Then you remember that Pyth
pandaspandarallelparallel-processingperformance
Python
Teaching a Car to Park - Reinforcement Learning in Pygame
2026-03-10
I built a car parking simulator in Pygame and trained a neural network to solve it. For the first 500 steps, the car did something unhelpful (usually drove into
neural-networksreinforcement-learningparkingsimulationpygame
Python
Plotly 3D Plots with Time
2026-03-10
Built an animated 3D scatter plot the other day that showed a trajectory evolving through time. Sounds simple, right? It's not, but Plotly makes it less painful
plotly3dvisualisationanimationdata-science
Software
PPO in Unity - Putt Putt Trick Shots
2026-03-10
PPO (Proximal Policy Optimisation) is the workhorse of modern RL. It's stable, sample-efficient, and doesn't require as much hyperparameter tuning as DQN. I tra
ppounityml-agentsreinforcement-learninggolftrick-shots
Software
Red Panda - The Kafka Alternative That Actually Works
2026-03-10
Kafka is the industry standard for event streaming, and it's also kind of a pain. It's written in Scala, it's slow to start, it requires ZooKeeper (which is its
redpandakafkastreamingdata-engineering
Software
Redwood JS - The Full-Stack Framework That Almost Convinced Me
2026-03-10
I've been building full-stack apps in JavaScript for years, and the pattern is always the same: separate frontend repo, separate backend repo, maybe share some
redwoodjsfullstackjavascriptgraphqlprisma
Software
River Meandering in JavaScript
2026-03-10
I spent a weekend simulating river erosion on an HTML canvas. The result looks like a real river snaking across a landscape. No pre-rendered assets, just physic
javascriptsimulationrivermeanderingcanvasphysics
Python
Routing Algorithms
2026-03-10
I implemented three routing algorithms on a real road network and timed them. The results were... not what I expected. A didn't always win, Dijkstra was slower
routingdijkstraastargraphsalgorithmspython
Python
Scissors Paper Rock Simulation
2026-03-10
I built a cellular automaton where Scissors, Paper, and Rock are actual populations fighting for space on a grid. Each agent spreads by converting its neighbour
simulationpygamegame-theoryemergencecellular-automaton
Python
Simulating Natural Evolution
2026-03-10
I built an evolution simulator from scratch. Creatures that eat, reproduce, mutate, and get eaten. No fitness function we designed - just let the rules loose an
evolutionsimulationgeneticspygameemergence
Software
Singer - Building Data Pipelines From NoSQL to SQL
2026-03-10
Data lives everywhere now. DynamoDB in production, MongoDB in legacy systems, Firestore in serverless projects. At some point you need all of it in one place -
singeretlnosqlsqldata-pipeline
Python
Spatial Generative Design
2026-03-10
Generative design for spatial layouts is the fun intersection of algorithms and geometry. The idea: define rules and constraints, let an algorithm iterate throu
generative-designspatialoptimisationgrasshopperpython
Python
Wave Function Collapse - Generative Art
2026-03-10
I built a terrain generator that felt like magic. You give it a set of tile rules, press go, and it fills a grid with valid combinations. It's called Wave Funct
wave-function-collapsegenerative-artproceduralpythonalgorithms
Python
xTuring - Fine-tuning LLMs Without the PhD
2026-03-10
I looked at xTuring and thought "this looks suspiciously easy - fine-tuning an LLM in 50 lines of Python instead of 500?" So I spent a week actually using it on
xturingllmfine-tuningmachine-learninggpt
Software
Zapier Integrations - When No-Code Automation Actually Works
2026-03-10
I've been building a lot of tools lately and reaching for custom integrations every time something needs to talk to something else. But I realized I was being d
zapierautomationintegrationsno-code