the Forty-Second Parallel

Hello, I'm Matt Grayson and this is my website. Feel free to learn more about me or just browse the archives. If you feel so inclined, you can also drop me a line. Thanks for stopping by!

Archives for September 2004

4 entries were found in the archives.

On the Coolness of Star Wars

Posted 29 SEP 2004 | Comments

James Lileks: "As someone once said, no matter how cool you think Star Wars is, it begins with Jar Jar and ends with Ewoks."

And I always thought it was just me. I mean, I like Star Wars and all ... or at least I have fond nostalgia of playing with plastic versions of the Millenium Falcon and the Ewok village. I have KOTOR for the XBox. Heck, I even have a Lego Tie Bomber on my desk at work. So, my appreciation for the original trilogy should be evident.

But, as an adult, I've always had a much harder time watching the actual movies. That willing suspension of disbelief is much harder to muster and I can't help by snicker at how cheesey some of the lines are. Is it entertaining? Sure, sometimes. But is it hokey just as often? It sure is.

BTW, this doesn't mean I won't be purchasing the trilogy on DVD ;-)

Is It Supposed to Work That Way?

Posted 18 SEP 2004 | Comments

Noticed Hans Nowak's observations on an area where Python's dynamic typing falls short in regards to refactoring. Read it; thought "yeah, ok. good point." and moved on.

Fast forward and zoom to my world. I'm working on a Python web app (in webware, btw) that has an object which contains a tuple. This tuple is populated by a bunch of integers that are retrieved from a database table. So far, so good.

Well, I have a case where I need to pass an integer from a webpage and determine if that integer is in the aforementioned tuple - seems straightforward. Pass the integer via webware's request object and check the tuple to see if the integer there using this fairly common method -

if integer is in tuple:
    return True
else:
    return False

Nothing unusual there. Worked in the past in other cases fine. But what happens in this case? It returns False, every stinking time - even when the passed integer is a known member. Ok, so I'm officially befuddled.

So, I start digging through things and discover that the integer passed from the page is a StringType and the integers in the tuple are all LongType. Ok, not really a surprise. But, why won't Python convert the types and make the comparison? That's supposed to be the benefit of using a dynamically typed language.

In strongly typed languages, you can manually coerce one data type to another. Python supports this too - at least for now. But it doesn't seem right to have to resort to doing something manually that the language is supposed to do for you automatically.

Maybe this all makes sense to others and there's something going on here that I just don't completely understand. There are certainly gaps in my knowledge of Python. But this issue just caught me off guard because it was completely unexpected.

Please Refresh

Posted 16 SEP 2004 | Comments

Well, that long awaited (at least for me) redesign I mentioned months ago is finally here. You might have to force refresh ...

This is probably one of the bigger redesigns I've done in terms of content organization. I went through multiple versions of the redesign before I decided on a minimalist style. I decided to drop the calendar widget and replace it with a mini blogroll and reading list. We'll see how that goes - if I update them semi-regularly, then I'll keep them around. But, if they start to get stale, I'll probably axe them and go back to the drawing board. The colophon will be updated soon to give credit to image and background sources.

I reimplemented the navigation bar at the top using the "CSS image slicing / fast rollovers without preload" method. And, as always, this site strives to be 100% valid XHTML.

Normal posting of forty-second parallel goodness will resume shortly. Enjoy :-)

Python Sidebar

Posted 01 SEP 2004 | Comments

This is probably old news, but I just stumbled across a Python sidebar for Mozilla browsers. Access to all of the Python docs straight from Firefox - very cool.

ok, no more posts about API docs for a while.