2013-09-14
| 00:02 | coventry` | Anyway, amalloy was right. This limitation stands in the way of using core.async to do a lazy split-with. I could work around it by putting unlimited queues between my code and the core.async channels, but that seems wrong on a couple of levels. |
| 00:03 | coventry` | Implementing it was a great exercise for learning core.async, though. :-) |
| 01:51 | s4muel | yyyyyyyyyykkj======================]==]]]]]]]]]]]]]]]]]]]]]]]]pppppppppppppppppppppppp000000000000000000000000000000000000000000000000000000000000 |
| 01:51 | s4muel | 0]]]]]]]]] |
| 01:51 | s4muel | 00000000000]]]]]]]]]]]]]]]i |
| 01:52 | s4muel | 7777711111111ewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwjjjju |
| 01:52 | s4muel | 0]]]]]]]]] |
| 01:53 | s4muel | 3333-......H |
| 01:53 | s4muel | So in other news, I am fostering kittens for a bit |
| 01:53 | s4muel | Sorry about that. |
| 01:59 | seancorfield | s4muel: mine do that sometimes if i leave the keyboard accessible when i leave the room! |
| 02:05 | SegFaultAX | s4muel: That made it go from annoying to awesome! :) |
| 02:07 | callen | s4muel: way to make your foibles adorable. |
| 02:09 | s4muel | I don't know if this is adorable or malevolence, though: http://i.imgur.com/vSwRSkD.jpg |
| 02:10 | SegFaultAX | s4muel: whynotboth.jpg |
| 02:10 | s4muel | True. |
| 02:11 | callen | s4muel: zomg kitty |
| 02:11 | s4muel | I know, I know. cats and the internet -- ehrmagerd! |
| 02:11 | callen | killing me man. I'm trying to be srsface and get some work done |
| 02:11 | callen | but noooooo, there's kitties afoot. No work getting done now. |
| 02:12 | s4muel | I can't even show you the picture of how one is sleeping on my magic trackpad |
| 02:13 | wei_ | s4muel: very cute |
| 02:18 | callen | s4muel: my head is going to asplode. |
| 02:18 | callen | s4muel: you'll be responsible for the death of a Clojure programmer. If head sploding must happen, do it in #php yeesh. |
| 02:18 | s4muel | callen: what work? http://i.imgur.com/35Atdfo.jpg |
| 02:19 | s4muel | aaaand I'm done. |
| 02:19 | callen | I just physically leaned back in my couch and silently laughed from the cute |
| 02:25 | seancorfield | callen: this should completely put paid to any work then... http://bangles.com/kittens/cute.html |
| 02:30 | callen | *_* |
| 02:31 | callen | hrm. that moment when you realize there are PRs for what you were working on already. |
| 02:45 | callen | oh oh, I get it. It's "chunk all the things!" weekend. |
| 02:47 | uvtc | How can I make use of a file that I've just tried to get ahold of via `(clojure.java.io/resource "stuff.txt")`? What can I do with that "java.net.URL" returned by `resource`? For example, how would I read the lines from that stuff.txt file? |
| 02:48 | andyfingerhut | (clojure.java.io/reader url) returns a reader you can pass to many other functions |
| 02:50 | uvtc | Hi andyfingerhut . Thanks. I just tried `(let [stuff (file-seq (io/resource "stuff.txt"))] ...)`, and then `stuff` appears to be a seq, but I don't see how to get the lines out of it. :) |
| 02:52 | uvtc | I'm getting java.net.URL cannot be cast to java.io.File, or java.io.BufferedReader... |
| 02:52 | s4muel | uvtc: try (slurp (io/resource "foo")) |
| 02:52 | andyfingerhut | Did you try (line-seq (io/reader (io/resource "stuff.txt"))) ? |
| 02:52 | uvtc | s4muel, oooh, that works. Thanks. |
| 02:53 | uvtc | andyfingerhut, Ah. No, didn't try that one. Thanks for the pointer. |
| 02:55 | s4muel | TIL slurp works on URLs too (thanks, guns!) |
| 02:57 | uvtc | andyfingerhut, Ok. Thanks. `(let [lines (line-seq (io/reader (io/resource "stuff.txt")))] ...)` works. :) |
| 02:57 | callen | import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories.EnterpriseGradeFizzBuzzSolutionStrategyFactory; |
| 02:57 | andyfingerhut | Good. That was from memory, so hoping I didn't lead you astray |
| 02:58 | andyfingerhut | callen: That is some serious enterprise-y naming |
| 02:58 | andyfingerhut | Where should I send the purchase order? :) |
| 02:59 | callen | andyfingerhut: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/tree/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage |
| 03:00 | seancorfield | hmm, unfortunately this import is real: (import (com.iesnare.www.dra.api.CheckTransactionDetails |
| 03:00 | seancorfield | CheckTransactionDetailsResponseDetailsDetail |
| 03:00 | seancorfield | holders.CheckTransactionDetailsResponseDetailsHolder)) |
| 03:00 | uvtc | This is serious and no-nonsense. |
| 03:01 | callen | #ReasonsIamGladToWriteClojureAndNotJava |
| 03:01 | andyfingerhut | DepartmentOfRedundancyDepartment |
| 03:01 | uvtc | Brushing up on my rusty Java-ese: if someone wanted to use a .properties file in a Clojure app, they'd put it into the my-proj/resources dir and load it with io/resource, correct? |
| 03:03 | andyfingerhut | I've tested something like that recently while working on a Clojure bug, and it worked. I forgot whether it required specifying the name of the "resource" directory in the Leiningen project.clj file or not. |
| 03:04 | andyfingerhut | perhaps :resource-paths See sample.project.clj in the Leiningen docs |
| 03:04 | uvtc | This is probably a silly terminology question, but do you think .properties files are "resources"? |
| 03:05 | callen | uvtc: many things are resorces. |
| 03:05 | callen | resources* |
| 03:05 | andyfingerhut | Ad regarding the bug, don't use non-ASCII characters in your file names :) |
| 03:06 | wei_ | seancorfield: what's a DetailsResponseDetailsDetail? |
| 03:06 | seancorfield | it's from Iovation's fraud analysis SOAP WSDL |
| 03:06 | uvtc | andyfingerhut, I think :resource-paths is for when I want to specify some other dir as (or in addition to) my resources dir (my-proj/resources). Does that sound correct? (Hm. It looks like maybe in Java-land, resources are stored alongside source files?) |
| 03:07 | uvtc | callen, right (images, for example). Thanks. |
| 03:08 | andyfingerhut | I just now learned that M-. in Emacs with nrepl can jump to function definitions inside of jar files in your ~/.m2 local Maven repo. Seriously cool. |
| 03:10 | rurumate | andyfingerhut: only if nrepl was started in the right dir, and you might have to eval the current buffer with C-c k before it works. C-c M-n is also worth learning. |
| 03:10 | uvtc | andyfingerhut, looks like now, if working in a project created via `lein new app my-proj` (which creates an empty resources dir for you), you don't need to specify "resources" in any path explicitly. |
| 03:11 | uvtc | andyfingerhut, thanks for the help. :) |
| 03:11 | andyfingerhut | rurumate: I don't recall doing anything special, and I definitely didn't do C-c k. I did require the namespace containing the function call on which I did M-. |
| 03:12 | rurumate | andyfingerhut: just in case it doesn't work one day |
| 03:22 | Acio | had a question, solved it meself, yay |
| 03:26 | rurumate | andyfingerhut: sorry it's C-c C-k to load the file, not C-c k |
| 03:28 | rurumate | Acio: care to share the question, and the solution? |
| 03:29 | Acio | rurumate: just newbie, couldn't find out how to convert fraction to a decimal, and now i found with-precision and bigdec |
| 03:29 | noto2 | also, ##(* 1/7 1.0) |
| 03:29 | lazybot | ⇒ 0.1428571428571429 |
| 03:30 | rurumate | Acio: there is also (float 3/4) |
| 03:30 | rurumate | and (double 3/4) |
| 03:30 | noto2 | but yeah, bigdec will be more precise |
| 03:31 | Acio | oh wow, not sure why thsoe didn't occur to em |
| 03:31 | Acio | thanks! |
| 03:31 | TEttinger | if you're adding lots of weird little decimal numbers like ##(apply + (repeat 10 0.1)) |
| 03:31 | lazybot | ⇒ 0.9999999999999999 |
| 03:31 | TEttinger | then you would prefer bigdec |
| 03:34 | Acio | thanks! |
| 03:46 | rhg | I think 99% of mindprod.com/jgloss/unmain.html is impossible in clojure lol |
| 03:48 | callen | rhg: is that a challenge? |
| 03:49 | callen | rhg: I have macros man. I make nightma^H^H^H^H^Hdreams happen. |
| 03:49 | rhg | Plz no |
| 03:49 | callen | wat r u doin...is that macro generating a class factory? HOOMAN. STAHP. |
| 03:49 | rhg | For all that's good. Plz no |
| 03:51 | rhg | I fporgot about macros powerz |
| 03:52 | callen | they all forget, until they see some Lisp necromancer's attempt at recreating the universe in his own image. |
| 03:52 | rhg | Id like to see it, then burn it and bury it 500ft underground |
| 03:53 | rhg | Nice laugh |
| 03:55 | rhg | I'm having to write c++, it doesn't need more obfuscation |
| 03:56 | callen | my dream one day is to write a C++ program that generates a lookup table statically using templates at compile time for some reasonably complicated but still doable problem |
| 03:56 | callen | then join the Basque freedom fighters, get them to switch to my cause |
| 03:57 | rhg | Gl..... |
| 03:57 | callen | and use my terrorist allies to kidnap Alexandrescu, and force him to read the C++ code |
| 03:58 | NSAPrismBot | callen: What? |
| 03:58 | rhg | I find c++ to be chore because I don't enjoy it |
| 04:00 | TEttinger | `seen callen |
| 04:01 | rhg | So, what's the worst macro you've seen? |
| 04:02 | llasram | TEttinger: #clojure/seen callen |
| 04:02 | TEttinger | llasram, wondering what the char was to issue a command to lazybot |
| 04:02 | llasram | $seen TEttinger |
| 04:03 | lazybot | TEttinger was last seen talking on #clojure 12 seconds and 479 milliseconds ago. |
| 04:03 | callen | $seen callen |
| 04:03 | lazybot | callen was last seen talking on #clojure 63 milliseconds ago. |
| 04:03 | TEttinger | hm |
| 04:03 | callen | do ho ho. clever. |
| 04:03 | TEttinger | it doesn't have what you said? |
| 04:03 | callen | I was expecting it to miss my request. |
| 04:03 | TEttinger | I must have added that |
| 04:09 | amalloy | incidentally, callen, i think it notices the request only by coincidence: lazybot's plugin-dispatching code calls things in arbitrary order, and for whatever reason it turns out that seen-logging happens before responding to seen |
| 04:16 | rhg | Callen, I challenge to write clojure so bad it makes grown men cry |
| 04:17 | callen | rhg: I'd rather write Clojure so bad that it makes the Clojure Cup judges cry. |
| 04:18 | rhg | K |
| 04:19 | rhg | Idk how hard that is tho |
| 04:20 | rhg | A mutable var loop? |
| 04:21 | s4muel | use java collections directly |
| 04:21 | rhg | Oh |
| 04:21 | rhg | Fugly. |
| 04:21 | s4muel | all of a sudden, everything's mutable! But then again, that's not really clojure, that's just parens around java :) |
| 04:22 | callen | s4muel: then write macro shims for mutable uses of java collections. |
| 04:22 | s4muel | that shadow core functions |
| 04:22 | TEttinger | use OpenCAL or some other obscure language's data from clojure |
| 04:22 | s4muel | write a protocol that reflects the properties of every object created then throw them away |
| 04:23 | rhg | 0.o |
| 04:23 | s4muel | there's opportunities for badness everywhere, but you just have to go so far far out of your way |
| 04:23 | TEttinger | JNI. anything in JNI |
| 04:25 | rhg | Ik there's worst... |
| 04:26 | s4muel | use java.io.shell to write your actual code out to strings of a php file and run it |
| 04:26 | s4muel | that's the king |
| 04:26 | rurumate | in LazySeq.java#seq there is a loop where this check is run repeatedly: "((LazySeq) ls).sval() instanceof LazySeq" It checks whether the "sv" of a LazySeq "ls" is also a LazySeq. Is there a way to run this test in clojure, or to get at the "sv" (because sval() is package-private) |
| 04:27 | rhg | Perl. |
| 04:27 | rurumate | for example, what would the "sv" of (filter' #(= 9999 %) (range)) be? |
| 04:28 | rhg | ? |
| 04:28 | rhg | Oh |
| 04:28 | rhg | Java |
| 04:28 | rurumate | (first (first (filter' #(= 9999 %) (range)))) will call LazySeq.seq(), which runs a loop checking "((LazySeq) ls).sval() instanceof LazySeq" repeatedly |
| 04:29 | rurumate | ..which is why that expression doesn't blow the stack (it runs a while loop that is implemented in java, in LazySeq.first() |
| 04:30 | rurumate | ..unfortunately, and for obvious reasons, it doesn't work that way in clojurescript (there is no underlying jvm) |
| 04:31 | rurumate | ..and the stack fills up |
| 04:33 | rhg | S4muel, I wonder about clojure not PHP; bad PHP is easy |
| 04:36 | s4muel | rhg: Heh, poorly worded - I meant just straight up writing php code in a clojure string(s), spitting to file, and running it. Nonsensical *and* abominable. |
| 04:36 | rhg | Agreed |
| 04:37 | s4muel | rurumate: that's an interesting problem. You would think that nested lazy-seqs made it in. maybe you found a bug? |
| 04:38 | rhg | Bad clojure without interop or macros is improbable |
| 04:39 | callen | rhg: I can prove that wrong in a single github link :) |
| 04:40 | rhg | Rly? |
| 04:40 | rhg | 0.0 |
| 04:40 | rurumate | s4muel: yes I think it's a bug in clojurescript, it's documented here: http://dev.clojure.org/jira/browse/CLJS-587 |
| 04:41 | rurumate | anyway gotta run, hope someone can fix this |
| 04:41 | clojurebot | Titim gan éirí ort. |
| 04:44 | rhg | L8r folks |
| 04:52 | borkdude | If Java is also coffee, what is Clojure? |
| 07:16 | klokbaske | So, functional reactive programming vs csp (eg core.async). What's the difference? |
| 07:17 | klokbaske | I've used the former a couple of times, and it seems to me that core.async's channels are much like signals in Frp |
| 07:19 | pyrtsa | klokbaske: This might not be summing it entirely, but in FRP, you streams generally don't know where they are pushing their events to. In CSP, the channels are visible in the definition of the CSPs. |
| 07:20 | pyrtsa | Which, at least in my opinion, makes CSP much more imperative than FRP. |
| 07:26 | klokbaske | pyrtsa: can you elaborate on how the channels are more visible than streams? I'm not sure I follow ... |
| 07:28 | pyrtsa | klokbaske: When you're using core.async, you explicitly `put!` values into a given channel. In FRP, less so. |
| 07:31 | pyrtsa | In a function you write in CSP, you may have more than one channel you're sending values to, in FRP the explicit pieces of code -- RxJava example being: (.onNext observer value) -- are rarely explicitly written and almost always only push values into one single observer. |
| 07:31 | klokbaske | pyrtsa: ok, i see what you mean with imperative then. |
| 07:32 | pyrtsa | In FRP, you're mostly using stream combinators, i.e. your code contains zero onNext's, onError's or onCompleted's. |
| 07:38 | klokbaske | pyrtsa: ok. i recognize what you say about frp, but I probably have to study some more core.async code to be able to relate it to frp. Can you recommend any? |
| 07:41 | pyrtsa | Hmm, there's so little material about core.async out there yet. |
| 07:41 | G0SUB | pyrtsa: you can always read the code :) |
| 07:41 | pyrtsa | G0SUB: Yeah, I was about to suggest that to klokbaske. :) |
| 07:42 | pyrtsa | klokbaske: Have you understood what core.async does behind the scenes? E.g. what happens when a value is put into a channel. |
| 07:43 | pyrtsa | In other words, what the fuss with goroutines is. |
| 07:44 | G0SUB | pyrtsa, klokbaske: by the way, excellent blog post explaining the innards of core.async http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/ |
| 07:46 | pyrtsa | Yes, that's a good one. |
| 07:46 | klokbaske | pyrtsa: no, it's still pretty much a blackbox for me. |
| 07:46 | pyrtsa | klokbaske: How about coroutines in general? |
| 07:46 | klokbaske | G0SUB: i'll look into that one. |
| 07:47 | klokbaske | I think I'll have to brush up on coroutines as well. Didn't know they where related to csp |
| 07:48 | pyrtsa | klokbaske: The above link should open it up a bit. |
| 07:49 | klokbaske | Great! Thanks a lot for the pointers. I'll see if I can wrap my head around it :-) |
| 08:15 | squidz | i'm trying to do some DOM manipulation using dommy. I am trying to create/update nodes based on the values of a map I pass. Does anybody know if it is possible to set dom element properties while defining a dommy template? |
| 08:20 | squidz | that is within the hiccup-like syntax |
| 08:48 | seangrove | squidz: haven't used dommy yet, how do you like it? |
| 08:50 | squidz | it seems okay, but I haven't used it much yet. I used enlive a long time ago, but if I remember correctly, I think it kind of forced me into using a single page application. Dommy is more along the lines of jquery I suppose |
| 09:01 | clj_newb_2345 | i fucking hate this -- I want emacs to be written in clojure, but then more elisp pacakges I install, the most unlikey that faint dreams becomes |
| 09:01 | clj_newb_2345 | why is that emacs must be built on top of mutable cons cells rather than persistent data structures? |
| 09:01 | clj_newb_2345 | woe woe woe to the software of the world |
| 09:09 | supersym | probably has to do with emacs being ancient :P |
| 09:10 | supersym | tbh I don't use emacs at all, learning curve would not be worth it atm I feel |
| 09:11 | clj_newb_2345 | emacs is fucking awesome |
| 09:13 | supersym | oh I bet...and I can see why people here prefer it over vim(L) |
| 09:15 | supersym | but currently I feel I get less annoyed using LT over emacs (with the keybindings, new extensions, new concepts etc) |
| 09:15 | seangrove | What's the version of google-closure-library I should be using with the latest version of clojurescript? |
| 09:18 | supersym | seangrove: https://github.com/clojure/clojurescript/blob/master/project.clj |
| 09:18 | supersym | isn't that what you are looking for? its a dependency anyway |
| 09:23 | seangrove | supersym: That looks hopeful, thanks |
| 09:24 | seangrove | Looks like that might have done it, thanks again supersym |
| 09:25 | supersym | yw |
| 10:21 | seangrove | dnolen: Working on cleaning up the source map patch, merged current master into it, running into a strange optimization bug: https://www.refheap.com/18664 |
| 10:21 | seangrove | This is with simple optimizations - it looks like the closure compiler is doing dead code removal, but I'm not sure why it's qualifying those lines as dead code |
| 10:40 | si14 | guys, do you have any idea why there is such a huge performance hit in the second case? https://gist.github.com/si14/737920b513fb8ccae152 |
| 10:41 | si14 | the only difference to me is that one value should be passed through iterations |
| 10:41 | si14 | I can't see how this can make 4x difference in this case. |
| 11:22 | borkdude | Are there any tools for clojure that let you express: I want to restrict access to this and that function to this and that namespace or function? |
| 11:22 | ambrosebs | borkdude: I don't think so. |
| 11:23 | borkdude | maybe not a runtime, static check would be ok |
| 11:24 | borkdude | maybe a tool that shows who is calling a specific function then, yes, rgrep |
| 11:24 | borkdude | tools that show you a graph of dependencies between namespaces then? |
| 11:25 | ambrosebs | borkdude: fwiw jvm.tools.analyzer provides a fully expanded AST to harvest var occurrences. |
| 11:25 | ambrosebs | borkdude: tools.namespaces then provides ns dep info. |
| 11:25 | borkdude | ambrosebs I'll take a look at it |
| 11:26 | supersym | borkdude: https://github.com/Hendekagon/lein-clique |
| 11:26 | borkdude | supersym cool thanks |
| 11:27 | ambrosebs | supersym: how does it work? |
| 11:28 | ambrosebs | supersym: does it know about local scope etc? |
| 11:29 | borkdude | Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/tools/logging__init.class or clojure/tools/logging.clj on classpath |
| 11:29 | supersym | its a dependency grapher,... uses tools.namespace |
| 11:30 | borkdude | supersym I get the above error |
| 11:30 | supersym | "tools that show you a graph of dependencies between namespaces then" not the first part about restricting access |
| 11:30 | borkdude | supersym dependency graphing is good enough for me now |
| 11:30 | supersym | borkdude: ensure you have that dependency |
| 11:31 | supersym | lein compile && export CLASSPATH=`lein classpath` |
| 11:31 | supersym | also always check `lein deps :tree` to see if there are conflicting dependencies |
| 11:31 | supersym | and.... you must have graphviz installed of course |
| 11:31 | supersym | it uses dot notation to generate these |
| 11:32 | supersym | a bit like they do here https://gist.github.com/w01fe/4958807 |
| 11:34 | borkdude | supersym should't a leiningen plugin declare its own dependencies? |
| 11:35 | ambrosebs | supersym: I meant how does it work out function dependencies? After a quick look, it seems it's very rough. |
| 11:35 | ambrosebs | which I guess is fine for exploratory stuff. |
| 11:38 | borkdude | supersym I installed graphviz and included the dep |
| 11:38 | borkdude | supersym now it spit out a deps.dot - how can I view it? |
| 11:40 | gfredericks | dot -Tsvg -o deps.svg deps.dot |
| 11:40 | gfredericks | I think |
| 11:41 | borkdude | gfredericks great, thanks |
| 11:42 | supersym | borkdude: sorry, you are correct |
| 11:43 | supersym | ambrosebs: oh it isn't a sophisticated tool |
| 11:43 | ambrosebs | supersym: no. |
| 11:43 | ambrosebs | supersym: couldn't tell from the readme |
| 11:44 | supersym | takes only used fns in a given function |
| 11:44 | ambrosebs | supersym: I assume things like locals aliasing vars confuse it? |
| 11:45 | ambrosebs | shadowing rather |
| 11:46 | supersym | ambrosebs: I would assume so, reading strings to execute code (not that you should use anything besides edn read string, but anyway) and such aren't picked up |
| 11:47 | ambrosebs | supersym: pretty cool how small the implementation is to get most of the benefits tho. |
| 11:48 | borkdude | I get a lot of overlapping nodes, can I use a layout engine that prevents it? |
| 11:48 | supersym | I agree... its nice for those projects, especially larger ones, to gain some quick insight... I'm really a visual person so these kind of tools are useful now and then |
| 11:48 | borkdude | this is very useful for discovering functions that are actually never used :) |
| 11:48 | supersym | generating a graph of NASA WorldWind project once was fun |
| 11:52 | borkdude | supersym is is possible to create a graph at the namespace level instead of function level? I think that would be also useful to get a larger overview |
| 11:52 | borkdude | supersym now I get a giant graph with a lot of overlapping nodes |
| 12:06 | borkdude | supersym are you the author of this plugin? |
| 12:07 | borkdude | supersym I see a commit on july 24 that the tools.logging dep is removed, but the plugin still installs 0.1.0-SNAPSHOT as a dep, this is where it goes wrong I thikn |
| 12:33 | supersym | borkdude: no I am not |
| 12:33 | supersym | last time I used it, things looked fine |
| 12:34 | borkdude | probably before june 24 |
| 12:40 | supersym | haha... let me take a look, I've got some time now |
| 12:44 | seangrove | dnolen: Nevermind with that code, there was some temporary cache issues. Still have the problem, but tracking it down |
| 12:48 | supersym | borkdude: once I added [org.clojure/tools.logging "0.2.6"], then convert the dot to svg looks good here |
| 12:48 | supersym | of course if there aren't many dependencies, the whole tree will be kind of..erh flat |
| 12:49 | borkdude | supersym yes, it does here too |
| 12:49 | borkdude | supersym but I've got a lot of deps between a lot of functions |
| 12:49 | borkdude | supersym I got the plugin working, but it should be fixed I mean |
| 12:50 | supersym | yeah.. I get you... I'll see if I can do a pull request |
| 12:52 | borkdude | supersym I can do it myself later |
| 13:15 | supersym | yeah I'm trying to track where that logging dependency is coming from |
| 13:15 | supersym | also getting warnings from lacij... dependency version ranges... thats a bit lazy |
| 13:16 | supersym | for the rest that project looks quite nice https://github.com/pallix/lacij |
| 13:16 | borkdude | I have made a comment in one of the commits about it |
| 13:17 | dbasch | question: I'm using seq-utils/separate from clojure-contrib. Does anyone know if this has been moved to a modular library? |
| 13:19 | supersym | dbasch: not from what I can see |
| 13:22 | dbasch_ | don't know if someone responded, my connection died after I asked the question |
| 13:33 | supersym | dbasch: not from what I can see |
| 13:33 | supersym | erh let me clarify that... the function is still there |
| 13:33 | supersym | nothing has moved |
| 13:41 | dbasch | thanks supersym |
| 13:54 | timgluz | Hello, does someone knows how to cancel cursor timeout for monger? I need to run long task, but after 30min, it raises exception. |
| 13:56 | timgluz | ps: what do you think about this page? http://www.versioneye.com/clojure |
| 14:04 | SegFaultAX | So... if anyone was wondering: https://gist.github.com/SegFaultAX/6563909 |
| 14:17 | supersym | timgluz: that should be possible http://api.mongodb.org/java/current/com/mongodb/DBCursor.html#setOptions(int |
| 14:18 | supersym | disable shouldn't be a problem, custom timeout isnt possible with java driver so it seems |
| 14:18 | timgluz | yes, monger.collection/find returns raw dbCursor |
| 14:20 | supersym | yeah so you are looking for this one, addOption QUERYOPTION_NOTIMEOUT |
| 14:21 | gdev | SegFaultAX, that's beautiful |
| 14:30 | gdev | I must dissect this class and study it AddressVerificationTaxProcessorTaxCalculator |
| 14:32 | arohner | brew update: |
| 14:32 | arohner | ==> Deleted Formulae |
| 14:32 | arohner | clojure |
| 14:32 | arohner | finally! |
| 14:33 | andyfingerhut | Would they accept a formula that simply had a note on the recommended way to install it? |
| 14:33 | arohner | idk. but getting them to believe that no, really, clojure shouldn't be packaged was quite uphill |
| 14:34 | timgluz | (let [db-cur (coll/find "products" the-criteria)] |
| 14:34 | timgluz | (.setOptions db-cur Bytes/QUERYOPTION_NOTIMEOUT) |
| 14:34 | timgluz | (map #(from-db-object %1 true) db-cur)) |
| 14:34 | timgluz | thanks, @supersym. i got it work: |
| 14:34 | timgluz | and now works as well find-maps, but without timeout |
| 14:37 | supersym | nice :) |
| 14:39 | tupi | hello. this (.setBatchMode true) gives me an error: No matching field found: setBatchMode for class java.lang.Boolean, any idea? |
| 14:41 | timgluz | tupi, are you missing object? |
| 14:41 | tupi | don't know :) [i am a novice in clojure, java and imagej :)] |
| 14:42 | gdev | tupi, you're calling setBatchMode on true |
| 14:42 | timgluz | :D well, i'm newbie too, but you're missing smt, because Boolean object doesnt have such a method |
| 14:43 | tupi | in the script i posted yesterday, http://paste.lisp.org/display/138930#2 which works fine, i am trying _not_ to get any display from IJ/run commands, such as (IJ/run imp "Measure" "") |
| 14:43 | tupi | so far i can not find how to tell imagej not to display anything [it defaults to display its ResultsTable, it appers |
| 14:51 | tupi | here is a new paste: I mistakenly inverted the values of conv2 in the text of the paste. but why are these values different? is my first version, (let [[perimc conv2] badly formed ? http://paste.lisp.org/display/138930#3 |
| 15:10 | gdev | tupi, first extract your arity checking |
| 15:15 | tupi | gdev: sorry, i don't understand |
| 15:17 | gdev | tupi, (let [args *command-line-args* its-length (count args)] (if (= its-length 3) ... si begging for a refactor |
| 15:19 | gdev | tupi, if you're only expecting 3 arguments you could simply write (defn foo [d-name f-name f-ext] .. |
| 15:20 | gdev | tupi, then you wouldn't have to do arity checking yourself |
| 15:23 | tupi | gdev: let's forget the command lne arg treatment for now, indeed the caller of these scripts will be a scheme process which will do the arg treatment jobs.. I am concerned by my conv2 different values ... |
| 15:25 | tupi | all i can think of the cause of the problem is, maybe, destructuring is done in // as opposed to a let binding computation |
| 15:27 | tupi | then in my code, the first call to (.getValue results "Perim." i), in the (do ...) form, uses the freshly computed value, whereas the second 'destructuring' value, (/ (.getValue results "Perim." i) (nth perim i)) actually uses the 'old' value |
| 15:30 | joef_ | tupi, the two versions are different |
| 15:31 | joef_ | the `(let [[perimc conv2] …` looks suspicious since the `for` is probably not returning two values |
| 15:31 | tupi | joef_: it is returning 2 values |
| 15:32 | joef_ | obj-nb = 2? |
| 15:32 | tupi | no |
| 15:33 | joef_ | the `for` will return `obj-nb` values |
| 15:33 | tupi | joef_: no. it will return 2 sequences of obj-nb values |
| 15:35 | tupi | oh, i think i undertand, let me try somthing and bb |
| 15:38 | tupi | yes of course, my newbee mistake |
| 15:40 | tupi | (let [[perimc conv2] … actually returned obj-nb tuples of 2 values: of course it needs an (apply map list ... to 'extract' the 2 sequences i want ... |
| 15:45 | hexacode | anyone know of any really good hardware accelerated audio synthesizers...preferably gpu based not fpga but fpga isnt out of the question completely |
| 15:47 | tupi | as i did ask, here is the answer, it might help others ... |
| 15:47 | tupi | http://paste.lisp.org/display/138930#4 |
| 15:51 | tupi | now i still have to undertand how _not_ to get any unwanted diplay on the outputport, but this is an imagej problem of course, not clojure related one ... |
| 16:16 | arrdem | anyone have a good Google Analytics alternative? |
| 16:17 | SegFaultAX | arrdem: For what? |
| 16:29 | SegFaultAX | gdev: Oh no... what have I done? https://gist.github.com/SegFaultAX/6563909 |
| 16:32 | arrdem | SegFaultAX: just basic traffic logging for a blog |
| 16:39 | mtp | do your webserver access logs not suffice? |
| 16:39 | mtp | analog/goaccess/write-your-own-log-parser |
| 16:39 | mtp | "log to a database and analyze that" |
| 16:40 | mtp | nginx definitely does logging |
| 16:46 | callen | SegFaultAX: trollan. lol. |
| 16:47 | callen | arrdem: why isn't google analytics good enough? |
| 16:47 | callen | arrdem: alternately: https://heapanalytics.com/ |
| 16:48 | callen | you don't *really* want to implement your own analyt----oh damn. |
| 16:50 | arrdem | callen: nerd sniped :D |
| 16:50 | callen | arrdem: yeah dude. you just gifted me my ClojureCup entry. |
| 16:51 | arrdem | callen: lol I'll be happy to see it |
| 16:51 | callen | arrdem: but in the meantime, raw logs, google analytics, heap analytics. the reason for using the latter two is that they gather and sift through a lot of client-centric information raw logs don't generally impart. |
| 16:51 | gdev | SegFaultAX, what *have* you done? 0_o |
| 16:51 | callen | gdev: trolled Twitter. |
| 16:52 | callen | gdev: Halloway did the same recently. re: Spock Framework |
| 16:52 | callen | I have to go now sadly, but thanks arrdem for the project idea. |
| 16:52 | gdev | callen, you will be missed ;,( |
| 16:52 | callen | gdev: well hopefully the nice young lady I am meeting for coffee doesn't kill me and use my organs for parts, so I'll be back eventually :P |
| 16:53 | arrdem | callen: as long as she sends us the brain... |
| 16:54 | gfredericks | b |
| 16:54 | gdev | callen, http://xkcd.com/306/ |
| 16:55 | gdev | callen, remember the key to conversation is constructive criticism |
| 16:55 | arrdem | lazybot: ping |
| 16:55 | lazybot | arrdem: Ping completed in 0 seconds. |
| 16:55 | arrdem | clojurebot: ping |
| 16:55 | clojurebot | PONG! |
| 16:55 | arrdem | (inc gdev) |
| 16:55 | lazybot | ⇒ 2 |
| 16:57 | jave | I'd like to add some clojure parts to an existing java web app. I think the clojure part can be mostly standalone. any hints how to do this? |
| 17:01 | gdev | jave, services |
| 17:02 | gdev | jave, your java web app could send things to a queue that your clojure service is listening to, process it, and send it back to a queue that your java app is listening to |
| 17:17 | kaw | Hey, I'm trying to use Clojurescript and domina, and getting a TypeError in the generated Javascript when trying to use by-class in domina 1.0.0: http://hastebin.com/panucorude.avrasm |
| 17:18 | kaw | Anyone have any idea what might cause that? Is it a bug in domina or could it be something in the way I'm including it? |
| 17:19 | kaw | Also, the problem is fixed if I replace "domina.domina" with "domina" in the generated code.. assuming this is a bug in domina, is there an easy way to get that patch into my cljsbuild workflow as a workaround? |
| 17:21 | arrdem | hyPiRion: is there an official clojurebot/lazybot api? |
| 17:21 | Raynes | …api? |
| 17:22 | arrdem | Raynes: looking for a way to access $karma without building my own IRC bot :P |
| 17:22 | Raynes | I see. |
| 17:22 | Raynes | There is no API for that sort of thing. |
| 17:22 | arrdem | mmkay. |
| 17:25 | jacobsen_ | rkneufeld: wondering if you have 120 seconds to chat about GUI recipes for Clojure Cookbook |
| 17:27 | jave | gdev: thats a thought, thanks |
| 17:43 | dobry-den | Does anyone know the key shortcut in emacs that toggles evil-mode to emacs mode (the <E> appears on the buffer bar)? i press it once a day by accident and only know how to return to evil by doing M-x evil-mode twice |
| 17:47 | dobry-den | Oh, found out about `C-h l` (show key press history). Apparently accidental press of C-z has been ruining my life for months now |
| 17:53 | akurilin | Is it a poor habit to expect the test profile to be enabled in leiningen when running tests? I'm trying to figure out if I should not rely on profiles to disable nrepl, modify logging etc. |
| 18:01 | arrdem | Raynes: thanks for refheap.el! |
| 18:10 | Raynes | arrdem: You're welcome! |
| 18:14 | arrdem | Raynes: can I update an existing paste? |
| 18:14 | arrdem | that looks like a no... |
| 18:15 | Raynes | arrdem: On the website, yes. You can edit it. However, you need to have an account setup with refheap.el to edit a paste created with it, otherwise it won't know who created the paste. Anonymous users can edit their pastes, but a cookie is used to determine who owns those pastes and that cookie doesn't exist when the anonymous paste is created via refheap.el |
| 18:15 | arrdem | Raynes: Ok. Couldn't you setq the refheap URL after a successful paste and have subsequent pastes edit? |
| 18:16 | arrdem | Raynes: I'd totally PR this behavior in if there's support on your end for it. |
| 18:16 | squidz | dobry-den: try doing M-x evil-normal-state to get it back to where it was |
| 18:16 | arrdem | Raynes: assuming that the username and token are set.. |
| 18:17 | Raynes | arrdem: There is a refheap API call to edit a paste. I'd happily take a pull request to add this functionality in refheap.el. |
| 18:17 | clojurebot | 'Sea, mhuise. |
| 18:18 | arrdem | Raynes: awesome. I know what I'm doing tonight. |
| 18:30 | arrdem | $karma gdev |
| 18:30 | lazybot | gdev has karma 2. |
| 18:30 | arrdem | $karma arrdem |
| 18:30 | lazybot | arrdem has karma 5. |
| 18:31 | gdev | you win this time arrdem D= |
| 18:42 | dark_element | does clojurescript "0.0-1878" breaks core.async "0.1.222.0-83d0c2-alpha" ? |
| 18:44 | jplur | This is a pretty vague question, but would core.logic be a good choice for compiling 'human' CSS from html DOM that only has inline styles? |
| 18:48 | s4muel | jplur: You might be better off using something like Raynes' laser for html manip tasks. |
| 18:48 | s4muel | jplur: But that is a pretty vague question. |
| 18:48 | supersym | yup |
| 18:48 | supersym | he did say so tho :) |
| 18:49 | s4muel | jplur: I'm assuming you would need to walk the dom, collect all the styles, and then... oh, gross. I just thought about how you are going to have to 'collapse' all that stuff |
| 18:49 | supersym | jplur: would this help? http://extractcss.com/ |
| 18:49 | jplur | s4muel yeah sorry, I'm not worried about parsing and navigating the tree, just figuring out how to work with something that has infinite solutions, where I kind of know what is 'elegant' |
| 18:50 | supersym | yeah you generally don't want to think about these tasks :P |
| 18:50 | supersym | even worse: use regex to do it :) |
| 18:52 | lgs32a | does anybody know where there is no such thing as last-nth? |
| 18:53 | s4muel | jplur: there was another lib just released for constraints programming that might be a good fit, check the ML |
| 18:53 | dcunit3d | is there a good way to debug with the ritz repl on `lein test` |
| 18:54 | danielszmulewicz | lgs32a: last? |
| 18:54 | s4muel | lgs32a: you mean like nth, but counting from the last item in the seq? |
| 18:57 | lgs32a | yes |
| 18:58 | lgs32a | like take-last but for a single elem |
| 18:58 | danielszmulewicz | there is `last`, neto |
| 18:58 | danielszmulewicz | there is first and last |
| 18:58 | lgs32a | yes but there is no last-nth |
| 18:58 | danielszmulewicz | lgs32a: ah, got you |
| 18:59 | dcunit3d | there is nthrest |
| 18:59 | dcunit3d | and take-last |
| 19:00 | lgs32a | ah |
| 19:01 | s4muel | lgs32a: if you can reverse the sequence generation and take things from the front in a lazy way that's probably better |
| 19:01 | lgs32a | yes i know |
| 19:01 | jplur | s4muel: thanks, looks like I'll have to do some research. I think I'm trying to solve 'who is the grandmother of x' type problems with a weighted preference instead of a boolean, some of the constraint stuff looks usefull as well. |
| 19:02 | danielszmulewicz | is there anybody that has worked with liberator? I've got an issue with setting the session. |
| 19:02 | lgs32a | i just thought it would not be bad to have last-nth in the language |
| 19:03 | lgs32a | its basically (comp first take-last) if one imagines indices starting at 1 |
| 19:08 | arityfn | Where is the abs function in clojure? |
| 19:08 | lgs32a | Math/abs |
| 19:09 | arityfn | ugh, about 15mins wasted. |
| 19:09 | lgs32a | written your own :P? |
| 19:10 | arityfn | I should have done since the start. |
| 19:58 | dnolen | lgs32a: peek works for vectors |
| 19:59 | mercwithamouth | does anyone have the clojure in action meap? |
| 20:00 | lgs32a | dnolen: thx |
| 20:00 | lgs32a | dnolen: but how can i access the nth with peek? |
| 20:01 | dnolen | lgs32a: oh, sorry misread you don't want the last element? |
| 20:01 | lgs32a | nah the nth last element |
| 20:01 | dnolen | lgs32a: oh you want nth from the last element like negative indices in Python? |
| 20:01 | lgs32a | like (= (last-nth 2 [1 2 3]) 1) |
| 20:01 | lgs32a | maybe i don't know python |
| 20:01 | dnolen | lgs32a: ok yeah doesn't exist |
| 20:02 | lgs32a | I'd be curious how a got implementation would look like |
| 20:03 | coventry` | For a clojure jar built from source, do I need to tell it or lein anything special in order to point it at jsr166y? The jar for it is not on my classpath in a "lein repl", though the reducers tests run fine in the clojure source dir. |
| 20:05 | TEttinger | ,(let [last-nth (fn [coll n] (nth coll (- (count coll) n)))] (= (last-nth [1 2 3] 2) 1)) |
| 20:05 | clojurebot | false |
| 20:05 | TEttinger | damn |
| 20:06 | TEttinger | ,(let [last-nth (fn [coll n] (nth coll (- (count coll) n 1)))] (= (last-nth [1 2 3] 2) 1)) |
| 20:06 | clojurebot | true |
| 20:06 | TEttinger | there you go |
| 20:06 | lgs32a | yeah |
| 20:06 | TEttinger | it will not work for lazy seqs |
| 20:06 | TEttinger | well infinite ones at least |
| 20:06 | lgs32a | thats what i thought |
| 20:06 | lgs32a | using count is fine? |
| 20:06 | TEttinger | count is fine for finite ones :D |
| 20:07 | TEttinger | ,(count (repeat 0)) |
| 20:07 | lgs32a | he will never return :) |
| 20:07 | clojurebot | Execution Timed Out |
| 20:07 | TEttinger | this will probably timeout yep |
| 20:08 | amalloy | TEttinger: the function is impossible to write for lazy seqs anyway...? |
| 20:08 | TEttinger | but since last-nth has undefined behavior for infinite seqs... yeah |
| 20:09 | TEttinger | amalloy, but it works for lazy seqs |
| 20:09 | amalloy | oh, i meant infinite there |
| 20:09 | TEttinger | ,(let [last-nth (fn [coll n] (nth coll (- (count coll) n 1)))] (= (last-nth (map inc (range 3)) 2) 1)) ;;actually I should check |
| 20:09 | clojurebot | true |
| 20:09 | amalloy | anyway, rather than counting i think you'd be much better off using take-last, or reusing its implementation strategy |
| 20:10 | TEttinger | really? |
| 20:10 | TEttinger | this seems like a very small implementation |
| 20:12 | TEttinger | http://clojuredocs.org/clojure_core/clojure.core/take-last#source uses loop/recur, which seems less than optimal |
| 20:12 | lgs32a | the implementation of take-last seems kinda insane to me |
| 20:13 | TEttinger | amalloy, what's the strength in that implementation? |
| 20:14 | coventry` | Using count holds onto the head. |
| 20:15 | lgs32a | ah |
| 20:15 | coventry` | I committed some travesties trying to implement lazy sequences with core.async last night, but I learned a few things about lazy sequences. :-) |
| 20:16 | TEttinger | I'm actually not sure what holds onto the head means |
| 20:16 | coventry` | TEttinger: After the (count), the entire sequence needs to be in memory, and the sequence may be too long for that. take-last does not need to hold the whole thing in memory. |
| 20:17 | TEttinger | ah. |
| 20:17 | TEttinger | would .length work ? |
| 20:17 | TEttinger | ,(let [last-nth (fn [coll n] (nth coll (- (.length coll) n 1)))] (= (last-nth (map inc (range 3)) 2) 1)) |
| 20:17 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: length for class clojure.lang.LazySeq> |
| 20:17 | lgs32a | it does not exist for lists |
| 20:17 | TEttinger | oh getLength |
| 20:18 | coventry` | TEttinger: I don't see how you could get the length without evaluating the whole thing. |
| 20:18 | TEttinger | right lazyseqs aren't all in memory |
| 20:18 | TEttinger | they're instructions right? how to get the next element, like an iterator? |
| 20:18 | lgs32a | but why would count keep the head? after all its just counting, right? |
| 20:19 | coventry` | lgs32a: I assume count works by iterating over the list. Then, you need to keep it around to return the tail after that. |
| 20:19 | TEttinger | http://clojuredocs.org/clojure_core/clojure.core/count#source count actually isn't implemented in clojure |
| 20:20 | lgs32a | i will now look in RT source code |
| 20:21 | lgs32a | count is implemented via interface for each sequence type |
| 20:21 | coventry` | lgs32a: but for persistent collections, the relevant line is "return i + s.count();", i.e., it's doing the count by recursing over the entire collection. |
| 20:22 | lgs32a | where is that line |
| 20:22 | coventry` | in countFrom, which is called from count. |
| 20:23 | lgs32a | ah |
| 20:24 | TEttinger | uh is github down again? |
| 20:24 | TEttinger | it's observing yom kippur apparently |
| 20:24 | lgs32a | i wonder why they did not implement the Count interface for persistent structurs |
| 20:26 | lgs32a | coventry`: but i don't see recursion |
| 20:26 | lgs32a | the for loop simply invokes s.next(); |
| 20:27 | coventry` | You're right. Plus, I was wrong about it being the relevant code. I think the relevant count method is actually in LazySeq.java, where it does just iterate over the sequence (public int count). |
| 20:27 | lgs32a | doesn't s=s.next() overwrite the current head |
| 20:27 | lgs32a | yea |
| 20:29 | coventry` | What I thought was recursion in RT/countFrom was the "s.count" in "return i + s.count()", but I am not sure what that method is for anymore. |
| 20:30 | lgs32a | nah its just if the tail-sequence suddenly implements Counted , its count is added to what has been counted |
| 20:30 | lgs32a | i think that could happen if you concat two seqs |
| 20:30 | lgs32a | because that returns a new lazy-seq |
| 20:31 | lgs32a | has anyone managed to run clojurec btw? |
| 20:40 | TEttinger | lgs32a, what's clojurec? |
| 20:41 | lgs32a | its an implentation of clojure on top of c if i am taken right |
| 20:41 | lgs32a | https://github.com/schani/clojurec |
| 20:42 | lgs32a | but whenever i tried to run the tests, i got different error message hash-maps |
| 20:42 | lgs32a | i also tried various things to get that bdw-gc right |
| 20:51 | coventry` | Hmm, if you define multimethods twice, you get screwed up dispatch. Why is that? https://www.refheap.com/18677 |
| 20:52 | lgs32a | coventry`: multi-methods check whether the var has been bound to a multimethod already |
| 20:53 | lgs32a | ah no i mixed sth. up |
| 20:53 | coventry` | Should have posted the test as well. Edited the past. |
| 20:53 | coventry` | paste. :-) |
| 20:54 | coventry` | The (thrown?) test passes on the first run, but there's no IllegalArgumentException on the second run. |
| 20:54 | lgs32a | i supposed its related to that root-binding thing anyway |
| 20:54 | lgs32a | suppose |
| 20:59 | lgs32a | no i can't find any real explanation |
| 21:18 | cjfrisz | dnolen: I think I've got a protocol-related CLJS compiler bug for you |
| 21:19 | cjfrisz | I rolled back to 1859 and the bug went away |
| 21:19 | cjfrisz | Of course, I rolled back about 3 hours ago, but wasn't careful enough about files getting recompiled, so I still thought the bug was my fault |
| 21:23 | dcunit3d | what repl would you all recommend for emacs? |
| 21:24 | dcunit3d | i'm using nrepl/ritz, but running into issues where java hangs and i have to close emacs. |
| 21:24 | dcunit3d | should i try slime/swank (& ritz?) |
| 21:24 | coventry` | I use the regular nrepl. (C-c M-j or nrepl-jack-in from your project files). |
| 21:25 | dcunit3d | also, when i `nrepl-jack-in`, none of my files are loaded. is there a way to set that up so they load automatically. i'm running jack-in from my project.clj file. |
| 21:37 | cjfrisz | dnolen: disregard possible bug until further notice; just when I thought I'd isolated it, it seemed to go away in 1877 |
| 22:48 | dcb | Is it possible to have a macro output multiple forms? e.g. (my-macro) -> (+ 1 1) (+ 2 2), or do you have to wrap the forms in a do? |
| 22:56 | lgs32a | you can output multiple forms |
| 22:57 | sontek | Have you guys played with aleph at all? Seems like its an alternative to http-kit? |
| 23:01 | dcb | lgs32a: do you have an example? Maybe a macro that outputs "(+ 1 1) (+ 2 2)"? I can't figure out how to do it, my best attempt is (defmacro my-macro [] `(+ 1 1) `(+ 2 2)), but that only outputs (+ 2 2) |
| 23:04 | lgs32a | hmz |
| 23:04 | lgs32a | dcb: i was wrong, only the last-form is evaluated |
| 23:05 | lgs32a | expanded |
| 23:05 | dcb | lgs32a: ok thanks. do it is |
| 23:09 | dissipate_ | how easy is it to pick up clojurescript once you have learned clojure? |
| 23:11 | callen | dissipate_: about as easy as it is to learn Clojure and JavaScript |
| 23:55 | nybbles | hi! has anyone ever set up a browser repl as described in https://github.com/cemerick/piggieback#browser-repl such that /repl is just another endpoint in your application server? |
| 23:55 | nybbles | i.e. whatever other routes i made as part of my app, such as /user/ would still work.. |