A non-scientific survey of ZIP Metadata

Okio's has an openZip() function that views a .zip file as a FileSystem. To expose file metadata in the file system API, Okio must extract it from the .zip file. There’s at least four ways to encode timestamps in a .zip file. I wanted to find out which of…

Honor and Internal Visibility

I don’t do many crimes. I don’t even do crimes that I could do without getting caught! Every single time my dog poops on the sidewalk, I pick it up. Even if nobody’s watching! I have honor. With that disclaimer out of the way, here’s instructions…

WebAssembly is like JSON for behaviour

If you’re sending data from one computer to another, it’s probably JSON. But it hasn’t always been this way. How we Transmitted Data Before JSONBefore JSON got popular (2005ish) we had XML, CORBA, Java serialization, Python Pickle, and a bunch of other clever and complex encoding schemes.…

Preparing for Network Failures this Holiday Season

Suppose I’m connecting my home Christmas lights to the Internet. Perhaps I’ll make a mobile app that calls my home control server via an HTTP API: POST /lights/toggle HTTP/1.1 { "subjects": ["maple_tree", "roof"] }HTTP/1.1 200 OK { "toggled": true }It works. I can finally…

Your Company’s DanceService probably doesn’t Dance

I work on a big product at a big company and we have lots of backend services that have big responsibilities: The messaging service sends customers their emails, SMS messages, and push notifications.The banking service manages the customers’ bank accounts.The identity verification service verifies customers’ identities.Except that…

Farm or Grind

Suppose your organization has a widely-used internal library for validating customer usernames: private val usernameRegex = Regex("[a-z]{2,40}") fun isValidUsername(username: String): Boolean { return usernameRegex.matches(username) }The function becomes widely adopted: Some callers use it during customer sign-up. We don’t want customers putting slashes in their usernames!…

Read a File in a Kotlin/Multiplatform Test

I like writing unit tests that read test cases from a data file: Zipline does ECDSA and EdDSA signing. It gets test data from Project Wycheproof.OkHttp does URL parsing. It gets test data from The web-platform-tests Project.OkHttp-ICU does Unicode Normalization. It gets its test data from Unicode’s…

Bob Bent the Universe

Bob Lee was murdered on April 4 in San Francisco. I met Bob in 2006 when I joined him on the AdWords front end (AWFE) team at Google. He was charismatic, inventive, and kind. With Kevin B. he created Guice, a dependency injector that we could use to make AWFE…