Monday, May 6, 2002

Updated the blog design. There might be a shared version after a few more tweaks.
11:16:07 PM  blips[]    
Jaguar Notes
Apple's Jaguar Page is up. Something hypr-cool? Sherlock 3 is actually Karelia's Watson, a really cool app showing how a desktop application can make use of web available data without succumbing to Microsoft's "Everything IS a web page" type interface.
2:33:33 PM  blips[]    
Fun With Generators
"The great thing about this arrangement is that I can substitute a different block generating function with zero effort, as sizeAndDigest doesn't need to know how its data is being generated. I could have done that with saved state and a callback to get the next chunk of data, but generators are a lot simpler." [Deadly Bloody Serious]
1:50:55 PM  blips[]    
Die 9, Die Die!
Steve Jobs: "We are here today to mourn the passing of OS 9."

I'm reading Maccentral's Live WWDC keynote coverage. Jaguar is sounding great.
12:35:20 PM  blips[]    

Radio and Category Theme Troubles are Troubling Me No More
I've found it's a good idea to avoid using special themes in categories in Radio. Some of my categories were rendering the correct template (after I manually removed template files out of their local folder a couple of weeks ago), but were doing the wrong daylink images and very wrong navlinks display.

I was about to post to the Radio discussion boards asking how to fix it, when I found the answer. Twice. First, I looked in the weblogData table, and found the categories/foo/lastThemeApplied setting. Then I thought, "there must be a way to do this via the web interface", went to my Radio home page, clicked on a troubled category, and there was the theme option, still set to "Adult Contemporary (Gray)". I set it to None, and now everything is rendering beautifully.

Almost. I have a few more tweaks to make.
12:13:10 PM  blips[]    

Python Generators
There's a post on Lambda the Ultimate today about Generators and Abstraction, with reference to Python. Ruby has the concept of generators built in from the ground up. Last summer, I came across Ruby and started playing around with it, and annoyed everyone around me (I was working for Zope Corporation who own PythonLabs) by going on and on about Ruby's object model and generators.

While I'm sure my little rants had little or nothing to do with the course of Python 2.2, it is nice to see Python picking up on simple generators, iterators, and the whole new classes thing. It has me excited about Python again.

An interesting show of the power of generators and iterators comes from PEP 279, The enumerate() built-in function. It's a new built in function that gives to all collections (anything iterable) functionality similar to dict.items() (more specifically, dict.iteritems()) which loops over the keys (index) and values (item) of a dictionary. This example, from the PEP itself, shows a good use of generators and iterators in action, keeping evaluation of a loop lazy while being able to index it:

def enumerate(collection):
    'Generates an indexed series:  (0,coll[0]), (1,coll[1]) ...'     
    i = 0
    it = iter(collection)
    while 1:
        yield (i,
        i += 1

8:51:39 AM  blips[]    
Boolean type for Python 2.3
I should pay attention to the comp.lang.python mailing list more often, but Usenet newsgroups seem to be a much bigger pain in the ass in these days of Broadband - it's hard to know whether your provider, or your providers provider, will really offer any usenet service.

Anyways, PEP 285 brings about True and False to the Python language as natural members for the first time. One of the areas this will help in is the reduction of code like this:

return not not foo #the twin 'not not' keywords cast foo into a boolean statement

and replace it with:

return bool(foo)

Which, while brief, avoids the headslam that boolean logic games like 'not not' can be. One place this will be especially beneficial is with XML-RPC and SOAP, and other means of communicating with languages that have (and expect!) booleans. It's been sufficient so far in Python to use any true value or any false value for boolean use, and 1 and 0 for basic usage, but that's hard to communicate over the wire. A Python function may return '1' as an integer value. But it can also be returning '1' to indicate truth (as in predicates like 'isinstance()').

So... Interesting. Never even knew it was up for debate, let alone accepted.
2:19:10 AM  blips[]    

Looks like, today.. I shift over to the seedy world of Independent Contracting. But, it should mean getting paid. And finally getting to do some real work for once. I've enjoyed doing speculative development on the SCS framework, sure, but I need a good "do this system in two days" challenge again.

1:53:57 AM  blips[]