[<< Previous 20 entries]

if I had a tee saying "Tech Goddess" I would wear it today

Steph's MacBook is affectionately known as the FrankenMac. It was built from the parts of 3 other MacBooks. The other night it started going into what seemed like swap death. Turned out to be catastrophic hard disk failure. Also, in what can only be described as a massive oversight, her laptop was not being Time Machined (whoops).

Anyway, after trying and failing to read the disk back using targeted disk mode plus dd_rescue on another Mac, I ended up swapping the disk into my Thinkpad last night and booting an Ubuntu LiveCD, ran dd_rescue and copied the hard disk image to an external hard drive. The filesystem is a little corrupted, and OSX can't read it... but Linux can! [Gotta say, this surprised me.]

I probably could have just booted the Mac itself with a LiveCD, but after targeted disk mode didn't work, I was worried it might be a logic board failure (let's just say Apple and I have a jaded history regarding logic boards). Also, I forgot for a bit that Macs can run Linux.

Since it did just seem to be a bad disk, I went and bought a new hard disk today, and have just successfully gotten the machine reinstalled and running again. The FrankenMac lives again!

So in summary, I am secretly brilliant, and Steph now has a 500GB USB harddisk to use with Time Machine.

P.S. something I forgot. This is for people who write articles for online Apple magazines: just because something is an Apple filesystem, they are still inodes, not iNodes.

P.P.S. I had to laugh, but I also forgot to give kudos to gnome-disk-utility which popped up a dialog during my dd_rescue, something like "One of your hard disks may be failing". Let's just say OS X loses here, being an OS that can't tell the difference between disk failure and filesystem failure.
Posted 9/2/10 14:30 — 4 comments

Monique Brumby and Rosie Burgess Trio

[info]socraticomatic was enthusing recently about Rosie Burgess Trio, so we went to see them for their single/video clip launch at the East Brunswick Club.

First up, they were supported by Monique Brumby, which is a gig I'd go and see by itself. Melbourne is so crazy, where you can have people who've won like awards and stuff as support acts.

Seriously though, Rosie Burgess Trio were fantastic. I had so much fun. I laughed so much from their banter, I wanted to cry. If I were a music magazine, I'd probably describe them as dynamic. They were lots of fun. Also, any band with songs about veganism is awesome. <3 <3 <3 (I think [info]socraticomatic's in love too).

Came away with 4 CDs (the new single was a freebie + one Monique Brumby + two Rosie Burgess). Both have new albums coming out too.

Finally, if you're in Sydney, the Rosie Burgess Trio is playing in Glebe next week. You should go.
Posted 29/1/10 00:21 — 5 comments

Plush Pizza: the most fabulous-est pizza in Melbourne?

Since going vegan, shop-bought pizza has been a bit of a hit-and-miss affair. There are lots of places that do vegetarian and vegan pizza, but none so far have been super great. Last night everything changed with a visit to Plush Pizza.

satay pizza and ben's special at plush pizza
why yes, that is a satay pizza

I wish we were going back there tonight. Trust me when I say I will be finding an excuse to return soon. The only downside is that it's a little tiny bit expensive, also that it's on the other side of town.

Saw this on the train to North Richmond today:

vegan


As always: recent food we've nommed.
Posted 24/1/10 16:36 — 12 comments

trams (hello infrastructure porn)

I am currently obsessed with this map of the Melbourne tramways circa 1948.

I've been looking at what got built as planned (e.g. the 86 and 96), what has since been abandoned (like this tramway down Brunswick Rd) and what never got built but I really, really wish it had (like replacing the cable tramway down Johnston St to Abbotsford). Also, that there used to be tramways down Johnston St, Rathdown St and the lower end of Lygon St serves to explain why they're all so frickin wide.

Seriously though, they should build that tram down Johnston St. That would be awesomesauce.
Posted 17/1/10 17:06 — 8 comments

tramtracker in maemo extras-devel [plus some crap about Optus]

Finally got a version of tramtracker (a client for tracking Melbourne trams) and python-suds uploaded to Maemo's extras-devel. There are a couple of issues, the known ones relate to this bug.

In my head I was having a race to see which would be done first: Optus sorting out my phone enough so that I could have data on it; or getting my app into the repository. Turns out, even though I didn't make a lot of effort, I still won.

In fairness, I probably could have gone today to get my phone recontracted (since I think it cut over last night), but the guy told me to come back on Saturday. I'm really hoping this is the end of about 4 hours of dealing with Optus over my phone. It started off by me looking at 3G data plans, and realising that if Stephanie and I both recontracted for 12 months, and put our numbers onto the same account, we could pay for both of our phones for the cost of her phone bill. Unfortunately my phone number was still in my Dad's name, and stuck in some antique account keeping system, so had to be migrated forwards (which took forever), then some nonsense about a credit check. [I'm sorry, but you gave the international student who's been here 4 months, and is not even a resident, a $60/month iPhone plan; why do I need to jump through so many hoops when I have a job and only want a $20/month plan where I bring my own damn phone?] Finally though both phones have been moved onto the same account, so I can go and recontract tomorrow (hopefully; I've been saying this for weeks).

That said, while Optus the company have basically been screwing me around. I do have to give kudos to the peoples at Optus Shop Brunswick, who have spent countless hours on the phone to Optus HQ trying to sort this out for me, even though they've so far earned absolutely no commission from me. I had thought about recontracting my phone at whatever store I happened to pass, but I think I should make sure these guys get the commission.
Posted 8/1/10 13:40 — 3 comments

chaos in the castle

Went with [info]socraticomatic to see Kaki King last night at the East Brunswick Club. It was pretty amazing (once the drummer calmed down a bit). She did a 90 minute set without a break, which was also pretty amazing. I'd seen videos of her playing, but it's pretty wild to watch her do it live (video of what I mean).

What I didn't realise is that she rarely seems to play her guitar with a canonical tuning, and she tells hilarious stories while she retunes her guitars. She also appears to be able to tune a guitar without any reference (as far as I could see). Also one of her band members was playing synthesiser trumpet, that's kinda cool.

~

The support act, Pikelet, was also really good. It was just one woman, a bunch of instruments, a loop machine and an effects rack; the sounds she was creating were brilliant though. She did a 45 minute set and it was really engaging. I ended up buying her album (though I'm yet to listen to it), I think a lot of other people did too.

Update: the album is good, but not as fun/awesome as watching her build the loops on stage.

~

I wish I'd taken a photo or two, but I didn't bring a camera. Let's just say that bit of the N900 promo video, where the dude takes a photo of a gig, does not result in an equally great photo; just a lot of hot carrier noise.
Posted 3/1/10 10:48 — 10 comments

fixing button theming with GtkBuilder

This is a bit icky. It would be neater if the Python bindings exposed hildon_gtk_widget_set_theme_size(), but not much. So, to fix the button theming if you've created your interface with GtkBuilder, it looks something like this:
# these aren't exported anywhere, copied from Maemo GTK+
HILDON_HEIGHT_FINGER = 70
HILDON_HEIGHT_THUMB = 105

# fix theming
for widget in self.ui.get_objects():
    if not isinstance(widget, gtk.Button): continue
    # hildon_gtk_widget_set_theme_size is not bound into Python
    if widget.get_name().startswith('largebutton'):
        widget.set_size_request(-1, HILDON_HEIGHT_THUMB)
    elif widget.get_name().startswith('kpbutton'):
        widget.set_size_request(HILDON_HEIGHT_THUMB, HILDON_HEIGHT_THUMB)
    widget.set_name('HildonButton-thumb')
Posted 2/1/10 11:52 — 0 comments

happy new year

Had a pleasant day off eating snacks, watching The Pretender with friends and hacking on my tram tracking app. I added geolocation, which meant needing to test on the device, so I had to package up python-suds for Maemo (git-buildpackage repo, Maemo package).

The app actually runs quite nicely on the device, although each SOAP query is a little slower than in Scratchbox. This makes the Update Database quite a bit slower (also possibly calling COMMIT after each INSERT is a little expensive, I'm not sure). Otherwise things are quite zippy, including searching by location.

I'm not entirely sure I'm using the location API correctly, I don't seem to receive any updates to the location. I think it does some caching to speed up lookups and cut down on signals, so I'll need to try it from another location, but I don't even seem to receive an initial signal when the GPS locks.

I started having a go at packaging the application itself, but ran into some error I don't understand (Debian always seems to throw obscure errors when I try to package things). Regardless, the branch is here. Would love some help here.

It seems like all the fundamentals are now in place; including favourites, status messages and geolocation. Still want to add support for tracking individual trams. Also need to tweak the interfaces, buttons don't look like they have the right texture. Was thinking of using my Google Maps/GtkWebKit experiments to add a "View On Map" option for location based searches.





Posted 2/1/10 00:55 — 2 comments

A Rant: Why Telepathy is not for Twitter

Telepathy is a pluggable framework for abstracting real-time communication protocols. Every now and again, someone pops up wanting to write a Telepathy Connection Manager for Twitter or Facebook's wall or some other service of this nature. This is normally because they want to see their current status in their chat roster, or update their wall via their presence or somesuch. I, however, believe this to be a very bad idea.

Twitter and Facebook's wall don't really expose any features of a chat protocol. The only thing they have in common is a message. Not even a presence (available, away, do-not-disturb, etc.), just a message. So you could expose a roster of these broken presences. They're not real time; you can't chat with these people. Unless you count submitting messages to Twitter with @danni on them as chatting; and that's not really private one-to-one chat.

In my personal opinion, Moblin's status panel, and Mojito, are a much better fit for these sort of services. A separate abstraction for these non-real time services. Of course, thanks to the power of Telepathy, it is very possible to listen to Mission Control for status message updates and then post these to Twitter if that's what you really, really want. Or you could make your status panel set your chat status. It's about 12 lines of code.

As for rosters, I wish people would stop suggesting the integration misc functionality into Empathy. [Separate rant: this includes mail notification. Stop asking for this. Just because a given chat protocol includes mail notification, Empathy is not the place for displaying it. Instead someone should write a plugin for the mail-notify applet that can subscribe to information coming from Telepathy's new mail notification spec.] Ignoring that Twitter really has to be read linearly to follow a conversation, I think Moblin (again) has the right idea with its People panel, and this is a concept I'd like to see appear in GNOME 3. Combine this with some semantic net metacontact magic and then you can see whether or not a person is online right now to chat, what their Facebook status is, recent photos they've uploaded, recent email threads and whatever, without trying to cram it all through one abstraction.
Posted 30/12/09 14:57 — 12 comments

a hacky way of monitoring messages in Telepathy

Sometimes people come up with some creative solutions to solve their problems. The correct way to monitor data, such as messages, coming from Telepathy is to write an Observer, however sometimes you just want to get a feed of all of the text messages (e.g. so you can feed it to your keyboard's LCD or something).

The following is a pure D-Bus solution (although it includes telepathy.interfaces to cut down on typing). It listens to all Channel.Type.Text.Received signals, looks up the connection they came from and resolves the sender handle to a name. However note: it makes a lot more D-Bus calls than is required with Telepathy. Really you should cache the results for these handles and listen to the signals that tell you when that information has updated. If you were doing things properly, that's what you'd do.
import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
from telepathy.interfaces import *
from datetime import datetime

dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()

def message(id, timestamp, sender, type, flags, text, path=None):

    # path is the object path of the channel, from this we can derive the
    # object path of the connection, and acquire a proxy to it
    service = '.'.join(path.split('/')[1:8])
    conn_path = '/' + service.replace('.', '/')
    conn = bus.get_object(service, conn_path)

    # request the alias and id of the sender handle
    d = dbus.Interface(conn, CONNECTION_INTERFACE_CONTACTS).GetContactAttributes([sender],
        [CONNECTION, CONNECTION_INTERFACE_ALIASING], False)
    alias = d[sender].get(CONNECTION_INTERFACE_ALIASING + '/alias',
        d[sender].get(CONNECTION + '/contact-id', "Unknown"))

    dt = datetime.fromtimestamp(timestamp)

    print "%s <%s> %s" % (dt.strftime('%H:%M'), alias, text)

# listen to all Channel.Type.Text.Received signals
bus.add_signal_receiver(message,
    dbus_interface=CHANNEL_TYPE_TEXT,
    signal_name='Received',
    path_keyword='path')

loop = gobject.MainLoop()
loop.run()
Like I said, this is not efficient use of Telepathy. If it eats your D-Bus, don't blame me.

On the other hand, this has actually started a conversation about possible new convenience classes for telepathy-python.

bowl and chopsticks
Posted 29/12/09 12:11 — 2 comments

pie tomorrow, pie yesterday, but never any pie today

Had a pleasant Christmas; spent with J, DB, Jo, K and T; spoke on the phone with family and overate vegan food (including the world's most delicious vegie sausage rolls... twice!). Received some very lovely and thoughtful gifts, also a number of penguins (which are also lovely).

the sausage rolls

Went shopping with K yesterday (found some new tops, wish I could have found a nice dress). Saw Sherlock Holmes with Steph and Melbourne Squids. I enjoyed it quite a lot (this is not to say it was perfect storytelling, but it massively exceeded expectations).

They've remade Clash of the Titans. Somehow though you'd think they could come up with a better tagline than Titans Will Clash. Just think of all the other movies this genius could have been applied to... Jedis Will Return!. Brilliant work.

dessert

Woke up this morning with a headache, so planned on a lazy day where I finished off some work from last week. Guests turned up while I was still in my PJs. Glad they did, regardless of my state of dress.

Tonight I am eating more veggie sausage rolls, and writing a little bit of software. Started on a Google Maps client for the N900 which uses GtkWebKit. It currently doesn't work that well, but seems to prove what's possible. GtkWebKit is relatively straightforward.

Working a half week next week, with Friday off again. Especially looking forward to the vegan picnic on Tuesday. Planning on making these.
Posted 27/12/09 20:31 — 12 comments

this is what goes around; and this.. this is what comes around

It used to be that no applications would compile for 64-bit architectures, because everyone was trying to cram pointers into ints. Today I had the opposite. The head of some code I'm working on wouldn't compile in a 32-bit environment, because someone was trying to store 5 bytes in a long.

We have truly come full circle.
Posted 21/12/09 15:44 — 2 comments

Melbourne Tram Tracker for the N900

So Collabora's robotic and non-robotic overlords very graciously bought everyone on staff an N900 for Christmas. In my opinion, it's actually a very nice phone (although possibly a little on the large side); but the let down is there just isn't the same host of applications for it. Still, possessing both the tools and the skills, I figured I should do something about this, rather than complain.

One of the most useful iPhone applications in Melbourne is the real-time tram tracker. For stops without a display board, you can type in the stop ID and get the upcoming arrivals at that stop. You can also find nearby stops via GPS and a bunch of other things. It turns out that Yarra Trams offer a SOAP WSDL web service that is reasonably well documented, so I've spent a few days putting together a basic tram tracker for Maemo 5 (even if only two people will ever use it).








It currently can show upcoming trams for a stop by ID or by searching for stops by road names. Could possibly also do things like search for stop by route. There is a lot of information available. It doesn't yet do searching by location; the information is in the database, I've just not yet looked at how the location APIs work yet. Also need to add support for storing favourites.

I also want to add support for tracking a tram by tram ID. I'm wondering if it's possible to use the GPS to detect periods of immobility and check the upcoming tram stop after the tram starts moving again. I habitually miss stops; so what I think would be neat is to dial in a stop number or cross road you're looking for, and have your phone notify you when you're approaching it.

The web service uses python-suds, which is unfortunately not packaged for Debian, so I can't just rebuild it for Maemo (if anyone wants to package this up for me, that would be really awesome). Then I'll find out how well my app actually runs on the device.

In case anyone cares, the source code is here.
Posted 20/12/09 11:42 — 7 comments

a threaded processing queue in PyGTK

I'm currently writing a PyGTK client that needs to make network requests using a library that doesn't integrate with the GLib mainloop (python-suds), so I found myself wanting to be able to make network requests without blocking the mainloop, and getting callbacks in my main thread when operations were done. The pattern to use is clearly having a dedicated network thread. In C I might have used GAsyncQueue, however I've found myself quite liking queue.Queue.

The following is a fairly generic class for queuing asynchronous requests. Calling the add_request() method from the main thread queues a function to be run in the worker thread. If the callback or error keywords are provided, these will then be called from the GLib mainloop in the main thread (queued via g_idle_add).
from threading import Thread
from Queue import Queue

import gobject

class ThreadQueue(object):
    def __init__(self):
        self.q = Queue()

        t = Thread(target=self._thread_worker)
        t.setDaemon(True)
        t.start()

    def add_request(self, func, *args, **kwargs):
        """Add a request to the queue. Pass callback= and/or error= as
           keyword arguments to receive return from functions or exceptions.
        """

        self.q.put((func, args, kwargs))

    def _thread_worker(self):
        while True:
            request = self.q.get()
            self.do_request(request)
            self.q.task_done()

    def do_request(self, (func, args, kwargs)):
        if 'callback' in kwargs:
            callback = kwargs['callback']
            del kwargs['callback']
        else:
            callback = None

        if 'error' in kwargs:
            error = kwargs['error']
            del kwargs['error']
        else:
            error = None

        try:
            r = func(*args, **kwargs)
            if not isinstance(r, tuple): r = (r,)
            if callback: self.do_callback(callback, *r)
        except Exception, e:
            if error: self.do_callback(error, e)
            else: print "Unhandled error:", e

    def do_callback(self, callback, *args):
        def _callback(callback, args):
            callback(*args)
            return False

        gobject.idle_add(_callback, callback, args)
We can then inherit this class to provide setup for our specific application:
class WebService(ThreadQueue):
    def __init__(self, guid=None, **kwargs):
        """Initialise the service. If guid is not provided, one will be
           requested (returned in the callback). Pass callback= or error=
           to receive notification of readiness."""
        ThreadQueue.__init__(self)

        self.guid = guid
        self.add_request(self._setup_client, **kwargs)

    def _setup_client(self):
        print "Setting up client"

        ...

        return self.guid
Which we call from our program like this:
class Client(object):
    def __init__(self):
        self.w = WebService(guid=guid, callback=self.client_ready)

    def client_ready(self, guid):
        print "client ready:", guid

gobject.threads_init()

Client()

gtk.main()
What's really cool though is adding methods to the API that are called asynchronously for you. Python makes this possible through the power of decorators. Add the following decorator to a method, and it instead of it being called directly, it will be added to the processing queue.
def async_method(func):
    """Makes the given method asynchronous, meaning when it is called it
       will be queued with add_request.
    """

    def bound_func(obj, *args, **kwargs):
        obj.add_request(func, obj, *args, **kwargs)

    return bound_func

class WebService(ThreadQueue):

    @async_method
    def GetStopInformation(self, stopNo):
        print "Requesting information for stop", stopNo

        ...
And that's it! If you can't follow it, don't worry too much. This is possibly the most Pythonesque bit of code I've ever written, but I've tried to make it generic enough that other people can use it for whatever they need. It's currently part of my app that's beginning to take shape, but the source is here.

Incidently, Maemo people: are there Glade definition files allowing me to use Hildon widgets, GtkBuild and Glade 3? That would be super awesome if there were.
Posted 19/12/09 00:30 — 6 comments

(Untitled)

Been doing a pretty poor job of blogging my life lately. Mostly it's been photos and no text.

Took a week off from work (the week before last) because a number of our Perth friends came to visit. I've never dropped someone off and picked someone up from the airport in the same run before.

gramel

It was a fun, but exhausting week that culminated with my 25th birthday. Not as traumatic as I might have anticipated 6 months ago. Ended up eating every meal out that day, breakfast at Grigons + Orr, lunch at Friends of the Earth, and dinner at the East Brunswick Club.

Went to Prahran on Monday for Jo's birthday (who is actually 2 days older than me). Turned out everyone there was vegan (I think?) but there weren't really that many vegan (veganisable) things on the menu. There somewhat of a dearth of vegan food south of the Yarra. Felt bad for the people who still ended up paying full-price for a seafood noodles minus the seafood.

penguin ornament jo gave me

Also went to Fitzroy twice on Monday, once to have lunch with Steph between her meetings and then later that day with Furry (before heading on to Prahran). Thankfully I still managed a couple of early starts this week, and a few late evenings, so somehow I still managed to finish all my work by Friday (even with all the distractions). Worked on the telepathy-gabble codebase for the first time this week.

We became just that little bit more Victorian this week. The registration and insurance on our car was running out, so we had to transfer the car to Victorian registration. This meant new license plates.

simmering in the pot

I've personally been very slack with doing any Christmas shopping. Although we have been to a lot of markets, at which I've seen a lot of great stuff, for the same couple of people, there are people who remain notoriously hard to find something useful and meaningful for (I hate just buying crap).

I think I'll propose family-based secret-Santa for next year. Steph's cousins do this. The way it works is everyone writes down a list of stuff they want, and it all gets put into an (electronic) hat, and then you buy a bunch of stuff for just one person. Plus instead of buying 10 books or DVDs or whatever you buy the person a larger present to the same cumulative value, allowing them to ask for something they want but may be unable to afford (without the hassle of asking everyone if they want to go shares in a gift).

Went to the Walk Against Warming yesterday. Estimates place the attendance at 40,000 people. Looking down Swanston St was kinda amazing. I didn't take any pictures, but given the number of cameras, I'm sure lots exist. We walked from the State Library down Swanston St, past Federation Square, to the Princes Bridge (which spans the Yarra), where we formed a human sign photographed by blimp (safe climate - do it: looks like this).

Climate Rally flows down Swanston street
by takver, CC BY-SA

The sign took a while to make, so I was amazing sore and hungry by the end. Caught the tram back to Friends of the Earth for lunch and to see Steph (who had to miss the walk because of her FotE shift). Ended up wiping down the tables and packing things up so they could close for the afternoon before coming home to have a nap. SJ dropped by later that evening to drop around some Christmas noms, and have a cup of tea and a catch-up.

Spent all of today so far in my PJs. Taken some photos. Have made an attempt at fruit bread, but I think our yeast is stale. I had to put it in a warmed oven to get it to rise. It's just cooling now, so we'll see how it went in a bit. My brother is meant to be showing up tomorrow, having been in Melbourne for a University motorsport event (they built a car!).

vegan chocolate truffles
Tags: ,
Posted 13/12/09 13:30 — 30 comments

GTK+ is crushing my spirit

I want a widget that is the combination of GtkComboBoxEntry and GtkEntryCompletion that can display a tree of options in a nice, indented way without the expanders (but with the rows expanded). Basically, a search box with a drop-down and hierarchical entries. I think I'm going to have to write my own, thought it sounds like something that might be more widely useful than just my application.

penguin in the tree

Visited [info]nixwilliams and [info]daniel_bethany for a cup of tea, which become lunch (which was delicious) which became more tea, which became waiting out the rain and watching Nicholas Crane trip over a lot. Got wet going home anyway. Now waiting out the rain again before going to the shops. It's a good thing that I like rain; though mostly I like wearing a giant, warm jumper while it rains outside.
Posted 10/12/09 18:53 — 9 comments

things what I've been up to

the sun sets on brunswick
we've been getting some killer sunsets

ethical christmas cards
Australian-themed, environmentally friendly Christmas cards (link)

9 Lives Jamming #6
Ballarat Rollerderby exhibition bout

pumpkin and tofu pie at tofwd
delicious lunch

lavender #1
Posted 2/12/09 09:23 — 4 comments

GNOME Journal is out

The GNOME Women edition of GNOME Journal has been released, including an article by yours truly on Telepathy and MC5. Check it out.

ask dr opus
Posted 24/11/09 10:07 — 10 comments

A complaint about Melbourne buses

I missed something I wanted to go to yesterday, because I opted to wait for the bus that was coming in 5 minutes, and thus be early, rather than walk and only just make it on time.

The bus companies in Melbourne seem quite small, they only run a couple of lines each. Most shifts seem to be a driving the same line back and forth. The problem is when there is a delay on a route, driving the same route back and forth leads to that delay stacking and stacking. A technique I've seen to combat this is having buses change routes at the end of every route, effectively driving in circles around the area. This hopefully gives them an opportunity to make up the lost time. Of course, it requires bus routes that terminate in the same place and bus companies that operate more than just a couple of routes.

For what it's worth, a lot of yesterday's angst could probably have been avoided if the City of Yarra had bothered to tell someone it was closing part of Johnston St. Simply adjusting the traffic light sequences for the detour would have been a huge win, instead of having a traffic light that gave you but 15 seconds to turn down the next road, backing traffic up for 15 minutes.
Posted 22/11/09 10:31 — 17 comments

in case you missed it

It turns out that PlanetPlanet starts to ignore you if you make four blog posts in quick succession, so in case you missed it yesterday:
Tags:
Posted 20/11/09 13:42 — 2 comments

[<< Previous 20 entries]