Zsh has neat shortcuts for decomposing file names & paths

I only just learned that the venerable basename and dirname are no longer necessary, let-alone the horrible string splitting required for teasing apart names from file extensions. Zsh has some awesomely convenient expansion modifiers which do it all! e.g. given the path “/Users/me/Documents/Work.zip”: You can also compose these arbitrarily, e.g.: Kudos to Zaiste Programming for … Read more

getifaddrs never specifies broadcast addresses

Apple “Feedback” #12149764. According to man 3 getifaddrs: The ifa_dstaddr field references the destination address on a P2P interface, if one exists, otherwise it contains the broadcast address. In my testing the ifa_dstaddr field is never non-null. I’m not sure I have any suitably configured P2P interfaces, but I definitely have interfaces with broadcast capabilities … Read more

getifaddrs returns truncated sockaddr_in’s for AF_INET ifa_netmasks

Apple “Feedback” #12149675. Some netmasks returned by getifaddrs have family of AF_INET yet a length less than sizeof(sockaddr_in), e.g. 5, 6, 7, or 8. On macOS Ventura 13.3.1, at least. It looks like it’s actually allocating only eight bytes for the ifa_netmask (not the 16 that is the size of sockaddr_in per MacOSX13.3.sdk/usr/include/netinet/in.h), as it … Read more

Performing a delayed and/or repeating operation in a Swift Actor

Say you want to perform some operation after a delay, and/or at regular intervals, inside a Swift actor – maybe your actor represents a weather station and you want to periodically fetch the latest weather information, automatically. How do you do that? You could punt the problem to some other code, outside the actor – … Read more

Evil Pacman

Google had (has?) a tongue-in-cheek achievement system built into the employee directory. Anyone can define a new achievement and award it to whomever, provided they can create (or pirate) a neat little icon for it. Lots of people have over the years – there must be thousands of distinct achievements possible, at this point. It’s … Read more

Attention trumps experience

It’s always bemused me that I did better in electronic engineering than computer science. I studied them simultaneously, receiving degrees in both after five years (some classes counted towards both, thus why it wasn’t seven or eight years). I grew up playing on, dabbling with, and programming computers. From BASIC II to Hypercard to RealBasic … Read more

The Abstracted Unreliability Anti-pattern

I don’t know if it’s genuinely on the uptick, or just coincidence, or merely runaway pattern recognition on my part, but I keep seeing the same logical fallacy applied over and over again: if I add more layers to a system it will become more reliable. A recent example: this set of services have poor … Read more