Archive for March, 2009

Apache Mod Rewrite March 31st, 2009

Mike

Another task in my quest to develop a half decent web site was getting my head around Apache Mod Rewrite again.

For anyone that’s bemused at this point, a rewrite engine is a piece of software that can modify a web address’ appearance (or rewrite it). To end users it means that they can type in a user friendly address such as www.example.com/page/ and behind the scenes something like www.example.com/index.php?name=page is passed to the web server. Advantages include obfuscation of the technology driving your web site (to an extent), more user friendly URLs (easier to remember, guess and nicer to look at) and better SEO.

This is the trusty Mod Rewrite syntax reference I always refer to.

Continue reading...


 

CSS Positioning and The Box Model March 31st, 2009

Mike

I’ve had to write a web site recently for a friend. I’ll post up a link when it’s done and I want to expose it to the wider world. However, as a result, I’ve been reminding myself of a few key concepts. First was properly getting my head around CSS positioning and the box model, mainly in order to deal with the oddities that older versions of IE always throw up. I don’t think you can beat this article at BrainJar.com. Highly recommended.

Continue reading...


 

Joining FLAC files March 31st, 2009

Mike

I just bought myself a shiny new portable audio player (I was about to write MP3 player but realised I didn’t buy it to play MP3s primarily so that would have been somewhat redundant). I went for a Cowon iAudio 7 (Silver, 16GB). There were a few reasons for this:

  1. Up to 60 hours of battery life (claimed)
  2. 16GB flash memory
  3. Reasonable price (less than £120 inc. postage at time of purchase)
  4. Generally good reports of sound quality
  5. Ability to play many audio formats (particularly FLAC).

Why are those things a big deal? Well, battery life is because I see this as a very sensible alternative to buying a CD changer for my new car (probably cheaper and I can take it to my next car). Sound quality is important because anyone that knows me also knows I’m an audiophile. Finally, the killer feature is the ability to play many formats, in particular FLAC. Being an audiophile, I’m moving towards ripping CDs as FLAC instead of MP3.

However, I’d read there was one gotcha – a lack of support for gapless playback. The solution? Well, rather obviously, rip mix CDs as one file (I don’t care about skipping tracks in the car). Hang on, surely there’s a way to combine FLAC files automatically, I thought (since I’m not going to want to rip/store only one file on my HDD). The answer is the rather useful shntool. A very simple command line tool (available for Linux and Windows – I like it already :) ) that will stick together a bunch of audio files and spit out a WAV (or, with a bit of work and very simple scripting, another compressed audio file).

I’ve used it on Windows only so far and simply stuck it in a directory that I added to the PATH environment variable. I did the same for the FLAC tools. The really neat part of this is that shntool can read a list of files to stitch from a text file. So, if you rip with something like CDex and create a playlist, you can then feed shntool the playlist to stick the files in order. Brilliant! Then run the WAV through the FLAC encoder again and you have one big file. If you’re feeling adventurous, shntool supports supplying a choice of encoder and parameters to do the whole thing in one go. So far I’ve been lazy, so all I do is something like this:


shntool join -F playlist.m3u
flac -o mixname.flac -8 joined.wav

Continue reading...