I have found the Pomodoro Technique (http://en.wikipedia.org/wiki/Pomodoro_Technique) to be helpful. I can't do it for a whole day, but a short sprint to grind through something is a near, achievable goal. For extended, head-banging frustrations, it's helpful to step away, think about it without the distraction of the screen, and coming back at it with fresh eyes. The time AFK is not to be underestimated: http://www.paulgraham.com/top.html
It's interesting to note that the Pomodoro breaks, at least if you use the 25 minute interval most commonly recommended, fit in well with this recommendation from the Cornell Human Factors and Ergonomics Research Group [1]:
Sit to do computer work. Sit using a height-adjustable,
downward titling keyboard tray for the best work posture,
then every 20 minutes stand for 2 minutes AND MOVE. The absolute
time isn’t critical but about every 20-30 minutes take a posture
break and move for a couple of minutes. Simply standing is
insufficient. Movement is important to get blood circulation
through the muscles. And movement is FREE! Research shows that
you don’t need to do vigorous exercise (e.g. jumping jacks)
to get the benefits, just walking around is sufficient.
The conclusions on that page seem to be completely at odds with the study it claims to use as its source; please be careful about propagating quotes from it.
I use a chrome extension called Strict Workflow that is an implementation of Pomodoro (with website blocker), and I pair it with Any.Do's extension and have both right next to my browser bar. They work pretty well in tandem...
Pomodoro saved my butt during my senior year of college. I put off a book report until the last minute and found myself needing to read 5 chapters about medieval Italian republics in 3 hours. I allocated 1 Pomodoro to each chapter, and said that if I hadn't finished the chapter before the end, I would skip to the next one. This forced me to speed read and skip confusing parts (instead of re-reading them 10 times). The report wasn't one of my best, but I wouldn't have finished it at all without the structure I got from Pomodoro.
Posted this a few weeks ago, but workstation popcorn [1] is sort of like pomodoro this on a macro scale throughout the day & has helped me a ton with being more productive & simply getting stuff done.
The magic of this technique is that mechanically and reliably takes impossible tasks and makes them actionable. All that's required, you tell yourself, is 20 freaking minutes. I can do that. Anyone can do that.
What I usually find is that after the first session, I'm engaged enough to keep going. My emotions have caught up, my determination sets in, and now the desire and confidence to complete the task are strong enough that I rarely need to do more pomodoro sessions.
I was just going to comment that I'm using pomodoro as well. Glad I'm not alone. I wrote about the combination of strategies I'm trying to use to kick start a side project and pomodoro is one of them: http://refactoringfactory.wordpress.com/2014/02/21/the-side-...
I second this. Usually I get distracted anyways, so I program 8 hours and get it done in 12 or so. It's harder to use when you have a lot of outside constraints in scheduling (you can't really walk out of class for 5 minutes every 30 minutes), but I use it on weekends and when I have a free-ish schedule.