a few new things

I know things have been quiet around here lately — life has been eating me, you know how it goes. Here are a few of the things I've been working on:

I have a new gig as a freelance tech blogger for PCWorld's GeekTech blog! This has been a ton of fun so far. I get to write stories like "Self-Stirring Pot Makes Instant Ramen Even Easier" and "Moss-Covered Table Powers Clock, Might One Day Power Your Laptop"! And they pay me! How is this my life? (Also I accidentally a professional writer? Yeah, I wasn't expecting that either.)

I'm still writing code, albeit less intensively. I soft-launched 750books.com, the site I teased in my previous post, a couple months ago. It exists to take the export files from the 750 Words daily writing site that I've been using for a bit and turn them into a beautiful PDF suitable for printing at a place like Lulu or Amazon CreateSpace. (The backend script that does this is up on Github; the service that wraps it isn't yet. I'm still learning how we deploy webapps in the 21st century.)

I wrote some LARPs! If this weirds you out, think disaster preparedness simulations. If this makes you think of people running around in the woods with foam swords, that's not wrong, but everything I was writing and most of what I play is more people in classrooms and hotel function space and less combat-focused. I also ran a seminar for people who want to write LARPs with a friend (running again at MIT the weekend of July 13! you should come!) and am organizing Pre-Convention, a day and a half of panels, talks, and workshops, for Intercon next year (you should come! you should bid something! it'll be great!). (My hobby: project management.)

As was perhaps inevitable, a couple weeks ago I decided to combine all of the above and launched Northeast LARP News, a blog to aggregate LARP event announcements in the Northeast US. (Okay, the code angle is a little weak, because I got smart and hosted on Blogspot. Shush, you.) So if you have things you want me to post, please send them over (instructions are on the site); if there are places I should advertise, please let me know, here or there; and please add it to your RSS readers/e-mail/LJ/Twitter/whatever. Questions, comments, concerns, etc. welcomed.

And that's a big piece of what I'm up to lately. Things are pretty good!

playing with css

As many coders do, I work on personal projects on the side, especially lately as I’ve been doing contracting work and job-hunting. Building software is apparently one of the things I on some level can’t not do — I get antsy after a while and need to write some code. Lucky for me, then, that people are happy to pay me well to do something I enjoy. 🙂

Right now I’m working on a site (in Python and Django) which will allow you to take things you have written and turn them first, as a MVP, into a PDF of a book, and eventually directly into a physical book, via one of the print-on-demand services.

Because I want the site to be friendly and easy to use, I have been lately working on the styling of it. Going into this I knew very little CSS — anyone who has looked at the source to this web site (please don’t, it hurts) can attest that much of it is left over from the bad old days of tables that characterized the web when I started it. This is where I am right now, after a couple evenings’ hacking (click for the HTML version):

 

I’m pretty happy with it so far. Right now it’s aiming to be pure HTML 5, and I made a couple design decisions in moving from my Inkscape mockups to this CSS mockup because they were easier to do in pure CSS. More browser backwards-compatability things, many of them enabled by JavaScript, will be along as the code moves towards being in actual production and out of the mockup phase. I’m confident at least that things will degrade functionally — if IE 6 users don’t see rounded corners, they’ll survive, and if they don’t see the placeholder text in the author field either, it’s a UX hit but doesn’t impair the functionality of the site. All my PUT and POST calls still work. (This example is of course straight HTML. Clicking the submit button doesn’t do anything.)

Let me know if it breaks in your browser. (Why yes, this is partly a backdoor attempt to get some browser compatability testing, how could you tell? 😉

unofficial python audiobox.fm uploader

tl;dr audiobox-uploader-0.01.tar.gzgit repository

Some time ago I was being frustrated by my inability to access the music stored on my personal fileserver while at work — something about Apple having locked iTunes sharing to the local subnet, the lack of decent DAAP clients for Mac, and so on and so forth. Moving all the many gigabytes of music I have to my work laptop over work’s network connection is slow and anti-social, and at any rate then I have two places in which I need to manage my music and propagate new albums I buy. (Yes, if this were a Twitter post it would get the #firstworldproblems hashtag.) “Wouldn’t it be great, in this much-ballyhooed age of Cloud Computing,” says I to myself, “if my music could live in the cloud.”

Some friends of mine have a startup, MixApp, which lets me (legally!) publish the music on my fileserver and listen to it and chat about it with friends online, which was sort of like what I wanted. It’s actually a really neat service, and I like it and use it a decent bit, but I don’t always want to listen to music with other people, and the interface is tuned to the social music listening model and not so much to being like iTunes. Additionally, at the time they were having server problems (since resolved!) so that avenue wasn’t available to me.

I started looking around online, and the first service I ran across that seemed to fit the bill was AudioBox.fm. For a mere $10 a month, they’ll host up to 151GB of music, and they’ve got a nice Flash-based, iTunes-like player, last.fm scrobble support, decent library management capability, and most of the other features I expect out of modern music player software. They’ve got support for a bunch of formats besides MP3 (FLAC, OGG, and M4A being the ones I care most about), though all the music gets transcoded to MP3 for streaming, so I’ve been mostly converting to MP3 locally before I upload, since there’s no sense taking up the storage space for FLAC if I don’t get any benefit from it. Since it’s all my music, I can also get it back any time I want, so it’s a convenient backup of my music collection.

The only problem was getting all my music into the service. There’s currently a fairly nice Flash uploader, but it only takes 999 tracks at once and only MP3s, and there’s now also a Java WebStart-based uploader (which there wasn’t when I started), but most of my music lives on my Linux fileserver, not any of the client computers I use, so neither of those was going to do it. There’s also a nice RESTful API, and so I set out to write a Linux upload script.

Along the way, I discovered that none of Python’s built-in HTTP libraries deal with submitting multipart forms. I ended up stealing the multipart processing logic from Gabriel Falcao’s bolacha library, of which portions were in turn borrowed from Django’s test client, but I was disappointed that the support wasn’t built into something more comprehensive. Claudio Poli at AudioBox pointed me towards bolacha, and has been excellent to work with on this script — I’m pleased with AudioBox’s attentiveness to developers. (Careful observers will note that AudioBox offers both an OAuth authentication API for web services and HTTP Basic authentication for desktop applications, and Claudio promises that they aren’t going to pull a Twitter on desktop and open-source application developers.)

None of Python’s built-in or commonly-used HTTP libraries support bandwidth throttling, either, which turns out to be important when you’re uploading tens of gigabytes of music. I thought about building native support into the upload script, but I wanted to get a release out, and the trickle utility turns out to work marvellously on Python to limit its upload bandwidth use, so I punted on that. Seriously, if you don’t know about trickle already, you should make a note of it — I can’t remember the number of times I’ve wanted to throttle a program that didn’t provide the option, so its existence falls into the “I wish I’d known about this years ago” category.

At any rate, the result of my labors is audiobox-uploader-0.01.tar.gz, released here for the first time. Source can be found on Github, and users should please feel free to contact me with any questions, comments, or patches you might have. 🙂