Regular readers of this site may note (all none of you), that there have been a few Tinderbox notes posted recently, and not a lot about research or robotics. I have been in the process of trying to get a proposal (PhD dissertation) put together, and that is taking up a great deal of time. Besides that I don't really want to steal my own thunder too much.
It turns out that what I am looking at is meshing in rather nicely with quite a few topics that are "hot" on the internets. Some topics of interest:
- Semantic Web technologies (particularly OWL)
- Semantic blogging (which should be of interest to Tinderbox users)
- Ontologies and semantic integration
- Robot-assisted search and rescue
How does it all fit together, you may ask? I gotta keep some secrets...
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).
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.
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...
So I'm in a little bit of a quandary at the moment. My current laptop, a gigabit ethernet G4 Powerbook, is starting to have problems. The top case started to crack around one of the hinges and I believe damaged one of the cables for the display. Now it still works -- I did a jerry-rigged fix to repair the break, but after I close and open the lid I have to finesse the display to get it to work.
I know what I want to do:
1) Give this laptop to Hannah. We can set it up in a fixed location at home and it should be OK. We wanted to do some music work with Hannah singing, and Garage Band is ideal for starting out.
2) I'd get a new laptop. I'm leaning toward a Powerbook 12". Two doubts about this laptop at the moment. One is the eternal fear that an updated version will be released mere moments after it is too late to change an order. Not much I can do about this... The second is the size: will the 12" screen be too small for me? Workaround for this is a KVM and use the nice big screen at work when I am here.
The biggest problem right now is budget. In theory I have some loans for the next year that will be kicking in soon and I do need a laptop. I often find that changing my location is good for my thoughts and focus and I can't take advantage of a portable with a broken screen. I can also go the "Student Developer Discount", which will give a nice 20% discount (see here for details). This makes it a little more palatable, but still not cheap.
Well, I know which of these inner voices will win, but hopefully I can hold out a little longer and wait until we're in a slightly better financial spot. I don't suppose anyone wants to throw an equipment grant my way... :-)
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.
So the school library has started purchasing resources through an online library. While the USF library is otherwise excellent, I take issue with this decision for a number of reasons. Let me first state though, that I really don't have a problem with the concept of an "ebook", mostly just with this particular instantiation. Problems that should be fixed:
- Each page of the book is a separate document. In the browser window, the embedded Adobe Reader will show one page at a time. The main problem with this is flipping pages -- with network lag and often-slow loads, by the time the next page has loaded, I've lost the thread of the sentence. If I want to go back page to re-read a passage, wait... wait... wait... what was I going to read again?
- No apparent way to bookmark a passage -- or even a page. While not as draconian as it could be, even going so far as to allow the printing of a single page at a time, there is no online way to bookmark a page or otherwise save a location. This is especially troublesome because of the
- Short timeout. Don't get distracted and let the system timeout -- you'll need to search for the book again, reopen it, and go to the page you were on. What's that? Didn't note the page number before the book auto-closed? Hope you're patient while you search.
- Oh, and I can't get it to work right in Safari...
I just heard from Lefteris that he just got back from presenting his paper (well, our paper technically, but he did all the writing) at the 2005 Mediterranean Conference on Control and Automation. I've updated the link to reflect the final version in the proceedings.
I think I need to start submitting to these fun overseas conferences. The AAAI Fall Symposium in Alexandria, VA will be fun and it will be good to see my Grandma, but there is something about going to Cyprus for a work conference...
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.



