Pong

I’ve recently been reimplementing retro arcade classic Pong to show off during a celebration of World Digital Preservation Day 2018 yesterday at the Bodleian Libraries. Here’s how that went down.

Frak on the BBC Micro, amongst the rest of a pile of computing nostalgia
The Bodleian has a specific remit for digital archiving… but sometimes they just like collecting stuff, too, I’m sure.

The team responsible for digital archiving had plans to spend World Digital Preservation Day running a stand in Blackwell Hall for some time before I got involved. They’d asked my department about using the Heritage Window – the Bodleian’s 15-screen video wall – to show a carousel of slides with relevant content over the course of the day. Or, they added, half-jokingly, “perhaps we could have Pong up there as it’ll be its 46th birthday?”

Parts of the Digital Archiving display table
Free reign to play about with the Heritage Window while smarter people talk to the public about digital archives? Sure, sign me up.

But I didn’t take it as a joke. I took it as a challenge.

Emulating Pong is pretty easy. Emulating Pong perfectly is pretty hard. Indeed, a lot of the challenge in the preservation of (especially digital) archives in general is in finding the best possible compromise in situations where perfect preservation is not possible. If these 8″ disks are degrading, is is acceptable to copy them onto a different medium? If this video file is unreadable in modern devices, is it acceptable to re-encode it in a contemporary format? These are the kinds of questions that digital preservation specialists have to ask themselves all the damn time.

Pong prototype with a SNES controller on my work PC
The JS Gamepad API lets your web browser talk to controller devices.

Emulating Pong in a way that would work on the Heritage Window but be true to the original raised all kinds of complications. (Original) Pong’s aspect ratio doesn’t fit nicely on a 16:9 widescreen, much less on a 27:80 ultrawide. Like most games of its era, the speed is tied to the clock rate of the processor. And of course, it should be controlled using a “dial”.

By the time I realised that there was no way that I could thoroughly replicate the experience of the original game, I decided to take a different track. Instead, I opted to reimplement Pong. A reimplementation could stay true to the idea of Pong but serve as a jumping-off point for discussion about how the experience of playing the game may be superficially “like Pong” but that this still wasn’t an example of digital preservation.

Two participants play Pong on the Heritage Window
Bip… boop… boop… bip… boop… bip…

Here’s the skinny:

  • A web page, displayed full-screen, contains both a <canvas> (for the game, sized appropriately for a 3 × 3 section of the video wall) and a <div> full of “slides” of static content to carousel alongside (filling a 2 × 3 section).
  • Javascript writes to the canvas, simulates the movement of the ball and paddles, and accepts input from the JS Gamepad API (which is awesome, by the way). If there’s only one player, a (tough! – only three people managed to beat it over the course of the day!) AI plays the other paddle.
  • A pair of SNES controllers adapted for use as USB controllers which I happened to own already.
My Javascript-powered web applications dominate the screens in Blackwell Hall.
Increasingly, the Bodleian’s spaces seem to be full of screens running Javascript applications I’ve written.

I felt that the day, event, and game were a success. A few dozen people played Pong and explored the other technology on display. Some got nostalgic about punch tape, huge floppy disks, and even mechanical calculators. Many more talked to the digital archives folks and I about the challenges and importance of digital archiving. And a good time was had by all.

I’ve open-sourced the entire thing with a super-permissive license so you can deploy it yourself (you know, on your ultrawide video wall) or adapt it as you see fit. Or if you’d just like to see it for yourself on your own computer, you can (but unless you’re using a 4K monitor you’ll probably need to use your browser’s mobile/responsive design simulator set to 3200 × 1080 to make it fit your screen). If you don’t have controllers attached, use W/S to control player 1 and the cursor keys for player 2 in a 2-player game.

Happy 46th birthday, Pong.

× × × × ×

Digest for November 2018

Summary

This month I reimplemented arcade classic Pong for its 46th birthday/World Digital Preservation Day (note 1, note 2) and set it up to play on a 15-screen videowall at the Weston Library in Oxford.

I also shared thoughts on why web developers should use CSS before adding JS, an explanation of the history of the North Sentinelese, and a tear-jerking Christmas short film.

All posts

Posts marked by an asterisk (*) are referenced by the summary above.

Articles

Notes

Reposts

Reposts marked with a dagger (†) include my comments or interpretation.

Videos

Note #11906

Playing Pong at the @bodleianlibs for #WDPD2018 #dp0c.

SNES controller Pong on the Heritage Window

×

Note #11897

The Prime Minister’s New Bill

With apologies to Hans Christian Andersen and thanks to JTA, both of whom deserve the credit for this more than I.

Once there lived a Prime Minister, and she loved to wear clothes made of strong international relations. One day a Swindler came to the Prime Minister and he promised that he could equip her with clothes of the best and strongest international relations. The Swindler claimed that all the people of the realm loved the new material he was producing, and the Prime Minister was delighted. She appointed a man to be in charge of ensuring that the Swindler did the job he had promised, and then she got back to her important work.

Her man soon reported to her a most alarming fact: the Swindler wasn’t at his loom. He was just sitting in the pub, sipping distinctly-English beers and seemingly making no progress on the bill at all. The Prime Minister was alarmed, but didn’t say anything: after all, she would soon be on the way to wearing clothes of the most beautiful and strong international relations. Besides, she’d been promised that all the people loved the new material that the Swindler worked with. So she appointed a second man and asked him to keep an eye on the Swindler, instead.

The second man checked in on the Swindler, and then reported that the Swindler still wasn’t weaving. The Prime Minister challenged the Swindler, but he claimed that he’d had car trouble while returning from France, where he’d been acquiring supplies, and would be getting back to his work soon. Clearly the second man had been too hasty in his judgement, so the Prime Minister appointed a third, who’d surely be less-judgemental as he saw the job through.

The third man checked on the Swindler, and discovered that while he was at his loom, he didn’t seem to be working at all and the loom stood bare. “The Prime Minister is concerned,” said the man “That no progress has been made whatsoever on her new clothes of strong international relations.”

“But progress has been made,” said the Swindler, “Can’t you see? I promised the Prime Minister that I would weave, and weave means weave! I am making clothes of the finest international relations; they’re made out of a Bill so lightweight and flimsy that it’s almost invisible. Only the cleverest of people can see it.” The Swindler reached into the loom and scooped his arm under the place where the fabric should appear, and raised it to show the third man.

“Ah yes,” said the third man, “I can see it.” But the third man could not see the Prime Minister’s new strong international relations.

Soon the clothes were ready, and the Swindler brought them to the Prime Minister to try on. She seemed confused at first: where were the clothes? But then the swindler explained: “These clothes are made of the finest international relations, in the fashion that is most-popular with the people,” he said. “Only the most-intelligent of people can see how beautiful, how elegant, how economically-viable they are!”

“Oh!” said the Prime Minister, and examined her new clothes. “I… um… see you’ve put a lot of work into stitching the hem: these borders will surely be well-protected.”

The Prime Minister tried on her new clothes, and observed that they were so light that she might as well have been wearing nothing at all. She wasn’t sure that she wanted to be seen wearing these new clothes because they made her feel naked and vulnerable, but she didn’t want people to think that she was stupid by confessing that she couldn’t see them. She resolved to show them to everybody she could find.

First she went to her Cabinet. “Do you like my beautiful new clothes?” she asked, “They’re made of strong international relations, and only the cleverest of people can see them!” And her Cabinet all nodded and said that yes, of course they liked them. But they could not see the beautiful new clothes. (It’s worth noting that half a dozen of them walked out at this point without saying a word.)

The Prime Minister went to see the Old People, and she said, “Do you like my beautiful new clothes? They’re made of strong international relations, but only clever people can see them.”

“Yes, they’re wonderful,” said the Old People. But they could not see the strong international relations.

The Prime Minister went to talk to the Emperor of America, and she said “Do you like my beautiful new clothes? They’re made of strong international relations, but only clever people can see them.”

The Emperor of America looked the Prime Minister up and down, and made a strange face that made the Prime Minister suspect that the Emperor didn’t even WANT to see the strong international relations, but he said: “Yes, they’re great clothes. The best clothes.” But the Emperor of America could not see the strong international relations.

The Prime Minister went to talk to the Racists, and she said “Do you like my beautiful new clothes? They’re made of strong international relations, but only clever people can see them.”

“Yes, they’re fantastic,” said the Racists, and they genuinely meant it, because they’d already persuaded themselves that because the new clothes had been made in their own country they were inherently superior to any clothes that might have been made by foreigners. But still, they had to admit, they couldn’t actually see any strong international relations nor did they want to.

The Prime Minister went to talk to the Under Thirties, and she said “Do you like my beautiful new clothes? They’re made of strong international relations, but only clever people can see them.”

The Under Thirties stared at Prime Minister, and then looked at each other, and then looked back at the Prime Minister. “You’re not WEARING any clothes,” they said. And the Prime Minister knew that they were right.

JUST LEARNED THERE ARE 16 OUNCES IN A POUND

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

by @innesmck

 

JUST LEARNED THERE ARE 16 OUNCES IN A POUND AND I AM FUCKING LIVID
SIXTEEN???
WHAT THE FUCK KIND OF NUMBER IS THAT

i have had no reason to actually look into imperial measurements until now and frankly i immediately regret it finding this out it makes some sense though because a pound is defined as being 7000 grains so that makes each ounce a nice round…

437.5 grains

and then, oh my word, oh my fucking actual god
GUESS HOW MANY POUNDS THERE ARE IN A STONE
you’ll never get it, it would be fucking impossible to guess this
THERE ARE FOURTEEN POUNDS IN A STONE!!!!!!!!!!!!!!!!!!
THAT’S A COMPLETELY DIFFERENT FUCKING NUMBER! FYI!!!!
THERE’S LITERALLY NO WAY TO KNOW HOW MANY OUNCES ARE IN A STONE!! NO-ONE CAN KNOW THIS “but innes you can just multiply up the fourteen by sixteen and you’ll g-“
NO
MATHS HAS CLEARLY ABANDONED US. NUMBERS MEAN NOTHING AT THIS POINT
WHAT THE FUCK KIND OF ANTIQUATED JOKE SYSTEM ARE PEOPLE WORKING WITH
my mum: wow count yourself lucky you only need to learn your 10 times tables, when i was a kid we had to go up to 12
me, a child: oh, for weights and stuff?
mum, a liar: sure
TURNS OUT NO-ONE ON THE PLANET IS TRAINED TO WORK WITH THESE FUCKED UP NUMBERS. THEY JUST MAKE STUFF UP. NO-ONE KNOWS HOW MUCH A POUND IS BECAUSE IF THEY’D EVER USED THIS BULLSHIT SYSTEM THERE WOULD BE RIOTS
and then how many ounces go in a cup?
WHICH FUCKING CUP, AMERICA

HOW DO YOU ALL OWN THE SAME SIZE OF CUP

WHO HAS A MONOPOLY ON THE ONE GOOD CUP SIZE

PRESUMABLY THIS IS JUST STRAIGHT UP BULLSHIT TOO TO COVER FOR THE FACT THAT NO-ONE KNOWS HOW MANY ANY QUANTITY OF ANYTHING IS

me: so, the recipe calls for 2 lbs 3 oz of flour, you got that?

you: uhhhh, sure. yeah. that’s like… 3 cups, probably. this is a great system.

AND THEN

THEN WE HIT THE BIG NUMBERS

PRESUMABLY. I ASSUME THAT’S THE ORDER WE’RE GOING IN
though judging from american dates IT IS KINDA HARD TO TELL
so what’s heavier, a ton of feathers or a ton of gold?
IT’S THE TON OF GOLD BECAUSE UNDER IMPERIAL MEASUREMENTS THESE ARE COMPLETELY FUCKING DIFFERENT SCALES
SEE ALSO: WOOL, COINS, MYSTERY ENGLISH ILLEGAL POUND, MISCELLANEOUS
THE ONE JOKE WHICH MAKES IT CLEAR THAT MASS IS A UNIVERSAL METHOD OF COMPARISON REGARDLESS OF MATERIAL HAS NO BEARING ON THE FUCKED UP BIZARRO WORLD OF YESTERDAY THAT IS THE IMPERIAL SYSTEM
I AM 30 YEARS OLD
I’VE GONE MY WHOLE FUCKING LIFE BELIEVING THE IMPERIAL SYSTEM WAS DIFFERENT, SURE, BUT I THOUGHT IT HAD AT LEAST SOME GROUNDING IN REALITY
but NO
I AM SO ANGRY RIGHT NOW
I CANT UNDERSTAND WHY YOU’VE DONE THIS TO ME

go on

say it

but if anyone tells me anything other than one hundred here I am tearing this entire fucking place to the ground

oh my sweet jesus

OF COURSE

OF FUCKING COURSE IT DOES

WHY WOULD WORDS MEAN ANYTHING ANY MORE

I HATE ALL OF THIS, AND I HATE ALL OF YOU FOR MAKING ME KNOW IT

THIS IS WHY IM NOT TAKING ANY OF YOUR SHIT WHEN YOU TRY AND TELL ME FAHRENHEIT IS A MORE LOGICAL SYSTEM
HOW MANY FAHRENHEIT ARE IN A CUP
i cant take this right now im going for a fucking walk
everyone is just saying terrible number conversions at me i hate this
no-one has even mentioned oxgangs though so you’re all fired
trying to get to sleep but all i can hear is your voices chanting “pints a pound the world around” over and over in my brain
Pints A Pound The World Around
i still don’t entirely know what it means but I am 100% fucking sure it’s not even true
im not sure anything is true any more
×

Note #11893

Some days my job… isn’t like other people’s jobs. Lately, I’ve been reimplementing Pong in Javascript for the @bodleianlibs’ video wall for an event on Thursday.

German chat app slacking on hashing fined €20k

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

by Richard Chirgwin (The Register)

German chat platform Knuddels.de (“Cuddles”) has been fined €20,000 for storing user passwords in plain text (no hash at all? Come on, people, it’s 2018).

The data of Knuddels users was copied and published by malefactors in July. In September, someone emailed the company warning them that user data had been published at Pastebin (only 8,000 members affected) and Mega.nz (a much bigger breach). The company duly notified its users and the Baden-Württemberg data protection authority.

Interesting stuff: this German region’s equivalent of the ICO applied a fine to this app for failing to hash passwords, describing them as personal information that was inadequately protected following their theft. That’s interesting because it sets a German, and to a lesser extend a European, precedent that plaintext passwords can be considered personal information and therefore allowing the (significant) weight of the GDPR to be applied to their misuse.

Warp and Weft?

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

Warp and Weft by Paul Robert Lloyd (paulrobertlloyd.com)

Earlier this month I had the good fortune to attend Material, a conference that explores the concept of the web as a material and all the intrinsic characteristics that entails. The variety of talks provided new perspectives on what it means to build for – and with – the web, and prompted me to …

What it means for something to be of the web has been discussed many times before. While the technical test can be reasonably objective – is it addressable, accessible and available – culturally it remains harder to judge. But I don’t know about you, I’ve found that certain websites feel more ‘webby’ than others.

Despite being nonspecific on the nature of the feeling he describes, Paul hits the nail on the head. Your favourite (non-Medium) blog or guru site almost certainly has that feel of being “of the web”. Your favourite API-less single-page app (with the growing “please use in Chrome” banner) almost certainly does not.

We Watched the Toy Story Porn Parody So You Don’t Have To [NSFW]

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

A wise man once said “To Infinity and Beyond”, Unfortunately there’s no way of knowing who that man was or in what context it was meant to be understood, so let us instead turn our attention to the Toy Story porn parody – Sex Toy Story The XXX Parody Part 1.

It says Part 1, but I searched and there’s no Part 2. Unless they’re doing like a Toy Story 3 thing where they wait like ten years for Andy to grow up and go off to college, in which case we will have to wait with bated breath for ten years for Part 2.

Sex Toy Story title card

We open on an unnamed woman played by Veruca James (Lesbian Anal Vampires, Emo Teen Fucks at Work) getting ready to masturbate. She does so the normal way we all do, by rubbing her clothed body.

“Does it exist?”, I asked, when the conversation drifted perilously close to this topic. Well of course it exists: Rule 34, duh. I was so glad that this article existed, to spare me from having to watch it to work out how much I didn’t want to watch it. Now all I have to do is scrub the idea of this article from my mind, which is hopefully easier than the retina-burning image of the film itself would have been.

Resulting link NSFW, obviously.

When to use CSS vs. JavaScript

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

CSS before JS #

My general rule of thumb is…

If something I want to do with JavaScript can be done with CSS instead, use CSS.

CSS parses and renders faster.

For things like animations, it more easily hooks into the browser’s refresh rate cycle to provide silky smooth animations (this can be done in JS, too, but CSS just makes it so damn easy).

And it fails gracefully.

A JavaScript error can bring all of the JS on a page to screeching halt. Mistype a CSS property or miss a semicolon? The browser just skips the property and moves on. Use an unsupported feature? Same thing.

This exactly! If you want progressive enhancement (and you should), performance, and the cleanest separation of behaviour and presentation, the pages you deliver to your users (regardless of what technology you use on your server) should consist of:

  • HTML, written in such a way that that they’re complete and comprehensible alone – from an information science perspective, your pages shouldn’t “need” any more than this (although it’s okay if they’re pretty ugly without any more)
  • CSS, adding design, theme, look-and-feel to your web page
  • Javascript, using progressive enhancement to add functionality in-the-browser (e.g. validation on the client-side in addition to the server side validation, for speed and ease of user experience) and, where absolutely necessary, to add functionality not possible any other way (e.g. if you’re looking to tap into the geolocation API, you’re going to need Javascript… but it’s still desirable to provide as much of the experience as possible without)

Developers failing to follow this principle is making the Web more fragile and harder to archive. It’s not hard to do things “right”: we just need to make sure that developers learn what “right” is and why it’s important.

Incidentally, I just some enhancements to the header of this site, including some CSS animations on the logo and menu (none of them necessary, but all useful) and some Javascript to help ensure that users of touch-capable devices have an easier time. Note that neither Javascript nor CSS are required to use this site; they just add value… just the way the Web ought to be (where possible).

Repost #11819

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

Disney's tweet: "#TheLionKing. 2019. ??"

Is it just me, or is this some fantastic fucking casting. For the first time perhaps ever, I feel confident that a remake of an already-good film has the potential to be awesome.

@RespectableLaw on North Sentinel Island

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

There’s been a lot of talk about the missionary killed by the natives of North Sentinel Island. They’re probably so aggressive because of this weirdo, Maurice Vidal Portman. So here’s a big thread about this creep and some facts from my decade-long obsession with the island.
The Sentinelese are often described as “uncontacted,” but this not strictly true. They had a very significant contact in 1880 with Commander Portman.
Portman, the black sheep third son of some minor noble, was assigned by the English Royal Navy to administer and pacify the Andaman Islands, a job he pursued from 1880-1900 with the full measure of his own perversity.
Portman was erotically obsessed with the Andamanese, and he indulged his passion for photography by kidnapping members of various tribes and posing them in mock-Greek homoerotic compositions.
During his 20 years in a sexualized heart of darkness, Portman measured and cataloged every inch of his prisoner’s bodies, with an obsessive focus on genitals.
Just imagine being a Neolithic person spending a few weeks in this guy’s rotating menagerie.
Portman spent most of his time in the greater Andaman Islands, but in 1880, he landed on North Sentinel. The natives fled, and his party ventured inland to find a settlement which had been abandoned in haste.
But they located an elderly couple and a few children they were able to abduct. The couple quickly died, likely from ailments to which they had no immunity.
The children spent a few weeks with Portman doing god knows what, after which he returned them to the island. Portman returned on a couple occasions, but the Sentinelese hid from him each time.
The story related by the children was certainly passed down among the 100 or so inhabitants of the island, and even today, Portman’s fatal kidnapping is just beyond a human lifetime.
So when the Indian government attempted contact with anthropologists in the 1960s and 70s, the Sentinelese were understandably hostile to outsiders. The Indian government soon gave up.
In 1981, a cargo ship named The Primrose ran aground on the coral reef surrounding North Sentinel. The crew radioed for assistance and settled in for a long wait. But in the morning they saw 50 men with bows on the beach, building makeshift boats.
The crew called for an emergency airlift and were evacuated, and not a moment too soon. Rough waves had thwarted the Sentinelese in their attempts to board, but the weather was clearing.
The ship and its cargo were left at the island, awaiting discovery by Neolithic eyes. Today you can still see the gutted remains on The Primrose on Google Earth.
Imagine climbing on board that ship. A completely alien vessel filled with alien things. Imagine seeing simple machines for the first time. A hinge. A latch. A wheel. Things that would instantly make sense in a satisfying way. Others would be so incomprehensible to avoid notice.
I have never been able to find out what cargo was on The Primrose in all my years of reading. There was about 100 tons of some sort of consumer product on board, and I’m curious what it was. But even absent the cargo, think about all the things that must have been on that ship.
In the 1990s, when anthropologists returned to the island to make new attempts at contact, they were met with a different attitude. Not friendly, exactly. But they were willing to accept gifts. Many would wade into the water with smiles to accept coconuts.

Here is a video of one of those encounters:

And in those videos, you can see that these pre-iron age people now had metal weapons, like the knife carried by this man. They had scavenged metal from the Primrose and cold-forged it into tools.
After collecting gifts for a few minutes, a few members of the tribe would approach and make menacing gestures, signaling that it was time for the outsiders to leave. They have never lost their desire for isolation, despite the gifts.
And they remained consistent in their intolerance against intruders. In 2006, two fishermen were killed after drifting into the island when their anchor detached while they were sleeping.
The Sentinelese are lucky they were so effective at preventing contact. The neighboring Jawara weren’t so fortunate. The tribe went from 9,000 to a couple hundred from lack of genetic immunity and only forestalled annihilation due to aggressive segregation. Their future is bleak.
Yet on North Sentinel, they’ve maintained a small community for 60,000 years which is by all indications happy. There is no way to integrate them into the modern world without wiping out nearly every member of their tribe.
And their aggressiveness is not the mark of savagery. It just that their conception of outsiders is mostly framed by some foot-faced English pervert who murdered some old people and did weird things to their kids. So let’s do them a favor and leave them alone.