Archive for the ‘twisted-planet’ Category

Obligatory PyCon 2008 post

Friday, March 21st, 2008

PyCon is about the people

My first trip to PyCon was 2005. It was the last year the conference was held in Washington, DC at the George Washington University. I flew out with my girlfriend and stayed in a youth hostel a couple of miles from the conference center.

I had an absolute blast. It was the first time I’d met Glyph Lefkowitz, JP Calderone, Chris Armstrong, Allen Short, Moshe Zadka and the rest of Twisted Matrix Labs. I’ve been using and working on Twisted in various capacities since about the spring of 2001. However leading up to PyCon 2005 I found myself in a bit of a coding slump. I had gone a couple of years without having a reasonable computing device. Keeping myself busy hacking 16-bit x86 assembly on an old 486 IBM Thinkpad. My network connections were sporadic, and my participation in Twisted had lulled. Eventually I was able to scrape together enough money to build a shiny new Athlon desktop.

For the next couple of years it gradually got easier to work on Twisted. Even while working a significant amount at a local movie theater and going to school full time. However I quickly became fed up with programming. It’s not that I didn’t want to write code I simply couldn’t. New concepts had been introduced to Twisted and I was having trouble wrapping my head around them. I had a real problem with Deferred’s for a while and even then the state of web twisted web programming had become … scattered. All these elements created a feedback loop of frustration. I became little more than a late night lurker in #twisted, enjoying conversation with “friends” whom I’d never met.

The thing that really kept me in #twisted and keeps bringing me back to working on Twisted is the people. I have to quote Aaron Sorkin’s “Sports Night” here to really explain what it is about these people that makes them so special to me.

If you’re dumb, surround yourself with smart people. If you’re smart, surround yourself with smart people who disagree with you.

I’ve surrounded myself with the smartest people I could find. PyCon is about people. I enjoyed PyCon 2008 as much as I had enjoyed PyCon 2005 (if not more) and I can’t wait for next year.

(more…)

Technorati Tags: ,

I don’t have a specific problem with any particular DVCS.

Saturday, March 8th, 2008

I do however have a problem with 3 DVCSes. That problem is that I currently have 3 installed, for working on about an average of 1.5 projects each. My personal choice has become bzr mostly because of launchpad.net and I know developers who I can bother. Everyone else please fall in line so I can remove darcs and git.

Technorati Tags: , ,

The Smallest Carbon Emacs Installer Ever.

Wednesday, January 9th, 2008

As noted on several other blogs posts the /usr/bin/emacs in MacOS X Leopard is built with carbon support, it simply lacks the .app wrapper. You can easily download the .app wrapper and create a symlink and away you go. So here is a shell script that does that.emacs-installer.shUsage:

  1. Download emacs-installer.sh
  2. chmod a+x emacs-installer.sh
  3. sudo ./emacs-installer.sh /Applications

Technorati Tags: ,

Status Report

Thursday, October 18th, 2007

Things are slowing down in Apple land, with the Oct. 26th ship date I’ve had more free time this week than in the past year and a half. So I thought I would take a quick moment to let everyone know what I’ve been working on.As most of you know I work on the Darwin Calendar/iCal Server which is an open source CalDAV server. However I’ve also been contributing heavily to an even more ambitious project the Apple Wiki Server.The Apple Wiki Server at it’s core serves a wiki, a blog, a group calendar (stored in the aforementioned iCal Server) and a mailing list archive. It has a WYSIWYG editor, tags, integration with OpenDirectory, RSS for virtually everything, and some great builtin themes.Aside from Apple stuff I bought the spectacular Programming Erlang book. So I’ve been resisting the urge to rewrite the Apple Wiki Server in Erlang. I do think Erlang is a wonderfully fun language for writing distributed applications and I hope to find some uses for it at work but I’m not expecting it to overtake Python and Twisted anytime soon. However I am trying to take many of the ideas from Erlang (use lots of processes, the supervisor tree, designing APIs that let me refactor the implementations into processes later, etc) and putting them to work in Python and Twisted. I would like to do an AMP based process pool soon, if I don’t get distracted writing Erlang code and playing with mochiweb.

iRate.py v2007-06-29

Friday, June 29th, 2007

The Problem:iTunes keeps song ratings, play and skip counts in a proprietary database format.The Solution:iTunes exposes song ratins, play and skip counts via AppleScript, and I have a python->AppleScript bridge.My solution of course is not a particularly original one, Doug’s AppleScripts for iTunes includes a Tags to File Comments script. Which uses AppleScript to take ratings, play counts, skip counts, and more out of iTunes and shove it into the Spotlight comment field in the extended attributes. This was a fine, perfectly well functioning script. However the performance characteristics of both AppleScript and extended attributes makes it very very slow. On my Core 2 Duo MacBook Pro it took roughly 8 hours (I don’t actually know, I fell asleep while waiting) to export the data for ~4,430 tracks, with iTunes using 100% CPU. I don’t know how long it takes to import the data because I figured I could write something else in less than 8 hours.So after about 4 hours of coding and debugging I present to you iRate.pyIt uses AppleScript to export the the ratings, played count, played date, skipped count, skipped date to an SQLite database. It will also import the same data from the SQLite database.  It also manages to be significantly faster than Doug’s script.  The export of my library takes about 44 seconds, and another 22 seconds to import.To run it requires:

  • MacOS X 10.4 (tested on 10.4.10)
  • iTunes 7.2+ (tested on 7.2 and 7.3)
  • Python 2.5 (Universal binary available here)
  • appscript 0.17.2 (Fancy installer available here)

So there we have a simple solution to a simple problem. Here is hoping someone else finds it as useful as I did.-David

Technorati Tags: ,

Here is a list of 5 things that suck.

Monday, June 25th, 2007
  1. Having your car stolen.
  2. Getting charged$265 for having your car stolen.
  3. Having your passenger side door not shut after your car was stolen.
  4. Moving.
  5. Having to put off moving because your car was stolen and now needs expensive repairs.

And here is a list of things I would like to not have to move, so if you’re reading this and are in the SF bay area you are perfectly welcome to come pick them up.

  1. A Macintosh IIsi
  2. An Amstrad PPC640D
  3. A Blue&White G3
  4. A box of misc comic books and baseball cards
  5. A couple of 19-21″ CRTs (will accept 1 14-15″ CRT or LCD in trade.)

I apologize for this post having nothing to do with anything terribly interesting.

very actual information about skulls

Tuesday, June 5th, 2007

WWDC2007 is in just 5 days. I’m very much looking forward to seeing people’s reactions to Leopard Server since last year. It’s been really fun to work on, and not just because my stuff is almost all Python + Twisted. I’ve just had to work on some really interesting problems. It’s also very nice to take a break from doing a lot of framework work and never getting to really use the framework. Now I am, now I thinking I’m understanding much better what it’s actual problems are, and why some of our design decisions have been good and some have been bad. (Mostly mine have been bad I think.) I really look forward to correcting some of those mistakes in the near future once we’ve shipped. I’m also looking forward to seeing what comes of the Twisted.web2 summer of code project. James and Valentino are both very smart people and I’m sure some amazing things will get done.On a web2 related note. I’ve never been very happy with static.File. For a variety of reasons that I haven’t really documented anywhere. So here is a short list.

  • It’s poorly factored, it contains code to handle both files and directories, and it is difficult to seperate the code that does the directory listings from the files. (Even though it’s in defined on another class, it’s still weird and difficult to substitute.)
  • It doesn’t take advantage of one of web2’s most useful features over twisted.web, the ability to consume an arbitrary number of path segments during resource traversal. In theory you could join all the segments passed to locateChild and try to treat it as a file, falling back to child_ methods or children that were added with putChild if the file didn’t exist, and if that failed returning a 404. (a non-existent static.Directory class could do this, since static.File instances shouldn’t have children.)
  • There were also some things that bothered me about overriding mimetypes
  • I’m also not fond of it’s ignoredExts or processors __init__ arguments. They’re useful for executing such as CGI scripts but I don’t really think you should mix scripts you want executed with files you want served statically. Perhaps that is just an asthetic issue. We also have a CGIDirectory which acts as a general purpose cgi-bin resource.

And now, just like I promised, som every actual information about skulls. “In humans, the adult skull is normally made up of 29 bones.”P.S. If you’re confused about the title of this post, it came from a spam comment that got caught in moderation (and made it past akismet,) it amused me greatly and I at the time of this writing nothing came up on google for it.

Technorati Tags: , ,

A brief summary of recent and upcoming events.

Tuesday, May 22nd, 2007
  • I got to meet Cory Doctorow again. This time it was at an SF in SF event. I got two more of his books, Eastern Standard Tribe and Someone Comes to Town, Someone Leaves Town. Both of which I read previously in ebook form and both of which he was kind enough to sign. (Which for those of you keeping score at home, means I now own all but one of his books and they’re all signed.) He also complemented my “All I need to know about you, I learned from your wireless network.” T-shirt :)
  • At the same event I was introduced to the works of Rudy Rucker which are also pretty awesome.
  • I’ve been working a lot in preperation for WWDC. If you’re reading this and are going to be there you should definitely get in touch with me and say hello. I’ll probably be spending a lot of time talking about Twisted and the Calendar Server
  • I bought a fixed gear bike. It’s a conversion with an old Trek frame. It is ridiculously light and ridiculously fun to ride. I rode it to work this morning (Down the hill->Mountain View via Caltrain->Cupertino) and home this afternoon. I’m going to try to do this about twice a week until I can make it all the way to Leavenworth and Sacramento from 4th and King. I have a route which is pretty good as far as hills go, but there is no getting around those last 4 blocks of hill. Once I can do that I’m going to bump it up to 3 times a week and we’ll see how things go after that. If i’m still alive next month it’ll be a good sign. (Though the week of WWDC I’ll be cheating because I’m only like 6 or 7 blocks from it.)

I think that’s pretty much it for now. I’d like to say I’m going to start blogging more, but I don’t really care. If you need to know what I’m doing every single day, well that’s why I have twitter.

Twitter + Quicksilver + Growl = Tweet+Growl

Wednesday, March 21st, 2007

A while ago after much discussion of Twitter by Leo Laporte and Merlin Mann on MacBreak Weekly I decided to sign up. I like it, I can’t explain why, I just do. It satisfies my urge to talk to noone in particular.Shortly after discovering Twitter I immediately went looking for the best way to post to Twitter. Where I found the Tweet = Twitter + Quicksilver which is a great little script, but it never told me when it was successful. (and during twitters recent downtime I Tweet’d several times.)So in the spirit of open source I decided to improve it by adding Growl support. So without further ado I present to you Tweet+Growl

tell application "GrowlHelperApp"	set the allNotificationsList to {"Success Notification", "Failure Notification"}	set the enabledNotificationsList to {"Success Notification", "Failure Notification"}	register as application ¬		"Tweet" all notifications allNotificationsList ¬		default notifications enabledNotificationsListend tellusing terms from application "Quicksilver"	on process text tweet		tell application "Keychain Scripting"			set twitter_key to first Internet key of current keychain whose server is "twitter.com"			set twitter_login to quoted form of (account of twitter_key & ":" & password of twitter_key)		end tell		set twitter_status to quoted form of ("status=" & tweet)		set results to do shell script "curl --user " & twitter_login & "-D - --data-binary " & twitter_status & " http://twitter.com/statuses/update.json"		set code to word 3 of results		if code = "200" then			tell application "GrowlHelperApp"				notify with name ¬					"Success Notification" title ¬					"Tweet Success" description ¬					"Successfully twittered \"" & tweet & ¬					"\"" application name "Tweet"			end tell		else			tell application "GrowlHelperApp"				notify with name ¬					"Failure Notification" title ¬					"Tweet Failure:" & code description ¬					"Failed to twitter \"" & tweet & ¬					"\"" application name "Tweet"			end tell		end if		return nothing	end process textend using terms from

Technorati Tags: ,

Why I switched.

Monday, March 19th, 2007

Let me start of with saying I love Linux, I love the community and I love a good bit of the software that comes on a Linux system. I am especially fond of both the Desktop and Server editions of Ubuntu. However I don’t use Linux on the Desktop anymore, and I’d like to share with my faithful readers some of the reasons why in no particular order.

  • 3 Device Filesystems in as many years. -This is a big one. I remember when /dev was just a bunch of files, and every linux system had pretty much the exact same set of files even if most of them weren’t connected to anything.Then someone decided that right thing to do was have a new filesystem called devfs, that would be mounted and only populated with the devices when the devices were connected. Now this was kind of cool sure, but not really important, however they decided it’d be really sweet to reorganize the hierarchy based on what kind of device was actually plugged in. So your cdroms would be distinguished your hard drives because they were in /dev/cdrom, etc.Then someone decided that devfs was the wrong way to do it and wasn’t worth maintaining anymore, while someone else decided that the proper way to do this would be to have a small kernel bit that talked to a user space daemon that would actually manage the device hierarchy. (Ahh the gradual microkernelization of linux with none of the benefits.) More importantly the new system (udev) would go back to all the old names, but have this really flexible (and really undocumented) configuration language that would let you use whatever naming system you wanted. Which was awesome of course, because it means udev can be backwards, forwards, and leftwards compatible, however the first time someone’s cdrom is actually /dev/poop/turd0 it gets to be a little old.
  • Windows as a useability goal -For a long time people talked about how linux wasn’t going to make it on the desktop until it felt just like using Windows. So what did all the brilliant Open Source hackers and computer scientists do?Well after much scrambling around like chickens with their heads cut off they started making things that looked and felt like Windows. Not because they stole windows look and feel, but because they made things that looked like they should be simple, and made them hard. What’s worse they remade them time and time again to make them harder and less useful. (Gnome file dialog anyone?)Windows shouldn’t be a useability benchmark and I think most of the people who are going to understand that understand it by now. Which basically leaves these smart people with two options, design things for themselves (not a horrible idea but really really hard) or crib things from Mac OSX.Not that Mac OSX is always a bastion of useable software (Finder, Mail.app come to mind) but it has a couple of things going for it, mostly that it starts out very simple and scales up to let you do complicated things (mmm… Quicksilver.) While Linux tends to start of with all these options, and not scale down very well.
  • I don’t think commercial software is a crime -Yes I’d much rather be writing and using Open Source software, but I’ve seen a lot of really cool commercial software since I’ve been using OSX (Yojimbo, Delicious Library, Pzizz, NetNewsWire, Cha-Ching.) So if there is an application that lets me use it the way I want to, and do so without a headache, I’ll pay $20, $30, or even $40 for it.So I still love open source software, but it’s hard to get paid to write Open Source software (I’m an extremely lucky individual) and if I were a more talented individual I’d probably be working for myself selling cool little applications for $30 a pop.I also understand that the really evil commercial software isn’t the thing written buy the single developer and sold for $25.99 it’s the huge multihundred dollar software that is encumbered with all sorts of horrible patents.
  • It doesn’t have Quicksilver -I spend a large portion of my life typing things into Quicksilver. I use it to capture things for Actiontastic, I use it to switch applications, I use it to launch applications, I use it to search google, to open bookmarks, to open URLs, and many other things.So not having Quicksilver on Linux is a big problem for me, a really big problem, so big that if I find myself switching back to Linux (like if someone wants to pay me to write software for it.) Then writing something as beautiful, useful, and flexible as Quicksilver will be the first thing I do.Sure there are things like it, but there is nothing quite like it. I got buy for a longtime with waffle.jl for Sawfish, and then things like LaunchBox started popping up but not quite being good enough and trying to be too pretty without being fast enough, and so I just never felt like there was a real option. The closest I came to finding something as useful and flexible as Quicksilver was Arnic, a little piece of Python, Twisted, Axiom code written by z3p (of twisted.conch infamy) I hacked on this for a bit, submitted a couple of patches, but even then ultimately came back to the QS on the X.

P.S. The GPL is a complete steaming pile of overly restrictive crap.

Technorati Tags: , ,