Press "Enter" to skip to content

Category: Mac

Downloading Office 2011

What do you do when it turns out that your downloaded disk image of Microsoft Office 2011 for Mac is on the 3TB Seagate drive that failed last week, and you didn’t back it up because you thought all that was on it was archived TiVo recordings?

Turns Out™ TJ Luoma knows what to do. Thanks, TJ.

(Next time: recovering data from a 3TB Seagate drive…)

Update 2016-01-21: Also Turns Out™ that if you already have Office 2016 installed, you can log into your Office account and go to the Install page; there is a link that says “Install previous version”.  Clicking this will download a disk image file containing an Office 2011 installer.  (The creation date of this installer is November 20, 2015, and the contents appear to be version 14.5.9; the most recent update as of this writing is 14.6.0, so remember to run Check for Updates after installing.)

Leave a Comment

Updating the cover of the Swift iBook

Apple updated the cover of The Swift Programming Language to match the new book in the series, but deleting and redownloading the book within iBooks in OS X Mavericks didn’t update the cover — it continued to display the original cover.

The solution was to quit iBooks, delete the iBooks cache located at ~/Library/Containers/com.apple.iBooksX/Data/Library/Caches/com.apple.iBooksX, and restart iBooks.

You’re welcome, Internet.

5 Comments

Improved cwd restoration in tcsh

My previous post illustrating a technique for restoring the current working directory in Apple’s Terminal for tcsh users was discovered by Khoo Yit Phang, who suggested an improved version down in the comments. I’m reproducing it here for greater visibility:

if ("$?TERM_PROGRAM") then
  if ("$TERM_PROGRAM" == "Apple_Terminal") then
    alias cwdcmd '( set echo_style = both; echo -n "33]7;file://${host}${cwd:ags/ /%20/}a" )'
    cwdcmd
  endif
endif

Compared to my approach, it has two improvements: (1) by using cwdcmd (of which I was previously unaware) rather than precmd, it only runs when you actually change directories; and (2) by using a suitably configured echo, it avoids running an external command (printf is not built into tcsh, but is present in /usr/bin).

Thanks, Yit.

Update: Of course, with this technique you have to explicitly run the command once, to restore the working directory to the title bar for the first time when you start up. Fixed above.

Leave a Comment

Current working directory restoration in Mavericks Terminal with tcsh

In John Siracusa’s excellent review of OS X Mavericks, he (originally) mentioned that the Terminal application is able to restore the current working directory of open shells across launches.

However, this section has subsequently disappeared from the online version, perhaps for the reasons given below (update: see below). Try looking here for a cached version of the original; scroll down to page/slide number 94. Sorry, John. Please purchase the full review on the iBooks store or the Amazon Kindle store to support John’s work.

Of course I was excited to try this out as, in the course of my work as a software developer, I often have several shell windows open in specific directories. So I tried it, and it didn’t work. It turns out the built-in support supplied by Apple assumes that you’re using the bash shell, but as an old-timer I’m stuck on tcsh instead:

Well, that’s no good, I thought. So I looked in the supporting code’s implementation (/etc/bashrc), and figured out how to do the same thing in tcsh. Simply place the following in your .tcshrc file:

if ("$?TERM_PROGRAM") then
 if ("$TERM_PROGRAM" == "Apple_Terminal") then
  alias precmd 'printf "33]7;%sa" "file://$host$cwd:ags/ /%20/"'
 endif
endif

This uses the appropriate escape sequence to send the URL of the current working directory to the terminal before each command; Terminal detects this information and uses it to update the state of the window (including a proxy icon in the window’s title bar for the corresponding folder). It turns out that the key is doing it using precmd (tcsh’s equivalent of PROMPT_COMMAND), and not sending the sequence in the prompt string itself as one might think. (The outer if statement is necessary to avoid an error when remotely logging in, as with ssh. It has to be a separate statement because of the variable expansion rules in tcsh.)

I’ve notified John via Twitter, so perhaps he add restore this information back to his review. In any case, it’s documented here for future generations. Drop me a note below if you have any issues with it.

Update: It turns out John removed it because he discovered it was a feature in Mountain Lion as well, which had happened not to work on his machine:

If you listen to John’s podcasts, you’ll realize that makes sense: he wouldn’t let something not new in Mavericks stand in the Mavericks review. Regardless, I wasn’t aware of the feature before and it still wouldn’t have worked in tcsh, so this post is presumably still useful. (Note that I haven’t tried it on Mountain Lion, and I’ve already upgraded my working machines to Mavericks; I don’t know why this technique wouldn’t work on Mountain Lion, but use it at your own risk.)

Update 2: OK, so it turns out the feature was first implemented in Lion, and other people have already figured out how to port it to other shells; see here for an implementation in zsh, for example. How did I manage to not learn about this for the last two years? Oh, well…

5 Comments

OCPython, anyone?

As dynamic scripting languages become more widely used, many developers are interested in using them to write “native” Mac OS X software, rather than having to learn Objective-C (which, of course, is a dynamic language in its own right). And in fact it is often possible to do so, using Apple’s BridgeSupport to generate the necessary metadata. Apple explicitly supports bridges for Ruby (RubyCocoa) and Python (PyObjC).

Nevertheless, there is necessarily an impedance mismatch between the runtime models — when passing objects to Cocoa, the bridge must convert the object from the dynamic language’s runtime to an Objective-C object derived from NSObject, and vice versa. This introduces a certain amount of inefficiency, which is not normally a big problem, but it would be desirable to avoid it.

Now, over the last few months, I’ve seen a variety of projects to do this by using the Objective-C 2.0 runtime to implement the object model for the dynamic language. In other words, objects in the dynamic language are subclasses of NSObject and no conversion is necessary.

These range from the venerable F-Script, which is even closer to Smalltalk than Objective-C, to Tim Burks’ original language Nu, which uses a Lisp-like syntax. I believe I’ve seen a reference to a JavaScript implementation as well, but I can’t seem to find it now.

The project that seems to be getting the most buzz in the Mac community right now is MacRuby, a port of Ruby 1.9 done by the developer of RubyCocoa (who is also an Apple employee). There was even a article about it featured on the Apple developer site recently.

Conspicuous by its absence from this list is my preferred dynamic language Python. I would love to see an implementation of Python hosted on the Objective-C runtime. I’ve always felt Python’s language model was a good match for Cocoa (of course, PyObjC not only predates BridgeSupport but even Cocoa itself, going back to the days of NextStep), and I’m personally more familiar with it than Ruby or other dynamic languages. So it seems like a logical step to take.

This project couldn’t be called MacPython, because that name has already been used to denote the Mac port of Python. For now I’m calling it “OCPython”, but I’m certainly open to a cleverer name (especially if there’s one that can riff on IronPython; unfortunately the element most associated with Mac OS X is Carbon, which is entirely wrong for this project).

I’ve been thinking about which version of Python to use as a jumping-off point; originally I was leaning towards 2.5 because it’s the version shipped with Leopard, but now I’m persuaded by Bill Bumgarner’s comment to use 3.0 and take advantage of the revised, less crufty implementation. (This is based on the stated goal of the 3.0 development project; I haven’t actually looked at the source code yet.)

I wish I could say I’m prepared to get the project off the ground myself, but right now I’m between jobs, as they say, and given the current financial situation I’m actively looking for full-time employment and can’t dedicate much time to something that won’t bring in any revenue. (Of course, if anyone out there would like to fund development of OCPython, contact me immediately.)

6 Comments

Pirates! returns to the Mac

As noted here, Feral Interactive is bringing Sid Meier’s Pirates! back to the Mac. [Edit: updated game-specific link]

I was inspired by this news to send the following email to Feral:

I was excited to see the announcement of the latest version of Sid Meier’s Pirates! for the Mac. I was the developer of the Mac port of the original version of Pirates! when I worked at MicroProse Software in the 80’s, and it was fun to see the black-and-white screenshot from our version on your website. I look forward to playing Pirates! once again on my PowerMac and MacBook Pro in the near future.

I hope this leads to a successful line of “Legends” — I have always felt that there was money to be made by porting older successful versions of PC games for the growing Mac marketplace, and I’m pleased to see that Feral agrees with me. Good luck with your upcoming launch.

We’ll have to see how this works out. (I know my son would probably vote for Sid Meier’s Railroads! next, being a huge Thomas the Tank Engine fan.)

Leave a Comment

I have a bad feeling about this

Sometime when I wasn’t looking Apple posted the WWDC session schedule. I hope I’m wrong, but already I see the potential for some serious problems.

WWDC does not seem to have a big reputation for being well-run. I can’t speak to this personally with any great authority; I’ve only attended one previous conference, in 2006. I didn’t really know what to expect, and I was excited just to be there, but even still there were a few issues I noticed. That year the sessions on the newly-announced Objective-C 2.0 and garbage collection were scheduled in a room that clearly was too small for the amount of interest. I saw there was a problem and decided to bypass the sessions, even though I was interested, figuring I could read up on the material later.

Meanwhile, the session on application code signing had been put in Presidio, the largest room — which I interpreted as a sign of the importance of the topic to Apple — but there were well fewer than a hundred people there. So Apple’s track record on predicting attendance is suspect at best.

Now this year they’ve sold out the conference, so we know it’s going to be crowded, and we know many if not most of those people are there for the iPhone. Apple seems to have booked Presidio exclusively with the key iPhone sessions, which is wise, but I fear it won’t be enough. I imagine four or five hundred people lining up early Tuesday morning, parking themselves in Presidio, and staying there for three and a half days. People who try to come for a later session are going to be annoyed if they can’t get in — but if Apple tries to clear the room after each session, people will get really angry.

[In 2006 they apparently ended up “repeating” a few of the overcrowded sessions by replaying them on a video projector one evening. I didn’t go; if I remember correctly, that was Wednesday, the night of the Apple Design Awards and Stump the Experts, and I didn’t want to miss those. This time around I’d probably pass them up, though. For one thing, the former DTS engineer with whom I saw Stump the Experts, and who made it twice as much fun by filling in the back story for me, is probably not attending this year.]

As a would-be independent developer with interests in both desktop and iPhone software, I’m anxious about the scheduling. On the one hand, if the iPhone session fill up I can usually find other sessions of interest to me. On the other hand, the trip out to San Francisco from the East Coast is a big deal in both time and money, and it’s not clear when I’ll be able to do it again, so I’d like to take advantage of the iPhone sessions as much as possible, since they’re clearly of more immediate value. (After all, I’ve got my Hillegas third edition right here already.)

At least if I keep myself on Eastern Time I can show up early every morning and get in line. I’ll miss the evening socializing, but I’m pretty introverted and don’t know anyone in SF, so that’s not much of a loss for me.

I sure hope this works out…

Comments closed

Little details mean a lot

I’ve just filed my 2007 taxes using the much-maligned TurboTax. (I filed my 2005 taxes this past January, so I’m doing much better this year.)

TurboTax for the Mac appears to have been completely rewritten with an eye towards satisfying the Mac customer, which is a refreshing change for Intuit. (It will be interesting to see how their Financial Life product looks this fall.)

As a good example of leveraging the foundations of Mac OS X to provide specific functionality for the customer: I was pleasantly surprised to be given these choices for saving my return after filing:

  1. “Print returns” (I routinely “print” to PDF, but Mac OS X already makes this easy);
  2. “Backup to .Mac”: this puts a copy of my TurboTax data file, as well as a PDF with my return and all supporting worksheets, into a folder (Documents/TurboTax/2007) on my .Mac disk;
  3. “Burn to CD”: this uses the standard disc burning interface to put a copy of my data file as well as the TurboTax application (fully updated, as far as I can tell) onto a CD. Brilliant. (I can’t tell you how much time I wasted looking for the 2005 software. The fact that it wouldn’t run under Leopard once I found it is another issue entirely…)

These are the little details that Mac users expect in their software (otherwise they wouldn’t have bought a Mac), and companies that pay attention to things like this should be able thrive in the Mac marketplace. Granted, Intuit’s reputation on the Mac is in tatters (and deservedly so), but I’m much more inclined to check out Financial Life now than I was before.

Comments closed

Signs of the Apocalypse, part 12

Sending an S.O.S. for a PC Exorcist (New York Times):

I called John C. Dvorak, a prominent columnist for PC Magazine and a podcaster on the Podshow network. “I advise everybody to buy a Macintosh because Apple products are the easiest to use,” he said.

Wait a sec, let me double-check… yes, 2 + 2 is still 4, and the sun appears to have set in the west.

(Oh, yeah, the article? The author took delivery of an $1800 laptop running Vista, and less than three days later it wasn’t working — something about the anti-virus software — so he paid this guy another $800 to wipe the hard drive and reinstall Vista, and now he’s happy. Couldn’t make this stuff up…)

Leave a Comment

Dancing with the elephant (revised)

While gathering information about application compatibility with Leopard, I notice one developer, Snerdware, is struggling to keep up with the situation. They report two major problems that affect their current applications, and, with some evident frustration, blame both of them on Apple. [Note: I’ve substantially rewritten my commentary on the first issue, since I’ve learned additional information and since my main point applies to the second issue.]

The first issue affects both their products; the report here is for AddressX:

AddressX won’t startup on 10.5.0/Leopard running on an Intel-powered Mac (a log indicates “… Reason: no suitable image found. Did find: /usr/lib/libcrypto.0.9.dylib: mach-o, but wrong architecture. …”).

When we looked at the 10.5 pre-release, we encountered an OS X library issue — it installs a non-universal/PPC-only version of a library that’s critical to our applications (and, of course, all our developer systems are Intel-powered). ‘Though we filed a bug report early in October (original Problem ID: 5520955 and have now re-filed it), believe it or not, it’s still a problem with the released/commercial version of 10.5.0 (even without the bug report, you’d think that a check to ensure all binaries are universal would actually be a basic QA step — it’s one that’s easily automated!).

After corresponding with someone named Bryan D. at Snerdware and doing a little more research, I’ve learned the following things which make me more sympathetic to their problem than I originally was:

  • Apple includes two versions of libcrypto: one called libcrypto.0.9.dylib, and one called libcrypto.0.9.7.dylib, and a symbolic link libcrypto.dylib that points to the newer library.
  • In Leopard, the newer library is indeed a four-way universal binary, but the older library is PowerPC only. I originally assumed this was because only pre-Intel applications would require it, since libcrypto.0.9.7.dylib has been available in Mac OS X at least as far back as 10.3.9; and so Snerdware was making a mistake by linking to the older library and then complaining that it wasn’t universal.
  • But it turns out that Snerdware relies on features that are present in the older library (which corresponds to libcrypto version 0.9.6l), but have been removed for some reason from the newer library.
  • More strangely, Apple did include a universal binary of libcrypto.0.9.dylib in the Intel versions of Tiger, but strangely left it PowerPC-only in Leopard. Huh?
  • Snerdware originally considered compiling the older library into their program, but since it’s crypto there are all kind of export regulations that come into play (and believe me, I know about this; I had to research exactly this topic at a previous job).

Hopefully this was indeed an oversight that can be fixed in a future update; otherwise, Snerdware has a problem with no easy solution, and some portion of the blame lies with Apple.

The second issue is a more fundamental problem, and one that affects nearly all Mac developers — Apple has a history of making significant changes to core system services between OS versions. I presume that Apple doesn’t do this maliciously, but there are plenty of developers who will tell you they’ve been burned by Apple changing or dropping technologies. Apparently Snerdware is once burned and twice shy:

Since we’ve previously been seriously “bitten” by Apple’s last-minute major changes to developer pre-releases, we can’t afford to take pre-releases seriously until they are near release. […]

With the imminent release of 10.5.0, we […] discovered that, even ‘though OS X’s Sync Services has the same interfaces and we’ve seen no documentation/release notes that document subtle but significant changes in behavior, we see that the behavior has changed in a way that will cause us to make very major changes to Groupcal … Given that Groupcal was working very well with 10.4, this is more than annoying for us, as well. Be angry with Apple, not with us.

[…] It’s things like this that make it much more difficult for an OS X product to be a viable business proposition.

Here I have a harder time finding sympathy. By their own admission they waited until the last minute to check whether the behavior of Sync Services had changed, and now they report to their users that their flagship product won’t be compatible until the first quarter of 2008, and point the finger at Apple?

(Luckily their target market appears to be corporate workgroups running Exchange servers, and those folks are less likely to be rushing out and upgrading to Leopard, so Snerdware may have some time there.)

If my livelihood depended on my product operating correctly with Sync Services, I wouldn’t rely on Apple keeping its behavior unchanged from release to release; I’d be booting up each Leopard seed on a non-critical system and checking things out. Perhaps I’d muster up the resources to send a developer to WWDC, where Apple encourages you to bring your code, try it out on the current seed, and discuss problems with the Apple engineers who have come up from Cupertino for the week for just this reason.

(To be fair, I don’t know that Snerdware didn’t do this; but with the “can’t afford to take pre-releases seriously” comment above, I somehow doubt it.)

And then — well, maybe Sync Services does change in the September seed and I still have a lot of work to do — but wouldn’t I’d be five weeks further along?

If you choose to dance with an elephant, you can approach it one of two ways — you can wait for the dust to settle, and then see what the lay of the land is; or you can try to be more nimble and maneuver around the elephant. We independent developers are supposed to be more nimble… aren’t we?

[But sometimes, even if you’re nimble, you can get still stepped on…]

Comments closed