Who you calling “drought tolerant”?

My wife picked up the April issue of Better Homes & Gardens at the library today. Inside, the Garden Doctor swiftly diagnoses the problem with a reader’s lavender plant, which is languishing despite the careful attentions of the reader, who “water[s] daily”.

The problem, says the doc, is over-watering. Definitely. Lavender is a Mediterranean plant; it doesn’t rain during the summer in the Mediterranean. Easy.

But I’m not so sure about the good doctor’s prescription (my emphasis):

It’s very drought-tolerant and shouldn’t need watering more than once or twice per week.

Oh, my.

Front-yard wildflower culture

Last fall I scattered annual wildflower seeds here and there, in my first attempt to raise California natives from seed. It’s gone much better than I expected.

The planter box in front of my bedroom window, which used to be dominated by a massive, ungainly old star-jasmine vine, is now dominated by a massive, ungainly new stand of Clarkia unguiculata, a California endemic:

Clarkia unguiculata in bloom, massed in an outdoor planter box

The common name is “elegant” Clarkia, which seems a little odd. Maybe someone had the individual flowers in mind, not the whole plant.

It does seem a bit more true to its name in a vase:

Cut stems of Clarkia unguiculata and Salvia greggii, in bloom, in a cylindrical ceramic vase in a window-sill

(The yellow blooms were cut from an autumn sage in the back: Salvia greggii, which is native to Texas, not California, but oh well.)

At any rate, those Clarkia seeds, elegant or not, came from Theodore Payne’s “Shady Mix”. Four bucks plus nominal shipping for the packet. I cleared the soil, mixed the seeds with a little sterile sand in an old dog-food bowl, and scattered. Then I let my 3-year-old “walk them in” to the soil, which was great fun for him.

Reflections on “Shady Mix”

The next time I plant “Shady Mix” it won’t be in such a confined spot. There were four other species in the packet (including the baby blue-eyes in this blog’s title photo), and in that planter box they’ve all been completely overwhelmed by the elegant Clarkia.

I did scatter a few of the seeds on more open ground; there, the purple Chinese houses (Collinsia heterophylla) are looking great:

Several Collinsia heterophylla specimens in bloom, shot close from ground-level

One or two baby blue-eyes (Nemophila menziesii) are still in bloom there as well. See if you can find them:

Collinsia heterophylla and Nemophila menziesii in bloom, shot from above

The seed packet also featured five-spot (Nemophila maculata), which I saw once or twice for about a week, and Clarkia amoena, which some call farewell-to-spring, and others call herald-of-summer (guess it depends on your point of view). Either way, it hasn’t bloomed yet. I’ll post photos when it does, if it looks any good.

Heart of a champion

Last shot of the post: the lone sky lupine (Lupinus nanus) that’s survived since I planted a packet’s worth in the fall. This tough little specimen, which stands about 2 inches high, has been trampled by a puppy and small children for months, and isn’t exactly sited in a friendly spot. At least three other seeds germinated there but didn’t make it to bloom time. This one’s clearly got the heart of a champion:

Close-up shot, from ground level, of a single specimen of Lupinus nanus.

Technical note: I’m figuring out WordPress as I go, and in this post you can finally click on any image above for a more detailed view.

Wildwood in early spring

Last week I spent an afternoon with the in-laws at Wildwood Park in Thousand Oaks. What a gem: 1800+ acres of fairly pristine California beauty plunked down in the middle of suburbia. On one short hike you can walk through coastal sage scrub, oak woodland, and riparian woodland.

Encelia was in full bloom all over the park and the Salvias were just getting started as well. But the dominant plants in the drier parts of the park were lemonade berry and sugar bush (Rhus integrifolia and R. ovata). These guys are really similar to each other and they hybridize freely, so I couldn’t always tell which one a particular shrub was.

But this bad boy was definitely one or the other:


The Artemisia in the foreground at left is probably 4-5 feet tall, and the ground slopes down from the path to the base of the trunk, so that “shrub” is easily 20 feet tall. I actually thought it was an oak tree at first.

Here’s a close up of the gnarled old trunk:

Close up photo of trunk of previously-pictured Rhus shrub
I’ve been hankering after a Rhus for a while now but this just seals it.

I also have a brand new plant-crush on Dudleya after a day at Wildwood. Here’s chalk Dudleya (D. pulverulenta) growing out of the side of a cliff, and just starting to put up flower stalks:

Photo of Dudleya pulverulenta with two small inflorescences, and Eriogonum crocatum in full flower
Its cliff-side neighbor, at the bottom of the shot, is the rare Conejo buckwheat (Eriogonum crocatum), showing its chartreuse blossoms. Must be a pretty fussy plant; I only saw it on the cliffs surrounding a waterfall, where it gets a continuous misting from the falls and of course has impossibly-good drainage. At any rate I imagine that cliff just glows in the moonlight.

Those were just a couple of the highlights; if you can make it to Wildwood, go. The park is only a few minutes off the 101 freeway; there’s no entrance or parking fee, dogs on leash are permitted, and the trails are easy. Just watch out for poison oak when you get close to water.

I can’t end this post without showing one more shot. This is the kind of composition that all landscape designers should aspire to (click the image for full-size view):

A natural trail border of at least six species of California native shrub, including Artemisa, Encelia, Rhus, and Opuntia species
That’s how Nature plants a border.

Spicebush, dead or alive?

At Christmas my wife gave me a spicebush plant in a one-gallon nursery container (botanists call it Calycanthus occidentalis). Somehow I had missed a living plant under the Christmas tree — it had only been wrapped enough to obscure the black plastic pot — so it was a real surprise and delight when I unwrapped it.

Spicebush, the books tell us, is a deciduous woodland/riparian shrub to eight feet tall, native to central California, fast-growing, and spreading by rhizomes. Its scented foliage is redolent of aged wine barrels.

In other words, a good screen plant for a spot next to an irrigated vegetable garden. And pretty darn local; we’re just barely south enough here to be considered “southern” California, so a central-California plant is fairly appropriate.

It also doesn’t hurt that our dog tends to do her dirty work in the spot I had in mind; I was hoping that the shrub’s aroma would somewhat obscure the unsavory evidence.

But there’s one key word in the description that I hadn’t attended to as closely as I might have: deciduous.

When the plant came out from under the Christmas tree, it was looking pretty wan. Most of the leaves were pale yellow and half-decayed. And there weren’t many leaves to begin with. Apparently the gentleman at the nursery had been confident that the plant was perfectly healthy, though.

So I put it in the ground a few days later, and after a couple of rains and an encounter or two with the dog, it had gone from wan to barren:

A small spicebush plant without any leaves, surrounded by 8-to-12-inch rocks

No problem, I thought: It’s deciduous, right? Loses its leaves in the winter and all that. It’s doing what it’s supposed to do. The thing about ‘deciduous’ is that you just don’t see much of it around here, in this evergreen land of live oak groves and citrus ranches.

Then winter started winding down. The handful of deciduous trees in the neighborhood started growing leaves again, and blossoming. The weather grew warmer. Birdsong was a normal part of the day again. And still, the spicebush looked like this:

A small spicebush plant without any leaves, surrounded by 8-to-12-inch rocks

So I started wondering if the plant just hadn’t made it. Maybe one too many run-ins with the dog. Maybe the, um, richness that the dog’s work had imparted to the surrounding soil had been too much for it. I’m always hearing that California natives don’t like fertilizer…

Since spicebush is a shrub, it has woody stems. And, at least for me, it’s pretty hard to tell the difference between dead woody stems and live ones. So I had no way of knowing whether this thing was alive. I finally decided that, if it hadn’t shown obvious new growth by the end of April, I would leave it for dead.

And then today I was doing my usual rounds in the backyard, and noticed these:

Close-up of three spicebush stems with tiny new growth at the tip of each. On two of the stms, the new growth is circled.

What a relief. And how exciting to think that in a few months there’s going to be a sizeable Calycanthus occidentalis in that spot.

… “and native plants”, part 2

The first post in this series left off with my wife and I deciding to scrap our conventional lawns and do something a bit more exciting with our yards.

It was an easy decision. Lawn care, besides being frightfully dull, was taking up most of my Saturdays, and it wasn’t turning over very attractive results. Plus, the back lawn made our feet and ankles itch.

But “no lawn” isn’t really a goal to aim at. What would replace it? Dirt? Rows and rows of vegetables? Weeds?

The first inspiration came from a somewhat-unlikely source: Sunset’s Before & After Garden Makeovers.

Most of the garden makeovers in the book are high-cost, professional jobs — the sort you hire a firm for. Somebody with a degree in architecture surveys the site and draws plans, then trucks in a ton of rock, several mature trees, and a crew of laborers, and finally hands you a bill for several thousand dollars. Voilà — you’ve done the yard.

Not really my style, but the book still has a lot of good material. The project featured on the cover, for example — one of the best-looking in the book — was done entirely by the homeowner, grubbing around in her front yard for years: a long-term labor of love.

A garden that would stop traffic

But what really caught my eye was the conversion of a coastal-California front yard, from a “Martha’s Vineyard wannabe” — lollipop trees flanking the deck, white picket fence, putting-green lawn — into a flagstone-lined xeriscape that blends right in with the golden, oak-covered hills behind it (visually, anyway).

The contrast between “before” and “after” was startling. A yawner of a yard had morphed into something I would stop my car to stare at, if I were driving by. Have a look sometime if you can. Most garden stores probably carry Before & After Garden Makeovers; this project is on pages 12 and 13.

And that’s how the first idea came — that a garden ought to be a good visual fit for its natural surroundings. This wasn’t quite “native plants only,” but it was a mental step in that direction.

And it was probably the most important mental step: It meant dropping the notion that our plot of ground was an isolated canvas, to be painted in any way we saw fit, with whatever plants happened to catch our interest. Now we had a guiding principle: Our yard should look like it belongs in southern California.

The logical next step, of course, was to aim at a yard that actually does belong in southern California, but I wasn’t quite there yet. More to come.

Maverick PHP: Self-assignment and the post-increment operator

That’s a mouthful of a title and it should telegraph that this post will be excruciatingly dull for anyone who isn’t interested in compiler theory, the parsing of computer languages, or the like.

Let’s get right to the code, shall we? Suppose you have these lines in PHP:

$a = 1;
$a = $a++;
echo $a."\n";

What do you suppose the output will be?

If you answered “2″, you’re probably thinking about the question correctly — but your answer is wrong.

If you answered “1″, you’re right — but unless you know the answer is 1 because you’ve actually tested it, or you’re a core PHP developer, you’ve most likely missed the subtlety of the question, as I did when I first heard it.

The question came up today on the php-general mailing list. Of course everyone, including me, lectured the OP for seven or eight replies about how PHP’s post-increment operator works, which completely missed the point.

The OP was perfectly familiar with that operator, which, in theory, affects its operand after the surrounding expression has been evaluated. So let’s look at that code again and consider what’s so odd about it:


$a = 1;
$a = $a++;

If the ++ operator works as expected, the assignment should first be evaluated. Then, $a should be incremented. But which $a gets incremented? And, come to think of it, what does “which $a” even mean? There’s only one variable named $a in the current scope.

So it would seem that, after the assignment, the one and only $a in the current scope should be incremented. Which would leave $a with a value of 2.

But if you test this out for yourself, you’ll find that $a actually ends up with a value of 1. In other words, PHP acts temporarily as if there were two variables named $a in the current scope. The one on the left side of the assignment persists; the one on the right gets incremented and then vanishes. (At least this is what happens in Ubuntu 9.04′s standard version of PHP. YMMV, but I suspect this isn’t the sort of behavior that changes very often in a language.)

Now try a similar thing in C:

int a = 1;
a = a++;
printf("%d\n", a);

Oops: The output is not 1, but 2! In other words, C does exactly what you would expect when you really think it through, while PHP does not. I found with some quick testing that Perl v5.10.0 and Groovy v1.6.3 both behave the same way PHP does.

Ultimately, does it matter? I mean, who in their right mind would write $a = $a++ anyway? It’s an interesting thought exercise for a certain kind of geek, though.

“… and native plants”, part one

I’m committed to going native. In my yard, that is.

The bug began to bite when I noticed that the most interesting front yard within walking distance of our house didn’t have a blade of grass in it. Not sure how I feel about photographing other people’s yards for this blog, so just imagine a three-terraced Mediterranean garden, each level spilling over with rosemary, Mexican bush sage, lantana, and the like.

I had been squandering my Saturdays on lawn care. Mowing, edging, thatching, raking, sweeping, bagging. Fixing broken sprinklers. Then doing it all over again the next week. We thought about hiring a gardener just to maintain our lawns, so that I could have some time to do anything else in the yard. Maybe plant a vegetable or two, or have a look at the overgrown olive tree in the back yard.

It also happened that everyone in the family was allergic to the back lawn. Nothing like your feet and ankles itching all day after a morning stroll in the garden.

My wife’s from Kansas, which helped move this train of thought along. I suspect the typical Midwesterner is amused by the way Californians baby their lawns. You see, in Kansas, it actually rains. In the summer, even. Which keeps lawns green.

Then, in the winter, the lawns go dormant. This can be quite a shock for a native Californian like me — the first time I visited Kansas it was March, and as we drove around, all I noticed was block after block of brown front yards.

But this hands-off approach to lawn care makes sense. Why fight Nature when you could spend your time and money on something more interesting?

So it didn’t take long for us to decide that, over time, we would replace the conventional lawns we had inherited when we bought the house. Maybe even aim for something like that Mediterranean paradise down the road. But that decision was just the beginning.

Using Zend Framework as glue (without the MVC)

In his excellent Five Things I Wish They’d Told Me talk at CodeWorks ’09, Cal Evans encouraged us in the audience to “blog the little things”.

In that spirit, then, here’s how I used Zend Framework to pull data from Twitter in four lines of PHP.

First, the script (I’ve removed the literal tweet-id from the code):

require 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

$tw = new Zend_Service_Twitter('bdunlap');
echo $tw->status->show()->text;

That’s it! Doesn’t do much, but then I didn’t need much done. I just wanted to see the raw text of one particular tweet (I had noticed that Twitter rendered the tweet differently, on search-result pages, from the way it was rendered on other pages).

Of course, any code with bigger ambitions would need to be a bit more robust, with error-handling, etc.

All the same, it was eye-opening to find that I could query Twitter’s API with a four-line script — two lines of which I didn’t even have to write myself — without needing to know anything about the API.

You can do this too, in a few simple steps. First, the backend prep:

  1. Download Zend Framework and unpack it in your development environment.
  2. Add ZF’s “library” directory to PHP’s include path.

Now we’re ready to start writing code. We’ll let ZF worry about which classes to load, and when:

require 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

The getInstance() method registers ZF’s autoloader with PHP’s spl_autoload. In this simple case we’ll ignore the returned instance, because we’re not interested in doing anything else with ZF’s autoloader (for example, registering our own namespaces).

Now we can instantiate any Zend Framework class and start using it, as in the script above:

$tw = new Zend_Service_Twitter([username here]);

There are about a zillion more classes available. Lots of possibility.

Thank you, Cal Evans
I would never have guessed I could do this, if not for that excellent talk, wherein Cal described ZF as a “hybrid” framework.

In other words, you can either commit to the entire framework and build an MVC app “inside” ZF — or, you can use the library classes piecemeal, to glue things together. Things like my one-off CLI script above, and Twitter’s API.

I had always just assumed, in my ignorance, that ZF was a monolith and that I had to use the whole thing to get any value from it.

So thanks, Cal. And consider me happily started on another one of your assignments: Learn a Framework.

Domain name, URL… same difference, right?

Normally I don’t expect a precise use of terms in pop-tech writing.  But yesterday, WSJ.com’s senior technology editor displayed an unfortunate haziness about the meaning of  “domain name”. A sample:

Social media domain names – such as Twitter.com/yourname – are a whole different ballgame.

Wait a second. I would have called “Twitter.com/yourname” a URL, not a domain name.

Maybe that was just a typo. Let’s read on.

Many sites dole out domain names on a first-come, first-serve basis. The most democratic is LinkedIn, which hands out “vanity URLs,” such as LinkedIn.com/in/JuliaAngwin,

Uh-oh. Was that LinkedIn thingy a domain name or was it a URL? Now it’s been called both.

The ambiguity continues:

Until recently, Facebook didn’t offer domain names. … But Facebook has begun quietly doling out vanity URLs to some ‘fan pages,’

What exactly is Facebook doling out, of late? Domain names or URLs? Or both? Is there a difference?

Answer: Yes, there is a difference. And the difference matters here, because the article is about claiming one’s name on social networking sites, before an impostor or a lesser namesake does.

The natural mental association is domain squatting — where a con artist grabs microsoft.com, for example, before the software giant can. And then tries to sell the name to Redmond for megabucks.

Domain squatting was big money in the ’90s, before it became illegal (in the US, at least). But in the social networking world, name squatting is as legit as Twitter or Facebook or LinkedIn wants it to be.

The WSJ article makes this point, but doesn’t say why. And by confusing domain names and URLs, it can’t explain why.

So what is a domain name, anyway? Wikipedia is tremendously opaque:

A domain name is an identification label to define realms of administrative autonomy, authority, or control … Domain names are used in various networking contexts and application-specific…

Wow, file that one under “sentences we didn’t finish.”

I suppose we can give our senior technology editor a break, then. Looks like domain name is hard to define. Maybe I’ll take a stab at it in a later post.