Archive for November 2014

Saturday, November 29, 2014

Zero Knowledge Proofs: an Illustrated Primer

Matthew Green:

Specifically, assume that I (the Verifier) have some strategy that ‘extracts’ useful information about Google’s coloring after observing an execution of the honest protocol. Then my strategy should work equally well in the case where I’m being fooled with a time machine. The protocol runs are, from my perspective, statistically identical. I physically cannot tell the difference.

Thus if the amount of information I can extract is identical in the ‘real experiment’ and the ‘time machine experiment’, yet the amount of information Google puts into the ‘time machine’ experiment is exactly zero -- then this implies that even in the real world the protocol must not leak any useful information.

Thankful to Be a Programmer

Andrew Wulf:

Is there any job like this one? Where everything you know changes at an ever-increasing pace, where the challenges of programming never end, and the need to produce quality is a constant reminder. I can't remember a time when I didn't love what I got to do, even when circumstances were terrible, or companies failed out from under me.

[…]

I love playing music and cooking and even writing blog posts but writing code is something special. You get to tell a freaking computer what to do and it does it! Sometimes too literally but still there is a feeling of power, of mastering knowledge, of making something from nothing that only programming can bring.

Android vs. iOS Start Experience

Luke Wroblewski:

Today’s new iPad Air 2 experience consists of 23 or more steps and no less than three iCloud services (iCloud, iCloud Drive, & iCloud Keychain). In contrast, today’s new Android Nexus experience consists of only 8 steps but with a mandatory 234MB update (some things don’t change). Here’s both start experiences in detail.

Via Nick Heer:

Privacy has its tradeoffs.

iWork ’14 Review

Iljitsch van Beijnum:

One thing hasn’t changed: like iWork ’13 before it, iWork ’14 creates files that previous versions of the suite can’t open. The file format hasn’t really changed, it’s just that Apple decided against using packages. A package is a folder that holds multiple files and folders but looks like a single file in the Finder. However, if you tried to transmit it over the Internet in the past, you’d possibly run into trouble. So the new versions of Keynote, Pages, and Numbers helpfully compress all the files that are part of a document into an actual single file.

At first blush, this seems utterly perplexing, because this is exactly how iWork ’09 worked. The disadvantage of the ’09/’14 single file method is that even a small change to a document requires the whole thing be written to disk in its entirety, including potentially large images and movies that are contained in the document. That may not be so bad on a Mac with a fast SSD, but it can make iCloud syncing a lot slower. Of course Apple also knows this, so the iWork ’14 apps only use the single file method when saving a document locally on a Mac. The package format is used when saving to iCloud.

[…]

The big advantage of the apps’ iCloud versions is live collaboration, and we’re very disappointed that this hasn’t been extended to the native apps. There are some oddities with that arrangement, too. For instance, tracking changes is not supported in shared Pages documents, so it’s either work with others on the same document in real time or see who changed what after the fact—you can’t have both.

[…]

Apple did bring back some features that were excised from the initial iWork ’13 release over the course of the year, but it doesn’t look like it’s full steam ahead on that revisionary front. For Keynote and Numbers that’s fine: Keynote remains best in its class while Numbers has no such pretensions but serves users with modest needs well. Pages, on the other hand, leaves too wide a gap between vision and execution.

Nick Heer:

It’s incredible just how much of a feature regression Pages experienced in the ’09-to-’13 update, going from an easy-to-use page layout machine to a barely-cutting-it word processor. It still doesn’t support page numbering on alternating sides, full OpenType features, or a useful contextual menu.

Update (2014-11-30): Accidental Tech Podcast discusses iWork.

Using C++ to Deliver Microsoft Office Across Different Platforms

Jesper:

How Microsoft Office’s codebase is being reworked to adapt to the new multi-platform requirements is the most interesting thing you’ll watch today, if you’re a programmer. Contains some nice breadcrumbs about how Mac Office development may be tilted on its head, and some brash admissions that the way forward will not be features that only work on one platform, because it’s hell going forward.

Friday, November 28, 2014

Planning for the Transfer of Confidential Data

Matt Henderson:

SecureSafe offer a feature called “Data Inheritance”, which allows you to define any number of “beneficiaries” who can access the files and passwords you store in the system. When you create a beneficiary, SecureSafe generates a PDF file for them, containing a unique access-code along with a description of the procedure for using it to access your account.

So what keeps a beneficiary from accessing your data when they shouldn’t? If a beneficiary attempts to access your SecureSafe account, you, as the account owner, are notified by email and SMS. You then have a configurable amount of time (the “delay period”) in which you can respond, denying the request.

First-Person View in Google Maps Navigation

Whitson Gordon:

It’s very simple: just tap the compass icon in the corner! This should switch you to the first-person navigation view that, in most cases, is much easier to use (especially while you’re driving). If you prefer the map view in any scenario, you can just tap the compass icon again to go back.

After the recent update, Google Maps stopped showing me the first-person view, and so I thought Google had simply gotten rid of it. It’s great to be able to get it back.

Before I had a chance to search for how to do this, I gave Apple Maps a try for two trips. It’s nice to be able to control it hands-free via Siri. However, it almost led us astray, suddenly suggesting a U-turn and an 8-mile drive to a completely different location just when our destination was in sight. On another trip, the map stopped updating for a minute or two, just as we started navigating through an unfamiliar city center. That had never happened with Google Maps. It was also off by a block with the location of the restaurant, which again Google had exactly right.

Wednesday, November 26, 2014

Attack of the 50-foot Save Sheet

Jason Snell:

According to Gotow, what happened is that Apple changed the file dialogs so that the title bar is now considered to be part of the window—and changed the math everywhere except in save sheets.

Hopefully Apple will fix this in a future Yosemite update. In the meantime, if you use an app that saves files via the sheet style, you might want to remind yourself to shrink its height a bit every so often.

If a sheet does get so large that it goes off the bottom of the screen, you can delete the NSNavPanelExpandedSizeForOpenMode or NSNavPanelExpandedSizeForSaveMode default.

Update (2014-11-26): Daniel Ericsson suggests holding down the Shift key while resizing the side of the sheet.

Update (2015-04-09): This is fixed in Mac OS X 10.10.3.

Tuesday, November 25, 2014

WatchKit Links

Update (2014-12-02):

App Store Changes “Free” Buttons to “Get”

Juli Clover:

It is not entirely clear why Apple has decided to replace Free with Get, but it may have to do with the growing sentiment that apps with in-app purchases are not free. Earlier this year, the European Commission asked Apple and Google to implement changes to the way they sell apps, to avoid misleading customers about “free” games that are not actually free.

Tim Schmitz:

It doesn’t differentiate between apps that are “free with in-app purchases” and apps that are just FREE. I think it’s worth labeling apps that are free with no in-app purchases as such.

He and Jason Snell don’t like the “GET” label, but I’m not in favor of using the iCloud download icon because it connotes that I have previously selected that item.

JPEG Image Compression

David Austin:

We may think of the color of each pixel as represented by a three-dimensional vector (R,G,B) consisting of its red, green, and blue components. In a typical image, there is a significant amount of correlation between these components. For this reason, we will use a color space transform to produce a new vector whose components represent luminance, Y, and blue and red chrominance, Cb and Cr.

[…]

As is typical, the luminance shows more variation than the the chrominance. For this reason, greater compression ratios are sometimes achieved by assuming the chrominance values are constant on 2 by 2 blocks, thereby recording fewer of these values.

[…]

Now we come to the heart of the compression algorithm. Our expectation is that, over an 8 by 8 block, the changes in the components of the (Y, Cb, Cr) vector are rather mild, as demonstrated by the example above. Instead of recording the individual values of the components, we could record, say, the average values and how much each pixel differs from this average value. In many cases, we would expect the differences from the average to be rather small and hence safely ignored. This is the essence of the Discrete Cosine Transform (DCT), which will now be explained.

He also explains the improvements in JPEG 2000.

Wink in All Colors

Soroush Khanlou:

This techinque of merging two characters at rendering time is how this new emoji spec handles various skin tones. An emoji followed by a skin color swatch can be merged at glyph-rendering time to represent that emoji with that skin color.

If the emoji rendering system doesn’t implement this ligature, it will display the emoji followed by a graphical representation of the swatch of the skin color. This fallback is ugly, to be sure, but it signals the intent of emoji-sender effectively.

[…]

“When a human emoji is not followed by a emoji modifier character, it should use a non-realistic skin tone, such as that typically used for the smiley faces, or a silhouette.”

Microsoft Makes .NET Open Source

Microsoft (comments):

Delivering on its promise to support cross-platform development, Microsoft is providing the full .NET server stack in open source, including ASP.NET, the .NET compiler, the .NET Core Runtime, Framework and Libraries, enabling developers to build with .NET across Windows, Mac or Linux. Through this implementation, Microsoft will work closely with the open source community, taking contributions for future improvements to .NET and will work through the .NET Foundation.

The .NET Team:

Microsoft has a history of sharing .NET developer products as open source, including ASP.NET, Roslyn, NuGet, Entity Framework and Azure projects. You can now add .NET Core and .NET Framework reference source to that list.

We’re in the process of opening up all of .NET Core. Today, we’re publishing a few libraries, as a kind of down-payment. Expect to the see the corefx repo fill up over the next coming months and for a coreclr repo to appear.

Here’s the GitHub page (via Justin Spahr-Summers).

Update (2014-11-30): Accidental Tech Podcast discusses the open sourcing of .NET.

Strange Tales of Swift Initialization

Russ Bishop:

Swift appears to treat initialization quite differently than Objective-C, even though under the hood it is actually quite similar. They both use two-phase initialization, but Objective-C simply hides the first phase from you.

[…]

Objective-C slaps some zeros on it and calls it done. Swift has no choice but to offer you access to this initialization phase. And by offer I mean make you an offer you can’t refuse.

[…]

Once Swift has walked the class chain setting all properties to appropriate default values, even including partially executing your initializers up until the point where they call super, it then resumes executing initialization code starting from the most-derived superclass as it walks back up the chain.

[…]

If you have a funny suspicious feeling in the back of your mind right now congrats: you’re a seasoned Objective-C pro. A lot of classes in Objective-C don’t follow the proper rules for initialization and/or have incorrectly marked headers. This includes plenty of Apple’s own classes.

In other words, Swift’s strictness is causing crashes where there were none before, but this is only because of latent bugs in the frameworks. However, Swift’s initializer rules are also causing headaches and badly structured code.

The Story of DeltaGraph

Andrew Wulf:

The key idea we came up with was figuring out how to build all the charts resolution independent. Cricket Graph and most other charting applications including Microsoft's (Excel did not have built in charts yet) used Quickdraw to output the charts, which was basically just screen resolution. People in the newspaper, magazine, scientific journals, etc, industries really needed Postscript quality charts so they could print at their normal resolution and quality. The Wall Street Journal for example used a mainframe to build their charts. They would become a key supporter.

[…]

When I started the UI code I asked two questions of Deltapoint (1) will this code ever be ported to Windows (2) do you want to support multiple documents open at a time. The answer to both was no. Windows was still too primitive to care about and multiple open documents was fairly uncommon.

[…]

One time General Motors had said that if we supported a certain chart type they would buy 10,000 copies. Of course we quickly added it and then they decided not to after all.

iPhone 6 Pixel Peeping

Ole Begemann on the iPhone 6 Plus (comments):

Result of rendering the test pattern at logical 3× scale after it got downsampled by the device. Notice how every line bleeds into neighboring pixels. In the section on the left, every single pixel is lit green at varying brightnesses. The black 1-pixel-wide gaps between each green line have been lost.

[…]

The test pattern (rendered at 2× scale) on an iPhone 5. This is how it is supposed to look. Perfect! Notice how much brighter the pixels are than on the iPhone 6 Plus (both devices were set to similar screen brightnesses).

[…]

Pixel-perfect rendering is a thing of the past on the iPhone platform. Having seen the rather severe results in the worst-case scenario (rendering a regular grid of hairlines), I am actually surprised how little of an issue the automatic downsampling is in practice. As I mentioned, I simply don’t notice anything of the effects I have illustrated here in real life.

Bryan Jones on the iPhone 6 (via John Gruber):

So, why does this display look so good? It turns out that what is different, like the iPhone 5 vs. the iPhone 4 is the proximity of the pixels to the glass in the iPhone 6 compared with the iPhone 5. With the iPhone 6, the pixels appear to be almost one with the glass. When the iPhone 5 came out, Apple bonded the display to the glass in an effort to get the pixels closer to the surface and Apple has appeared to make the pixels in the 6 even closer still.

Update (2014-12-17): Ole Begemann:

My tests show that activating Display Zoom on the 6 Plus has no discernible negative or positive effect on output quality. The effective scale factor changes from one non-integral number (2.61 px/pt) to another (2.88 px/pt), resulting in a final image that is just as flawed on a per-pixel level as it was before.

[…]

On the iPhone 6 […] The end result is a slightly blurry image which, unlike the ever-present-but-practically-invisible loss of image quality on the 6 Plus, looks clearly worse than the non-zoomed image at normal viewing distance. Especially text looks distinctly worse when Display Zoom is on. I’m not sure whether the lower-resolution screen on the iPhone 6 (326 ppi vs. 401 ppi) or the fact that upscaling is worse for image quality than downscaling is the major contributing factor here.

Moms With Apps

Tim Burks:

The @momswithapps website lists apps that work offline and that are free of IAP, social network links, and ads.

The site’s discover view is more pleasant to use than the App Store itself.

A Swift Corner Case

Geoff Pado:

Any call to a method or property that uses optional chaining will return the same type as it normally does, but wrapped in a optional. Which makes sense—any broken link in the chain will cause the whole thing to return nil. This is true even for methods that return Void. Chained calls will return Void?.

[…]

Because of the combination of optional chaining and implicit return, we suddenly were left with a closure that was automatically returning something of type Void?, which clashed with addOperationWithBlock()’s expectation of Void.

Share Extension Iterations

Daniel Jalkut:

The problem with all the targets on your Mac or iOS that may or may not support sharing pertinent data to your extension, is you have to walk them through the process of invoking you. When you’re deep into the development of a particular aspect of the user interface or mechanical behavior of your extension, what you really want is to repeatedly invoke the extension with the same, predictable kinds of data. Luckily, it’s possible on both Mac and iOS platforms for a host app to invoke sharing extensions programmatically, so you just need to choose a Run target that will predictably invoke your extension upon launching.

[…]

If you’re working on a Mac-based Share extension, the key to invoking it at runtime is to enlist the help of the NSSharingService infrastructure. You simply ask it for a service with your identifier, and ask it to “perform.”

iCloud Drive Splitting Folders

Drew McCormack:

It’s difficult to know exactly what is happening, but it seems iCloud Drive is generating extraneous folders during conflict resolution.

[…]

For many apps, this is no big deal, and may never arise. But if your app stores data at specific paths in iCloud Drive, it could very easily become a problem.

[…]

If you are removing and re-adding folders in your app at a specific path in iCloud Drive, don’t be surprised if one day you discover the data is gone, and moved into a second version of the folder at a different path.

I consider this pretty undesirable behavior. No other sync solution I know does this. Dropbox doesn’t — although Dropbox does do something similar to this with files rather than directories — and the original iCloud file sync also didn’t do it.

RaceSplitter Rejected for Slide to Start

Matt Henderson:

In RaceSplitter, we use a slider labeled “Slide to Start Race” as the UI control for starting the race timer. This was introduced three years ago, in response to users inadvertently starting races when the control was a simple button. (Our customers appreciated this change, since, when staring at 500 participants on a start line, it’s all too easy to accidentally tap a start button.)

So three years and 13 versions later, Apple are now rejecting the app with the claim that this control could cause user confusion vis-a-vis the UI control that Apple used to use to unlock devices in versions of iOS predating iOS 7.

Monday, November 24, 2014

Kindle Library

Kirk McElhearn:

There is no way to set up Kindle Family Library from the Amazon web site, or from a device running a Kindle app (such as an iPhone or Android phone), so if you don’t have a recent Kindle, you simply cannot use this feature. I find this surprising for two reasons. First, Amazon is saying that they have this great feature that is supported by every device they’ve ever made, but you can only turn it on if you have a recent device. Second, the settings are a bit confusing, and would be a lot easier to manage on the web.

Perl 6: Get Ready to Party

Larry Wall (via Aristotle Pagaltzis):

The last pieces are finally falling into place. After years of design and implementation, 2015 will be the year that Perl 6 officially launches for production use.

In this talk, the creator of Perl reflects on the history of the effort, how the team got some things right, and how it learned from its mistakes when it got them wrong. But mostly how a bunch of stubbornly fun-loving people outlasted the naysayers to accomplish the extraordinary task of implementing a language that was so ambitious, even its designers said it was impossible.

Sunday, November 23, 2014

NSAtom, the True Object

Brian Webster:

In our case, if our method is returning a YES value, that will end up with a full value of 0x0000000000000001. If you try interpreting this value as an object, the runtime will think it is a tagged pointer, since the bottom bit is 1. OK then, so what kind of object is this exactly?

[…]

Ah, so it looks like, whether by design or by accident, no matter what message you send to NSAtom, it returns a value of 1.

Update (2015-01-17): There’s been further discussion of NSAtom on Twitter.

Saturday, November 22, 2014

Updating Before Migrating to New Mac

Dave Winer:

It’s normally very easy to migrate, but this time they threw a curveball at me. In order to use the Migration Assistant, I have to upgrade the previous machine (the one I’m typing this on) to the latest Mac OS. That’s exactly what I don’t want to do. This is my safety net against incompatibilities in the new version of the OS.

That seems like a strange requirement for that reason—and also because the old Mac might not be able to run the latest OS. Apple’s documentation says:

Migration Assistant in Mavericks and Yosemite can transfer information from other computers that have OS X Snow Leopard v10.6.8 or later installed. If you’re migrating from a computer with an earlier version of OS X, update your older computer first, or manually copy your data from one computer to another.

Perhaps he misunderstood, and Migration Assistant only wanted him to update from 10.8.2 to 10.8.5. I don’t envy the person who had to write that error message.

Monodraw

I have been enjoying following the development of Helftone’s upcoming Monodraw ASCII art editor. I’m not sure that I would ever need to use such an application, but it is such an interesting idea, executed with characteristic passion and attention to detail. Inspiring.

Pricing Determines Your Business

Jason Cohen:

Price is inextricably linked to brand, product, and purchasing decisions — by whom, why, how, and when. Price is not an exercise in maximizing some micro-economic supply/demand curve, slapped post-facto onto the product. Rather, it fundamentally determines the nature of the product and the structure of the business that produces it.

Core Data Relationships Data Loss Bug

Tom Harrington notes that several developers (including James Dempsey and Rich Siegel) have encountered a bug with Core Data’s -[NSPersistentStoreCoordinator migratePersistentStore:toURL:options:withType:error:] method. This is supposed to copy the data store from one location to another, e.g. for making a backup. The frameworks may also call the method on your behalf, e.g. if the user does a Save As. The bug is that, on Yosemite and iOS 8, the method discards many-to-many relationships. This is actually worse than corrupting the file because the new file will still be readable, so it may not be obvious that it’s missing some of the data. The bug is reputed to affect all store types.

(DropDMG and EagleFiler use Core Data but not many-to-many relationships, so I don’t think they are affected.)

Update (2014-11-24): Harrington has filed a bug and posted a sample project.

Update (2015-03-10): This is fixed in Mac OS X 10.10.2 and iOS 8.2.

What Makes Clang So Special

CoderGears (via Maxime Chevalier):

The most important difference of its design is that Clang is based on LLVM, the idea behind LLVM is to use LLVM Intermediate Representation (IR), it’s like the bytecode for java. LLVM IR is designed to host mid-level analyses and transformations that you find in the optimizer section of a compiler. It was designed with many specific goals in mind, including supporting lightweight runtime optimizations, cross-function/interprocedural optimizations, whole program analysis, and aggressive restructuring transformations, etc. The most important aspect of it, though, is that it is itself defined as a first class language with well-defined semantics.

The Trials and Tribulations of Writing a 3rd Party iOS Keyboard

Alexei Baboulevitch (via iOS Dev Weekly):

I recently released my first commercial project: Translit Keyboard, a 3rd party keyboard for iPhone that lets you transliterate Latin characters into Cyrillic and some other alphabets.

[…]

This was a satisfying project to work on, giving me great insight into Swift, autolayout (since removed), Core Graphics, and a bit of Interface Builder. But it also gave me experience with something that I had yet to encounter in my sheltered iOS development existence: the horror of undercooked Apple frameworks and tools.

Below are as many of the problems I encountered during development as I can remember. I have high hopes that these will be fixed over the next few years, but until then, perhaps this article will help some poor programmer in dire straits!

Friday, November 21, 2014

iOS IPC via NSFileCoordinator and NSFilePresenter

Tom Harrington:

There’s still no full IPC mechanism on iOS. NSDistributedNotification hasn’t made the jump from OS X to iOS and probably never will. But file coordination and presentation can serve the same purpose, as long as the apps use the same app group.

When I was adding file coordination and presentation to my demo app, I realized that they could also be used for notifications between an app and its extensions. If one of them does a coordinated write while the other is using a file presenter for the file, the call to presentedItemDidChange happens almost instantly. Notification is the whole purpose of that method, so it makes sense it would work this way. I want to be notified if a specific file changes, and that’s how I get the notification.

But you don’t need to care about the file contents to be interested in notifications. If you just want a notification, choose a file name and use it as the notification mechanism. Any time one process needs to notify the other, make a change to the file. The other will get a file presenter call, and the notification is complete. It feels sort of like a hack but really this is exactly how the API is designed to work.

Update (2014-11-22): Apple TN2408 (via JanApotheker):

Using file coordination in an app extension to access a container shared with its containing app may result in a deadlock. This is usually the case if a process is suspended mid coordinated I/O. This can be more prevalent on iOS where most apps will be suspended after a short period of time after being moved to the background. Extensions should use alternatives to file coordination.

[…]

Regardless of this issue, the containing app (and all applications) should properly use background task assertions around file operations they require completed in a shared container (with or without extensions). This includes all writes or deletions. Such a process might still be killed by jetsam but at a much lower frequency.

Update (2014-11-29): Wade Spires recommends CFNotificationCenterGetDarwinNotifyCenter for iOS IPC.

Update (2014-12-01): Harrington has filed a bug on NSFileCoordinator:

This would seem to be a textbook example of a situation where NSFileCoordinator and NSFilePresenter would be ideal. Nay, it would seem to be the primary purpose for those classes to exist. The documentation for NSFileCoordinator even goes so far as to say that “…NSFileCoordinator class coordinates the reading and writing of files and directories among multiple processes.” But actually using it between different processes turns out to not be safe.

The tech note explains that “…you are obliged to write to that container in a coordinated manner to avoid data corruption. However, you must not use file coordination APIs directly for this.” This kind of documentation makes me sad.

Why We Created the Take Control Crash Course Series

Adam C. Engst:

We’re like you — we turn to the Web for answers first. But a lot of what’s on the Web is incomplete, unrelated, out of date, or flat-out wrong, whereas we work hard on accuracy and relevance in our books. We have to compete with all the content that’s already out there, but that’s hard if we’re not on the same playing field. So we’ve put the full text of each Crash Course on our Web site for search engines to index and for people to read […]

This may seem nuts, but people in the publishing industry also thought we were crazy back in 2003 when we refused to apply DRM to our books. What little copying there is hasn’t harmed our sales over the last 11 years, so with the Crash Courses, we’re going further and making them freely available on the Web. But, why would anyone buy such a book? Two reasons: first, we believe those who want offline access, better formatting, or more help than one chapter can provide will do the right thing and support our efforts, and those who needed only a quick answer wouldn’t have purchased anyway. Second, although the first chapter is easily read, we’ve slowed down navigating within the Web versions of books other than “Read Me First: A Take Control Crash Course,” so trying to read the entire book online would be unsatisfying.

Swift Retrospective

Ash Furrow:

We discovered, as I mentioned earlier, that Swift just isn’t ready for primetime yet. I want it to be, but it was probably a mistake to write the app in Swift. By our projections, it took us about four times longer than we had anticipated to complete the project (in terms of person-hours worked). A lot of that is admittedly due to our own faulty estimates, but a lot more of it is attributable to Swift’s immaturity. In future projects, we’re going to be more mindful about estimation.

[…]

So we’re pretty much stuck with Swift, as much as you can be “stuck” with a totally awesome language that just needs some more time to have a mature ecosystem of tools. Swift does, after all, address most of my concerns with Objective-C. It has a lot of features that made developing Eidolon a joy. I’m impressed with what Apple’s made so far, but I’m eagerly waiting for Xcode 6.2 and beyond.

Scaling Customer Service by Fixing Things Twice

Gareth Wilson:

We think that for each customer issue, we have to do two things:

  1. Solve the customer’s problem right away
  2. Find a way to stop that problem from happening again

How we solve the first depends on the specific problem at hand, but to resolve the second we use the 5 Whys method.

[…]

If you stick to Fixing Things Twice then over time all the common problems get resolved. This frees up your Customer Service team to look in to the unique issues that need more time.

I think this is the right way to do things and leads to a higher quality product. It’s incredibly satisfying to track down root causes. But you have to exercise some discretion because this is a hole with no bottom. At a certain point, you can do more good for more customers by not trying to second-fix issues of diminishing severity and popularity.

Browsing Versions of a File in Time Machine

Lukas Mathis:

In Time Machine, the selector for picking how far to get back is finicky, and hard to use. As far as I can tell, it’s impossible to know when specific files actually changed, unless you manually step through the history and check the file’s modification date. The UI doesn’t properly support what is probably the most common use case: getting back the most recent good version of a single file.

[…]

All I needed was for Time Machine to show me what versions of a specific file it had backed up, so that I could pick the one with the most recent modification date. Not any old version — the most recent version. But I can’t tell Time Machine to just show me what versions of a file it has. Instead, I’m (sluggishly, because Time Machine’s UI apparently requires more power than the most recent Tomb Raider) stepping back through Time Machine’s version history, painfully trying to figure out which specific instance of the files it shows me is the one that I need to recover.

tmutil looks very useful and can remove the Time Machine metadata that would ordinarily be messed up if you tried to manually restore from a snapshot. But it doesn’t seem to solve this particular problem. The easiest way I’ve seen is BackupLoupe, however even that will show you an entry for each snapshot containing the file, rather than each distinct version of the file.

Thursday, November 20, 2014

MPW’s About Box

John-Michael Bond:

The animation shows the imaginary building blocks of a 3 1/2" floppy disc flying together one-by-one from out of a box. When the pieces have finishing compiling an airbrush machine comes and paints the surface of the disc.

It’s a wonderful piece of animation, lovingly put together and hidden in a menu most users would never see. If you weren’t around for the original Mac OS, or just weren’t programing during those days, here’s your chance to see it.

Alas, the YouTube account has been terminated, but there is still a static screenshot.

Update (2014-11-21): @chucker found another copy of the video.

PCalc Piracy

Filip Truta interviews James Thomson:

You recently said on Twitter (I quote), “according to my stats, around 70% of the copies of PCalc on iOS are pirated.” That’s a staggering number! Especially for a calculator app. Why do you think this is happening? Could it be the $9.99 price tag?

It’s certainly higher than I thought it would be, but it’s certainly not unusual. I’ve heard of people who develop games who are seeing more like a 90% piracy rate! I think there are newer ways to pirate apps that don’t necessarily require a jailbroken phone, and there will always be people who don’t want to pay for things. PCalc has had a lot of positive publicity over the last few months, and I think that’s probably contributing to it getting pirated as well. I don’t think it’s down to the price though – people still pirate 99c apps.

But the other thing is, a 70% piracy rate doesn’t necessarily mean that I’m losing 70% of my sales. Most of those people wouldn’t have bought a copy in the first place, so while it still bothers me on an idealogical level, I am not too worried yet. But, if that number continues to rise over time, then I think it indicates a cause for concern.

With iOS so locked down, you’d think this would be a problem Apple could solve for non-jailbroken phones.

You Can Now Deregister iMessage

Apple (via Josh Centers):

You may need to turn off iMessage if you are now using a non-Apple phone and can’t get SMS or text messages someone sends you from an iPhone.

Finally.

Update (2014-11-21): Jason Marr notes that deregistering does not fix the problem if people reply to old iMessage threads.

Friday, November 7, 2014

Tracking Down a WebKit Crasher

Daniel Jalkut:

I love it when customers take the time to write something about the circumstances surrounding a crash. Often even a little clue can be enough to lead to the unique series of steps that will ultimately reproduce the problem.

[…]

This is where the open-sourced nature of WebKit is both a blessing and a curse. If this issue had been revealed to exist somewhere deep within AppKit, or any of Apple’s other closed-source frameworks, I most certainly would have thrown up my arms, filed a bug, and hoped for the best. But Apple’s WebKit framework is something I can download, build, and debug. Sure, it takes nearly all day to build, and there is a steep learning curve to debugging it, but why did I become a software developer if I’m not up for a challenge?

[…]

To make a long, long, long, long, story very short: I used Instruments and its “pairing” functionality, which lets you hide balanced pairs of retain/release calls so that you are left with a more manageable subset of calls to examine and scrutinize. After scratching my head over this for hours and not making much headway, I finally came upon a specific call stack that had a very suspicious heritage. I confirmed through Instruments and then by direct examination of WebKit source code, that the WebView instance in question was in fact retaining and then autoreleasing itself as part of its dealloc method.

The Future of Unison

Cabel Sasser:

Unison’s end is bittersweet. The market for a Usenet client in 2014 isn’t exactly huge. But if you know Panic, you know we do our very best to never drop things awkwardly — we like to leave our apps in a good place for our (very) valued users.

So we’re excited to release a nice, final update to Unison.

c4 Compiler

Robert Swierczek has written a minimal C compiler in about 500 lines of code (via Michael Feathers).

Update (2014-11-21): Hacker News comments.

Fire in the Valley, Third Edition

The Pragmatic Bookshelf (Amazon):

This completely revised and expanded third edition brings the story to its completion, chronicling the end of the personal computer revolution and the beginning of the post-PC era. It covers the departure from the stage of major players with the deaths of Steve Jobs and Douglas Engelbart and the retirements of Bill Gates and Steve Ballmer; the shift away from the PC to the cloud and portable devices; and what the end of the PC era means for issues such as personal freedom and power, and open source vs. proprietary software.

The earlier edition that I read was good.

Update (2015-01-18): Paul Freiberger and Michael Swaine are interviewed on the Floppy Days podcast.

ECC RAM

James Hamilton in 2009 (via Accidental Tech Podcast):

An excellent paper was just released that puts hard data behind this point and shows conclusively that ECC is absolutely needed. In DRAM Errors in the Wild: A Large Scale Field Study, Bianca Schroeder, Eduardo Pinheiro, and Wolf-Dietrich Weber show conclusively that you really do need ECC memory in server applications. Wolf was also an author of the excellent Power Provisioning in a Warehouse-Sized Computer that I mentioned in my blog post Slides From Conference on Innovative Data Systems Research where the authors described a technique to over-sub subscribe data center power.

I continue to believe that client systems should also be running ECC and strongly suspect that a great many kernel and device driver failures are actually the result of memory fault. We don’t have the data to prove it conclusively from a client population but I’ve long suspected that the single most effective way for Windows to reduce their blue screen rate would be to require ECC as a required feature for Windows Hardware Certification.

Monday, November 3, 2014

Android’s Audio Annoyances

Lukas Mathis:

For a long time, the main difference between Android and iOS was polish. Both systems offered roughly the same basic features, but iOS just did them better. Scrolling was smoother, the visual design was more consistent, the keyboard worked way better, and so on. While the difference is still there today, it is much less noticeable than it once was. But there are still pockets of awfulness in Android, and one of these pockets is how it deals with audio.

Sunday, November 2, 2014

CloudPull Removed From the Mac App Store

John Brayton (via John Gordon):

The most significant improvement in the CloudPull 2.6 update is Yosemite compatibility. I submitted this update to the Mac App Store on October 1. Apple rejected it on October 15. I spent time from October 15 through October 27 escalating the issue — first with the App Review Team, then with the App Review Board, and finally with Apple Developer Technical Support. Meanwhile, Yosemite was released on October 16 and many customers have already migrated to the version available on my web site.

It is possible to work around Apple’s reason for rejecting the app. Instead, I have decided to distribute CloudPull exclusively through my web site. That will allow me to provide updates more quickly, and to focus on serving customers rather than dealing with the Mac App Store.

The reason for the rejection was an OS bug that causes Core Data to open a compiled model file in read-write mode when it only needs read access. The .mom file is probably inside the app’s bundle, which is not a location that apps are supposed to be writing to. Lots of developers ran into problems like this when the Mac App Store was new. Apple seems to be using DTrace to audit what submitted apps are doing, but it still hasn’t audited its own APIs to make sure that they play by the rules.

It sounds like Brayton did everything by the book, but one month after submission his app was still in limbo when he pulled the plug on the Mac App Store version. This is the sort of Max Q issue that Rich Siegel was talking about last month. The Mac App Store is supposed to make it easier for customers to keep their apps up-to-date. In this case, it instead impeded the process of delivering a Yosemite compatibility update.

Saturday, November 1, 2014

The Point of Optionals

Sam Deane:

What it took me a while to get was that if we encounter an API or some source of objects that is giving us an optional X, we should probably want to turn it into a non-optional X as soon as we can. We want to push the “deal with the thing not existing” code out as far to the edges of our call graph as we can, and validate things as early as we can, and as close to the source of the objects as we can. This gives us more chance to deal with unexpected situations early before they become bad, and means that the bulk of the code doesn’t have to.

I think that the loss of the mental baggage in the rest of the code will actually be substantial in many cases, and will be a great aid to productivity (plus a small aid to efficiency).

Police Can Require Cellphone Fingerprint

Chuong H Nguyen (via Daniel Jalkut):

A Virginia Beach Circuit Court judge ruled that law enforcement officials can compel you to unlock your smartphone with a fingerprint, but that they can't force you to enter in your passcode or password to unlock your device. Judge Steven Frucci says that obtaining a fingerprint is like obtaining a DNA sample or a physical key, things that would have to be surrendered in an investigation anyways. Passcodes would be considered knowledge, and not a physical object, so they deserve more protection under the law.

Nick Heer:

A workaround for this, if you’re interested, is to simply shut off your iOS device before the police seize it; it will require the passcode when it wakes.