28 Free Coffees: Out-View Gangnam Style; Out-Nuke Gandhi

Mikey Clarke
2 min readMay 30, 2021

--

You know how many/most cafes have some kind of buy-ten-get-one-free deal? I’ve been doing much of my home-office work these days at a Home Cafe, located inside the National Library of Wellington, New Zealand. Home offers just such a deal. I have stockpiled 28 free coffees and counting.

Friends have asked me why. Couple of reasons! First, I’d got a peek at Home Cafe’s POS UI. It’s like catnip to my kind. Part of my web-dev day job involves designing such UIs. Part of UI design involves stress-testing them: you shove impossibly vast or teensy pieces of content into them and ensure they display it without errors. I’ve found myself consumed with the vaguely professional goal of stockpiling such a vast number of Home Cafe coffee freebies that their UI breaks and can’t display that properly.

It happens more than you might think! The most recent really popular example I’m aware of was the YouTube video for the song Gangnam Style,

… which was Youtube’s first ever video to exceed ~2.1 billion views.

Why 2.1 billion? That particular number is 2³¹: the standard coding-web-dev way of storing a regular normal integer is to use four bytes, 32 bits, and this records a number anywhere between plus-or-minus 2³¹. That’s just fine and dandy for recording a video’s view count … until a colossal mega-hit like Gangnam Style comes along and exceeds 2³¹. The number does something called an integer overflow bug, and wraps around to -2³¹, and starts counting up from minus-two-billion again.

For Civ-fans, that’s the same bug that (allegedly!) makes Gandhi such a murderous nuclear psychopath. Way back in Civ1, its devs gave each civilisation leader a list of traits: industriousness, culture, tendency to go to war, tendency to use nukes, etc,. and for each trait, each leader had a value 0–12. They set Gandhi’s tendency to use nukes to zero, naturally … and also set a global event, something like researching Pacifism, can’t recall what, that when it occurs, reduces every civ’s leader’s tendency to use nukes by two points. The devs used a single-byte integer, eight bits, total possible values 0–255. Zero minus two wraps around to 254. Gandhi’s tendency to use nukes: 254/10. So the instant he got them, he went on a horrible murderous nuclear rampage. Most devs and most players thought this was hilarious and added it as a deliberate running gag in every Civ sequel.

So that’s a long-winded way of saying that I’m trying to out-YouTube-view Gangnam Style, and out-nuclear Civ-Gandhi, via the medium of Home Cafe coffee freebies.

--

--

Mikey Clarke
Mikey Clarke

Written by Mikey Clarke

Hi there! My snippets and postings here are either zeroth drafts from my larger novels, or web-app tutorials and other computery codey musings.

No responses yet