Thursday, October 30, 2014

CMDevice​Motion

Nate Cook:

Each packet of CMAccelerometerData includes an x, y, and z value -- each of these shows the amount of acceleration in Gs (where G is one unit of gravity) for that axis. That is, if your device were stationary and straight up in portrait orientation, it would have acceleration (0, -1, 0); laying flat on its back on the table would be (0, 0, -1); and tilted forty-five degrees to the right would be something like (0.707, -0.707, 0).

We’re calculating the rotation by computing the arctan2 of the x and y components from the accelerometer data, and then using that rotation in a CGAffineTransform. Our image should stay right-side up no matter how the phone is turned.

The results are not terribly satisfactory -- the image movement is jittery, and moving the device in space affects the accelerometer as much as or even more than rotating. These issues could be mitigated by sampling multiple readings and averaging them together, but instead let’s look at what happens when we involve the gyroscope.

Microsoft Band

Microsoft:

Built-in GPS: Go running without your phone and still get your pace and distance data.

[…]

Battery life: 48 hours of normal use; advanced functionality like GPS use will impact battery performance

I wonder how many of the features work with iOS. It seems like integration would be difficult given what iPhone apps are allowed to do. I like the idea of GPS tracking without carrying a phone (unlike Apple Watch), but it doesn’t look like it can play music or podcasts. Only $199.

David Pierce:

Simply by virtue of being available to Android, iOS, and Windows Phone users all at once, Microsoft believes it can make inroads in an otherwise terribly siloed marketplace. Health will work with Android Wear watches, Android phones, and the iPhone 6’s motion processor, automatically collecting data from all three. Microsoft’s also been working with Jawbone, MapMyFitness, My Fitness Pal, and Runkeeper to import their data, and plans to incorporate many more.

Something only Microsoft can do?

Capturing Phone Relay Audio

Paul Kafasis:

The combination of Yosemite and iOS 8.1 on the iPhone now offer a function called Phone Relay. Using Phone Relay, you can use your Mac to make and receive phone calls. That’s very handy on its own, but adding Audio Hijack Pro to the mix makes it even better. By setting FaceTime as the source in Audio Hijack Pro, you can record those calls for later reference!

Towards an Ideal OpenType User Interface

John Gruber:

What I find absurd is that you can use many of these features in TextEdit (Apple’s free text editor), but not in Pages (Apple’s purportedly professional word processor). They worked up through Pages ’09, but were sacrificed in the name of iOS and web app compatibility.

Wednesday, October 29, 2014

AppleScript and Yosemite

Ray Robertson:

Apple introduced a great variety of new automation features and updates in Yosemite. I’ve written up a quick summary below with links to more detailed information.

Daniel Jalkut:

Unfortunately the progress feature of AppleScript has not been exposed to 3rd party developers, so far as I can tell.

AppleScript Release Notes:

AppleScript/Objective-C is now available to all scripts, not just library scripts.

I’ve been wanting this feature for years. You no longer have to create a special AppleScriptObjC application; you can use it from any script. This will be useful both for the powerful Cocoa APIs as well as the many basic data structures and operations that were never part of AppleScript.

Here are some examples:

use framework "Foundation"

-- Calling an Objective-C class method:
get current application's NSDate's timeIntervalSinceReferenceDate()

-- Use pipes to avoid conflicts with AppleScript keywords.
get current application's NSDate's |date|'s timeIntervalSinceReferenceDate()

-- Basically, you just use “'s” in place of “.”.
set _array to current application's NSMutableArray's alloc()'s init()

-- “count” is also reserved.
get _array's |count|()

-- AppleScript changes “_array's addObject_(1)” to the interleaved syntax:
_array's addObject:1

-- AppleScript changes “_array's insertObject_atIndex_(0, 0)” to:
_array's insertObject:0 atIndex:0

set _string to _array's |description|()
set _appleScriptString to _string as Unicode text

set _data to _string's dataUsingEncoding:(current application's NSUTF8StringEncoding)
set _tildePath to current application's NSString's stringWithString:"~/Desktop/test"
set _path to _tildePath's stringByExpandingTildeInPath()
set {_ok, _error} to _data's writeToFile:_path options:0 |error|:(reference)
-- Should return “{1, missing value}”.
-- The file will contain “(0, 1)”.

Unfortunately, it looks like the technology is not yet very mature. Script Editor beach balled and had to be force-quit half a dozen times while I was writing this sample.

Apple Features Then Forbids PCalc Widget

James Thomson:

Apple has told me that Notification Center widgets on iOS cannot perform any calculations, and the current PCalc widget must be removed.

and:

I would be allowed to make a widget that let you to “enter a formula” but it couldn’t perform the calculation in the widget.

and:

And yes, Apple is currently featuring PCalc in the “Great apps for iOS 8” section, under Notification Center widgets.

Jason Snell:

First there’s the maddening inconsistency: This is an app that was accepted into the App Store, and is even being featured in the App Store as I write this. And now, a few weeks in, someone at Apple has decided that the app is too... what? Too useful?

Then there’s the frustration about Apple reducing functionality. Why is doing basic math in a widget not okay, but running billing timers and calculating trip ETAs and any number of other tricky actions are fine? It can’t be the fact that it’s a widget that you interact with, because I’ve seen numerous widgets that allow you to tap and swipe and do all sorts of stuff.

[…]

Also, in the Yosemite version of Notification Center, Apple itself provides a calculator widget! So Notification Center can be used for different things on the Mac and on iOS? How does that make sense?

Federico Viticci:

Rather, what is disappointing is the persistence of contradicting signals from a company that many developers saw as “more open” after WWDC ’14. Developers like Thomson will keep finding themselves in the position of risking to implement a feature or create an app that may be approved, gain users, and be shut down by Apple for a sudden policy change.

Marco Arment:

Like the after-the-fact rejection of Launcher last month, this feels like the worst era of app review returning with a vengeance.

When decisions like this start happening, Apple needs to reevaluate the purpose of app review: to protect itself, its platform, and its customers from spam, fraud, abuse, and malware (and ensuring Apple gets its cut, which is reasonable).

David Barnard:

As I’ve mentioned in previous emails, I fear App Review. And that’s no small thing. So many decisions I make end up being filtered through whether or not I think something might get rejected. Which has a profound impact on my team’s entire development process — from what ideas we explore while brainstorming to how we implement specific features.

Nick Heer:

It’s not the rules themselves that are necessarily a burden on app developers. It’s Apple’s store, so they get to set the rules. But it’s seemingly-arbitrary stuff like this that makes developers lose sleep at night. Thomson clearly spent a great deal of time and care building this extension, and now that’s gone to waste with unfortunately characteristic indifference from Apple. And it’s not like PCalc was rejected outright — Apple allowed it in the store for the past month and a half before pulling it for violating a rule that doesn’t even exist.

Josh Centers:

I thoroughly read the Extensibility developer documentation while researching “iOS 8 Third-Party Keyboards Explained and Reviewed” (2 October 2014) and found nothing that would specifically bar a widget like PCalc’s. In fact, the developer documentation even hints that a graphics-intensive game might be allowable in the Today View, even if it’s not encouraged.

Update (2014-10-30): Sarah Perez:

But now we’re hearing that Apple is changing its course. The PCalc app and widget will remain in the App Store, and all calculator-type widgets will be allowed as well, an Apple spokesperson has confirmed to us.

From our understanding, the calculator use case was not one that Apple had anticipated, which is why an App Store reviewer originally explained to Thomson that he would need to adjust the app, or risk being pulled from the App Store.

It’s odd that Apple didn’t anticipate it considering that Yosemite includes Apple’s very own calculator widget.

Daniel Jalkut:

Incredible that TechCrunch was informed about PCalc’s widget being re-approved by Apple before its developer, @jamesthomson, was.

The core problem remains that App Review doesn’t follow the letter of its own written rules.

Gus Mueller:

I don’t have inside information, but I’m willing to bet that someone with veto power in Apple got a little upset or jealous about PCalc’s widget, and said “kill it”. James is lucky that he has lots of friends and folks who love PCalc, and also have a soapbox to stand on. So with the outcry and bad publicity, Apple changed it’s mind.

Tuesday, October 28, 2014

Yosemite’s Switch to Core Storage

Craig Cohen (via Clark Goble):

Yosemite uses a volume format known as Core Storage. It is the enabling technology behind Fusion Drive and FileVault.

Core Storage is a reliable, high-performance volume format. It provides increased crash protection, ditto blocks for metadata, copy-on-write B-tree catalogs, in-place transformations for backgrounding the disk encryption used by FileVault, and intelligent block-level data migration used by Fusion Drive.

Yosemite will auto-convert your drive so long as your Mac has hardware support for encryption. HFS+ is still there; it’s just wrapped in another layer.

1Password mini Shortcuts

AgileBits:

What might seem like one of the smallest new features in 1Password 5 for Mac is actually one of its biggest. We completely redesigned it so you can find what you need more easily, but we also gave it a huge dose of keyboard shortcuts so you can work faster and keep important items at your fingertips.

Sunday, October 26, 2014

Yosemite Uploads Unsaved Documents and Recent Addresses to iCloud

Jeffrey Paul (via Rui Carmo):

Presumably to support Continuity, current document state is no longer only saved locally - those in-progress (not yet explicitly “saved”) documents live in iCloud Drive, so that they can be opened on other devices without ever having to hit “save”. This is useful, however, all of my previous open files have now been synchronized to Apple servers.

[…]

Apple has taken local files on my computer not stored in iCloud and silently and without my permission uploaded them to their servers - across all applications, Apple and otherwise.

I don’t think it’s at all obvious that the system would copy the Saved Application State folder to iCloud. Many of the applications don’t even have iOS counterparts. I have not tested this, but I’m guessing you could prevent this by unchecking “Allow Handoff between this Mac and your iCloud devices” in the General tab of System Preferences.

Also:

Check out ~/Library/Containers/com.apple.corerecents.recentsd/Data/Library/SyncedPreferences/recentsd-com.apple.mail.recents.plist. It would appear that iCloud is synchronizing all of the email addresses of people you correspond with, even for non-iCloud accounts, to their recent addresses service. This means that names and email addresses that are not in iCloud contacts, not synchronized to your device, and only available in an IMAP-accessed inbox are now being sent to Apple, silently.

I’m not sure how to turn that off.

Update (2014-10-26): Landon Fuller has a traffic log.

Thinking about this some more, I’m not sure that Paul is correct about the unsaved data being uploaded because of the new Continuity/Handoff feature in Yosemite. It think this is part of the older Documents in the Cloud feature, as mentioned by Dmitry in the comments. It looks like Handoff, as expected, uses a more direct method of transferring the files.

If that’s the cases, the preference mentioned above is the wrong one. To turn off auto-uploading of unsaved data, you would need to uncheck the particular application in the iCloud Drive section of the iCloud tab of System Preferences. This would prevent you from using that application’s container (rather than the global iCloud Drive) with iCloud. In other words, I don’t think there’s a way to explicitly upload saved documents without having the system implicitly upload unsaved documents. Pre-Yosemite, there is no application-level control, so you would need to turn off Documents & Data entirely.

Regarding the e-mail address list, I found a disclosure on Mail’s help page:

If you use iCloud Contacts, your Previous Recipients list is available on your other Mac computers (with OS X v10.8 or later) and iOS devices (with iOS 6 or later) that have iCloud Contacts turned on.

So there does not seem to be a way to opt out of storing all your addresses unless you also opt out of syncing your address book with iCloud.

Update (2014-10-28): It looks like there is a way to save certain documents to iCloud without having new documents automatically auto-saved there. As Philippe notes in the comments, you can use the Lion-era NSDocumentSaveNewDocumentsToCloud hidden preference, which changes the default location for new documents:

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

In conclusion, I don’t think there’s anything new here with Yosemite. Apple seems to be providing the options that they should, although I would argue that the default behavior should be not to upload user data without asking. I think the main problem is that the OS doesn’t explain what it’s doing and, as a result, few people seem to understand how the iCloud features work and interact. The vast majority of users don’t know that when you click the box to enable iCloud—which you pretty much have to do these days—that this is one of the results.

Saturday, October 25, 2014

Trust No One, Not Even Performance Counters

Paul Khuong (via David Smith):

I can guess why we observe this effect; it’s not like Intel is intentionally messing with us. mfence is a full pipeline flush: it slows code down because it waits for all in-flight instructions to complete their execution. Thus, while it’s flushing that slows us down, the profiling machinery will assign these cycles to any of the instructions that are being flushed. Locked instructions instead affect stores that are still queued. By forcing such stores to retire, locked instructions become responsible for the extra cycles and end up “paying” for writes that would have taken up time anyway.

Yosemite’s Mail Drop Considered Harmful

Dan Wood:

If Apple Mail detects a giant attachment, it will offer to send it via Mail Drop, which means that the file is uploaded separately to a temporary iCloud URL. It will stick around for 30 days.

The problem is that if you use this technique, it’s possible that any actual textual message might not be seen by the receiver of the email message.

If you send your email message as plain text — you might not even realize that you are sending a plain text message or a rich text message —or if the receiver’s email client shows them plain text instead of rich text — then ONLY the Mail Drop URL will be seen by the receiver. Not your important message.

Friday, October 24, 2014

Repurposing the Titanic

Justin Williams:

Building products with a bootstrapped mentality is completely different than a startup mentality. When bootstrapped, every decision you make affects the bottom line, and that is a bottom line you care about from day one. Trying to convert a platform that wasn’t designed with that in mind proved to be too great of a challenge for me as the sole proprietor of Glassboard. Rather than focusing on improving the core Glassboard product, I spent most of my time trying to cut costs where possible to curb our losses.

Alias Files and Bookmark Files

Daniel Jalkut:

The long and short of it is Apple has moved away from “alias files” in recent years, and now favors a format they call “bookmarks.” To users, the files behave the same way, and Apple continues to call them “aliases” e.g. in the Finder when it offers to make an alias to a file. However, the older system service for “resolving an alias file” does not work on bookmarks.

[…]

The problem was compounded at some point, maybe as recently as OS X Yosemite, when Apple started aggressively converting old alias files into bookmarks. So even if you had an old, functional alias to a folder in your script tree, it may have recently stopped working in FastScripts because Apple converted it … helpfully … to a bookmark.

The Race to Archive TwitPic

Pierre Chauvin (via Nick Heer):

Right now, a collective of Internet archivists and programmers is trying to do the impossible: save more than 800 million pictures uploaded to the Twitter photo-sharing service Twitpic before they disappear down the memory hole after the company’s scheduled shutdown on October 25.

Update (2014-10-29): Twitpic:

We weren’t able to find a way to keep Twitpic independent. However, I’m happy to announce that we have reached an agreement with Twitter to give them the Twitpic domain and photo archive, thus keeping the photos and links alive for the time being. Twitter shares our goal of protecting our users and this data. Also, since Twitpic’s user base consists of Twitter users, it makes sense to keep this data with Twitter.

Via Manton Reece:

This is much better than all those photos becoming broken links, but it’s still a sad statement on the Twitter ecosystem. Twitter threatened Twitpic, then Twitpic decided to shutdown, and in the end Twitter gets all the Twitpic assets anyway for cheap or no money at all. It’s a bizarre end to what only a couple years ago was a $3 million business.

Apple Maps Connect

Greg Sterling (comments):

This afternoon, Apple notified us of a new self-service portal to add or edit local business listings: Apple Maps Connect. It’s intended for small business owners or their authorized representatives (though not agencies) to be able to quickly and easily add content directly into Apple Maps.

The service is free and the listings (or corrected listings) appear on Apple Maps on the PC and in mobile. All users sign in with their Apple IDs and passwords.

I thought we’d see something like this about two years ago, but it’s good that it finally exists.

iTunes 12 MiniPlayer

Chris Johnson (via John Siracusa):

At first, I had no idea how you were supposed to invoke the Mini Player in Yosemite. The first thing I tried was green zoom icon, but that just made iTunes take up the full screen. After clicking on various things in the title bar area, I eventually tried and succeeded with the album artwork. I had mistakenly assumed that clicking the album artwork would give me a larger view of the album artwork.

In the Mini Player, I was similarly confused. Clicking the album artwork made the artwork bigger. Clicking the little double arrow icon was no help, it also makes the album artwork bigger. I’m not sure why Apple decided we needed two ways to see the larger album artwork. The × icon did the trick, but I was afraid to try it, thinking it would quit iTunes.

Update (2014-10-26): Kirk McElhearn:

When you click the close button, the behavior now depends on how you displayed the MiniPlayer. If you displayed it in a way that hid the main iTunes window, closing the MiniPlayer will bring back the iTunes window. If you displayed it and the iTunes window is still visible, then the MiniPlayer window will close, and nothing else will change. In other words, when you close the MiniPlayer, no matter what you do, the main iTunes window will show up again.

Thursday, October 23, 2014

Peak Google

Ben Thompson:

IBM didn’t capitalize on PCs because their skills lay on the hardware side, not software. Microsoft didn’t capitalize on mobile because they emphasized compatibility, not the user experience. And now Google is dominant when it comes to the algorithm, but lacks the human touch needed for social or viral content. And so, when all of that brand advertising finally begins to move from TV to the Internet – and that migration is a lot closer than it was even a year ago – I suspect that Google is not going to capture nearly as much of it as many observers might expect.

[…]

This is the primary basis of my thesis that Google may very well be in a similar situation to early-eighties IBM or early-oughts Microsoft: a hugely profitable company bestride the tech industry that at the moment seems infallible, but that history will show to have peaked in dominance and relevancy.

I don’t know enough about advertising to really have an opinion on this, but it’s an interesting thesis.

Yosemite and Default URL Handlers

Luc Vandal:

Unfortunately, Apple is now blocking sandboxed apps to change the default handler for a particular URL scheme. This is why Screens is not able to set Screen Sharing as the handler.

[…]

We’re always sad to remove functionalities from our apps but sandboxing gets more restrictive every OS X release.

Update (2014-10-27): Kevin Walzer ran into this issue as well.

Playgrounds for Objective-C

Krzysztof Zabłocki introduces KZPlayground.

Update (2014-10-28): Edge Cases and Mike Ash discuss this.

Yosemite Wi-Fi Enhancements

Glenn Fleishman:

Taken together, this information can help you sort out network difficulties. If you always see 20 MHz in the Channel line, but the PHY (physical protocol mode) is 802.11ac, you have other networks in the vicinity on the same or adjacent channels that are forcing the base station and client to negotiate a slower rate; moving the base station or forcing a different channel could help.

If your noise value is very high (like -30 dBm instead of -90 dBm), there’s interference from other devices, Wi-Fi or otherwise, in the same band, and you again may need to move the base station or pick a different channel.

Wednesday, October 22, 2014

BBEdit 11

BBEdit 11 is a great update with lots of good changes. Some of my favorites:

Yosemite Phone Home

The fix macosx folks have a Git repository showing all the data that Yosemite sends to Apple, with different preferences settings:

When the user selects ‘About this Mac’ from the Apple menu, Yosemite phones home and s_vi, a unique analytics identifier, is included in the request. (s_vi is used by Adobe/Omniture’s analytics software).

Speculation is that it is looking up the marketing name of the Mac model. The cookie was first set when visiting Apple’s Web site.

The logs show that a copy of your Safari searches are still sent to Apple, even when selecting DuckDuckGo as your search provider, and ‘Spotlight Suggestions’ are disabled in System Preferences > Spotlight.

This is because Safari has a separate preference (under Search, not Privacy) to turn off Spotlight Suggestions.

When setting up a new Mail.app account for the address admin@fix-macosx.com, which is hosted locally, searching the logs for “fix-macosx.com” shows that Mail quietly sends the domain entered by the user to Apple, too.

My guess is that Apple has a database of mail server configuration information to help make the setup process smoother for users.

I don’t think Apple is doing any nefarious here, but it is a good exercise to make this sort of list. I hope that Apple is doing so internally and that one day they will be more transparent about it the way they are about iOS security. The current privacy policy is a good start.

An open question is the extent to which Tim Cook’s vision is possible:

A few years ago, users of Internet services began to realize that when an online service is free, you’re not the customer. You’re the product. But at Apple, we believe a great customer experience shouldn’t come at the expense of your privacy.

Cook frames it as Apple not needing your information because it isn’t monetizing it, but there are definitely cases where having more information would help Apple improve the user experience—at the expense of privacy. It is not always possible to maximize both.

16 GB

John Gruber:

There’s no doubt in my mind it’s good short-term business sense to go with a 16/64/128 lineup instead of 32/64/128. But Apple is not a short-term business. They’re a long-term business, built on a relationship of trust with repeat customers. 16 GB iPads work against the foundation of Apple’s brand, which is that they only make good products.

Apple has long used three-tier pricing structures within individual product categories. They often used to label them “Good”, “Better”, and “Best”. Now, with these 16 GB entry-level devices, it’s more like “Are you sure?”, “Better”, and “Best”. Fine, keep the 16 GB models around for expert business and education buyers who know that they really don’t need more storage space. But don’t put devices on the tables in Apple retail stores that you wouldn’t recommend as a good product and good value to typical customers.

Lebeaupin on Swift

Pierre Lebeaupin:

Nested block comments do not work. They cannot be made to work (for those who care, I filed this as rdar://problem/18138958/, visible on Open Radar; it was closed with status “Behaves correctly”). That is why the inside of an #if 0 / #endif pair in C must still be composed of valid preprocessing tokens.

[…]

Little did I know that not only Swift method calls are not more dynamic than Objective-C method calls, but in fact don’t use objc_msgSend() at all by default! Look, objc_msgSend() (and friends) is the whole point of the Objective-C runtime. Period. Everything else is bookkeeping in support of objc_msgSend(). […] Apple is trying to convince us of the Objective-C-minus-the-C-part lineage of Swift, but the truth is that Swift has very little to do with that, and much more to do, semantically, with C++. This would never have happened had Avie Tevanian still been alive working at Apple.

[…]

I find it very odd that there is no description or documentation of threading in Swift. And yes, I know you can spawn threads using the Objective-C APIs and then try and run Swift code inside that thread; that’s not the point. The point is: as soon as I share any object between two threads running Swift code, what happens?

[…]

I don’t like: the lacks of a narrative, or at least of a progression, in the book. Where is the rationale for some of the less obvious features? Where is the equivalent of Object-Oriented Programming with Objective-C (formerly the first half of “Object-Oriented Programming and the Objective-C Programming Language”)? This matters, we can’t just expect to give developers a bunch of tools and expect them to figure out which tool is for which purpose, or at least not in a consistent way. Providing a rationale for the features is part of a programming language as well.

[…]

Swift seems to go counter to all historical programming language trends: it is statically typed when most of the language work seems to trend towards more loosely typed semantics and even duck typing, it compiles down to machine code and has a design optimized for that purpose when most new languages these days run in virtual machines, it goes for total safety when most new languages have abandoned it. I wonder if Swift won’t end up in the wrong side of history eventually.

[…]

Swift, with its type safety, safe semantics and the possibility to tie variables as part of control flow constructs (if let, etc.), promises to capture programmer intent better than any language that I know of, which ought to ease maintenance and merge operations; this should also help observability, at least in principle (I haven’t investigated Swift’s support for DTrace), and might eventually lead to an old dream of mine: formally defined semantics for the language, which would allow writing proofs (that the compiler could verify) that for instance the code I just wrote could not possibly crash.

CloudKit

John Siracusa:

CloudKit isn’t just the network data storage API that developers have always wanted from Apple; apparently it’s also the API that Apple has always wanted for itself. Both iCloud Drive and Apple’s new iCloud photo library service (upon which the upcoming replacement for iPhoto is being built) were written from scratch on top of CloudKit. Looking at it another way, if CloudKit doesn’t work well, third-party developers won’t be the only ones suffering.

Apple’s ability to make sure its servers are always available and that they answer requests in a timely manner is still an open question. As anyone who’s ever gotten an inscrutable error or interminable spinner from an Apple TV while trying to watch a video from the iTunes Store knows, Apple’s use of a network service does not necessarily ensure its reliability or speed.

The most reassuring thing about CloudKit is its design. It looks a lot more like a well-executed client library for a traditional Web service than a Cocoa API that just happens to have a network component. It’s still far from the cross-platform, multi-language ideal presented by Microsoft’s Azure Mobile Services, but Azure can’t hope to compete with the platform integration of CloudKit on OS X and iOS.

Roustem Karimov:

We don’t have to guess when something goes wrong anymore, and we no longer have to tell our users to perform a set of magic steps hoping that some of them would trigger iCloud to work. CloudKit solved the problems we had with the old iCloud.

It’s a great sign that Apple is eating its own dog food and no longer trying to abstract away the network. I think it’s a mistake to only make CloudKit available to App Store apps.

Code Signing Is Flaky and Unreliable

Tom Harrington:

For whatever it’s worth, I’ve been developing iOS apps since early 2008 and I regard the code signing process as conceptually straightforward. In practice though, it’s flaky and unreliable. More than six years in and I still routinely lose a day to trying to get code signing working again.

[…]

Code signing works or doesn’t work for incomprehensible reasons. Getting signing working again does not result in learning any useful skills that can be applied to future attempts.

The bug’s original title was more colorful.

Passenger Privacy in the NYC Taxicab Dataset

Neustar (via Landon Fuller):

In my previous post, Differential Privacy: The Basics, I provided an introduction to differential privacy by exploring its definition and discussing its relevance in the broader context of public data release. In this post, I shall demonstrate how easily privacy can be breached and then counter this by showing how differential privacy can protect against this attack. I will also present a few other examples of differentially private queries.

There has been a lot of online comment recently about a dataset released by the New York City Taxi and Limousine Commission. It contains details about every taxi ride (yellow cabs) in New York in 2013, including the pickup and drop off times, locations, fare and tip amounts, as well as anonymized (hashed) versions of the taxi’s license and medallion numbers. It was obtained via a FOIL (Freedom of Information Law) request earlier this year and has been making waves in the hacker community ever since.

The release of this data in this unalloyed format raises several privacy concerns. The most well-documented of these deals with the hash function used to “anonymize” the license and medallion numbers. A bit of lateral thinking from one civic hacker and the data was completely de-anonymized. This data can now be used to calculate, for example, any driver’s annual income. More disquieting, though, in my opinion, is the privacy risk to passengers. With only a small amount of auxiliary knowledge, using this dataset an attacker could identify where an individual went, how much they paid, weekly habits, etc. I will demonstrate how easy this is to do in the following section.

cjbprime:

Amazing. If you said to someone “Hey, I wanted to know where you went after the cab picked you up last year, so I called up the cab company and asked them where they dropped you off and they told me”, they would be outraged at (your behavior and) the breach of privacy shown by the cab company. But the city released a dataset that allows exactly this query. What were they thinking?

Something else that could be mentioned in the linked article: if someone you were with got in a cab in 2013, and they told you where they were going, and you remember the approximate time and location, you can tell whether it was their true destination regardless of how many other people were being picked up at the time, because you don’t have to find the exact ride they took, you only have to see whether any rides went to the place they told you.

This search is even extremely resistant to the differential privacy suggested by the post’s authors. I’d be much happier simply stating that location data is not de-identifiable, and no-one should use a cab in a city that logs location data if they aren’t happy with an adversary knowing where they went.

Tuesday, October 21, 2014

Yosemite Developer Documentation

Monday, October 20, 2014

The Gentleman Who Made Scholar

Steven Levy:

Some people have never heard of this service, which treats publications from scholarly and professional journals as a separate corpus and makes it easy to find otherwise elusive information. Others have seen it occasionally when a result pops up on their search activity, and may even know enough to use it for a specific task, like digging into medical journals to gather information on a specific ailment. But for a significant and extremely impactful slice of the population: researchers, scientists, academics, lawyers, and students training in those fields — Scholar is a vital part of online existence, a lifeline to critical information, and an indispensable means of getting their work exposed to those who most need it.

The iPad’s Future

Ben Thompson:

This is certainly a big comedown from the sky-high expectations that followed the iPad’s explosive growth in 2010 and especially in 2011, when many conjectured that the iPad business would ultimately be bigger than the iPhone. The question, though, is if the decline in the iPad’s fortunes is simply the natural order of things, Apple cannibalizing itself before others have the chance, or a missed opportunity.

I think that it’s all three.

[…]

The problem is that must-have apps are exactly what the iPad needs to become indispensable. And sadly, while Apple seemed to shrug off much of that 1997 paranoia at this year’s WWDC, they didn’t make any real changes to the App Store policies around trials and upgrades that would truly make a difference. Truth be told, though, this year’s WWDC was likely already too late. By then iPad sales had already started to decline on an annual basis, giving developers even less incentive to focus on the iPad.

Jean-Louis Gassée:

Indeed, after growing faster than anything in tech history, tablets have stalled. For the past three quarters unit sales have plummeted: iPad sales fell by 2.29% in the first (calendar) quarter of 2014 versus the same quarter in 2013, and they fell by 9% in Q2.

[…]

I once thought the mini was the “real” iPad because I could carry it everywhere in a jacket pocket. But about two weeks ago I bought an iPhone 6 Plus, and I haven’t touched my mini since. (As punishment for my sin, I found 52 apps awaiting an update when I finally turned on the mini this morning…) Now I have an “iPad micro” in my (front) jeans pocket…and it makes phone calls.

Update (2014-10-22): John Gruber:

Everything Apple is promoting about the Air 2 is true, both in terms of what you can objectively measure, and in terms of how it feels to use it. It’s thinner, lighter, faster, and has a better display and better camera. And, yes, Touch ID is great, especially if you’ve been using it for the last year on your iPhone.

I don’t think I’m going to buy one, though.

For the last two years, my day-to-day iPad has been a Mini. I like the Mini form factor so much that I switched to the original non-retina model in late 2012 even after having used the retina iPad 3 for six months or so. In terms of visual acuity, that was painful. In terms of hold-ability, though, it was a huge win. Last year I didn’t hesitate to stick with the Mini form factor once it went retina.

Update (2014-10-27): Lukas Mathis

Apple’s behavior severely limits the types of apps that are available on iOS. Whether it is due to actual restrictions, or just due to fear on the part of developers, there are a lot of «safe» apps on iOS, but very few apps that try to break the mold of what people expect from their devices. You get a lot of games, podcast clients, todo lists, camera apps, text editors, things like these — but not a lot of stuff that colors outside of these lines.

None of these app types work substantially better on larger screens.

[…]

The iPad isn’t selling better because Apple’s rules prevent it from being the truly compelling device that it could be.

Update (2014-10-30): Khoi Vinh:

What will it take to get there? The short answer is a new commitment from Apple to this product line, and a willingness to reexamine the company’s entire approach to date. For instance, I’m not entirely sure it’s in the best interest of the iPad to be tied so closely to the iPhone. Ultimately, a more aggressive branching of the iPad’s operating system away from the iPhone’s operating system may be necessary. Doing so may be the only way that Apple starts to answer the critical questions at the heart of the line: “What, exactly, is unique about the iPad? What can it do better than any other device? And why can’t customers live without it?”

Rui Carmo:

Apple is constantly shirking away from letting the iPad become a productivity tool, and it’s going to cost them in the long run.

Trusting iCloud

Nate Boateng:

Signing out and back into iCloud deleted the last 3 years of vacation shared photo streams I had…

To be clear, signing out and back into iCloud today broke nearly every piece of it. Photo Stream, Family Sharing, iCloud Drive. All of it.

Via Joe Steel:

The truly disturbing thing about what happened to Nate was that he didn’t trust Apple, and had a backup of everything. I don’t trust Apple, and I have a backup of everything. At what point is distrust a sign of a problem, and not just paranoia? Even Dan Moren, doing some Color Commentary™ on Thurday’s Apple Event seemed a little scared of the “Public Beta” moniker on iCloud Photo Library.

Andreas Zeitler (via John Gordon):

On iOS 8, the previous fix still works, but now this “fix” has to be applied for each app individually. One app stops syncing? Reboot the device!

I reboot my device about three times a day now, just to get iCloud syncing back, just for one specific app. If that doesn’t fix it, well, users report that you can delete the app and install it again, then sometimes iCloud does seem to come back. If not, well, try installing the app again. If that doesn’t fix it, you can always restore the device, which usually fixes the problem.

Sunday, October 19, 2014

1pass

1pass is an open-source Python library for reading 1Password’s .agilekeychain file format (via Jonathan Wight).

Spotlight Suggestions and Privacy

fix macosx (via Landon Fuller):

If you’ve upgraded to Mac OS X Yosemite (10.10) and you’re using the default settings, each time you start typing in Spotlight (to open an application or search for a file on your computer), your local search terms and location are sent to Apple and third parties (including Microsoft).

Mac OS X has always respected user privacy by default, and Mac OS X Yosemite should too. Since it doesn’t, you can use the code to the left to disable the parts of Mac OS X which are invasive to your privacy.

I think previous versions of Mac OS X did have Safari send partial searches to Google by default. However, Spotlight searches have not previously left your Mac.

Update (2014-10-19): To be clear, you don’t need this script to improve your privacy. The Spotlight Suggestions and Bing Web Searches boxes are readily uncheckable in System Preferences. Rather:

There’s no single “local search only” toggle, and you have to cross-reference the documentation provided in System Preferences against the list of “Search Results” to figure out which of the options actually sends your queries to Apple.

I wanted something simple, that I knew worked, and I could just tell family to run themselves, so I put this together. It’s a convenient way to apply the settings, a jumping-off point for a more involved effort to resolve some of the other remaining privacy issues on Yosemite, and a handy way to get the privacy message across.

Since Apple hasn’t provided a single switch, it makes sense to have a single script that can be kept up-to-date.

Update (2014-10-19): There is also another checkbox called “Include Spotlight Suggestions” in Safari’s preferences.

Update (2014-10-20): Ashkan Soltani and Craig Timberg:

Apple officials said Monday that the data collection is intended only to improve the quality of searches conducted through Spotlight, a standard feature on both Mac computers and Apple’s mobile devices, such as the iPhone and iPad. The user identification number rotates after 15 minutes to a new identifier, they said, and the location and search query information is not used to create profiles of users or to deliver targeted advertising.

[…]

Testing by The Washington Post found that the locations revealed in Spotlight searches can be strikingly precise, placing a user within a particular building in Washington, D.C., even though the disclosure box on Spotlight refers to collecting “your approximate location.”

Update (2014-10-21): John Gruber:

The only thing Apple could do differently is make this another one of the you-have-to-explicitly-opt-in stages when you first upgrade to Yosemite or create an account on a new Mac.

Update (2014-10-22): Rich Mogull:

To manage your session, Apple uses a one-time session ID that lasts for 15 minutes. Neither the session ID nor the search query use your IP address or any other device identifier. Session IDs also aren’t coordinated or correlated, so there is no way for Apple to track historical usage by chaining session IDs together. In short, your query exists within a 15-minute bubble that isn’t tied to you directly. This is different, for example, than Siri, which uses a more persistent device identifier since it requires more context over time (due in large part to the overhead of voice recognition).

Apple:

Information on the three most recently used apps on the device is included as additional search context. To protect the privacy of users, only apps that are in an Apple-maintained whitelist of popular apps and have been accessed within the last three hours are included.

Search feedback sent to Apple provides Apple with: i) timings between user actions such as key-presses and result selections; ii) Spotlight Suggestions result selected, if any; and iii) type of local result selected (e.g., “Bookmark” or “Contact”). Just as with search context, the search feedback is not tied to any individual person or device.

Apple retains Spotlight Suggestions logs with queries, context, and feedback for up to 18 months. Reduced logs including only query, country, language, date (to the hour), and device-type are retained up to two years. IP addresses are not retained with query logs.

In some cases, Spotlight Suggestions may forward queries for common words and phrases to a qualified partner in order to receive and display the partner’s search results. These queries are not stored by the qualified partner and partners do not receive search feedback. Partners also do not receive user IP addresses. Communication with the partner is encrypted via HTTPS.

New iWork File Formats

The new versions of the iWork apps change the file formats again, but it’s not as drastic a change as last year. Numbers 3.2.2 created a package folder with some metadata and a ZIP archive containing the .iwa files. Numbers 3.5 seems to use the same structure except that the .numbers file itself is the ZIP archive.

I repeated my CSV file import test from last year, and I don’t see any speed or size changes between the two versions of Numbers.

Aperture Import Plug-in for Lightroom

Adobe:

As promised in a blog post here, we are proud to introduce the Aperture and iPhoto import plugin for Lightroom 5. The plugin allows Aperture and iPhoto customers to migrate their images and key metadata (such as keywords, events, project structure) into Lightroom catalogs in a seamless way.

The problem remains that I don’t really want to use Lightroom. Also, it is significant that image adjustments and stacks don’t import.

It’s About the Encryption Keys

Stefan Reitshamer:

There’s a lot of talk on the interwebs about encryption. Encryption is a necessary but not sufficient condition for maintaining control of your data. Controlling access to the encryption key is just as important.

Lots of articles that reference encryption fail to mention this, and that’s confusing for people who are not crypto experts.

The iPad Zombie

Allen Pike (via John Gruber):

Apple still sells the original iPad mini. Today, they announced that not only would they continue to sell it, but cut the price to $249, making it the cheapest iPad ever. If they follow their usual pattern of leaving the iPad line as-is until next fall, the iPad 2’s internals will live on for 4.5 years.

[…]

We already see this pain on the App Store, especially with games. There is no mechanism to specify on the App Store which CPU is required for your app.

Yosemite’s Speakable Scripts

Christopher Breen:

In Yosemite, Speakable Items are gone. Their functionality has been merged with the Dictation architecture of the OS and morphed into a new feature called Dictation Commands. But unlike Speakable Items, Dictation Commands are not separate from the rest of the speech architecture. Turn on Dictation and you automatically gain access to Dictation Commands. At any time—even during a dictation session—you can speak the title of a command to have it recognized and executed.

[…]

When you launch the Automator application in Yosemite, the workflow template chooser offers a new option: Dictation Command. Using this new workflow template you can create a system Dictation Command that automates any process or task that Automator is capable of performing.

Daniel Jalkut:

It seems the scripts are run not as the streamlined items that they are but are instead sort of wrapped in an automator action and run. It’s nice that you don’t have to go out of your way to translate a script into an Automator Workflow, but unfortunately this means that “Speakable Scripts” do put up the little Automator gear icon in the menu bar, and are probably ultimately slowed down at least a bit by being run as a full-on workflow.

I wonder if saving a script as an application would work any better.

Update (2014-10-19): Daniel Jalkut:

Wait a minute, maybe it is running them as native scripts. There’s just a change on OS X Yosemite with how the system runs scripts, such that they always show an Automator-style progress indicator in the menu bar. I find this pretty irksome as a default behavior because for example short-lived scripts don’t need progress to be indicated at all.

Mutable Collections in Swift

Mike R. Manzano:

How do you create an var that holds an immutable Array? As in a var that you can assign different immutable Arrays to?

BJ Homer:

Because Swift arrays and dictionaries can never be shared, there is no distinction between mutating an existing collection and re-assigning a new collection. The behavior of the code is exactly the same. In either case, the owner’s setter method is called whenever the array is modified.

So to answer the original question, there is no syntax to specify a variable that holds an immutable array because there is nothing that such syntax would add. Swift addresses the issues that made NSArray and NSMutableArray necessary in the first place. If you need a shared array, you can still use the Cocoa types. In every other case, Swift’s solution is safer, simpler, and more concise.

On the whole, I think this is probably a good direction. The downsides would seem to be that the performance model is less clear and that it’s more work to write your own data types as struct-class pairs.

One somewhat common pattern in my Objective-C code is a (often recursive) method that takes a mutable array or dictionary as a parameter and builds it up. You can’t do this with var in Swift because that only lets you modify the collection within the method. However, you can use inout to have Swift “return” the last value to the caller.

This is not the same as passing around an NSMutableArray, though. For example, consider what would happen if there were multiple threads involved. Also, inout only lasts for the duration of the method; the collection cannot (as far as I know) be stashed in another object and then mutated (back in the caller) later.

Update (2014-10-19): Christoffer Lernö responds via Twitter.

Friday, October 17, 2014

AVFoundation in Yosemite

Philip Hodgetts:

There is a lot of new audio functions. A lot, as in heaps.

[…]

We’ve had AVAssets and AVCompositions in AVFoundation up until now, which do not support reference movies. It seems a reasonable inference that an AVFragmentedMovie is what we’d have called a QT Reference movie in the past.

Update (2014-10-18): Mike Ash:

I was excited to try AVAudioEngine now that 10.10 is here. But it’s just sadness and silent failures and mysterious crashes. Sigh.