This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; -*- mode: lisp -*- | |
| ;; | |
| ;; A quick and dirty tree shaker for SBCL. Basically, it destroys the | |
| ;; package system and does a gc before saving the lisp image. Gives | |
| ;; about a 40% reduction in image size on a basic hello world test. | |
| ;; Would like to hear how it works on larger projects. | |
| ;; | |
| ;; Original idea from: https://groups.google.com/d/msg/comp.lang.lisp/6zpZsWFFW18/WMy4PyA9B4kJ | |
| ;; | |
| ;; Burton Samograd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Short guide to UDP/IP Client/Server programming in Common Lisp using usockets | |
| ; | |
| ; The main reason for this guide is because there are very few examples that | |
| ; explain how to get started with socket programming with Common Lisp that I | |
| ; could understand. | |
| ; After working on a short example on TCP, I found the | |
| ; need for a UDP tutorial. So, here goes. | |
| ; As usual, we will use quicklisp to load usocket. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; The following Lisp code is from ``Calendrical | |
| ;; Calculations'' by Nachum Dershowitz and Edward | |
| ;; M. Reingold, Software---Practice & Experience, vol. 20, | |
| ;; no. 9 (September, 1990), pp. 899--928 and from | |
| ;; ``Calendrical Calculations, II: Three Historical | |
| ;; Calendars'' by Edward M. Reingold, Nachum Dershowitz, | |
| ;; and Stewart M. Clamen, Software---Practice & Experience, | |
| ;; vol. 23, no. 4 (April, 1993), pp. 383--404. | |
| ;; This code is in the public domain, but any use of it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defmacro with-display (host (display screen root-window) &body body) | |
| `(let* ((,display (xlib:open-display ,host)) | |
| (,screen (first (xlib:display-roots ,display))) | |
| (,root-window (xlib:screen-root ,screen))) | |
| (unwind-protect (progn ,@body) | |
| (xlib:close-display ,display)))) | |
| (defun take-screenshot (&optional (host "")) | |
| (with-display host (display screen root-window) | |
| (xlib:get-image root-window :x 0 :y 0 :width (xlib:screen-width screen) :height (xlib:screen-height screen)))) |
NewerOlder