Updates from September, 2009

  • Tinkering

    mike 12:04 pm on September 7, 2009 | 1 Permalink
    Tags: computing, , scripting,

    I really liked a recent post by Alex Payne titled Switching Season. He says he gets an itch every year or so to go try something different, and I can sympathize. What he says at the end really resonates:

    It’s about computer usage as a creative act, something that becomes harder and harder to experience the more proficient one gets with a computer.

    I feel this way every once in a while too – It used to be fun just getting a computer to do something. Once you know enough about how it works and most of what you do is handled pretty smoothly, some of the fun goes out of it. The problem with high-quality free apps like Mail and Address Book is that they remove the motivation for people to tinker with new ways of using computers for the same old things.

    This urge to tinker is pretty strong, at least for me, and I think it might be one reason why I’m not so excited about web and mobile (at least iPhone) programming. Both platforms have a lot going for them, but the barrier to tinkering with my data is high – sometimes I can’t get my data out of a service, and if I want to write scripts to combine two web apps, where do they run?

    For example, I’ve seen a lot of great things come from the community built around BibDesk’s scripting interface, and if it were a web app, none of that would have happened.

     
  • Subversion Client Issues

    mike 7:17 am on July 13, 2009 | 7 Permalink
    Tags: gui, ,

    I use subversion, and won’t switch to something newer for a while, so it’s worth looking at how to polish that old hammer. I’m used to using the command line svn, or emacs. But recently I decided to try out a few of the nice GUI clients that are around, including Versions, ZigVersion and Cornerstone.

    Of these, the only one that’s polished enough to lure me away from emacs and seems to support my favorite mode of working is Cornerstone, and it still gets it a little wrong.

    I like to write log comments while looking at (and scrolling through) the diffs for the files I’m committing. This means I want a text field for writing log comments on the same screen as the diffs, that isn’t modal, and doesn’t stop me from moving around between multiple diffs.

    As far as I could tell, I couldn’t get the comment field and the diff display shown together in Versions, and while I could in ZigVersion, that app had a subpar diff display and lacked polish overall, missing key shortcuts where I’d expect them, for instance. Cornerstone almost lets me do what I want, but it displays the comment field in a modal sheet, so I have to cancel to change which diff I’m looking at.

    This is easy in emacs, but I like a nicer diff GUI. Am I just missing something? This feels like a natural workflow, so it seems strange that no clients support it well.

     
  • Something Buckets

    mike 7:27 am on February 10, 2009 | 0 Permalink

    Alex Payne’s recent post The case against everything buckets makes a strong point in favor of using the filesystem for filing. To paraphrase: If your problem is that you have a bunch of files you need to search through, and possibly tag, then the filesystem and Spotlight are probably closer to solving your problem than you expect.

    I enjoyed reading his post, because I like rules of thumb for simple design, and one of my favorites is “why not just use files?” – there are often reasons to do something else, but the filesystem is faster, more reliable, and more open than anything you’re likely to come up with on the first try. So you’d better be sure you’re not just poorly reimplementing it.

    Buzz Andersen has a thorough response, centering on the fact that VoodooPad is a very useful app. Certainly I agree – I use it all the time, and its hyperlinking sets it apart from other notes apps (and the filesystem). So yes, VoodooPad is a Good Idea.

    But is VoodooPad really an “Everything Bucket”? I’m not sold – you can use it to store PDFs and images and other files, but it really focuses on pages, and those files are just attachments to your pages. I see it as a notes app. I think if your problem is keeping notes – with images if necessary, linking between them, and searching those notes, then VoodooPad is clearly better than the filesystem. But you don’t have to put everything else in there too.

    I agree with Alex that I don’t want one program to keep everything in a proprietary database. I like apps that keep my files as files. (like EagleFiler.) But I do want layers on top of the filesystem – you wouldn’t want to use just files for email, for example.

    The only solution that’s always bad is the solution to someone else’s problem.

     
  • iCal's Text Field Jumble

    mike 2:38 pm on November 2, 2008 | 0 Permalink
    Tags: , , ,

    I’ve written here before about text fields, particularly the problem of having a good-looking ‘display’ mode and a separate ‘edit’ mode for data you don’t edit so often, like in AddressBook.

    The most recent version of iCal decided that events are write-once-read-many as well. You now have to use cmd-E to get into edit mode, while cmd-I just gives you a small display mode.

    I’m mostly OK with that, although I find I edit events about as often as I look at their info windows – after editing I usually just deal with alarms, not the events themselves. The casual glance at the time and title is always enough – I think either you’re looking at the time and title or you’re editing. I don’t see the appeal in the new ‘info-only’ mode (if it’s actually new – it seems new.)

    However, the change does highlight the jumble of editable text fields and text-like fields in the edit window:

    The “Add Attendees” link and the “None” placeholder for url act the same – you click on them, and enter text. One’s a link and one’s mute gray text. Why? For my part, I think the gray text is too understated, and the link is too garish.

    There are other differences: you can tab to the “url” field, but you can’t tab to “attendees”… until you add one, then you can. Once you click on either of them, the url field pops up a plain white raised NSTextField, but the attendees field is sunken and translucent, apparently an NSTokenField?

    Both of the blue links could also be buttons. I’m still not completely sold on replacing buttons with links, but I can understand the trend. I think a small plus-sign button would be fine for “Add File”, though, and “Attendees” ought to be a text field. Why force the user to use the mouse when adding data to an event?

    All in all, I think the “Add Attendees” link/field is pretty strange. I’m curious if I missing a precedent somewhere.

     
  • Two hours

    mike 7:42 pm on March 27, 2008 | 10 Permalink

    Daniel Jalkut just wrote about a desktop bookmarking app called Pukka, which despite being apparently nice enough to warrant a positive review, was simple enough that Leo Laporte wasn’t comfortable just saying it cost $15. I felt like adding to the discussion after a few commenters described the app as trivial – in one case saying that any good programmer could write it in two hours.

    This bothered me, so I downloaded Pukka and gave it a try. I was curious to see if it was indeed trivial.

    While it definitely doesn’t seem like the most feature-rich program up front, there’s a lot of stuff in there – it works with more than one bookmarking site, it integrates with RSS readers, uses the OS X keychain, includes Bonjour discovery of nearby users, and has AppleScript support.

    Further, it shows attention to detail. Although I may not agree with some of Justin’s UI design choices, it’s clear that he spent time thinking about bookmarking workflow. I know in some of my projects, just pondering design choices takes hours – drawing mockups, and trying things out.

    End-user app development isn’t just programming, and programming isn’t just typing.

    I think it’s fair to say that that although you might be able to retype the code by hand in a few hours, Pukka represents a good chunk of serious work. I’m sure the mac developers in the audience will agree – Applescript support alone is almost guaranteed to be more than two hours of work.

    I’m glad that there’s a market for small apps and small developers, and I hope downwards price pressure from large subsidized or bundled apps doesn’t kill that off.

     
  • VoodooPad 3.5

    mike 4:00 pm on February 11, 2008 | 1 Permalink

    From Flying Meat, VoodooPad 3.5 is out. (release notes here).

    It’s a solid update, including welcome image-editor integration and more. I thought I’d point out my favorite feature in the release notes:

    “You can now edit pages and sort the results in the search window (woo!).”

    I like this because it matches a kind of manual refactoring habit I picked up with Project Builder / XCode’s excellent “Find in Project…” window – I search for a keyword that marks places I need to look at and edit the files right in the search window. (Note: ‘occur-mode’ and kin are a powerful way to do the same in Emacs…)

    It’s a powerful habit if you plan for it, by using comments in code to keep track of what you’ve touched when making a lot of cross-cutting changes, like # @addsearch Then when you think you’re done with a change, you can run a quick search to see if you forgot to fix anything.

    Sometimes in VoodooPad notes, I’ll write in placeholders like that comment when I don’t have a bit of information yet, and now I can follow my trails the same way I do in code.

    Thanks, Gus!

     
  • PyObjC notes

    mike 11:07 am on February 1, 2008 | 0 Permalink

    I’ve been hacking around with PyObjC, the Python-ObjC/Cocoa bridge recently, and it’s quickly becoming my favorite way to write Cocoa apps. It’s really natural to mix Python idioms with Cocoa objects.

    The latest version of PyObjC is 2.0, it’s installed by default on OS X 10.5, and XCode now includes templates for starting a PyObjC project. There’s even code autocomplete in XCode for PyObjC and IB integration, so aside from some smart-indenting issues, writing PyObjC in XCode is almost as natural as writing in ObjC.

    I thought I’d post a few nice shortcuts and tips here.


    You can use tuples for NSRect/Range/Point, for instance, this -

    r = NSInsetRect(((0, 0) ,
                     (100, 100)),
                    10, 10)
    

    creates this NSRect -

    NSRect origin=<nspoint x=10.0
                           y=10.0>
           size=<nssize width=80.0
                       height=80.0>>
    


    Passing python arrays as NSArray instances (and dictionaries as NSDictionaries) works great, but sometimes you need to pass a C array. The Python ‘array’ module handles that nicely:

    import array
    g = NSGradient.alloc().
       initWithColors_locations_colorSpace_(
        [NSColor.whiteColor(),
         NSColor.blackColor()], <br/>
        array.array('f', [0.0, 1.0]),
        NSColorSpace.deviceRGBColorSpace())
    


    ObjC selectors are just python strings in PyObjC.

    defNC.addObserver_selector_name_object_(self,
      'windowDidResize:',
      NSWindowDidResizeNotification,
      self)
    # or
    self.performSelectorOnMainThread_withObject_waitUntilDone_('doIt:', None, False)
    # or
    if o.respondsToSelector_("fun:"): return o.fun_(a)
    


    Finally, something that comes in handy when working with KVC, the ‘_’ method now defined on NSObjects in PyObjC:

    o = <some ObjC object>
    print o._.myKey
    o._.myKey = 44
    # is equivalent to:
    print o.valueForKey_('myKey')
    o.setValue_forKey_(44, 'myKey')
    


    That last example is straight from the NEWS page, where lots of other useful info can be found.

     
  • TaskPaper adds just enough to stick

    mike 12:47 pm on November 1, 2007 | 7 Permalink

    My favorite apps, the ones that slip easily into everyday use and stick there, just start with plain text and add some extra sauce. VoodooPad is a great example, and Hog Bay Software’s new app TaskPaper is, too.

    I’ve used both kgtd and iGTD, and played around with a few others. I came closest to sticking with a system using kgtd, but switched to iGTD because manually syncing kgtd got old.

    All the extra stuff in iGTD was appealing, but I left tasks in the inbox for weeks, and never reviewed much of my vast forest of projects. I eventually fell back into tending short lists in Stickies, with titles like “NOW:” and “BY TUESDAY!:”.

    When I moved those Stickies lists into TaskPaper, all I had to do was copy and paste – it uses the same format I do when I get lazy, and that has to be a good sign. I haven’t found a reason to jot a note somewhere else yet.

    Moving tasks from iGTD was more sobering. Half those “next actions” had been done for weeks, and the other half were clearly scheduled for next Neversday. As Merlin Mann pointed out, switching apps is a good excuse for a real review.

    TaskPaper adds automatic formatting, tabs, search, and a bit of hyperlinking to plain text. Tasks are lines that start with a dash, and can be tagged by starting any word with an at-sign. Clicking a tag starts a search for that tag. I use them in a couple of ways – as contexts, and for scheduling. They can really be anything that makes sense as a visible search keyword.

    I have been keeping a few tabs open – one to edit tasks, and a couple others with live searches to look at what’s on my plate. When I want to schedule something, I’ll tag it as @now or @tomorrow – I have those two as open tabs, and as I work I keep the @now tab open. Other tabs come and go to look at contexts, like @email or @errand.

    I like that the tags can be part of the sentence, so I don’t have to tab through a bunch of controls to set tags – I just write something like ‘@email Bob @home’… easy.

    I also set up an inbox project (by typing “Inbox:”, naturally) to collect notes quickly, and that’s worked pretty well so far.

    As with any 1.0, there’s some room for improvement. It’s not very scriptable, but it is plain text, so it could be worked around. Quicksilver integration was important with both kGTD and iGTD, and I’m not sure yet if I’ll really miss that here. It can clean up tasks marked as done into an “Archive” project, but doesn’t yet note when they were finished, if that kind of thing matters to you. Finally, I’m not sure what the best way to sync with other devices would be, but there is a web interface in development – maybe that would be a good iPhone option.

    TaskPaper is a solid, clear, and nicely minimalist app. Over the week I’ve been using it, it has made keeping to-dos in one place too easy to avoid, and added just enough functionality to sort through them without being distracting.

    Note: When I downloaded the 1.0 release, I found a conflict with TextExtras and wrote a bug report. In reply, Jesse sent me a complimentary license. Nice guy. I was going to write about it anyway, but I thought I should mention that I got it for free, as a surprise.

     
  • That Windows feeling

    mike 11:44 am on September 4, 2007 | 7 Permalink

    I started this post more than a year ago. Not much has changed, and it’s time to just let it out.

    Uninvited dialogs popping to the front or stealing keyboard focus in OS X have been giving me that Windows feeling lately. It was part of the old Mac OS’s comfortable “I’m in control” feeling, and was always immediately noticeable using Windows – popups and splash screens everywhere.

    It’s particularly bad with multiple monitors, when you may not notice that a dialog opened on the other monitor and is stealing all your keypresses, making the app you thought you were using seem unresponsive and rudely interrupting your work.

    Here are just a few that I notice all the time:

    • Apple Backup: Every damn time it runs a backup I get an annoying alert, sometimes two if the media isn’t ready when it wants to run. This is the one single situation that I can remember Retrospect’s UI being better.

    • Apple Mail: If a message is sent but the SMTP server can’t be contacted, the message pops back up with a sheet to pick a new server to be used until you change locations – a feature I endure daily to cope with my home ISP insisting I use their SMTP server. This window pops to the front and steals key focus, so if you’re typing in another mail message, you lose letters.

    • Safari with GMail: sometimes GMail just pops to the front of the stack. I don’t ever want a web page deciding that it needs to be in the front – what is going wrong here? (note, now that I use my WebMail app, this doesn’t happen to me anymore…)

    • Safari also pops the download window up when it starts a download – good idea right? Not if it took a while to start the download and I’m now editing something in a totally unrelated browser window…

    • Growl: Growl could be a solution to some of these problems, but it adds its own annoyance. Just waving your pointer over a notification – or even having it sitting in the spot the notification appears at – steals key focus from the current app. I use a variety of sticky notifications that I have to click on, and so this happens to me all the time.

    • FileMerge: if it takes a while to open a merge and I’ve moved away, it still pops the window to the front and takes key.

    • iTunes: changes to the music store status (like it finally loading a page), cause background windows to pop up in front of other iTunes windows. This doesn’t happen in browsers, why here?

    • iTunes: A more debatable example is if your iPod battery is completely drained, it will charge for a while before bringing iTunes to the front at a random time when it’s ready to sync. This is only if you’ve already requested iTunes to be shown when you plug in your iPod, so maybe it’s not their fault it annoys me.

    • Keychain security – because I have sensitive passwords on my laptop, my keychains lock when it sleeps, and time out. So I see a lot of the keychain password dialog, which steals key focus – even when it’s invoked from an app in the background. Backup makes this happen regularly. The dialog is small enough that I often don’t notice it on the other monitor.

    If this annoys you too, share your examples in the comments.

     
  • NSLocalizedString can set errno

    mike 10:27 am on July 10, 2007 | 2 Permalink

    This is a short one, but it might help someone with debugging someday.

    A while back, we had some code that was checking errno, then using the NSLocalizedString macro to get a localized error message, but it checked errno again later. Only the app isn’t localized yet. There’s no Localizable.strings file, so when NSBundle -localizedStringForKey gets called, even though it fails gracefully, it still ends up setting errno to “ENOENT”, or “file not found”.

    So the lesson is – in case you’re seeing weird behavior where errno is changing after you check it, make sure you’re not using any system calls that might set it.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel