Currently:
2008-09-05»
war zoning out»
Well, I wasn’t wrong about it being a bit noisy outside: six people have been shot in the current gang violence in the Mission this week. It’s latino gangs and Hell’s Angels, apparently. They should fly some mods and rockers over.
I wonder if in fifty years, there’ll be historical Surenos re-enactment societies? Maybe that’s what West Side Story was.
I’m punch-drunk from coding to a rather dumb self-imposed deadline. Still, thank you, Arthur Koziel, for this tip about creating administrative users when you start a database from scratch in Django. I’ve been doing a lot of that, reinventing my databases. One of the wonders of these modern, whipper-snapper frameworks is that you don’t just refactor your code — you refactor your database schema too. Thank god, too: SQL has always filled me with the heebie-jeebies, while I’ve been slowly finding myself become more OOPish as life goes on. I’m such a fan of refactoring, because I so badly need it: I’m a veery slow coder, and a scattergun debugger, which both combine to leave me with a tendency to hack solutions under time pressure. Just putting in enough support to do real refactoring at least lets me tidy up my code a little before anyone else sees it.
I’m really, really, enjoying Django, though. They were wise to keep it cooking for so long before 1.0: there’s so much there (like the test fixtures and contenttypes) which you find yourself reaching for before you even know they’re there. The documentation is great, but I’m also enjoying the general pedagological bent of its supporters and their wider group of companions. If you’re somebody who is thinking about playing with these frameworks, you could do worse than check out the videos on Show Me Do, the Bollywood of screencasting python tutorials.
Okay, on that slightly hallucinatory note, I’ll grab some sleep.
2 Comments »
2008-09-04»
hacking for coins»
Wow, the Mission is jumping tonight. Sirens, a car driving around in loops with an ultrasound sound system, and a man who shouts “hein” every 45 seconds.
I’m a bit under the gun today, so here as usual when I can’t think of anything to write, is something I thought of to write years ago. It’s another Linux User column — usually I’d just stick it with the others in the ugly column corner, but I suspect nobody finds them there, so you have the joy of it clogging up your RSS reader too. Enjoy!
Hacking for Coins
Originally published in Linux User and Developer sometime in 2003/2004. License here
One recurring question of Linux development and the open source development
model in general is that of remuneration. How does one get paid for the
generous work generally volunteered toward a free software project?
There are many models proposed for guaranteeing some financial support for
those wishing to work full-time. There’s patronage. This is where the Crown
Prince of Bavaria, say, gives Linus Torvalds a castle and a moat, and bids him
to write code for the pleasure of the court, or else be thrown in the dungeon
with those BSD mongrels. Linus goes on to create great works, often prefaced
with a large set of logon messages in praise of his honoured patron, only to
die later in poverty following some dismissive comments he includes in a
kernel driver about the CEO of OSDN’s mistresses’ pet lioness.
Critics of patronage point out to live on the whims of a distant,
self-involved elite is a demeaning life for Linux programmers, reminiscent as
it is of both medieval surfdom and being a mere Linux user, both of which
being horrid epochs that as a civilisation we imagine we have transcended.
Another possibility, at one stage I believe semi-seriously proposed by Richard
M Stallman, is a “software tax”: a government program to provide the basic
infrastructure of society by funding open source development out of public
funds. Indirectly, of course, this is what many of our university computer
science departments do now, along of course with their generous financial
support of the brewery, cigarette paper and Pot Noodle industries.
Unfortunately, a Ministry of Hacking has many obstacles to overcome. Many of
our American cousins would believe that the is nothing less than communism,
and would lead to gun control, socialised medicine, and publically-subsidised
firemen. In Britain, while a Code Dole would have some appeal, many government
offices require you to sign on at unfeasibly early hours of the afternoon,
which would make the whole process so unpleasant to many hackers that they
might simply not bother and die of poverty and neglect.
Both of these concepts assume that financial aid for open source coders need
come from outside. But geeks are not helpless, and full of ideas and
creativity. Might not we, in some way be able to temporarily disengage our
mighty brains from finding a better way to sort alphanumeric lists, and
imagine a way of general earning money for ourselves?
In the past, such a gargantuan and uncharacteristic act of concentration has
produced mixed results. Many software projects have temporarily attempted to
live off Google Adsense earnings. As it transpires, the number of adverts
targetted at people wanting to browse CVS repositories is not enormous, and
once all your readers have clicked on the “Visit Ebay, Where We have
Thousands of CVS Repositories For Sale!” advert, revenue pretty much dries up.
Thinking more laterally, many geeks have come up with ingenious, but perhaps
unrealistic projects. Downloaders can pay to have a CD of sources delivered by
a naked singing “Fat Bearded Guy A Gram”. Or costs can be defrayed until the
senior developer’s designs for a space elevator provide enough Helium-3 sales
to pay off the bank loan.
More prosaic is the crazy, mind-boggling possibility of “keeping the day job”.
Again, when Richard M. Stallman was once asked how might programmers earn a
living if all software was free, he replied with words to the effect that he
had always considered waiting tables to be fine and noble practice. Audiences
at the time jeered his words: but stayed to marvel as RMS demonstraterd
Meta-X-silver-service, an Emacs keyboard macro that mystically served a fine
Filet Mignon Garnished with Scallops, Asparagus Spears & Sauce Bearnaise
service to a random stranger, who then provided Mr Stallman with a
fine, fine tip.
Finally, there’s the Street Performer Protocol, the system devised by John
Kelsey and Bruce Schneier for funding creative projects in the absence of
traditional intellectual property rights. In this system, a work such as a
novel or piece of software is effectively “ransomed” – given to a publisher
with the understanding that it would be released to the wider public when, and
only when, they pay a certain amount.
The Street Performer Protocol was first suggested in 1999, but has had
surprisingly little take-up. In fact, was originally devised in early 1972,
but the authors refused to publish it until they were given a million dollars
and a plane to Rio de Janeiro. Negotiations with the public at large stalled
until, in the desperate act which gave the protocol its name, Schneier and
Kelsey travelled to the Edinburgh Fringe and took hostage over thirty clowns,
mimes and magicians who they found performing outside Waverley Station.
They later released a cryptographically-signed note declaring that unless a
prominent academic journal picked up their financing proposal, they would
utterly neglect to kill a street performer on the hour, every hour.
Within fifteen minutes, the people of Edinburgh had paid First Monday, an
online journal, close to five thousand dollars to publish the entire work.
Schneier and Kelsey were remunerated, a publisher provided with their
financial model, and Edinburgh was rid of pantaloon-wearing drama students
forever.
Such innovative and creative solutions are badly needed if we are to truly
create a world in which programmers can work on improving Linux full-time
while still being able afford to feed their children – children who will grow
up knowing a clown-free world. The Street Performer Protocol is available at:
http://www.firstmonday.org/issues/issue4_6/kelsey/ and my Paypal account is
danny@spesh.com. I’ll start with the jugglers in Cambridge’s town center.
4 Comments »
2008-09-03»
civil war by any other means»
Scale: for me it feels like it’s all about scale in America. Trying to somehow scale up the human condition to cover huge, inhuman scales: scales of power, scales of income difference, scales of vast distance, scales of intention, scales of cultural variation. Wiccans and dominionists; black separatists and klanners; Folsom St Fair and Little Green Footballs. How could they all possibly live together?
People forget, when they’re painting the beginning of the United States as basically a bunch of rich white guys in cahoots, is that they were white guys who were two generations down from, as my friend Anno says, the English equivalent of the Taliban, stuck next to Catholics, pacifists, and other miscellany.
The triumph of the American political culture is that raises to religious a creed that declares that “We are all OBVIOUSLY created equal, by — well, a um, thingy — and we have INALIENABLE RIGHTS (the exact list of which we’ll get back to you on), and among the many inalienable rights we have, are um, LIVING, LIVING THE WAY WE WANT, and the PURSUIT of … WHATEVER IT IS THAT MAKES US HAPPY PURSUING.”
It’s deliciously vague, and somehow the country has managed to maintain a stable political infrastructure over vast ideological distances. I’ve read the pamphlets put out by Jefferson supporters against Washington and Adams in the run-up to the 1800 election. They’re incredibly vicious, and I’m sure the reverse was true. Seventy years later, it’s amazing that America managed to have only the one civil war, and then, like some sort of mortally wounded Terminator, manage to stitch itself together again well enough to lumber spritely through the rest of the industrial revolution, despite unparalleled casualties.
When my European friends talk to me about the horrific right-wing nature of America, I can only point to the fact that it’s also houses some of the most left-wing viewpoints in the world (is that true? It’s sort of true: I’ve certainly heard stronger left-wing opinions in San Francisco than I did in London).
How do you even manage to comprehend such divisiveness? Sometimes, I think it’s some core political genius. Sometimes, I think it’s just luck. Sometimes, in more pessimistic moments, I think it only works because there’s enough space between people that the genocide reflex just doesn’t kick in.
Watching Palin, and flicking between commentators across the political map, I had that sense of vertigo, of physical illness again, when I’m trying see her from all these disparate angles. Half the audience just felt it was a sophomoric, nasty, poorly presented rant. The other thought it was the best political speech they’d seen in their lives.
I realise I sound (like I often do here) as though I’m a believer in American exceptionalism. That’s not what I want to say here. I guess what I’m saying here is that I have absolutely no idea how this will play out in America, and I think I knew that the moment she appeared. The left seemed to have one idea of who she was, and the right another: but I think how this plays out may well be much scarier and weirder than either side thinks. And as someone who is planning to live here (where “here” is both the United States and the world that is currently so influenced by it), I find that profoundly disturbing.
I remember talking to Desiree about what it was like in Yugoslavia, before it exploded, and I remember the profound disconnect between neighbours in Britain when Margaret Thatcher stormed the complacent political scene there. I think of the Main Sequence of democracies: a few years of stability, and then some juddering coup or outrage bringing it crashing to the ground. Is that what happens now? Or is it always like this, in America: is it always like that, when you declare that anyone can say anything?
4 Comments »
2008-09-02»
the dynabook, javascript, and real computer literacy»
My first day taking Ada to school. I survived 6AM, and Ada was very good at briefing me on what daddies do at school. She taught me a “Spanish” song phonetically, although I think she may, Borges-like, be teaching me her own imaginary language.
I comb her hair a bit too much in the morning, because I don’t want the other kids to think she’s an odd kid. I was an odd kid. My hair was all over the place (still is, though less of it), and I was always distracted by lucky experiences I’d struggle to explain. At eight, I remember getting teased at my village school by classmates and my teacher because I claimed that my dad had a computer in his room. My teacher pointed out that if that was true, there wouldn’t be much room for my dad in that room: computers were huge, of course. When I said that he let me program it, they really started teasing.
Back then, I had these elaborate, vivid and private fantasies of what the future of the world would be like. When I was 11, a lot of them were based on this article about the Dynabook, re-published in 1980:
Imagine having you own self-contained knowledge manipulator in a portable package the size and shape of an ordinary notebook. Suppose it had enough power to outrace your senses of sight and hearing, enough capacity to store for later retrieval thousands of page-equivalents of reference material, poems, letters, recipes, records, drawings, animations, musical scores, waveforms, dynamic simulations, and anything else you would like to remember and change.
Such flights of imagination are what one would expect to find as the basis for a well-written science fiction novel, or perhaps as the musings of a Creative Conmputerist wishing she could carry the school computer system to the park and use the text-editing facilities to write poetry while sitting under a tree. It isn’t often that such an idea is the basis for a serious research effort by a major company, in this case the Learning Research Group of the Xerox Palo Alto Research Center (PARC) which recently released its latest report on Personal Dynamic Media — the Dynabook.
I remember every image in this article. I painstakingly transferred that image of a bear onto graph paper, and tried to recreate a SmallTalk “dynamic page” in BBC Basic. It was so close I could taste it. Sometimes I got angry that I was just a kid, and everything was taking so damn long to arrive.
I was reminded about all of this, because I was doing research about Google Chrome for the Irish Times column, and daydreaming again while reading Scott McCloud’s beautiful imagery, and thinking: this is what I thought Dynabook pages would look like, only instead of static comics telling a story so well, they would be alive, and dance and be pull-apartable, like a kit car.

And, of course, the recursive truth here is that this booklet includes a description of the element of the modern Dynabook, the Web on a laptop, that could bring those images of really dynamic media alive: Javascript.
To Alan Kay (and the hypertext pioneers), the design of the modern Web page inside out. When you’re writing a page for the Web, as I am now, I’m building it from stringing text together, just as would write a normal book. I’m barely leavening it with any programming functionality at all. In the Dynabook, the aim was to bring the dynamism of the computer to the masses: tools to be able to create pictures as easily as words, and animation as easily as both: but all of them really just subsets of — not programming, but whatever it is that computers provide us as an opportunity. “Interaction” sucks as a term, but I think we may be stuck with it.
The Dynabook — and Alan Kay’s dream still remains — an educational project. What was it trying to teach? I think what it was trying to teach was what I was lucky to get at eight because of my dad’s fictional computer, and which I genuinely believe everyone can, and should have.
Unfortunately, the best term for it has already been debased, and is anyway one of those anachronistic portmanteaus like “horseless carriage” (or Dynabook, for that matter). It’s computer literacy: but let me tell you what that means to me.
As regular readers will already have noted, by professional standards, I’m not great shakes as a programmer. It’s just something I do because I enjoy it, and it’s useful in my everyday life. Yet people regularly marvel that I can do it at all, and wish that they could. I think they can, but the reason they can’t is because they weren’t taught it when they were five, as Ada is being taught reading, and writing, and mathematics, and Spanish.
I think that’s criminal, in the 21st century. Watching my child learn reading and writing, it’s perfectly obvious to me that this is an incredibly hard and unnatural feat, that we’ve somehow managed to consistently teach to >99% of the population of the developed world. We’ve managed that because we have had hundreds of years of trial-and-error training on how to do it.
I think that if some of us applied the same dedication to teaching programming, we’d have the same percentage of coding literacy: a future generation who could wield every part of the computing experience as well as they could a pen. Most of them might be, by the professional standards of today’s programmers, barely coders at all: but that’s like elegant scribes of the past sneering at the slate-scrawling graduates of the first public schools. (Actually, I don’t think that would be the case: I think a huge minority of modern coders are people who don’t really feel any affinity to or ability for the job, but have been obliged to learn it because of extenuating circumstances. Someone trained from kindergarten would knock their abilities into a cocked hat.)
Reading, writing, ‘rithmetic, and ‘raction. Learning your ABCs, your 123s, and your iterations, abstractions, and recursions.
Alan Kay was – and still is – trying to build that platform, and that educational experience, with the Dynabook. We’ve now got the infrastructure in the Web, Javascript, and modern technology. Like in 1980, trained by accident to see the obvious, it’s so close I can taste it. I don’t know how we got to Gutenberg to universal literacy, but that’s the path we need to walk down now. I want true literacy for my daughter.
2 Comments »
2008-09-01»
Ken Campbell is Dead»
Nobody tells you that when you get old, you’ll see your heroes disappear from out in front of you, like fellow chickens vanishing out of sight from the battery farm conveyor-belt into some unseen manufacturing process.
I first went up to the Edinburgh Fringe in a children’s play, School for Clowns. Everyone else applied, correctly, for the acting experience. Me and Al Murray auditioned so that we could get some money and lodgings to do comedy. There was a tension that Edinburgh between actors and comedians, at least among all of us twenty year olds. Forty of one or the other lived for two months in one room with no baths or hot water or laundry and a single toilet in an old Masonic Lodge near the top of Edinburgh’s granite spur.
We were ostensibly a theater group, but the comedians stank and drank up the place and shouted long after midnight, horribly parodied the actor’s hard work instead of rehearsing their own, and constantly, desperately, hit on everyone. And we never ever washed-up, and we never took anything seriously apart from angry endless nerve-wracking arguments about jokes, which we’d type furiously on a typewriter in a corner of a room, or loudly reconsider while all the actors tried to sleep in our unhygenic shanty-town made of cardboard boxes.
School for Clowns was written by Ken Campbell, who I had never heard about. I thought he was a terrible writer. The play made no sense, and was certainly too weird for kids. After agonies with our director, we quickly jettisoned almost every element of it, and replaced it with a new script, and a new plot, hastily improvised. The play remained just as weird though: the one part we’d left, the characters, had a life of their own, and for six weeks I found myself stuck in the role as Campbell had written it: a wide-eyed idiot clown, endearing but gormless, constantly and randomly suggesting random ideas that drove the play along, constantly accidentally sabotaging the lesson with chaos. The chaos was what the children liked, and hopeless audience-panderers that we were, we would would egg them on to take over the show, commandeering children in the audience and overreacting to their smallest acts of naughtiness until the show would frequently end with dozens of kids on stage, slapping clowns with pies and coloured water, and screaming to their friends to join them.
Then, one night, Toby Hulse, who was twenty-two and therefore infinitely wise, took us to see Ken Campbell’s one man show. I was curious, partly because both the actors and the comedians seemed to talk of Campbell with hushed respect.
It was insane. And I don’t mean that in a sort of “crazy”, light-hearted way. I’d entered sceptical of almost all theater, because really at heart, I felt it was about a sort of overintellectualised basal manipulation, but Campbell managed to drill right into me, while at the same time explaining exactly how he was doing it. He sat there and talked about how to manipulate the audience, then lift you up on one of his extended rants and demonstrate the trick. It was like a masterclass in masterclassery.
I was an easy catch: I spent my teenage years obsessed with the Illuminatus books in the same way other kids were obsessed with football. But I hadn’t known that Campbell had written and performed a five hour musical adaption of the same trashy science fiction trilogy, and then put it up as the inaugural show at the Cottesloe auditorium of Britain’s National Theatre, and that this particular one man show was his retelling of his investigation into the demi-monde of the book and its adherents. Campbell was pulling the old Robert Anton Wilson trick of convincing you to believe a religion made of nonsense, then showing you how gullible you were to believe such a thing.
We came out of the show, recovering and retelling Campbell’s stories to one another, and asking “Do you think that really happened?”; trying to find again the borders between the fictional and the real world Almost everyone agreed that whatever else was true, those books Campbell referred to as coming from the Loompanics catalogue had to be made-up by Campbell for the cheap laughs. “How to be disappear completely”?Kill Without Joy: The Complete How To Kill Book“? I emphatically explained that not only was Loompanics real, but I had copies of their edition of the Principia Discordia at home, everyone looked at me as though I had become part of the play. Was I put up to this by Campbell? Had the show finished?
It’s hard to convey how hard it was to deliver such High Weirdness to the world before Internet, how hard it was to stumble upon the unusual, and how you’d have to mine and hunt for it. And how risky it was to go on those hunts, far away from any reassuring backdrop of normality: the serious parts of Campbell’s stories frequently discussed how others he was going crazy, and how close he felt to it himself. When you met him in person, he gave off that aura of what the Guardian obituary generously calls “a thin streak of malicious devilry”. I’d say it was far more dangerous than that: after surviving eight hours or so of his 29-hour long play The Warp, I really doubted his good intentions to either the audience or the cast, all of whom were on the edge of sanity by then. I remember the ordinarily mild-mannered Kevin Cecil looking like he was going to kick a nun after one three-hour conspiracist Campbell experiment.
The comparison with Puck or Falstaff doesn’t miss the mark, except that he was a Shakesperian character directing his persona at the audience, not another character. He’d be jovial, but with a force to it, as though he was deliberately dunking you down into the lowest most erratic parts of humanity, as an illustrative lesson, but also as a thuggish test to see whether you could survive it. Acting and comedy were the same, low high art. The sin of the arch and luvvie and those actors involved in the “art” wasn’t that they took it too seriously, as all of us trivially thought. It was they didn’t take it seriously enough. The serious part of performance was the shouting and the drink and the squalour and the arguing over stupid jokes.
I didn’t take enough people to Ken Campbell shows, and I didn’t go to enough Ken Campbell shows, and now it’s all gone. Damn.
6 Comments »
django incoming!»
I’ve spent today hacking with Django (well, to be accurate, I’ve been hacking on Django intermittently with eating pancakes, playing with kids in the park, and watching the whole Sarah Palin gossip trainwreck ricochet across the Internet: I honestly now have no idea what the hell is going to happen in this election).
I’ve been tracking Django since forever, but held off from doing anything too serious with it until 1.0. I’ve got a work project that fits the bill quite nicely, and I figured that a few days before 1.0’s September 2nd estimated deadline would be good enough to start hacking.
It’s been fascinating working under a codebase that is under heavy but stable development as you work. I hit bugs that I’d find in the bugtracker, filed just a few days ago, and then find them fixed while I slept. I’d also have occasional disconnects where something I’d been using in Django a few months ago had been completely reworked (mostly the admin feature), and I’d have to scramble a little to work out what had changed, and what had remained the same.
Overall, though, I’ve been really enjoying it. The changes that were made, like being able to subclass database models, seem esoteric but end up being really useful (I am uncomfortable with idea of refactoring a database schema, but it’s made much more sense to me now I can fiddle with inheritance instead of bang my head against SQL). The documentation remains first class, and has kept up with all the changes. I’m not far enough through the project to give you a realistic summary of how good a fit it is for my use, but so far, it’s been fun, at least — and it’s definitely good enough for 1.0 status.
Comments Off on django incoming!
2008-08-30»
electoral roulette; being a jeffersonian»
My friend Stephen Sharkey, who writes plays, once wrote an adaptation of Dostoyevsky’s The Gambler, and, as part of his “research”, we would go out and spend our meagre earnings nightly in Soho’s casinos. My colleagues tried their hands at games of skill, like poker and blackjack. I tended to play the games of utter randomness, like roulette, because I was fascinated by the obsession that the players (including myself) would devote to seeking patterns and predictability in the spin of a wheel that was — as we all rationally knew — completely beyond our control.
I feel that about this American election. I have no control. I can’t vote, which removes even the smallest breath I might place on the wheel. I can make no predictions; there’s certainly not much point in following the spin right now, because predicting the election from the day-to-day motions of the polls this far out is close to futile.
But that doesn’t stop me from constantly hitting reload on the news sites and listening out for every bounce of the ball.
I suspect we’re wired to pay more attention under these circumstances, as our minds desperately focus down to find some factor we can use to change the odds.
I am for Obama, more emotionally at this point than because I’m expecting any real change. I fully expect to be disappointed in him when he gets into office; he’s already disappointed me by betraying the main issue I cared about in this Congress. I worry that I’ve brought down my curse on the Democrats with the arrival of Sarah Palin, the sort of emotional down-at-home story that voters lap up and modern Democrats seem congenitally unable to recognise and counterract — even when, as with Bush, the mythos was artfully constructed. I think right now they’re just hoping she’ll make some kind of rookie screw-up, but eight weeks isn’t that long, and there’s a sizeable proportion of newbie screw-ups that count as endearing in that story.
But, hey, I suppose I should really be rooting for Ron Paul or Barr or None of The Above, right? Nah. My concerns right now are mainly about corruption, and freedom through civil liberties, domestic and international. Obama has a slight lead on the domestic front, where McCain just seems erratic. Obama’s rhetoric suggests that he would see some real mileage to be gained from defending civil liberties, in the face of “security”-driven outrages on that front. I don’t trust McCain’s ability to syringe the corruption out of the heart of the Republican party as it is now. I don’t trust Obama to start that job yet, but it’ll take eight years or so before it’s anywhere near as bad as it is now.
In foreign policy, I’m basically a Jeffersonian in Walter Russell Meade’s ontology of American foreign policies. Jeffersonians are broadly isolationists, believing that America’s own domestic democracy is a fragile flower that needs all the protection it can get, and that most foreign entanglements put that project at risk. That is contrasted with Wilsonian spread-the-give-of-democracy globalists, Hamiltonian defend-the-free-market-with-guns capitalists, and Jacksonian you-lookin’-at-my-flag-funny-or-what? militarists. Jeffersonians haven’t really had much fun in the last few administrations, but hope springs eternal — the most tragic part of Meade’s 2001 book Special Providence for me was that he foresaw a Jeffersonian revival — about a month before 9/11 and the emergence of a fierce Jacksonian/Wilsonian alliance.
So, for a Jeffersonian, a dignified withdrawal from Iraq, a closing down of Guantanomo, and a ten year project for energy independence, and a specific appeal for cross-party allegiances, all sound good. Plus he’s culturally closer to me than McCain, and he’s a great speaker who lays on the constitutional references with a trowel, which I admit I’m a sucker for.
But mainly what I want from this election, is for it to be over. The idea that I have eight more weeks watching this wheel spin around, and that ball bounce and bounce and bounce, is more than I can bear. Les jeux sont fait, rien ne va plus!
1 Comment »
2008-08-29»
the most useful simple script i have»
Lee’s comment that mentions having a folder for items you’re about to delete reminds me of probably the script that has most contributed to sanity in my filing system. It’s pig simple, albeit a bit scary to write and enact. All it does is delete everything in a given folder that’s over a week old.
I’ve had bad experience with handing “delete file” powers to an automatic script before, so I’ll disclaim any warranty (“TO THE EXTENT PERMITTED BY APPLICABLE LAW” as the GPL shouts), but it’s pretty straightforward, and works for me: I have it in a cronjob. The tmp
folder it cleans up is my default save folder on Firefox, and where I generally download everything. If I want to save anything longer than a week, I find it a place in the rest of my filing system. It’s sort of like having a cleaner come around every week: occasionally you go “Garr! Where’s that coffee-stained, have torn copy of last month’s New Yorker! I was going to eventually get around to reading that!”, but mostly your cruft just silently disappears without you noticing a thing.
You’ll need to replace /home/danny/tmp
with your own dumping ground. If you run it like this:
It’ll tell you what it’s planning to delete. Run it without the -d
and it really will delete those things, blam.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#!/usr/bin/python ## # clean_folder -- clean up temporary folders ## # Deletes everything under a folder which hasn't been modified # in a week. Deletes directories that are empty, too. ### import os, sys, time if (len(sys.argv) == 2) and (sys.argv[1] == '-d'): dryrun = True else: dryrun = False tmpdir = '/home/danny/tmp' daysback = 7 cutofftime = time.time() - (60 * 60 * 24 * daysback) for d in os.walk(tmpdir, topdown=False): (dirpath, dirnames, filenames) = d for f in filenames: thisfile = os.path.join(dirpath, f) if (os.lstat(thisfile).st_mtime < cutofftime): try: if dryrun: print "I would delete:", thisfile else: os.remove(thisfile) except OSError, (errno, strerror): print "%s: OSError(%s): %s" % (d, errno, strerror) for d in dirnames: thisdir = os.path.join(dirpath, d) if not os.listdir(thisdir): try: if dryrun: print "I would delete:", thisfile else: os.rmdir(thisdir) except OSError, (errno, strerror): if (errno != 66): print "%s: OSError(%s): %s" % (d, errno, strerror) |
11 Comments »
2008-08-28»
the business of barack»
Watching the Barackticon today, I remembered Mark Andreessen’s conversation with Obama before the nomination battle began, and this bit in particular:
We asked him directly, how concerned should we be that you haven’t had meaningful experience as an executive — as a manager and leader of people?
He said, watch how I run my campaign — you’ll see my leadership skills in action.
At the time, I wasn’t sure what to make of his answer — political campaigns are often very messy and chaotic, with a lot of turnover and flux; what conclusions could we possibly draw from one of those?
I’m drawing the same conclusions as Andreessen did: I’ve been really impressed by the confidence and professionalism of this campaign, right down to the sheer chutzpah of putting on that concluding speech in a sports stadium.
Part of it, I suppose, might be down to simply being able to throw down more money than the next guy, but when I think back to the awkwardness and slip-ups of the Kerry democratic convention and campaign, it really stands out that there’s a great team at work here. You can pick good people to be on your team, but it takes real expertise to pick good people who themselves can pick good people, and so on.
I thought the same thing about both Bush campaigns: they weren’t quite so picture-perfect as this, but you got a feeling of a well-oiled party machine grinding into action — albeit using old (and to me unfamiliar) tools to do so. I remember reading an inside-the-Bush-Whitehouse book extract from a young speechwriter who talked about how you never saw anyone not in their business suits in the Bush campaign, which I can believe. It was a print-out and spreadsheet, pinstripe success.
This Obama campaign, which I have probably cursed by saying this out loud, looks from the outside like a well-run, contemporary business: seemingly the right mix of enthusiasm and discipline, encouragement and focus. I view organisations like that as a sort of minor miracle, because the working environment has changed so radically in the last decade that I despair of anyone getting it right. You’re safer using the old disciplines, but at a cost: that’s what makes your company or image appear distant and inhuman compared to the bumbling, chaotic but adventurous alternatives. Bush’s skill was appearing human despite that kind of frozen discipline, and you only had to see how badly Gore and Kerry were at imitating the same relaxation to see the challenge of covering up all that machinery.
I suspect that if Obama gets in, they’ll be an awful lot of Fast Company-style books written about this campaign, and how to build your business the same way.
1 Comment »
2008-08-27»
horrid day; roll-call of the presidents»
Yuck. Nasty fistful of hours, full of drama and not-much done. The only tiny island of glee (I like wading desperately out to those when stuck out on some muddy estuary of despond) was sitting in a ten minute taxi ride, listening to the roll-call of the Democrats end with Hillary propsoing for the unanimous support for Obama by acclaim.
I remember watching the American conventions at home, and — as is correct behaviour in Britain — sneering in projected shame at the display: not of the emotion, but of all that self-congratulatory pomp. And so pre-rehearsed! What’s the translatable metaphor here? It’s like if Americans were to turn on the television and see Mexicans greet their new nominee by taking giant cakes made in advance in the shape of their candidate, and then individually smearing it over their bodies going “love him, love me, loooooove meee loving himmmmm”, while the camera obscenely zooms in on their smug faces. That’s what American pageantry looks like to Brits. It’s not the show of emotion, it’s the horrid self-reflexive, self-glorifying appearance of it.
These days, I rather like it (the pageantry, not the cake smearing) — the constructed joy is infectious, even as I dimly hear the echo of a million English voices going “Oh, do come off it!”.
To translate backwards, here the rollcall is like an English person going into the corridor, doing a little jump and saying “yay! me!”, being caught by your best friend — and then have them give you a knowing wink. Americans are allowed to do all that, somehow choreographed in advance, on TV, with thousands of each other, in pursuit of their political ideas, and smeared with cake, I mean, with streamers and big banners.
Forget the cake. It’s a distraction. When I get back to the UK, I’m going to go to a football match, because I think need more metaphors for all of this. Also, right now I could do with the anticipation of some big happy emotions. If they do that at West Ham these days.
3 Comments »