06.21.08
Posted in personal at 5:07 pm by danvk
I’ve become a big fan of The Onion’s crossword puzzle recently. Here’s a few reasons to love it:
- It’s free. Unlike some other papers.
- It’s convenient: there’s an Onion distribution box within 100 feet of my apartment.
- It’s online (w/ answers!). Here’s a link to the June 17 puzzle.
Now some spoilers… don’t read these if you plan on doing that puzzle I linked to!
Permalink
06.12.08
Posted in programming, web at 12:41 am by danvk
Inspired by the sorttable library, I’ve done some Javascript hacking over the last day and created dragtable, a complementary library which lets you drag column headers around to rearrange HTML tables. A demo will make everything clear:
| Name |
Date |
Favorite Color |
| Dan |
1984-07-12 |
Blue |
| Alice |
1980-07-22 |
Green |
| Ryan |
1990-09-23 |
Orange |
| Bob |
1966-04-21 |
Red |
|
Drag the column headers to rearrange the table. dragtable is incredibly easy to use. To make a table rearrangeable, just add class=draggable to the table tag. And, if you set class="draggable sortable", you can have a table that’s simultaneously sortable and rearrangable! For more details and a download link, check out the dragtable page.
I’m calling this v0.9 since I’m sure there are plenty of bugs and tweaks left to make. I’d love to get some feedback, so take it for a spin and tell me what you think!
Update: I’ve added full-column dragging and bumped the version to 1.0. Head on over to the dragtable, grab a copy, and let me know what you think!
Permalink
05.27.08
Posted in news, personal, tv at 8:35 pm by danvk
Last we spoke, I swore to not pay attention to the news for a few months. How quickly the world changes when you’re not paying attention! I walked by a TV this afternoon and heard a general saying this:
We want to capture R. Kelly, the world’s most notorious terrorist.
I know R. Kelly is bad, but the world’s most notorious terrorist? It took me a minute to realize what the quote really was:
We want to capture or kill the world’s most notorious terrorist.
What does this say about me!?
Permalink
05.20.08
Posted in news, politics at 11:49 pm by danvk
I came to a realization last weekend while watching Mike Huckabee, Harold Ford, Jr. and various pundits discuss VP candidates on Meet the Press. We’re going to be hearing this exact argument for the next three months. I’ll care then. After the Oregon and Kentucky primaries tonight, I’m going to stop paying attention to the presidential race. There’s just not going to be any news of note until this fall. Why worry?
But before checking out for a few months, I’ve got one last Presidential Primary post left in me.
The question for the last few weeks has been “why is Hillary still in this race?” She can’t win a majority of pledged delegates, overall delegates, states, or votes (unless you use very strange definitions of who “counts”). Could she have something up her sleeve with Michigan and Florida?
According to Daily Kos, here was the delegate count at the end of the night:
| |
Pledged |
Super |
Total |
Needed |
| Obama |
1,656.5 |
304.5 |
1,961 |
64 |
| Clinton |
1,501.5 |
277.5 |
1,779 |
246 |
| Remaining |
86 |
214 |
300 |
Obama passed 1,622 pledged delegates tonight and claimed a majority. But that excludes Florida and Michigan. Florida had 185 delegates and Michigan had 156. To get an absolute majority of pledged delegates including Florida and Michigan, he’d need 1,622 + (185 + 156)/2 = 1792.5 delegates. With only 86 pledged delegates left, there’s no way he can make Florida and Michigan irrelevant.
Or so goes the argument. But what did those excluded Florida and Michigan actually look like?
I don’t know precisely how the “Uncommitted” delegates work, but I imagine they’d be under enormous pressure to vote for Obama at the convention. Add those in and you get:
| |
Pledged |
Fl.+Mi. |
Total Pledged |
Needed |
| Obama |
1,656.5 |
124 |
1780.5 |
12 |
| Clinton |
1,501.5 |
178 |
1679.5 |
113 |
| Remaining |
86 |
0 |
86 |
So if you include the Florida and Michigan delegations, he hasn’t passed that magic mark, but he’s extremely close. And more interestingly, he’s the only one that can pass that mark. Hillary needs 113 pledged delegates for a majority, but there are only 86 left. This is because of the Edwards delegates.
If you don’t give Obama the 55 uncommitted delegates from Michigan though, he’s unlikely to pass the 50% mark, even by June 3. Could that be the trick? It seems a bit far-fetched. We’ll find out in three months when I start paying attention again!
Permalink
05.06.08
Posted in personal, travel at 10:52 pm by danvk
First off, apologies for the Craig- and Ryan-like pace of updates to danvk.org.
On Sunday, Ryan and I rode out to the far Western edge of San Francisco, just north of Ocean Beach. While it’s only six miles from my apartment, this felt like a much longer trip. There are no freeways in this part of the city, so our route was stop and go through neighborhood after neighborhood: Russian Hill, Nob Hill, Pac Heights, Laurel Heights, Inner Richmond and Outer Richmond.
This is the land of Adolph Sutro, a former mayor of San Francisco who I learned about from this Sparkletack episode. Sutro’s two claims to fame in this area are:

The second Cliff House, which lasted from 1896-1907. This must have been especially dramatic back then, when this area was completely uninhabited. Nowadays we’re on the third Cliff House, a swanky restaurant with spectacular views. I’d love to eat there someday, but that degree of swankiness requires a special occasion.

The remains of the Sutro baths, which Sutro once hoped would be his great legacy. It’s a shame that these public baths no longer exist. I can only imagine how nice it would be to relax here with a magnificent view of the ocean and feel the sea breeze coming in. The rocks you can see peeking out of the sea were covered in mussels, which made the waves slowly drain off them, rather than crashing. It was a sight to behold.
Here’s what the baths used to look like. I believe you can see the lack of a Cliff House in the background.

I was disappointed to find out that the baths were enclosed. While it is a spectacular building, I liked the idea of catching the sea breeze from the baths. I also find it amazing how very old these ruins look, even though the building only burned down in 1966.
Permalink
02.27.08
Posted in news, reviews, tv at 8:00 pm by danvk
FRONTLINE on PBS, the documentary series that takes on the tough, complicated issues and finds them… tough and complicated.
It’s rare for me to watch a documentary and conclude that it undereditorialized, but that’s exactly the reaction I’ve had to the first few episodes of this season.
First we had The Medicated Child, which looked at the rapid increase in drug prescriptions for ADHD and Bipolar disorder in children. Frontline’s approach was to follow several families that had either put their children on drugs or decided not to. Each family had widely varying reactions. One family felt that the drugs prevented their child from committing suicide. Another felt that the drugs had led directly to their child committing suicide. And so on. I doubt that these cases are typical, but with only a few stories in the show, it’s difficult to get any sense of proportion. The issue of what’s caused the increase in prescriptions, the issue I found most interesting going into the show, was hardly touched.
Then there was Growing Up Online, which purports to look at the increasingly prominent role of the internet in the lives of kids. I was really excited about this one since, unlike with most documentaries I see, I have very direct, personal experience with this issue. I was left with the distinct impression that I knew more about growing up online than the producers did. Once again, they followed a few extreme examples. One girl created an entire online world revolving around erotic, gothic pictures of herself. Another boy was driven to suicide by cyberbullying. These are interesting cases, but again, they are so rare that they throw off all sense of balance in the episode. The show was not without its strengths, however. Some of the kids had interesting perspectives on the role of the internet that I was able to relate to. And most interestingly, it showed me how growing up online has shifted since I did it. We had AIM and email when I was a kid, but most people didn’t have blogs and there was no Facebook. We had dialup. Going online was a decision. Nowadays kids have laptops, cable and wireless connections that are always on. Being online is no longer an experience, it’s just a given.
Finally we have Rules of Engagement, which looks at the incident in Haditha, Iraq. I was inspired to watch this by an interview with the director on On The Media, one of my favorite podcasts. Haditha is an especially thorny issue, even by FRONTLINE standards. The Marines say one thing. The Iraqi’s say something completely different. Several Marines have changed their stories, but only after being offered immunity to testify against one another. There’s essentially no physical evidence. It’s just one man’s word against another’s. I certainly feel as though I understand the Haditha situation better after watching this documentary, but I have no idea who to believe.
I guess this is a problem inherent to the documentary. Is a mere data dump valuable? Is it possible? Is it better to editorialize explicitly and make an argument, or is it better not to take sides and only incidentally present a skewed or unbalanced view.
I don’t know the answers to any of these questions, but I do know that FRONTLINE has left me wanting unqualified statements of fact. Maybe I’ll go read some math books…
Permalink
02.03.08
Posted in personal, programming at 3:50 am by danvk
I found a disk image I’d made of an old hard drive of mine today (circa 1995) and had some fun browsing through my files. Back then, I was programming in a combination of QBASIC and GW-BASIC. It’s easy to read old QBASIC programs, since QB saved code as human-readable text.
Not so, GW-BASIC. To save space, it stored code in a compact, binary format. This seems like an unnecessary optimization now, but back in 1984 it made a lot of sense. GW-BASIC was an interactive environment, and it stored all your code in memory. Memory was a scarce resource at the time, so every byte counted. Hence the binary format.
I wanted to read my old GW-BASIC programs, so I dug around and found this discussion of the GW-BASIC binary file format. It’s incredibly detailed, which let me whip up a decoder in Python over two solid hours of hacking. Without further ado, here it is:
GW-Basic Program Decoder
For a sample decoding, see below the fold.
Read the rest of this entry »
Permalink
01.30.08
Posted in news, politics at 11:20 am by danvk
The big news of the day is that John Edwards is dropping out of the Democratic presidential race. It’s not clear to me whether this helps Clinton or Obama. From what I can tell, Edwards’ main constituency was older, white men. In the past, men have tended to favor Obama, whereas older people have tended to favor Clinton. It will be interesting to follow the polls over the next few days.
One thing that’s certain about Edwards’ decision is that it’s a good one for the Democratic party. Because each state awards delegates proportional to its popular vote, he could have grabbed maybe 5-10% of the delegates. This would have almost certainly prevented either Clinton or Obama from getting a majority, and led to a brokered convention. Now, that could only happen if there were an exceptionally close delegate race.
Permalink
01.19.08
Posted in sports, tennis at 3:22 pm by danvk
Because of the 15 hour time difference, most Americans don’t get particularly excited about the Australian Open. It’s our loss. The first major of the year always manages to produce some interesting stories, and this year is no exception. Good thing there’s danvk.org to help you catch up!
Yesterday alone saw:
I managed to catch the last set of the Federer match, and it was fantastic. Both players played well. Federer had less trouble on his serve in the final set (he set a career high for aces in a match), but with each passing game it seemed like the chances of some random twist turning the match the other way increased. After all, the last time Roger lost here was in 2005, when Marat Safin knocked him out in a five-setter that ended well after midnight.
It’ll be fun to see if Tipsarevic continues to play this well. He seems like an interesting guy. He’s the only tennis player I know of who wears goggles on court, and he has a Dostoyevsky quote tattooed on him (”Beauty will save the world” from The Idiot). Frankly, I’m surprised that more young players don’t throw the kitchen sink at Fed like Janko did. It’s a great way to make a name for yourself. After all, people first started noticing Federer when he knocked off Pete Sampras at the 2001 Wimbledon Championships.
The announcers on ESPN pointed out an interesting fact about this tournament. It’s the first time in many years that a single tournament can decide who will be #1. Here’s how it works:
- Rankings in tennis are based on your performance in events over the last 52 weeks.
- Rafael Nadal has 5780 points
- Roger Federer has 7180 points
- At a Grand Slam you get 1000 points for winning, 700 for runner-up, 450 for semis, 250 for quarters, 150 for round of 16, 75 for round of 32, etc.
- Roger got 1000 points last year — if he’d lost yesterday, he would have dropped to 6225 points
- Nadal got 250 points last year — if he wins this year, he’ll have 6530 points
If Roger makes it to the semis, or Rafa doesn’t win the title, then Federer will remain number one. You can argue about the merits of the tennis ranking system, but it’s certainly predictable!
One final twist: if Rafa doesn’t pass Roger at this tournament, it will be impossible for him to do so for several more months. That’s because Rafa cleaned up during this time last year, while Federer kept losing to this guy. Rafa has points to defend, while Federer does not. You can see the full points breakdown on the ATP profiles for Federer and Nadal.
Permalink
01.04.08
Posted in web at 4:00 pm by danvk
I’ve been meaning to write a post for a while about how difficult it is to choose a browser on the Mac. There’s no perfect choice, the Camino browser’s combination of compatibility and a Mac feel has made it mine.
My main gripe about Camino is the lack of plugins, particularly the lack of a good Greasemonkey equivalent. In Firefox, I use Greasemonkey to kill the annoying ads that pop up on nytimes.com whenever you double-click a word. In Camino, I have to avoid double-clicking random words. For some reason, I find this completely impossible.
There’s an official feature request for user script support in Camino, but I’m not holding my breath. The NY Times problem bothered me so much that I spent some time creating a Camino workaround.
The idea is to prevent Camino from loading the JavaScript file that provides this “feature”: http://graphics8.nytimes.com/js/common/screen/altClickToSearch.js
To do so, create a new text file somewhere on your machine (I put mine in ~/Library/nytimes.pac) with the following contents:
Save that file and follow these instructions to tell Camino to use your PAC file. In my case, I set network.proxy.autoconfig_url to file:///Users/<your user name>/Library/nytimes.pac. Now clear your cache, restart Camino, and try visiting http://graphics8.nytimes.com/js/common/screen/altClickToSearch.js. If you’ve done it right, you should get an error saying “Proxy Server Refused Connection”.
Enjoy the popup-free browsing!
Permalink
« Previous entries