: ) wonderful world ( :

the metasyntactic variable

Archive for June 2007

without comments

One can reverse the pages of a PDF document by using the pdftk package under linux and fire a command like this:

pdftk input.PDF cat end-1 output output.PDF

Written by grault

June 18, 2007 - 9:07 pm at June 18, 2007 - 9:07 pm

without comments

My first hunchentoot page setup:

% pwd
/home/kotee
% ls -d slime
slime
% ls slime/slime.el
slime/slime.el
% cat .emacs
(set-variable 'scheme-program-name "guile")
(setq inferior-lisp-program "/usr/local/bin/sbcl")
  (add-to-list 'load-path "/home/kotee/slime")
  (require 'slime)
  (slime-setup)

% cat .sbclrc
(require 'asdf)
(push "/home/kotee/asdfsys/" asdf:*central-registry*)

(asdf:oos 'asdf:load-op :hunchentoot)
(asdf:oos 'asdf:load-op :cl-who)
% ls -1 asdfsys/*.asd
asdfsys/acl-compat.asd
asdfsys/cffi.asd
asdfsys/chunga.asd
asdfsys/cl-base64.asd
asdfsys/cl-ppcre.asd
asdfsys/cl+ssl.asd
asdfsys/cl-who.asd
asdfsys/flexi-streams.asd
asdfsys/html-template.asd
asdfsys/hunchentoot.asd
asdfsys/hunchentoot-test.asd
asdfsys/md5.asd
asdfsys/rfc2388.asd
asdfsys/trivial-gray-streams.asd
asdfsys/url-rewrite.asd
% cat hunchen.lisp

(defpackage :first
  (:use :cl :hunchentoot :cl-who :sb-ext))

(in-package :first)

(defmacro with-html (&body body)
  `(with-html-output-to-string
    (*standard-output* nil :prologue t)
    ,@body))

(defun main-page ()
  (no-cache)
  (with-html
    (:html
     (:head (:title "first page"))
     (:body
      (:h1 "first page")))))

(push (create-prefix-dispatcher "/first"
                                'main-page)
      *dispatch-table*)

(defparameter *server* '())
(setf *server* (hunchentoot:start-server :port 4242))
% ls -1 asdfsys/*.asd

After this you can start emacs and start slime (ESC-x slime RET). Split the display with
C-x 2 and find the hunchen.lisp file with C-x C-f. Then type C-c C-k and finally one can open the http://localhost:4242/first page.

Written by grault

June 3, 2007 - 2:20 pm at June 3, 2007 - 2:20 pm