Cardboard Cubbyhouse: 2. Design

This is just a quick overview of everything I planned to do.

sketch.jpgThe basic, “typographic arrow” shape we’ve covered. In fact I think I got that from another impromptu box cubby put together by my good lady other half. You get an entrance tunnel and windows looking out in two directions.

Drawing it

AI printout of plan viewPencil and paper handled the initial ideas, then gave way to Illustrator, which made all the angles and measuring much simpler. Turning that into 3d was not so easy, and I was doing quite a lot of pythagoras. version-in-sketchup.pngThere it would have stayed, had I not stumbled across Google Sketchup while just fooling with Google stuff as you do.

As you can see, sketchup’s little measuring doodad was invaluable. With this, I had everything.


The roof obviously couldn’t be cardboard, but it pretty much cried out from my first sketch that this modernist aussie installation had to have a corrugated iron roof. I then discovered CGI mini (not to be confused with any lightweight web-scripting you might be doing). It seemed perfect, small corrugated iron for a small edifice. Ultimately, this choice caused a few problems.

drip-test.jpgI realised I’d need something to stop water running back down the inside of the roof from the front, and came up with a garden hose slit along its ‘belly’ and glued. This was unexpectedly tested ahead of schedule, and performed very well.


Nor can cardboard just sit on the ground, even if I didn’t live in a termite nexus. It needed to sit up on some kind of piers, and I obviously have some sort of pathological weakness for lightweight, easily worked materials. Hebel (or AAC) is something I’d learned about on those home improving shows that were all the rage for a while there. To simplify slightly, it’s “leavened” cement, like a very solid sponge (or a very gritty Aero bar). It’s very ligh, can be worked with woodworking tools and is pretty cheap (it also has excellent acoustic and thermal properties which we make no use of here). Credit goes to Mr. Peter Collen from work for pointing out that they’d need a waterproof layer to prevent ground water seeping into the cardboard. I eventually settled on a square cut from one of the thousands of PET milk bottles we go through these days.

The floor itself is the hardest-working piece of all and I never really entertained it being cardboard. For a while I planned on masonite, but then realised that plywood would fit in much better. I also decided some of that metal kick-strip stuff they have on stairs would be good at the very entrance.

The meat in the sandwich

edges.jpgLet me try to be brief here. The plan was for 100mmx100mm members for all the formwork, using standard half-lap joints (I call them “rebated”). I decided to laminate with the flutes up/down to prevent crushing. I had a bright idea to run the occasional layer horizontally to add strength in another axis, but once built I could see the opposite would have been better: 3 vertical and 10 horizontal (see construction for more info on that)

Columns benefit from this knowledge and are mostly vertical. For the columns where the “shaft” joins the “head” I came up with a natty way of making an L-shaped piece without wasting any cardboard.

The roof frame is 50×50 – not having to carry children – and the roof ribs are 50×100, so that they line flush with the frame.

Walls I just left vague – they might be single sheets of double-wall, but probably some kind of laminate, with the flute alignment alternated for strength. Again to deal with water, the walls are meant to extend just 1m or so below the floor formwork, so any drips that form will stay on the walls.


All laminating was done with PVA glue – this is biodegradable, though it takes a long time. Cardboard itself is held together by a starch, so if you were super keen for degradability and lived in a moisture-free place you could use flour and water.

countersunk screwThe bigger bits are joined to each other via countersunk screws. Cardboard has the nice property of being self-countersinking. I also discovered afterwards that screwing “into the grain” produces a pretty weak result.


Shell script to delete all but the N newest files in a directory

(First, the cubby is finished, but it’s a more demanding writeup, so it’ll will come shortly.)

Couldn’t find something to do this via Google, so naturally I thought I’d share this once it was ready.

Do you ever want to keep just the N newest files in some directory. There’s no shortage of scripts out there to purge (or do something else to) all files over a certain age, and that’s great for log files and things which you know are always going to come in. But if I have a directory which is downloading files from an internet source of varying reliability, I don’t want to end up in a situation where I have no data in my work dir.

Enter, a little script I cooked up to do what I want: you specify a directory and a number and it keeps only the N newest files in your dir.

It makes judicious use of pipes and xargs and unix goodness to do the job reliably in a small amount of space. It will give you a usage statement if you run it with the wrong number of args, and returns a non-zero value if it fails (but it could fail even if it succeeded 99.9%. And it goes a little something like this:

#! /bin/sh# keepnewest
# Simple directory trimming tool to handle housekeeping
# Scans a directory and deletes all but the N newest files
# Usage: cleanup <dir> <number of files to keep>
# v 1.0 Piers Goodhew 1/mar/2007. No rights retained.

if [ $# -ne 2 ]; then
  echo 1>&2 "Usage: $0 <dir> <number of files to keep>"
  exit 1

cd $1
files_in_dir=`ls | wc -l`
files_to_delete=`expr $files_in_dir - $2`
if [ $files_to_delete -gt 0 ]; then
  ls -t | tail -n $files_to_delete | xargs rm
  if [ $? -ne 0 ]; then
    echo "An error ocurred deleting the files"
    exit 1
    echo "$files_to_delete file(s) deleted."
  echo "nothing to delete!"


Cardboard Cubbyhouse: 1. Origins

The inspiration hit me one day after the kids were playing in a two-box cubby contraption their mother had thrown together in the room-without-clear-demarcation. While putting them away, I noticed that these computer boxes were solid. And quoted on the base were all sorts of strengths: crushing, bursting, weight that-can-be-carried. My mind ticked over.

Frank Gehry’s carboard chair has always been a favourite, I just love the idea of using something so unexpected for solid, long term furniture (and google it, several places are selling them to this day, and they cost more than an Aeron!) And in a similar vein, I’d not long before been to see the cardboard house outside the Opera House. While the low-cost and ease of construction are plusses (as is its relative biodegradability), I just fundamentally think that building things out of fat cardboard laminates is cool (in fact, under moderate scrutiny, you can see that cardboard is not quite the eco-friendly tool to house the masses it might seem – you cut down fewer trees, but then you need huge amounts of water and lots of delicious carbon to reduce a mighty tree to a soggy paste which you can then form into cool crinkly shapes. And do these huddled homeless masses really only want for super-cheap building materials? Or, are there a host of endemic socio-political pathologies that only several centuries of perfect conditions might erase?)

I just want to make it clear that although there is some social and environmental merit, I’m no misty-eyed treehugger. I started to build this because it would be damn natty. And make my kids the envy of the inner west. Also I was (and am) creatively under-challenged at work and strange ideas just kept popping out of me.

Early designs resembled Gehry’s: a curvy retro-ish thing made with ribs. But at some point I can’t quite recall, I decided something in the shape of an arrowhead would be an interesting space both from inside and out, and a sketch more or less identical to the final design was quickly produced. (Some practicalities intervened, I live in the termite capital of Sydney and all of Sydney can get quite wet – last century anyway – so I didn’t want to have the thing directly touch the ground, which the retro designs did.)

Cubby Scale ModelOne of the things my current, noncreative, job has taught me is that it really is OK to plan things in detail. So, having transferred my sketch to Illustrator (with 100% right measurements) I sat down for a couple of nights and made me up a 1:10 scale (1:1000 in 3D) model. (It’s since met with the kids and been beautified. Don’t have a photo of that, but I’ll try to add one in)

I flirted with the idea of just ordering up a huge batch of cardboard, but I decided that I ran across a fair bit of the stuff in my line of work – directly, but also my whole department was lucky to receive a lot of big boxes. It also seemed reasonable to re-use what would otherwise be recycled eventually, but who knows how efficiently or cleanly. And also the prospect of talking to the relatively small number of cardboard suppliers about how much did I want, what did I want it for, what kind did I want, etc., was not enticing.

I also learned a lot about cardboard (it was also around this time that I learned that the only reason you wouldn’t just use wikipedia, is if something isn’t in wikipedia). Cardboard (correct name “corrugated cardboard”) had a surprisingly spread-out history: first someone invented the crinkly paper. Then, someone else worked out you could stick a sheet of flat paper on one side to make it more rigid. Later, someone else again worked out how to stick paper to both sides. Someone else worked out that you could make it into boxes which both stacked well (it doesn’t crush along the “grain”) and protected their contents (it does crush laterally, acting like a cushion).

It comes in various thicknesses (1,2 or 3 wall) and various pitches (“flutes”). The cardboard I’d seen in the computer boxes originally was double-wall A/B flute (I’m guessing the flute letters, I seemed sure at the time) which turns out to be fairly common in larger boxes and has the advantage (where you’re laminating) of being thicker to begin with – they’ve done half the work for you.

Part FSo I began gathering, and then I had to spend quite a lot of money on tools to measure, rule, cut, glue … and on December 7, 2005 I completed one peice, “Part F” of the base (for almost all of the first year, the cubby existed only as the base).

And that seems like a good place to stop.

FCP 5.1.2 for Script Kiddies

As the administrator of quite a few FCP seats for a few years now, I’ve been hanging out for some kind of way to automate FCP for most of that time.The XML introduced with version 4 promised all sorts of streamlining (and I put it to good use), but it still requires human intervention to start/stop/save anything. Closer, but no cigar.We have workflows here which just require humans to click the same buttons again and again, and (until recently) I had one script which used UI scripting to pretend to be a human clicking “Save as …”, filename, click OK, etc etc etc. (To generate a pile of FCP projects ready for use derived form an excel sheet of jobs with code numbers, duration etc). Could be better! (suffice to say it didn’t always work!)I even got me an audience with some senior FCP people at Apple and asked them directly. And they’re obviously listening. Slightly. One of the improvements brought in with FCP 5.1.2 is support for AppleEvents. I say “slightly” for two reasons:

  1. They’re Apple Events not AppleScript. There’s some example Objective-C code, which maybe I could have made something of in a few months, but nothing simple
  2. What they do seems a little odd. Or non-obvious anyway.

Once I got over my initial disappointment, I set to thinking. First, I worked out where Apple were coming from with how you were supposed to use these things. Then (with help from a page Google can no longer find, or I’d credit it) I managed to get my head around using Raw AppleEvents within AppleScript.

My findings

The basic workflow is: you can add arbitrary XML to an existing project (or extract it, change it and put it back). You can’t just create a new blank project, so my scripts do this:

  1. Duplicate a base template project, giving it the right name you want and putting it in the right place(via standard AS or Shell script)
  2. Open that Project in FCP (via routines below)
  3. Insert my custom-generated XML into this project (via routines below)
  4. Save and close the FCP project (via routines below)

You still can’t create a new project from scratch, export a movie of anything or do an automatic print-to-video or Edit-to-tape. So there are a lot of possibilities which … aren’t actually possible. But hopefully what we have here will help someone somehow! It has helped me to retire my UI scripting monster, with a faster and more reliable successor.And here are the routines I cooked up. I generally use POSIX paths (my scripts are total unapologetic bastard hybrids of shell and AppleScript. My motto is “quick-and-dirty is totally safe for a script under 2 screens long”) so these routines expect those. If you’re more of a purist, omit the word “POSIX” in front of “file”.Also, If you’re doing heavier work, you really don’t want to use these subroutines, with their repeated tell .. end tells, you want to just use what I have as a guide to the syntax.And lastly, I’ve only used three of the possible events. If you’ve actually read this far and want to know more, head on over to Apple’s Developer pages for the full information (the whole API is in FCP_AppleEvents.h). The basic raw syntax below can be applied to all of the events.

Sample Code

My basic code is:

-----------------Routines to talk to FCP via new v. 5.1.2 AppleEvents ------------------------
--From FCP_AppleEvents.h
property kFCPSaveAndCloseProject : 0
property kFCPDiscardAndCloseProject : 1
--We always refer to projects via their files. I'm always using POSIX file paths,
--if you don't, delete the word "POSIX" form each routine

--get FCP to open a file
on FCPOpen(aFile)
	tell application "Final Cut Pro"
		«event KeyGofcP» given «class fcpP»:POSIX file aFile
	end tell
end FCPOpen

--get FCP to insert XML into a project (you refer to the project as a file)
on FCPInsertXML(aFile, someXML)
	tell application "Final Cut Pro"
		«event KeyGiXML» given «class fcpP»:POSIX file aFile, «class xmlD»:someXML
	end tell
end FCPInsertXML

--get FCP to Close (and optionally save as per the flags)
on FCPSaveandClose(aFile, saveFlags)
	tell application "Final Cut Pro"
		«event KeyGcfcP» given «class fcpP»:POSIX file aFile, «class fcCF»:saveFlags
	end tell
end FCPSaveandClose

Mac Tip du jour: how to monitor uncommunicative apps

You know how it is: you’re doing some sort of intensive task, like installing something or making an image of something, and the progress bar stops moving. Is it still working, or has it crashed? When do you give up? (And then there’s the apps that have indeterminate progress bars, or just plain don’t give you feedback).

The other day I was installing the Final Cut Studio, and during the Soundtrack install it appeared to hang. I forced quit, tired again and again it seemed to hang (and I do have a pretty long “hang threshold”, I didn’t just give up after a minute or two)

In the olden days, I used CPU Monitor to just check to see if the computer was still working (proves nothing, of course: it could be patiently waiting for something which will never happen, or frantically running an infinite loop, but you get some idea). It occurred to me that in the modern world (in fact, post X.2 I think), I could go one better and monitor the data being written to disk. And lo and behold I could see that, not only was there data being writ, but it was happening in a lumpy I’m-processing-data kind of way.

Used it again today making a NetBoot image. Not because I really feared that it wasn’t working (although today is in fact the first time I’ve suceeded with netboot) but, just like a good progress bar, it gives you *something* to do while you wait …