#clojure logs

2011-10-30

04:33spoon16anyone using jenkins for clojure projects?
04:33spoon16looking for some information on configuring a leiningen project in Jenkins
04:36scottjspoon16: idk but chas made a video about clojure+hudson and a blog post maybe 1.25 years ago
04:37spoon16I'll look for it
05:19callenthe clojurebox site appears to be down.
05:19callennot sure what's going on there.
05:55ziltiI hate having to ask again, but I'm trying to get noir up and running... Locally (using "lein ring server") everything works perfect, but as soon as I'm deploying it using "lein ring uberwar" I get this: http://lyrion.ch/beta
05:55ziltiUsing ring 1.0.0-RC1
06:09ziltiI hate having to ask again, but I'm trying to get noir up and running... Locally (using "lein ring server") everything works perfect, but as soon as I'm deploying it using "lein ring uberwar" I get this: http://lyrion.ch/beta
06:09callenzilti: don't repeat yourself.
06:09callenzilti: it's a waste of time and pollutes the channel.
06:09callenzilti: everytime you repeat yourself, I drown a kitten. Capiche?
06:11ziltiNOOO not the kitten
08:23raekzilti: did you get an answer to the proxy question?
08:23ziltiraek: Yes, it's working now.
08:44ziltiHuh why can't I recur in a (while [...] (if ?
08:46raek,(macroexpand-1 '(while condition body))
08:46clojurebot(clojure.core/loop [] (clojure.core/when condition body (recur)))
08:47zilti"Did you mean: loop?"
08:47raekzilti: what do you mean by "can't recur"?
08:48ziltiUse recur there. But yeah, I meant loop instead of while, mistyped that stuff...
08:49raekzilti: you mean using recur in the body of a loop form? that should work.
08:49ziltiYes, it does
08:53archaici have a problem where incanters matrix is not respecting repls *print-length* any advice on how to fix this? (slime/emacs)
10:45gfredericks,(+ 5 6)
10:45clojurebot11
10:58ziltiIs there some sort of let that "generates" vals based on a zipmap?
11:13gfrederickszilti: not quite sure what you mean. Try giving some example code (with your made-up syntax) and explain what it does?
11:13ziltigfredericks: I mean something like (let [{a 10 b 50}] ...) which does the same as (let [a 10 b 50] ...)
11:14gfrederickszilti: so then you'd be able to (let [m {'x 12}] (let [m] (inc x))) => 13?
11:15ziltigfredericks: I meant more like (let [{m 12}] (inc m) => 13
11:16gfrederickszilti: what's the advantage there? isn't that the same as (let [m 12] (inc m)) but with two more characters?
11:16ziltigfredericks: I want to use this in a macro where I have a list of argument-names and a list of arguments
11:17gfrederickszilti: so you have a map and you're trying to generate a let expression for it?
11:18gfredericks,(let [m {'a 71 'b :foo}] `(let [~@(apply concat m)] foo bar))
11:18clojurebot(clojure.core/let [a 71 b :foo] sandbox/foo sandbox/bar)
11:18gfredericks^ any reason that wouldn't work?
11:19ziltiAh concat... ok
11:19ziltitbh I'm not yet sure what's the difference between ~ and ~@
11:19gfredericks~@ unpacks a sequence.
11:19clojurebot@ splices in a seq and foo# is a symbol, not a seq
11:20gfredericks`(x y ~@[:a :b :c])
11:20gfredericks,`(x y ~@[:a :b :c])
11:20clojurebot(sandbox/x sandbox/y :a :b :c)
11:20gfredericksvs
11:20babilenzilti: I found http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html (and subsequent parts) to be quite helpful to clarify this among other things.
11:20ziltiI see
11:20gfredericks,`(x y ~[:a :b :c])
11:20clojurebot(sandbox/x sandbox/y [:a :b :c])
11:21zilti(inc gfredericks)
11:21lazybot⇒ 3
11:21ziltibabilen: Thanks, I already know these links, but haven't worked them through yet
11:21babilenzilti: Hehe :)
11:22ziltiIt wasn't exactly clear to me what "splice" means in this context
11:22duck1123~@ is like the macro version of apply
11:22clojurebotAck. Ack.
11:22duck1123I wasn't talking to you clojurebot
11:22ziltilol
11:22morphlingclojurebot: @
11:22clojurebot@ , {a b c]
11:23gfrederickswhat a weirdo
11:23morphlingclojurebot: what is @
11:23clojurebotAlles klar
11:23duck1123if you do ~ it puts the value as is, if you do ~@ it inserts each item of the seq into the code
11:24gfrederickskeep in mind that neither ~ nor ~@ give you any additional power in a macro -- any macro could be written without them, just more verbosely and less readably
11:25ziltiOh, clojurebot speaks german
11:27ziltiI have a "(fn ['~'~@argslist] '~'~body)" now. Argslist are normal arguments in a vector (as in (def [x y z])). Could it be that this causes a "Can't use qualified name as parameter" error?
11:28gfredericksoh man I can't imagine that you actually have a reason to use '~'~@
11:28gfrederickszilti: maybe you should describe on a higher level what you're trying to do
11:28duck1123zilti: why are you quoting everything?
11:29ziltiWell... emh... I don't know an alternative to it
11:29gfrederickszilti: what's your motivation for using macros in the first place?
11:30ziltigfredericks: To avoid having to repeat myself over and over in the code
11:30llasramSo I noticed that on the alioth shootout benchmmarks, the Clojure implementation of the "n-body" bench mark is the largest of all the implementations code-wise, about 2x the size of the (average-ish) Java version
11:30gfrederickszilti: what sort of repetition?
11:30llasramI'm trying to create something which is a bit smaller, but I haven't gotten it down that much. Anyone have any ideas? https://gist.github.com/1326024
11:32ziltigfredericks: a nested function call with an additional arg
11:33ziltiSo I can do (do-something x) instead of (wrap (partial do-something x) y)
11:34duck1123most of the time, unless you have special requirements about evaluating the params, you don't need a macro
11:34gfredericksyeah. I'd say you probably want some kind of HOF at the most
11:35ziltiHOF?
11:35clojurebotHOF is Higher-Order Function
11:35duck1123wanting to pass a body to be wrapped in other code, is a valid use for macros, however
11:35gfrederickszilti: like is the issue that you want something like partial that adds arguments to the end instead of the beginning?
11:35cgraywould it break anything if (println foo) returned (identity foo)? because i just got bitten by that while trying to debug...
11:36gfrederickscgray: at this point I think that'd be a pretty major change
11:36gfrederickscgray: also it'd make the repl very repetitive
11:37ziltigfredericks: It's not about just adding that argument.
11:37duck1123cgray: it's usually easy enough to create a macro that evals, prints, and then returns the value
11:37cgraygfredericks: yeah, i guess it would... what i was trying to do was (->> foo (println) (bar)) and assuming that foo would get passed to bar
11:37cgrayduck1123: ok, good plan
11:37gfredericksduck1123: cgray: that sounds like a function, not a macro: #(do (println %) %)
11:38duck1123cgray: for instance, this is the one I use https://github.com/duck1123/ciste/blob/master/src/ciste/debug.clj#L5
11:38duck1123gfredericks: fair enough. In my case, I needed a macro because I needed access to the code
11:38cgrayduck1123: cool, thanks
11:39gfredericksduck1123: ah ha
11:40gfredericksduck1123: although in the middle of -> that might be a little weird
11:40duck1123it shows up oddly, but it's good enough to know what I was doing
11:41gfrederickszilti: well I can't give a more specific example without knowing more details
11:46ziltiI just don't understand why it gives me a "Can't use qualified name as parameter" error
11:47duck1123because clojure won't let you put a normal name. You need to gensym that name, or pass it in
11:47gfredericks,(fn [sandbox/foo] 12)
11:47clojurebot#<CompilerException java.lang.RuntimeException: Can't use qualified name as parameter: sandbox/foo, compiling:(NO_SOURCE_PATH:0)>
11:48duck1123zilti: so are you passing forms that are to be used as the body?
11:48gfredericks,[`(fn [foo] 12) `(fn [foo#] 12)]
11:48clojurebot[(clojure.core/fn [sandbox/foo] 12) (clojure.core/fn [foo__53__auto__] 12)]
11:48gfredericksthe former breaks, the latter works
11:50gfredericksalso there's ##`(fn [~'foo] 12)
11:50lazybot⇒ (clojure.core/fn [foo] 12)
11:52gfredericksthe worst thing about macros is that people are tempted to use them
11:55ziltiduck1123: yes
11:56duck1123zilti: here's a case where I used a macro to create a fn. help? https://github.com/duck1123/ciste/blob/master/src/ciste/core.clj#L28
11:57ziltiI have them all suffixed with # that doesn't help
12:03duck1123zilti: if possible, could you post what you have and how you call it, and what you're looking for?
12:06ziltiduck1123: https://gist.github.com/1326068
12:07duck1123zilti: a macro that creates a macro?
12:07ziltiduck1123: Yes
12:07gfrederickso_o
12:08TimMcNow you have 3 problems.
12:08gfrederickslol
12:08duck1123and I thought I wrote crazy macros
12:09TimMcduck1123: Now write a macro that makes you answer a riddle before it will allow your code to compile!
12:09duck1123how does nesting syntax quotes work. do you have to double escape them?
12:09TimMc,``a
12:10clojurebot(quote sandbox/a)
12:10gfredericksmacros are _usually_ not the answer, but I think it's fair to say that macros that create macros are _never_ the answer.
12:10TimMc,(pr-str ``a)
12:10clojurebot"(quote sandbox/a)"
12:10TimMcgr
12:10ziltihmm
12:10ziltiNo you don't have to double escape syntax quotes
12:11duck1123ok, first off. The top level of args do not need the #
12:12ziltiI did that to ensure that they aren't the reason
12:12gfrederickszilti: # is only for when you introduce a new symbol inside a ` form. Usually for let bindings or function arguments. The args to the top level macro are not inside ` so don't apply
12:17duck1123zilti: if you take the body and wrap it in a fn, then you could call that fn inside this named part and just make it a macro that creates fns
12:18TimMcHey, I just had a thought -- when people ask how to (apply) a macro, what they're actually asking for is eval!
12:19mefestoalso i think there is an issue with the (do ~@forms) which looks like you're expecting all the results to be saved in 'records but do will only return the last value
12:20duck1123mefesto: that's my code... that works
12:20mefestooic
12:21duck1123or at least it well once I fix the error I just introduced trying to get rid of naked uses
12:24gfredericksTimMc: okay, so let's say I want to do (apply and my-vals). You're saying what I'm trying to do is (eval (cons 'and my-vals))?
12:25gfredericksI think that makes sense. If you want to decide the arguments to the macro at runtime, eval would be essentially the way to do it.
12:27ziltiPhew. So now I have a macro that yields a function which calls a function. Works now.
12:35mefestozilti: did ring-1.0.0-RC1 fix that issue you were having with noir yesterday?
12:36mefestoi get that error anytime i enter a url to a directory of the public resources
12:36ziltimefesto: Yes and no... It did fix the problem I had yesterday, but now I have this: http://www.lyrion.ch/beta
12:37mefestozilti: ugh, i ran into that at work on fri ... doesn't happen when you test locally?
12:38ziltimefesto: Works fine locally (lein ring server)
12:38mefestoi was using apache to reverse proxy to ring ... which gave me that error
12:38mefestoi tried with nginx and it worked
12:38mefestomaybe a default content/mime type setting in apache?
12:39ziltimefesto: mime type would be one thing. The other is that it's just displaying the "not found" page which shouldn't be there. Btw I can't switch the server software - It's a shared server with a private Tomcat
12:40mefestozilti: for the root mapping i had to add a (defpage "/" [] (render "/home")) or something like that
12:40mefestoor /beta => /beta/home
12:41ziltirender /home ?
12:41mefestoyeah, where /home is the welcome page
12:41ziltimefesto: All it is currently is the default noir example, except that I've set a defpage "/" []. It doesn't change anything if it's in beta/ or not.
12:42ziltiSee http://www.lyrion.ch same thing
12:42ziltiOk, off eating
12:52ziltiback. mefesto, do you have any idea what might break the routing stuff?
13:12mefestozilti: ping
13:12ziltiam here
13:12mefestoi just reproduced the issue and found something for apache that fixes it
13:13mefestoone sec, i'll post the config
13:13mefestoalthough like you were saying about your host, you might not be able to change the apache config (htaccess sometimes lets you)
13:15mefestozilti: https://gist.github.com/0efa42d54857f269ffde
13:16mefestoi didn't set it up as the root app but should be similar
13:16ziltiOk, thanks!
13:16mefestozilti: http://mefesto.dyndns.org:8080/myapp
13:16ziltiBut why do you have 8080?
13:17mefestozilti: by default noir (jetty) runs on port 8080
13:17ziltimefesto: But I replaced the default noir server call in the server.clj with the gen-handler call from noir to create handlers for ring
13:18mefestozilti: replace the 8080 with whatever port your instance is running on
13:19ziltimefesto: I only have "(def handler (server/gen-handler {:ns 'lyrionch}))" so I guess it's 80?
13:19mefestozilti: when you launch the server from the command line doesn't it print out the port number?
13:20mefestozilti: or if you're on linux you can figure it out using netstat or something
13:21mefestozilti: netstat -tanp | grep java
13:21ziltimefesto: On the command line I use lein ring server 8080 because by default lein ring scans from 3000 upwards for a free port. I guess it's different when deployed by war
13:21duck1123when using a war, it's whatever the container is using. usually 8080
13:23ziltiduck1123: I had some stuff running on that server using Scalatra, didn't need to set anything for that. Also uses jetty locally and also deployed by war.
13:25duck1123so these are all showing up accessible on port 80?
13:25ziltiduck1123: Yes
13:26duck1123ok, and you have apache or something proxying that call right?
13:27ziltiWell I guess so, yes. It isn't my apache.
13:27duck1123that's probably what's happening
13:28mefestozilti: i think this is because the 404 page generated by noir isn't setting a content-type header and apache defaults to text/plain. as an alternative to the apache conf stuff you can add middleware that will add :content-type "text/html" to the response map if it's empty
13:28ziltiI've now included mefestos gist in my htaccess. I wonder how I activate it
13:29mefestozilti: ring might already have something for this so check there first
13:29mefestohttps://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/content_type.clj
13:29duck1123I had something similar happen is it asking you to download the file?
13:30ziltiBasically "my" apache determines the content type based on file extensions
13:30duck1123I had an issue with netty and apache where netty would send back a not modified and apache would mess it up
13:32ziltiIs the .htaccess used immediately? Or is it cached?
13:33mefestomeh that built-in ring middleware defaults to application/octet-stream
13:36ziltiIf it's not cached then I'm not allowed to do anything like that in the htaccess. I even put some random stuff in it to see if it's parsed, and nothing happened.
13:37duck1123you can't put location info like that in htaccess I believe
13:39zilti"Game Over"
13:40mefestozilti: example w/out modifying apache conf: https://gist.github.com/1326168
13:41mefestozilti: updated my setup and removed the DefaultType from apache
13:42R4p70rWhat is the Clojure equivalent of Haskell unzip? Which from what I understand is an f such that (f [[1 2] [3 4] [5 6]]) => [[1 3 5] [2 4 6]]
13:43ziltimefesto: But that doesn't solve the routing problem...
13:44mefestozilti: i thought you already had the routing working from apache -> yourapp and it was just the 404 page coming back as plain text?
13:44ziltimefesto: No, there's only the 404 page, nothing else, no matter what route
13:44duck1123does noir have any way of intercepting the requests?
13:44Raynesduck1123: You can use pre-route
13:45duck1123you could probably add some middleware in there to inspect it
13:45mefestohttps://gist.github.com/1326168
13:45mefestoline 10
13:45duck1123could it be that your requests are coming in with the context appended?
13:47mefestozilti: you're running this in tomcat right?
13:47ziltiyes, Tomcat 6
13:49mefestozilti: how is apache talking to tomcat, mod_jk, proxy, other?
13:51tufflaxR4p70r I don't think something that does that exists. But I wrote this, maybe it will help. But then you'd have to flatten first. http://pastebin.com/GSjej6hG
13:52R4p70rtufflax, Thanks I'll take a look
13:58mefestoi still get the FileNotFoundException from ring (1.0.0-RC1) when a directory is accessed
14:00mefestook n/m ... lein clean :)
14:01ziltiHm now I get HTTP Status 404 - Servlet lyrionch.server/handler servlet is not available
14:09ziltimefesto: I've added your middleware, now my server.clj looks like this: https://gist.github.com/1326198 I still have the same source-code-404-page when having the port set to 8080, and when I set it to 80 I get "HTTP Status 404 - Servlet lyrionch.server/handler servlet is not available"
14:11mefestothis is middleware that is setup in the main but you don't use the main ... you deploy as a war to tomcat, right?
14:11ziltiyes
14:12mefestoyeah this middleware is only added if you do `lein run`
14:12mefestoi dunno how to do it for a war setup
14:15ziltimefesto: I just had to add (server/add-middleware wrap-content-type "text/html") in front of the (def handler (server/gen-handler {:ns 'lyrionch})) statement
14:15ziltiNow I have at least a good-looking 404 page
14:16mefestozilti: progress :)
14:17ziltimefesto: :) Well now I'll try to log the routes... What's the recommended method for logging in clojure?
14:17Raynescake latest-version clojail
14:18RaynesDamn, wrong window.
14:18mefestozilti: if it's just for temp why not just println?
14:18mefestozilti: otherwise, clojure.tools.logging
14:18RaynesAnd don't ask why I don't know what the latest version of my own library is.
14:18ziltimefesto: Because I won't be able to see that on my server ;)
14:18ziltiRaynes: lol
14:20mefestohmm some sneaky guy tried using my server as a forward proxy :)
14:23ziltimefesto: Where's the current route stored?
14:24mefestozilti: (:uri request)
14:28Raynes&(require 'clojure.string)
14:28lazybot⇒ nil
14:28Raynes&(clojure.string/join [\a \b \c])
14:28lazybot⇒ "abc"
14:28Raynesamalloy_: ^ Unbroke that for you, wherever you are. <3
14:30ziltimefesto: Argh... I can't get hold of the request variable anywhere outside the middleware...
14:31mefestozilti: can you post your middleware?
14:31ziltimefesto: It's your middleware, unchanged
14:31mefestothe content type one?
14:32ziltiYes... Now I think it's best to create a second one for adding the route to the output?
14:32mefestohttps://gist.github.com/1326237
14:32mefestoring probably has stuff for this tho
14:33ziltilog?
14:33clojurebotsee logs
14:33ziltiBut I don't have any logging set up.
14:33mefestoreplace that with your log function :)
14:34ziltiIsn't there a way to add this to the ouput?
14:35mefestozilti: output being the response body?
14:35ziltiyes
14:36mefestozilti: aren't you able to check the tomcat logs? if so then println should be good enough for this debugging
14:36ziltiIt's stored in there? Yes, I can access them.
14:36mefestozilti: otherwise, assuming the response body is a string then the typical clojure concat stuff should do
14:37mefestozilti: yeah, last i recall tomcat dumps stdout into the logs
14:37ziltimefesto: I don't know how to access the response body in the middleware
14:37mefestozilti: (let [res (handler req)] ...)
14:38mefestozilti: res is the response map ... return the modified version from that let
14:38ziltimefesto: Yes, but what key does the content have? :body ?
14:38mefestohttps://github.com/mmcgrana/ring/blob/master/SPEC
14:38mefestoyup :body
14:39ziltiOh, nice! Thanks!
14:41zilti(inc mefesto)
14:41lazybot⇒ 1
14:46mefestodoes lazybot keep score?
14:47mefesto(dec mefesto)
14:47lazybotYou can't adjust your own karma.
14:47mefestohah nice
14:48ziltiARGH How long can it take to restart a Tomcat!
14:49ziltiOh no... I accidentally queued 3 stops and 3 starts...
14:50mefestozilti: yea i think im done using tomcat/jboss these days
14:50ziltiUsing jetty instead?
14:50mefestozilti: i'm new to noir but so far it's got everything i need
14:51mefestozilti: i'm thinking just using lein run is good enough
14:51mefestozilti: ex. lein run prod
14:52mefestozilti: i have a few (simple) apps to be made at work and i'm going to try this out for them
14:52ziltimefesto: The only problem with Tomcat I have is that when deploying using war files you can't deploy to the root context
14:53mefestozilti: you should be able to
14:53ziltimefesto: It seems to only be possible by manually copying the contents of the war into the root context
14:53mefestohttp://benhutchison.wordpress.com/2008/07/30/how-to-configure-tomcat-root-context/
14:54mefestoso something like `lein uberwar ROOT.war` ?
14:54gfrederickscp my.war tomcat/webapps/ROOT.war
14:58ziltiHm right now it doesn't println to the log file
14:58mefestozilti: is there a catalina.out file?
14:59ziltimefesto: It doesn't println to the log file? Which folder is that cataline.out file supposed to be?
14:59mefestohttp://tomcat.apache.org/tomcat-6.0-doc/logging.html
15:00mefestozilti: not sure. i thought it was the tomcat root dir
15:01mefestoThe "Console" section says that System.err/out go to that file
15:04mefestozilti: find it?
15:04ziltimefesto: Unfortunately: no
15:05mefestozilti: on linux?
15:06mefestozilti: if so try `find /dir/to/tomcat -name catalina.out`
15:07ziltimefesto: Yes, on linux. But I'll first try (java/util/logging/Logger/global/info
15:08RaynesThis is why I don't do web development.
15:08mefestozilti: clojure.tools.logging should work for you then. i believe it'll use whatever underlying logging framework is available at runtime (commons logging, java.util.logging, log4j, etc)
15:08RaynesOr, why I'm happy that I don't have to do *much* web development.
15:08mefestoThis is why i can't stand java web containers
15:08daakui'm trying my hand at some complex clojure (for me) and java (which i don't really know) by writing a gen-class that extends java.util.logging.Handler and i'm getting a "No matching ctor found for class" error that i can't seem to figure out and would love some help with: https://gist.github.com/bab3a0a8160f9abb1714
15:10daakui tried to decompile the generated class, and oddly i do see a constructor with the signature i'm using (what the rest of the code was doing is beyond me)
15:11gfredericksdaaku: what're you doing when you get the error?
15:11daakugfredericks: trying to instantiate my handler class: (ring-loggly.core.handler. "foo" 200)
15:11daakugfredericks: this happens at (compile 'my.ns) btw
15:12gfrederickshm
15:13daakulol, i'm not there yet. i figured if i can get this to work, i'll know more about java interop as well as clojure concurrency
15:14ziltiOk bye for today. Progess: I'm getting an exception now...
15:14gfredericksdaaku: if it were me, I would try things like putting the reference to the class after the gen-class, or in another namespace so you can properly import it. But really I don't know what's going on.
15:15daakugfredericks: seems unlikely it's an order thing since it does seem to find the class, just not the constructor (at one point the class wasn't being found either)
15:16gfredericksdaaku: agreed. That's why I gave up before mentioning it.
15:28simardis there a lib for git/clojure interop ?
15:29maiowhat's wrong with (iterate repeat :foo) ?
15:32TimMcmaio: What are you trying to accomplish?
15:33maio(= (repeat 100 :foo) (take 100 (iterate ___ :foo))))
15:33maiowhat would you put instead of ___?
15:33TimMc,(doc iterate)
15:34clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
15:34TimMcmaio: identity would work, but just use the (repeat) function.
15:37maiook thanks. I'm doing clojure koans btw - https://github.com/functional-koans/clojure-koans/blob/master/src/koans/lazy_sequences.clj#L24
15:38TimMcmaio: Oh, in that case I shouldn't have told you the answer.
15:38TimMcDo you understand why it works?
15:40maiowell I understand one that is few lines above (= __ (take 20 (iterate inc 0)))
15:40maiothat would call inc 0, than inc of that inc before and so on
15:41maiobut I'm not sure I get that example I needed help with
15:42maioI would just put (repeat :foo) there
15:43Raynes&(take 5 (iterate identity :foo))
15:43lazybot⇒ (:foo :foo :foo :foo :foo)
15:44maio&(take 5 (repeat :foo))
15:44lazybot⇒ (:foo :foo :foo :foo :foo)
15:44maio&(repeat 5 :foo)
15:44lazybot⇒ (:foo :foo :foo :foo :foo)
15:44RaynesYes, that'd make more sense. But I don't think koans are meant to make sense. ;)
15:45brehautif a lazy seq falls in the forest, is it fully realized?
15:45Raynesbrehaut: Depends -- does it land on a gopher?
15:45brehautRaynes: nobody uses gopher these days, so i think we can assume no
16:04maio,(doc complement)
16:04clojurebot"([f]); Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value."
16:16TimMc,(take 5 (iterate complement :hi))
16:16clojurebot(:hi #<core$complement$fn__3653 clojure.core$complement$fn__3653@5b0f2e> #<core$complement$fn__3653 clojure.core$complement$fn__3653@419d65> #<core$complement$fn__3653 clojure.core$complement$fn__3653@1c477f9> #<core$complement$fn__3653 clojure.core$complement$fn__3653@1a089a6>)
16:17gfrederickswhat a fantastic collection of functions!
16:17TimMcoof
16:17TimMc,(take 5 (iterate not :hi))
16:17clojurebot(:hi false true false true)
16:17TimMcI always do that.
17:03daakui've successfully written some code that pipes java logging to loggly.com in a single background thread that batches them in a number of async http requests. it's using gen-class and atoms, and is pretty small (45 lines) and would love some feedback if anyone's got some time: https://github.com/nshah/ring-loggly.clj/blob/master/src/ring_loggly/core.clj (the ring middleware aspect is still wip)
17:05daakuone thing i discovered is that i might be able to use proxy instead of gen-class, but haven't figured it out yet
17:08zakwilsonI know there have been a bunch of different things written to allow Clojure to connect to IRC and do various things. I want to join a channel and receive all the channel's messages, triggering a callback when a message is received. Which is likely to be the simplest to work with?
17:18Rayneszakwilson: I maintain an IRC library.
17:18Rayneszakwilson: https://github.com/Raynes/irclj
17:19RaynesI use this library in lazybot. It hasn't had much attention by me lately, and I plan to rewrite parts of it in the future, but in the meantime it works pretty well and is dead simple.
17:19RaynesThe example bot should be helpful.
17:20zakwilsonRaynes: looks like exactly what I need. Thanks.
17:21Rayneshttps://github.com/raek/lcug-examples/tree/master/bot is another example bot.
17:26teromRaynes: the link on irclj page (http://www.github.com/Raynes/sexpbot) gives 404
17:27Raynesterom: Yeah, it's http://github.com/flatland/lazybot
17:27RaynesI'll update that shortly.
17:28jodaroirclj: i see what you did there
17:28Raynesjodaro: Indeed.
17:28Raynesjodaro: See why you should stop using crappy names?
17:30jodarototally
17:30jodaroi'm missing an important part of the creative process
17:32RaynesJust ask me and I'll give you golden names.
17:33Raynesjodaro: For example, clj-wordnik = wordnak, clj-klout = repute.
17:34zakwilsonI just found that the google search 'where did contrib go' gives the right answer.
17:41Raynestechnomancy_: Yeah, I don't understand people who name things clj-*
17:41RaynesUse your mind, friends. There are all sorts of lovely names you can squat.
17:41llasramCL people who are used to projects named cl-* ?
17:41RaynesThat's the whole problem with CL. Crappy names.
17:42llasramnice
17:42RaynesEven the name of the language -- Common Lisp. I mean, 'common' is in the name!
17:42llasramYou could even extend that to a statement about namespaces...
17:42RaynesWhat if Clojure was called Typical JVM Lisp.
17:42technomancy_I've said it before, Common Lisp function names are optimized for Wheel of Fortune.
17:43technomancy_how else do you explain rplacd?
17:43llasramlol, I was just trying to make sure I was going to spell "rplaca" right
17:44llasramAlthough I've been reading /Let over Lambda/, and even Hoyte admits it's probably one of the worst-named functions ever
17:45technomancy_calling filter "remove-if-not" has got to be on that list though
17:45technomancy_dont-keep-unless-predicate-isnt-false
17:47llasramEh. I'm not going to defend CL (never really used it), but any langage of any age will have a few naming warts. I mean, Clojure is all of what, 3 years old? And find vs get, for just one example
17:50technomancy_yeah, or some or contains
17:50technomancy_though the former is really CL's fault too
17:51llasramThere is only possible solution: go back in time, and replace CL with Scheme when no-one is looking
17:53manutterwoot, just got my blog added to Planet Clojure
17:54manutterI haven't been Clojure blogging much, anyone got any good tips, syntax colorizers for Clojure, etc?
17:54manutterI'm also trying to branch out into screencasts too
17:55scottjmanutter: have you seen http://youtube.com/emailataskcom screencasts?
17:55manutterno, but I will, thanks :)
17:56Raynesmanutter: What blogging engine do you use?
17:56manutterblogger right now
17:56RaynesYikes.
17:56RaynesNo clue in that case.
17:56manutterI do some other blogs on WordPress
17:57RaynesI'm into octopress.
17:57manutterwow, haven't heard of that one
17:57RaynesWordpress's SyntaxHighlighter plugin can highlight Clojure.
17:57scottjhttp://jaderholm.com/blog/blog/2011/09/26/blogging-with-org-mode-and-octopress/
17:57RaynesOctopress is a developer-oriented blogging engine.
17:58scottjwith org+octo you can get the exact same clojure highlighting (and any other language) as you get in eamcs
17:58manutterawesome, that's exactly the kind of stuff I was hoping to find.
17:58RaynesI do note taking and… everything else in Springpad.
17:59jcromartiedoes anybody know how to use clj-http with cookies?
17:59jcromartiewrap-cookies in particular
18:00jcromartieI'm reading the source in the mean time https://github.com/dakrone/clj-http/blob/master/src/clj_http/cookies.clj
18:00Bronsahttp://kimochi.ath.cx/up/9e0a18c69940ae9e20a84cc7846c961b.avi
18:01jcromartieBronsa: what's that?
18:02Bronsasome paredit-like thing i'm working on
18:02jcromartieoh cool
18:02jcromartie:) paredit is the way to go
18:02technomancy_M-x htmlize-buffer is great for blogging
18:03llasramOh man, htmlize-buffer is totally my blog's syntax-highlighting engine
18:03manutterOo, that sounds like a good one too, thanks.
18:03jcromartieI feel like paredit is much closer to "modifying the code" than simple text editing, which is more like "modifying the text that makes up the code"
18:04technomancy_llasram: supposedly htmlfontify replaces it in 23 or 24, but it still has a couple bugs with giving the default face a different style.
18:05Raynestechnomancy_: I was using that for my talk, but then I realized I could gist my code and then copy it over to keynote and maintain highlighting. Github's highlighting is easier to see in my talk, since I use solarized dark in Emacs which is pretty low-contrast.
18:05technomancy_there's a github theme for Emacs =)
18:05technomancy_but yeah, I basically only use htmlize with the stock theme
18:05RaynesBesides, I'm of the opinion that gist solves all problems.
18:06llasramtechnomancy_: Hmm. Thanks for the heads-up. Works fine in 23, but something to check when I make the switch to 24
18:06scottjyou can have different themes per frame
18:06RaynesI know, but htmlize gives me an extra step of having to open the html in my browser to copy it over. With gist, I just gist the code. Not that there is a huge difference.
18:07technomancy_yeah, if you're using a non-textual format for your slides... but then you have the proverbial two problems.
18:08llasramRaynes: Or you can do what I did. I wrote my own blog engine, and the only way to post to it is from code written in emacs-lisp, which uses htmlize-buffer to syntax-highlight code examples before posting. Totally a sane solution
18:08RaynesYeah, man.
18:08technomancy_llasram: 93-line rakefile, man. can't go wrong.
18:09scottj(defun raynes () (interactive) (htmlize-buffer) (browse-url-of-buffer) (run-shell-command "conkeror -e 'cmd_selectAll(); cmd_copy();"))
18:10technomancy_scottj: nice; didn't know about browse-url-of-buffer
18:10llasramtechnomancy_: Nice. Yeah, I need to switch to something else. Either something super-simple like that, or something off-the-shelf. I haven't touched my current blog code in years, and wouldn't know where to start even e.g. brushing up my stylesheets w/o spelunking
18:10RaynesKeynote is pretty nice. I needed nice and simple button buttons to press. It's my first ever talk. I'm scared of everything.
18:10RaynesMinus the extra 'buttons' there.
18:10technomancy_Raynes: all the more reason to use version control
18:11raflis there a standard or community standard for writing clojure documentation?
18:11RaynesI do use version control, though it doesn't do much good with binary files. ;)
18:11Raynesrafl: Marginalia is a good option.
18:11RaynesAutodoc is another.
18:12RaynesBut there aren't really any 'standards'.
18:13scottj;; is a pretty good standard
18:13Raynesscottj: o/
18:13raflas in, even attempting to come up with a way to "give me the docs for $function" is basically futile?
18:14llasramdocstrings?
18:15raflthat seems kinda useless if people tend to use other tools for providing their docs anyway, which is the impression Marginalia gave me
18:15raflunless of course i didn't actually get what it does.
18:16scottjI think marginalia is for above and beyond docstrings
18:16scottjor a pretty way to display docstrings and more
18:16raflso, if someone were to use marginalia for his docs, would that mean he normally wouldn't even bother to provide docstrings?
18:17scottjyou'd still provide docstrings
18:17scottjyou know about repl ways to read docstrings right?
18:18wtetznerif you're using slime, you can use M-. to jump to a function definition, which lets you easily see the docstring
18:18llasramEr, or C-c C-d C-d to just show the docstring for it
18:18raflstepping back a bit - one of the annoyances i'm having is it being too hard and distracting to go to the docs for a given function or a synopsis of a full module or whatever. they all tend to be in very different places
18:19rafland not necessarily for modules i have already installed, but for ones i'm trying to figure out whether or not to use them
18:20raflit just seems slightly odd to have to go to different web pages all the time or having to figure out where the source lives for every one of them
18:20rafli figured that, if there was some similarity in how all the modules would provide their docs, it'd be easy enough for me to write something that'd just give me docs for a module on clojars, given its name
18:21raflbut that doesn't seem very practical, apparently
18:21scottjllasram: same thing in tooltip http://www.youtube.com/watch?v=dio__Qylp-s#t=1m11s
18:22llasramscottj: Yah, I got ac-slime working just a few weekends ago. Thanks for the tip, though :-)
18:22llasramAny golfers in the house? I mentioned earlier, but I'm trying to make the Clojure solution for this alioth benchmark not the longest (code-wise) for any language http://shootout.alioth.debian.org/u64q/performance.php?test=nbody&amp;sort=gz
18:23llasramHere's what I have so far: https://gist.github.com/1326024
18:23llasramWhich is now slightly shorter than the Haskell version, but longer than the Java version (by their metric)
18:23scottjrafl: have you looked at autodoc? maybe you could run that on the various projects.
18:24Raynesibdknox: HAI
18:24scottjrafl: also if you're using emacs/vim you can use tag files to navigate to the symbol's source w/o having it running in your system
18:24ibdknoxRaynes: OMG
18:24ibdknoxRaynes: HAI
18:25raflscottj: i will in a minute. right now i'm being distracted by the shiny that is ac-slime :)
18:25Raynesibdknox: I require a new version of noir without cssgen's contrib dependency. No, I demand it.
18:25ibdknoxI think that's fair
18:25ibdknoxI'm annoyed with cssgen anyways
18:26ibdknoxRaynes: give me a minute
18:26RaynesIt's just, it puts contrib on tryclojure's classpath, yet tryclojure runs 1.3.
18:26scottjhave you used gaka?
18:26RaynesIt's all very confusing and scary.
18:26Raynesibdknox: Also, I got tryclojure running on heroku last night. :>
18:26ibdknoxwow
18:27ibdknoxRaynes: I'm impressed. I never looked at clojail that in depth but I would've thought it required some stuff that wouldn't work on heroku
18:27Raynesibdknox: Took me like 10 minutes.
18:27RaynesYeah, me too!
18:27ibdknoxthat's... awesome
18:27RaynesAll I had to do was specify the policy file on the command-line.
18:27ibdknoxvery cool
18:27RaynesHeroku apparently doesn't care, since it isn't like unsandboxed code can damage anything anyways.
18:28llasramI haven't used Heroku (yet), but I saw one of their guys' talks at Strange Loop. AFAI could tell from what he said, you basically just get a chroot in an EC2 box to do whatever you want it?
18:30ibdknoxeh
18:30ibdknoxyou have no local storage
18:31ibdknoxbasically you can't interact with the filesystem last I knew
18:31ibdknoxmaybe that changed recently though
18:31technomancy_ibdknox: well... that was on the old stack
18:31technomancy_back when it was all-ruby
18:32ibdknoxtechnomancy_: huh.. I tried a while back and had bad things happen when I tried to read a file
18:32ibdknoxtechnomancy_: and that was with Clojure
18:32technomancy_hmm... definitely let me know if you run into that again
18:32technomancy_you can write to the filesystem, but you should only use it as a scratch-pad rather than for permanent storage.
18:32ibdknoxright
18:32technomancy_(which is actually true of everything on EC2, not just heroku)
18:32ibdknoxyep
18:33ibdknoxtechnomancy_: you saw that Raynes got try-clojure onto heroku in 10 minutes, yeah?
18:33ibdknox(inc technomancy)
18:33lazybot⇒ 17
18:33technomancy_yeah, that's sweet
18:40algalspeaking of clojure in the cloud, is there anything standard / good / obvious for persisting clojure data structures to the Google App Engine datastore?
18:41daakuis there a null-safe built in macro?
18:42ibdknoxdaaku: huh?
18:42ibdknoxalgal: just pr-str them?
18:43daakuibdknox: something to deal with calling a java method on the result of null value from another java method where object or null is returned
18:44algalibdknox: yeah, read/print serialisation to a string seems like the drop dead simplest way. Was wondering if there's anything non-obvious I should know about. New to clojure.
18:46ibdknoxalgal: I mean you could try to do something clever, splicing maps out into columns and such, but it's probably not worth it, unless you're doing crazy indexing
18:46ibdknoxalgal: it's hard to tell without knowing your use case though.
18:46ibdknoxdaaku: ##(doc if-let) is the only thing I can think of
18:46lazybot⇒ "Macro ([bindings then] [bindings then else & oldform]); bindings => binding-form test If test is true, evaluates then with binding-form bound to the value of test, if not, yields else"
18:47technomancy_daaku: there's -?> in clojure.core.incubator I think
18:47daaku-?> looks like it
18:47daakuthanks technomancy_
18:47scottjthere's .?. also
18:48daakui just came up with a crappy one: (defmacro null-safe [default & body] `(try (do ~@body) (catch java.lang.NullPointerException e# ~default)))
18:48ibdknoxI should look at the incubator stuff aparently :)
18:48ibdknoxRaynes: 1.2.1-SNAPSHOT no longer has cssgen
18:49Rayneso/
18:49daakuman there's a lot of cool stuff available
18:52algalA newb question -- I notice add-classpath is deprecated. Is there some new function that replaces it? Without it, it seems like my REPL is crippled to whatever the class path was when I started it. Or am I missing something?
18:58technomancy_algal: most people just restart
18:58technomancy_you can try https://github.com/cemerick/pomegranate though
18:59algaltechnomancy_: ok, thanks.
18:59algaltechnomancy_: and thanks also for leiningen. It's a great help -- been away from Java so long, maven etc.. is a mystery to me. nice to find something sane to get started with.
19:00technomancy_great! =)
19:00algalI even liked the short story too, so it's a double win. :)
19:17algalspeaking of leiningen, is ~/.lein/bin/swank-clojure a sensible place to put customisations if my "default" (i.e., non-project) REPL's classpath? (e.g., if I wanted contribs to be available so I could get to trace )
19:19technomancythat's one way to do it. I just generate a new scratch project
19:22algaltechnomancy: okay, cool. I like to have a REPL just a command away in emacs, so I'm trying to just find the defaults..
19:23RaynesBleh. Scratch projects are for wimps who don't believe in The Global Project, technomancy.
19:24RaynesWimp.
19:24algalThe Global Project is life itself, eh?
19:24Raynesalgal: It was a vague reference to a non-argument we had about cake's global project concept a while back.
19:25algalRaynes: ah.
19:25RaynesHe gave me a line that I've had a lot of fun with since then: "Must be solving problems I don't have."
19:25algalRaynes: That is a good one! Reminds of an old Quaker saying, which I quite like. "It does not speak to my condition."
19:26Raynestechnomancy is the Shakespeare of programming.
19:26algali can believe it
19:26ibdknoxthis was him: http://shakespearelang.sourceforge.net/report/shakespeare/
19:27algalyeah, saw that on HN recently
19:28algalContribs is pretty stable stuff, I'm guessing? (again, newb question….)
19:28ibdknoxnoooooo
19:28ibdknox~contrib
19:28clojurebotlatest contrib is 947
19:28ibdknox..
19:28ibdknoxalgal: don't use contrib
19:29ibdknox~where did contrib
19:29clojurebotcontribute is http://clojure.org/contributing
19:29ibdknoxok
19:29algalibdknox: oh really… ?
19:29ibdknoxthe bot is pissing me off lol
19:29Raynes$google where did contrib go
19:29lazybot[Where Did Clojure.Contrib Go - Clojure Design - Clojure Development] http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
19:29Raynesibdknox: lrn2bo
19:29Raynest
19:29ibdknoxalgal: yeah, the old monolithic contrib is phased out
19:30ibdknoxRaynes: one of these days I will understand clojurebot and his mysterious ways.
19:30ibdknoxthat day is not today.
19:30algalah.
19:30RaynesMeh, just understand lazybot. I'll help.
19:32ibdknoxlazybot: is clojurebot annoying???
19:32lazybotibdknox: How could that be wrong?
19:32ibdknoxsrsly.
19:33algalibdknox: So, monolithic phase-out means just rejiggering of the namespace, but it's still just one jar? and half the stuff hasn't been officially upgraded and renamespaced for clojure 1.3? Am I getting it?
19:33ibdknoxalgal: not one jar
19:33algalibdknox: (I mean, understanding it.)
19:33ibdknoxalgal: they're all different projects now
19:33algalmamma mia.
19:33ibdknoxalgal: the idea being that you shouldn't be bringing down some epic jar when you just want one function
19:34ibdknoxalgal: also, the projects move at very different speeds
19:35algalokay, so if it's being broken into loads of smaller jars, then that makes distribution more complicated. Is that solved by them all living in an official repo that people access via maven / leiningen / etc. ?
19:35simarddoes anyone know of a clojure library for accessing git ? I'm having a hard time finding that on google, as every lib these days is hosted on github
19:35algal(Sometimes tough to back out this big picture stuff just by googling reading etc.. fast moving plat and all that.)
19:35ibdknoxalgal: if it's an official contrib library it's in maven central
19:36algalibdknox: ok. And some of the parts of the "old 1.2" contrib have been officially upgraded and others are waiting for maintainer input and others have been orphaned…. ?
19:36ibdknoxsimard: https://github.com/TobiasRaeder/clj-git
19:36ibdknoxsimard: also, there's jgit
19:37ibdknoxalgal: correct
19:37algalibdknox: Great. Thanks.
19:37Raynessimard: Also, if you need to work with the Github API, check out https://github.com/Raynes/clj-github
19:38ibdknoxRaynes: oo, didn't know about that
19:38Raynesjodaro: And before you call me out on having a clj-* library, it's only because I haven't come up with an interesting name yet. ;)
19:39simardibdknox: Raynes: thank you both
19:39ibdknoxRaynes: what do you use the github api for?
19:40RaynesI believe I wrote it because I was working on a cake plugin for working with Github.
19:40RaynesBut other people use it now, so I still maintain it.
19:40ibdknoxmm
19:40RaynesI also thought I'd want to use it in lazybot for commit reporting in channels, but I ended up using using a post-receive hook + web server.
19:41ibdknoxyeah, I've always ended up using hooks
19:41RaynesP.S.: If you had an IRC channel for noir, I could get lazybot to report commits in there with compare links and everything.
19:42ibdknoxoo
19:42ibdknoxno one has requested a Noir channel yet
19:42ibdknoxthat's the only reason I haven't done it
19:42ibdknoxwow
19:42ibdknox#noir is actually empty
19:42RaynesMight become necessary at some point. Noir is obviously going to be the most popular web framework.
19:43ibdknoxobviously.
19:43ibdknoxI'll have achieved victory once we bully amalloy_ into using it... :D
19:43RaynesWhen I get some time, I'll do the work required for 4clojure to use it.
19:44algalthanks for the tips, chaps.
19:44Raynes4Clojure's routing and stuff is relatively simple. I did some refactoring of it a while back, so it shouldn't be troublesome.
19:46ibdknox:)
19:46ibdknoxok
19:46ibdknoxI registered noir
19:46ibdknoxlol
19:47Rayneso/
19:48simardRaynes: do you have an example of using your lib ?
19:48Raynessimard: clj-github?
19:48simardyes
19:48RaynesWhat do you want to do?
19:48simardshort answer: I don't know
19:48ibdknoxlol
19:48RaynesWell, there is a brief example under 'Usage' in the README.
19:48ibdknoxyou just know you want to do something with github?
19:49simardI'd like to.. retrieve a file from a repo on github
19:49simardmodify it, and commit it bacj
19:49RaynesOh. Yeah, this wont help you with that.
19:49simardyou mean the lib, or your readme ?
19:49ibdknoxsimard: you need jgit for that
19:49simardok
19:49RaynesYou need jgit for that.
19:49Raynesibdknox: Damn you.
19:50simardso that wrapper around jgit, is it faily usable ?
19:50simardclj-git
19:50ibdknoxit implements like two things
19:50ibdknoxlol
19:50RaynesLooks like it. Deps are a bit out of date though.
19:51RaynesBut in general, jgit shouldn't be hard to use. clj-git is probably like a big usage example.
19:51ibdknoxmore or less
19:51ibdknoxthere's really not much there
19:52simardok, yeah I'll read to get an idea of how to use jgit
20:08dnolenwhy constraint logic programming rocks, http://dosync.posterous.com/a-taste-of-ckanren
20:09ibdknoxFor those playing the home game, #noir is now open :)
20:35technomancysimard: I wrote https://github.com/technomancy/quickbeam but it was more of an exercise in swarm coding than an actual useful library
20:35technomancys/I wrote/I wrote with the help of the Boston Clojure Group/
20:35technomancybased on jgit
20:36Raynestechnomancy: Boston Clojure Group? Don't you live in Seattle? You must get around.
20:37technomancyapparently they schedule their meetings around my travel itineraries
20:37RaynesI bet.
20:37technomancyor they did anyway; the first 3 always coincided with Sonian team get-togethers.
20:38simardtechnomancy: swarm coding ?
20:38technomancysimard: it's like pair programming but with 4+ people =)
20:39simardoh, you mean chaos :)
20:39technomancyas close to chaos as you can get and still end up with a functioning library published to github and clojars =)
20:39simardhehehe
20:40jamiltronI only code when I have a cheer squad accompanying me.
20:41RaynesI only code when I have The Ting Tings performing That's Not My Name at the other end of the room.
20:42jamiltronNice
21:04meta_Why does clojure.walk and into destroy meta?
21:07RaynesMan, writing talks is hard. Why did I wait to the last minute to write this thing?
21:07meta_I mean, I know _why_ as the bugs in the clojure 1.3 code are obvious...
21:07Raynesredinger: I'd appreciate it if you'd go ahead and move the Conj to December. That isn't unreasonable, is it?
21:07meta_I just wonder if there was a reason why that I'm missing.
21:09meta_details: 'into uses transients but forgets about meta.
21:10Raynes"Stuart, the author, hates it because he says it’s too buggy and breaks on too many edge cases..."
21:10RaynesRE: clojure.walk
21:11RaynesThat was '10. Not sure if anything has changed since then.
21:11meta_I've heard that back then, and I get it (I still like clojure.walk...)
21:11RaynesI do too. :>
21:11RaynesGuilty pleasure.
21:11ibdknoxit's really slow
21:12meta__into_ is the big bug IMHO
21:12RaynesWe use it significantly in Clojail.
21:12meta_I'd like to build a case:
21:12meta_1. metadata has its uses
21:13meta_2. currently it cannot be used with clojure 1.3 because it's somewhat like stepping on a mine field wether or not it will survive after calling a clojure core fn.
21:13meta_is that too harsh?
21:15meta_It's just me posting the short unfiltered version because it's irc...
21:16meta_I heart Clojure.
21:38technomancymeta_: that's always been a big question mark with metadata usage; it's unclear which operations preserve it and which don't
21:39meta_I vote that Clojure (core fns) should never lose metadata.
21:39meta_Who's with me?
21:40spoon16is there a way to tell if a sequence is lazy?
21:41technomancymeta_: I think it should be decided on a case-by-case basis. into should probably propagate the metadata of its first arg though.
21:42meta_I'm actually fine with that _except_ for into and clojure.walk (I love those fns and rely on them heavily, but I'd also love to use metadata too...)
21:43meta_I guess I'm just arguing for those two things.
21:43technomancymaybe bring it up on the mailing list
21:44meta_That's a good idea. Would you mind doing that ? <grin>
21:45technomancyI don't have a very good track record for getting my fixes into clojure =\
21:45meta_heh heh...
21:45meta_ty for the comments.
21:47technomancysure
21:59gfredericksdoes anybody know what maven repo I need to add to get clojure.algo.generic?
22:02simardto whoever recommended me "The Joy of Closure", thank you
22:03Raynessimard: That'd be pretty much everybody.
22:03RaynesNot many people don't like that book.
22:04simardthanks everybody
22:04simard:)
22:06gfredericksI've recommended JoC a number of times and have never looked inside it at all
22:44Raynesgfredericks: That's the Clojure hive mind.
22:44RaynesOnce you've been here for a while it gets inside your head.
22:56daakuis there a better way to write this: (array-map :trace 0 :debug 1 :info 2 :warn 3 :error 4 :fatal 5) ? i feel i should be able to use [:trace :debug :info :warn :error :fatal] (iterate inc 0) instead, but can't seem to figure out what's the best way to write it
22:58technomancy,(map-indexed vec [:trace :debug :info :warn :error :fatal])
22:58clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>
22:58technomancy,(map-indexed vector [:trace :debug :info :warn :error :fatal])
22:58clojurebot([0 :trace] [1 :debug] [2 :info] [3 :warn] [4 :error] ...)
22:58daakusweet, even better. thanks technomancy
22:58technomancyI guess you still need an (into {} ) there
22:58technomancyif you only have 6 elements you might as well use a literal
23:00daakuhmm.. i get ArityException Wrong number of args (2) passed to: core$vec clojure.lang.AFn.throwArity (AFn.java:437)
23:01daakui'm using 1.3
23:05daakuoh
23:05daakuman, i'm an idiot
23:12technomancyman, what is it with people and wanting to avoid putting jars in repositories?
23:12technomancyಠ_ಠ
23:13technomancymaybe if it were "get a subscription with $HOSTED_SERVICE" instead of "run your own archiva server" people wouldn't be so resistant to doing the right thing
23:14technomancyam I missing something, or does sonatype not offer nexus-as-a-service?
23:15technomancyseems like a real no-brainer; they're trying to sell an "enterprise nexus" instead which doesn't make any sense.
23:24spoon16I want to use *buffer-size* defined in duck-streams
23:24spoon16how do I do that from my own ns/.clj?
23:25technomancyspoon16: duck-streams?
23:25technomancysurely you mean clojure.java.io?
23:26spoon16clojure.contrib.duck-streams
23:26spoon16it defs *buffer-size*
23:26spoon16I just want to read that value in my own .clj
23:26technomancyyeah, but duck-streams is way deprecated
23:26spoon16oh
23:26spoon16I guess I wasn't paying good attention :)
23:27spoon16so, lets say I do mean clojure.java.io
23:27spoon16how do I read the var in my own function/ns?
23:27technomancy(:require [clojure.java.io :as io])
23:27technomancythen io/*buffer-size*
23:27spoon16ok