Thursday
Jul272006

after the move

"All your furniture doesn't fit in your new apartment!" the owner said with some dismay, seeing my IKEA POANG chair and LACK coffee table on the back patio. "No," I agreed. "Why is that?" "My last apartment was bigger than this one. It's okay though. I like it here." And I do. The owner runs a shop, and she offered to sell the coffee table for me; the POANG's cushion had been pretty well destroyed by the cats, so I think I'll just use it for outdoor furniture.
The new apartment is maybe half the size of my previous apartment, but I really think I can be happy here. Happier, even -- this might be more of the right place for me than where I was, at Money Village. I took a lot of pleasure from all the manicured landscaping at Money Village, and appreciated the latino men who were always replacing something just past its prime with something about to flower. The sprinkler system -- irrigation, really -- for the gardens bothered me a bit... Not exactly a waste of water, but a gratuitous use of it. The Columbia River died so I could look out on a rich green meadow? (I know my water really comes from the Hetch Hetchy reservoir, but it amounts to the same thing. The Hetch Hetchy valley died so I could look out on a rich green meadow.)
Where I live now is a quiet street in Pacifica, two blocks from the ocean, with rows of single-story houses. Each house has its own garden or lawn or trees, and it's all alive. There are palm trees, and succulents, and flowering vines, and weathered fences, and gravel driveways... and it's beautiful. I don't think these people have landscapers. I think they take care of their yards themselves, and plant a bush or a tree because they plan to enjoy that tree for ten or twenty years. The air is always damp with fog coming off the ocean. My apartment is half the size of my old apartment, but the owner is building a mosaic walkway to the back patio for me, and I think we might become friends. On the wall above my desk is a large-format photo she took of a desert scene; the wall is light mauve; the floor is bamboo. Everything here is here because the owners -- two people-- decided to put it here.
Money Village was a great place to live for a year, and it was a level of luxury that I needed after the scary South Side of Providence. Now I'm happy to be here, cozy and foggy and rich with the opposite of transience.

Saturday
Jul222006

irony

"The irony is..." that George W. Bush does not know what irony is. Correct me if I'm wrong here, but I'm pretty sure that's ironic. It is also ironic, a different sort of irony closer to cynicism, perhaps tragic irony, that the leader of the most powerful nation in the world, he who holds the reigns to a military, economic, and symbolic power that could actually decrease the violence in the Middle East, is the stupidest, least-diplomatic man to hold that office since the creation of Israel as a modern nation-state.
...all of which is a simplistic analysis that, I'll grant, fails to account for many of the dozens of factors contributing to the tempest of the Middle East... But still! In my simple analysis I still feel secure in claiming this: If the US, in the person of Rice or Bush or Bolton or any of the hawks who communicate US policy to the world, would simply ask Israel to stop bombing Lebanon, then Israel would stop fucking bombing Lebanon.
This precipitating issue, the two kidnapped Israeli soldiers, brings to mind the assasination of Archduke Ferdinand... except that in this case perhaps a dozen US black-ops boots-on-the-ground and a single military helicopter venturing into Lebanon under cover of night could bring the soldiers back to Israel... But then we'd lose the pretense under which the US would, could, will invade and occupy the entire region.
Might, perhaps, the "two kidnapped Israeli soldiers" turn out to be a sham along the lines of babies pulled out of incubators in Kuwait, centrifuge rods and yellow-cake uranium in Africa, secret stashes of WMD to the "north south east and west of Baghdad," and George W. Bush's service in the National Guard? The hawks in this administration have repeatedly fabricated evidence, or expertly deployed fear/uncertainty/doubt, in order to justify their (our, damn it!) political and military actions.
I would have more respect for the neo-cons if they simply declared, to Iran, Iraq, Lebanon, Syria, Kuwait, and (heck) Saudi Arabia: "We'd like to control the middle east. Please return the keys to your country to the UN, for distribution to the western judeo-christian capitalist democracy of our choice."
Maybe fewer people would die that way.

Thursday
Jun292006

Just switched hosts, some things broken

I switched hosting providers in the middle of the night last night (did you notice sbshine.net down for a few days? No? Good.) and now a few things are broken, most notably, archives, and a weird css error at the top of the page.
I couldn't decided between TextDrive, DreamHost, and MediaTemple, so I ended up going with TextDrive because I liked their site design best.
Anyways, I promise I will get things back up soon. I know some of you are dying to find my archived post on the rich text editor :)

Sunday
Jun112006

making ant easier to deal with using scripts

A major complaint with ant is that it's a purely declarative language, and some build tasks really want to be expressed procedurally. Scott Evans summed this up by saying ant is a hateful language. But when I was tasked with improving the build system, I wanted to work through the hate.
Inspired by dojo, I handled some tricky parts in the OpenLaszlo ant build files by inserting small java-via-javascript script tasks. Our "old" (ant 1.5.1) files had to deal with some bend-over-backwards structures to fake procedural logic, or used <if> tasks from antcontrib. I was dissatisfied with antcontrib because it seemed abandoned, and the bend-over-backwards was hard to read, understand, maintain. The general approach I've taken here is described in the ant manual.

Consider this problem: we want to build a platform-specific installer. The ant 1.5.1/antcontrib build file looked like this:


<if><equals arg1="${build.platform}" arg2="unix"/><then>
<!-- tar up a bunch of stuff -->
....
</then><else><if><equals arg1="${build.platform}" arg2="macosx"/><then>
<ant target="pkg-dev" />
</then><else><if><equals arg1="${build.platform}" arg2="windows"/><then>
<ant target="nsi-dev" />
</then></if></else></if></else></if>

The main problem with this is that it's hard to read the semantics from all of the pointy brackets. I prefer this alternate formation, where we use javascript to just express an if/then/else procedurally:

<script language="javascript"><![CDATA[
var pkgtask = lps.createTask("ant");
if (lps.getProperty("build.platform") == "unix") {
pkgtask.setTarget("pkg-gzfile");
} else if (lps.getProperty("build.platform") == "macosx") {
pkgtask.setTarget("pkg-dev")
} else if (lps.getProperty("build.platform") == "windows") {
pkgtask.setTarget("nsi-dev");
} else {
var f = lps.createTask("fail");
f.setMessage("Unknown OS. Failing.");
f.execute();
}
pkgtask.execute();
]]> </script>

This formulation is, imho, cool. It's using ant's Java api via javascript via rhino via the Apache Bean Scripting Framework to let us express procedural logic procedurally. We can use the ant java api to get access to ant tasks, properties, and targets, but use javascript logic structures to make decisions.

Yes, it's syntactic sugar, but when I'm maintaining a build file of more than 1300 lines, I'll take some sugar if it makes it easier to read, understand, and maintain.

(BTW, it looks like there's a logic problem in my javascript; you'll still get to the final pkgtask.execute() even if you don't know the platform. But no! The else-unknown-platform case creates and executes a fail task, which pops us out of that scope, and we never get to the pkgtask.execute() line.)

(Meta-problem: examples of cases which would benefit from javascript-ificiation instead of built-in ant task composition are by definition very complicated. A small example isn't as compelling as a big one would be, but for the purposes of pedagogy, I'm using a small example.)

Friday
Jun092006

fat kitty vs mac

If you suffer from an excessively affectionate cat, as I do, here is a helpful tip for mac users. Go to system preferences, Keyboard and Mouse, Trackpad. Check "Ignore accidental trackpad input" and "Ignore trackpad when mouse is present." Then the cat can walk on the trackpad and hit the trackpad button and it's all okay.
A co-worker (P T Withington) pointed me at this helpful video of how to use the mac as an exercise machine for the kitty. This seems like it would be less effective with my 16-lb cats. Maybe when I someday replace my powerbook, I can devote it to a cat exercise device.