A few years ago I got into the Call of Cthulhu roleplaying game and discovered their single-player books, like Alone Against the Dark and Alone Against the Frost. I rather thought that putting together an app version with all the rules built in would be a fun project, but never had the time.
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.
in Programming on Mac, Rosetta, Reverse-engineering, Security
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.
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.
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.
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.
If you’ve been playing with SwiftUI for a while, you’re likely familiar with the liberal use of @State and @Binding throughout the library. For instance, consider the following simple to-do item editor:
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.
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.
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!
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.
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!)
In updating some stuff for the ReadiumSDK 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:
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.
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.
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.
[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?
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.
The astute Mr. Gemmell earlier today made note
of a rather elitist-sounding article
over at paidContent:UK. The author of that piece rather laments the fact that
eBook consumption is led by ‘genre fiction’. You know– everything that most people
read; something — shudder — classifiable. Science fiction. Romance. Crime.
Horror. Fantasy. Historical.
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.
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.
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 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.
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.
Earlier today, Mark Topham pointed me towards IAP ‘consumables’, a method by which a user could be billed, say, $4.99, but which would still bill them if we put through the transaction again (for a different $4.99 book).
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.
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.
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.
So since I posted my original article, I’ve heard from a couple of people about a nice solution to the problem, although I’ve then heard from another that it can still bite you in the ass.
So a little earlier tonight Matt Drance opined about -[NSNotificationCenter addObserver...usingBlock:],
claiming it wasn’t so good. I personally love being able to specify a block to
handle a notification, and especially love being able to have the observer run on
the main thread, or on a queue of my choice. This is absolutely awesome.
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.
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.
[W]e cannot accept an outcome where developers are blocked from using our innovations and enhancements because they are not available on our competitor’s platforms.
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.
For my iPad Dev Camp Hackathon project I’m releasing AQGridView, formerly known
as KBGridView, written for the Kobo iPad application(iTunes link).
It was designed to fill the role of NSCollectionView, with an API and internals
based around UITableView. Full details are found on its GitHub project page.
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.
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.
A detailed post from Michael Tamblyn of Kobo about the
pricing metrics of eBook publishing, particularly focussing on the agency model
being proposed by Macmillan, to which Amazon ‘capitulated’
after cutting them off over the weekend.
Jeff brings many of Jon Casasanta’s points down to earth and discovers that, like Mark Twain’s hero, rumours of the death of Mac software have been greatly exaggerated.
So response to my previous post has been fairly positive, despite not achieving the critical mass necessary to land on Daring Fireball— come on @gruber, pay attention ;o)
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.
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.
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.
Following some conversations with the nice folks on the #textmate IRC channel, I’ve tweaked the name and layout of the GoTextMate bundle. The link above now points to the new version of the project.
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 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.
So Amazon recently changed the terms of service for their Product Advertising API,
which is in use in applications such as Delicious Library. This is (I believe) the
API by which DL gets its book information, and through which it provides links to
related items, reviews, etc.
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.
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.
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.
If you’re tired of using the pure-C API for accessing the system address book on
iOS, this project will give you an Objective-C wrapper around that API.
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).
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.
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.
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:
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.