Mac

Unpleasant trip down memory lane

We've all heard how smells can tickle a memory?

Today's unpleasant smell eminated from a PC running Windows 7. You'd think mounting a network drive would be easy. It was. But then the mount somehow went stale a few minutes later? Not sure what happened exactly, but connection errors ensued. Trying to disconnect and remount didn't work. Navigating the UI was as retarded as it always has been on Windows. The solution that was within my patience threshold was to use a different machine (a PC that was already configured to mount to the same network drive).

The experience, though short, brought back a flood of sour, aweful memories from years of using Windows PCs. What utter crap. On the plus side it reminds me of how absolutely great computing has become since my switch to a Mac.

MacRuby for Application Scripting

MacRuby 0.6 was released a few days ago (30 April 2010). MacRuby is a version of Ruby 1.9, ported to run on the Mac OS X Objective-C common runtime. You can write Cocoa apps and, interestingly, you can also use ruby as a scripting language to control applications running on your system.

Read More

Flash CPU Performance Dependent on Hardware Acceleration

Jan Ozer in this article compares H.264 video playback performance of Flash and HTML5 across Windows/Mac, Chrome/Safari/Firefox and Flash 10.0/10.1.

The conclusion:

Overall, it’s inaccurate to conclude that Flash is inherently inefficient. Rather, Flash is efficient on platforms where it can access hardware acceleration and less efficient where it can’t.

Adobe has responded to the CPU Performance gripes and Steve Jobs finger pointing and done a lot to improve performance in Flash Player 10.1.

With Flash Player 10.1, Flash has the opportunity for a true leap in video playback performance on all platforms that enable hardware acceleration.

But Apple does not expose the necessary hooks to do hardware accelerated video playback on Macs.

I don’t follow the politics of the situation, but after noting significant playback efficiencies in Flash Player 10.1 on the Mac, respected technologist and AnandTech founder Anand Lai Shimpi commented with actual GPU-accelerated H.264 decoding I’m guessing those CPU utilization numbers could drop to a remotely reasonable value. But it’s up to Apple to expose the appropriate hooks to allow Adobe to (eventually) enable that functionality.” So it looks like the ball is in Apple’s court.

MySQL Uninstall on Mac OS 10.6

I needed to uninstall a newer 64-bit version of MySQL to go back to a 32-bit version. Here are the steps:

1
2
3
4
5
6
7
# Remove folder with mysql installation
sudo rm -rf /usr/local/mysql-*
# Remove soft link to above folder
$ sudo rm /usr/local/mysql
# Remove receipts
$ cd /private/var/db/receipts/
$ sudo rm com.mysql.*

Thanks to this link for the critical bit on finding and removing the receipts.

Saving Web Receipts Files on Mac OS X

Mac OS X has a handy feature that allows you to, via the print dialog, save PDF files directly to a web receipts folder. This is particularly useful when making online purchases in a browser.

You enact this feature by executing command-P (or File > Print), pulling down the combo box in the lower left of the print dialog, and choosing Save PDF to Web Receipts Folder. This automatically saves a PDF file directly to your ~/Documents/Web Receipts folder. How cool is that!

In Mac OS 10.5 and 10.6, this is now a python script that you can customize. Below I show how to modify this file to change the default save location and prepend the date to the resulting filename.

  1. Navigate to /Library/PDF Services/Save PDF to Web Receipts Folder.pdfworkflow/Contents.
  2. Edit the file tool. It doesn't look like you need to be root to do this, but if you do use sudo -s from the command line.
  3. Towards the top of the file add another import statement import datetime
  4. In main modify destDirectory to be your desired save folder location. I used:
    destDirectory = os.path.expanduser("~/PDFDocs/Receipts/")
  5. Modify these lines from:
    title = safeFilename(title)
    destFile = title + ".pdf"
    to:
    title = safeFilename(title)
    # Create a YYYYMMDD string
    today = datetime.datetime.now().strftime("%Y%m%d_")
    destFile = today + title + ".pdf"
  6. Presto, you are done! At least until a major software update clobbers this file. Which is why I wrote this blog entry: to remind me how to do this again the next time.