Processing Syntax Coloring in TextWrangler
Processing is based on Java. TextWrangler supports syntax highlighting for Java code, but it doesn’t automatically recognize that Processing uses Java syntax. So, head over to the Languages pane of TextWrangler’s preferences and click Add next to the Suffix Mappings list. Enter .pde as the Extension and select Java as the language that should be associated with .pde files.

Now if you open a Processing source code file in TextWrangler, it will be displayed with basic syntax highlighting.
Posted on Thursday, March 18th, 2010. Tags: code, java, mac, processing, textwrangler.
Reading on the Big Screen
Big displays are worthwhile because they improve the ratio of visible content to “computer stuff”.
Here is a story from Issue 114 of Hub Magazine viewed in Tofu, a little app that displays text in a side-scrolling columnar format suitable for comfortable reading. The story is The Unpopular Opinion of Reverend Tobias Thackery, by Adam Christopher. Yes, we are all dog-men.

Two pages of a document can be displayed side-by-side at life size (in other words, the image of the typical page is eleven inches tall, just as it would be if printed). This is especially useful when reading documents whose layout would require scrolling back and forth to follow the flow of text on a smaller screen.

What am I reading? The paper which introduced the collective animal behavior model presented by Iain Couzin at a recent EvoS seminar:
Couzin, I. D., Krause, J., James, R., Ruxton, G. D., & Franks, N. R. (2002). Collective Memory and Spatial Sorting in Animal Groups. Journal of Theoretical Biology, 218(1), 1-11. (PDF)
I’d like to write my own implementation of the model (or some representative subset) in Processing. I spawn a lot of eventually-neglected side projects, of course, but right now this subject has my attention.
Posted on Sunday, March 14th, 2010. Tags: mac.
Add Curved Drop Shadow plugin for Acorn
This is a variation on the Curved Drop Shadow without Border plugin for Acorn I posted a few days ago (which is itself a derivative of the original Create New Image with Curved Drop Shadow plugin). It adds the drop shadow to the current image instead of spawning a new document. The drop shadow is added to the active layer.
Download AddCurvedDropShadow.py (2.3 KB) and install it in ~/Application Support/Acorn/Plug-Ins.
Posted on Sunday, March 14th, 2010. Tags: acorn, mac, python.
No Book is an Island
Today I started reading The Windup Girl by Paolo Bacigalupi. So far, it’s as excellent as the testimonials claim. Having recently read Sundiver by David Brin, I noticed what seems to be a subtle nod to that story in one of the opening scenes of Windup Girl.
From the first chapter:
Cycles and rickshaws and megodont wagons flow past them, parting like a river around boulders. The cauliflower growths of fa’ gan fringe scar the beggars’ noses and mouths.
From the first chapter of Sundiver:
Bright points of static filled the space above the blankets and in front of the screen, and then Fagin stood, en-replica, a few inches away.
The E.T. did look somewhat like a giant sprout of broccoli.
An ailment called fa’ gan that looks like cauliflower and an alien named Fagin that looks like broccoli, both introduced in the first chapter of each author’s debut novel? It could be a coincidence – perhaps “fa’ gan” has a meaningful real-world etymology – but I like to think it’s an “easter egg” for the well-read geek. Now I’m going to be on the lookout for other genre references!
Upon further reflection, it occurs to me that there is an additional commonality which might suggest a more specific reason for this reference: both books deal with evolutionary themes.
As part of the Uplift series, Sundiver examines a universe in which humanity’s haphazard evolution is an exception to the norm of guided intervention. Windup Girl is set in a world populated by “genehacked” animals and bioengineered plagues like fa’ gan. One question, among others, is whether these beings are the result of guided or misguided human intervention.
According to his most recent blog post, David Brin is a contributing author to a forthcoming book, Pathological Altruism, which is edited by a group that includes my boss. So now if we can just get a character from Windup Girl to give an EvoS seminar, the circle will be complete.
Posted on Saturday, March 13th, 2010. Tags: evolution, reviews.
Search with Google Scholar Service
Download this service (53 KB; might require Snow Leopard), unzip it, and install it in ~/Library/Services. Then select some text, right-click the selection, and choose “Search with Google Scholar” to find related articles. If the text you selected is the title of a paper, chances are the first result will include exactly what you want: a PDF copy of the paper, or at least an abstract.

This service is shamelessly derived from the “Show Address in Google Maps” service that ships with Mac OS X 10.6.
Posted on Friday, March 12th, 2010. Tags: mac, service.
Pannier Shoulder Bag
With a pair of cheap carabiners and a strap scavenged from an old duffel bag, you can comfortably carry a bike pannier over your shoulder. Pass the pannier’s handle strap through the carabiners to prevent the bag from dropping if the carabiners are jostled off the rack hooks. (I find this isn’t much of an issue, but parkour commuters may want something more secure.)

When it’s time to mount the bag on your bike rack, slip the carabiners off the hooks and loop the shoulder strap under the cover flap to keep it clear of your wheel. This setup is specific to the panniers I’ve got, of course, but I’m sure you can work out something similar with any model.

Do the hooks or rigid irregularities on the back of the pannier make it uncomfortable to carry? No; unlike a backpack, a shoulder bag hangs pretty loose, so nothing digs into your back or side. Of course, this is just intended as a convenience, so if you’re concerned with ergonomics you should look for a pack expressly designed for the purpose.
Posted on Thursday, March 11th, 2010. Tags: bike.
New Old Bike
Got a bargain on a vintage 3-speed Schwinn today. It’s a 1968 “Racer”, made in Chicago.
Needs new tubes and brake pads, but otherwise it seems pretty solid. It’s the perfect practical configuration for doing errands around town: fenders and chainguard to stay clean, a rack to carry things (although it may need a little tweaking to fit my favorite panniers), and an internally geared hub. The cushy seat and relaxed posture are nice, too.
The internally geared hub is an intriguing novelty to me. It works, but behaves very differently from the derailleurs I’m accustomed to.
Posted on Tuesday, March 9th, 2010. Tags: bike.
Haiku Reviews 3
A Programmatic Approach to Perfect Happiness by Tim Pratt (via Escape Pod 239)
Yes, the androids dream –
of equal rights, kinky sex,
and we human sheep.
Here we meet Kirby, robotic consort to the insatiable April, as he observes the symptoms of his adolescent step-daughter’s infection with an attitude-altering “happiness virus”. It is at first a matter of some concern to the couple, but thankfully it amounts to little more than a welcome respite from Wynter’s typical prickly temper. After a tense encounter with April’s ex, however, we realize that Kirby may be more than a mere observer. He’s wired for pleasure, yes – but who’s programming who? (Full text at Futurismic.)
Learning to Fly by Garth Upshaw (via Pseudopod 183)
Rodents, wings, and angst
with practice casts rats in flight
and traps lass in night.
I think anyone who has ever enjoyed poking around the library stacks has imagined discovering a dusty old tome full of forgotten knowledge. The teenage protagonist of Learning to Fly has found such a book, and has made a habit of sneaking out after curfew to practice its spells. She finally gets it down, but she gets more than she bargained for. Lord Rat is a crafty old bastard.
The Mermaid’s Tea Party by Samantha Henderson (via Podcastle 93)
Maid and sailor, prey,
serve sirens tea and escape
from their slaver way.
Shipwrecked by mermaids, a plantation owner’s young daughter is marooned by the “fishy bitches” on an island with another captive, the self-styled pirate Handsome Jack. The sailor was spared for his ability to tell fearsome tales, and Cassandra has bought some time by promising to serve tea to the mermaids if they recover any from the flotsam. (Mermaids get a kick out of lampooning high society.)
The story is not really about how the two defeat their captors, but about how the grim link of the slave trade connects Cassandra’s childhood naiveté with Handsome Jack’s circumspect remorse. Jack dies before the pair is found. His body is perfunctorily discarded by the rescuers as that of a lecherous knave, but we are left with the impression that his acquaintance has inspired Cassandra, the Pirate Queen, to chart a righteous new course through life.
Sir Hereward And Mr. Fitz Go To War Again by Garth Nix (via PodCastle 92)
Sworn to cull stray gods,
a knight and his wooden aide
slay shades and bear loss.
The titular characters (a man and a sorcerous self-motivated puppet) are mercenaries. As the story begins, they are en route to a city where they hope to find relaxing employment; it seems their gigs often develop into events of calamitous proportions. They have just barely arrived in Shûme when a minor gaffe leads to a duel between Hereward and Jessaye, a lieutenant of the city’s Temple Guard. They are well-matched, and the fight foreshadows romance.
Mr. Fitz soon learns something ominous about Shûme’s god, and we learn that the pair has a higher allegiance than to any local potentate. They execute their order’s mandate, but at cost to the prospect of Hereward’s love – and any hope of rest. What are the casualties of duty?
A great narration by Paul Tevis made this one a real treat to listen to. (Full text at Jim Baen’s Universe.)
The Clapping Hands of God by Michael Flynn (via StarShipSofa Aural Delights 122)
Affection, postponed,
becomes preventable grief;
act, or sacrifice.
A survey expedition passes through a gateway to a new world and sets up camp to stealthily observe the inhabitants. As might be expected, given the characters’ mission, the worldbuilding is enjoyably thorough. It is culture – both that of the natives and that of the humans – that is the central subject here. The expedition’s leader is challenged to maintain objectivity as his crew habitually anthropomorphizes the alien society. As a crisis facing the locals approaches its climax, Hasan succumbs to the anthropomorphic view: he hesitates to enforce evacuation, and even permits assistance to an alien who has struggled industriously to locate the crew. As a result, a woman he admires dies.
As Tony might say, a truly crackin’ narration by Mike Boris.
Down on the Farm by Charlie Stross (via Tor.com Story Podcast 11)
Men of the Laundry
hack math to weave their magic,
wrung out on the Farm.The Matron, machine,
guards the stark minds held inside –
jail, weapon, or womb?
You can have your Harry Potter; I’ll tend to my English wizard needs at the Laundry, “that branch of the British secret state tasked with defending the realm from the scum of the multiverse, using the tools of applied computational demonology”. The protagonist is sent to investigate anomalies at the service’s “funny farm”, which is nominally a secure hospice for those damaged in the line of work. There is, perhaps, a bit more to it than that. (Full text at Tor.com.)
Posted on Sunday, March 7th, 2010. Tags: escapepod, haiku, pseudopod, reviews, starshipsofa, torstory.
Curved Drop Shadow without Border (A Modified Plug-in for Acorn)
This is a very slightly modified version of the “New Image with Curved Drop Shadow” plug-in that ships with Acorn. The original plug-in adds a narrow white border with a gray frame to the image in addition to the curved drop shadow. I removed the code that adds the border, so all this version does is add the subtle shadow (illustrated in the screenshot below).

Download New Image with Curved Drop Shadow without Border.jstalk (1.5 KB; unzip and install in ~/Library/Application Support/Acorn/Plug-Ins; restart Acorn). I’m not sure what license terms apply to this plug-in, but the JSTalk plug-in and the original Python filter were written by Gus, inspired by the screenshots in an article by Sebastiaan.
Posted on Saturday, March 6th, 2010. Tags: acorn, jstalk, mac.
Keep Working with Full Screen Movies on a Second Monitor
Do you have a big external monitor for your Mac laptop? If so, you might want to watch a DVD or a video file on it while you continue to work on your main monitor. With the click of a checkbox, you can keep the video playing full screen while you use other applications.
In the DVD Player application preferences, check “Remain in full screen when DVD Player is inactive”:

In the QuickTime Player 7 application preferences, click “Remain in full screen when player is inactive”:

It’s a little tricker to set up the same configuration in iTunes, but you can play many iTunes videos (including television shows and movies purchased from the iTunes store – but not rentals) in QuickTime Player. Right-click a movie in iTunes and select “Show in Finder” to locate the file.
Posted on Saturday, March 6th, 2010. Tags: itunes, mac, quicktime.
