Situation:

* Your program has a problem.
* You spend ages debugging the program.
* You give up and ask on StackOverflow.
* While writing up the question you realise the answer.

This happened to me just 10 minutes ago. Anyone else ever had this happen to them?