news
Programming Leftovers
-
Tim Kellogg ☛ Plan Mode Is A Trap
The wild part? The more time spent planning, the longer and more complex the implementation phase was.
Now, I don’t actually know why this is, but the correlation is almost perfect. For the rest of this post I’m going to explain why I think this is. My explanation might be wrong, but I’m fairly certain the observation is not.
-
Daniel Lemire ☛ Prefix sums at tens of gigabytes per second with ARM NEON
We can use SIMD instructions. SIMD instructions are special instructions that process several values at once. All 64-bit ARM processors support NEON instructions. NEON instructions can process four integers at once, if they are packed in one SIMD register.
But how do you do the prefix sum on a 4-value register? You can do it with two shifts and two additions. In theory, it scales as log(N) where N is the number elements in a vector register.
-
Zip Code First ☛ ZIP Code First
A US ZIP code is 5 characters. From those 5 characters you can determine the city, the state, and the country. That's 3 fields. Autofilled. From one input.
But you don't do that, do you? No. You make me type my street address, then my city, then scroll through a dropdown of 50 states to find Illinois wedged between Idaho and Indiana, then type my ZIP, then — the pièce de résistance — scroll through 200+ countries to find United States, which half the time is filed under "T" because some dipshit thought "The United States of America" was the correct sort key.
It's 2026. What the fuck are we doing.
-
Andrew Nesbitt ☛ If It Quacks Like a Package Manager
I spend a lot of time studying package managers, and after a while you develop an eye for things that quack like one. Plenty of tools have registries, version pinning, code that gets downloaded and executed on your behalf. But flat lists of installable things aren’t very interesting.
The quacking that catches my ear is when something develops a dependency graph: your package depends on a package that depends on a package, and now you need resolution algorithms, lockfiles, integrity verification, and some way to answer “what am I actually running and how did it get here?”
-
Perl / Raku
-
Arne Sommer ☛ Sheriff Detector with Raku
Last week I used the «Lingua::EN::Numbers» module to translate numbers to text. This time it is the other way round, and we can use the «Lingua::NumericWordForms» module.
-
-
R / R-Script
-
Rlang ☛ Explaining Time-Series Forecasts with Exact Shapley Values (ahead::dynrmf with external regressors applied to scenarios)
Shapley values constitute a widely adopted way to attribute the contribution of each feature (explanatory variable) to the prediction of a model. Mostly used in supervised learning, this post illustrates an example of how to use them to explain time-series forecasts, with exact Shapley values, and based on the ahead::dynrmf model with external regressors.
The code below uses the ahead package to compute exact Shapley values for a time-series forecast. It uses the ahead::dynrmf_shap function to compute the Shapley values and the ahead::plot_dynrmf_shap_waterfall function to plot them.
-
Rlang ☛ DuckDB + dbplyr: When Your Pipeline Gives Different Results Every Time It Runs
The migration to R goes well. You use {DBI} to open a DuckDB connection, load your source files as lazy tables via {arrow} or dplyr::tbl(), build the transformations with {dbplyr}, and collect the result at the very end. Your code is readable, your tests compare the R output to the SAS reference, and they pass (maybe using {datadiff}).
Then you run the pipeline again.
-