06.12.08

Draggable Table Columns

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!


01.04.08

How to Block New York Times Popups in Camino

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!

12.24.07

Using Track Parser

Posted in music, programming, web at 12:27 pm by danvk

pitchfork-tracks.png Pitchfork Media has released their two standard year-end lists, the Top 100 Tracks of 2007 and the Top 50 Albums of 2007. As usual, they’ve been lampooned all over the web, including one critique in pie chart form. For me, they made for perfect listening on a long car drive this weekend.

In my case, this list led to a good use of my Track Parser script, which is in all likelihood the most useful program I’ve ever written. It’s an AppleScript for iTunes (i.e. Mac only, sorry) that lets you apply regular expressions to track names/tags. Here’s how I used it today…

Through some strange turn of events (certainly nothing to do with this), I found myself with a playlist of the top 100 tracks. The music was all there, but none of the songs had their “Artist” field filled in! Here’s where my Track Parser script came in.

I googled around and quickly found this page, which has some commentary on the list, as well as what we’re interested in: a copy of all the songs/artists in simple text form. (For what it’s worth, I agree with his reactions.)

I copied the list and ran two regular expressions to get it down to just the artist (s/ ".*//g and ^\d*: if you must know). The tracks are in reverse order of what we want (100 to 1 instead of 1 to 100). So I ran pbpaste | tac | pbcopy to put the #1 track at the top of the list. Or I would have, if Mac OS X had the tac command. Instead, I ran this monstrosity:

pbpaste | perl -ne 'push @x, $_; END { print for reverse @x }' | pbcopy

to do the same thing. In retrospect, I should have just sorted my playlist in reverse track order.

Next I went into iTunes and selected my songs. I ran “Track Parser (Clipboard)” from the Scripts menu, clicked “New Pattern” and put in “%a” to extract the artist from each line. Track Parser handled the rest. Total time: about five minutes.

12.17.07

Never buy a D-Link WBR-1310 Wireless Router

Posted in personal, reviews, web at 10:25 am by danvk

I bought one from Fry’s a few months ago because it was the cheapest option and I assumed all wireless routers were more or less the same. Not so. You’d think the D-Link QA people would have discovered that this thing can’t maintain a connection for more than five minutes before it went to market. Here’s a smattering of reviews:

  • Strengths: the lights are really pretty with the rest of the blinking lights that make up my computer setup.
    Weaknesses: how about holding a connection for more then 2 minutes”
  • “Mistakenly, I didn’t check any reviews before buying it, but if you look, you’ll see the same thing over and over. The WBR-1310 drops its wireless signals, without fail, every 5-15 minutes. Not once, in the entire time I owned it (which was only 2 weeks untill I finally got fed up enough to return it) did it hold a signal for over 15 minutes.”

So do your research before you buy a wireless router! I bought a Linksys WRT54G to replace the D-Link, and have been happy with it in the past two days of use. The Wiki article says that this was the first wireless router to have its firmware open-sourced. As my roommate pointed out, that speaks volumes about Cisco’s confidence in this product.

12.12.07

xkcd@google

Posted in movies, personal, web at 10:33 pm by danvk

One of the best perks of working at Google is the Authors@Google program, which brings in authors to speak about their books. We recently hosted xkcd’s Randall Munroe, who gave a completely hilarious talk. I only caught the end in person, but it’s now available on YouTube for all to see.

For some context, the guy who does the intro is Peter Norvig, the guy who asks the first question is Guido van Rossum, the creator of Python, and the the guy who asks the second question is Don Knuth!

Here’s one of my favorite xkcd’s:

10.26.07

NS-Tower in a Canvas Tag

Posted in programming, web at 2:49 pm by danvk

nsticonw.gif I recently noticed that Rice has unceremoniously purged my Owlnet site, so I’ll be moving some of its content over here. First up: my JavaScript implementation of Nagi-P Software’s NS-Tower.

This is one of the few games I’ve ever seen with only one control: jump. Your character bounces off the walls and you have to power him up for jumps. My record is 282 floors on Hard. Can you beat it? No fair using the JavaScript version, though. More details below (warning: it takes a hard right turn for the nerdy)…
Read the rest of this entry »

05.29.07

Netflix?

Posted in movies, web at 11:35 pm by danvk

picture-1.pngI wrote a few weeks ago about enjoying The Fog of War, the 2003 Academy Award winner for best documentary. The list of winners over the last sixty years has some fine-looking films on it. Clicking around Wikipedia, I’d quickly assembled a list of five movies I wanted to see:

I hit up my usual movie source, but it only had the first two. I watched The Wind That Shakes the Barley last night and thoroughly enjoyed it. It brought me back into the Irish history kick I was on after visiting the Emerald Isle last winter. The Deer Hunter is on the way.

For the others, though, the internet has failed me. The free internet, that is. There’s still Netflix. They have all but the last movie on my list. Craig, Nick and I had a good experience with them two summers ago, so I’m tempted to give them a try. I’d most likely go with the $15/month plan, which gets me two DVDs at a time and unlimited monthly rentals. It also gets me their Instant Viewing service, which lets me download movies. Or would, if only I didn’t have a Mac. This is almost annoying enough to make me avoid Netflix entirely. To watch movies online, you need to be running Windows, Windows Media Player, and you can only watch them inside a special Netflix application. Lame.

Netflix has a two week free trial, so I may give that a shot. Any Netflix subscribers out there? What do you think?

05.02.07

Barack Obama Myspace Gaffe

Posted in politics, web at 7:35 pm by danvk

I’m generally a big fan of Barack, but this gaffe really bugs me. It’s so incredibly heavy handed. The asking price was a pittance for his campaign.

I doubt Barack himself had much to do with it, but it makes me sad to see his organization strongarming an ardent supporter like this. Or, as the Daily Kos article puts it, “Shitting on your biggest supporters is generally not a wise thing to do.” Ugh.

04.03.07

NCAA Tourney 2007

Posted in sports, web, wikipedia at 9:04 pm by danvk

A few weeks ago, I looked at the Wikipedia edits to the 2006 NCAA Tournament article. Here’s the edits chart for this year’s tourney, as promised.

2007edits.png

For comparison, here’s the chart for last year:

2006edits.png

The overall features are quite similar: the important dates stand out clearly in each chart. The total edit volume in 2007 is about double what it was in 2006, which is consistent with Wikipedia’s rapid growth. The edits were more front-loaded in 2007. Selection Sunday was far and away the busiest day, and the edits decreased steadily into the later rounds. This may indicate that fans contributed content relating to their favorite teams, and then stopped once that team was eliminated.

Shortly before last year’s tournament, I wrote a program to create a basic article for every NCAA tournament, from 1939-2005. The articles had a list of teams, locations, and a bracket. The idea was that, once the tournament got underway, other contributors would spruce the articles up a bit with some individualized content. Here’s a plot of the cumulative edits to the 1939-2005 tourney articles.

alledits.png

There are clear spikes during March Madness each season. Cumulative, there have been 1,493 edits to these articles by users other than myself, an average of 22/article. This is a bit skewed by the more recent tourneys, though. The median number of non-Dan edits is 10/article, which still isn’t bad. Wikipedia has its own flavor of the “release early and often” mantra from open source software. It’s not important that the article be perfect the first time around. It’s more important to just put something out there so that others can improve upon it.

03.22.07

NCAA tourney

Posted in sports, tv, web, wikipedia at 11:26 pm by danvk

I’ve been enjoying March Madness the past few weeks, even though my team got knocked out in the first round.

Internet video really is coming into its own. This year, for the first time, you can watch the games online with March Madness on Demand. As with the NewsHour Online Video Archive, there are still some kinks to work out. Biggest gripe: it only works in Internet Explorer 6 on Windows. No love for Mac users like myself. What’s worse is that you don’t even get a message telling you that IE6 is required if you load it in Firefox. It just mysteriously doesn’t work. Hopefully this tool will be better next year. The main thing is that it exists at all.

Oh, and if a game is being broadcast on CBS in your area, you’ll get a message saying it’s been blacked out. Yeesh.

The Wikipedia article on the 2007 tourney has been fun to watch. In the last ten days, it’s received over a thousand edits. Wikipedia edit counts aren’t a bad way to track current events. Here’s what the edit history for last year’s tourney looks like:

2006edits.png

The major events stand out in stark relief. One caveat: if an article gets protected by an administrator in response to vandalism, it throws a wrench into the fluidity of edits. I’ll post a similar chart for this year’s tourney after it’s over.

« Previous entries