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
#!/usr/bin/env python | |
# Originally created: 2011-09-12 17:32:25 - abrooks | |
import inspect, new | |
def close(): | |
l = [] | |
for x in range(0,3): | |
for y in range(0,3): |
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
(require '[datomic.api :as d]) | |
(defn txns1 | |
"Uses query to find txns. Believed to be less efficient." | |
[hdb] | |
(->> | |
(d/q '[:find ?tx | |
:where | |
[?tx :db/txInstant]] | |
hdb) |
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
for R in {1..10}; do | |
~/wrapper-linux –m ~/i86bi_linux-adventerprisek9-ms –p $((2000 + R))\ | |
-- -e 1 –s 1 $((10 * R)) & | |
sleep 1s | |
done |
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
;;; Rich's example from http://www.assembla.com/wiki/show/clojure/Enhanced_Primitive_Support | |
(defn fib [n] | |
(if (<= n 1) | |
1 | |
(+' (fib (dec' n)) (fib (-' n 2))))) | |
;;; Same example with ops' (not a great example, only showing usage) | |
(defn fib [n] |
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- field-name [field] | |
(str "native-" (name field))) | |
(defn- cset!* [[obj field] value] | |
(clojure.lang.Reflector/setInstanceField obj (field-name field) value)) | |
(defn cset! "C setter" | |
{:inline-arities #{2} | |
:inline (fn [field-form value-form] | |
(if (and (seq? field-form) (keyword? (second field-form))) |