Archive for January 8, 2018

Monday, January 8, 2018

Conditional Conformance in the Standard Library

Ben Cohen:

The most noticeable benefit of conditional conformance is the ability for types that store other types, like Array or Optional, to conform to the Equatable protocol. This is the protocol that guarantees you can use == between two instances of a type.

[…]

Having equatable elements gives collections other helper functions for tasks like searching[…]

[…]

This approach also works for Codable. If you try and encode an array of non-codable types, you’ll now get a compile-time error instead of the runtime trap you used to get.

[…]

If the collection we’re splitting is bidirectional, we ought to be able to make our splitting wrapper bidirectional too. In Swift 4.0, the way to do this was pretty clunky. You had to add a whole new type, LazySplitBidirectionalCollection, which required Base: BidirectionalCollection and implemented BidirectionalCollection. Then, you overloaded the split method to return it where Base: BidirectionalCollection.

Now, with conditional conformance, we have a much simpler solution: just make LazySplitCollection conform to BidirectionalCollection when its base does.

iCloud Drive Can Strip Metadata From Your Documents

Apple:

Apps create files and directories in iCloud container directories in exactly the same way as they create local files and directories. And all the file’s attributes are saved, if they add extended attributes to a file, those attributes are copied to iCloud and to the user’s other devices too.

Howard Oakley:

I have examined files with a rich collection of extended attributes, under 10.12.6 and 10.13.2, on local storage and in iCloud Drive. This confirms that most xattrs are stripped by iCloud Drive in this fashion.

Xattrs removed include:

  • com.apple.FinderInfo
  • com.apple.metadata:_kMDItemUserTags
  • com.apple.ResourceFork
  • com.apple.serverdocs.markup
  • net_sourceforge_skim-app_ series
  • net_sourceforge_skim-app_notes
  • net_sourceforge_skim-app_rtf_notes
  • net_sourceforge_skim-app_text_notes
  • co.eclecticlight.[any]

[…]

Xattrs which are preserved include:

  • com.apple.TextEncoding
  • com.apple.metadata:kMDItemDownloadedDate
  • com.apple.metadata:kMDItemWhereFroms
  • com.apple.metadata:kMDLabel_ series
  • com.apple.quarantine

For me, iCloud Drive preserves tags, but labels, resource forks, and any third-party extended attributes have always been lost. I don’t understand why Apple’s documentation claims otherwise.

Previously: Dropbox 1.0.

Update (2018-01-09): See also: Hacker News.

Update (2018-01-12): See also: Howard Oakley.

Update (2018-01-29): Howard Oakley:

When you access your iCloud Drive from two or more client systems, iCloud Drive knows which files originated from each of the clients, and keeps track of that.

[…]

What is most startling is the way that it adds an apparently unique xattr of type com.apple.cscachefs to many files within application bundles. iCloud Drive doesn’t appear to add quarantine flags (com.apple.quarantine), but adds com.apple.cscachefs instead – only when accessed from a second client.

[…]

Some com.apple.* xattrs, like com.apple.ResourceFork and com.apple.serverdocs.markup, always get stripped; others will only be stripped if they exceed a certain size, which varies according to the type of xattr. All xattrs of 80 KB or larger are removed, but iCloud allows com.apple.metadata:kMDItemCopyright, for example, to reach 24 KB size and leaves it intact. If you rely on a particular xattr passing unscathed through iCloud’s filters, you need to test it carefully over a range of sizes and situations.

Update (2020-03-27): Howard Oakley:

However, when you access files which have been uploaded to iCloud from a different Mac or iOS device, iCloud doesn’t preserve all xattrs by any means. Some are often but not always preserved, others usually stripped, and one type invariably stripped.

How to Disable macOS High Sierra Upgrade Notifications

Elizabeth Jones (via John Gordon):

Every time I turn on my MacBook (2017,) it immediately starts up with that exasperating High Sierra notice to upgrade to High Sierra so I can “enjoy the latest technologies and refinements.” And it’s even popping up on my iMac (2015 with Fusion Drive,) that Apple itself recommends NOT updating to High Sierra.

[…]

After spending a lot of time trying things, I came upon the easiest of solutions, all done within the Mac App Store.

  • Click on mac OS High Sierra Notifications Details option OR just open Mac App Store
  • In the banner for macOS High Sierra, control-click anywhere inside that banner
  • Select Hide Update and bingo, no more notification!

However, updating to macOS 10.13 is currently the only way to get Apple’s Meltdown security update.

Update (2018-01-11): Andrew Abernathy:

Welp. I just got another alert to upgrade to High Sierra despite having hidden the update yesterday. :(

Let Facebook Rejoin the Open Web

Dave Winer:

The fact that I have to post a screen shot of his message is a perfect demo of the problem. I could have posted this on Facebook, but then I wouldn’t have been able to use links, style or images. The post couldn’t have a title. And if I wanted to include a podcast I couldn’t. Or I could post it on my blog, as I have, and link to the screen shot, because who knows what you’ll see if I post a direct link to the message.

Panic Discontinues Transmit for iOS

Cabel Sasser (Hacker News):

Transmit iOS made about $35k in revenue in the last year, representing a minuscule fraction of our overall 2017 app revenue. That’s not enough to cover even a half-time developer working on the app. And the app needs full-time work — we’d love to be adding all of the new protocols we added in Transmit 5, as well as some dream features, but the low revenue would render that effort a guaranteed money-loser. Also, paid upgrades are still a matter of great debate and discomfort in the iOS universe, so the normally logical idea of a paid “Transmit 2 for iOS” would be unlikely to help. Finally, the new Files app in iOS 10 overlaps a lot of file-management functionality Transmit provides, and feels like a more natural place for that functionality. It all leads to one hecka murky situation.

[…]

  • This does not affect Transmit 5 for Mac. It’s doing extremely well
  • This also does not affect Coda iOS and Prompt iOS, both of which are still going strong

Jason Snell:

Totally get why you are doing it, still makes me extremely sad. Wouldn’t it be nice if Files supported other server protocols directly?

This is a real bummer for me personally, because Transmit is a huge part of my iOS workflow.

Steve Troughton-Smith:

Transmit, an app for transferring files, spent most of its iOS lifetime on a platform that didn’t have a user-accessible filesystem or files, where users learned to do without—tough to gauge anything from its success or lack thereof up to this point. No doubt it’ll return someday

David Sparks:

What is even more upsetting is that an app of the calibre of Transmit for iOS is a financial failure and none of us are much surprised. There are so many iPads and iPhones out in the world. Granted not everyone will need a world-class file sharing app, but enough should need it that an app like Transmit for iOS can flourish.

If this were a simple problem, it would already be solved, but I think it is a combination of factors: hardware, operating system, software, and App Store climate.

Dr. Drang:

I don’t upload podcasts, but as I use my iPad Pro more and more (I’m writing on it now), Transmit—in particular, its Share Sheet—has become a important part of my blog writing process.

Matt Birchler:

I have transmit on the second page on my iPhone and the first page of my iPad. It’s one of the first apps I mention when talking about how much more I like iOS than Android as well as being one of the apps that lets me go Mac-free more easily.

Michael Rockwell:

I’m not sure if Panic would have found success by transitioning to a subscription-based business model or if charging more for Transmit would have actually resulted in more revenue. But it’s clear to me that Panic needed a way to get more money from users that rely on and loved using the app.

Stephen Hackett:

I can’t help but see this is a bad omen for the iOS productivity scene. An FTP client may not be as exciting as whatever the hot GTD app of the year may be, but it’s the type of app that signals stability.

Ruffin Bailey:

I’m also surprised by this...

Also, paid upgrades are still a matter of great debate and discomfort in the iOS universe, so the normally logical idea of a paid “Transmit 2 for iOS” would be unlikely to help.

Is that really not worth trying?

My guess: with the sales they had, it was an iffy proposition even if lots of customers upgraded, and surely they have other apps that are likely to offer a better return for their development time. If you’re already busy, do you hire more or just drop the app for now? I do expect that it will come back.

John Gruber:

iOS is a vastly bigger platform, but high-quality apps that you pay for to use for work still do better on the Mac. Sure makes me wonder just how much of App Store revenue is from games.

Nick Heer:

But something is clearly still not right in the App Store economy if developers are finding it as difficult as they are — generally speaking — to make a living building apps for one of the world’s biggest platforms. Making progress on this, I think, ought to be one of Apple’s highest priorities this year. 2018 marks the tenth anniversary of the App Store and, while they may generally be averse to marking historical milestones, it would be a shame if independent developers had less hope of a successful career this year than they did in 2008. Based solely on the revenue and growth Apple announced last Thursday, there should be hope for developers. The giant pool of money is clearly there; unfortunately, smaller developers simply aren’t seeing enough of it. Whether that change must start with things Apple controls, or developers, or users, I don’t know, but it would be a shame if the App Store becomes the place for virtually all users to download Facebook Messenger, Google Maps, and a manipulative game — and that’s it.

Previously: Status Board Discontinued.

Update (2018-01-09): Cabel Sasser:

🤔 An interesting mental debate today after a weekend of intense thoughts and feedback from users: what’s worse, pulling an app from sale that you can’t reasonably maintain, or letting it sit in the App Store unmaintained?

② Pulling from sale is ripping off the band-aid. It doesn’t feel great to do, it makes some people feel dumb for buying your app (which I hate), it makes you look a bit stupid (which I hate). But it’s honest and truthful and is appreciated by many:

③ On the other hand, keeping it in the store unmaintained means people can still find it and buy it and use it! It does a ton today! But feels gross to sell an uncertain future? And how long until it breaks? And how long until you’re buried in 1-star “app is abandoned!” reviews?

④ I have no great answer. But I’ll note we’ve dropped 5 apps in our lifetime (Audion, CandyBar, Unison, Status Board, and Transmit iOS). Knowing when to hold ‘em and when to fold ‘em certainly isn’t the only reason we’ve been around for 20 years… but I bet it hasn’t hurt?

Update (2018-01-17): Federico Viticci:

It’s difficult to pin down what, exactly, made Transmit for iOS unprofitable. The iOS counterpart always lagged behind the cloud integrations from the Mac app (Backblaze B2 and Rackspace Cloud Files, for instance, never made it to iOS); Panic didn’t update Transmit to take advantage of major additions to iOS 11 such as Files and drag and drop; perhaps more importantly, Transmit for iOS is a product of the pre-iOS 11 era, back when the concepts of desktop-like file management and drag and drop were alien to the platform. Ultimately, I think Transmit for iOS lived and (slowly) died because we had it too soon.

But this isn’t a post-mortem for Transmit on iOS, which, according to Panic, may even relaunch as a new app on the Store someday. Instead, I’d like to take a quick tour of some of the alternatives for Transmit available on iPad today. In case Panic decides to pull Transmit from the App Store, or if the app stops working in a future release of iOS, these FTP clients and file managers should compensate for the features of Panic’s app. Most of them don’t offer the same sophisticated and polished UI design, but some of them may even turn out to be more flexible and better integrated with iOS than Transmit.

Computer Latency: 1977-2017

Dan Luu (tweet):

These are tests of the latency between a keypress and the display of a character in a terminal (see appendix for more details).

[…]

Compared to a modern computer that’s not the latest ipad pro, the apple 2 has significant advantages on both the input and the output, and it also has an advantage between the input and the output for all but the most carefully written code since the apple 2 doesn’t have to deal with context switches, buffers involved in handoffs between different processes, etc.

On the input, if we look at modern keyboards, it’s common to see them scan their inputs at 100 Hz to 200 Hz (e.g., the ergodox claims to scan at 167 Hz). By comparison, the apple 2e effectively scans at 556 Hz.

Previously: Touchscreen Latency.