Take a rest when you find a problem.
Procrastinate positively. If you don’t want to do the #1 item on your todo list, just look for what you can do now on the list below.
Get your motivation from your machine. If you do like to start working on your program, just compile it. If you see errors or warnings, you are easily tempted to fix it. Now you are motivated.
Write down and divide what to do. Then each item is easy. Once the work is divided to the concrete action which can be done within ten minutes or so, you are automatically tempted to work on it.
When reading a document, do not expect that it is designed to be read sequentially. Use two threads: One for skimming through the big picture, and the other to get details. When the first thread gives you some questions, it is time to start the second thread.
Listening to nice sound activates different portion of brain and it helps to relax tention.
Working alone makes your brain clock slower and dull. Good music gives you faster and confortable pulse.