Getting a Python Traceback without an Exception

Any Python programmer will be familiar with the stack traceback associated with an exception; most will be particularly familiar with a traceback being displayed for an unhandled exception. This is extremely useful in finding and resolving the issue in the code. However, for a long time now, I've often thought that it would be extremely useful to be able to get a stack traceback at any arbitrary point without needing an exception, which would aid in determining what code path was taken to get to a particular function call. I knew this was possible - Python does allow you to get at the stack frames - but I thought I might have to do a bit of work to obtain a nice traceback. Finally, figuring someone else must have wanted this, I did a bit of Googling and turned up this article. I somehow missed print_stack(), format_stack() and extract_stack() in the traceback module. :) Sooo easy! :)
read more

The Stupidity of Forced Password Changes

Changing passwords on a regular basis is supposed to increase security. If someone somehow gets hold of a password you used some time ago (perhaps they took a few months to get through their camera footage at the local wireless hotspot?), hopefully, it won't matter. Centrelink (the organisation responsible for social security services in Australia) enforces password changes after a defined period; I think it's every three months. Unfortunately, I tend to forget my new passwords when I have to change them like this. I believe I pick relatively strong passwords, but as a result, it sometimes takes me a while to memorise them. You can do silly things like changing one character, but I sometimes forget which character I changed. :) I would argue that enforcing password changes like this actually encourages insecure, stupid behaviour like writing them down, because people know they're going to forget their new password!
read more

In praise of Darwin and the spirit of inquiry

This article is a rather interesting read:
In praise of Darwin and the spirit of inquiry
While it is centred specifically on Christianity, it strongly advocates my fervent belief that science and spirituality/religion/faith are most definitely not mutually exclusive; rather, they should support each other.
read more

iPhone Ocarina

Okay. So some of you will know that I'm a bit (?) cynical of the iPhone. This is partly because it seems like yet another flashy new piece of largely closed, proprietary technology with lots of over-exaggerated hype. I've always been cynical of a lot of Apple stuff in general because of the huge number of people that see Apple as gods who can do no wrong. In truth, I think my cynicism towards the iPhone is mostly due to the fact that it has a touch screen which I can't use. Yeah, yeah, I know - I'm a sore loser. :) Anyway, despite my cynicism, even *I* was wowed reading this article about an iPhone application called Ocarina. From the article:

Once you install and open this program, your iPhone's screen displays four colored circles of different sizes. These are the "holes" that you cover with your fingers, as you would the holes on a flute. Then you blow into the microphone hole at the bottom of the iPhone, and presto: the haunting, expressive, beautiful sound of a wind instrument comes from the iPhone speaker.
Different combinations of fingers on those four "holes" produce the different notes of the scale. (You can change the key in Preferences--no doubt a first on a cellphone.) Tilting the phone up or down controls the vibrato.

Now *that* is pretty damned cool. I haven't actually played with it myself, but I'm sure it could keep me amused for a while... assuming I could figure out where to put my fingers. :)
read more

Sorry, but We Only Have Toast

I slept terribly last night. How unusual. Anyway, I felt pretty awful and as a result, the following conversation ensued between Jen and I:
Jamie: "<sighs heavily> I feel like a dried out turd."
Jen: "Well I'm sorry, but we only have toast."

It made my morning seem so much more bearable. :)
read more

Healthy Fruit Tingles?

I bought some new 1000 mg vitamin C tablets yesterday and discovered, much to my surprise, that they taste disturbingly like fruit tingles! I find this disturbing because a) I like fruit tingles, which therefore means I like the taste of these tablets; b) I could probably quite happily eat more of them; and c) my taste buds have to be totally demented to find a similarity between vitamin C tablets and fruit tingles. Who would have thought that tablets of any kind could taste even half decent?

update: My brother informed me that they even look like fruit tingles minus the dimple in the centre. Now that I can actually taste a bit more, I can detect more of a slightly bitter aftertaste, but they still taste rather like fruit tingles.
read more

Blind Man Assaults Child

A blind man assaulted a child on a Brisbane bus just before 9 this morning.
James Teh, a 21 year old unemployed musician, attempted to squash the boy with his rather large backpack.
"I didn't realise the poor kid was sitting on the seat next to me," Teh told police. "I was carrying two bags and was trying to get them both into a workable position as I sat down."

This is just one of many incidents of unprovoked assault by a blind person, citing their disability to excuse this unacceptable behaviour. Even if such acts are accidental as they claim, blind people seem to believe that their lack of sight is justification for their failure to see others nearby.
"Damn blindies," a young high school music teacher commented. "You just can't trust 'em."
read more