[ANN] Reactive with ClojureScript Recipes (book)

2017-10-11 Thread Nicolas Modrzyk
Good morning All, >From the other side of the planet, Apress just published a recipe book on ClojureScript with React/Reagent. It should quite a fun and easy read for most of the people on this list, so please have a look: http://www.apress.com/jp/book/9781484230084 This being a book on

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-11 Thread Daniel Compton
Without more information it's hard to tell, but this looks a like it could be a garbage collection issue. Can you run your test again and add some logging/monitoring to show each garbage collection? If my hunch is right, you'll see garbage collections getting more and more frequent until they take

Re: How to add a java servlet into a clojure ring project

2017-10-11 Thread Matching Socks
war files are zip files, so you can unzip the war and see what's wrong with it. If necessary, build the combined war file another way. You might be able to do that by producing a war file with your web app only (which you know works) and then taking it apart with unzip, incorporating the

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-11 Thread Justin Smith
a small thing here, if memory usage is important you should be building and running an uberjar instead of using lein on the server (this also has other benefits), and if you are doing that your project.clj jvm-opts are not used, you have to configure your java command line in aws instead On Wed,

possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-11 Thread lawrence . krubner
I can't figure out if this is a Clojure question or an AWS question. And if it is a Clojure question, I can't figure out if it is more of a general JVM question, or if it is specific to some library such as durable-queue. I can redirect my question elsewhere, if people think this is an AWS

Re: Is the Learning Guide in Order?

2017-10-11 Thread TP
As a first step I would recommend this tutorial: https://aphyr.com/posts/301-clojure-from-the-ground-up-welcome (unless you are ready to buy a book). 2017-10-11 16:01 keltezéssel, Mark Nutter írta: See also https://www.braveclojure.com/. On Tue, Oct 10, 2017 at 9:11 PM, Tomiwa Ademidun

Re: CLJS: experiencing "callback envy" re closures as DOM event handlers

2017-10-11 Thread hiskennyness
On Wednesday, October 11, 2017 at 1:23:36 PM UTC-4, James Reeves wrote: > > If you output your HTML as DOM nodes, rather than a string, you can just > attach the function directly to the attribute. > It just occurred to me that one advantage of the string approach is that the initial page

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread geraldo dev
(do (def a {:foo :bar}) (def b {:another :value :foo :BAR}) (merge-with (fn [x y] (conj (if-not (vector? x) [x] x) y)) a b)) If override the duplicate values merge could be used. Also one

Re: CLJS: experiencing "callback envy" re closures as DOM event handlers

2017-10-11 Thread hiskennyness
On Wednesday, October 11, 2017 at 1:23:36 PM UTC-4, James Reeves wrote: > > If you output your HTML as DOM nodes, rather than a string, you can just > attach the function directly to the attribute. > Aha! I have only ever mucked with innerHTML, I will have to look into this approach.

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
Sorry, this is the problem with working all night. My sleep deprived eyes skipped over this line: old-field-value (get old-documents field-name []) I fetch the value from the wrong map. Such a basic error. On Wednesday, October 11, 2017 at 1:44:13 PM UTC-4,

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
I should remove the parens before they confuse anyone. They are added by the log statement. Without the parens: {:company_profile_id ["2"], :topic :company, :url ["mikeshawauto.com"]} field-name: :company_profile_id field-value: ["2"] but I in the final document I only get: "final

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
So I tried this: new-field-value (into [] (concat old-field-value field-value)) And I did not get what I expected. Maybe I am sleep deprived, but I don't see why I can't build up a vector with several values. This is in a map in an atom. This is the code: (swap!

Re: CLJS: experiencing "callback envy" re closures as DOM event handlers

2017-10-11 Thread James Reeves
If you output your HTML as DOM nodes, rather than a string, you can just attach the function directly to the attribute. On 11 October 2017 at 18:20, hiskennyness wrote: > I am cobbling together my own little CLJS web framework and it is going > well but I am stumped by one

CLJS: experiencing "callback envy" re closures as DOM event handlers

2017-10-11 Thread hiskennyness
I am cobbling together my own little CLJS web framework and it is going well but I am stumped by one bit of interop: supporting event handlers that close over lexical variables. It seems to be a piece of cake for, inter alia, Reagent. Here is an excerpt from the "simple" example, hacked a bit

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
So I have this: ({:company_profile_id ["2"], :topic :company, :url ["mikeshawauto.com"]}) And then I get this field name and value: (:company_profile_id) (["2"]) The next 3 lines of code are: old-field-value (get old-documents field-name [])

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
Using conj instead of into, for no particular reason, except debugging. The document is slowly built-up: ({:company_profile_id [["2"]], :topic :company, :url [["mikeshawauto.com"]]}) ({:company_profile_id [["2"]], :topic :company, :url [["mikeshawauto.com"]]}) ({:company_profile_id [["2"]],

Re: beginners' puzzle

2017-10-11 Thread Timothy Baldridge
Best answer for that is probably the source code itself: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java On Wed, Oct 11, 2017 at 9:07 AM, wrote: > how these keywords in clojure implemented > could anyone anwer me ? > > -- > You

Re: Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
Nevermind. Something about my reasoning is off on this one. I notice that even if I use conj, the same problem happens, I get 4 values in 4 vectors instead of 5 values in 4 vectors. So there must be some earlier step that I've gotten wrong. On Wednesday, October 11, 2017 at 11:44:40 AM

Does (into) ever combine 2 numbers into 1?

2017-10-11 Thread lawrence . krubner
I seem unable to figure out where I made a mistake, though this should be simple. I have two SQL calls that bring back 5 fields: SELECT company_profile_id , reference_id, reference_source FROM company_reference_idlimit 1 ; ++--+--+ |

How to add a java servlet into a clojure ring project

2017-10-11 Thread 'Alexandra Strekalova' via Clojure
I am integrating Togglz library into a Clojure Ring project to support feature toggles and would like to activate the Togglz admin console. According to the Togglz documentation it is necessary to add a servlet in the /WEB-INF/web.xml file for projects that don't support Servlet 3.0. I used

beginners' puzzle

2017-10-11 Thread googolglesucks
how these keywords in clojure implemented could anyone anwer me ? -- 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

Re: Is there a better way to get to `Classname[].class` ?

2017-10-11 Thread pericles macedo
Thanks Peter, Yeah, I didn't find that reference before. It would have saved me a couple hours. I found something similar in a few places, but it only had the primitive types. It missed the class specific element type. On Tuesday, October 10, 2017 at 3:22:38 AM UTC-7, Peter Hull wrote: > > I

Re: Is the Learning Guide in Order?

2017-10-11 Thread Mark Nutter
See also https://www.braveclojure.com/. On Tue, Oct 10, 2017 at 9:11 PM, Tomiwa Ademidun wrote: > Hey guys, > > I Finally started learning Lisp/Clojure thanks to inspiration from the > great Paul Graham's essays . First, I > wanted to

Re: About determinism of async

2017-10-11 Thread Timothy Baldridge
If you want to simply keep some messages in order, then a cat transducer will do the trick just fine: ;; need a buffer or buffer size to get to the transducer param (def c (chan 20 cat)) (async/onto-chan c [1]) (async/>!! c [2 3 4]) (async/close! c) ( wrote: > If you don't want to split at

Re: About determinism of async

2017-10-11 Thread Gary Trakhman
If you don't want to split at the consumer I would recommend adding another channel, and piping it with a cat xform as mentioned above. On Oct 11, 2017 3:28 AM, "JokkeB" wrote: > Thanks. I'm not interested in reading the messages as pairs, I just need > to make sure nothing

Re: Is the Learning Guide in Order?

2017-10-11 Thread Matching Socks
There are some books that give a cohesive and well-ordered introduction. If you can still find a copy of "Clojure Programming", by Emerick, Carper, and Grand, that's the one that I found most thoroughly helpful with the standard library. Also, it has a pretty good index and I made frequent

Re: About determinism of async

2017-10-11 Thread JokkeB
Thanks. I'm not interested in reading the messages as pairs, I just need to make sure nothing gets in between them. I think I'll choose some way to merge the messages, for example just a vector like you suggested, and then have the end consumer recognise and split the vector. I guess splitting