+ 5
Yup. There have been DAYS that I've spent trying to figure out how to make something work. I've sat in the same spot for over 18 hours without taking a break, all to fix/debug something. There are times that you get frustrated when something's not working right, or you can't figure something out, and you just want to pull your hair out. However, when this happens, I've learned that it's sometimes best to walk away for a moment, sleep on it, and then come back to it with a rested mind. Just like being tired affects our body, it affects our mind/ability to think also. So when you get frustrated or fed up, take a break and do something entertaining for a moment, and come back to it later. However, don't get in a habit that at the first sign of trouble you just go and distract yourself with stuff that ultimately doesn't matter toward your life.
Best of luck!