Skip to main content

Posts

New Job, Fun Projects, and Amazon S3

I haven't posted in a while, but things have been going on. I thought I'd post about some of the more interesting aspects. I've recently began a fairly regular contracting deal with an interesting company, and I'll have to be a little vauge on some aspects, because of NDAs and such. During one of my usual nights of aiding the Pythoners of #python on irc.freenode.net, I was discussing a project someone was trying to complete and the long debate about various routes that could be taken led to me being contracted for the job, which I've had fun with. I've been contracted to build a Fuse package, which uses Amazon's S3 as its storage mechanism. It is a fun system to work with, because of its simplicity and challenging limitations. For example, all operations are redundant, but non-atomic, because the same data could be changed at the same time, and its unpredictable how it would propogate across their redundant network. Mostly this hasn't been an issue, beca...

Pandora Pop-Up White Bars Bug the Crap Out of Me!

Pandora Internet Radio - Find New Music, Listen to Free Web Radio So, they added this weird white-bar to top top of pop-up options, and I wrote them to complain because I find it very ugly and unintuitive. I would expect a titlebar-like control as such to be used to move a widget or window, and the X at its left to close the widget just enforces that thought, even tho the bar seems to serve no purpose. Pandora's people tell me it was for some very soon to come updates and that I would see why soon. So, this morning I see they updated the interface again, and there are auto-appearing controls to vote on songs instead of clicking for the menu on each song. That means I will almost never ever see that popup. Is that what they were talking about? Am I missing something? technorati tags: pandora , music , userinterface Blogged with Flock

I've Joined the Flock

Flock — The web browser for you and your friends So this Firefox-based browser is pretty cool. It integrates del.icio.us, Flickr, and blogging. It seems to be strongly related to Yahoo! I'll probably use this for all my casual browsing, keeping Firefox around for development, only. technorati tags: flock , web , browser , software Blogged with Flock

XML versus Binary Document Format Debates

Responding to Sean McGrath on his recent post about XML-vs-binary document formats: Look, its just like I was trying to say in #python@irc.freenode.net the other day: There is nothing wrong with a format being binary. There is no virtue to be found in every byte of a file being interpreted as a textual character (or part of one) that represents your real data. "There ain't such thing as plain text," says Joel Spolsky! There isn't any difference in interpresting the binary as text than just interpretting it directly as your data. You can easily have XML formats as undocumented and inconsistant between versions as any binary format, but you get the added benefit of extra processing overhead, bloated filesizes, and limitations on structure and performance (try keeping efficient on-disk indexes into an XML file up-to-date). I do believe text-based formats and XML has its place, but these places are limited. I would have much perfered an opening and standardization of a r...

DeferArgs 0.4 (Busy day!)

Continuing discussions in #twisted about the benefits and complaints of my deferargs drove me to add more things and release pretty often today. This is version 0.4 . New is tests and ability to move the functionality to the callsite, so you can do this: def printArgs(*args, **kwargs): print args print kwargs deferargs(printArgs)(10, defer.succeed(20)) Also, and I don't know how useful this will be, you can not define specially handled argument types, such as lists that might contain deferreds. These are optional, and not enabled by default. Lists are the only special type handled so far. Use it as follows: @deferargs([list]) def printList(l): print l printList([1,2, defer.succeed(3)]) I might add dictionaries, sets, and tuples to the next release. Filed in: programming python twisted

DeferArgs 0.3 by Example

DeferArgs 0.3, just a few hours after 0.2, is now released here . The only update is support for attemp/catch-all blocks without any @catch(type) handlers. In response to some people in #twisted@irc.freenode.net, here are examples that show what can be done more clearly. To write any function that can accept deferred arguments nicely: @deferargs def printArgs(*args, **kwargs): print args print kwargs To add psuedo-exception handlers and a psuedo-finally block to a @deferargs decorated function: @deferargs def printArgs(*args, **kwargs): print args print kwargs print "This one is important! ", kwargs['important'] @catch(KeyError) def onKeyError(e): print "There was no important kwarg!" @catch() def onAnyError(e): print "Crap!" @cleanup() def _(r): print "Every thing is done." There is also a model for a psuedo-try block, which basically decorates just calls the function immediately when you define it and its...

DeferArgs supports asyncronous try/except/finally constructs

A new version of DeferArgs is available at the cheeseshop . New in 0.2 are the attempt, catch, and cleanup decorators. These mirror the functionality of try, except, and finally. Any deferargs decorated function can be followed immediately by any number of error handlers decorated as @catch(ErrorType) or @catch() to catch all, with the same semantics as except clauses if they were after a try block that surrounded the code in the function. The catches can all be followed with a cleanup decorated function, which will be called when everything else is done, errors or not. There is also a convinience decorator called attempt, which automatically calls the function once a @catch() decorated handler is defined (signifying that all error handlers for it are prepared). Of course, calling it only really creates the deferred that fires when its arguments are ready, so you dont have to expect it to run for real untl after the attemp/catch/cleanup is completely defined. As always, comments are we...