Diff-ing commands on Mac

There are several tools to compare files for changes out there for Mac OS X. I’ll cover a few here. The first and most basic is diff. From the command line, it looks like this:

diff -u old_file new_file

Where of course old_file is the old suspected filename, and new_file is the new one. This will give you a quick glance at what is new. Each line of difference in the new file will be preceded by a plus (+) symbol, and each difference in the old one will be preceeded by a minus (-) Last saved timestamps will appear at the very top of the output.

A cool trick – if you use TextMate, you can pipe your diff output to it and take advantage of TextMate’s fancy-schmansy code coloring:

diff -u old_file new_file|mate

Shift + Control + Option switches Textmate to the Diff bundle, and Shift + Control + Command + D will give you access to the context menu for all of the diff commands. Great for you Lightning Ruby Ninja™ coders out there who insist on never letting the tips of your fingers leave your keyboards.

If you have the XCode Developer Tools installed, you get a second option installed: opendiff, laced with a GUI app called FileMerge:

opendiff old_file new_file

What is cool about this is that if you run opendiff from the command line, FileMerge takes over and shows you your differences with sexy Mac-ness, replete with an array of search and code merging commands at your disposal. That’s hot.

If you like BBEdit, and who doesn’t, you have bbdiff at your disposal too:

bbdiff old_file new_file

BBEdit has a file comparison and merging utility built in which does not suck at all.

Extra Coolness for Dreamweaver users: Select opendiff or bbdiff in your prefereces to compare files with their corresponding GUIs this way:

  • Dreamweaver > Preferences > File Compare
  • Click Browse
  • Select bbdiff or opendiff from the file dialog, click OK, and enjoy.

Lusty. So there’s a few options for finding out what your colleague did to break your perfect code. Happy diff-ing!


I am a recent convert to Last.fm, but know that this has been a long time coming.

I have hit Last.fm many times since they launched. But I always found it, well, kind of useless in the past. I wasn’t grabbing very useful recommendations, and the usability of the software client and the website were lacking in my opinion. Cut to many months later, and something appears to have changed. The content of this site appears to have improved since last I checked – more music of the type I was looking for. Probably the root cause of my problems before was that I have a masters in music performance on a bizarre instrument known as the double bass, with tastes that includes baroque lute music, north Indian classical music, Charles Mingus, and Nine Inch Nails. Suddenly where before things appeared kind of barren in the eclectic world, some critical mass has been reached to the point where I am finding music I am interested in, and the mind of this thing is able to make reasonable recommendations to feed my insatiable consumption of new things to hear. This is the good part.

However, there is a bad part. Their widgets are a hideous bluk of code. I so wish they would just make ’em 100% Flash or something so I could do some sort of standards-compliant embed mode that had a bit more architectural beauty than this behemoth:

(Note – the widget that was here has been redacted because I couldn’t stand looking at the HTML validation errors that appeared here every single time I visited my own website. Please visit my playlist on last.fm instead.)

It pained me to post that. Sure it looks and works great in a nice big browser, but I’m sure this is going to suck on my iPhone and embedding all that inline design cruft and HTML table junk was heartburn-inducing. 100% Flash would have been nice. Or better, just an MP3 stream URL. Well, it is a cool widget and all, but it just seemed like a lot of code…

In addition, the site itself seems to be a bit much. I think less features would make it more usable, but it’s hard to take things back once they’re out there. There should be an add to playlist button or something in the player when viewing a single track web page rather than leaving it in the left column. Recommending tracks to others in my network should be easier – a select menu or type-ahead autocomplete feature rather than having to go look up or memorize everyone’s user IDs.

But on the whole, this is the most interesting music-related website I’ve seen yet. I’ve been addicted to it for the past few days now and really think this one is a hit.

Key Points on Practicing Music

As I work on my research for my final project, I came across this gem from “The Science and Psychology of Music Performance: Creative Strategies for Teaching and Learning” by Parncutt & McPherson. If you are a practicing musician or a teacher trying to motivate your students to practice, these points are really worth taking to heart:

  • Engage in metacognition—become mindful about practicing and related physical and mental processes. Be consciously aware of your own thought processes.
  • Approach practice systematically. Do not go about practice haphazardly. Practice is more effective when it is structured and goal-oriented.
  • Engage in mental practice (cognitive rehearsal) in combination with physical practice.
  • Invest time in score study and analysis, particularly when beginning a new piece.
  • Plan regular practice sessions with several relatively short sessions distributed across time.
  • Acknowledge the relationship between time spent practicing and achievement and set out to invest the time necessary.
  • Be aware of the importance of motivation. When teachers and parents allow students to make some choices about goals and repertoire, student motivation is likely to increase.
  • Listen to high-quality models of musical performance. This is particularly important for beginning musicians. Parents and teachers should invest in a library of fine recordings and, if capable, play and/or sing often for their charges.
  • Support and nurture young musicians. Parents and teachers should demonstrate keen interest and involvement in music study and practice.

I would love to hear if anyone has any further practice ideas akin to the above list, or comments on these issues.


Zadin is a cute little Vietnamese restaurant in San Francisco, and dining at here has been my favorite gluten-free dining experience to date. Almost everything on the menu is either gluten-free or can be modified, and they state so clearly on the menu. GF Redbridge beer is on the list too, so obviously these guys have gone way out of their way to accommodate celiacs.

We started with the greens salad and the salt/pepper calamari. The greens salad had these roasted walnuts which were sweet and crunchy – very tasty. The calamari was awesome, with a lemon-y dipping sauce.

Next we ordered some pho. The pho wasn’t bad – quite tasty in fact. Only complaint was the beef slices were not all that plentiful.

We finished off with the shaken beef – this was an outsanding dish with very tender beef slices paired with fried yams. Crazy good stuff.

When we got there around 7 PM on a Saturday evening, I was surprised to find it nearly empty. But the place filled up in no time and the clientelle seemed to be enjoying themselves muchly.