Categories
Technology

How not to create software

If you develop open source software, or software that you give to the public out of the kindness of your heart, document it. I know people will say, “But it’s free! How can you add more demands on the caring, giving person who wrote it?”

Easily. Software that requires one to edit C makefiles because this little tweak or that little tweak won’t get picked up by the auto-configuration tools; J2EE applications that require tiny little tweaks in a dozen different text files; software that requires you ‘guess’ exactly what you’re supposed to do on a screen Are Not Helpful.

Undocumented APIs. Errors that provide no messages. No documentation because the developer is too busy building the next version of the software to write a silly thing like documentation. These Are Not Helpful.

I have worked with wonderful commercial and non-commercial, proprietary and open source software in the last several months for Practical RDF. These will all be included in the book, with full attribution for the creators as well as full appreciation for the good work and great software that’s a pleasure to both install and learn to use.

Software that is neither is not included. Simple as that. This evening I reached my Tweak/Fuss/Guess/Muck Overflow Point.

Archived with comments at Wayback Machine

Categories
Technology

Are the fish spawning?

I had a friend ask me a couple of days ago why it’s taking so long to finish the Practical RDF book. I had to laugh (either that or scream) because to write about something such as Siderean Software’s RDF-based search and navigation product, Seamark, required reading over 100 pages of documentation, not to mention installation of the software and other assorted technical activities just to write — effectively — one section covering this very sophisticated commercial product in Chapter 16. And I’m covering at least five other products in that same chapter.

To write about Inkling/SquishQL in Chapter 11 required that I finally download and install Fink (I’ve been lazy), so that I can easily download and install Readline, so that download and install PostgreSQL, so that I can download and install and try out Inkling/SquishQL on my Mac OS X. And SquishQL isn’t even the primary focus of that chapter.

However, I must focus and get this book finished, if for no other reason than to complete the brainwa…urh, education of Dorothea, who is a reviewer for my book (and an excellent one at that).

Must Stop Weblogging.

However, Jonathon has made this a bit difficult by continuing the discussion about copyright and Creative Commons, because, as he puts it, …I am one of only two people in the whole of Blogaria who accept that writers might wish to exert a degree of control over how their work is used and who also feel no obligation to donate their work to the public domain.

I am the other person Jonathon refers to, but I genuinely do not believe we can be the only two people who want to have some control over how our work is used. We can’t possibly be the only two people who believe this. Can we?

As Jonathon, states, this is a topic worth discussing if for no other reason than to see if there are other fishies swimming against the tide of Creative Commons, Public Domain, and an artist’s rights to their own work as compared to the public’s right to use the work as they will. As he writes:

I believe, and I suspect Burningbird does too, that this is a discussion worth pursuing, not so much because she and I happen to share a contrary view but because the intertwined beliefs “copyright is bad” and “Creative Commons is good” have almost instantaneously become an orthodoxy in Blogaria (to wit, the inclusion of support for Creative Commons licenses in the next version of Movable Type). And orthodoxies are the enemy of free, creative thought.

On this issue, there is an orthodoxy within the weblogging kingdom — a mass movement difficult to swim against; and as my last two posts should demonstrate, I am not one for spawning. There must be more subtle nuances to this issue then the black and white pronouncements of “copyright is evil”, “artists wanting to maintain control of their work are stealing from the public domain”, and “creative control suppresses free speech”.

However, I must get myself back to my work and leave this discussion for Jonathon and others — but I sure would like to hear from those others who believe there is no harm in an artist retaining creative control of their work, and that we can be inspired from artists without deriving from them.

(And as I write this, I can feel the push of the stream against me, and see a million fishy eyes headed directly at me…)

Archived with comments at the Wayback Machine

Categories
Technology Weblogging

Month, day, year, oh my

Another fooflah, this time over archiving.

Dorothea picked on Mark’s archive setup, which is based on archive-month-link. Jonathon responds with a push-back at Dorothea’s weekly archive. He’s joined in his comments by Mark who pushes back with justification for his archive-month-link. Aquarionics bravely joines the discussion, Dorothea retracts.

Could be me misreading everything but it sure looked like good fun was NOT had by all. Good lord, I thought I was the only person who took things too seriously.

Being the pain in the butt, annoyance, and general irritant that I am, I thought I would make things worse. It’s part of my philosophy that if you push things enough, either it blows totally, in which case we’ll at least have an interesting afternoon; or everyone collapses into laughter, poking gentle fun at each other’s font choice.

In line with this, I take a great deal of satisfaction in knowing that everyone would be uncomfortable with my archive setup. I list categories, the last 50 entries, and I provide search. That’s it. No weekly or monthly archives at all. I never really thought anyone used them. From this discussion, though, I think I may be off in my assessment; perhaps people do use archives. Well, this is a lowering thought. All this time I’ve been depriving my readers of my archives.

However, after reading all this, I wasn’t sure how to do archives. No matter what kind of archive I implemented, I would be taking sides, and that kind of ruins some of the fun. But I didn’t want to do all of the archives, as static web page generation is taking far too long now as it is. So I did what any self-respecting blogger would do: I picked door number 3.

Instead of static archive pages, I added a form to my main Archive page just under the categories. A person puts in a specific date (using a specific format), picks if they want the material ordered reverse chronological, and clicks the button. A MySql/PHP page opens that lists all of the content in either chronological (default) or reverse order. They can then click on an item to go the main page to view the trackbacks and comments, or they can just read the material there (though I might change this).

Because I let MT do my line breaks I had to a little tiny munging on the text, but that’s my own fault for not doing my own markup.

If a person screws up the format, they’ll get all of my material dating back to when I did my last port in March of last year (I didn’t move all my old content over). However, I also put a limit of only 300 entries on the page. I might play with this a bit, add a range later, but we’ll see how it goes for now.

Following is the code — change stuff appropriately.

 

$dt = $_POST[‘create_date’];
$reverse = $_POST[‘reverse’];

if ($reverse)
$order = “ORDER BY entry_created_on desc limit 300”;
else
$order = “ORDER BY entry_created_on limit 300”;

$link = mysql_connect(“localhost”, “user”, “password”)
or die(“database errors”);
mysql_select_db (“database”);

$query = “SELECT entry_id, entry_title, entry_text, entry_created_on FROM mt_entry where entry_created_on > ‘” . $dt . “‘ and entry_blog_id = 2 and entry_status = 2 ” . $order;

$result = mysql_query($query) or die(“database errors”);

while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
$input = $line[0];
$input = str_pad($input, 6, “0”, STR_PAD_LEFT);

$text = str_replace(“</blockquote><br />”, “</blockquote>”, str_replace(“<blockquote><br />”, “<blockquote>”,nl2br($line[2])));

printf(“<div class=’titlebox’><span class=’title’>”);

printf(“<a href=’http://weblog.burningbird.net/fires/%s.htm’>%s</a></span></div>”, $input, $line[1]);

printf(“<div class=’blogbody’ style=’font-family: arial; font-size: 12px; line-height: 16px’>%s<div class=’posted’><p>Posted on %s</p></div>”,
$text, $line[3]);
printf(“</div>”);
}

/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($link);

 

Categories
Technology

YAM—Yet Another Modification

One more modification. Since I do make updates to a weblog posting — to add new information, make corrections, whatever — I made these easier to spot.

First, I’m now highlighting the change, putting a box around it with a different color of background. In addition, I pulled my old MT tag-based recent entry list and replaced it with a PHP/MySql application that lists the ten most recently modified weblog postings, regardless of whether this modification is a new entry, or a modification to an older one.

This list, which is between the Recent Comments and the Recent Trackbacks, should help you keep up with all my fast fingered, quick typing, multi-faceted, many changeable weblog posting entries. It’s part of my strategy to bubble-up changes to the top.

Champagne development and caviar schemes.

Of course, I realize that I’m violating one of the sacred rules of weblogging: thou shalt not edit. Oh, but it’s so fun! I could use this list in addition to the traditional MT Recent Entries listing, but for now I’ll just stay with the recent modified list.

I’ll probably get back to non-tech posts in a bit. Right now, I’m having a little bit of fun playing around here, in this my toy box. However, I feel a Mark Twain post hovering near my mind.

Code: Change database, blog-id, user, and password, as well as your own archive location and archive file format. Do not change the status or you’ll end up with the draft posts as well as the published ones. Could be embarrassing.

 

<?php

$link = mysql_connect(“localhost”, “user“, “password“)
or die(“database errors”);
mysql_select_db (“database“);

$query = “SELECT entry_id, entry_title, entry_modified_on from mt_entry where entry_blog_id = 2 and entry_status = 2 ORDER BY entry_modified_on desc limit 10″;

$result = mysql_query($query) or die(“database errors”);

while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
$input = $line[0];
$input = str_pad($input, 6, “0”, STR_PAD_LEFT);
printf(“<a href=’http://weblog.burningbird.net/fires/%s.htm‘>%s</a><br />”,
$input, $line[1]);
}

/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($link);
?>

Categories
Technology Weblogging

Burningbird’s threadneedle strategy

Recovered from the Wayback Machine.

I wanted to provide the details of my overall Threadneedle strategy to fill in some of the gaps in the material I’ve supplied to this point for comments, Trackback, and Backtrack. I also want to provide instructions on how to incorporate some of this into non-Movable Type environments.

My goal is to encourage and track conversations related to, and surrounding, any one of my posts. Ultimately, from a Threadneedle perspective, this effort will add my thread into others in a distributed conversation open to any interested party.

This multi-step guide should provide the detail about comments, trackback, backtrack and related technologies, so that you can incorporate much (or all) of this information within your weblog, regardless of tool. Read on…

Step 1The first step in Threadneedle enabling this weblog was to enable comments. Comments allow people to join the conversation associated with a post, even if they don’t have a weblog (or prefer to be anonymous). The use of comments was further refined by the “Recent Comments” functionality. Recent Comments allows my readers to see where new comments are occurring so that they don’t have to hunt around among my posts — even older posts — looking for new activity. You can read how I enabled Recent Comments in this posting.

In parallel with this activity, I’m replacing all of my web sites with weblogs, and enabling comments on all of my work, not just the so-called ‘traditional weblogging writing’. I’m making this move because weblogging software, with its comfortable templates and lean, but sophisticated content management is, to me, an incredibly effective tool to use for all web content management. And comments add a dynamic to my existing static pages, which should help them to remain vibrant and healthy, rather than dulled, dusty, and disused.

However, I don’t want all of this material across all these weblogs to exist in isolation, so I want to show on each ‘main’ weblogging page — not the individual pages, which should be kept free of processing — the recent comments across all of the weblogs. I could use a MT plug-in, but this would be forcing a re-build on all of the main weblog pages for each new comment issued. This is prohibitive. A better approach is a well-tuned SQL query, embedded in PHP.

At this time, I’m using Movable Type tags to track recent comments for each individual weblog. A future enhancement will use PHP/MySql to track recent comments across all my weblogs.

If you’re not using Movable Type, then, of course, you’ll use whatever comments are available in your environment. This also applies to how you would track comments across many implementations of weblogs, something I just can’t cover here because the different comment implementations vary too widely.

 

Step 2 

The second step in my threadneedle strategy was to enable Trackbacks. With this, people who link to me, or write something related to one of my posts, can send me a trackback ping. This ‘ping’ is really an HTTP call with some associated data, such as entry being pinged, the link of the remote posting that pinged me, and that posting title and an associated excerpt. The Trackback functionality, implemented as part of Movable Type using Perl and CGI on my system, takes this information and stores it along with the associated weblog posting that was ‘trackback pinged’.

In my main page is a link that opens a CGI generated page that lists all of the trackbacks that have been made against the page, along with the unique trackback ping for that entry. A movable type tag lists the number of trackbacks the entry has received and when I receive a trackback ping, my main page is automatically re-built so that this number is incremented.

Additionally, I also added trackback to my individual posting archive pages so that each is listed just above my comments. You can read how I accomplished this functionality in this weblog posting

On final change I made was to add the RDF/XML for Trackback auto-discovery. This is added to the individual posting page, and allows any tool that can process the RDF/XML to find out the trackback ping id, excerpt, title, and link associated with that posting. You don’t have to add this RDF/XML to your page, as long as you provide some other way for people to discover your trackback ping URL and identifier. But the RDF/XML allows automated discovery.

Embedded RDF/XML causes XHTML validation to fail, so the RDF/XML is enclosed in HTML comments. Read more about this RDF/XML here. Read more about enabling trackback in MT weblogs here.

In a nutshell, trackback works by generating a unique trackback ping identifier and associating this with a specific weblog entry. Since I use MT, trackback is incorporated into my weblogging tool, but there is also a very handy stand alone Trackback Server that the Trott’s have released under Artistic license. This means you can copy it and use it, or even include it in your weblogging software distribution, as long as the code is left relatively intact, and the copyright information is kept within the code.

How does Trackback work? Following are the events associated with it:

 

 

  1. Write a post that references another post
  2. If Trackback auto-discovery is not turned on, find the trackback URL associated with the post you’re writing about, and use whatever means you have to send the trackback ping, which includes your posting URL, title, and a brief excerpt as well as the ping id of the posting you’re pinging
  3. If you do enable auto-discovery and the remote weblog has embedded RDF/XML into their posting, you don’t have to do anything further; however, if the remote weblog does not have the embedded RDF/XML, follow step 2.
  4. The remote weblog gets this ping, and pulls out the URL, title, and excerpt, as well as the trackback ping id and associates this trackback item with the proper post. It can do this because stored, somewhere, is a mapping between a weblog post entry, and a trackback ping id. Entry-ping. Entry-ping. Ping-Entry. Just like peanut butter and jelly. The grape kind.
  5. At this point, you sit back, feeling like Joe/Jill Cool because you’re on the hip, leading edge of technology and people are going to think you’re macho-techno-alpha-geek because you Implement Trackback. You techie hotie you.

 

Now, mechanically, how does TB work. First of all, TB is RESTful. You’ve seen this term used before, most likey, but what does it mean?

Without getting into gory details, REST follows a principle based on why get fancy when plain works. It uses standard HTTP calls to communicate data, rather than using the more encoded procedural call like processes to send data, such as SOAP or XML-RPC. Since all web servers provide access to data transmitted in standard HTTP calls, all web servers are already enabled to use REST.

Now you can see why people use RESTful — they aren’t just being weird.

REST makes Trackback extremely easy to work with, in different languages and within different weblogging tools, because it’s just HTTP, a little processing, and some static storage. That’s all it is.

Now, you don’t have to be using Movable Type to implement Trackback. In fact, you don’t have to be using Perl and CGI. All you really have to do is follow the Trackback Specification. To allow your site to be trackback enabled, you need to provide the technology that implements this specification, using whatever technology that works for you. For instance, the Homebrew Trackback Tutorial provides how-to implement Trackback in PHP.

The key element to this is sending an HTTP call with the required trackback info, and providing the ability to intercept an HTTP call and pull the information from it. This is combined with functionality to generate a unique trackback ping, and store the trackback information for each posting so that it’s accessible with the posting in whatever method works for you.

I know this sounds simple, and it is is you’re an experienced web developer. If youre not, and you’re not using MT, list in the comments what your weblog environment is, and what functionality can be used with your system, and we’ll see if we can’t map you to an implementation, or at least help point you in the right direction.

Rather than using Trackback, I could scan my referrer logs and pull referrers, but I’ve never been happy about this approach. I wanted to incorporate into my Threadneedle strategy a deliberate interest in being part of a conversation, and this occurs with Trackback — you have to enable it, ping me, or at least turn on Trackback auto-Discovery. No accidental tourists here.

One future enhancement I am making is to create a web page form that allows a person to enter the trackback information — link, excerpt, title, and so on — that will automatically create the trackback ping for whichever of my postings they wrote about in their weblog. A trackback entry would then appear for them in my posting without them having to enable trackback, at all. This is how the trackback works with LazyWeb.

 

 

Step 3 

The third step in my Threadneedle enablement was incorporating Recent Trackbacks (same as Recent Comments) as well as Backtrack. Recent Trackbacks is incorporated using PHP/MySql, and will only work with Movable Type, but you should be able to get this functionality within your Trackback implementation by polling recent entries in whatever store you’re using to map trackback entries to weblog entries.

(Again, if you need help implementing this with other systems, I would suggest writing this request in these comments, or in your weblog and trackback ping this entry. Or you could invoke LazyWeb — this is the perfect LazyWeb type of request. Something very doable, a small, one-person, fun type of tweaky task.)

My implementation of Backtrack displays a list of all trackback pings sent with one of my weblog postings (not received), listed below the trackback entries I’ve received, and labled with “Sticky Strands”. Now the trackback ping URL isn’t all that useful, so what I’ve done is created a PHP web page that takes this ping URL, adds a small bit of information to it and invokes it as an HTTP request. This HTTP request then returns with the title, link, and excerpt from the posting I trackbacked, and also a listing of other trackbacks that posting received, including my own. Both my readers and I can discover who else is participating in the conversation associated with the one posting.

How this works: Backtrack relies on another aspect of the Trackback specification, which allows a return of information formatted in RSS. To get this RSS feed, you simply attach the following string on to the URL used for the trackback ping:

 

?__mode=rss

example: http://burningbird.net/cgi-bin/mt-tb.cgi/294?__mode=rss

 

At that point all you need to do is process the RSS into viewable content. My processing is based on PHP, but you can use whatever works for you. See this page for my code for Recent Trackbacks and Backtrack.

Now, a future enhancement could be to do something similar to what Sam Ruby does, which is to follow trackbacks he receives and find out who trackbacked them and so on; and follow my trackbacks to find their trackback pings sent, and so on. In other words, Sam allows a person to follow a thread all the way up and all the way down, without leaving his Backtrack page. (Here’s Sam’s Python code.)

Sam’s code works because of that RDF/XML that’s added to each page to support Trackback auto-discovery. I could implement this, but I’m hesitant, and the reason has nothing to do with technology.

I am a huge believer that one thing that differentiates weblogs from usenet or MetaFilter or online forums is the weblog itself — the unique location, and the unique look. The comments, and trackbacks, and previous postings all combine with the posting to create a unique avator virtually representing ourselves on the net.

Because of this, I don’t like putting full exceprts into my RSS files for aggregators — I want people to come here to read my writings. And this strong belief in the weblogging avatar also plays into my reluctance to extend Backtrack more than one level.

With just the one level, you can click on any of the links and go to that weblog posting, and see the writing within the avatar rather than stripped of all identifying characteristics. With multi-threaded Backtrack, it’s too easy to skip around, and you miss things. At least, this is my interpretation when I tried it out over at Sam’s. All it became at one point is just words.

Now, Sam’s idea is a great one, and the technology is cool. But for the nonce, I think I’ll keep Backtrack the way it is, same as I’ll keep my Trackback listings the way they are.

 

Step 4…n 

Continuing Threadneedle strategy incorporates enhancements to existing technologies, including providing email notification when a thread has received new input (such as a new comment or trackback thread) and an RSS feed for same for people to subscribe to (a Threadneedle thread RSS feed viewer? Hmmm.).

Additonally, following a thread is very doable with Trackback auto-Discovery enabled (that’s why adding the RDF/XML is so important.) I wouldn’t mind playing around with the graphics software available to generate graphical/clickable ‘maps’ of a thread in its entirety.

Lastly, I want to start a compaign to encourage all webloggers who are interested in weblogs as a mode to conversations to incorporate Trackback technology. I know there are some geeky alternatives, such as pingback, but the most widespread technique used now is Trackback. It would be nice for all of us to focus on one specification. This means encouraging non-Trackback enabled weblogs to trackback enable their tools. In the meantime, though, the Trackback specification tells users of some of the tools what they can do to trackback-enable their weblogs.

My personal to-do list:

 

  • Encourage implementations of Trackback in other technologies for others to use.
  • Finish transforming all web content into Movable Type
  • Implement Recent Comments and Recent Trackbacks across all weblogs
  • Create Form to allow Trackback pings to my posts from non-trackback enabled weblogs
  • Enable technology that allows a person to be notified by email when a thread they’re interested in has had activity (new trackback or comment)
  • Create RSS feed of a thread that a person can subscribe to
  • Perhaps play around with technology that tracks a thread in its entirety, cabled with web graphics software to draw graphical/clickable picture of same
  • Harrass other weblog makers to add Trackback specification capability to their tools

 

More Reading: Trackback White Paper. And Ben Hammersley has re-capped many of the Sticky Strand technologies.

This is a start to documenting Threadneedle as is is incorporated here at Burningbird (and elsewhere). I’ll continue to refine this, and will gather these documents into a separate How-To Weblog.

But one starts walkin’ before one starts skippen’ before one starts runnin’ and before one goes to the moon.