#clojure logs

2010-08-24

00:00redalastorThat one already have much of the nice things we like so it's going to be easier to transition people.
00:11ihodesaugh! I forgot something.
00:11technomancyihodes: heh; hey
00:11technomancywas just looking at your patch
00:11ihodesi have a fix.
00:11ihodeshaha
00:12technomancyoh?
00:12ihodesi was just falling asleep, when i realized i forgot one case
00:12technomancywell don't let it keep you up at night. =)
00:12ihodesi had taken out the test for if there was no :min-lein-version specified. i'm pushing it up now
00:12technomancyoh right; I didn't even think about that.
00:13technomancyihodes: I skipped the patch that added :min-lein-version to lein's own project.clj since there's no trouble building lein with an older version of itself
00:14ihodeshaha it's fixed now, committing
00:15ihodessending pull request :)
00:15ihodesthen i can sleep
00:15technomancysweet; thanks
00:16ihodessent. also, i think i'll start sending patches if that's ok: deselecting people from the pull requests is a drag haha
00:17technomancyhow about if you send email to the mailing list describing where to pull from?
00:17ihodesby the way, was changing VERSION to LEIN_VERSION and exporting it ok? i realized i may have missed a better/different way to get the currently running lein's version
00:17technomancyyeah, if it's going to be exported it should be more specific; that's good
00:17ihodesi can do that, sure
00:17technomancyif it goes to the list then it's easier for others to apply it
00:17ihodesalright, good. for sure. and i'm not sure the bat script will work - don't know if LEIN_VERSION needs to be …exported?… from that on windows.
00:18ihodesbut cheers! I'll look into some issues tomorrow. thanks for the awesome project to hack on.
00:19technomancydang; not sure about that. maybe you could mention it on the windows support thread.
00:20ihodesis that on the google group?
00:21technomancyyup
00:24ihodesalright, posted on the one Shantanu started. good night :)
00:24technomancylater
00:25ihodesah and sorry about the over 80 lines–I'd double-checked that. i'll look into whatever caused that… and silly re: the < vs. lambda. gnight!
00:25technomancyit's all good
00:44technomancyanyone familiar with c.c.zip-filter.xml?
00:45technomancytrying to figure out what this means: (xml-> (xml-zip (xml/parse istream)) (tag= :components))
00:51cemericktechnomancy: returns an xml zipper containing only <components> elements in the XML coming from istream IIRC
00:53tomojonly children of the root element, though, yes?
00:53tomojand it returns a seq of zippers, I think?
00:54technomancyI guess I need to read up on zippers
00:55cemericktomoj: right, (tag= ...) is equiv to /tagname, not //tagname in XSL parlance
00:55technomancysomeone was telling me it would be relatively easy to express that without contrib, but I don't know the clojure.zip ns well enough to say
00:57cemerickright, there's clojure.zip/xml-zip
00:58technomancywell, that's already being used; it's more a question of whether xml-> and tag= can be replaced
00:59tomojwouldn't you have to go down and then search right?
00:59tomojI mean, you can just filter children looking at the tag, but then you don't get zippers back
01:00technomancyyes, but it's too late at night for me to attempt to dive into such a rich topic as zippers, so I'm fishing for easy answers. =)
01:00tomojtag= at least can be removed because xml-> does it automagically :)
01:00technomancyoh... I can't get rid of contrib here anyway because (grumble grumble) delete-file-recursively, slurp*, and to-byte-array did not make it into clojure.java.io. =\
01:00technomancyweak.
01:01cemerickThe latter two are particular sore spots.
01:01cemerick1.3.0-SNAPSHOT, here we come.
01:01technomancycemerick: oh, I see that you spoke up for to-byte-array. nice.
01:01technomancyshame it appears to have been too late.
01:01cemerickyeah, not enough though I guess.
01:02tomojtechnomancy: do you use the results as zippers or just map zip/node over them?
01:02technomancytomoj: here's a quotation from the file in question: ;; TODO: need documentation; I have no idea what this is for. Alex!!!
01:02technomancy=)
01:02tomojheh
01:02cemerickslurp* would never get in because of the * naming.
01:03technomancytomoj: it's for walking over a set of XML files to remove duplicate entries, I think
01:03technomancycemerick: understandable I suppose; a proposal to save it must be accompanied by a better name for it.
01:05technomancyI suppose I don't feel bad about snarfing delete-file-recursively into leiningen wholesale since I wrote it myself anyway.
01:05msfcan any one throw me a pointer to where I can read up on reflection warnings and why I should care ?
01:06tomojtechnomancy: read-components?
01:07technomancytomoj: right
01:08technomancyif I understood why it was necessary I could write up a test case; then I'd be more comfortable monkeying around in there
01:09technomancydoh; now that clojure.core/slurp uses clojure.java.io/slurp it may actually make slurp* unnecessary
01:10tomojthink something like https://gist.github.com/fc267f2b16d88bff7acd should work if you also grab children from clojure.zip, but don't take my word for it :(
01:10technomancytomoj: thanks; I'll take a look
01:11cemericktechnomancy: shit, I had no idea slurp was now using reader!
01:11cemerick:-D
01:12technomancycemerick: yeah, complaint officially retracted!
01:12cemerickheh, with old argument style compatibility retained, even.
01:13technomancywell done, Mr. Halloway.
01:15tomojisn't there a less ugly version of #(= (:tag %) :components) ?
01:20slyrus(fn [entry] (= (:tag entry) :components)) :)
01:20technomancy(comp (partial = :components) :tag)
01:21slyrusI'm not sure that's more readable
01:21tomojmaybe I want (filter-by :tag :components)
01:22tomojer
01:22tomojguess it would be (filter-by :tag coll :components) or (filter-by :tag :components coll)
01:30slyruswell, the new contrib layout certainly takes a lot longer to build
01:30technomancywell, there aren't a lot of good reasons why you'd have to build the whole thing
01:32slyrus?
01:33slyrusI can see not loading all of the jars, but I would imagine that one would want a full set of jars if they were building their own contrib
01:33technomancysure, but why would you build your own contrib?
01:33technomancydo you not trust build.clojure.org?
01:34slyrusit's not that I don't trust it, I just want to be able to build my own. what if I need to make changes?
01:34msfhaving trouble getting lein to talk to repositories.apache.org
01:34technomancyslyrus: then you'll probably be making them to one module at a time
01:35msf:repositories { "apache" "http://repository.apache.org/content/repositories/snapshot s/"}
01:36msfagh
01:36msfsorry
01:36slyrustechnomancy: I like to avoid problems like msf's :)
01:37msfheh
01:38slyrusbut, then again, I'm just a quasi-control freak used to building my own lisp environment and all of its libraries
01:49technomancydiffrent strokes...
01:52slyruswachu talkin' bout Willis?
01:53technomancy...for diffrent folks.
01:54maravillashm, is it october 22nd yet?
01:55technomancynope
01:56maravillasalas...i'll try again tomorrow
01:58tomojwhoa, I didn't realize what modularisation of contrib meant
01:58tomojthat's awesome
02:01slyrusok, finally that of a name for that bioinformatics-y package I've been thinking about
02:01slyruss/that/thought/
02:01sexpbotok, finally thought of a name for thought bioinformatics-y package I've been thinking about
02:02slyruswhoops...
02:50vIkSiT'lo all
02:50jacortinaslo
02:50vIkSiThow would you use a (dosync (alter)) with a merge-with (or any function that takes more than 2 args)?
02:50vIkSiThey jacortinas
02:50jacortinasnoooo clue
02:54LauJensenHello
02:56LauJensen,(let [r (ref nil)] (dosync (alter r (partial merge-with +) {:a 1} {:a 1})) @r)
02:56clojurebot{:a 2}
02:56LauJensenvIkSiT: something like that maybe
02:56vIkSiThey LauJensen
02:56vIkSiTaaah
02:57vIkSiTpartial.
02:57vIkSiTglad i learned how to curry
02:57vIkSiTLauJensen, hmm that looks like a bad solution to my problem though. would you help me figure out another logic for it? :)
02:57LauJensenShoot
02:57vIkSiTbasically - i want to read one file at a time from a directory, do some computation on it, and store the result in a map.
02:57vIkSiTat the very end, i need to combine my map into one (using merge-with +)
02:57vIkSiTmaps*
02:58vIkSiTwhats the best functional way to do so?
02:58vIkSiTmy uber-clunky version looks like https://gist.github.com/8feba443c12348f33eb7
02:58vIkSiTwhich *works* as long as i can get that merge-with/ref taken care of..
02:59tomojwhat's this (range (count (take 1 file-list))) ?
02:59hiredman(reduce (partial merge-with nil-safe-plus) {} (make-maps-from-files))
02:59tomoj(range 1) ?
03:00hiredmanwhy are you using refs at all?
03:00LauJensenvIkSiT: Go with hiredmans recommendation, and dont use concurrency semtantics where there is no concurrency :)
03:01hiredmanrefs are not functional, they are a way to control mutation and make it "safe"
03:02tomojdoesn't your let also have an odd number of forms in the binding vector?
03:02tomojthe inner let, I mean
03:02tomojno.. just unbalanced sexps
03:02tomojmaybe I'm going blind
03:02vIkSiTaah.
03:03vIkSiTtomoj, for your first question - i need to go through all files, so i just tried with one for now..
03:03vIkSiThiredman, yes indeed, i was just using it as a hack. the reduce method seems much cleaner
03:04tomojdon't forget that for is not a loop
03:05vIkSiTtomoj, ?
03:06tomoj~for
03:06clojurebotfor is not a loop
03:08wwmorganvIkSiT: I posted an approach that uses the ->> macro. untested
03:08vIkSiTwwmorgan, aha, link?
03:08wwmorganyour gist
03:08vIkSiTI was thinking of the ->> as well, but couldn't fit it in..
03:08vIkSiTk
03:08tomoj,(do (for [i (range 10)] (println i)) 3)
03:08clojurebot3
03:12vIkSiThmm, how do i map a java function?
03:12vIkSiTah got it.
03:13bsteubervIkSiT: you could wrap it in a clojure funktion
03:13vIkSiTah
03:13vIkSiTright
03:13vIkSiTbtw is ->> lazy?
03:14vIkSiTfor instance, i have about 1000 data files in that dir - not sure how well it will hold up.
03:14hiredmanuh
03:17wwmorgan->> is just a syntactic transformation. Since (->> a b c) becomes (c (b a)), it will be as lazy as c is.
03:17sexpbot=> #<core$_GT_ clojure.core$_GT_@53cb30a4>
03:18vIkSiTah
03:18vIkSiTof course
03:21bsteuberI need to generate a java class with static fields (not methods) from clojure - is that possible?
03:21LauJensenBjering: Status? :)
03:25limux1972where is the gen-and-load-class?
03:28vIkSiThmm
03:28vIkSiTso what would the best way to sort a map by value?
03:30limux1972when i reference gen-and-load-class, there is exception of unable to resolve var?
03:31tomoj,(sort-by val {:a 3 :b 2 :c 1})
03:31clojurebot([:c 1] [:b 2] [:a 3])
03:31limux1972also i found that the gen-and-load-class defined in genclass.clj not as private
03:31LauJensen"how to sort by value?" (sort-by val ..) .. its almost like english:)
03:32tomojlimux1972: does yours have a "(comment" before it?
03:34limux1972i don't know, i use the offical clojure.jar
03:34limux1972that function have to uncomment, and build myself?
03:34tomojif it's commented out, you're not supposed to be using it..
03:35vIkSiTsheesh.
03:35vIkSiTLauJensen, tomoj - i couldn't find it :)
03:36limux1972ok, i will build one from soucre myself
03:36vIkSiTtomoj, LauJensen - given that returns a sequence of lists - how do you convert it back to a map?
03:36vIkSiT(or do you not need to?)
03:37tomojit would be somewhat silly to convert it back to a map
03:37tomojsince you started with a map
03:38vIkSiTheh i get that..
03:38vIkSiTi meant, converting an arrayseq into a map in general ..
03:38clojurebotparedit screencast is http://p.hagelb.org/paredit-screencast.html
03:38vIkSiT... ?
03:38LauJensen(into {} ...) ?
03:38vIkSiTLauJensen, ah.. and that won't maintain the ordering right?
03:39vIkSiTunless i do a sorted-map perhaps
03:39LauJensenRight
03:39LauJensenBut like tomoj says, you have no motivation to convert it back
03:40tomojsorted-maps are sorted by key
03:44vIkSiTLauJensen, right
03:44vIkSiTtomoj, ah right
03:49LauJensen,(reduce #(assoc %1 (val %2) (key %2)) {} {:a 3 :b 5 :c 1})
03:49clojurebot{1 :c, 5 :b, 3 :a}
03:49LauJensenvIkSiT: Of course you could switch them, but now we're way into silly town :)
03:49vIkSiThehe
03:51vIkSiTwow. stack overflow error when serializing last data structure
03:51vIkSiThmm, how do i customize my lein swank to give more memory to the JVM btw?
03:51wwmorgan,(doc map-invert)
03:51clojurebotI don't understand.
03:53neotykHi
03:53neotykis there an easy way to "splice" a map?
03:54neotykmacro gets map as argument, and wants to use it inside as keyworded arguments
03:55Chousuke~@(apply concat themap)
03:55clojurebotExcuse me?
03:57neotykChousuke: works great, thank you
04:03neotykwhat is more idiomatic for macro when it expects some configuration in first argument to expect it as map or as vector?
04:07spariev_vIkSiT: I just added a line with JAVA_OPTS="$JAVA_OPTS -Xmx2048m" at the beginning of the lein script
04:07vIkSiTspariev_, ah. It looks like :jvm-opts in project.clj with ["-Xms2048m"] should work too..
04:07AWizzArdneotyk: I would say that this is a question of personal taste, but of course depends on the situation. Having many named fields makes accessing them easier and allows easier for optional key/value pairs.
04:09neotykwhich would be better? 1. (a {:n v} ..) 2. (a [:n v] ..)
04:09vIkSiThmm I think my issue may not be jvm memory.
04:09spariev_vIkSiT: yep, looks like I use ancient version of lein :) :jvm-opts is the way to go
04:09vIkSiTI get a stackoverflow trying to serialize a large datastructure using this serialize function : https://gist.github.com/3e3bdb1f0ca0ca72c5c6
04:09vIkSiTspariev_, :)
04:10vIkSiThow do you guys serialize large data structures? convert to json perhaps?
04:10AWizzArdneotyk: another option is to not pass a map/vector at all.
04:10LauJensenneotyk: According to the guidelines, unroll the map (fn :a 5 :b 3)
04:10AWizzArdBut instead the macro accepts [arg1 arg2 & keys], and you can (apply hash-map keys)
04:11Chousukeor use the new destructuring feature :P
04:11AWizzArdAnd merge this with defaults.
04:11AWizzArdyes true
04:11AWizzArdDestructuring.
04:11AWizzArdChousuke: btw, why "new"?
04:11AWizzArdIsn't that available already since pretty long time by now?
04:11ChousukeAWizzArd: it was introduced in 1.2 which was just released
04:11Chousukeso pretty new.
04:12vIkSiTor not. looks like json-read and write arent supposed ot map to clojure data structures
04:12vIkSiTshucks
04:12AWizzArdChousuke: ah okay
04:13neotykChousuke, AWizzArd, LauJensen I have that macro http://github.com/neotyk/ahc-clj/blob/24be2b2c51dd5a7fd36d5fe3230999ea6daeec8e/src/async/http/client.clj#L34
04:14Chousukeneotyk: why the destructuring form there? that's equivalent to just "config"
04:14neotykChousuke: because it is my first macro :-)
04:14Chousukeanyway, in that case I would go with a map for the configuration.
04:15Chousukebut hm, do you depend on the http client being bound to *ahc*?
04:17ChousukeYou should avoid dynamic binding if you can. It hurts composability.
04:17neotykChousuke: yes, normally library provides async http client, but if you want to use your custom configured one, than I figured out that would be way to go
04:17Chousukeokay.
04:18AWizzArdneotyk: if this were not a macro, but a defn, how would you solve/prefer it then?
04:20neotykAWizzArd: I don't see it been solvable with defn
04:20ChousukeYou can but you'd have to pass around anonymous functions :/
04:20neotykI like "new" destructuring a lot
04:21AWizzArdMacros are never needed. They just abstract away some syntax, and in this case, as Chousuke said, they spare you a (fn [])
04:21ChousukeWell, hm
04:21ChousukeSome things are not really possible with functions
04:22AWizzArdAll is possible, from a mathematical point. But in that point saving to type duplicated code is not included.
04:22ChousukeI think some opengl clojure wrapper (possibly penumbra) does reflection in macros to generate bindings for opengl methods at compile time.
04:22ChousukeI don't see how that's even in theory possible without macros :P
04:22AWizzArdfrom the computational point it can be done without macros, even if that means the code would run slower
04:23ChousukeWell yeah, but that's pretty useless information :)
04:23AWizzArdAlso, functions could write pure byte code directly.
04:24neotykI would probably use keyworded args for config like here http://github.com/neotyk/ahc-clj/blob/refactor/src/async/http/client.clj#L24
04:24Chousukeneotyk: but you can't in this case because you have the body parameter. So go with a map.
04:25AWizzArdneotyk: btw, I think what Chousuke said before about {:as config} also applies to {:as options}.
04:25AWizzArdYou could just say 'options' instead
04:25ChousukeAWizzArd: actually not
04:25Chousukethe map form in that case causes "options" to become a map.
04:26Chousukein the earlier case {:as config} is redundant because it doesn't follow a & and thus has different destructuring behaviour
04:28AWizzArdOh right, a &. Good point.
04:28Chousukebut the & {:as options} form causes the args in the form of ":foo bar :some more" become {:foo bar :some more} which is then destructured normally; and since there's only :as, it just gets bound as is to 'options
04:30neotykI've also modified a bit c.c/promise so I can check if it was delivered
04:31neotykdo you think it is worth creating ticket and submitting a patch for it?
04:32neotykimplementation is: http://github.com/neotyk/ahc-clj/blob/refactor/src/async/http/client/util.clj#L20
04:35AWizzArdneotyk: better ask rhickey first
04:40BjeringLauJensen, status is I am porting my C++ server + stressbot to Linux to rerun the trials there, even though I would be surprised if that changes alot.
04:41LauJensenk. I dont know how much it will change, but I remember in on of my blogposts on benchmarking, I could pick the windows user out from among the *nix users in the comments, just by looking at his results
04:42Bjeringcould be the difference is huge for jvm things. Doubt many shops runs heavy java servers on Windows.
04:42BjeringFor C++ the windows story is good.
04:48BjeringI think it could be huge judging from this post... http://stackoverflow.com/questions/592303/asynchronous-io-in-java
04:48Bjeringit says in JDK6 they use select in windows, which is bad.
04:54LauJensenInteresting - Im wondering why you're porting the C++ server as well, isnt seeing how the Clojure version performs against your stressbot enough?
04:55BjeringIt wont be the same hardware, reinstalling my main workstation is more job than fixing the minimal porting I will have to do. And to be fair, running on my 6 year old single-core Athlon git server I expect any version to perform less.
04:56Bjeringhmm, 8 years old even.
04:56Bjeringsurprised it still runs...
04:58AWizzArdBjering: did you think about trying to put your service on Googles App Engine?
05:00BjeringAWizzArd, no I haven't but dnolan also showed me Amazons service could be a good idea. Now all that said. I am currently running through local-host. I want to test _my_ code, not my internet. But I should probably learn/investigate those kinds of hosting solutions eventually.
05:01AWizzArdYes, EC2 is also nice, though for very low-end hardware you will pay over 80$ per month, while at Google you get a much better starting point for roughly 0$ per month.
05:01LauJensenBjering: Single-core isnt good for Clojure. GAE isnt good for Clojure Concurrency. You should try on a Linux box with at least a couple of cores
05:02LauJensenAmazon might be your best bet like dnolen said
05:02AWizzArdLauJensen: spending several hundreads for some hobby projects is not possible for everyone.
05:03AWizzArdhundreds even
05:03LauJensenAWizzArd: Its not a hobby project
05:03LauJensenAnd besides, EC2 costs very little money
05:03AWizzArdMany thousand percent more than Google.
05:03LauJensenpercentages can cheat - 5$ isnt much
05:03Bjeringanyway, if the test on my old Linux machine are positive for jvm/netty vs the C++ I will have to get Linux to my dev-machine anyway and we can have more authorative test results. Or I could just send anyone a rar of both my C++ and Java/Clojure code and hear someone elses result.
05:04LauJensenAnd besides, he needs to work with agents which is a no go on GAE, so its not an option
05:04AWizzArdDepends on the design of his app. On Google he has 72 cores.
05:04LauJensenBjering: Im a little pressed for time this week, otherwise I would have loved to help
05:05AWizzArdBjering: what are your experiences so far? How much slower is the JVM, compared to C++ in this case?
05:05BjeringYou are already helping, yesterday you taught me to get rid of reflection which was a x10 speedup that shifted the bottleneck :)
05:06LauJensen:)
05:06LauJensenBjering: on my system, a call to partial is a 10x slowdown as well
05:07BjeringAWizzard, with java solution (and clojure solution, I have both versions), my machine starts taking alot of cpu load when I go above 7k stressbot clients, and totally hangs my machine at 35k clients. My C++ (using boost::asio for the network) takes 2% CPU when I run it using 4 threads, and 5% when it use 1 thread.
05:08AWizzArd2% for 35k clients?
05:08LauJensenYou wish
05:08BjeringIts interesting how the C++ solution perorms WORSE when allowed only one thread, I think its typical network congestion behavior... start getting a queue alot of CPU goes to maintaining that queue. Its a pretty hard point until everything is fine, and above it it is just bad.
05:09AWizzArdBjering: did you read that article, about having 100k concurrent users on Netty?
05:09BjeringAWizzard, the C++ I stop at 50k clients. It has a hard peak at 64k when I run out of ephemeral ports for my stressbots.
05:10BjeringAWizzard, yes, I suspect he has either alot less traffic per connection and/or he also run onther OS and get a proper NIO.Selector.
05:11AWizzArdSo, why don't you then stay with the C++ solution? It seems to be working already and performs way better.
05:12BjeringAWizzArd, this is just a benchmark/test. The real app I will build will have a complext game world, and I think clojure would be an excellent match for modelling it and querying it, I expect to be MUCH more productive if I could pick clojure.
05:12AWizzArdI mean, I find it very interesting to see such comparisons, especially if it is not this minimal nonsense of the language shootout, but instead something realistic.
05:12BjeringIts a 18 month project eventually
05:13BjeringSpending ~1 week picking core techonogy seems reasonable
05:13AWizzArdah ok
05:13AWizzArdAnd will your chat server take http requests?
05:13Bjeringno
05:13AWizzArdAh okay, so Netty offers also something else than this?
05:13BjeringEventually it might be binary sockets using google protobufs, but this chat server user 0-terminated strings. As preferred by Flash XMLSocket.
05:14Bjeringyes
05:14BjeringTPC-IP sockets
05:14neotykAWizzArd: netty is convenience wrapper over nio, http is just one of protocols you can support there
05:15AWizzArdoh, good to know
05:15AWizzArdI thought it is mostly a http server.
05:15kumarshantanuBjering: Is this scaling required for user-facing HTTP stuff? or some back end thing? *curious*
05:15Bjeringkumarshantuanu: Client facing, NON-http stuff.
05:17neotykAWizzArd: well http is hell popular, right ;-)
05:17Bjeringhttp or not is not the issue. Its the selector that takes all the time, and I have a stackoverflow answer that states java.nio on JDK6 use select on windows.... if that is correct and not avoidable that alone explains why performance becomes bad. Porting will show if that was the case.
05:18neotykBjering: I was able to simulate Reverce C10K on my mac with netty
05:18neotykwith no problems
05:18kumarshantanuBjering: This may be mildly OT -- did you look at ICE? http://www.zeroc.com/index.html
05:18AWizzArdBjering: please, write down all those interesting infos, and write up a nice article about that.
05:18hiredmanI think netty can use xnio now too, so you might look in to using that
05:19neotykAlso in grizzly we used to support aio
05:20Bjeringkumarshantanu: Yes briefly, I think it is too tuned to model a typical MMO-world, my game wont be that typical.
05:20neotykbut aio is hard to get as jdk7 has not been released yet
05:21Bjeringhiredman: Very interesting, defintly worth trying.
05:22Bjeringalright, pause on the port work... testing xnio first.
05:22LauJensenhehe
05:43Bjeringfound out why I cant fint xnio classes in my 3.2 netty jar... I will try to downgrade to 3.1 even though this post kind of states it wont be a point, it might not be considering the windows situation.. http://www.jboss.org/netty/community.html#nabble-td5190537
06:28sunkencityrylehI have a weird problem with pmap when I use pmap in a jar file (built with leiningen uberjar) it freezes after having run pmap (doesn't happen in repl, or with map) do I need to add some extra options for threading or what?
06:34AWizzArdsunkencityryleh: You don't need to do anything extra. This seems to be a more complex problem.
06:36sunkencityrylehAWizzArd: ok. It's pretty weird I thought that pmap would act as a drop-in replacement for map
06:39hiredmanyou need to call shutdown-agents, pmap uses the agent threadpools and the jvm waits for all the threads to exit
06:39sunkencityrylehhiredman: ah thanks!
07:14sunkencityrylehhow can I concat a string to a collection without adding each char as a separate entity :)
07:15sunkencityryleh,(concat '("foo" "bar") "baz")
07:15clojurebot("foo" "bar" \b \a \z)
07:17msfhow can I get clojure to print a full stack trace ?
07:26sunkencityrylehdoh, of course conj works to append to the list :)
07:31neotykmsf: clojure.stacktrace/print-cause-trace
07:41msfthanks
07:42LauJensensunkencityryleh: when you say freezes, do you mean that it hangs after having completed its run, not exiting the program ?
07:43sunkencityrylehLauJensen: yep. wrapping the pmap function in a (do (pmap...) (shutdown-agents)) solved the problem
07:44LauJensengood - Ive been bit by that before as well :)
07:45sunkencityrylehyep it's a problem that comes completely from outer space :) I was completely lost as to what the problem would be
07:47rhudson'future has that issue as well
07:49no_mindany good tutorial on getting started with web development in clojure
07:49no_mindI am trying my luck for past 2 hours to print hello world in browser
07:49LauJensenno_mind: I have a couple of my site
07:50no_mindLauJensen, url ?
07:50LauJensenhttp://bestinclass.dk/index.clj/2009/12/dynamic-interactive-webdevelopment.html
07:50LauJensenhttp://bestinclass.dk/index.clj/2009/12/beating-the-arc-challenge-in-clojure.html
07:50LauJensenhttp://bestinclass.dk/index.clj/2010/02/reddit-clone-in-10-minutes-and-91-lines-of-clojure.html
07:50LauJensenhttp://bestinclass.dk/index.clj/2010/02/reddit-clone-with-user-registration.html
07:50no_mindthnxs
07:50LauJensenPerhaps start with the arc-challenge one, thats the simplest. And then as a bonus, the entire site bestinclass.dk, blogging backend and all is written in Clojure and its open source
07:51no_mindaha
07:59LauJensenno_mind: And finally, if you make a new project with moustache, hello world is (def myapp (app [""] (-> "Hello World" response constantly))) (doto (Thread. #(run-jetty #'myapp {:post 8080})) .start)
07:59LauJensenthe [""] means the url "/", ["hey"] would be "/hey" with or without the trailing slash
08:28BahmanHi all!
08:33pdk(doc constantly)
08:33clojurebot"([x]); Returns a function that takes any number of arguments and returns x."
08:42defnhttp://xahlee.org/emacs/lisp1_vs_lisp2.html <-Curious to know what Clojurians think of this...
08:45defnI think I agree with the basic premise: Too much jargon in clojure, haskell, etc.
08:45defnThe question then becomes how to remedy that
08:54LauJensendefn: Where do you come across this jargon in Clojure?
08:54no_mindLauJensen, trying your tutorials and constantly getting "java.io.FileNotFoundException: Could not locate hello_world__init.class or hello_world.clj on classpath: (NO_SOURCE_FILE:0)" I am running it through lein repl
08:55LauJensenno_mind: I never tried lein repl and I cant offer you support with lein (try technomancy), but the repos I uploaded should work if you type "lein deps && lein swank", then M-x slime from Emacs. Also one or 2 of them are executables, so "lein deps && jein jar && java -jar thatjar.jar" should work
08:56LauJensen(Im thinking of the reddit clone)
08:56no_mindwhy cant we have something simple in clojure for this ?
08:56raek"lein deps && lein repl" should be suffficient
08:57LauJensenno_mind: Isnt it simple though? :)
08:57raekno_mind: did you do a lein deps?
08:57no_mindraek, yes
08:58raekwhich repo?
08:58raekthis one? http://github.com/LauJensen/bestinclass.dk
08:58no_mindraek, it is a fresh project I created with lein new
08:59LauJensenraek: No that one is more tricky to install as it is married to nginx
08:59raekok, and you do a (ns ... (:use hello-world)) or something?
08:59defnLauJensen: I guess now that I consider it there isn't jargon, but I wonder about how Clojure is presented to someone new to FP, Lisp, Java, etc. I get the sense that in Clojure there are these infinite possibilities which people starting out /don't want to know about/ because they make the language seem daunting
08:59LauJensenhttp://github.com/LauJensen/cloneit
09:00LauJensenraek: That one I think - I gave him 4 blogposts to scrape through
09:00defnthe number of choices in Clojure causes paralysis
09:00clojurebot"[Clojure ...] feels like a general-purpose language beamed back from the near future."
09:00defnjust choosing an editor becomes an exercise in learning them all
09:00raekit says that it can't find your hello_world.clj file
09:00raekdid you put it in src/ ?
09:00no_mindyes
09:00no_mindand set the CLASSPATH as well
09:00LauJensendefn: I dont think people ever hear the word 'idiomatic' thrown as much around anywhere else than here, but still its not a void word that only we understand. I cant really think of any jargon
09:00raeklein does the classpath things for you
09:00defnchoices are nice, but they cause paralysis in noobs
09:01raekdo you have an underscore or a hyphen in the file name?
09:01LauJensendefn: paralysis is also nice, ... nice and relaxing
09:01defnfor instance, if im just learning clojure, i dont care to know which functions are lazy
09:01defni dont care to know how to thread forms
09:01raek(ns hello-world) should be in src/hello_world.clj
09:02RaynesMethink's I'd like to know that map is lazy and what the significance of that is before it bites me in the ass.
09:02defni guess my goal is to just arrive at some sort of meaningful subset of clojure's features which could be used without explaining 50 years of computer science
09:03no_mindraek, yes
09:03raekthat should work.
09:03defnid like to teach a class at a local college on clojure but there will be limited time available to me
09:04defnmaybe im just underestimating students, but the depth to so many aspects of clojure (which attracts me) might be a turn off to others who are familiar with more "conventional", "main stream" languages
09:05raeklein new foo && cd foo && echo '(ns hello-world)' > src/hello_world.clj && lein repl
09:06raek(require 'hello-world)
09:06raekthis works for me
09:07defni guess the question im asking is, what is a smooth way to introduce a new paradigm without overwhelming them
09:07defnthem being students
09:07LauJensendefn: We have these wonderful entry points for noobs that are so easy to get started with, like try-clojure.net, the Eclipse and Netbeans IDEs which automatically install Clojure. But what all of these (especially the first) need is a good interactive tutorial
09:07rhudsondefn: Might be worth taking a look at SICP to see what it starts with
09:08LauJensenrhudson: starts with an algorithm for approximating square root
09:08defnLauJensen: amen
09:08rhudsonI was thinking more of what forms & functions it starts with
09:09RaynesI don't get "interactive tutorials".
09:09defnI've actually written several tutorials that I've abandoned because at some point (usually early on), I find myself digging /way/ to deep
09:09defntoo*
09:09RaynesI've never had any desire to run through a JavaScript powered tutorial when learning a new language, but that's just me.
09:10defnexplaining things which have elements which require explanation, which have elements which also require lengthy explanations and references to wikipedia articles and dusty, stuffy sounding book titles
09:10dnolenSICP starts at the right place and keeps going, there's very little math in it (at least in the way that most people have been brain-washed by)
09:10defnlike "The Structure and Interpretation of Computer Programming"
09:10defnfor so many novices that is a huge turn off
09:10defnIt sounds very ivory tower
09:10dnolendefn: huh, the only I hear complain about SICP are people who already know how to program.
09:11RaynesNot that I wouldn't welcome an interactive tutorial in try-clojure if somebody wanted to waste their time on it, as long as it isn't me. ;)
09:11defnid really like to build a ruby-koans, but for clojure
09:12defnhttp://github.com/edgecase/ruby_koans
09:12LauJensendefn: But I think before we undertake this mission of bringing in the hordes, we should ponder one of lifes most profound mysteries: Why is PHP so popular?
09:12defnLauJensen: haha :D
09:12AWizzArdBecause it started lightweight.
09:13RaynesLauJensen: Maybe Rich should proclaim his hatred for programming languages and say he doesn't know how to design a language.
09:13AWizzArdSame with HTML+JS vs. Java Applets.
09:13LauJensenI mean, this insanely inconsistantly designed language, which is so verbose and ugly and tedious to work with and debug, why is it the 5.th most deployed language in the world?
09:13AWizzArdMySQL.
09:13Rayness/programming languages/programming/
09:13sexpbotLauJensen: Maybe Rich should proclaim his hatred for programming and say he doesn't know how to design a language.
09:13AWizzArdAll those solutions that started out totally crappy but lightweight won. Twitter. Google.
09:13defnAWizzArd: agree on all of your points there.
09:13defnCSS could be in that camp as well
09:13AWizzArdWin a big userbase and then improve.
09:13LauJensenRaynes: Ive made many blogposts where Rich had the opportunity to post hatefilled flamebaiting comments, but he never grapped it :(
09:13bobo_php is popular because you dont need to know any programing at all to use it. in fact. its easier to use if you dont
09:14LauJensenhaha, true
09:14defnAWizzArd: in a way you're sort of discussing what I was trying to puzzle out earlier
09:14defna subset of clojure which does almost nothing
09:15defnso it is almost too easy for people new to the language to get their heads around
09:15LauJensendefn: I think maybe we should just accept that Clojure is primarily for serious people and Raynes. Its not possible to bring the hordes to a functional lisp and not have it run away
09:15LauJensen:)
09:16defnLauJensen: On the one hand I want to keep my relationship with Clojure discrete, personal.
09:16defnOn the other I would to write it on a stone tablet and distribute it to the masses.
09:16defn:)
09:16LauJensendefn: tell me which hand to chop off, right or left?!
09:16LauJensenI want to see Clojure grow as well. But for wide adoption in the industry, takes a lot longer than wide adoption in teenage communities
09:16defnhmmm, left, so you can keep easy access to your parens
09:17LauJensendefn: I meant I wanted to cut off your hand with the stone tablet :)
09:18defnIt's like enjoying a band but knowing that if you put up too many flyers, the lead singer is going to eventually do a deodorant commercial.
09:19defnIn this case the lead singer would be Stuart Halloway.
09:19pdkisnt that sort of why trent reznor killed himself
09:19defn(I kid S.H.)
09:19pdkHMMMMM
09:19LauJensendefn: You know Rich has a music carrer on his resume right?
09:19defnLauJensen: I do.
09:19LauJensenThankfully he failed
09:19defnWhich I have found fascinating and inspiring.
09:20defnI studied music, and I often feel like a fish out of water in the CS circuit.
09:20RaynesI can't write songs to save my life.
09:20LauJensendefn: Well, now you can team up with Rich and have Raynes do back up on his Banjo
09:21defnha!
09:21pdkwait
09:21pdkwrong guy
09:21defnpdk: yeah I didn't think Reznor killed himself?
09:21pdkkurt cobain i mean
09:21defnpdk: maybe you meant Kurt C.?
09:21defnYeah
09:22defnI don't know -- the whole thing about having real anxiety over whether or not you're popular, while I think it's normal and human, is totally irrational and ridiculous
09:22defnYou just use what you love and make things you enjoy. Why overthink it?
09:22RaynesI didn't know Kurt Cobain had a real reason for killing himself other than typical suicidal depression, but I digress.
09:22pdki thought his case was more that he was worried about ending up a sellout
09:22defnI think heroin played a role. Is this #clojure?
09:22Raynesdefn: Aye, good point.
09:23pdkpsychoactive substances do help in understanding macros
09:23pdk:p
09:23RaynesAs does a good night sleep.
09:23LauJensenWe have #clojure-casual I think, ready to receive theories on why KC killed himself
09:23defnThinking about it before you sleep is best.
09:23defn(IMO)
09:24pdkcmon now
09:24Raynesdefn: Thinking about it while you drift off to sleep will result in answers and insight in the morning.
09:24pdkdon't tell me you've never heard it brought up during the review process of an rfc
09:24RaynesMy very own midnight oracle.
09:24defnRaynes: yeah...
09:25RaynesOh, nice. chouser finally got ops or foundership transfered?
09:25defnpdk: I haven't had the "pleasure" of being involved in any of those.
09:25pdkdoogie chouser
09:25pdkthe hit new retro inspired classic tv show
09:25defnWhat's his catch phrase?
09:26defnIt's a sitcom, so you need one.
09:26pdkummm
09:26pdkgood point
09:28RaynesAw man. My last Irclj commit had a borked issue-closing commit message.
09:28RaynesI did "Closes 2#" instead of "Closes #2"
09:30LauJensenRaynes: Ive always wondered, is it true that this is how you get your mail? http://i.imgur.com/V698o.gif
09:31RaynesLauJensen: Absolutely.
09:39RaynesI just closed Irclj's last issue. I feel so warm and fuzzy inside.
09:39LauJensenCongratz :)
10:19emhis there a way to write Clojure strings without having backslashes escaped, or have a macro do it? I have a lot of latex strings in my Clojure code
10:19emhs/escaped/interpreted/
10:19sexpbotis there a way to write Clojure strings without having backslashes interpreted, or have a macro do it? I have a lot of latex strings in my Clojure code
10:20pdkwhen you enter them it's going to process the string to evaluate the escape chars before it gets passed off to any function/macro anyway
10:20pdkso youll probably have to bite the bullet here
10:20pdkand output two \\s where you want one
10:20pdktwo \s rather
10:21emhok
10:21@chouseremh: there's no way to get a literal double-quote in clojure code without a backslash. A shame, but that's where we are.
10:22@chouseryou might consider putting such strings in some other file and processing it, rather than trying to embed very many such strings in your code.
10:22emhyeah, I've been doing that for bigger chunks
10:26emhI also defined a bunch of functions like (section "Section") and (par "Some text...") that output the latex functions for the most commonly used functions
10:26@chouserthat's a good idea. could write a macro to generate such functions for you.
10:27emhyep
10:30arkha java method declared as 'void' returns nil when run from clojure, is that true?
10:32@chouserarkh: yes
10:32arkhchouser: thanks
10:38defnchouser: Can I make a casual suggestion for your next project. (After JoC)
10:38@chouserdefn: ha! sure.
10:38defns/\./\?
10:39defnclojure-koans : http://github.com/edgecase/ruby_koans
10:40MayDanielhttp://github.com/relevance/functional-koans/tree/clojure
10:40defnnoooo!!!
10:41defnI think I'll keep writing my own anyway... I think there is a lot of room for narrative in the koans.
10:42defnand I think I'd still suggest a masterful version of clojure-koans to chouser. :) Reason being, I look at JoC and I see these narratives, these stories.
10:43defnIt seems like something he and fogus would be able to master in a way that sticking to the script doesn't achieve.
10:43defnLike "nil pun with care"
10:44fogusdefn: I want to check that out at some point. At the moment I'm working on something else that I think people will enjoy
10:44defnfogus: If you think people will enjoy it, then not working on it (at this particular moment) is the only thing you're doing wrong.
10:44defn:)
10:45fogusI think people will enjoy this other thing better. ;-)
10:45no_mindwhich IDE has support for clojure except for Emacs ?
10:45defnno_mind: many
10:45defnno_mind: netbeans, eclipse, vim
10:45pdkisn't there an intellij plugin
10:46defnyeah there's one of those
10:46defnthere are some standalone IDEs
10:46pdkexpect a lot of emacs chauvinism from folks either way though
10:46no_mindeclipse and netbeans are too heavy and vim has no GUI
10:46mrBlissno_mind: http://www.assembla.com/wiki/show/clojure/Getting_Started
10:46pdkwhere are these standalone clojure ides
10:46bozhidarthe intellij plugin is pretty buggy I think
10:46defnno_mind: what do you use right now?
10:46no_mindgeany
10:46mrBliss<mrBliss> no_mind: http://www.assembla.com/wiki/show/clojure/Getting_Started
10:46mrBliss<pdk> where are these standalone clojure ides
10:46mrBliss<bozhidar> the intellij plugin is pretty buggy I think
10:46mrBliss<defn> no_mind: what do you use right now?
10:46defnso you run linux I take it?
10:46mrBliss<no_mind> geany
10:47mrBliss
10:47pdkan exchange so nice we posted it twice
10:47no_mindyes I run linux
10:47defnno_mind: ever use textmate?
10:47no_mindtextmate ? isnt it osx only
10:48defnyeah, but danlucraft has been working for i think 2 years now on "redcar"
10:48defnwhich is sort of an open source, cross-platform textmate
10:48Raynesno_mind: Vim does have a GUI.
10:48defnwhich can use textmate bundles
10:48RaynesThere is gvim.
10:48@chouserdefn: you'd want me to write koans?
10:48defnchouser: heh now I feel like I've disrespected you somehow
10:48slyrus,(aset (byte-array 32) 0 12)
10:48clojurebotjava.lang.IllegalArgumentException: No matching method found: aset
10:48@chouserwell no, I just don't know what koans are about
10:49no_mindlast time I used redcar, it kept on crashing. Let me try again
10:49@chouserI mean, I'd write puzzles for people to solve?
10:49defnI just read Joy of Clojure and I think there is way you have with the /narrative/, your examples, the way you and fogus and chosen them is so purposeful, and you have had this experience
10:49slyrushow do I set values in a byte-array?
10:49qbgTo test a ns foo.core, leiningen 1.3 creates a ns foo.test.core. Is this the current idiomatic test ns name?
10:49danlucraftno_mind: crashing? that's not good.
10:49defnchouser: sort of -- the puzzles are not hard so much as they demonstrate little bits of edge cases
10:49slyrusdo aset-byte?
10:49qbgcontribs has tests in the form of foo.test-core
10:49slyruss/do/d'oh/
10:49sexpbotd'oh aset-byte?
10:50no_mindyup crashing. You are typing code in full swing and boom! The editor window disappeared :(
10:51danlucraftno_mind: I honestly have not had that happen to me for a loong time. When was this?
10:51no_mindabout 4 months ago
10:51fogusdefn: They look similar to the LIttle Lisper/Schemer/MLer series no?
10:51no_mindI am using Sun JDK
10:51danlucraftno_mind: hmm. well, try it again. it's more stable now for sure. Clojure editing is shit though
10:51danlucraftno_mind: the auto-indenter goes mad :)
10:51defndanlucraft: i just set up the newest version of redcar after being out of the game for 8-9 months. great project.
10:52danlucraftdefn: thanks :)
10:52defndanlucraft: what's with rubyzip, is it?
10:52defni suppose i could google it but I saw it while I was installing and was curious
10:52no_mindhmm
10:53danlucraftdefn: on windows it downloads and unzips gecko for the htmltab
10:53defnah-ha
10:53no_mindwhy cant we have a geany plugin for clojure. That IDE is pretty stable and I can generate exactly same screenshots as redcar, with geany :)
10:54slyrusi don't suppose there's any support for unsigned bytes tucked away somewhere?
10:54defnrude no_mind, but well, i dont know anyone who uses geany
10:54danlucraftno_mind: screenshot level compatibility is very powerful thing
10:54defnno offense
10:55RaynesI know a couple of people who use Geany, but really not many.
10:55defnno_mind: what's the reason for not using a more full-featured editor like vim or emacs?
10:55no_mindI was joking. But screenshot level compatibility is a major game changer in several cases. :)
10:55no_mindI used to use Vim
10:55danlucraftah, ok Gtk2
10:55no_mindused it for 11 years
10:55no_mindthen got fed up and wanted to try something new
10:55no_mindtried every kid on the block
10:55defnwith what no_mind?
10:55no_mindand settled for geany
10:56defnyou said you were "fed up", but I'm curious with what
10:56defnit edits text -- it has a big user base, lots of plugins
10:56no_mindwith Vim and more than vim the boring command line
10:56danlucraftno_mind: interesting choice. what are the main draws of Geany in your view?
10:56defnno_mind: ever heard of gvim?
10:56RaynesAnd Cream.
10:57RaynesI've heard lots of good things about cream.
10:57defnCream, gedit, geany
10:57defnI've used them -- but the base of users on those editors is small enough that you wait for a feature like a clojure plugin for 4 years.
10:57no_minddanlucraft, small install file size, easy on RAM plus gives you symobol and function list for every doc you open in left hand doc. So jumping functions is easy. Apart from all other features of standard IDE
10:57defnwhich is why no_mind is posing this question in the first place
10:57Raynesdefn: Cream *is* Vim.
10:57RaynesIt's just an easier to use Vim.
10:58danlucraftdefn: I'd love to work on clojure support next, but there's just so much to do :)
10:58no_minddefn, I wanted to try something which is not vim or emacs
10:58defnright, like that whatchamacallit "easier" emacs
10:58defnit just breaks compatability
10:58defnbah humbug
10:58danlucraftdefn: david byrne integrated the enclojure repl a few weeks ago
10:58defn /the/ david byrne?
10:58danlucraftbut haven't heard much from him since...
10:59Raynesdefn: Really? I was pretty certain that Cream was fine with typical Vim plugins.
10:59danlucraftdefn: no
10:59defndanlucraft: heh
10:59defnRaynes: you used the word typical
10:59defnwhat if I want atypical
10:59Raynesdefn: I'm pretty sure you can use ANY Vim plugin with Cream, but I'm not familiar enough with it to say.
11:00defnRaynes: nor am I tbqh -- I remember using it about 4-5 years ago
11:00defnI just don't see why, if it's functionally equivalent, you wouldn't just graduate to vim at some point
11:01defnyou use the menus for awhile and learn how to do it all with a :, and then you move on
11:01RaynesMaybe that's what they're aiming for.
11:01defnI used the emacs menus for a little while, but then I turned the ugly toolbar off -- it's just a distraction
11:01defnIt reminds me of filters in photoshop
11:02defnYou want to make a button, so you make a button, and then you spend 30 minutes applying filters and undoing
11:02defnif I need a gaussian blur I'll M-x gaussian-blur
11:02defnOtherwise I don't need it in my face
11:03danlucraftno_mind: interesting, thanks. one of the few editors I have never tried
11:45slyrusdo boolean arrays use 1 bit per element?
11:47@chouserhm, I'm having trouble finding a definitive statement, but I doubt it.
11:47@chouser"Arrays of type boolean are accessed and modified using the byte array instructions baload and bastore"
11:48@chouserif you want your bits packed, you'll probably have to pack and unpack them yourself.
11:50slyruspack and unpack them out of what? unsigned numeric types?
11:50slyrusfun...
11:50slyruss/unsigned/signed/
11:51slyrusI was all set to pack them out of bytes until I realized that bytes are signed and they probably take up more than one machine-byte per byte (4?)
11:51pdkremember
11:52pdkhigh storage overhead is the wave of the future
11:52no_mindis there a pastebin for clojure ? or should I use generic pastebin
11:52slyruscheap whole genome sequencing is the wave of the future
11:52Raynesno_mind: gist.github.com, hpaste.org, paste.factorcode.org, paste.pocoo.org, and several others have Clojure-specific highlighting.
11:53Raynesgist.github.com is my personal favorite.
11:53LauJensengist.el is my personal favorite
11:54RaynesThat isn't a website.
11:54Raynes;)
11:54no_mindok
11:54arkhis CamelCase used for defrecord?
11:54arkher .. that wasn't camelCase
11:54arkhanyway, mixed case?
11:55cemerickGenerally, yes.
11:55arkhcemerick: is that because it's making a Java class?
11:55cemerickYes.
11:55arkhcemerick: cool - thank you
11:58arkhsorry, I've always wondered this, too. For a Java class, would you say "UDPServer" or "UdpServer" ? Wondering if the acronym would stay caps.
12:00pdkitd stay caps
12:01arkhpdk: thanks
12:01pdklook at the convention in java standard library, sun has an online javadoc for it
12:01cemerickyeah, keep acronyms capitalized in general
12:02arkhpdk: oh duh ... like 'HttpURLConnection" - but then that alternates. I suppose HTTPURLConnection looks silly : /
12:09slyrusok, how about chars? are they really 2-bytes? if so, that will probably work.
12:15bobo_cant i open multple files at once in emacs? *.clj actually opend a file named *.clj
12:15fsmunozcheers
12:16BjeringAlright, what I learn today is that computers have become faster the last 8 years :)
12:18fsmunozSmall problem here, just wanted to check if it's something known/trivial or not: I've installed lein (self-install, etc, etc) and while it creates a new project it refuses to do anything else (namely, test/repl/swank, probably more) with an error like: Exception in thread "main" java.lang.NoClassDefFoundError: _j2se_j9=1119744. Any pointers?
12:20mrBlissbobo_: you could try dired
12:22BjeringFor those following my chat-benchmarking-adventures (I really should get a twitter account atleast...) I have now compiled C++ versions to my ancient Linux machine. It can handle 3000 clients at 26% CPU load. The java/netty version handles 3000 clients at 32% CPU load. That is more the kind of difference I expected. Seems I have a strong case that Java6 NIO impl on windows is what is holding back my results. Tomorrow I'll learn/install Linux...
12:22bobo_Bjering: daily blog updates atleast!
12:24bobo_mrSpec: that doesnt realy open the files? it lets me pick the files and open them?
12:24durka42is there a good way to build regexes from common components, or have string interpolation in regexes? it's hard to concatenate #"" patterns with str because you can't have unmatched parens inside #"", so (str #"ab(" *thing* ")") doesn't work
12:26cemerickBjering: it's almost accepted wisdom at this point that NIO is slower in general than "classic" IO
12:29Bjeringcemerick, well there is little wisdom involved in benchmarking. Should be easy enough to proof either way. In C++ asynch is THE way as the other option is native threads and that is bad. On the jvm any benchmark on Windows seems wrong to me, as I learned today how my C++ server and jvm server are comparable on Linux, but on windows my C++ server (IOCP) is x100 faster.
12:30BjeringI'll make a "classic" IO approach with the jvm-version once I have a powerful wellconfigured Linux ev environment set up and we will see if I agree :)
12:32slyrushere's my first cut at 2-bit "arrays" if anyone's interested: http://gist.github.com/547843
12:33cemerickBjering: there's been lots of benchmarks. *shrug* First result for googling "slow nio benchmarks": http://www.thebuzzmedia.com/java-io-faster-than-nio-old-is-new-again/
12:33cemerick"NIO is x% slower" has been a conclusion coming from various independent benchmarking efforts for a few years IIRC.
12:33dnolen_Bjering: so the Clojure version on a Linux box is comparable to your C++ version?
12:34Bjeringdnolen_: Didi it with the java version (which was eqvivalent to my clojure version on my Windows), but yes.
12:35Bjeringcemerick: Throughput isnt my problem, no of connections and no of sends / reeives is.
12:38no_mindneed suggestion on this http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29422#a29422
12:39dnolen_Bjering: so are you going to go ahead and build yr app in Clojure? ;)
12:41Bjeringdnolen, most likely. I will have to learn to use Linux though :) Any tips? I know basic stuff, like chmod, ls, passwd etc. But I want an in depth overview of things like how the filesystem should be organized /usr vs /etc vs /var etc. What is THE book/online resource to learn whese things?
12:42Bjeringie, I have been a user (on Solaris, 15 years ago), never an admin...
12:43dnolen_Bjering: heh I'm a Linux newb myself. That said I find Ubuntu to be the friendliest easiest to work with. Also there's a lot of info online on SuperUser etc.
12:44bobo_yeh, ubuntu is realy easy to use
12:59jkkramerdurka42: re-pattern creates a regex from a string
12:59jkkramer,(let [c "c"] (re-pattern "ab(c)"))
12:59clojurebot#"ab(c)"
13:00jkkramerer...
13:00jkkramer,(let [c "c"] (re-pattern (str "ab(" c ")")))
13:00clojurebot#"ab(c)"
13:00durka42yes, but you lose the raw-string benefits of #""
13:00durka42,#"(\(\))"
13:00clojurebot#"(\(\))"
13:00durka42,(re-pattern (str "(\(" "\))"))
13:00clojurebotUnsupported escape character: \(
13:00akhudekhey, is there a native clojure construct similar to a maybe monad?
13:00durka42,(re-pattern (str "(\\(" "\\))"))
13:00akhudeka let-maybe perhaps?
13:00clojurebot#"(\(\))"
13:01durka42akhudek: there's if-let, i don't really know what you want let-maybe to do
13:01LauJensenakhudek: does clojure.contrib.monad count?
13:02akhudekI thinks if-let only takes a single binding pair, not a list.
13:03akhudekLauJensen: I don't really want to go that far, but I notice that I often end up using a lot of nested if-let's.
13:03LauJensenakhudek: Sounds like you're on an imperative path
13:04akhudekThat could be. I'll stare at the code some more.
13:04arohnerakhudek: have you seen the arrows?
13:04arohner->, ->>
13:04sexpbotjava.lang.Exception: Can't take value of a macro: #'clojure.core/->>
13:04jkkrameryou can destructure in the if-let binding, if that helps any
13:04jkkramerthat can be confusing to read, though
13:06akhudekhere is the code in question: http://pastebin.com/9zkVV7ij
13:06akhudekperhaps I'm just thinking too imperatively
13:07mrBlissakhudek: I've had the same problem, mostly for user input
13:08@chousercond might be useful there
13:15@chouserakhudek: not sure this is any better. http://pastebin.com/3eQ1v2SZ
13:17akhudeka little cleaner then my refactor http://pastebin.com/R9AZT5uQ
13:18@chouserif you want to postpone the let and destructuring until it's needed, I think you're essentially forced into the nested-if style
13:18@chouserwhich isn't necessarily bad.
13:19akhudekyeah. I suppose it's a better performing solution. Thanks for the input.
13:48@chouserrhickey: are you around?
13:48rhickeychouser: yep
13:48rhickeyfor a few minutes
13:48@chouserok, a couple quick things.
13:49@chouserone, just wanted to let you know we can update the IRC channel topic now if needed.
13:50rhickeyok
13:50@chousertwo, do you have any interest in a proposal for new syntax for character and/or string literals in the near term, to address some things I've mentioned before? http://paste.lisp.org/display/91391
13:52rhickeychouser: many of those seem non-problems to me, is there some sort of priority to them?
13:52@chouserno, the only reason for bringing it up now is release timing.
13:53@chouserand that I've fielded two questions in the last week or so about double-quotes in strings.
13:53rhickeychouser: well, splitting that list up is the first step in getting any of it on the table
13:53@chouserif you've no appetite for it, I won't bother writing up a real proposal.
13:54@chouseryeah, I think it'd be two things -- an addition string syntax to allow double quotes without individual escaping, and a new syntax for literal Characters (deprecating the old one)
13:55@chouserI'm sure for anyone that doesn't work heavily with strings these things are unlikely to seem important.
13:56rhickeythe latter in particular seems not pressing
13:57LauJensen.. strings are pretty common nowadays :) I think the double quoting sounds nice, I have no problem with the character literals
13:57rhickeyI'm running at 2, anything else?
13:57@chousernope, I'm good. thanks for your time.
13:57rhickeysure, so proposal for quotes welcome
13:58jkkramerrhickey: any chance you'll be processing new CAs soon?
13:58rhickeyjkkramer: just did some - how recent?
13:59jkkrameri put mine in the mail last monday, the 16th
13:59jkkrameri'm in NY so shouldn't have taken long to ship
14:00rhickeyjkkramer: yes, but after I last checked - I'll grab it soon
14:00rhickeygotta run
14:00jkkramerrhickey: ok thanks
14:00arkhchouser: +1, newline consistency would be good
14:02arkhchouser: +1 on triple quotes (does my opinion matter? heck, who cares! throwing it out there ;)
14:03serp_what are triple quotes?
14:03@chouser"""something like this"""
14:03arkhnothing is escaped in triple quotes, right?
14:04@chouserarkh: that's independant
14:04@chouserso -- opinions welcome. I'll try to come up with something consistent and compelling to propose.
14:05@chouserperl has q or qq followed by a pair of "grouping" things like () {} or <>
14:06@chouserruby has %q followed by a similar pair
14:07@chouserpython has triple quotes """ or '''
14:07technomancychouser: I'm particularly interested in use/require => uses; lots of complaints over that wart.
14:08@chouserprecede the python one with r to turn off \n stuff, or use q instead of qq in perl to do the same thing.
14:08@chousertechnomancy: yes, me too. But others have pushed on that one, so I won't get in their way.
14:08@chousertechnomancy: though in my mind the current behavior of defrecord expands the scope of the use/require improvements required
14:08technomancyhere's my list: http://p.hagelb.org/1.3-hopes-and-dreams.html
14:09@chousertechnomancy: excellent. I'm uncertain about :like and don't know what "dots" means
14:10technomancydots are just like ruby's test/unit's output for every passing test
14:11arkhnot totally related but I've enjoyed python's multiline regex's, too
14:11arkhmade possible by triple quotes
14:12LauJensentechnomancy: could you explain in danish what a non-transitive-aot is ?
14:12MrHusI for one love python's string's http://docs.python.org/release/1.5.1p1/tut/strings.html
14:12technomancyLauJensen: cemerick implemented it and made a ticket: http://www.assembla.com/spaces/clojure/tickets/322
14:12LauJensenThanks
14:13LauJensenah yes
14:16@chouserclojure's string and regex literals already support multiline
14:17@chouserand with (?x) you can include extra whitespace, comments, etc. in your clojure regex.
14:17arkhcool - I wasn't sure if clojure supported multiline regex but that's good to know :)
14:17technomancychouser: agreed that :like needs more discussion and usage, but it's really hard to experiment with it outside clojure.core due to the hardcoded nature of ns
14:19@chousercan't you just branch clojure itself, or even just have a lib that does (in-ns 'clojure.core) and mucks about as necessary?
14:19LauJensenI also dont see why we cant have (import '(some.javalib.*)) - There has been talk of future advantages by not having this for about 3 years, but Ive yet to come across one
14:19cemerickchouser: what did you have in mind for char literals?
14:19@chouserI guess there's still friction there. maybe enough to reduce experimentation.
14:20@chousercemerick: something that would use matching shortcuts for chars and strings (unlike \newline and "\n" today)
14:21cemerickLauJensen: There are probably unsolvable semantic issues with wildcard imports given the array of classloader configurations that are possible.
14:21@chousercemerick: and therefore remove the need to remember the special table of character names: \newline, \space, \tab, \beep, \backspace
14:21@chouseroops, \beep isn't there
14:21cemerickThat, and wildcard imports are just as bad as use, w.r.t. knowing what the hell is in your namespace. :-)
14:22LauJensencemerick: As I understood rich it wasnt because of limitations, but because he could add some compiler optimizations if he withheld - I just dont think he's gotten around to it
14:22@chouseryou have to do \07 instead of \beep
14:23cemerickchouser: not sure there's a lot of room for that, if you're keeping \n, etc. in strings...which I'd think is a must-have.
14:23@chouseroops, that doesn't work. you have to do "\007" or something.
14:23@chousercemerick: yeah, I know.
14:24@chousermaybe #:\n instead of \newline
14:24@chouserugly but simple
14:24cemerickaaaaaagggh! ;-)
14:24cemerickwhat does \newline emit on windows?
14:24@chouserit better be the same as "\n"
14:25@chouserwhich had better be the same as "\012"
14:25@chouserand therefore not the same as (newline)
14:25cemerickmisery
14:27@chouserit's C's fault. the ASCII names are "carriage return" and "line feed" aren't they? \r makes sense then, but where did \n come from?
14:31mebaran151anybody know of a good binary serialization format for Clojure: I'm thinking of porting MessagePack for some binary RPC goodness, but I'm wondering if there's a better solution out there.
14:32cemerickmebaran151: yeah, the one I wrote some months back and still haven't put on github :-/
14:32@chouserWe've used google protobufs with reasonable success.
14:33mebaran151you guys think porting the messagepack rpc system might be useful? The binary format looks like a decent fit for clojure. I feel like I could do something better with the defrecord and defprotocol magic though, whereby you'd get your records back.
14:33noidichouser, do you have a wrapper that converts the Java objects to Clojure data structures, or deal with the objects directly?
14:34@chouserwe've progressed from the latter to the former and beyond.
14:34@chouserstill no permission to opensource it though. :-/
14:34mebaran151the MessagePack people brag their binary format is quicker than protobufs, but I'm looking for a nice preworking solution
14:34noidibeyond sounds intriguing :)
14:34mebaran151I'm also intrigued by the beyond
14:37@chouserwhat we've got now doesn't require generating any java code for your .proto files -- it works with streamed protobuf descriptors directly (to allow dynamic use of new message types)
14:38mebaran151that's what turned me off to protobufs in the beginning
14:38@chouserwe don't yet parse .proto files ourselves because we don't need to, but it might be fun to add for the heck of it.
14:38mebaran151I couldn't figure out a good way to integrate it with our build structures
14:40@chouserread messages are exposed as IPersistentMaps that do the reading/parsing lazily, so if you never ask for a field that's encoded at the end of the buf, that part of the buf won't be parsed.
14:40@chouseryou write messages with just a message type and a regular clojure map
14:41@chouserif it's a literal clojure map, much of the work is done at compile time.
14:41@chouserbut I should stop talking now because it's not useful unless I release, and I'm not allowed to release.
14:41@chouserand my mother taught me bragging is rude. sorry.
14:43noidi:)
14:48mrBlissI notified some guy on github that he had uploaded his private ssh key. Now he has deleted it but you can still see his key when you look at his commits :D
14:48arj_I'm playing around with the new agent functions in 1.2. But I can't seem to get set-error-handler! to work
14:48arj_I've set the error-mode to :continue
14:49arj_and when I send a func like #(1/0) off to an agent I get the exception in the main thread it seems
14:50@chouserthat's because 1/0 will generate an exception at *read* time.
14:50@chouser,(read-string "1/0")
14:50clojurebotjava.lang.RuntimeException: java.lang.ArithmeticException: Divide by zero
14:50akhudekhmm, is there any way to get clojure.core/print-method to work with user defined hierarchies?
14:50arj_ah
14:50@chouserperhaps try #(/ 1 0)
14:50arj_aha
14:51@chouserakhudek: I think that would break everything as user defined hierarchies don't include java classes.
14:51arj_yeah that has the same effect as throw "something"
14:51cemerickchouser: OMG, clojure does static code analysis! ;-)
14:51@chousercemerick: at *read* time!!!
14:51cemerickmind the ;-)
14:51arj_I'm printing in my error handler, but I can't see the output anywhere
14:51arj_maybe it's something with slime
14:52@chouserakhudek: but you can add your own things to the default hierarchy if you want.
14:52AWizzArdfogus: the Clojure compiler statically checks that everything is an Object or primitive or Array? ;-)
14:52akhudekchouser: how would I go about doing that? and is it worth bothering with?
14:53akhudekcurrently I have a bunch of records for first order logic concepts and have overloaded .toString for each
14:53akhudekI'm defining a custom print-method for each record individually
14:53@chouserakhudek: hm... with records, you should be able to have them extend some protocol of your own, and write a print-method for that protocol.
14:54@chouserakhudek: I haven't tried that myself yet. Last time I mucked with such things we were using :type metadata on regular maps instead of records.
14:54akhudekhm, ok let me see if that will work
14:58@chouserhm, not working here. It's still picking up the default print method for records
14:59@chouseroh, because those are installed individually when you do defrecord. meh
15:01@chouserand even without that, it's using the PersistentMap print-method. hmph.
15:04duncanmis there a reason why copy in clojure.java.io doesn't use buffered streams?
15:04hiredmanchouser: wfm
15:06akhudekyeah, doesn't seem to be a way to do it cleanly
15:06akhudekI have Object toString overloaded in the defrecord and that works fine for str
15:06akhudekoh well, no big deal
15:06hiredmanhttp://github.com/hiredman/Arkham/blob/master/src/arkham/core.clj#L13
15:07akhudekhiredman: that's what I'm doing at the moment
15:09akhudekbut I have about 10 records in a hierarchy and though there might be a way to avoid 10 defmethods
15:10hiredmanto get what chouser is saying to work I think you would have to remove the specific records print-method
15:10chillitomanyone seen kotarak?
15:14@chouserhiredman: when I do that, I still only get IPersistentMap's print-method, not the one I installed for the protocol.
15:14@chouseroh!
15:14@chousernope, still fail.
15:15@chouserand if I use deftype instead of defrecord, I the the print-method of Object
15:15@chouserI get the
15:16@chouserlike the multimethod is totally ignoring the interface inheritance
15:16hiredmancould be an artifact of the name munging going on behind the scenes
15:16@chouserI don't think that happens anymore
15:17hiredmanit must, at least for defrecords
15:17hiredmanor, I guess classloader shuffling
15:17@chouseroh, no, I screwed up my test for deftype
15:17@chouseryeah, it does classloader stuff now
15:22@chouserok, I was doing a couple things wrong.
15:22@chouserakhudek: this works, but may not be worth doing: http://gist.github.com/548144
15:22@chouserfor records you need both remove-method and prefer-method
15:23@chouserfor defmethod, make sure you use the interface name (eg. user.Pair) not the protocol name (eg. user/Pair or just Pair)
15:24fogus@chouser: This is why I went the path of toString for my presentation.
15:24@chousersmart
15:24akhudekoof, yeah, that is actually less concise than simply overloading print-method for each record
15:25akhudekI'm using a macro to remove duplication as well
15:25@chouseryou can't extend .toString through right? Have to implement inline in the defrecord?
15:26fogus@chouser: I believe that is correct
15:27fogusException: Object is not a protocol
15:27@chouserwe're still going to want a better mix-in mechanism for deftype/defrecord. The dynamism of extend is beautiful, but when you can't use it the consequences are either repeated code or giant ugly macros.
15:28@chouserfor fingertree I've so far gone with the giany ugly macro approach.
15:28@chousergiant
15:30chillitomkotarak, just trying to get vimclojure going, the pathogen way
15:30chillitomhow can i tell if it's worked, i get no syntax highlighting or anything
15:32kotarakchillitom: you call to pathogen#runtime_append_all_bundles() must come before the "filetype plugin indent on".
15:34chillitomkotarak, the pathogen call is the first thing in my .vimrc
15:34kotarakchillitom: ok. at least "set nocompatible" should come before the pathogen call. Where did you place the vc files?
15:36chillitomokay i've added set nocompatible. vimclojure is in ~/.vim/bundles/vimclojure (hg checkout)
15:37chillitomsorry bundle
15:37chillitomnot bundles
15:37kotarakchillitom: this won't work
15:38kotarakchillitom: checkout the repo somewhere else and make a link "ln -s $HOME/check/out/path/vim $HOME/.vim/bundle/vimclojure-2.2.0-SNAPSHOT
15:38chillitomokay
15:40chillitomdone
15:41kotarakchillitom: does it work?
15:41chillitomno highlighting yet
15:41kotarakhrmpf
15:41chillitomis that the best way to tell
15:41chillitom?
15:42kotarakchillitom: you can try "set ft?" (w/o ")
15:42kotarak:set ft?, that is <- note :
15:42chillitomfiletype=
15:43kotarakchillitom: then the detection does not work
15:44chillitomi did just get an error about clj_highlight_builtins being deprecated at startup
15:44chillitombut :set ft? is still blank
15:44kotarakThat's a good sign!
15:45kotarakchillitom: do you actually edit a clojure file?
15:45chillitomyeah i open a labrepl .clj file.. no highlighting
15:45chillitomon ft set
15:45chillitomno ft set
15:45kotarakTry manual: :set ft=clojure
15:46chillitomcolours!!
15:46kotarakchillitom: what is the exact name of the file?
15:47lenwhi all - i am learning and stuck - http://gist.github.com/548174 - often hangs on (connect-server ...) - any pointers welcome
15:47chillitomlabrepl.clj
15:48chillitommy .vimrc is very basic
15:48kotarakhmm...
15:48kotarakchillitom: just a sec
15:48chillitomonly "syntax on" and "filetype plugin indent on"
15:48chillitomafter pathogen call and set nocompatible
15:49lenwchillitom: which clojure plugins do you have ?
15:49chillitomjust VimClojure
15:49kotarakchillitom: http://paste.pocoo.org/show/254049 this should be minimum
15:50lenwi have let g:clj_highlight_builtins=1
15:50lenwlet g:clj_paren_rainbow=1
15:50kotaraklenw: that's ok. Their name and default will change in 2.2
15:50chillitomkotarak, that's pretty much what i have
15:51chillitomplus let vimclojure#HighlightBuiltins = 1
15:51chillitomlet vimclojure#HighlightContrib = 1
15:51chillitomlet vimclojure#ParenRainbow = 1
15:52kotarakchillitom: hmm... that's not so nice. Then things should actually work.
15:52chillitomi see that HighlightContrib isn't valid i'll remove that
15:52chillitomshould I enable DynamicHighlight ?
15:52kotarakchillitom: yeah. It's removed. It hadn't any meaning anyway. Never get around to statically define the contrib stuff.
15:53kotarakchillitom: it will have no effect unless you specify also vimclojure#WantNailgun = 1. Please leave that off for the moment. First let's get the static stuff straight.
15:53chillitomI feel so close.
15:54chillitomhighlighting is working for other source file types
15:55chillitomand setting ft works.. how does the filetype detection work?
15:55chillitomi always meant to learn to write vim highlighters
15:55kotarakchillitom: look in $HOME/.vim/bundle/vimclojure-2.2.0-SNAPSHOT/ftdetect/clojure.vim
15:55kotarakThere should be an autocommand setting the filetype
15:56chillitomau BufNewFile,BufRead *.clj set filetype=clojure
15:56kotarakexactly
15:57chillitommissing something more from my .vimrc?
15:57kotarakchillitom: can you paste it somewhere?
15:57KirinDavecemerick: Nice article on setting up a maven repo. It's actually hard to find simple step-by-steps with the right amount of detail.
15:58chillitomkotarak, sure, one second
15:58cemerickKirinDave: thanks :-) I'm waiting for the hate mail to come pouring in. ;-)
15:58KirinDaveWell that's inevitable
15:58KirinDaveYour post is well written and useful. Nerd hate is _inevitable_
15:58kotarakcemerick: ah, let me check... *harharhar* ;)
15:59chillitomkotarak, http://paste.pocoo.org/show/254055/
15:59cemerickKirinDave: If they're not hatin', you're not trying hard enough.
15:59chillitomwhere's the article, i could use an intro to maven
16:00LauJensenAWizzArd: How do you handle phones etc, that have the qwerty keyboard?
16:00KirinDavecemerick: So I've been doing this big total reorg of my desktop in preparation for my new job and the writing stuff.
16:00KirinDavecemerick: Are you into those kinds of desktop minimalism hacking exercises?
16:00cemerickKirinDave: nah, it's a whirlwind over here. I clean up once every few months or so.
16:01KirinDavecemerick: This is my new desktop & work organization setup.
16:01KirinDavecemerick: http://cl.ly/26oh
16:02kotarakcemerick: dang, you mentioned gradle and even Ivy. pfff
16:02KirinDavecemerick: The dark desktops are for work. The light ones are for non-work stuff.
16:02cemerickkotarak: I figured you'be happy for that! :-)
16:02kotarakcemerick: I am. thanks :)
16:02cemerickKirinDave: oh, *that* desktop. Thought you meant meatspace. :-)
16:02KirinDavecemerick: Noh
16:03KirinDaveAlthough that is gonna be a project too.
16:03mebaran151can you do tiled setups on MacOS X? I've become addicted to my compiz gridding plugin.
16:03KirinDavemebaran151: Not sure what you mean.
16:03AWizzArdLauJensen: i still can type on qwertz, just slower, now after 4 years. And they typically show which letter a key will produce :)
16:03cemerickkotarak: np -- I'm not hip to gradle, but getting people straight w.r.t. repos is definitely common cause.
16:03AWizzArdLauJensen: but anyway, I have Neo installed on my mobile phone.
16:03LauJensenfigures :)
16:03mebaran151basically, you can set it up so all your windows take up the exact amount of sapce and arrange themselves according: using the numpad you change their relative sizes to one anohther and don't waste any screen space
16:04cemerickKirinDave: I've never been able to make peace with spaces. Anything more complicated than Cmd-Tab is too much for me to develop muscle memory for.
16:04cemerickProbably the same reason I simply can't cope with emacs.
16:05KirinDavecemerick: Ha.
16:05neotykrhickey: I've extended c.c/promise to be able to check if it was delivered? already, do you think it would fit c.c? http://j.mp/cblJgg
16:05KirinDavecemerick: Well I am just drilling myself to be more organized.
16:05KirinDavecemerick: Also these long weeks at microsoft where I am in get-the-fuck-out limbo
16:05KirinDaveit's fun to pass the time
16:05KirinDaveI think I'm going to rent some shop time and build a new desk from scratch
16:05KirinDavehttp://lifehacker.com/5617021/diy-plank-desk-inventively-hides-your-cord-clutter
16:06cemerickIt's a good impulse. I'll have to get square eventuallly.
16:06KirinDaveEasy design.
16:06KirinDaveAnd looks nice.
16:06KirinDaveAnd a very solid functional idea.
16:06LauJensenKirinDave: Interesting to see a trimmed setup on OSX - Wheres your new gig?
16:06KirinDaveI just need some time with a table saw, power sander, and a router to get it done right.
16:06KirinDaveLauJensen: I'm lead engineer for BankSimple now.
16:07KirinDaveWell, as of Sept 13 next mo
16:07cemerickI've been on an ikea table for the past 4 months or so. It's been good enough so far.
16:07KirinDaveBut as it stands we're already starting serious design stuff.
16:07KirinDavecemerick: That'd be the base for this.
16:07LauJensenah ok, congrats :)
16:07KirinDaveLauJensen: Thanks.
16:07cemerickKirinDave: that means the invites will flow like water, right? ;-)
16:07LauJensenKirinDave: It you really want lean and clean, try Arch / Awesome
16:07KirinDavecemerick: Once we have a product, sure.
16:07KirinDaveLauJensen: ?
16:07cemerickdetails, details
16:07KirinDavelink plx
16:07KirinDavecemerick: But of course.
16:08KirinDaveRight now we're in a protracted debate about scala or clojure for the engine to implement the API.
16:08LauJensenKirinDave: www.archlinux.org, http://awesome.naquadah.org/
16:08kotarakcemerick: yes, indeed. I hope people now also understand what a SNAPSHOT means and why it is NOT-a-release(tm) and then sun will shine, birds will sing etcetc
16:08KirinDaveLauJensen: Sorry, I demand copy and paste works properly before I use desktop linix
16:08KirinDaveErr, linux.
16:08LauJensenWorks fine KirinDave
16:08cemerickkotarak: one step at a time, right? :-)
16:08KirinDaveLauJensen: Copy styled text to another buffer. :)
16:08kotarakcemerick: right. :)
16:09chillitomkotarak do you have anything else in your .vimrc that it might be worth me trying too?
16:09LauJensenKirinDave: styled? Sounds like bloat
16:09KirinDaveLauJensen: Incorrect.
16:09KirinDaveLike tabluar data.
16:09LauJensenKirinDave: What are you discussing in regards to scala vs clojure?
16:09kotarakchillitom: no. that should be it. Everything else is unrelated.
16:09KirinDaveLauJensen: I think Alex loves Scala and I love Clojure.
16:09chillitomkotarak, okay thanks
16:09KirinDaveI argue that Scala's benefits are in succint definitions of systems that benefit from static typing.
16:09LauJensenKirinDave: Hmm, I have a few blogposts that he might like then :)
16:09KirinDaveIt's very good at that.
16:09kotarakchillitom: I'm running a little bit out of ideas.
16:10KirinDaveI think for network services like an API with synchronization requirements, Clojure is still superior.
16:10kotarakchillitom: you could try to put the ftdetect file directly into ~/.vim/ftdetect
16:10chillitomis there something i can do to check the au command is being run?
16:10KirinDaveBoth integrate equally easily into a larger deployment framework.
16:10kotarakchillitom: lemme check
16:10KirinDaveAnd Scala's speed advantage on primitives is mostly lost in API parsing, routing, and general data munging.
16:10KirinDaveI argue we should use Scala for analytics and cloud ops. There, it will shine.
16:11chillitomkotarak, okay if i run the au command by hand it works just fine
16:12KirinDaveLauJensen: If you have input on that, I'm happy to take it!
16:12chillitomI wonder why it isn't being picked up by vim/pathogen
16:12kotarakchillitom: you can check with au BufNewFile *.clj
16:12LauJensenKirinDave: I fail to see how Scala would be a better choice than Clojure for analytics and cloudops, unless you have a strong preference for large codebases and object orientation
16:12chillitomkotarak, yeah no command set
16:13KirinDaveLauJensen: Scalas java interop is more natural than Clojures, I think, when you have something like Hadoop you want to plug into.
16:13KirinDaveLauJensen: Maybe that's my broken assessment.
16:13kotarakchillitom: did you try to move the ftdetect/clojure.vim?
16:13LauJensenKirinDave: Have you seen Stuart Sierras hadoop integration lib ?
16:13KirinDaveYes
16:13KirinDaveI think anyways, what was it called?
16:13LauJensenclojure-hadoop
16:13chillitomkotarak, nope, but i might just add the line to my .vimrc and be done with it
16:13KirinDaveAh, no. I think I saw another cloud op framework demo the other night.
16:13hiredman~scala {((x: Any, y: Any) => (f: Function2[Any, Any, Any]) => f(x, y))(1, 2)((x: Any, y: Any) => x)}
16:13LauJensenKirinDave: With it you get to work on native Clojure datastructures, using nothing but Clojure
16:13clojurebotAny = 1
16:14LauJensenIf Scala can beat that in terms of interop, I'd love to see a code example
16:14kotarakchillitom: ok. But I'd really like to understand that...
16:14kotarakcemerick: btw: http://bit.ly/b5fCI4
16:14kotarakthe other step
16:14KirinDaveLauJensen: Ultimately I am going to have to yield a little. I am the only clojure guy and there are two big fans of scala. :)
16:14tomojclojure-hadoop kind of bugs me with print-dupiness
16:14KirinDaveLauJensen: So I am trying to keep the API layer as Clojure because having refs and a very clean model for distributed and async ops will be hugely helpful.
16:15LauJensenOk
16:15KirinDaveBut I like Scala and want to learn more of it.
16:15KirinDaveI feel like it's so much tho. Reminds me of C++
16:15hiredmanbut scala is so ugly
16:15KirinDaveEverything, everything, everything in the hard-boiled syntax.
16:15hiredman~tell me about scala
16:15clojurebotScala often gets in the way when trying to write neat code -- seen in #scala
16:16danlarkinhiredman is on the case, heads will roll
16:16chillitomkotarak, moving it worked just fine, first time
16:16KirinDavehiredman: Most people take their version of "ugly" as "related to C++"
16:16KirinDaveBut then they give Scala a pass because static typing is so *familiar*
16:16kotarakchillitom: hmmm ok...
16:16LauJensenKirinDave: I tried Scala for a little while. Felt alot like every other imperative language I ever tried, except more complex
16:16KirinDaveIt seems like a Big Mistake™ to many to just step back from static typing.
16:17kotarakchillitom: can you check with ":script" what is loaded before your .vimrc?
16:17KirinDaveLauJensen: Well it's certainly less asinine than java or python, so I like it there.
16:17mabesKirinDave: have you seen cascalog? (http://github.com/nathanmarz/cascalog) I've only played around with it but it seems to be a selling point for using clojure on the analytics side of things
16:17KirinDavemabes: I saw a demo of it the other night @ the bay area clojure meetup that Runa hosted. Was rally cool.
16:18KirinDaveLauJensen: If you said, "We need a big OO system, what OO language will you go to?" I'd probably say Scala.
16:18KirinDaveLauJensen: Now if you took the "OO" out, then it's Clojure or PLT Scheme.
16:18chillitomkotarak, i'll move it back and take a look
16:18KirinDaveMaybe I should try writing an MBE system in PLT Scheme.
16:18KirinDaveAnd I really hope one day we can have Conditions and Restarts in Clojure.
16:18fogusKirinDave: Congrats on the gig
16:18KirinDavefogus: Thanks.
16:19KirinDaveThat's the _one_ thing I miss from Common Lisp.
16:19KirinDaveConditions and restarts are still 5 years ahead of everyone else's error handling.
16:19kotarakchillitom: pathogen should be loaded before runtime/filetype.vim
16:20kotarakKirinDave: c.c.error-kit is kind of a hacky start with conditions and restarts. (Not really, I believe, but close?)
16:20chillitomkotarak, http://paste.pocoo.org/show/254063/
16:20KirinDavekotarak: I dunno about that...
16:21LauJensenKirinDave: I just dont see the novelty in OO anymore. I guess subconciously Ive started associating it with every single bad software experience Ive had, and Ive yet had a really bad one with Clojure
16:21LauJensen(if you disregard the stacktraces ofc)
16:21chillitomkotarak, looks like pathogen is loaded second
16:21kotarakchillitom: yeah. debian does stupid things. Try "filetype plugin indent off", then pathogen, the "filetype... on" again in your .vimrc
16:22chillitomkotarak, okay i'll give it a go
16:22KirinDaveLauJensen: I agree. The most frustrating part is that most people don't understand what the fuck OO is or why it's meaningful.
16:22KirinDaveLauJensen: Ask most people to define the essential features of OO and they get it radically wrong.
16:22LauJensenKirinDave: What, they dont say model entities as objects? :)
16:23chillitomkotarak, no change
16:23KirinDaveLauJensen: They go, "Um.. Identity, Inheritance... Encapsulation..... umm..."
16:23KirinDaveFfffuuu
16:23KirinDaveYes No No.
16:23fogusDo people actually say identity?
16:23KirinDaveYes.
16:24KirinDaveWhich I guess is a valid answer.
16:24KirinDaveAnd I suppose it's meaningful.
16:24kotarakchillitom: then, I'm afraid you have to somehow tell Debian *not* to load the filetype stuff. Pathogen has to come first. (Or just put the clojure.vim in .vim/ftdetect instead of the bundle...)
16:24KirinDaveBut when I try and tell people that Erlang, for example, is a pretty OO language in practice they tell me I don't understand OO.
16:24KirinDave*grumble*
16:24LauJensenKirinDave: If they said identity fused with state I would have been happy :)
16:24fogusErlang is the only OO language
16:24KirinDaveHa.
16:24LauJenseneh? Erlang isnt OO
16:25KirinDaveIn practice, it is strongly OO.
16:25fogusIndeed
16:25KirinDaveEvery design is a giant intercommunicating hierarchy of objects.
16:25LauJensenExplain please
16:25KirinDaveIt's _very very very_ oo
16:25chillitomkotarak, thanks for your help (and for vimclojure)
16:25LauJensenOh, so you mean each player in the network is an object?
16:25hiredmanactors as "active objects"
16:25fogusMessages messages messages
16:25KirinDaveAnd the only way they communicate is asynchronous asymmetric messages.
16:26LauJensenYea I see what you're saying
16:26kotarakheck, C is OO.
16:26LauJensenI remembered an essay by an Erlanger a while back, where he said when people asked him if Erlang was OO (which was usually the first question), they typically danced a little "yes, well, no, not exactly, maybe", and he wanted them to just come out and say "no, and theres a good reason for it"
16:27KirinDavekotarak: Not really
16:27hiredman~oo sucks
16:27clojurebothttp://www.sics.se/~joe/bluetail/vol1/v1_oo.html
16:27KirinDaveYou can write OO C, but..
16:27kotarakOO is not a property of a programming language.
16:27KirinDavekotarak: I'm not sure I agree with that.
16:27KirinDaveI mean, what is Io then?
16:27fogushiredman: How do I teach clojurebot that "Erlang is the only OO language"?
16:28chillitomOO is old hat.. next.
16:28hiredmanclojurebot: Erlang is the only OO language
16:28clojurebotRoger.
16:28hiredmanclojurebot: erlang?
16:28clojureboterlang is http://clojure.googlegroups.com/web/erlang.clj
16:28hiredmanbah
16:28kotarakA programming language? Maybe with special support for OO stuff? Even VimL is OO....
16:28hiredmanclojurebot: erlang?
16:28clojurebotErlang is the only OO language
16:28fogusyay!
16:29KirinDaveI should pretend to do a little work for microsoft.
16:29KirinDavePardon me, please
16:29fogusI guess this is why no one gets the OOP question right, because everyone has a different answer.
16:29KirinDavefogus: Except that Kay gave us a really clear definition and he fucking defined it.
16:29KirinDavefogus: Err, coined it.
16:30fogusKirinDave: His ideal was the motivation behind my Erlang statement. ;-)
16:30KirinDavefogus: Everyone else just perverts the essence with useless clutter, frequently implementation details.
16:31fogusWhoops... gotta run. Good luck all.
16:31patrkriskotarak: have you updated vimclojure for clojure 1.2?
16:33kotarakpatrkris: release will be soon. Here is a snapshot: http://bit.ly/cpwPay
16:33patrkriskotarak: coolio
16:36ssiderisso, I have installed leiningen, slime, swank clojure and I have started a project with dependencies etc
16:37ssiderishow can I run a piece of clojure that depends on one of the jars that leiningen downloaded?
16:37@chouser"OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme LateBinding of all things." -- Alan Kay, 2003. http://c2.com/cgi/wiki?AlanKaysDefinitionOfObjectOriented
16:37ssiderisspedifically, I'm trying to run this: http://github.com/ztellman/penumbra/blob/master/test/example/game/pong.clj
16:38dnolen_ssideris: you need to make sure you got the native deps with: lein native-deps
16:38dnolen_ssideris: might be borked right now, need to upload a version of lein-deps that works with lein 1.3.0 later this evening
16:38dnolen_ssideris: you can then just start a repl and load the examples
16:39dnolen_with: lein repl
16:39ssiderisyeah, I have the latest lein and it didn't work
16:39ssiderishm I've started swank and I've connected to it from emacs
16:39dnolen_ssideris: sorry, not a machine that I can push to clojars with for that project
16:39ssideriswould starting swank in the dir of the project take care of the classpath?
16:42dnolen_ssideris: you need to unpack the native libs
16:42dnolen_ssideris: penumbra github repo has some manual instructions
16:44ssiderisdnolen_: ok, I suppose penumbra is a special case, but in general, if it was a pure java dependency that I was using what would the steps be to run something that has a dependency that's already been downloaded using lein deps?
16:44dnolen_ssideris: yes, it would been simpler, native deps complicates things
16:45technomancyLauJensen: for what it's worth I hereby retract my half-hearted endorsement of the MS Natural 4000.
16:45technomancyit feels like typing on butter. so mushy.
16:45ssiderisdnolen_: yes, but I don't even know how to handle the simple case :-)
16:45LauJensenIts scratched from the list :)
16:45LauJensenBut in all honesty, AWizzArd got me hooked on Das Keyboard + NEO
16:46ssiderisLauJensen: even with all the l33t value, isn't Das Keyboard a bit overpriced?
16:46LauJensenssideris: I live in Denmark, everything is overpriced
16:46LauJensenAnd compared to everything else. No, its an OK price for a quality keyboard
16:46ssiderisLondon here, I know what you mean...
16:46LauJensenI think it costs the same as my Dinovo Edge actually
16:46danlarkintechnomancy: why do you dec the MSN4k?
16:47technomancydanlarkin: the keys are hell of mushy
16:47technomancythere's no crispness at all
16:47danlarkinI like mine
16:47danlarkincrispiness is just more stress on your fingers
16:47LauJenseneww, danlarkin likes mushy keys :((
16:47ssiderisdnolen_: any advice on the simple case?
16:48technomancywith mushiness you just get the feeling you don't know the exact amount of pressure you need to use to have it register
16:48technomancyso you end up pushing harder than you need to
16:48dnolen_ssideris: lein deps, lein repl, that's it
16:48danlarkintechnomancy: ...maybe you do
16:48technomancywith a buckling-spring mechanism, it's really obvious when it clicks, so a lighter touch may be used
16:49danlarkinI am confidently applying the correct amount of pressure :)
16:49ssiderisdnolen_: and then (load "/src/myproject/myfile.clj") ?
16:49technomancydanlarkin: also for it to be comfortable I have to put it in my lap, but it's so huge
16:49technomancyif I could just chop the numpad off it would be an improvement
16:50danlarkinno accounting for taste I suppose
16:50dnolen_ssideris: more like "src/myproject/myfile", drop the .clj
16:51technomancydanlarkin: how come you're standing up for it? hasn't it caused you a bunch of kernel panics?
16:51danlarkinwell, the drivers
16:51danlarkinbut the keyboard itself I like!
16:52chillitomguys, i'm interested in what your clojure development cycles are like
16:52technomancydanlarkin: well it's still probably the best if you have RSI issues and can't spend over $100 on a keyboard.
16:52ssiderisdnolen_: seems to work from the lein repl, but shouldn't the same work from a swank started in the project dir using "lein swank"?
16:52technomancymy thinkpad keyboard has been giving me wrist-aches
16:52RaynesI use an MSN4k. :(
16:52RaynesI actually like the keyboard.
16:52chillitomdo you edit code in a .clj file then (use ...clj) it after each change?
16:53RaynesI'm siding with danlarkin on this one. I've become quite attached to this keyboard over the past 2 years.
16:53Raynes<3
16:53pdkwhich kb is this
16:53technomancyhave you guys ever touched a Model M? it's like a religious experience.
16:53RaynesI haven't. I can't afford that thing.
16:53danlarkintechnomancy: I've used a model M. did not like
16:54ssiderisI've heard a lot about model M, but I'm uncertain about any keyboard that makes a lot of noise
16:54@chouserchillitom: sometimes, though more likely to do (require ...). Othertimes I use (load-file "foo.clj"), and sometimes just send forms to the repl from vim
16:54RaynesEr, well, a Das anyway. I've not looked at model Ms.
16:54chillitomchouser, do you need the nailgun client set up to send from vim?
16:55Raynesssideris: das offers silent models: http://store.daskeyboard.com/Das-Keyboard-Professional-Model-Silent/dp/B003M549A2/175-9245098-7665938
16:55chillitomi only have basic vimclojure set up so far
16:55@chouserchillitom: that's one way to do it. I usually use a screen-based approach. less to break.
16:55ssiderisRaynes: a good to know for when I can spare the money :-)
16:56nteondoes the silent one feel the same?
16:56RaynesThe most I've ever spent on a computer accessory was $100 for the Logitech Performance MX that I'm using now.
16:57technomancyModel Ms are only $70
16:58ssiderischouser: btw, I saw your blog post about doing the Euler problems in clojure... have you published any solutions anywhere yet? (I'm trying the same myself)
16:59@chouserssideris: that's old -- haven't done any in a long time. several of mine (though not all) are at http://clojure-euler.wikispaces.com/Problem+001
16:59bozhidarI love my das keyboards
16:59bozhidarbut most people around me hate them
16:59bozhidar;-)
16:59RaynesI'll happily take 'em off your hands.
16:59Raynes;)
17:00ssiderischouser: thanks, I mainly want to see how idiomatic my solutions are (they don't feel like they are particularly)
17:00@chouserah. well, the ones on that wiki are all over the map, but they should at least give you some ideas
17:01@chouserof course mine are all over the map too -- these are learning experiences for everyone, myself included.
17:01ninjudd,(first (seq (for [i [1 2 3 4]] (do (println i) i))))
17:01clojurebot1
17:01clojurebot1 2 3 4
17:01@chouserninjudd: chunked seq
17:02ninjuddchouser: how do i make it not realize the rest?
17:02ssiderislazy-seq
17:02@chouserninjudd: depends a bit, I suppose.
17:03@chouser,(first (for [i '(1 2 3 4)] (do (prn i) i)))
17:03clojurebot1
17:03clojurebot1
17:03lancepantzso vectors are chunked and lists aren't?
17:04@chousera seq on a vector is chunked and lists are unchunked seqs, yes.
17:05ninjuddchouser: ok, using a list fixes my problem. thanks
17:05@chousernp
17:11chillitomis use of -> and ->> encouraged?
17:11mebaran151chillitom: if your code naturally pipelines, I would suspect yes
17:11chillitomdoesn't changing evaluation orders like this make script scanning files more difficult
17:12mebaran151I mean the point is that the evaluation order is clearer that way
17:12mebaran151,(-> 1 inc #(* 2 %1))
17:12clojurebotjava.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector
17:13kotarakchillitom: use of -> and ->> is fine and encouraged if it makes sense.
17:14mebaran151ah, I didn't know you couldn't pass an anonymous function
17:14kotarak,(let [m {:a {:b {:c :hello}}}] (-> m :a :b :c))
17:14clojurebot:hello
17:14mebaran151(-> 1 inc (* 2))
17:14kotarak,(-> 1 inc (* 2))
17:14clojurebot4
17:14technomancydoes clojurebot know about dinc?
17:14technomancy,(-> 2 dinc)
17:14clojurebotjava.lang.Exception: Unable to resolve symbol: dinc in this context
17:15mebaran151what's dinc?
17:15technomancyhiredman: dude!
17:15kotarako.O dinc?
17:15technomancymebaran151: double-inc!
17:15mebaran151because + 2 hurts?
17:16technomancywe clearly need a more succinct way to express (comp inc inc)
17:16mebaran151dinc is actually one character longer than + 2
17:17mebaran151(dinc i) vs. (+ i 2) 7 to 8!
17:18technomancyyou're counting chars instead of tokens though.
17:18mebaran151with the proper parser support, we could have +n prefix support
17:19mebaran151(+2 i) but this is of limited utility
17:32sts193can anyone help or point me to a guide for a beginner trying to get into clojure?
17:35lancepantzsts193: i like this one: http://java.ociweb.com/mark/clojure/article.html
17:38sts193thanks!
18:08burritoboywhat does "binding forms" mean in this sentance? Clojure uses vectors to denote function arguments or binding forms.
18:09defnburritoboy: (let [foo (+ 1 1)] foo)
18:09alexykdnolen_: ping
18:09defn=> 2
18:09defn(defn bar [foo] foo) (bar 2) => 2
18:10alexykwhat do folks use to grep through a list of files with a sexp, collecting matches?
18:10alexyksexps from contents
18:10defni have something alexyk
18:10burritoboydefn: ah maybe I shouldn't try to understand that part yet, I don't quite get that yet
18:10alexykmean regexps
18:10alexykdefn: shoot
18:11defnhttp://github.com/defn/walton/blob/master/src/walton/core.clj#L38
18:12defnalexyk: i know it's not pretty, but it's fast
18:13alexykdefn: cuute! I actually want to parse same #clojure, but say extracting only nicks. Can I use it?
18:13alexyk(for social graph and such)
18:13alexykso my regexp would be -!- (\w+) or something
18:13defndepends on your logs
18:14defnbut yeah i think that's sufficient
18:15alexykdefn: but you collect sexps, not regexps?
18:15defnsexps yes
18:15defn (((( )))) is valid
18:16defnalexyk: maybe i misunderstand what you are looking for
18:16alexykdefn: so how'd I collect regexps? I want to collect say all nicks in all logs, i.e. all users
18:17defnunique users or a vector of all occurrences
18:18defnwhat should your data look like when you run this on your logs, the result?
18:20alexykdefn: unique users are ok. Unix, someting like: grep '-!- (\w+)' *.log | sed <get nick only> | sort | uniq
18:20alexykthen we have a list of all nicks in the logs.
18:21defndepends on what your logs look like
18:21alexykdefn: you also seem to use 1.1 packages from contrib, they changed in 1.2 right?
18:22defnalexyk: yeah my code is so out of date, and yes i feel very guilty about this
18:22alexykdefn: do you run against 1.1?
18:22defnin that code yes
18:26alexyknice thing, walton. Results, not often clear, but may be for some :)
18:27defnalexyk: it needs some TLC. i'm cutting it in half so it will be a client-side lib that queries a backend API on my server
18:27defnand then i need to build a new front end for the web
18:30dnolen_alexyk: pong
18:31alexykdnolen_: looks like you git add'ed a bunch of crap in Clojure.tm! :)
18:31alexyklike, Untitled 2, Untitled, Cale 2, etc
18:31alexykCake
18:33dnolen_alexyk: No those are aria42's changes. Those are real commands, the files just need renaming
18:33alexykaha
18:33dnolen_alexyk: have you played around with it? eval last sexpr works reasonably well now. The main things is making it work on all "atoms" so to speak.
18:34alexykdnolen_: basic sent to repl is great, will try more things
18:35dnolen_alexyk: yeah a lot of the goodness is totally aria42's work. It's coming along.
18:35arohnerwhen clojure reads a (ns) declaration, is there any reason why it can't blow away the existing ns entirely? Remove all vars, all aliases, etc.
18:36dnolen_the next things are: better eval last sexpr, jump to definition, and pretty stacktraces.
18:37arohnerI really hate that changing an existing alias in an ns declaration requires an (ns-unalias) at the repl. Slime/clojure should handle that without exploding
18:39technomancyarohner: it's on my todo to make a blow-away-ns slime command, but a patch would make it happen sooner =)
18:39arohnertechnomancy: I might do that
18:54mebaran151I'd like to extend clojure.lang.Keyword to implement a third party interface? Can protocols help me do this?
19:05Rayneschouser: ping
19:28notsonerdysunnyhttp://pastebin.com/1vQNfQ72
19:28notsonerdysunnyI am kind-of new to this jar and java stuff.. I tried to package the jreality.jar along with its native dependencies and upload it to the clojars org .. I am having trouble with the simply requiring a class in the namespace that is available in on one of the jars that I have packaged together .. can anybody help? The link to the paste is given above..
19:29notsonerdysunnyI verified that the jar actually contains what I wanted using jarexplorer
19:33tomojyou don't require java classes, you import them
19:33tomoj(try (:import [de.jreality.plugin JRViewer]) instead)
19:39Raynestomoj: (:import de.jreality.plugin.JRViewer) ought to work, right?
19:48tomojindeed
20:55crowbar7So, I havev a couple of questions
21:06crowbar7What is a nicer way to deal with this XML? IE. Not calling the URL twice would be good. (apply str (interpose " " (interleave
21:06crowbar7 (zf/xml-> (z/xml-zip (parse url )) :txt_forecast :forecastday :title zf/text)
21:06crowbar7 (zf/xml-> (z/xml-zip (parse url )) :txt_forecast :forecastday :fcttext zf/text))))
21:06crowbar7(apply str (interpose " " (interleave
21:06crowbar7 (zf/xml-> (z/xml-zip (parse url )) :txt_forecast :forecastday :title zf/text)
21:07crowbar7 (zf/xml-> (z/xml-zip (parse url )) :txt_forecast :forecastday :fcttext zf/text))))
21:07crowbar7Those last 3 lines
21:12tomoj(let [x (z/xml-zip (parse url))] (apply str (interpose " " (interleave (zf/xml-> x ...) (zf/xml-> x ...)))))
21:12crowbar7k
21:12crowbar7thanks
21:13crowbar7That should speed up my call quite a bit
21:14rhudsonsmall point, but instead of (apply str (interpose " " blah)) you can use (clojure.string/join " " blah)
21:15crowbar7I'm guessing that would be quicker then interpose
21:25crowbar7tomoj: I already have that code in a let block
21:39tomojcrowbar7: hurrah
21:40crowbar7So, now that parse itself is it's own let block it will only go fetch that url the first time then work off a saved immutable state the second time I call it?
21:40crowbar7err
21:41crowbar7a binding in a let block
21:45tomojright
21:48crowbar7cool
21:49crowbar7Well, that gets my IRC bot finding the local forecast
21:49Raynes$fcst Eldridge, AL
21:49sexpbotRaynes: 3:47 PM CDT
21:49sexpbotRaynes: TODAY: Clear. Lows in the mid 60s. North winds around 5 mph in the evening then becoming light.
21:49sexpbotRaynes: TONIGHT: Sunny in the morning then becoming partly cloudy. Highs in the lower 90s. North winds 5 to 10 mph.
21:50Raynescrowbar7: What service are you using? Just curious.
21:50RaynesI specifically tried to find a JSON-based service, to no avail. I ended up using wunderground.
21:51crowbar7that is what I use as well
21:51crowbar7wunderground
21:52RaynesIt's an okay API. I just can't stand parsing XML.
21:53crowbar7seemed easy enough, I think weather.com has a faster api as my friends php bot can scrape it faster.
21:53RaynesYeah, but weather.com is horridly inaccurate.
21:53crowbar7however his forecast function is totally borked, so I wrote my own for my bot.
21:54RaynesIs your bot on github (or elsewhere) by any chance? :>
21:54crowbar7Not yet
21:54crowbar7He is really poorly written, but once I get a couple more features I will stuff him on there.
21:54crowbar7He is in one file
21:54Raynescrowbar7: Are you using any IRC libraries or frameworks, or did you roll your own connection handling stuff?
21:55crowbar7I used pirc
21:55crowbar7I did roll my own for a little bit, but found pircbot to have quite a load of nice features I could just call.
21:55Raynescrowbar7: http://github.com/Raynes/irclj You might be interested in that. I wrote it specifically to replace Pircbot in sexpbot. It's somewhat modeled after it.
21:56crowbar7nice
21:57crowbar7I hate using the wall hacked method in pirc bot
21:57RaynesNo such annoyances in Irclj. :>!
21:58crowbar7I see that
21:58crowbar7clojurebot is nice but coding something with the pop queue framework hiredman wrote is a little over my clojure head. :p
21:59Raynesraek: If you want, you could add trattern as an example bot. I've been meaning to mention that.
22:00crowbar7I actually want to get a clojure asterisk framework written
22:00crowbar7I have some stuff for my work that uses a Java backend. might try to convert it to clojure with a rewrite someday. :p
22:00crowbar7dealing with asterisk
22:01RaynesNeat.
22:03Raynescrowbar7: Pircbot is a pretty nice framework. I actually pretty much copied it's flood protection.
22:04crowbar7nice
22:05Crowbar7that is much better
22:10jsandadoes leiningen support specifying dependencies on libraries/modules that are of type pom instead of the maven default jar type?
22:12jsandai tried [group/artifact "version" :type "pom"] but leiningen still tried to pull down a jar module
23:24technomancyjsanda: that's not supported yet, but it wolud be easy to add if you are so inclined
23:47jsandatechnomancy: i am inclined :-)
23:48technomancyjsanda: act soon and your patch may be included in 1.3.1
23:49jsandawhen are you releasing 1.3.1?