Maybe there is something to this "rapid cycling bipolar disorder" ...
I was up until 4AM working on some code for displaying the continued fraction of an irrational number, including bracketting off the periodic part. I had decided to look at the source code SymPy uses, and try to translate that into C/C++. It turns out I learned I could use C++ STL <map> to implement the way the Python code (SymPy) pulls it off, and the code turned out quite elegant (brief and to the point).
When I awoke this morning, the depression I had been experiencing all day yesterday had vanished, replaced by a humble sort of pride in my stubborn tenacity.
I wouldn't even care if my brain has been hijacked by the Soul of the Computing Machines ... if it helps me learn more about computational programming, so be it.