Yes... so many times. Whenever I am stuck with a problem for more than an hour, I take a break. I usually just walk a bit, sleep (if it's late night) or just engage myself with some other activity. Usually, when I am away from computer I imagine various solutions and when I am back to work, 90% of the times I fix the problem. :)