Angela's website -- Sitemap
Angela Brett's
integrated circus


mathematician by numbers, programmer by the power of grayscale, physicist by a trick involving renormalisation, some dork matter, and a goat, linguist by dint of cunning, writer by Sunday midnight

Sights
Hardware
People
Websites
Interests
Tastes
Sounds
English Français

Sitemap

The sitemap, which is also used for the background image, was created with an AppleScript I wrote to control OmniGraffle. The sitemap on the web is an imagemap generated by OmniGraffle. You can also download the sitemap as an OmniGraffle document, and click the elements with the browse tool to go to the pages. It's a pretty weird thing for somebody to want to do, but hey, maybe you want to analyse it using graph theory. If you do, please tell me if you find anything interesting. I don't know as much about graph theory as I'd like to.

It was originally meant to just be a background image for the 'integrated circuit' and perhaps a site map, but in the end it became very useful for me to see the 'organisation' of this tangled web site. I altered the script to highlight links to pages which didn't exist yet, and pages which didn't have French versions yet, and it became pretty much a to-do list, and generally a source of pride at the true messiness of my head and the way that such a small amount of PHP and AppleScript code was able to cope with such a 'structure.' It reminds me of a similar diagram in GEB.

As you can probably tell, I am not an electronics engineer. I make no claims that the site map in any way resembles something which could be a working circuit diagram. I just thought it would be neat to organise my site as an integrated circuit with inputs, outputs, and a whole lot of barely understandable mess in between. Because that's a good representation of me. And I wanted to see whether I could script OmniGraffle to do such a thing.

I spent a fair bit of time searching the web to find out if there was an easy way to access a MySQL database from AppleScript. I found a few things, one that had been abandoned and I think something else that didn't work. But all I want to do is query, so in the end it turned out to be pretty easy to just write my own code to do do a query through the commandline. For those of you who are still in the process of searching the web for an easy way to access a MySQL database from AppleScript, here it is:

on runQuery(query)
set selectcommand to "/usr/local/mysql/bin/mysql -B -D databasename -u username -h localhost --column-names=n -e "
set result to do shell script (selectcommand & "'" & query & "'")
return result
end runQuery


And then set the text item delimiter to tab, and loop through lines and items. Of course it doesn't work so well if the things you're selecting contain newlines or tabs, but I'll let you figure out how to get around that yourself.

This page has been accessed times since 2024-05-08 16:26:22 Last updated: 2007-09-11 10:50:48
Other This website pages

Forums
Work
Websites
Writing