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
;; Shannon Entropy | |
;; Can be used against strings | |
;; Requires Alexandria and a rewrite. :-) | |
(defun entropy (vector) | |
(let ((pmf (make-hash-table)) | |
(counter 0)) | |
;; Count up the values O(n) | |
(loop for e across vector |
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 defroute (method url-rule form) | |
`(progn | |
(caveman.route:add-route ,(intern "*APP*" caveman.route:*package*) | |
(caveman.route:url->routing-rule ,method ,url-rule ,form)) | |
,form)) |
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 clj-hash (&rest kvs) | |
"Destructures `kvs`: assums keys and values are paired together: | |
kvs ::= k1 v1 ... kn vn | |
Defines a sequence of functions ki that will obtain the value of ki | |
from a hash table. | |
Raises simple-error on ki not being a keyword. |
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
(defun make-map (pairs | |
&key | |
(test #'eql) | |
(default nil)) | |
"Creates a hash table with the list pairs; the CAR of each element | |
in the pairs is the key, the CDR is the value. | |
Hash table tests are :test | |
The default value of elements is `default`" |
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
;; Cyberpunk Colour Theme | |
;; | |
;; "and he'd still see the matrix in his sleep, bright lattices of logic | |
;; unfolding across that colorless void..." | |
;; William Gibson, Neuromancer. | |
(deftheme cyberpunk | |
"") | |
(custom-theme-set-faces |
NewerOlder