Mr Bean-alike

There is a man who catches my train in the mornings who looks an awful lot like Mr. Bean. I don’t mean he looks a bit like Rowan Atkinson, he really has the Mr. Bean expression and all. Oh, and I’m sitting right across from him. If this damn Zire 31 had a camera I’d take a photo.

Chapter Tool GUI Part II

I had planned to create a GUI wrapper, perhaps in AppleScript Studio, for Apple’s Chapter Tool command line program. My application was going to have an interface very similar to QuickTime Player, but with an extra section where you entered data about the chapter(s). You would be able to scrub through the track, and find the place to insert the Chapter Marker: then you would have a list of Chapter Markers, and the ability to edit the location, and the attributes. I did a bit of stuff with Python’s XML handling features, enough to basically figure out how to write out the required XML basic structure, and I think I know how to do the attributes. What I cannot do is figure out how to get a QT viewer in the AppleScript Studio progam (or Interface Builder, actually). There seems to be some templates for PyObj-C applications, I may use one of those. Or, I might just make an application that controls/gets data from QuickTime Player (iTunes isn’t so good for this, as it requires files to be imported before playing them). Then, all it needs to do is look after the XML generation, and bingo, easy Chapters. Actually, I remember why I stopped: Chapter Tool would not work on my Mac.

Sub-Pages don't work in Blogsome

There you go. Visit http://schinckel.net/software/, and then visit http://schinckel.net/software/acronymmerpy/ No difference, even though there is a page in acronymmerpy/ I’ll put this in the blogsome forums when I get a chance.

Ludwig Van

The BBC has been offering free downloads of the BBC Philharmonic performing Beethoven’s Symphonies as a part of their Beethoven Experience. I finally finished downloading the entire set. I also leeched (using realdump) the complete Sonata Cycle, as performed in 2003 by Artur Pizzaro. The BBC website doesn’t allow resume transfers on downloading, so I had to have several tries at some of the files. And a couple of the Sontatas don’t seem to be all there - but there ain’t any more on the server.

Memory Leak

iTunesRater seems to be leaking memory, and I think I know where. I discovered this by just watching the amount of memory it used, and each time a new track plays, the memory usage goes up. I think it’s to do with the artwork display: I thought I deleted the image being displayed, but maybe I don’t. Before I update the image with a new one, I use the code:

        delete image of image view “Artwork”

(both times: when I replace the artwork in the main window, and the previous track drawer). However, unless I’m missing something else, this is where the leak is!

acronymmer.py final (?)

Taking into account the comments on PhotoMatt’s acronymit page (where I shamelessly stole some ideas, including the list of words!), I’ve modified acronymmer.py so that it:

  1. Does not apply <acronym> tags to instances that have been acronymmed already.
  2. Does not apply tags to instances that are inside href or title strings.
  3. Does not save the file if no changes have been made.

Here it is, including my current acronym list. (I know some of these are Abbreviations, but ecto, and some browsers do not handle this tag). Also, this code needs to be re-pasted - I was trying to make it (XHTML) valid, and it’s broken now.

    #! /usr/bin/env python
        
    'A script for ecto that adds abbr and acronym tags to the text'
        
    acronyms = {
    'WYSIWYG' : 'what you see is what you get',
    'XHTML' : 'eXtensible HyperText Markup Language',
    'IIRC' : 'if I remember correctly',
    'HDTV' : 'High Definition TeleVision',
    'LGPL' : 'GNU Lesser General Public License',
    'MSDN' : 'Microsoft Developer Network',
    'WCAG' : 'Web Content Accessibility Guidelines',
    'SOAP' : 'Simple Object Access Protocol',
    'OPML' : 'Outline Processor Markup Language',
    'MSIE' : 'Microsoft Internet Explorer',
    'FOAF' : 'Friend of a Friend vocabulary',
    'GFDL' : 'GNU Free Documentation License',
    'XSLT' : 'eXtensible Stylesheet Language Transformation',
    'HTML' : 'HyperText Markup Language',
    'IMAP' : 'Internet Message Access Protocol',
    'RAID' : 'Redundant Array of Independent Disks',
    'MPEG' : 'Motion Picture Experts Group',
    'JPEG' : 'Joint Photographic Experts Group',
    'CSTA' : 'Central Scorpions Touch Association',
    'CDDB' : 'Compact Disc DataBase (Gracenote)',
    'XBMC' : 'Xbox Media Centre',
    'VNC' : 'Virtual Network Computing',
    'URL' : 'Uniform Resource Locator',
    'W3C' : 'World Wide Web Consortium',
    'MSN' : 'Microsoft Network',
    'USB' : 'Universal Serial Bus',
    'P2P' : 'Peer To Peer',
    'PBS' : 'Public Broadcasting System',
    'RSS' : 'Really Simple Syndication',
    'SIG' : 'Special Interest Group',
    'RDF' : 'Resource Description Framework',
    'AOL' : 'American Online',
    'PHP' : 'PHP Hypertext Processor',
    'SSN' : 'Social Security Number',
    'JSP' : 'Java Server Pages',
    'DOM' : 'Document Object Model',
    'DTD' : 'Document Type Definition',
    'DVD' : 'Digital Versatile Disc',
    'DNS' : 'Domain Name System',
    'CSS' : 'Cascading Style Sheets',
    'CGI' : 'Common Gateway Interface',
    'CMS' : 'Content Management System',
    'FAQ' : 'Frequently Asked Questions',
    'FSF' : 'Free Software Foundation',
    'API' : 'Application Interface',
    'PDF' : 'Portable Document Format',
    'IIS' : 'Internet Infomation Server',
    'XML' : 'eXtensible Markup Language',
    'XSL' : 'eXtensible Stylesheet Language',
    'GPL' : 'GNU General Public License',
    'KDE' : 'K Desktop Environment',
    'STB' : 'Set Top Box',
    'MP3' : 'Mpeg Layer 3',
    'PVR' : 'Personal (Digital) Video Recorder',
    'GUI' : 'Graphical User Interface',
    'CLI' : 'Command Line Interface',
    'AAC' : 'Advanced Audio Coding',
    'IE' : 'Internet Explorer',
    'CD' : 'Compact Disk',
    'GB' : 'Gigabyte',
    'MB' : 'Megabyte',
    'KB' : 'Kilobyte',
    'TV' : 'TeleVision',
    'PC' : 'Personal Computer',
    'NSLU2':'[Linksys] Network Storage Link (USB) 2.0'
    }
    
    
    import sys, re
    data = open(sys.argv[1]).read()
    olddata = data
    
    # replace only the first instance of each acronym/abbreviation
    for each in acronyms:
        d = re.search(r'(?!<.*(title|href)='*>)?\b%s\b(?!(.*'>|</acronym>))' % each, data)
        if d:
            data = data[:d.start()] + '<acronym title='' + \
                   acronyms[each] + '>' + \
                   each + '</acronym>' + data[d.end():]
        
    if data <> olddata:
        open(sys.argv[1],'w').write(data)

Chapter Tool GUI

Apparently, Apple has a new tool for adding Chapter information to AAC files, but it is CLI only. I’ll write a wrapper GUI for it tonight, since Jaq is away, and I don’t need to go to bed tonight. But first, Chicken & Chips.

SubEthaEdit: Copy as XHTML

Man, this is cool. After reading about it on Fraser Speirs’ blog, I tried SubEthaEdit’s Copy As XHTML. (⇧⌘C) It is extremely good. See:

    #! /usr/bin/env python
        
    """A script for ecto that adds abbr and acronym tags to the text"""
        
    TODO = """
    Lookup on the internet for a list of acronyms/abbreviations?
    """

The only thing missing for me is the ability to paste this into ecto, and have ecto be able to edit it in Rich Text mode, rather than just HTML. (Oh, and I think my stylesheet is stopping the comment/string/keywords appearing in colour). Edit: No, it was an issue with double-quotes being escaped by a slash! I’m not sure what caused it, but it was annoying

composed and posted with ecto

TouchSA Job Opportunity

Project Officer - Communication & Game Development Touch football is one of South Australia’s favourite sports with 14 affiliated competitions running across the state which include large numbers of women and juniors. The state body is also responsible for the administration and management of its State and National representative programs. Due to changes in the management structure of the sport Touch SA has the opportunity to introduce the new position of Project Officer - Communication & Game Development. This newly formed position will be responsible for the daily running of the states largest competition City Touch situated in the Adelaide Parklands as well as working on other programs and projects being delivered by the state body. The successful candidate will possess the following qualifications and experience.

  • Demonstrated success in project management.
  • Demonstrated success in the delivery of sporting programs.
  • Excellent written and oral communication skills supported by interpersonal skills of a high order.
  • Demonstrated high level negotiation and facilitation skills.
  • Demonstrated experience and skills in volunteer management.
  • Demonstrated ability to consistently display customer services principles, practices and attributes.
  • Demonstrated initiative and self management.
  • Tertiary qualifications in sport management or related field desirable.

An information pack is available on the Touch SA website at: www.touch-sa.asn.au A remuneration package commensurate with qualifications and experience will be negotiated with the successful candidate. For further information contact Gavin Macdonald on 08 8373 3222. By close of business on Friday 15 July 2005, applicants should email a brief overview of their qualifications and experience as they relate to the selection criteria above, together with a resume containing contact details of referees to: Membership Services Manager South Australian Touch Association membershipservices@touch-sa.asn.au

Updated: acronymmer.py for ecto

I’ve improved acronymmer.py, my script for adding acronym tags to posts in ecto. It will work with any file, however, that is passed as an argument to the script. There is one issue with ecto, and that is that abbr tags are not recognised by the Rich Text parser, so I’ve just set it to convert tags to acronym only for the time being. (Note to Adriaan: You should fix this!) Don’t run this script over the same text twice: it will re-tag them, resulting in messy (but still legal) code. Also, this needs a little fixing: the dictionary of items needs to return keys in size order, rather than just randomly.

    #! /usr/bin/env python
        
    'A script for ecto that adds abbr and acronym tags to the text'
    
    import sys, re
        
    acronyms={'WYSIWYG':'What You See Is What You Get', 
              'DOM':'Document Object Model',
              'XHTML':'eXtensible HyperText Markup Language',
              'NSLU2':'[Linksys] Network Storage Link (USB) 2.0'
             }
        
    # get input data - depends on implementation.  For ecto:
    data = open(sys.argv[1]).read()
        
    # replace only the first instance of each acronym/abbreviation
    for each in acronyms:
        d = re.search(r'\b%s\b' % each, data)
        if d:
            data = data[:d.start()] + '&lt;acronym title="' + \
                   acronyms[each] + '"&gt;' + \
                   each + '&lt;/acronym&gt;' + data[d.end():]
        
    #return data to ecto
    open(sys.argv[1],'w').write(data)