This file contains 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
#!/bin/dash | |
volume=10 | |
shuffle=0 | |
search_paths="" | |
while getopts :v:p:s opt; do | |
case $opt in | |
v) | |
echo "volume:" $OPTARG |
This file contains 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
(ns slider-demo | |
"A brief demonstration of using interactive Swing components with Clojure." | |
(:import [javax.swing JSlider JFrame JPanel SwingConstants] | |
[javax.swing.border LineBorder] | |
[javax.swing.event ChangeListener] | |
[java.awt BorderLayout Color Rectangle])) | |
(defn make-frame | |
"Returns a JFrame instance which is non-resizable, 800px wide, 600px high, | |
and containing panel." |
This file contains 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
(defn threads [] | |
(let [tg (-> (Thread/currentThread) .getThreadGroup .getParent) | |
enum (into-array Thread (repeat (.activeCount tg) nil))] | |
(.enumerate tg enum) | |
(seq enum))) | |
;; example: | |
;; user> (threads) | |
;; (#<ReferenceHandler Thread[Reference Handler,10,system]> #<FinalizerThread Thread[Finalizer,8,system]> #<Thread Thread[Signal Dispatcher,9,system]> #<Thread Thread[main,5,main]> #<Thread Thread[Server 0 [12],5,main]> #<Thread Thread[Call-on-write Stream,5,main]> #<Thread Thread[Swank Control Thread,5,main]> #<Thread Thread[Read Loop Thread,5,main]> #<Thread Thread[Swank REPL Thread,5,main]>) |
This file contains 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
diff --git a/hiredman/sandbox.clj b/hiredman/sandbox.clj | |
index e5f3138..4b6b4d2 100644 | |
--- a/hiredman/sandbox.clj | |
+++ b/hiredman/sandbox.clj | |
@@ -91,13 +91,9 @@ | |
docstring# (:doc m#)] | |
(if m# | |
(.replaceAll (str al# "; " docstring# ) "\\s+" " ") | |
- (let [foo# (-> hiredman.clojurebot.code-lookup/contrib | |
- :vars |
This file contains 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
(defmulti input (fn [event game] (event-key event))) | |
(defmethod input :default [event game] | |
(comment not handled) | |
game) | |
(defmethod input :key-up [event game] | |
(comment your implementation here)) |
This file contains 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
user=> (set! *print-level* 5) | |
5 | |
user=> (let [a (atom {}) b (atom {})] (reset! a {:foo b}) (reset! b {:bar a}) a) | |
#<Atom@d3576a2: {:foo #<Atom@30ff8c74: {:bar #<Atom@d3576a2: #>}>}> |
This file contains 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
diff --git a/src/compojure/http/request.clj b/src/compojure/http/request.clj | |
index 834736a..b0fd07d 100644 | |
--- a/src/compojure/http/request.clj | |
+++ b/src/compojure/http/request.clj | |
@@ -20,15 +20,18 @@ | |
(defn- parse-params | |
"Parse parameters from a string into a map." | |
[param-string separator] | |
- (reduce | |
- (fn [param-map s] |
This file contains 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
(defn hello-route [request] | |
((GET "/" | |
{:status 200 | |
:headers {} | |
:body "Hello World"}) request)) |
This file contains 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
; cc -m64 -fPIC -o /home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel /home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c: In function ‘main’: | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c:69: warning: cast from pointer to integer of different size | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c:75: warning: cast from pointer to integer of different size | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c:80: warning: cast from pointer to integer of different size | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c:85: warning: cast from pointer to integer of different size | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c:90: warning: cast from pointer to integer of different size | |
/home/abhishek/Shed/cl-proc/darcs/cl-proc/src/grovel.c:95: warning: cast from pointer to integer of different size | |
/home/ab |
This file contains 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
(defmulti foo (fn [a & more] a)) | |
(defmethod foo :bar | |
([a] (println "a 1")) | |
([a b] (println "a 2"))) | |
(comment | |
> (foo :bar) | |
a 1 | |
nil |
OlderNewer