Friday, February 16, 2007

Switched to Google Reader

About three weeks ago I migrated from Bloglines to Google Reader. I'd checked out Google's offering some time ago but found it lacking, particularly given that I was such a Bloglines devotee having used it for years

Turns out that the more recent version of Google Reader is fantastic!  So much so that I've made the complete switch.  Apart from now being as stable and up-to-date as Bloglines, Reader has a much better (and prettier) interface and has a killer feature up it's sleeve; your unread blog posts are protected from aggregator and/or browser crashes.

Here is the scenario:  You go away for a day (or three) and come back to read your blogs.  You put aside and hour (or three) and start to delve into the 900 new posts that have accumulated.  It's at this point that Bloglines blows.  If you choose the regular option and read all of your new posts ("A") then Bloglines tries to download them all into your browser - all at once. 

More often than not something goes wrong and the download doesn't complete.  Occasionally the browser presents problems (huge memory consumption, high CPU usuage or, sometimes, a crash) as it tries to render the humungous page of posts.  So, with large numbers of new posts, there's a very real chance you're going to lose them all.  They disappear into the darkest depths of the blogosphere.  You see, Bloglines marks them as read once the download begins.  Anything goes wrong, kiss new posts bye-bye.

Google Reader is smarter.  Instead of downloading them all at once it fetches 20 at a time with AJAXy goodness.  When you approach the bottom it grabs the next 20.  When each entry is highlighted (when it has focus, or as you thump on the "j" key) it is marked as read.  Simple.  Slick.  And not even a browser crash will cost you more than 20 unread posts.  Very slick.

Google Reader isn't perfect and Bloglines is still a great web app but for now I'm a very happy Google Reader fan.

Now, if you're not using a blog aggregator then get on to it!  Everyone will be soon, simply because it's the best way to absorb information that is of relevance to you.  I can recommend Google Reader.

Tuesday, February 06, 2007

Google Maps down under

Sweet, Google has just announced extended support for the Google Maps Australia site. You can now perform business searches and get driving directions.

Now, if they could just add the Google Maps road information to Google Earth...

[BTW, until they do, you can use this tip as a workaround; it will download the correct 'tile' from Google Maps and semi-transparently overlay it in Google Earth.]

Monday, February 05, 2007

make_pair is your friend

One common newbie code smell I've seen a lot of recently is the unnecessary definition of a typedef for a pair of items:

typedef std::pair <Type1, Type2> myPairForMap;

typedef std::map  <Type1, Type2> myMapType;

...

myMapType m_Map;

The idea is that you can do this:

m_Map.insert( myPairForMap(foo, bar) );

What many people seem to not understand is that there is a more elegant way - use std::make_pair:

m_Map.insert( std::make_pair(foo, bar) );

make_pair is a templated function that returns a pair of items.  It's a simple function so I'll repeat it here in its entirety:

template <class T1, class T2>

pair<T1, T2> make_pair(const T1& x, const T2& y) {

    return pair<T1, T2>(x, y);

}

See?  It detects what types you're passing in and returns a pair containing the items.  No need to define the pair typedef.