Dan Wood: The Eponymous Weblog

Dan Wood is co-owner of Karelia Software, creating programs for the Macintosh computer. He is the father of two kids, lives in the Bay Area of California USA, and prefers bicycles to cars. This site is his weblog, which mostly covers geeky topics like Macs and Mac Programming.

Useful Tidbits and Egotistical Musings from Dan Wood

Categories: Mac OS X · Cocoa Programming · General · All Categories

Fri, 29 Apr 2005

Recently I listed some of the features from Apple's list of new Tiger features that I wanted to talk about. Well, now I can. So here are some followups to that post.

Quartz Composer
I will probably go into more in the future. In the meantime, people interested in cool graphics and animation should install the developer tools and run it, it's /Developer/Applications/Graphics Tools/Quartz Composer. Also check out "Core Image Fun House", an application that looks like the major basis for Stone Design's iMagininator.
Xcode 2
I've been using this new version for a while, and it's pretty solid. I like being able to keep my development contained to one window per project, though I really do miss the major window customization capability that was around in a previous version of XCode, was that Project Builder?
Fax Logs and Archives
Finally! I don't do faxing a lot, but it's handy to find out whether or not my fax got sent or not!
Spotlight Find
This is gettig a lot of attention, so there's not a lot to say. 'Bout time is all I can say; search within content has been around for a long time, but it just was never integrated into Mac OS X very well until now.
Core Image
I'll have some technical stuff to post about this later. In any case, this is great technology. Try the above-mentioned iMaginator or Core Image Fun House for a tour of what you can do. Starting now, lots of applications are going to have lots more eye candy!
Safari Inline PDF Viewing
Finally! I had been using a plugin, but this is much better integrated. You can open the PDF from Safari into Preview with a contextual menu.
Safari RSS Auto Detection
Does this look kind of like a suggestion I blogged 1-1/2 years ago? Safari's built-in display of RSS is pretty useless, but it's great integration with NetNewsWire and other RSS applications. Now you don't have to hunt all over for a little RSS/XML badge on a site; just click on the RSS badge to add it to your feed. Maybe this will encourage some websites with feeds to actually put the necessary detection markup into their pages.
Automator
I have never been one to swallow the AppleScript Kool-aide (except during and right after a talk by Sal Soghoian. But this makes applescriptability useful for just about anybody. I've used it quite a bit for just odds and ends, like renaming files, batch-converting images, and so forth. Great stuff, and it will be even more useful as more application come on-board.
Programmer Base 10 math Calculator
Apple's desscription didn't really do this feature justice. The built-in Calculator Application now has three personalities: basic, scientific, and programmers. Lots of useful features on the latter! Any of them can use RPN if you want.
Mon, 25 Apr 2005

As most modern developers know, a great way to save time when building an application is to stand on the shoulders of others, by making use of open-source/free software that is all around. You see if somebody else has already solved your problems in a general way, and incorporate their software libraries into your application. Ideally, you give a little back to the community and perhaps contribute something of your own for others to use.

I wanted to highlight a great Cocoa UI addition — or rather, replacement — that we are using in our forthcoming application. It's RBSplitView, a replacement for the not-keeping-up-with-the-times NSSplitView class. Its developer, Rainer, has been extremely helpful by making this class available, and responding to feature requests to enable developers to make more "modern" software. If you want a better split view, check this class out!

Wed, 20 Apr 2005

More people who read this weblog are probably aware of the "Meet the Engineers Behind Tiger" (Really, Managers) feature at Apple than realize that there's a new Pope (and the guy they chose was not my first choice).

Many of you have probably spend most of the last year worshipping these fine men as heroes ... but only now, here is your opportunity to be them.

How is that possible? you might ask. Well, thanks to the magic of iChat, you can change your online looks — and accompanying personality — at the drag of a mouse. Do you want to be French when you look your friends in the eye? Become Bertrand! Getting ready for a long hike in the Sierras? Let Ted Goldstein be your inspiration! Want to be seen in uber-cool spectacles? Your friends can envision you as Peter "Graphics" Graffagnino! Feeling like you need some pep in your life? Let Scott be your guide! (Plus, it's cheaper than coffee!)

Download the whole set here, or just drag an individual image from here to your iChat "Buddy List" window. Taa-daa!

(Thanks to Terrence for the unintentional idea!)

Sun, 17 Apr 2005

Here's a smaller report on day 2 of the California Democratic Convention.

See more ...

Sat, 16 Apr 2005

Yesterday was the first day of the 2005 California Democratic Convention, and as hoped, I am able to blog a bit, in an attempt to share the experience with readers who, like myself only a few months ago, are hardly aware of such an event like this taking place.

See more ...

Wed, 13 Apr 2005

Anybody reading this weblog is probably aware that Mac OS X 10.4 "Tiger" due out very soon. As a developer, I've been able to use the prerelease versions of the OS, but I'm also unable to talk about it. Now that Apple has released a big list of new features, I thought I would highlight the items from their list that I would express my enthusiasm for, if I could:

Quartz Composer
Build stunning visualizations that leverage all of Mac OS X’s graphics technologies.
Xcode 2
Experience the second major release of Apple’s groundbreaking developer tools, which bring together ease of use, UNIX power and high-performance development technologies.
Fax Logs and Archives
Keep logs and archives of your faxes.
Spotlight Find
Search all of your documents, images, emails and applications and view the results literally as fast as you can type in search words.
Core Image
Unlock the performance of today’s powerful graphics hardware and enjoy ultra-fast, pixel-accurate image processing.
Safari Inline PDF Viewing
View PDF documents directly in a Safari browser window — no other application required.
Safari RSS Auto Detection
Automatically detect the availability of RSS news feeds for a website so you can easily add them to your list.
Automator
Easily automate complex and repetitive tasks without any programming — just like having a personal robot inside your computer.
Programmer Base 10 math Calculator
Use different systems like base 8 or hexadecimal with the upgraded calculator.

Of course there are lots of little odds and ends from Apple's list that I will probably find handy. Notice the big feature that is absent from my list: Dashboard. I know it's what most users are excited about, but yawn. (Sorry, Dori!)

Tue, 12 Apr 2005

I haven't posted much about politics since the electoral debacle of last year. I was depressed with the outcome, and frustrated that all of the hope that so many of us had back then went up in smoke, and frustrated that in spite of the energy of the movement to take our country back, we still had a Democratic Presidential Candidate/Campaign who was pretty much the typical story. So I, along with a whole bunch of others, decided it was time to try to do something about it. I actually joined the Democratic Party (I had been independent) and got myself elected to being one of the delegates representing my assembly district here in California. And this weekend, I will be going to the California State Democratic Convention.

A lot of people who go to these things are entrenched old-timers and are happy to be members of this club, even if it means being on the losing team all the time. But a bunch of people like me are new at all this, and have to figure out what the heck is going on, but are also there to ask some hard questions and challenge the way things are currently run in the "Wobblycrats" party.

If I have computer access, I will blog a bit about what's going on here. This process is part of the way that citizens can have some say in the way this country is run, and I feel that so far, it's been quite an "insider's club." (Most people I talk to haven't even heard of all the state conventions, the assembly districts, the delgates, etc., and it took a lot of digging to figure out what it's all about.) Just as weblogs had a big impact on last year's elections, I think they can continue to have an impact by making transparent more aspects of our government ... seeing where the party platforms and positions come from, where the candidates get their start, and so forth.

If anybody has any questions about what the convention is about or what happens there, please feel free to leave them in the comments. (Please, no flames from Republicans — you are having your turn in office now, so lighten up.)

Fri, 08 Apr 2005

Our project uses Cocoa Bindings extensively. This works great, except for when you have a bug. For instance, you might have something defined in your nib file that doesn't correspond to anything in your model object. At runtime, you end up with a crash deep in the bowels of the bindings system, with nothing to help you find your way out other than the stack trace which looks like binding-related code of Apple's. It's completely opaque, of course — you can't tell what was happening between your code line that was running (say, loading a nib file) and where it has crashed.

There needs to be a way to tell what is going on. Maybe a way to log accesses, or a way to view the parameters being passed around when hunting through the stack traces in XCode's debugger. I've found a few clues from time to time, but usually it's a lot of work to figure out what went wrong.

Are there any fellow Cocoa developers using Bindings who have come up with tricks and techniquest for diagnosing bindings gone wrong?

Thu, 07 Apr 2005

I've was following the Terri Schiavo case a bit ... not for the tragedy that it was already, but for the way that it has been turned into such a political issue.

I read recently that a memo circulated among Senators to help Republicans politicize Terri Schiavo's case was recently proved as being real, and not faked as Republicans claimed.

I was curious to read the memo, which ABC first reported, so I did some googling. I found a reference to it on ABC's site. What is interesting is that the full text, which used to be on their, is not there anymore. The story has been changed. Is it standard to change an existing news story?

Here's the scoop. Do a Google search for schiavo memo full text and the top hit is titled "ABC News: GOP Talking Points on Terri Schiavo". If you click on the cache for the story, you see a story called "GOP Talking Points on Terri Schiavo". But if you actually go to the link itself, you get a different, but related, story, titled "Senator Says His Aide Wrote Terri Schiavo Memo".

I'm not suggesting there's any conspiracy to hide the original story, but it seems a bit weird, doesn't it?

FWIW, for posterity's sake, here's the full text of the Schiavo memo (boldfacing emphasis mine), from Google's cache:

S. 529, The Incapacitated Person's Legal Protection Act

Teri (sic) Schiavo is subject to an order that her feeding tubes will be disconnected on March 18, 2005 at 1p.m.

The Senate needs to act this week, before the Budget Act is pending business, or Terri's family will not have a remedy in federal court.

This is an important moral issue and the pro-life base will be excited that the Senate is debating this important issue.

This is a great political issue, because Senator Nelson of Florida has already refused to become a cosponsor and this is a tough issue for Democrats.

The bill is very limited and defines custody as "those parties authorized or directed by a court order to withdraw or withhold food, fluids, or medical treatment."

There is an exemption for a proceeding "which no party disputes, and the court finds, that the incapacitated person while having capacity, had executed a written advance directive valid under applicably law that clearly authorized the withholding or or (sic) withdrawl (sic) of food and fluids or medical treatment in the applicable circumstances."

Incapacitated persons are defined as those "presently incapable of making relevant decisions concerning the provision, withholding or withdrawl (sic) of food fluids or medical treatment under applicable state law."

This legislation ensures that individuals like Terri Schiavo are guaranteed the same legal protections as convicted murderers like Ted Bundy.

WebKit: Previous technique doesn't work for all situations

The technique I posted to prevent caching isn't all it's cracked up to be. If you are loading via -[WebFrame loadHTMLString: baseURL:] then it won't work. The included file is cached by WebCore and there is no way to get around it. Well, they have filed a bug report (#4082386), at least.

When I have a development "stumper", I first search around on CocoaBuilder and CocoaDev to see if anybody else has asked and answered the same question. Most of the time, I can find the answer there. Or I can try posting a question to the lists, or asking around of some developers I know. When all else fails, and I really need help, I use up one of the technical support incidents that comes with my Apple Developer Connection membership. These don't come cheap, so they are a last resort.

I've lately been doing some development with WebKit to display some HTML, and I've been looking for a way to prevent the display of a page from caching the files that it includes (images, stylesheets, javascript files, etc.). Normally caching is fine, but if I'm planning on changing the contents of a file that the page request includes and then reloading the page, the newly-changed file is ignored.

So I punted and asked Apple. And since it's a generic solution, maybe other developers can make use of this little tidbit. So I'm sharing it here.

See more ...

Tue, 05 Apr 2005

Google Maps added satellite imagery to their site. Very good quality, too. Here are some cool U.S. places to see from above:

Any other interesting sites to "google" from way up high? Add your links in the comments...

Sun, 03 Apr 2005

I've been making use of Apples "Pages" program for some personal projects lately. It's a more or less useful application, but one thing that drives me batty: It forces me to enter my registration information every time I launch the program.

Could this be a bug, or a new design decision by Apple to stem piracy?

In other aspects, the program is fairly usable, though a few aspects of it drive me nuts. It is more of a word processor than a page layout program, meaning that it's not very good at filling up a fixed number of pages. The way that it automatically creates and removes pages to fit the content is annoying to say the least. Often, when there are graphics or text boxes placed "above" the flow of text, they whimsically jump from page to page, or sometimes not so whimsically, disappear altogether from the document (and then maybe reappear later as new pages get added).

I do like the instantaneous text-wrapping feedback the program provides as you move objects around on a page. Being able to rotate text and graphics is great. The layout and column mechanisms are fairly intuitive after a little practice. It certainly behaves like a "modern" application. But I am sure it could use a little optimization: occasionally the program gets s...l...o...w even when running on a dual-processor G5. I pity user of legacy hardware trying to do anything complex on this program! Hopefully the Pages team will be motivated to speed up the program as the iPhoto team did.

The feature I would most like to see would be handling of documents with half-sheet-sized facing pages that print side-by-side on the same printed sheet. In such a case, the cover page and the back page would go side by side on the sheet; the inside-front and inside-back pages would go side by side, etc. This would save people the tedious work of physical cut and paste, or, as I'm doing, printing each page to a PDF and then placing the images side by side on a new document sized for a full paper sheet.

Sat, 02 Apr 2005

One "benefit" to being in the Apple developer program is their monthly mailings of CDs (and now, quarterly, DVDs). Back in the old days (Anybody remember Phil and Dave's Excellent CD and all the other silly titles?) the CDs were incredibly useful, chocked full of sample code, SDKs, online documentation, system software, and so forth.

Today, these CDs/DVDs are totally useless. Every few months, I open one up and check out the contents. And you know, there's nothing there that I can't download from the Internet — and probably get a newer version, too. And I laugh when I get a "seed" version of whatever OS is currently in development; by the time it gets to me, I've already downloaded, burned, and installed a much newer version!

So part of my fees to the developer program goes to fund this completely wasteful endeavor that should have been phased out in the late nineties. So thirteen giant non-recyclable Tyvek envelopes get thrown away, along with twelve CDs and four quarterly DVDs that sit on my shelf and accumulate dust until I get sick of seeing them, too.

Does anybody with Internet access actually find these CDs useful?