Although this is an old post it still comes up in search engines. So, given the horrid advice on this topic I thought I'd demonstrate how a professional developer solves the problem; not an academic...