kconner.com

What’s funny about languages with optionals is that seeing ? gives you certainty and seeing ! raises questions.

18 Sep 2019

I don’t know why I was complaining the other day about how Docker is unintuitive. Maybe it is, but I just needed to read 100% of the documentation and try out half the sample code, and now it fits in my head like it ought to.

I’m only half kidding. You don’t get to learn everything top-down. Like when you begin Swift with print("hello world"), you benefit from progressive disclosure in the language and its documentation. After a short tutorial you can do useful things, and then you come back for more information when you need to know the next thing. Stack Overflow not only gets you unstuck, it improves your intuition.

Some things you have to learn bottom-up, like the shell. man cat, man ps, man 3 intro, apropos regex, ad infinitum. Only when you’ve been exposed to all these details do their combinations begin to make sense, and nobody is going to tell you which information you’re missing. You have to just be willing to absorb every tiny thing and then synthesize the intuition yourself. In theory, if you learned it all, you could solve every problem. So in practice, you read everything available and look up anything you don’t recognize. That learning curve can be a lot when you’re just stuck on one thing, but it’s a fact of life.

Everything you can learn is somewhere on this spectrum. If you’re stuck, you may need to back up and adapt your learning style.

16 Sep 2019

iOS 13 beta was nice to use all summer, but next week I’ll need my new phone to restore from a backup. That means I needed to make a backup on the public release version, the GM. This year it’s complicated because the beta channel is currently on 13.1, not 13.0, so it’s a downgrade. And because that’s something you’re never supposed to have to do, I had problems.

After downgrading iOS from 13.1 beta to 13.0 GM, my Mail database seemed to fail to load. The app would freeze for about six seconds after tapping most any mailbox, and then the mailbox list would be empty. It was as if loading from the message cache caused a failure, like a crash and restart in whatever daemon owns the data. The only exception was an inbox I had zeroed before the upgrade, which worked fine.

To fix that I wanted to reset my Mail cache, for which there are no explicit controls. It wasn’t enough to remove my Mail accounts and delete the app and add them back. Thinking a cache wouldn’t be included in backups (and it should be only a cache because these are IMAP accounts), I backed up my phone on 13.0, erased all content and settings, and restored. That did the trick for Mail.

An hour later I found my music library was suffering from a similar problem, and no amount of tricks would solve it. Although I could add and remove files through means like iTunes sync, the library index appeared to be missing a lot of them. The index was immutable, for instance, I couldn’t add a song to a playlist or add from Apple Music. This was also true for Podcasts and TV. I imagine they are still one big database under the hood.

I think the reason having restored from a backup made no difference to the media library is that it is not simply a cache, it’s a source of truth. Syncing through iCloud Music Library is optional, so the backup mechanism probably needs to include the index even though it omits the media files.

I had to preserve some data, do a fresh install, and then set everything up again from scratch. Ultimately the amount of time that took was about the same as the amount of time I spent trying to repair things. It would have been simpler to just reset to a state I could be confident in.

If any of that made your stomach turn, don’t tempt fate by putting a beta on your carry phone.

15 Sep 2019

In the timeline of multiplayer games there was a point where you could play on the internet with strangers, but there wasn’t yet voice chat. Games let you type a line of text and broadcast it to the top of everyone’s screen, and it would mix in with server messages about what else happened, like who killed who by what means, or who joined and left.

Quake 1 exemplified this when its online multiplayer community blew up. Id released the Quakeworld client, which compensated for the lag we all had on dial-up – Under 300 ping was great; under 100 would get you accused of being a low ping bastard / LPB. The community built GameSpy, then called QuakeSpy, the global server browser Windows 95 app, which we all used as a launcher. The DOS-era convention of having a boss key to quit to the shell was still in effect, though.

It was all so new, that year everyone was both a noob and a troll. I for one was in middle school. So we’d bind a key to say “F10 for extra armor” and see who quit. But it was not usually the player ahead of you on the scoreboard.

15 Sep 2019

I think it’s cool the way identity terminology changes. If terms reflect how we identify, they reflect how we identify in the context of other identities. When you state your identity, you alter the landscape of what people can identify with. Now we have so much to say about it that just about anyone who spends the time to read about identity on Wikipedia learns something about themself.

12 Sep 2019

Getting release and CI and debug behavior all working in Docker is rough. It’s a very opaque experience. You can’t see, so you have to do everything in baby steps, lest you have a problem you can’t track down at all. This is worth it, right? It’s satisfying when it works, but I feel like we’re solving the problem of configuration drift or environment mismatch by merely shrinking the part you write once and then don’t touch again.

10 Sep 2019

In your Azure DevOps Pipeline, if your variable group’s values are not showing up where you reference them, check the syntax. There are two ways to satisfy the variables key, and they mean different things.

First, if you supply a dictionary, you are creating literal variable names and values:

variables:
  name1: value1
  name2: value2

Second, if you supply an array of dictionaries, each item’s keys determine whether it’s a single variable or a group:

variables:
- group: name-of-variable-group
- name: name1
  value: value1
- name: name2
  value: value2

(YAML can be a little confusing here. Each hyphenated line begins an array item, and since there is at least one of them, the outer value is an array. Each line with a colon is a name-value pair in a dictionary, and since there is at least one of them after each hyphen, each array item is a dictionary.)

If, like me, you saw the first syntax, then learned about variable groups, then glossed over the fact there were two syntaxes, you might end up with this:

variables:
  group: name-of-variable-group
  name1: value1
  name2: value2

That syntax doesn’t reference a variable group, it creates a variable whose name is “group”. That’s a nasty silent failure for a newcomer.

09 Sep 2019

Assuming this doesn’t appear malformed, I was able to write and publish a blog post from a one-line shell command. Maybe when I’ve used it for a while, I’ll put up a tutorial post.

That’s a nice piece of work for a Sunday afternoon. I always feel like I do better work when I’m just fooling around, compared to when I’ve dreamed up a big project.

08 Sep 2019

I thought I’d put together a blog that’s as easy for me to post to as Twitter and Facebook make it, so I will have a place to publish things without resorting to Twitter and Facebook.

The recent release of NetNewsWire 5 got me thinking about this. I’ve also been using doing, whose shell interface takes the drudgery out of tracking what I work on.

I figure what I need is a blog I can post to from the shell. Having moved my site to GitHub Pages recently, I find I have Jekyll available, which handles the Markdown and page generation bits. Scripting up a new post tool should be doable.

08 Sep 2019

I’ll bet Heimdall is really good at Where’s Waldo.

08 Sep 2019