This file contains hidden or 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
Exception in thread "main" java.lang.StackOverflowError | |
at com.esotericsoftware.kryo.util.ObjectMap.get(ObjectMap.java:265) | |
at com.esotericsoftware.kryo.util.DefaultClassResolver.getRegistration(DefaultClassResolver.java:61) | |
at com.esotericsoftware.kryo.Kryo.getRegistration(Kryo.java:429) | |
at com.esotericsoftware.kryo.util.DefaultClassResolver.writeClass(DefaultClassResolver.java:79) | |
at com.esotericsoftware.kryo.Kryo.writeClass(Kryo.java:472) | |
at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:565) | |
at com.esotericsoftware.kryo.serializers.MapSerializer.write(MapSerializer.java:86) | |
at com.esotericsoftware.kryo.serializers.MapSerializer.write(MapSerializer.java:17) | |
at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:501) |
This file contains hidden or 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
{ | |
"VU": "VUT", | |
"SR": "SUR", | |
"ML": "MLI", | |
"LK": "LKA", | |
"GF": "GUF", | |
"BA": "BIH", | |
"US": "USA", | |
"TR": "TUR", | |
"PN": "PCN", |
This file contains hidden or 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
=> \d test; | |
Table "public.test" | |
Column | Type | Modifiers | |
--------+---------+----------- | |
id | integer | | |
value | integer | | |
=> select * from test; | |
id | value | |
----+------- |
This file contains hidden or 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
$template TestFormat,"Message: %msg%\n" | |
$template TestFile,"/tmp/test_%$year%%$month%%$day%%$hour%.log" | |
# Writes matching messages to path defined by TestFile template in TestFormat format | |
:syslogtag, contains, "test" -?TestFile;TestFormat | |
# Drops messages matching this syslog tag | |
:syslogtag, contains, "test" ~ |
This file contains hidden or 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> (require '[korma.core :as sql]) | |
nil | |
user> (def q (-> (sql/select* :test) | |
(sql/fields :foo :bar))) | |
#'user/q | |
;; Just looking whether the query is correct | |
user> (sql/as-sql q) | |
"SELECT \"test\".\"foo\", \"test\".\"bar\" FROM \"test\"" |
This file contains hidden or 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> (count (for [x (range -200 200) y (range -200 200)] (hash {:foo x :bar y :baz "what"}))) | |
160000 | |
user> (count (frequencies (for [x (range -200 200) y (range -200 200)] (hash {:foo x :bar y :baz "what"})))) | |
487 | |
user> (count (frequencies (for [x (range -200 200) y (range -200 200)] (hash [x y "what"])))) | |
6369 | |
This file contains hidden or 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> (def s (apply str (repeat 100 "a"))) | |
#'user/s | |
user> (bench/quick-bench (count s)) | |
WARNING: Final GC required 2082.410405844158 % of runtime | |
Evaluation count : 8685690 in 6 samples of 1447615 calls. | |
Execution time mean : 67.822779 ns | |
Execution time std-deviation : 1.770044 ns | |
Execution time lower quantile : 65.381948 ns ( 2.5%) | |
Execution time upper quantile : 69.642259 ns (97.5%) | |
Overhead used : 2.812543 ns |
This file contains hidden or 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> (defn c [p] | |
(with-open [rdr (clojure.java.io/reader p)] | |
(reduce + (map count (line-seq rdr))))) | |
#'user/c | |
user> (bench/quick-bench | |
(c "/tmp/test")) | |
WARNING: Final GC required 356.7754050400232 % of runtime | |
Evaluation count : 6 in 6 samples of 1 calls. | |
Execution time mean : 525.040480 ms | |
Execution time std-deviation : 29.017225 ms |
This file contains hidden or 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
Exception in thread "main" java.lang.ExceptionInInitializerError | |
at clojure.main.<clinit>(main.java:20) | |
Caused by: java.io.FileNotFoundException: Could not locate clj_http:client__init.class or clj_http:client.clj on classpath: | |
at clojure.lang.RT.load(RT.java:443) | |
at clojure.lang.RT.load(RT.java:411) | |
at clojure.core$load$fn__5018.invoke(core.clj:5530) | |
at clojure.core$load.doInvoke(core.clj:5529) | |
at clojure.lang.RestFn.invoke(RestFn.java:408) | |
at clojure.core$load_one.invoke(core.clj:5336) | |
at clojure.core$load_lib$fn__4967.invoke(core.clj:5375) |
This file contains hidden or 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
(defproject druid-example "0.1.0-SNAPSHOT" | |
;; Additional repository as described here https://github.com/metamx/druid/issues/34#issuecomment-10830530 | |
:repositories {"metamx-libs" "https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local" | |
"jboss-libs" "https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads"} | |
:dependencies [[org.clojure/clojure "1.4.0"] | |
[com.metamx/druid "0.3.2"]] | |
:main druid.core) | |
;; Dependencies are not resolved correctly :( | |
$ lein deps |