Tuesday, August 19, 2008

Set programs installed in Windows Program files folder to PATH (Cygwin)

VIM_HOME='/cygdrive/c/Program Files/Vim/vim72'
JAVA_HOME='/cygdrive/c/Program Files/Java/jdk1.5.0_11'

alias ll="ls -lh"
alias l="ls -a"

PATH="${VIM_HOME}":"${JAVA_HOME}/bin":${PATH}
export PATH

The quote and double quote play the magic..

Thursday, August 14, 2008

Compare ', #' and ` in LISP

quote '
is syntactic sugar for QUOTE, which takes a single expression as its "argument" and simply returns it, unevaluated.
(quote (+ 1 2))  ===  '(+ 1 2)

#'
is syntactic sugar for FUNCTION.
(function foo)  ===  #'foo


backquote `
a backquoted expression is similar to a quoted expression except you can "unquote" particular subexpressions by preceding them with a comma, possibly followed by an at (@) sign.
    [Basicly it's similar with quote ', but can do more, like evaluate subexpressions by a comma]
Without an at sign, the comma causes the value of the subexpression to be included as is.
With an at sign, the value--which must be a list--is "spliced" into the enclosing list.

<Examples>
Backquote Syntax    Equivalent List-Building Code            Result
`(a (+ 1 2) c)        (list 'a '(+ 1 2) 'c)                    (a (+ 1 2) c)
`(a ,(+ 1 2) c)        (list 'a (+ 1 2) 'c)                    (a 3 c)
`(a (list 1 2) c)    (list 'a '(list 1 2) 'c)                (a (list 1 2) c)
`(a ,(list 1 2) c)    (list 'a (list 1 2) 'c)                    (a (1 2) c)
`(a ,@(list 1 2) c)    (append (list 'a) (list 1 2) (list 'c))    (a 1 2 c)

Wednesday, August 06, 2008

Reset Root Password of OpenBSD


At boot> prompt type boot -s to boot into single user mode:
boot> boot -s

Next you will see a message as follows:
Enter pathname of shell or RETURN for sh:
Just hit [Enter] key to load sh shell.

Mount / and /usr file system in read-write mode:
# mount -uw /
# mount /usr

Finally set or change the password for root user, enter:
# passwd

Press CTRL+D to boot into multiuser mode or just reboot server:
# reboot