When I get stuck... I usually ask a friend about my code. Even the process of me explaining the code to him/her may get me in the mindset I need to be in to detect a bug.
However... Probably the longest time I've ever been stuck on something was trying to find a way to perform mathematics on generic types in C#... I worked on this topic for months before I found a way to do it. I actually used generic types, runtime compilation, and delegates. :) I was only able to see this solution after exploring topics that were (at the time) outside my comfort zone. So you need to push yourself at all times to learn.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.