In pursuit of a sense of wonder
Lost is the occasional blog of Leon Matthews, programmer, and master of miscellanea.
Sixteen Years of Python Performance
I build and benchmarked 17 versions of Python against each other so that you don't have to. Let's compare the performance of every Python version from 2.6 all the way to almost-released 3.13. Spoiler, it's great!
Install Klipper on a Raspberry Pi Zero 2
Running Klipper on your 3D printer requires a Linux server connected to your controller board. The Raspberry Pi Zero 2 is a great choice. It's tiny and uses hardly any power, which makes it easy to add to your build. If you don't mind the WiFi networking and have $15, pick one up and follow along to get it set up!
Doctests & Metaclasses & Multiprocessing, Oh My!
I've been programming in Python for more than a decade, but it's only now that I have had to bring out the big guns: writing a metaclass.
RErename
My little bulk file renaming script. Inspired by the venerable rename Perl script, my version uses Python regular expressions and focuses on safety. That's not just important, it's super-duper important! Bulk renaming is dangerous enough, but add regular expressions into the mix and It's all too easy to shoot yourself in the foot!
Childrens' Game to Punish PCs
Snakes and ladders is a boring game. But just how boring, exactly? Is it possible to bore a computer so much that it self-destructs? Let's try it and find out...
Tidy Caseless Ordering in Django
Sorting by name in Django is a common admin annoyance. By default upper-case names come before lower-case ones because of their raw ASCII encodings. This isn't fun to try and explain to clients. For years I've ordered my models using a forced lower-case slug, but sometimes you need the big guns: database functions. Let's use that powerful ordering, while keeping our code nice and neat.