The Confusatory

cbowns’s tumblr.

  1. Designed to Annoy

    What if cigarette cartons were designed to be less convenient? A study in design from RISD.

  2. “In a blinding flash of inspiration, the other day I realized that ‘interactive’ anything is the wrong word. Interactive makes you imagine people sitting with their hands on controls, some kind of gamelike thing. The right word is ‘unfinished.’ Think of cultural products, or art works, or the people who use them even, as being unfinished. Permanently unfinished.”

    Brian Eno in an interview with Kevin Kelly, via rogre (via nicolefenton)

  3. "Offices Designed as Fun Palaces Are Fundamentally Sinister"

    dezeen maganize

    [These] have trickled into the mainstream, spawning the ubiquitous astroturfed, supposed fun palaces that characterise digital, media and communication office design. Plastered with domestic wallpapers that have long since lost their edgy irony, punctured by playground slides linking one floor with another, their forced entertainment has a sinister tone. These are places of perpetual adolescence, whose playground references sentence their employees to a never-ending Peter Pan infantilism.

    These spaces of west-coast-uber-alles business ideology might be seen as a denial of the very real power structures inherent in labour relations. And their denial of these dynamics through apparent fun and the sensation of individualism could be seen to operate as a form of oppression. More fundamentally sinister is the idea of work colonising the real spaces of intimacy and freedom: when your office resembles all the places that you go to escape work, maybe there is no escape from work itself.

  4. A lot, a lot, a lot, a lot of your lived experiences on Earth actually have nothing to do with you, but with the narrative that your body presents — at least that’s what I’ve deduced. The narrative can change, sure, but if it does, it’s got nothing to do with what you’ve done to subvert it, and everything to do with other people doing a better job of restraining their inner asshole.

    As the genius comedian Chris Rock said of Pres. Barack Obama’s election in 2008: “You could say that black people made progress, but to say black people have made progress would mean that black people deserved to be segregated,” he said. “The reality is that white people have gotten less crazy.”

    This brings me to the recent Harvard Business Review article by a Harvard professor that aggregated a bunch of studies which all said that the social and inter-office political implications for women who “lean in,” AKA aggressively negotiate for pay or other things at work, are much more catastrophic than they are for men.

  5. “The internet already feels like the Yo app on your birthday (“Happy birthday! Happy birthday! Happy birthday!” and nothing more to say).”

  6. Technical Reading Tuesday

    I’ve used steipete's PSPDFKitImproveRecursiveDescription for years: when debugging an iOS application, it prints out a ton more information about the view hierarchy than the default [UIView recursiveDescription] method. It prints out the owning view controller for a view, child view controllers, and frames which overlap or are zero-sized. I’ve got a fork of the gist which builds successfully for iOS 7.

    I went crawling through steipete's gists earlier last week, and found just a ton of gems. Some of these are tactical strike-force fixes for odd/buggy UIKit behaviour, or debug-only (like the improved recursiveDescription gist), or should just generally be handled carefully.

    Macros, niceties, scripts, etc:

    Hacking inside UIKit:

  7. Mark up your methods with nonnull

    clang supports a neat markup attribute called nonnull. NSHipster has more information about it. You can use this attribute to indicate to the compiler if any (or all) parameters to a method should not be nil/NULL.

    This is especially useful for methods which take block parameters. For a method which takes a block to provide optional additional behaviour, it’s common to pass a nil block when the caller doesn’t need to do additional work, like completion:nil for UIKit animation blocks. When writing your own methods which accept a block as a parameter, mark up the method with nonnull, and the compiler will help provide a compilation-time backstop to callers who mistakenly misuse the API. (Especially clever callers can still defeat the compiler’s ability to detect a passed nil, so you should continue to be defensive and check the block parameter as non-nil before calling it. After all, calling a nil block will crash your application.)

    nonnull takes a comma-delimited list of parameters (starting at 1) which should be non-null. You can also elide the parameter numbers, which is interpreted as “all parameters should not be null”.

    Example usage: all parameters should be non-null:

    - (void)uploadFile:(NSURL *)file
            completion:(void (^)())onComplete
      __attribute__((nonnull ()));

    Usage with a BOOL parameter, which can’t be non-null-checked:

    - (void)uploadWithProgress:(BOOL)showProgress
            completion:(void (^)())onComplete
      __attribute__((nonnull (2)));

    gparker pointed out that this attribute has been improved in recent clang builds to support in-line markup as well, though this is not supported in Xcode 5.1. When it is in a public Xcode build, it’ll look like:

    - (void)uploadFile:(NSURL *) __attribute__((nonnull)) file
            completion:(void (^)())onComplete;
  8. iOS Permissions: Respecting the User

    [Ed: apologies for linking to TechCrunch. We try to avoid it.]

    There’s an excellent article written by Cluster about prompting users for location services, photo album access, and receiving push notifications.

    iOS’s dialog box-based permission granting system for photos, location, etc. has been widely accepted as “Works Well (Enough)”. However, if a user selects “Don’t Allow” in a dialog, and wishes to change it later, they have to exit the application and go through several steps to change it.

    five-step user permission access flow in iOS 7

    From the application’s perspective, this is difficult to guide users through successfully (and even harder to make sure they make it back to your app).

    Cluster implements several alternate approaches, which I believe are better both for the application and for the user:

    • They show a native iOS dialog asking if the user wants to grant access, and only if the user says “yes” do they show the actual iOS dialog for accessing photos (or location, etc).
    • They implement UI that makes it clear what the advantages are to granting access.
    • They educate and inform the user about the dialog that’s about to come, what it’s for, and why it’s appearing.

    I like these approaches a lot. They contextualize and inform the user about the permissions and data access they’re granting. They allow a user to judge the requested access on merit and the value it will yield, rather than being faced with a hostile “the app wants your location right now yes or no?!” dialog at launch (or a barrage of several in a row).

  9. Remapping Keyboard Commands in Sublime Text 2: Embrace the Disassembler

    Sublime Text 2 is a highly extensible GUI text editor for OS X, Windows, and Linux.

    It contains a simple system for users to remap its commands’ keyboard shortcuts. On OS X, I traditionally ack through ~/Library/Application Support/Sublime Text 2/Packages/Default/Main.sublime-menu and find the title of the menu item I’m looking to change. Remapping it is simple: following the directions, you add a line like: { "keys": ["command+option+r"], "command": "filter_through_command" } to your user keymap, and the new shortcut takes effect immediately.

    I wanted to remap a command which had no menu entry, though: the Find box’s “Regular Expression” toggle. Searching through all the usual keymaps came up empty when searching for it, “Whole Word” (another Find box toggle), and others. otx (a disassembler built on top of otool, installable via homebrew's headonly repository), however, found a result in the application’s binary:

      +467  00000001000b9853  488d358b503f00            leaq        0x3f508b(%rip), %rsi          icon_regex
      +474  00000001000b985a  488d0d8f503f00            leaq        0x3f508f(%rip), %rcx          Regular expression
      +481  00000001000b9861  4c8d059b503f00            leaq        0x3f509b(%rip), %r8           toggle_regex
      +488  00000001000b9868  4c89ff                    movq        %r15, %rdi
      +491  00000001000b986b  e80ad9f7ff                callq       icon_button_panel::add_toggle_button(char const*, observable<bool>*, char const*, char const*)
      +496  00000001000b9870  498d96e0010000            leaq        0x1e0(%r14), %rdx
      +503  00000001000b9877  488d3592503f00            leaq        0x3f5092(%rip), %rsi          icon_case
      +510  00000001000b987e  488d0d95503f00            leaq        0x3f5095(%rip), %rcx          Case sensitive
      +517  00000001000b9885  4c8d059d503f00            leaq        0x3f509d(%rip), %r8           toggle_case_sensitive
      +524  00000001000b988c  4c89ff                    movq        %r15, %rdi
      +527  00000001000b988f  e8e6d8f7ff                callq       icon_button_panel::add_toggle_button(char const*, observable<bool>*, char const*, char const*)
      +532  00000001000b9894  498d9600020000            leaq        0x200(%r14), %rdx
      +539  00000001000b989b  488d359d503f00            leaq        0x3f509d(%rip), %rsi          icon_whole_word
      +546  00000001000b98a2  488d0da6503f00            leaq        0x3f50a6(%rip), %rcx          Whole word
      +553  00000001000b98a9  4c8d05aa503f00            leaq        0x3f50aa(%rip), %r8           toggle_whole_word

    In the above disassembly, you’ll notice the usual underscore-named commands appear as plain text. Those are exactly what I needed to add to my user keymap!

    { "keys": ["control+command+r"], "command": "toggle_regex"}