Archive for January 22, 2013

Tuesday, January 22, 2013 [Tweets] [Favorites]

Actual Facebook Graph Searches

Actual Facebook Graph Searches is like The Amazing iOS 6 Maps except more scary than funny (via Hacker News).

An Open Letter to Xcode

Graham Lee:

I think you, and the product people, and the developers who make you, all know that you are a key piece of machinery in producing Apple’s bread and butter. I worry though that other people at Apple, particularly some of the managers, do not see this. I think that they see you as a tool for internal use and a small number of external customers; a group that is not the primary focus for Apple’s products. These same people would see the combine harvester not as the greatest labour-saving device of the twentieth century, but as a niche instrument only of interest to combine harvester operators.

[…]

Help everyone to realise that the better you are, Xcode, the better nearly everything else that Apple does will become.

[…]

What I’m saying, Xcode, is that you’re mature and grown up and people respect you for that. Please stop having these mid-life crises like you did at version 4 where you suddenly change how everything is done. Your work now is in incremental enhancement, not in world-changing revolution. People both at Apple and outside have come to expect you to be dependable, reliable and comfortable. You may think that’s boring. It’s not! Remember all of those things that exist because of you, all of those people who are delighted by what you have helped create. Just bear in mind also that when it comes time for Xcode 5, people will want a better Xcode, not a replacement for Xcode.

The Trend Against Skeuomorphic Textures and Effects in User Interface Design

John Gruber:

They work on sub-retina displays because sub-retina displays are so crude. On retina displays, as with high quality print output, these techniques are revealed for what they truly are: an assortment of parlor tricks that fool our eyes into thinking we see something that looks good on a display that is technically incapable of rendering graphic design that truly looks good.

Blocks, Operations, and Retain Cycles

Conrad Stoll (via Jonathan Penn):

What we had to do is just make the operation referenced by the block into a weak reference. That way, the block isn’t holding onto the operation, it just has a weak reference to it. It’s worth pointing out that pre-ARC, __block was sufficient to prevent a retain cycle. But with ARC, __block no longer carries the same meaning and __weak must be used to prevent a retain cycle. When the operation is finished and gets released by the operation queue, it will go away. That will then release the block, which releases the image and graphics contexts just like we see it’s supposed to in the sample above. That resulted in dramatically improved memory performance and completely normal memory behavior. Literally just that 2 line fix there.

It seems like NSBlockOperation shouldn’t provide access to its -executionBlocks; then it could release them as they complete or when it’s canceled. (Alas, the API uses “cancelled” while nearly everywhere else Apple uses the single-l form.)

Apple Pulls 500px’s Mobile Apps

Sarah Perez (via Andrew Wooster):

“The app was in the App Store for 16 months – since October 2011. Can you imagine that?” Tchebotarev exclaims. The app was updated in November with a gorgeous new interface, but no changes were made which would make it easier to find nude images.

Programmer Interrupted

Chris Parnin (via Jon Trainer):

But it is only so long before interruption finds a way to pierce my protective bubble. Like you, I am programmer, interrupted. Unfortunately, our understanding of interruption and remedies for them are not too far from homeopathic cures and bloodletting leeches.

A Month With Apple’s Fusion Drive

Anand Lal Shimpi:

It seems that Fusion Drive is really made for the user who doesn’t necessarily have a ton of applications/data, but does have a reasonable sized media collection. For that user, Fusion Drive should be a reasonable approximation of a well managed SSD/HDD setup with your big media files going to the HDD and everything that you launch frequently living on the SSD. I’m always going to ask for a larger cache, but I do believe that 128GB is a good size for most client workloads and usage models today.

Managing Books in iTunes

Michael E. Cohen:

With the major overhaul that Apple gave to the look and feel of iTunes in iTunes 11, Apple had a chance to revamp the Get Info interface to handle the different kinds of media that iTunes manages more fluidly and accurately. Instead, Apple left Get Info virtually unchanged, so that you have to guess that authors are really artists, that categories are really genres, and that books don’t have anything corresponding to Beats Per Minute (yes, you can set that field in Get Info for a book, though why you would want to do that – or why iTunes even allows you to do it — beats me).

More sadly, Apple has done little in iBooks to provide readers with the ability to see or to search through their books by any metadata beyond titles, categories, or authors, nor has Apple provided any organizing tools in iBooks other than those I described earlier. For the only ebook-reading software that Apple provides on any of its platforms, the lack of basic organizing tools in iBooks is embarrassing.

Google Button Colors

Daniele Gobbetti:

Check out the speech by Jon Wiley on this page. He explains the design decisions made by google in the past months. In the video he makes a lot of examples, for instance why the “compose” button is red while the “search” button is blue etc. etc.

It was a mystery to me.

E-mail Clients: Fast, Fluid, Ineffective

Christopher Breen:

You’d think that there would be solid alternatives, but you’d be wrong. And you’d be wrong because email clients are no longer focused on the power user.

That shouldn’t be surprising. Purchase any new computer or iOS or Android device and you get a free email client that satisfies the needs of the vast majority of users who demand little more than to send and retrieve messages through common email services. What sort of market does that leave for someone wishing to build a truly powerful email client (something, I understand, that is both difficult and time consuming)?

These days I find Apple Mail—combined with plug-ins, AppleScripts, and EagleFiler—to be the least bad option. However, I’ve been following the development of MailMate with interest. At least one other developer has a power-user e-mail client in the works.

NS: Poor Man’s Namespacing for Objective-C

Jonathan Rentzsch:

I’ve been successfully using a nine-line preprocessor hack for a few years now that effectively works-around the problem.

Define your classes using his simple macro, and you can easily prefix their names at compile-time.

NetflixGraph Memory Optimization

Drew Koszewnik:

The relationships between objects in our directed graph were generally represented with HashMaps, where HashSets of “to” objects were keyed by “from” objects.

This was a lot of objects and a lot of 64-bit pointers. In the new design:

Our data structure maintains two arrays. One is an integer array, and the other is a byte array. Each object’s connections are encoded into the byte array as delta-encoded variable-byte integers (more on this in the next paragraph). The integer array contains offsets into the byte array, such that the connections for the object represented by some ordinal are encoded starting at the byte indicated by offsetArray[ordinal].

This reduced the memory footprint by 90%.

Location Services Access Requires Outgoing Connections

Ole Begemann:

If your sandboxed Mac app requires access to Location Services, make sure to also request the entitlement for outgoing internet connections, whether your app needs it for other features or not. It might save you an unnecessary rejection by the app review team.

FirmTek miniSwap/U3

Bare Feats (via Paul Haddad):

The FirmTek miniSwap/U3 is the fastest USB 3.0 device we have tested to date. For that matter it’s the fastest bus powered storage device we’ve tested to date regardless of the interface type (including Thunderbolt).

It’s a relatively compact, fanless enclosure that can easily swap bare 2.5-inch drives. The price hasn’t been announced yet.

Dylan Programming Guide

Open Dylan (via Hacker News):

The Dylan Programming Guide has been updated to use our new documentation format. As a result it is now available in PDF and ePub formats as well as much improved HTML.

There were a lot of good ideas in Apple’s Dylan language. For example:

C and C++ macros are text substitutions, performed by a preprocessor. The preprocessor has no understanding of the language; it simply splices together text fragments to create replacement phrases.

Dylan macros are written in terms of Dylan language elements; the macros choose their transformation by pattern matching, and they substitute program fragments.

Language-based macros are more powerful than — and avoid a number of common pitfalls of — text-substitution macros.

Update (2013-02-17): The Hacker News thread.

Why Was “~” Chosen to Represent the Home Directory?

pbm quotes Wikipedia (via Hacker News):

This practice derives from the Lear-Siegler ADM-3A terminal in common use during the 1970s, which happened to have the tilde symbol and the word “Home” (for moving the cursor to the upper left) on the same key.

Where to Archive Your Tweets

Manton Reece:

Both of my apps — Tweet Library for iOS and Watermark for the web — can now import the .zip file you receive from Twitter. This file contains your full archive of tweets and retweets. Both apps can load the file directly from Dropbox, making it as simple as possible to get the tweets imported. And both apps are smart about only importing tweets that haven’t been stored yet, so you don’t have to worry about duplicates.

JATemplate

Jens Ayton’s JATemplate offers a replacement for Cocoa’s printf()-style format strings:

So, is this a horrible hack? Well, by the standards of typical day-to-day code, probably. But in the correct frame of reference, which is “compared to printf()-style formatting”, no.

When Is id Promoted to instancetype?

Steven Fisher:

This is straight from Clang Language Extensions:

  • the first word is “alloc” or “new”, and the method is a class method, or
  • the first word is “autorelease”, “init”, “retain”, or “self”, and the method is an instance method.

What It’s Really Like Working With Steve Jobs

Glenn Reid (via Kontra):

I can still remember some of those early meetings, with 3 or 4 of us in a locked room somewhere on Apple campus, with a lot of whiteboards, talking about what iMovie should be (and should not be). It was as pure as pure gets, in terms of building software. Steve would draw a quick vision on the whiteboard, we’d go work on it for a while, bring it back, find out the ways in which it sucked, and we’d iterate, again and again and again. That’s how it always went. Iteration. It’s the key to design, really. Just keep improving it until you have to ship it.

His blog has a 1998 e-mail exchange with Jobs from before he was hired to create iMovie:

I’m guessing, from talking with Sina and Will Stein, that what you’re after is the Democratization of Video Editing, the simplest and most obvious tool yet for doing basic editing. It seems like it could be done.

He also created iPhoto. Here’s a blog post from 2008 with the idea for something like Photo Stream:

I should be able to just push a button on my iPhone and have [the photos] bluetooth’ed or 3G’d or even emailed back to my mothership. […] Or, even better, automatically sync them to a special place on MobileMe where I can get them at my leisure later (not necessarily publish them, but sync them and allow me to make them public/visible or not).

How to Pair Socks Efficiently

amit (via Jason Kottke):

Given a pile of n pairs of socks, containing 2n elements (assume each sock has exactly one matching pair), what is the best way to pair them up efficiently with up to logarithmic extra space?

I like this answer from Srinivas, although it assumes that each sock has more than one pair:

I use pigeon hole principle to pair exactly one from the laundry pile. I have 3 different colors of socks (Red, Blue and Green) and 2 pairs of each color. I pick up 4 number of socks each time and I always make up a pair and get to work.

Introduction to Garbage Collection

nari (translated by Chris White) (via Jonathan Rentzsch):

It seems as though the majority opinion about garbage collection is “As long as everything works okay behind the scenes I’m all okay.” However garbage collection is one of the taken for granted features that is built into a good number of language processors. It would not hurt as a programmer to properly understand the structure and internal implementation of garbage collection.

He starts off with some bookshelf examples and then explains how Ruby’s garbage collector works.