Secret Sauce at MacDev|360

In December 2010 I had the opportunity to speak at the MacDev|360 conference in Denver. Since this was the first big Mac-focused thing I’d had the opportunity to speak at (everything since 2008 had been all iPhone, all the time), I decided to delve into my archive somewhat and pull out the knowledge I’d gained while working on MacAdministrator, where I’d implemented OpenDirectory plugins, authorization plugins, and even process injection and runtime function patching.

Dynamic Patching on Mac OS X

Back in the Old Times, when Macs still used PowerPC processors, I worked on desktop management software that needed to override core system functionality, for example disabling a menu item in Internet Explorer or Safari, or intercepting print commands to perform cost accounting. I ultimately worked out a way to inject code into other processes (we were running as root after all) and then patch any given function by swapping out its first instruction. When the Intel switch came, I figured out how to do the same thing for x86/IA-32.

Rediscovered Talks, Part 2: Kobo, EPUB, and DRM

This second batch of unearthed slides comes from my years at Kobo, where I led the team that created the Kobo iOS app, then went on to work on standards conformance issues. I wound up taking part in working groups at the IDPF and the W3C, helping stitch together EPUB standards and tried (mostly failed) to get web browsers to properly implement the things that page-layout eBooks would need, rather than dynamically-sized websites.

Rediscovered Talks, Part 1: Networking the Early iOS World

I’ve been digging through old files lately—stuff in dropbox and on old hard drives—and realised I’d done quite a few presentations in the past for which there’s just about nothing available online. Here’s a couple that deal with iOS 4 and 5 APIs. I worked a lot with networking and data handling at this time, so I’d run into all the bad situations head-on and had to work out solutions on my own, and I’d get to talk about that sometimes.

Visual Effect Views in SwiftUI

One of the key elements of the new UI styles introduced in iOS 8 and macOS 10.10 was the use of transparency, specifically a blurred semitransparent background through which some of the underlying content could be seen. On iOS, this is implemented using a UIVisualEffectView, while on macOS the same can be obtained using an NSVisualEffectView. The two are somewhat different in the types of inputs they take, however, and their APIs don’t quite match up with one another.

Adobe Joins the Readium Foundation

I’m feeling rather legitimized today: none other than Adobe themselves have joined the Readium Foundation. The initial goal of our collaboration is to ensure that any reading system built using the Readium SDK will have the option to include built-in handling for EPUB 2 and EPUB 3 documents protected using Adobe Content Server 4 – the most pervasive form of DRM in the eBook industry.

iTunes Radio

From John Gruber

Tyler Hayes on iTunes Radio:

The design and goal is clearly focused on listeners purchasing music — but even so, iTunes Radio feels like the first truly modern take on what terrestrial radio wishes it could be. Radio was always meant to be a promotion tool, a way to sell more music, but without being built directly on top of the world’s biggest music retailer, it was always too distant from the marketplace to be more effectual. Now a “buy” button lives next to every song, or a wish list one for those hesitant, and it feels like this is how modern radio should function.

Agreed; iTunes Radio is well-done and well-designed. I’m a little surprised Apple is making everyone wait for iOS 7 to get it.

Airing my NSBriefs

A couple of weeks ago I had the immense honour of being invited to speak with Saul Mora for his NSBrief podcast. We wound up talking for well over two hours, and only remembered to start recording about half an hour in. I think we could probably fill another one or two episodes without much trouble!

Redirection on Octopress and Heroku

For a little while now I’ve had notifications from gaug.es that a number of inbound links were getting HTTP 404 errors. This all stemmed from the fact that I reassigned this domain from a Tumblog (still accessible at tumblr.alanquatermain.me, btw) and ported all the relevant (i.e. longer-form) posts across from that source. There were still a few links out there which were pointing to the old Tumblr articles, though, which no longer worked.

App.net Invitational

I’ve been on Twitter for a long time now, and it’s arguably been instrumental in my success as a solo developer and a person of note in the world of Mac & iOS development. These days, though, I find myself using it less for conversations and more for feeding outward. I browse through occasionally, but there’s so much happening on there now that I’ve no real expectation that it’s useful as a source of news. Similarly, I’ve found it less useful for conducting conversations: I’m a wordy person, and I choose my words and expressions fairly carefully, yet I spend half my time trying to cut down the character count. Sure, I can split something over multiple tweets, but that makes it problematic for a user to follow the thread of a conversation backwards. Software like Twitterrific goes a long way toward helping that, but browse through a few such conversations and you start seeing errors: your API Call Count has passed the allowed limit (horror!)

C++03 vs. C++11: Fight!

In updating some stuff for the Readium SDK project, I wanted to use std::shared_ptr in some containers without lots of typing. Essentially I wanted something like shared_vector<SomeType> to magically unfold into vector<shared_ptr<SomeType>>.

Since I’m using C++11 for the project, that’s actually pretty easy to do through the magic of template aliases:

W3C!

When I started reading about XML back in 1998 I couldn’t have imagined this would ever come to pass, but it has: I’m now a member of the W3C working groups on XML Security and CSS.

Continue reading W3C!

eBook DRM and unDRM

A couple of days ago (on my birthday, no less!) I had the honour of moderating a session at the inaugural W3C and IDPF workshop on eBooks and the Open Web Platform, “eBooks: Great Expectations for Web Standards.” Due to a little something I wrote a while ago, I was asked to provide a position paper to the conference which naturally I was quite happy to do. One thing led to another, and there I was on Tuesday in New York, talking about DRM technology in a workshop hosted by O’Reilly, one of the most ardently anti-DRM companies you might name.

Developing for iOS in a Server-Centric World

Turns out, developing iOS apps is different from developing web apps. Like, hella different. For any server-side readers out there, I thought I’d hit you with a few big ones: There is no CSS. Every part of a design has to be coded in Objective-C.

  • There is no flow layout (like HTML). Everything is position: absolute;.
  • Small “cosmetic changes” can mean hours or days for developers to complete.
  • No one unit tests in Cocoa. Like, no one.</li>
  • Likewise, unit testing is a bitch.
  • No one does automated UI testing. There are some open source projects, but it’s far from the mainstream.

Apple's Response to the 'Kindle Theory' of Antitrust

[I]f Amazon was a “threat” that needed to be squelched by means of an illegal conspiracy, why would Apple offer Amazon’s Kindle app on the iPad? Why would Apple conclude that conspiring to force Amazon to no longer lose money on eBooks would cripple Amazon’s competitive fortunes? And why would Apple perceive the need for an illegal solution to the “Kindle threat” when it had an obvious and lawful one which it implemented – namely, introducing a multipurpose device (the iPad) whose marketing and sales success was not centered on eBook sales?

Readium Open Source Initiative Launched to Accelerate Adoption of EPUB 3 | International Digital Publishing Forum

The IDPF has got together a who’s-who of people and companies in the eBook world to work on an open-source implementation of a reference ePub3 reading system and container library. And of course Kobo is putting a ton of weight behind it. Also, me: I’m going to be working on this project full-time here very shortly.

I don't have a story

It’s been fascinating to read all the remembrances of Steve Jobs over the past couple of days, and all the inspiring eulogies written by those whose lives he had profoundly affected in some way.

The Spark

I got into computers at an early age. I suppose it was only natural— my father had been involved with computers and programming since university in the mid 60’s, and by the time I was about 6 or 7 he was working with programming enough that he had a computer at home, on which I wrote my first BASIC program at the age of 8 or 9. My first real exposure to the whole world of computers, however, came through a BBC series called The Dream Machine.

Talk to me

Apple’s Installer doesn’t do uninstallation. It could, since a certain amount of metadata is left around, but that could be extended to something truly useful and Apple-like in its simplicity.

The real outcome of the new In-App Purchase rules

Marco Arment: A rare disagreement

The root cause for so much of the subscription ruckus, I think, isn’t that 30% number — it’s that Apple pulled the rug out from under some major apps after the fact. … [T]heir months or years of hard work, and in many cases, their entire businesses — can be yanked by Apple’s whim at any time for reasons that they couldn’t have anticipated or avoided. … [I]f Apple breaks that expectation by changing an important rule in a way that we think isn’t justifiable, it’s perfectly reasonable for us to complain about it as loudly as possible in order to effect change.

A better idea for eBook libraries

I understand the publishers’ concern: buy an eBook, it lasts forever. It never needs to be restocked, and can be duplicated and backed up really easily. Previously, they had a reason to expect repeat purchases from libraries as they replaced stolen or damaged books. eBooks potentially cause their income from libraries to drop by a substantial enough amount that they would need to find new revenue streams in order to continue operating at the level they currently manage.

The DOJ and the FTC and the EU, oh my!

The Wall Street Journal: Antitrust Enforcers Eye Apple Anew

The Justice Department and the FTC are both interested in examining whether Apple is running afoul of U.S. antitrust laws by funneling media companies’ customers into the payment system for its iTunes store—and taking a 30% cut, the people familiar with the situation said. The agencies both enforce federal antitrust laws and would have to decide which one of them would take the lead in the matter. … Apple’s rules don’t stop media companies from selling digital subscriptions on their own. But the company imposed restrictions that could make that option less attractive to customers, and steer more sales through its own system.

Why vendors are annoyed by the new In-App Purchase rules

I was asked in a comment to another post to explain why my reaction to IAP isn’t just indicative of greed on the part of publishers, who used to get something for nothing, and don’t want to start paying for it now. Since then it’s been suggested that I promote my response to a full post, so I’m now doing that, tweaking it only slightly to better indicate that my points apply equally to any eBook vendor.

Apple States the Obvious and Inevitable

MG Siegler — Apple States the Obvious and Inevitable

If you’re going to consume content on their device, Apple would prefer that you buy that content from them and not from a competitor.

Or if you do buy want to buy it from the competitor, that’s okay, but then there’s a corkage fee. Only you don’t pay the corkage fee, the competitor does. (Well, unless they pass off the extra cost to you.)

Can you read iBooks on the Kindle? What about Sony’s books? Nope.

It’s neither complicated nor evil. It’s business.

Lesson for today

So today we had an interesting issue at Kobo: [[NSThread currentThread] threadDictionary] was returning nil. This is never supposed to happen, as it’s created on demand.

The imminent Mac App Store

Wolf Rentzsch: Mac App Store

My fellow Mac developers are laughing at the Mac App Store guidelines. They’re reporting that apps they’ve been shipping for years — a number of them Apple Design Award-winning — would be rejected from the Mac App Store. These are proven apps, beloved by their users. The current guidelines are clearly out-of-touch.

Oh ... Em ... Gee !

This weekend’s celebrations at iPad Dev Camp took a fantastic turn today, when AQGridView took home the prize for Best Developer Tool. I’d been sitting quietly at the back, hoping that it might merit me enough blue tickets to get a prize later on, and was in absolute shock when they announced my project’s name as the winner of the first award. There was a very surprising amount of applause as I walked up to receive my prize: a 32GB iPad and a VGA adaptor for it.

How the iPad will deliver books from bondage

All in all, the iPad won’t change the game as much as, say, Kobo, which is determined to become the world’s leading seller of e-books and plans to do so by allowing its e-books to be read on any device. It’s coming at this from the right direction. Apple dominates the digital-music world with the iPod and iPhone, but the iPad will not enjoy the same omniscience with digital books.

In reply to Cory Doctorow

Joel Johnson: Cory Doctorow, you are a consumer, too

It all just kills me. It literally makes me sick to my stomach. I am sitting here looking at my computer screen and looking over at your post and just wanting to take it apart line by line but what’s the point? I agree with so much of what we all seem to think about culture, about copyright, and freedoms to tinker. But I don’t want to use shitty computers with shitty operating systems, just like I don’t want to drive cars that come with their own schematics. Instead I want to drive beautifully engineered machines that scream with precision fury. And if they break, I want to take them to a shop and have them fixed. You keep the 3D printer; I’ll take AAA.

CoreFoundation dual-mode code macros

Since I’m doing some work on AquaticPrime using SecIdentityRefs, SecKeyRefs, etc, and since I want it to be compatible with either Garbage Collection or manual memory management, I need to handle CoreFoundation objects properly in both cases. It’s not difficult to do, but it lends itself to some nice syntactic sugar, which I’ve chosen to implement as the following macros. Hopefully these will prove useful to others as well.

A Lovely Tablet Computing Idea

Note that I didn’t say ‘slate computing’ as more and more have done since “the impending Apple Slate”” was mentioned (including Steve Ballmer oh-gosh-why-am-I-not-surprised). It’ll probably happen, similarly to the iPod name, but let’s not get ahead of ourselves in the rush to be the first to embrace the latest buzzword.

iPhone 4.0 hope: background tools via launchd

A lot of people want to run apps in the background on the iPhone, but I believe that Apple has some very legitimate concerns about the feasibility of doing so, at least on the current hardware platforms. However, I believe that there is a perfectly valid way of accommodating most developers’ background-execution needs. This system is called ‘launchd’, and I believe it would provide a very good means of allowing certain tasks to run in the background under the control of various system policies enforced by Apple.

A Blocks Gotcha

So I was just writing some code, and I refactored it a bit by putting a little chunk into a block, then calling that block in multiple places. Here’s the gist of the original declaration:

Blocks, Episode 2: Life Cycles

Blocks are quite special constructs. The chief reason for this is the way that they are able to capture the lexical scope in which they were defined, keeping the values of variables defined on the stack preserved with them. While this is very powerful, it leads to some questions of memory management, and therefore some new rules to learn. To begin with, we’ll look at a block’s life-cycle.

Blocks, Episode 1

I was expecting to have to wait until the release of Snow Leopard to write any of this small series of tutorials on using Blocks and the different paradigms you might want to learn as a result. I will still have to do so to really get involved with the actual capabilities of things like Grand Central Dispatch. However, since Landon Fuller / Plausible Labs released their port of the Blocks runtime to OS X 10.5 and iPhone OS 3.0, I can give you a heads-up on the things you can do with them, and on the new programming behaviours they allow you to implement.

AQGlassButton Internals

The AQGlassButton class is implemented using two CoreGraphics objects: a CGMutablePathRef and a CGGradientRef. The gradient defines the actual gloss appearance, while the path defines the shape of the button, and is used for both drawing its outline and for clipping the gradient when that is rendered.

AQGlassButton on GitHub

This is a simple glass-effect UIButton subclass, implemented entirely using CoreGraphics. It’s probably not up to the sort of fidelity you can get with a stretched image (and a good illustrator), but it should serve for a nice introduction to the relevant techniques: paths, gradients, and colors.

Lockless lazily-initialized static/global variables

So we all know (or we should) about the potential perils of double-checked locking. These can be mostly mitigated by judicious use of the volatile keyword, at least in languages which support it, but in this wonderful world of multi-core and multi-processor development, there are still some problems[PDF] to be aware of (there’s optimizing-compiler theory in there; if that scares you, just take my word that it’s got problems).

symbolicatecrash can kiss my arse

So I just spent all this evening debugging the fixed version of symbolicatecrash, attempting to see why it wasn’t working for me. I found a few bugs, fixed them (eventually—Perl is a language I’ve not used extensively, and not at all for about 10 years). Here I’ll go through what I had to change & why.

Apple Binary Protection Tool

This is a slightly-tweaked version of some code by Google’s Amit Singh. I’ve juggled things a little and added support for scanning through fat binaries encrypting all valid architectures in a single pass. It will automatically detect whether it’s currently encrypted or decrypted, and will apply or remove encryption as appropriate.

AQXMLParser Test Redux

I added NSXMLDocument to the XML parser test code and refactored it to only run a single user-selected test each time. When doing this, NSXMLParser used the same amount of memory whether using memory-mapped data or not. Here are the new output values:

Xcode BSD License Comment Script

When I first started using custom header comments containing different licenses, I was using Epsilon, where I had a custom EEL script, user variables, & a keyboard shortcut to insert a header block with the appropriate Creative Commons license. Now, however, I find myself using Xcode most often, so I needed something there to save me from forever copying & editing one chunk of BSD-license header comment.


© 2009-2019. All rights reserved.

Powered by Hydejack v9.2.1