I can do something like this
val sortedCounts = counts.sortBy(kvPair => kvPair._2, false)
in Scala. So far I only found the *sort-by-key *function in Sparkling,
which doesn't exactly do what I need...
Regards
Roger
--
You received this message because you are subscribed to the Google
Does ClojureCLR provide an nrepl implementation that would allow
vim.fireplace to connect to his session ?
Regards
Roger
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts
The following snippet works
(fresh [?row ?col]
(fd/+ row 1 ?row)
(fd/+ col 1 ?col)
(membero {:row ?row :col ?col} data)))] ; check
existence of {:row (?row + 1) :col (?col + 1)}
But I'm not sure if this isn't to verbose.
I have the following simple core.logic snippet:
(def my-data [
{:name 'peter
:some-data {
:some-value: 42
}
:sales 1200
:age 32}
{:name 'paul
:sales 200
:age 42}
{:name 'mary
If it were me I'd avoid making 'topic a magic symbol and let the user
choose a symbol to bind. It'd look something like
Yes, that is true and I already changed my macro. I just wanted to take
little steps towards the final goal.
Thanks
Roger
--
You received this message because you are
I would like to find the entries with 4 adjacent cells (horizontally or
vertically) ?
Is this the right way to do this ? I don't think so, since my solution
seems to be very slow. Evaluating in LightTable takes about 10 seconds.
(def matrix [
{:row 1
:col 1}
I didn't know that featurec supported this.
BTW: If anyone is interested. The following works:
(def my-data [
{:name 'peter
:sales 1200
:nested {
:value 123}
:age 32}
{:name 'paul
:sales 200
Also in this case I don't really see the value over writing the search
directly - but your goals are not clear to me
It's just an exercise to get a feel for what core.logic can be used for.
Regards
Roger
--
You received this message because you are subscribed to the Google
Groups
Ok,
the execution time is about 3sec in a standalone repl. Much faster but imho
still way to slow.
Regards
Roger
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from
I just started to play with macros in Clojure. The following is a simple
example that expands to:
(on-message topic-test (clojure.core/fn [topic13730] (println topic13730
test)))
To make this work I had to replace the symbol 'topic in the body with the
gensym symbol. Is this the right way
Thanks,
that helped a lot.
Regards
Roger
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To
Hi,
it seems as if there is a test package for vertx and Clojure
(vertx.testools)
Since I would like to test my vertices I tried this simple approach:
(tt/as-embedded (fn []
(core/deploy-verticle project/vertices/time.clj)
(tt/test-complete*)))
But this gives me a timeout.
BTW: The
I think I'm getting close. The eventbus_test.clj
https://github.com/vert-x/mod-lang-clojure/blob/master/api/src/test/clojure/vertx/eventbus_test.clj
runs
and I changed my test to:
(deftest eb-send
(core/deploy-verticle /project/vertices/time.clj)
(let [addr const/topic-time
id
Maybe it is a better solution to put the code I wan't to test outside the
vertices and just leave the basic eventbus setup insides the vertices ?
Regards
Rpger
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
I would like to replay all changes since a specific timestamp. It seems as
if I can get all transactions with
(q '[:find ?t :where
[_ :db/txInstant ?t]
] (db conn))
Using as-of would allow me to replay the state at a given point in time.
But that would replay the complete state
Is it possible to do some batch updates with taoensso.carmine ?
So far I'm doing
(defmacro wcar* [ body] `(car/wcar server1-conn ~@body))
(defn test-data [s n]
(map (fn [i] (reverse (conj '(taoensso.carmine/set) (str i |color)
blue))) (range s n)))
(def data (map (fn[i] (conj (test-data i
Is it possible to do some sort of batch processing with the carmine library ?
So far I'm doing the following.
(defn test-data [s n]
(map (fn [i] (reverse (conj '(taoensso.carmine/set) (str i |color) blue)))
(range s n)))
(def data (map (fn[i] (conj (test-data i (+ i 2000))
I have problems to understand how the following code evaluates. I
understand what the code does but not how this result is computed:
BTW: This is an example from the async webinar:
(chan 1 (comp (map #(.-keyCode %))
(filter #{37 39})
(map {37 :previous 39
Hi,
I found the following example for SSE:
(def ch (channel)) ; lamina.core.channel
(defn handler [request]
(println request)
(when (= (:uri request) /event-source)
{:status 200
:headers {Content-Type text/event-stream}
:body ch}))
(defn handler [request]
(println request)
The first part of my code looks like this
(defn handle-client [in out]
(binding [
*in* (reader in)
]
(with-connection db
(let [outstream (writer out)]
(loop []
20 matches
Mail list logo