Skip to content

Instantly share code, notes, and snippets.

View whilo's full-sized avatar

Christian Weilbach whilo

View GitHub Profile
@whilo
whilo / immutant_mount_stacktrace
Created September 9, 2014 08:58
Immutant mount exception
void@benjamin:/usr/src/clj-demgen$ lein immutant test
Retrieving cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-20140906.032134-10.pom from clojars
Retrieving compliment/compliment/0.1.4-SNAPSHOT/compliment-0.1.4-20140831.194031-3.pom from clojars
Retrieving org/clojure/tools.nrepl/0.2.4/tools.nrepl-0.2.4.pom from central
Retrieving org/clojure/tools.namespace/0.2.5/tools.namespace-0.2.5.pom from central
Retrieving cider/cider-nrepl/0.8.0-SNAPSHOT/cider-nrepl-0.8.0-20140906.032134-10.jar from clojars
Retrieving compliment/compliment/0.1.4-SNAPSHOT/compliment-0.1.4-20140831.194031-3.jar from clojars
Retrieving org/clojure/tools.nrepl/0.2.4/tools.nrepl-0.2.4.jar from central
Retrieving org/clojure/tools.namespace/0.2.5/tools.namespace-0.2.5.jar from central
Running tests inside Immutant (log output available in target/isolated-immutant/standalone/log/server.log)...
@whilo
whilo / immutant_log
Created September 9, 2014 11:42
Immutant mount exception - server log
void@benjamin:/usr/src/clj-demgen/target/isolated-immutant/standalone/log$ cat server.log
01:44:40,889 WARN [org.hornetq.journal] (MSC service thread 1-6) HQ142000: You have a native library with a different version than expected
01:44:40,898 WARN [org.jboss.as.messaging] (MSC service thread 1-6) JBAS011600: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
01:44:43,939 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:10057/management
01:44:43,941 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:10057
01:44:43,942 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.2.x.slim.incremental.19 "Janus" started in 6869ms - Started 91 of 133 services (42 services are passive or on-demand)
01:44:44,160 INFO [org.jboss.as.repository] (HttpManagementService-threads - 1) JBAS014900: Content
(ns async.naive-bench
(:require [clojure.core.async :as async
:refer [<! <!! >! timeout chan alt! go put! filter< map< go-loop]]))
(def test-ch (chan))
(loop []
(put! test-ch (System/currentTimeMillis))
(Thread/sleep 0 5)
(recur))
import sqlite3
connection = sqlite3.connect("company.db")
cursor = connection.cursor()
# delete
#cursor.execute("""DROP TABLE employee;""")
sql_command = """
CREATE TABLE employee (
(ns geschichte.error
"Error handling macros with on top of go channels."
(:require #+clj [clojure.core.async :as async :refer
[<! <!! timeout chan alt! go put! filter< map< go-loop sub unsub pub close!]]
#+cljs [cljs.core.async :as async :refer
[<! >! timeout chan put! filter< map< sub unsub pub close!]])
#+cljs (:require-macros [cljs.core.async.macros :refer [go go-loop alt!]]))
(defn throwable? [x]
click1 <- function(){
x <- runif(1);y <- runif(1)
plot(x = x, y = y, xlim = c(0, 1), ylim = c(0, 1),
main = "Bitte auf den Punkt klicken",
xlab = '', ylab = '',
axes = FALSE, frame.plot = TRUE)
clicktime <- system.time(xyclick <- locator(1))
c(timestamp = Sys.time(),
x = x, y = y,
(ns full.binding-test
#?(:cljs (:require [cljs.core.async :refer [<! chan onto-chan]]
[zones.core :as zones :include-macros true]))
#?(:cljs (:require-macros
[full.async :refer [<<!]]
[full.binding-test :refer
[new-bound-fn create-vars new-binding]]
[cljs.core.async.macros :refer [go go-loop]])))
#?(:cljs (enable-console-print!))
@whilo
whilo / gist:4946cb4a018065aafed8a1db8d952407
Created May 19, 2016 22:19
core.async stack binding exception.
➜ topiq git:(master) ✗ java -jar target/topiq-standalone.jar resources/server-config.edn
16-05-19 21:56:57 benjamin INFO [topiq.core:129] - "Starting server @ port 8080 with config resources/server-config.edn"
Exception in thread "async-dispatch-16" java.lang.IllegalStateException: Pop without matching push
at clojure.lang.Var.popThreadBindings(Var.java:331)
at clojure.core$pop_thread_bindings.invokeStatic(core.clj:1839)
at clojure.core$pop_thread_bindings.invoke(core.clj:1839)
at replikativ.peer$server_peer$fn__15542$state_machine__4514__auto____15543$fn__15545.invoke(peer.cljc:55)
at replikativ.peer$server_peer$fn__15542$state_machine__4514__auto____15543.invoke(peer.cljc:55)
at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:1011)
at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:1015)
(def ^:dynamic *foo* nil)
(defn -main [& args]
(go
(binding [*foo* nil]
(<! (go 42))
(println "done.")))
(Thread/sleep 30000))
(ns datanaive.core)
;; https://courses.cs.washington.edu/courses/cse544/16au/lectures/lecture05-datalog.pdf
;; slide 7
;; Actor(344759,‘Douglas’, ‘ Fowley ’).
;; Casts(344759, 29851).
;; Casts(355713, 29000).
;; Movie(7909, ‘A Night in Armour ’, 1910).