It has just occurred to me that the best way to throwing things out of one’s mind is to let it be absorbed by something else. I guess this is oft-overlooked fact, even though it seems to be quite obvious. In particular, forcing oneself not to think about something is not a wise strategy, since it leads to mental strain and thinking more and more, eventually yielding dejectedness that can be hard to get over.
And what could be more absorbing than debugging a SIGSEGV buried deeply in the innards of some library early in the morning? ;–)