<D <M <Y
Y> M> D>

: I won a game of Illuminati with lousy cards, and lost one with really good cards. C'est la Via Appia.

: I have decided that, however much the problem of printing date navigation bars for various levels of date navigation (eg. by year, month, day, etc) may look like a problem easily solvable by one uber-abstraction, it's not. The problem is that "by year" means something different when you're viewing a whole year of entries at once (eg. "show me the next year") than it does when you're viewing a month's worth of entries at once (eg. "show me this month in the next year"). The fact that I was also trying to have the same abstraction handle both "next" and "previous" didn't help.

That said, I have now a set of abstractions which should work, once I finish writing them.

: I miss strong typing.

: This entry is stored in the file nycb/2001/7/7-3 (because it's my fourth entry today). The problem with this scheme is that sorting the filenames, which Python can do relatively quickly, doesn't sort the entries. I've changed it in new NewsBruiser to be nycb/2001/07/07-3, but that still won't sort properly if there are more than ten entries in any given day (which has happened for NYCB eight times in the past three years). I have a custom sort which will sort that properly, but even optimized it's 20 times slower than a straight filename sort. I'm going to leave it at that for now, but would it make more sense to violate the zero-one-infinity rule and make it nycb/2001/07/07-03? Then I could use the filename sort, but if for some reason a notbook got more than 100 entries in a day, it would break.

: Da-da-da-da-da-dada! Newsbruiser Search! The code is ugly, but I'll revisit it after I do the editor.

: It's all over but the shouting. The new NewsBruiser can do almost everything the old version can, and more (if that makes sense). It's 1000 more lines of code, but it feels like less. Tomorrow I'll be putting the finishing touches on it, and hopefully writing the docs as well.

: Oops, it's only 400 more lines of code. My mistake.

Going to sleep now before I start making more serious mistakes.


[Main]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.