Unintelligible

Sunday, March 8, 2009

Rubyists and Photographers, slight return

A few months ago, I posted an entry on how Rubyists sometimes get distracted by the power of the language, preferring lengthy debates on programming aesthetics to actually writing (efficient) code. I compared this to photography, in which aspiring photographers sometimes get lost in technical discussions rather than focussing on the work they produce. Then I came across this quote, which concisely expresses in 3 sentences what I hadn’t managed in an entire post:

Every medium suffers from its own particular handicap. Photography’s greatest handicap is the ease with which the medium as such can be learned. As a result, too many budding neophytes learn to speak the language too long before they have anything to say.

(Will Connell, 1949, via Brendan MacRae, via Tim Bray)

The point of my original post was that the same may apply to Ruby; the language’s power and accessibility makes everything seem so easy, that it becomes tempting to engage in discussions about the finer points of programming aesthetics rather than focussing what one has to say (i.e. the problems one chooses to solve.)

posted by Nick at 1:15 pm - filed in ruby  

Sunday, March 8, 2009

Adding a Windows service using sc

The ‘sc‘ utility can be used to create, delete or edit a Windows service. It can be used for any executables (as opposed to installutil, which can only be used for .Net services). Its help is available using sc /help (and is also available on MSDN); however, I found the output slightly confusing, so for my own reference here’s an example for creating a service for the Subversion server:

sc create svnserve binPath= "\"C:\Program Files\CollabNet Subversion Server\svnserve.exe\" 
  --service -r \"c:\svn_repository\" --listen-port \"3690\"" DisplayName= "Subversion Server"

This passes two parameters, the binPath and the DisplayName (the rest are the directives Subversion expects when running as a service). The trick here is the space between the ‘=’ sign after the parameter name and the parameter value; the service won’t be installed otherwise.

posted by Nick at 12:53 pm - filed in windows