10.25.06
Posted in programming at 11:10 pm by danvk
By the end of summer 2003, I was tired of Perl and ready to pick up a new scripting language. The only question was which one to choose, Python or Ruby? I staged my own shootout to decide. A hard drive crash prevented me from putting it online at the time, but I recently found the writeup, which you can read here. The short and sweet:
First of all, I’ll throw Perl right out. I love the language, but not for object-oriented programming. To write a purely procedural program I’d take it over both Ruby and Python any day of the week, but not for OO.
If I had my choice in the matter, I would use Ruby. It’s [sic] syntax seems cleaner, and it’s object orientation doesn’t seem hackish in the least. It’s performance, however, left a lot to be desired. Granted, deep recursion probably isn’t the most widely used technique, but there’s no reason it shouldn’t work. For a different sort of problem, I’d likely choose Ruby, though I’m worried I might have to switch over to Python if I ran into similar problems.
It’s interesting to read this in retrospect, knowing that i used Perl for the next three years before switching to Ruby this past summer. It was hard, but I developed a rule that’s helped. If I start writing a Perl program and it’s longer than two lines, I’ll switch over to Ruby. I’m typically glad I did. I’ve often wondered, in retrospect, why I didn’t switch back then.
First of all, why oh why did I have to use the Josephus problem? I’d been reading the Mozart/Oz book that summer and it seemed reasonable. I’d also just completed Rice’s Comp 212 class and thought that Objects were pretty neat. This test came from the Mozart book, used objects, and had a cool name.
Unfortunately, it also exposed a low stack limit in Ruby 1.6. If only I’d known about the ulimit command back then. If only Ruby 1.8 had been released on July 4, 2003 and not August 4. I can run the same Ruby program now and get up to N=547 with no difficulty. Recursion isn’t a particularly common technique in Ruby, so this test artificially punished it.
So why didn’t I follow my own advice and switch to Python back in 2003? Rather than throwing out Perl, I threw out OO. My post-Comp 212 interest in OO faded quickly, and it was back to Perl for those “purely procedural programs.”
Permalink
10.24.06
Posted in reviews at 9:58 pm by danvk
On the off chance that you find out about it from danvk.org, the Mozilla Foundation has released Firefox 2.0, and you should go get it.
I’ll admit, I’m not exactly excited about Firefox 2.0. None of the new features are earth-shattering. The ones I’m most excited about are corrections of idiotic behavior that should have never happened in Firefox 1.5 to begin with.
- Spellchecking
Or rather, “spell checking,” as Firefox suggests. Some other words I was surprised not to find in the FF dictionary: ‘toolbar’, ‘firefox’ (!) and ‘frontmost’. It’s a cool feature, but I’ve been using Camino for the past few weeks, so it’s nothing new.
- RSS
The “live bookmarks” feature has always been stupid, but now FF is less insistent that you use it. I’ve trained myself to never click the orange feed icon in the location bar. It got mapped to NetNewsWire on my Macbook, and FF 1.5 offered no clear way to unmap it. I use Google Reader now. FF 2.0 is much better. It gave me a list of possible actions to take (including Google Reader) and there’s a place in the Preferences to change my decision later.
- Tab Bar
At long last, tabs have their own X’s. There’s also a minimum tab width: if you open up enough, you’ll get scroll arrows on either side of the tab bar. Scrolling through tabs this way seems like it could be pretty obnoxious. If you’ve got a way to do horizontal scrolling with your mouse (or MacBook trackpad), it works much better. Oh, and remember those X’s? They disappear from all but the active tab when you have enough open. It’s good that FF tries to free up space to display more of the title, but if I have that many tabs open, it’s much more likely that I’ll want to close an inactive one!
- Saving Sessions
This one’s a major disappointment. I thought Firefox would remember which tabs I had open whenever I quit and restart FF. Apparently not. It only comes into play when there’s an unexpected close, e.g. Firefox crashes. I wish there were an option to always run the session saver when Firefox starts. Also, the “recently closed tabs” menu would be better if it worked across sessions.
Another cool feature: it uses Google Suggest to complete your searches. Now I can uninstall Google Toolbar! I’ll use Firefox 2.0 on my laptop until it gets pushed onto the linux machines at work, but unless I find something unexpectedly great, I’ll be heading back to Camino soon.
Update: Ryan over at Lifehacker points out that there is an option for reopening sessions on startup. It’s Preferences->Main->”When Firefox starts: Show my windows and tabs from last time”.
Permalink
10.22.06
Posted in personal at 7:29 pm by danvk
I’ve added a link in my blogroll to my shared items on Google Reader. I share whatever stories I find particularly interesting. It’s usually fairly low volume: a story every day or two at most. You can view my shared stories here or subscribe to this feed.
Sharing is one of the coolest features of Google Reader, and certainly its most viral. It makes me want to convince all my friends to go on Reader and share their favorite stories.
Permalink
10.21.06
Posted in books, programming, reviews at 12:25 am by danvk
Earlier today, Ars linked over to a great list of Mac applications that make switching worthwhile. I’ve used plenty of them, (Adium, Transmit, VLC, Firefox, Thunderbird) but there was one app I’d never heard of that especially stood out to me. It’s one of those brilliantly simple ideas that I wish I’d thought of first.
Delicious Library turns your MacBook’s iSight camera into a barcode scanner. Just put wave a book in front of the screen and DL fills in all the details. This is so spectacularly cool that it just must be tried. The scanning was accurate whenever it worked, which was about 90% of the time. Some books have smaller-than-normal ISBN barcodes, and these gave it trouble. The only downside is that it’s a limited demo, and the full application costs an outrageous $40.
Before I discovered the San Jose library, I had an idea for a 20% project at Google. Wouldn’t it be cool if every Google employee made a list of the books they owned and were willing to share? I doubt there’s any library that could beat the Google workforce in sci-fi or CS literature. The problem with this idea is that data entry is painful. I can’t imagine typing every single ISBN of all my hundreds of books onto a computer, let alone convincing other people to do it. Delicious Library turns this problem completely on its head. Not only does it make entering ISBNs easy, it makes it exciting. I wouldn’t have thought that was possible before discovering this program.
I really wish Delicious Library was open source. If it were, I’d implement that Google Book share. But as it is, I’d be stuck learning Apple’s iSight API, the intricacies of barcodes, and probably Objective-C/Cocoa. I’m sure it would all be very interesting, but not when I’m already developing software fifty hours a week…
Permalink
10.19.06
Posted in books, personal at 11:35 pm by danvk
One of the biggest things I miss about not being in school anymore is 24-hour access to a research library. Even though not everyone at Rice sang Fondren’s praises while we were there, we’re realizing that, in retrospect, it was pretty great. Not every university library is open 24 hours. A friend of mine recommended The Leviathan and the Air-Pump recently, and I set out to get a copy.
Fortunately for me, I discovered the MLK Jr. branch of the San Jose library system. (does anyone have more stuff named after him than that guy?) It’s a research library associated w/ San Jose State University, but it’s also open to the public. It had my book, and it also had the greatest math book ever. I don’t know how I’d feel about the public access if I were a SJSU student, but it’s perfect for me.
The library is brand-new and must have been designed by the same people that redid the first floor of Fondren, aka Spaceship Fondren. My favorite “feature” of the library: a giant ticker counting off the number of books that had been checked out from the library. It was up to about 46 million after three years of operation. I told the circulation people that they were ambitious: there was room for at least four more digits. At 15M books/year, it’ll take them 64 years to get to a billion, and just over ten times that to use all the digits. 660 years? I can think of some university libraries that have probably been around that long…
Permalink
10.17.06
Posted in boggle, programming at 11:16 pm by danvk
I’ve updated my Boggle program to use the Enable2K Scrabble word list. It’s significantly better than the old linux spell-checking dictionary I’d been using. It contains more of the words with suffixes like -s, -ed, -er, -ing that are so crucial to a high-scoring Boggle board. The updated online Boggle solver remains here. And Hasbro– for requiring a form post to look up a word…
I’ve run several hundred thousand boggle gradients with this new word file and I’ve found a new top dog: plsteaiertnrsges, clocking in at 1,045 words and a whopping 3,625 points! I’ll blog about the process I used to get this in the next week or two.
Permalink
10.10.06
Posted in books, programming at 11:26 pm by danvk
I stubmled across “Code Reads”, an interesting new series on famous essays/books in programming. The first was on the most famous of all programming books, The Mythical Man-Month. I heard the book’s title many times before I understood it. The key was finding out that it was about software management. Then it clicked that “man-month” was a unit that implied a doubling of men meant a halving of development time. That the unit is “mythical” is an interesting statement about the dynamics of software development. So there you go.
I wanted to subscribe to the feed, but I couldn’t get the Code Reads without getting all of Scott Rosenyard’s ramblings about the Iraq War and Mark Foley. There was no clear way to subscribe to the just the “Code Reads” category. Google Reader had no options to filter out the articles I wanted. Neither did Feed Burner. I came up with two solutions:
- Google Blog Search I searched for “Code Reads” on Scott’s site and subscribed to an RSS feed of the search results. This worked great, except that the feed only contained short snippets for each article, whereas the site’s RSS contained nearly-full reviews. Workable, but not ideal.
- Ask dsandler, resident RSS guru. Through ways I don’t fully understand, he found http://www.wordyard.com/category/code-reads/feed/, which works perfectly.
I guess Scott disabled some category-specific feeds from his blog, but didn’t do a completely thorough job. Here’s hoping it stays that way!
Permalink
10.08.06
Posted in programming at 12:41 am by danvk
I’ve moved my Boggle program over to danvk.org. To find all the words on a Boggle board, try danvk.org/boggle.php. As a rather extreme example, the best board I’ve ever found is catdlinemaropets, which clunks in at an impressive 2724 points. It’s a cool interface: try hovering over a word in the word list.
How did I find this board and how can I find all the words on a board in 0.366 seconds? I’ll try to blog on algorithms for solving Boggle boards soon.
And mell is SO a word, Nick…
Permalink
Posted in Uncategorized at 12:05 am by danvk
I visited http://www.owlnet.rice.edu/~danvk and was greeted with a 404 File Not Found page. Has my Rice home page been taken down? I don’t know whether this is temporary or permanent, but as a precaution, I’m going to begin moving my old site’s content over to danvk.org.
Permalink
10.04.06
Posted in reviews at 11:53 pm by danvk
As promised, my review of the new Google Reader. There are a number of others out there… I’ve read Matt Cutts and Scoble so I’ll try not to hit on their points.
Before the new Reader came out, I’d been using NetNewsWire for about a month and a half. NNW uses the very-standard three pane interface, which I’ve configured to be fully horizontal. Vertical screen space is precious on a widescreen laptop, so this just feels right.

My main pet peeve: when I’ve clicked on a folder, I want NNW to show me all the items in that folder! The list should be completely chronological, and it should include both read and unread items. The read items give me a sense of where I’ve been in this list before. I shouldn’t have to reestablish which articles I’ve passed on every time I update my feeds. I searched as hard as I could, even posted a question on the NNW forums, but apparently NNW just can’t do this.

In short, the new Reader wins! Read and unread items all appear together in a nice chronological list.
The old reader combined every item in every feed into one list, the “river of news” that other bloggers seem so fond of talking about. I couldn’t stand this. It’s just not the way I read my feeds. There are a few feeds that don’t get much traffic, about a post a day, but I read them religiously. And then there are others, with dozens of posts a day, that I occasionally peruse when I’m bored. The two should be separate. In the river of news, my low-volume feeds would drown. The new reader is unquestionably an improvement over the old.
I really like the list view, which combines two of the traditional panes. It feels less cramped than the three-pane view. In all fairness, NNW can do this too:

Unfortunately, this view in NNW wastes tons of vertical space. Even with all the stories collapsed, it can only show six at a time. Google Reader fits thirty. This is a big win for Reader.
In list view, Reader looks spectacularly similar to Gmail. There’s been plenty of speculation about a Gmail/Reader merger, and I could certainly imagine this happening. One of the main reasons I love Gmail is the keyboard shortcuts: j/k (up/down), u (previous view), and g i (go to inbox). Reader has some similar keystrokes. j/k still go up and down in a list, but they automatically expand every story they select. Remember, I don’t necessarily read everything in all my feeds! This behavior makes the keys worthless. The n/p keys do what I want, but as a vi user, they just don’t feel natural.
In some ways, however, Reader has better keyboard support than Gmail. Example: hit ‘g t’

It supports auto-complete, so I can hit “l <enter>” to go to my low-volume folder. This is a really cool way to navigate, and I wish Gmail had it! I think they got the visuals from the Gmail Macros Greasemonkey script. (I may be completely off here) I’d use that script, but it kills “g i” going to my inbox.
I said my “low-volume” folder, but is it a folder or a tag? This is one of the stranger things in Reader. It seems that if you put a whole feed into a container, then that container is a folder. But if you put an individual item in it, it’s a tag. There’s no difference between the two. A tag is a folder is a tag in Reader. The split terminology doesn’t serve any purposes. Just pick folders or tags. I’d go with “tags,” since each feed/item can have multiple tags. That doesn’t make sense in a folder world.
A few other nits:

There’s tons of unread stories in these two feeds. Why only the five new stories from one of the feeds? Shades of NetNewsWire. I’ve got a bug filed on this. Also:

Why aren’t the stories on the home page clickable!?
Reader 2 is an enormous improvement over the old Reader, and it’s already begun to replace NetNewsWire in my regular surfing. I’m excited about subscribing to other people’s shared items feeds, so be sure to import your OPML file into Google Reader and give it a try!
Update: Here’s a link to my shared items.
Permalink
« Previous entries