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-learning
snake
3d
neural-networks
dqn
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-learning
dqn
acrobat
control
pendulum
deep-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-learning
monte-carlo
dqn
blackjack
q-learning
deep-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-learning
dqn
breakout
game-ai
deep-learning
atari
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-learning
dqn
self-play
connect4
game-ai
deep-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-learning
flappy-bird
dqn
reward-shaping
game-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-learning
dqn
maze
generalisation
deep-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-learning
dqn
pong
game-ai
deep-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-learning
dqn
rocket-landing
deep-learning
reward-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-learning
multi-armed-bandit
slots
exploration
exploitation
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-learning
self-play
tic-tac-toe
dqn
game-theory
minimax
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-learning
physics
simulation
dqn
parabolic
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-learning
neuroevolution
genetic-algorithm
cartpole
evolutionary-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-learning
dqn
reward-shaping
mountain-car
deep-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
python
reinforcement-learning
alphazero
mcts
self-play
game-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
python
transformers
attention
deep-learning
nlp
visualisation
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
python
simulation
boids
pygame
emergent-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.
python
computational-geometry
convex-hull
algorithms
scipy
matplotlib
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
python
diffusion-models
deep-learning
generative-ai
pytorch
ddpm
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
python
duckdb
sql
data-analysis
parquet
performance
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
python
simulation
fluid-dynamics
navier-stokes
pygame
physics
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.
python
fractals
terrain-generation
noise
matplotlib
3d
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,
python
generative-art
l-systems
turtle-graphics
procedural-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-learning
ppo
carcassonne
board-game
ai
pytorch
self-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
python
pandas
polars
data-analysis
performance
dataframes
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'
tauri
electron
rust
desktop-apps
javascript
performance
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
python
voronoi
computational-geometry
scipy
matplotlib
generative-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
python
webassembly
pyodide
browser
javascript
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
3d
matplotlib
plotly
visualisation
mesh
surface
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-cloud
3d
classification
segmentation
lidar
machine-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
geospatial
optimisation
shapely
geopandas
geometry
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
blender
python
3d
bpy
scripting
generative
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
bokeh
dashboard
data-visualisation
python
widgets
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.
bokeh
plotly
matplotlib
altair
visualisation
comparison
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.
simpy
simulation
discrete-event
javascript
car-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,
expo
react-native
mobile
book-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-diffusion
sdxl
fine-tuning
dreambooth
lora
machine-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-processing
art
tsp
single-line
python
opencv
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
topography
contour
matplotlib
plotly
geospatial
visualisation
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
isochrone
geospatial
routing
openstreetmap
python
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
simulation
pygame
creatures
emergence
kinesis
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
geospatial
geopandas
lakes
comparison
visualisation
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
levenshtein
edit-distance
spell-checker
algorithms
nlp
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
maze
algorithms
pathfinding
recursive-backtracking
astar
python
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
neat
neuroevolution
unity
street-lights
simulation
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
pandas
pandarallel
parallel-processing
performance
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-networks
reinforcement-learning
parking
simulation
pygame
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
plotly
3d
visualisation
animation
data-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
ppo
unity
ml-agents
reinforcement-learning
golf
trick-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
redpanda
kafka
streaming
data-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
redwoodjs
fullstack
javascript
graphql
prisma
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
javascript
simulation
river
meandering
canvas
physics
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
routing
dijkstra
astar
graphs
algorithms
python
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
simulation
pygame
game-theory
emergence
cellular-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
evolution
simulation
genetics
pygame
emergence
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 -
singer
etl
nosql
sql
data-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-design
spatial
optimisation
grasshopper
python
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-collapse
generative-art
procedural
python
algorithms
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
xturing
llm
fine-tuning
machine-learning
gpt
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
zapier
automation
integrations
no-code