Archive for March 14, 2013

Thursday, March 14, 2013

Kiln Harmony

Joel Spolsky:

One of the biggest new features is Kiln Harmony, which lets you operate on Kiln repositories using either Git or Mercurial. So you can push changes to a Kiln repo using Git and then pull them using Mercurial. This means that you never have to decide whether you want to use Git or Mercurial. Religious war: averted.

Benjamin Pollack:

There’s a lot of magic that goes into Kiln Harmony. Rather than try to cram all that material into a little blog-post, we’ll be running a series of articles in the coming days on how Kiln Harmony works. We’ll take you under the covers into the details of our implementation, how we handle bizarre corner-cases, how we handle data formats that are more defined by their violations than their nominal structure, and more.

Benjamin Pollack:

Kiln Harmony had three iron requirements: it had to be repeatable (you couldn’t get different repos on subsequent translation attempts), lossless (we couldn’t discard data just because it was hard to preserve), and idempotent (a given Git commit or Mercurial changeset had to always generate exactly the same counterpart for a given repository, with no exceptions—even across Kiln installations or with a side-trip through a site like GitHub or Google Code). This suggested to us a pretty straightforward architecture: every single repository would be stored both as Git and Mercurial on-disk, and we would write a daemon that synchronized changes between the two repositories.

Though I’m a happy FogBugz customer, I had previously ignored Kiln since I use Git. Now I’m wondering whether it would be helpful for me.

Update (2013-03-16): Benjamin Pollack:

We heard you, so beginning in Kiln Harmony, we’ll start looking through changesets, code, and file names, beginning the second you start typing. Not only does this get you the results you want faster; the feedback you get as you type helps you figure out what you’re looking for in the first place. On the Kiln team, we’ve found instant searches so useful that we barely ever go to the “real” results page, and we bet you will, too.

The Future of Software Pricing

Kevin Hoctor:

I think everyone can agree that we won’t survive long as indie developers if we can only charge one or two dollars for our apps. I don’t even think $15 is enough unless you have an enormous audience. So what do we do? How do we compete with the “race to the bottom” inspired by the App Store? I don’t have all the answers, but I do have my opinions and I’m willing to back them up with evidence through my business actions.

The $50 Mac version of MoneyWell seemed like bargain to me after using QuickBooks. I’m not interested in the iOS version, but having one free bank account with an in-app purchase for more seems like a good idea.

Booting Your Mac from a Duplicate

Joe Kissell:

In general, there’s no harm, and considerable benefit, in letting backups run. Your backup software should act as though your duplicate is your regular startup disk and keep copying files to its normal destination as though you had restarted normally. That’s probably what you want, because if you create or modify a file while running from the duplicate, it can then be backed up.

Perhaps it has since been fixed, but I’ve seen cases where this didn’t work right. Time Machine saw the duplicate as a new drive. Thus, rather than creating an incremental backup, it wanted to make a fresh copy of all the files. The only way to do this was to free up space by deleting the backups of the original drive. And the same problem happened again when switching from duplicate back to the regular startup disk. If you boot your Mac from a clone, I think it’s advisable to give it a different drive to use for Time Machine.

Presenting BlockAssert

Steven Fisher:

For various reasons, you sometimes can’t use NSAssert in a block easily. I’m going to explain why and describe a new macro, BlockAssert, which solves this.

MVVM and View Models

Colin Wheeler:

In the MVVM pattern the View Model encapsulates data/properties that the view can bind to, any validation logic and actions that can be performed. For instance if you had a button that needs to change its title text you would have a property on the view model that the button can bind its title property to. The same goes if you need to change the color of a control or enable and disable the control. In this pattern we are essentially taking the state of our app and putting it into a view model.

Among other benefits, this decoupling makes it easier to test and revise the interface.

Re-Downloading Mac App Store Apps

Peter Maurer and Jason Sims report that it is no longer possible to redownload one’s purchases if an app has been removed from sale. As Maurer says:

Looks like Apple fixed a bug that was actually a feature.

Mark Munz wonders what this means for upgrades, e.g. to iLife/iWork. If the new version is a free update, which the Mac App Store sees as the same product, people with older OS versions will not be able to download the old version. But, with this change, the old version will become inaccessible even if the new version is a new product.

Because the Mac App Store doesn’t let you go back to a previous version, even if the new version has a bug, I’ve been saving each app update that I download. I have a DropDMG configuration called “Mac App Store” that compresses the app, puts its version number in the filename, and saves it in my archives folder.

Forcing Aperture to Locate Referenced Files

Thomas Boyd:

Notice the “Reconnect All” button is not lit up even though the corresponding photo has been located. Hold down the Option key and the button will light up.

How Much, or How Little, I Use Interface Builder These Days

Brent Simmons:

Any one of those would be enough: all three thoroughly convince me to stay away from IB for all but the rarest cases.

And the fourth reason I added just yesterday is that dealing with auto layout in IB is not worth the hassle — not when it’s so much easier done in code.

I basically agree that Interface Builder is a beautiful idea that never really lived up to its promise. For a long time, I’ve been making small tweaks in code since it’s so much easier than modifying xib files (especially when localization is involved). And I’ve even run into bugs caused by IB incorrectly generating the xib. I hope to phase out IB as I transition to using auto layout.

Scrivener and the Mac App Store

Keith Blount on a one-character bug and the difficulty of deploying the fix to the Mac App Store:

Well, the trouble is that, as a developer, I have no way of testing the installation of the Mac App Store version across platforms. I can test the integrity of the installer package that I send to Apple (which I did), but not the full installation procedure. (If you are a developer and know this to be incorrect, please let me know. I can test the installer package on the 10.8 machine I create it with, but not on my 10.6 machine it seems.) And unfortunately, it seems that the Apple review process doesn’t test the installation procedure thoroughly, either, since this problem was not picked up by the App Review process. Thus Scrivener 2.4 went live with the problem.


But older versions don’t only become inaccessible to the user – they become inaccessible to the developer, too. Once I became aware of the issue and uploaded the 2.4.1 fix, I then looked for a way to revert the on-sale version to 2.3.1 until 2.4.1 got through review, so that this issue could be eradicated in the meantime. However, it seems there is no way of doing this, and that the only way forward is to wait for Apple to approve the 2.4.1 update.

Since the version in the store has a bug, and Apple won’t accept the fix, he’s temporarily removed the app from the store:

2.4 was released on the App Store last Thursday night, after a week in the review queue. On Friday morning, as soon as I found out about the bug in 10.6′s receipt validation code, I submitted a bug fix, Scrivener 2.4.1, to Apple, and I asked for an expedited review.


It is nearly a week now since 2.4 became available, and we still do not know when 2.4.1 will pass review and be made available on the store. 2.4.1 was rejected on Monday night for a reason that didn’t make sense (the reviewer said it wasn’t sandboxed when it was). We followed this up and resubmitted, but were then told that the reviewers needed more time. Yesterday, I was informed that they want us to make some changes to Scrivener 2.4.1 before it can pass review. I was also informed that Scrivener 2.4, 2.3.1 and 2.3 should really have not passed review either, given the things they want us to change. (Please note that the things we have been asked to change are not bugs, but features Apple interpret as not meeting their App Store review requirements.)


Incidentally, because of some of the changes we are being required to make, we cannot guarantee that Scrivener on the Mac App Store will have as good support for .docx, .doc and .odt formats in 2.4.1 and future releases. This does not affect the version on our site.

Do You Need a Third-Party Disk Utility?

Joe Kissell:

Lately I’ve noticed something curious: While I used to turn to such utilities every few months, I haven’t had to do so in a long time—certainly not in the past couple of years. Anecdotal evidence suggests that I’m not alone in this; disk errors beyond the purview of Disk Utility seem to have declined sharply.

John C. Welch:

So I think a huge reason why people don't worry about dedicated disk utilities anymore is that backing up has become such a literally thoughtless process, a hard drive crash is no longer the horrifying event it used to be.

I used to swear by DiskWarrior, but it’s now been a long time since I’ve used it. I used to run it periodically to optimize my volume’s catalogs, which really did speed things up, and several times it saved drives that had become completely unusable. Nowadays, I can imagine using it to get at very recently modified files if my drive became inaccessible, but I would no longer plan on resuming use of the repaired drive. Instead, I would erase it (or replace it) and restore from a SuperDuper! clone.

Fragmentation can still be a problem for large files such as an Aperture database or Spotlight index, which can accumulate thousands of fragments. SSDs reduce the effects of fragmentation, but I still find it helpful to defragment certain problem files using iDefrag.

I also continue to find bad blocks on my drives, which can cause hangs and lead to damaged files. Drive Genius’s Scan feature is the best way that I know to detect them.

Lastly, it’s alarming just how many disk problems my customers encounter. SpamSieve now includes various diagnostics to detect and fix incorrect permissions and corrupt files. It also validates parts of its own bundle and advises the user to download a fresh copy if components are missing or damaged. Seeing how often this can happen, it’s a wonder that anything on the Mac works.

A Shift in Google’s Thinking


Above all, despite many examples to the contrary, Google appealed to manifest impartiality: its search results were algorithmically derived, untouched by human biases and thus fair. The list of grandiose promises and statements made by Google that turned out to be false and hypocritical is uncomfortably long.

The Chequered History of MagSafe

Jordan Merrick:

There’s an Apple support article that details how to reduce cable strain and damage on your MagSafe power adapter but that’s about it, it’s not even in the getting started booklet that’s in the box with the Mac (at least it hasn’t been on any Mac I’ve owned). Unless you decided to one day research the best methods for keeping your adapter free of cable damage then you’d never really know. Ironically, this was the exact same problem Apple’s smaller profile 30-pin dock connector cables were experiencing since they shrank it and removed the need to pinch the sides - customers would just yank the cable.


With the previous T-shaped connector, pull the cable in any direction and it’ll detach. With the L-shaped connector, pull the cable in most directions and it’ll detach. The one direction it won’t detach is if it’s pulled back away from the rear of the Mac (or the rear-right of the Mac), the cable can’t detach since the MagSafe port is recessed. All it needs is a sharp tug of the cable backwards and it’s enough to cause the exact problem MagSafe tried to avoid - a flying Mac.


By reducing the height and increasing the width of MagSafe, Apple could move back to the more versatile T-shaped connector that all new MacBook Pro/Airs ship with. The magnet is still pretty strong (in fact I think it’s still a little too strong) but the cable’s strain relief appears to be better and my cable has been in constant use for the better part of 8 months and it looks just as good as it did out of the box.

Daylight Savings Time

Dr. Drang:

If, by the way, you think the solution is to stay on DST throughout the year, I can only tell you that we tried that back in the 70s and it didn’t turn out well. Sunrise here in Chicago was after 8:00 am, which put school children out on the street at bus stops before dawn in the dead of winter. It was the same on the East Coast. Nobody liked that.

People complain about the complications DST causes in scheduling, especially in our connected world where international phone calls have to be arranged between people in countries whose time changes occur at different points in the calendar. This is a real problem, but only because our vaunted technology has let us down.

The Power of Abstraction

Graham Lee:

In her keynote speech at QCon London 2013 on The Power of Abstraction, Barbara Liskov referred to several papers contemporary with her work on abstract data types. I’ve collected these references and found links to free copies of the articles where available.

What CS Papers Should Everyone Read?

Ryan Williams (via @CompSciFact):

We all have favorite papers in our own respective areas of theory. Every once in a while, one finds a paper so astounding (e.g., important, compelling, deceptively simple, etc.) that one wants to share it with everyone. So list these papers here!

Embarrassingly, I think I’ve only read one of these, the fun Ken Thompson one about a compiler Trojan horse.

See also: 10 Papers Every Programmer Should Read (At Least Twice) and the 6.033 reading list.

Update (2013-09-10): An old Bruce Schneier post discusses David A. Wheeler’s Countering Trusting Trust through Diverse Double-Compiling.