Be careful where you get your information

The internet is rife with misinformation.

As a developer you tend to depend heavily on searching for examples of how to solve a particular problem such as code snippets, and patterns and practices. There is very little ground breaking work and it is almost certain that someone has been there, done that, and blogged the solution to your problem already.

Problems arise when you choose the wrong source to trust. For example, today I was trying to figure out how to get ASP.NET not to render a name attribute for the form element as we are starting to target XHTML 1.1 compliance for BeforeYouBuy. A quick google came up with this.

Certainly the answer that is proposed is “a solution”, but it’s certainly not “the solution”. A slight modification to my search turned up this how to on the msdn site.

It’s really down to knowing where to look.

MySql “Nested transactions are not supported” exception

If you are getting an unexpected “Nested transactions are not supported” exception from your MySql database then you may have hit this bug.

I firstly suspected Spring.NET, then the MySql ADO.NET driver. We scratched our heads for a couple of days on this one before I found that bug report.

To make a long story short, simply commenting out the query_cache_size option in the my.ini file solved it. What effect this will have on performance I haven’t determined yet.

A:Hover and IE – a trap for young players

If you’re having trouble getting your a:hover effect to work in IE you might want to make sure you have an href attribute on the anchor element. The hover effect won’t work in IE unless it does.

I had something like the following:


<a onclick="somejavascriptfunction()">Anchor text</a>

Changing to this solved the issue:


<a onclick="somejavascriptfunction()" href='#'>Anchor text</a>

It’s a bit embarrassing and I should know better. I hope this post helps other people avoid wasting time like I did.

Amazons DRM free MP3s

A couple of nights ago I finally found some time to check out Amazon’s new MP3 service and so far I’m pretty impressed.

No DRM

My interest in the Amazon MP3 service was piqued when I discovered all their tracks are DRM free (unlike some other crippled offerings). The songs are encoded at 256 kbps which is a pretty respectable bit rate.

Linux support!

I got even more excited when I went to the getting started page and in the “Buy and Download” section they mention they have a Linux version of their Amazon MP3 Downloader application. And they haven’t gone for some budget “one size fits all” Linux solution, but they have binaries for most of the major distros.

It’s really encouraging to see this sort of first class support for Linux by companies like Amazon.

What if I’m running 64 bit linux?

If like me you are running the amd64 build of your distro you will need to convince Amazons MP3 Downloader to run against 32 bit libraries. If you use Ubuntu then I suggest the excellent getlibs tool for installing your 32 bit dependencies. After you’ve downloaded the Ubuntu deb file, install it using:

sudo dpkg -i –force-all amazon*.deb

Then install the 32 bit dependencies with getlibs:

getlibs /usr/bin/amazonmp3

It’s dangerously easy to use

Amazon certainly seem to have a great range of music on offer. To test things out I purchased

var country_code = geoip_country_code();if (country_code != “GB”){ document.getElementById(‘ukShaka’).style.display = ‘none’;}else{document.getElementById(‘usShaka’).style.display = ‘none’;} by Kruder & Dorfmeister using 1-click. The 3 track EP cost me £2.37, you can get full albums for around £6-7 (or $9-11 US). The Amazon MP3 Downloader is a simple but effective app downloading Shakatakadoodub to my machine in a matter of seconds. From there it was a simple job to import into Banshee. One mouse click was all it took to purchase and download a DRM free EP!

I’m a happy camper

Overall I’m really impressed with this offering and can’t understand why it hasn’t had more press. It amazes me that people stick with crippled solutions like the iTunes store when you have a DRM free alternative like this available. I know where I’ll be buy my music from now…

var country_code = geoip_country_code();if (country_code != “GB”){document.getElementById(‘ukmp3’).style.display = ‘none’;}else{document.getElementById(‘usmp3’).style.display = ‘none’;}

Tomboy for windows

When working in Windows I like to use as much Open Source software as possible to make my environment as familiar to my Linux desktop as I can. I have many of the popular applications installed such as Firefox, Thunderbird, Gimp, MySql, and XEmacs (who said XEmacs wasn’t popular?!).

Recently a Tomboy preview for windows became available and a few nights ago I finally got round to installing on my laptop. Tomboy is a great application and works the way a note taking application should work.

The install is a little fiddly if you are running Vista due to a bug in the Gtk runtime installer, but it’s not too challenging to get running.

If you’ve ever wanted an application to quickly jot notes into I throughly recommend you give Tomboy a try.

Vista performance and Aero

Misinformation everywhere

Do a search for Vista performance tips and you will get dozens of hits, most of which will be espousing the same advice – if you want better performance on your Vista machine turn off Aero.

I have a Lenovo Thinkpad T61 with Vista Business installed. It’s a fairly high spec machine and should be pretty snappy, however coming from using XP at work and Ubuntu at home I found Vista very slow. I followed the advice of a number of different sites and (among other things) switched of Aero. I noticed a marginal performance improvement (probably due to switching off search indexing) but still wasn’t happy.

Switching Aero on improves performance

Just the other day I decided to switch Aero back on. It was like I’d found the turbo button. My machine was much more responsive and Visual Studio went from taking around 30 seconds to load to starting in 1-2 seconds.

In retrospec it kinda makes sense. Vista has support for offloading the rendering tasks to the GPU so why would you force all this work back onto the CPU by switching Aero off?

It worked for me…

Turning Aero on improves performance (at least in my experience) so if you’ve previously switched it off, try turning it on again – you might be in for a plesant surprise!

Superstring theory 101

I thought I’d post this presentation Brian Greene did at TED in 2005 given that it seems a few people are interested in the book I’m currently reading:

.

The presentation is a fantastic primer on Superstring theory and, should it wet your appetite, the book will certainly appeal.