In CS 101 I spent all night working on my final homework, walked into class, put the printed solution on the professor's desk, sat down in a desk right in front of his and fell asleep.
I dreamt about the homework problem, and realized I had made a mistake. I immediately woke up, grabbed the paper, and made the correction. The whole class burst into laughter, but the professor didn't seem disturbed. Later he told me something like that happens every few years (he's been teaching for 30).