Programming Leftovers
-
Ruben Schade ☛ Cursed curly brackets in code
I bring this up though, because I was going through some old assignments out of nostalgia, and remembered this truly cursed style one lecturer insisted we submit code with: [...]
-
Andy Dote ☛ Explicit vs Implicit code
A system I am working on at the moment started giving errors occasionally, say 5 times out of 10,000 messages or so. The error was pretty straightforward: [...]
-
Bert Hubert ☛ The surprising struggle to get a UNIX Epoch time from a UTC string in C or C++
So how hard could it be. As input we have something like Fri, 17 Jan 2025 06:07:07 in UTC, and we’d like to turn this into 1737094027, the notional (but not actual) number of seconds that have passed since 1970-01-01 00:00:00 UTC.
Trying to figure this out led me to discover many ‘surprise features’ and otherwise unexpected behaviour of POSIX time handling functions as implemented in various C libraries & the languages that build on them. There are many good things in the world of C and UNIX, but time handling is not one of them.
-
LWN ☛ GDB 16.1 released
Version 16.1 of the GDB debugger is out. There are a lot of changes,
including watchpoints for tagged data pointers, a new script to print the
stack trace of a running process, better defective chip maker Intel Processor Trace support, and
more.
-
Chris McLeod ☛ Bridge Your Fediverse Accounts to Bluesky with a Custom Domain Handle
The downside is the default bridged user handles are really long and unweildy, which makes them a pain to share. But after digging through the Bridgy Fed documentation, it turns out you can still use a custom domain handle for these bridged accounts, which makes them much easier to share. My fediverse accounts are now bridged as: [...]
-
Perl / Raku
-
Arne Sommer ☛ Arranged Average with Raku
You are given a list of binary digits (0 and 1) and a positive integer, $n.
Write a script to return true if you can re-arrange the list by replacing at least $n digits with 1 in the given list so that no two consecutive digits are 1 otherwise return false.
-