Welcome

Hi! Most people come here for the tiffin recipe. I can't blame them.

LiveJournal Entries

Best viewed from the blog itself, since Livejournal strips out a lot of CSS.

  • April

    Wed, 02 May 2012 19:14:52 GMT

    Marmite sitting in the ivyApril showers! It's weird to think at the start of the month it was bright and sunny. I baby-sat my parents' rabbit, Marmite, who turned out to be pretty cute once he decided to nap at my feet.

    duck racing!For Easter I visited my parents, who had just returned from Bruges along with several chocolate ducks. Naturally the thing to do was duck racing, with chocolate eggs as the prize.

    Emily had brought back a whole sack of chocolate mini-eggs from our visit to the Netherlands, and she hid a share of them around my house, so I could have an Easter egg hunt. I'm still finding them every now and then, today I found one in my box of tissues!

    A couple of weekends ago I visited Emily's mum's house in the middle of the countryside in Hampshire, which was awesome. Emily's mum made me feel very welcome, the country air was so relaxing, and I'd forgotten just how many stars you can see when not stifled by a city.

    Lastly, my house is for sale! I'm looking to move somewhere closer to London to mitigate the increased commute time from when my work moved offices, plus I'd like a second bedroom to use as a study for when I work from home.

    This entry was originally posted at http://flexo.dreamwidth.org/6036.html.


  • March

    Sat, 31 Mar 2012 16:18:21 GMT

    It's that time of the month again!

    Considering that last month I was writing about making snowmen^H^H^H Daleks, it seems very odd that I've been out sunbathing in Russell Square Gardens most days this week. The Gulf Stream hasn't shut off yet, then.

    Netherlands

    At the start of the month Emily and I went to Amsterdam, as it's somewhere we both wanted to visit in order to see our respective friends. On Friday evening after arriving, we met up with Emily's friend Stu, who took us out to an Ethiopian restaurant somewhere in Amsterdam - I forget where exactly because we were too busy running after trams whose stops aren't quite as close together as we'd hoped. Ethiopian food involves shared platters of curried portions spread across a base of floury pancakes. Finger food! It was rather tasty.

    On Saturday I went to Leiden to meet up with fuzzie and Bertram while Emily spent the day with Stu. fuzzie, Bertram and I went to Noordwijk's sand dunes, which are just about the only hills I've ever seen in Holland. Emily joined up with us after we got back to Leiden station, and we went out for dinner at an American-style restaurant, where I had a very tasty and filling jambalaya and everyone else's food looked good too.

    me standing outside the Amsterdam Art hotel

    We had Sunday to ourselves and took the opportunity to explore Amsterdam, but first stopped off at the Sex Museum, which was ... interesting. And slightly scary. We ended up in Leidseplein around lunchtime, and had lunch in the excellent Bagels and Beans before going to a flower market in the afternoon and crashing at our hotel - the Westcord Art Hotel - for a little while before going out for dinner at The Pancake Bakery, which I couldn't recommend enough. I had a savoury pancake for mains, a sweet pancake for dessert, and some poffertjes to finish it off, because poffertjes!

    We flew back into London City Airport on Monday, which was slightly unnerving as the plane just flies along the Thames and gets closer and closer to the water until you think you're about to splash down, but the runway appears out of nowhere just before you do. I think I spotted the M25 over Essex before we got too low down, but I don't know Essex's geography well enough to say for sure.

    So all in all we had a fantastic time, got to see our friends and do some touristy things, and ate incredibly well to top it off!



    On the topic of good food, we cooked the ratatouille from Hugh Fearnley-Whittingstall's Veg Everyday cookbook after looking through it for ideas. Really good! It's jumped immediately onto my list of favourite meals.

    Canterbury

    Last Saturday I took Emily to Canterbury to show off the city and show her the place I'd gone to University in. After exploring the old town high street, we walked along the western part of my old cycle route, over hand-operated level crossing and through a large orchard. We were going to turn around when we got to the footbridge over the Great Stour river on Tonford Lane, as I always used to do, but it turned out that Canterbury City Council had conveniently built us a footpath back to Canterbury along the Stour called the Great Stour Way, which took us back to Westgate Gardens via the embankment of a closed (and removed) railway track.

    Westgate GardensWestgateCanterbury Cathedral

    After getting back to the City centre, we went into Siesta (still awesome) and walked around and through the Cathedral as light faded, before having a curry at Kashmir Tandoori (not how I remembered it) and heading back to London/Dartford on the high speed rail (St Pancras to the Dartford bridge in 15 minutes, oh how I wish my commute was that fast, but I'd have to backtrack to Gravesend to make use of it).

    It was all a wonderful day, and we'll definitely go back. Emily loved the sound of camping in Blean Woods (I will update the link to the photos in that post soon, I hope)(Holy crap, I've barely changed) so there might be hammocking forthcoming in the summer.

    And finally...

    femputer's old PSU, blackenedI had to perform surgery on femputer, my plug computer which hosts my website, irssi and bitlbee sessions, and a few other things, after the PSU decided to go pffffut the week before last. My website was offline for a while but it doesn't seem to have affected my search engine rankings too much. I still get beaten by a dozen pages about the incidental Scrubs character, bah.

    The Doctor on Metebelis ThreeI also finished watching all the (released as of February) DVDs from the Third Doctor Doctor Who era last month. Thanks to a delay in the delivery, it just missed out being in last month's post. There are so many stories I liked in these seasons, compared to the rather lacking stories of the Second Doctor's era. Here are my favourites:

    * Spearhead from Space - The Third Doctor is introduced after being forced to regenerate and being exiled to Earth at the end of events in The War Games
    * Inferno - stonking end-of season finale featuring alternate timelines for the first time. It was really the first time Doctor Who actually had a story that messed around with Time rather than using the TARDIS merely as a vehicle to the next story.
    * Day of the Daleks - another time-travelling episode where soldiers fighting a future Dalek occupation of Earth go back in time to try to the present day to try to stop the war before it starts - and this was twelve years before The Terminator came out! The DVD also has a special edition version where they improved the visual effects, filmed more Daleks, and cleaned up some sloppy direction.
    * The Mutants - not a great storyline but the first believable monster costume I'd seen, and some pioneering visual effects.
    * The Three Doctors - featuring the last on-screen appearance of William Hartnell as the First Doctor, the Time Lords, and a whole lot of other continuity-breaking mishaps in the Tenth Anniversary story of Doctor Who.
    * Green Death - The Doctor, finally getting his TARDIS fixed, finally goes to what he had described as the idyllic world of Metebelis Three, while Jo Grant goes off eco-cruisading in Wales. This one's also known as The One With the Giant Larvae, makes a Green message well ahead of its time, and sees the first time since Susan leaves the TARDIS in the First Doctor era that the Doctor is heavily affected by a companion leaving his company.
    * The Time Warrior - The introduction of both Sarah Jane, the Sontarans, and the name of the Doctor's homeworld, and the first time the series went significantly back in time for quite some time.
    * Planet of the Spiders - the Third Doctor's last appearance, which tidies up some various loose ends, and has a slightly different feel to it than most Third Doctor serials. That said, it also features an (amusingly utterly pointless) pursuit of a bad guy featuring just about every type of vehicle imaginable, which is very Jon Pertwee. It's also the first time that the term 'regeneration' is coined.

    Honourable mentions to The Silurians (very similar storyline to their reintroduction in Matt Smith's first year), Terror of the Autons (The Master's debut), The Dæmons (which wasn't released yet but is by a lot of accounts the Third Doctor's best story), and Invasion of the Dinosaurs (the only time we've had dinosaurs in Doctor Who to my knowledge).

    I shall be starting on the Fourth Doctor stuff soon! I can't see Tom Baker displacing Jon Pertwee as my favourite classic Doctor, but you never know.

    This entry was originally posted at http://flexo.dreamwidth.org/5805.html.


  • traceback.extract_stack(): my new favourite python function

    Mon, 26 Mar 2012 11:32:11 GMT

    Ah, SQLAlchemy, my old nemesis. I'm still stuck using SQLAlchemy 0.4.x/0.5.x at work, so I don't know if this has changed in later releases, but I hope so. Whereas things in Python like file objects will automatically close themselves when they go out of scope, something like this will leave hanging connections open:

        def __init__(self, dburi, **sa_kw):
            self.engine = create_engine(dburi, **sa_kw)
        ...
        def my_thing(self, id_):
            row = self.engine.execute(
                my_table.select().where(my_table.c.id == id_)
            ).fetchone()
            # do stuff with row
            return
    


    Instead, my_thing() needs to look like this:

        def my_thing(self, id_):
            conn = self.engine.connect()
            row = conn.execute(
                my_table.select().where(my_table.c.id == id_)
            ).fetchone()
            # do stuff with row
            conn.close()
            return
    


    I'm not sure why the engine should even have a execute() function if it's going to end users up in a position where they're leaking connections, but there we go.

    Now, this is annoying to debug because rather than getting an error immediately, you find out about it sometime in the future when the QueuePool queue exhausts all of its available connections and raises an error on some future unfortunate self.engine.execute().

    Fortunately I can edit SQLAlchemy's code pretty easily, but throwing an error (my usual way of figuring out where code is misbehaving) when connections are established doesn't work due to the queue semantics above. After that, traceback.print_stack() is pretty useful to hack in, but the stacks end up huge through SQLAlchemy's internals, and I had a lot of database reconnections going on with all those engine.execute()s around.

    So I decided to write something that would tell me where in my code the connections were established and closed to see where my leak was. The following code shows a self-contained file that demonstrates what's going on:

    # tb.py:
    import traceback
    def debug():
        stack = traceback.extract_stack()
        items = []
        for item in stack:
            if 'tb.py' in item[0]:
                items.append(item)
        print ''.join(traceback.format_list(items))
    def dosomething():
        debug()
    if __name__ == '__main__':
        dosomething()
    


    Essentially, I'm creating a stack trace that only shows the lines of the stack that I'm interested in.

    The relevant part of SQLAlchemy to add these into are in pool.py's QueuePool methods do_get() and do_return_conn().

    With this extra output it was relatively easy to spot which lines of my code were checking out more connections than they were putting back, and I found the bug quickly after that.

    Anyway, I thought it was a neat hack and I'll probably end up using it again sometime, so in the blog it goes.

    Edit: It seems that engine.execute(...).fetchall() does actually close the connection, whereas fetchone() doesn't (SQLA 0.5.8). Consistent!

    This entry was originally posted at http://flexo.dreamwidth.org/5560.html.


Identi.ca Feed

These dents are also imported into Twitter.

  • Listening to the radio for once. Too many songs can be described by "meeeeeeeeeeeeeeeeeeeeeeeeee*teen-angst*eeeeeeeeeeeeeeeeh"

    about 7 hours ago from BitlBee

  • I'm 10,000 days old today!

    about 5 days ago from BitlBee

  • I love that moment of clarity when you finally understand a coding concept. It's like seeing the Matrix. Thanks, fuzzie!

    about 12 days ago from BitlBee

  • Just watched (by coincidence) Genesis o/t Daleks and Journey's End consecutively. Weird having Davros referring to the former in the latter.

    about 16 days ago from BitlBee

  • My 3-step guide to hating GUI builders: 1. Click and drag, so easy! 2. Make things pretty! 3. How the fuck do I reference anything in code?!

    about 24 days ago from BitlBee

  • grrr, got to the sstation five mins early and then my train's delayed by 17 and counting... #southeasternfail

    about 27 days ago from BitlBee

  • Found a plugin that makes Xcode's editing area vim-like: https://github.com/JugglerShu/XVim . Productivity: doubled.

    about 37 days ago from BitlBee

  • Trying and failing to get a non-Xcode project to compile on new Mac with OS X Lion. No real gcc! Linking fails. Apple must hate developers.

    about 40 days ago from BitlBee

  • Happy Easter all! Forgot to link to March post;here is: http://flexo.dreamwidth.org/5805.html http://nickmurdoch.livejournal.com/393977.html

    about 42 days ago from BitlBee

  • Well done to the Respect Party for winning the by-election. I don't know much about the party, but any increase in electoral choice is good.

    about 51 days ago from BitlBee