Category Archives: Tech

Tech

JustSit 0.2.2 is Out

Just uploaded, you can download the APK here. I think I’m going to release this one on the Android Market as well.

I fixed an outstanding screen rotation bug, made it so that vibrate mode applies to both the bell and the ringtone, and upgraded to the Android 1.5 (Cupcake) API.

New Theme

I recently learned of the Blueprint CSS framework, and wanted to apply it to a project I’m doing for work. However, I needed something simpler to try it in first, so I used it to design a new WordPress theme for this blog. This is something I’ve been wanting to do for a while, but it wasn’t really a priority.

Overall, I’m pretty happy with how it turned out, and Blueprint made it easy to get the layout right without hours of CSS fiddling. I’m not a CSS expert by any means, so often hours of fiddling are unavoidable if I need to do some complicated CSS.

For comparison, here’s an archive of what the old theme looked like:

I still want to theme the comments at some point, to get the Gravatars bigger, but it’s not a high priority. That aside, what do you think of the new theme?

Death Stats

Inspired by this blog post by Tim Ferriss and the letter “On the shortness of life” by Lucius Seneca contained therein, I created a “death stats” script to help remind me to make good use of the time that I have left.

Of course, I could die in a car accident any day, but we have to think of these things practically and probabilistically.

The script runs in Bash — you’ll need a Mac or Linux machine, or Cygwin on Windows I suppose, in order to run it. I have it running on my webserver and emailing me each morning via a cron job. The math should be pretty self-explanatory, and you could easily add your own metrics. Note that I’ve changed my exact birth date for the posted script here, since in some situations that could be considered confidential information.

The estimated death date I got using the “Normal” mode of the Death Clock.


#!/bin/bash
# Prep
# YYYYMMDD
BIRTHDATE="19820301"
DEATHDATE="20570127"
DAYSPERYEAR="365"
SECONDSPERDAY=$((24*60*60))
SECONDSLEFT=$((`date -d $DEATHDATE "+%s"`-`date "+%s"`))
SECONDSTOTAL=$((`date -d $DEATHDATE "+%s"`-`date -d $BIRTHDATE "+%s"`))
# There's probably a nicer way to format the percentage but this works
PCTOVER=`echo "scale=2; (($SECONDSTOTAL - $SECONDSLEFT) / $SECONDSTOTAL)*100" | bc | sed "s/\.00//"`
DAYSLEFT=$(($SECONDSLEFT / $SECONDSPERDAY))
YEARSLEFT=$(($DAYSLEFT / $DAYSPERYEAR))
# Output
echo "Percent Over: $PCTOVER"
echo "Days Left: $DAYSLEFT"
echo "Years Left: $YEARSLEFT"

The output looks like this (the numbers are made up):

Percent Over: 29
Days Left: 19002
Years Left: 51

I do hope and think it reasonably likely that Ray Kurzweil is right, and that my life could be substantially extended, but I’m not counting on it, and I don’t think I should — it would kind of defeat the purpose here. Read the letter by Seneca in Tim Ferriss’ post to see what I mean.

Suggestions for improvements to the script are welcome.

NB: This doesn’t work on OS X, because the date command is different.

Back to Windows

After many years of using and promoting Linux, and more recently the Mac, I’m giving up the fight and going back to using Windows. Perhaps ‘back’ is the wrong word, since I’ll be switching to Vista. I’ve gotten tired of not having the device drivers I need, having to research every accessory I buy to see whether it will work on the Mac or in Linux, futzing for hours with arcane commands and configuration files just to get my webcam to take a picture.

I’m also sick of missing out on current events, like the Conficker worm, which somehow made the top story on Google News last night. Top story! I was feeling really left out. Once I have windows installed on my Mac Pro, though, I should be able to join the Conficker party in no time.

Sure, it’ll be difficult to do my work, since it relies largely on UNIX-based software, but hey, that’s what Cygwin is for, right? And PuTTY. Got any recommended software for me? It’s been a while since I was a full-time Windows user. A Quicksilver replacement would be particularly welcome. And send me a copy of Conficker if you have it — thanks.