Archive for April, 2006

Aperture 1.1

Thursday, April 13th, 2006
Bearded Iris

Aperture v1.1 is now shipping. It is quite nice and snappy on a MacBook Pro with 2GB of RAM. I migrated all of my photos to the new RAW converter and there is a noticeable difference; an improvement in most cases. It is clear that extreme adjustments interact with it differently.

Beyond the speed difference, the biggest change I’m noticing is that the near blinding brightness of the MBP’s screen in comparison to the PowerBook G4 1.25ghz (first generation screen) yields a very different feel to the photos.

Bee on Flower

In these few months of returning to iPhoto ’06, I came to realize two things. First, iPhoto is an awesome application — generally a joy to use and quite capable. Secondly, I can’t live without stack-and-select along with freeform keywords.

That the price dropped is interesting and it was quite nice of Apple to offer rebates for owners of 1.0.

Repairing Permissions

Wednesday, April 12th, 2006

Daring Fireball has a typically brilliant article on the voodoo cult surrounding ‘repair permissions’.

A phrase caught my eye — “Repairing permissions is zapping the PRAM for the twenty-first century” (from Rosyna via Jason Harris).

There was a step in between.

Prebinding.

There was a good 3+ year period where updating prebinding on the system was the cure-all for any kind of random system problem or slow down.

Somewhere in there, I made the “mistake” (it was actually a lot of fun) of releasing a little chunk of Cocoa code that demonstrated how to use the (then cool, no longer so) authorization APIs to run the prebinding update command and log the output into a text view.

From the start, it was documented as having the sole purpose of demonstrating a piece of API. That the actual act of updating prebinding was totally useless.

That didn’t stop anyone from downloading the damned up and running prebinding on a regular basis. I got email from people claiming that using Xoptimize (my stupid prebinding app) every week helped their system, that they had advised their mother to use it every day, and that — I’m not kidding — updating prebinding somehow made Finder window resizing faster.

That damned app had over 150,000 downloads. More than pretty much anything else except pyobjc. I almost wished I had charged money for it. Almost. It was useless and I have a hard time charging people for useless things (I’m trying to get over that).

Instead, I wrote an article that gave a high level overview of prebinding. Actually, a few people at Apple thanked me for doing so during the hiring process, so it wasn’t entirely for naught.

In any case, prebinding was definitely the voodoo fix-all between zapping pram and repairing permissions.

pdfcat — concatenate PDF documents

Tuesday, April 11th, 2006

Today, I was doing my taxes and I ended up with a directory full of JPG images that were scans of documents and a handful of PDFs. I wanted a single document that I could print and/or send to my accountant.

You’d think that an OS that uses PDF — a multipage document format — would make this easy. I assumed it would. My first thought was to open all the JPG images in Preview and save as PDF (single page documents with encapsulated bitmaps).

OK. Great. Got a bunch of PDF documents. Nothing struck me as capable of saving a multipage PDF from said documents. Nor did a search of MacUpdate or Google reveal solutions beyond some random Java app, a TeX based hack that involved installing a huge pile of stuff and re-learning LaTeX, and a handful of apps that might have been able to solve the problem. Maybe.

In the end, I decided it would be easier just to write some code to do the concatenation. It was easy. I grabbed the pdf2png hack from a while back and modified it to scan a bunch of PDF documents, looking for maximum dimensions, and then images all pages of all documents into a new document with that maximum dimension.

The end result is pdfcat.

To use:

[albbum:/tmp/pinball] bbum% pdfcat part* whole.pdf
Processing 3 input files
Output whole.pdf
Size: 612 x 792
Processing part1.pdf
Processing part2.pdf
Processing part3.pdf
Wrote 170 pages

The script is a totally stupid, one-off, hack. It served my current purpose, which may be entirely coincidental. If you find it useful, great! If you improve it, please let me know!

(Yes, I found it odd that I couldn’t make it through filing taxes without writing some code. Not that odd, though.)

Update: Heh. Yeah. I could have used Automator. Of course, it took me a while to figure out that I had to use a “New Folder” action to actually cause the resulting PDF to be saved somewhere. And it doesn’t seem to go in any kind of a sort order (oh, wait, there is a “sort finder items” action). Actually, Automator would have been the quick-and-dirty way to go. Wait, my script is quick and dirty too. Sigh. If all you have is a text editor, all the world’s problems can be addressed with code…

End result; I like my command line solution better, but I’ll send my mom an Automator workflow if she ever needs to solve a similar problem (and she likely will, knowing her).

Universal Python Build

Monday, April 10th, 2006

Bob Ippolito and Ronald Oussoren have been working on a branch of Python 2.4 with the intention of creating a universal build of Python.

They have done that and more. A lot more. In the process, many other aspects of Python on Mac OS X have been fixed or optimized. Furthermore, the Python build now uses SDKs as a part of the build. This lays the framework for being able to do development on one version of the OS while targeting older versions with Python. Very nice.

This is one of the areas of the world of universal binaries that few people really understand.

Building a correct universal binary of most open source projects is exceedingly hard.

Simply passing CFLAGS=-arch i386 -arch ppc will generally not yield a correct binary. Worse, if the project uses autoconf, you can rest assured that the result of ./configure ; sudo make install will only yield a correct result for the architecture the build is created on. While autoconf can support cross-compilation, very few developers using autoconf will jump through the hoops necessary to do so.

And that is really what this boils down to. Cross compilation is hard to get right. Xcode makes building universal binaries easy because the entire high level Mac OS X development model and all of the predecessor technology has been focused on cross-compilation for well over a decade.

If you are planning on developing or maintaining a body of source targeted to Mac OS X that cannot use the Xcode native build system — and there are certainly many reasons to do so — I would highly recommend that you go have a close look at Ronald’s and Bob’s work.

Live partition resizing & Boot camp

Monday, April 10th, 2006

Many Mac owners, myself included, partition their machine such that the OS is isolated from User data. Or so they can install two copies of the OS. Or for any of a number of other reasons.

Of course, as the system and user’s relationship to the system evolves, it often proves to be the case that the originally chosen partitioning scheme is, well, wrong. Too much space for OS, not enough for Data.

Or, in the case of Boot Camp, a new technology is released that requires an additional partition on the system’s drive.

With the 10.4.6 update, the diskutil command has gained the ability to resize partitions, including creating new partitions.

This is via the resizeVolume subcommand:

[albbum:~] bbum% diskutil resizeVolume
Disk Utility Tool
Usage:  diskutil resizeVolume [Mount Point|Disk Identifier|Device Node] size
        <part1format part1Name part1Size> <part2format part2Name part2Size> ...
Non-destructively resize a disk. You may increase or decrease its size.
When decreasing size, you may optionally supply a list of new partitions to create.
Ownership of the affected disk is required.
Valid partition sizes are in the format of <number><size>.
Valid sizes are B(ytes), K(ilobytes), M(egabytes), G(igabytes), T(erabytes)
Example: 10G (10 gigabytes), 4.23T (4.23 terabytes), 5M (5 megabytes)
resizeVolume is only supported on GPT media with a Journaled HFS+ filesystem.
A size of "limits" will print the range of valid values for the current filesystem.
Example: diskutil resizeVolume disk1s3  10G
         JHFS+ HDX1 5G MS-DOS HDX2 5G
Valid filesystems: "Case-sensitive HFS+" "Journaled HFS+"
	"Case-sensitive Journaled HFS+" "HFS+"
	"HFS" "MS-DOS FAT32" "MS-DOS FAT16" "MS-DOS"
	"MS-DOS FAT12" "UFS" "Linux" "Swap" 
</size></number></part2format></part1format>

Boot camp requires an MS-DOS Partition for installation. There can only be one MS-DOS partition in the first three partitions on the disk and it must be the last of the first three partitions (you can have any number of additional partitions beyond 3 of any type).

The example in the above command is telling; it would resize disk1s3 to 10 gigabytes while creating a new journaled HFS+ partition of 5 gigs and an MS-DOS partition of 5 gigs. Assuming that there is no disk1s0 or disk1s1 (which happens), the end result would be an MS-DOS partition as the last of three partitions, ready for the installation of Windows.

Buggy Weekend; spring is here!

Monday, April 10th, 2006
Honeybee on Flower

I took a walk with the camera on Saturday. Even with all the rain, spring is definitely here in Northern California. Lots of flowers are in bloom and the California Poppies are particularly striking in our neighborhood.

I caught this bee working one of the 8 foot tall flower spikes on a bush in the community garden. Looks like it is hanging on for all it is worth! She eventually remembered how to fly, though.

I am seriously pining for an Intel build of Aperture. iPhoto is a great tool, but it just can’t deal with the dozens-of-frames-of-the-same-thing picture taking mode possible with digital + Aperture’s stack-and-select.

Spider

With spring comes lots of bugs. This makes Roger very happy. This is a spider he found in the yard. I believe that is an egg case on its backside. Any idea what kind of spider it is?

Salmon stuffed with asparagus and crab

Saturday, April 8th, 2006
Crab & Asparagus stuffed in Wild Pacific Salmon
Crab & Asparagus stuffed in Wild Pacific Salmon

Next up on the BGE?

Fresh wild pacific salmon stuffed with crab, butter, a touch of lemon, dill, and a bit of lightly cooked asparagus. It’ll sit on the BGE for at least 2 hours or until it gets to 120 degrees internal temp, whichever comes first.

Forgot the dill, damnit. Maybe I’ll make a dill sauce. Actually, Knotmaster Ben (he tied the truss) made a Mustard/Dill sauce that was most very yummy.

Cooked Salmon

Update: Absolutely brilliant. Used hickory chips to provide smoke. The crab/salmon bits that were exposed to smoke were divine. The asparagus actually cooked into the salmon such that each spear was coated in the most wonderful, buttery, salmon meat.

The next step is to figure out how to do something similar, but with the salmon completely open face. This should vastly increase the smoke exposure, but has a risk of either drying out the salmon or overcooking the veggies and/or crab on top. I’m thinking that a tub of liquid next to the salmon would solve that problem.

2006 Garden

Thursday, April 6th, 2006
Seedlings 1

Roger, Christine and I have been hard at work planting our 2006 garden. We have the community garden plot all prepped and weeded, with carrots, strawberries, gladiolas, and wildflowers already in the ground.

In the garage, I built an indoor mini-greenhouse out of a 3 foot high by 4 foot or so long shelving unit, a couple of florescent lights, a heating pad and some painter’s drop plastics to keep the humidity and head in.

In that, Roger and I have planted cherry tomatoes, heirloom tomatoes, butternut squash, gourds (the birdhouse kind), lemon cucumbers, japanese long beans, “red beans” (climbing beans with beautiful flowers), watermelon seeds (that Roger collected from a yummy farmer’s market watermelon he had last year), Sunzilla (16 foot tall sunflowers), eggplant seeds (more farmer’s market seeds), and a mini-herb garden of parsley, dill and basil.

Seedlings 3

The bottom shelf, on top of the heating pad, is the collection of peppers seeds. From left to right:

Desert TepÍn
Some count this as the oldest chile species of the four or so species commonly in cultivation (the other species have many sub-species). In any case, it is a very hot and unique flavored chile pepper. Vicious bite, but doesn’t last. Hard as hell to grow — takes a long time to germinate with a low germination rate. I’ll be lucky if any of the seeds germinate.
Red Savina Habanero
This is often counted as the hottest pepper in the world by scoville units (though England has a new pepper that may be hotter). However, the Tepin is counted as hotter by some. In any case, this is a classic habanero. I would rather be growing a Scotch Bonnett, but this’ll do this year.
Serrano
The basic Serrano pepper. A staple in a all kinds of cooking when you simply need some distinct chile heat without being either overwhelming in flavor or hot. I greatly prefer Serrano to Jalapeno.
“Red Devil Pepper”
I have no idea what kind of pepper this really is. The ripe fruit is about 2.5″ long and 3/4″ of an inch in diameter. It is extremely hot with a very distinct flavor. Larger (and hotter) than a Thai Hot. It was left behind in the garden plot that we took over near the end of last year.
Black Pasillo or Ancho Chile
This is an Ancho chile pepper whose seeds my parents collected while we were in Mexico (Baja trip). This particular variety was claimed to be one of the most expensive chiles in Mexico. In any case, it will dry well and make for a wonderful base to home made chile powder.

Antibalas Afrobeat Orchestra

Wednesday, April 5th, 2006

I recently picked up Antibalas Afrobeat Orchestra’s album entitled Liberation Afro Beat, Vol. 1.

Wow. The mothership has landed! This is an album full of tight, funky, jams with “world beat” overtones. (Really, “world beat” just means “rhythms and melodies not familiar to the typical western listener’s ear”).

The entire album is one long funky jam. I’m a long time fan of Parliament, Funkadelic, Deep Banana Blackout, and other Funk Masters.

This album is quickly diving into the heavy rotation list. I am definitely going to have to go and figure out which of Fela Kuti’s albums to pick up.

The only mediocre moment is the last song; more protest with the music taking back stage, but even it has its moment of supreme down stroke.

Update: I picked up Fela Kuti’s Two Sides of Fela: Jazz and Dance. More excellent stuff. Awesome Jazz riffs w/a quite a touch of the funk.

Big Green Egg; Huh?

Monday, April 3rd, 2006
Big Green Egg & Pizza Peel

I have had a few people respond to the passing mentions of the Big Green Egg with “What the hell is that? How big? huh?”. So, a Review, if you will. (The pizza peel in the photo was made by Andrew Stone as a wedding gift. Beautiful woodwork!)

I first ran into a Big Green Egg in Atlanta when I was working for Netsurfer (back when writing GIF89a decoders was a money earner). Impressive device. The BGE is a large ceramic egg. Inside, there is a firebox in the bottom, a vent on the front, and a ceramic coated grilling grid. The rather heavy lid has a large, chimney-like, hole at the top and included is a cast iron cap with an adjustable vent.

Recently, my wife bought (Christine Rocks!) me a large BGE out of the blue. The BGE comes in a number of different sizes; ranging from mini to large. I received the large along with the Egg Table on Wheels. The damned thing is heavy;

Big Green Egg

The BGE isn’t made of just plain old ceramic. It is constructed of a high-tech ceramic that maintains an incredible stable and even heat within the cooking chamber. Furthermore, the ceramic is maintains thermal stability to the point that blasting a BGE with water when it is at full heat will cause no damage.

Between the adjustable vents at top and front, the BGE can be set to maintain a temperature from less than 150 degrees to over 600 degrees fahrenheit. By adjusting the events at top and bottom accordingly, it is possible control both the temperature and the amount of smoke retained within the cooking chamber. In other words, the device can be used for anything from nearly cold smoking to quick searing of meats to baking of bread.

Read the rest of this entry »