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.16.07

C++ STL sort weirdness

Posted in programming at 9:59 pm by danvk

I ran into a weird bug at work this past week. What does this code do?

#include
#include
#include

struct Compare {
int operator()(int a, int b) { return a – b; }
};

int main(int argc, char** argv) {
std::vector blah;
for (int i=0; i<20; i++) blah.push_back(20 - i);
std::sort(blah.begin(), blah.end(), Compare());
std::copy(blah.begin(), blah.end(),
std::ostream_iterator(cout, “\n”));
}

If you said “segfault”, give yourself a pat on the back! Bonus points if you know that changing the “20″ to a “16″ will prevent the segfault.

After spending several hours staring at this, I figured out what was going on. Rather than taking a compare function that returns an int (like qsort or Perl’s sort), it wants a “LessThan” function:

struct LessThan {
bool operator()(int a, int b) { return a < b; }
};

If I’ve ever been happy that C++ silently casts ints to bools, I have now done my penance. I’m still somewhat surprised that std::sort segfaults when given a strange comparison function, rather than returning an unsorted list.

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:

12.11.07

Good Science, Expensive Science

Posted in astronomy, news, sports at 11:01 pm by danvk

There have been two space-related stories of note in the news recently.

The first was that the launch of Space Shuttle Atlantis was delayed until January. The space shuttle has been NASA’s greatest boondoggle in history: its $145 billion cost to date has passed the Apollo program’s inflation-adjusted $135 billion. The worth of the Apollo program is an issue for another time, but at least it had a clear goal which it accomplished. The Space Shuttle has languished into old age. Seriously, does anyone realize how old this program is? Here’s a video from the launch of the first space shuttle, in 1981:

For some context, the commander of this mission was John Young. John Young walked on the moon… on his fourth space flight! Here’s a plot of space shuttle launches over time:

shuttle-launches.png

NASA was accelerating launches through the start of 1986, when Challenger was destroyed. The first period represents the hopes and dreams of the shuttle program. Before Challenger, it really might have made space travel routine. The middle segment, from Challenger to Columbia, is the long working life of the shuttle. Expectations were capped, and so were results. The shuttle program should have ended after Columbia. But instead, it gets a third period to die of old age.

Shuttle missions these days primarily service the International Space Station, which exists primarily to give the Space Shuttle somewhere to go. Seriously, try reading the wiki article about the Columbus module being installed on the next shuttle mission and tell me what exactly it does. Hubble Space Telescope maintenance is often pointed to as something worthwhile that the Shuttle does. Fair enough. But how many Hubble’s could we have had for $145 billion?

The second story is genuinely exciting. It comes from the European Space Agency’s CoRoT mission. At $50 million, it’s a featherweight space mission. This telescope was launched last December and has been observing stars for the past year, looking for transits. This week, they reported that “CoRoT is discovering exo-planets at a rate only set by the available resources to follow up the detections”.

This is completely nuts! There are currently 268 known exoplanets. It’s possible that this number will double in the next month as the CoRoT group begins publishing their findings on December 20. Personally, I’d consider that a more significant achievement than anything the Space Shuttle has done in the last 25 years with its $145 billion.

11.26.07

I miss the sun

Posted in books, personal at 8:19 pm by danvk

It set at 4:53 PM today. And it’s only going to get worse over the next month, as we head towards the winter solstice on December 21.

For some perspective, check out Graham Robb’s excellent New York Times op-ed piece on human hibernation, The Big Sleep. Well into the 19th century, people in the European countryside went into partial hibernation during the winter. Robb’s book is near the top of my reading list.

« Previous Page« Previous entries Next entries »Next Page »