Becoming edumucated

A while back I submitted a short research outline to the AAAI Fall Symposium. It went over well enough that I have been expanding what I wrote there to continue towards my dissertation. Unfortunately, it did not scale directly; or rather, I need to restructure quite a bit to get it to scale up. So I have fallen to try to mind-map how all the bits and pieces inter-relate. I think that it has worked out rather well.

The mind-map doesn't really translate directly to an outline though. So I fell back on Tinderbox agents to help with this task. First I added a couple of simple attributes: Section and Order. Then we can use an agent to collect all the notes for a section, sorting on the Order attribute:

Since the agent is looking for notes with the section attribute that includes a given tag, we can place a note in multiple sections. The upshot is that I can now shuffle sections around just by changing two attributes and the agents automatically restructure the outline.

The downside is that I can only do this for a single level -- children of agents, but not grandchildren.

Filed under Robotics , Tinderbox , Paper .

So I ran across what I think is a bug in Tinderbox. I have a note that has a bunch of pictures and links. I set the links by selecting the appropriate text (usually inside [ ... ] ), then setting it to the web location I want. Normally no problem. In this particular note, the location seem to be getting messed up somehow. For example, the box around the linked text 13MB WMV in the note is correct. In the link browser, it is 3MB WMV] (not correct).

It gets worse, though. The intended link for 200KB WMV (toward the bottom) somehow now includes the image (and caused XHTML validation errors when I export).

Filed under Tinderbox .

This is very similar to the last Tinderbox + Automator experiment. Instead of purely Automator, though, I thought I'd try to work with some of the Finder tools.

First stab: Let's see if we do a Folder Action on the export directory. Can it run an Automator workflow? It turns out I can. I like running the Automator scripts -- they give good feedback in the status bar as to which portion of the script is executing.

So if all works well, we have a folder that will automatically upload its contents when I export HTML from Tinderbox.

Filed under Tinderbox .

I just made my life a little easier with Automator today.

My usual use of Tinderbox for the website involves the following:

1) Work in Tinderbox.

2) Export to HTML for upload.

3) Open Terminal if it is not open

4) rsync from my local machine to the website.

Not terribly hard, but a bit tedious. Automator just made this a little easier. I made a workflow that takes a directory and rsyncs it to the right spot. Check out the sample. You'll probably want to stick it in your ~/Library/Scripts directory

Pretty simple workflow -- it asks for the export directory first. In my case I select ~/Sites/robothor/export and hit OK. Then it POSIX encodes the path and quotes the result in case there is a space in the path somewhere. The third step is executing a small shell script to upload to the server. If you want to modify the script, you'll need to change this. I am running sshKeychain, which handles giving the correct password to rsync. The final step is just a simple Growl notification letting me know it is done. This is very simplistic, but it seems to work for me so far.

At some point it would be nice to see either Automator actions or Applescript support to Tinderbox. Imagine running a workflow that tells Tinderbox to export as HTML, then automatically uploading this to the server. Unfortunately TB won't accept Automator workflows as scripts, so I can't call the script from within TB. Oh well...

Filed under Tinderbox .

A case of "why didn't I do this sooner" when I saw this post on the Tinderbox wiki about auto-generating a Google Sitemap. I modified the provided templates a bit because I wanted to fill in some of the optional attributes. As suggested, I use an agent to collect exported notes with the following templates:

<?xml version='1.0' encoding='UTF-8'?>

<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation= "http://www.google.com/schemas/sitemap/0.84

http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

^children(sitemap-item.xml)^

</urlset>

and

<url>

<loc>^urlEncode(^URL^)^</loc>

<lastmod>^Get(Modified, =)^</lastmod>

<priority>^Get(GoogleSitemapPriority)^</priority>

<changefreq>^Get(GoogleSitemapChangeFreq)^</changefreq>

</url>

The change I made to this is to suck out the priority and change frequency from attributes. One nifty aspect of Tinderbox is that I can apply some defaults (say GoogleSitemapPriority of .5) and then override this so certain pages have a higher priority. Works like a charm and now I don't have to worry about mucking around with one of those perl sitemap builders...

Kudos to the Tinderbox community for continually finding neat things to do with this program.

Filed under Tinderbox , Internet .

I spent a little time today trying to get Spotlight to import Tinderbox files correctly. I was initially having problems and knew the latest Tinderbox (2.5) was supposed to be Spotlightable. So what do we know about Tinderbox files?

$ mdls Tinderbox\ release\ notes

Tinderbox release notes -------------

kMDItemAttributeChangeDate = 2005-06-30 11:20:26 -0400

kMDItemContentCreationDate = 2002-03-08 14:21:13 -0500

kMDItemContentModificationDate = 2005-06-27 13:49:50 -0400

kMDItemContentType = "dyn.ah62d4rv4gk8yg3pwqy"

kMDItemContentTypeTree = ("public.data", "public.item")

kMDItemDisplayName = "Tinderbox release notes"

kMDItemFSContentChangeDate = 2005-06-27 13:49:50 -0400

kMDItemFSCreationDate = 2002-03-08 14:21:13 -0500

kMDItemFSCreatorCode = 1130721893

kMDItemFSFinderFlags = 16

kMDItemFSInvisible = 0

kMDItemFSLabel = 0

kMDItemFSName = "Tinderbox release notes"

kMDItemFSNodeCount = 0

kMDItemFSOwnerGroupID = 80

kMDItemFSOwnerUserID = 501

kMDItemFSSize = 646376

kMDItemFSTypeCode = 1130721893

kMDItemID = 2251793

kMDItemKind = "Tinderbox document"

kMDItemLastUsedDate = 2005-06-30 11:19:26 -0400

kMDItemUsedDates = (2005-06-30 11:19:26 -0400, 2005-06-29 20:00:00 -0400)

The important bits for our purpose are the kMDItemContentType and kMDItemContentTypeTree. These are set by the Spotlight importer and are what Spotlight "knows" about the filetype. Here the Tinderbox Release Notes is treated as just plain data and not indexed.

$ mdimport -d1 Tinderbox\ release\ notes

2005-07-01 16:46:21.470 mdimport[13845] Import '/Applications/Productivity/Tinderbox 2.5/Tinderbox release notes' type 'dyn.ah62d4rv4gk8yg3pwqy' no mdimporter

Now, I have a choice -- I can either let Spotlight not index the file, or I can finesse the RichText.mdimporter to handle this type. We'll ignore this for now.

So let's look at another Tinderbox. The original box for this web site was called RoboTHOR. I'd never added a file extension, since I hadn't needed it previously, but obviously raw Tinderboxes don't work ideally. What if I renamed it to RoboTHOR.xml ?

$ mdls RoboTHOR.xml

RoboTHOR.xml -------------

kMDItemAttributeChangeDate = 2005-07-01 16:28:00 -0400

kMDItemContentCreationDate = 2005-04-19 18:48:33 -0400

kMDItemContentModificationDate = 2005-07-01 14:39:31 -0400

kMDItemContentType = "public.xml"

kMDItemContentTypeTree = ("public.xml", "public.text", "public.data", "public.item", "public.content")

kMDItemDisplayName = "RoboTHOR"

...

Certainly better. Now mdimport's output will be a little more pleasant:

$ mdimport -d1 RoboTHOR.xml

2005-07-01 16:48:24.961 mdimport[13852] Import '/Users/mtlong/Sites/robothor/RoboTHOR.xml' type 'public.xml' using 'file://localhost/System/Library/Spotlight/ RichText.mdimporter/'

So now the final test. What about .tbx, the normal extension for Tinderbox documents?

$ mdls RoboTHOR.tbx

RoboTHOR.tbx -------------

kMDItemAttributeChangeDate = 2005-07-01 16:50:00 -0400

kMDItemContentCreationDate = 2005-04-19 18:48:33 -0400

kMDItemContentModificationDate = 2005-07-01 16:33:18 -0400

kMDItemContentType = "com.testgate.tinderbox"

kMDItemContentTypeTree = (

"com.testgate.tinderbox",

"public.xml",

"public.text",

"public.data",

"public.item",

"public.content"

)

...

But now we have stopped getting love from mdimport:

$ mdimport -d1 RoboTHOR.tbx

2005-07-01 16:50:48.586 mdimport[13872] Import '/Users/mtlong/Sites/robothor/RoboTHOR.tbx' type 'com.testgate.tinderbox' no mdimporter

Spotlight will no longer import this file, even though it still knows that it is XML. But there is a solution. We can modify the /System/Library/Spotlight/ RichText.mdimporter/Contents/Info.plist and alter the LSItemContentTypes array as follows:

<key>LSItemContentTypes</key>

<array>

<string>public.rtf</string>

<string>public.html</string>

<string>public.xml</string>

<string>public.plain-text</string>

<string>com.apple.traditional-mac-plain-text</string>

<string>com.apple.rtfd</string>

<string>com.apple.webarchive</string>

<string>com.testgate.tinderbox</string>

<string>dyn.ah62d4rv4gk8yg3pwqy</string>

</array>

We simply added com.testgate.tinderbox and dyn.ah62d4rv4gk8yg3pwqy. Now mdimport

$ mdimport -d2 RoboTHOR.tbx

2005-07-01 16:09:53.020 mdimport[13591] Import '/Users/mtlong/Sites/robothor/RoboTHOR.tbx' type 'com.testgate.tinderbox' using 'file://localhost/System/Library/Spotlight/ RichText.mdimporter/'

$ mdimport -d1 Tinderbox\ release\ notes

2005-07-01 17:35:27.905 mdimport[13901] Import '/Applications/Productivity/Tinderbox 2.5/Tinderbox release notes' type 'dyn.ah62d4rv4gk8yg3pwqy' using 'file://localhost/System/Library/Spotlight/ RichText.mdimporter/'

Now were sitting fat dumb and happy.

Filed under Tinderbox .

Jen just scored a new Powerbook as a graduation present (and is thus finally making the switch). She had asked me for a few pointers on some Mac software that I consider productivity essentials. Here are a few of the high points, roughly categorized:

Personal Information Management:

I use Tinderbox right now primarily for my web activities, but there is a much bigger potential in terms of writing and research. While an insanely useful piece of software, there are still holes that are filled by the Devon Technologies products.

The suite of products from Devon Technologies, DevonThink and DevonAgent are also part of my work flow. I really find the ability to browse a site with DevonAgetnt, especially a journal or conference repository and suck down useful bits of information into DevonThink, where I can then classify and organize. This is a recent purchase, so I am still trying to find the best workflow for the PhD.

TeX:

Once I have the information, I need to do something with it. In my case, this usually involves writing in LaTeX. For OSX, I use TeXShop for all my TeX needs. Good editor plus handy preview is really what it is all about. Oh, and now that I am on Tiger, the editor is much snappier than it used to be thanks to the performance improvements in the new OS.

With writing comes references, and for OSX the best BibTeX editor is BibDesk. Each update gets better and better. Recent additions are auto-generation of cite keys, auto-renaming and filing of pdfs, and a quick-input tool to help fill in the bibliographic information in the first place (always the most tedious).

Equation Service is a neat OSX Service that allows you to enter a snippet of LaTeX, and produce a small PDF of the equation as output. Great for putting nice-looking equations into applications that do not support LaTeX.

General OSX:

For general ssh work, SSH Keychain keeps things organized. Quicksilver is a fantastic system tool for launching applications, among its myriad uses. SubEthaEdit is a good general-purpose editor that is free for personal use.

I'm sure there are others, but these seem to be fired up most of the time (translation: right now).