Fork me on GitHub

Hello everybody. Does anybody here know of an easy and succinct way to use regular expressions with truss ( I know I can create my own predicate for the purpose but would like to know if there is some idiom I can (ab)use


@weavejester: Any chance of seeing a new release of ring-jetty-adapter in the near future? There are quite a few new features (`http?` being the one I’m most interested in) that are not in a release yet.


hi guys I would like to hear your opinion regarding serialize and un serialize between protocol, is it worth the effort ? For example : In the elasticsearch client project for clojure I see that the author spends quite a lot of time to convert elasticsearch native protocol to clojure data structure and forth. If we use the rest api, it undoubtedly is faster in term of development and I think the performance of json serialize and deserialize is pretty fast as well. So my question is : is it worth the effort to convert elasticsearch native protocol to clojure in this case ?


In the case of ES the rest api should be slower. The native api has a true long lasting connection to the cluster + compact protocol, and the bottleneck with rest is more likely to be network roundtrips than serialisation. That said it might not matter in your case. Personnally I prefer to use the http api with ES, it makes upgrading less painful too (version mismatch between cluster/client can be a pita with native)


nxqd: I doubt it is worth it


my last job was a pretty heavy user of elasticsearch, we started out with the http es api, then thought the native protocol api would be a good idea, and then went back to the http api, because the native protocol api was a pain to work with


and then continued to use the http api while our elasticsearch team was one by one hired away by the new elastic company, and I suspect still use it to this day


@mpenet: thanks for your info.


@hiredman: thanks for your info especially as a heavy user as well it's good to know simple_smile


Hi! I'd like to get a nicely formatted string from clojure data. Basically pprint, but returning a string with line breaks.


@andreas-thoelke: do you have an example string and data?


As an example I'd like to format a nested clojure map or vector of maps


You can surround preformatted text with three back ticks, if you care to paint a picture.


{:a "A"
 :b  "B"}
How would you want that to look?


oh, I mean not in Slack. In my editor.


Yes, I meant to write examples in slack. It helps folks like me picture what you're looking for 😉


so I'm looking for a clojure function, perhaps in the pprint namespace..?


Sure so if you did

(require '[clojure.pprint])
(clojure.pprint/pprint {:a "A" :b "B"})
=> {:a "A"
    :b "B"}


yes, pprint prints to the console, but I need it to return me a string


(with-out-str (clojure.pprint/pprint {:a "A" :b "B"}))


Thanks! This definitely returns the formatted string!


Not ideal though, as it still prints to the console


guess it depends on how you're using the string, if written to a file I don't recall seeing it printed to the console. When using with-out-str I'm usually writing some big string to a file.


Wait! It actually doesn't print to the console! ("it evaluates in a context"?). So it seems to do exactly what I want, it just looks a bit odd..


I am looking for a backend lein template with boot, postgres mount and config management (maybe environ). Are there alternatives to Luminous?