Living Code (Dethe Elza)

Syndicate content
A program is a process, not a thing. This also applies to life, the universe, and everything.
Updated: 11 years 8 weeks ago

Last Post

May 2, 2006 - 9:16pm
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!
Categories: Attendees

Screenshot in Cocoa (Python)

March 9, 2006 - 11:04pm
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_( rect, NSBorderlessWindowMask, NSBackingStoreNonretained, False) view = NSView.alloc().initWithFrame_(rect) window.setLevel_(NSScreenSaverWindowLevel + 100) window.setHasShadow_(False) window.setAlphaValue_(0.0) window.setContentView_(view) window.orderFront_(self) view.lockFocus() screenRep= NSBitmapImageRep.alloc().initWithFocusedViewRect_(rect) image.addRepresentation_(screenRep) view.unlockFocus() window.orderOut_(self) window.close() 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.
Categories: Attendees

Silent Blog

March 2, 2006 - 11:00pm
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.
  • Writing the OS X version of the file uploader for The Conversation Network. At some point this will be made public, and the idea is to open source it. I'll be sure to point that out when it happens. It's been really great to have this opportunity to work with Doug Kaye and the rest of the gang from ITConversations, after being an admirer (and consumer) of their work for some time.
  • Attended the Northern Voice and Moose Camp conference, where I was fortunate enough to co-moderate a session on community and blogs with Nancy White
  • Writing my own weblog software. Blogger has a better interface than manilasites, but that's not saying much. I'm also trying to port my old content from manilasites, plus my pre-blog-era work, plus my paper journal. All of this will be hosted at livingcode.org in the near future.
  • Writing more articles for IBM developerWorks, I hope to have more to say about that Real Soon Now
  • Generally organizing the livingcode site better, getting projects their own pages, putting code into SVN. Trying to use Sourceforge was a huge failure, their interface is just too crufty and they still don't support Subversion. But Dreamhost (where livingcode.org is hosted) does support Subversion now, so I'm going to be moving all my public code over there.
  • I wrote a screensaver using PyObjC which I'm hoping to get included in their distribution as an example, but I need to do some refactoring first (in the time leftover from other projects). I want to write that up too, it was pretty interesting to work on.
  • I periodically take a stab at porting VPython to the Aqua environment. I have some ideas for this (some of them probably heretical to the VPython folks), but need time to work on them. Notice a pattern emerging?
  • Porting Apple's Sketch demo application from ObjectiveC to PyObjC.
  • Several of these things are just precursors to DrawingBoard, my animation program for kids. I really, really want to be working on that, but need to get some of the smaller projects finished and out of my head so I can concentrate.
  • Exploring programming environments for my kids. My nine-year-old daughter and I will try competing in the PyWeek game challenge later this month.
  • I'm sure I've forgotten several significant things.
More news as it happens.
Categories: Attendees