Note #16013

Making magic happen alongside my new @WooCommerce Team Alpha buds in sunny Cape Town. 🇿🇦

Team Alpha in Cape Town

×

Dan Q found GC7B91V South with Scott

This checkin to GC7B91V South with Scott reflects a geocaching.com log entry. See more of Dan's cache logs.

Staying in the hotel nearby for a meetup event with my team, who’ve flown in from all over the world (USA, UK, France, Indonesia, Russia, among others) to meet one another face to face (we normally all work remotely). Needed to count the portholes twice but got the right answer in the end. TFTC (my first find in ZA)!

Dan with a statue at the GZ

×

Dan Q posted a note for GC79361 Prestwich Memorial Tribute and TB Hotel

This checkin to GC79361 Prestwich Memorial Tribute and TB Hotel reflects a geocaching.com log entry. See more of Dan's cache logs.

Turned up on a Tuesday at 16:15 to find the place all locked up, despite a sign on the door saying it was open until 18:00! Might try again later in the week.

Note #15997

Off to Cape Town. Don’t wait up! ✈️ 🇿🇦

Dan Q found GC4FJ91 Poke My Eye Out

This checkin to GC4FJ91 Poke My Eye Out reflects a geocaching.com log entry. See more of Dan's cache logs.

Found after an extended hunt with fleeblewidget. Hadn’t brought my proper GPSr out and my phone didn’t give us a solid fix, but a spoiler photo by a previous finder was enough of a clue to help us as we expanded our search radius. TFTC.

Howdymattic Outtakes

Yesterday, I shared with you the introduction video I made for my new employer. A few friends commented that it seemed very well-presented and complimented me on my presentation, so I thought I’d dispel the illusion by providing this: the “outtakes”. My process was to write a loose script and then perform it multiple times (while being sure to wear the same hoodie) over the course of several days as I walked or cycled around, and then take only the “good” content.

That I’m able to effortlessly make a longer video out of a selection of the outtakes should be evidence enough that I’m just as capable of mucking-up a simple task as anybody else, probably moreso.

You may observe in this video that I made a number of “Hey, I found a…” snippets; I wasn’t sure what would scan best (I eventually went with “Hey, I found a… nothing?”). Folks who’ve seen this video have already criticised my choice; apparently the cow I found was more photogenic than me.

Also available on: VideoPress, QTube, YouTube.

Howdymattic

New employees at Automatticlike me! – are encouraged to make a “howdymattic” video, introducing themselves to their co-workers. Some are short and simple, others more-ornate, but all are a great way to provide the kind of interpersonal connection that’s more-challenging in an entirely-distributed company with no fixed locations and staff spread throughout the globe.

In anticipation of starting, tomorrow, I made such a video. And I thought I’d share it with you, too.

Also available on: VideoPress, QTube, YouTube.

Mission Across Wales

This article is a repost promoting content originally published elsewhere. See more things Dan's reposted.

The Mission Across Wales title card

Truly in the style and spirit of Challenge Robin / Challenge Robin II, this sweary idiot decides to try to cross Wales in as close as possible to a completely straight line, cutting through dense woods, farms, rivers, hedgerows and back gardens. Cut up by barbed wire, stung by nettles, swimming through freezing rivers, and chased by farmers, it makes for gruelling, hilarious watching. Link is to the four-hour playlist; put it on in the background.

Without The Bod

Eight years, six months, and one week after I started at the Bodleian, we’ve gone our separate ways. It’s genuinely been the nicest place I’ve ever worked; the Communications team are a tightly-knit, supportive, caring bunch of diverse misfits and I love them all dearly, but the time had come for me to seek my next challenge.

(For anybody out-of-the-loop, I’m moving to Automattic after surviving their amazing, mind-expanding recruitment process).

Bodleian staff badge and keyring
My imminent departure began to feel real when I turned over my badge and gun card and keys.

Being awesome as they are, my team threw a going-away party for me, complete with food from Najar’s Place, about which I’d previously raved as having Oxford’s best falafels. I wasn’t even aware that Najar’s place did corporate catering… actually, it’s possible that they don’t and this was just a (very) special one-off.

Partry platters courtesy of Najar's Place along with drinks and cake.
Start from the left, work towards the right.

Following in the footsteps of recent team parties, they’d even gotten a suitably-printed cake with a picture of my face on it. Which meant that I could leave my former team with one final magic trick, the never-before-seen feat of eating my own head (albeit in icing form).

Dan on a cake
Of course, the first thing I was asked to do was to put a knife through my own neck.

As the alcohol started to work, I announced an activity I’d planned: over the weeks prior I’d worked to complete but not cash-in reward cards at many of my favourite Oxford eateries and cafes, and so I was now carrying a number of tokens for free burritos, coffees, ice creams, smoothies, pasta and more. Given that I now expect to spend much less of my time in the city centre I’d decided to give these away to people who were able to answer challenge questions presented – where else? – on our digital signage simulator.

"Play Your Shards Right" on the big screen.
Among the games was Play Your Shards Right, a game of “higher/lower” played across London’s skyscrapers.

I also received some wonderful going-away gifts, along with cards in which a few colleagues had replicated my long tradition of drawing cartoon animals in other people’s cards, by providing me with a few in return.

Coworkers competing agressively for tiny prizes.
“Wait… all of these Javascript frameworks look like they’re named after Pokémon!”

Later, across the road at the Kings’ Arms and with even more drinks inside of me, I broke out the lyrics I’d half-written to a rap song about my time at the Bodleian. Because, as I said at the time, there’s nothing more-Oxford than a privileged white boy rapping about how much he’d loved his job at a library (video also available on QTube [with lyrics] and on Videopress).

It’s been an incredible 8½ years that I’ll always look back on with fondness. Don’t be strangers, guys!

Dan says goodbye to Bodleian colleagues
My department’s made far too much use out of that “Sorry you’re leaving” banner, this year. Here’s hoping they get a stabler, simpler time next year.
× × × × × ×

Reply to @ADumbGreyHam

Adam Graham tweeted:

@scatmandan I’ve just been in a meeting with with some people who were saying some very positive things about the legacy of work your dad (I think) did with buses in the North East

That seems likely. Conversely: if people are still talking about my work 7½ years after I die it’ll probably be to say “who wrote this bit of legacy code this way and what were they thinking?”

CC @TASPartnership @bornvulcan @TheGodzillaGirl

Shredding eight years of old payslips

I’ve just cleared out my desk at the Bodleian in anticipation of my imminent departure and discovered that I’ve managed to successfully keep not only my P60s but also every payslip I’ve ever received in the 8½ years I’ve worked there. At a stretch, I might just end up requiring those for the current tax year but I can’t conceive of any reason I’ll ever need the preceding hundred or so of them, so the five year-old and I shredded them all.

If you’ve ever wanted to watch five solid minutes of cross-cut shredding shot from an awkwardly placed mobile phone camera, this is the video for you. Everybody else can move along.

Also available on QTube and on VideoPress.

Reply to: Indelible

Bryn wrote:

The surgery had happened at a weirdly transitional point in my life. Only a few days earlier I’d performed improv on stage for the first time (see “Yes And” and “Memory Lane“), I’d changed jobs and was contemplating another move. The scar from the surgery seemed to be part of that too, and I had an idle thought to have a tattoo done on the scar as a permanent reminder to myself not to let work swallow my life up again.

Every time I consider getting a tattoo, I’m stopped by the fact that I’m sufficiently indecisive about what I’d get and where. Somehow, a tattoo would represent a sort of irreversible permanence that I feel is difficult for me to commit to. (I fully accept that this may seem a strange sentiment to many, coming from a sterilised-without-breeding man – I didn’t say I was consistent!)

But to add personalisation to a scar, especially one with a personal meaning and message: that I can really get behind. Unfortunately my only likely-permanent scars don’t have any messages behind them more-significant than, for example, “don’t let Dan play with knives”. Is it possible to get a tattoo on top of an emotional scar instead?

Text Rendering Hates You

This article is a repost promoting content originally published elsewhere. See more things Dan's reposted.

Rendering text, how hard could it be? As it turns out, incredibly hard! To my knowledge, literally no system renders text “perfectly”. It’s all best-effort, although some efforts are more important than others.

Just so you have an idea for how a typical text-rendering pipeline works, here’s a quick sketch:

  1. Styling (parse markup, query system for fonts)
  2. Layout (break text into lines)
  3. Shaping (compute the glyphs in a line and their positions)
  4. Rasterization (rasterize needed glyphs into an atlas/cache)
  5. Composition (copy glyphs from the atlas to their desired positions)

Unfortunately, these steps aren’t as clean as they might seem.

Delightful dive into the variety of issues that face developers who have to implement text rendering. Turns out this is, and might always remain, an unsolved issue.

Time-Efficient Shuffling

Some years ago, a friend of mine told me about an interview they’d had for a junior programming position. Their interviewer was one of that particular breed who was attached to programming-test questions: if you’re in the field of computer science, you already know that these questions exist. In any case: my friend was asked to write pseudocode to shuffle a deck of cards: a classic programming problem that pretty much any first-year computer science undergraduate is likely to have considered, if not done.

Interview with paper visible.
Let’s play at writing software. Rather than a computer, we’ll use paper. But to make it sound techy, we’ll call it “pseudocode”.

There are lots of wrong ways to programmatically shuffle a deck of cards, such as the classic “swap the card in each position with the card in a randomly-selected position”, which results in biased results. In fact, the more that you think in terms of how humans shuffle cards, the less-likely you are to come up with a good answer!

Chart showing the probability bias for an incorrectly-implemented Fisher-Yates shuffle, for a 6-card deck.
If we shuffled a deck of six cards with this ‘broken’ algorithm, for example, we’d be more-likely to find the card that was originally in second place at the top of the deck than in any other position. This kind of thing REALLY matters if, for example, you’re running an online casino.

The simplest valid solution is to take a deck of cards and move each card, choosing each at random, into a fresh deck (you can do this as a human, if you like, but it takes a while)… and that’s exactly what my friend suggested.

The interviewer was ready for this answer, though, and asked my friend if they could think of a “more-efficient” way to do the shuffle. And this is where my friend had a brain fart and couldn’t think of one. That’s not a big problem in the real world: so long as you can conceive that there exists a more-efficient shuffle, know what to search for, and can comprehend the explanation you get, then you can still be a perfectly awesome programmer. Demanding that people already know the answer to problems in an interview setting doesn’t actually tell you anything about their qualities as a programmer, only how well they can memorise answers to stock interview questions (this interviewer should have stopped this line of inquiry one question sooner).

Riffle shuffling
Writing a program to shuffle a deck takes longer than just shuffling it, but that’s hardly the point, is it?

The interviewer was probably looking for an explanation of the modern form of the Fisher-Yates shuffle algorithm, which does the same thing as my friend suggested but without needing to start a “separate” deck: here’s a video demonstrating it. When they asked for greater efficiency, the interviewer was probably looking for a more memory-efficient solution. But that’s not what they said, and it’s certainly not the only way to measure efficiency.

When people ask ineffective interview questions, it annoys me a little. When people ask ineffective interview questions and phrase them ambiguously to boot, that’s just makes me want to contrive a deliberately-awkward answer.

So: another way to answer the shuffling efficiency question would be to optimise for time-efficiency. If, like my friend, you get a question about improving the efficiency of a shuffling algorithm and they don’t specify what kind of efficiency (and you’re feeling sarcastic), you’re likely to borrow either of the following algorithms. You won’t find them any computer science textbook!

Complexity/time-efficiency optimised shuffling

  1. Precompute and store an array of all 52! permutations of a deck of cards. I think you can store a permutation in no more than 226 bits, so I calculate that 2.3 quattuordecillion yottabytes would be plenty sufficient to store such an array. That’s about 25 sexdecillion times more data than is believed to exist on the Web, so you’re going to need to upgrade your hard drive.
  2. To shuffle a deck, simply select a random number x such that 0 <= x < 52! and retrieve the deck stored at that location.

This converts the O(n) problem that is Fisher-Yates to an O(1) problem, an entire complexity class of improvement. Sure, you need storage space valued at a few hundred orders of magnitude greater than the world GDP, but if you didn’t specify cost-efficiency, then that’s not what you get.

Stack of shuffled cards
If you’ve got a thousand galaxies worth of free space you can just fill them with actual decks of cards – one for each permutation – and physically pick one at random. That sounds convenient, right?

You’re also going to need a really, really good PRNG to ensure that the 226-bit binary number you generate has sufficient entropy. You could always use a real physical deck of cards to seed it, Solitaire/Pontifex-style, and go full meta, but I worry that doing so might cause this particular simulation of the Universe to implode, sooo… do it at your own risk?

Perhaps we can do one better, if we’re willing to be a little sillier…

(Everett interpretation) Quantum optimised shuffling

Quantum ungulations
If you live in a universe in which quantum optimised shuffling isn’t possible, the technique below can be adapted to create a universe in which it is.

Assuming the many-worlds interpretation of quantum mechanics is applicable to reality, there’s a yet-more-efficient way to shuffle a deck of cards, inspired by the excellent (and hilarious) quantum bogosort algorithm:

  1. Create a superposition of all possible states of a deck of cards. This divides the universe into 52! universes; however, the division has no cost, as it happens constantly anyway.
  2. Collapse the waveform by observing your shuffled deck of cards.

The unneeded universes can be destroyed or retained as you see fit.

Let me know if you manage to implement either of these.

× × × × ×