Archive for June, 2010

links for 2010-06-29

June 30, 2010
Advertisements

links for 2010-06-28

June 29, 2010

links for 2010-06-27

June 28, 2010

links for 2010-06-25

June 26, 2010
  • <blockquote>
    <h3What is this?</h3>
    This map shows all trains (yellow pins) on the London Underground network in approximately real time (screenshot). Click the stations for a local map of that station. I have a (per-station) National Rail version, and a bookmarkable train times planner.
    <h3>How does it work?</h3>
    Live departure data is fetched from the TfL API, and then it does a bit of maths and magic. It’s surprisingly okay, given this was done in only a few hours at Science Hackday on 19/20th June 2010, and the many naming/location issues encountered, some unresolved. A small number of stations are misplaced or missing; occasional trains behave oddly; some H&C and Circle stations are missing in the TfL feed.
    <h3>Who did this?</h3>
    Matthew Somerville (with helpful hinderances from Frances Berriman and James Aylett). Station icon by Tim Diggins. <a href="http://github.com/dracos/underground-live-map">Source code</a>.
  • <blockquote>
    <p>
    And while Flusberg said that this might never be a product for someone like my father — my benchmark of an average suburban American and aging Luddite — I think I disagree. (For reference, Mr. Tweed just got an email account less than two years ago.)
    </p><p>
    I can envision the old man getting an energy audit because he wants to save some money and opting for a system like this. And now that he knows how to get online, I could see him walking around the house trying to shut down phantom power, or being grateful for an alert when something goes wrong with the pool pump or the basement freezer.
    </p><p>
    As for the installation for the mass market? Keep an eye on the Geek Squad.
    </p>
    </blockquote>

links for 2010-06-24

June 25, 2010

links for 2010-06-23

June 24, 2010

links for 2010-06-19

June 20, 2010
  • <h2>Beware anonymous functions</h2>
    <p>
    Anonymous functions bound everywhere are a pain. They're difficult to debug, maintain, test, or reuse. Instead, use an object literal to organize and name your handlers and callbacks.
    </p>
    <pre>
    // BAD
    $(document).ready(function() {
    $('#magic').click(function(e) {
    $('#yayeffects').slideUp(function() {
    // …
    });
    });

    $('#happiness').load(url + ' #unicorns', function() {
    // …
    });
    });

    // BETTER
    var PI = {
    onReady : function() {
    $('#magic').click(PI.candyMtn);
    $('#happiness').load(PI.url + ' #unicorns', PI.unicornCb);
    },

    candyMtn : function(e) {
    $('#yayeffects').slideUp(PI.slideCb);
    },

    slideCb : function() { … },

    unicornCb : function() { … }
    };

    $(document).ready(PI.onReady);
    </pre>

links for 2010-06-18

June 19, 2010

links for 2010-06-17

June 18, 2010

links for 2010-06-16

June 17, 2010