Applescripting in Python

I plan on writing a more in-depth article on this when I have time (it’ll happen, really!), but for now, I thought I’d share a little Python OSA script I wrote last month that resizes my Terminal.app terminals and generally cleans up my workspace in my preferred window setup: work.py.

Programming in Python with py-appscript is marginally better than programming in Applescript (since the syntax isn’t quite as braindead), although there are challenge of its own, since you can’t get sizes exactly of collections without making the function call and all that. Also, there were lots of interesting challenges with limitations of Terminal.app’s bindings and other silly things like how to minimize windows. I’ll write more about it later, but in the meantime, hopefully this turns out to be useful for some people.

Keyconfig for Firefox 3

I’ve been happily using Firefox 3 for the past couple months. On the Mac in particular, it’s been a night and day difference performance-wise. One of the more unfortunate aspects right now is that there aren’t a lot of extensions that work with FF3 at the moment. One of those that I missed a lot was the keyconfig extension.

It hasn’t been updated for a while (and the download site is a bit on the sparse side, but it looks like the author, dorando is still active and there are directions for modifying the XPI to be compatible w/ FF3.

Since I went through the trouble of modifying the bits, I thought I’d throw it up there for those less inclined to muck around in the files. This will give an unsigned warning, but should install: keyconfig-ff3.xpi.

Modifications:

  • install.rdf modified with 3.0.*
  • install.rdf modified to comment out so it can be installed w/o modifying security preferences
  • this.os.addObserver(this,"stupid-dummy",false); added to function keyconfigService()
  • document.createElement("key") changed to gDocument.createElement("key") in the keyconfig.jar!contents/keyconfig.js file

UPDATE: The June 11, 2008 build of keyconfig at mozilla.dorando.at has support for FF3 – you’re probably better off getting the official version there.

Obama ’08

Those of you that have been reading for a while might remember when my blog got really political a few years ago. I don’t think that’ll happen this time. I’ve been pretty busy – barely posting for the past year or two (I’ll be trying to change that in ’08). But, I did want to post this because it was pretty inspiring. Barack Obama is a President I could be proud of:

HTML Quiz

This was actually pretty fun:

53

Here’s the ones I got:

A, B, BASE, BLOCKQUOTE, BODY, BR, CITE, CODE, DD, DIV, DL, DT, EM, FORM, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IMG, INPUT, LEGEND, LI, LINK, META, OBJECT, OL, OPTION, P, PRE, S, SCRIPT, SELECT, SMALL, SPAN, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TH, THEAD, TITLE, TR, U, UL

And the ones I forgot including some really obvious ones. There are a bunch of form related ones I use all the time that I didn’t remember, as well as oldies like frames…

ABBR, ACRONYM, ADDRESS, APPLET, AREA, BASEFONT, BDO, BIG, BUTTON, CAPTION, CENTER, COL, COLGROUP, DEL, DFN, DIR, FIELDSET, FONT, FRAME, FRAMESET, IFRAME, INS, ISINDEX, KBD, LABEL, MAP, MENU, NOFRAMES, NOSCRIPT, OPTGROUP, PARAM, Q, SAMP, STRIKE, TEXTAREA, TFOOT, TT, VAR,

eBook Thoughts

First, a bit of background: I read a lot on my screen every day, and I’m very much in the Cory Doctorow camp on Ebooks (as true now as it was 3 years ago IMO). I still read a lot of physical books. A lot more, actually, in the past year since I moved into SF proper and have had a lot more transit/commute time. These days I always try to carry a book around when I head out, especially if I’m catching the BART or MUNI – there’s a lot of “dead time” during the day. I don’t suspect that any of this is very unique, but rather that these attributes I’ve lined out are actually quite normal, and at most, differs from the norm only by degree, not quality.

That being said, there are a few areas where I fall outside that norm, but I think might give an interesting perspective, as they are “leading edge” issues. For example, I currently have 699 subscriptions in my Google Reader. (At Amazon Kindle’s current subscription pricing, that would mean a cost of $700 to $1400 per month. That’s ignoring the fact that I’m sure no reader (including Google Reader) works well for hundreds or thousands of feeds at the moment.) I’m also an early adopter and a bit of a gadget geek, having bought one of the very first e-ink devices, the iRex iLiad. It actually suffers from a variety of issues that has left it in the realm of tinker-toy instead of daily device, which very much informs my thinking.

All this is to give some context on my thoughts about the Amazon Kindle. There are a lot of things to like about it. It has many features like the Vizplex E-Ink screen, OTA content-loading, and very good power management that make it very appealing. The store integration and library management approach (centralized syncing) from what I’ve seen looks sensible and good.

Of course, I’m never going to buy one in its current state. Mark Pilgrim writes the best philosophical reasons against the Kindle, but many of my issues, while related, are less idealistic and more utilitarian – I’ve already mentioned how the Kindle is incompatible with my feed reading habits. The built-in search is nice, but unfortunately, ultimately useless, as the Kindle is unable to load (and therefore index) the majority of my technical/reference reading (in PDFs and HTML). I’m also unconvinced by the ability of the UI to handle a seriously large catalogue (the pictures show a linear list). And even though it may be built on Linux, I suspect it will be seriously unfriendly to tinkering to make it work better. Of course, the biggest issues do all revolve around the DRM and how your content is treated. These are the things that Mark points out, but it may be worth re-iterating.

I find it laughable that anyone would call the Kindle the iPod of reading. The success of the iPod was built on the transfer/ripping of people’s existing libraries and the file sharing of open digital media files (yes, Petunia, we’re talking about copyright infringement with EM-PEE-THREES). Now, on the first area, it turns out book scanners aren’t quite as common as CD drives, and on the second… can you imagine if the iPod were built in the way that Kindle is? Every single piece of media that you wish to load onto the Kindle must be sent via email to Amazon’s text processor, where it rips apart your content, and then tracks and does analysis on your documents.

Now, if you’re an Amazon.com customer already (I’m an Amazon Prime member myself and buy from Amazon regularly, bordering on religiously), you’re already comfortable (or at least resigned) to the amount of commercial/transactional information they’re collecting, however their Kindle TOS gives no additional provisions for privacy of the documents that pass through their conversion service, which means they are now potentially collecting the full contents of your personal documents, or anything you send through their conversion service for that matter — that’s a (nominal) step up from knowing what DVDs I bought.

All this wouldn’t be worth putting on the tin-foil hat if they weren’t motivated to pry through your documents, but… well, they are. The first general term is about “Illegal Use.” Text analysis is trivial and I don’t see why the RIAA’s wet dream would be any less so of the book publishers’ associations considering that they in conjunction w/ Amazon are already foisting the same consumer-antagonistic DRM that removes all traditional property rights from the media you “buy” on it. The Kindle is just like the iPod, if the every single track you put on your iPod went through a similar digital panopticon and if the iPod became a useless brick w/o said panopticon service.

Aside: I have a relatively modest library (according to Amazon, I’ve bought about 100 books from them since 1998 — their yourmedialibrary system is actually neat start for personal catalogue management). Based on quick look at my shelves I’ve probably bought another 100 or so volumes elsewhere). As a friend mentioned, books are one of the last types of media where I buy the majority of what I consume. I don’t have any philosophical grounds against it, and although I’d prefer it be convenient, I have occasionally gone out of my way to drive to a brick and mortar store (Scalzi’s Old Man’s War) or ordering from Amazon (Charlie Straus’ Halting State) after reading a piece of it online (or even the whole thing in some cases), and that’d be unlikely to change, especially because it appears to be more convenient to purchase, but having that at the cost of giving up all my existing rights/privileges (while paying up-front and on-goingly) to “lease” IP is a kick in the face.

In any case, I am really glad that the Kindle has been released and with such hype, as it really shines a bright light on digital reading, long the neglected step-child while music and video hogged all the digital attention. Kindle ups the stakes, and will encourage people to start thinking about what they really want out of ebooks, and hopefully it’ll spur other companies to respond to that demand.

As for myself, the reading device I am most excited about is the OLPC I just ordered. It’s not e-ink based (which is a shame, since they really are amazing), and it’s heavier and bulkier, but it is both higher resolution (1200×900 vs 800×600) and denser (200dpi vs 167dpi) than the Kindle, and as a transflective screen, will also work in sunlight and consume only 0.1W of power w/ the backlight off. It also has very good power management (read the travails), which allows fast suspend/resumes in the 100ms level. Lastly, it is a fully functional Linux system, with the GUI built on Python and built for openness . One thing that I learned from the iLiad is that if the system is nominally open/hackable, that unless there is a large enough community working on it, or active support from the developers, all your time will be spent fighting the device. Progress will be slow, marginal, and ultimately unfulfilling for everyone.

In short, wake me up when someone loads Android or Python on it, then I’ll be excited. Speaking of Android, eBook readers do have competition (besides pBooks that is) – the iPhone (and mobile phones) in general serve much of the purpose of being extremely portable and killing dead time without having to carry something extra around. Still, for those long trips, it would be nice to be able to read the latest news or gathered technical papers, or yes, some books on an e-ink screen.

Things to look forward to:

Downtime

After 356+ days of uptime, service was interrupted as my server was moved over to another rack at around 3AM. And a bit more downtime on the site as I fell asleep and forgot to get the DNS updated until the morning… But, things should be back up, depending on your DNS TTL.

SXSW 2007 Notes

SXSW was pretty damn crazy this year. Even bigger than last year, and this time with 500% more overlapping parties. Unfortunately that meant less time hanging out w/ old friends and having interesting conversations, and absolutely nowhere for Boggle-playing (although I did play a bit of Set for the first time – I think I would have gotten better at it if I hadn’t had so many drinks earlier…)

Also, some good sessions. My faves:

  • Will Wright Keynote – this is the third time I’ve seen him speak (Spore demos don’t count and pale by comparison) and he’s bar none the best presenter of game structure/form. What’s great is that he takes you on a real intellectual journey when he speaks – you hang on as he zips through and there’s so much good stuff that you really want to go back and explore – that sounds like that’d be a fun game. Anyway, really hoping a good recording pops up
  • Henry Jenkins – I’ve been a huge fan of Jenkins’ written work since my first readings back in visual literacy class in my undergrad days. And, it turns out he’s just as insightful and engaging in interview as he is in writing. Hooray! If I ever live in Boston I’m gonna crash all his classes.
  • Bruce Sterling – as a speaker, Sterling rarely disappoints. You’re guaranteed at least a handful of clever bon mots, some novel insights, and a few incendiary things tossed in that you suspect is there just to get a rise out of people. There was a bit more of the latter this time. Aside: the commonality of all the three sessions mentioned so far is that they’re talks where can engage you in intellectual dialogue, even as a domain expert (this, unfortunately, is rarer than you’d hope – for years, I’ve been pretty dissatisfied w/ a lot of SXSW sessions because they often made me feel like I was wasting my time, but I had a lot less of that this year – partly by better panel selection (topics, knowing the speakers, skipping time slots), and partly by sheer luck I think).
  • Phil Torrone and Limor Fried – I’ve seen this talk a fair number of times, but it doesn’t get boring – there’re always new gadgets and the conversation does keep evolving (I like the DIY business tangent, and I’d appreciate even deeper discussion about the more serious/cultural implications of Maker Culture and the coming of the Fab Labs…)
  • Beautiful Algorithms – this was everything I wanted out of the session. A soothing discussion about various maths accompanied by great visual animations of said algorithms. Take a look at cove.org for some of those. (Hilbert Curves btw are quite useful for collapsing multi-dimensional data)

I’m really looking forward to catching some of the podcasts of sessions. Here are the ones I wish I didn’t miss:

  • Mobile Design – Kevin moderated this one, and apparently Matt Jones was quite on. This unfortunately overlapped w/ the Jenkins session, so I really didn’t have much of a choice on that one
  • Pervasive Gaming – I almost made it to that 10AM session, but blinking led to a 1hr snooze…
  • WoW w/ Joi and Justin – I heard good things about this, and yes, it turns out that this is really good. Joi, Justin, and Ben are great complements for each other and the conversation is lively and touches on all kinds of relevant issues… highly recommended
  • Field Guide To Design Inspiration – haven’t listened to this yet, have heard it’s worthwhile – but come on, no slides?

Slide

Twitter API

Things that need to be fixed/added:

  • AUTH for API is sooo broken (nonexistent). Impossible to make apps for people w/o. Here’s a document on how to implement one.
  • user object should pass leave status (and any other info you have, like last update)
  • Not API per se, but not having groups is pretty lame

Other stuff, but that’s the stuff that popped out while I implemented my email digest app.