August 31, 2005
Roadkill

I've been getting on fairly well with Roadkill, my nice new Powerbook, but it's been a bit of a learning curve. The pretty Mac front end stuff is a piece of cake on the whole, with one major exception - undo, cut, copy and paste are Apple-z, x, c, and v respectivly, instead of Ctrl-z, x, c, and v as they are on Windows. I've been using those shortcuts for so long now that they are embedded in muscle memory. I've hit the wrong shortcut before my brain (such as it is) has had a chance to overrule them. Getting over that is going to take a while.

Getting some of the command line driven stuff - Ant, Subversion and Tomcat - working was a bit more of a challenge. Easy once you know how, but you keep being tripped up by things that I didn't know about.

I had installed Java 1.5, but the installer didn't tell me where it had been put, so I had to go and look for it. I found it in /System/Library/Frameworks/JavaVM.framework/Versions/1.5/ in the end.

There was already a version of Ant installed in /Developer/Java/Ant, probably as part of the XCode tools install, but it was the wrong version, and in any case I wasn't able to add 3rd party tasks to it, so I needed to use my own version.

Both of these problems involved setting environment variables, and I gather that it's recommended that you don't muck about with global environment variables, so I set up some shell scripts to start and stop tomcat and to run ant scripts with the environment variables set correctly. I was even smart enough to put the shebang line at the top (though finding the bloody '#' key took a while) and to mark them as executable wwith chmod. But I still couldn't run the bloody scripts. The shell was claiming that tey wen't there, though I could see them with ls.

It turns out that your current working directory isn't on your path by default. Arrrgh! That one took me hours, literally. Prefixing the script names with ./ does the trick there.

I still can't resolve any of the other boxes on my network by name, only by IP address. Irritating, but no show stopper. I can always add them to /etc/hosts, but for the moment I'm just using the IP addresses.

Still, I managed to get past all that, and my current web application is building and running on Roadkill happily enough now, after fixing a couple of minor Windows-isms in our build file. ;-)

Next on my list; installing PostgreSQL, and getting my app to work with it, and working out this whole multiple Python versions on one machine thing, and working out where the insert and delete keys are...

One other thing - what do you, uh, we Mac users use to read Usenet? Entourage seems to have trouble getting at Gmane - this fix, uh, doesn't.

Posted to Mac by Simon Brunning at 01:52 PM
Java Meetup next week

Pop along to next week's London Java Meetup on Tuesday the 6th. I'll be there - and I'm bringing Tulna and El Presidente with me this time. Perhaps Steve, too.

This month's topic is Spring, but as usual, off topic nerdyness of any kind seems to be welcome. For instance, I happen to know that Tulna (nerd in denial) will be interrogating Darren about shooting RAW, since she has a shiny new Nikon D70s.

I've dropped the ball a little recently with the Python meetups, but I'll probably organise one for October. I can't afford one this month - I spent over £100 last time!

First post from roadkill!

Posted to Java by Simon Brunning at 01:05 PM
August 26, 2005
It's here!

And a thing of beauty it is too. Don't expect too much from me for a day or two.

Posted to Mac by Simon Brunning at 10:35 AM
August 25, 2005
Men, Women, and IQ tests

'Men cleverer than women' claim. Sounds preposterous, doesn't it?

Well, actually, if you read the article rather than the headline, you find that the claim is that men have higher IQs than women do. That, I can believe. After all, I don't think that IQ tests really measure anything meaningful, and I wouldn't be at all surprised if there was a sex bias in there to go along with cultural and educational-background biases. That is; men aren't cleverer than women (except, that is, for recognising that you don't need to own more than half a dozen pairs of shoes, or indeed any cushions at all) but IQ tests might give more weight to the sort of tasks that men tend to be good at.

In fact, not only do I believe that IQ tests are not a good way to measure general intelligence, but having read The Mismeasure of Man, I don't even believe that there is such a thing as general intelligence to be measured. Have you ever noticed that even the stupidest people are good at some things, and even the cleverest have their mental blind spots?

Posted to Science and technology by Simon Brunning at 05:20 PM
Freedom Languages

Kevin Barnes' Freedom languages (via Smalltalk Tidbits, Industry Rants) is very interesting. Read it. ;-)

Posted to Python by Simon Brunning at 01:49 PM
Happy Birthday!

My iPod is one year old today. I've listened to it for a grand total of 33 days, 4:17:38, according to the second of these scripts. That's getting on for 10% of the time!

Thanks again, Mum. Best birthday present ever.

Bad news is, my earphones did again, only yesterday. That's three sets I've got through in the last year - I must be seriously rough on them. Anyway, I might get some Shure E2Cs this time - I spotted them on one of those dodgy Tottenham Court Road shops for thirty-five quid or so.

Posted to iPod by Simon Brunning at 01:24 PM
August 24, 2005
El P is Back

El Presidente is back from his two week holiday in Russia today. He's always in a shitty mood when he gets back from holiday, and he's got more to be irritated by than usual this time. (But it wasn't my idea, honestly, Paul! And I did get to the bottom of my to-do list while you were away. Nearly.)

Anyway, to try and cheer him up, we've brought in a whole load of sugary stuff - doughnuts, chocolate, and biscuits. We are hoping to either put a smile on his face or kill him with hyperglycemia.

We are also attempting to get a accurate measure of The Flury, the SI unit of carbohydrate, being defined as the quantity of sugary crap that El Presidente is capable of consuming in a single day. We've tried measuring this before, but no single one of us can carry that much in at once, so Tracey and I are working in concert this time.

Update: What's left as at 2:30 and is it any co-incidence that El P decided upon putting his desk next to the microwave? (He turned his head away to avoid being recognised - but there's no mistaking that shirt, is there?)

Posted to Apropos of nothing by Simon Brunning at 12:20 PM
The Ancient History of Shoes

Sturdy shoes first came into widespread use between 40,000 and 26,000 years ago, according to a US scientist.

OK, now, can someone explain why women need so many pairs?

Posted to History by Simon Brunning at 12:09 PM
August 23, 2005
iPod Statistics

Still no Powerbook. :-( It was dispatched on Saturday, so it should be here soon.

Still, in the meantime, to keep myself occupied, here are more statistics about what's on my iPod than you can shake a stick at. You know all those stats they throw at you when you are watching cricket/baseball, for the obsessives? It's kind of like that.

If you put yourself there, bung me a link to your stats. I'm interested. No, really.

Posted to by Simon Brunning at 01:43 PM
August 17, 2005
All Quiet

I seem to have left my iPod playing when I got home last night, 'cos it was dead this morning. I hate commuting without music. (It's happy enough now though - it was just the battery.)

Besides which, being the nerd I am, I had to knock this up to make sure that my metadata is still correct:

import win32com.client
 
def main():
    iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application")
    
    quiet_tracks_playlist = iTunes.LibrarySource.Playlists.ItemByName('Reduce Played Count')
    for track in quiet_tracks_playlist.Tracks:
        print 'reducing played count for', track.Artist, '-', track.Album, '-', track.Name, 'from', track.PlayedCount,
        track.PlayedCount -= 1       
        print 'to', track.PlayedCount
 
if __name__ == '__main__':
    main()

How sad is that?

(I suppose that I'll be learning how to script iTunes all over again once I've got my new Mac.)

Why do I care about re-setting the played count? 'Cos I want this to be right:

import datetime
import time
import win32com.client
 
def main():
    iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application")
 
    total_time = datetime.timedelta(0)
 
    for track in iTunes.LibraryPlaylist.Tracks:
        try:
            track_time = time.strptime(track.Time, '%M:%S')
        except ValueError:
            track_time = time.strptime(track.Time, '%H:%M:%S')
        track_length = datetime.timedelta(hours=track_time.tm_hour,
                                          minutes=track_time.tm_min,
                                          seconds=track_time.tm_sec)
        track_time = track_length * track.PlayedCount
        total_time += track_time
                                                 
    print 'Total iPod time:', total_time
 
if __name__ == '__main__':
    main()
    raw_input('Hit enter to continue...')

And how sad is that?

Posted to iPod by Simon Brunning at 05:08 PM
How did *that* happen?

Dan's PC died yesterday; hard disk died. It's been replaced, but while Dan was working on it, we were having a chat with Jeff, our finance director, and Dan suggested that we should keep a spare PC about the place so that in the event of one dieing, there's always another one to be getting on with. Jeff thought that this was a jolly good idea.

I pointed out that I thought that we ought to get notebook PCs rather than desktops in future. The aren't that much more expensive, and they give you a whole lot more flexibility. I'm forever being sent off to client sites, and a notebook of my own would be dead handy. (There is Roadwarrior, but you know how it is using a PC other than your own..) Besides, we'd be able to work from home if we needed to occasionally due to trains not running or other problems, or to implement that bright idea that you have on Saturday evening straight away.

Jeff thought that this was a good idea too. "Just spec yourself up a decent notebook," he said, "and order it".

"Result!", I thought.

"Oh, don't go ordering yourself a Powerbook, though!"

"Fair enough. I wasn't planning to try and get that one over on you, much as I'd love to. You do realise, though, that all the stiff we work on these days is cross platform, and would work just fine on a Mac?" I couldn't help but point it out.

Half an hour later, Jeff and Alex (our technical director) came over and told me to order a Powerbook! They asked me to check that it wasn't going to cause a problem in terms of development or office tools or network infrastructure, but that if it all looks workable, they'd like to make sure that we really are building cross platform software.

So, I've checked. Development tools are no problem - just about everything is Java based (Eclipse, Ant, Tomcat, Spring, Hibernate, Axis, etc, etc, etc.), though I have a bunch of Python stuff too. We want to be cross database, too, so we are developing against MySQL, and deploying against SQL Server and DB2/400 (which don't run on the development boxes.). We use Subversion for change control. All of this should be fine on a Mac. MS Office for Mac is compatible with Windows Office, and our network should just require a little tweaking. All systems go.

I did suggest that we should wait for El Presidente to get back to see if he was OK with it all, but there's no stopping Jeff and Alex with the wind in their sails, so the order went in today:

I have no words for how cool this is. See - who needs a girlfriend? ;-)

Tulna, (who doesn't have a blog, oh no,) is dead jealous. And she says she's not a nerd. Now - lots of Mac software to download...

Posted to Mac by Simon Brunning at 04:04 PM
August 12, 2005
Singletons are selfish?

(Nerds; this is about single people, not about real Singletons.)

Bloody hell, as if it isn't hard enough, Zoe Williams over at the Graudiad is claiming that single people are selfish, and need to be given a hard time.

Fuck off, Zoe. I get given ehough of a a hard time about it already, thank you.

Via Wherever You Are.

Posted to Apropos of nothing by Simon Brunning at 04:39 PM
Python 2.4, Windows and MSVC7

Ever since Python 2.4.0, the Python for Windows binaries have been build with MSVC7, as opposed to version 6. The main reason for this, IIRC, was that VC6 was no longer available to buy, and was increasingly difficult to get hold of. (See the bottom of the python-dev Summary for 2003-05-01 through 2003-05-15 for more.) Microsoft sweetened the deal by giving free copies of VC7 to several key Python developers, and pointing out that free (as in beer) versions of the compilers are available for download.

All C coded Python extensions distributed as Windows binaries need to be compiled by the same version of VC as core Python, so this required all extension builders to get VC7. But then, most probably already had it, and given that VC6 was no longer available at all, this probably made things better rather than worse on the whole. It was the right decision.

Update: Phillip J. Eby correctly points out that an extension builder doesn't need VC7 - only the core developers need that. An extension builder can use the free Microsoft compiler, GCC, or MinGW.

On the other hand, being Microsoft, there was bound to be a price to pay - and it turns out to be a big one. Software compiled with VC7 requires a dll, msvcr71.dll, at runtime. Owners of a full version of VC7 are free to distribute this, but no one else is.

This isn't a problem for the standard Python distribution, since the core Python developers have donated copies of VC7. It's not a problem for Python C extension builders and users, either, because the extensions can be compiled using the free compiler, and use the version of msvcr71.dll distributed with the standard Python distribution at runtime.

So, why is msvcr71.dll a problem? Py2exe, that's why. It's no longer possible to use py2exe to build a working stand-alone executable from a Python script and distribute it to people who don't have Python already installed. The exe built by py2exe needs msvcr71.dll to run, and you can't legally distribute that unless you own VC7.

Was this a deliberate trap? Probably not. I'm not that paranoid about The Great Satan, err, I mean Microsoft. I doubt anyone realised in advance that there'd be a problem. But it does underline the need to avoid proprietary software in general, and Microsoft software in particular, if any reminder were needed.

In fact, there's at least one other problem that I've come across caused by the move to VC7. There are Python bindings available for Subversion, (which rocks, by the way) and you need these to run Trac. But the Python Subversions bindings aren't available for Python version 2.4, and won't be in the foreseeable future; Apache is still compiled using VC6, so Subversion is built using it too.

I don't really have much in the way of a suggestion as to a solution to this, I'm afraid. It would, of course, be lovely if Python for Windows was built with a free compiler such as GCC or MinGW, but there would be a huge amount of effort involved in making the move, for which I'm in no position to volunteer.

Posted to Python by Simon Brunning at 03:34 PM
August 11, 2005
Where are you all?

I've often been interested to know who reads Small Values, and where you all are. My Sitemeter stats give me some idea, but not much. So, please add yourself to the Small Values Of Cool Readers map. Ta.

Update: Do zoom in a bit before placing yourself, or you might end up hundreds of miles from where you really live. ;-)

Via Look At This...

Posted to Apropos of nothing by Simon Brunning at 02:12 PM
In the cross-hairs...

Oh dear.

Posted to The Big Room by Simon Brunning at 01:39 PM
Penpal wanted

My eldest, Freja, has decided that she'd like a penpal. Or, rather, an email pal. Anyone out there, preferably outside the UK, with a seven-to-nine year old with email access who'd like a penpal in England?

Posted to Parenting by Simon Brunning at 01:36 PM
The Worst Mistake in the History of the Human Race

No, not Visual Basic, apparently. According to Jared Diamond, it's agriculture.

Hmmm. A hunter-gatherer lifestlye may well have been better off in terms of food and health, but it's not able to progress much technologically speaking. So, the hunter-gatherer lifestyle may be better in the short, medium and long terms, but in the long long term, natural climate change would inevitably have wiped humanity out eventually. As it is, there is some chance that we'll manage to get off planet before we destroy the ecosystem for once and for all.

Besides, without technology, the invention of the Wonderbra would have been impossible.

Posted to Science and technology by Simon Brunning at 01:30 PM
August 09, 2005
Spirits

One morning last week, at Mum's house, the girls rushed into the house and breathlessly told us that they'd found a dinosaur's bones in the garden.

Turns out that they'd found Satya. Her skull was on the picnic table.

They spent the rest of the morning running around screaming. They were playing "being chased by Satya's spirit". Rather unlikely, I though; Satya would be more likely to trying to get away from the little savages, as she did in life.

Oh, a few more photos.

Posted to Parenting by Simon Brunning at 04:17 PM
August 08, 2005
Back...

I was on holiday last week, visiting Mum in Newcastle. See us at the beach and at Bollam Lake. Thanks to Mum for the photos - I'll upload mine tomorrow.

I still have over 400 emails to read, and Bloglines had over 4000 new posts for me this morning. :-(

Posted to Apropos of nothing by Simon Brunning at 03:30 PM