Every aspect of how one gets setup or the mood they put their working setting in is a major part of what could be either what I call a "good code day" or a "bad code day".
Music plays a huge roll in determining this factor for me. I need to be fueled before I start working on a project, thus my music of choice is usually on the industrial side of things. You have bands like flesh field/synapscape/wumpscut that provide "noisy" stylings that sort of become background, and since most of the time the lyrics of the song, and the person singing the song are so highly distorted it doesnt distract you with voices. (Erm I get distracted by clear voices that I can understand since I tend to focus on the voice rather then what Im doing). Yet whenever I get really pissed off at somthing that isnt working correctly, I might slap in some calmer tunes like Delirium or Wolfsheim, vnv nation and the likes of those.