Archive for January 7, 2019

Monday, January 7, 2019 [Tweets] [Favorites]

GitHub Now Offers Unlimited Free Private Repos

GitHub (Hacker News):

GitHub Free now includes unlimited private repositories. For the first time, developers can use GitHub for their private projects with up to three collaborators per repository for free. Many developers want to use private repos to apply for a job, work on a side project, or try something out in private before releasing it publicly. Starting today, those scenarios, and many more, are possible on GitHub at no cost. Public repositories are still free (of course—no changes there) and include unlimited collaborators.

Update (2019-01-08): Paulo Andrade:

So Microsoft bought HockeyApp and are doing a pretty good job so far of turning it into @VSAppCenter. Then they bought @github and added free private repos. At this rate it looks like I’ll be coding Swift in @code soon

My question is:

What’s Apple doing with @buddybuild?

Previously: App Center Will Take It From Here, Apple Acquires Buddybuild.

iTunes Video and AirPlay on Samsung TVs

Eric Slivka:

Samsung today announced that it has worked with Apple to integrate iTunes movies and TV shows, as well as AirPlay 2 support, into its latest smart TVs. The features will roll out to 2018 models via a firmware update this spring and will be included on new 2019 models. iTunes movie and TV show access will come via a new dedicated app for Samsung’s TV platform, available in over 100 countries.

Eric Slivka:

- Apple says “leading TV manufacturers” will be including AirPlay 2 support in their TVs, indicating that this initiative will not be a Samsung exclusive. Apple has not, however, announced additional TV partners or a timeline for when AirPlay 2 will come to these other brands. Samsung’s support is rolling out in a firmware update for 2018 TVs and built into 2019 models “beginning this spring.”

- AirPlay 2-enabled TVs will act just like any other AirPlay 2 speaker, meaning you can send many different types of audio from an iOS device or your Mac to your TV. Music being sent to your TV via AirPlay 2 can also be synced with other AirPlay 2 speakers.

Great news. I’d been hoping they’d do this for a long time. It makes my purchased content seem more secure, given that I’ve had problems with the old Apple TV hardware and don’t want to buy a new Apple TV. Less reason to make the big jump to Amazon and fragment my library.

Benjamin Mayo:

In other words, Samsung TVs will be able to watch 4K iTunes content before Macs can.

Ryan Jones:

Hm, so are cross-platform Services the entry drug to Apple or the ecosystem around iPhone? I’m not sure.

But it is hard to imagine Music and TV competing well against Spotify, Netflix, YouTube TV without a native advantage.

Ryan Jones:

They just aren’t built for any of this. Really really feels like spreadsheet growth-hunting.

Josh Centers:

Everyone says I’m wrong here, but Samsung won’t be the last smart TV platform to get iTunes. And once it’s as universal as Amazon Video, you’d be crazy to drop $180 on an Apple TV.

Mitchel Broussard (in 2016):

HTC announced its new smartphone, the HTC 10, revealing that the Android device will have the ability to wirelessly play audio through devices and speakers that support streaming via Apple’s AirPlay feature (via SlashGear).

Previously: Cultural Insularity and Apple TV, Movies Anywhere, Amazon Offering Apple Products.

Update (2019-01-08): Colin Cornaby:

Still don’t understand why Apple doesn’t offer a built in option for a Mac to become an AirPlay 2 target.

Nilay Patel:

Apple tells me that no smart TV content tracking is allowed on AirPlay 2 streams on Vizio and LG TVs, in addition to preventing Samsung from tracking the iTunes app. Sounds like they pushed this policy with the industry, good for them

The wacky part is Apple can’t prevent TV makers from content tracking on HDMI inputs, so a smart TV can track what you watch on an Apple TV!

Joe Rossignol:

A few days ago, Apple announced that AirPlay 2–enabled smart TVs are coming soon from leading manufacturers, and we’ve since seen a series of announcements from Samsung, LG, Sony, and Vizio at CES 2019.

Update (2019-01-09): Benjamin Mayo:

This is great for everyone.

[…]

If Apple had licensed AirPlay video more liberally from the get-go, every TV screen and projector would have it built in already. No need to buy a $100+ peripheral. No need to switch to the Apple TV input. No setup needed.

I am so pleased that Apple has changed their stance here. These partnerships bind Apple customers more closely to the iPhones, iPads and Macs they already own, and improve customer satisfaction and loyalty rates. It will take time for the number of AirPlay 2-enabled TVs sold to be meaningful, but in the course of time, it will be commonplace.

Rene Ritchie:

I’m keeping my Apple TV until Eddy Cue pries it from my Hulk hands.

tvOS interface is much better for me than any of the smartTV stuff, and I trust it to have better updates faster, be more secure and private, and I dream of apps taking off one day. So help me. LOL.

Kirk McElhearn:

Hell is freezing over for Apple because the company has finally accepted that it cannot make enough money from its video offerings just with Apple devices (ie, the iPhone, iPad, and Apple TV). This also suggests that the Apple TV has seen its last iteration. If Apple can put the same apps on any smart TV – which is, of course, not complicated – why have a separate device?

Lee Bennett:

Coz Apple TV provides an app experience not available anywhere else! Long Live Apple TV!

Nick Heer:

But I am not sure that necessarily leads to the end of the Apple TV. I don’t see the company abandoning dedicated hardware just because it has a services business, even for a presently lower-priority product like the Apple TV. It seems to me that it’s more likely that Apple’s TV product may morph to become a full television that they have complete control over. Why not? Most televisions look awfully cheap and are privacy nightmares.

Update (2019-01-11): Josh Centers:

The HomeKit story is a bit more interesting: supported TVs will become HomeKit devices, and as such, you’ll be able to turn them on and off or change their inputs with Siri or Apple’s Home app. You’ll also be able to create HomeKit scenes with actions to control these TVs.

[…]

What’s curious is how only Samsung gets iTunes Movies and TV Shows, but Samsung is the only vendor not providing HomeKit support. Despite that confusion, these announcements may be great news for Apple users who own or plan to buy a supported TV set, but what does it mean for the rest of us, and for Apple’s TV plans going forward?

Why Doesn’t JSONEncoder Conform to the Encoder Protocol?

Kaitlin Mahar:

Inspecting the source code for JSONEncoder, we see it’s a open type that internally uses a private type _JSONEncoder, which does conform to Encoder.

[…]

But why were they designed that way? Why not just make JSONEncoder an Encoder too?

In short, the answer is that they provide very different APIs. The JSONEncoder API is designed to provide a single, simple entry point into encoding, and the Encoder protocol provides a completely different API for customizing how types are encoded.

This makes sense, though it’s kind of odd that the facade and the protocol for the private types both use the same word (Encoder/Decoder). Cocoa distinguishes between NSArchiver/NSUnarchiver, which you use directly, and NSCoder, which is passed to you. Although, that’s also a bit messy because the archivers are subclasses of NSCoder, and so all the other methods are still there.

Swift Import Declarations

Mattt Thompson:

Import declarations have a form that can specify individual structures, classes, enumerations, protocols, and type aliases as well as functions, constants, and variables declared at the top-level:

import <#kind#> <#module.symbol#>

Here, kind can be any of the following keywords[…]

[…]

In practice, isolating imported declarations and submodules doesn’t confer any real benefit beyond signaling programmer intent. Your code won’t compile any faster doing it this way. And since most submodules seem to re-import their umbrella header, this approach won’t do anything to reduce noise in autocomplete lists.

If you gave up after finding that import Module.Class doesn’t work, you actually can do it with import class Module.Class.

When to Use dispatch_async()

Pierre Habouzit:

Re the last discussions, dispatch_async() can be used for 3 different things:

(1) asynchronous state machines (onto the same queue hierarchy), which is a way to address C10k and is fast

[…]

(2) getting concurrency (a better pthread_create())

(3) parallelism (dispatch_apply()

[…]

(1) provided you use dispatch_async_f for the shortest things to avoid allocating blocks, dispatch is fast, and it’s great almost whatever the size of your workitem (assuming you do something meaningful).

(2-3) is way tricker than it looks:

your workitem needs to represent enough work (100µs at the very least, 1ms is best)

your workitems if running concurrently need not to contend, else your perf sinks dramatically.

Contention takes many forms.

[…]

As we presented in WWDC’17: go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure (such as iOS low power mode to name one).

We have repeatedly measured that inefficient concurrency is commonly a 2x cost in time to completion.

It is not a 2x cost in instructions count though, it’s just that concurrency kills your IPC rate and you spend a lot of time just waiting.

Lastly be very careful with micro benchmarks: calling your code 1M times in a loop makes the CPU ridiculously better at running it and while improving micro benchmarks is good, you should always have a macro benchmark to validate that it's a good idea.

David Smith:

What I’m getting at is that we’ve been discovering that the inherent costs of multithreading are a lot higher than they look in microbenchmarks (because microbenches hide cache effects and keep thread pools hot). A lot of iOS 12 perf wins were from daemons going single-threaded.

See also: Modernizing Grand Central Dispatch Usage.

Smartphone Facial Recognition Test

Catalin Cimpanu:

The study, carried by Consumentenbond and its international partners, found that holding up a photo of the phone’s owner is enough to unlock 42 of the tested smartphones.

Any photo will do, such as ones obtained from social media, CCTV footage, or other means.

[…]

According to Consumentenbond, models from Asus, BlackBerry, Huawei, Lenovo, LG, Nokia, Samsung, Sony, and Xiaomi failed such tests.

Apple devices, known for their strong facial recognition feature, survived the tests with their reputation intact, as expected.

The failing Samsung phones were from the cheaper A series; the S series passed, as did other HTC, Huawei, and Lenovo phones.