Sunday, September 30, 2007

Scientific Method

Taking these science classes, both books open with a bit on the scientific method. Being a complete moron, i'd never heard of this "Method" previously and decided to attempt to apply it. Sitting at a bar (and not even drinking), i came up with a theory: i communicate using fewer words than others. A bit later i get some work via IM and see potential for a hypotheses: my IM logs will show i've written less words to others than others have written to me. That's easy enough to research, i've just over 1.5 year's worth of IM logs to parse. A few lines of perl later and here is my word count, their word count, and the former divided by the latter:

Me Them Diff
44 37 1.19
53 181 0.30
53 289 0.18
94 146 0.64
200 453 0.44
231 401 0.58
279 238 1.17
323 146 2.21
339 428 0.79
347 392 0.89
398 374 1.06
399 855 0.47
511 627 0.81
682 773 0.88
1251 1137 1.10
1341 1021 1.31
1375 1831 0.75
1469 2596 0.57
2519 3084 0.82
2849 3565 0.80
3221 2194 1.47
3947 3707 1.06
4908 8957 0.55
5323 7113 0.75
6071 3920 1.55
6128 4624 1.33
8124 8035 1.01
11096 17018 0.65
34601 53853 0.64
64800 84477 0.77
Total: 162976 212472 0.77

Out of 30 people, 11 use fewer words than me and 19 use more words. Overall (and rounded a little), i'll use 4 words for every 5 someone else does.

Next i should look through my collected e-mail from the past few years and see if the trend continues through that medium, but instead i'm going to be distracted by my IM logs for a few more days, and past that i've still some visuals to work on.

Labels:

Saturday, September 22, 2007

Devaluation



Thought i'd get just past the end of the summer on these $3 sandals, but instead these started breaking 2 months in - that's not even 1 month to the dollar. Biking with the metal pedal biting into my foot is a bit trying.

Thursday, September 20, 2007

You can safely ignore this post.

This will interest very few of my readers, make sense to even less, and be worth reading to maybe .35 of you (if you happen to find this post fully worth reading, there's a good chance i only think of you as a tenth (or less) of a person). I suggest you wait for the next post.

I have a tendency to keep my IM client logged in 24/7/365 independant of whether i'm near a computer. Currently i only run my IM client on one machine (my work machine) and remote display it onto my home machine when i'm not at work. I also log everything and have scripts that assist me in viewing the most recent messages (necessary if i kill the client to remote display it - sure i could run it in vnc but don't feel like it). Sometimes i get messages i'd prefer to read before i get back to a computer, so yesterday evening i started on a script that prints the last X minutes worth of messages. Here's the script:

#!/bin/sh
#
#prints out last few minutes worth of logged gaim messages.
# Usage: $0 [minutes] defaults to 15 minutes.

diff=$1
if [ X"$diff" = X ]; then
diff=15
fi

#convert time into something manageable
h=`date +'%H'`
m=`date +'%M'`
time=`expr $h \* 60 + $m - $diff`
mtime=`expr $h \* 60 + $m + $diff \* 2`

#took me only 2 hours to forget why i am using this tmpfile, it looks wrong
tmpfile=`mktemp /tmp/XXXXXX`
echo 0 > $tmpfile

#find all files that have been modified in the requested time interval
find $HOME/.gaim/logs -mmin -$diff -a \! -path '*.system*' | while read file; do
found=0

#run through all the lines in that file, looking for the first
#timestamp within the range we want
while read line; do
if [ $found = 0 -a `echo $line | grep '^('|wc -l` = 1 ]; then
ch=`echo $line | sed -e 's/:.*//' -e 's/^(//' -e 's/[^0-9]//g'`
cm=`echo $line | sed -e 's/:..).*//' -e 's/^(..://' -e 's/[^0-9]//g'`
ctime=`expr $ch \* 60 + $cm`
if [ $ctime -ge $time -a $ctime -le $mtime ]; then
echo
echo $file | awk -F/ '{ print $8" on "$6":"}'
echo $line
found=1
echo 1 > $tmpfile
fi
elif [ $found = 1 ]; then
echo $line
fi
done < $file
done

retval=`cat $tmpfile`
rm $tmpfile
exit $retval


With that utility, i only need to answer the following questions:
1) am i running gaim at work?
2) is one of gaim's parents sshd (and thus it's being remote displayed - would be easier to check if i installed ptree, or if this were Solaris (pargs and the other p* utils are great!))?
3) is my screensaver running at work?
4) is my screensaver running at home?
5) is my monitor at home on?

Based on that information, i can determine whether or not i am actively using a computer that i am running gaim on, and hence whether or not to run the aforementioned script that prints the last few messages. If there are any messages i can then mail these to my phone (this step would be easier if OpenBSD's mail command supported the -e option like Solaris and FreeBSD). Luckily this second part fits nicely into a small cron entry:

*/15 * * * * t=`mktemp /tmp/c.XXXXXX`; if [ `pgrep -u $USER xlock | wc -l` -ge 1 -a \( X`echo $(ps -o ucomm= -p $(ps -o ppid= -p $(ps -o ppid= -p $(pgrep gaim))))|awk '{print $1}'` != "Xsshd" -o X$(ssh inti.blackant.net 'if [ `pgrep -U $USER xlock|wc -l` -ge 1 -o `DISPLAY=localhost:0 xset q | grep "Monitor is On"| wc -l` = 0 -o `pgrep -u $USER xlock | wc -l` -ge 1 ]; then echo yes; else echo no; fi' 2>&1 | tail -1) = Xyes \) ]; then $HOME/bin/lastgaim 15 > $t 2>&1 ; if [ `wc -l < $t` -ge 1 ]; then mail -s 'gaim check' $myaddress < $t; fi fi ; rm $t

This could all be more readable and efficient in perl, and even more efficient if it were done as a plugin to the IM client (the next step, though right after upgrading the client, instead of continually patching), but sometimes it's nice to excercise shell skills. I'm sure there's plenty up there that should be done better. I'm also aware there are a million caveats (plus a bug or three) to the above, such as i get the last 15 minutes of messages, even if the screensaver's only been on for 5. Until i get the plugin written (or find the one that has already been written), i can live with that.

Labels:

Tuesday, September 04, 2007

Attacks

The first attack came at dawn, a sudden thrust at my head, but this initial foray was quickly crushed. The second attack came by night a few days later, and this time they were much sneakier, the blitz from below, striking deeply and leaving wounds for a week. The third strike again came in the morning light - the enemy, bolstered by previous success, lead a full frontal assault, with all their might and power. The end result: their End left in my forehead. I immediately stopped and shook the attacker out of my helmet and finished the remaining miles to work. In the mirror, i saw the remnants of their assault - a full 4 millimeters of stinger in my skin, half their rear, and what i will assume is their poison sac, fully depleted, having run through my veins the past 5 miles:


bee stinger i pulled from my forehead, on a Czech 50 koruna for scale


closeup of same

Labels: ,

Sunny Times


Spent the weekend making sun jars. I found the components for a total of just under $15, and they are quite addictive to make, so i made 7 of them and have 6 more in the works. And am broke.

Labels: ,