Category: Programming
-
Where is zip?
Download a copy of CPython’s source: Where is zip implemented? Looks promising! This looks like a good start point — defining it along with the other builtins inside _PyBuiltin_Init in Python/bltinmodule.c: where _PyBuiltin_Init gets called in Python/pylifecycle.c here: where pycore_init_builtins called in Python/pylifecycle.c here: where pycore_interp_init gets called in Python/pylifecycle.c here: where new_interpreter gets called…
-
Getting text from some seed packet labels
I’ve been enjoying following along with Simon Willison as he plays with LLMs via his llm tool but haven’t tried it out yet. Now I have a small task in mind — I recently planted some seeds, taking a photo of each seed packet while I was at it. I’d like to extract the plant…
-
Extracting Google Scholar metadata
I wanted to find the number of citations per year for a paper from my dad, at least per Google Scholar. Hacking around, here’s a little JavaScript to get it per results page: How would you do this? Is there a nicer way to do it? There were 12 results pages. I was paranoid about…
-
My second WP plugin
I’m starting to read “WordPress Plugin Development Cookbook – Third Edition”. The first example does nothing other than make a do nothing plugin visible in the admin page, but the second example already allowed for some fun. I’m happy with how psychedelic this turned out: I won’t add it here though. References mentioned:
-
“How to stick with your projects, even when they’re janky”
There’s a lot to reflect on from this 2025 talk from Jeaye Wilkerson, creator of jank, a Clojure dialect targeting C++ interop: “How to stick with your projects, even when they’re janky”: I’ve not really done his talk full justice, but in the spirit of focusing on shipping, I’m publishing this as is. 🙂
-
Parsing “Pollinator Post”
May Chen runs a treasure of an e-mail newsletter, the “Pollinator Post”, where she shares macro shots of insects and plants, mostly local natives, from her hikes around the East Bay, along with commentary drawing on her decades of experience as a docent. Until recently, these posts were available only via an invite-only e-mail group,…
-
KmpMatcher + links
In an earlier post, I talked about extracting attachments from .eml files, which I was doing in pursuit of a half memory of having implemented the Knuth-Morris-Pratt algorithm. That turned out to be a dead end so I ended up consulting a lot of other sources and glomming together something new from those. You can…
-
Errors you might see if you forget `bazel_dep(name = “protobuf” …)
If you forget to include the dependency on protobuf in your MODULE.bazel file while including a cc_proto_library target, you may see errors like the following when you try to build that target: ERROR: /private/var/tmp/…/external/abseil-cpp+/absl/utility/BUILD.bazel: no such target ‘@@abseil-cpp+//absl/utility:if_constexpr’: target ‘if_constexpr’ not declared in package ‘absl/utility’ defined by /private/var/tmp/…/external/abseil-cpp+/absl/utility/BUILD.bazelERROR: /private/var/tmp/…/external/protobuf+/src/google/protobuf/BUILD.bazel:483:11: no such target ‘@@abseil-cpp+//absl/utility:if_constexpr’: target ‘if_constexpr’…
-
Extract attachments from .eml files
I have a need for an implementation of the Knuth-Morris-Pratt algorithm (or similar) handling streaming input. I’m pretty sure I’ve implemented this previously and thought I might my find my code in an old .zip file I’d sent someone in e-mail. But Gmail refuses a direct download of the attachment, I guess due to it…