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
(defbolt serialize-feed ["id" "feed"] [tuple collector] | |
(serialize tuple collector) | |
(ack! collector tuple)) |
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
(defbolt active-user-bolt ["id" "user-ids" "story"] {:prepare true} | |
[conf context collector] | |
(let [redii (redis/redii)] | |
(bolt | |
(execute [{id "id" story "story" :as tuple}] | |
(doseq [user-id (active-users redii)] | |
(emit-bolt! collector [id user-id story] :anchor tuple)) | |
(ack! collector tuple))))) |
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
(deref feed-atom) | |
=> {..digest datastructure..} | |
@feed-atom | |
=> {..digest datastructure..} | |
(swap! feed-atom | |
(fn [feed-atom] (update feed-atom))) | |
=> {..updated digest datastructure..} |
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
(topology | |
{"actions" (spout-spec resque-spout)} | |
{"users" (bolt-spec {"actions" :shuffle} | |
user-bolt | |
:p 4) | |
"likes" (bolt-spec {"users" :shuffle} | |
like-interest-scorer | |
:p 12) |
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
:dependencies [[tvachon/enlive "1.0.2"] | |
[compojure "1.1.1"] | |
[korma "0.2.1"] | |
[lobos "1.0.0-SNAPSHOT"] | |
[postgresql "9.0-801.jdbc4"] | |
[oauth-clj "0.0.7-SNAPSHOT"] | |
[clojurewerkz/urly "1.0.0"] | |
[org.clojure/clojure "1.4.0"]] | |
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
Test 1 2 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
==> riakc (compile) | |
Compiling src/riakclient.proto | |
=INFO REPORT==== 5-Jun-2012::02:03:08 === | |
Writing header file to "riakclient_pb.hrl" | |
=INFO REPORT==== 5-Jun-2012::02:03:08 === | |
Writing beam file to "riakclient_pb.beam" | |
Compiled src/riakc_obj.erl | |
Compiled src/riakc_pb.erl |
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
→ mv ~/.lein ~/.lein.bak | |
→ mv ~/.m2 ~/.m2.bak | |
→ lein --version | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 3165k 100 3165k 0 0 42300 0 0:01:16 0:01:16 --:--:-- 83370 | |
./bin/lein: line 144: sha1sum: command not found | |
WARNING: Clojure jar failed to download from http://build.clojure.org/releases/org/clojure/clojure/1.2.1/clojure-1.2.1.jar |
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
→ lein version | |
Leiningen 1.7.1 on Java 1.6.0_31 Java HotSpot(TM) 64-Bit Server VM | |
→ lein plugin install s3-wagon-private 1.1.1 | |
Exception in thread "main" java.lang.reflect.InvocationTargetException | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | |
at java.lang.reflect.Method.invoke(Method.java:597) | |
at jline.ConsoleRunner.main(ConsoleRunner.java:69) |
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
(let [x [[1 3 :a] | |
[1 4 :b] | |
[2 5 :c] | |
[2 6 :d]]] | |
(<- [?session-id ?time ?dataz] | |
;; do stuff | |
)) => | |
;; gets the first from each group [defined by the first column] based on the | |
;; value of the second column, and carries the third column's data along | |
(produces [[1 3 :a] [2 5 :c]]) |