2010

2009

2007

2006

2005

Integrating databases with Spotlight

Entry published apr 21 2006

Due to the way Spotlight is designed, it is very difficult to index monolithic databases, as in all the data stored in one file. Spotlight works by monitoring the file system for modifications, like a file being created or a file being saved. When a file system event occurs, Spotlight identifies the type of file and uses it’s corresponding Spotlight plugin, if available, to extract data from the file. This works great for things like Word documents, text files, and any other kind of document based application.

For applications which use databases, Spotlight indexing is a lot harder to pull off. For example, iCal uses a database to store your calendar events, but iCal is searchable by Spotlight, how can this be? What iCal does is very hackish, for every event in the database it creates a corresponding file in your Library folder which can be indexed by Spotlight.

I think a cleaner option would be for Apple to implement a system service similar to printer spooling. If an application that uses a database updates data, it can post via a notification or some other mechanism to the Spotlight spooler the modified data. When Spotlight is free, it can index the data and add it to it’s repository. Along side the data fed into the Spotlight spooler, there could be some kind of index that Spotlight could pass into the host application when that search result is opened.

What’s also interesting, is that despite the fact that Apple has introduced CoreData to developers, they haven’t provided an easy system for developers to index their databases. Hopefully, a system like the above would help alleviate the problem and eliminate the trickery with files.

0 comments category: mac os x
. o .

MailCore 0.2 is out! And it's universal!

Entry published apr 18 2006

MailCore 0.2 adds a few bug fixes and it’s built as a universal binary. Most importantly I fixed a few SMTP/MIME related bugs. Now that those bugs are fixed, SMTP works great. I have two working examples, InboxLister, which is a minimal IMAP client in like 15 lines of code and MessageSender, which sends e-mail in very few lines of code as well. The documentation is nearly complete, you can check it out here. I will be adding some more detail to the introduction page and the exceptions page in the future, but all of the pages on the classes are complete. The newest release is available precompiled here. Note: I haven’t implemented message flags yet, but that is next on my list.

0 comments category: kiwi
. o .

How to compile cyrus-sasl as universal

Entry published apr 15 2006

Most people probably aren’t going to care about this, but I want to share this so no one else has to go through the same pain. A few things are fairly hackish, but hey, it works. Much thanks goes to Nicholas Riley in helping me figure this out.

  1. Download the cyrus-sasl tarball from http://asg.web.cmu.edu/sasl/sasl-library.html

  2. The newest version of GCC is much stricter when compiling so you’ll have to comment out line 112 in file lib/saslint.h, like so:

    //extern sasl_global_callbacks_t global_callbacks;

  3. DO NOT run configure by itself, instead execute this:

    env CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" ./configure --disable-dependency-tracking

  4. Open libtool in a text editor and change this (should be about line 177):

    # Commands used to build and install a shared archive. archive_cmds="\$CC \$(test x\$module = xyes && echo -bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$linkopts \$(test x\$module != xyes && echo -install_name \$rpath/\$soname \$tmp_verstring)"

    To this:

    # Commands used to build and install a shared archive. -archive_cmds="\$CC -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 \$(test x\$module = xyes && echo -bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$linkopts \$(test x\$module != xyes && echo -install_name \$rpath/\$soname \$tmp_verstring)"

  5. Now run make, and it should compile
0 comments category: unix