#clojure logs

2010-05-09

00:02_brian2_I think you define java exceptions for anything
00:05sidsthat's left to the library author to decide
00:05_brian2_which uses a wrapper around the java (html/html-resource (java.net.URL. url))
00:06_brian2_well, they haven't addressed this problem
00:08technomancyhugod: have you gotten trunk slime to work with lein swank and M-x slime-connect, or just swank-clojure-project?
00:09sids_brian2_: that function uses java.net.URL's getContent which should be throwing a FileNotFoundException or something
00:10sids,(import 'java.net.URL)
00:10clojurebotjava.net.URL
00:10sids,(.getContent (URL. "http://clojure.org/doesnt-exist"))
00:10clojurebotjava.security.AccessControlException: access denied (java.net.SocketPermission clojure.org:80 connect,resolve)
00:13_brian2_so if I something like use (try ( (html/html-resource (java.net.URL. url)) (catch ... ) , the program still blows up
00:13technomancy_brian2_: any particular reason the call to html/html-resource is nested in two levels of parens?
00:14_brian2_no, its a typo
00:14_brian2_i mean I dont in program
00:14sids_brian2_: you don't what?
00:15technomancy_brian2_: gotcha. well I think more context is needed then; try a paste site?
00:15_brian2_use 2 parens
00:15_brian2_ok, just a second, I'm going to get it al together
00:15_brian2_hopefully ur still here
00:18sids_brian2_: I just checked, enlive's html-resource does throw FileNotFoundException for a 404 URL
00:19_brian2_but my problem is 400 errors
00:19sids_brian2_: can you give me url that throws 400, I can check it for you
00:20sidss/throws/returns/
00:20sexpbot_brian2_: can you give me url that returns 400, I can check it for you
00:20_brian2_ok, just a sec, this is kind of a random event, so hopefully i will catch one
00:22tomojsexpbot: who is your master?
00:22tomoj:(
00:23_brian2_ http://is.gd/a3eEU
00:23sexpbot"Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home"
00:23_brian2_but it seems to be re-routed in my browser
00:25sidsthat returns a 301 redirect and following that redirect leads to a page which returns 200
00:25_brian2_actually, its not the problem
00:25_brian2_the problem I want to solve is simple if I get 400 error to exit and move on
00:26_brian2_the reason I got the error is that i am
00:26_brian2_using crappy way to locate the url in text
00:26sids400 is bad request, right?
00:26_brian2_I guess
00:27_brian2_something like that
00:27sidsenlive should throw an exception for that, give me one such url and I can check
00:27_brian2_the url I used was : http://is.gd/a3eEU Use discount code "gaga" for 25% off!
00:27sexpbot"Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home"
00:28_brian2_sexbot doesnt mind
00:28_brian2_that one
00:28sidsenlive doesn't mind it either
00:28_brian2_or maybe just make one up
00:29_brian2_I get "main" java.io.IOException: Server returned HTTP response code: 400 for URL: http://is.gd/a3eEU Use discount code "gaga" for 25% off! B6d
00:29_brian2_ at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
00:29sexpbot"Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home"
00:30sidsso you get the exception, then what seems to be the problem?
00:30sidsyou are unable to catch it?
00:31_brian2_the program crashes
00:31sidscan you paste the relevant code somewhere?
00:31_brian2_ok
00:35_brian2_sids : http://clojure.pastebin.com/VuTid23R
00:36sidson a different note, you seem to be using this entire string as the url: >>http://is.gd/a3eEU Use discount code "gaga" for 25% off! B6d<<
00:36sexpbot"Streetwear Shop - 80s Retro Style Fashion Clothing & Accessories — Home"
00:37_brian2_yea, I am using a crappy method to grab the URL
00:37_brian2_but I want to make the program robust to the errors
00:38_brian2_rather improve the pattern regex
00:38_brian2_becasue that will never be perfect
00:42sids_brian2_: your catch syntax wasn't quite alright (missing the name argument)
00:43_brian2_yea, I just saw that
00:43sidsI fixed that and put it in a repl, runs without a worry: http://clojure.pastebin.com/ZBhcLj1m
00:43_brian2_ok
00:43_brian2_thanks!
00:43sidsthere is no need to use a try around your let, fetch-url will catch the exceptions and return a nil in that case
00:44_brian2_ok
00:44technomancyis anyone using slime-repl.el from trunk slime successfully with clojure?
00:47technomancyI'm getting regular slime evaluation to work, but the repl is busted and still thinks it's in CL-USER
00:51_brian2_sids : runs beautifully, thanks for your help!
00:53sids_brian2_: you're welcome :)
03:46ArkRostHi! Can someone write a code of the parallel quicksort with using transient strucrures?
04:10LauJensenMorning guys
04:10LauJensenI'm benchmarking my site using 'siege' and it gives me everything I want, except a mean transaction time, anybody know of a simple *nix tool which does the job a little better?
06:00herdrick,(str (repeat 1 "foo"))
06:00clojurebot"clojure.lang.LazySeq@18ce5"
06:00herdrick,(repeat 1 "foo")
06:00clojurebot("foo")
06:01herdrickQuestion: how do I get the usual string representation from that lazy sequence?
06:01herdrickI thought doall was the way, but no.
06:02herdrickVery basic question, yet I don't know or am having a memory lapse
06:05herdrickIn other words, what I'm looking for is (some-fn (repeat 1 "foo")) to return a string "(foo)" or something formatted like that.
06:05herdrickother formats are fine: "('foo')" "(\"foo\")" whatever
06:11herdrickah, gotta sign off. will be back.
06:21LauJensen$mail herdrick (apply str (repeat 1 "like so"))
06:21sexpbotMessage saved.
06:25nurvHi.
06:28cschreiner$mail
06:28cschreinercool feature
06:29cschreiner$help
06:29sexpbotcschreiner: I can't help you, I'm afraid. You can only help yourself.
06:31herdrickSorry, I was gone. Did i miss anything?
06:31herdrick$mail
06:31herdrickoops
06:31Borkdude$mail
06:40herdrickLauJensen: thanks. Though I would like something that preserved the tree structure of the seq. So this would work:
06:40herdrick,(str "(" (apply str (repeat 1 "foo")) ")")
06:40clojurebot"(foo)"
06:40herdrick...for that exact case
06:41herdrickbut I was hoping for something more general. I guess I will write my own recursive thing. Or use the tree walker stuff in clojure.contrib
06:41herdricksorry, clojure.walk
06:52jowagalter has its equivalent for root values in alter-var-root. Is there an ref-set equivalent for root vars?
06:58jowagI think for that purpose redefining root var with def should be fine, but I'm not sure
07:37jwr7ah-hah. So clojure.contrib.sql's insert-rows is really insert-row.
07:39LauJensenjwr7: yea, check out ClojureQL instead :)
07:39jwr7LauJensen: I would, except after spending lots of time with CLSQL I'm opposed to any additional DSLs on top of SQL…
07:41jwr7I might have to use something better than clojure.contrib.sql, though — there are no persistent connections and no connection pooling.
07:44LauJensenOh - If you don't like a DSL ClojureQL is definitely not for you, its _the_ DSL for SQL :) Lets you extend the SQL language itself, like add fulljoins to derby etc. But what rubs you the wrong way about DSLs ?
07:45LauJensen@ jwr7
07:45jwr7LauJensen: experience. I believe they optimize for the wrong goal: db-independence. In practice, I've never encountered a situation where I would actually need to migrate to a different DB and expect it to work flawlessly.
07:45jwr7LauJensen: you *always* have to modify things when migrating to a new DB, DSL or not.
07:45jwr7LauJensen: so there is little advantage. And the disadvantages are many. I have to learn a new syntax, convert things into that syntax and encounter its limitations.
07:46jwr7It also isolates me from the db-specific features I *might* want to use.
07:47LauJensenIm not saying that you dont, but lets say you're benchmarking some app and you want results on both MySql, Oracle, Mongo and Cassandra - ClojureQL lets you do that with the same code. It always provides raw hooks into the db-specific stuff you might want you use. And the limitations are only a patch away from being removed
07:47LauJensenBut yes, you do have to learn the syntax
07:47jwr7LauJensen: right — but that's a *very* specific use case, which isn't my use case :-)
07:47somniumLauJensen: eh? you support nosql too?
07:48LauJensensomnium: Mongo and Fleet are being implemented as we speak, and we hope to have at least one in full working order for v. 1.0
07:48somniumLauJensen: full joins on CouchDB?
07:49somniumah, I was about to ask if it was still in flux, how far off is 1.0 looking?
07:49LauJensensomnium: The backend is currently multimethods, so if you implement a frontend function which returns a :fulljoin object, just add the method you want to the backend. You can see how easily we did it for Derby and Sqlite
07:49jwr7LauJensen: I think this discussion is similar to maps vs objects — you get way more flexibility if you put a layer of objects and multimethods on top of your data, but then again, maps get you there 90% of the way and often enough you don't need that flexibility at all.
07:49jwr7…and having debugged CLSQL… well, you get the point :-)
07:49LauJensensomnium: We have a deadline in 2 weeks for all the frontend stuff (the frontend is completely reworked), then we're assing how much we need to retrofit the backend, whereafter we can publish a release date
07:50LauJensenIm guessing 6 - 8 weeks, preferably 5 :)
07:50jwr7hey, but that lack of connection pooling worries me…
07:50jwr7does this mean there is no library for accessing an SQL database from a multithreaded application without establishing and tearing down connections all the time?
07:51LauJensenjwr7: We put in some alpha connection pooling a while ago, it does support multiple long-lived connections
07:51somniummongo isnt that painful without a dsl, despite the underlying javaness of the driver
07:51LauJensenBut thats also going to change with the release of 1.0, just not sure how much yet
07:53somniumLauJensen: if you really want to be heroic you could do everything from TCP/IP on up in clojure for direct BSON -> persistent datastructure :D
07:54LauJensen:)
07:54somniumsomeone said they were working on a prototype for a pure clojure Mongo client but they havent been around in a while
07:55LauJensenpure, as in rolling their own driver?
07:56somniumthe low level bits anyway
07:56LauJensencool- I'll make sure you test it again clojureql 1.0 once they're both released :)
07:56jwr7LauJensen: oh, cool — so all that remains is for you to remove the DSL thing, and I'll use ClojureQL :-)
07:57somniumheh
08:01somniumLauJensen: would it be better to wait for a 1.0rc to learn the api?
08:45rhudsonGiven a lazy seq of chars, how do I get a string value?
08:46rhudsonE.g. given (concat "abc") how do I get "abc" ?
08:46rhudson,(str (concat "abc"))
08:46clojurebot"clojure.lang.LazySeq@1ecc1"
08:53somnium,(apply str (concat "abc"))
08:53clojurebot"abc"
08:54rhudsonThanks! This has been driving me crazy.
08:54somniumcheers
08:55elguru,(version)
08:55clojurebotjava.lang.Exception: Unable to resolve symbol: version in this context
08:55elguru,(clojure-version)
08:55clojurebot"1.1.0-master-SNAPSHOT"
08:55elguru,(persistent!
08:55clojurebotEOF while reading
08:55elguru (reduce #(assoc! %1 %2 %2) (transient {}) (range 0 10))))
08:56elguru,(persistent! (reduce #(assoc! %1 %2 %2) (transient {}) (range 0 10)))
08:56clojurebot{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9}
08:57elguru,(let [result (transient {})]
08:57clojurebotEOF while reading
08:57elguru (doseq [elt (range 0 10)]
08:57elguru (assoc! result elt elt))
08:57elguru (persistent! result))
08:57elguru,(let [result (transient {})]
08:57clojurebotEOF while reading
08:57elguru (doseq [elt (range 0 10)]
08:57elguru (assoc! result elt elt))
08:57elguru (persistent! result))
08:58elguru,(let [result (transient {})] (doseq [elt (range 0 10)] (assoc! result elt elt)) (persistent! result))
08:58clojurebot{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7}
08:58elguruok, again:
08:58elguru,(persistent! (reduce #(assoc! %1 %2 %2) (transient {}) (range 0 10)))
08:58clojurebot{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9}
08:58somniumelguru: youre not supposed to bash them in place
08:58elguruin the doseq version?
08:59somniumelguru: yes
09:00elguruwhy is that? and is it mentioned somewhere? my problem is, that the result is quite unexpected and is sometimes correct and somtimes not.
09:02elgurujust failing would be better of course.
09:02somniumelguru: I dont know the answers to one and two, but the solution is to use the transient versions the same way as the immutable ones
09:03somniumI agree, but I suspect since they only exist for speed, they dont waste time on checking for undefined usage
09:03somniuminto uses them under the hood btw
09:04somnium,(into {} (map vector (range 10) (range 10)))
09:04clojurebot{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7, 8 8, 9 9}
09:04somniumshould be 'fast'
09:05elguruah ok, i will check it out. thank you.
09:11LauJensensomnium: yes, it would be better to wait, as the frontend will change completely. In the backend, just a few dbs will be added
09:12LauJensenSee the wiki on gitorious for more info
09:13somniumLauJensen: any chance of supporting BDB, maybe with cupboard?
10:29Licenserrhickey: how is the copyright on the 'clojure design' and logo?
10:30Licenseraka can I use the logo /general color scheme on a website?
10:34BorkdudeWhy can't I do this inside a let?
10:34Borkdude (let [my-power-list (lazy-cat [x] (map #(* % x) my-power-list))]
10:34BorkdudeIt says it can't resolve symbol my-power-list
10:35LicenserBorkdude: do you have declared my-power-list before?
10:35Borkdudenope, but I can do (def my-power-list .. same stuff ..)
10:35somniumBorkdude: let isnt recursive, you can use letfn, or ... [my-list (fn my-list ...)]
10:36Borkdudesomnium: fn as in identity?
10:37Borkdudewait
10:37Borkdudeit just works, I made a type elsewhere
10:38somniumBorkdude: O_o
10:38somnium,(let [x x] x)
10:38clojurebotjava.lang.Exception: Unable to resolve symbol: x in this context
10:40Borkdude,(let [my-power-list (lazy-cat [2] (map #(* % 2) my-power-list))] (nth my-power-list 512))
10:40clojurebotjava.lang.Exception: Unable to resolve symbol: my-power-list in this context
10:40Borkdude
10:40Borkdudehmm wtf, why does it work on my machine now
10:41somniumBorkdude: guessing you defined a var named my-power-list somewhere
10:42BorkdudeI think I did a declare somewhere yes
11:00BorkdudeSo the more general question is now: how can I close over a recursively defined lazy sequence?
11:03Borkdudeso: (let [myseq (lazy-cat [0] (.... myseq .....))] (fn [] (something with myseq)))
11:05somniumBorkdude: let isnt recursive, it only shadows previous bindings
11:05Borkdudeso I can't never do this?
11:05Borkdudes/never/ever
11:05somniumyou can call a function that produces a recursive sequence
11:06Borkdudegive an example of such a function?
11:07Borkdude(fn [] (let [my-seq [0]] (lazy-cat my-seq (.... my-seq)))) ?
11:07Borkdudethis won't work because I need to lazy-cat over what I am defining
11:09somnium,(let [f (fn foo [xs] (lazy-seq (when (seq xs) (cons (take 3 xs) (foo (drop 3 xs)))))) v (f (range 20))] v)
11:09clojurebot((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 13 14) (15 16 17) (18 19))
11:09somniumis one (utterly pointless) example :)
11:11Borkdudesomnium: what does it mean when you do (fn foo [x] ...) instead of just (fn [x] ...)?
11:12somniumBorkdude: it provides a self-reference to an anonymous fn
11:12somniumBorkdude: otherwise we would need the Y-combinator, and no one wants that :)
11:13Borkdudeis it similar to recur?
11:13Licenserwhat is a Y-wombinator?
11:13Licenser*combinatrr
11:13BorkdudeWombinator... is that like a really really Mad Wombat?
11:14Licenser:P
11:14Licenseryes
11:14BorkdudeLicenser: this is something from logic or lambda calculus I think
11:17BorkdudeAnd also a company by Graham
11:18somniumLicenser: its a riddle, what is the result of ((fn [x] (x x)) (fn [x] (x x)))
11:18Licensera tack overflow?
11:18Licenser*stack
11:18BorkdudeYes, write that down and you have proved a theorem ;-)
11:19Licenserit is wombinator for you good sir!
11:21somniumhttp://www.fatvat.co.uk/2009/04/understanding-y-combinator.html
11:21sexpbot"Fatvat: Understanding the Y Combinator"
11:22Borkdudebrb
11:23Borkdudewill try your (fn name [args]) solution soon
12:00AWizzArd~seen hoeck
12:00clojurebothoeck was last seen quiting IRC, 395 minutes ago
12:06Licensertach leute
12:09bsteuberdpes lein also download a maven executable? and if, where does it put it? :)
12:10Licenserraynes und ich haben etwas gespielt: http://tryclojure.licenser.net/ (meinungne?)
12:11Licenserich will es noch nicht auf #clojure veröfentlichen da noch nicht fertig genug, aber ihr seid ein guter test-kreis :P
12:11Licensersozusagen meine private beta-tester armee
12:13bsteuberLicenser: english channel :)
12:13Licenser... schesse
12:21LauJensenGents - Anybody know of a similar tool to siege, but with more stats (like mean transaction time) ?
12:30LauJensenOk - JMeter is huge, but ApacheBenchmark is in apache2-utils and does exactly what I want
13:26LauJensenLicenser: 'ihr seid' ?
13:37The-KennyLauJensen: "(plural) you are". It was meant for #clojure.de
13:37LauJensenokay, thanks
13:37LauJensenMy german is rusty :|
14:05Borkdudesomnium: is there maybe a recursive lazy-cat in contrib, like fn takes a name to make it recursive?
14:27Borkdudesomnium: ah rec-cat it is called
14:27Borkdude,clojure.contrib.seq-utils/rec-cat
14:27clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.contrib.seq-utils/rec-cat
14:30Borkdude(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512))
14:30Borkdude,(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat
14:30clojurebotEOF while reading
14:30Borkdude [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512))
14:30Borkdudehm?
14:33Borkdude,(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat
14:33Borkdude [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 8))
14:33clojurebotEOF while reading
14:33Borkdude
14:33Borkdude$(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat
14:33Borkdude [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512))
14:34sexpbotEOF while reading
14:34Blackfootthe lines are split
14:34Borkdude,(let [my-lazy-pow (clojure.contrib.seq-utils/rec-cat lz (lazy-cat [2] (map #(* 2 %) lz)))] (nth my-lazy-pow 512))
14:34clojurebot26815615859885194199148049996411692254958731641184786755447122887443528060147093953603748596333806855380063716372972101707507765623893139892867298012168192
14:34Borkdudeah, right
14:48mfexBorkdude, are you also attending the amsterdam clojurians meeting?
14:56Borkdudeah mfex
14:56BorkdudeI saw you're post on the Google Group
14:56Borkdudes/you're/your
14:56BorkdudeI don't think so, but I am planning on going there some time
14:57mfexI have never been there either
14:57BorkdudeI read you are finishing your MSc in Twente, I have studied there too
14:58BorkdudeWhat is your subject?
14:58mfexI'm half way through my final thesis on action semantics for model driven engineering
14:59mfexhow long ago were you at ut?
14:59BorkdudeI finished in 2005
15:01BorkdudeA fellow student of mine is still there, maybe you know him ;-)
15:02mfexI started in 03
15:02BorkdudeHmm, maybe talk in #clojure-casual? As not to generate too much noise here
15:03mfexsure
15:20giaceccommarczyk: Thanks for the hint the other day about apply vs some
15:23mmarczykgiacecco: yw
15:23giaceccoI'm still disappointed apply doesn't work with macros
15:24Borkdudegiacecco: there is an apply for macros in contrib
15:24Borkdudehttp://clojure.org/libraries#Clojure%20Libraries-Category:%20xml-clojure.contrib.apply-macro
15:25giaceccoBorkdude: ho thanks, but is there a theoretical reason for that?
15:25giaceccoRich must have designed apply that way for a reason
15:26mmarczykactually apply was designed that way about 50 ways ago :-)
15:26mmarczykum
15:26mmarczykyears
15:27mmarczykalthough you could be nitpicky and argue that LISP 1.5 had no macros (I think...?), so maybe it's a bit less than that
15:27giaceccoAgree, but RH changed stuff when he reckoned it was useful. I'm an idiot, but I can't see the value in not making apply work for both functions and macros in the core language
15:28mmarczykapply simply can't work with macros, for fundamental reasons
15:29Borkdude,(type defn)
15:29clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/defn
15:29mmarczyknote that the apply-macro thingamabob in contrib is itself a macro
15:30mmarczykwhereas apply is a function
15:30RaynesA macro is not a function.
15:30RaynesApply applies a function.
15:30mmarczykhi Raynes :-)
15:30RaynesHi
15:30giaceccoProbably I just need to study more and I would get it
15:31giaceccoSomeone may then wonder:
15:31Borkdudea macro works at macro processor time, it's a different dimension so to say
15:31giaceccoWhy something as basic as logical operators are implemented as macros, e.g. or
15:32mmarczykgiacecco: would you want (and false (println :foo)) to print :foo?
15:32Borkdudegiacecco: it's because macro's don't evaluate their args
15:33Borkdudewhich makes it possible to 'short circuit'
15:33mmarczykactually you could take the view that it is precisely the basic building blocks of your programmes which should be implemented as macros
15:33mmarczykunless they are already built into the language as special forms, like, say, if
15:33giaceccoWow that's a strong statement!
15:34mmarczyks/should/must
15:34mmarczyk/
15:34mmarczykin fact
15:35mmarczykunless you're using call-by-name pervasively, in which case an "and" function would be perfectly fine
15:35mmarczykthe only language I've used which does that is Haskell
15:36mmarczykI suppose PLT's Lazy Scheme might be similar, but I've never used that
15:36mmarczyks/might/is likely to/
15:36sexpbotI suppose PLT's Lazy Scheme is likely to be similar, but I've never used that
15:36giaceccoI believe you're flying too high for me, I'm a humble learner :-)
15:36mmarczykthanks, sexpbot :-)
15:37mmarczykwell, try playing around with macros, maybe implement giacecco-and as a function first, then as a macro
15:37mmarczyktry emulating the built-in and's behaviour
15:37giaceccoLast quick one before I need to leave: why can't I use comp on Java functions, e.g. (def integer-sqrt (Math/floor Math/sqrt)) ?
15:38mmarczykwith some luck, you might be able to see why and is a macro *and* why apply doesn't work with macros
15:38giaceccoI meant (def integer-sqrt (comp Math/floor Math/sqrt))
15:38mmarczykJava methods are not first class objects in Clojure (nor are they in Java, mind you)
15:39mmarczykyou can wrap them if you like, though
15:39mmarczyk(comp #(Math/floor %) #(Math/sqrt %))
15:40giaceccoA ha!
15:40giaceccoI expected something like that
15:40giaceccoThanks!
15:40mmarczyknp
15:41giaceccoWhat's the level of the discussion in the forum: are my questions too naive to be asked here?
15:41mmarczykLicenser: das ist ein schoenes REPL, hoffentlich koennt ihr spaeter def*-Ausdruecke zulassen :-)
15:41Borkdude#(...) means "tame this Java code"
15:42mmarczyk:-)
15:43mmarczykgiacecco: not at all, ask away
15:43giaceccoGreat, I must spend Much
15:43giaceccomuch more time here then
15:43Licensermmarczyk: thanks
15:44mmarczykyou're likely to receive more extensive answers on the ggroup, simply because of the format
15:44giaceccoThank you all a lot, and goodbye for today! I'll be on the ggroup, too.
15:44mmarczykLicenser: is the code up anywhere? or am I asking a bit too early?
15:45Licensermmarczyk: my gitup page, it is a form of Raynes web stuff but It's really not done yet
15:46mmarczykright, I somehow missed the fine print below the box the first time round
15:46Licenser:)
15:47RaynesMine is almost perfectly usable. mmarczyk I'll pass you a link to my own personal tryclojure thingy in a little while.
15:47mmarczykplease do, thanks! :-)
15:47LauJensenIs there some wonderful lib out there, which could coerce this to a Date or something IComparable "2010-03-30 22:26:45" ?
15:48mmarczykLauJensen: Date/valueOf ?
15:49mmarczykum, actually it wouldn't be Date...argh
15:50chouserLauJensen: looks like a comparable string to me
15:50mmarczyk,(java.sql.Timestamp/valueOf "2010-04-08 23:11:59")
15:50clojurebot#<Timestamp 2010-04-08 23:11:59.0>
15:50chouseroh my
15:50chouserI wouldn't have thought of looking in java.sql
15:51mmarczyk:-)
15:57LauJensenmmarczyk: wow, you impressed me :)
16:04Raynesmmarczyk: It didn't break yet, did it? :p
16:07MadWombatHello
16:08MadWombatI am trying to figure out clojure.contrib.accumulators, what is wrong with (add (empty-counter) "asdf") ?
16:09MadWombatoops, got it, sorry, me silly
16:09MadWombatempty-counter is a var, not a func
16:09MadWombatb
16:18eshirais there a non-log(n) version of contains? to be used with vectors?
16:20eshirawell i guess i'm thinking about the contains? semantics wrong. I want to know if some element x is in some vector v.
16:25mmarczykLauJensen: :-)
16:26mmarczykRaynes: you mean clj-sandbox...? if so, not to my knowledge :-)
16:26Raynesmmarczyk: I mean anything. :p
16:26mmarczykRaynes: oh, in that case, I'm not sure
16:26Raynesclj-sandbox wont break.
16:27RaynesUnless _ato breaks it, that is.
16:27Raynes;)
16:27mmarczyksomething's bound to have been broken recently ;-)
16:27Raynesmmarczyk: If it broke, I'm fairly certain you'd know it.
16:27mmarczykwell I sure hope I can beat him to it, I was promised a cookie if I manage that :-P
16:28mmarczykthe chances seem to be slim, though
16:28RaynesNow you have something that isn't sexpbot to break. :D
16:28mmarczykyeah! that's true :-)
16:28RaynesI like tryclj because I can write bits of code on my cellphone without having to deal with JavaScript. It's just HTML.
16:30mmarczykat some point having a private environment to do def* in would be nice
16:30chousereshira: no, vectors are indexed by the position of their elements, not by the element values.
16:30chousereshira: so the only way to find an element by value is to walk the whole vector. O(n)
16:30Raynesmmarczyk: Do you approve? ;) I think for a first web development project in any language, it's pretty good. :D
16:30chousereshira: if you want to look things up by value, you need a set or a map
16:31mmarczykRaynes: you mean it's your first? in that case, I approve very strongly indeed :-)
16:31Raynes:D
16:31Raynes<3
16:32BorkdudeRaynes: I think I missed out on the link
16:32mmarczykRaynes: also, that means you're ahead of me on this one -- no functioning Web project on my record as of yet :-(
16:32Raynesmmarczyk: Haha.
16:33mmarczykBorkdude: look for Licenser speaking German above
16:34Borkdudemmarczyk: I did, and then what I do?
16:35mmarczykfish out a link
16:35RaynesBorkdude: I sent you the link a second ago.
16:35Raynes:o
16:35BorkdudeRaynes: where?
16:36RaynesIn -casual.
16:36drewrshould `mvn install` work from a fresh contrib checkout?
16:36RaynesI'd rather not unveil it to the entire world until It's closer to finished.
16:36BorkdudeRaynes: http://joyofclojure.com ?
16:36sexpbot"The Joy of Clojure"
16:36RaynesEr.
16:37RaynesLook in -casual. >.>
16:37pdkcome to think of it would it still be worth it to sit on my practical clojure preorder
16:37pdknow that it got delayed again
16:37BorkdudeAh ok
16:37Borkdudenice :)
16:39AWizzArdHello Lein experts: how does Lein produce Überjars? a) it first unpacks the existing jars (the dependencies) into a temp folder and includes them in the Überjar, or b) it uses some custom classloader that allows it to put jars into the Überjar directly (without unpacking them first)?
16:42hiredmanAWizzArd: $5 says the unpacking thing
16:42AWizzArdk
16:42AWizzArdmaybe Ant can do such a thing too, hmm...
16:42hiredmansure
16:43hiredmanant has a number of jar tasks
16:43AWizzArdok, i will look into those
16:43AWizzArdThx hiredman.
16:44hiredmanhttp://ant.apache.org/manual/CoreTasks/unzip.html
16:44sexpbot"Unzip Task"
16:45mmarczykyup, it unpacks them
16:46AWizzArdok good, i will try to teach this to my ant script
16:46mmarczyktheir just funnily named zip files anyway, you can look inside with the archive manager of your choice :-)
16:51AWizzArdtoo bad that there is no native 7zip implementation for Java
16:51mmarczykthey're, oh my
17:00chouserrhickey: can we rename the "failed" state of an agent to "stopped"?
17:01chouseryou recover from this state by calling restart-agent, after all, not unfail-agent.
17:01hiredmanuh, don't they only stop when failed?
17:01chouserand then it is less likely to be confused with the :fail error-mode
17:02chouserhiredman: right. "stop" isn't currently a word used by the docs. I think I'd like to use "stopped" instead of "failed"
17:05eshirachouser: thanks, i'll just do (set my-vector) i suppose
17:08Raynesmmarczyk, Borkdude, Licenser: Hah. I forgot to remove the reload middleware before putting up tryclj. It actually works like a normal REPL.
17:14Licenserfor those who were interestind in swing: http://blog.licenser.net/2010/05/09/the-ease-of-guis#
17:14sexpbot"lice! : The ease of gui's."
17:14mmarczykRaynes: you caught it yourself, though, so you get to keep your own cookie :-(
17:15Raynes:p
17:15MadWombatI am playing with a markov generator again, here my function for generating sentences http://pastie.org/952885, for some reason instead of a list of words, I get a list of letters starting with a capital and ending with a period. What am I doing wrong? Where do the words get split up?
17:15mmarczykLicenser: cool, I'm hoping clj-swing will make it possible for me to create reasonable GUIs at some point
17:15mmarczykfor the first time since I my Delphi days
17:15Licensermmarczyk: I really hope that it will too :P
17:15Licenserdelphi had a incredible editor
17:15mmarczykyup
17:16mmarczykthat was totally *amazing*
17:16mmarczykin fact, if I wanted to do Windows desktop programming, I'd very likely research the possibility of using Delphi to programme the front-end
17:18mmarczykjust thinking about a Clojure process doing the actual work with a Delphi-constructed GUI makes me weep tears of hope and joy
17:20mmarczykMadWombat: shouldn't you do (conj result next-word)
17:20mmarczykrather than concat?
17:21mmarczykalso, do you use 1.1 or 1.2? you could switch your random choice to rand-nth with the latter
17:21MadWombatmmarczyk: no, result is a list of words
17:21MadWombatmmarczyk: 1.1
17:21MadWombatmmarczyk: considering switching though
17:21mmarczykif result is a list of words and you concat the word onto it
17:21mmarczykthen it becomes a list of words with some characters at the end
17:21MadWombathmm
17:22mmarczykso maybe (concat sentence [next-word])
17:22mmarczykbut then *don't do this*
17:22mmarczykyou don't want to append to the end of the list repeatedly
17:22MadWombatmmarczyk: ?
17:22mmarczykuse a vector instead
17:22mmarczykand conj
17:22mmarczyk,(conj ['a-list-of-words-goes-here] "next-word")
17:22clojurebot[a-list-of-words-goes-here "next-word"]
17:23MadWombatmmarczyk: I thought conj was for maps?
17:23mmarczyknot at all
17:23mmarczykit's the universal add-to-collection thingamajig
17:23mmarczykfor sequences it even figures out where best to put the added item
17:23mmarczykbeginning for lists, end for vectors and queues
17:24MadWombatah, conj adds item, concat adds collection
17:24MadWombatwhy vectors instead of lists? I thought adding at the end of a list is efficient
17:24mmarczykassoc is for maps
17:24mmarczykbtw
17:24mmarczykjust the opposite, actually
17:24MadWombatyes, silly wombat, trix is for kids
17:25mmarczyklists are just linked lists
17:25MadWombatand vectors are arrays?
17:25mmarczykso you can add to the front at the cost of constructing the front link
17:25mmarczykbut if you add to the end, you have to copy
17:25mmarczyk(no destructive updates in Clojure)
17:25mmarczykum, no
17:26mmarczykvectors are high-branching-factor trees of arrays with an extra tail portion
17:26MadWombatcool, lemme try this stuff out
17:26mmarczykactually I believe the underlying abstract structure would be a trie
17:27bmasonred black tree iirc
17:27mmarczykyou should probably watch one of the cool presentations Rich has done on Clojure data structures :-)
17:27bmasonthose are cool :)
17:27mmarczykindeed :-)
17:34MadWombathmm... seems like the following, surprisingly, works as expected (defn f [x y] (let [x x y y] ... ))
17:34hiredmansurprising how?
17:34MadWombathiredman: I would expect it to be confused at some point
17:35bmasonredefining the variables?
17:35hiredmanbmason: no
17:35hiredmanyou are creating a new scope
17:36MadWombatyes, but I am assigning llocal variables with same names as global ones to value of globals
17:36bmasonright... inner most scope takes precedence... and defining a var to equal itself wouldn't have any effect
17:36hiredmanlocals are not vars
17:36bmasonwhat do you call them for ease of terminology?
17:36hiredmanMadWombat: function are arguments are not globals
17:36hiredmanbmason: they are locals
17:37MadWombathiredman: yes, sorry, not globals, but they are in the scope
17:37hiredmanlocals have a fixed nested lexical scope
17:37hiredmanat the top(bottom?) of that scope is the dynamic scope of vars
17:38MadWombatbasically I expected it to be confused at the point of "the second x, is it the local he just named or the func argument?"
17:38hiredmanMadWombat: that is just not possible
17:39hiredmanat the time when the expression whose value will be bound to x inside the scope of the let is being evaluated, the let's scope cannot exist
17:40hiredmanbecause the binding of x to that value is part of the scope
17:40hiredmanbecause the let's scope doesn't exist, how could you evaluate an expression in it?
17:41bmasonbasically how it gets interpreted is "create a new local called 'x' and assign it the value of the function argument 'x' "
17:41hiredmanbind
17:41hiredman:(
17:42bmasonok binding... within the scope of the let, the 'x' defined there takes precendence
17:42hiredmanscope is like a linked list of pairs
17:42technomancyhiredman: did you see my further hacks on serializable-fn?
17:43hiredmanno, I didn't
17:43technomancyhiredman: it can serialize lexical context now =)
17:44hiredmancute
17:44mmarczyktechnomancy: did you get slime-repl from HEAD to work?
17:44hiredmanas long as you run in the same vm, yeah?
17:45technomancymmarczyk: no, I was hoping I could get hugod to tell me how he fixed it. =)
17:45mmarczyktechnomancy: funny, it "just works" for me
17:45technomancyhiredman: well, as long as it's something that prints decently
17:45hiredmanlet cons a new pair on to the linked list of environments
17:45technomancyhiredman: I don't think it would work with reference types, etc.
17:45technomancyhaven't really searched for edge cases yet
17:46hiredmanwhen you resolve a name to a value you walk the linked list and stop at the first entry
17:47hiredman,(first (filter #(= 'x (first %)) '((x 1) (x 2))
17:47clojurebotEOF while reading
17:47hiredman,(first (filter #(= 'x (first %)) '((x 1) (x 2)))
17:47clojurebotEOF while reading
17:47hiredmanbah
17:47hiredman,(first (filter #(= 'x (first %)) '((x 1) (x 2))))
17:47clojurebot(x 1)
17:49technomancymmarczyk: could you try with the "elpa-2010" branch from my slime fork?
17:49technomancymaybe you've got a slightly older/slightly newer version than I happened to grab
17:53mmarczyktechnomancy: sure
17:53mmarczykwill do it now
17:53technomancymmarczyk: oh, and the latest clojure-mode as well
17:54technomancyI moved a few things around so now you can use clojure-mode with slime.el directly and skip swank-clojure.el entirely
17:54mmarczykoh, cool
17:54mmarczykdoes this mean that the whole "coloured REPL" business could go into clojure-mode
17:54mmarczykincluding the advice stuff for slime-repl?
17:55technomancyoh, I haven't looked into the coloured repl code yet
17:55mmarczykin this case, please don't :-)
17:56mmarczykI'll make it fit in well with the new clojure-mode
17:56technomancysorry, I'm slow
17:58mmarczykI was also going to patch leiningen to accept (and add to the pom) website, mailing list and licence info for projects
17:58technomancyoh, that sounds nice
17:58technomancydo the clojure-mode stuff first though if you don't mind; it's closer to a release
17:58mmarczykok
17:59technomancynot to boss you around or anything =)
17:59mmarczyk:-)
18:00Raynesmmarczyk: It should be working properly now, if you want to try it.
18:01Raynesmmarczyk: Also, you don't have to click the text field every time you submit your code now. That was bugging me.
18:02Raynesmmarczyk: I'm going to add syntax highlighting soon. :o
18:02mmarczykRaynes: cool :-)
18:02mmarczykRaynes: I believe I used Enter to submit code, though
18:02Raynesmmarczyk: Didn't matter.
18:02mmarczyktechnomancy: um, what's package-activated-list
18:02mmarczyk?
18:03RaynesIt refreshes the page every time you submit.
18:03mmarczyktechnomancy: guess I'd have to install ELPA to use your fork, right?
18:03RaynesWell, not refreshes. Sort of.
18:04mmarczykRaynes: are you planning paredit-like facilities? ;-)
18:05RaynesNo. :p
18:05Ploujwho here takes care of swank-clojure? :)
18:05RaynesPlouj: technomancy
18:05Ploujoh yeah, right
18:06PloujI'm having some weird connection issues with localhost when running M-x slime
18:07mmarczyktechnomancy: you might want to make the (when (member 'slime package-activated-list) ...) thing check for the presence of a variable by that name
18:08mmarczyktechnomancy: with the condition replaced by nil, I can start a SLIME REPL with your fork, with a nice user=> prompt :-)
18:08mmarczyktechnomancy: which changes to foo=> after (ns foo)
18:25technomancymmarczyk: thanks, will do
18:27technomancymmarczyk: hmm... wonder what's the difference then; it's busted here
18:27technomancymmarczyk: what Emacs version?
18:27technomancyPlouj: what's up?
18:27technomancyPlouj: do you know that M-x slime is not meant for general use?
18:28Ploujtechnomancy: I get this error a lot of the times "Lisp connection closed unexpectedly: connection broken by remote peer"
18:28Ploujtechnomancy: I thought that M-x slime is good for just opening a repl without associating it with a project. What do you suggest?
18:28technomancywell, right, that's what I mean
18:28PloujI'm not familiar with slime so... :
18:28Plouj:)
18:29technomancyanyway, that is a common problem. I have no idea what causes it, but I know that generally using lein swank or mvn clojure:swank gets around it, which is what I have started recommending
18:29Ploujoh
18:29technomancyPlouj: I can't reproduce that problem on my own machine, so I can't do much to debug it
18:30Ploujhow do I use mvn clojure:swank?
18:30Ploujjust run it in some directory?
18:30DuneManmaybe some nice soul will debug it for you :-)
18:30technomancyPlouj: run it from within a mavenized clojure project, then use M-x slime-connect
18:30technomancyDuneMan: that would be nice. =)
18:31Ploujok, that means I need to create a clojure project
18:31DuneManToo bad don't know how to use emacs at all
18:31technomancyPlouj: you can do it from a contrib checkout, I think
18:32Ploujwhat's a "contrib checkout"? :)
18:32technomancyunfortunately clojure-maven-plugin has a bug; it doesn't let you set the port
18:32technomancyso you can only have one mvn repl running per machine
18:32Ploujheh
18:32technomancyPlouj: a checkout of clojure-contrib
18:32DuneManthat sounds fixable.
18:32technomancyDuneMan: it is, but clojure-maven-plugin is ... "lightly-maintained"
18:33technomancyit has quite a few of these small easily-fixable bugs that have been around for the better part of a year
18:33DuneManSomeone should fork it.
18:33Ploujmaybe this is a timing issue
18:34technomancyPlouj: it smells a bit like a race condition
18:34DuneManI have a feeling I'm gonna keep writing clojure now that I'm up and running
18:34mmarczyktechnomancy: "GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version 2.18.0)\n of 2009-09-27 on palmer, modified by Debian"
18:34technomancybut yeah, I don't have many details about it
18:34Ploujtechnomancy: do you know what actually prints the "Lisp connection closed" error. Is it your swank code or some slime thing?
18:35technomancymmarczyk: interesting. I guess I will try a fresh .emacs init; maybe there's something in my personal config messing it up
18:35technomancymmarczyk: you don't use the starter kit, do you?
18:35mmarczyktechnomancy: I could put up a Gist with my slime-related config if you feel that could be useful to you
18:35technomancyPlouj: pretty sure it's slime itself, so not my code
18:35technomancymmarczyk: that'd be handy
18:35mmarczyktechnomancy: no, except as an awesome repository of ideas :-)
18:35technomancymmarczyk: stealing from it is just as good as using it outright. =)
18:36mmarczyktechnomancy: that's what I figure also :-)
18:36mmarczyktechnomancy: it's so *amazingly* clean that it's absolutely my no. 1 elisp learning resource & the thing to emulate stylistically
18:42Ploujis swank something separate from clojure and slime?
18:49Ploujtechnomancy: have you tried creating a throw-away user on your unix machine and testing swank-clojure in that? :)
18:52mmarczyktechnomancy: hopefully this contains all the relevant stuff: http://gist.github.com/395481
18:52mmarczyktechnomancy: if not, I'll add in whatever's missing, of course
19:02technomancyPlouj: it's a client-server model: slime is the client and swank is the server.
19:03technomancymost swank servers are written in CL, but obviously swank-clojure is not
19:08Ploujoh
19:50AWizzArdI created a .jar file and need to start it like: java -jar my.jar one.of.my.Deftypes
19:51AWizzArdis there a way to add this one.of.my.Deftypes as a command line arg into the manifest file?
19:52hiredmanno
19:52AWizzArdok, so if I want to get a double-clickable file I will have to do some other little magic here
19:59hiredmangen-class
19:59AWizzArdyes
19:59hiredmanit's the only way to generate a static main, which you need for a clickable jar
19:59hiredmanyou also need to have the right information in your jar manifest
20:00AWizzArdthe correct Main-Class
21:02_brian2_anyone know if/how its possible to use congomongo on a network, ie run a clojure program on my mac using a remote mongo installation?
21:20_brian2_I guess I need to read about java sockets
21:31hugodtechnomancy: slime-repl from HEAD works for me, both s-c-p and s-c with lein swank. (slime-fancy doesn't because of slime-autodoc)
21:37hugodtechnomancy: although, sometimes I have to call (setq slime-dispatching-connection nil)(setq slime-default-connection nil) to make connecting reliable
22:45_brian2_hi, I would like to give clj-ssh a try. I put [clj-ssh "0.0.1-SNAPSHOT"] in my project file, ran lein deps, open a repl and (use 'clj-ssh) and get : FileNotFoundException: Could not locate clj_ssh__init.class
23:02hugod_brian2_: try (use 'clj-ssh.ssh)
23:02hiredmanbrixen: as single segment namespaces are frowned on I would be surprised if that did work
23:12_brian2_ok
23:12_brian2_thats whats on the website
23:14_brian2_yes, that works, thanks!
23:25hugod_brian2_: fixed on the website, thanks for the feedback
23:26defnhello all
23:29_brian2_ok, thanks for your work hugod
23:31_brian2_i dont know much about ssh, I want to log into another computer from my mac to access data in a clojure program, do I need to generate a key, fingerprint and all that?
23:32DuneManThat's generally the best way to use ssh
23:32DuneManssh-keygen
23:32DuneManthen set up your .ssh-config to use the correct key on the remote computer
23:32_brian2_ok so clj-ssh talks to that
23:32DuneManand add the key to the remote computer's access list.
23:33_brian2_well, i use ssh routinely to access the computer from my command line
23:33DuneManAnything that uses the unix ssh libs in the background will look into the .ssh directory and use that stuff. Not sure about clj-ssh, guessing hugod will tell you :-)
23:33_brian2_ok
23:33DuneManI'd guess at most you'd need to point it to the rsa/dsa file?
23:34_brian2_there is some indication of that
23:34DuneManif you needed to do anything more than that, I'd say the lib is broken.
23:34DuneManheh
23:34hugodclj-ssh will pick up .ssh/id_rsa by default
23:34_brian2_ok, thanks
23:34hugodthough if you have a passphrase, you'll need to add it explicitly
23:35_brian2_is that the same as password?
23:35technomancyiirc jcsh does not respect DSA keys, I wonder if clj-ssh has the same problem
23:35DuneManshould probably not use dsa anymore anyway
23:36hugodtechnomancy: I've not tried that
23:36hugodclj-ssh uses jsch
23:37technomancyhugod: thanks for the tip about slime-default-connection etc; will try that
23:37technomancyno idea why it's giving me the CL-USER prompt
23:37_brian2_hugod : i see you say you are trying to imitate something in the contrib library, why is that?
23:37_brian2_is your's more up to date?
23:38hugod_brian2_: contrib.shell is just for local sh
23:38_brian2_ok
23:39_brian2_hugod : if I have more questions, do you mind if I post them to the issues area?
23:39hugodtechnomancy: I have seen that in the past - if I remember correctly, it was some sequencing issue, and disappeared after the first comman
23:41hugod_brian2_: sure, if they are issues, otherwise general usage questions can be answered here
23:41_brian2_ok
23:42hugodif you don't get a response here, feel free to escalate to the issues
23:43_brian2_what does that mean?
23:43_brian2_exclamation marks?
23:48DuneMantechnomancy: http://github.com/hugoduncan/clj-ssh/issues
23:48DuneManerps
23:48DuneMan_brian2_: http://github.com/hugoduncan/clj-ssh/issues
23:49_brian2_hugod : so if I just want to log into a computer is it -> (ssh "user@something.com) but where do I put the password?
23:49_brian2_also that doesn't work
23:49DuneManreally, you should generate an rsa key and do passwordless login.
23:49_brian2_ok
23:49DuneManeven if the lib makes it easy to do it the insecure way.
23:50_brian2_the error is java.net.UnknownHostException
23:51technomancyI heard RSA had patent issues, which is why I always stuck with DSA
23:52technomancythat was a while ago; wouldn't be surprised if they expired
23:52DuneManlooks like username "blah" as an option.
23:52hugod_brian2_: (ssh "somthing.com" "ls" :username xx :password yy)
23:52DuneMantechnomancy: Ah, I'm not actually aware.
23:53hugod_brian2_: or whatever command you want to run - it's not going to give you an interactive shell
23:53_brian2_ok
23:54_brian2_I would like to access a database and manipulate it using a clojure program, is that possible, or am I on the wrong track
23:54technomancyhugod: do you do those 2 setqs before it's connected?
23:55hugodtechnomancy: I run them whenever I have trouble making a connection, and then try again
23:55DuneMantunneling a connection of ssh?
23:55DuneManover*
23:56DuneManOne would think the right thing to do would be to use your databases java library to manipulate it
23:56technomancyhugod: remind me again why I'm running trunk slime? =)
23:56DuneManand, at most, tunnel the connection over ssh.
23:56DuneManAnd if you're using a database that doesn't have a good java driver, then you should probably think about joining 2010 and using a real database.
23:56hugodtechnomancy: because you like using sbcl ;-)
23:57DuneManunless there's some reason why that's impractical.
23:57technomancyoh right, I am a child of the '80s.
23:57_brian2_DuneMan : Im using mongo, the new kid on the block
23:57DuneManThen use congomongo.
23:57_brian2_i am
23:57DuneManThen you don't need to do anything with ssh.
23:58DuneManunless you don't want to open the port and want to tunnel the connection over ssh
23:58DuneManI spoke at MongoSF last week
23:58DuneManlove it :-)
23:59_brian2_well, where does congo mongo sit when I use it that way?
23:59DuneManTunneling it?
23:59_brian2_I mean is it on the client or server
23:59DuneManCongomongo is a client library for speaking to mongodb.
23:59DuneManIt wraps the java mongodb library.