#clojure logs

2009-05-15

00:02duck112358technomancy: I'm surprised that considering you hope to tackle mvn integration, corscrew doesn't itself follow the maven conventions
00:02duck112358looks cool otherwise
00:06technomancyduck112358: I started the project before I really used mvn much
00:06technomancywhat conventions specifically do you mean?
00:06technomancyhaving its own pom?
00:06duck112358also the whole src/main/clojure and src/test/clojure
00:07duck112358I am just now trying to get my project working with maven
00:07duck112358soo I've been reading the book
00:07duck112358I started work on archetypes to create clojure project stubs with maven, but I'm just learning it
00:09duck112358I really wish we had some sort of Maven for the Clojure programmer wiki page to write down just what you need to know to get started doing it right
00:10duck112358if every clojure library had a consistent folder layout, the world would be a much happier place
00:12technomancyduck112358: have you seen the clojure-pom project?
00:12technomancyat work we write poms that inherit from that, so you end up having to write only a small amount of XML
00:13duck112358wait, the one for just clojure, or something else
00:13technomancyit's one that any clojure project can refer to as a parent and automatically get a certain subset of functionality
00:13duck112358are you using the maven-clojure-plugin to compile, or call out to java?
00:14technomancyjust calling out to java
00:14technomancyhttp://github.com/dysinger/clojure-pom
00:15technomancyclojure-http-client uses that
00:15duck112358ok, because I have been running into classpath issues with the maven plugin
00:16duck112358I've been pulling from the tapestry repository for clojure and clojure-contrib
00:16technomancywe just set our classpath to src/:target/classes/:target/dependency/ and use mvn process-resources to unpack all the deps (including clojure) in target/dependency. works like a charm, and the classpath never changes
00:16duck112358I still think the -lang suffix needs to go, but I'll shut up about that for now
00:17technomancyyeah, I think it's unnecessary.
00:17duck112358does that AOT compile your code?
00:17technomancysounds like Rich agrees
00:17technomancywe haven't been doing AOT yet, but it would be easy to add
00:18duck112358it should be fixed whenever 1.0.1 goes out, i think
00:18duck112358see, I need to AOT compile my stuff, because I'm running with Tomcat
00:19duck112358another library I'm working on compiles just fine, but when I coppied the xml to another client, I'm getting a file not found error
00:20duck112358btw, I got to explain the joys of clojure to 6 ruby guys at last nights meetup
00:20technomancyhow'd they take it?
00:21technomancyI've found they aren't to happy about my "Ruby is still my favourite imperative language" quip. =)
00:22duck112358they were definitely interested. At least one guy is going to check it out
00:22duck112358I also had to explain emacs to them. (I was the only non-mac guy)
00:23technomancyheh; rubyists.
00:24technomancyalways confused as to why anyone would want something more sophisticated than textmate
00:25duck112358I've never used textmate, so i can't speak for or against it
00:25duck112358I've always been into the kitchen sink
00:26duck112358before emacs it was eclipse
00:26technomancythat's the kitchen sunk
00:27duck112358The only thing I miss is Oxygen is 100x better than nXml for editing xml documents.
00:27p_leh, rubyist + Macfanboy = bad combination
00:28duck112358I felt kinda left out, I don't do rails, they all did. They all had their macbooks and iPhones, I just have my eeepc
00:29p_lit's mostly the rails crowd that is mac-happy ;-)
00:30technomancywell eeepcs are pretty hip these days
00:30technomancydoesn't hurt that you can run whatever software you like on them. =)
00:30hiredmanI ? my wind
00:32duck112358I run dovecot, mysql, tomcat, and emacs on mine
01:02duck1123_is there any clear way to know what an ExceptionInInitializerError on line 1 means?
01:03duck1123_I know it's a problem with my ns macro, but i don't know what
01:07duck1123_did the format of ns change recently? This used to compile
01:07hiredmanthe ns macro changed
01:08duck1123_ok, then it's not maven that caused all of my ns calls to miraculously fail
01:08duck1123_i'll look into the fix
01:09duck1123_do you know if that was on the list?
01:10hiredmanI do not think it was
01:10hiredmanclojurebot: latest?
01:10clojurebotlatest is 1368
01:10hiredmanr1368
01:10hiredmanr1367
01:11duck1123_hmm... so where would i need to go to find out what to change?
01:12hiredmanclojurebot: stat! is <reply>a sap
01:12clojurebot'Sea, mhuise.
01:12hiredmansvn diff?
01:12hiredmangoogle code might have a nice diff thinger
01:13duck1123_ok, then i'll have to do that in the morning
01:14duck1123_i'm not quite happy with this emacs maven integration lib i found yet
01:14duck1123_but it's compiling
01:16cadshey, I've got a thing that lets you build vector spaces on an underlying data type, and exposes a bunch of vector operations on the resulting type
01:17technomancythere's no cp -r equivalent in the JDK, is there?
01:18cadshow should I encapsulate a space and its functions so that you can have a few instances globally, but can still use the functions comfortably?
01:18cadscould a new namespace be created for each new vector type?
01:19technomancyyeesh: http://www.dreamincode.net/code/snippet1443.htm
01:19duck1123_technomancy: ruby has one. :)
01:20memoizetechnomancy: java can't even tell if a file is a symlink ;p
01:20hiredmancads: maybe binding?
01:20technomancymemoize: That's Not Portable(TM(TM)
01:21hiredmanyou could use Chouser's jni (jna?) thing
01:21hiredmancall out to libc
01:22memoizeyeah, saw that, using that technique to do lots of unportable things with java, clojure
01:23duck1123_technomancy: cp -r isn't portible either.
01:24duck1123_the maven repository for clojure doesn't have a 1.0 version
01:24duck1123_that's upsettinng
01:24hiredmanbig thread on the mailing list
01:24hiredmanabout how to push the 1.0
01:24hiredman*sigh*
01:24duck1123_I'm talking about the tapestry one
01:25technomancyportable enough for me
01:25technomancywindows users can PDI
01:26hiredmandirty gnu hippie
02:01unlinkYes, cp -R would be portable.
02:02unlinkIt's almost laughable to consider someone might be using a non-Linux unix now.
02:02unlinkWhen was the last time you logged into a Tru64, Solaris or FreeBSD box?
02:02hiredmanevery day
02:03unlinkhah
02:03unlinkWhich of those?
02:04hiredmanfreebsd
02:04unlinkI haven't logged into FreeBSD since mid-2007.
02:04slashus2unlink: Mac OS X follows the UNIX specifications now. But that is an obvious example.
02:05hiredmanunlink: your loss :P
02:16technomancydid something change about AOT compilation recently?
02:16technomancyold script that used to work suddenly went bonkers
02:17technomancyjava.io.IOException: No such file or directory (deps.clj:1) when I try to compile a namespace that works fine in the repl
02:19technomancyback to 1.0, I guess.
02:29technomancyhah. I just read the elisp definition of cond instead of the clojure one.
02:29technomancywas very confused for a minute there
05:34AWizzArdI want to inline (defn get-entry [key] (find @*my-ref* key)). Is (def #^{:inline #(find @*my-ref* %)} get-entry) the right way to do it? Looks a bit strange...
06:50markusgustavssonAWizzArd: definline?
06:50markusgustavsson~definline
06:50clojurebotGabh mo leithsc�al?
06:50markusgustavsson~brain
06:50clojurebotbrain dump is http://clj.thelastcitadel.com/clojurebot
07:05cemerickooh, there's lots of new stuff :-)
07:05cemerick~haskell
07:05clojurebotYo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute.
07:05cemerickvery nice.
07:07cemerickIn order to be fully compliant, that probably should be s/inside a/inside your
07:17AWizzArdmarkusgustavsson: definline sounds good, thx
07:27AWizzArdI have two functions F1 and F2. In F1 I @*my-ref*. In F2 I have a transaction in which I call F1. Am I right that F1's dereferencing of *my-ref* is in that case also protected by the transaction?
07:39AWizzArd"In F1 I access @*my-ref*."
07:58AWizzArd~ def definline
07:58AWizzArd~ def definline-
08:02AWizzArd,(macroexpand-1 '(definline foo [x] (+ x 1)))
08:02clojurebotjava.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number
08:03AWizzArdoh
08:04AWizzArdhmm, where is the problem with that definline example?
08:07liebke(definline foo [x] `(+ ~x 1))
08:08markusgustavssonAWizzArd: x is not a number
08:08liebkeAWizzArd: I guess you treat definline just like defmacro
08:09markusgustavssonliebke: yeah
08:09AWizzArdah oki
08:17heart-hackerheloooooooozzzzzzzzzzzzzzzzzz!!!!!!!!!!!!!!
09:48tmiin compojure, anyone know how I can do the equivalent of (route :*) with the new defroutes macro?
09:48clojurebotcompojure is http://github.com/weavejester/compojure/tree/master
10:17chessguy_woohoo! the day has arrived!
10:33ChouserI've got a 3rdparty .class file with a class in the anonymous package.
10:33ChouserIs there any way to use that from Clojure?
10:37Chouserah, (Class/forName "Jzmq") ...not ideal, but it gets me a little farther down the road.
10:37danlarkinhttp://jira.fastmq.org/browse/ZMQ-226
10:38danlarkin:)
10:38Chousernice
10:43chessguyanybody using enclojure?
10:48chessguyhm, quiet group today
10:52chessguyhiya rich
10:53bstephensoni'm using enclojure
10:54rhickeychessguy: hey
10:56Chouserinto-arruser=> (.newInstance (first (.getConstructors (Class/forName "Jzmq"))) (into-array "localhost"))
10:56Chouserjava.lang.IllegalAccessException: Class clojure.lang.Reflector can not access a member of class Jzmq with modifiers "public" (NO_SOURCE_FILE:0)
10:56Chouserwhat kind of sense does that make?
10:58chessguybstephenson, so i'm trying to start simple with a clojure project
10:58chessguybstephenson, i've created a new project, and in Source Packages, i've created a file "front-end.clj"
10:59chessguyin which i put "(defn main [] print "hi")
10:59chessguybut it fails to build
11:00tmichessguy: (defn main [] (print "hi"))
11:00chessguytmi, same error
11:00chessguy(my code worked in the repl too)
11:01chessguyi get 'Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentList (.clj:4)'
11:02chessguyalong with the requisite massive stack trace
11:08tmichessguy: up the stacktrace up on paste.lisp.org; someone might be able to figure it out (I'm off, so can't help you)
11:09lisppaste8chessguy pasted "stack trace" at http://paste.lisp.org/display/80295
11:11chessguynothing terribly interesting there
11:13bstephensonchessguy: sorry stepped away for a sec
11:13chessguybstephenson, yeah, i'm docking your paycheck for that one
11:16bstephensonchessguy: have you tried naming your main clojure function "-main", not "main"?
11:16chessguyum...no
11:16stuhoodwhat does compiling do when there is no namespace declaration, or gen-class?
11:17hiredmanyou can't, using (compile ...)
11:17hiredmanit takes a namespace
11:17chessguybstephenson, doesn't seem to make a difference
11:17stuhoodhm... so maybe you need a namespace?
11:17hiredmanchessguy: did you pastbin the code ittself somewhere?
11:17chessguystuhood, the IDE puts a namespace in there automatically
11:18stuhoodgotcha
11:18chessguythere's really no code to it
11:18hiredmanwell obviously there is some
11:18bstephensonchessguy: look here: http://clojure.org/compilation under the "gen-class Examples" section
11:18chessguyother than the (defn main...), which i wrote out
11:19hiredmanare you running 1.0?
11:19bstephensonclojure main function should be named "-main".
11:20bstephensonchessguy: that makes it the default entry point for java when loading the class.
11:20chessguybstephenson, the first example there fails to compile in the same way
11:20hiredmanchessguy: what version of clojure?
11:21chessguyprobalby not quite 1.0
11:21chessguybut pretty close
11:21hiredmanbefore or after close?
11:22chessguybefore
11:22hiredmanchessguy: pastbin the code
11:22hiredmanand how you are compiling it
11:22chessguyhow?
11:22chessguyerr, what do you mean by "how" i'm compiling it?
11:23hiredmanjust (compile 'name.space) ?
11:23chessguyoh, i'm using enclojure
11:23chessguyi did mention that
11:23chessguynot sure what command it runs internally
11:24bstephensonchessguy: the example code on clojure.org won't run within netbeans/enclojure as written without some adjustment. But if you build it and run it, sending it an argument like "Fred", it will work.
11:25chessguybstephenson, i'm not even getting as far as running it...
11:25bstephensonchessguy: the -main that will run in netbeans looks like this:
11:25bstephenson(defn -main ([greetee] (println (str "Hello " greetee "!"))) ([] (-main "world")))
11:25chessguyit should build, right?
11:25AWizzArdis there something like dissoc-in (similar to update-in)
11:26bstephensonchessguy: yes, it build with my enclojure
11:26bstephenson(the original code from clojure.org)
11:28lisppaste8chessguy pasted "complete code/output" at http://paste.lisp.org/display/80297
11:28chessguythere you go hiredman
11:29chessguythat's as complete as i know how to be
11:31bstephensonchessguy: that code built in my enclojure, but I have clojure 1.0. Have you tried a "Clean and Build" in NetBeans'?
11:31chessguybstephenson, yes. same thing
11:34chessguyis there some easy way to tell from the repl what version of clojure i'm using? i don't recall
11:36bstephensonchessguy: I just created an entirely new project called Hello, with default namespace clojure.examples.hello, enclojure created hello.clj (which should be the name of the file you are compiling), cut-and-pasted code from your code output, and it compiled in my enclojure!?!?
11:36chessguywait, enclojure created hello.clj?
11:39chessguyheh
11:39chessguyok, it seems to be working now
11:40bstephensonyes, when I created project Hello, it asked me what my default namespace was. I said clojure.examples.hello. Enclojure create directories /clojure/examples, and then creates file hello.clj . That is how the filename and directory structures have to be in order for clojure (like java) to compile (if you use the ns symbol)
11:40bstephensonchessguy: good to hear! Never argue with success!
11:40chessguyyeah, i guess i was messing with the namespaces too much
11:40chessguyinterestingly, it created my file with the exact code from that examples page already in it
11:41bstephensonyes, that code is included when we construct a default project in enclojure. It is there for you to enjoy modifying :)
11:42bstephensonclojure/enclojure are very specific about namespaces and file and driectory structures (like java), so keep an eye on it.
11:42chessguyso what if i want sub-namespaces like clojure.examples.hello.foo and clojure.examples.hello.bar?
11:44bstephensonyou would have files clojure/examples/hello/foo.clj and clojure/examples/hello/bar.clj (both in same directory)
11:45bstephensonchessguy: just a tip from me personally: avoid using hyphens or underscores in filenames, it can get confusing switching between clojure's hyphens and java's underscores.....
11:46Chouserjustrunyourwordsalltogetheritsmucheasier
11:46bstephensonokwithinreasonavoidhyphens
11:48chessguyhaha
11:49bstephensonChouser: I do write a lot of functions with hyphens, but try not to make the last name in the namespace with a hyphen, so I don't get hyphenated filenames. Do you create a lot of namespaces where the result is the source filename contains the hyphen?
11:50ChouserI don't specifically try to avoid it. I guess it depends on how much java interop you're doing.
11:51Chouserthe only reason you'd need to know that a - in a function name should be a _ is if it's a method name in Java, right? At which point camelCase may make sense.
11:52bstephensonChouser: True, and I am a big camelCase proponent, but it is discouraged at our comapny.
11:52bstephensonI appreciate your POV though, thx
11:52ChousercamelCase is discouraged in Java sources?
11:52bstephensonno in clojure sources, and clojure namespaces
11:53Chouseroh, sure. yeah, if it's not for going to be (primarily?) used in Java, then you can usually use hyphens with little negative consequence. esp. for function names.
11:53Chousernow namespace/class/package names may be a bit different -- you're more likely to see the underscores in your source file names and such.
11:54Chouserbut since those are also going to show up less frequently in your source code, perhaps machingthemtogether is reasonable.
11:54bstephensonyes, implies more into Java interop in that project......
11:57bstephensonI think I would try to find a single word synonym for matchingthemtogether, and use that. But I am not nearly the expert as others here, so MHO should be taken with much salt. Mostly I was trying to answer the enclojure problem question. :0
11:57bstephenson:)
11:57chessguydoes netbeans interact well with version control?
11:57bstephensonWe have found little problem with SVN so far. Have quite a few projects there
11:58Chouserbstephenson: well, I appreciate you answering questions. I've been slacking off in that regard a lot lately, compared to what I used to do, and I don't think anyone's missed me. So thanks for your part in that. :-)
11:59bstephensonChouser: when you take that first step to answer someone else's question, it is a bit daunting....glad I knew what I was talking about!
11:59hiredmanau contraire
11:59hiredmanChouser: I missed you
12:00chessguyawwww. group hug!
12:00rhickeywho else will remember when I forget?
12:00chessguy~remember rhickey
12:00clojurebothe works hard so you don't have to
12:00bstephensonhiredman: couldn't agree more. Only listen to rhickey's posts more than Chouser's!
12:03Chouserso the problem with that class is that the class itself was not marked public.
12:03Chousereven though the constructor was.
12:04Chouserdoes that mean that only other unnamed-package classes could have used it?
12:04Chouserand why do I feel like I'm the first person to have ever tried to use this?
13:04technomancyclojurebot: what is peepcode?
13:04clojurebotYou don't have to tell me twice.
13:04technomancyclojurebot: what?
13:04clojurebotwhat is peepcode?
13:04technomancyclojurebot: forget what
13:04clojurebotI forgot what
13:04technomancysilly bot
13:05dysingermoin'
13:05technomancyclojurebot: peepcode is a commercial screencast series; see the Clojure one at http://peepcode.com/products/functional-programming-with-clojure by technomancy
13:05clojurebotOk.
13:08rsynnottalso, that colour hurts my eyes
13:09cp2:)
13:09cp2hello all
13:11technomancyrsynnott: you can be comfortable in your masculinity and still be OK with pink; it's OK. =)
13:15rsynnottI'm not too worried about my masculinity
13:15rsynnott(I'm a homosexual, anyway, so allowed to be ok with pink regardless)
13:15rsynnottbut that is a terribly ugly variety of pink :)
14:08unlinkYes, give me a regular blog entry over a screencast any day.
14:12technomancyI just used reduce and partial in the same line.
14:12replacaunlink: everyone has the medium they like best. I *do* like the occasional screencast, though mostly for tips and tricks.
14:13replacatechnomancy: watch out, you might stumble into haskell :-)
14:14technomancy(http://nerdmeritbadges.com/)
14:15unlinklol at #02
14:15rsynnottso people like screencasts?
14:15rsynnottI alwaysa assumed they existed largely because people liked MAKING them
14:15qmrwcan i define a function at the repl and then get the source for it later in the repl?
14:16marklarrsynnott: I think its like replaca said, everyone has a medium they like best
14:16gnuvinceScreencasts are good, but I really like presentations.
14:16marklarI'm not a fan of them, but I've been teaching a friend programming and he loves them
14:16gnuvinceSome people are just so captivating to watch
14:16technomancydepends on your learning style
14:16gnuvinceSimon Peyton-Jones comes to my mind.
14:16technomancyhaving an engaging narrator is key. not many people can pull it off.
14:17gnuvinceCS should have more females.
14:18unlinkScreencasts suck because once you have watched it and you want to later refer to information in it, you have to seek to that position in the screencast.
14:19unlinkAlso you can't copy and paste information from a screencast.
14:19gnuvinceunlink: you must hate real life ;)
14:20unlinkI can copy and paste information from real life.
14:20unlinkWell, at least the parts of real life that are written in blog entries.
14:20technomancymy Emacs screencast came with a text script, but I didn't get around to including it with the Clojure one. =\
14:21gnuvinceunlink: I tried to right-click on the hot cashier at the gas station this morning
14:21gnuvinceDidn't work :(
14:21gnuvinceSo no copy, and now I can't go there anymore
14:22unlinkThat's not how you interface with women.
14:22technomancygnuvince: should have used keyboard shortcuts
14:22unlinkThe trick is to get her to try to right-click you.
14:22replacaI really liked the screencasts when I was learning rails. I think that's because rails consists mostly of a lot of little tidbits which make nice quick screencasts
14:23gnuvinceunlink: I'll keep that in mind ;)
14:23gnuvincetechnomancy: :)
14:24technomancyI wish I had a tumblelog so I could post that. =)
14:26gnuvincetumblelog?
14:27technomancyhttp://en.wikipedia.org/wiki/Tumblelog
14:28rsynnottit's like a blog, but with fewer features!
14:29rsynnott(as distinct from twitter, which is like a blog, except with basically no features)
14:29rsynnottsoon, there will be a service where you can simply post a smiley or frowny face depending on mood
14:30technomancyrsynnott: http://binarytweet.com
14:30technomancyoh... it's down. =(
14:31gnuvinceI'll make the nothingtweet!
14:32gnuvinceYou can't post anything
14:32gnuvinceYou just have an account
14:32technomancygnuvince: it's the logical final step
14:35gnuvinceThe one before last
14:36gnuvinceThe last one is an empty index.html page that you sell for 4.8 billion dollars to Time-Warner
14:38cemerickwhat are people's general impressions of couchdb, assuming you've used it? (this being a more trustworthy crowd than the general programmer herds :-) )
14:38technomancycemerick: head-over-heels.
14:38technomancyit makes me very happy.
14:41dnolen_so technomancy: question about corkscrew.
14:41clojurebottechnomancy is to blame for all failures
14:42danlarkinhigher response time than an SQL database
14:42technomancydnolen_: oh?
14:43dnolen_so how were you planning on resolving the location of a library from the client?
14:43dnolen_do you have first download the library and then run corkscrew to get the dependencies?
14:45technomancydnolen_: right now only svn/git and http deps are supported; for those you need to give a URL
14:45dnolen_so the part I was working on worked something like this (and joining forces is a good idea).
14:45dnolen_from the REPL I type
14:45dnolen_(install 'library-name)
14:45danlarkincemerick: I still have those couchdb functions I wrote, I bet technomancy has some too :)
14:46dnolen_this hits a server which looks up that librarys dependency info (your format).
14:46dnolen_then it could run corkscrew to install the whole shebang
14:46dnolen_and update the classpath dynamically
14:46dnolen_so you can just start trying out that library right away.
14:46technomancydnolen_: updating the classpath isn't possible
14:47technomancybut if you unpack the dependency onto a directory that's already on the classpath it should get around that flaw
14:47dnolen_you can dynamically add the classpath, and _also_ write to a file. and IDEs can use this file to load the REPL classpath.
14:47dnolen_there's just reason to maintain the classpath by hand.
14:47dnolen_it's too tedious.
14:47dnolen_libraries should define how to update the classpath.
14:47cemericktechnomancy, danlarkin: how many nodes have you scaled out to so far?
14:48technomancydnolen_: dynamically adding to the classpath only works for .clj files; you can't load bytecode from a classpath entry that's been added after JVM boot
14:48cemerickin my (brief) research so far, the only thing that's sent up flags vis a vis other options is the single-master nature of things (unless that's changed, and I'm reading outdated stuff)
14:49dnolen_technomancy: gotcha is that just a limitation of the JVM?
14:49technomancydnolen_: correct
14:49dnolen_and no way to hack around that I suppose?
14:49danlarkincemerick: just one. I agree, the couchdb replication model is... unusual
14:50ChouserI believe you can use -Djava.ext.dirs=foo and drop new .jars into foo at runtime
14:51dnolen_Chouser: I was just going to say that screw it, pull all jars in one place ;)
14:51dnolen_and OS specific dynamic libs
14:51dnolen_so what I'm describing is possible and desirable :)
14:52cemerickdanlarkin: I like the simplicity quite a lot. I worry about what ends up happening when we start pushing too many writes for our master -- do we just go and shard things at the app-level? I can do that with mysql already, thanks.
14:53danlarkincemerick: yes, I think sharding /and/ conflict resolution have to happen at app-level
14:53cemerickI've been reading what little is out there about cassandra, and it sounds like a great hybrid, but I have to recoil a little at its age. at the moment.
14:54danlarkinha, I was just going to mention cassandra
14:54danlarkinone advantage it has over couchdb is it's known-good in a (HUGE) production deployment
14:54danlarkina young project for sure, but obviously stable enough for facebook
14:55hiredmanclojurebot: sdb?
14:55clojurebotTitim gan �ir� ort.
14:55technomancysdb has a lousy query syntax and ugly urls compared to couch
14:56cemerickif it had *two* large users, I wouldn't think twice. Facebook is big, but having another set of set of eyes matters.
14:56technomancybut having amazon handle everything has its appeal
14:56hiredman~sdb is http://github.com/richhickey/sdb/tree/master
14:56clojurebotAck. Ack.
14:56danlarkinsdb is alright, but unusable in some situations, since it's on an external network
14:56cemerickindeed.
14:57cemerickour plan is to set things up so we can plug in whatever persistence we want -- s3 would work just fine for us, but we can't be bound to it for all customers, etc.
14:58cemerickdanlarkin: not trying to be snarky, but I can't help but notice that rhickey's sdb api wraps an existing java API.
14:59cemerick(or, s/has no problem/doesn't feel guilty about)
14:59danlarkincassandra is now in apache incubator, I am expecting nice things from it
14:59cp2do you have a permit for that?
14:59cemerickdanlarkin: ah, I didn't notice that
15:00danlarkinI know more about couchdb than I do cassandra at this point, does it have anything akin to couchdb's views?
15:02cemerickdanlarkin: it uses a column-oriented data model, so aren't couchdb-style views irrelevant? (perhaps I've not yet grokked views...)
15:02chessguyhi ya'all
15:02dysingerI don't think any docdb has anything like couchdb's map/reduce views
15:02dysingerexcept maybe super heavy-weight hadoop/hbase
15:02dysingerand that's not really a doc db
15:05danlarkincemerick: how can I get all users with first name "Dan", for instance
15:05danlarkinoh... thrift
15:06danlarkineack, couchdb is much nicer in terms of query interface, from what I'm seeing on http://wiki.apache.org/cassandra/ThriftInterface
15:07dysingerthere is project voldermort and hypertable
15:07dysingeralso
15:07technomancyyeah, the elisp client for couch is like 300 lines, and most of it is UI
15:07danlarkinyeah everyone and their brother has a K:V store
15:07dysingeryes
15:07dysingerit's all the rage
15:07dysingerI like couchdb
15:08dysingerfor documents at least
15:08dysingerjackrabbit is even a close cousin with JCR
15:08dysingerAt erlang exchange a couple weeks ago Dynomite was demonstrated.
15:08dysingerlooked pretty
15:08dysingercool
15:09danlarkinthe one thing that I have yet to see is a fair comparison between an SQL backend and a couchdb backed, by someone who actually *gets* document store backends, instead of just trying to replicate a relational model as a document
15:09dysingerthe speaker went to his production systems and killed a couple servers in the cluster and the system kept running.
15:09dysingerYeah you are confused if you want to do SQL-type things with K:V stores.
15:09dysingerby you I mean the abstract "you"
15:10dysingerThere is no direct comparison between sql and document/k:v dbs
15:10dysingerIt's not the same use case
15:11danlarkinthere's overlap
15:11dysingerIt's a whole different ball-game IMO
15:11dysingerI don't see it. SQL is all about guarantees on write, transactions and related records.
15:11dysingeryou don't get that with K:V distrib dbs and document dbs.
15:11dysingerbut you do get other things
15:12dysingeranyway that's IMHO from using couchdb and others.
15:13cemericklearning in real-time here: so, with couchdb views, I could potentially avoid having an index off to one side for semi-arbitrary querying?
15:13cemerick(wow, this is incredibly OT :-P )
15:13cp2hugh
15:13cp2hush
15:13cp2*
15:14danlarkincemerick: couchdb (stored) views are run each time a document is updated
15:14danlarkinor whatever
15:14danlarkinit's not read-time calculation
15:14danlarkinif that answers your question, I don't know
15:15cemerickwell, that sounds promising -- so, I could create a view that contained only those documents belonging to a particular customer, etc?
15:16danlarkinexactly
15:20ChouserSweet! The Java protobuf objects are immutable (unlike their C++ cousins)
15:23cemerickdamn wacky wireless
15:24danlarkincemerick: in case you didn't see it: [3:12pm] danlarkin: exactly
15:24cemerickyeah, I saw, just in time :-)
15:24cemerickdanlarkin: in that case, couchdb is *very* interesting indeed. It might turn into mysql past some unknown scale, but at least the data model is sane for what we do.
15:24cemerickand who knows, we may never need that level scalability
15:25danlarkinit's a bit scary to build something on couchdb not knowing how well it works for scaling up
15:26technomancyit's erlang! magic scalability pixie dust!
15:26clojureboterlang is http://clojure.googlegroups.com/web/erlang.clj
15:27cp2so uh
15:28cp2what distro do you guys prefer to use on servers? (be it for work, personal, whatever)
15:28cp2trying to decide what to install on this vps
15:29danlarkincp2: might as well ask if we prefer vi or emacs
15:29danlarkin:)
15:29cp2hah danlarkin
15:29cp2im not trying to start a war here =P just asking for (small) opinions...
15:29technomancyuse what you know
15:29cemerickwe used fedora for a long time...switched to ubuntu server a few months ago
15:29technomancyunless it's fedora
15:29technomancy=)
15:30cp2lol
15:30cp2well, currently it has centos 5 installed
15:30cp2but i am getting pretty pissed at it
15:30cp2am leaning more towards debian
15:31danlarkinI use gentoo, but don't say that too loudly anywhere or you'll get people shouting "--funroll-loops" at you
15:31cemerickthat was sorta-kinda our progression. We decided on ubuntu purely based on its release pace and general level of activity compared to debian proper.
15:33cp2hah danlarkin -- i know
15:33cp2i used to run gentoo on a desktop at home
15:33cp2got a lot of abuse for mentioning it =P
15:33cp2cemerick: yeah, i was thinking that too
15:33cp2ubuntu is more 'up to date' (even though debian 5 just came out, but still)
15:34danlarkinI used to use debian (way back when potato was the stable release, long before ubuntu existed) but I prefer portage to apt by a longshot
15:36cp2well, i have sort of a love hate relationship with portage
15:36cp2i would rather not talk about it :(
15:42arohnerwow, talk about rhickey's time machine. I was about to ask if there was a function to "replace" values in a collection
15:43arohnerand so I thought "I know, I'll use find-doc before asking the channel"
15:43arohnerand there it is, clojure.core/replace
15:48cemerickdanlarkin: I've been off in #couchdb being a noob. It's not single-master at all.
15:49danlarkinoh word?
15:52lisppaste8cemerick pasted "danlarkin: multiple-master couchdb mini-transcript" at http://paste.lisp.org/display/80309
15:53danlarkinOoooo
15:53danlarkinI wonder what the eta is like
15:53danlarkin"some time soon" :)
15:55cemerickwell, it sounds like you can just round-robin the PUTs (which would be completely transparent to clients), and have functionally the same thing now
15:55cemericka little more sysadmin involved there, though, and you've still got the single point of failure (the proxy)
15:56danlarkinI joined #couchdb after you mentioned you were in there
15:57cemerickdanlarkin: yeah, that's when I stopped the transcript :-)
15:57danlarkina twisted server to round robin to different couches seems... weird
15:57cemerickI don't think the twisted server is necessary for the round-robining -- IIUC, that's to ensure proper application of the views.
16:01danlarkincemerick: your problem sounds fun, I'm jealous :)
16:09cemerickdanlarkin: eh, the storage stuff is the simplest part. We're still trying to figure out the real guts of the thing. :-)
16:37danlarkincemerick: I'll try to get my couchdb functions up on the internets this evening (or some time this weekend, at least) and then you can start hacking them into shape :)
16:39cemerickdanlarkin: I hope you won't feel bad if I say that we'll likely just use jcouchdb. We've no fear of dependencies, and already-tested code has a strong pull...
16:39cemerickI will absolutely take a look, though -- maybe the advantages will outweigh that instinct.
16:41danlarkinhaha I'm horribly offended!
16:42danlarkinjust kidding of course, jcouchdb likely covers more features of couchdb right now
16:42hiredmanhmmm
16:43hiredmanI wonder where that exception came from
16:43hiredman~still here?
16:43clojurebotIt's greek to me.
16:43cemerickyeah. I've had a number of conversations here in the past couple of weeks with people reimplementing stuff in clojure that already exists in java with decent APIs. It's a confusing impulse to me.
16:44dnolencemerick: only if you think that Clojure will never run on an environments other than Java.
16:45danlarkinwe can't help it
16:45dnolenif Clojure runs on Objective-C, any library that explicity depends on Java will need to be rewrriten. versus writing against a stable Clojure based interface.
16:47cemerickdnolen: sure, but aside from "just wanting to" (completely legitimate motivation, of course), it seems like one would wait until those other backends are available, and then hopefully wrap whatever is natively available there with a common API that handles the gnarly details of hooking up with the bits that do the real work.
16:51cemerickI hope no one takes my puzzlement the wrong way. I'm just talkin' over here. :-)
17:03Chouseris proxy-super thread-safe?
17:04Chousermaybe as long as the proxy instance is visibile to only one thread?
17:09billy-hi. i have a key that needs to be a string than back again...
17:09billy-when (keyword ":a") returns ::a
17:09billy-what's that?
17:09Chouser,(name :a)
17:09clojurebot"a"
17:09opqdonutit's a keyword :)
17:09Chouser,(keyword (name :a))
17:09clojurebot:a
17:10billy-ok, so its not :namespace/a then
17:10billy-,::a
17:10clojurebot:sandbox/a
17:28chessguyugh, what's that if-let construct?
17:31leafwchessguy: it's a short cut for (let [a (whatever)] (if a (do ...)))
17:32chessguyis there something similar for (let [a (whatever)] (if a a (do ...)))
17:33opqdonut:D
17:33chessguyopqdonut, :)
17:33chessguywhat are you doing in here?
17:33opqdonutcoding clojure at work nowadays
17:34chessguyreally? awesome!
17:34stuartsierrachessguy: (or (whatever) (do ...)))
17:34chessguythat's right, i forgot you were a java guy
17:34chessguystuartsierra, ooooh, good call
17:35opqdonutnot entirely satisfied with the language but it's the best one available on the jvm :)
17:35chessguyopqdonut, what are you working on these days?
17:35opqdonutmachine learning applied to robotics
17:35opqdonutmostly coding, other guys handle the theory
17:35opqdonutat a small startup
17:36chessguywhereabouts?
17:36opqdonuthelsinki, finland :)
17:36chessguycool. sounds like fun
17:36opqdonutyou're still coding the chess system?
17:37chessguystarting something new in clojure
17:37opqdonutmhmm?
17:37chessguyfigure it's about time i learn a lisp, and i really like a lot of the features of clojure.
17:38opqdonutyeah, pureness is nice
17:38opqdonuti've done some things in CL but the impurity kept bothering me after haskell
17:38chessguyyeah, i miss strong typing :(
17:39dnolenme not. ;)
17:39opqdonuti miss algebraic data types
17:39opqdonutnot the typing that much
17:40opqdonuta shame the adt library in contrib is so unfinished
17:40chessguydnolen, a little slack, please. we're trying hard to branch out here
17:40opqdonutguess i should contribute a few patches
17:40dnolenopqdonut: pardon my ignorance, but what does ADT give you over a relatively powerful object system like Smalltalk or CLOS except less flexibility and type checking?
17:41opqdonutdnolen: i just want discriminated unions i can case over
17:41opqdonuti'm used to thinking that way
17:42opqdonutstruct-maps with a :type key aren't that good a solution
17:42dnoleninteresting, do you have link for that? is this some form of dispatching?
17:44opqdonutmm yeah, basically
17:44cemerickhave a good weekend, all
17:44cp2
17:44cemerickdanlarkin: thanks for the couchdb info, etc.
17:44opqdonutdnolen: i haven't got a proper reference but i write a short example in haskell
17:45dnolenI have a copy of Real World Haskell looking at it now ;)
17:45opqdonutheh
17:45opqdonutdata Expression = Lit Int | Plus Expr Expr
17:46opqdonuteval e = case e of Lit i -> i; Plus a b -> (eval a) + (eval b)
17:46opqdonuti want to write something roughly like that
17:47opqdonuthttp://code.google.com/p/clojure-contrib/wiki/TypesApiDoc <- a very unfinished implementation for clojure
18:12guineaWhat's the difference between sync and dosync? Is it laziness?
18:13guineanever mind, I just found the macro definition of dosync
18:57chessguyopqdonut, how would you change that API?
18:59chessguy,(eq? '(1 2 3) '(1 2 3))
18:59clojurebotjava.lang.Exception: Unable to resolve symbol: eq? in this context
19:01opqdonutoh the types one? it's fine, the library's just pretty incomplete
19:01chessguywhat would you add to it?
19:02opqdonutwell the api pretty much has everything that's needed, defadt and match
19:03chessguyso...what's incomplete about it?
19:04opqdonutwell, printing a nullary constructor throws a nullpointer exception
19:04opqdonutand other bugs
19:04chessguyoh, so it's buggy
19:44unlinkWhere's the part of prn that does the actual printing?
19:51eeei asked a question in the discussion group . . . got no answer
19:51eeewill try here
19:51eeewhat's a good thing to return from java
19:51eeeso that
19:51eeeclojure can work with a "pair"
19:52eeein my case, there's a minData() and a minPri() function
19:52dnolen_like returning a vector in clojure?
19:52eeebut maybe the user just wants min()
19:52eeeand then they know that :data
19:52eeegets the data
19:52eeeand :pri
19:52eeepri
19:53eeegets the priority
19:53eeeso maybe returning a map
19:53eeewith two keys
19:53eeei guess the java code needs to include clojure at that point. to use clojure objects
19:54eeenative clojure objects
19:57guineadepends on if clojure objects are java objects
19:58guineanot sure if you'll need a wrapper though
19:58eeethis is something for rhickey, i guess
19:59guineayeah
19:59eeeif it comes down to preference
19:59guineain your shoes, i'd probably just use a java object
19:59guineacreate a java class with pri and data
19:59guineathen perhaps use a macro of clojure function to access pri and data
19:59eeeok
19:59eeetnks
20:00guineaeither a macro or a function to access the pri and data fields/methods
20:00eeethat's a thought
20:00eeebetter than first and second, for sure
20:00eeebut at that point
20:01eeenot simpler than just asking heap
20:01eee(.minData heap)
20:01guineayou can always use a clojure wrapper to return it in first, second format
20:02eeei could actually make the heap a lazy seq
20:02eeewell . . .doesn't solve the pair problem
20:02eeei just confused myself
20:02eeevm
20:02eeenevermind
20:03guineai'm trying to think of something useful to practice using refs and stm on
20:03eeei am working toward that with this work
20:04eeefirst doing serial versions of heap algs
20:04eeebut will end with parallel branch and bound
20:05guineaand you're doing part of it in java?
20:05eeerich asked me to implement the heap in java purely functional
20:05eeeso I did
20:06eeegot a rockin persistent datastructure
20:06eeeneed to do some examples
20:06eeeso people se the value
20:06eeei've wanted to implement this stuff for a long time. . . .long before clojure
20:07eeeso now finally forcing myself to
20:07eeevery fun coding up the heap, and I have some stuff that may never have been done before planned
20:08eeedon't know clojure tho . . . so good project to start out with
20:08guineasounds very cool
20:08eeehttp://code.google.com/p/jc-pheap/
20:09eeefeel free to mess with it or suggest stuff if you think it is a way to mess with stm
20:10eeeyou could parallelize the a-star algorithm
20:10eeethat is included there
20:10guineacool
20:11eeewow, now that I put the source in a zip, the download count went up to 2
20:11eeei wonder how many read-only svn views were out before that
20:11guineais there no count of those?
20:12eeenot that I know of
20:12eeei bet if I used github it would have helped, too
20:12eeepeople seem to like that
20:14ieureGitHub is really nice.
20:14guineawhat brought you to clojure?
20:16eeean article on languages coming out for parallelism
20:16eeeso it was gonna either be F# or clojure
20:16eeeand F# is microshaft?
20:17eeeand clojure had cool videos by rhickey
20:17eeeand clojure is lisp
20:17eeeparallel stuff and lisp? done
20:18eeewhat about you, guinea
20:21eeeis there an easy way to get the set of keys from a map?
20:21dnolen_keys
20:22dnolen_,(keys {:k1 'v1 :k2 'v2 :k3 'v3})
20:22clojurebot(:k1 :k2 :k3)
20:22eeewell, that would be easy :)
20:23guineaI need to use the JVM and Java based libraries on some things, but don't really like Java
20:23dreishIf you actually wanted a set, there's .keySet
20:23guineaI tried Scala, but found it was still pretty verbose
20:24eeedreish . . . it's for a reduce
20:24eeeso as long as some sort of "foreach" happens
20:24dreishDon't want a set then. :)
20:24eeeright
20:24eeebut thanks for the info
20:24eeethat I'll forget
20:24eee:(
20:25dreish(show {:a 1})
20:25dreishIf you've loaded contrib repl-utils
20:25eee,(show {:a 1})
20:25clojurebotjava.lang.Exception: Unable to resolve symbol: show in this context
20:25eeereally?
20:25eeethat is cool
20:26guineawhat's the help command in the repl again?
20:26dreishHelp for a function? doc
20:26eee,(doc doc)
20:26clojurebot"([name]); Prints documentation for a var or special form given its name"
20:26guineayup, that's the one
21:13lisppaste8tmi pasted "key must be integer?" at http://paste.lisp.org/display/80320
21:14dreishtmi: In a vector, yes.
21:21tmidreish: I'm trying to get session-stuff working in compojure; (with-session (fn [req] ...)) and I can't quite figure out where it goes wrong.
21:21dreishOh, sorry. I've never tried compojure.
21:22tmi:/
21:22tmiThanks anyway.
21:32kliis there a way to iterate over a collection while keeping a counter
21:32klilike ruby's each_with_index
21:36unlinkkli: a bad way to do it is (apply map list [(iterate inc 0) my-seq])
21:36unlinka slightly less stupid, but still bad way to do it, would be (map list (iterate inc 0) my-seq)
21:37klii see
21:37cp2,(map list (iterate inc 0) [1 2 3 4 5])
21:37clojurebot((0 1) (1 2) (2 3) (3 4) (4 5))
21:38lisppaste8tmi pasted "key must be integer culprit...?" at http://paste.lisp.org/display/80322
21:40kli,(def *test* 1)
21:40clojurebotDENIED
21:40klihaha
21:41klirejected =D
21:41klii was going to start using this as my repl...
21:41cp2,(def *girlfriend*)
21:41clojurebotDENIED
21:41cp2:(
21:41klithe bot's grumpy
21:42hiredmantmi: what is merge?
21:42hiredmanthe function merge?
21:43tmihiredman: looks that way
21:44hiredmanneither of those two things are maps, as far as I can tell
21:44hiredmanand the first thing is definitely a vector
21:44hiredman,(into [] {:a 1})
21:44clojurebot[[:a 1]]
21:44hiredmanbah
21:45hiredman,(assoc [] :a 1)
21:45clojurebotjava.lang.IllegalArgumentException: Key must be integer
21:46tmihmm
21:49tmiit's supposed to be {:status 302...}; now I gotta figure out why/where it's converted :/
21:50hiredman,(doc merge)
21:50clojurebot"([& maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result."
21:51hiredman,(merge-with merge [1 2] {:a 1})
21:51clojurebotjava.lang.IllegalArgumentException: Key must be integer
21:51hiredman,(merge-with merge {1 2} {:a 1})
21:51clojurebot{:a 1, 1 2}
21:52hiredman,(doc merge-with)
21:52clojurebot"([f & maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) will be combined with the mapping in the result by calling (f val-in-result val-in-latter)."
21:52hiredmanhmmm