#clojure logs

2015-06-02

00:15dumptruckmanhmm
00:19dumptruckmanhow about combining seqs contained in different maps under the same key?
00:19currentoorhas anyone here used lobos for migrations?
00:21dumptruckmanlike a merge-with but only for a specific key
04:49olliveraHim how can I get the component name from the structure below?
04:49ollivera{"id" : "1", "versions" : [ { "news" : [ {"id" : 3, "parameters" : { "component" : "myNameHere" } }]}]}
04:51SagiCZ,(-> {"id" : "1", "versions" : [ { "news" : [ {"id" : 3, "parameters" : { "component" : "myNameHere" } }]}]} "versions" first "news" first "parameters" "component")
04:51clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
04:51mnngfltgHelp! When I type in "(str (java.util.Locale/getDefault))" in a pristine `lein repl`, I get "en_MT"
04:52mnngfltgI'm not in Malta though. Does anyone see the same?
04:52mnngfltg,(str (java.util.Locale/getDefault))
04:52clojurebot"en_US"
04:52SagiCZollivera: what kind of structure is it? is that string?
04:53SagiCZmnngfltg: i think this is taken from JVM properties
04:53mnngfltgI tried this: -Duser.language=de -Duser.country=DE (or en resp. US)
04:53olliveraSagiCZ: (get-in page-name [:versions 1 :news 1 :parameters :component]) works ... but I specified the indexes (1) ... it should be able to find all ocorrences in the nested arrays
04:54mnngfltgbut it doesn't help (I used the :jvm-opts key in project.clj)
04:56kwladykai am writing short article to help people choose template library for web. Answer for this question will help me be more objective: Who use Enlive? Why you use Enlive instead Selmer?
05:01olliveraSagiCZ: what I want to do is walk thought all versions and news, not only the first. My example only had one to simplify the structure
05:01SagiCZthis just isnt a valid clojure map {"id" : "1", "versions" : [ { "news" : [ {"id" : 3, "parameters" : { "component" : "myNameHere" } }]}]} .. so i was asking what datatype it is
05:02oddcullysmells like json
05:02SagiCZyeah.. so if it is JSON.. get a JSON parser.. dont do it manually
05:02SagiCZI loved the Jackson library for java im sure there is something for clojure too
05:12stainmnngfltg: unix? Try running "locale" in the shell to see what your LANG is
05:12mnngfltgstain: LANG=en_US.UTF-8
05:14stainmnngfltg: hm, I get en_US if I set such a LANG with OpenJDK 1.8.0_45-internal
05:14mnngfltgstain, I now see that the strange behavior disappears when I get rid of my ~/.lein/profiles.clj
05:14stainmnngfltg: I guess you'll just have to pack up and move to Malta! I think it's actually quite nice there.. :)
05:15mnngfltgstain, I'd love to, believe me :)
05:19mnngfltgWow! If I add [cider/cider-nrepl "0.9.0-SNAPSHOT"] to an empty profiles.clj, it relocates me to Malta.
05:23mbufare there any performance benchmarks available for Clojure?
05:24mnngfltgmbuf, compare to other languages you mean?
05:24mbufmnngfltg, yes, I have seen the alioth one already
05:24mbufmnngfltg, at least with C
05:25mnngfltgmbuf, well it compiles to java bytecode, so it could be similar to java in the best case
05:25mbufmnngfltg, I see
05:26SagiCZit is quite a bit slower than java in most cases
05:26SagiCZsince you've got immutable collections
05:27mbufSagiCZ, I see
05:28SagiCZbut then again you could design your application in a more efficient way with functional programming.. using lazy sequences and all that.. so in the end it could actually be faster then traditional java design
05:28stainit is like comparing apples and oranges
05:28stainexactly.. you should not compare how fast you can iterate over a billion integers
05:28mbufSagiCZ, stain I get the picture
05:29stainhowever those kind of algorithms can be made insanely fast also with clojure and the odd type hint
05:30stainbuilding with immutable datastructures also makes it so much easier to parallelize a clojure app, while in Java you have to go through everything like a tax inspector to see where it could fall over
05:31SagiCZstain, to be honest, its not as easy as slapping pmap wherever you have a map.. you do have to think about it a bit
05:31mbufokay
05:32mnngfltgmbuf, I'd say it's fast enough for many things, and you can always drop down to java for your inner loops if you wish
05:32mbufmnngfltg, okay
05:33SagiCZand Java is fast enough for anything apart from games and HFT
05:33stainSagiCZ: of course, unless you have one of those "embarassingly parallelizable" problems it still requires planning. What I mean is that you will more easily have put in the foundations in order to do so anyway if you do it the Clojure way
05:33SagiCZstain: agreed
05:33stainbut with Java 8 you are also getting that with Streams
05:33stainwhich I found accidentally breaks lots of the classic coding patterns
05:33mnngfltgthere are also many optimizations you can do with Clojure -- transients, memoization, type hints, ..., and you can add them when you notice performance problems
05:33SagiCZJava 8 made me really rethink if I need clojure at all and I am still not sure.. I love Java 8
05:34SagiCZstreams, lambdas, filters.. just fantastic additions IMO
05:35staine.g. trying to populate a classical Hashmap from Stream.forEach gave me randomly missing elements as I forgot that Hashmap was not threadsafe and that I was actually using threads under the hood
05:35stainyeah, I think it's a great way forward.. and it's a paradigm shift for javacoders as finally you are "allowed" to write 'just functions' again
05:35stainI can see why they took so long
05:36stainas in Java 8 it's quite a substantial change all over
05:36SagiCZto me the new stuff seemed very polished, useful and intuitive
05:36stainexactly.. it is not just thrown together like "Oh, we need lambdas, right"
05:37stainhere's the longest Stream call I've written so far: https://github.com/apache/incubator-commonsrdf/blob/master/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java#L281
05:37stainit does get a bit weird.. but if you read it with Clojure eyes it's quite understandable
05:37stainbut of course the casting comes in there to ruing everything :)
05:39SagiCZi think the code is pretty readable.. also you can always split .. and you can define your lambdas as variables to name them (self-doc) and later combine them etc
05:39SagiCZi do this with filter lambdas that I use more than once in a class
05:40stainexactly, just introducing some names.. like in Java's lambda you have to give a name to the lambda parameters, but don't need to say their type. That is quite neat, and also has a nice step-up from the for-each syntax.
05:41TEttingerSagiCZ, java's fast enough for many games too, since everything just calls into OpenGL anyway
05:42TEttingerand since games are typically long-running, JIT can kick in
05:42SagiCZTEttinger: I know.. just didnt want to complicate the argument
05:42wasamasathe question is of course whether the programmer will not screw up when making the game :P
05:43TEttingeryeah, I think the main issue with java is that you don't know if end users have a JVM anymore. stuff like Packr helps with that
05:43wasamasaso far I've seen only one that didn't go all bonkers, nullpomino
05:43oddcullywasamasa: s/game/program/ fixed it
05:43wasamasaand ran wonderfully on a netbook
05:44SagiCZTEttinger: I wished Microsoft packed JVM to regular Windows updates as is done with .NET framework
05:44SagiCZs/wished/wish
05:44stainwhat I have not tried yet in Java 8 is to try to make my own functional interfaces outside Streams. That is still just flows much more naturally in Clojure, while in Java 8 you have to think a bit about it (and be inspired by Stream) to do it right, and not just build a light-weight Inversion of Control pattern
05:44TEttingerSagiCZ, you don't even know if the end users have windows update
05:44TEttingersome people running win7 have windows update permanently turned off (pirates, probably)
05:45stainI've used install4j which bundles whatever JDK you want for any OS
05:45TEttingeryeah, I use Packr for the same thing
05:45TEttingeryou don't need a mac to make a mac app, etc.
05:45SagiCZTEttinger: Well you don't even know if the end users have a computer.. what kind of argument is that?
05:46TEttingerstain and I are talking about bundling the VM with the app
05:46TEttingerwhich works pretty wel
05:46TEttingerl
05:46TEttingerit's better when the VM is tiny, like for Lua
05:46oddcullyTEttinger: libgdx packr?
05:46TEttingeryes
05:46oddcullythis working well?
05:46clojurebotTitim gan éirí ort.
05:46TEttingerI made lein-packr too
05:46TEttingertry it out maybe?
05:47TEttingerhttps://github.com/tommyettinger/lein-packr
05:47TEttingerlein-packr only works for 32-bit windows, 64-bit linux, and 64-bit mac
05:47oddcullyi fooled around with libgdx and groovy some time ago. and i came by that, as i thought halfway (?) is using it
05:47stainTEttinger: ah, good to know I am not the only one relying on alexkasko's OpenJDK builds :)
05:48TEttingerstain: I'd encourage switching to Zulu soon
05:48TEttingermore recent packr works with linux 32 bit as well, but breaks the passing of VM args to clojure and scala apps
05:48TEttingerwhich is weird
05:49TEttingerif you do lein uberjar, and try to run the jar the way packr 1.3 does, it will always fail
05:49wasamasahotspot, why do you keep gobbling my RAM
05:49stainTEttinger: ok, well, in fact we have to switch to Oracle JRE for some strange reason.. as our project moved to Apache Software Foundation which don't like GPL
05:49stainbut commercial stuff is OK
05:49TEttingerbut if you use packr 1.1 like I do, it works fine
05:49TEttingerzulu isn't actually commercial, but they have a commercial product too
05:50TEttingerhttp://www.azulsystems.com/products/zulu/downloads
05:53stainTEttinger: thanks for the links, I see they have docker images as well, which I appreciate
05:54TEttingercool!
06:31SagiCZ,(require '[clojure.core.async :refer [<!! chan merge]])
06:31clojurebot#error {\n :cause "Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath."\n :via\n [{:type java.io.FileNotFoundException\n :message "Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath."\n :at [clojure.lang.RT load "RT.java" 449]}]\n :trace\n [[clojure.lang.RT load "RT.java" 449]\n [clojure.lang.RT load "RT.java" 412]\n [cl...
09:53J_ArcaneThis might be helpful to someone as dense as me: https://github.com/jarcane/multipage-reagent
10:10istateyea.. true.. css alwas gets so messykkkllkkkjjjkkkkkkjclo
10:58fourqDoes Clojure/conj have a location yet or still TBD? (Nashville please)
11:37damian_Hello. Is anyone familiar with using hiphip library?
11:39damian_I'm trying to use dot-product function (https://gist.githubusercontent.com/w01fe/5963993/raw/hiphip_dot_product.clj)
11:41damian_Yet input: (dbl/dot-product (1 2) (1 2)) gives me error: ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn
11:41oddcullydamian_: this would call 1 as fn
11:42oddcullydamian_: '(1 2)
11:43damian_Oh, typo. I've already tried [1 2], '(1 2) and (1 2). Everything with the same effect
11:45damian_=> (dbl/dot-product '(1 2) '(1 2)) ClassCastException clojure.lang.PersistentList cannot be cast to [D
11:47oddcullybut that's a different error
11:47oddcullyhave you tried http://conj.io/store/v1/org.clojure/clojure/1.7.0-alpha4/clj/clojure.core/double-array/
11:47thomlawrenceseems from the docs that hiphip works with arrays
11:47oddcully, (.getClass (double-array 1))
11:47clojurebot[D
11:47oddcullyerm
11:49gfredericksis there a thing for clojure.test that runs tests as files change?
11:50thomlawrencehttps://github.com/jakepearson/quickie works pretty nicely
11:50justin_smithgfredericks: I know there is a lein plugin for that
11:51thomlawrencealso if you're in emacs it's reasonably easy to have a hook that runs tests in your REPL when you save
11:51damian_Ok, works like thaht:
11:51damian_=> (dbl/dot-product (double-array '(1 2)) (double-array '(2 3))) 8.0
11:52damian_Many thanks
11:52oddcullyyw
11:54gfredericksthomlawrence: yeah emacs works fine, this is for non-emacs :)
11:54gfredericksthomlawrence: quickie looks good, thanks!
12:21arav93Hi, how does is-tc-e and is-tc-err work?
12:22arav93If there is anyone who is familiar with it, please help me out!
12:22arav93:)
12:25justin_smitharav93: do you want to know how it is implemented or how to use it? the implementation seems simple enough https://crossclj.info/ns/org.clojure/core.typed/0.3.0-alpha4/clojure.core.typed.test.test-utils.html#_is-tc-e
12:26arav93I want to know how it is used justin_smith
12:27justin_smitharav93: it's meant to be called in a deftest, using clojure.test
12:27justin_smithas a replacement for clojure.test/is
12:28arav93Oh ok
12:28justin_smitharav93: sadly I can't point to a good example - the reason that's a crossclj.info link is I intended to point out how some project was using it in their tests, but no project followed by crossclj.info is using it
12:29arav93It's ok, thanks for your help anyways justin_smith :)
12:29justin_smithI should qualify what I said a bit - it isn't a general replacement for test/is - it's a variant that simply tests if something is properly / improperly typed
12:43ShayanjmI'm trying to export a large list of maps to csv. Here's what i've got so far: https://gist.github.com/shayanjm/5cc95e71a3f3492084e6
12:43Shayanjmin the CSV, however, it looks like the vector elements are getting quoted unnecessarily
12:44Shayanjmany idea how I can prevent that from happening? I'm using clojure.data.csv but couldn't find any documentation re: using the quote? predicate
12:45justin_smithShayanjm: csv doesn't do trees, so the compromise there is to represent the nested collection as a single string
12:46Shayanjmjustin_smith: sure - but the inner elements are also getting double quoted, is this the expected behavior?
12:46justin_smithShayanjm: one alternative would be to make a line in a separate csv for each vector, with a linked unique id
12:46justin_smithShayanjm: that's the only way to represent something inside a string that should itself be a string
12:46ShayanjmRight, didn't think that one through
12:47Shayanjmis there a way to change the quote delimiter?
12:47Shayanjmi.e use single quote vs double for clarity?
14:25andyf_gfredericks: seventy-one. So ... much ... pull request ... discussion ....
14:26andyf_Is this performance art?
14:27chouserspontaneous performance art? Like a drum ciricle?
14:30andyf_Shoot, now I'm actually going to spend a few minutes wondering what kind of pull request to submit to that repo.
14:34gfredericks(inc andyf_) ;; for contributing to open source
14:35gfredericksandyf_: I mentioned earlier that I'd accept (defn seventy-one? [x] (= x seventy-one)) and don't think anybody's bothered yet
14:39SagiCZi was thinking of adding some id to my entity objects .. (they are just maps) .. is there some mechanism in clojure core for generating random ids? i dont need zillions of them so UUID seems like an overkill
14:40gfredericks&(gensym) like this?
14:40SagiCZsomething like {:name "Jack" :id "#6421" :age 45}
14:40gfrederickswhar ar the bots!!
14:40SagiCZ,(gensym)
14:40clojurebotG__27
14:40SagiCZum.. that sounds like something you would use in a macro..
14:41andyf_This #clojure channel log hasn't been appended to in a couple of days, probably because the bot that does it is down: http://logs.lazybot.org/irc.freenode.net/%23clojure
14:41tbaldrid_I often do this:
14:41tbaldrid_,(do (let [a (atom 0)] (defn make-id [] (swap! a inc))) (make-id))
14:41clojurebot1
14:42gfredericks,(defn make-id (partial swap! (atom 0) inc))
14:42clojurebot#error {\n :cause "Parameter declaration \"partial\" should be a vector"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: Parameter declaration \"partial\" should be a vector, compiling:(NO_SOURCE_FILE:0:0)"\n :at [clojure.lang.Compiler macroexpand1 "Compiler.java" 6644]}\n {:type java.lang.IllegalArgumentException\n :message "Paramete...
14:42SagiCZtbaldrid_: I see. thats something I would do too.. I was just wondering if there is some mechanism already bundled with clojure
14:42gfredericks,(def make-id (partial swap! (atom 0) inc))
14:42clojurebot#'sandbox/make-id
14:42tbaldrid_although you did say "random IDs" so I'm not sure what you mean by that
14:42gfredericks,(make-id)
14:42clojurebot1
14:42tbaldrid_ooooh partial, I like it
14:42SagiCZtbaldrid_: something like UUID generator returns.. they are not sequential
14:43amalloydangit i restarted lazybot recently, andyf_. why is he dead again. i blame you
14:44tbaldrid_SagiCZ: what do you need the randomness for?
14:44puredangerfourq: re your question about the conj, no location yet but unlikely to be Nashville :)
14:44andyf_amalloy: I must have killed it at least once some time, so accepted.
14:44SagiCZtbaldrid_: I guess I don't really need it to be random.. just thought it would look better.. but as I think about it the generator would more efficient if it just inc'ed
14:45amalloyanyway he's back
14:45chouserNashville would be fun. Or New York City, if you think they can handle the extra traffic the Conj would create.
14:45fourqpuredanger =)
14:46fourqNashville is having CodeConf here this year
14:51SagiCZgfredericks: why did you use partial when you dont want to add any more arguments later when calling the make-id?
14:52amalloySagiCZ: to close over (atom 0) instead of recreating it each time the function is called
14:54SagiCZthanks
14:55SagiCZso I could create the same thing like this?
14:55SagiCZ(def make-id (let [a (atom 0)] (fn [] (swap! a inc))))
14:55amalloySagiCZ: that is exactly the thing tbaldrid_ described, before gfredericks proposed the partial version as an improvement
14:56amalloypersonally i like the partial version less
14:56tbaldridgepartial and comp make everything better ;)
14:56SagiCZyeah I was just trying to rewrite it into something I understand
14:56SagiCZi didnt know partial creates closure like this
14:57amalloySagiCZ: it just follows naturally from the fact that partial is a function
14:57tbaldridgeSagiCZ: the source of partial is pretty simple: https://github.com/clojure/clojure/blob/clojure-1.6.0/src/clj/clojure/core.clj#L2460
14:57amalloy(partial (atom 0) ...) must evaluate (atom 0) exactly once, before even calling partial
14:58amalloyand then the value of that (which is an atom) is used thereafter, rather than the expression being re-evaluated each time
14:58SagiCZi understand
14:58SagiCZthanks
15:08SagiCZhow could I drain a core async channel? I know "into" but it waits until the chan closes
15:08tbaldridgeas in take as many things as you can, but don't wait for closing?
15:08SagiCZyep
15:09tbaldridgeput async/poll! in a loop
15:09tbaldridgebut that's only in the SNAPSHOT versions of core-async
15:09SagiCZyeah i dont have poll
15:09SagiCZnevermind
15:09tbaldridgeyou can also use (alts! [c] :default nil)
15:09SagiCZcan i just put <!! in a loop?
15:09tbaldridgethat'll block when you take the last item
15:10SagiCZi see
15:11SagiCZwhat does "alt" mean? alternative?
15:13tbaldridgeSagiCZ: if you do this: (alts! [c1 c2]) it will take one value from one channel, or the other, but not both
15:13tbaldridgeSo it's a `select` if you're familiar with async io in C
15:13_alejandroSagiCZ: it's like a select (lets you receive a value among multiple channels); I imagine it is named after alternative
15:14tbaldridge(alts! [c] :default nil) says "take a value from c, but if there isn't one available, return nil instead)
15:14tbaldridgeso that will either return [c val] or [:default nil] to let you know what happened.
15:14SagiCZtbaldridge: well thats handy!
15:15SagiCZi want to use channels for the event flow in my application.. just dont know how to avoid "over"using them.. is there anything channels are particulary bad at?
15:17tbaldridgeyeah, they aren't exactly super fast. Not slow mind you, but there's a few locks inside of them. So don't send super small messages super fast.
15:17tbaldridgeBut besides that, not really.
15:17_alejandroSagiCZ: I think there's some overhead to each channel, so depending on your performance needs it could be an issue
15:17stuartsierraDon't mix channel operations with computation or side effects. Try to keep them separate.
15:18tbaldridgeAlso, try to keep you go blocks and channels alive. Don't create whole graphs just to throw them away.
15:18_alejandroSagiCZ: I think you can reduce that overhead via transducers (assuming the operations happening between channels are cheap)
15:18tbaldridgeIf you can create a static graph and flow data through it, perfect!
15:18_alejandrotbaldridge: would you say that's true of thread blocks too?
15:18SagiCZtbaldridge: i have drawn a static graph on paper already... that will get built and initialized on start and stay that way forever
15:19SagiCZhowever I will send small messages.. up to about 5 times a second.. is that considered too fast for channels?
15:19tbaldridge_alejandro: yeah, it's pretty much true of all of core.async.
15:20tbaldridgeSagiCZ: oh no, I'm saying don't send 1million ints a second over a channel
15:20SagiCZtbaldridge: oh thats alright then!
15:20SagiCZand when I mult a channel.. do the values get physically copied? as in do they take up more space in memory?
15:20tbaldridgeSagiCZ: no, nothing is copied, so use immutable data :)
15:21SagiCZgreat
15:22SagiCZwhy do people say that channels break immutability? or do they mean that the channel itself is mutable?
15:22tbaldridgeSagiCZ: yes channels are mutable, hence the ! in <! and >!
15:22SagiCZoh.. i thought they were excited funnels
15:26m1dnight_Can I apply recur?
15:26m1dnight_It seems like I cant? OR am I mistaking?
15:27amalloym1dnight_: you can't, but you probably don't want to
15:27amalloydo you have an example where you think you want to?
15:27m1dnight_Well, i'm doing some convoluted stuff for my thesis.
15:28m1dnight_What I want to achieve is evaluate the arguments to recur, apply a function to them and then put them back to recur
15:28m1dnight_so something like (recur x y) --> (let [recurargs [x y] processed (process-args [x y])] (recur processed))
15:28amalloym1dnight_: the thing is, you always have a fixed number of arguments at a recur point, so applying a list doesn't really make a lot of sense
15:29m1dnight_I know.
15:29m1dnight_Just wondering how I could achieve something like that.
15:29amalloyyou can just write (let [[x y] (process-args [x y])] (recur x y))
15:29m1dnight_yeah but its a macro so all I have is a list
15:30m1dnight_I have a walker that handles each clause that matches (= (first form) 'recur)
15:30amalloyyou want a macro to replace the call to recur?
15:30m1dnight_yeah, I have a macro that allows the user to use recur, and inside that macro I want to process the arguments to recur.
15:30m1dnight_Not sure if im conveying what I want to achieve
15:30amalloym1dnight_: sure, so you have a list like '(recur (f x) (g y))
15:31m1dnight_derp
15:31m1dnight_why didnt I think of that lol
15:31m1dnight_oh wait.
15:31m1dnight_but suppose I have the original form (recur x y z)
15:31amalloythat's my point, that's the list you already have
15:31amalloyand it's not hard to transform that into the list '(let [[x# y#] (process [(f x) (g y)])] (recur x# y#))
15:31m1dnight_I want to pass x, y, and z as 1 parameter to a function. So I have to pass them as a list/array and I can only return a list/array.
15:32m1dnight_And then im stuck in applying recur to those arguments.
15:33amalloyi feel like you're not hearing what i'm saying. what i'm saying is, you have a list already, which has recur as its first element
15:33amalloyand you want to transform it into another list, which looks like (let [...] (recur ...))
15:33amalloylooking like the most recent snippet i posted
15:33m1dnight_ooohhhh
15:33amalloyand that is not a difficult transformation to do, so you can just do it
15:33m1dnight_right, now im getting it
15:33m1dnight_right, right, right :)
15:34m1dnight_Haha, sorry I was a bit slow on that one.
15:34m1dnight_Thanks amalloy
15:34m1dnight_(inc amalloy)
15:34lazybot⇒ 276
15:35amalloy(defmacro silly-recur [& args] (let [syms (map (fn [_] (gensym)) args)] `(let [~@syms (process [~@args])] (recur ~@syms))))
15:35amalloysomething like that, anyway. i haven't tested it, just typed it into irc
15:37amalloywhere you won't actually define silly-recur as a macro, but use that logic in whatever weird code-walker you already have
15:37m1dnight_hehe, weird indeed :)
15:37m1dnight_I think i got it working amalloy
15:37m1dnight_thanks for the patience
15:39SagiCZwhats the thing one should use when one wants to "map" over seq but ignore the result?
15:39SagiCZdoseq?
15:39clojurebotdoseq is like for, but for side effects instead of values
15:39SagiCZhaha I dont even need humans!
15:40amalloy#clojure is finally fully-automated
15:40SagiCZ:D
15:40andyf_for?
15:40clojurebotfor is awesome
15:41SagiCZvery helpful
15:41SagiCZ(inc clojurebot)
15:41lazybot⇒ 51
15:41adereth(inc clojurebot)
15:41lazybot⇒ 52
15:41andyf_I was wondering whether it would respond "for is like dose, but for values instead of side effects" :)
15:42amalloythere are a few examples of corecursion in clojurebot's factoid list, but i don't remember where they are
15:59justin_smith~corecursion
15:59clojurebotI don't understand.
15:59justin_smith~corecursion is a definition cycle
15:59clojurebotA nod, you know, is as good as a wink to a blind horse.
15:59justin_smith~definition cycle is a corecursion
15:59clojurebotA nod, you know, is as good as a wink to a blind horse.
15:59SagiCZ~SagiCZ
15:59clojurebotNo entiendo
16:00tmtwd~( + 32 32)
16:00clojurebotNo entiendo
16:01tmtwd(inc 2)
16:01lazybot⇒ 3
16:01tmtwdwhat is the whole point of ~
16:01tmtwd?
16:01SagiCZ~doseq
16:01clojurebotdoseq is like for, but for side effects instead of values
16:01SagiCZ~clojurebot
16:01justin_smithtmtwd: it invokes clojurebot's factoid functionality
16:01clojurebotclojurebot has a poetic soul
16:02justin_smithtmtwd: which is distinct from its clojure evaluation
16:02tmtwdoh
16:05tmtwdtest
16:09creeseI'm using rabbitmq and core.async. Does anyone know what this exception means? "java.lang.AssertionError: Assert failed: No more than 1024 pending puts are allowed on a single channel. Consider using a windowed buffer."
16:09creesehttps://gist.github.com/creese/7008cb444a042b894fa9 <— full stack trace
16:10tbaldridgecreese: yes
16:10tbaldridgedo you have a copy of the code?
16:10amalloyit means you are putting a zillion things into a channel and not reading them out
16:10tbaldridgeit's more nuanced than that'
16:11tbaldridgeyou have more than 1024 things parking on a channel. You can have as many things as you want in a channel as long as you give it a buffer
16:11tbaldridgeSo either you're spining up more than 1024 go blocks and they're all trying to >! onto the channel
16:11amalloytbaldridge: in that it suggests there are a zillion different go blocks also?
16:11tbaldridgeor you're using put! without respecting backpressure
16:15SagiCZcalling mult multiple times on the same channel returns different mults?
16:15creesetbaldridge: Here's a code snippet. LMK if you need more. https://gist.github.com/creese/063193bd3b6fce1ae480
16:17m1dnight_amalloy: could you have a look at my macro? Im still nog getting it right.
16:17hiredmanwhat is there to say? you are put!'ing things in to a channel as fast as you can as they come off rabbit, without waiting waiting for the consumer on the other end of the channel
16:17amalloyhiredman: better than that, there isn't even a consumer afaict
16:18creesethere is
16:18SagiCZdoes calling mult multiple times on the same channel returns different mults?
16:18hiredmancreese: so stop doing that
16:19m1dnight_I dont understand quite yet how I can expand a list that is bound to a symbol defined inside my `(..) expression
16:19creesehttps://gist.github.com/creese/063193bd3b6fce1ae480 <— I've updated this with the code for the consumer
16:19amalloym1dnight_: sure, i guess. have you tried just copying the one i gave, and fixing the [] i forgot to put in, though?
16:19tbaldridgecreese: hiredman is right. put a callback at the end of the call to put!
16:20m1dnight_yeah, well based on that one though
16:20hiredmanor use the blocking version of put
16:21tbaldridgeyeah, or that
16:21hiredman(if however whatever rabbit library you are using is ok with you blocking the handler thread)
16:21m1dnight_hld on, its rather small
16:21m1dnight_https://www.refheap.com/102029
16:21m1dnight_this is what I have so far
16:22m1dnight_And now I get the rror that long can not be cast to fn, so it's probably evaluating the res#, instead of interpreting it as a list. So all I have to do now is expand it and wrap it in a seq (to prepend to it)
16:22m1dnight_But i cant figure it out.
16:22m1dnight_Macro tutorials are not really elaborate about it either.
16:23m1dnight_brb doorbell
16:23amalloyline 10 is just total gobbledegook
16:24amalloyhonestly just replace it with something that looks exactly like the paste i gave you: (let [syms (map (fn [_] (gensym)) recur-args)] `(let [[~@syms] (process [~@recur-args])] (recur ~@syms))))
16:26m1dnight_okay ill give it a shot
16:27amalloythat is, replace lines 9 and 10 with that
16:31m1dnight_right right right right
16:32m1dnight_now I get it, the part with the gensyms is the trick i didnt get
16:32m1dnight_thanks amalloy
16:32m1dnight_(inc amalloy) and again!
16:33creesehiredman: thanks, I'll try the blocking put
16:34m1dnight_finally :) thanks man, realy
16:34m1dnight_really*
16:34tbaldridgecreese: be sure to read the specs to make sure your Rabbit library won't freak out if you block the callback thread
16:39SagiCZso this is the graph I want to build with channels https://i.imgur.com/4rSQS1d.png .. so far I have this https://www.refheap.com/102030 .. am I doing something completely wrong? I am kind of thrown off by all the options core.async has.. not sure if I should use pipes, pipelines, transducers and what-nots.. this seems to work as I expected
16:42SagiCZi have just the first two levels of course
16:42donbonifacioI have a service that boots in 5s (aot), if I add javaagent:newrelic, it takes 23s. Anywone knows if I can make this better?
16:45tbaldrid_dogonthehorizon: sounds like a question for newrelic
16:47donbonifaciotrue
16:48SagiCZ~am I here?
16:48clojurebotI don't understand.
16:48SagiCZok
17:04SeyleriusIf the listener function on a GUI button takes a bunch of GUI data, passes it through a parser and a solver, and gets a set of solutions back that I want to move around through using a slider, what's the best place to put the vector of solutions?
17:04SagiCZlocal variable?
17:05SeyleriusSagiCZ: Wouldn't that be local to the listener function?
17:05SagiCZit would
17:05SagiCZbut the computation should be on a non GUI thread anyways
17:05SeyleriusI need the button's listener function to stash the vector of solutions somewhere that the slider's listener function can get at it.
17:06SeyleriusBecause when the slider gets slid, it needs to display a different solution.
17:07SeyleriusSagiCZ: I don't want to stick it in a global...
17:07SagiCZi understand that
17:08SagiCZyou could close over the listener function though
17:08SeyleriusHmm... Since the slider doesn't appear until after the solver's done solving, the solve-button's listener function could create the slider's listener function.
17:08SeyleriusSagiCZ: Example?
17:10SagiCZwhat gui framework are you using?
17:14SeyleriusSagiCZ: Seesaw
17:14SagiCZyeah seesaw has a binding api if I recall correctly.. so maybe you could bind the solution vector to the slider?
17:17SeyleriusSagiCZ: That's gonna be a negatory. A combobox will do it, but a slider just does numbers.
17:17SagiCZumm.. i thought you could do very custom bindings.. but maybe its mixing up with my JavaFX experience
17:20SeyleriusIf I use fn, then any variables in scope when I do that are available, right?
17:20SeyleriusActually, easy test:
17:20SagiCZyes.. thats called "closure" or "closing over fn"
17:20SeyleriusThought so.
17:21SagiCZit usually solves those problems but unfortunetely my clojure is very rusty so i cant throw in an example that would solve your problem
17:21SeyleriusThat's clear enough, though, so I can work with it. Thanks.
17:21Seylerius,(let [foo "foo"] (map #(str foo %) (range 3)))
17:21clojurebot("foo0" "foo1" "foo2")
17:21SeyleriusYep
17:23marthallHello everyone!
17:24SeyleriusHello marthall
17:24SagiCZhi
17:25marthallI'm a beginner in clojure, and I'm trying to update a variable inside a loop. Of course this is not working, as I'm familiar with the immutability: I think this gist explains my problem, but I can't find a good solution. Any tips? https://gist.github.com/marthall/5b09e3b2c1a07dd41d3d
17:25SagiCZmarthall: taking a look
17:26marthallThank you SagiCZ
17:27SagiCZmarthall: I think you want reduce and not doseq.. reduce goes through a sequence computing something from accumulated value and the next value in sequence finally producing one result (your input)
17:27SagiCZreduce?
17:27clojurebotreduce accumulates the men from the boys
17:27SagiCZ~reduce
17:27clojurebotreduce accumulates the men from the boys
17:27m1dnight_:D :D :D
17:27SagiCZso helpful
17:27m1dnight_what do you want to know SagiCZ ?
17:28SagiCZ(doc reduce)
17:28clojurebot"([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val is supplied, returns the result of appl
17:28SagiCZi just wanted to show the doc for marthall
17:28m1dnight_oh
17:29marthallThanks alot SagiCZ. I've used reduce in python, and thought that was the one, but I was not sure. I'll look further into it :)
17:30amalloymarthall: you want (reduce (fn [input [w b]] (sigmoid ...)) input (map vector ...))
17:30SagiCZmarthall: more imperative solution would be to use loop and update your input var via "recur".. something like
17:30SagiCZ(loop [[w b] coll, input input] ... (recur (next coll) (sigmoid (+ (dot w input) b)))
17:31SagiCZbut yeah.. its a classic reduce problem
17:31amalloySagiCZ: not quite: you'd need [[w b]] coll, at least. it's still hard to detect when coll is empty, though, which is one reason reduce is nicer
17:32SagiCZ,(not (seq []))
17:32clojurebottrue
17:32SagiCZ,(empty? [])
17:32clojurebottrue
17:32amalloySagiCZ: uh huh, but my point is you never actually have a coll to call seq on, in the snippet you laid out
17:33amalloyyou just have w and b
17:33SagiCZamalloy: you are right.. sorry
17:33SagiCZyou would need another var to keep the coll in
17:34marthallamalloy & SagiCZ: Thanks guys, I'll give it a shot and come back if I fail. This is my first time in this channel, and I have to say I'm astonished by how helpful you are!
17:34SagiCZmarthall: as was I my first time here.. this channel is nothing like other channels on freenode
17:36SagiCZm1dnight_: oh yes.. very much that.
17:36m1dnight_friendly bunch in here <3 :>
17:39uptownoh yeah? let's put that to the test haha. i'm using boot, and thus defclifn in my app, which is made up of system/components. What's the best way for compponents to supply their own defclifn option definitions and for the top scope to aggregate them?
17:40m1dnight_Id help, but I have no idea what any of those things are :p
17:40uptownyou're excused
17:43justin_smithuptown: so things that are initialized by the component system need to be able to provide configuration to boot?
17:44uptownjustin_smith: it would be DRY-er that way
17:45SagiCZ[[:a 0] [:b 3]] -> {:b 3, :a 0} ?
17:46justin_smithSagiCZ: ##(into {} [[:a 0] [:b 3]])
17:46lazybot⇒ {:a 0, :b 3}
17:47SagiCZthank you
17:47justin_smithnp
17:59alexyakushevBronsa: Hello, can I still ask you that classloader question?
18:20sdegutisGiven two collections of items with some overlap, is there a way to tell how many of one collection are in the other?
18:21sdegutis(f #{1 2 3} #{2 3 4 5}) => 2
18:21sdegutisWhat's f?
18:21SagiCZ,(count (intersection #{1 2 3} #{2 3 4 5}))
18:21clojurebot#error {\n :cause "Unable to resolve symbol: intersection in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: intersection in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6543]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol:...
18:21sdegutisNice, thanks.
18:22SagiCZits in clojure.set
18:23amalloysdegutis: (comp count filter) works too
18:24sdegutisNeat.
18:35sdegutisamalloy: your way is so cool
18:35sdegutisit's almost abusive
18:35sdegutis(in the original, non-evil sense of the word)
19:31andyf_Any reference to the original, non-evil sense of the word "abusive"? Never heard of that.
19:47SeyleriusSomehow, this code (http://sprunge.us/MDEa) is giving me "IllegalArgumentException Don't know how to create ISeq from: cube_sudoku_solver.core$gui_grid_box$fn__7607 clojure.lang.RT.seqFrom (RT.java:528)"
19:49andyf_Seylerius: A stack trace from (clojure.repl/pst *e) done immediately after the exception occurs could contain function names and line numbers that might help narrow down where your code was last involved.
19:49Seyleriusandyf_: Coming up.
19:50SeyleriusStack trace from cider: http://sprunge.us/GMcJ
19:52andyf_The part where you do (map gui-square #(->> % ...)) looks suspicious. gui-square does not expect to take a function, does it?
19:52andyf_Maybe #(->> % ...) should be (->> % ...) instead?
19:53Seyleriusandyf_: I might be missing another map...
19:54andyf_This is not the problem, but this: (#(quot % 3) (dec num)) is more clearly written as this: (quot (dec num) 3)
19:54SeyleriusOr... drop gui-square at the bottom of the ->>
19:58amalloyyeah the problem is definitely that (map gui-square f xs) line, but it's not totally clear what the actual fix is because it's hard to see what you're trying to d
20:21SeyleriusOkay, this is my GUI setup function (http://sprunge.us/MDPi), but although the GUI is getting setup, the listeners do not seem to be firing.
20:23mrcheeksSeylerius:Is it some kind of toolkit such as seesaw vs pure swing?
20:23Seyleriusmrcheeks: Seesaw.
20:24amalloy~map
20:24clojurebotmap is slightly retarded
20:24amalloywell. close enough, i guess
20:24amalloySeylerius: map is lazy
20:25amalloyyour listener function just returns a lazy sequence, and realizes zero elements of that sequence
20:25gfredericksclojurebot: forget map |is| slightly retarded
20:25clojurebotI forgot that map is slightly retarded
20:25Seyleriusamalloy: Huh. But why isn't the mode-switch listener firing?
20:26SeyleriusThe line that starts (sc/listen mode-group selection ...)
20:26amalloyi dunno. i don't use seesaw, and i don't want to read that whole giant snippet. i just scrolled to the bottom and found one thing that was obviously wrong
20:27Seyleriusamalloy: Well, thanks for that one. I swapped it for a mapv, to force it to complete immediately.
20:27Seyleriusamalloy: What do you use for GUIs?
20:27amalloyi dunno. javascript? i don't really do any
20:27SeyleriusGotcha.
20:28amalloylike a decade ago i used swing by itself in java, but since then there hasn't been much of a compelling need
20:28mrcheeksSeylerius:Did you try the show-events of seesaw, debugging, etc?
20:30Seyleriusmrcheeks: No. Do you have a debugger recommendation (I'm using Emacs+cider at the moment)
20:30mrcheeksSeylerius: I'm not clojure developer, just an enthusiast, but looking at your code, it is easily done in plain swing...
20:30Seyleriusmrcheeks: I don't particularly know swing, or normal java.
20:31mrcheeksSeylerius:I believe that Arthur Malarba implemented some kind of debugger for Cider, few months ago, likely not complete but probably usable.
20:31wildnuxSeylerius: i get "Unable to resolve var: cider.nrepl.middleware.debug/wrap-debug in this context" when i try to use cider-debug, how do you make it work?
20:32wildnuxI am trying to learn debugging clojure, but emacs and clojure both are new
20:32mrcheeksSeylerius:http://endlessparentheses.com/cider-debug-a-visual-interactive-debugger-for-clojure.html, I rarely use debuggers in general unless I'm completely clueless about what's going on after reading.
20:33mrcheeksSeylerius:Again, I only do Clojure for fun, my paid work is all Java and sometimes Groovy.
20:34Seyleriusmrcheeks: Thanks for the tip. That looks helpful
20:34Seyleriuswildnux: Are you using cider 0.8 or 0.9?
20:34wildnuxSeylerius: [cider/cider-nrepl "0.8.2"]
20:35Seyleriuswildnux: Take a look at the link mrcheeks gave. You want 0.9.
20:35wildnuxSeylerius: was just looking at it
20:35wildnux:)
20:35wildnuxmrcheeks: thanks a lot.. I have been scratching my head for long time
20:36Seylerius(inc mrcheeks)
20:36lazybot⇒ 1
20:39mrcheeksnp, :-), life would be more enjoyable hacking some Clojure on daily basis with $$, all that Java, etc. is getting kind of boring. If I were a Clojure professional I'd have tried implementing a full debugger for Cider based on the previous work of Ritz (https://github.com/pallet/ritz -> JPDA)
20:41wildnuxmrcheeks: I do java only at work, but clojure is the language I love, I am trying to be better so I can try finding clojure for next job ;)
20:42gfredericksmonolithic macros make repl-driven development stupider
20:42gfredericks(M.M.M.R.D.D.S.)
20:43it0aa job in clojure would be so nice
20:43mrcheekswildnux:nice not much Clojure happening in Canada as far as I know unless I build my own product. I'm "die hard" Emacs user, but maybe Cursive for IntelliJ is free, I think that it has a "good enough" debugger.
20:43it0aalso sick of the day in/day out java nonsense
20:44it0a~_~
20:44clojurebotNo entiendo
20:44TEttingerit is unintended, yes
20:44it0ahaha
20:44TEttinger$seen damian_
20:44lazybotI have never seen damian_.
20:45TEttingerwhat...
20:45TEttingerjust this morning, [08:41;33] <damian_> Yet input: (dbl/dot-product (1 2) (1 2)) gives me error: ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn
20:45TimMcit0a: It is indeed pretty nice!
20:46it0aTimMc: so envious :P
20:46TimMcfunctionaljobs.com has Clojure positions here and there
20:46TEttingerTimMc, do you have a webslinging development job, or something more unusual?
20:47TimMcWeb servers, yeah.
20:47TEttinger(I'd consider something like clojure backends for websites or clojurescript frontends to be the most common use?)
20:47TimMcA tiny bit of front end, a little Java here and there.
20:48TEttingerwith more traditional lisp stuff like AI or other learning algorithm stuff probably being rare, but that's what Prismatic does, kinda
20:48TimMcRight now I'm on a non-Clojure project but I hope to be back in it in a month or so.
20:48TEttingerman, could Prismatic have picked a worse time to choose a name with PRISM in it for their data collection/recommendation service
20:48SeyleriusTEttinger: You mess around with seesaw much?
20:49TEttingeryeah, a bit
20:49SeyleriusMy listeners are deaf.
20:49TEttingernot in a while
20:49TimMcTEttinger: Or a BETTER time? :-D
20:49TEttingerdun dun DUN
20:49m1dnight_do watched and atoms get recycled once they are out of scope?
20:49SeyleriusHeh
20:49m1dnight_watches*
20:50m1dnight_s/are out of scope/you leav their defining scope/
20:50TEttingerm1dnight_, I'd hope so, they are internally handled by java objects and java objects are garbage collected...
20:50amalloym1dnight_: objects get garbage collected when there is no longer a path to them from a GC root (ie, a class's static members or a stack frame's local variables)
20:50m1dnight_okay then :)
20:50amalloythis applies to atoms as much as to anything else
20:50m1dnight_I was just wondering about the watchers in particular.
20:50amalloywatchers are just objects pointed at by the atom
20:50m1dnight_oh okay
20:51SeyleriusTEttinger: Mind taking a look at this function (obviously it creates my GUI crap), and see if you can spot why the listeners refuse to listen? I've aliased seesaw/core to sc. http://sprunge.us/MDPi
20:51TEttingersure, Seylerius
20:51SeyleriusTEttinger: Thanks. What do you normally use for GUIs in clojure these days?
20:52SeyleriusI'm quite certain the listener functions aren't actually getting called, because I've stuck a println in a couple and never see an output. A println before or after gets called, though, so the sc/listen lines are getting eval'd.
20:53amalloySeylerius: printlns might go to a different stream than you expect, if they're being run from the swing dispatch thread
20:53amalloytry looking in your *cider-nrepl* buffer or whatever it's called
20:54Seyleriusamalloy: Yeah, that's where I'm looking. I've stuck a println right before and after the listener functions, and I see those outputs, but I never see the ones _inside_ the listeners.
20:54TEttingerSeylerius, it looks like you aren't ever adding stuff to the frame
20:55TEttingerare the buttons appearing?
20:55SeyleriusTEttinger: Yeah, everything gets drawn right.
20:55TEttingerhm
20:55SeyleriusTEttinger: Want the whole thing to try running it?
20:55TEttingeroh, nvm :content main-panel
20:55SeyleriusTEttinger: Yep
20:55TEttingernah, I'll keep looking at this for now
20:55SeyleriusKay, thanks.
20:56TEttingerI'm pretty sure I see something off
20:56amalloySeylerius: i mean not your repl buffer, but the one that contains debug output from cider itself. in slime/swank that buffer was called *swank*; i'm not sure what it is in cider
20:58Seyleriusamalloy: Nope.
21:07TEttingerSeylerius: so there's some examples in the tests, and they really look the same as your listen calls. https://github.com/daveray/seesaw/blob/develop/test/seesaw/test/event.clj#L110
21:08TEttingeroh!
21:08TEttingerthere's a thing, Seylerius
21:08TEttingeryour reset button should use doseq because its goal is to cause side effects, instead of using map
21:09TEttinger(at the bottom)
21:11TEttingerso I'm guessing with that being lazy, and the other listeners using when-let and possibly always getting nil in the binding, it's never getting to the bodies of the listeners
21:13SeyleriusHmm...
21:13TEttingerSeylerius: try using let instead of when-let and when you would get a value, insert some debug code to see if you got nil (like a case that handles nil in the first listen)
21:14TEttingerafter :3d
21:14SeyleriusTEttinger: Will do.
21:14SeyleriusTEttinger: Simply returning nil oughta do for the nil cases, right?
21:15TEttingerI would print, which would return nil anyway
21:15TEttingerthat way you can see what it's getting
21:16TEttingerit's been weird, I built up some experience with some kinda uncommon libraries when I was working on clojure games using some odd choices of library. in the last 24 hours, hiphip has been mentioned, Packr I managed to save someone's bacon, and now Seesaw is coming into play...
21:16TEttingerI hadn't thought about seesaw in like a year
21:17m1dnight_i recall that a few days/hours ago somebody was talking about a diff function for maps, am I right?
21:18m1dnight_aha got it!
21:19SeyleriusTEttinger: What are you using for GUI work these days?
21:19SeyleriusIf not seesaw?
21:19TEttingerI haven't done GUI work recently, when I do graphics stuff it's for games, using (very indirectly) OpenGL through many layers of nice wrappers
21:20TEttingerso I intended to use play-clj with a game, and use a java lib for certain aspects of the logic, things that are very array-heavy
21:21TEttingerI ended up just expanding on the java lib like mad
21:21SeyleriusWow
21:21TEttingerI'm still going to use clojure eventually with it
21:21TEttingerplay-clj is really nice
21:22TEttingerrelatively idiomatic clojure style that can do fancy stuff that's really verbose with libGDX (the library it wraps, which in turn makes OpenGL easy to use, relatively, from java)
21:23SeyleriusTEttinger: That's interesting. I'll have to check that out...
21:23SeyleriusWhat kind of game are/were you working on?
21:24SeyleriusAlso, I've swapped all the when-lets for lets, and the map for a mapv (to avoid laziness), but it's still not doing anything.
21:29SeyleriusTEttinger: Hrm. Swapping when-let for let across the listeners didn't work, and swapping map for mapv didn't either. Nothing's getting called.
21:29SeyleriusOh, wait...
21:30SeyleriusAHAH!
21:30SeyleriusWe have a useful error now!
21:31SeyleriusTEttinger: Error output: http://sprunge.us/bgjX
21:31SeyleriusThe mode listener is what's failing.
21:33TEttingerah cool!
21:33TEttingerSeylerius, sorry I was away, eating chinese food (it was good!)
21:33SeyleriusSounds good.
21:35TEttingerso the mode listener, that's (sc/listen mode-group :selection ...
21:36SeyleriusTEttinger: Yep
21:36TEttingerit's selecting a widget rather than its value
21:37TEttingeryou want to try to get the :id of the widget, with some sensible default if that fails
21:37TEttingerlike (get s :id (println "this returns nil so don't use the result"))
21:38TEttingerthen if whatever that returns is non-nil, you have :2d or :3d
21:40SeyleriusTEttinger: Okay, now I'm getting two annoyances. One old (it takes two clicks to select a radio button), and one new ("Wrong number of args passed to keyowrd: :3d").
21:40TEttingerare you using a keyword as a function?
21:41TEttinger,(:a {:a 1 :b 2})
21:41clojurebot1
21:41TEttinger,(:c {:a 1 :b 2})
21:41clojurebotnil
21:41TEttinger,(:c {:a 1 :b 2} :default)
21:41clojurebot:default
21:41SeyleriusNot meaning to, but I think it's trying to in the listener.
21:41clojurebotGabh mo leithscéal?
21:41TEttingercan you sprunge up the code again?
21:42xeqiSeylerius: did you get your solver working?
21:42TEttingerthat's this, xeqi :)
21:42Seyleriusxeqi: Solver works great, GUI sucks balls.
21:42xeqiwell, this is the gui for it
21:42xeqihaha
21:42SeyleriusTEttinger: http://sprunge.us/jGCQ
21:43xeqiSeylerius: anyone recommended making all those defs into a let binding yet?
21:44Seyleriusxeqi: Not yet, but I can see it being a good idea.
21:44xeqisince they're in a defn, and def in a defn will still mutate the namespace
21:44xeqinot just make a local definition
21:45TEttingerah! (let [s (sc/id-of (sc/selection mode-group))]
21:45TEttingerif the selection isn't something that has an id, this could be trouble (like if it's nil)
21:46SeyleriusTEttinger: Good catch.
21:46TEttingerso the body of (sc/listen mode-group :selection ... is where it's throwing the exception?
21:47TEttingerah, I think I may have an idea here
21:47TEttingerthe two clicks thing may mean you are listening to the group when you want to be listening to all the buttons, which is pretty easy to do with seesaw
21:49SeyleriusTEttinger: Okay, that's easy enough to fix; listen to mode-buttons instead of mode-group.
21:49TEttingerhttps://github.com/daveray/seesaw/blob/develop/test/seesaw/test/event.clj#L206-L215
21:50TEttingeryeah, pass listen a vector of widgets, and when one has its selection change, you'll get notified, twice I think (once for one losing selection, once for gaining)
21:51TEttingerI think the selection is nil if a :selection event is triggered by being deselected?
21:51TEttingerit might not give events on deselection at all
21:51SeyleriusTEttinger: Which is why it was a when-let binding, actually, according to the tutorial I'd looked at.
21:51TEttingerahhhh
21:52TEttingerso going back to when-let, still getting the id, should work?
21:52SeyleriusTEttinger: Yeah, that should do it.
21:52TEttingerand of course the listening to single widgets, I think that should be all for that fn...
22:00SeyleriusTEttinger: Here's the tutorial, and I know this particular snippet worked. So this is weird. Changing to listening to the buttons themselves fixed the two click problem, though. https://gist.github.com/daveray/1441520#file-seesaw-repl-tutorial-clj-L446
22:04SeyleriusStepping out for food.
22:04TEttingerah, that's the problem then
22:04TEttingerbefore it was listening to the group and getting a radiobutton back, and you were checking only for keywords (the :id of those radio buttons)
23:44currentoorI'm using the lobos library for writing migrations and lately I've had problems connecting to the DB. I keep getting the following error Attempting to call unbound fn: #'clojure.java.jdbc.deprecated/
23:44currentoorAnyone else deal with this?
23:45karan.