RSSAmplifier

Blog

Benjamin Esham

esham.ioRSS feed ↗25 posts

Latest posts

iOS development tip: use <code>trash</code> instead of <code>rm</code> to clear your DerivedData

Every iOS and Mac developer is familiar with the situation: Xcode has gotten itself wedged somehow and the only solution 1 is to blow away the “DerivedData” folder in ~/Library/Developer/Xcode . Cache invalidation is hard but in this case cache destruction is easy, and I have a tip that makes it even easier. The obvious way to delete your DerivedData from the command line is $ rm -r…

Curate your shell history

Simon Tatham wrote an article recently called “Policy of transience” , explaining (among other things) why you might want to disable your shell history file. Simon writes: My unusual habit is: turn off the history file completely, by putting the command ‘ unset HISTFILE ’ in my .bashrc . I still get history within a single instance of the shell, so I can edit my last command ten times until it…

How to self-host the Anki sync server in a FreeBSD jail

Anki is a cross-platform flashcards app. It uses spaced repetition to show you your flashcards at the (hopefully) optimal times for building long-term recall. The Anki apps on various platforms can sync with each other. The Anki sync server is open-source; by default, the apps sync with a server instance that the Anki developers generously maintain for free. But you still might want to run your…

Authoritarians thrive on misinformation, and Apple is providing it as a service

Oppressive regimes benefit when people are confused, when they cannot tell fact from fiction. “To abandon facts is to abandon freedom,” warns Yale history professor Timothy Snyder . “If nothing is true, then no one can criticize power, because there is no basis upon which to do so. If nothing is true, then all is spectacle.” George Lakoff and Gil Duran of FrameLab agree : “Once we can no longer…

An odd gap in Swift’s checking of protocol conformances

Idiomatic Swift code relies heavily on protocols, 1 so I was surprised yesterday when I tripped over a fairly simple oversight in Swift’s ability to verify that a given class conforms to a protocol. Consider this simple protocol and class: enum Color { case bondiBlue case beige } protocol Paintable { func paint ( _ color : Color ) } class Bookshelf : Paintable {} We’re defining a protocol that…

Tidbits from Wikipedia articles about tall buildings

Wikipedia’s article about the Sears Tower mentions two people who have climbed it: On May 25, 1981, Dan Goodwin, wearing a homemade Spider-Man suit while using suction cups, camming devices, and sky hooks, and despite several attempts by the Chicago Fire Department to stop him, made the first successful outside ascent of the tower. […] In August 1999, French urban climber Alain “Spiderman” Robert,…

The best thing about living in California

Carmel Beach It wasn’t the mild weather, or the trendy foods, or how my habit of arriving two minutes late to every meeting—a professional liability back on the East Coast—suddenly meant that I was always the first one there. No: it was the fact that California is not only the first U.S. state alphabetically whose name starts with C, but also the first state whose abbreviation starts with C. Which…

Using an App Store Connect <abbr>API</abbr> key with jwt.io

When you make a request to Apple’s App Store Connect API , you have to identify yourself with a JWT that has been signed by your Apple-issued key . If you’re making a small number of requests, you might use jwt.io to create these JWT s. But there’s a hitch: jwt.io requires you to enter a private key and a public key, but Apple only provides you with a private key. You can use the openssl…

Ducks and drakes and nominative determinism

Wikipedia tells me that the world record for stone skipping ( 88 skips! ) is held by a man named Kurt Steiner. A previous record holder was named Max Steiner and curiously, the two are not related. It would be surprising enough by itself for two unrelated people with the same name to reach the pinnacle of the same obscure sport. 1 But if it were going to happen, I guess it makes sense that those…

You can’t spell “Gell-Mann amnesia” without <abbr>LLM</abbr>

For a while I assumed we were all on the same page about this AI thing. I thought we all understood that—aside from the considerable ethical concerns with the unauthorized scraping of everybody’s creative work, and the dismal treatment of the people who annotate that work, and the electricity it takes to compile those annotations into models, and the likelihood that companies will see this new…

Tazo’s maddening precision

Brewing a pot of herbal tea takes around five minutes—plenty of time, if you’ve made the mistake of leaving your phone in another room, to become bored enough to start reading absolutely anything. Ask me how I know. Here’s the wrapper from a bag of Tazo’s Sweet Cinnamon Spice tea: 1 Here in the United States we’re instructed to brew this tea with eight ounces of water. And it’s a very casual eight…

Making direnv easier on the eyes

Direnv is a utility that makes it easy to set and unset environment variables as you move between directories on the command line. It works great, but its output can be a bit noisy. For some projects I use direnv with Lorri to set an entire Nix shell ’s worth of environment variables, and when I cd into one of these projects direnv produces a lot of output: $ cd ~/Projects/itunes-wrapped direnv:…

There’s only one Space Karen for me

Shantel VanSanten as Karen Baldwin on For All Mankind . Courtesy of Apple. For All Mankind is one of my favorite TV shows of the past few years. It imagines how things might have gone if the Soviet Union had landed a person on the moon first and the Space Race—and the USSR itself—had continued indefinitely. Showrun by Star Trek and Battlestar Galactica alumnus Ronald D. Moore , the series is very…

A quick proof about the Fibonacci sequence

This post contains math markup that will only display properly in a browser. Software engineers use the Fibonacci numbers in two equally important contexts: to demonstrate their knowledge of recursion during interviews, and to plan their work using story points , which are time estimates but with plausible deniability. It was in the latter context that I noticed something about the Fibonacci…

What’s the smallest amount of currency that can’t be represented by a floating-point number?

At this point it’s common wisdom among software developers that if you’re going to store amounts of currency, you shouldn’t use floating-point numbers. Floats can represent numbers within a huge range, but only some numbers in that range can be represented exactly, and while this is fine sometimes it’s almost never what you want when dealing with money. I got to wondering: counting up cent by…

Counterfactual fgrep

For years and years I thought the fgrep command was a shorthand for running grep with the -f flag (“Obtain patterns from FILE , one per line”). I thought this was a weird flag to promote to its own command; I never used it. Why did other people have all of these files full of regexes to search for but I’d never needed such a thing? Life made so much more sense when I realized that fgrep was a…

Road work, next few miles

Ways of writing “two and a half” on highway signage Notation What it means to a mathematician How often is it used on highway signage? 2 1/2 10.5 All the time 2–1/2 1.5 Pretty often 2 1/2 1.414… Occasionally 2 + 1/2 2.5 Never ever

Wikipedia curiosity of the day

The Vim text editor can run scripts written in several programming languages: Python, Ruby, and Lua, to name just three, and MzScheme, to name one more. I got curious about this last one. I assumed from the name that MzScheme is a dialect of Lisp, but I’ve never seen evidence of anyone actually writing a Vim script in this language. I popped open LaunchBar (whose ability to search Wikipedia I’ve…

Unsustainable

Jason Kottke recently linked to an essay on climate change by George Monbiot. This paragraph that Kottke quoted also grabbed me: Every nonlinear transformation in history has taken people by surprise. As Alexei Yurchak explains in his book about the collapse of the Soviet Union— Everything Was Forever, Until It Was No More —systems look immutable until they suddenly disintegrate. As soon as they…

How to restore autocompleting search results in LaunchBar

I’ve been using LaunchBar for many years, both on my own laptop and on my work machines. At some point I noticed that my work LaunchBar installations—which started over with a fresh configuration every few years—were showing me autocomplete suggestions as I typed in queries for Wikipedia and Google: My home LaunchBar installation, which I’ve been migrating from computer to computer since version…

Noon

It’s a well-known bit of trivia that the names of September through December are derived from numbers, and that they’re the wrong numbers with our calendar laid out as it is now. But before reading The Name of the Rose , whose chapters are named according to the canonical hours , it hadn’t occurred to me that the word “noon” is also a number that was mislaid somehow: it comes from the Latin nona…

Parsing <abbr>JSON</abbr> with more context

Matt Parsons wrote an article the other day called Return a Function to Avoid Effects . The article is short and to the point, so I’d recommend just reading it, but this gist is this: sometimes a library wants you to produce a value of type t , but you’d like to have a value of type e available when you do that and the API doesn’t offer a way to inject an e in the right place. Parsons shows that…

An otherwise functional clock that hasn’t been adjusted for <abbr>DST</abbr> is right zero times a day

Twice a year I’m reminded of how little correlation there is between how much a time-telling device costs and how smart it is about daylight saving time. Device Approximate price new Does it automatically adjust for DST ? IKEA wall clock $15 No Microwave oven $90 No Kindle Paperwhite $100 No Fitbit fitness tracker $150 Yes (but don’t ask about the sleep tracking for that night) Canon M5 camera…

A Dream of Zsh

Last night I had the strange sensation that as I was dreaming, my conscious mind was also turning over a programming idea, one that still kind of made sense when I woke up: what if I were to write a static site generator… in zsh? Maybe it’s not as crazy as it sounds! Think about some of the things that shell scripts make easy: Enumerating, reading, and writing files Gluing together external…

Microblogging

The idea of microblogging on my own website is something I’ve been kicking around for years. Instead of posting short pieces of text to Twitter , longer pieces of text to this blog, and photos to Instagram , why not just post all of that stuff here? I could still cross-post to other sites if I wanted to, but my intention has always been that this website should represent me on the web and so it…