Mar 2002

More Cocoa progress

I was proud of myself. After another day of working through that Cocoa book I had the urge to do a simple app from scratch.

So I did. It just displayed one window with an input text field and a button. Type in the text field, then click the button, then the browser runs a Google search on whatever you typed.

It took me about ten minutes from start to finish.

Admittedly it’s not very useful, so I’m not releasing it (even as sample code). Unless, that is, that I decide to take the obvious next steps, which are... Anybody? Anybody?

Yes, that’s right, a pop-up menu allowing you to choose the search engine. So you could choose Google, Apple developer docs, the PHP website, Dictionary.com, etc.

And of course via Preferences you could add, edit, and delete search engines: it would have to be customizable. Now that would be a pretty useful app—more useful than the unfortunate Sherlock, at least.

All mimsy were the borogoves

It’s funny. (Perhaps only to me.) Of all the poems ever written, the one whose first stanza I can remember best is one with a bunch of made-up words. From memory:

’Twas brillig, and the slithy toves
did gyre and gimble in the wabe.
All mimsy were the borogoves,
and the mome raths outgrabe.

Graveyard?

If you mix Diet Pepsi with Diet Coke in a glass is it a graveyard? How ’bout if you mix Diet Pepsi with Diet-Coke-with-lemon?

Learning Cocoa Progress

I made it about a third of the way through the Cocoa book yesterday. Good progress.

I still get sturvish when I think about outlets and actions too much. Actually, the concept is easy, the problem is knowing what to drag to what. My hurdle in learning Cocoa is understanding the relationship between what I see in Interface Builder and what I see in my code.

The joke I’ve heard about Cocoa is that a tutorial will advertise something like, “You can write a full-featured text editor with just three lines of code!” And then the tutorial takes 25 pages showing all the non-coding steps you have to do. For a certain type of programmer it’s pretty alien. Me, I’ve even always preferred .r files (text files) to working with ResEdit. And I never dug PowerPlant or MFC much. I like text.

That’s not to judge Cocoa but to say it’s different from what I’m used to. I’m enjoying learning it, and I already expect to use it in the future.

In fact, it’s about all I can do to stick with the book—I want to leap off and start working on some of the ideas I have for new apps. Patience!

Cocoa-land

I’m in Cocoa-land today. Probably for a few days. I’m working through Cocoa Programming for Mac OS X by Aaron Hillegass.

Why

One of the reasons I did the AppleScript and Frontier/Radio contextual menu plugins is so that writing tool and weblog tool authors have an easy way to connect to the desktop and other apps.

If you’re the author of such a tool, and you’re interested in working together in some way, let me know. I’m open-minded, looking for win-wins. I can also do contextual menu plugins for classic Mac OS and Windows (for a good cause).

CGIs in C

I must be nuts. I really, really like C. I like pointers. I don’t just use them, I like them. And all that memory management stuff. It’s fun.

I like the control, I like being close to the metal.

So sometimes I think the Web development language I should use is C. No scripts, no Java. C.

And then I think: what would I write in C?

I’d start with a templating system, of course, to make development easier. Gotta have templates.

And then of course one wants the ability to embed macros in the templates.

And then I realize—nuts, I’ve just re-invented Frontier, Zope, and PHP. I’m back to writing scripts!

Luckily this all takes place in my mind and I haven’t wasted any time on writing code.

But, you know, I really like writing in C.

Big Cat on VersionTracker

Like Big Cat? Don’t like it? You can rate it on VersionTracker.

Big Cat

In some places it’s common for the birthday celebrant to give gifts to other people. In that spirit I offer the Big Cat contextual menu plugin. It’s like the Frontier/Radio plugin but it runs AppleScript scripts. Here’s a Finder screen shot; here’s an Internet Explorer screen shot.

Sort-of Easter Egg

It’s not uncommon for programmers to want to leave their mark on a product they’ve worked on. Some sort of small Easter egg or something, something personal. Some kind of signature.

I’ve never given in to that temptation. Except once, that is, in a very small way.

On the Manila Appearance Prefs page, in the pop-up menu where it asks what date format you want to use for the home page, the example date is March 26, my birthday.

I had to pick a date—any date would do—and the first one that popped into my head was that date. So why not?

Thanks

I turn 34 today. Thanks for all the happy-birthdays!

And remember to wish Josh Lucas a happy birthday—he turns 30 today.

MySQL Explained to Frontier Users

I wrote a little piece explaining MySQL to Frontier users.

“Old programmer’s philosophy: if you work primarily (or exclusively) in one environment, it’s a good idea to learn about others. It stretches your mind, helps you think more widely and imaginatively about how to solve problems.

“It’s the programmer’s equivalent of being ‘well-rounded,’ which always sounds like something boring like eating your brussels sprouts—but really it’s not just nutritious but fun.

“So the point of this article isn’t to get anyone to switch from Frontier to MySQL but just to tell you about another environment.”

Menu sharing replacements

I don’t really miss menu sharing on OS X any more.

First thing is that the Frontier contextual menu plugin allows one to run scripts—it replaces OSA Menu for me.

Next thing is all the places Apple has allowed one to attach AppleScript scripts. There’s the script menu, toolbar scripts, and Script Runner. The key with those is that you can use AppleScript scripts to run a script in Frontier or Radio. Just send a doscript message to Frontier.

Another thing is that many apps—Eudora, AppleWorks, and BBEdit, for example—have a Scripts menu where you can attach AppleScript scripts. Again, you just use a small AppleScript script to run a script in Radio or Frontier.

It’s not quite as convenient as menu sharing—but, if you add it all up, you end up with an environment that’s at least as scriptable and customizable as classic Mac OS.

uuidgen

Tip for OS X developers: sometimes you need a UUID. One case is when developing contextual menu plugins. The easy way to generate a uuid is the command-line uuidgen tool. It takes no parameters and returns a UUID.

Rolling Referers Page with PHP/MySQL

I posted a small tutorial with code that describes how the referers page for this site and ranchero.com is done.

This feature is one of the many cool features in Manila, and I missed having it.

Go-carts

Last night I dreamt that me and Sheila and my extended family were racing around the streets of Paris in home-made go-carts. It was a yellow sunny day. We were all wearing old-fashioned aviator hats and goggles. There was a big pack of us. It was so fun. TV cameras appeared to cover the event, but we raced right past them. Finally we stopped for coffee. Then we raced around some more until dusk.

Look Up PHP Function for BBEdit

I posted my little AppleScript script for BBEdit to ranchero.com. For AppleScript newbies (I’m one) the page includes an explanation of how the script works.

Router problems solved

Not to keep you all in suspense about my router issues—I ordered a new router from a different company. It arrived the next day. I plugged it in—and, much to my kitten’s delight, it worked on the very first try.

So now I’ve fully switched over to using my cable modem. Surprisingly, this is the first time I’ve used NAT and DHCP and had a firewall. It’s about time. I always felt naked without all that stuff.

To my surprise, I get faster download speeds with the cable modem than I got from my T1. It’s amazing. Of course, uploading is another matter. But it’s not too bad, it’s roughly like having a dual-channel ISDN line. (I had ISDN for a couple years back in the ’90s.)

Tech Support

Sometimes tech support gets right to the point.

My kitten and I spent several hours yesterday trying to install a router. Now, I pride myself on being able to use mass-produced products that are designed for the average home user. But I couldn’t get this thing to work. No matter what I tried I got no net juice.

In exasperation I finally called tech support. I described the problem and what I did to fix it.

“You better take it back,” the tech support guy said.

No twenty questions, no assumption of stupidity—the guy knew I had a lemon and told me so. Cool.

If wishes were horses, geeks would fly, or something like that

I really really really wish Project Builder supported external editing in BBEdit. I spent some time last night trying to figure out a hack that would make it work. No joy.

Look Up PHP Reference from BBEdit

Many years ago I was trying to learn AppleScript and just not getting it. Nothing against AppleScript—everybody’s brain is wired differently. For me, a language that seems like natural language but really isn’t was just confusing.

But that’s just me. While struggling with AppleScript I discovered Frontier, and it immediately clicked for me.

Since then I’ve learned lots of other languages, but AppleScript has always been the language that stumps me. Which is why I’m proud to have finally written a useful AppleScript script.

The following is a script for BBEdit. If you write PHP scripts in BBEdit it’s useful.

This script allows you to select some text then search for it on the PHP site. Drop it in your Scripts folder as a compiled script. On my machine I called it Look Up PHP Function. Here’s the source:

set s to ""
set searchurl to "http://www.php.net/manual-lookup.php?pattern="

tell application "BBEdit 6.5"
   set s to selection of text window 1 as text
end tell

set searchurl to searchurl & s

tell application "Internet Explorer"
   Activate
   OpenURL searchurl
end tell

It’s pretty simple—it creates a URL by appending the selected text to a base URL. Then it tells Internet Explorer to open that URL. You could probably change the Web browser and it would still work.

Night

When it’s as dark and rainy as this, night comes asked-for; the lights in the house seem so much brighter than that feeble sun filtered through the clouds.

Radio traffic

Have you wondered what kind of effect Radio has on sites with RSS feeds? Check out the user agents page. Radio occupies 8 of the top 10 spots on this site.

I’m not complaining, by the way. This server isn’t having any problems keeping up. It’s all good.

Membership added

I finally added membership to this site. The main benefit is that you can edit your comments (those posted from this point on). More membership features to come later.

If you were a member of the old inessential.com, you’ll have to sign up again. Sorry about that!

Ranchero.com also has membership now. (Since it runs the same code as this site.)

Choosing Linux libraries

So here’s what it’s looking like: I plan to use the gnome libraries and use KDevelop as my IDE. That still could change of course.

I chose the gnome libraries for the simple reason that I can write in C rather than C++. I have nothing against object-oriented languages—I’m a fan of Python, Java, and Objective C, for instance—but I prefer C to C++.

Search engine feature added

This site now has a search engine—still in beta, I need to add some features. It searches just weblog posts, but not comments or other pages (yet).

Search engines for your own site can be addictive. I keep finding things I wrote, and thinking, Wow, I wrote that?

It uses MySQL’s standard fulltext index feature. The search engine was thus very easy to write: essentially just a where clause.

Question for Linux Programmers

Question for Linux programmers: say I want to write a GUI app (in C or C++) that runs on both KDE and GNOME. What APIs (or frameworks) should I use? GTK or QT? Or something else? Does the answer change depending on what license I want to release my software under? What if it’s GPL, what if BSD, what if commercial?

Unix Under the Desktop

I just got my mail—the April issue of Linux Journal was there. Guess what? There’s an article by me, written with Doc Searls, in there. Unix Under the Desktop, it’s called. A review of Mac OS X. Page 66.

I haven’t been published in print since my college newspaper. I’m proud.

Frontier Contextual Menu Plugin

The Frontier Contextual Menu Plugin—it’s alive! Now shipping one-point-oh. Here’s a screen shot.

Title and Link API RFC

Regarding Daniel Berlinger’s Title and Link API RFC: I agree. It’s very needed. The only thing missing from the RFC was the full method names.

Plan for the day

Plan for the day: release the 1.0 version of the Frontier/Radio contextual menu plugin.

Dual-boot

After several days of struggling, I finally have a dual-boot Windows/Linux machine.

Imagine my pleasure when I discovered that KDE does anti-aliased text. Finally! That made my choice of desktop very simple. My biggest complaint with desktop Linux has long been the jaggy appearance of fonts.

The anti-aliasing could be of higher quality. And there should be an option to not anti-alias text below a certain size—but still, I’m pleased, those are nits.

Web File Types

The Web File Types plugin for OS X has been released. Here’s a screen shot.

Coincidentally, today is three years to the day since the last release (which was for OS 8). This little piece of software has been around for going on five years.

Redesign

Redesigned. Like it? It matches the ranchero.com redesign.

The DNS change hasn’t taken hold yet, so this site is at test.inessential.com for now.

03/05/02

Question, for a piece of software I’m working on: what are the type and creator codes for Dreamweaver, GoLive, Fireworks, Photoshop, and ImageReady?

03/04/02

I love BBEdit. I wrote a song for it.

You know you’re a geek when you write songs for your favorite apps.

BBEdit
You’re so nice
You’re like sugar
And like spice.

I use you
All the time
Because you’re cool
Not like slime.

BBEdit
BBEdit
You’re the app that
Always gets it.

BBEdit
I confess
I love you
You suck less.

3/01/02

This is my last day at UserLand. My decision to resign is for personal reasons, and has nothing to do with the company, its software, its people, or its mission—regarding all of which I have high opinions.

I’m proud of the work I accomplished over the last five years—I’m proud of the work the entire team accomplished. So many more people write for the Web now than did five years ago, because of the work of UserLand and others, and this gives me immense personal satisfaction.

I’m grateful to UserLand, and to Dave Winer in particular, for teaching me how to be a software developer. It reminds me of the old days when, instead of going to college, you would join a trade guild as an apprentice and learn your craft from a mentor. I got a great education.

I learned that being a software developer is more than just about programming—it’s also about respect, empathy, and integrity.

So... what’s next for me?

I’ll be doing software for Frontier and Radio. I’ll still be on the same mailing lists, reading the same discussion groups. I’ll continue doing this weblog and mac.scripting.com.

In other words: I’m still here.

Thanks to everyone for the notes of thanks, via email and the Web. I appreciate it very much. It means alot to me, more than you probably imagine.

Archive