Sometimes, I get jaded about technology. I see something blink or beep or run a complicated earth-saving algorithm, and I sigh. I wish I cared, but I can’t. Then, sometimes, I see something that shocks me back into being wowed. Writing a computer program that allows you to mouse-click a button to call your cellphone, it seems, is one of those wow things.
For my Computers for the Rest of you final, I’ve been writing a Processing program that reads a log of all the user’s typed (thanks to KeyloggerX), analyzes that log for unhappy words, and calls the user to cheer them up if the log proves too sad.
I started with just a push-button-to-call program:
And it works! If you press the square on the left, Asterisk calls my cellphone, says “goodbye” nicely, and hangs up. If you press the button on the right, it does the same to my girlfriend (she found that amusing at first, but after a few accidental calls at 2 a.m. I disabled that button — be nice to me or I’ll make it your number instead!).
After I got that working, I moved on to proper log analysis. Right now, that works too! Every three minutes, the program reads the text log. If you’re sad, it calls, and if not, it leaves you alone. It then trashes the log file and sits patiently for another three minutes.
Sad:
And not sad:
Right now there’s a few things to still work out — notably, that the Processing program craps the bed if it doesn’t find a text log file (that’s easily fixable), there isn’t much cheer-up audio (that’s a quick fix too), and the sad-test algorithm needs to be a bit fancier to find more sad words (not too tough). But, I’m on the right path!
And lest I forget, thanks in huge helpings to the kind assistance from Kate Hartman, Adam Simon and Sinan Ascioglu, who all gave me code snippets, told me about programmy things, and/or generally were nice about the fact I can’t code my way out of a paper bag without help.



Post a Comment