(Not that anyone cares.)

7:00 - Cereal mixed with yogurt.

12:00 - Schwan frozen pizza.

5:30 - Tuna melt.

Note 1: Buy a new can opener.

Note 2: All times are approximate.

Retirement School

June 17, 2008

The best sentence I’ve read today:

[...] many jobs that require a college education today will require little in the way of education tomorrow. Many people may then defer college until retirement, in order to increase the returns to leisure by widening their cultural horizons.

Prediction

June 16, 2008

OS X is serving as a gentle introduction to *nix for previously *nix-fearing developers. In these users’ next few upgrade cycles they will start moving to operating systems like Linux, OpenSolaris, or the *BSDs.

Last Day of the Month

June 15, 2008

When a blog has never been visited my dissertation software retrieves any posts from the past 24 hours. This isn’t hard:

from datetime import datetime
lastvisit = datetime.utcnow().replace(day=(datetime.utcnow().day-1))

But when this happens and it’s the first day of the month you get:
ValueError: day is out of range for month
Since my project is only going to run for this summer, I did changed it so that it will work this year but not next year (sorry, WordPress strips out all of the tabs…):
from datetime import datetime

n = datetime.utcnow()
if n.day != 1:
    lastvisit = datetime.utcnow().replace(day=(datetime.utcnow().day-1))
elif n.month - 1 in (1, 3, 5, 7, 8, 10, 12):
    lastvisit = datetime.utcnow().replace(month=(n.month-1), day=31)
elif n.month - 1 in (4, 6, 9, 11):
    lastvisit = datetime.utcnow().replace(month=(n.month-1), day=30)
elif n.month - 1 == 2:
    try:
        lastvisit = datetime.utcnow().replace(month=(n.month-1), day=29)
    except ValueError:
        lastvisit = datetime.utcnow().replace(month=(n.month-1), day=2 8)


Today I ran across this article on ASPN. And now here’s what I would write (omitting some of the boilerplate from above):

if n.day == 1:
    days_in_month = [calendar.monthrange(year,month)[1] for year in [n.year] for month in range(1,13)]
    datetime.utcnow().replace(day=days_in_month[n.month-2], month=n.month-1)
elif:
    datetime.utcnow().replace(day=n.day-1)


If I would have spent 5 minutes looking for The Right WayTM to do this, I would have saved a little time and had cleaner code. Now I don’t want to change what I’ve got working well enough.

Dear Lazyweb: How do I post pretty code snippets?

Random Data

June 15, 2008

In the last 3 and a bit days my software has gathered over 125,288 posts from 96,000 blogs. 37,594 blogs have at least one post from that period.

Below’s a crappy table ripped right from the mysql console. The first column is the total number of posts and the second column is the number of sites that have the corresponding number of posts.

+—————–+—————–+
| number of posts | number of sites |
+—————–+—————–+
|             100 |               1 |
|              89 |               1 |
|              87 |               1 |
|              83 |               1 |
|              79 |               2 |
|              75 |              12 |
|              74 |               1 |
|              72 |               1 |
|              70 |               1 |
|              69 |               1 |
|              68 |               3 |
|              66 |               1 |
|              65 |               3 |
|              63 |               3 |
|              62 |               2 |
|              61 |               1 |
|              60 |               3 |
|              59 |               2 |
|              58 |               4 |
|              57 |               1 |
|              56 |               2 |
|              55 |               2 |
|              54 |               2 |
|              53 |               4 |
|              52 |               8 |
|              51 |               2 |
|              50 |               2 |
|              49 |               3 |
|              48 |               6 |
|              47 |               4 |
|              46 |               2 |
|              45 |               3 |
|              44 |               4 |
|              43 |               8 |
|              42 |               9 |
|              41 |               8 |
|              40 |              10 |
|              39 |               5 |
|              38 |               7 |
|              37 |              10 |
|              36 |              10 |
|              35 |              12 |
|              34 |               7 |
|              33 |               7 |
|              32 |              12 |
|              31 |               9 |
|              30 |              16 |
|              29 |              19 |
|              28 |              16 |
|              27 |              32 |
|              26 |              27 |
|              25 |              43 |
|              24 |              28 |
|              23 |              45 |
|              22 |              45 |
|              21 |              49 |
|              20 |              66 |
|              19 |              69 |
|              18 |              78 |
|              17 |              71 |
|              16 |             116 |
|              15 |             106 |
|              14 |             140 |
|              13 |             166 |
|              12 |             184 |
|              11 |             259 |
|              10 |             312 |
|               9 |             410 |
|               8 |             548 |
|               7 |             791 |
|               6 |            1093 |
|               5 |            1699 |
|               4 |            2959 |
|               3 |            5139 |
|               2 |            8170 |
|               1 |           14695 |
+—————–+—————–+

Gin, Fire and Boobies

June 13, 2008

I’d bet Clay Shirky would probably call MMORPGs one of the many “gins” of our era. I’d agree. But that’s not going to deter me from giving Age of Conan a try when I get home in September.

Scott Jennings convinced me in his post about how you can set stuff on fire. And I mean lots of stuff.

I can’t wait to play with fire (and boobies) come September!

Irony

June 10, 2008

Some days I absolutely love to program and forget why I want to retrain.

Via Coding Horror:

Programming is all about knowing when to boil the orange sponge donkey across the phillipines with an orangutang gorilla crossed with a ham sandwich to the fourth power of twelve across the nile with an awful headache from the previous night when all of alfred’s naughty jalapeno peppers frog-marched the nordic elves across the loom-lined geronimo induced swamp donkey over and above the fortran fortified kilomanjaro fence past the meticulously crafted anti disgusting sponge cake scenario where all the hats doth quoteth the milk which is not unlike the super werewolf from the infinite realm of ninja-step. it’s hard to define, really.

I always knew it was all about donkeys and things made of sponges.

But seriously, comments are good. I sometimes think bloggers should promote the best comments up to replace the original post.

Wanna know why?

Because every time I want to write I have to log into this big flashy website, when all I want to post is a little text and a few links. I don’t need tags. I don’t need categories. I don’t need previews. I don’t need rich editors and statistics.