A program is a process, not a thing. This also applies to life, the universe, and everything.


Last Post

This will be my last post on Blogger, but fear not! I have imported all my Blogger articles (and I'll add my older ManilaSites articles eventually) on my new site: livingcode.org. Um, yeah, it's still called Living Code, but now it's on the livingcode site, which makes all the difference. It's driven by my new Pythonalicious blogging tool: Sandcastle.

What didn't make it across are the comments on blogger. While I've had a few really good comments here, the ratio of spam to comments has been completely out of whack. I'm just going to put up my email address and let the spam filters take care of it. Hopefully real comments will be able to get through.

It's taken longer than I'd hoped to make this transition, but now I hope to be able to concentrate on posting some of the examples I've written for PyObjC and writing some new tutorials. I'm also going to get the projects I'm discussing into publicly accessible subversion repositories Real Soon Now™

The new blog is fully tag-enabled. There is a main Atom feed, and each tag has its own Atom feed, so for instance if you're only interested in Python articles, you can just subscribe to the Python tag-feed and you won't have to hear about my Make Magazine-inspired projects with the kids. Now I just need to add some Ajax and it will be fully buzzword-compliant.

Hope to see y'all there!


Screenshot in Cocoa (Python)

I noticed that jwz is trying to take a screenshot in Cocoa and having trouble. I'm happy to see that he's porting his awesome collection of screensavers to OS X, that's great news. As for taking screen shots, I'm amazed it is as hard as it seems to be--heck even the new Nokia Series 60 give you the ability to take screeenshots from Python now. In any case, here is a method that works for me under PyObjC. It assumes it is part of a Cocoa object and that you've done a from AppKit import * already. Since I can't comment on jwz's blog (whether it's because I don't use LiveJournal or because I do use Safari, I don't know), I'll post it here instead.

def screenShot(self):
rect = NSScreen.mainScreen().frame()
image = NSImage.alloc().initWithSize_((rect.size.width, rect.size.height
window = NSWindow.alloc().initWithContentRect_styleMask_backing_defer_(
view = NSView.alloc().initWithFrame_(rect)
window.setLevel_(NSScreenSaverWindowLevel + 100)
screenRep= NSBitmapImageRep.alloc().initWithFocusedViewRect_(rect)
return image

I cribbed this several months ago from some example Cocoa code, but forgot to make a note of where I got it. If anyone recognizes this pattern, please let me know so I can attribute it.


Silent Blog

Yes, I've been quiet for awhile. No, I'm not going to apologize, and I wish more bloggers would stop apologizing when they take time off. One of the great things about Atom/RSS feeds is that I can keep up with blogs that are posted to infrequently, which includes some of my favorites. Don't feel like you need to post all the time--we've all got plenty of other things to read!

My quiet time is going to continue for a bit longer, but while I won't apologize, I will at least explain. Here's what I'm doing instead with the couple of hours I have between putting the kids to bed and going to bed myself.

More news as it happens.


Reflecting on the past, looking to the future

Programming is the art of telling stories to the computer in such a way that the computer can tell us interesting stories back. At its best, these stories help us to write even better stories, and to share them with each other.

I see computers as not ready yet. People buy them, they're interesting toys. They help in some ways, make things more difficult in others. But we have bought into the mythology of computers. Meanwhile, the state of the art in computing has moved backwards in important ways[1], even though computers are getting cheaper and faster. Innovation crawl during the dotcom boom[2]. Tools get more complicated[3], resulting in less freedom of expression, wasting the time of the people who use them.

The idea behind Living Code is that software is not a thing that is finished, it is more like a conversation. Like telling a story that someone will make better. We are trying to take steps to move to a new model of software, one in which we don't "write programs," but instead play the computer like a musician plays jazz. This model should be accessible to children, and yes, even to adults.


A rather large goal.

But just as software is never finished, the goal isn't there to be achieved. We have a goal in order to make focused, achievable steps while learning from history and aware of our limitations. In this conversation our goals become prototypes, experiments which are contantly evolving as they are tested in use.

Happy New Year!

[1] For examples of the promise that computers have thus far failed to live up to, see the wikipedia articles for Sketchpad, Dynabook, OpenDoc, Seymour Papert or Douglas Englebart.

[2] For examples of how computer innovation has stalled, check out one of many patents holding the field back, or check out this summary of Microsoft's innovations.

[3] For an example of how tools are getting too complicated, see Charles Petzold's article, Does Visual Studio Rot the Mind?


Sierra Sliders

Kathy Sierra, of the Creating Passionate Users blog, posted about using an equalizer metaphor for product planning and brainstorming. She included some images for her readers to play around with for their own equalizer-planning projects. I took those, apply the Gimp to them, mixed with Bob Ippolito's uber-cool MochiKit, and release to you:

Sierra's Sliders

Equalizer Example

You can label up to eight sliders using the text box, hit enter and tweak the sliders. When you have it the way you want it, you can bookmark the result and send it to your team members, or your mom. Tested in IE 6, Firefox 1.5, and Safari 2.0.2. Your mileage may vary. Void where prohibited by law. Some limitations may apply. Coded in a hurry.


3D, it's not just for breakfast anymore

I've been fooling around with 3D lately. First off, my third article as guest-writer for David Mertz's XML Matters column, The Web ain't just for 2D anymore went live on IBM's developerWorks site today. It's about X3D (3D in XML), successor to VRML, and the possibility of it being relevant today. I have moderate hope for it, now that SVG is starting to be a player. The funny thing is, I think X3D is probably less complicated to implement than SVG is. The real coolness starts when you can combine them, but that is still a ways off.

Years ago, I was the lead programmer for Antarcti.ca's 3D web client (which was discontinued awhile back), and before that I implemented a simple 3D renderer in Java AWT (this was before Swing, and way before Java3D. So I've been tinkering around with 3D for awhile. Lately I've volunteered to take a stab at porting VPython over to OS X Aqua (it can be built for OS X, but only under X Windows, which doesn't appeal to me). So far, the build process for it has been stumping me, and soaking up what little time I have to devote to my hobby coding, but I still plug away at it from time to time. It's a C++ extension for Python which relies on boost, glib, and OpenGL libraries, and it uses autoconf in a fairly non-auto way. I've never been expert at build systems, most python projects I've needed were either .configure;make;make install or python setup.py install, so the struggle to port this really bugs me, but VPython is a very cool project and I want to use it (and I don't want to give in and rely on fink and X). Sometimes I'm too stubborn for my own good.

In a previous post I mentioned that I was thinking of writing a tool for screencasting from OS X. It turns out that while Apple has included more advanced Cocoa libraries for Quicktime in Tiger, there isn't a convenient way to create new, writable movies from Cocoa, so that project has stalled, for the time being. There is a solution, but I'm trying to wrap up other things before I delve into it.

I have two projects nearly ready to release which are both larger examples of using PyObjC. One is my own project, DrawingBoard, which is being tested right now by both my kids and my friend Michael's kids. I'm about ready to let other people see it, rough as it still is. The other project is a port of Apple's Sketch example code from Objective-C into Python, which gives examples of how to use Core Data, undo/redo, and many other things. Both will be coming soon.


Interface Builder vs. Macromedia Flex Builder 2

I recently tried out the beta of Macromedia Flex Builder 2, and was quite impressed. I normally avoid Flash on principle, but it has some pretty powerful tools built in. It feels more limited than Apple's Interface Builder, but it has one feature that I've been dying to see in IB: You can flip between visual drag-and-drop widget mode, and editing the layout as XML. Interface Builder so needs this ability. It would help for folks writing about developing for OS X (sometimes 100 words is better than half a dozen pictures, and trying to show CTRL-dragging in a still picture is an exercise in futility), and it would help when you come to a new project (or one you haven't worked on in awhile) and want to get a feel for what methods and event handlers are hooked in to various widgets. Heck, it would help with automated tools, with testing, with grep. Just do it, Apple, or hire me to do it.

The other part that was interesting for me was that Flex Builder runs inside of Eclipse. It's been a long time since I've tried Eclipse and I was pleasantly suprised. It was fairly snappy, not too confusing to find my way around in, and looked better than I remembered. Of course, I was running it on a dual 3GHz Windows box, so I might be disappointed once more if I ran it on my Powerbook, but my brief encounter with it didn't suck, which was a big improvement.

Of course, neither of these developments are going to lure me away from Python and Vim any time soon.

This page is powered by Blogger. Isn't yours?