Archive for the “Programming” Category

I just spent some time and put together a bunch of user-defined commands to aid debugging with gdb on intel machines. They allow you to do things like print arguments to the current method, print arguments for the method about to be called, print return values, etc. To try them out, download this file, put it in your home folder, and rename it to .gdbinit. Then the next time you run gdb, try running help user-defined to get a synopsis of all new commands. You can ask for help on a specific command for more details as well.

The basis for this was inspired by Daniel Jalkut on the #macsb channel.

Update: I just added a new function getret. Re-download to get the changes.

Comments Comments Off on GDB tools for intel debugging

Last night I updated Notification Watcher to be a Universal binary. I also updated the project for Xcode 2.2. You can find it over at

On a side note, I really need to re-design tildesoft to actually look semi-decent. I’ve been meaning to do this for ages, but I am not a designer. Anybody have any ideas?

Comments Comments Off on Notification Watcher update

I just stumbled across something interesting today while poking around rcd (the daemon that farms out remote control events). If you send the NSDistributedNotificationCenter notification name @"" (no object or userInfo dictionary) then Dashboard hides itself. That’s pretty neat!

On a side note, it turns out there is no way to hack rcd to farm remote control events out to non-Apple programs. It has all the appleevents and such that it uses hardcoded in. I was really hoping they did something like implement a generic remote control AE that they sent to any app that cared, but no, if you’re not iTunes, DVDPlayer, iPhoto, QuickTime Player, or Keynote, you won’t see hide nor hair of the events.

Update: Turns out there’s a companion @"" notification as well that, you guessed it, brings Dashboard forward.

Comments Comments Off on Quick Tip: Dismissing Dashboard Programmatically

Just a quick post about AJAX on Rails, to test out my latest feature, which is Lightbox support for Typo:

If you click that and it doesn’t overlay the image on top of the current page, then you’ve run into a bug in Safari that I’m trying to figure out the cause of. Grrrrr. The bug has been worked around.

Comments Comments Off on AJAX on Rails

Inspired by a script mentioned on, I wrote a ruby script that generates an RSS feed for all the Crash Reporter logs on your machine. Just create a New Special Subscription in NetNewsWire, point it at the script, and you’re all set.

Comments 10 Comments »

Well, yesterday was my first day at my new job. For those of you who don’t know, I’m now working at Yahoo! as a Macintosh programmer. Interestingly, my coworker (co-Macintosh programmer) is a FOAF that I met at WWDC (our mutual friend is Karl Adam, a.k.a. PantherMachina).

Anyway, I flew out here 2 days ago and am staying (for the short-term) with my older brother Rick, who works at Apple. I’m looking into getting an apartment with my coworker (his name is Tristan), but we need to find something appropriate first. In any case, the work here looks to be quite interesting and enjoyable - last night Tristan and I stayed until, I believe, 9:30 PM. Granted, I was just customizing my computer to have all the things I want/need on it, but he was actually doing some work.

For those of you who use the Yahoo! Instant Messenger network, you’ll be happy to learn that the project I’m working on is the Yahoo! Instant Messenger client. However, I think that’s all I can tell you, so don’t bother asking for details.

Comments Comments Off on A new dawning of work

Seth Dillingham: “Never spend an hour doing by hand what you can spend four hours automating.”

How true.


Comments Comments Off on Words of Wisdom

So why has been talking about MouseHole lately. If you’re unaware, MouseHole is a ruby script that acts as a web proxy and filters HTML documents via ruby scripts. Or for a much better look at it, go look at what why wrote.

Anyway, I wanted a way to do JavaScript cross-site AJAX tricks, like what Greasemonkey enables. Unfortunately, because MouseHole is a pre-processor, not a JavaScript extension, it’s not possible. So I spent a few hours and wrote a way for MouseHole scripts to provide content that doesn’t actually exist (as opposed to mutating existing content). This way JavaScript can do an AJAX call within the same domain (so it doesn’t hit the security limitations) but that call is intercepted by your script, so you could pull info from other sites and send it back, or whatever you wish.

I haven’t actually done anything with this new capability yet aside from a rather silly example script which simply adds a button to Google that asks MouseHole for a random number. I’d really like to extend Google Maps, but that will require delving into how it works, and it’s far too late to do that now, as I need to get to bed.

Anyhow, I put together a patch and sent it to the MouseHole Scripters mailing list. If you check out MouseHole from the CVS repository, you can apply my patch and test it. Or you can just wait to see if it gets added to MouseHole.

Comments Comments Off on MouseHole and JavaScript

So, for a while now Colloquy has had 2 nice new things going for it:

  1. The ability to write plugins in F-Script
  2. An installation of Trac on the website


F-Script is pretty neat. It’s a Smalltalk-based language that lets you use the Cocoa frameworks to do some pretty nifty stuff. One of the best things about it is it lets me write Colloquy plugins that use the Cocoa frameworks without having to compile anything or relaunch Colloquy each time I want to test a new iteration of the plugin. It also lets me open up an F-Script console in Colloquy and play with it interactively.

Read the rest of this entry »

Comments Comments Off on TracLinks and the power of F-Script

Ok, I just released SafariSource v1.5. This version adds a preference pane to Safari’s preferences that lets you control the syntax highlighting. It also adds the option to use italic/underline/bold in addition to colors and the ability to change the base font/size.

This update was a real pain to do. I ran into a memory corruption bug that I spent hours trying to track down. A couple hours ago I finally discovered the cause. I was using a header file class-dumped from Jaguar’s AppKit and apparently Panther added 2 new ivars to NSPreferencesModule. What I didn’t expect was that my definition of NSPreferencesModule was taking precedence over AppKit’s definition, so when I allocated the memory for my subclass it wasn’t large enough and whenever those 2 extra ivars were written to it was writing to memory that wasn’t owned by my instance and that was the memory corruption. Simply class-dumping a new header file and using that magically solved the problem.

Anyway, enjoy :)

Comments Comments Off on Update to SafariSource