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
(reduce (fn [accum x] | |
(assoc accum | |
(keyword x) | |
(str x \- (rand-int 100)))) | |
{} | |
["hi" "hello" "bye"]) |
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
_runit_sv() { | |
local cur prev commands opts services | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
commands="status up down once \ | |
pause cont hup alarm interrupt quit 1 2 term kill exit \ | |
start stop reload restart shutdown \ |
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
(def f (new Frame "AWT test")) | |
(. f setSize 400 400) | |
(. f setLayout (new GridLayout 3 1)) | |
(class f) ;;java.awt.Frame | |
(supers (class f));; #{java.awt.Container java.io.Serializable java.awt.Window java.awt.image.ImageObserver java.awt.Component java.awt.MenuContainer java.lang.Object javax.accessibility.Accessible} | |
(r/reflect (.getAccessibleContext f) ) | |
(def acc (AWTAccessor/getComponentAccessor)) |
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
;Named "Babel distance" after the Borges story "The Library of Babel" | |
(def bearings | |
{:E [120 240 0 360 | |
:NE [60 180 300] | |
:NW [120 240 0 360 | |
:W [60 180 300] | |
:SW [120 240 0 360 | |
:SE [60 180 300]}) | |