Novel Ideas

Of course, by this I mean ideas for my next novel, not NEW ideas. Biology: Removal of junk DNA as part of creating the perfect soldier. Switching on our tail gene. Black Comedy: Person who kills people for their annoying habits/actions. Phone ringtones, 8 items or less, driving slowly in right lane. Historical Fiction: Eighteen Hundred & Froze to Death. The year Summer never came. (1816).

We Are All Made Of Stars • 18 • Moby

I ARE THE WINNER!

I got a phone call from a guy from TransAdelaide, or the Adelaide Metro, or something like that yesterday. I won the weekly draw, or monthly draw, or whatever; and won 2 tickets to paradise either the MotoCross or Monster Trucks at the Adelaide Entertainment Center mid August. Now, neither of these really appeal to me, but I’ll go anyway - I guess the fans expect me to… So, according to the email I received from them “YOU ARE THE WINNER!”. Luckily I was expecting it, otherwise I would have likely dumped it, since it looks an awful lot like a heap of the SPAM I’ve been getting lately.

Freecycle not fun anymore

I’ve been a member of the freecycle-adelaide list for a few months now - I’ve given away some stuff, and picked up a few good things, including a push mower. Recently, A Current Affair did a story on it, and now the list is filled with people asking for stuff. The moderator posted a message reminding everyone that you are supposed to only rarely ask for things, and must offer before asking for anything. I haven’t asked for anything - I see it as a way to use other people’s stuff they need to get rid of, not prompt someone to give stuff away. Anyway, I’m thinking about unsubscribing, as I had 78 new emails today, and 77 of them were either SPAM or [freecycle-adelaide] things. And not much there that was that interesting.

Stopping an Application from appearing in the Dock

To stop an Application appearing in the Dock under Mac OS X add the following to the Contents/Info.plist:

1
2
    <key>NSUIElement</key>
    <string>1</string>

Camino Changes

I use the fantastic Camino browser for MacOS X, and the latest update has something nice: better looking tab panels.

Things MacOS could learn from Windows

Apple Matters has a story about what MacOS should ‘borrow’ from Windows. I’ll address them as I see the issue.

  1. Compatible control keys. These should be called Modifier Keys, and I think Apple does a better job. Control-C is used by every variety of Unix ever for sending a break: I'd like to see this remain. And Command is in a better position for reaching with one hand to get all of the keys. Try to do a Ctrl-T, and then a Cmd-T. Plus, I can use my thumb for the Command key, meaning I can continue to use the correct finger. Cmd-Q, versus Ctrl-Q.
  2. Save buttons on toolbars. I rarely use the Save Menu, let alone the Print toolbar button. Cmd-S always saves. The only time I use buttons is if I don't know the keyboard shortcut.Multi-button mouse. Every multi-button USB mouse I have ever tried worked first time. Even those that needed a driver for Windows. Like the wireless one that came with my Dell. Trying to use this with another computer without the software installed was hopeless - I had to use the Apple mouse instead. But yes, I'd like to see an Apple styled multi-button mouse.
  3. Only show relevant file types in open and save dialogs. I actually hate that Windows never shows all of the files it can see - Word sticks to only showing Word documents and not Plain Text files by default. And, every time a beginner uses Windows, and uses Excel for the first time instead of Word, they think they've lost all of their files. And freak out.
  4. Sort folders on top of directory listings. I'd be surprised there isn't a hidden setting using defaults for this one. Yes, I agree.
  5. More context sensitive help. Actually, my take on this is get rid of the stupid help key on the keyboard. I've hit this more times than I care to remember when I go to hit Delete. And then Help opens up, telling me stuff I already knew, and not deleting what I wanted to delete.
Overall, I disagree with just about everything said in the article.

How long have you iTunes-d?

I like the bit that appears at the bottom of iTunes, telling you how much music you have in your collection (or in the current playlist). iTunes Library Size I thought it might be fun to see how much music I had listened to. As it turns out: 5883 songs, 17:13:27:05 total time. Here is the script I wrote to find it out.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    #! /usr/bin/env python
    
    import Foundation
    import os
    
    library =  os.path.expanduser('~/Music/iTunes/iTunes Music Library.xml')
    
    db = Foundation.NSDictionary.dictionaryWithContentsOfFile_(library)
    tracks = db[u'Tracks'].itervalues()
    
    timecount = 0
    playcount = 0
    
    for track in tracks:
        try:
            timecount = timecount + track[u'Play Count'] * track[u'Total Time']/1000
            playcount = playcount + track[u'Play Count']
        except KeyError:
            pass
    
    days, timecount = timecount / (60 * 60 * 24), timecount % (60 * 60 * 24)
    hours, timecount = timecount / (60 * 60), timecount % (60 * 60)
    minutes, seconds = timecount / 60, timecount % 60
    
    print '%i songs, %i:%02i:%02i:%02i total time' % (playcount, days, hours, minutes, seconds)

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    #! /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.