Archive for May, 2008

punch clock: an introduction to objective-c

My first attempt at using Objective-C for something useful has produced Punch Clock, a simple application that one might use to record one’s activities for personal time management or later entry in a time-tracking system or timesheet.

While it is, as an application, little more than a skeleton of a prototype, it has enough useful functionality to give a flavour of Cocoa development in Objective-C. It features:

  • post-launch application initialisation through the use of a NSApplication delegate
  • an editable NSTableView
  • programmatic edits of a table cell
  • NSButtons that are enabled and disabled according to the state of the application

Those not completely disinterested can browse the source. It is hosted by Bitbucket as a Mercurial repository; retrieve it using:

   hg clone http://bitbucket.org/sinistral/punchclock

bash: clear: command not found

A base install of Cygwin does not include the clear command, though the same functionality can be achieved using ^L. The command is part of the ncurses package that may be found in the Libs category.
Thanks to Ruben Laguna for his post on the subject.

EDIT: This ncurses package now appears in the Utils category.

cygwin svn: cannot move ‘*/tmp/entries’ to ‘*/entries’: permission denied

It seems that Cygwin’s subversion port and Tortoise SVN do not play well together. A default installation of both can result in the following error occuring seemingly at random during long checkout or update operations:

Can't move '/cygdrive/c/xxx/trunk/.svn/tmp/entries'
to '/cygdrive/c/xxx/trunk/.svn/entries':
Permission denied

To resolve this, Tortoise SVN’s icon overlays may need to be disabled entirely as suggested here. While Tortoise SVN doesn’t have a Disable overlays checkbox, they may be effectly disabled as follows:

  • <SecondaryClickContextMenu> > Tortoise SVN > Settings > Icon Overlays
  • Ensure the checkout directory is included in the Exclude paths mask (I’ve taken to using c:* and c:*).

Others have suggested that it may not be necessary to disable Tortoise SVN’s overlays entirely, as long as the Show overlays only in explorer tickbox is ticked. This didn’t work for me; your kilometerage may vary.