Monthly Archive for September, 2006

The New Google Reader is P-I-M-P

Google has overhauled their AJAX-powered web RSS reader. It’s, like, wicked awesome dood. If you hated the old one, give it another shot.

They even addressed my previous request for a mark all read feature (hint: it’s shift-a).

Update:
Gone are the days of agonizing over a sentence who’s only raison d’être is to contain a single link. See that shared section in the side bar? From now on, I’ll save the blog articles for those rare instances in which I have something to add.

Happy Birthday Tom’s Hardware

Tom’s Hardware turns 10 years old today.

I’m not sure I’ve been reading for 10 years, but I definitely remember the sysdoc.pair.com days. Here’s what it used to look like back when I was a college freshman.

New Printer

Our old Lexmark ran out of ink, so we decided to buy some more — inside a new printer. Printers are the packaging that ink comes in.

I picked up a Brother HL-5250DN from NewEgg for $205 shipped. Two hundred bucks. For a monochrome laser that does 30ppm, 1200×1200 dpi, ethernet, duplexing, PCL6, and Postscript 3. What a bargain.

It also supports Bonjour, so I was expecting some plug and play action. I was wrong.

Everything looked good at first. The printer got an IP and I could ping it by name. However, a few minutes later dhcpd3 would come along and delete the A record from bind. The lease was still present, and valid, but I could no longer resolve “printer”.

I eventually gave up and just assigned it a static IP. After four hours. Zeroconf my ass.

Cingular Discovers Unintended Consequences

Via Digg, I found this article about a woman who had her cell contract cancelled by Cingular. Her phone was roaming onto competing networks too frequently and thus she wasn’t a good little cash cow.

Here comes the funny part. A few of the Digg comments suggest that this can be done on purpose to escape Cingular’s normally termination-proof contracts. Here’s one example:

When I moved I became fed up with Cingular’s spotty service, so I asked out of the contract. They said no, of course. I connected my phone to another network and dialed my wife’s phone that was on another network and played music through the handsets every night for a month. I was canceled the following month.

Free LG Fusic Worth Every Penny

File this one under, “Be careful what you wish for…”

Sprint gave Joel a free phone, hoping he would review it for them, and unfortunately for them, he did.

VLA Redux

After discovering C99’s Variable Length Array feature, I was discouraged by the apparent lack of a C++ equivalent. To review, a VLA has a dynamic size at creation time, but is otherwise fixed. This allows it to use stack memory for blazingly fast allocation and deallocation. The fully-dynamic, growable, heap-allocated std::vector is heavyweight by comparison.

In an ideal world, C++ would have a VLA template class which would confer all the benefits of C99’s VLA, plus additional type safety and (for the love of god) a .size() accessor.

In wrestling with this, I stumbled on to the idea of putting alloca() into a forceinline function. Depending on your mood, this is either a clever trick or a fragile hack.

Let me enumerate the problems here:

  1. The alloca() function is not standard.
  2. Neither is forceinline.
  3. If the compiler cannot forceinline your alloca function, it’s a bug.
  4. Compilers can never guarantee inlining of arbitrary functions (recursion, etc).

That being said, here’s a nascent implementation which seems to work on gcc and VC++:


#include <new>
#include <stdlib.h>

#if defined( __GNUC__ )
   #define FORCEINLINE inline __attribute__ ((always_inline))
   #define ALLOCA alloca
#elif defined( _MSC_VER )
   #define FORCEINLINE __forceinline
   #define ALLOCA _alloca
#endif

template< typename T >
class dynamic_array
{
   private:
   T* elems_;
   std::size_t size_;

   public:
   FORCEINLINE explicit dynamic_array(std::size_t size) :
      size_(size),
      elems_(static_cast<T*>(ALLOCA(sizeof(T)*size)))
   {}
   T& operator[](std::size_t x) { return elems_[x]; }
   std::size_t size() const { return size_; }
};

Now we can say things like:


template< typename A >
void fib(A array)
{
   array[0] = 0;
   array[1] = 1;
   for( unsigned i=2; i<array.size(); ++i )
     array[i] = array[i-1] + array[i-2];
}

void both(size_t size)
{
   dynamic_array<int> d(size);  // cheap
   std::vector<int> v(size);
   fib(d);
   fib(v);
}

If we had a caller_alloca() or the ability to write if( inline ), we might even be able to do this safely.

Kevin and I talked about this idea at length and, being the uber-coder that he is, he whipped up a full-fledged version here. Check it out.

Herb Sutter’s Concur @ NWCPP

Last week NWCPP hosted Herb Sutter (and I cajoled Kevin into bringing his camera). Herb talked about the Concur project, which is a handful of language and library extensions to dramatically simplify correct concurrent C++ programming. Slides Here.

Here’s some video that makes my blog look cool on Google’s bandwidth dime:

Continuum Impressions

I’ve listened to Continuum exactly once. Here are my initial, knee-jerk reactions:

  • I like Waiting on The World… It was a good choice for a single.
  • I already own the JM3 record. Why are you selling me Gravity and Vultures again?
  • Thank freaking god I finally have an album version of I Don’t Trust Myself. I’ve been playing that hook for at least two years now. It’s sonic crack cocaine.
  • Bold As Love is great, but John set the dial to 10. We know it goes to 11, dude, we have the Tsunami Aid version.
  • Where is In Your Atmosphere? Where is The Hurt? Where is Lifelines? Is there a hidden track or something? I was really expecting at least one of these.

Give me about 5 more plays and I’m sure I’ll be raving about the new tracks.

Jonathan Coulton Music

Check out Jonathan Coulton’s nerd-inspired, DRM-free, CC-licensed music here. You can buy direct for a buck a song, or pick up his complete “box set” for $60.

If you do nothing else, at least visit the site and click the play button for Code Monkey.

Update:
Just noticed lyrics, chords, and guitar tab for Code Monkey here. Freaking awesome.

Update 2:
JoCo did a live acoustic performance on The Sound of Young America. Run there and download the MP3’s. Quick. Like a bunny.

Insane Big Brain Academy Video

Here’s a video of “Darkgigs_Xx” scoring 1649g in Big Brain Academy in a single practice test. This is insane. I’m not ashamed to say that this is better than my overall best score (which is the sum of five of these tests).

Update:
Apparently his best overall score is a jaw dropping 4071g!
GameSpot Forums, Cyberscore BBA Scoreboard

Update 2:
This BBA walkthru contains some good tips to improve your score.




Creative Commons Attribution-NonCommercial 3.0 United States
Creative Commons Attribution-NonCommercial 3.0 United States