news
Programming Leftovers
-
Yordi Verkroost ☛ Advent of Code 2025 - Day 3
The meat of today's problem is in finding the largest possible number in a list by combining two (part one) or twelve (part two) numbers in order.
-
Sandor Dargo ☛ Time in C++: Understanding std::chrono::steady_clock
In the previous articles, we explored what clocks are in general and took a closer look at std::chrono::system_clock, the one that represents the wall-clock or calendar time. Now let’s move to another important one: std::chrono::steady_clock.
At first sight, the difference between steady_clock and system_clock might not be obvious. They both give you a time_point, and you can use both to measure durations. But under the hood, they behave quite differently — and those differences make steady_clock the right choice for measuring intervals and durations.
-
Matthew Weber ☛ Metadata Is The Worst - Matt's Blog
So, I’ve been working on my music collection and it is really coming along. I’ve downloaded a metric shit ton of music in the last month. My biggest problem remains, however. Metadata is crap. Even though now all of my files are meticulously named and organized, the so-called metadata search only works about 80% of the time. Why it is so hard, I’m not sure. These people have databases, right? All my folders have album.nfo files in them already, so the metadata shouldn’t even need to be looked up. It’s just an odd thing.
-
Kerrick Long ☛ Acceptance Tests and Unit Tests as Documents First, Tests Second - Kerrick Long (blog)
As my wife and I were listening to Uncle Bob’s book on professionalism in software, this line surprised me. Maybe it’s just because I don’t understand tests as well as I’d like, but I had to stop and take note. He clarified exactly what he meant, too: [...]
-
Idiomdrottning ☛ Scheme Do
I thought the do in in Scheme was a li’l hard to learn since the examples I could find was a li’l too fancy and clever. Just like a lot of my own documentation often is; sorry about that.
-
Evan Hahn ☛ I made a little audio speed calculator
But I wanted to turn this prototype into something I could share with others. I didn’t want it to be a buggy mess! Unfortunately, there were a number of things the LLM failed to do in the first version: [...]
-
Cassidy Williams ☛ Change commit timestamps in Git
If the commit you want to change is the most recent one, you can run this on a Mac or Linux-based system: [...]
-
AdventOfCode ☛ Day 3 - Advent of Code 2025
The batteries are arranged into banks; each line of digits in your input corresponds to a single bank of batteries. Within each bank, you need to turn on exactly two batteries; the joltage that the bank produces is equal to the number formed by the digits on the batteries you've turned on. For example, if you have a bank like 12345 and you turn on batteries 2 and 4, the bank would produce 24 jolts. (You cannot rearrange batteries.)
You'll need to find the largest possible joltage each bank can produce. In the above example: [...]
-
Manuel Matuzović ☛ Speculation rules improvements
The Speculation Rules API allows you to speed up future navigations by prefetching or even prerendering URLs in advance of a user actually clicking a link. When the link is clicked, the speculation is used, and the user experiences a faster load than if no speculation was used.
-
Web Performance Calendar ☛ Traffic Modeling Using Machine Learning - Web Performance Calendar
When I explain the difference between lab (aka synthetic) and field data to people, one of the things I mention is that the lab allows for testing under repeatable, controlled conditions. Each test run offers an apples-to-apples comparison with previous tests, and results are available almost immediately. On the other hand, field data measures actual user experience, but it requires time to collect enough sample data for the results to be relevant.
One thing I have always been curious about is how shifts in synthetic data impact field metrics. For example, if I reduce a lab metric, is there any way to anticipate how that might change the field metric without having to wait for data collection? As I was taking Frank Kane’s Machine Learning, Data Science and Generative AI with Python course, I learned about XGBoost, a tool that excels at prediction. As I learned about its capabilities, I wondered if it could be used to predict the relationship between lab and field data in a meaningful way.
-
Arjen Wiersma ☛ Advent of Code 2025 Day 3
The puzzle today has us figuring out the joltage of a bank of batteries. This is a puzzle of the type “largest sequence in a list”. When you start you already know that part 2 will be something that a naive approach will not be able to handle, but I still did part 1 with a naive combination function.
-
Aman Mittal ☛ Create a copy as markdown button for MDX documentation site
Here is an overview of how I implemented the above solution for a Next.js based documentation site.
-
AdaCore ☛ Announcing Advent of Ada/SPARK 2025: Coding for a Cause!
For each person completing one of the Advent of Code challenges using the Ada programming language, AdaCore will donate $10 to the Ada Developers Academy, up to a total of $5,000. And for those willing to go an extra mile, AdaCore will donate $20 if the solution is implemented in SPARK with at least proof of absence of run-time errors (a.k.a. Silver level).
-
MaskRay ☛ The dark side of RISC-V linker relaxation
Because the linker has a global view and layout information, it can perform some peephole optimizations which are difficult/impossible to do on the compiler side. Generic link-time code sequence transformation is risky, because semantic information is lost and what the linker sees are byte streams. However, if every instruction in the candidate code sequence is associated with one ore more relocations, the ABI and the implementation can assign (additional) semantics to the relocation types and make such transformation safe. This technique is usually called linker optimization or linker relaxation. It seems that the term "linker optimization" is often used when the number of bytes does not change while "linker relaxation" is used when the number of bytes decreases.
-
LWN ☛ Zig's new plan for asynchronous programs
The designers of the Zig programming language have been working to find a suitable design for asynchronous code for some time. Zig is a carefully minimalist language, and its initial design for asynchronous I/O did not fit well with its other features. Now, the project has announced (in a Zig SHOWTIME video) a new approach to asynchronous I/O that promises to solve the function coloring problem, and allows writing code that will execute correctly using either synchronous or asynchronous I/O.
-
[Old] John D Cook ☛ Stochastic Rounding and Data Privacy
Round-to-nearest will be biased unless ages are uniformly distributed in each decade. Suppose, for example, our data is on undergraduate students. We would expect a lot more students in their early twenties than in their late twenties.
-
[Old] Miguel Batista ☛ Quantifying Information Loss
That idea caught my attention: rounding is just a deterministic way of adding noise. So how much information do we actually lose when we do this?
-
Dmitrii Kovanikov ☛ Avoiding space leaks at all costs
In any case, both lazy and eager evaluations have their own advantages and drawbacks. But this post is not about comparing different evaluation semantics and their trade-offs. I’d like to talk about living with the consequences of our choices.
Haskell programs are infamous for having lots of space leaks. This is the result of Haskell choosing the lazy evaluation model and not designing the language around preventing such type of memory usage errors.
-
Mira Welner ☛ How Should We Peer Review Software?
Of course, you could increase science funding such that they could hire software engineers, but we are going in rather the opposite direction these days.
I don't think the problem is so unsolvable and intractable that we should just abandon it. I'm open to suggestions. To quote the great Jello Biafra in his song Where Do Ya Draw the Line, "I'm not telling you; I'm asking you." I think there is a way to solve this problem, but it is not so trivial as requiring reviewers to inspect the simulation code that goes along with the paper. They aren't going to do that unless you pay them or incentivize them somehow. It just isn't realistic.
-
Perl / Raku
-
Rakulang ☛ Day 4 – Gift yourself a merry little PDF journal – Raku Advent Calendar
I wanted to give myself the Xmas gift of a 2026 pdf journal this year.
I had grand plans to create a fully fledged library for doing this, but ironically enough I just wasn’t that organised!
But courtesy or the comprehensive PDF api by dwarring https://raku.land/zef:dwarring/PDF::API6 and with help from tbrowder’s Date::Names for human dates https://raku.land/zef:tbrowder/Date::Names and, of course, all the folk who have brought raku/rakulang to us, here’s my script
-
Rakulang ☛ Day 3 – Christmas Crunching Part I – Raku Advent Calendar
The first challenge was to work out the total distance to travel on Christmas Day and then to know what speed Santa’s slight would need to average in order to get around the entire Earth in just 24 hours.
-
Perl ☛ Perl Advent Calendar 2025 - Stopping the Evil Grinch: A Holiday Defense Guide
Logging is handled by the Log::Log4perl module. The core of the script is the run_report function, which deletes any previous report file and executes each command. Because ClamAV errors are expected when scanning protected or locked files, the ClamAV call is allowed to return a non-zero exit code.
-
The Weekly Challenge ☛ Advent Calendar - December 3, 2025
From a binary array b=(b1,….,bn) we find the partial binary numbers s=(s1,….,sn) as: [...]
-
-
Python
-
Simon Willison ☛ TIL: Dependency groups and uv run
TIL: Dependency groups and uv run. I wrote up the new pattern I'm using for my various Python project repos to make them as easy to hack on with uv as possible. The trick is to use a PEP 735 dependency group called dev, declared in pyproject.toml like this: [...]
-