Skip to content

Instantly share code, notes, and snippets.

View radhikalism's full-sized avatar

radhika reddy radhikalism

View GitHub Profile
#!/bin/dash
volume=10
shuffle=0
search_paths=""
while getopts :v:p:s opt; do
case $opt in
v)
echo "volume:" $OPTARG
(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."
(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]>)
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
(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))
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: #>}>}>
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]
(defn hello-route [request]
((GET "/"
{:status 200
:headers {}
:body "Hello World"}) request))
; 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
(defmulti foo (fn [a & more] a))
(defmethod foo :bar
([a] (println "a 1"))
([a b] (println "a 2")))
(comment
> (foo :bar)
a 1
nil