#clojure logs

2013-09-14

00:02coventry`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:03coventry`Implementing it was a great exercise for learning core.async, though. :-)
01:51s4muelyyyyyyyyyykkj======================]==]]]]]]]]]]]]]]]]]]]]]]]]pppppppppppppppppppppppp000000000000000000000000000000000000000000000000000000000000
01:51s4muel0]]]]]]]]]
01:51s4muel00000000000]]]]]]]]]]]]]]]i
01:52s4muel7777711111111ewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwjjjju
01:52s4muel0]]]]]]]]]
01:53s4muel3333-......H
01:53s4muelSo in other news, I am fostering kittens for a bit
01:53s4muelSorry about that.
01:59seancorfields4muel: mine do that sometimes if i leave the keyboard accessible when i leave the room!
02:05SegFaultAXs4muel: That made it go from annoying to awesome! :)
02:07callens4muel: way to make your foibles adorable.
02:09s4muelI don't know if this is adorable or malevolence, though: http://i.imgur.com/vSwRSkD.jpg
02:10SegFaultAXs4muel: whynotboth.jpg
02:10s4muelTrue.
02:11callens4muel: zomg kitty
02:11s4muelI know, I know. cats and the internet -- ehrmagerd!
02:11callenkilling me man. I'm trying to be srsface and get some work done
02:11callenbut noooooo, there's kitties afoot. No work getting done now.
02:12s4muelI can't even show you the picture of how one is sleeping on my magic trackpad
02:13wei_s4muel: very cute
02:18callens4muel: my head is going to asplode.
02:18callens4muel: you'll be responsible for the death of a Clojure programmer. If head sploding must happen, do it in #php yeesh.
02:18s4muelcallen: what work? http://i.imgur.com/35Atdfo.jpg
02:19s4muelaaaand I'm done.
02:19callenI just physically leaned back in my couch and silently laughed from the cute
02:25seancorfieldcallen: this should completely put paid to any work then... http://bangles.com/kittens/cute.html
02:30callen*_*
02:31callenhrm. that moment when you realize there are PRs for what you were working on already.
02:45callenoh oh, I get it. It's "chunk all the things!" weekend.
02:47uvtcHow 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:48andyfingerhut(clojure.java.io/reader url) returns a reader you can pass to many other functions
02:50uvtcHi 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:52uvtcI'm getting java.net.URL cannot be cast to java.io.File, or java.io.BufferedReader...
02:52s4mueluvtc: try (slurp (io/resource "foo"))
02:52andyfingerhutDid you try (line-seq (io/reader (io/resource "stuff.txt"))) ?
02:52uvtcs4muel, oooh, that works. Thanks.
02:53uvtcandyfingerhut, Ah. No, didn't try that one. Thanks for the pointer.
02:55s4muelTIL slurp works on URLs too (thanks, guns!)
02:57uvtcandyfingerhut, Ok. Thanks. `(let [lines (line-seq (io/reader (io/resource "stuff.txt")))] ...)` works. :)
02:57callenimport com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl.factories.EnterpriseGradeFizzBuzzSolutionStrategyFactory;
02:57andyfingerhutGood. That was from memory, so hoping I didn't lead you astray
02:58andyfingerhutcallen: That is some serious enterprise-y naming
02:58andyfingerhutWhere should I send the purchase order? :)
02:59callenandyfingerhut: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/tree/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage
03:00seancorfieldhmm, unfortunately this import is real: (import (com.iesnare.www.dra.api.CheckTransactionDetails
03:00seancorfield CheckTransactionDetailsResponseDetailsDetail
03:00seancorfield holders.CheckTransactionDetailsResponseDetailsHolder))
03:00uvtcThis is serious and no-nonsense.
03:01callen#ReasonsIamGladToWriteClojureAndNotJava
03:01andyfingerhutDepartmentOfRedundancyDepartment
03:01uvtcBrushing 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:03andyfingerhutI'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:04andyfingerhutperhaps :resource-paths See sample.project.clj in the Leiningen docs
03:04uvtcThis is probably a silly terminology question, but do you think .properties files are "resources"?
03:05callenuvtc: many things are resorces.
03:05callenresources*
03:05andyfingerhutAd regarding the bug, don't use non-ASCII characters in your file names :)
03:06wei_seancorfield: what's a DetailsResponseDetailsDetail?
03:06seancorfieldit's from Iovation's fraud analysis SOAP WSDL
03:06uvtcandyfingerhut, 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:07uvtccallen, right (images, for example). Thanks.
03:08andyfingerhutI 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:10rurumateandyfingerhut: 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:10uvtcandyfingerhut, 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:11uvtcandyfingerhut, thanks for the help. :)
03:11andyfingerhutrurumate: 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:12rurumateandyfingerhut: just in case it doesn't work one day
03:22Aciohad a question, solved it meself, yay
03:26rurumateandyfingerhut: sorry it's C-c C-k to load the file, not C-c k
03:28rurumateAcio: care to share the question, and the solution?
03:29Aciorurumate: just newbie, couldn't find out how to convert fraction to a decimal, and now i found with-precision and bigdec
03:29noto2also, ##(* 1/7 1.0)
03:29lazybot⇒ 0.1428571428571429
03:30rurumateAcio: there is also (float 3/4)
03:30rurumateand (double 3/4)
03:30noto2but yeah, bigdec will be more precise
03:31Aciooh wow, not sure why thsoe didn't occur to em
03:31Aciothanks!
03:31TEttingerif you're adding lots of weird little decimal numbers like ##(apply + (repeat 10 0.1))
03:31lazybot⇒ 0.9999999999999999
03:31TEttingerthen you would prefer bigdec
03:34Aciothanks!
03:46rhgI think 99% of mindprod.com/jgloss/unmain.html is impossible in clojure lol
03:48callenrhg: is that a challenge?
03:49callenrhg: I have macros man. I make nightma^H^H^H^H^Hdreams happen.
03:49rhgPlz no
03:49callenwat r u doin...is that macro generating a class factory? HOOMAN. STAHP.
03:49rhgFor all that's good. Plz no
03:51rhgI fporgot about macros powerz
03:52callenthey all forget, until they see some Lisp necromancer's attempt at recreating the universe in his own image.
03:52rhgId like to see it, then burn it and bury it 500ft underground
03:53rhgNice laugh
03:55rhgI'm having to write c++, it doesn't need more obfuscation
03:56callenmy 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:56callenthen join the Basque freedom fighters, get them to switch to my cause
03:57rhgGl.....
03:57callenand use my terrorist allies to kidnap Alexandrescu, and force him to read the C++ code
03:58NSAPrismBotcallen: What?
03:58rhgI find c++ to be chore because I don't enjoy it
04:00TEttinger`seen callen
04:01rhgSo, what's the worst macro you've seen?
04:02llasramTEttinger: #clojure/seen callen
04:02TEttingerllasram, wondering what the char was to issue a command to lazybot
04:02llasram$seen TEttinger
04:03lazybotTEttinger was last seen talking on #clojure 12 seconds and 479 milliseconds ago.
04:03callen$seen callen
04:03lazybotcallen was last seen talking on #clojure 63 milliseconds ago.
04:03TEttingerhm
04:03callendo ho ho. clever.
04:03TEttingerit doesn't have what you said?
04:03callenI was expecting it to miss my request.
04:03TEttingerI must have added that
04:09amalloyincidentally, 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:16rhgCallen, I challenge to write clojure so bad it makes grown men cry
04:17callenrhg: I'd rather write Clojure so bad that it makes the Clojure Cup judges cry.
04:18rhgK
04:19rhgIdk how hard that is tho
04:20rhgA mutable var loop?
04:21s4mueluse java collections directly
04:21rhgOh
04:21rhgFugly.
04:21s4muelall of a sudden, everything's mutable! But then again, that's not really clojure, that's just parens around java :)
04:22callens4muel: then write macro shims for mutable uses of java collections.
04:22s4muelthat shadow core functions
04:22TEttingeruse OpenCAL or some other obscure language's data from clojure
04:22s4muelwrite a protocol that reflects the properties of every object created then throw them away
04:23rhg0.o
04:23s4muelthere's opportunities for badness everywhere, but you just have to go so far far out of your way
04:23TEttingerJNI. anything in JNI
04:25rhgIk there's worst...
04:26s4mueluse java.io.shell to write your actual code out to strings of a php file and run it
04:26s4muelthat's the king
04:26rurumatein 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:27rhgPerl.
04:27rurumatefor example, what would the "sv" of (filter' #(= 9999 %) (range)) be?
04:28rhg?
04:28rhgOh
04:28rhgJava
04:28rurumate(first (first (filter' #(= 9999 %) (range)))) will call LazySeq.seq(), which runs a loop checking "((LazySeq) ls).sval() instanceof LazySeq" repeatedly
04:29rurumate..which is why that expression doesn't blow the stack (it runs a while loop that is implemented in java, in LazySeq.first()
04:30rurumate..unfortunately, and for obvious reasons, it doesn't work that way in clojurescript (there is no underlying jvm)
04:31rurumate..and the stack fills up
04:33rhgS4muel, I wonder about clojure not PHP; bad PHP is easy
04:36s4muelrhg: 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:36rhgAgreed
04:37s4muelrurumate: that's an interesting problem. You would think that nested lazy-seqs made it in. maybe you found a bug?
04:38rhgBad clojure without interop or macros is improbable
04:39callenrhg: I can prove that wrong in a single github link :)
04:40rhgRly?
04:40rhg0.0
04:40rurumates4muel: yes I think it's a bug in clojurescript, it's documented here: http://dev.clojure.org/jira/browse/CLJS-587
04:41rurumateanyway gotta run, hope someone can fix this
04:41clojurebotTitim gan éirí ort.
04:44rhgL8r folks
04:52borkdudeIf Java is also coffee, what is Clojure?
07:16klokbaskeSo, functional reactive programming vs csp (eg core.async). What's the difference?
07:17klokbaskeI'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:19pyrtsaklokbaske: 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:20pyrtsaWhich, at least in my opinion, makes CSP much more imperative than FRP.
07:26klokbaskepyrtsa: can you elaborate on how the channels are more visible than streams? I'm not sure I follow ...
07:28pyrtsaklokbaske: When you're using core.async, you explicitly `put!` values into a given channel. In FRP, less so.
07:31pyrtsaIn 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:31klokbaskepyrtsa: ok, i see what you mean with imperative then.
07:32pyrtsaIn FRP, you're mostly using stream combinators, i.e. your code contains zero onNext's, onError's or onCompleted's.
07:38klokbaskepyrtsa: 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:41pyrtsaHmm, there's so little material about core.async out there yet.
07:41G0SUBpyrtsa: you can always read the code :)
07:41pyrtsaG0SUB: Yeah, I was about to suggest that to klokbaske. :)
07:42pyrtsaklokbaske: Have you understood what core.async does behind the scenes? E.g. what happens when a value is put into a channel.
07:43pyrtsaIn other words, what the fuss with goroutines is.
07:44G0SUBpyrtsa, 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:46pyrtsaYes, that's a good one.
07:46klokbaskepyrtsa: no, it's still pretty much a blackbox for me.
07:46pyrtsaklokbaske: How about coroutines in general?
07:46klokbaskeG0SUB: i'll look into that one.
07:47klokbaskeI think I'll have to brush up on coroutines as well. Didn't know they where related to csp
07:48pyrtsaklokbaske: The above link should open it up a bit.
07:49klokbaskeGreat! Thanks a lot for the pointers. I'll see if I can wrap my head around it :-)
08:15squidzi'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:20squidzthat is within the hiccup-like syntax
08:48seangrovesquidz: haven't used dommy yet, how do you like it?
08:50squidzit 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:01clj_newb_2345i 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:01clj_newb_2345why is that emacs must be built on top of mutable cons cells rather than persistent data structures?
09:01clj_newb_2345woe woe woe to the software of the world
09:09supersymprobably has to do with emacs being ancient :P
09:10supersymtbh I don't use emacs at all, learning curve would not be worth it atm I feel
09:11clj_newb_2345emacs is fucking awesome
09:13supersymoh I bet...and I can see why people here prefer it over vim(L)
09:15supersymbut currently I feel I get less annoyed using LT over emacs (with the keybindings, new extensions, new concepts etc)
09:15seangroveWhat's the version of google-closure-library I should be using with the latest version of clojurescript?
09:18supersymseangrove: https://github.com/clojure/clojurescript/blob/master/project.clj
09:18supersymisn't that what you are looking for? its a dependency anyway
09:23seangrovesupersym: That looks hopeful, thanks
09:24seangroveLooks like that might have done it, thanks again supersym
09:25supersymyw
10:21seangrovednolen: 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:21seangroveThis 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:40si14guys, do you have any idea why there is such a huge performance hit in the second case? https://gist.github.com/si14/737920b513fb8ccae152
10:41si14the only difference to me is that one value should be passed through iterations
10:41si14I can't see how this can make 4x difference in this case.
11:22borkdudeAre 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:22ambrosebsborkdude: I don't think so.
11:23borkdudemaybe not a runtime, static check would be ok
11:24borkdudemaybe a tool that shows who is calling a specific function then, yes, rgrep
11:24borkdudetools that show you a graph of dependencies between namespaces then?
11:25ambrosebsborkdude: fwiw jvm.tools.analyzer provides a fully expanded AST to harvest var occurrences.
11:25ambrosebsborkdude: tools.namespaces then provides ns dep info.
11:25borkdudeambrosebs I'll take a look at it
11:26supersymborkdude: https://github.com/Hendekagon/lein-clique
11:26borkdudesupersym cool thanks
11:27ambrosebssupersym: how does it work?
11:28ambrosebssupersym: does it know about local scope etc?
11:29borkdudeException in thread "main" java.io.FileNotFoundException: Could not locate clojure/tools/logging__init.class or clojure/tools/logging.clj on classpath
11:29supersymits a dependency grapher,... uses tools.namespace
11:30borkdudesupersym I get the above error
11:30supersym"tools that show you a graph of dependencies between namespaces then" not the first part about restricting access
11:30borkdudesupersym dependency graphing is good enough for me now
11:30supersymborkdude: ensure you have that dependency
11:31supersymlein compile && export CLASSPATH=`lein classpath`
11:31supersymalso always check `lein deps :tree` to see if there are conflicting dependencies
11:31supersymand.... you must have graphviz installed of course
11:31supersymit uses dot notation to generate these
11:32supersyma bit like they do here https://gist.github.com/w01fe/4958807
11:34borkdudesupersym should't a leiningen plugin declare its own dependencies?
11:35ambrosebssupersym: I meant how does it work out function dependencies? After a quick look, it seems it's very rough.
11:35ambrosebswhich I guess is fine for exploratory stuff.
11:38borkdudesupersym I installed graphviz and included the dep
11:38borkdudesupersym now it spit out a deps.dot - how can I view it?
11:40gfredericksdot -Tsvg -o deps.svg deps.dot
11:40gfredericksI think
11:41borkdudegfredericks great, thanks
11:42supersymborkdude: sorry, you are correct
11:43supersymambrosebs: oh it isn't a sophisticated tool
11:43ambrosebssupersym: no.
11:43ambrosebssupersym: couldn't tell from the readme
11:44supersymtakes only used fns in a given function
11:44ambrosebssupersym: I assume things like locals aliasing vars confuse it?
11:45ambrosebsshadowing rather
11:46supersymambrosebs: 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:47ambrosebssupersym: pretty cool how small the implementation is to get most of the benefits tho.
11:48borkdudeI get a lot of overlapping nodes, can I use a layout engine that prevents it?
11:48supersymI 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:48borkdudethis is very useful for discovering functions that are actually never used :)
11:48supersymgenerating a graph of NASA WorldWind project once was fun
11:52borkdudesupersym 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:52borkdudesupersym now I get a giant graph with a lot of overlapping nodes
12:06borkdudesupersym are you the author of this plugin?
12:07borkdudesupersym 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:33supersymborkdude: no I am not
12:33supersymlast time I used it, things looked fine
12:34borkdudeprobably before june 24
12:40supersymhaha... let me take a look, I've got some time now
12:44seangrovednolen: Nevermind with that code, there was some temporary cache issues. Still have the problem, but tracking it down
12:48supersymborkdude: once I added [org.clojure/tools.logging "0.2.6"], then convert the dot to svg looks good here
12:48supersymof course if there aren't many dependencies, the whole tree will be kind of..erh flat
12:49borkdudesupersym yes, it does here too
12:49borkdudesupersym but I've got a lot of deps between a lot of functions
12:49borkdudesupersym I got the plugin working, but it should be fixed I mean
12:50supersymyeah.. I get you... I'll see if I can do a pull request
12:52borkdudesupersym I can do it myself later
13:15supersymyeah I'm trying to track where that logging dependency is coming from
13:15supersymalso getting warnings from lacij... dependency version ranges... thats a bit lazy
13:16supersymfor the rest that project looks quite nice https://github.com/pallix/lacij
13:16borkdudeI have made a comment in one of the commits about it
13:17dbaschquestion: I'm using seq-utils/separate from clojure-contrib. Does anyone know if this has been moved to a modular library?
13:19supersymdbasch: not from what I can see
13:22dbasch_don't know if someone responded, my connection died after I asked the question
13:33supersymdbasch: not from what I can see
13:33supersymerh let me clarify that... the function is still there
13:33supersymnothing has moved
13:41dbaschthanks supersym
13:54timgluzHello, does someone knows how to cancel cursor timeout for monger? I need to run long task, but after 30min, it raises exception.
13:56timgluzps: what do you think about this page? http://www.versioneye.com/clojure
14:04SegFaultAXSo... if anyone was wondering: https://gist.github.com/SegFaultAX/6563909
14:17supersymtimgluz: that should be possible http://api.mongodb.org/java/current/com/mongodb/DBCursor.html#setOptions(int
14:18supersymdisable shouldn't be a problem, custom timeout isnt possible with java driver so it seems
14:18timgluzyes, monger.collection/find returns raw dbCursor
14:20supersymyeah so you are looking for this one, addOption QUERYOPTION_NOTIMEOUT
14:21gdevSegFaultAX, that's beautiful
14:30gdevI must dissect this class and study it AddressVerificationTaxProcessorTaxCalculator
14:32arohnerbrew update:
14:32arohner==> Deleted Formulae
14:32arohnerclojure
14:32arohnerfinally!
14:33andyfingerhutWould they accept a formula that simply had a note on the recommended way to install it?
14:33arohneridk. but getting them to believe that no, really, clojure shouldn't be packaged was quite uphill
14:34timgluz(let [db-cur (coll/find "products" the-criteria)]
14:34timgluz (.setOptions db-cur Bytes/QUERYOPTION_NOTIMEOUT)
14:34timgluz (map #(from-db-object %1 true) db-cur))
14:34timgluzthanks, @supersym. i got it work:
14:34timgluzand now works as well find-maps, but without timeout
14:37supersymnice :)
14:39tupihello. this (.setBatchMode true) gives me an error: No matching field found: setBatchMode for class java.lang.Boolean, any idea?
14:41timgluztupi, are you missing object?
14:41tupidon't know :) [i am a novice in clojure, java and imagej :)]
14:42gdevtupi, you're calling setBatchMode on true
14:42timgluz:D well, i'm newbie too, but you're missing smt, because Boolean object doesnt have such a method
14:43tupiin 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:43tupiso far i can not find how to tell imagej not to display anything [it defaults to display its ResultsTable, it appers
14:51tupihere 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:10gdevtupi, first extract your arity checking
15:15tupigdev: sorry, i don't understand
15:17gdevtupi, (let [args *command-line-args* its-length (count args)] (if (= its-length 3) ... si begging for a refactor
15:19gdevtupi, if you're only expecting 3 arguments you could simply write (defn foo [d-name f-name f-ext] ..
15:20gdevtupi, then you wouldn't have to do arity checking yourself
15:23tupigdev: 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:25tupiall i can think of the cause of the problem is, maybe, destructuring is done in // as opposed to a let binding computation
15:27tupithen 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:30joef_tupi, the two versions are different
15:31joef_the `(let [[perimc conv2] …` looks suspicious since the `for` is probably not returning two values
15:31tupijoef_: it is returning 2 values
15:32joef_obj-nb = 2?
15:32tupino
15:33joef_the `for` will return `obj-nb` values
15:33tupijoef_: no. it will return 2 sequences of obj-nb values
15:35tupioh, i think i undertand, let me try somthing and bb
15:38tupiyes of course, my newbee mistake
15:40tupi(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:45hexacodeanyone know of any really good hardware accelerated audio synthesizers...preferably gpu based not fpga but fpga isnt out of the question completely
15:47tupias i did ask, here is the answer, it might help others ...
15:47tupihttp://paste.lisp.org/display/138930#4
15:51tupinow 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:16arrdemanyone have a good Google Analytics alternative?
16:17SegFaultAXarrdem: For what?
16:29SegFaultAXgdev: Oh no... what have I done? https://gist.github.com/SegFaultAX/6563909
16:32arrdemSegFaultAX: just basic traffic logging for a blog
16:39mtpdo your webserver access logs not suffice?
16:39mtpanalog/goaccess/write-your-own-log-parser
16:39mtp"log to a database and analyze that"
16:40mtpnginx definitely does logging
16:46callenSegFaultAX: trollan. lol.
16:47callenarrdem: why isn't google analytics good enough?
16:47callenarrdem: alternately: https://heapanalytics.com/
16:48callenyou don't *really* want to implement your own analyt----oh damn.
16:50arrdemcallen: nerd sniped :D
16:50callenarrdem: yeah dude. you just gifted me my ClojureCup entry.
16:51arrdemcallen: lol I'll be happy to see it
16:51callenarrdem: 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:51gdevSegFaultAX, what *have* you done? 0_o
16:51callengdev: trolled Twitter.
16:52callengdev: Halloway did the same recently. re: Spock Framework
16:52callenI have to go now sadly, but thanks arrdem for the project idea.
16:52gdevcallen, you will be missed ;,(
16:52callengdev: 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:53arrdemcallen: as long as she sends us the brain...
16:54gfredericksb
16:54gdevcallen, http://xkcd.com/306/
16:55gdevcallen, remember the key to conversation is constructive criticism
16:55arrdemlazybot: ping
16:55lazybotarrdem: Ping completed in 0 seconds.
16:55arrdemclojurebot: ping
16:55clojurebotPONG!
16:55arrdem(inc gdev)
16:55lazybot⇒ 2
16:57javeI'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:01gdevjave, services
17:02gdevjave, 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:17kawHey, 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:18kawAnyone 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:19kawAlso, 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:21arrdemhyPiRion: is there an official clojurebot/lazybot api?
17:21Raynes…api?
17:22arrdemRaynes: looking for a way to access $karma without building my own IRC bot :P
17:22RaynesI see.
17:22RaynesThere is no API for that sort of thing.
17:22arrdemmmkay.
17:25jacobsen_rkneufeld: wondering if you have 120 seconds to chat about GUI recipes for Clojure Cookbook
17:27javegdev: thats a thought, thanks
17:43dobry-denDoes 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:47dobry-denOh, 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:53akurilin 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:01arrdemRaynes: thanks for refheap.el!
18:10Raynesarrdem: You're welcome!
18:14arrdemRaynes: can I update an existing paste?
18:14arrdemthat looks like a no...
18:15Raynesarrdem: 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:15arrdemRaynes: Ok. Couldn't you setq the refheap URL after a successful paste and have subsequent pastes edit?
18:16arrdemRaynes: I'd totally PR this behavior in if there's support on your end for it.
18:16squidzdobry-den: try doing M-x evil-normal-state to get it back to where it was
18:16arrdemRaynes: assuming that the username and token are set..
18:17Raynesarrdem: 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:17clojurebot'Sea, mhuise.
18:18arrdemRaynes: awesome. I know what I'm doing tonight.
18:30arrdem$karma gdev
18:30lazybotgdev has karma 2.
18:30arrdem$karma arrdem
18:30lazybotarrdem has karma 5.
18:31gdevyou win this time arrdem D=
18:42dark_elementdoes clojurescript "0.0-1878" breaks core.async "0.1.222.0-83d0c2-alpha" ?
18:44jplurThis 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:48s4mueljplur: You might be better off using something like Raynes' laser for html manip tasks.
18:48s4mueljplur: But that is a pretty vague question.
18:48supersymyup
18:48supersymhe did say so tho :)
18:49s4mueljplur: 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:49supersymjplur: would this help? http://extractcss.com/
18:49jplurs4muel 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:50supersymyeah you generally don't want to think about these tasks :P
18:50supersymeven worse: use regex to do it :)
18:52lgs32adoes anybody know where there is no such thing as last-nth?
18:53s4mueljplur: there was another lib just released for constraints programming that might be a good fit, check the ML
18:53dcunit3dis there a good way to debug with the ritz repl on `lein test`
18:54danielszmulewiczlgs32a: last?
18:54s4muellgs32a: you mean like nth, but counting from the last item in the seq?
18:57lgs32ayes
18:58lgs32alike take-last but for a single elem
18:58danielszmulewiczthere is `last`, neto
18:58danielszmulewiczthere is first and last
18:58lgs32ayes but there is no last-nth
18:58danielszmulewiczlgs32a: ah, got you
18:59dcunit3dthere is nthrest
18:59dcunit3dand take-last
19:00lgs32aah
19:01s4muellgs32a: if you can reverse the sequence generation and take things from the front in a lazy way that's probably better
19:01lgs32ayes i know
19:01jplurs4muel: 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:02danielszmulewiczis there anybody that has worked with liberator? I've got an issue with setting the session.
19:02lgs32ai just thought it would not be bad to have last-nth in the language
19:03lgs32aits basically (comp first take-last) if one imagines indices starting at 1
19:08arityfnWhere is the abs function in clojure?
19:08lgs32aMath/abs
19:09arityfnugh, about 15mins wasted.
19:09lgs32awritten your own :P?
19:10arityfnI should have done since the start.
19:58dnolenlgs32a: peek works for vectors
19:59mercwithamouthdoes anyone have the clojure in action meap?
20:00lgs32adnolen: thx
20:00lgs32adnolen: but how can i access the nth with peek?
20:01dnolenlgs32a: oh, sorry misread you don't want the last element?
20:01lgs32anah the nth last element
20:01dnolenlgs32a: oh you want nth from the last element like negative indices in Python?
20:01lgs32alike (= (last-nth 2 [1 2 3]) 1)
20:01lgs32amaybe i don't know python
20:01dnolenlgs32a: ok yeah doesn't exist
20:02lgs32aI'd be curious how a got implementation would look like
20:03coventry`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:05TEttinger,(let [last-nth (fn [coll n] (nth coll (- (count coll) n)))] (= (last-nth [1 2 3] 2) 1))
20:05clojurebotfalse
20:05TEttingerdamn
20:06TEttinger,(let [last-nth (fn [coll n] (nth coll (- (count coll) n 1)))] (= (last-nth [1 2 3] 2) 1))
20:06clojurebottrue
20:06TEttingerthere you go
20:06lgs32ayeah
20:06TEttingerit will not work for lazy seqs
20:06TEttingerwell infinite ones at least
20:06lgs32athats what i thought
20:06lgs32ausing count is fine?
20:06TEttingercount is fine for finite ones :D
20:07TEttinger,(count (repeat 0))
20:07lgs32ahe will never return :)
20:07clojurebotExecution Timed Out
20:07TEttingerthis will probably timeout yep
20:08amalloyTEttinger: the function is impossible to write for lazy seqs anyway...?
20:08TEttingerbut since last-nth has undefined behavior for infinite seqs... yeah
20:09TEttingeramalloy, but it works for lazy seqs
20:09amalloyoh, i meant infinite there
20:09TEttinger,(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:09clojurebottrue
20:09amalloyanyway, rather than counting i think you'd be much better off using take-last, or reusing its implementation strategy
20:10TEttingerreally?
20:10TEttingerthis seems like a very small implementation
20:12TEttingerhttp://clojuredocs.org/clojure_core/clojure.core/take-last#source uses loop/recur, which seems less than optimal
20:12lgs32athe implementation of take-last seems kinda insane to me
20:13TEttingeramalloy, what's the strength in that implementation?
20:14coventry`Using count holds onto the head.
20:15lgs32aah
20:15coventry`I committed some travesties trying to implement lazy sequences with core.async last night, but I learned a few things about lazy sequences. :-)
20:16TEttingerI'm actually not sure what holds onto the head means
20:16coventry`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:17TEttingerah.
20:17TEttingerwould .length work ?
20:17TEttinger,(let [last-nth (fn [coll n] (nth coll (- (.length coll) n 1)))] (= (last-nth (map inc (range 3)) 2) 1))
20:17clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: length for class clojure.lang.LazySeq>
20:17lgs32ait does not exist for lists
20:17TEttingeroh getLength
20:18coventry`TEttinger: I don't see how you could get the length without evaluating the whole thing.
20:18TEttingerright lazyseqs aren't all in memory
20:18TEttingerthey're instructions right? how to get the next element, like an iterator?
20:18lgs32abut why would count keep the head? after all its just counting, right?
20:19coventry`lgs32a: I assume count works by iterating over the list. Then, you need to keep it around to return the tail after that.
20:19TEttingerhttp://clojuredocs.org/clojure_core/clojure.core/count#source count actually isn't implemented in clojure
20:20lgs32ai will now look in RT source code
20:21lgs32acount is implemented via interface for each sequence type
20:21coventry`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:22lgs32awhere is that line
20:22coventry`in countFrom, which is called from count.
20:23lgs32aah
20:24TEttingeruh is github down again?
20:24TEttingerit's observing yom kippur apparently
20:24lgs32ai wonder why they did not implement the Count interface for persistent structurs
20:26lgs32acoventry`: but i don't see recursion
20:26lgs32athe for loop simply invokes s.next();
20:27coventry`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:27lgs32adoesn't s=s.next() overwrite the current head
20:27lgs32ayea
20:29coventry`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:30lgs32anah its just if the tail-sequence suddenly implements Counted , its count is added to what has been counted
20:30lgs32ai think that could happen if you concat two seqs
20:30lgs32abecause that returns a new lazy-seq
20:31lgs32ahas anyone managed to run clojurec btw?
20:40TEttingerlgs32a, what's clojurec?
20:41lgs32aits an implentation of clojure on top of c if i am taken right
20:41lgs32ahttps://github.com/schani/clojurec
20:42lgs32abut whenever i tried to run the tests, i got different error message hash-maps
20:42lgs32ai also tried various things to get that bdw-gc right
20:51coventry`Hmm, if you define multimethods twice, you get screwed up dispatch. Why is that? https://www.refheap.com/18677
20:52lgs32acoventry`: multi-methods check whether the var has been bound to a multimethod already
20:53lgs32aah no i mixed sth. up
20:53coventry`Should have posted the test as well. Edited the past.
20:53coventry`paste. :-)
20:54coventry`The (thrown?) test passes on the first run, but there's no IllegalArgumentException on the second run.
20:54lgs32ai supposed its related to that root-binding thing anyway
20:54lgs32asuppose
20:59lgs32ano i can't find any real explanation
21:18cjfriszdnolen: I think I've got a protocol-related CLJS compiler bug for you
21:19cjfriszI rolled back to 1859 and the bug went away
21:19cjfriszOf 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:23dcunit3dwhat repl would you all recommend for emacs?
21:24dcunit3di'm using nrepl/ritz, but running into issues where java hangs and i have to close emacs.
21:24dcunit3dshould i try slime/swank (& ritz?)
21:24coventry`I use the regular nrepl. (C-c M-j or nrepl-jack-in from your project files).
21:25dcunit3dalso, 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:37cjfriszdnolen: disregard possible bug until further notice; just when I thought I'd isolated it, it seemed to go away in 1877
22:48dcbIs 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:56lgs32ayou can output multiple forms
22:57sontekHave you guys played with aleph at all? Seems like its an alternative to http-kit?
23:01dcblgs32a: 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:04lgs32ahmz
23:04lgs32adcb: i was wrong, only the last-form is evaluated
23:05lgs32aexpanded
23:05dcblgs32a: ok thanks. do it is
23:09dissipate_how easy is it to pick up clojurescript once you have learned clojure?
23:11callendissipate_: about as easy as it is to learn Clojure and JavaScript
23:55nybbleshi! 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:55nybblesi.e. whatever other routes i made as part of my app, such as /user/ would still work..