#clojure logs

2010-12-08

00:07amalloyscottj: nice, i didn't know about emacs-client. not sure what i'll use it for, but (server-start) is in my ~/.emacs now!
00:08amalloydid you figure out your butlast thing?
00:29jackdempseyhey all, going to writeup a small app in clojure as part of the continual learning process. key piece will be making some http calls, parsing the resulting dom, and looking at some elements
00:29jackdempseyi still don't know much of what's in contrib, so if anyone has a pointer as a lib or two i should look at, would appreciate it
00:30jackdempseyseems like clojure-http-client is a good start
00:30jackdempseyah, nm, ha
00:53scottjamalloy: nope, I'm went ahead and used butlast cause this is working on code and I don't think I can write code faster than butlast can process it
02:05bartjthe only way I can print which test functions are being executed (with clojure.test) is with the "testing" macro
02:05bartjcan someone please confirm?
05:24AWizzArdDo we have an Ant expert available? :)
05:24AWizzArd(the build tool)
05:55esjI LIVE !
06:32bartjdoes clojure invoke threads while doing a reduce? for eg: this operation (time (reduce + (range 100000000)))
06:32bartjtook only about 31 seconds, and I am extremely keen to know how it is *so* fast
06:34bobo_bartj: no i think preduce exissts though
06:34kjeldahl&(doc preduce)
06:34sexpbotjava.lang.Exception: Unable to resolve var: preduce in this context
06:34bobo_guess not
06:34clojurebotI guess that is my answer.
06:35bartjgah, I am able to see preduce in the cheatsheet but not in the documentation as well)
06:35kjeldahlReally? I see no preduce on http://clojure.org/cheatsheet
06:36kjeldahlAlso, only guessing, but considering what reduce does, it's kind of hard to run in parallel. Map on the other hand...
06:36bobo_yeh
06:36bartj$Revision: 1.02, $Date: July 10, 2009
06:37bobo_there is a pvreduce in the fork join stuff though
06:40bartjkjeldahl, you mean to say that preduce will do it much faster ;)
06:41kjeldahlbartj: No, I was thinking of the sequential nature of the reduce operation. But lots of people have thought about this more than I.
06:41kjeldahlApologies if I didn't get the joke, and my reply seemed to serious. :-)
06:41kjeldahltoo serious I meant
06:49kzarSo I was messing around with swing and I was wondering if there's something like partial I could use here, I was trying to do something like (partial . g drawOval) so I could easily map some numbers into drawOval. I think it's not working because the . is a macro? Best I could get was #(.drawOval g %1 %2 %3 %4) but that forces me to use that number of arguments and is a bit verbose
06:50Chousukethere's memfn
06:55cemerickI don't think there's any use case that is better served with memfn than with #()…
06:55bsteubercemerick: I think kzar just gave one, no?
06:56bsteuberhow do you solve if with #() ?
06:56cemerickbsteuber: memfn doesn't give you anything like partial application
06:57cemerick,((memfn substring a b) "foot" 1 3)
06:57clojurebot"oo"
06:58cemerickthose "args" you provide to memfn define the arity of the returned fn.
06:59bsteubercemerick: ah ok, had a wrong idea of memfn in my head, then
06:59javeI tend to wind up with stuff like: (eval `(sh ~@(rtmpdump-cmd isbn chapter))). It doesnt feel quite right
06:59clojurebotI want my bikeshed blue!
07:00javewhats the proper way to do it?
07:01bsteuberjave: why not (apply sh (rtmpdump-cmd …)) ?
07:01cemerickjave: (apply sh (rtmpdump …))
07:01javehmm. sometimes one needs to ask humiliating questions. It occured to me the moment I pressed enter
07:04bsteuber:)
07:04bsteuberhappens to me all the time here oO
07:07kzarheh same here
07:07djpowellhmm, just got bitten by using for inside a dynamic binding. dynamic bindings and (in this case, unwanted) lazyness are an unpleasant mix
07:16cemerickdjpowell: That is largely fixed in 1.3.0 -- until then, http://cemerick.com/2009/11/03/be-mindful-of-clojures-binding/
07:36bobo_compare-value-and-set maybe?
07:42cemerickraek: identity-based CAS is a primitive operation provided by AtomicReference.
07:43cemerickThat is, you can't paper over it with a value-based comparison and get the same concurrency semantics.
07:50esjHeroku sold for 212 Million ! gawp
08:04djpowellcemerick: I'm not sure that 1.3.0 fixes the dynamic/lazy thing
08:05djpowell(def *x* 1) (binding [*x* 2] (for [y (range 1 3)] *x*)) - still returns (1 1) rather than (2 2)
08:06djpowellputting doall around the for fixes it
08:07raekcemerick: I am making a state machine that has its state in an atom. not all transitions are allowed at all times, so I want to have functions that try to do transitions and return booleans representing whether they suceeded
08:09cemerickdjpowell: you may be right -- I know that bindings are passed along in agent sends, futures, etc, but the lazy-seq gotcha may remain.
08:11cemerickraek: how is identity-based CAS related to that?
08:11djpowellcemerick: the fix to futures etc is nice, but yeah, I think lazy-seq is a big gotcha at the moment
08:30jweissis there a functional way to get the first item in a list that matches a predicate? I could do (first (filter pred list)) but i'm not sure if the laziness works there to prevent more predicate calls than necessary?
08:30jweissi'm trying to think of a way to test that at the repl
08:31djpowellwrite a fn that calls (println "X") before calling your pred
08:31cemerickjweiss: you've got it right
08:31jweissdjpowell: ah that'll do it. cemerick thanks
08:31cemerickjweiss: actually, some is more concise
08:32jweisscemerick: but some will just give me true or false, not the first matching item
08:32jweissoh
08:32jweissi guess i am wrong
08:32cemerickjweiss: no; if you make your predicate return the value from the seq, then it's exactly what you want
08:32jweisscemerick: ok thanks
08:32djpowelloh beware btw - chunked seqs mean that for the built in data-structures, the predicate may get called for the first chunk
08:33jweissdjpowell: ok, i can live with that, this is actually a tiny dataset, but i wanted to know for future reference
08:38chouserright, so be careful with that -- some things produce chunked seqs while others don't
08:40djpowellthis dynamics + lazyness thing is difficult to fix yourself. something like a bound-seq wrapper is ok - but what if seqs are nested inside the outer seq
08:40chouser& (let [i (atom 0)] {:filter (first (filter #(do (swap! i inc) (odd? %)) '(1 2 3 4 5))) :i i})
08:40sexpbot⟹ {:filter 1, :i #<Atom@3f29e0: 1>}
08:40chouser& (let [i (atom 0)] {:filter (first (filter #(do (swap! i inc) (odd? %)) (range 5))) :i i})
08:40sexpbot⟹ {:filter 1, :i #<Atom@157385e: 5>}
08:41chouser^^ jweiss
08:43jweisschouser: was just processing what that code does, i think i got it :) thanks
08:45jweiss& (let [i (atom 0)] {:filter (first (filter #(do (swap! i inc) (odd? %)) (range 25))) :i i})
08:45sexpbot⟹ {:filter 1, :i #<Atom@153dc23: 25>}
08:45jweiss& (let [i (atom 0)] {:filter (first (filter #(do (swap! i inc) (odd? %)) (range 100))) :i i})
08:45sexpbot⟹ {:filter 1, :i #<Atom@36afc2: 32>}
08:45jweissso i guess chunk size is 32
08:46djpowellYeah - which matches the internal arrays, clojure uses to implement hash-maps and vectors, as well as just being a reasonablish size
08:50chouserhash maps don't generate chunked seqs currently
08:50chouser& (let [i (atom 0)] {:filter (first (filter #(do (swap! i inc) %) (apply hash-map (range 100)))) :i i})
08:50sexpbot⟹ {:filter [0 1], :i #<Atom@1e5c05: 1>}
08:51chouser& (class (seq (hash-map :a 1 :b 2)))
08:51sexpbot⟹ clojure.lang.PersistentHashMap$NodeSeq
08:51chouser& (class (seq (vector :a 1 :b 2)))
08:51sexpbot⟹ clojure.lang.PersistentVector$ChunkedSeq
08:55jweissis there a way to make re-find do multiline matching
08:59jweissi think i found it
08:59jweiss& (re-find #".*findme.*" "blah blerg blah\nfindme blork\n foo bar")
08:59sexpbot⟹ "findme blork"
09:00jweiss& (re-find #"(?s).*findme.*" "blah blerg blah\nfindme blork\n foo bar")
09:00sexpbot⟹ "blah blerg blah\nfindme blork\n foo bar"
09:19jweisschouser: something doesn't seem right here
09:19jweiss& (doc clojure.contrib.error-kit/deferror)
09:19sexpbotjava.lang.Exception: Unable to resolve var: clojure.contrib.error-kit/deferror in this context
09:20jweissclojure.contrib.error-kit/deferror
09:20jweiss([name [parent-error?] doc-string? [args*] & body] [name [parent-error?] doc-string? args-destruct-map & body])
09:20jweissMacro
09:20jweiss Define a new error type
09:20jweissnil
09:20tonyl(require 'clojure.contrib.error-kit)
09:20tonyl,(require 'clojure.contrib.error-kit)
09:20clojurebotnil
09:20jweissaccording to that the doc-string comes between the parent error and the args
09:20jweissbut the way it actually seems to work is that the doc-string needs to come after the parent error and args
09:21jweiss,(doc clojure.contrib.error-kit/deferror)
09:21clojurebot"([name [parent-error?] doc-string? [args*] & body] [name [parent-error?] doc-string? args-destruct-map & body]); Define a new error type"
09:22jweiss,(clojure.contrib.error-kit/deferror blah [] "my docstring" [s] {:msg "boo!" })
09:22clojurebotDENIED
09:22jweissdoh
09:23jweissactually i guess it works both ways
09:35jcromartieso maybe someone can advise me on the "clojurely" way to design this
09:35jcromartiebut in developing a data masking tool, I know that I need "rules" which can be previewed and applied to a database
09:36jcromartieand can be generated (for instance by functions that suggest transformations for a certain table)
09:36jcromartieso I've got multimethods for apply-rule commit-rule! and preview-rule
09:37jcromartieapply-rule being the non-destructive version
09:40cky,'DENIED
09:40clojurebotDENIED
09:40cky:-D
09:50neotyk,(source clojure.walk/postwalk)
09:50clojurebotjava.lang.Exception: Unable to resolve symbol: source in this context
09:51neotykcan someone enlighten me what (partial postwalk f) in postwalk defn does?
09:52garytr25&(source clojure.walk/postwalk)
09:52sexpbot⟹ Source not found nil
09:52neotyk,(clojure.repl/source clojure.walk/postwalk)
09:53clojurebotSource not found
09:54neotykpostwalk in short (defn postwalk [f form] (walk (parrtial postwalk f) f form))
09:54jcromartieugh I always screw myself over when trying to organize code into namespaces... I end up with cyclical dependencies everytime
10:31jcromartieOK this is fun
10:31jcromartieSay I have a defn in another namespace, and I use that namespace.
10:31jcromartieSo the symbol resolves fine...
10:31jcromartiebut then I use eval inside of pmap
10:31jcromartieand it fails
10:32jcromartieso ((eval 'normalize) "hi") works
10:32jcromartiebut (pmap #((eval 'normalize) %) ["hi"]) does not
10:33jcromartieor a simpler example
10:33jcromartie@(future (eval 'normalize))
10:34tonylis normalize a valid symbol
10:35jcromartie(eval 'normalize) works fine, it resolves
10:36jcromartiebut any new thread seems to not have that binding bound
10:36tonylyeah that would be a problem
10:37tonylwhy not (let [v (eval 'normalize)] (pmap #(v %) ["hi"]))
10:38jcromartieyeah I could do that
10:38jcromartiebut I was going to defer eval until the last moment
10:39jcromartiesimple enough of a change
10:39tonylI am not much of a help there. I don't know much about threading bindings
10:39jcromartiebut I assumed threads inherited bindings
10:39jcromartie:)
10:39jcromartieno problem
10:39tonylas far as I know only root bindings, not parent bindings
10:43jcromartie"Supplying an initial value binds the root"
10:43jcromartieso (def x 1) should mean that any thread has access to x
10:50kzarI want to return an array with one change, something like take [:a :b :c] and return [:a :b :herp-derp], what's the best way to do that?
10:51kzar,(aset [:a :b :c] 2 :herp-derp)
10:51clojurebotjava.lang.IllegalArgumentException: No matching method found: aset
10:52chouserkzar: that would be right if [] were an array, but it's not -- it's a vector
10:52chouser,(assoc [:a :b :c] 2 :herp-derp)
10:52clojurebot[:a :b :herp-derp]
10:52kzarchouser: oh whoops, thanks
10:52kzarchouser: I forgot they aren't the same, sorry
11:26rata_hi all
11:27rata_does anybody know a possible reason why "lein compile" isn't compiling my dependencies in one of my computers? (archlinux, lein 1.4.0)
11:44jcromartiewhat's the best way to structure namespaces and dependencies?
11:45jcromartiein terms of what depends on what namespace
12:02amalloyjcromartie: avoid cyclic dependencies :) - did you have something more specific in mind?
12:07dnolenanybody tried to write a binary decision diagram in Clojure?
12:12amalloydnolen: what for? to figure out what function does the thing you want?
12:12amalloyif so, i know fliebel wanted to do that, but i think he gave up and did something easier
12:13dnolenamalloy: there's some interesting research (and working projects) that implement datalog efficiently via BDDs
12:13dnolenamalloy: also found an interesting paper that uses BDDs to do abstract interpretation of prolog programs.
12:14dnolenjust curious if anybody had messed w/ them, had pointers, links, code to share.
12:49fogus`dnolen: I would love to see someone retrofit BDDs onto clojure-datalog.
12:57dnolenfogus`: I should look more closely at the clojure-datalog implementation, it uses magic sets right?
13:01fogus`dnolen: Yes. The datalog impl is very cool. I spent a couple hours picking Straszheim's brain at The Conf. If you want to learn more about it, then check out the dissertation "Soft Stratification for Transformation-Based Approaches to Deductive Databases"
13:04pdloganfogus`: any idea of the expressiveness / performance of the datalog v. the recent mini-kanren's? -- i.e. I guess the datalog would not be as expressive -- is it a pretty efficient implementation?
13:04dnolenfogus: Yeah I'm looking forward to digging into it. I haven't used it much since it seems quite slow.
13:04pdlogani.e. are any of these candidates for "real world use"?
13:05dnolenpdlogan: even the new miniKnaren is "slow". I'd like it to be about 10X faster than it is. Right now it solves the Zebra puzzle in ~14-20ms. I'd like to see < 2ms.
13:06dnolenI'm working on that.
13:06fogus`pdlogan: Not sure about real-world use as I haven't tried. I think in that regard I would love to see the TheDeadline folks open source their Rete engine. They seem to have no issues using it for real work
13:07pdloganI see - thanks dnolen - you think it can get there eventually?
13:07fogus`pdlogan: I tried to convince them to do so, with no success. ;-)
13:08dnolenpdlogan: I don't see any obvious obstacles. There's a metric ton of literature out there that I've been pouring over that's quite helpful in that regard.
13:08pdloganfogus`: the original OPS5 source is around somewhere - and oh is it a piece of work.
13:09fogus`pdlogan: As for expressiveness I can't say either (great help I am huh) since my experience with both has been exploratory
13:09fogus`pdlogan: Yes, I've looked at it (MY EYES!)
13:09pdloganyeah, n/p - there are various levels of "datalogs +/-"
13:10pdloganjena has a forward and backward engine in open source java, recenttly incubated for apache. (FWIW)
13:10pdlogan(two different engines and the forward has to run strictly before the backword if used together)
13:11pdlogananyway all the attention to LP in clojure is getting exciting
13:11fogus`I've always wished that Jess had a less restrictive license
13:12dnolenpdlogan: yeah I haven't look at much forward literature. All Prolog stuff. I'm curious to see if Clojure makes it easier to unify them.
13:12pdloganyeah jess seems the pinnacle in java
13:13pdlogan"forward" is by definition stateful, where backward is not, for one thing
13:13fogus`I've been playing with my own inference engine and have something fun working, but it's very rough around the edges and not general purpose.
13:13dnolenpdlogan: miniKanren is interesting in that that each function is like little a abstract logic machine. They produce goals, does it matter if the results are produced backwards or forwards in a particular machine? (I doubt it)
13:15dnolenWarren's incomplete paper on XSB brought me to that thought.
13:18pdloganinteresting stuff -- it's been a long time since I've been into logic programming and all of a sudden I have a big stack of reading.
13:20fogus`(inc pdlogan)
13:20sexpbot⟹ 1
13:23dnolenfogus`: thx for the datalog paper, I've been looking for the right ones to read.
13:24fogus`dnolen: to paraphrase Jeffrey -- If the paper doesn't talk about negation, then it's a toy.
13:26dnolenfogus`: also haven't read much about negation, beyond Prolog's negation as failure.
13:26dnolenand that miniKanren has disequality constraints.
13:28maaclI am struggling coming up with an elegant (or actually any) Clojure solution to this map transformation https://gist.github.com/733674 (python solution incl.)
13:31amalloymaacl: clojure.set/index?
13:32amalloyi don't think it's quite what you want, but it looks close, so maybe it's useful/inspirational?
13:34maaclamalloy: yeah looked at it, but i find it difficult to use when the map is "keyless" (i.e. the keys are actually data)
13:35jcromartieSQL Server*
13:38jkkramermaacl: here's one way, using reduce & for: https://gist.github.com/733691
13:45alexykjcromartie: are you serious? MSFT's?
13:45pppaulis there a tutorial on using 'for'?
13:46jcromartiealexyk: yes
13:46amalloy&(doc for)
13:46sexpbot⟹ "Macro ([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost f... http://gist.github.com/733699
13:46alexykjcromartie: how do you limit things then? :)
13:46amalloypppaul: the above is pretty good
13:46jcromartieselect top 10 *...
13:46jcromartieinstead of select * limit 10
13:46jcromartieand to limit to a range, you need a subquery
13:46alexyka*holes
13:46jcromartieselect top 10 * from (select top 100 * ...)
13:46jcromartieheh yeah
13:47alexykno matter how F# tempted me to look at .net I never plunged, and this stuff confirms it's not for naught
13:47alexykno matter how Dr. Harrop enticed us
13:49Rayneshttps://github.com/Raynes/sexpbot/commit/ca81a293e39890d0289965c87178e52e6f762b4d
13:50jweisschouser - having a curious problem with errorkit: https://gist.github.com/733706
13:54edwMy swank connection clobbers my app whenever I close it. Is there a way to avoid this? And ideally automatically re-spawn a swank listener?
14:03amalloy$source deferror
14:03sexpbotSource not found.
14:04amalloyjweiss: https://github.com/richhickey/clojure-contrib/blob/2ede388a9267d175bfaa7781ee9d57532eb4f20f/src/main/clojure/clojure/contrib/error_kit.clj#L59
14:05chouserjweiss: yeah, deferror has all kinds of bad magic in it. :-(
14:05amalloydeferror puts some metadata in the var of the error thing you define; if you define a new var pointing at the same thing, it has the wrong meta
14:05amalloy(disclaimer: i've never used deferror in my life, but the source sure looks that way)
14:06chouserthat was written before cgrand told us at the Conj to have our DSLs produce values, and not to rely on macros
14:07jweissamalloy: chouser ok i see why that's happening now
14:07jweissi guess i can copy over the meta myself
14:09chouserI'm actually not sure that'll be sufficient
14:09chouserthere's also heirarchy stuff going on that appears to be based on the error's name, not its value.
14:09amalloyi'd guess not. when black magic is being done, usually you have to copy the meta and sacrifice a chicken
14:10chouserjweiss: are you sure you need error-kit? It's due to be replaced, I just haven't taken the time.
14:10chouserjweiss: if you don't actually need continue or continue-with, I'd recommend clojure.contrib.condition instead
14:39chouserhuh. I just abused tree-seq where I normally would have used iterate
14:40chouserno need for a separate (take-while ...) to end the seq
14:40jweisschouser: well i probably don't need it (yet) but i do need something like that at some point
14:41jweissi'm kind of surprised there aren't more people using it, it's pretty cool (although it would seem the implementation could be improved)
14:42jweissis there some other way to let the callers just pick a handler by name other than using error-kit
14:43amalloychouser: wow, that's evil
14:43amalloythough tbh (take-while identity (iterate f x)) is so common i have a function for it
14:44chouser& (tree-seq #(< % 10) (comp list inc) 0)
14:44sexpbot⟹ (0 1 2 3 4 5 6 7 8 9 10)
14:44chouseramalloy: I didn't realize that's what I was doing until I was done
14:45hiredmanjweiss: condition from contrib is simpler than error kit, but flexible, you end up with throwable maps
14:45jweisshiredman: yeah i saw that, i may give that a try
14:46chouserjweiss: you can provide a function that you will call when an error happens, and users can dynamically bind that to their own function that does what they want
14:47jweisschouser: yeah, that would do what i need. i guess i don't really *need* error-kit then
14:47chousererror-kit probably doesn't blong in contrib, at least not in its current state
14:48chouserI wrote it as a sort of proof-of-concept, to show you could get most (all?) of Common Lisp's error handling behavior in Clojure
14:48chouserand it went it contib because that's where I was putting stuff then :-P
14:49chouserbut that all leaves quite open the question of whether or not we *should* use all of Common Lisp's error handling in Clojure
14:56dnolenamazon s3 multipart upload api seems like a sweet thing to couple with Clojure.
14:57dnolenparallel file upload
15:03edwWhenever I close a swank connection in Emacs, my process (started via lein repl or lein swank) dies. How do I get my process and its REPL to continue running?
15:06amalloyedw: i haven't had that problem, but then i use cake
15:07edwI've tried wrapping the swank.swank/start-repl in a try statement, but it doesn't return, so the exception happens in another thread.
15:07amalloythat is, i don't know enough to suggest that it's lein's fault, but since cake is basically a drop-in replacement you might try it
15:08edwWhat's the prevelance of lein vs cake usage? I'm trying to keep my toolset as mainstream as possible.
15:08amalloyedw: i think they're both pretty mainstream these days
15:11edwI'll check it out. Thanks.
15:12jkkrameredw: how are you closing the swank connection in emacs?
15:15raekedw: I'm using leiningen and I haven't had that problem
15:15edwjkkramer: Using ,sayonara
15:18jkkrameredw: i've never seen that before. is that for quitting emacs or just closing swank?
15:18edwOkay, this is weird: using ,disconnect leads to a graceful shutdown while ,sayonara fubars the server.
15:18edwI.e. I can reconnect after ,disconnect-ing.
15:19jkkramerM-x slime-disconnect seems to also work
15:19edwThis doesn't help if the connection is gracelessly severed e.g. I slap my laptop shut and go home. Or the network monkey restarts the router.
15:22edwI was hoping to use screen(1) to keep my app running forever on my Linode server.
15:22jkkrameredw: so severing your local connetion kills the remote swank server?
15:23edwWell let's try it...
15:23jkkramerthat would be surprising to me
15:24edwHuh. With cake...it works!
15:24edw(To test, I killed the SSH tunnel and re-started it.)
15:37maacljkkramer: thanks a lot
15:40amalloyedw: this isn't actually surprising, because cake does some things that are substantially different than lein
15:41amalloyspecifically of interest to you is that the project jvm is kept alive in the background indefinitely. eg $ echo "(def x 1)" | cake repl; echo x | cake repl
15:41amalloyshould result in 1, even though you "shut down" the repl
15:53jweiss& (declare z)(if (bound? z) z 0)
15:53sexpbotjava.lang.SecurityException: You tripped the alarm! def is bad!
15:54jweisswhy does the above throw "Var user/z is unbound"?
15:54amalloyjweiss: the bots will only evaluate one sexp at a time. aside from declare being "evil" here, you need to wrap things in a (do)
15:55amalloyjweiss: (bound? #'z)
15:55amalloyor (var z)
16:04stuartsierraAck no! swank broken on Clojure master
16:16danlarkin~ $ readlink /tmp Tarragon
16:16clojurebotTitim gan éirí ort.
16:16danlarkinsorry
16:54lpetithello, can someone explain me how to correctly set this bug (for which I've just provided a little patch) in the right state ?
16:54lpetithttp://dev.clojure.org/jira/browse/CONTRIB-102
16:55lpetitI mean, I see in the docs I must set it the "patch" tag, and set in some ready to test state, but I don't see anywhere in the interface where I can do this.
16:58stuartsierralpetit: we haven't sorted out the JIRA process completely yet
16:59stuartsierrayour best bet is to bug somebody
17:00stuartsierra *my* answer is to not use anything in contrib except logging, json, and maybe sql
17:00lpetitstuartsierra: well, can I bug you ?
17:00lpetit:-D
17:01stuartsierraI'm busy. :)
17:01stuartsierrabut I'll try to take a look later
17:01lpetitmay this be a problem with the rights currently attributed to my profile ?
17:03stuartsierradunno, I've managed to avoid learning anything about JIRA so far :)
17:04hiredmanlpetit: I think you just mark it as test
17:04marvinthepais there a way to do (apply and (true true true false false false))
17:05marvinthepaother than (reduce #(and %1 %2) (true true true false false false))
17:05marvinthepai.e. without the last two false's being evaluated?
17:05stuartsierrano
17:06lpetithiredman: well, "mark it as test", I do not see how to do that. Someone needs to explain me how to do this step by step in the JIRA UI.
17:06stuartsierraclick "edit"
17:07stuartsierrachange "patch" to "code & test"
17:08stuartsierrachange "approval" to "test"
17:08stuartsierra(we need to change the text on that for contrib
17:11lpetitwow, how come I didn't see this "edit" button. Somehow since the "comments" were available, I have thought that I was already in editable state, with insufficient rights to edit attribute fields. Thanks Stuart.
17:15marvinthepa(every? #(true? %) (map #(and %1 %2) col (drop 1 col)))
17:15marvinthepaugly..
17:17tonylmarvinthepa: what are you trying to do?
17:17brehautmarvinthepa: (rest col) ~= (drop 1 col)
17:18marvinthepawow
17:18marvinthepai am really stupid forgetting about rest
17:18brehautmarvinthepa: you dont need to wrap true? in a fun either
17:18lpetitmarvinthepa: true? instead of #(true? %)
17:18marvinthepasure..
17:19marvinthepathat was a fast shot. Anyway, lets say I have a lazy col of booleans
17:19marvinthepaI want to return false if one of them is false
17:20marvinthepa(apply and) does not work..
17:20brehaut(some false? col)
17:20kotarakmarvinthepa: (every? identity col)
17:20lpetitlogical false (eg boolean false or nil), or true false (ah! true false!)
17:20lpetit?
17:21marvinthepaWow I feel stupid. It's late..
17:21brehautkotarak: is right, i am wrong
17:21brehauts/://
17:21sexpbot<brehaut> kotarak is right, i am wrong
17:21kotarakbrehaut: I think yours should work, too, shoudn't it?
17:22brehautits backwards
17:22kotarakAh, yes
17:22kotarakYou are right
17:22lpetit,(every? identity [true true false])
17:22clojurebotfalse
17:23kotarak,(some false? [true true false])
17:23clojurebottrue
17:23marvinthepa,(not (some false? [true true false]))
17:23clojurebotfalse
17:23marvinthepathanks
17:45jweissi seem to be having a problem where lein aot compiling is not working the way i'd expect - if i include a namespace to compile, and that ns refers to another one that uses defrecord, it doesn't seem to compile the defrecord, and running my compiled class fails.
17:46jweissi wouldn't think i'd have to include gen-class on all the deps
17:46stuartsierrajweiss: this may be a bug: http://dev.clojure.org/jira/browse/CLJ-42
17:49jweissstuartsierra: hm, i am not sure if that's the bug or not. would lein be using reload-all under the covers?
17:50stuartsierradunno
17:51stuartsierrabut there *are* bugs around AOT-compiling and defrecord/deftype
17:51jweissstuartsierra: ok good to know, i'll poke around jira
17:51technomancyAOT... more trouble than it's worth =P
17:51stuartsierraI don't think the bugs have been identified / ticketed yet.
17:52jweisstechnomancy: unfortunately we have a lot invested in TestNG test harness... java classes only
17:52technomancyjweiss: it could be related to https://github.com/technomancy/leiningen/issues/#issue/141
17:52jweisstechnomancy: that sounds sorta like what i see
17:52clizzinhow can i use clojure to override a single method in a java class? i googled up a page detailing the use of proxy; is that the preferred strategy?
17:53kotarakclizzin: it worked for me, YMMV
17:54ohpauleezclizzin: proxy is the best way
17:54kotarakclizzin: if you need the name of your class which does the override you'll need gen-class
17:55clizzinkotarak, ohpauleez: my understanding is that proxy returns an object of the "subclass" type, so that i can pass it to a java method that takes an argument of the superclass, correct?
17:55clizzint
17:55clizzinthat is*
17:56lpetitclizzin: yep
17:56clizzinlpetit: cool. (was going to clarify what i meant with an example, but looks like you get me.)
17:56clizzinthanks all!
17:56clizzini'll give that a shot and hopefully it'll work
17:56ohpauleezclizzin: good luck!
17:57kotaraklpetit: woah. You obviously need a Java background to parse this that fast. ;)
17:58lpetitkotarak: maybe I have just /pretended/ to understand. After all, one chance over two, and I'll sleep before we'll get the answer ;)
17:58kotaraklpetit: haha :D
18:00lpetitno, in fact I'm used to reading Eclipse javadocs and filling the holes, I've a lot of training, that's all :-p
18:01kotaraklpetit: yeah, I wouldn't expect you throwing guesses around. :)
18:05clizzinugh so proxy can't access protected members...is there any way to do this in clojure, or will i have to write some java?
18:13clizzini notice lpetit has gone silent after all, haha
18:13lpetithey, it's midnight here in France !
18:14lpetitoh, sorry you wrote smth. You didn't place lpetit in your post, btw
18:14clizzinhaha, no worries. yeah, it wasn't a specific query for you, but it does seem you are probably best equipped to answer.
18:15lpetitclizzin: I'll let the proxy experts talk.
18:15kotarakclizzin: gen-class has some knobs to expose protected things, but never used them. You'll have to check the docs.
18:15lpetitclizzin: proxy probably suffers from the same limitations as dynamic java proxies ?
18:15ohpauleezif you have access to the Java side of things (and not just the class or jar) you can just put them in the same package namespace
18:15clizzinkotarak: thanks for the tip
18:16clizzinohpauleez: oh interesting. this is definitely possible via gen-class, but do you know if it can be done with proxy? i don't see it in the docs, but maybe someone knows something.
18:17lpetitclizzin: suggestion when using gen-class = levarage the :impl-ns option . So the "API" of your gen-class is clearly separated from your "implementation".
18:17lpetitclizzin: and sometimes it can let you solve cyclic compilation problems, too.
18:17ohpauleezclizzin: no idea, I haven't tried to do it with a protected method before
18:19clizzinlpetit, ohpauleez: thanks for the tips, i'll poke around in the docs and see if i can figure something out
18:19ohpauleezawesome
19:56KirinDaveI'm having a weird issue with ring
19:56KirinDaveIhave all these logging statements that seem to be swallowed when they're in ring handlers.
19:56KirinDaveAnyone know why this might be?
20:00hiredmanlogging like real logging, or logging like printlns?
20:06KirinDavehiredman: Well actually neither get out
20:07hiredmanprintlns are not surprising because they print to *out*, which, who knows how it's been rebound
20:11KirinDavehiredman: I think we're trying to use logula, which is one of the illustrious codahale's tools.
20:12hiredmannever heard of it
20:17jcromartieso, in clojure.contrib.sql with-connection can't combine multiple with-query-results?
20:20jcromartiehm no that's not right
20:20jcromartielaziness
20:20jcromartiethat's the issue
21:54GMTaoHey all.
21:55GMTaoI heard that Rich has left Clojure and moved on to other things. Is this true?
21:55hiredmanyou'd have to ask him
21:56GMTaoOkay, thanks. I wasn't sure, so I wanted to confirm.
22:41defnwait. what?
22:42defnis there any evidence to suggest what GMTao is talking about is true?
22:50jcromartieit looks like he's gone a bit quiet
22:50jcromartiebut it's only been 4 days since a commit
22:51defn4 days? That's it?
22:51defnIt's called a "vacation", folks.
22:51defn:)
22:51brehautwait, those are for nerds too?
23:23Raynesdefn: Uh, unless Rich got run over by a bus, I seriously highly extremely doubt that that would happen.
23:26defnRaynes: hey man dont shoot the messenger
23:26defni was just surprised, thought maybe i missed a memo
23:26Raynes$seen rhicky
23:26sexpbotI have never seen rhicky.
23:26Raynes$seen rhickey
23:26sexpbotrhickey was last seen quitting 3 days ago.
23:27RaynesIndeed. Probably doing talks or holiday stuff or something.
23:27defnbtw, Ruby is becoming more sane -- I've got JRuby using headius' bridge to the Clojure STM, Hamster (tries), multiple dispatch methods, and the ability to read in and emit s-expressions
23:28defnthis is all likely for naught, but I can't help wondering what a "sane" ruby would look like...
23:30technomancydefn: I saw that cloby gem
23:30technomancywhat exactly is the point of putting mutable objects in STM?
23:30technomancydoes he just not understand what's going on there or what?