Jer’s Software Hut Falls Silent

The shadowy, misshapen minions have all gone home; the vast underground chamber that once rang with their chants as they turned the giant wooden capstans has fallen silent. The river of lava flows unimpeded, the precarious rope bridges spanning it falling into disrepair. Above, the streets of Sky City Research Facility, once teeming with antigravity cars, are empty, the crystalline architecture acquiring a layer of eagle guano and dust that is transformed into gritty runoff when it rains.

The crudely-crafted Web site at jerssoftwarehut.com no longer accepts payment for Jer’s Novel Writer software licenses, and bears the following statement:

Well, it’s happened; I have a regular job. As I slave away working for the man I often wonder if things might have been different had I only worked harder at making Jer’s Software Hut a business rather than a hobby. Probably now we will never know. It was a good run but it’s time to ackowledge that development is stalled and customer service around here has been really awful.

That pretty much says it all; despite thousands of happy users, some of whom even paid for the software, when it came time to have a steady income again I took the safer path of working for someone else. (The ironic twist to this narrative I will leave for another time.)

It was a good run, and as I get my work life under control I hope soon to at least return to using Jer’s Novel Writer for its intended purpose – as a writing tool that helps me create fiction. Until I do that I can’t even consider opening the shutters on the Hut and throwing the big switch that raises the lightning rod into the violent midnight thunderstorm, while sparks fly and the turbines spin faster and faster, the needles on their gauges creeping ominously into the red. Maybe someday, though. Maybe someday.

1

Pride and Prejudice and Zombies

It is a common practice these days for publishers to put a series of questions at the end of their more ‘literate’ offerings. The purpose of the questions is to help drive book club discussions, and therefore book club sales. Pride and Prejudice and Zombies by Jane Austen and Seth Grahame Smith is no exception. The last of these study questions reads thus:

Some scholars believe that the zombies were a last-minute addition to the novel, requested by the publisher in a shameless attempt to boost sales. Others argue that the hordes of living dead are integral to Jane Austen’s plot and social commentary. What do you think? Can you imagine what this novel would be like without the violent zombie mayhem?

This was a question I had asked myself many times while reading the book. If our protagonist, Elizabeth, were not a superlative zombie slayer, trained in the ways of Shaolin and other deadly Eastern arts, what would she do instead? Skimming Project Gutenberg’s archive of an earlier draft of the story, it seems Elizabeth was originally an accomplished musician. That’s not bad, but the motivation of this pursuit seems mainly to attract the best mate possible.

And what of Mr. Darcy, her foil in this early example of the I-hate-you-so-much-I-must-love-you story? Even as a highly refined killing machine he doesn’t bring that much to the table except a generous nature (it turns out – sorry for the spoiler) and a lot of money. Take away his skill with blade and musket and there’s not much left.

So bring on the zombies, I say. Let Elizabeth kill several of Lady Catherine’s ninja bodyguards. Let the final confrontation between Catherine and Elizabeth take place in a dojo, with swords and grievous wounds. Let Mr. Bennett spend an amiable morning with Mr. Bingley trapping, decapitating, and incinerating the undead. Let Mr. Wickham — oh, but there I go spoiling things again. Anyway, let’s give these people some teeth!

As an afterthought, I would be curious to know how well a student would do on a typical exam for the abridged Austen-only version, having read and Zombies instead. Would some teachers decide that reading the expanded version was better than not reading it at all? Would some teachers say quietly to unmotivated students, “If you read the zombie version you can still pull a B”?

Note: if you use the above link to buy this book (or a Kindle, or a new car), I get a kickback.

2

Happy Birthday to my Sweetie

It was my first chance to spend the day with my sweetie on her birthday, and it was a big birthday at that. Yesterday my honey turned forty years old, and I was there to help celebrate. We didn’t whoop it up or anything, just let someone else do the cooking, opened up a nice bottle of wine, and watched a movie. We’ll be having a slightly larger celebration when more family is in town.

In the meantime, happy birthday, sweetie! Let’s do that again lots of times!

1

Crazy Eyebrow Hair

I was never blessed with much in the eyebrow department; where some people have well-defined and expressive eyebrows that add character to their faces, I just have a faint hint of eyebrowage. It’s one reason that eye surgery has never really appealed to me – my glasses provide some definition on my face that most people get from their eyebrows.

It is possible that my brother took my eyebrow mojo – he certainly has more going on on his forehead than most.

Recently my sweetie and I were cuddling and she started to laugh. “Oh, my God,” she said (or something like that), “you have a crazy eyebrow hair! Go look in the mirror!” I did and she was right; I have one big kinky gray eyebrow hair.

Crazy Eyebrow Hair!

My only notable eyebrow hair.


You can see in the picture that the rest of my eyebrow hairs are nothing to write home about. Sparse, thin, and pale. But behold the majesty of the mighty gray one! Could this be a sign of things to come? As more of the hairs turn gray will they, too, become part of a crazy, kinky, shrubbery that will give me that mad scientist look that makes all the girls swoon?

Man, I sure hope so. That would be cool.

1

Duke City Shootout Now Accepting Submissions

Got an idea for a short film but despair of it ever being produced? Buck up, Sparky! The Duke City Shootout is here to make your film dream come true.

What you do: Write one of the best 12-page screenplays ever. Send it in.

What they do: Choose the best of the screenplays submitted, bring you out to Albuquerque, and provide you with a mostly-skilled crew and (usually) a film industry mentor to help you get the job done. Cameras, grip, and whatnot are provided.

What happens next: After casting local talent and getting everything ready, teams have three days to shoot and four to edit, before the films are judged by an industry panel and then shown in a big theater packed with enthusiastic people. It’s a good time. You can read of my experience in the Shootout Under the Pirates! category. I advise starting with the oldest episodes and working forward in time.

If you have a flair for writing cool short movies, you really can’t go wrong with this festival. It’s a lot of work getting a film to the screen, but here’s a chance to make it happen. Check out The official Duke City Shootout Web page for the lowdown.

What are you waiting for? Get to work on that script!

1

Career Advice for a Wayward Pop Star

I was driving up highway 17 the other day, top down despite the threatening weather, ZZ Top playing slightly louder than strictly necessary. Inexorably, inevitably, sure as night follows day and a pilot for a terrible television series follows the Super Bowl, my mind turned from Tres Hombres to Britney Spears.

To call me a fan of Ms. Spears would not be terribly accurate. Her music and schoolgirl-slut image is interchangeable in my mind with that of several other forgettable young women. Presented with a song by one of them, I expect I’d guess the correct singer at a rate only slightly higher than random chance. I’m pretty sure she did one called “Not That Innocent” or something like that.

Recently I learned that she was a Mouseketeer, along with another of the interchangeable popsters, and Justin Timberlake. I didn’t even know they still had Mouseketeers. Maybe now they’ll reconsider. If memory serves Britney and Justin were together for a while, but I might be thinking of some other guy.

I’m not a fan, but I think about Britney every once in a while. Somehow she came to define the whole pop-bimbo image, the platonic ideal of sweaty teenage jizz-bait. Then something went wrong, and I heard even less about her than I had before. A year or two ago she tried to stage a ‘comeback’ (it says something about us that someone in their twenties can come back), and I read that it was a disaster. Recently I saw her face on a perfume commercial, so I’m pretty sure she’s not dead.

The things I read about her comeback meltdown were almost giddy in their celebration of the crash of one of the most famous people of the previous decade. While I was never a fan, I also took no pleasure in her downfall. I could have told her that her comeback was ill-concieved, however, had she taken the time to ask me. Britney the schoolgirl cock-tease won’t work anymore. There’s too much history. Under my sage guidance Britney could come back, however — just not as a recapitulation of what she was before.

This is what occurred to me while listening to crunching electric guitars while driving a curvy road. Britney is now in a position to make an album I would buy, and I suspect a lot of other people would too. The title would be Mea Culpa and it would be about her real experiences, the mistakes she made, her lessons learned and her hope for the future. She would tell us of the fear and insecurity and the agents and handlers and the drugs and all the other stuff that can make anyone’s life go haywire. It would be her taking responsibility for her life, and showing the strength to rise up and move on. That would be a cool album.

It would be Britney evolving from a singer into an artist. Does she have what it takes to make an album like that? The artistic power and the courage to open her soul? I doubt we will ever know. Her people would never stand for it.

1

The Coolest T-Shirts Ever

Every once in a while as my sweetie and I converse, one of us will say ‘that should be on a t-shirt!’ Now she’s gone and done something about it. Now you too can share in the genuis.

quick! do science!!! mug in green

quick! do science!!! mug in green

quick! do science!!!

Sometimes you need a steely-eyed, devil-may-care scientist to get you out of a scrape.

“If you have the interrabang [!?], what would you call this?” the project manager for this endeavor asked me, pointing to the ‘!!!’. After a couple of suggestions we decided on ellipsclamation. Now you know!!!

'40 - The New 39' duffel

40 – The New 39

Know anyone staring down the big 4-0? What they need is a rugged gym bag to let the world know that they aren’t intimidated by the rolling of the decade. With Science (see above) on their side, people can expect to perform at a 39-year-old level at least until 41, maybe even 42!

FAQ: WTF? Mouse Pad

My favorite: FAQ: WTF?

It is the frequently asked question.

All the above designs come plastered on a variety of products, not just the ones pictured here. T-shirts, sweatshirts, tote bags and more await at Harlean’s cafepress store! If you want any of the above printed on something else, I’m sure Harlean (who is a fiction) will be happy to set that up for you.

1

Haloscan comments to WordPress – the nitty gritty.

As I mentioned in the previous episode, I recently had to move more than 8000 comments from my old comment system, Haloscan, and import them into WordPress. Haloscan served me well back in the day, but they are going away, and all my more recent comments are in the WordPress system anyway. Nice to have them all in one place.

The process turned out to be pretty easy. I found a script for importing comments from a different system, modified it, modified it some more, found a fundamental problem with it, fixed that, and in the end not much of code remained from the example, except the part where the WordPress logo is displayed on the screen. I assume that part came from the code the guy copied to make the code that I copied.

Along the way I learned a couple of things. PHP is a pretty flexible language, but running a loop that sets up 8500 data structures and runs 25500 database queries exposes PHP’s primary weakness: memory management. The whiz kids who invented PHP designed it for a load/compile/execute/exit-and-clean-up flow. Memory allocated during execution is cleaned up when the program is done running (usually when the Web page is delivered). When you try to do heavy lifting with PHP, you have to start paying attention to getting your memory back before the traditional clean-up time.

The code I started with did a direct database query to add the comment to the comments table, but that got things out of sync with other tables. (The posts table keeps track of the number of comments that apply to it, presumably for performance reasons.) I dug into the core WordPress code and found the method they call to post comments, and I made my code call that function. I have no idea what all the bookkeeping chores are that function does, and really I don’t care as long as they get done.

I didn’t worry about performance too much at first (after all, it only has to run once), but one of the database queries I did was really expensive (scanning all the posts for a specific set of characters). Even running on my local server it was slow, and I knew that if I tried something like that on my actual Web host alarms would go off and they’d shut me down for a while. I did a little optimization on that front, and it was enough.

The following script has some Muddle-specific code in it, but it might come in handy for others who need to move Haloscan comments to a new system. The part that parses Haloscan XML is pretty generic and would work for anyone, the part that saves the comments might be useful as a guide as well. The main difference others will have to deal with is where to get proper post_id based on the thread field in the XML. In my case I had a link in each blog episode back to the Haloscan thread.

The HTML bit in the middle of the file is not essential; but it puts a nice WordPress logo on the screen when the script starts up. I inherited that from the script I started with.

NOTE: While this script has code in it specific to me, I am available to customize it for others who need to move their code from Haloscan into another environment, or, for that matter, from any structured source into WordPress. Drop me a line!

<?php
 
if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. You must install WordPress before you import any comments.");
require('../wp-config.php');
 
function saveCommentToWP($comment, $dbRef, &$postThreads) {
    //echo "here's where the comment save happens <br/><br />";
    $thread = $comment['thread'];
    $postID = $postThreads[$thread];
    if (!isset($postThreads[$thread])) {
        $query = "SELECT * FROM wp_posts WHERE post_content LIKE '%".$thread."%' AND post_status='publish'";
        $postID = $dbRef->get_var($query, 0);
        $postThreads[$thread] = $postID ? $postID : 0;
        if ($postThreads[$thread] == 0)
            echo ("<br />Thread $thread has no post!");
        else
            echo "<br />Thread $thread";
        flush();       // got to have real-time updates!
    }
 
    if ($postID && $postID != 0) {
        $userId = $comment['email'] == '[email protected]' ? 1 : 0;
 
        //set up the data the way wp_insert_comment expects it.
        $wp_commentData = array();
        $wp_commentData['comment_post_ID'] = (int) $postID;
        $wp_commentData['user_id'] = (int) $userId;
        $wp_commentData['comment_parent'] = 0;
        $wp_commentData['comment_author_IP'] = $comment['ip'];
        $wp_commentData['comment_agent'] = 'Haloscan';
        $wp_commentData['comment_date'] = $comment['datetime'];
        $wp_commentData['comment_date_gmt'] = $comment['datetime'];
        $wp_commentData['comment_approved'] = '1';
        $wp_commentData['comment_content'] = $comment['text'];
        $wp_commentData['comment_author'] = $comment['name'];
        $wp_commentData['comment_author_email'] = $comment['email'];
        $wp_commentData = wp_filter_comment($wp_commentData);
 
        $comment_ID = wp_insert_comment($wp_commentData);
 
        //echo ("<strong>saved comment $comment_ID</strong>");
    }
 
    // try to reclaim some memory
    unset($wp_commentData);
    unset($comment);
}
 
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>WordPress &rsaquo; Import Comments from RSS</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
    body {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 20%;
        margin-right: 20%;
    }
    #logo {
        margin: 0;
        padding: 0;
        background-image: url(http://wordpress.org/images/logo.png);
        background-repeat: no-repeat;
        height: 60px;
        border-bottom: 4px solid #333;
    }
    #logo a {
        display: block;
        text-decoration: none;
        text-indent: -100em;
        height: 60px;
    }
    p {
        line-height: 140%;
    }
    </style>
</head><body> 
<h1 id="logo"><a href="http://wordpress.org/">WordPress</a></h1> 
 
<?php
 
// Bring in the data
$reader = new XMLReader();
if ($reader->open('export-8.xml')) {
    $postThreads = array();
    $thread = '';
    while ($reader->read()) {
        //echo "<br />read node type: ".$reader->nodeType.';     '.$reader->name.': '.$reader->value;
        if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'thread') {
            $thread = $reader->getAttribute('id');
        }
        if ($thread) {
            if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'comment') {
                // begin building comment
                $comment = array('thread' => $thread);
                $reader->read();
                while ( !($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'comment') ) {
                    if ($reader->nodeType == XMLReader::ELEMENT) {
                        $property = $reader->name;
                        $reader->read(); // assumes text element following element tag has the data
                        $comment[$property] = $reader->value;
                    }
                    $reader->read();
                }
                saveCommentToWP($comment, $wpdb, $postThreads);
            }
        }
    }
    $reader->close();
}
 
?>
 
 
</body>
</html>

3

In with the Old

I got a message today that Haloscan is closing down. That is the service that provided refreshingly spam-free comments on my old blog. A year ago I finally abandoned iBlog for WordPress, and I’m glad I did. At the time, however, I didn’t want to tackle moving the old comments over into the new system. In my conversion I embedded a link into each of the old episodes to the legacy comment system, and left it at that.

It is fortunate I found out about Haloscan when I did. Another week and 8500 comments would have been lost forever. That’s a big part of the underlayer of this blog, the part people sink gradually into as they hang around more, and they realize that this isn’t just about me. There are some pretty interesting conversations, observations, poems, and even stories in those comments. With the timer running I set to work to get the comments out of Haloscan and into WordPress.

The move turned out to be pretty straightforward. (Simpler, perhaps, than it had been to put the links into the posts.) I’ll go into the technical details in an episode tomorrow, but for now, why don’t you pop into the archives for 2004 or so and find an old episode with good comments? Maybe you’ll find something interesting someone said once. Maybe you’ll see the name of someone you haven’t thought of in a while. Maybe you’ll see something you want to comment on, even.

The Pinnacle of Human Achievement

I might have mentioned bacon lollipops a while back; I’m too lazy to go look. But now there’s this!

Caffeinated Maple Bacon Lollipops!

The copy in the announcing email read thusly:

Dear Everyone:

For years, mankind has looked up to the stars and asked, “Why is bacon so awesome? And can it be improved?”

While we here at Lollyphile can’t answer the former without slipping into flowery prose, we are confident in answering the latter. Yes. Yes, it can be improved: it can also be a stimulant. The equation looks like this:

(organic, sustainably farmed bacon) + (Vermont maple syrup) + (the caffeine equivalent of two cups of coffee) = Caffeinated Maple Bacon Lollipops

Caffeinated Maple-Bacon Lollipops!

We’re really, genuinely proud of these lollipops. Not like the normal newsletter or press release “We are proud to offer…” proud, but like the genuine, “Hey lookit this thing my child can do exceptionally well” proud. Really proud. And excited.

Now isn’t that something? (No, at this time I do not get a commission for lollipop purchases.)

A Literature Question

As one who aspires to the title ‘writer’, it is important that I read. There’s no better teacher than a well-written story. Toward that end I’ve been digging back into books that have stood the test of time, stories that everyone in the world has read except me. Pride and Prejudice and Zombies is one I’ve been meaning to get to for a while.

I have a question, though. In this version, Elizabeth Bennett is a young lady from the lower portions of the upper class, and she’s reasonably attractive, quick of wit, and a bit of a snippy bitch (many of her most pointed insults almost got past me, delivered as they were with subtlety and nuance that only upper-crust English can summon). Plus, she’s one hell of a zombie slayer. Her entire brood of sisters are quite accomplished at deanimating the undead.

She has caught the eye of more than one gentleman, but her zombie slaying is considered unladylike by some, and her first marriage proposal comes with the assumption that she will stop slaying zombies. Naturally she rebels at the mere idea.

I never read Pride and Prejudice (some sort of hackneyed subset of the version I’m reading), but I can’t help wondering how much of the zombie content is invented and how much is paraphrasing what was already there in the version Jane Austen did without assistance. Zombie-slaying of course wasn’t in the abridged version, but was there something else instead, something non-zombie-slaying Elizabeth would be loath to give up? Lady Catherine de Bourgh is renowned for her zombie slaying, and so is her daughter. What claim to fame do they have in the first draft?

1

Happy Ought-to Ought-to Day!

It’s a special day on the muddled calendar, although the name is based on that old-fashioned calendar that many people insist on using even today. It’s February twoth, or as valued bloggcomm member and new blogger Jesse pointed out, 02/02, pronounced aught-two aught-to (rhymes with ought to ought to).

The day forms a nice partner with January twoth, a deadline to measure progress on the new year’s projects. (I really should have mentioned it back then.) My list of ought-to’s is a long one this year, starting with kick-starting the writing and reading more. Wouldn’t hurt to get a blog episode up now and then as well. I really need to get the muddled calendar displaying correctly as well, and get the sweet voting working again, and do something about Jer’s Software Hut…

What ought you to do today?

1