Categories
Just Shelley

The Crystal pendant

Last week on the way back from the store, I noticed a sparkle in the car in front of me. The driver had one of those lead crystal pieces that you hang over the rear view mirror, and which reflects rainbow light back into the interior of the car.

I can never see one of these without remembering a crystal pendant that belonged to a friend of mine from years back. She was my best friend before we moved to Seattle, and lived in the small house just behind ours. I wish I could remember her name now, but I’ve never been great with names. But I remember her, and her sisters, and her mother.

She was a beautiful young woman – probably one of the prettiest girls in class. Her three older sisters were also very lovely, and as nice as they were pretty. Their mom raised the girls alone, as their father died or ran off or something. She was short and dumpy and unattractive and not particularly nice.

I used to spend hours in their house, listening to Beatles music, sharing with my friend and her sisters about periods (it was one of her sisters that explained what it was all about) and training bras and even the concept of shaving one’s legs so that they looked nice with the short skirts getting popular at the time.

Their home was very small compared to our large two story house, and they had little money compared to us. Once Mom took me and my friend for a corndog and when we got back, my friend’s mother yelled and yelled at my Mom for her fancy ways and her money, and for …shaming her in front of her daughters

Mom wasn’t rich, but she was beautiful and popular, and worked and had money that my Dad provided every month so we lived nicely. More than that, we were First Family in that town, with a history and a place that assured us welcome everywhere. My friend’s family moved to town from Spokane, and there were those who would sniff about poor folk having no call to be so cantankerous.

My Dad was in Vietnam at the time and he would send me pretty jewelry he’d pick up in trips to Japan and elsewhere, like a lovely blue saphire necklace, and one made of gold and dark green jade. He even gave me a solitary diamond–a small one, but it was a diamond.

The only jewelry my friend had was a single lead crystal pendant; a pretty necklace but not worth much.

I remember one summer afternoon I think it was, being in my friend’s house and spying her necklace fallen on the floor. It looked like the clasp had been bent and she must have lost it without knowing it. I picked it up but rather than giving it to her, I put in my pocket and took it home. Later, I climbed out my bedroom window to the roof, my favorite spot, and pulled it out of my pocket. I held it up to the dying light, so that it sparkled back at me, just like that crystal in the car last week.

I didn’t return the necklace to my friend. I am still ashamed of what I did, especially considering that she had so little and I had so much. Somehow in my mind, I came to believe that taking what made my friend happy would somehow make me happy. And I was very unhappy at the time, living in a home whose outward appearance of small town contentment was just as fake as the jewel of that pendant.

Oddly enough, or perhaps synchronously enough, Dave Rogers wrote a post on obtaining wealth and status a couple of days ago that also reminded me of my own actions in taking that necklace. He wrote about people who seem to need wealth and status, even at the expense of friendhips; perhaps even of love:

…it occurred to me…that the pursuit of wealth and status is really about seeking authority over others. Money is a form of authority, while status is kind of a surrogate for authority.

People pursue wealth and authority at the expense of their own relationships with others because they don’t have authority over themselves. This is that feeling of powerlessness, although it is often experienced as anxiety or anger or depression. Things happen that upset us, and we don’t like and can’t control the feelings; so we seek enough authority to be able to control events so that, presumably, the bad things that cause the bad feelings don’t happen, or we can ignore them. This is ultimately futile, but many times we don’t discover this fact because we’re locked into the pursuit with the notion that, “It’ll get better when…” Only it never gets better.

Not just to get authority over others but also to take authority from others. To take others joy.

I see no harm in delighting in one’s success. I have tooted my own horn a time or two in this weblog, and I hope that others see it as delight in an event and a, natural, desire to share it with others. But there’s a difference between taking pride in one’s accomplishments because we feel good about them, and using such to steal respect from others in order to bolster our own worth– like I stole my friend’s necklace to grab a little of her joy.

It never works, you know– stealing the joy from others. After I took my friend’s necklace, she never mentioned it was gone; she continued happy, while I continued sad, made even more miserable by guilt. Those who want things–names to drop, money to spend–will, as Dave wrote, only find happiness within themselves and not given, or taken, from others.

Sometimes I find myself begrudging others their good luck or fortune or success, especially when I feel a failure with book deals that fall through, or jobs that are lost; or when I feel lonely sometimes on my solitary walks. But their happiness does not come at the expense of mine, and a person’s true worth, like the crystal in the car, reflects from inward not out.

Categories
Just Shelley

In France Now

I drove over to see my Dad in the hospital yesterday. When I entered the room he looked at me without recognition for a moment, before going “Michelle? What are you doing over here?”

Though the trip is four hours each way, that’s not outside of reason for visiting one’s father. I said, “I though I would drive over and see how you’re doing, Dad.”

“You can’t drive to France”, he answered.

My Dad can become disoriented in the hospital, or whenever he’s very stressed. When this happens he reverts back to two significant events in his life: the first was when he was in the 82nd Airborne during WWII, and he was in France; the second was when he worked for the CIA in Vietnam. Obviously it was going to be a French moment in the hospital during this trip.

He was still receiving units of whole blood when I was there, which surprised me so long after the operation. When I held his hand, I noticed how white it was, and how he had no strength in the grip. Later a nurse came with a shot of insulin as his blood sugar levels were off, and that seemed to help him focus. And he got his favorite meal yesterday – meatloaf and mashed potatoes and gravy. Especially the mashed potatoes and gravy. My Dad loves mashed potatoes and gravy.

Two young ladies from Dad’s assisted living home came out that afternoon to say hi and bring a get well card signed by Dad’s dinner table companions. Dad didn’t recognize them at first, but they were pretty young things and it brought out the Irish charm and blue-eyed twinkle. When he said things that confused them, I quietly mentioned that Dad becomes disoriented in hospitals, but not to worry overmuch.

While they were there, the hospital dietician came up to see what Dad liked for his meals. He mentioned mashed potatoes and gravy. I mentioned applesauce, and Dad’s eyes lit up – he also loves applesauce. And oatmeal and orange juice, and the dietician mentioned he would have a nice breakfast the next morning to look forward to.

I had lunch with my brother as we talked about the decisions that need to be made. The options are that Dad could go into a nursing home for the next month or so to begin recuperation, or return to his apartment, but we’d have to hire special help. Medicare would cover the one but not the other. Dad’s savings are rapidly disappearing but even with the special care he’ll need, he has enough for at least a year and we decided we’d give him a good year. At his apartment, he’ll recover more quickly surrounded by the familiar. And he’ll be happier.

Back at the hospital, I noticed with approval that they had put surgery socks on Dad, and that he was receiving type A blood, donated by a voluteer – thank you whoever you are. Dad’s chart was marked with the letters of “DNR” or Do Not Resuscitate, which means if his heart failed or he stopped breathing the hospital was not to use extraordinary means to revive him. This is a long standing item we have had on request, and the hospital knows this, as does the paramedics who have been out to my brother’s house, and even know where the secret key is stashed so they could let themselves in.

Dad is the one who said to me a few years back that he’d lived too long, and you can see it in his body, as he slowly dies by inches. But he just won’t let go of that spark of life.

Categories
Diversity

In support of O’Reilly

For all the times I’ve been critical of O’Reilly about the lack of women participants at the company’s events, I now find myself needing to speak up in support of the organization generally and Tim O’Reilly specifically.

At Misbehaving, Liz Lawley noticed that the number of female participants at FooCamp was only 10% of the total. However, I know that O’Reilly has been working, specifically, to include more women in these events. And this includes FooCamp.

I was invited this year, but, unfortunately, like others, had to decline because I did not have the money to make it to the event in California. Was I a token invitation? No. I believe that O’Reilly invited me to the camp this year because of my work with, my participation in discussions of, and my writing about technology the last several years–not solely because I’ve been critical of the lack of female participation at these events.

I know I would have been very comfortable talking technology with the group that was there, because I have done so with a large number of the participants here within the weblogs. I would have been a peer among peers at this event.

In a way, I feel as if I’ve let other geek women down by not going; by not bringing more of a female presence to this event. If I had the cash to spare, believe me I would have gone. This is just the type of event I would enjoy.

Perhaps O’Reilly will have me do more writing for the company so that I can afford to attend the camp next year.

Categories
Just Shelley

Stubborn old farts run in my family

Recovered from the Wayback Machine.

My Dad is a remarkably stubborn old fart. His surgery yesterday was I guess rather harrowing for all involved, but as my brother said, my Dad came out looking better than the surgical team who had to fight to keep Dad alive. Dad always did like to make trouble for the doctors.

Mike said he doesn’t look bad today all things considered. He now has a one foot long metal rod in his leg to provide stability. It’s a good thing he can’t fly anyway, because wouldn’t he set off the alarms now. Frankly, though, if he were questioned for being a possible terrorist, I think he’d be rather flattered about the whole thing. At his age and all.

He’s still in intensive care until tomorrow, as I guess the danger time for surgeries, especially for older people, is 1 1/2 to 2 days.

My roommate will be home today, and I’m heading over tomorrow to see Dad, have lunch with my brother.

I sometimes forget, sitting in the isolation of my room or out on my solitary hikes, that I have connections with people: family and friends. Tenuous threads that have a habit of getting caught up on life now and again, providing a good, swift yank as you march blithely along.

Categories
Weblogging

WP to MT: Template engine or function call

When exploring the differences between the dynamic version of Movable Type and WordPress, it’s easy to get caught up in the one using a template engine and tags and the other using function calls. Those who support tags will say, and rightfully, that actual PHP code in a template can be intimidating to non-techs; but those who support function calls say, and rightfully, that template engines add an extra layer of processing to the application.

A template engine parses the template and generates an intermediate page that replaces tags with actual function calls. The reasoning behind doing this is to separate the presentation from the processing, in this case separate the PHP processing from the (X)HTML. Movable Type uses one of the more well known engines, the Smarty template engine, to handle the tag parsing in its new dynamic architecture.

However, a criticism of Smarty is that it doesn’t separate the processing enough, and can add it’s own level of complexity, as demonstrated in this small example from the Smarty site:

<html>
<head>
<title>User Info</title>
</head>
<body>

User Information:

Name: {$name|capitalize}<br>
Addr: {$address|escape}<br>
Date: {$smarty.now|date_format:”%Y-%m-%d”}<br>

</body>
</html>

But then, all template tag systems have some level of complexity if they’re going to be any use. At least for experienced MT users, they don’t have to learn another set of tags: Six Apart’s developers have extended the Smarty class to ‘translate’ so to speak, between MT’s tags, and Smarty’s. All combined, when you put something like this in a MT template such as Main Index:

<MTEntries lastn=”10″>
<div class=”sidecomments”><a href=”<$MTEntryPermalink$>”><$MTEntryTitle$></a></div>
</MTEntries>

After transformational magic, you get:

<?php $this->_tag_stack[] = array(’MTEntries’, array(’lastn’ => ‘10′)); smarty_block_MTEntries($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat=true);while ($_block_repeat) { ob_start(); ?>
<div class=”sidecomments”><a href=”<?php echo smarty_function_MTEntryPermalink(array(), $this);?>
“><?php echo smarty_function_MTEntryTitle(array(), $this);?>
</a></div>
<?php $this->_block_content = ob_get_contents(); ob_end_clean(); echo smarty_block_MTEntries($this->_tag_stack[count($this->_tag_stack)-1][1], $this->_block_content, $this, $_block_repeat=false); } array_pop($this->_tag_stack); ?>

Looks like templates engines make the code a whole lot simpler. But then, look at what you use with WordPress to get the same result:

<?php get_archives(’postbypost’, 10,’other’, ‘<div class=”sidecomments”>’, ‘</div>’, 0) ?>

One of the challenges with a template engine is that you have to account for variations in what people want. This usually means having to build template starting and ending blocks, modifiers, and so on so you can get somewhat complex template tag use. However, with straight function use, you just pass all of this user defined options in as parameters.

As you can see, straight function calls can be simple, and template tags can be simple: it’s how each are integrated into the page that makes the difference. What I think is more important isn’t which approach is used, but how clean the end result is, and how extensible is the underlying architecture. And in these, both Movable Type and WordPress excel, especially with some of the new design considerations with WordPress 1.3. and the intermediate step taken to handle template tag differences between MT and Smarty in the new MT 3.1.

(Weird naming synchronocity, eh?)

(I’ll cover other ‘clean’ tools when I get into porting the Movable Type weblogs.)

As for extensibility, both Movable Type and WordPress are known for their plugin environments, though there has been some criticism of MT’s new PHP plugin environment–existing Perl plugins don’t work with it. However, with Six Apart’s use of the ezSQL database library in addition to Smarty, WordPress plugin authors may now have a new venue for their efforts.

For instance, I have a plugin in WordPress that provides the recent trackbacks, pingbacks, and comments, in one list in my sidebar. I also provide the URL for those who comment, which is why I don’t use the packaged comment functions.

WordPress uses ezSQL for database access, a simplified database API. So does MT for its PHP plugins. Because of the similarity, I could take much of my existing WP plugin and just port it over to MT. The code for the plugin I ported to MT can be downloaded here.

Key code differences, aside from the database structures that set the MT plugin apart from the one in WordPress is the function name, how the database connection is accessed, and the generated text output. Smarty requires that all objects have file names that reflect their nature, such as ‘function.’ for functions, and ‘modifier.’ for modifiers, and so on. The next part of the name is the actual tag element name that’s used in the template, using MT naming conventions, starting with “MT_”. The tag in this case is MTCustomComments. Since the plugin is a function, the file is called “function.MTCustomComments.php”, and the function is named smarty_function_MTCustomComments, the ’smarty’ also being a requirement for the function name within the template system.

Two parameters are passed, ‘$args’ representing any arguments passed to the function, and a reference to the Smarty context, ‘&$ctx’. Looking in the code, you can see how the database connection, db, is accessed through the Movable Type object (that buffer between Smarty and MT), that’s part of the Smarty Context:

$lines = $ctx->mt->db->get_results($sql);

One other difference is that rather than print out the result directly in the function, as I do in WP, I return a string, which is then output automatically within the template. I could do the same with the WP plugin if I was seeking to minimize differences between the environments.

To install the MT plugin, I created a sub-directory called ‘plugin’ in the PHP directory, loaded the new function file into it, and it’s ready to use. In the Main Index page, I then invoke the plugin as follows:

<$MTCustomComments$>

Any PHP function, Smarty Plugin, and even WordPress plugin could be adapted quite easily to the new Six Apart dynamic environment. And this also means that a Six Apart plugin could be easily adapted for use in WordPress. In fact, it wouldn’t take much to create tool-specific wrappers to wrap around functions so they can operate in both environments.

Not just MT and WordPress: let’s not forget other PHP systems with plugin environments, too.

The possibilities are intriguing.