Jan 29 2010

iBad: The FSF Kool-Aid and Other Dystopian Hallucinations

The people who worry that the iPad will bring about a dystopian future for home computing keep forgetting something: for the rest of humanity, their ideal world of perfectly hackable machines is already a dystopian nightmare. It’s a world in which nothing works without spending hours setting it up, in which basic features are missing while the manual lists thousands of irrelevant options, in which a million hardware extensions are available for their machine, but none of them help to solve a single one of their day-to-day problems. While being something of a hacker myself, I feel that the hacker’s vision of totally open computing probably should become a niche market, in much the same way that chemistry sets represent a niche market. The fact that not every person has a set of tools in his house that, by default, allows him to conduct arbitrary chemistry experiments has not substantially slowed down the progress of chemistry from what I can tell. The arrival of a world in which the most popular computers are closed to arbitrary hardware extensions and all applications are required to run within a sandbox probably won’t slow down the progress of personal computing much either.

Hackers of the world, your priorities are not simply different from the average user’s: they often represent a direct attack on the average user’s preferences. You keep asserting that you have the normal person’s interests in mind, but I think you’re often simply concealing your own self-interest underneath politicized rhetoric about freedom and openness.


Nov 20 2009

Cleaning Up an iTunes Library with MacRuby

For a little more than a year now, I’ve been meaning to write a script to rename all of the files in my iTunes library so that they’re in proper English title case. In large part, this project was inspired by reading John Gruber’s post about a Perl script that he’d written to convert text strings into title case programmatically. After reading Gruber’s post, I grabbed a copy of Sam Souder’s translation of Gruber’s Title Case script into Ruby and set about trying to use it as part of a home-grown Ruby script to clean up my iTunes library. During my first pass, I tried to combine Sam’s convenient utility method with RubyCocoa to produce a script that could access the iTunes methods directly and rename my files automatically without editing the MP3 files directly. Unfortunately, the RubyCocoa documentation was too sparse at the time for me to figure out the relevant method calls to be making.

Thankfully, I spent some time this week reading the MacRuby documentation and realized in the process how to write my desired script. The results are now on GitHub. The only original bit of code is below:

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
#!/usr/bin/macruby
 
# We iterate over every track, stripping bounding whitespace and putting things into proper title case.
 
require 'titlecase'
 
framework 'cocoa'
 
load_bridge_support_file 'ITunes.bridgesupport'
 
framework("ScriptingBridge")
 
itunes = SBApplication.applicationWithBundleIdentifier("com.apple.itunes")
 
music_playlist_tracks = itunes.sources.objectWithName("Library").userPlaylists.objectWithName("Music").fileTracks
 
music_playlist_tracks.each do |track|
  old_artist = track.artist
  new_artist = track.artist.strip.titlecase
  if old_artist != new_artist
    track.artist = new_artist
    puts "Artist: #{old_artist} => #{new_artist}"
  end
 
  old_album = track.album
  new_album = track.album.strip.titlecase
  if old_album != new_album
    track.album = new_album
    puts "Album: #{old_album} => #{new_album}"
  end
 
  old_name = track.name
  new_name = track.name.strip.titlecase
  if old_name != new_name
    track.name = new_name
    puts "Name: #{old_name} => #{new_name}"
  end
end

Outside of this little snippet of MacRuby code that I had to write, I made two small changes to Sam Souder’s original code:

  1. I defined a titlecase method for the NSString class rather than the String class.
  2. I pulled the list of English prepositions out of the main code and put it into a separate YAML file to make it easier for a non-programmer to edit the list.

I know from experience with checking the results in a half gleeful and half paranoid frenzy that this code works properly on my own two machines, both of which are running MacRuby 0.5. That said, I won’t vouch for the reliability of this program in any way. If you notice any bugs, please do let me know, so that I can fix my own iTunes library with a revised version of the script.


Nov 11 2009

Two of Unison’s Quirks

As many people know, I adore the program Unison. That said, Unison has its fair share of quirks. Today I found myself confronting one that I had spent a whole day confused by about a month ago.

Unison stores a cache of information about the file system for every directory that it synchronizes. On Macs, this caches lives in ~/Library/Application Support/Unison/. What you need to know is that this cache must either be absent on both the client and the server or it must be present on both. If it gets deleted on one but not the other, Unison hangs indefinitely without producing any error messages when you try to synchronize the directories again. Suffice it to say, this is confusing.

Possibly this quirk is already fixed in newer versions, but I’ve had trouble compiling Unison recently, so I’ve left that task for the future. In the meantime, the other quirk that irks me is the inconsistency in the icons used by the Mac GUI. Sometimes a top level element in the GUI represents a folder and sometimes it represents a single file inside of a folder. I think that a cleaner GUI would simply render a folder with nested files every single time you had a discrepancy between the client and server — even if the discrepancy is a single file. Changing the meaning of items at the same spatial positioning seems to produce a Stroop effect for me — and I suspect for others as well.


Oct 11 2009

iPhone SSH Clients

Lately I’ve been doing a lot of my work over an SSH connection. I therefore decided that I should finally invest in an iPhone SSH client. After looking at pTerm, TouchTerm and iSSH, I decided that I should purchase iSSH. I have to say that this was one of the better app purchases I’ve ever made. What makes an SSH client app so valuable is not the ability to log in to one of my servers remotely per se, but rather that this ability provides me with a workaround for the most burdensome of the iPhone SDK’s clauses: the prohibition of language interpreters. By logging in to a remote machine over SSH from my iPhone, I can now write R and Ruby programs while I’m on the train. This is a major gain for my productivity, as I’d formally been reduced to programming on my iPhone using notes that I would e-mail to myself and debug hours after originally writing them.

On another note, I also bought the game Canabalt recently, which may be the best iPhone game that I’ve ever played. If you want to convince yourself of its brilliance, you can play a Javascript version of it for free online.


May 14 2009

Mac OS X 10.5.7 Observation

Is it just me or does the Dock respond much more smoothly under 10.5.7 than under 10.5.6?


Dec 26 2008

Making the Most of My Mac

For literally years I’ve been meaning to write a post about my favorite programs and utilities for the Mac, but I’ve always managed to put it off. Given that I recently sent my girlfriend my old Powerbook, I thought that I should finally write down a list of the programs and tools that I’ve found worth having as a Mac user. This list is definitely idiosyncratic — with a heavy bias towards programming and scientific tools –, but I think that there are still a lot of very good programs on this list that do not always get as much publicity as they deserve. All that said, here’s my list.

1. Adium: The best chat client for the Mac that I’m aware of. I use it as a client for GMail chat, AIM and MSN. I’d use iChat if it worked with all of those services as well as Adium does, but it just doesn’t as far as I can tell. There are things that iChat does that Adium can’t do — e.g. video chat –, but I don’t have any use for those features. I could also use the AIM and MSN programs provided by AOL and Microsoft, but I much prefer a single integrated program over several separate programs. (site)

2. Caffeine: A simple little program that keeps your Mac from going to sleep, turning off the monitor or activating the screen saver. Very useful when you’re giving presentations. (site)

3. Carbon Emacs: The only build of Emacs that I find reliably renders the keys on my Western Spanish keyboard. It is also the only one that seems to respect traditional Emacs key bindings, which is very important to me. (site)

4. Cubase: My favorite music composition software for the Mac. Cubase is well-deservedly famous as a MIDI sequencer and I’ve found that it’s equally good as a multitrack audio recording system. I use it along with a Toneport UX2 to record guitar and Superior Drummer 2.0 for drum tracking, and I’ve gotten great results so far. (site)

5. Cyberduck: The FTP/SFTP client I use. I’m sure there are better tools than Cyberduck (such as Transmit 3), but Cyberduck is free and does the job more than well enough for my needs. (site)

6. Delicious Library: A program to help you keep a record of all of the books, DVD’s and CD’s you own. I find it especially useful for keeping track of the books I lend to people. (site)

7. Flickr Uploader: If I’m going to upload a lot of photos to Flickr, I really don’t want to have to use a Web interface. Flickr Uploader lets me do all of the editing on my machine and then send the labelled and tagged photos as a single group to Flickr. Most importantly, the progress I’ve made in tagging photos isn’t lost when my Internet connection flakes out. (site)

8. Gimp: I’m too cheap to buy Photoshop, but the recent builds of Gimp for the Mac work well enough for my purposes. (site)

9. Graphviz: If I have to draw any sort of graph, I always use Graphviz. It’s a great interface to compilers for the DOT language developed at Bell Labs to describe graphs. If you can program at all and ever need to write up flowcharts or diagrams of any sort, I think Graphviz is the way to go. You should also know that the Pixelglow build for Macs is much better than the default. (site)

10. Growl: Growl provides one of those clever little hacks to the basic Mac user interface that Windows users always find impressive: it creates a service for displaying notifications on your screen that quickly fade away after you’ve seen them. But the truth is that Growl’s usefulness is only obvious after you’ve used it for a while. (site)

11. Handbrake: The best video transcoder I know of for the Mac. Whenever I need to change one video format into another, Handbrake’s been able to do it for me. (site)

12. Hazel: Another great service for Macs: install Hazel and you have a simple daemon that will regularly move files according to a set of rules you define yourself. I use it to sort every file on my desktop into folders specific to filetypes — moving MP3’s to one folder and PDF’s to another. It’s been a major part of my efforts to be more organized with my files. (site)

13. KeePassX: A password manager that I find very helpful for navigating the mass of passwords I need to remember without leaving the passwords as plain text anywhere on my system. (site)

14. MacFreePOPS: A simple little program that will let you access your Hotmail account from Mail as if it were a POP server. Extremely useful. (site)

15. MacFUSE: Probably the most impressive of all of the hacks created by the Mac user community. MacFUSE allows you to install new file system drivers that run entirely in user space. The result is that you’ll get easy access to NTFS (i.e. Windows) hard drives and a slew of other formats. I think everyone should put MacFUSE on their machine the day they buy it. (site)

16. Mac The Ripper: If I need to make a copy of a DVD I’ve made, Mac The Ripper makes it much easier for me to do so. Unfortunately only the older version is still freely distributed, but it works for most DVD’s. (site)

17. MarsEdit: Just as I don’t like using a web interface to upload photos to Flickr, I don’t much like using one when writing blog posts. So I do all of my writing in MarsEdit, which then handles uploading my finished posts to my server. (site)

18. Mathematica: I use Mathematica fairly frequently when I want to get a quick sense of how functions behave or when I need to evaluate an integral I’ve forgotten how to solve by hand. (site)

19. Matlab: If I need to do a lot of basic number crunching involving matrices, I always use Matlab. Additionally, I tend to use it along with PsychToolBox and DotsX for coding experiments in neuroscience and psychology. (site)

20. MySQL: I always use MySQL as the database system for every dynamic web site I build. It works perfectly on Mac OS X these days, so I tend to demo things on my own machine before moving them off to a stand-alone server. (site)

21. NetNewsWire: My favorite RSS reader for the Mac. I can’t speak highly enough of NetNewsWire’s interface or the fact that the iPhone application is just as great as the desktop version. (site)

22. OpenOffice: Again, I’m too cheap to buy a copy of Office, so I use OpenOffice. It’s managed to serve me pretty well so far. It’s still a little lacking on the Mac, but it’s getting much better with time. (site)

23. Papers: My means for storing and organizing all of my PDF files. Think of it as iTunes for PDF’s. If you read journal articles, Papers will improve your life more than you could possibly expect. (site)

24. Perian: Perian will outfit your Quicktime player with almost all of the codecs you could want. Without it, I find Quicktime almost useless. (site)

25. Perl: The classic programming language needs no introduction, but I think it’s worth noting that you’re always better building your own version of Perl and storing it in /usr/local/, where you won’t be able to destroy the version that OS X ships with by default. I’ve also found it nearly impossible to get many modules to build without some customization. (site)

26. Python: Again, I don’t think Python needs an introduction, but building your own copy seems like a very good idea to me. (site)

27. Quicksilver: A great tool for getting easy access to programs. I don’t use nearly as many of Quicksilver’s features as a lot of people do, but I find it really helpful to be able to avoid using Finder when I don’t need to. (site)

28. R: My language of choice for statistical computing and data analysis. Great tools for producing graphs and an amazing set of facilities for any statistical computation you could ever want to perform. If you want to do statistics like a grown up statistician would, R is the way to go. (site)

29. ReadIris: My favorite OCR software for the Mac. I use this every time I want to copy a long section of text I’ve scanned. I invariably have to make corrections by hand, but that’s much faster than typing everything myself from scratch. Given how well ReadIris performs for me, I have high hope that one day in my life we’ll see a properly Bayesian piece of OCR software that gets everything right. (site)

30. Ruby: Another programming language that needs no introduction, but which I’d recommend building from source and storing in /usr/local. (site)

31. ScreenFlow: The best screencasting software for the Mac I could find. Given the number of features, the quality of the interface and its relatively low cost, I doubt one could find something better for a few years to come. (site)

32. Scrivener: An amazing application that makes writing extended works (for me those are mostly translations) much, much easier. I don’t use it as often these days, but Scrivener is a brilliant tool if you do a lot of writing that can be broken into sections and outlined carefully. (site)

33. ScummVM: When I’m not working, I like to play some old LucasArts games. ScummVM makes that possible. (site)

34. Senuti: If I need to transfer a file off of an iPod (which iTunes makes impossible), Senuti is there for me. It was free for a long time, so I’m somewhat surprised to find that you’re supposed to pay for it now. (site)

35. Sequel Pro: My favorite database client system. The heir to the great CocoaMySQL application. A perfect compliment to MySQL on the Mac. (site)

36. Skype: Who doesn’t use Skype as their VoIP program? (site)

37. TexLive: When I want documents to look clean, I always use LaTeX. TexLive is the current standard distribution of LaTeX for UNIX systems and it has some great tools specifically made for the Mac. (site)

38. TextMate: They claim it, and I agree: TextMate is Emacs for the 21st century. If you are young enough that you find GUI’s helpful and don’t think touching the mouse is a crime against nature, TextMate is the best text editor you will ever find. Every Rails person worth his salt is a TextMate user and there is an endless supply of bundles to customize TextMate for the language of your choice. (I’ve recently used it a lot with Matlab, R and Erlang.) (site)

39. The Unarchiver: If you’ve ever received a compressed file you couldn’t open, get The Unarchiver and your problems will be solved. Everything else is a waste of time and/or money. (site)

40. Twitterific: My favorite Twitter client for the Mac. (site)

41. Unison: Probably my single favorite tool for the Mac. Unison lets my keep all of the files that matter to me in perfect sync between my laptop and my desktop. In practice, that amounts to a brilliant back-up system as well as making my life incredibly easier when I do some work on my laptop and then some more work on my desktop. In the end, Unison seems to be the program destined to replace rsync one day. (site)

42. VLC: The system I always use to watch anything that doesn’t open in Quicktime with Perian installed. (site)

43. VMWare Fusion: Sometimes I need to run Windows or Linux. VMWare Fusion makes it incredibly easy to do so and runs both of those operating systems with remarkable efficiency. (site)

44. Zenmap: If I need to figure out the structure of the network I’m on, nmap is the tool for doing so. Zenmap provides nmap for the Mac and also a (sometimes) helpful GUI. (site)


Aug 30 2008

Negative Items Left to Delete under Mac OS X Leopard

Until today I’ve felt that, at this point, Leopard has been patched enough to be relatively bug free. While transferring files across my home network today I changed my mind, because I found that the number of files left to delete that’s shown in progress dialogues can become negative. You can see what I mean below:

-2593_Items.jpg

And just to make clear that the first number isn’t a one-time fluke, here’s another shot of the same progress dialogue a second later:

-3697_Items.jpg

I’m not entirely sure what caused the negative count: most likely it was the very large number of small files that had to be deleted. I’d bet that the number was originally underestimated when the delete operation began, and that, when more files were found later, this took the count of remaining files beyond 0 into the negative integers.

Personally, I find this a little worrisome.


Jan 21 2008

Bug Still Present in iPhone 1.1.3 Firmware

The bug I complained about on January 12, 2008 is still present in the recently updated iPhone firmware, version 1.1.3. Perhaps 1.1.4 will solve the problem.


Sep 26 2007

Oscar Wilde Dashboard Widget

I loved my Oscar Wilde widget and its endless supply of clever snipes at human pretense, but I discovered today that it was using, by itself, a full 250MB of memory to run. Has anyone else ever used the widget and seen this kind of memory use? I almost suspect virus-like behavior with that amount of memory being committed to one widget. Or is it simply a very severe memory leak coupled with excess caching? Does anyone know about this? Because I could find not information about this on Google, I have no plans to run the widget ever again, but I would like to.

And to think that people are so indignant about the Wordpress modifications.