Nik's Technology Blog

Travels through programming, networks, and computers

MySQL Replace Function

I never knew this function existed. Well I never!

MySQL Replace(), here's the syntax.

update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

I've also successfully used nested Replace() functions, as above, within a select statement to reform field values for output.

What would we do without it!

Some more MySQL snippets

Apple vs Microsoft (iTunes vs Media Player)

I'm no fan of big companies with monopolies that strangle the life out of the IT industry, but Apple and Microsoft do have a knack of producing some fairly good software.

Until recently I had just been ignoring the smug Mac users when their claims that Apple's computers and software are the best things since sliced bread.

I'm not convinced that the DRM (Digital Rights Management) strategy adopted by either Apple or Microsoft is the best way forward, but I am slowing warming to Apple's philosophy.

After buying an iPod and solving the issue of it crashing on me while converting to Windows format, even before I'd even used the thing, I have to admit, they got a lot right with the software. iTunes even though some features that should be there are missing on purpose is the business!

It's a joy to find and update your music. ID3 tags are so easy to edit, even for multiple files. Artwork can be added through the interface, although it would be better if the music library Apple uses to write the ID3 tags in the first place had the said album artwork (Something Microsoft's Media Player does).

As for the iPod, well it's sexy, easy to scratch and heavy, but not as heavy as all those CD's that it's replacing!, oh and it does crash once in a while, no blue screens though :-)

iTunes Album Art Importer

If like me you've recently bought one of Apple's new iPod Photos, or you use iTunes on Windows and wondered why the album artwork for your favourite CDs didn't get imported with the tracks then you may want to read this.

Windows Media Player and iTunes store album art in different ways. Media player stores them as jpg's within the directory where the music is stored. Apple however make use of the tracks ID3 tags and store the album artwork actually in each of the music files.

There are advantages and disadvantages to both methods, however when you import music into iTunes it currently ignores the album artwork Media Player put there.

To get around this you could try the following program. It was created using VB.NET, Apples SDK and uses the Amazon Web Service to query Amazon and retrieve the artwork.

You can set it to run on your whole music collection and specify whether to update tracks with existing artwork. It does however crash on occasions, but it's still much faster than doing it yourself.

iTunes Art Importer