Re: core.async | compojure ... odd error ... help!!
Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday, September 27, 2014 8:08:48 PM UTC+2, mond wrote: Thanks for the tips. I wasn't expecting magic but otherwise your points are well taken Ray Sent from my iPhone On 27 Sep 2014, at 16:55, James Reeves ja...@booleanknot.com javascript: wrote: On 27 September 2014 10:01, mond r...@mcdermott.be javascript: wrote: Speaking to the main point, no I don't want to put a channel on to the response so that's a mistake that I see and would like to avoid. I would like to understand where I have gone wrong. You're trying to use core.async with a library that has no understanding of core.async. It's important to understand that core.async isn't magic; it won't work with libraries that weren't designed for it. Maybe I need to use HTTPkit instead? HTTP Kit has good support for async, but uses its own lightweight protocol. Check out the examples on their website, and if you still want to connect a core.async channel up to HTTP Kit, you'll need something like: (async/take! async-ch (fn [msg] (httpkit/send! http-ch msg))) This tells core.async to take values off the async channel and pass them onto HTTP Kit. - James -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: core.async | compojure ... odd error ... help!!
Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday, September 27, 2014 8:08:48 PM UTC+2, mond wrote: Thanks for the tips. I wasn't expecting magic but otherwise your points are well taken Ray Sent from my iPhone On 27 Sep 2014, at 16:55, James Reeves ja...@booleanknot.com javascript: wrote: On 27 September 2014 10:01, mond r...@mcdermott.be javascript: wrote: Speaking to the main point, no I don't want to put a channel on to the response so that's a mistake that I see and would like to avoid. I would like to understand where I have gone wrong. You're trying to use core.async with a library that has no understanding of core.async. It's important to understand that core.async isn't magic; it won't work with libraries that weren't designed for it. Maybe I need to use HTTPkit instead? HTTP Kit has good support for async, but uses its own lightweight protocol. Check out the examples on their website, and if you still want to connect a core.async channel up to HTTP Kit, you'll need something like: (async/take! async-ch (fn [msg] (httpkit/send! http-ch msg))) This tells core.async to take values off the async channel and pass them onto HTTP Kit. - James -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: core.async | compojure ... odd error ... help!!
Excellent - thanks. Nice to see core.async getting the ring middleware love :) On 28 Sep 2014 at 10:48:57, Max Penet (m...@qbits.cc) wrote: Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday, September 27, 2014 8:08:48 PM UTC+2, mond wrote: Thanks for the tips. I wasn't expecting magic but otherwise your points are well taken Ray Sent from my iPhone On 27 Sep 2014, at 16:55, James Reeves ja...@booleanknot.com wrote: On 27 September 2014 10:01, mond r...@mcdermott.be wrote: Speaking to the main point, no I don't want to put a channel on to the response so that's a mistake that I see and would like to avoid. I would like to understand where I have gone wrong. You're trying to use core.async with a library that has no understanding of core.async. It's important to understand that core.async isn't magic; it won't work with libraries that weren't designed for it. Maybe I need to use HTTPkit instead? HTTP Kit has good support for async, but uses its own lightweight protocol. Check out the examples on their website, and if you still want to connect a core.async channel up to HTTP Kit, you'll need something like: (async/take! async-ch (fn [msg] (httpkit/send! http-ch msg))) This tells core.async to take values off the async channel and pass them onto HTTP Kit. - James -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/gOsd2Zzc1Vk/unsubscribe. To unsubscribe from this group and all its topics, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] aprint (awesome print) released
lein repl nREPL server started on port 60264 on host 127.0.0.1 - nrepl://127.0.0.1:60264 REPL-y 0.3.1 Clojure 1.6.0 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e test.core= (use 'aprint.core) nil test.core= (aprint hello) hello nil test.core= Bye for now! 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ after I quit the REPL, on which I have used aprint, the enter key can not switch to new line properly. sorry for my poor english. -- tao.zhou2009 Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Saturday, September 13, 2014 at 2:44 PM, Dave Sann wrote: great stuff. thanks. On Friday, 12 September 2014 01:06:29 UTC+10, Vladimir Bokov wrote: Yes. I use clansi: (clansi.core/without-ansi (aprint issues)) Thanks for feedback, I updated README too четверг, 11 сентября 2014 г., 21:58:57 UTC+7 пользователь Dave Sann написал: Is there an easy way to get the same compact layout but without the colour control codes? On Friday, 5 September 2014 07:50:10 UTC+10, Vladimir Bokov wrote: Hi folks, I got just tired to gazing into big amount of data and scroll 3-4 screens of my 13' laptop to grasp the structure, so I used pprint's pretty printer, but add colors and changed indentation *by default* (actually pprint has tuning parameters, too, but anyway it's breaking maps by single entry by line...) Now the screen area gets used more effectively and looks more friendly imo :) See it: https://github.com/razum2um/aprint Looking forward yours opinion if I should make a nrepl middleware to use it *right away*, without doing (ap) every time ;) -- 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 (mailto:clojure@googlegroups.com) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com (mailto:clojure+unsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com (mailto:clojure+unsubscr...@googlegroups.com). For more options, visit https://groups.google.com/d/optout. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Acceptance testing with Clojure
I've googled around a little bit, but didn't found any relevant info about subject. Please, share your experience about acceptance testing with Clojure! -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] aprint (awesome print) released
Hi, what terminal, shell (+distro?) are you using? Do colors work well in grep --color or some thing else? Also, see https://github.com/razum2um/aprint/issues/2 - In meanwhile I hardly can reproduce such errors, most likely I need a vagrant box for that from you And file an issue on github, let's discuss it there. воскресенье, 28 сентября 2014 г., 21:20:20 UTC+7 пользователь Tao Zhou написал: lein repl nREPL server started on port 60264 on host 127.0.0.1 - nrepl:// 127.0.0.1:60264 REPL-y 0.3.1 Clojure 1.6.0 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e test.core= (use 'aprint.core) nil test.core= (aprint hello) hello nil test.core= Bye for now! 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ after I quit the REPL, on which I have used aprint, the enter key can not switch to new line properly. sorry for my poor english. -- tao.zhou2009 Sent with Sparrow http://www.sparrowmailapp.com/?sig On Saturday, September 13, 2014 at 2:44 PM, Dave Sann wrote: great stuff. thanks. On Friday, 12 September 2014 01:06:29 UTC+10, Vladimir Bokov wrote: Yes. I use clansi: (clansi.core/without-ansi (aprint issues)) Thanks for feedback, I updated README too четверг, 11 сентября 2014 г., 21:58:57 UTC+7 пользователь Dave Sann написал: Is there an easy way to get the same compact layout but without the colour control codes? On Friday, 5 September 2014 07:50:10 UTC+10, Vladimir Bokov wrote: Hi folks, I got just tired to gazing into big amount of data and scroll 3-4 screens of my 13' laptop to grasp the structure, so I used pprint's pretty printer, but add colors and changed indentation *by default* (actually pprint has tuning parameters, too, but anyway it's breaking maps by single entry by line...) Now the screen area gets used more effectively and looks more friendly imo :) See it: https://github.com/razum2um/aprint Looking forward yours opinion if I should make a nrepl middleware to use it *right away*, without doing (ap) every time ;) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com javascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: core.async | compojure ... odd error ... help!!
Hi mond, I've been using HTTPkit with Compojure and core.async (all fronted by Nginx so the entire stack is async FWIW). To glue core.async with HTTPkit when handling inbound requests, I have a utility function (defn handle-async! [handler req] (http-server/with-channel req channel (take! (handler req) #(http-server/send! channel % and I make use of that utility function when defining routes (defroutes all-routes (GET /covers/v1/:cover [] (partial http/handle-async! fetch-cover!)) (context /books/v1 [] (GET /search [] (partial http/handle-async! search-handler!)) (GET /:isbn [] (partial http/handle-async! get-book-by-isbn! The handler functions fetch-cover!, search-handler!, get-book-by-isbn!, all return channels (they either call go for stuff that needs to be async, or to-chan on collections read directly from memory. - Mike On Saturday, September 27, 2014 5:01:36 AM UTC-4, mond wrote: Hi James, Er, nice tip on the routes - that was another thing that I didn't expect to work but was happy when it did ;-) I will of course adapt it to your recommendation. Speaking to the main point, no I don't want to put a channel on to the response so that's a mistake that I see and would like to avoid. I would like to understand where I have gone wrong. Maybe I need to use HTTPkit instead? Thanks Ray On Saturday, 27 September 2014 02:08:50 UTC+2, James Reeves wrote: Hi Ray, I don't entirely understand why you expected this to work. Channels aren't a valid Ring response body. The error message is essentially telling you that Compojure has no way of turning the channel object you've returned into a valid response. The other problem you have is that the Ring Jetty adapter doesn't have any support for asynchronous operations. Another small point. You're using * as an argument name, but this isn't really recommended. This only works by coincidence, and it may be removed in future versions. Instead use something like: (GET [/:brand/:country/:resource :resource #.*] [brand country resource] ...) - James On 27 September 2014 00:14, mond r...@mcdermott.be wrote: My first core.async program ... all works outside of the web app but barfs once I put the functions inside a web container. I hope somebody in the group can point to my obvious mistake... The idea is that the function 'respond-within-sla' will give back a result or a come back later message after N milliseconds. It is passed a number of ms, three functions and the arguments for the final function ... which is the one that should operate within the SLA. (defn respond-within-sla [expected-result-milliseconds respond-ok respond-later data-fetcher args] (let [data-channel (timeout expected-result-milliseconds)] (go (if-let [data (!! data-channel)] ((async/close! data-channel) (respond-ok data)) (respond-later))) (go (! data-channel (apply data-fetcher args) To keep the volume of code to parse to a minimum I have made a few toy functions that demonstrate the failure... ; test funcs (defn ok [data] (prn (str send HTTP 200 ... got data data))) (defn later [] (prn (str send HTTP 202 ... request received, come back later))) (defn fetcher [arg1 arg2 arg3] (prn (str fetching data with args arg1 arg2 arg3)) response-data) (defn failer [ args] (Thread/sleep 1000) (str never gets here args)) ; test funcs (defn ok [data] (prn (str send HTTP 200 ... got data data))) (defn later [] (prn (str send HTTP 202 ... request received, come back later))) (defn fetcher [arg1 arg2 arg3] (prn (str fetching data with args arg1 arg2 arg3)) response-data) (defn failer [ args] (Thread/sleep 1000) (str never gets here args)) (defn generate-response [brand country resource] (let [sla (or (env :sla-milliseconds) 100)] (respond-within-sla sla ok later fetcher brand country resource))) (defn generate-fail [brand country resource] (let [sla (or (env :sla-milliseconds) 100)] (respond-within-sla sla ok later failer brand country resource))) From within the REPL it all works fine... (generate-response A B C) = #ManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@4b7ae3f7 fetching data with args A B C send HTTP 200 ... got data response-data (generate-fail A B C) = #ManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@4eb8b5a9 send HTTP 202 ... request received, come back later Here is the compojure route.. (defroutes app (GET /:brand/:country/* [brand country *] (generate-response brand country *)) (ANY * [] (route/not-found You must use a REST style to specify brand and country keys in the URL))) If I now start it up 'lein run' and try to exercise the functions from
Re: Acceptance testing with Clojure
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I can answer this in two ways: 1. Acceptance testing Clojure code. 2. Acceptance testing other code with Clojure. I have significantly more experience with the latter than the former. All in all, I prefer the built in clojure.test library over more opinionated libraries like Midje. In particular I recommend adding in Aphyr's excellent Prism plugin to your profiles.clj to do auto testing, and pjstadig`s similarly excellent humane-test-output for readability. My dislike of midje stems from how awkward I found it to share setup code between tests. I feel that clojure.test nests more, allowing me to save more code up front. I also haven't used Midje in a while, so Brian might've upgraded it without me noticing. You also cannot go wrong with test.check. I really enjoy using it for both correctness and simple profiling (e.g. print to console and see if anything gets too slow). On the latter front, test.check + JDBC/Selenium/HTTP appears to be one of the most fruitful ways of hunting down bugs in single-page applications that I've ever seen. I think at this point the bug count for our testing code is close to 5 for an average of 3 hours per bug. Most of these bugs were either concurrency, caching, or SQL based, and some were close to 4 years old. I'll be giving a talk on this subject at the Conj this year, and the video will be posted later if you aren't attending. For more info on test.check, you should check out Reid Draper's Cognicast episode (http://thinkrelevance.com/blog/2013/11/11/reid-draper-cognicast-episode-045) and my Cognicast episode (http://blog.cognitect.com/cognicast/ashton-kemerling-064) On 09/28/2014 08:24 AM, Ruslan Prokopchuk wrote: I've googled around a little bit, but didn't found any relevant info about subject. Please, share your experience about acceptance testing with Clojure! - -- Ashton -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBAgAGBQJUKBxtAAoJEIkUqIW02x05kBMQALUcIDvGO+ohCVUJw2xC2HMT UPBK3eFHVhrgp84EqFx00A/+/sFmXM6wKWzcbTuEeG4YEuiea2UiZjqs7bFvqg3w L2j3CwGpG+eENSP4CQ4L2qB0n4ljuWSqHgH1eWYIGC98f6hKfMC2Itb7SEKWdm1M iYTQdFKhULbsmahwL1Z+dKuxe9Q6Vv20HahQan5T7JY8jE8QJI5d/icXI8xel6OV 3wlsW1AfBec1d7r/67R0MRnWqD2swE3WFbh+SlNQz/orSNvHvOLufhS5s0Xamtji xo59pX7xrAMkyf/a40HopHTcWD1Qkp9T0VBO0X43dfdbTH5gMdc7iOFmpHXj5EAi wbRRAtXp75F6tdYHf4n6I9y+N2auRz1SF1KOPb69mjkjx8Pujy8EwZdfpwABqLtu 4D06KlRrVmCiduvc0eVBcUVOa0o2lait2y0cMLa1M2Tt3rwNZb23nrJ3T9xXhrIY GKW/N+uQ2uC028Wqh3oFcOrjN6S6XU6rahhojCSSXsfMddmzsgz6qPdy3voAa68j e4Z/aP5Q9fPViW3j/E9FGmrQU89eOUdPVabbrJNu2J3DqGu3eaRLpAJP9oa5v7Q+ iEOGU38ZbLwMXhvw8VvMOnF9MKn9JAsoDZOPFOfuftZWmP1q0HqmBxxxg4WBW3hC 2EldloS4hNyaSJ4tIlex =djIk -END PGP SIGNATURE- -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] aprint (awesome print) released
Last login: Sun Sep 28 22:30:20 on ttys005 192:test tao$ lein repl nREPL server started on port 60609 on host 127.0.0.1 - nrepl://127.0.0.1:60609 REPL-y 0.3.1 Clojure 1.6.0 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e test.core= (use 'aprint.core) nil test.core= (aprint {:I [heard {:you like} {:nifty tools} {:very muuuch}], :so [I 'made '(something 4 you)]}) {:I [heard {:you like} {:nifty tools} {:very muuuch}], :so [I made (something 4 you)]} nil test.core= Bye for now! 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ OS: OS X 10.9.5 Terminal: Version 2.4 (326) Copyright © 1991-2013 Apple Inc. All rights reserved. I use the example in your project’s README.md. You can see, I only used aprint. the problem is the same as : https://github.com/razum2um/aprint/issues/2 Thank you for your very quick reply. I also post a comment under issue 2. -- tao.zhou2009 Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Sunday, September 28, 2014 at 10:27 PM, Vladimir Bokov wrote: Hi, what terminal, shell (+distro?) are you using? Do colors work well in grep --color or some thing else? Also, see https://github.com/razum2um/aprint/issues/2 - In meanwhile I hardly can reproduce such errors, most likely I need a vagrant box for that from you And file an issue on github, let's discuss it there. воскресенье, 28 сентября 2014 г., 21:20:20 UTC+7 пользователь Tao Zhou написал: lein repl nREPL server started on port 60264 on host 127.0.0.1 - nrepl://127.0.0.1:60264 (http://127.0.0.1:60264) REPL-y 0.3.1 Clojure 1.6.0 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e test.core= (use 'aprint.core) nil test.core= (aprint hello) hello nil test.core= Bye for now! 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ after I quit the REPL, on which I have used aprint, the enter key can not switch to new line properly. sorry for my poor english. -- tao.zhou2009 Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Saturday, September 13, 2014 at 2:44 PM, Dave Sann wrote: great stuff. thanks. On Friday, 12 September 2014 01:06:29 UTC+10, Vladimir Bokov wrote: Yes. I use clansi: (clansi.core/without-ansi (aprint issues)) Thanks for feedback, I updated README too четверг, 11 сентября 2014 г., 21:58:57 UTC+7 пользователь Dave Sann написал: Is there an easy way to get the same compact layout but without the colour control codes? On Friday, 5 September 2014 07:50:10 UTC+10, Vladimir Bokov wrote: Hi folks, I got just tired to gazing into big amount of data and scroll 3-4 screens of my 13' laptop to grasp the structure, so I used pprint's pretty printer, but add colors and changed indentation *by default* (actually pprint has tuning parameters, too, but anyway it's breaking maps by single entry by line...) Now the screen area gets used more effectively and looks more friendly imo :) See it: https://github.com/razum2um/aprint Looking forward yours opinion if I should make a nrepl middleware to use it *right away*, without doing (ap) every time ;) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com (javascript:) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com (javascript:) For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com (javascript:). For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send
lein midje :autotest problem - fast re-init?
I've really been enjoying using lein midje :autotest to run my tests every time I do an editor save. However, I introduced a bug in my code which it didn't detect. I re-arranged some code and accidentally moved a function reference above the point where the function is defined. When I saved, the automatic re-load of the file did not generate an unresolved symbol error because the function was already defined from the previously saved version. It wasn't until I killed lein and restarted it that the load of the file generated the Unable to resolve symbol error. Any suggestions besides killing and restarting lein midje :autotest from time to time? (To be avoided given the long delay starting it.) Thanks. Steve -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ANN] New release 0.28.1 of Counterclockwise
Counterclockwise, the Eclipse Clojure development tool. Counterclockwise 0.28.1 has been released. Improvement over 0.28.0 based on user feedback. Thanks to all who helped improve Counterclockwise by their constructive comments! - Drag Drop from Github / Bitbucket / Google Code URLs works in Linux - Better User feedback for Drag Drop folder actions - Added a check for missing `.classpath` file for Leiningen projects. Automatically reconstruct the java build path if it is missing. ChangeLog = http://doc.ccw-ide.org/ChangeLog.html#_changes_between_counterclockwise_0_28_0_and_0_28_1 Installation instructions == http://doc.ccw-ide.org/documentation.html#_install_counterclockwise Cheers, -- Laurent Petit -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: lein midje :autotest problem - fast re-init?
On Sep 28, 2014, at 9:57 AM, Steve Ford fordsfo...@gmail.com wrote: Any suggestions besides killing and restarting lein midje :autotest from time to time? (To be avoided given the long delay starting it.) You can use Stuart Sierra's workflow: description: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded tooling: https://github.com/stuartsierra/reloaded I myself haven't bothered switching, because I push frequently and the continuous integration server will catch those problems. (Or, when I'm pushing less frequently, I'll occasionally toss off a plain `lein midje` in a shell buffer somewhere.) Note: Rather than `lein midje :autotest`, you can also run autotest in the repl. I prefer it: 546 $ lein repl nREPL server started on port 51091 on host 127.0.0.1 user= (use 'midje.repl) Run `(doc midje)` for Midje usage. Run `(doc midje-repl)` for descriptions of Midje repl functions. nil user= (autotest) == Loading (midje.data.fact midje.util.exceptions ... = Namespace implementation.line-numbers.fim-check-failures ... 0 failures, 0 errors. Midje summary: All checks (736) succeeded. [Completed at 15:02:22] true user= -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] A guide to setup test driven workflow for Clojure
This seems cool, my approach isn't nearly as sophisticated and much more editor dependent. I've using prelude, which include projectile, which binds C-c p P to projectile-test-project. There were a couple customizations I had to make to get it really streamlined, though. The command shows up in the compile prompt, but I can get rid of that by customizing compilation-read-command to nil. It doesn't save when this variable is nil, so I bound a keyboard macro to F6: [?\s-p ?S ?\s-p ?P] On Saturday, September 27, 2014 5:43:05 PM UTC-4, suvash wrote: Hi friends, I have just posted a guide to setup a test driven workflow for Clojure, the idea being able to have a workflow where one does not have to leave the editor to execute tests as the files are modified. It is posted at http://suva.sh/2014/10/27/test-workflow-setup-for-clojure/ I hope this comes of use to somebody else as well, as I've been quite bummed to not have run into a tutorial as such. Please feel free to discuss it at reddit / HN as you will. https://news.ycombinator.com/item?id=8377951 http://www.reddit.com/r/Clojure/comments/2hn8u2/a_guide_to_setup_test_driven_workflow_for_clojure/ Thanks #suvash -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] A guide to setup test driven workflow for Clojure
just use: https://github.com/weavejester/ns-tracker, (ns xxx.repl) (def modified-namespaces (ns-tracker [src test])) (defn reload [] (doseq [ns-sym (modified-namespaces)] (require ns-sym :reload))) and in project.clj :repl-options {:init-ns xxx.repl} when modified files, just (reload) in a open REPL. -- tao.zhou2009 Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, September 29, 2014 at 7:16 AM, Colin Williams wrote: This seems cool, my approach isn't nearly as sophisticated and much more editor dependent. I've using prelude, which include projectile, which binds C-c p P to projectile-test-project. There were a couple customizations I had to make to get it really streamlined, though. The command shows up in the compile prompt, but I can get rid of that by customizing compilation-read-command to nil. It doesn't save when this variable is nil, so I bound a keyboard macro to F6: [?\s-p ?S ?\s-p ?P] On Saturday, September 27, 2014 5:43:05 PM UTC-4, suvash wrote: Hi friends, I have just posted a guide to setup a test driven workflow for Clojure, the idea being able to have a workflow where one does not have to leave the editor to execute tests as the files are modified. It is posted at http://suva.sh/2014/10/27/test-workflow-setup-for-clojure/ I hope this comes of use to somebody else as well, as I've been quite bummed to not have run into a tutorial as such. Please feel free to discuss it at reddit / HN as you will. https://news.ycombinator.com/item?id=8377951 http://www.reddit.com/r/Clojure/comments/2hn8u2/a_guide_to_setup_test_driven_workflow_for_clojure/ Thanks #suvash -- 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 (mailto:clojure@googlegroups.com) Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com (mailto:clojure+unsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com (mailto:clojure+unsubscr...@googlegroups.com). For more options, visit https://groups.google.com/d/optout. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] aprint (awesome print) released
Forgive me if this is unwelcome self-promotion, but I figured I'd take this opportunity to point out some similar projects: My re-usable pretty-printing engine with a simple EDN printer: https://github.com/brandonbloom/fipp A colorizing EDN printer built on Fipp: https://github.com/greglook/puget/ nREPL integration for Puget: https://github.com/greglook/whidbey On Thursday, September 4, 2014 5:50:10 PM UTC-4, Vladimir Bokov wrote: Hi folks, I got just tired to gazing into big amount of data and scroll 3-4 screens of my 13' laptop to grasp the structure, so I used pprint's pretty printer, but add colors and changed indentation *by default* (actually pprint has tuning parameters, too, but anyway it's breaking maps by single entry by line...) Now the screen area gets used more effectively and looks more friendly imo :) See it: https://github.com/razum2um/aprint Looking forward yours opinion if I should make a nrepl middleware to use it *right away*, without doing (ap) every time ;) -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] aprint (awesome print) released
As a workaround, see if running stty sane fixes your terminal. -- Michael Wood On 28 Sep 2014 4:43 PM, tao.zhou2009 tao.zhou2...@gmail.com wrote: Last login: Sun Sep 28 22:30:20 on ttys005 192:test tao$ lein repl nREPL server started on port 60609 on host 127.0.0.1 - nrepl:// 127.0.0.1:60609 REPL-y 0.3.1 Clojure 1.6.0 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e test.core= (use 'aprint.core) nil test.core= (aprint {:I [heard {:you like} {:nifty tools} {:very muuuch}], :so [I 'made '(something 4 you)]}) {:I [heard {:you like} {:nifty tools} {:very muuuch}], :so [I made (something 4 you)]} nil test.core= Bye for now! 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ OS: OS X 10.9.5 Terminal: Version 2.4 (326) Copyright © 1991-2013 Apple Inc. All rights reserved. I use the example in your project’s README.md. You can see, I only used aprint. the problem is the same as : https://github.com/razum2um/aprint/issues/2 Thank you for your very quick reply. I also post a comment under issue 2. -- tao.zhou2009 Sent with Sparrow http://www.sparrowmailapp.com/?sig On Sunday, September 28, 2014 at 10:27 PM, Vladimir Bokov wrote: Hi, what terminal, shell (+distro?) are you using? Do colors work well in grep --color or some thing else? Also, see https://github.com/razum2um/aprint/issues/2 - In meanwhile I hardly can reproduce such errors, most likely I need a vagrant box for that from you And file an issue on github, let's discuss it there. воскресенье, 28 сентября 2014 г., 21:20:20 UTC+7 пользователь Tao Zhou написал: lein repl nREPL server started on port 60264 on host 127.0.0.1 - nrepl:// 127.0.0.1:60264 REPL-y 0.3.1 Clojure 1.6.0 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e test.core= (use 'aprint.core) nil test.core= (aprint hello) hello nil test.core= Bye for now! 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ after I quit the REPL, on which I have used aprint, the enter key can not switch to new line properly. sorry for my poor english. -- tao.zhou2009 Sent with Sparrow http://www.sparrowmailapp.com/?sig On Saturday, September 13, 2014 at 2:44 PM, Dave Sann wrote: great stuff. thanks. On Friday, 12 September 2014 01:06:29 UTC+10, Vladimir Bokov wrote: Yes. I use clansi: (clansi.core/without-ansi (aprint issues)) Thanks for feedback, I updated README too четверг, 11 сентября 2014 г., 21:58:57 UTC+7 пользователь Dave Sann написал: Is there an easy way to get the same compact layout but without the colour control codes? On Friday, 5 September 2014 07:50:10 UTC+10, Vladimir Bokov wrote: Hi folks, I got just tired to gazing into big amount of data and scroll 3-4 screens of my 13' laptop to grasp the structure, so I used pprint's pretty printer, but add colors and changed indentation *by default* (actually pprint has tuning parameters, too, but anyway it's breaking maps by single entry by line...) Now the screen area gets used more effectively and looks more friendly imo :) See it: https://github.com/razum2um/aprint Looking forward yours opinion if I should make a nrepl middleware to use it *right away*, without doing (ap) every time ;) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: [ANN] aprint (awesome print) released
stty sane after execute the above command, the terminal is normal. -- tao.zhou2009 Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, September 29, 2014 at 12:29 PM, Michael Wood wrote: stty sane -- 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 unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.