Skip to content

Instantly share code, notes, and snippets.

luxbock luxbock

Block or report user

Report or block luxbock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View asdfsf
Mono: DllImport error loading library '/Users/Olli/Google Drive/projects/demo_app/libsubgame.dylib': 'dlopen(/Users/Olli/Google Drive/projects/demo_app/libsubgame.dylib, 9): image not found'.
Mono: DllImport error loading library '/Users/Olli/Google Drive/projects/demo_app/libsubgame.so': 'dlopen(/Users/Olli/Google Drive/projects/demo_app/libsubgame.so, 9): no suitable image found. Did find:
/Users/Olli/Google Drive/projects/demo_app/libsubgame.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00'.
View anonymous-gist.
~/Google Drive/projects/demo_app $ mono SubgameConsole.exe
SubgameConsole - type ? for help
Unhandled Exception:
System.DllNotFoundException: libsubgame
at (wrapper managed-to-native) SubgameConsole.libsubgame:libsubgame_init (int)
at SubgameConsole.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libsubgame
at (wrapper managed-to-native) SubgameConsole.libsubgame:libsubgame_init (int)
at SubgameConsole.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
@luxbock
luxbock / asdfdsf.clj
Last active Aug 29, 2015
scen-c results
View asdfdsf.clj
(def scen-c
{:algorithm 0
:abstraction 0
:rules {:stack 1000, :pot 100, :bb 20, :to-act 0
:max-bets 3 :actions [[1/2 3/4 1 :all-in] [1/2 1 :all-in]]}
:init-node {:player 1, :prev-action :check, :street 3}
:board [(card "2h") (card "3s") (card "4d") (card "Ts")]
:range-sb (hand-range "5s5h 6s5s 7c2h Th9h 9c9s AcAd KsKd")
:range-bb (hand-range "AcAd AsAh AdAh AsAd 7c9h")})
@luxbock
luxbock / profiles.clj
Last active Aug 29, 2015
profiles.clj
View profiles.clj
{:user
:dependencies [[im.chit/vinyasa "0.2.2"]
;; ...
[leiningen #=(leiningen.core.main/leiningen-version)]]
:injections [(require '[vinyasa.inject :as inject]
;; other requires
)
(inject/in
;; Inject as is
View anonymous-gist.clj
;; Given that:
(destructure
'[[f [a b] {:keys [c d]} & rs]
[:first [:a 1 :b 2] {:c "C" :d "D"} 3 4 5]])
;; =>
[vec__22487 [:first [:a 1 :b 2] {:c "C", :d "D"} 3 4 5]
f (clojure.core/nth vec__22487 0 nil)
vec__22488 (clojure.core/nth vec__22487 1 nil)
a (clojure.core/nth vec__22488 0 nil)
View core.clj
(ns debug-walker.core
(:refer-clojure :exclude [read-string])
(:require [clojure.java.io :as io]
[clojure.repl :as repl]
[clojure.tools.reader :refer [read-string]]
[clojure.pprint :refer [pprint]]
[rewrite-clj.zip :as z])
(:import [java.io LineNumberReader InputStreamReader PushbackReader]))
(defn file-source-fn
@luxbock
luxbock / anonymous-gist.clj
Created Jan 25, 2015
Referential Transparency
View anonymous-gist.clj
(filter even? (range 10))
;; equals
(new clojure.lang.LazySeq
(fn []
(when-let
[s (. clojure.lang.RT
(seq (new clojure.lang.LazySeq
#(let [b (clojure.lang.ChunkBuffer. 32)
View anonymous-gist.clj
(defn C [n]
(cond
(one? n) 1
(even? n) (C (div n 2))
:else (C (add1 (times 3 n)))))
(defn C* [n]
(cond
(= 1 n) 1
(clojure.core/even? n) (C (quot n 2))
View results.clj
(defn C
[n]
(cond
(one? n) 1
(even? n) (C (div n 2))
:else (C (add1 (times 3 n)))))
(defn C* [n]
(cond
(= 1 n) 1
@luxbock
luxbock / benchmark.clj
Last active Aug 29, 2015
The Little Schemer vs. regular Clojure versions of the Collatz function
View benchmark.clj
(ns little-schemer.benchmark
"Benchmarking the function C of the Collatz Conjencture:
http://en.wikipedia.org/wiki/Collatz_conjecture
in regular Clojure (C*) and as it is defined in the book The Little Schemer,
where all of the parts are defined recursively in terms of add1 and sub1."
(:gen-class)
(:refer-clojure :exclude [even?])
(:require [criterium.core :refer [quick-bench]]))
You can’t perform that action at this time.