Alarm Clock of Justice
When I was in high school i had enough time to create a lot of projects. Some of them got picked up and used. Here’s a retrospective on the Alarm Clock of Justice, which I still occasionally get emailed about! I guess it was downloaded 10,000 - 50,000 times but I don’t really know
Huh you can even get it at download.com but be warned it’s probably not going to work well for you.
The Alarm Clock of Justice was made probably around 2005. This was before everyone had cellphones with alarms in them. Often people like myself would have desktop computers in their rooms running Windows XP. Computers were generally louder than today so you wouldn’t want to leave one on all night. But Windows had (has?) Hibernation which is basically shutdown mode. If I could find a way to wake up the computer from Hibernation then I could play an alarm. Long story short: CreateWaitableTimer will let you set a timer that will wake up the computer from sleep in the future.
I wrote the Alarm Clock of Justice in VB.NET and C. Here’s the split between the two:
- DateTime logic
- Alarm playing
- Most everything else
- Wake computer from sleep (CreateWaitableTimer + WaitForMultipleObjects)
- Volume control
- I think a low-level global keyboard hook? (For snooze!)
The Alarm Clock of Justice evolved through my usage of it. I used it every day to wake up for several years. I would often add features that I wanted and refine the UX. Snooze and backup alarms are excellent examples of this. The snooze experience is actually quite good. A lot of alarm clocks will let you disable the snooze too easily and go back to sleep! I know this happened in Alarm Clock of Justice. So in order to prevent sleeping in through snooze disablement I made snooze disablement require you to be somewhat awake: you had to hit a key combo like “Ctrl+O” or something. I chose the key to be in a weird position in my keyboard. I distinctly remember being too asleep one morning to correctly disable snooze! Oh also you can select the number of snoozes you get. Oh and according to the screenshot I have you can actually set a file to play when you snooze. So when you snooze you can start some program to display some picture or something.
Let me show you a screenshot:
Do you see the many tabs-inside-tabs? Those actually all worked.
Here’s what I can remember of the feature list:
- Wake your computer up to play an alarm
- With adjustable wake up time! (Some computers took a really long time to wake up)
- Alarm can be made of
- Playing a song
- Opening a program
- Controlling the volume
- Fading In (and Out)
- Some other awful settings?
- Showing a picture on the screen
- Flashing random colors
- Enforce a snooze limit
- Turn off the display when going to snooze
- Mute the volume when going into snooze
- Run a program/file when going into snooze
- Holy crap! The Backup Alarm
Holy crap. I once received an email from a soldier in Afghanistan who asked me if there was “any possible way to turn off the backup alarm?” I wish I was more organized in my youth and hadn’t lost all my darn email. Anyway if you didn’t respond to your alarm (disabling snooze?) the Alarm Clock of Justice would assume you are still sleeping and that it will take drastic measures to wake you up:
I took great care to ensure the backup alarm was always able to play. For example the Alarm Clock of Justice exe is 6MB because it embeds the .wav file (no decoder required!) directly into the exe so even if the file is deleted the program still has it in memory (I think? Maybe resources are paged in on demand. I didn’t understand such things when I was programming it).
- Blast system volume to 100% - every 100ms!
- Play the Alarm Clock of Justice song - forever
- My brother playing the guitar and myself screaming for about 1 minute
- The usual stuff like “turn display on” etc
In hindsight I really enjoyed this feature but, based on the emails I received, it probably caused more harm to humankind than good.
Eventually I moved my computer out of my room so I stopped using it.
Written late at night on Dec 7, 2016.