Notes on XKCD's “Pixels”
chromakode.com
chromakode.com
This is an art project. Randal can set his own deadlines. There is no reason to ask someone to work crazy sleep-deprived hours for it, even if they volunteer. He's doing the same thing a bad boss would do, with less justification than most.
Writing it up afterwords sets a bad example for other impressionable young hackers who look up to these guys and will set themselves up for being exploited when they go to work because they think it's expected of them.
I couldn't finish the article. I'm sure there are good hacks in it. But we have to stop promoting bad behavior. If we can't do this ourselves for art, what about when there's real pressure?
Update: to clarify, there's nothing unusual about this and there far worse examples all the time. It's just a bit striking since Randal's image is of a somewhat otherworldly idealist.
Backpedal #2: to avoid being overly dramatic, let me clarify that being ashamed of someone else's behavior implies that you feel some responsibility for their behavior, which doesn't make sense in this case. Also, not finishing an article is, to be honest, not all that unusual.
Perhaps they only came up with the idea 3 days before Colbert? Perhaps Colbert asked (last minute) for a cool, new, live demo? Perhaps they were just being opportunistic, and this turned into one of those unforeseen firedrill moments? Externalities being what they are, they did a bang up job of pulling it off in time.
Also I'm not assuming malice. However, I wouldn't congratulate them for pulling it off; this is itself encouraging the wrong thing.
Ironically enough, they get this principle when it comes to other people's misconceptions about television. Very few people have any idea how much time and effort goes in to film and broadcast production. Producers are constantly fielding requests from clients, executives, and others with limited technical skill who say things like "Can't you just..." or "I don't see why we don't just..." or "How about just...?".
You get the picture.
I didn't anticipate this response. You're absolutely right about taking responsibility for the example we set of project management. I personally hate pulling all-nighters, and did not intend to legitimize the unhealthy "larval stage" hacker culture archetype (re: http://modelviewculture.com/pieces/the-open-source-identity-...).
This was a project with crazy bounds that we all consented to sprint towards. We are a team that has worked on many projects together across years, and are wholly comfortable with each others' constraints and limits.
It's usually the case for our projects that inspiration arrives at the most inconvenient time. For this one in particular, the idea came up 3 days before launch. We had several discussions during those days where we could have pulled the plug on this due to scheduling concerns. Each of us decided to push forward because we wanted it to exist.
It seems like the basic idea could be used for anything. There's nothing about zooming that makes it particularly appropriate for a book launch; a simple comic would do to mark the occasion and Pixels could have launched later. So the use of this idea for this project is a choice and the deadline is entirely self-imposed.
(Also I do enjoy the occasional hackathon, though I won't stay up late for it. I'll stay up late for entirely different and probably just as bad reasons.)
I have to bust ass once in a while to hit a deadline, but I always consider that a failure of my project planning. I get psyched about hitting a deadline without a single hour of overtime from any member of the team - to me that is something to brag about.
It's easy to expect more out of artists. Good artists make finished works look easy, even when it could never have been. It's much harder to appreciate the insane number of constraints that come baked into every single project whose only judgment and exposure comes in that 5 second time between when you first see it and when you get bored of it and click to the next thing in your feed.
But of course they never asked me. Any pressure they feel comes from the imaginary audience in their heads.
How much this resembles the actual audience (which, admittedly, can be harsh, fickle and are easily distracted - guilty!) is hard to say.
Taking a broader perspective, there are of course far worse problems in the world, the sort of thing the Fair Trade advocates worry about. Demonstrated demand for consumer goods is quite a force, in aggregate. Who wants to be a millionare?
Leonard Bernstein
It comes down to cheap, fast, and good. You can pick any two you like. If you're lucky, you'll get both, so you better be sure to note which matters most, because honestly, that's what's going to drive everything else. This is especially true of non-routine work, like much of art in general. Creative businesses that make a priority of hitting deadlines must either have very deep pockets, or enough latitude to ship sub-par product.
A great example of this is the Clock of the Long Now, which is being designed and built by Danny Hillis. This is a clock that is designed to run for 10,000 years. Quality is job one. Right now, they have about $43 million to work with (supplied by Jeff Bezos). When people ask when it will be ready, they say "we don't know." Pressed for a ballpark figure, the answer is simple: "No."
> My plane landed in SFO a half hour before our rough goal of launching midnight EST. While my cab was hurtling me home at 80mph, the folks at xkcd were putting the final touches on the art and server code. We cobbled it all together over IRC and went live at around 1:30am EST.
We're in Daylight Saving time. EDT. Or just "ET" or "Eastern", which are good year-round. (Or "America/New_York" if you're feeling pedantic.)¹
Unless of course you just don't observe Daylight saving time, and you were actually working in EST, in which case, respect.
> As you scroll deeper, pos becomes a long array of the nested pixels you've entered, like [[305, 222], [234, 674], [133, 733], ...]
Doesn't this mean that crossing a panel boundary means we need to pop up the stack? And, if I'm on the bottom-most panel of a bottom-most panel and I cross that boundary, mean two things off the stack? And if I'm evil, and keep zooming in on that bottom of the bottom of the […] bottom of the bottom of the bottom of a pixel, and then move across that boundary:
Uncaught RangeError: Maximum call stack size exceeded zoom.js:529
TurtlesDown.render zoom.js:529
TurtlesDown.render zoom.js:586
TurtlesDown.render zoom.js:576
TurtlesDown.render zoom.js:586
TurtlesDown.render zoom.js:576
TurtlesDown.render zoom.js:586
TurtlesDown.render zoom.js:576
TurtlesDown.render zoom.js:586
TurtlesDown.render zoom.js:576
[… (it's turtles all the way down!) …]
(Some bugs to be expected given the development timescale, of course. :-) And, to be fair, when I thought about "how would you implement this?", yours was the solution I had in mind. Tough edge case here though; you note the problem with addition and carry in your post too, and I wonder if I just ran into a corner case of that.)I did greatly enjoy this comic. Especially once I determined that it gave different panels depending on where you zoomed in.
> browsers were still too slow to draw all 360,000 individual pixel panels via Canvas
Would mipmapping help any here?
¹At least it isn't carved in stone: http://thumbs.dreamstime.com/z/clock-grand-central-station-n....
Point taken. :)
>Doesn't this mean that crossing a panel boundary means we need to pop up the stack?
Aha! Yes, now that I'm looking closely, I think that is possible, since the logic that handles crossing outside of the current "pos" pixel boundary is re-entrant.
However, I note that the line numbers in your trace are alternating. This looks suspiciously like an oscillation between the "need to zoom out and find a new pos" and "need to zoom in and set pos" states. It just occurred to me that since these conditionals compare floating point positions directly, it might be possible for a precision error to cause such a loop.
This exercise has made me realize a benefit to the mess of carrying code that happens further down, when wrapping around the 4 panels that are actively being displayed. That code will in principle operate past the point where a recursive implementation will stack trace, FWIW. According to StackOverflow [1], that'll be around 25K/50K nestings in Chrome/Firefox.
>Would mipmapping help any here?
Yep! The current implementation only scales an image once per render, caching the resultant image data and reusing it for all of the other draws [2]. Images are also pre-scaled to various intervals (for example [3]), though that was to improve image scaling rather than performance. Actually, while working on the mipmapping implementation, I found evidence that the canvas putImageData call (for image buffers) is a good deal slower than drawIamge [4]. It looks like where I left things, I'm still using putImageData. Tomorrow, I'll try caching the actual canvas elements and see if that gives the predicted huge performance boost.
[1]: http://stackoverflow.com/a/7828803
[2]: https://github.com/chromakode/xkcd-pixels/blob/master/zoom.j...
Um... he interned at NASA and worked for them for six months after graduating as an independent roboticist contractor. He's been working on xkcd professionally, full time, for 8 years since then.
Plenty of time to learn javascript.
The post I was responding to suggested "Since he is a rocket scientist, it is unlikely that he would be able to code the frontend, and would require help", which is absurd. Given Mr. Munroes obvious interest in programming and computers, (see comics:
https://airbrake.io/blog/internet/best-programming-xkcd-comi...
) it was entirely reasonable to believe that he had picked up enough experience to code the javascript frontends.
There is simply no reason to pigeon hole the man as a "Rocket Scientist", especially given the fact he was a roboticist previously (which, shockingly enough, tends to involve programming). He has shown a wide variety of interests, and if he demonstrated an ability to code frontend javascript, I would not be surprised.
Is there an xkcd team as such? It would be good to read a bit more about them, if there's any info available.
From the article: "For this project, I chose to use vanilla JavaScript with no external dependencies or libraries. In general, we strive to keep the dependency count and build process minimal for these projects, since keeping the complexity level low gives them a better chance of aging well in the archives."
Still, I think from a UX perspective the slightly springy behaviour of Seadragon is much nicer than the algorithmic rigidity of things like Leaflet or Google Maps.
http://www.secrettechnology.com/sydney/
looking through wayback archives it seems siberia was posted around july of 2011
it is a brilliant idea, very ripe for self discovery, and hopefully randall and chomakode came to it in their own way because when i saw the comic i immediately went into the webs looking for a shout out to jason nelson..
i was waiting for this inevitable post and link on HN for a platform to expose more people to the weird and wonderful art of jason nelson (ii)
..
i was introduced to nelson through his gamegamegame(iii), a wild platformer that could best be described how futurama describes beck: 'transcends genres even as he re-invents them';
(i) http://en.wikipedia.org/wiki/Jason_Nelson
(ii) http://www.secrettechnology.com/ (warning autostarts noise)
(iii) http://www.secrettechnology.com/gamegame/gamegame.html
Regarding performance, did anyone else have absolutely awful frame rates when zooming? On my beefy Macbook Pro in Chrome it would drop to two or three frames per second.
Edit: and on my Windows PC in Chrome, which was fairly beefy three years ago, it's more like a frame every few seconds.
Chromium 38 on Linux on both.
> The Indian before mentioned [...], saying that the world was supported by a great elephant, was asked what the elephant rested on; to which his answer was—a great tortoise: but being again pressed to know what gave support to the broad-backed tortoise, replied—SOMETHING, HE KNEW NOT WHAT
-- [0] http://www.gutenberg.org/cache/epub/10615/pg10615.txt, 2nd book, chapter XXIII, paragraph 2
A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described how the earth orbits around the sun and how the sun, in turn, orbits around the center of a vast collection of stars called our galaxy. At the end of the lecture, a little old lady at the back of the room got up and said: "What you have told us is rubbish. The world is really a flat plate supported on the back of a giant tortoise." The scientist gave a superior smile before replying, "What is the tortoise standing on?" "You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
I am curious, however, about this comment: "We anticipated a higher proportion of the Colbert Report referrals would be using IE." What was the rationale behind this? Maybe I'm just wrong in my assumptions about the Colbert audience, but I'd definitely have expected a much more mobile-heavy (and non-IE) group.
So, at the time you're running your evening TV advertisement or PR spot it's 80% mobile, not the 25% the stats tell you.
Nevertheless, you're correct, and watching the peaks and valleys and plateaus between the different platforms is incredibly interesting to analyze.