The most effective coding regime I have found is to program in the starting in the morning up through about 1pm in the afternoon. After that I drink 1/2 cup of red wine and start drinking water to thin my blood in preparation for a 3 mile run.
I have done memory tests before and during the run. I find myself better able to remember obscure memories of the far past after exercise.
One of the reasons for this may be the brain, just like muscles, works harder during strenuous exercise and is fueled by lactate, rather than glucose. You can read more about the brain using lactate in this article.