20140507

Superego


"You really do need a system"  —Leonard Shelby, Memento


Until a few months ago, a lot of my evenings went like this: after everyone else went to sleep, I'd fire up the computer, grab a sleeve of crackers and a fresh tub of Nutella, play video games, and read Facebook, Twitter and Hacker News.  I was rolling!  I'd roll straight through to one-thirty, two and beyond.


Basically this


The next day, I'd wake up bleary-eyed with a nasty grumpy brain fog.  Bad, bad, bad, I was mad at myself for being so stupid.  I did the math and on average, I was getting six hours' sleep, not really enough.  And in retrospect, the late nights weren't even that much fun.  Like eating a whole bag of potato chips in one sitting, in recollection, they don't seem so delicious.

I tried to be more responsible, many times, but nothing worked for long.  During the day I wanted to do better; but when night came, I wanted to stay up and play.  I started tracking my sleep with the Jawbone UP; that helped for about two weeks.


A device for measuring my failure


Three months ago, after yet another morning waking up tired and angry, I realized that simply wishing and wanting to do better was not enough.  I put on my thinking cap.  What was actually going to fix the problem for real?   Well, I'm a software programmer; I program things.  I can't program myself, but I can program my computer — to simply kick me off after a certain time of night.

So I built a system, called Superego, which does just that.  It works like this:

A) The Jawbone UP tracks my sleep.
B) Superego sets the day's Computer Curfew time based on how much sleep I've been getting lately.
C) At Computer Curfew time, Superego shuts off all web browsing and games until 6am the next morning.

Now I'm getting seven and a half hours of sleep a night.






Some common questions:


I need this!  Let me have it!

If you've got a Mac, sign up and go for it!



Can't you just work around Superego by using your computer's administrator password?

Yes, and that's why I hid my administrator password.  I made a new password and printed out five copies.  One is at work, one's in the cellar, another's in my wife's nightstand, and there's one in each of my kid's piggy banks.  During the day, I can easily get the password if I need it.  But at night, my wife is a light sleeper, so if I try to open her nightstand drawer, she'll catch me.  If I make the long trip down to the cellar, I'll come to my senses, give up and just go to bed.

Most important, if I do somehow circumvent the system and stay up late, the next day I will do what it takes to prevent a recurrence — for example, hide the passwords in places even more remote.


How is the Computer Curfew time set?

The Computer Curfew time adjusts every day based on how much sleep I'm getting lately.

It's like how you hit a target with a bow and arrow on a windy day.  You aim and shoot; if the arrow falls a little to the left, you aim your next shot a little further to the right.  With the Computer Curfew, the target is seven and half hour sleep.  When I get less sleep than the target, the next day's Curfew is earlier; if more, later.

For example, last night was a good night — eight hours, sixteen minutes, more sleep than I need — so tonight's curfew is 10:25pm, fourteen minutes later than the previous night.

The actual math is nothing too fancy; a weighted average to compute recent sleep, and another to compute the recent curfew.  If recent average sleep is ten minutes more than the target, then tonight's curfew will be ten minutes later than the recent average curfew.


Can't you just stay up late watching TV or reading instead?

For whatever reason, late-night TV and reading are not a problem for me; I don't like TV, and when I read at night, I fall asleep pretty fast.


This would never work for me, my problems are different.

Indeed, people have all kinds of different sleep-related issues.  If you think a modified version of this system could help you, let me know.  I love doing this kind of self-improvement stuff.




Why so much effort and nonsense, why don't you just go to sleep at a reasonable time?

Ha!  If you are one of those "willpower" people who can just decide to do something and then actually do it, good for you.  The rest of us aren't so lucky.




I have more questions!

Please ask away!  I'll add the common ones to this article.






13 comments:

  1. Great idea, I really need your help, the idea that "oh I will do better next time" gets kinda tired after a while. I need someone else to manage my computer time. If I asked my partner of 19 years to manage me it would be unfair. I need some (the computer) to just say no.

    ReplyDelete
    Replies
    1. Hi Brian, thanks! If you haven't already, you can sign up for the system here: http://bit.ly/superego_survey. Hope it helps. —David

      Delete
  2. Will your system work with other sleep trackers such as Fitbit?

    ReplyDelete
    Replies
    1. Fitbit for sure! In fact, I've already got the Fitbit connection working.

      Delete
  3. Holy crap. Well done. This is EXACTLY what I do. Although less fancy. (substituting Nutella with PBnJ, port with a beer or whiskey, and software eng with web dev).
    Thanks for this - I thought I was alone in my geeky, embarrassing, self-inflicted insomnia.
    I signed up.

    ReplyDelete
  4. I have the same freakin problem. Only it's on my iPhone, in bed. I can't get in as much trouble if I have to go sit up at the computer. How about developing an app for that? I have other friends who'd buy it too. I've used every iPhone sleep tracker out there.

    ReplyDelete
  5. This sounds great! Any chance it will be available for PC soon?

    ReplyDelete
  6. This sounds great --can it work on my iPad and iPhone as well?

    ReplyDelete
  7. How do you change the time zone? I live in Holland but it says it's set to some time in the USA so it's the morning now and it's closing down my browser every few seconds...

    ReplyDelete
  8. Hi WASVL, sorry about that! email me at dsjoerg at gmail dot com and I'll help you out.

    ReplyDelete
  9. Just heard the re-podcast from New Tech City and thought, "That is me!" Would love to sign up but are there plans for PC and iOS versions? I hope so!

    ReplyDelete
    Replies
    1. Hi Sleepy, no plans for PC or iOS, sorry!

      Delete