New MacBook Pro Retina

Our new MacBook Pro Retina arrived while we were in Hawaii.

Our old MacBook Pro was getting long in the tooth. It was a pre-unibody, 2007 model, 2.4 GHz Intel Core 2 Duo with 4 GB of RAM, a 500 GB spinning disk drive, and OS X 10.6.8 (Snow Leopard).

The new one has a Retina display, 2.8 GHz processor, 16 GB RAM and a 1 TB SSD and it’s running OS X 10.9.4 (Mavericks).

It’s been challenging to migrate files from the old laptop to the new one, as the old one keeps crashing.

OS X Homebrew: Build FreeTDS from HEAD (gitorious)

Here’s a pull request I just submitted to homebrew to make it possible to build FreeTDS from master on its gitorious repo:

https://github.com/mxcl/homebrew/pull/21309

Example of using it:

$ brew install freetds --HEAD --universal
==> Cloning https://git.gitorious.org/freetds/freetds.git
Updating /Library/Caches/Homebrew/freetds--git
==> autoreconf -i
==> ./configure --prefix=/usr/local/Cellar/freetds/HEAD --with-openssl=/usr/bin --with-tdsver=7.1 --mandir=/usr/local/Cellar/freetds/HEAD/share/man
==> make
==> make install
🍺  /usr/local/Cellar/freetds/HEAD: 63 files, 3.6M, built in 67 seconds

$ brew test freetds --HEAD -v
Testing freetds
==> /usr/local/Cellar/freetds/HEAD/bin/tsql -C
/usr/local/Cellar/freetds/HEAD/bin/tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v0.92.dev.20130718
             freetds.conf directory: /usr/local/Cellar/freetds/HEAD/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.1
                              iODBC: yes
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no

Pretty simple:

commit 3d786f23bc2ff5d73a22474f9256330a17f01e23
Author: Marc Abramowitz 
Date:   Thu Jul 18 09:10:33 2013 -0700

    freetds.rb: Enable support for building FreeTDS from HEAD (gitorious)

diff --git a/Library/Formula/freetds.rb b/Library/Formula/freetds.rb
index 0a700e6..362b411 100644
--- a/Library/Formula/freetds.rb
+++ b/Library/Formula/freetds.rb
@@ -5,10 +5,19 @@ class Freetds < Formula
   url 'http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz'
   sha1 '3ab06c8e208e82197dc25d09ae353d9f3be7db52'

+  head 'https://git.gitorious.org/freetds/freetds.git'
+
   depends_on "pkg-config" => :build
   depends_on "unixodbc" => :optional

+  if build.head?
+    depends_on :automake
+    depends_on :libtool
+  end
+
   def install
+    system "autoreconf -i" if build.head?
+
     args = %W[--prefix=#{prefix}
               --with-openssl=/usr/bin
               --with-tdsver=7.1

Here’s the commit on GitHub.

I also added support for a test and for doing a universal build.

Compiling a universal library

A note for my future self on how to compile a library as universal binary in Mac OS X.

For a while, I’ve been getting warnings like these when building pymssql:

ld: warning: ignoring file /usr/local/lib/libsybdb.dylib, 
file was built for unsupported file format 
( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) 
which is not the architecture being linked (i386): 
/usr/local/lib/libsybdb.dylib
ld: warning: ignoring file /usr/local/lib/libct.dylib, 
file was built for unsupported file format 
( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) 
which is not the architecture being linked (i386): 
/usr/local/lib/libct.dylib

I finally decided to do something about them. I rebuilt FreeTDS from source as follows:

./configure \
    CFLAGS="-arch i386 -arch x86_64" \
    CXXFLAGS="-arch i386 -arch x86_64" \
    LDFLAGS="-arch i386 -arch x86_64" \
    --disable-dependency-tracking
make
make install

Goodbye warnings!

This Stack Overflow post was helpful: Stack Overflow: How to compile universal libraries on Mac OS X?

Getting double-tap to drag working again in OS X Lion and Mountain Lion

Finally fixed one little thing that was annoying me on my work laptop with OS X 10.8.4. I couldn’t double-tap to drag files or make selections.

The fix is dead simple and it’s from this CNET article:

If you want to reactivate the classic double-tap-and-drag gesture, it’s possible, but the option is well-hidden. Instead of being in System Preferences under Trackpad, it’s actually under System Preferences > Universal Access > Mouse and Trackpad > Trackpad Options. Click the check box that says “Dragging” and you should be all set.

In Mountain Lion, it seems that “Universal Access” was renamed to “Accessibility”.

How to bring back "double tap to drag" in newer versions of OS X

How to bring back “double tap to drag” in newer versions of OS X

What is up with Mail.app and Exchange?

Fired up Mail.app on my work laptop today for the first time in a while.

Outlook 2011, OWA (the Outlook Web interface) and my iPhone all show the same state of my inbox, with a single message in it.

Mail.app shows two messages – the one that the other guys show and one that I filed many hours ago.

Things I tried (all of which failed):

  1. Telling Mail.app to resynchronize
  2. Telling Mail.app to rebuild the mailbox
  3. Restarting Mail.app
  4. Deleting my Exchange account and adding it back (and the rebuilding the mailbox for good measure)
  5. Quitting Mail.app, moving my ~/Library/Mail folder to somewhere else, Start Mail.app, go through the wizard to see up my Exchange account all over again.

Nope. Still shows those blasted two messages. The last one is rather amazing to me. If I moved the folder out of the way, that seems to me like it would be pretty much starting from scratch. If that didn’t work, I can only guess that either the OS is doing some caching that I don’t know about or the message is still on the server and Mail.app is just interpreting the server state didn’t from all the others. Strange.

It still amazes me how much trouble we all have with computers with pretty basic stuff like email, calendars, and addressbooks, and getting it all to sync. I hate crap like this, because it breaks the trust that I have in computers to do the simple stuff for me. But then if I can’t trust it, I don’t know, I might as well go back to pen and paper. Imagine how much time we could free up as a culture if we didn’t have to deal with Exchange, IMAP, ActiveSync, SyncServices, and all of that other crap that sounds nice but then fails in strange ways.

Using TextExpander to expand a sequence of OmniFocus tasks: A failed experiment

I recently got turned on to TextExpander by the Mac Power Users podcast.

One of my ideas was to use snippets in OmniFocus to create certain repetitive multi-action sequences. For example, when a project involves emailing someone and then waiting for a reply, it would be nice to type a short abbreviation and then enter a fill-in for the name of the person and then have TextExpander create two actions in OmniFocus; one called “Email ” with a context of “Online” followed by another called “Waiting for reply from ” with a context of “Waiting”. I theorized this should be doable because TextExpander lets you insert key presses like Tab and Enter into snippets.

Well, it didn’t work for me as expected. Strangely, it works with the first action; I get the title and context that I want. For the second action, however, I cannot get it to set the context. No matter how many tabs I insert into my snippet expansion, any text that I try to make it put in the context field of the second task seems to go in the title instead. Strange.

Here is the snippet:

If you get it to work or have any insights, please let me know…