JavaScript closures can be kind of weird. The way a closure works within a loop is a fairly common "gotcha" because it doesn't work in the way that it intuitively feels like it should.
Take the following block of code:
for (var i = 0; i < 5; i++) {
var button = document.createElement("button");
button.innerHTML = "Button #" + (i + 1);
button.onclick = function() {
alert("You clicked on " + button.innerHTML + "!");
};
document.body.appendChild(button);
document.body.appendChild(document.createElement('br'));
}
Roger Ebert has lost his battle with cancer and died today at age 70 - and I'm actually really saddened by this. I've followed his Twitter feed for ages - in fact, assuming Twitter lists people in reverse order that they were followed, he's the fourth person I followed on Twitter. (Minus any I've unfollowed, of course.) For a while he was pretty much the only reason I ever even bothered to check Twitter.
I've updated my Colossal Cave Adventure JavaScript port. It fixes a few bugs related to the Plover room, but probably more importantly, adds the ability to save the game. Save games are done by creating a new link that can be bookmarked. The URL can be loaded in order to restore the game to whatever state it was at when the game was saved.
Oh, right, I did say I was going to try and create a CherryPy-based webapp front end. So here is a very quick and dirty implementation that provides some very basic control over the TV. Specifically, basic volume control (up and down), and the various input controls. Which is what I wanted out of it.
I know I'm not the only one this is happening to, but it's still amusing:
Update: Just to be clear, this happened immediately after the iPhone 4S was announced (October 4th, 2011), but before Steve Jobs's death (October 5th, 2011). Note the time stamp.
After watching an episode of Kitchen Nightmares (sadly the US version, the UK version is better), I decided it might be time to try and get some takeout from one of the many local restaurants in my area.
Unfortunately, I am a bit of an "introvert," and therefore don't know anyone in my area and know next to no restaurants. So to Google Maps it is to look at local pizza places.
That finds me today's entry for "Restaurant Website Nightmares," Jimmy's Pizzeria.
This is only for blip.tv, but as of now, if you have NoScript set to block Facebook.net, you won't be able to view videos on blip.tv.
Thankfully, there is a feature in NoScript called "surrogate scripts" that allows NoScript to substitute a script stub to make things work on websites even if a given domain is blocked. So all I need to do it write a surrogate script to implement the functions it needs.
It turns out blip.tv doesn't work because a single function is missing: FB.Event.subscribe. So the entire surrogate script is:
Well, since I've actually got the thing working for the most part, try playing the Colossal Cave Adventure, ported to JavaScript! This (should) be the entire mostly-original game, playable right from in your browser.
Seriously, screw Theora. None of the tools work. Really, there's no reason to go beyond that at all. ffmpeg can't create working Ogg Theora files for no discernible reason. The makers of Theora don't provide an encoder, so it's not like you can just use theirs! The only working Theora tool appears to be ffmpeg2theora - which is completely useless because it can't be used to remux streams.
The one thing Xiph does provide, a tool for creating Ogg streams, doesn't create working streams. Making it completely useless as well.