Archive for September 4, 2015

Friday, September 4, 2015

qtmodernizer

qtmodernizer(1):

qtmodernizer is a command line tool to examine a media file which may be in a legacy format or may contain legacy media tracks. In this case a legacy format is one which cannot be read directly by CoreMedia or AVFoundation frameworks.

qtmodernizer examines all the tracks to determine if they are all in a form that can currently be played. If all tracks are playable and the format is readable, qtmodernizer does returns and does nothing. If any of the audio or video tracks are encoded with a codec that CoreMedia does not support, that track will be converted to a modern format, usually H.264 for video and AAC for audio (see --useprores for other choices).

This was added in Mac OS X 10.9. It’s probably a good idea to update any old media files that you have now.

Struct Semantics in Swift

Chris Eidhof:

Instead, we can change our mutableData accessor to prevent copying when there are no other references to the data variable. To do this, we need to check if the data is uniquely referenced. In other words, we only make a copy of the data if the data is shared. We can do this using the isUniquelyReferencedNonObjC function. This is the reason why we need Box: it only works on Swift classes. NSMutableData is an Objective-C class, and then the function doesn't work.

[…]

Now we have full copy semantics, and efficient behavior: only when a copy is really necessary, it is made. This way, we never have to remember to write data.copy() ourselves, we implemented it correctly once and can then forget about it.

Lessons Learned From Reading Postmortems

Dan Luu (via Kyle Van Essen):

For more on this, Ding Yuan et al. have a great paper and talk: Simple Testing Can Prevent Most Critical Failures: An Analysis of Production Failures in Distributed Data-Intensive Systems. The paper is basically what it says on the tin. The authors define a critical failure as something that can take down a whole cluster or cause data corruption, and then look at a couple hundred bugs in Cassandra, HBase, HDFS, MapReduce, and Redis, to find 48 critical failures. They then look at the causes of those failures and find that most bugs were due to bad error handling. 92% of those failures are actually from errors that are handled incorrectly.

Solving Wi-Fi Coverage Problems

Glenn Fleishman:

With a combination of graphic visualizations, lists of information, and the capability to drill down into super-technical details, WiFi Explorer has become my top recommendation for anyone trying to sort out a local Wi-Fi environment.

[…]

WiFi Explorer helps tremendously with understanding interference from adjacent networks by providing both comprehensive details and graphical insight. It also lets you see at a glance precisely how your network is configured. Apple doesn’t offer that in AirPort Utility, which shows connections and base station names, but requires you to hover over each base station to see channel assignments and other details.

[…]

The Channels view is remarkable. It shows how different base stations are occupying swaths of frequencies. In 2.4 GHz, you can see where networks overlap. Channels 1, 6, and 11 are considered non-overlapping — the central frequency for each channel is offset by 25 MHz, or more than a full channel.