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! 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 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.

 1    #! /usr/bin/env python
 3    'A script for ecto that adds abbr and acronym tags to the text'
 5    acronyms = {
 6    'WYSIWYG' : 'what you see is what you get',
 7    'XHTML' : 'eXtensible HyperText Markup Language',
 8    'IIRC' : 'if I remember correctly',
 9    'HDTV' : 'High Definition TeleVision',
10    'LGPL' : 'GNU Lesser General Public License',
11    'MSDN' : 'Microsoft Developer Network',
12    'WCAG' : 'Web Content Accessibility Guidelines',
13    'SOAP' : 'Simple Object Access Protocol',
14    'OPML' : 'Outline Processor Markup Language',
15    'MSIE' : 'Microsoft Internet Explorer',
16    'FOAF' : 'Friend of a Friend vocabulary',
17    'GFDL' : 'GNU Free Documentation License',
18    'XSLT' : 'eXtensible Stylesheet Language Transformation',
19    'HTML' : 'HyperText Markup Language',
20    'IMAP' : 'Internet Message Access Protocol',
21    'RAID' : 'Redundant Array of Independent Disks',
22    'MPEG' : 'Motion Picture Experts Group',
23    'JPEG' : 'Joint Photographic Experts Group',
24    'CSTA' : 'Central Scorpions Touch Association',
25    'CDDB' : 'Compact Disc DataBase (Gracenote)',
26    'XBMC' : 'Xbox Media Centre',
27    'VNC' : 'Virtual Network Computing',
28    'URL' : 'Uniform Resource Locator',
29    'W3C' : 'World Wide Web Consortium',
30    'MSN' : 'Microsoft Network',
31    'USB' : 'Universal Serial Bus',
32    'P2P' : 'Peer To Peer',
33    'PBS' : 'Public Broadcasting System',
34    'RSS' : 'Really Simple Syndication',
35    'SIG' : 'Special Interest Group',
36    'RDF' : 'Resource Description Framework',
37    'AOL' : 'American Online',
38    'PHP' : 'PHP Hypertext Processor',
39    'SSN' : 'Social Security Number',
40    'JSP' : 'Java Server Pages',
41    'DOM' : 'Document Object Model',
42    'DTD' : 'Document Type Definition',
43    'DVD' : 'Digital Versatile Disc',
44    'DNS' : 'Domain Name System',
45    'CSS' : 'Cascading Style Sheets',
46    'CGI' : 'Common Gateway Interface',
47    'CMS' : 'Content Management System',
48    'FAQ' : 'Frequently Asked Questions',
49    'FSF' : 'Free Software Foundation',
50    'API' : 'Application Interface',
51    'PDF' : 'Portable Document Format',
52    'IIS' : 'Internet Infomation Server',
53    'XML' : 'eXtensible Markup Language',
54    'XSL' : 'eXtensible Stylesheet Language',
55    'GPL' : 'GNU General Public License',
56    'KDE' : 'K Desktop Environment',
57    'STB' : 'Set Top Box',
58    'MP3' : 'Mpeg Layer 3',
59    'PVR' : 'Personal (Digital) Video Recorder',
60    'GUI' : 'Graphical User Interface',
61    'CLI' : 'Command Line Interface',
62    'AAC' : 'Advanced Audio Coding',
63    'IE' : 'Internet Explorer',
64    'CD' : 'Compact Disk',
65    'GB' : 'Gigabyte',
66    'MB' : 'Megabyte',
67    'KB' : 'Kilobyte',
68    'TV' : 'TeleVision',
69    'PC' : 'Personal Computer',
70    'NSLU2':'[Linksys] Network Storage Link (USB) 2.0'
71    }
74    import sys, re
75    data = open(sys.argv[1]).read()
76    olddata = data
78    # replace only the first instance of each acronym/abbreviation
79    for each in acronyms:
80        d ='(?!<.*(title|href)='*>)?\b%s\b(?!(.*'>|</acronym>))' % each, data)
81        if d:
82            data = data[:d.start()] + '<acronym title='' + \
83                   acronyms[each] + '>' + \
84                   each + '</acronym>' + data[d.end():]
86    if data <> olddata:
87        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:

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

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: 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