The result is brilliant, but a little rough (ExtJS and EnvJS don’t play nice, for example). The documentation is currently insufficient, but just barely so. One or two examples of usage would be enough to reduce this to a half-hour learning curve.
I have no idea where the name comes from… Maybe it’s a pun in German or something? 🙂
Programmers often want to put behavior in programs that only happens for debug builds, like logging or other diagnostics.
A common convention in C is to surround your debug-only behavior with “#ifndef NDEBUG … #endif”. The double-negative is ugly, but it’s a widely used convention nonetheless.
Xcode doesn’t use this convention by default, so you need to add “-DNDEBUG” to your Release compiles to turn off the debugging behavior. To do this, Get Info on your project, go to the “Build” tab, select the “Release” target and edit the Preprocessor Macros line like in the following screenshot.
(Credit: Greg Parker)
A few times when I upgraded Skype on Windows, it went into a mode where the settings would not stick. I’d have to reset them (like preferring my headset over my speakers) each time I launched Skype. I’m not the only one who experienced this — apparently Skype has an intentional “memory-only” mode where it will not save settings to disk. I don’t know why upgrading triggered the misconfiguration, but here’s the workaround.
The fix is to change this registry setting from “1” to “0”:
FreeBSD (and thus Mac OS X) has a filesystem notification API called kqueues which allow you to autodetect changes in watched files/folders. Apple uses it behind the scenes for indexing (Spotlight). It’s really fast. If I modify a file in one window via “touch /tmp/foo.txt” then the watcher program prints a message in the other window before the touch command exits. I’m using the Obj-C UKKQueue wrapper to simplify access to the kqueue system call.
I’ve found a few cases where the watcher fails to trigger when I rapidly delete and recreate the file… I’m not sure if it’s a bug in the system or in my app (probably the latter, maybe I’m not processing the input fast enough).
[UPDATE: oh, I just learned that kqueue can only watch a file that exists. If I wanted to know when a file was created, I’d have to watch the parent directory and then start watching the file when/if it was created. So that explains my problem with recreates]
In OS X 10.5, Apple added a new FSEvents API which uses a daemon to do a system-wide kqueue for the whole filesystem and distributes the messages to listeners in user space. I expect this is probably to reduce the kernel load of a pile of apps each requesting notifications for the same files.
My current project is targetting 10.4, so I’m avoiding the 10.5-specific FSEvents API.