help
this
out
help
this
out
$ curl http://localhost:8080/data/fs/local/quasar/wide2{ "user_id": 8927524.0, "profile_name": "Mary Jane", "age": 29.0, "title": "Dr", "comment_id": "F2372BAC", "comment_text": "I concur.", "comment_reply_to_profile": 9817361.0, "comment_reply_to_comment": "F8ACD164F", "comment_time": "2015-02-03", "a1user_id": 8927524.0, "a1profile_name": "Mary Jane", "a1age": 29.0, "a1title": "Dr", "a1comment_id": "F2372BAC", "a1comment_text": "I concur.", "a1comment_reply_to_profile": 9817361.0, "a1comment_reply_to_comment": "F8ACD164F", "a1comment_time": "2015-02-03", "a2user_id": 8927524.0, "a2profile_name": "Mary Jane", "a2age": 29.0, "a2title": "Dr", "a2comment_id": "F2372BAC", "a2comment_text": "I concur.", "a2comment_reply_to_profile": 9817361.0, "a2comment_reply_to_comment": "F8ACD164F", "a2comment_time": "2015-02-03", "a3user_id": 8927524.0, "a3profile_name": "Mary Jane", "a3age": 29.0, "a3title": "Dr", "a3comment_id": "F2372BAC", "a3comment_text": "I concur.", "a3comment_reply_to_profile": 9817361.0, "a3comment_r |
;; Copyright (c) 2014-2015 Andrey Antukh <[email protected]> | |
;; Copyright (c) 2014-2015 Alejandro Gómez <[email protected]> | |
;; All rights reserved. | |
;; | |
;; Redistribution and use in source and binary forms, with or without | |
;; modification, are permitted provided that the following conditions | |
;; are met: | |
;; | |
;; 1. Redistributions of source code must retain the above copyright | |
;; notice, this list of conditions and the following disclaimer. |
When querying inside the loc
float array, pop
becomes a float instead of an integer.
$ # SELECT pop, loc[0], loc[1] FROM zips LIMIT 10
$ curl 'http://localhost:8080/query/fs/local/quasar?q=SELECT%20pop%2C%20loc%5B0%5D%2C%20loc%5B1%5D%20FROM%20zips%20LIMIT%2010' -H'Accept: text/csv'
pop,1,2
15338.0,-72.622739,42.070206
36963.0,-72.51565,42.377017
(require '[clojure.core.async :refer (<!! >!! close! chan mult tap alt!! timeout)]) | |
(defn assert-closed! [c m] (assert (= nil (alt!! c ([v] v) (timeout 50) ([_] :timeout))) m)) | |
(let [[c1 c2 c3] (repeatedly 3 chan) | |
_ (close! c1) | |
m (mult c1)] | |
(tap m c2) | |
(<!! (timeout 50)) | |
(tap m c3) |
So this is the compilation I'm getting inside my larger project under :optimizations :simple
(cljs 1.7.28
)
The real problem is this:
Line 7 of the output code sets $_STAR_format_str_STAR_27199$$ = $_STAR_format_str_STAR_27199$$.indexOf("~")
for line 12 in the input code of (let [tilde (.indexOf s \~)] ...)
.
Now, $_STAR_format_str_STAR_27199$$
seems to be standing in for s
in the input code. Why is closure renaming tilde
into overwriting s
?
Later, at the end of line 9 (output) or line 15 (input), (subs s 1)
/ cljs.core.subs.call(null, $_STAR_format_str_STAR_27199$$, 1)
causes an error because we have tilde
, s
and *format-str*
sharing a variable name.
Roshi is a set CRDT store modeled as a stateless web server in front of N (clusters) x M (shards) redis servers. It has 3 operations: Insert, Select, and Delete
Each element is a {"key", "member", "score"}
key
is the set name essentially. You select based on key
. key
s can be merged on select.member
is the unique name of a member of the setscore
is a numeric value that has multiple uses.
key
and member
are inserted, a select will only return the one with the highest score
(require '[clojure.core.async :refer (go go-loop <! >! >!! chan close! alts!)]) | |
(defn de-async | |
"From is a channel of channels. | |
Returns a new channel that has the values of the channels. | |
Closes when all channels are closed." | |
[from] | |
(let [to (chan)] | |
(go-loop [cs [from]] | |
(if-not (empty? cs) |
// function reducing(acc, next) { | |
// return next_acc | |
// } | |
// function transducing(reducing) { | |
// return more_reducing | |
// } | |
// Example reducer (without transducers) |
// this a lazy evaluation of the delayed value | |
// If the delayed value is delayed (i.e. a function), then return a function that will resolve eventually | |
// If not, then resolve immediately and prefix | |
function resolve(prefix, delayed_value) { | |
if (typeof delayed_value === 'function') | |
return function (a) { return resolve(prefix, delayed_value(a)) } | |
else | |
return prefix + delayed_value | |
} |