Wednesday, October 13, 2010

Removing the crap from iTunes 10.0.1

I use iTunes to play music on my osx laptop, though I have been very disappointed with the latest updates to iTunes. It seems that apple thinks that I want to be a part of yet another social network and thus has enabled "Ping" on my iTunes account.

First thing I did was to "opt-out" of ping (wtf Apple, these things should be opt-in), a quick Google search reviled that it is fairly easy to do (after you agree to their new terms and conditions of course). Though even after I did this, the iTunes interface is still littered with crap about Ping (including the new side bar that was added with 10.0.1). It seems that you can removed these with a quick jump into Terminal.app with the following commands:
defaults write "com.apple.iTunes" "disablePingSidebar" -bool "TRUE"
defaults write "com.apple.iTunes" "hide-ping-dropdown" -bool "TRUE"

I also discovered that you can get the minimize/zoom/exit buttons back with some other plist values:
defaults write "com.apple.iTunes" "full-window" -boolean "YES"

While I am at it, if you want to disable to links to the itunes store from next to your songs, you can use this option:
defaults write "com.apple.iTunes" "show-store-arrow-links" -bool "FALSE"

Don't forget to restart iTunes after you have made these changes.

Wednesday, March 3, 2010

Making the switch to xmonad (on ubuntu)

I have been using xmonad under unbuntu for nearly a year now (and have been VERY happy). I thought it was finally time that I share my method for configuring/setting up xmonad.

I run xmonad under gnome, this allows a lot of the magic of Ubuntu to continue working (such as network manager configuring wifi), and helps keep the amount of manual configuration down to a minimum.

Monday, January 4, 2010

NCSS Python Golf

It is time again for me to run a Python Golf challenge... The aim? To write a python program that solves a problem in the least number of bytes (of source code).

The first of a few problems is:

Given a list of words on stdin (one per line), find the words that have the largest number of anagrams in that list.

Print all of the words that have the meet the criteria of having the largest number anagrams (One per line, in alphabetical order).

This competition has now finished. The winner was Nick Cooper at 103 bytes, with the following awesome solution:
import sys
s=sorted
o=s(sys.stdin)
r=map(s,o)
d=map(r.count,r)
for e,t in zip(o,d):print e*(max(d)==t),