Archive for the 'Programming' Category

Deployment Build Directory with Xcode

Mar 09, 2004 in Programming

Here’s a useful tip from Chris Hanson about setting up a different build directory for development and deployment builds in Xcode.

I was trying to figure this out about 5 minutes before Chris’es tip showed up in NetNewsWire. I found it quite timely and I’m finally getting around to sharing it here in case anybody else might find it useful.

twhexdiff

Feb 06, 2004 in Programming

I’m more of a BBEdit person than a TextWrangler person, but I did lunge for the Bare Bones web site when I saw the TextWrangler 1.5.1 was available.

The TextWrangler 1.5 upgrade added AppleScript support to the Bare Bones’ newest product, but the AppleScript dictionary was missing (if I remember correctly) the compare command. The 1.5.1 update fixes this issue, among other things.

As a result, I’m able to post twhexdiff, a version of my bbhexdiff tool for use with TextWrangler.

TextWrangler is based off bbhexdiff 1.1 and is available from the bbhexdiff project page.

Custom Project Builder Templates

Sep 24, 2003 in Programming

Chris Hanson:

The standard response is to change one of the hidden user defaults for Project Builder. But did you know you can easily customize the file and project templates used by Project Builder?

Chris goes on to discuss creating file templates for his open source work.

I was looking at file templates last week and I think it’s cool that creating a new template is so simple. However, I’ve this far been thwarted in my attempts to create a template for Objective-C categories. It just doesn’t seem like there’s any way to split the file name into the class name and extension name.

Upgrading SDKs

Aug 14, 2003 in Programming

Here’s a simple request to anybody maintaining SDKs intended for third party use — when you release a new version of the SDK, do not change the default behavior of an essential function so I need to add additional code to restore the old behavior… especially if the new behavior takes over 10x longer to complete.

Open Source Licenses?

Jul 09, 2003 in Programming

For the aforementioned project dealing with Amazon.com wishlists, I need some way to parse to parse the XML data I’m getting back from Amazon.

After playing with Mark Liyanage’s TextXSLT application, I’ve decided to use XSLT and have already come up with a basic XSL stylesheet. I’m leaning towards using the Sablotron XSLT processor, but I haven’t dealt with many open source licenses so I’m not entirely sure what the licenses require of me.

According to the Sablotron FAQ, Sablotron is subject to the Mozilla Public License 1.1 or the GNU General Public License alternatively. I assume this means I get to choose which license terms I want to use?

If I understand correctly, the GPL would require me to release the source code used in my project. I read the Mozilla license and I think I would only need to release changes I made to the Sablotron code as opposed to my entire project. Am I interpreting this correctly or am I way off base?

For what it’s worth, I would much prefer to not release my source code. I’m probably going to release this project as freeware, but I’d like to keep the code to myself in case I decide to do something more with it at a later date.

Wish(list)ful Thinking

Jul 09, 2003 in Programming

I’ve been playing around with the Amazon.com Web Services because I’ve come up with an idea for carrying around Wishlists when I’m away from my computer.

I’ve made pretty good progress, but I’m looking to robustly handle as many product types as possible. Amazon carries so much stuff that I think I’d have a really hard time covering the bredth of Amazon’s of product lines if I tried populating my wishlist with every sort of product.

Instead of trying to become one with the Amazon catalog, I’m going to pose ask my readers (yes, both of you) for help. If you have an Amazon wishlist that contains items other than books and DVDs, I’d be very apprciative if you would share it with me.

To access your wishlist, I need one of two pieces of information:

  • Your wishlist ID
  • The email address associated with your Amazon.com account

The following example of locating the wishlist ID is from Web Services documentation:

http://www.amazon.com/exec/obidos/registry/19J6Y001ZYYD3

In the above URL, the wishlist ID is “19J6Y001ZYYD3″

Your wishlist ID doesn’t seem to appear in the URL when you click the Wishlist link next to your account — to see the ID, I think you need to search for your wishlist by your email address. If anybody knows a better way to find your wishlist ID, please post it here.

So, if you’re willing to share your wishlist, you can either post the info in the comments section of this posting or email it to the Contact address at the top of this page.

Irate Scotsman Strikes Twice

Jul 01, 2003 in Programming

The Irate Scotsman, Matt Gemmell, has apparently gone developer-community mad
within the last 7 days. This is a good thing.

It all started innocently enough with Matt’s plea to end the icon crisis. Basically, if you create some sort of icon, toolbar or otherwise, and you think others might find it useful, share it with the Macintosh development community.

So far, Matt, Michael McCracken, Gus Mueller, and Buzz Anderson have shared creations used in their software. If I figure out this icon thing, I’ll add something of my own.

From the share-and-share-alike point of view came the idea of taking donations to buy a purchase/commission a set of icons that are available for public usage. Alright, where do I send the check?

Matt’s madness continued on Sunday with the release of SS_PrefsController. SS_PrefsController lets you easily build multi-paned Preference windows, similar to Safari.

The Omni Group provides similar functionality with their OAPreferences class, but SS_PrefsController accomplishes this with fewer dependencies.

If Matt keeps up this pace, I think somebody should start iratescotsmanrumors.com, where Mac developers are free to post wild speculation about Matt’s next Big Thing.

Oh, and by the way, thanks, Matt!

OmniFoundation and HTML Entities

Jun 03, 2003 in Programming

I’m posting this mostly so I’ll remember it in the morning and beyond, but the OmniFoundation framework contains an category for NSString called htmlString. This category mostly generates HTML entities for high ASCII characters. It also handles ", &lt, and > and converts newline characters to <br/> tags.

I’ve been looking for something like this for a few days now and it didn’t occur to me to check the Omni source code until a few minutes ago.

Depending on how I use this, I may disable or modify the handling of quotes since I prefer the smart quotation generated by SmartyPants and the like.

Java 1.5

May 11, 2003 in Programming

java.sun.com

The new language features all have one thing in common: they take some common idiom and provide linguistic support for it. In other words, they shift the responsibility for writing the boilerplate code from the programmer to the compiler. Because the source code is now free of this boilerplate, it’s easier to write and read. Because the compiler, unlike the programmer, never makes mistakes, the resulting code is also more likely to be free of bugs.

Java was the first useful programming language I learned (I’m not counting Pascal and TI-82 BASIC), so it’s really interesting to watch it evolve over time.

bbhexdiff 1.1

Mar 28, 2003 in Programming

I just updated the relevant pages now, but I posted a minor bug fix for bbhexdiff at around 11:30 this morning. The main bug was that different files with the same name would try to create both temporary hex files in the same location.

I changed this so that the hex dump of the old file has the suffix “.hexo” and the hex dump of the new file has the suffix “.hexn.”

You wouldn’t have seen this if you used either the -o or -n options. However, you would have seen some debugging code that printed out the name of the hex dump files. This code has been removed.

I also added code to make sure both hex dumps aren’t the same. With the old code, you would have received a warning from BBEdit if you tried to compare a file to itself. However, if you were comparing large files, this could take some time. As a result of this change, the warning occurs much sooner.

Update: I just reread the entry and noticed I wasn’t entirely clear about the new file extensions. They’re only applied if you don’t use the -o or -n options. If you specify your own names for the hex dumps, the script does not modify your names.