Archive for February 8, 2013

Friday, February 8, 2013

Hooked on DTrace

Mark Dalrymple:

A friend of mine got an app rejected from the Mac AppStore because his app was (supposedly) attempting to open the Info.plist in DiskArbitration.framework in read/write mode. An app really shouldn’t be trying to write to anything in a system framework. Sad thing is, his app wasn’t doing this, at least not explicitly. It just used the framework, including it in Xcode in the usual manner and then calling its API. The framework was being loaded by the usual app startup machinery. It was an unjust accusation, but there’s really no recourse, short of resubmitting the app and hoping it works.

Wouldn’t be nice if you could catch every open being done by a program, and see what access flags it’s passing? You could take this output and see “oh yeah, for some reason I’m opening this read/write” and do some debugging, or else have some evidence for “I don’t see any wrongdoing”. Sounds like a great application of DTrace.

Update (2013-02-17): Part 2.

Update (2013-02-21): Part 3, which focuses on Objective-C:

Whenever faced with “who creates this” or “who calls this”, and I have no idea where to begin looking in the code, I reach for DTrace.

Update (2013-03-14): Part 4:

One way to do it is to make your own static probes. These are functions you explicitly call inside your program or library that tell DTrace “Hey, if you’re interested in country-clicking, someone just clicked on FI.” You can then put a DTrace probe on country-clicks, and all the other data available in DTrace is at your disposal like stack traces and timestamps.

The Base64 Encoder Has a Fixed Point

Francisco Mota (via Reddit):

Every time we encode, we get the same string back with a few changes at the end. This isn’t on purpose, this is a purely accidental consequence of base64’s design. There was never any point where the designer of base64 decided “Let there be a long string s that is a prefix to its own representation in base64!”

Civilized Discourse Construction Kit

Jeff Atwood:

Our amazingly talented team has been working on Discourse for almost a year now, and although like any open source software it’s never entirely done, we believe it is already a generation ahead of any other forum software we’ve used.

I greatly admire what WordPress did for the web; to say that we want to be the WordPress of forums is not a stretch at all. We’re also serious about this eventually being a viable open-source business, in the mold of WordPress.

Unlike Atwood’s previous project, Stack Overflow, Discourse is built using Ruby on Rails, Ember.js, and PostgreSQL.

Update (2013-02-11): Robin Ward explains more about the choice of Ember.js.

Update (2014-04-27): The Omni Group is using Discourse for their new forums, and I find it maddening. It seems to load posts only when you scroll down, and unload them when they scroll out of view. So as I scroll I am constantly seeing content load, even minutes after viewing the thread. And since the posts that are out of view are unloaded, the browser’s in-page find feature doesn’t work. It’s also annoying how the URL in the browser’s location bar changes as I scroll, and even without scrolling after I go to a supposed permalink.

Update (2014-05-21): Omni is switching all their forums to Discourse. The previous forum software was some of the best I’d seen. I find the new forums almost unusable. Searching within a page doesn’t work. Neither does saving as a Web archive or PDF. I can’t even use Select All and the Copy command to copy the text to the clipboard. The URL in the local bar changes as I scroll around, and even when I click on a permalink. The scroll thumb is no longer accurate. It feels like my Web browser is broken, but the same problems occur in current versions of Safari, Chrome, and Firefox. Yes, Discourse looks slick, but I wouldn’t choose it over any of the ancient PHP-based forum packages it was meant to replace. It’s shocking considering how good of a Web citizen Stack Overflow is.

rooSwitch Is Now SwitchUp

roobasoft:

I’m excited to announce that rooSwitch has a new home, name & most importantly a new caretaker. Irradiated Software has been handed the keys and has renamed it to SwitchUp.

It’s a cool utility for managing sets of application preferences and support files, kind of like the old Mac OS 9 Location Manager.