 <p>It's often best to clear your head by doing something other than programming for a little while. See <a href="http://stackoverflow.com/questions/305223/jon-skeet-facts#309319">this answer</a> for an example - I did it while struggling with a particularly thorny bug, and when I came back to the problem I solved it in about a minute.</p>