<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>iStumbler Labs Blog</title><link>https://istumbler.net/blog/</link><description>It's just, like, my opinion, man.</description><atom:link href="https://istumbler.net/blog/feeds/rss.xml" rel="self"/><lastBuildDate>Mon, 19 Aug 2024 00:00:00 -0700</lastBuildDate><item><title>Updating Objective-C Frameworks for Swift Package Manager</title><link>https://istumbler.net/blog/2024/08/19/Objective-Swift-Package-Manager.html</link><description>&lt;h3 id="intro"&gt;Intro&lt;/h3&gt;
&lt;p&gt;You have a dusty old Objective-C framework that you want to publish as a 
&lt;a href="https://developer.apple.com/documentation/xcode/swift-packages"&gt;Swift Package Manager&lt;/a&gt; 
Library. Here’s how.&lt;/p&gt;
&lt;p&gt;iStumbler Labs publishes a number of Objective-C frameworks and they all need updating 
to work with Swift Package Manager:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/KitBridge"&gt;KitBridge&lt;/a&gt; — KitBridge allows you to create views which can be used in iOS, iPadOS, macOS, and tvOS applications.&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/SparkKit"&gt;SparkKit&lt;/a&gt; - Small, Simple and Fast; Line, Pie, Dial, Bar, Ring, Stack and Grid Views for macOS, iOS and tvOS&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/CardView"&gt;CardView&lt;/a&gt; – A Good looking subclasses of NSTextView &amp;amp; UITextView&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/FourCorners"&gt;FourCorners&lt;/a&gt; - Utilities to make working with CoreLocation easier&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/LiveBundle"&gt;LiveBundle&lt;/a&gt; — LiveBundle is a category which provides dynamic updating of resources from your web server&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/Soup"&gt;Soup&lt;/a&gt; – An object oriented persistence framework from iStumbler Labs modeled on the Apple Newton API&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/alfwatt/IcedHTTP"&gt;IcedHTTP&lt;/a&gt; - A very small HTTP Server framework suitable for embedding into iOS or Mac OS Apps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Updating all of these for Swift Package Manager was a bit of a chore but there&amp;rsquo;s an easy to implement process to make it less painless.&lt;/p&gt;
&lt;h3 id="follow-the-project-layout-conventions"&gt;Follow the Project Layout Conventions&lt;/h3&gt;
&lt;p&gt;Swift Package Manager (SPM) expects a particular source code layout, e.g. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;Project&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nx"&gt;Project&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xcodeproj&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;strictly&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;necessary&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Swift&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nice&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nx"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;swift&lt;/span&gt;&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Defines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;targets&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Project&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nx"&gt;Sources&lt;/span&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;projects&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;Project&lt;/span&gt;&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;library&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Header&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;here&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;Tests&lt;/span&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nx"&gt;projectctl&lt;/span&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="err"&gt;←&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Line&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Tool&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It&amp;rsquo;s possible to configure different locations for source files and includes, however it&amp;rsquo;s easiest to follow the SPM convention, as this simplifies the package description and makes it easier for other developers to understand the project structure.&lt;/p&gt;
&lt;h3 id="example-project"&gt;Example Project&lt;/h3&gt;
&lt;p&gt;We’ll use IcedHTTP as an example, here is the finder layout:&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-01-project-layout.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;And the Xcode project layout:&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-02-xcode-layout.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;First create the expected structure in the Finder: &lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-03-expected-layout.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;Then add Sources to your Xcode project as a Group:&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-04-add-Sources.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;Move all the &lt;code&gt;.m&lt;/code&gt; files and the &lt;code&gt;Info.plist&lt;/code&gt; to the Project folder (&lt;code&gt;Sources/IcedHTTP&lt;/code&gt; in this example), and move all the &lt;code&gt;.h&lt;/code&gt; files to &lt;code&gt;Sources/includes&lt;/code&gt; in the Xcode Project Navigator.&lt;/p&gt;
&lt;p&gt;You will need to adjust the &lt;code&gt;Info.plist File&lt;/code&gt; Build Setting for each Target, this is a good time to update your build schemes (in particular, I like to add a Composite Target for building All the targets in the project):&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-05-build-settings.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;At this point check to make sure all your targets build correctly from the Xcode Project&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-06-xcode-build-check.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;Now we can define our Swift Package, create &lt;code&gt;Package.swift&lt;/code&gt; at the root of the project, next to the Xcode Project&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-07-add-new-file.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-08-create-package-swift.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;Content of the &lt;code&gt;Package.swift&lt;/code&gt; file should look like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;swift&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;5.10&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;PackageDescription&lt;/span&gt;

&lt;span class="n"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;IcedHTTP&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;platforms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;macOS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;v10_14&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iOS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;v14&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tvOS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;v14&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;library&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;IcedHTTP&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dynamic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;IcedHTTP&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;IcedHTTP&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once that file is saved we can open the Swift Package in Xcode (you don’t have the close the Xcode Project, they can both be open which is handy for cross-checking the Package definition and Xcode builds. Note that the Package Icon replaces the Xcode Project icon in the upper left corner:&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-09-open-package-swift.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-10-browse-package.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;Any issues with the Package definition will show up automatically, error messages are generally helpful.&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-11-pacakge-build-check.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;If you get errors like &lt;code&gt;'Framework/Framework.h' file not found&lt;/code&gt; you will need to wrap imports using the &lt;code&gt;SWIFT_PACKAGE&lt;/code&gt; compile time &lt;code&gt;#define&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;#if SWIFT_PACKAGE&lt;/span&gt;
&lt;span class="c1"&gt;#import &amp;quot;Framework.h&amp;quot;&lt;/span&gt;
&lt;span class="c1"&gt;#else&lt;/span&gt;
&lt;span class="c1"&gt;#import &amp;lt;Framework/Framework.h&amp;gt;&lt;/span&gt;
&lt;span class="c1"&gt;#endif&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once your package definition is correct, you can see the built product, depending on which run destination you have selected. Choose &lt;code&gt;Product -&amp;gt; Show Build Folder in Finder&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/blog/images/2024/OSPM-12-built-products.png" width="512"&gt;&lt;/p&gt;
&lt;p&gt;Double check your Xcode Project to make sure you can still build using your configured targets.&lt;/p&gt;
&lt;p&gt;Commit your changes to the git repo (you have a git repo, right?) and push them to your favorite git hosting service.&lt;/p&gt;
&lt;p&gt;When you want to &lt;a href="https://developer.apple.com/documentation/xcode/publishing-a-swift-package-with-xcode"&gt;publish a version of your pacakge&lt;/a&gt;, tag your repo with a &lt;a href="https://semver.org"&gt;Sepantic Version String&lt;/a&gt; and push to a public repo.&lt;/p&gt;</description><pubDate>Mon, 19 Aug 2024 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2024-08-19:/blog/2024/08/19/Objective-Swift-Package-Manager.html</guid><category>_posts</category></item><item><title>Functional Reactive Nonsense</title><link>https://istumbler.net/blog/2018/10/20/functional-reactive-nonsense.html</link><description>&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/309/1*sUrELFhihxAtm21dthWzxw@2x.jpeg"&gt;&lt;/p&gt;
&lt;p&gt;There is a perverse inversion in many Senior Level engineering job postings; they rigidly dictate a particular stack of technology, which the company has typically invested considerable time in implementing and tailoring to the needs of their application. While this makes some sense for a mid-level or junior developer its he opposite of what you should be looking for in a Senior engineer:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“It doesn’t make sense to hire smart people and then tell them what to do; we hire smart people so they can tell us what to do.”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;— Steve Jobs&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I suspect that these postings are the result of a manager trying to maintain a system designed by a &lt;em&gt;forward looking&lt;/em&gt; developer who sold the team on it’s benefits but never quite realized them before departing for greener pastures, leaving an big ‘ol tech stack in the repo behind them as they go. By suspicions I mean; I’ve seen this happen more than once. I might have done it myself, maybe, long ago.&lt;/p&gt;
&lt;p&gt;Typically these stacks will provide an “Over the Top” solution to programing on the target platform, replacing some or all of the vendors native tools, with more “modern” or “advanced” or “convenient” or “expressive” or “safe” versions, often in combination, always without quantification. The sales pitches vary from sensible and desirable, such as allowing for cross platform development from a single code base to the outer orbits of architectural astronauts, looking for a &lt;a href="https://en.wikipedia.org/wiki/No_Silver_Bullet"&gt;magic bullet solution&lt;/a&gt; to solve all software development problems with concise self documenting code.&lt;/p&gt;
&lt;p&gt;There are a few stacks I could poke holes in but today I’m going to focus on &lt;a href="http://reactivecocoa.io"&gt;Reactive Cocoa&lt;/a&gt; ( &lt;a href="https://reactnative.dev/"&gt;React Native&lt;/a&gt; was a close second). Generally any framework which intends to replace a portion of the native toolkit is likely to have similar issues, namely the tradeoff between Runtime, Development time, and Maintenance time doesn’t add up for real world usage. Let’s look at each of these in turn.&lt;/p&gt;
&lt;h4 id="runtime-performance-matters"&gt;Runtime Performance Matters&lt;/h4&gt;
&lt;p&gt;Code is CO2. Every line of code which eventually runs on a processor &lt;a href="https://en.wikipedia.org/wiki/Landauer%27s_principle"&gt;consumes energy&lt;/a&gt;. In our current carbon economy this means that on average, nearly every line of code we write will result in the release of Carbon Dioxide into the atmosphere. Heat will need to be dissipated, blowers move air, batteries discharge, systems slow down.&lt;/p&gt;
&lt;p&gt;Every additional layer of software on top of the hardware platform adds to the performance burden of the system. If you’re paying for the hardware and electricity (in a server farm, for e.g.) then it’s your problem, but if you’re writing software that runs on people’s devices, your convenience is &lt;a href="https://github.com/ReactiveCocoa/ReactiveCocoa/issues/1503"&gt;paid for by your customers&lt;/a&gt;. Packing an over the top framework into your app is a bit like showing up at a friends house for dinner with an entourage. It might make you feel cool, but you aren’t being a very good guest.&lt;/p&gt;
&lt;p&gt;Physical limits aren’t something we like to admit exist in software development, “Moore’s Law will surely save us!” And for decades, it has, but as we get closer to the quantum realm (and eventually cross over into it) in the chip fabrication process, &lt;a href="https://qz.com/852770/theres-a-limit-to-how-small-we-can-make-transistors-but-the-solution-is-photonic-chips/"&gt;the pace has slowed&lt;/a&gt;, and the exponential curve for Silicon begins to look more sigmoid in shape. We can no longer expect our processors to get faster at the breakneck pace of the 90s and 00s, optical and quantum processors will eventually become a commercial reality and provide great steps in processor power, but for the foreseeable future they won’t be included in consumer devices.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“It takes about a year, but once you get it, you’ll be super productive.”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;— Some Reactive Cocoa Developer&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="developers-time-matters"&gt;Developers Time Matters&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Reactive_programming"&gt;Reactive Programming&lt;/a&gt; on it’s own might not over-burden your app, in fact there are applications where it is clearly the &lt;a href="http://conal.net/papers/icfp97/"&gt;best choice&lt;/a&gt;. But for most apps it doesn’t add much except Library size, runtime penalties and additional learning needed for developer to fully utilize it. This is substantial, especially when implemented on top of Apple’s platforms, which already have a highly optimized UI development tools.&lt;/p&gt;
&lt;p&gt;Reactive programming promises a lot, including easier to understand code and better developer experience. Except that in every case I’ve seen, it takes longer to write an app this way, and it can be challenging to debug. Once when working on integrating into a Reactive Cocoa app the lead told me I’d need to maintain my own timer for a query sent to a connected hardware device, because they couldn’t reliably generate and propagate RAC signals once per second.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Always write code like your maintenance programmer has a shotgun, and knows where you live. — Larry Wall&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="maintenance-time-matters"&gt;Maintenance Time Matters&lt;/h4&gt;
&lt;p&gt;Working with a new technology stack might seem exciting to you, it might even distract a little from the fact that most apps aren’t very groundbreaking and that writing a shopping cart or picture sharing app isn’t going to get you inducted into the programming hall of fame. You might become tempted by one of the constant sirens of human experience, the deep need for newness.&lt;/p&gt;
&lt;p&gt;Without this core drive humanity would never have become the super dominant species and we wouldn’t have memes. It’s hard to imagine a world where everyone is always content actually working well in practice. If everyone is a slacker and expends minimal effort to simply survive there would be no growth, no art, no striving for a more perfect world.&lt;/p&gt;
&lt;p&gt;While this drive for neoteny May have gotten us here, it’s not helpful when you are trying to engineer a system for performance and reliability and especially when you are planning for long term support. Newness in the service of entertaining the people working on the project isn’t doing the business or its customers any favors and it does a great disservice to whoever has to maintain the product later. In order to improve or make repairs they will have to understand all the underlying tools of the platform as well as all the over the top software, in addition.&lt;/p&gt;
&lt;h4 id="user-experience-matters-most"&gt;User Experience Matters Most&lt;/h4&gt;
&lt;p&gt;While I’m sympathetic to the desire to do good work and to feel like the products we design and build are using the most modern tools and methods the reality of software product engineering is that it has to address a messy reality, and in doing so it becomes complex.&lt;/p&gt;
&lt;p&gt;This complexity is not the result of architectural failure, but the day to day reality that our software must navigate the various pressures on it. Good architecture seeks to make the daily tasks of software engineers simple, repeatable and direct. The best platforms deliver this, or more precisely, are managed to consistently maintain these qualities as features are added and removed.&lt;/p&gt;
&lt;p&gt;While the native (Objective-c) toolkits of macOS, iOS and (NDK) Android may be out of fashion, but they still deliver the best possible user experience by virtue of their being the foundation on top of which all others are built. You may be able to run fast on stilts, and the feeling of the air in your hair is exhilarating, but when you trip it’s a long fall.&lt;/p&gt;</description><pubDate>Sat, 20 Oct 2018 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2018-10-20:/blog/2018/10/20/functional-reactive-nonsense.html</guid><category>_posts</category></item><item><title>We’ll Cross That Bridge When It’s Burning</title><link>https://istumbler.net/blog/2017/12/27/we-ll-cross-that-bridge-when-it-s-burning.html</link><description>&lt;h4 id="developing-apps-for-macos-ios-and-tvos-using-kitbridge"&gt;Developing Apps for macOS, iOS and tvOS using KitBridge&lt;/h4&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4M3tUZsNN2Owjy4tCijm-w.png" title="Behold, OrangeCard running on macOS, tvOS and iOS!"&gt;&lt;/p&gt;
&lt;p&gt;So, you want to write an app for iOS, macOS and maybe even tvOS? There’s been &lt;a href="https://daringfireball.net/2017/12/marzipan"&gt;a lot of talk&lt;/a&gt; lately about the &lt;a href="https://github.com/insidegui/UXKitDemo"&gt;UXKit.framework&lt;/a&gt; inside of Photos.app or possibly another replacement framework to bridge the AppKit/UIKit divide. While this may yet come to pass, there’s nothing stopping us from improving the portability of code across macOS, iOS and tvOS &lt;em&gt;right now&lt;/em&gt;.&lt;/p&gt;
&lt;h4 id="so-whats-all-this-about-then"&gt;So, What’s All This About, Then?&lt;/h4&gt;
&lt;p&gt;While UIKit is clearly derived from the experience of developing AppKit it was a sort of green-field for the developers to create a more modern framework with none of the baggage of AppKit. This lack of baggage makes for more streamlined development but there is collateral damage for experienced AppKit developers who will find some of the changes are hard to adapt to, especially if they need to go back and forth often.&lt;/p&gt;
&lt;p&gt;In particular, there are a number of support classes which could have been shared between UIKit and AppKit but weren’t: NS/UIImage, NS/UIColor, NS/UIBezierPath and the foundation class NS/UIView. The difference are more than just name deep, the APIs lack some of the the &lt;a href="https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch"&gt;impedance matching&lt;/a&gt; which makes pairing them with other existing frameworks simpler and faster to implement.&lt;/p&gt;
&lt;h3 id="bridge-over-troubled-waters"&gt;Bridge Over Troubled Waters&lt;/h3&gt;
&lt;p&gt;First, a little history, &lt;a href="https://github.com/alfwatt/KitBridge"&gt;KitBridge&lt;/a&gt; is fairly new hotness, started just this year based on some initial ideas prototyped in &lt;a href="https://github.com/alfwatt/QRKit"&gt;QRKit&lt;/a&gt;, which implements a very limited cross-platform view framework using a simple &lt;a href="https://github.com/alfwatt/QRKit/blob/master/QRKit/QRDefines.h"&gt;bridging header&lt;/a&gt;, an NSImage category and strategic use of &lt;strong&gt;#ifdef&lt;/strong&gt; directives in the implementations. That simple header and category allows QRKit to provide the same API across all it’s target platforms.&lt;/p&gt;
&lt;p&gt;KitBridge takes that starting point and expands on it to include more classes and more categories, which bring balance to view development. With KitBridge you can always use the UIKit API for the bridged classes on either platform. On iOS and tvOS the native methods are used and on macOS (where there is typically more CPU and memory to go around) the methods are provided by categories. There are some cases where UIKit lacks a trusty AppKit method and those are provided as well.&lt;/p&gt;
&lt;p&gt;Besides expanding on the number of classes that the bridge supports, KitBridge also makes it easier for projects to share a single implementation file between versions, at least for Views, App Delegates and Controllers.&lt;/p&gt;
&lt;h3 id="building-on-top-of-the-bridge"&gt;Building On Top of the Bridge&lt;/h3&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0pWKqZ41IoelUFRczGjLBw.png" title="Who doesn’t love a good block diagram?"&gt;&lt;/p&gt;
&lt;p&gt;While KitBridge does not cover every possible porting issue (I’ve been adding affordances one by one as I need them for various apps) it does provide a lot of support for writing portable Views and Controllers and already supports two other frameworks which provide a useful set of views: &lt;a href="https://github.com/alfwatt/CardView"&gt;CardView.framework&lt;/a&gt; and &lt;a href="https://github.com/alfwatt/SparkKit"&gt;SparkKit.framework&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;CardView.framework provides a NS/UITextView subclass with a single interface for adding styled text and graphics. CardView was originally extracted from &lt;a href="https://desklampx.com"&gt;DeskLamp&lt;/a&gt;, and made it’s way into OrangeCard and iStumbler. Now that the framework has been integrated with KitBridge, I’ll be bringing OrangeCard to iOS and tvOS from macOS, once the non-UI platform differences are taken into account.&lt;/p&gt;
&lt;p&gt;SparkKit.framework provides a set of data visualization tools with pie, ring, bar, stack, grid and columnar data views, also built on top of BridgeKit. It is enabled by harmonizing the NS/UIBezierCurve interface so that the views have the same drawing code. The most recent release of iStumbler uses SparkKit to draw the Channels and WiPry plugins grid views, and I expect to replace the line graphs and level indicators in an upcoming update.&lt;/p&gt;
&lt;h3 id="remaining-work"&gt;Remaining Work&lt;/h3&gt;
&lt;p&gt;While spackling over the difference between the App and UI Kits helps make portable apps easier, there’s lots to be done still. As the apps I’m building on top of these frameworks evolve I expect KitBridge to evolve as well. Since there seems to be some interest, I wanted to introduce the frameworks because I think they save time when porting apps from macOS to iOS and vice versa, and I hope you enjoy working with them.&lt;/p&gt;</description><pubDate>Wed, 27 Dec 2017 00:00:00 -0800</pubDate><guid>tag:istumbler.net,2017-12-27:/blog/2017/12/27/we-ll-cross-that-bridge-when-it-s-burning.html</guid><category>_posts</category><category>uikit</category><category>appkit</category><category>ios</category></item><item><title>Exactly Backwards</title><link>https://istumbler.net/blog/2017/11/09/exactly-backwards.html</link><description>&lt;p&gt;Facebook is trialing a revenge porn suppression system which threatens user privacy and could be implemented in a way which does not require sharing compromising photos.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://amp.theguardian.com/technology/2017/nov/07/facebook-revenge-porn-nude-photos"&gt;Facebook asks users for nude photos in project to combat revenge porn&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Reading the article, here are the steps required by the proposed system to prevent publication of a revenge porn image:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Take a compromising photo&lt;/li&gt;
&lt;li&gt;Distribute said photo to 2nd party&lt;/li&gt;
&lt;li&gt;Develop distrust in 2nd party&lt;/li&gt;
&lt;li&gt;Send compromising photo to 3rd party&lt;/li&gt;
&lt;li&gt;3rd party sends compromising photo to FB&lt;/li&gt;
&lt;li&gt;FB Employees views compromising photos&lt;/li&gt;
&lt;li&gt;Photo is hashed and included in a database&lt;/li&gt;
&lt;li&gt;Existing instance of the photo are removed&lt;/li&gt;
&lt;li&gt;Any future posts of the photo are not published&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So: to prevent people from seeing your compromising photo you need to show it to a bunch of people, who will leave it sitting around for a while, just in case they need to look at tit again. Sound crazy to you?&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1005/1*eBPqekT8SojGnjeswmL1kg.png"&gt;&lt;/p&gt;
&lt;h3 id="a-better-way"&gt;A Better Way&lt;/h3&gt;
&lt;p&gt;The article discusses the existing solution to the problem of unseeable content on the Internet: &lt;a href="https://en.wikipedia.org/wiki/PhotoDNA"&gt;PhotoDNA&lt;/a&gt;. While there’s a lot of press-release content about the underlying technology being donated to the &lt;a href="https://en.wikipedia.org/wiki/National_Center_for_Missing_%26_Exploited_Children"&gt;National Center for Missing &amp;amp; Exploited Children&lt;/a&gt; there’s no indication that the source code is generally available. Thankfully, there are some related, portable, &lt;a href="http://phash.org"&gt;open source&lt;/a&gt; efforts which overlap the feature set of PhotoDNA considerably.&lt;/p&gt;
&lt;p&gt;Given that we have a way to generate a perceptual hash of the photo on the users device, there is no need to send the actual image to anyone. We can implement a system with the following steps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Take a compromising photo&lt;/li&gt;
&lt;li&gt;User designates photos &amp;amp; videos they wish to suppress&lt;/li&gt;
&lt;li&gt;Perceptual Hashes are Generated on Device&lt;/li&gt;
&lt;li&gt;Hashes are submitted to a database of suppressed image hashes&lt;/li&gt;
&lt;li&gt;Existing posts matching the hash are hidden and reviewed&lt;/li&gt;
&lt;li&gt;Someone posts an image which matches one of the hashes&lt;/li&gt;
&lt;li&gt;The image is flagged for review based on content policy&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are a few things that I like better about this method but looking at the specific tradeoffs helps to understand the advantages:&lt;/p&gt;
&lt;h4 id="tradeoff-one-processor-power-vs-network-bandwidth"&gt;Tradeoff One: Processor Power vs. Network Bandwidth&lt;/h4&gt;
&lt;p&gt;Sending the image over the network takes bandwidth and exposes the image to more potential viewers (which is what the system is supposed to be preventing in the first place). Generating perceptual hashes on the device takes processor resources and code, but nothing that my watch couldn’t handle. &lt;strong&gt;Network bandwidth is limited relative to processor power, generating hashes locally is better resource management.&lt;/strong&gt;&lt;/p&gt;
&lt;h4 id="tradeoff-two-user-privacy-vs-intellectual-property-protection"&gt;&lt;strong&gt;Tradeoff Two: User Privacy vs. Intellectual Property Protection&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Sending the code to generate the perceptual hash to the user exposes it to potential analysis and reverse engineering. Sending the image to a cloud service exposes the image to potentially multiple parties. &lt;strong&gt;Generating the hash on the device better preserves user privacy, using open source software will keep the blood-thirsty IP lawyers at bay.&lt;/strong&gt;&lt;/p&gt;
&lt;h4 id="tradeoff-three-prior-restraint-vs-content-review"&gt;&lt;strong&gt;Tradeoff Three: Prior Restraint vs. Content Review&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Now, let’s say I have a photo someone sent that I don’t want published to any social network site. Doesn’t have to be compromising, could just be a bad hair day or maybe me parking my car in two handicapped spots.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prior restraint is always expense.&lt;/strong&gt; The system we’re talking about is explicitly designed to censor images and flag users who post censorable images, the use of the system to suppress content which some simply doesn’t like can’t be overlooked. &lt;strong&gt;Requiring that each photo be reviewed before submitting isn’t just a privacy problem, it’s too much work.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There is no point in having a human review the photos unless there’s a hit against the database of suppressed perceptual hashes, once an image has been submitted which appears in the database it can be held for review without being published (similar to the existing tag review features, which prevent auto-tagging of your face in image).&lt;/p&gt;
&lt;h4 id="is-our-machines-learning"&gt;Is Our Machines Learning?&lt;/h4&gt;
&lt;p&gt;What confuses me about this whole project is that machine learning has been around for some time, and is becoming more and move available to developers on more and more platforms, and despite that we don’t see better tools for automatically detecting this type of content.&lt;/p&gt;
&lt;p&gt;If my phone can find all &lt;a href="https://www.bustle.com/p/what-is-the-brassiere-folder-on-ios-apple-categorizes-your-nudes-under-this-bizarre-keyword-in-the-photos-app-3193263"&gt;images of a brassier&lt;/a&gt; in my photo albums, then why can’t Facebook identify that feature of an image, along with the face of an existing users (which it already knows) and flag it for review? Particularly if the recognized user isn’t the one posting the image?&lt;/p&gt;
&lt;p&gt;If you liked this article, please, &lt;a href="mailto:alf@istumbler.net"&gt;send nudes&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Thu, 09 Nov 2017 00:00:00 -0800</pubDate><guid>tag:istumbler.net,2017-11-09:/blog/2017/11/09/exactly-backwards.html</guid><category>_posts</category><category>facebook</category><category>privacy</category><category>social-media</category><category>security</category><category>censorship</category></item><item><title>Meet the Osbornes</title><link>https://istumbler.net/blog/2017/05/15/meet-the-osbornes.html</link><description>&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/829/1*kzqE0rPrvzgyF82BdF8a7w.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://buyersguide.macrumors.com/#Mac"&gt;MacRumors Mac Buying Guide&lt;/a&gt; May 2017&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Osborne effect&lt;/strong&gt; is a term referring to the &lt;a href="https://en.wikipedia.org/wiki/Unintended_consequences"&gt;unintended consequences&lt;/a&gt; of a company announcing a future product, unaware of the risks involved or when the timing is misjudged, which ends up having a negative impact on the sales of the current product. This is often the case when a product is announced too long before its actual availability. This has the immediate effect of customers canceling or deferring orders for the current product, knowing that it will soon be obsolete, and any unexpected delays often means the new product comes to be perceived as &lt;a href="https://en.wikipedia.org/wiki/Vaporware"&gt;vaporware&lt;/a&gt;, damaging the company’s credibility and profitability. - &lt;a href="https://en.wikipedia.org/wiki/Osborne_effect"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The fundamental lesson of the Osborn Effect is that disclosing future plans leads to potentially fatal consequences, particularly in the fast moving early personal computer industry. This is well understood as far as it applies to a single product line, and many technology companies have become tight lipped about future plans after learning this lesson directly, as Apple did watching it’s then peer implode and die, or by hearing the &lt;a href="https://despair.com/products/mistakes"&gt;cautionary tale&lt;/a&gt; we fondly remember them by.&lt;/p&gt;
&lt;h4 id="family-problems"&gt;Family Problems&lt;/h4&gt;
&lt;p&gt;Of course, the Osborne effect doesn’t just apply to product lines with a single model with updates released in succession, it also applies to product families like the Mac. When you update one part of the product family other parts can suffer a “ &lt;strong&gt;Second Hand Osborne Effect&lt;/strong&gt;” as their implied obsolescence becomes tacitly clear. This is particularly true when making fundamental changes, like external I/O ports.&lt;/p&gt;
&lt;p&gt;Which brings us to the recent problems with the Thunderbolt 3/USB Type C connectors on the new MacBook Pros: they immediately obsoleted the entire Mac desktop line in one fell stroke. With no announced or regular update schedule, it slaps a big red &lt;strong&gt;DO NOT BUY&lt;/strong&gt; sticker on the box of every iMac, mini and Pro in the stores.&lt;/p&gt;
&lt;p&gt;Leaving Pro and Developer users, who’s offices are typically packed with iMacs and Mac Pros on desks, with a mini or two in the network closet running servers and continuous integration tasks, who want to upgrade in the sort of limbo that makes putting together a &lt;a href="http://www.hackintosh.com"&gt;Hackintosh&lt;/a&gt; start to look like a viable option.&lt;/p&gt;
&lt;h4 id="the-worst-case-scenario"&gt;The Worst Case Scenario&lt;/h4&gt;
&lt;p&gt;The Osbourne effect &lt;em&gt;is&lt;/em&gt; a killer. You could argue that Apple’s current level of secrecy around new products is the result of a sort of corporate early life trauma: watching someone else die horribly by their own press release must have left some scars on the executives. Theres no arguing that the resulting communications policy works very well for the revenue leading product lines: iPhone and iPad. We have become accustomed to regular annual updates of the iPhone line with slightly less frequent (and trailing) iPad releases. Both coming along with a steady cadence which while unannounced, is clear and predictable.&lt;/p&gt;
&lt;p&gt;Without a predictable update schedule, doubt and fear rule the consumer’s buying decisions, and when a &lt;a href="https://www.apple.com/macbook-pro/"&gt;shiny new MacBook Pro&lt;/a&gt; makes it clear that the rest of the product family isn’t the Most Favored and several of them have been neglected for some years, well. You can expect purchases to drop off and while a smaller company would be in big trouble, for Apple the situation is less immediately tenuous but clearly, in some ways it can be worse for a big company: sales decline leads to less attention from the executives, which leads to sales decline and the eventual outcry from users who feel neglected.&lt;/p&gt;
&lt;h4 id="admitting-the-problem-is-just-the-first-step"&gt;Admitting the Problem is Just the First Step&lt;/h4&gt;
&lt;p&gt;While some were happy with Apple’s recent &lt;a href="https://daringfireball.net/2017/04/the_mac_pro_lives"&gt;executive sit-down&lt;/a&gt; with the press and their vague pre-announcement of a &lt;em&gt;“less innovative than Phil’s ass”&lt;/em&gt; version of the Mac Pro next year, it worries me that they’re just admitting they have a problem now. This suggests they haven’t even started in on a replacement for the Pro which means waiting an entire development cycle (more than a year, typically) and nothing new was revealed about the iMac or Mini update cycles which are also staring to get long in the tooth.&lt;/p&gt;
&lt;p&gt;The key to having a happy family, at home or in your product lineup, is to not show too much favoritism to one child or the other. There are, of course, moments of need or a particular talent which require special attention from time to time. The birth of a &lt;a href="https://www.apple.com/watch/"&gt;new family member&lt;/a&gt; can be a trying time, especially when rushing the rest of the brood through the annual update process and throw in a big move to &lt;a href="http://www.businessinsider.com/apple-park-spaceship-campus-headquarters-explained-2017-3"&gt;the new house&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, like many an &lt;a href="https://www.theguardian.com/lifeandstyle/2017/may/13/a-letter-to-my-parents-whose-favouritism-ripped-our-family-apart"&gt;ignored eldest child&lt;/a&gt; the Mac line seems to have been left to itself, and as it ages it’s more and more embarrassing to be living at home, in the basement.&lt;/p&gt;</description><pubDate>Mon, 15 May 2017 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2017-05-15:/blog/2017/05/15/meet-the-osbornes.html</guid><category>_posts</category><category>apple</category><category>macbook-pro</category><category>mac-pro</category><category>mac-hardware</category><category>imac-pro</category></item><item><title>The Sad State of Wi-Fi APIs in Apple Platforms</title><link>https://istumbler.net/blog/2017/04/25/the-sad-state-of-wi-fi-apis-in-apple-platforms.html</link><description>&lt;p&gt;It’s &lt;a href="https://developer.apple.com/wwdc/"&gt;WWDC&lt;/a&gt; prediction season again. Spring break for Nerds will soon descend on San Jose with it’s sessions all day, parties all night schedule. Rumors and speculation fly along with wish lists for new features that might be announced in the big keynote. Legions of fans sit huddled over glowing screens watching the video and refreshing news sites to see what other people watching the video are saying about the video.&lt;/p&gt;
&lt;h4 id="my-wishlist-is-short"&gt;My Wishlist is Short&lt;/h4&gt;
&lt;p&gt;I only ever have one wish for WWDC: &lt;strong&gt;a single, comprehensive Wi-Fi API on all Apple platforms which can be used for apps released in the App Stores&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Seems simple enough, we have had &lt;a href="https://developer.apple.com/library/mac/documentation/Networking/Reference/CoreWLANFrameworkRef/index.html"&gt;CoreWLAN&lt;/a&gt; on macOS since &lt;a href="http://www.apple.com/shop/product/MC573Z/A/mac-os-x-106-snow-leopard"&gt;10.6&lt;/a&gt;. In fact, your truly got to introduce the feature at WWDC [citation needed] after working with World Wide Developer Relations organization and spending a lot of time persuading my colleges to just let it happen already.&lt;/p&gt;
&lt;p&gt;Just one small wrinkle; there was a question about &lt;em&gt;which&lt;/em&gt; Wi-Fi API was going to be published. That WWDC video isn’t available, I presume, because the API that I got up on stage and presented, wasn’t CoreWLAN, and neither the placeholder or the eventual incumbent were my first choice. But no matter, there was an API, it did everything that was needed and it replaced the reverse engineered &lt;a href="https://web.archive.org/web/20190718071822/http://www.macstumbler.com/Apple80211.h"&gt;Apple80211.h&lt;/a&gt; file everyone had been using up to that point.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/460/1*FumEQDdB_Z_EsAlBTk_chg.jpeg" title="We’re done here, right?"&gt;&lt;/p&gt;
&lt;h4 id="lets-roll-some-wi-fi-apps"&gt;Let’s Roll Some Wi-Fi Apps!&lt;/h4&gt;
&lt;p&gt;As happy as I was to help publish the Wi-Fi API and get it introduced it to the world, my real motivation was to update iStumbler. It took a little while after the release of SnowLeopard until I was able to get permission to ship &lt;a href="https://istumbler.net/archive/release99/"&gt;iStumbler Release 99&lt;/a&gt; in February 2010.&lt;/p&gt;
&lt;p&gt;Despite my selfish motivation, I am very proud to have enabled a number of other Wi-Fi apps, which eventually made their way to, the Mac App store. Even if one of them is an &lt;a href="https://web.archive.org/web/20120615033532/http://itunes.apple.com:80/us/app/wifi-manager/id483772322"&gt;unbelievable facile&lt;/a&gt; compile and submit of the example code for CoreWLAN:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cXnkMrtRyKMIfQJOae3zMA.png" title="Something is missing…"&gt;&lt;/p&gt;
&lt;h4 id="but-then-ios"&gt;But then iOS&lt;/h4&gt;
&lt;p&gt;The development of iOS and iPhone was famously segregated from the existing Mac and OS X development. As such, they did not share their Wi-Fi Client stack (the user-space software which keeps the list of preferred networks and manages the automatic-join process) until fairly recently, after the teams where eventually merged in Apple’s &lt;a href="https://www.youtube.com/watch?v=tVq1wgIN62E"&gt;Deforistallizaion&lt;/a&gt; process.&lt;/p&gt;
&lt;p&gt;The iOS Wi-Fi team decided early that they were not going to offer a public API and have been doggedly hardening each release to prevent access to apps who try to use it, even on Jailbroken devices. My understanding is that it’s considered a privacy risk, as a Wi-Fi scan list can be submitted to a number of online services to determine the user’s location (which is exactly what CoreLocation does). If only there were some way to notify the user that an App wanted access to a hardware feature with some privacy or security implication…&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gFXC-lcHAPbGtCECHg3MLQ.png" title="I just can’t think of a way to get affirmative consent from a user…"&gt;&lt;/p&gt;
&lt;h4 id="enter-sandbox"&gt;Enter Sandbox&lt;/h4&gt;
&lt;p&gt;Much has been written about the limitations of the App Sandbox and the Mac App store over the past few years, despite the (relatively modest) amount of work involved, I’d be very happy to have iStumbler in the Mac App store. Sadly, I missed the window to submit it before the App Sandbox became a requirement, which as you can see from the &lt;a href="https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/DesigningYourSandbox/DesigningYourSandbox.html"&gt;App Sandbox Design Guide&lt;/a&gt; precludes using CoreWLAN:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;With App Sandbox, your app cannot modify the system’s network configuration (whether with the System Configuration framework, the CoreWLAN framework, or other similar APIs) because doing so requires administrator privileges.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which means iStumbler stuck outside of the App Store and it’s throngs of paying customers, and instead has to rely on discovery and sales via my &lt;a href="https://istumbler.net/store/"&gt;web site&lt;/a&gt; (hint-hint). But it’s worse for the developers who have Wi-Fi apps already on the store: they can’t be updated with new features, because that would require sandboxing. Which isn’t allowed.&lt;/p&gt;
&lt;p&gt;This creates a tenuous situation for people trying to make a living writing applications which utilize Wi-Fi. You can imagine my dismay when 10.11 shipped and iStumbler started emitting this warning:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;airportd[#]: WARNING: iStumbler (#) is not entitled for com.apple.wifi.scan, temporarily allowing request with background priority — — all entitlement requirements will be strictly enforced in a future release&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thankfully the warning is gone from 10.12, but for a year or so there it looked like we were headed deep into Kafka territory: A Public Wi-Fi API exists, but you can’t use it outside of the sandbox without entitlements and we don’t allow &lt;a href="http://stackoverflow.com/questions/37529193/what-is-the-entitlement-for-a-mac-app-to-use-corewlan-to-access-wi-fi-in-the-san"&gt;those entitlements&lt;/a&gt; to be used for Developer ID or Mac App Store apps.&lt;/p&gt;
&lt;h4 id="but-who-cares-really"&gt;But Who Cares? Really?&lt;/h4&gt;
&lt;p&gt;You really should. If you’ve ever stared at your screen waiting for something to load, spent an evening debugging a family member’s broken Wi-Fi connection, had to call a nerdy family member over to fix a broken Wi-Fi connection or generally wondered “how does this magic technology which brings me kitten photos by the exabyte work?” then you have some skin in the game.&lt;/p&gt;
&lt;p&gt;Access to the internal workings of your computer might break the feeling of magic for some, and there are things which you don’t need or want to see, but we all care very much about our connection to the rest of humanity and having the tools to make sure that our Wi-Fi is connected, performing well and reliably is critically important to our sense of well-being in a more and more interconnected world.&lt;/p&gt;
&lt;h4 id="a-modest-proposal"&gt;A Modest Proposal&lt;/h4&gt;
&lt;p&gt;I’m going to preface this by admitting that it’s a big ask to get Apple to change their course on this. User privacy protections, concerns over battery usage, the need for additional testing to make sure that even aggressive use of the public APIs don’t degrade system performance unacceptably all take time and political will to make happen.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Apple should publish a single, well documented and comprehensive Wi-Fi API which works on all Apple Devices which can be deployed to the App Stores&lt;/strong&gt;. Let the user know that an app wants to use Wi-Fi, and let them decide if they want to enable Wi-Fi access in the foreground or background in the same manner as location services, the address book or camera.&lt;/p&gt;
&lt;p&gt;It might seem like a niche feature, &lt;strong&gt;but network connectivity problems are difficult problems to diagnose and resolve.&lt;/strong&gt; Hard problems require a robust and ever changing set tools to collect information and improve the user experience.&lt;/p&gt;
&lt;p&gt;Pretty please?&lt;/p&gt;</description><pubDate>Tue, 25 Apr 2017 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2017-04-25:/blog/2017/04/25/the-sad-state-of-wi-fi-apis-in-apple-platforms.html</guid><category>_posts</category><category>wi-fi</category><category>apple</category><category>api</category><category>wwdc</category><category>wwdr</category></item><item><title>The Macintosh Factory</title><link>https://istumbler.net/blog/2016/09/29/the-macintosh-factory.html</link><description>&lt;h4 id="infoworld-march-19-1984"&gt;InfoWorld March 19, 1984&lt;/h4&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Ae5ZnX23oG25pp6j0qs8w.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KICkaz43KYqWG0FYnquTJA.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1s70cc548jz4YEgRWRQSQ.png"&gt;&lt;/p&gt;</description><pubDate>Thu, 29 Sep 2016 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2016-09-29:/blog/2016/09/29/the-macintosh-factory.html</guid><category>_posts</category></item><item><title>Missing Headphone Jack!? Apple’s W1 chip heralds the death of Bluetooth</title><link>https://istumbler.net/blog/2016/09/08/missing-headphone-jack-apple-s-w1-chip-heralds-the-death-of-bluetooth.html</link><description>&lt;p&gt;&lt;a href="http://www.theverge.com/2016/9/7/12829190/apple-w1-chip-iphone-7-wireless-headphones"&gt;Apple first wireless chip is the new W1 for wireless EarPods&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Apple’s iPhone 7 and Watch Series 2 announcements today included an interesting new piece of hardware, the Apple W1 wireless chip. The AirPod promotional video is long on benefits and short on details but here’s what we know from the introduction.&lt;/p&gt;
&lt;h4 id="its-not-bluetoothtm"&gt;It’s not Bluetooth™&lt;/h4&gt;
&lt;p&gt;Which is to say, it’s not an interoperable product based on the &lt;a href="https://bluetooth.org"&gt;Bluetooth SIG&lt;/a&gt;’s specifications and testing processes. Notorious for being “ &lt;a href="http://daringfireball.net/linked/2015/11/13/bluetooth-next-year"&gt;great next year&lt;/a&gt;” and for vendors ignoring standard profiles in order to lock users of their hardware into their software, poor audio quality, flakey connections and an inability to synchronize with AirPlay due to a lack of timing signals. Bluetooth is basically the Android of Personal Area Networking, and it’s clear that Apple has had enough and want’s to move the ball into it’s own court.&lt;/p&gt;
&lt;p&gt;Apple will continue to support Bluetooth on various devices to the extent that they must to maintain market share. Given their current heft, they have the ability to reduce that demand once 3rd parties are onboard and producing Lightening and W1 enabled accessories. A few generations from now, after automakers have implemented W1 and the need for bluetooth interoperability (and why not create a lightening adapter for bluetooth and car charging to hasten the process).&lt;/p&gt;
&lt;h4 id="its-in-the-iphone-7-watch-series-2-and-ear-pods-now-tomorrow"&gt;It’s in the iPhone 7, Watch Series 2 and Ear Pods Now, Tomorrow…&lt;/h4&gt;
&lt;p&gt;Consider the requirements for high quality streaming audio with long batter life: very low latency and power usage, coupled with just enough CPU and DSP to decode and decompress the audio. More and more electronics manufactures are using SoC solutions wrapped around radio cores, for simplicity and power savings. And the AirPods system, as demonstrated, requires at least three, possibly four W1 chips (One for the phone and each pod, and potentially a fourth for the case).&lt;/p&gt;
&lt;p&gt;I have on my desk for e.g. a Wi-Fi Access Point which is based on a standard QCA chipset with enough headroom to run Linux on the radio module itself. Just add a flash chip for storage and solder it to a board. Moore’s Law may have stalled but before it did we reached a very high level of integration and power efficiency, and while further gains may not be quite as fast, they will no doubt continue to come. The W1 is emblematic of this advancement, a fully integrated device controller on a single chip, with dramatic power and cost savings.&lt;/p&gt;
&lt;p&gt;The W1 is very likely to be suitable for desktop HID devices (mouse, keyboards, game controllers, both of which I personally use USB versions of, primarily for reliability reasons), portable speakers, microphones, small cameras and printers, remote controls and potentially much of the Internet of Things ecosystem which we can expect to continue to promise great things “next year” for some time unless someone comes in and re-writes the user expectation for ease of use and reliability.&lt;/p&gt;
&lt;h4 id="what-next-for-apple-wireless-chips"&gt;What Next for Apple Wireless Chips?&lt;/h4&gt;
&lt;p&gt;The W1 is a clear shot across the Bluetooth bow, Apple is clearly serious about user experience for it’s wireless audio products and this product decision reflects a clear vote of no confidence in the future of the SIG and the technology.&lt;/p&gt;
&lt;p&gt;What Apple does or doesn’t do about Wi-Fi moving forward will tell us a lot about where they want to take this new interest in chip-level RF engineering.&lt;/p&gt;
&lt;h4 id="links"&gt;Links&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.slashgear.com/the-iphone-7-headphones-savior-wont-be-bluetooth-06454864/"&gt;The iPhone 7 headphones savior won&amp;rsquo;t be Bluetooth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://thinkerbit.com/articles/more-on-bluetooth-5-in-next-iphone"&gt;Thinking more about Bluetooth 5&amp;rsquo;s inclusion in the next iPhone&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><pubDate>Thu, 08 Sep 2016 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2016-09-08:/blog/2016/09/08/missing-headphone-jack-apple-s-w1-chip-heralds-the-death-of-bluetooth.html</guid><category>_posts</category><category>airpods</category><category>headphones</category><category>wireless</category><category>bluetooth</category><category>apple</category></item><item><title>Stop talking about your tools and get to work making great apps…</title><link>https://istumbler.net/blog/2016/06/07/stop-talking-about-your-tools-and-get-to-work-on-making-great-apps.html</link><description>&lt;p&gt;&lt;a href="https://duckduckgo.com/?q=static+vs+dynamic+typing&amp;amp;t=osx&amp;amp;ia=web"&gt;Static vs. Dynamic&lt;/a&gt;? &lt;a href="https://duckduckgo.com/?q=strong+vs.+weak+typing&amp;amp;t=osx&amp;amp;ia=about"&gt;Strong vs. Weak&lt;/a&gt;? &lt;a href="https://duckduckgo.com/?q=Functional+vs.+Objective+programming&amp;amp;t=osx&amp;amp;ia=qa"&gt;Functional vs. Objective&lt;/a&gt;? &lt;a href="https://duckduckgo.com/?q=duck+vs+strong+typing&amp;amp;t=osx&amp;amp;ia=web"&gt;Duck vs. Strict&lt;/a&gt;? &lt;a href="https://www.youtube.com/watch?v=oBkMztuHlVg"&gt;Tabs vs. Spaces&lt;/a&gt;? &lt;a href="https://duckduckgo.com/?q=which+is+better+vi+or+emacs&amp;amp;t=osx&amp;amp;ia=web"&gt;vi vs. emacs&lt;/a&gt;! &lt;a href="https://medium.com/@istumbler/code-review-you-are-doing-it-wrong-2ec72db44f2a#.duw2w434l"&gt;Code Review&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?q=code+style+guides&amp;amp;t=osx&amp;amp;ia=web"&gt;Code Style&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?q=source+control+systems&amp;amp;t=osx&amp;amp;ia=about"&gt;Source Control&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?q=source+control+systems&amp;amp;t=osx&amp;amp;ia=about"&gt;Build Systems&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?q=source+control+systems&amp;amp;t=osx&amp;amp;ia=about"&gt;Compilers&lt;/a&gt; and &lt;a href="https://duckduckgo.com/?q=LAMP&amp;amp;t=osx&amp;amp;iax=1&amp;amp;ia=images"&gt;Stacks&lt;/a&gt;; oh, my.&lt;/p&gt;
&lt;p&gt;If you read the technology press, particularly those sites targeted towards developers and the myriad blogs produced by developers, you would think that the above questions and areas of concern are the most important things to consider when designing and developing an application. They aren’t.&lt;/p&gt;
&lt;p&gt;The choice of tools is not the biggest factor in determining the quality or speed with which your products ship. The more time you spend arguing about them the less time you spend working on the things that will contribute to your Apps success.&lt;/p&gt;
&lt;h4 id="a-bad-worker-will-never-find-a-good-tool"&gt;A Bad Worker Will Never Find a Good Tool&lt;/h4&gt;
&lt;p&gt;No other industry invests in the tools the power of success or failure; attributes the qualities of the tools to the thing produced or make such sweeping judgements of people based on their choice of tools. Perhaps this has to do with the ultimate plasticity of the digital medium, and the heady feeling of walking on stilts that you can get from working with a well orchestrated stack of technology: write one small line of code, and watch the system take great strides towards your intended goal.&lt;/p&gt;
&lt;p&gt;It’s this sense of great power and precise control that ties people in the technology field so tightly to their tools it ends up branding them: “Java Developer”, “C Coder” and “JavaScript Developer” are commonly used to describe the human resources we’ve all become, and all imply a fairly specific set of skills, traits and prejudices (ActionScript developers in particular). While familiarity with a particular set of tools is important to being a productive programmer, sometimes the tools you know best aren’t the right ones for the job.&lt;/p&gt;
&lt;p&gt;To the extent that &lt;a href="https://web.archive.org/web/20160610145500/http://www.cracked.com:80/blog/6-harsh-truths-that-will-make-you-better-person_p2/"&gt;our jobs define who we are&lt;/a&gt;, our choice of tools says something about our particular temperaments and goals. But the critical skills are adaptability and the willingness to learn new technologies in order to deliver Apps which are designed with the User first in mind. Deciding on which tools you want to use for a particular App is putting the cart before the horse, figure out where you want to go and find out the best way to get there then choose the right tools for the task at hand.&lt;/p&gt;
&lt;h4 id="type-systems-are-sm-for-software-engineers"&gt;Type Systems are S&amp;amp;M for Software Engineers&lt;/h4&gt;
&lt;p&gt;One of the social environmental hazards of living in San Francisco is occasionally meeting people who are very open about their kinks. Sure, it can make for titillating cocktail hour chatter, but unless it’s an interest you share, the extended details can leave you feeling like you need a shower. It can get sticky quickly and there are some obvious parallels to the endless discussion of type systems in the software engineering world:&lt;/p&gt;
&lt;p&gt;“&lt;strong&gt;Strong vs. Weak&lt;/strong&gt;” typing is totally a Top “I need you to do this exactly the way I tell you” vs Bottom “you might have to coerce me first…” approach to the question of, uh, coupling.&lt;/p&gt;
&lt;p&gt;“&lt;strong&gt;Strict vs. Duck&lt;/strong&gt;” type systems have advocacy groups arguing as stringently about what qualifies one to use a particular method as others do about who can use a particular bathroom.&lt;/p&gt;
&lt;p&gt;It can feel safer to work inside of carefully crafted constraints, with strict rules on what you can and can’t do—if you’re into that sort of thing—but even the best type system doesn’t save you from having to rigorously test your app. Most of the problems you’ll find with the app will be about usability, not the type of crashing bugs that type systems can help prevent, but never completely cure.&lt;/p&gt;
&lt;p&gt;Personally, I’d be content with a safe word which would let me escape both discussions. I always liked Guido’s “&lt;a href="http://docs.python-guide.org/en/latest/writing/style/#we-are-all-responsible-users"&gt;we’re all adults here, right&lt;/a&gt;?” attitude generally, and I appreciate that &lt;strong&gt;void&lt;/strong&gt;* will always be there for me when I need it.&lt;/p&gt;
&lt;h4 id="apps-are-delivered-on-platforms"&gt;Apps are Delivered on Platforms&lt;/h4&gt;
&lt;p&gt;Here’s the thing, neither your favorite tool or the one chosen type system will deliver an app. Apps are built by developers, using tools targeting platforms that users purchase devices to run. Multiple tools, with different languages, for different purposes to produce different kinds of output: code, resources, documentation, marketing materials, plans, release check-lists and on and on.&lt;/p&gt;
&lt;p&gt;Platforms have native tools for app building, and learning those tools in order to deliver the App you want to your target users is a much smaller problem than figuring out who they are and what they want in the first place, then learning all the other tools you’ll need to manage delivery distribution and marketing of the product of that set of tools.&lt;/p&gt;
&lt;p&gt;Great apps are focused intently on their users and are honed over many revisions based on feedback from them. The easiest apps to write are the ones &lt;a href="https://istumbler.net"&gt;you want&lt;/a&gt; for &lt;a href="https://desklampx.com"&gt;your self&lt;/a&gt;. Harder is writing apps which serve a &lt;a href="https://istumbler.net/labs/orangecard.html"&gt;particular purpose&lt;/a&gt;, or &lt;a href="https://web.archive.org/web/20170215191328/https://qrtv.us/"&gt;test some ideas&lt;/a&gt; you have in a clean and concise way.&lt;/p&gt;
&lt;h4 id="tools-are-just-tools"&gt;Tools are Just Tools&lt;/h4&gt;
&lt;p&gt;Take away the Platforms and Tools and the digital scaffold of Source Control, Build Automation and Integrated Development Environments and the only thing left is the App itself, how it meets the needs of it’s users and how to shape the ideas that the developer or team has into a working product.&lt;/p&gt;
&lt;p&gt;Focusing obsessively on tools, as a developer, team or industry is worse than wasted time, it misses the point of developing software. Instead of arguing over &lt;em&gt;how&lt;/em&gt; we should be agreeing on the &lt;em&gt;what&lt;/em&gt; and &lt;em&gt;why&lt;/em&gt; of our creative endeavor: build the best apps and systems we can so that people will be delighted by them.&lt;/p&gt;</description><pubDate>Tue, 07 Jun 2016 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2016-06-07:/blog/2016/06/07/stop-talking-about-your-tools-and-get-to-work-on-making-great-apps.html</guid><category>_posts</category><category>mobile-app-development</category><category>software-development</category><category>programming</category></item><item><title>Wi-Fi’s Service Discovery Problem</title><link>https://istumbler.net/blog/2016/06/02/wi-fi-s-service-discovery-problem.html</link><description>&lt;p&gt;Picture yourself in a conference room; you are a visitor here, sitting in front of a laptop looking at a document that you need to send to your host, who works here. You host needs to review the document before sending it on for approvals. There is a lot of money hanging on these approvals and you are anxious to get the document reviewed.&lt;/p&gt;
&lt;p&gt;It’s not a huge file, but it’s not small either, too big for email, let’s say a whopping 100 Mb. And it just so happens that the internet connection in this conference room is slow, very slow something like 100 Kb/s, even if you could upload the file to a sharing site your host will have to download it again, taking twice as long…&lt;/p&gt;
&lt;p&gt;The good news? Both your laptop and your hosts are equipped with the latest Wi-Fi and Bluetooth radios. Bluetooth won’t help you much, since it’s not fast enough to transfer the file in a reasonable amount of time, but if you have recent laptops you should be able to get more than a gigabit per second using the Wi-Fi Radios.&lt;/p&gt;
&lt;h4 id="bonne-chance"&gt;&lt;strong&gt;Bonne Chance!&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Assuming that you and your host have some way to share files locally, and that both the client and server are on the same network, all we need to connect is to figure out what network addresses to use. Thankfully there are standards for doing this. And the beautiful thing about standards is that there are so many to choose from:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Bonjour_%28software%29"&gt;Bonjour&lt;/a&gt;, based on the &lt;a href="https://www.ietf.org"&gt;IETF&lt;/a&gt; &lt;a href="https://tools.ietf.org/html/rfc6762"&gt;mDNS&lt;/a&gt; and &lt;a href="https://tools.ietf.org/html/rfc6763"&gt;DNS-SD&lt;/a&gt; RFCs, promoted and branded by Apple&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Universal_Plug_and_Play"&gt;UPnP&lt;/a&gt;, based on, uh, Microsoft stuff, I guess, promoted by the &lt;a href="http://openconnectivity.org"&gt;Open Connectivity Foundation&lt;/a&gt; (totally not a standards group)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Service_Location_Protocol"&gt;SLP&lt;/a&gt; an older IETF RFCs, now considered more or less obsolete&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here we have our first problem: Windows and MacOS implement two different protocols, and neither implements the other. Android implements both natively but doesn’t provide it’s own browser or basic set of tools so you’ll need to find an app to complete our proposed file transfer.&lt;/p&gt;
&lt;h4 id="administrative-denials-of-service"&gt;Administrative Denials of Service&lt;/h4&gt;
&lt;p&gt;Provided you’re lucky enough to have two devices that &lt;em&gt;can&lt;/em&gt; discover each other, they then have to be on the same network to use any of the service discovery protocols we’ve discussed so far. More specifically, they need to be in the same &lt;a href="https://en.wikipedia.org/wiki/Broadcast_domain"&gt;broadcast domain&lt;/a&gt; so that service discovery messages can be heard by other devices. Broadcast domains typically extend across an entire Wi-Fi &lt;a href="https://en.wikipedia.org/wiki/Service_set_(802.11_network)"&gt;SSID&lt;/a&gt; or IP &lt;a href="https://en.wikipedia.org/wiki/Subnetwork"&gt;Subnet&lt;/a&gt;. However most business guest and internal Wi-Fi networks are “separate but equal” networks, with guest not allowed to connect to the internal network.&lt;/p&gt;
&lt;p&gt;Even if both laptops join the guest network many enterprise Wi-Fi networks provide a “&lt;a href="http://security.stackexchange.com/questions/16751/wireless-client-isolation-how-does-it-work-and-can-it-be-bypassed"&gt;client isolation&lt;/a&gt;” or “&lt;a href="http://superuser.com/questions/730288/why-do-some-wifi-routers-block-multicast-packets-going-from-wired-to-wireless"&gt;multicast filtering&lt;/a&gt;” mode which prevents clients on the network for talking to each other, which prevents service discovery from happening.&lt;/p&gt;
&lt;h4 id="screw-it-well-go-direct"&gt;Screw It, We’ll Go Direct&lt;/h4&gt;
&lt;p&gt;Clearly this is a bad situation: two laptops sitting right next to each other on a table which have an array of communications tools but can’t talk to each other, even if they are compatible, due to the network configuration. Unfortunately it’s not uncommon, so the &lt;a href="https://en.wikipedia.org/wiki/Wi-Fi_Alliance"&gt;Wi-Fi Alliance&lt;/a&gt; (WFA) got together and developed the &lt;a href="https://en.wikipedia.org/wiki/Wi-Fi_Direct"&gt;Wi-Fi Direct&lt;/a&gt; specification which allows Wi-Fi Devices to connect to each other without the Access Point getting in the way.&lt;/p&gt;
&lt;p&gt;The earliest Wi-Fi Direct devices shipped in 2011. Apple, at about the same time, developed &lt;a href="https://en.wikipedia.org/wiki/AirDrop"&gt;AirDrop&lt;/a&gt; and released it in &lt;a href="https://en.wikipedia.org/wiki/Mac_OS_X_Lion"&gt;MacOS 10.7&lt;/a&gt;. So, once again we have a platform divide: MacOS devices can connect directly (but not with iOS, for a few more years) but AirDrop doesn’t interoperate with Wi-Fi Direct and now we have Apple on one side and Everybody Else on the other. Again.&lt;/p&gt;
&lt;h4 id="now-what"&gt;Now What?&lt;/h4&gt;
&lt;p&gt;Without a cross-platform story Wi-Fi Direct has had lackluster success, and the WFA has not taken the time to specify the IP networking environment for Wi-Fi that would make existing IP service discovery protocols work. They have added a new and exciting twist with &lt;a href="http://www.wi-fi.org/discover-wi-fi/wi-fi-aware"&gt;Wi-Fi Aware&lt;/a&gt; which overlaps with Wi-Fi Direct in scope and functionality, and allows for pre-association advertising and discovery of services (which Wi-Fi Direct also supports) and then connection to an Infrastructure, IBSS, P2P or Mesh Wi-Fi network on which the application can do further service discovery to get an IP address and finally connect for application layer traffic to flow.&lt;/p&gt;
&lt;p&gt;While it’s not unusual for WFA to publish a specification like this, the situation is clearly fraught. While the industry players shuffle for dominance in the service discovery and connectivity market, users are left with the simple and apparently insoluble problem: “Why can’t I connect to the device right next to me?”&lt;/p&gt;</description><pubDate>Thu, 02 Jun 2016 00:00:00 -0700</pubDate><guid>tag:istumbler.net,2016-06-02:/blog/2016/06/02/wi-fi-s-service-discovery-problem.html</guid><category>_posts</category><category>wifi</category><category>service-discovery</category><category>internet</category></item></channel></rss>