Jeff Standen's Avatar

Jeff Standen

@jstanden.bsky.social

Founder & Software Architect @ cerb.ai I've been obsessed with coding since the dial-up BBS days of the early 1990s. My daily stack is PHP/MySQL/AWS/Docker, with increasingly more Python for devops/ML. #php #mysql #aws #python #docker #german #piano

230 Followers  |  506 Following  |  128 Posts  |  Joined: 18.11.2024  |  2.0193

Latest posts by jstanden.bsky.social on Bluesky

Advent of Code 2025

I just completed all 12 days of Advent of Code 2025!

adventofcode.com

#AdventOfCode

16.12.2025 02:42 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image

I've completed "Christmas Tree Farm" - Day 12 - Advent of Code 2025

I was _deeply_ unsatisfied with this solution, so I've been turning it into a game and working on an actual solver instead.

github.com/jstanden/adv...

#AdventOfCode #Python #Programming

16.12.2025 02:41 โ€” ๐Ÿ‘ 6    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
advent-of-code-python/2025/journals/topological-sort-graph.ipynb at main ยท jstanden/advent-of-code-python Advent of Code solutions in Python. Contribute to jstanden/advent-of-code-python development by creating an account on GitHub.

Since I used nx.topological_sort() to do the heavy lifting for me on this one, here's an implementation of Kahn's algorithm to do the same thing for any graph model.

github.com/jstanden/adv...

12.12.2025 04:20 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

I used z3, but went back and re-learned Gaussian Elimination (like I seem to do every year).

You can at least feel some measure of comfort that a lot of people probably also used AI to generate those solver examples.

12.12.2025 02:52 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
advent-of-code-python/2025/journals/diophantine-equations.ipynb at main ยท jstanden/advent-of-code-python Advent of Code solutions in Python. Contribute to jstanden/advent-of-code-python development by creating an account on GitHub.

As penance for using Z3 on Day 10 pt2, I wrote down some notes and worked examples for linear Diophantine equations and Gaussian Elimination w/ matrices.

This comes up every year and I never remember it.

I worked a few examples from my Day 10 input.

github.com/jstanden/adv...

#AdventOfCode #math

12.12.2025 02:33 โ€” ๐Ÿ‘ 23    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Good question. If I get a few mins before the next puzzle tonight, I'll swap in the dataclass decorator in place of the tuple and see if it has the same issue.

Just using tuples and a 'visited' set I knocked the initial 40s down to 20ms. The object copy may still drag before checking the set.

11.12.2025 23:28 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

It's also worth mentioning on this post that I added a two lines of code to track visited states, and the code runs in 20ms. The several second solution time was just my naive implementation and not a Python issue.

11.12.2025 22:11 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Also for education. When I'm helping my son visualize something like rigid transformations in geometry, I just open a Jupyter notebook and write a couple lines of code w/ Shapely and we get a pretty chart in under 5 mins.

If we fire up C/Rust/Go, I'd lose the afternoon.

11.12.2025 22:10 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

You aren't wrong about parallel computing either. For web apps, we also deal with that limitation in Apache/Nginx process managers. Interpreter overhead vs threaded event queue is an issue.

There's always a tradeoff in developer time vs compute time, and the former is often far more expensive.

11.12.2025 22:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Yeah, there are absolutely large swaths of programming where Python isn't the right tool. I wouldn't use it where every cycle/byte matters (AAA game, an OS).

For web apps, min ideal light speed one-way latency LA to London is ~29ms. Realistically 2-3X. Compiled vs interpreted is rarely noticeable.

11.12.2025 22:01 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Most of the time I need to get a quick throw-away answer on some question from a pile of data, and I haven't found anything that beats Python and a Jupyter notebook with inline plots.

I've used PHP for 24 years on a SaaS project, and it's never the bottleneck. It's almost always the relational DB.

11.12.2025 21:54 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Personally, I find Python both fun and efficient for data analysis, manipulation, and visualization (e.g. numpy, pandas, networkx, z3, matplotlib, scipy). That makes up most of my actual work.

It's the exception when I write production code for extreme efficiency/performance. I'd use a library.

11.12.2025 21:54 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Yeah, this is a great point. I may not technically be defining a single class for any AoC challenge this year, but that's a ton of overhead to subclass/override the existing tuple class.

namedtuple._replace() is expensive to copy w/ modification.

My big speedup was just a visited states set.

11.12.2025 21:42 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Bit Twiddling Hacks

This is fascinating. Thanks for the tip! ๐Ÿ‘

I had actually just bookmarked this old school bit hacks archive: graphics.stanford.edu/~seander/bit...

11.12.2025 21:38 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Sure, but there isn't a single programming language that's good at everything. The more languages you learn the easier any future one is, since algorithmic thinking is what matters vs syntax. I learned C in 1995. I've made a great living on PHP for 25 years. C/Rust/Go being faster never mattered.

11.12.2025 21:35 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

You're probably right about the network effect being a major reason. The creator of Python (Guido van Rossum) worked at Google and they promoted it heavily 10+ years ago. Notebooks + interpreter make it easy to play with data vs compiled, even if not the fastest. Tons of libraries. It's fun to use.

11.12.2025 21:28 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

The networkx graph visualization made the bottlenecks obvious. ๐Ÿ˜€ I spent too long thinking that they mattered, but I assume all other inputs were also directed and acyclic.

11.12.2025 21:23 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Readability on the state objects in my BFS queue while avoiding classes/structs. I also used them for the machine schematics, but we only had a few hundred.

Could have been dictionaries. Immutable tuples are more memory efficient, but the hidden 'class' overhead is too expensive for this case.

11.12.2025 21:20 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
advent-of-code-python/2025/day11.ipynb at main ยท jstanden/advent-of-code-python Advent of Code solutions in Python. Contribute to jstanden/advent-of-code-python development by creating an account on GitHub.

I've completed "Reactor" - Day 11 - Advent of Code 2025

I spent a while severing bottleneck edges in Part 2 before remembering the trick to past problems like this. The result is a couple lines and ~30ms.

github.com/jstanden/adv...

#AdventOfCode #Python #Programming

11.12.2025 21:16 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0
Post image

Quick visualization while untangling AoC 2025 Day 11 Part 2.

#AdventOfCode #networkx

11.12.2025 06:11 โ€” ๐Ÿ‘ 11    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I added 2 lines for a 'visited' states set and BFS runs in milliseconds. ๐Ÿ‘

10.12.2025 23:34 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Great tip! I felt like there was probably a way to treat it like Dijkstra. ๐Ÿ˜€

10.12.2025 21:32 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Python's namedtuples apparently have major overhead. I replaced my BFS queue state for Day 10 Part 1 with tuples and the runtime dropped from 45s to 14s.

I'm sure I can optimize it further with just math, but the solution is only ~7 lines of code.

#AdventOfCode #Python #Programming

10.12.2025 17:05 โ€” ๐Ÿ‘ 15    ๐Ÿ” 0    ๐Ÿ’ฌ 7    ๐Ÿ“Œ 0
Day 10 - Advent of Code 2025

I've completed "Factory" - Day 10 - Advent of Code 2025

I used Z3 to solve Part 2 in ~500ms. I still need to clean up Part 1's brute force.

github.com/jstanden/adv...

#AdventOfCode #Python #Programming #z3

10.12.2025 08:05 โ€” ๐Ÿ‘ 9    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image Post image

Part 1 and Part 2 visualizations in matplotlib for 2025 Day 9.

#Python #matplotlib #shapely

09.12.2025 10:12 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
advent-of-code-python/2025/day9.ipynb at main ยท jstanden/advent-of-code-python Advent of Code solutions in Python. Contribute to jstanden/advent-of-code-python development by creating an account on GitHub.

I've completed "Movie Theater" - Day 9 - Advent of Code 2025

My shortest solution so far thanks to the shapely Python library in Part 2.

github.com/jstanden/adv...

#AdventOfCode #Python #Programming

09.12.2025 10:06 โ€” ๐Ÿ‘ 6    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0
Day 8 - Advent of Code 2025

I've completed "Playground" - Day 8 - Advent of Code 2025

networkx and heapq did the heavy lifting on this one. It's super short but not particularly efficient (~1.8s).

github.com/jstanden/adv...

#AdventOfCode #Python #Programming

08.12.2025 08:19 โ€” ๐Ÿ‘ 14    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

That's super efficient code. Nice work! ๐Ÿ˜€

08.12.2025 01:31 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Yeah, and after participating for several years you start expecting at least one of each core type of problem, and can identify which it is from the ASCII sample data. ๐Ÿ˜€

08.12.2025 01:13 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Yeah, AoC is a good excuse to practice regex, but I've only barely used them on puzzles this year so far.

The 10xE15 skill would have helped on Day 7 today. I usually detect those problems when my code runs more than 2 seconds and I realize I'm going to have to toss it and start over. ๐Ÿ˜€

08.12.2025 01:12 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

@jstanden is following 20 prominent accounts