What is the opposite of iTunes Genius?

I didn’t realise until today that there was a part of iTunes Genius that makes suggestions when browsing the iTunes store.

I went to click on one item, and got:

Now, why would you go and recommend something you can’t give me? That is just plain mean!

Python Line Continuations

Using TextMate, it is very easy to get snippets and commands to do things that you often do. However, the python bundle is a bit lacking, and this is a great opportunity to improve that.

I’ve created a Command that will enter a newline, and if not inside a list, function call, dictionary or multi-line string, automatically add a trailing .

I’ve hooked it in to the Enter key, and the other settings can be seen in the screenshot below:

The actual code follows:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/usr/bin/env ruby

scope = ENV['TM_SCOPE'].split

no_trail = ['punctuation.definition.arguments.end.python',
            'meta.structure.list.python',
            'meta.structure.dictionary.python',
            'string.quoted.single.block.python',
            'string.quoted.double.block.python']

print (scope & no_trail) == [] ? "\\\n" : "\n"

SCM workflow in TextMate

I’m loving coding in TextMate - it makes ruby much more fun. And python, too.

It integrates really well with heaps of other tools, including my diffing app of choice (Changes.app), and my preferred DVCS (Mercurial).

It even has its own Commit pane that appears when you choose to commit. There is one problem with it, however. Invariably I have made a change to a file and can’t remember exactly what it was. You can’t view the changes using the Mercurial bundle and Changes, and leave that window open while you commit. So, I end up having a terminal window open that I type hg chdiff into.

Instead, we should be able to quickly see the changes made to the working copy. Perhaps using a button like below:

Of course, that’s just a mockup (although it is done in IB) - the button is not connected up to anything. I have no idea how to reverse engineer the Commit.app to do this. But it would be cool.

Update: It appears all you have to do is tell the CommitWindow.app tool that you want to use --diff-cmd "hg,diff", and it is all done.

Dr Seuss

Dr Seuss.png

Safari 4 Busy Icon

The active tab looks wrong.

Inactive tabs not so much.

Safari_Loading_icon.png

Limiting SQL Alchemy queries

Note for future reference: especially since the data migration script I was running today was running out of memory and crashing.

You can use slice notation, which limits the query:

>>> for p in db.query(Person)[:10]:
...   print p

This rocks.

Star Wars Videos

Star Wars: Retold (by someone who hasn’t seen it) from Joe Nicolosi on Vimeo.

Star Wars: The Crazy Ones (via retrophisch).

Jailbait

Jailbait.png

Songsmith

Finally, Microsoft put out something worth downloading, and it won’t install on my VMWare machine:

Songsmith.png

Goals for 2009

What am I hoping to achieve in the coming year?

  • Learn two new languages: at this stage it looks like it might be two of Haskell, Ruby and Icon. Probably the first two.
  • Play in the National Touch League. Over 30s, but still the highest competition in the world.
  • Finish this degree, start the next. I’m hoping to get a headstart on my Honours degree, if they’ll let me.
  • Release some OS X software. I have three commercial programs in various stages of completion. I’m hoping to get one of them done and released.
  • Build a vegetable garden. Got the beds planned out - just need to make them.
  • Learn to type using a Dvorak key layout.
  • Reread SICP

I’m sure I’ll think of more things than this…