Archive for February, 2009

Cocoa job-seeking tactic

Wednesday, February 25th, 2009

CocoaBuilder is a consolidated, searchable archive of all posts to the cocoa-dev, macosx-dev, and xcode-users mailing lists. It's a terrific resource for Mac developers.

CocoaBuilder strips out email addresses to protect your privacy, but it includes your full name in the title of each page. So to see all the posts you've ever made, you can simply search for your name, as long as your name is fairly unique.

It occurred to me that if you're applying for a Cocoa job, you could include a search link in your cover letter. This would be an easy way to help the employer get an idea of you as a person. By browsing your posts, they can get a sense of your Cocoa cred, your writing style, your willingness to help, your ability to learn, how far back you go with Cocoa, and even how nicely you play with others. Of course they could easily do the search themselves, and some probably do, but why not give them one-click convenience?

Although I happened to think of this while browsing CocoaBuilder, it would work for any public forum on any topic, as long as there's a way to search for yourself in the archives, either directly or via Google.

Here are search links for my posts to the Cocoa lists. I wonder if I should change the name I use to something more likely to be unique down the road.

The results include all my dopey posts as well as the good ones, but I don't think there's a Google hack that can fix that.

OO chiasmus of the day

Wednesday, February 25th, 2009

Most classes have behaviors. Many behaviors don't have class.

(I learned about chiasmus from Dr. Mardy.)

Switched to Notespark

Saturday, February 21st, 2009

Thanks to Sho's comment on my post yesterday, I have switched from Appigo's Notebook app to Notespark, by Metaspark.

One thing Notebook does wrong is that it makes you hit an Edit button at the top of the screen to start editing a note. It then scrolls all the way to the bottom of the note and puts the insertion point there. This is especially annoying for me, because I very often want to add stuff to the top of the note, or near the top.

Unlike Notebook, Notespark does almost the right thing, which is that you tap the text to start editing it and the insertion point goes where you tapped. This is what Apple's Notes app does. Unfortunately Notespark doesn't remember where you were scrolled to between launches, as Apple's app does; I've submitted feedback about this to their forums.

Both applications integrate nicely with their respective web apps. What makes Notespark stand out is how it is specifically designed to support shared editing. Multiple users, or the same user logged in multiple times, can make changes to the same note. Notebook supports this too, but the difference is that Notespark will merge everybody's changes instead of blowing away your changes with my newer ones.

If there is a conflict that prevents a merge (for example, if two people make different changes to the same sentence), Notespark makes it easy to either resolve the conflict or fork the note into two notes. Thus it elegantly solves what was by far the hardest problem in my wish list. I can jot a note on my iPhone when I'm on the go, and I can edit the same note on my iMac when I need to do more sophisticated editing.

Here's what the Notespark iPhone app shows you when there is a merge conflict:

notespark-conflict.jpg

And here are your options for resolving the conflict:

notespark-conflict2.jpg

One thing you can't do with the web interface is edit notes offline. It would be nice if Metaspark told us one day that all our notes are actually in svn, and we could have the option to check files out and use whatever text editor we want. But that might be too much to ask.

I have minor quibbles and I found one bug, all of which I reported on Notespark's forums. Nothing that prevents me from being a happy customer so far.

UPDATE: The folks at Notespark fixed the bug I found.

Idea: text files plus svn for iPhone list makers

Friday, February 20th, 2009

[Note: What follows is just an idea, very possibly a flawed one. I doubt I'll try to build this any time soon. Feel free to beat me to it!]

I just switched from the iPhone's built-in Notes app to an app called Notebook, by Appigo. It's nicely done and looks really good in Verdana 14, but of course it isn't exactly what I want, because no text editor in history has ever been perfect for anyone.

Besides looking as nice as Notebook, here are three features I'd like in an iPhone notes app. If such an app exists, I'd love to know about it.

  • Svn for online storage: Do svn checkouts and commits against a repository where I've stored text files. Do svn adds and deletes as appropriate.
  • Paragraph-based operations:
    • Have gestures for moving the current paragraph up and down. This would help move a paragraph without having to stupidly delete it and retype it.
    • Have gestures for cutting and pasting the current paragraph. If you're a vi user, think "dd", then navigating somewhere else in the doc, then "p" or "P". Unlike in a desktop app, cutting shouldn't be allowed if the paste buffer has something in it, and pasting should clear the paste buffer. This is to prevent accidentally blowing away something I'd cut and meant to paste somewhere.
    • Have a separate gesture for deleting the current paragraph without affecting the paste buffer.
    • The paste buffer should survive between launches of the app.
  • Randomness: View five random paragraphs.

"Svn for online storage" comes from the fact that I want to edit my files on both my iPhone and my computer.

"Paragraph-based operations" comes from the fact that I use text files for lists. I've tried list-oriented apps but I keep coming back to text files.

"Randomness" comes from the fact that I jot down all kinds of things in a single text file on my iPhone. (Indeed, I might not mind if my hypothetical app only supported one text file.) My text file contains not only to-dos but odd things people said, random philosophical musings, ideas for apps I wish existed, the attendance list from the last CocoaHeads (no reason, I'm just a packrat for this kind of info), book titles I see at the store and want to Google when I get home, and so on. I don't prune the list as often as I should and sometimes stuff in there is months old.

I think it might trigger interesting thoughts to see a random sampling once in a while. Imagine shaking the iPhone, or doing some other gesture that means "random," and seeing the following appear (actual items from my list):

  • Hot dog rebar
  • Bear little brain simple caveman
  • Pacquiao Hatton
  • Try Bee apps
  • Exploit my appetites

("Hot dog rebar" is a technique one of my coworkers mentioned for making meatloaf.)

It seems to me the hardest technical and design challenge would be using svn. Appigo's app lets you sync your notes online if you have a Toodledo account, and this works very nicely, but it doesn't merge changes: the last update of a file wins. So if I make some edits on my phone, then get home and without thinking make some edits via the web site, doing a normal sync will cause me to lose data.

This is why I've been keeping the to-do list for AppKiDo in a text file in svn. I can edit it on my laptop or my desktop without having to remember which machine has the latest edits.

I don't know if the iPhone can be an svn client. It might have to upload files to a hosted directory somewhere that would be a proxy for the iPhone, and tell the host to perform the svn operations. This means writing server code, but might be the only/easiest solution.

What about svn conflicts? Offhand I don't think I want to resolve conflicts on the phone. It's too ugly a task even in a desktop app. My first thought is to check first if there's a conflict, and if so, don't do the svn operation. Then I need to figure out some other way to get the changes from the iPhone into the document and get the merge back down into the iPhone.

Svn diffs would be tricky to do well, but could be valuable so I'm reluctant to leave the feature out altogether. It would be nice to come up with a nice way to view diffs on the phone, but worst case, I could view the raw output of svn diff.

Just to play my own devil's advocate for a minute: instead of all the work of figuring out an svn-based solution, maybe I could live with the Toodledo model, and just be careful to sync my iPhone frequently.

I haven't thought much about a name for this hypothetical app. How about "iNapkin"?

UPDATE: A possible alternative to solving the svn problem, which may or may not make sense: how about when you "upload" the file from the iPhone, the entire file gets HTTP-POSTed to an "upload URL" that you specify. The response is some XML that may contain a modified version of the file that will replace the file you uploaded. Then people can implement the server side of this — the thing the URL points to — however they want. There's probably some smarter pattern/implementation for this already. Just putting the idea out there — and now I have to run to something I'm late for…

UPDATE: I have switched editors again.

Toad curl

Wednesday, February 18th, 2009

[UPDATE: Feh. This only works for certain kinds of docs, like Cocoa APIs. I may try to make it work more generally when I get a chance, but it probably works for most of the cases I care about, so I may not bother.]

I wrote a quick and dirty bookmarklet that navigates from a local documentation file to the online ADC version of that file. To get the bookmarklet, drag the following link to your browser's bookmark bar: toadcurl.

To test, use your browser to open the local doc file for, say, NSString. You can easily do this from AppKiDo or the Xcode doc window. Once you have the page displayed, click the "toadcurl" bookmarklet and you should go here.

I sometimes want to do this for two reasons:

  1. I might wonder if the online version is newer; and
  2. I might want to paste the online URL into an email, rather than a file:// URL that might not work for the people I'm emailing to, depending on what version of Xcode they're running and where they have the Dev Tools installed.

I originally named it "toADCurl", since it generates a URL that links to an ADC page, but changed it to all lowercase because I liked the random phrase "toad curl". Of course you can name it whatever you want.

I've only tested with Xcode 3. If it doesn't work for earlier versions, perhaps someone could send me a fix?

It's entirely possible there's already a way to do this that I missed. If so, I'd love to know about it.