< December 2006 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      
Sun, 31 Dec 2006:

As 2006 dawned, I had dubbed it my Year of Travel - but little did I know that it would turn out into the Year I Stayed Home.

Not that I didn't wander far and wide - from the islands of Aotearoa, to the high reaches of the Himalayas. But in more sense than one, I've stayed home - for more than a quarter of this year, I've been with my parents & grand-parents (they looking after me, more than the other way around).

Personally, it has been a year of great losses and lessons. Punctuated regularly by the death of my role models - the baton passed on from hand to the other, with sadness, yet hopefully. As if something new, something great has been transferred from one vessel, too old to bear the load, onto one fresh, young and willing.

I've come to terms, in a manner of speaking, with life, death and taxes.

--
The year is dying in the night;
Ring out, wild bells, and let him die.
                 -- Lord Tennyson

posted at: 22:11 | path: /me | permalink | Tags: ,

Mon, 25 Dec 2006:

Repeat after me, three times - C++ is not C. This is a fact which has to be hammered into every programmer who claims to know C/C++, with a nice clue bat if necessary. But in this case, it was more of g++ isn't gcc and only for those who use RHEL4.

Here's a bit of working code in C99 which is totally different from C89 (otherwise known as your dad's C standard) - which is technically speaking, legal C++ code as well.

/* compile with gcc -std=c99 */

#include <limits.h>
#include <stdio.h>

int main()
{
  printf("Maximum value for unsigned long long: %llu\n", ULLONG_MAX);
}

But the exact same code was not working when treated as C++ code. For a few versions of glibc, no matter which C++ standard you used, ULLONG_MAX wouldn't be defined. Not even if the code segment is enveloped in an extern "C" block.

As it turns out, this was a quirk of the glibc's extension to the C pre-processor - include_next. Rather than include the standard /usr/include/limits.h, what the first include statement does is pull the limits.h file from the compiler include files - from /usr/lib/gcc/.... You can figure this out by running g++ -M limit.cpp, which dumps a pre-order traversal of the include hierarchy.

And the definition of ULLONG_MAX was probably written by someone who never expected a compiler include file to be included directly from a user program - and rightly so. Except, there is no real way to fix the include order for such similarly named files.

Eventually, the fix was to use ULONG_LONG_MAX instead of the slightly shorted ULLONG_MAX. But the glibc bug has been fixed for a while - was just not critical enough to be pushed to all machines.

--
The strictest limits are self-imposed.
            -- House Harkonnen, Frank Herbert.

posted at: 07:12 | path: /hacks | permalink | Tags: , ,

Thu, 07 Dec 2006:

Yeah, I had a father.

And then last saturday, I didn't.

[1] , [2] , [3] , [4] , [5] .

May his soul rest in peace.

--
The future is interesting because I am going to spend the rest of my life there.

posted at: 21:33 | path: /me | permalink | Tags: , ,

Fri, 01 Dec 2006:

Somebody has attempting a reality distortion by showing off how shiny smart folders are in Mail.App. As novel as that may seem, what I hadn't realized was that a lot of people don't know that the nearly the same functionality has been available in thunderbird for a while. So, here's a cool feature of Thunderbird 1.5 I've been using for quite a few months now (got me a nightly build, thanks to one bug-fix).

If you look at the thunderbird message pane, you'll notice a combo box named View. You can create custom views with its customize option. For example, here's how one of my custom views look like.

Now, there are a lot of cool things about filters and views. One of my favourite options in there is the Age in Days option. Combine that with a List-Id or [Bug filter, you get interesting sources of information for status reports.

But views are a true bitch to use. The view isn't reset when you switch folders and a view set for a bugs folder makes no sense when you switch back to your Inbox. But that's where this killer feature comes in. The second last option in the View drop-down is titled Save view as a folder - and that's exactly what it does.

Voila ! There you have your smart folder - no swapping views or anything, just visit the folder and you've got everything you need. Well, it does more than just filter a folder - you can even aggregate multiple folders, with this feature. And I hear that there is tagging in thunderbird 2.x - making it truly web two point OH! compatible.

And before you ask, I've become a GUI weenie :)

--
How do I type "for i in *.dvi do xdvi i done" in a GUI?
                -- comp.os.linux.misc

posted at: 19:19 | path: /misc | permalink | Tags: , ,