Category Archives: Computing

Articles about computers and the IT industry.

Mpow Swift Bluetooth headphones

Buying the Mpow Swift Bluetooth Headphones was an experiment to see if there was a solution to a very first world problem: tangled headphone cables.

Good bluetooth headphones easily go into the hundreds of pounds. These were less than £20 and, considering that, are surprisingly good.

They’re in-ear and block enough sound that I can listen to podcasts on the tube which is my main requirement. The sound quality is fine for music if you’re not too picky.

My main gripes are the colour (bright green) and the battery indicator which drops from a claimed 30% full to zero in milliseconds. In practice I don’t let it drop much below 50% before re-charging.

Overall it’s difficult to argue for the price.

Amazon Fire 7″

The Amazon Fire 7″ falls very much into the “good for the money” category. If you compare it to an iPad you’re going to come away disappointed. The screen is terrible. Viewing angles are not great, the colours are washed-out and it’s low resolution by modern standards. Battery life could be better. The case feels cheap and it creaks a bit when you squeeze it. And the app selection is nowhere near what you get in Apple’s (or even Google’s) eco-system.

But — and it’s a big but — it’s a tenth of the price of an iPad. And, if all you want to do it watch Netflix and BBC iPlayer, it’s perfectly adequate and well worth £50.

iPhone 6s

I wasn’t sure that I wanted a “big” iPhone as I was perfectly happy with the 4” form-factor. But if I was going to get a new phone and the new ones are bigger, I reasoned, I may as well go really big and go for a 6s Plus. On paper it made perfect sense.

Then I played with one in an Apple Store and I laughed. In practice it was comically big. I really didn’t want a phone I could only realistically use with two hands.

In many ways, my main complaint with the iPhone 6S is the same. It’s a lot bigger and I can only just use it one handed. Even a couple of months in, I think I still want a 4” phone.

Which is not to say that it’s not good. The camera is excellent. It’s much faster than my old 5. It’s my first device with Touch ID, and it’s great. Going back to punching in my PIN code every time would get annoying very quickly.

At launch I thought that 3D Touch would be a game changer and that Live Photos were a gimmick. I may have had that the wrong way around. The problem with 3D touch is that it’s not available everywhere, so you quickly forget to use it. This is not entirely Apples fault. Even my own apps don’t fully support 3D Touch yet. Live Photos, on the other hand, “just work” and they do capture a moment in a way that a simple photo doesn’t. They’re good for those serendipitous moments that you wouldn’t try to record a video of.

Overall I like it, but with more reservations than I’ve had with any of my previous iPhones after a couple of months with it.

Technology and Humanities

I read a couple of things about the intersection between technology and the liberal arts today, otherwise totally unrelated but the need for a connection between the two.

What the humanities can learn

The first was in the conclusion of Walter Isaacson’s “The Innovators,” a book about the inventors of the “digital revolution.” He started by talking about how engineers need to understand the arts and humanities (as Steve Jobs insisted Apple did) and moves on to how the opposite is also true:

The converse to this paean to the humanities, however, is also true. People who love the arts and humanities should endeavour to appreciate the beauties of math and physics, just as Ada did. Otherwise, they will be left as bystanders at the intersection of arts and science, where most digital-age creativity will occur. They will surrender control of that territory to the engineers.

Many people who celebrate the arts and the humanities, who applaud vigorously the tributes to their importance in our schools, will proclaim without shame (and sometimes even joke) that they don’t understand math[s] or physics. They extoll the virtues of learning Latin, but they are clueless about how to write an algorithm or tell BASIC from C++, Python from Pascal. They consider people who don’t know Hamlet from Macbeth to be Philistines, yet they might merrily admit that they don’t know the difference between a gene and a chromosome, or a transistor and a capacitor, or an integral and a differential equation. These concepts may seem difficult. Yes, but so, too, is Hamlet. And like Hamlet, eat of these concepts is beautiful. Like an elegant mathematical equation, they are expressions of the glories of the universe.

Most people have a bias one way or the other. You won’t be surprised that I know more about BASIC and C++ than Hamlet and Macbeth. You don’t have to — indeed can’t — know everything, but you can certainly learn to appreciate the other “side.”

What the scientists can learn

The other piece I read was about scientists being “easy prey for jihadists”. The study suggests that terrorist recruiters look for an “engineering mindset” as what’s required are people who are “intelligent and curious, but unquestioning of authority.”

Immunising the Mind – his report – gathers a wide spectrum of opinion in support of the contention that science education fails to inculcate critical thinking in the way that the debates within arts teaching do.

Again, basically the same conclusion but the other way around. Scientists, the report suggests, should understand more about the humanities, in this case learning about debate and arguing varying positions.

Apple TV (4th gen)

Keeping with tradition, I’m going to write about my new gadgets but my “unique selling point” is going to be brevity. And, in this case, another angle I bring is being a  Brit — much of the mainstream tech press is American and content is still very much a local.

Good

  • The same but better. I liked the old one, so I mean that as a compliment.
  • Feels much faster than the old one. (The hardware should mean that it does, but if Android has taught us anything it’s that specs don’t guarantee performance.)
  • think Siri is going to be great, and the more apps that it understands the better. For the past couple of weeks1 it’s only supported iTunes and some of the less useful stuff (weather, sports scores).
  • I really like the remote. Clearly it’s not designed for serious gamers but I don’t consider that a flaw. I’m not a serious gamer. (As an aside, it’s weird that much of the press have been complaining about the remote as a game controller and saying that the device won’t replace your Xbox One or PS4. I think it’s a good compromise between the two extremes.)

Bad

  • I think the price is starting to get a bit high as a casual/streaming device.
  • Missing a bunch of apps, though, hopefully, this is something that will be solved with time. There’s already Netflix, but I’d like to see BBC iPlayer 2, 4oD and Amazon video. US media companies seem to have been more on the ball than those in the UK, though many had apps on the old Apple TV; maybe they had less work to do to bring their streaming apps to the 4th gen?
  • I don’t have many apps yet but it’s clear that we’ll need folders sooner rather then later.

Ugly

  • The idea of copying all your credentials and configuration over from your iPhone is fantastic. Entering your Apple ID username and password using the on-screen keyboard is a pain. However, it seems not to be working for a lot of people and for me it took so long that I almost gave up.

Overall it’s already slightly better than the 3rd generation Apple TV and has the potential to get a lot better as the App Store fills out. In my mind, it’s odds of success likely rest on the cost. It’s therefore a shame that it’s possibly on the high side. Of course, that’s not been a problem for Apple in its recent history.

  1. I got the developer kit. []
  2. Having said that, I’m successfully using Auntie Player. []

Starting with CloudKit Syncing

One of the slightly more hidden features of CloudKit, Apple’s cloud-based back-end service for applications, is that you can use it to synchronise content as well as simply query it. I use this approach to sync favourite search terms between devices in my app Yummy.

However, I found the process wasn’t as well documented as it might be. It’s all there, but it’s written as many man pages are: it makes total sense if you already know what you’re looking for. This post is my attempt to make the process clearer.

We’ll start by inserting some data into the cloud data store and then try to get it back out again.

Pushing data to CloudKit is pretty straight forward. As we’ll see later there’s a little more preparation required in practice, but at it’s simplest it looks like this:

// Get a reference to the private cloud database
CKDatabase* db = [[CKContainer defaultContainer] privateCloudDatabase];
// create a new record
CKRecord* myRecord = [[CKRecord alloc] initWithRecordType:@“Record” zoneID:zoneID];
// set the interesting values
[myRecord setObject:@“Data” forKey:@“Key”];
[db saveRecord:myRecord completionHandler:^(CKRecord* record, NSError* error) {
  // error handling
  // save a local copy in cache
}];

We’ll come back to the zoneID variable used in the second line.

It’s asynchronous and only takes a couple of API calls. Nice.

Once data has been pushed to the cloud you have to get it back again. In my case there are few enough records that I could just download everything and do a local “diff.” That would look like this:

// create a query
CKQuery* query = [[CKQuery alloc] initWithRecordType:@“record”
                                              predicate:[NSPredicate predicateWithValue:YES]];
// define what to do with the records to be returned
CKQueryOperation* queryOperation = [[CKQueryOperation alloc] initWithQuery:query];
queryOperation.recordFetchedBlock = ^(CKRecord* record) {
  // do something with each record
};
// fire off the query
[db addOperation:queryOperation];

Doing the local diff is left as an exercise for the reader.

Again, just a few lines of code. (Quick aside: I’m not sure if it’s a good thing that the block is called for every record individually. It feels like it might be easier given a block of records, but CloudKit is generally consistent about this one record at a time approach.)

But that feels like it’s missing the point. CloudKit supports just getting a list of what’s changed since the last sync.

The class to find the records that have changed since the last sync is CKFetchRecordChangesOperation, but if we put that in a method:

CKFetchRecordChangesOperation* changesOperation = [[CKFetchRecordChangesOperation alloc] initWithRecordZoneID:[CKZoneID defaultZone]
previousServerChangeToken:nil];
[[[CKContainer defaultContainer] privateCloudDatabase] addOperation:changesOperation];

(The nil token means we’re starting from scratch — get us everything. Next time we sync, we pass in the token given at the end of the last sync.)

However if we run it we get an error:

<CKError 0x7fd326282bb0: “Server Rejected Request” (15/2027); server message = “AppDefaultZone does not support sync semantics”; uuid = 00138311-1714-4651-BE36-9D85B3CB5D51; container ID = “containerID”>

So, in short, the default configuration does not allow us to sync! We have to create a new record zone to store our records. A corollary of this is that you can only sync private stores, since you cannot create new zones for the public cloud database.

In principle this is quite simple but in practice it can get a little hairy as every call to CloudKit is asynchronous and there’s lots of error handling to consider.

I’m not going to show all my working (because what I have is pretty hacky and I’m sure you can do better) but the algorithm is:

  1. Are we logged into iCloud? If not, give up now
  2. Do we have a record of the current zone ID? If so, jump to step 7
  3. Fetch the list of zones that we can use
  4. Loop through the list returned. If there’s one we recognise, save the reference and jump to step 7
  5. Create a new zone
  6. Save the Zone ID in the completion handler
  7. Now get on with our sync / insert / update / delete operation

Note that queries tend to pick the right zone automatically, so if you’re searching rather than syncing you don’t need to worry about this.

And that’s it. Syncing is possible, just a little convoluted.