Daring Fireball: About the Footnotes

Daring Fireball: About the Footnotes John Gruber talks about the use of footnotes in blog posts. What strikes me as a good way to do stuff is to have a multi-line abbreviation-style tag, that floats over the text where the pointer is when hovering.1

iTunes Library Checker 2.0

I’ve rewritten most of iTunes Library Checker to use some neater import code, it should also be a bit faster. Not quite complete yet, but close to the previous functionality.

    #! /usr/bin/env python
    
    import Foundation
    import os
    import struct
    
    library =  os.path.expanduser('~/Music/iTunes/iTunes Music Library.xml')
    db = Foundation.NSDictionary.dictionaryWithContentsOfFile_(library)
    libpath = Foundation.NSURL.URLWithString_(db[u'Music Folder']).path()
    
    tracks = db[u'Tracks'].itervalues()
    
    findstr = "find '"+libpath+"' -type f -not -name .aacgained -not -name ._* -not -name .DS_Store | sort"
    treedata = os.popen(findstr).readlines()
    
    missing = []
    other = []
    missing_files = []
    other_files = []
    surplus = treedata[:]
    
    for track in tracks:
        location = Foundation.NSURL.URLWithString_(track[u'Location']).path()
        if not os.path.exists(location):
            missing.append(track)
            missing_files.append(str(location))
        else:
            try:
                surplus.remove(str(location)+'\n')
            except ValueError:
                other.append(track)
                other_files.append(str(location))
        
    missing_files.sort()
    other_files.sort()
    surplus.sort()
    
    open('surplus.txt','w').writelines(surplus)
    open('missing.txt','w').writelines(missing_files)
    open('other.txt','w').writelines(other_files)

Simpler iTunes Library Checker

I posted some code exactly a month ago, then I find this. I will rewrite the code so it is simpler, using the MacOS hooks that come with PyObjC.

Deeper iTunes Data

I came across an interesting question today: Why doesn’t iTunes store all of the data about each time a song is played? And also, how much of the song was played? It should be easy to write a daemon that monitors iTunes, and writes this data to a database. This database can then be cross-referenced against the iTunes database for a comprehensive breakdown of when songs are played. You can then find all of the songs that you listen to at a certain time of day, or season, and so on. You can also have a ‘how-often-played’, but cross referencing the Date Added attribute with the Play Count and so on. I’ve already started to write this program, but it will likely be MacOS X only.

How Accurate is the iTunes Counter?

I got a comment to a post that had nothing to do with iTunes. Whilst it wasn’t a particularly helpful or nice comment, I thought maybe I can answer the question I think he’s asking. (Unless he’s talking about the iTunes Music Store counter that shows how many songs have been bought for the latest contest…). Wach time you finish playing a song, the Play Count field is incremented, and the Last Played date is updated. If you skip a song before listening to the entire track, neither of these are updated. There are some scripts around for MacOS AppleScript that will update a Play Count and Last Played if you listen to more than a certain amount of a track. I could also add the same feature to iTunes Rater. But I don’t really use Play Count and Last Played that often, anyway.

Still No Joy (XML-RPC)

I’m still not able to post with ecto on Blogsome: some of the functionality is there, but I get an error on posting. I might try MarsEdit or something else and see if that works, as w.bloggar does, apparently. I’ve also stopped using Dvorak keyboard layouts, as it takes too long to learn to type, and I hate not being able to keep up with my thoughts.

Poaching Eggs

I read about some guy’s aim to poach an egg. It’s much simpler than this: just boil some water in a saucepan, with a little white vinegar added. When boiling, stir the water gently and break the egg into the pan. Use a slotted spoon to keep the shape, and to remove the egg when done. When you get good at it, you can try more than one egg at a time. (Not many words here due to Dvorak layout.)

Dvorak Keyboard Layout

Back in the heady days of BeOS, I at one stage taught myself how to type reasonably well using a Dvorak keyboard. I’ve clearly forgotten most of it. This was typed (slowly) on a Dvorak layout. I am getting faster, and more accurate, though. Using the CLI program dvorak7min will get me back up to speed soon, I hope.

Blogsome XMLRPC issues

I cannot post via ecto, or any other offline client at the moment: Blogsome has disabled XMLRPC support, due to a security issue. Since they use Multi-User WordPress, there is not fix for this build as yet.

Bad Coffee

I had possibly the worst cup of coffee I’ve ever had the other night. “Le Bon”, in the southern (station) end of the Adelaide Railway Station Underpass, sells coffees for $2.20, which is much less than most other places. But, you do get what you pay for. This was worse than instant coffee. And, it was so hot it burned the crap out of my tongue. Even then, I could still tell just how putrid this was. By that stage, I was on the train, so I had to hold on to a full cup of woeful coffee for 20 minutes, and once I forgot just how bad it was and took a sip. Don’t ever buy coffee there. Ever.