#clojure logs

2010-03-16

00:01crowbar7dnolen: Well, it's the whole aspect of threading not being a complete pita that draws me.
00:01technomancythis is strange... if a .clj file has a corresponding .class file with the same timestamp, the .class file gets ignored
00:02technomancywouldn't it make more sense to prefer the .class file if they're the same age?
00:02fanaticoalthough clojure's lifespan has yet to be determined, we can at least count on lisp outliving us all.
00:03hiredmantechnomancy: if they are the same age then the .clj has to be newer
00:04hiredmanthe class file is generated from the clj file, so it has to be younger unless the clj file was modified since it was generated
00:04scgilardiedited and compiled in the same second is unlikely enough that preferring the .clj file in that case seems the correct choice. somebody artificially manipulating the mod dates?
00:04technomancyhiredman: not necessarily, but in cases where the timestamp is lost (rsync shenanigans, etc) it does make sense to go the safe route and prefer .clj
00:04technomancynow that I think about it
00:05technomancyscgilardi: yeah, in this case coming from a jar file
00:06technomancyI guess if the timestamps are exactly the same it's a good bet that they can't be trusted.
00:06scgilardibut just jarring wouldn't affect the mod date. the loader code uses the timestamps inside the jar.
00:06technomancyscgilardi: well if you don't use java.util.zip.JarFile quite correctly it actually just uses the current time as the modification date, it looks like
00:07scgilardigotchya, interesting
00:07hiredman:(
00:09technomancyI did just get a patch fixing lein's jar creation, but it made me wonder.
00:13crowbar7technomancy: Actually what turned me onto clojure originally was when I wrote an IRC bot with it for my old college computer club (pretty much every active member writes one at some point). The thing was not only was my bot the first and only one be multi-threaded, but it was easier for me to just thread the thing then make it serial.
00:15crowbar7My bot thus is also the only one that does not timeout from the irc server because he is hung up from some http query.
00:17technomancyslick. =)
01:42slyphongah
02:29psykoticis reify working yet in the experimental branch?
02:32hoeckpsykotic: its in the current master
02:32psykoticnice
02:32hoeckpsykotic: never used it though, always using deftype to implement interfaces
02:33psykoticdeftype calls out to reify though, no?
02:33hoeckyes
02:34psykoticgood, thanks!
02:39hoeckpsykotic: sorry, both reify and deftype expand to reify* and deftype* forms which are implemented in the compiler
02:39rfgAnyone know which GUI framework or look and feel JVisualVM uses? It's pretty.
02:39hoeckso deftype does at least not in clojure-land expand to reify
02:40hoeckrfg: I would bet it uses plain swing
02:41psykotichoeck: the assembla page on deftype/reify implies that you still cannot define mutable fields with them. is that still the case?
02:42psykotici need to interop with some java code that reflect over fields to do some magic--and that magic is only accessibly by that route, due to poor design
02:43rfgJVisualVM's titlebar has a subtle gradient and the font is different from my own swing window. How are those sorts of thing set?
02:44psykotichoeck: actually, i think i might be better off calling java directly to construct a class on the fly, since i don't need to implement class methods that call clojure--i only need this class as a kind of schema for this java library.
02:44hoeckpsykotic: according to the latest master doc, you can
02:45psykotichoeck: hmm, good to know, i'll try it out, thanks again!
02:45hoeckpsykotic: http://github.com/richhickey/clojure/blob/23f612edadfd629315c68d8962eaf86ee177d687/src/clj/clojure/core_deftype.clj#L239
02:45psykotichoeck: that is awesome! seems the assembla docs are lagging a bit behind.
02:46hoeck(deftype myType [#^{:volatile-mutable true} field]) will get you a mytype with a volatile .field
02:48psykoticbtw, is there a preferred workflow if i want to use the latest clojure, etc, with a lein project? i'm used to setting clojure as a dependency but obviously the latest master isn't a clojar :)
02:49hoeckrfg: maybe by using a customized/subclassed Component, or using decorators to paint the toolbars background
02:51hoeckrfg: btw, there is a lot of swing-related documentation around (I'm not a swing expert) :)
02:51hoeckand jvisualvm definitely uses swing, just took a look at it
02:54rfgYeah, there's plenty of swing info, but a lot of it is ghastly :)
02:55hoeckpsykotic: I have [org.clojure/clojure "1.2.0-master-SNAPSHOT"] in my deps and I think it gets the latest clojure from build.clojure.org
02:55psykoticinteresting
02:56psykoticthat's really neat, i had assumed it could only pull from clojars, maven central, etc
03:04hoeckthere is so much magic in lein, it just said it downloaded clojure-20100311 from clojars, so no dl from build.clojure.org
03:52mebaran151anybody here use clojure box
03:52mebaran151I can't seem to get paredit to work....
03:53LauJensenMorning team
03:53mebaran151if I got it running, I might even put off installing Ubuntu for a bit
03:53mebaran151paredit on Windows 7 would be sick
03:59TheBusbymebaran151: I've had the same issue for a while
03:59mebaran151ah, so it's not a broken install
03:59TheBusbyif you discover the fix, be sure to post it somewhere. ;)
03:59TheBusbyif it is, I have the same broken install
03:59mebaran151would it be possible just to install emacs normally?
04:00TheBusbyRegarding emacs + Windows, I know little to nothing
04:00TheBusbyeverything works fine in Ubuntu though ;)
04:01rfgmebaran151: Did you enable it in your .emacs?
04:02rfgmebaran151: Are you using Clojure Box?
04:03mebaran151rfg, yeah, I just got a nice shiny new VAIO
04:04mebaran151so I'm playing in Windows 7 and trying out Clojure Box
04:04rfgYou have to enable paredit in your .emacs as per the Clojure Box readme.
04:05mebaran151I need to find a gnome-do replacement for Windows too
04:05mebaran151rfg: oh alright, I was surprised that paredit-mode wasn't available as per M-x
04:05rfgI don't know this "gnome-do" of which you speak.
04:05mebaran151it's like Quicksilver, a general launcher
04:05rfgmebaran151: I had the same problem. :)
04:06mebaran151ah thanks
04:06rfgWindows 7 is nice.
04:06TheBusbyrfg: thanks
04:06mebaran151where's the .emacs file?
04:06rfgThough I've just spent the last ages pulling my hair out trying to get JOGL to behave on it.
04:07rfgmebaran151: it's in c:/Users/<you>/AppData/Roaming/
04:07rfgThe quick way to get to it is in emacs cd to ~
04:07noidimebaran151, http://www.launchy.net/
04:07rfgor directly: C-x-f ~/.emacs
04:08mebaran151so what do I change?
04:08rfgI think you just need to append (require 'paredit).
04:10rfgmebaran151: You'll want to throw this in as well http://jaguilar.posterous.com/i-get-so-tired-of-searching-fo
04:11mebaran151I actually don't mind the default color scheme of emacs, but maybe i don't know what I'm missing
04:11rfg:)
04:12rfgTheBusby: my pleasure.
04:14mebaran151does lein work on windows yet?
04:14rfgpass
04:15mebaran151anyway I think I got my .emacs file edited; how do I load it?
04:15rfgI've not used lein. What am I missing?
04:15mebaran151it's a saner version of maven
04:15mebaran151a far far far saner version of maven
04:16rfgmebaran151: google says
04:16rfgM-x load-file RET ~/.emacs RET
04:17rfgI need to remember that one, I tend just to close emacs and reopen.
04:18rfgActually what I need is a big red button on my desk, whose sole function is to reload my .emacs. I change it that much.
04:18clojurebothttp://www.math.chalmers.se/~rjmh/Papers/whyfp.pdf
04:20mebaran151cool paredit mode works!
04:20rfgNice
04:22mebaran151how do I make it the default for clojure-mode
04:22noidi(add-hook 'clojure-mode-hook (lambda () (paredit-mode +1)))
04:22mebaran151in my .emacs?
04:23noidiyup
04:26mebaran151now I just have to get hg working in windows, along with lein and a good launcher, and maybe a shell
04:26mebaran151and figure out where I'd put screenplay.el
04:36mebaran151hmph, powershell actually isn't that bad, and the hg install was painless
04:37ordnungswidrigmebaran151: screenplay?
04:38mebaran151heh, emacs has a nice easy screenplay mode I've been playing with
04:45ordnungswidrigfor writing screenplays?
04:45mebaran151a little bit
04:45mebaran151as a hobby
04:45mebaran151I haven't gotten much into it yet
04:45ordnungswidrigI see, I just didn't get the connection to clojure *g*
04:46mebaran151ah, yeah, I'm setting up a new clojure dev environment in Windows
04:46mebaran151and I'm trying to see if I can get all the emacs bells and whistles from Linux to play nice in Windows 7, where files are hidden
04:47ordnungswidrighmm, "files are hidden"?
04:51LauJensenDoes anybody know what happened to Cemericks blog ?
04:54mebaran151*the location of files is not known to me at the moment
04:55mebaran151like where your .emacs.d belongs and what conventions work, etc
04:55mebaran151anyway I gotta go to bed: thanks rtg and everybody!
04:59psykoticyay
04:59psykoticmy first working compiler hack :)
04:59psykotici extended deftype/deftype* to take an optional :extends clause for specifying non-Object superclasses
04:59LauJensenShow us the code :)
05:00psykotici'll post the patch on gist, sec
05:01ChousukeI think extending concrete classes with deftype is dangerous
05:01AWizzArdWhy?
05:01clojurebotwhy not?
05:02ChousukeAWizzArd: you might inherit mutable state that you're unaware of.
05:02psykoticChousuke: i'm using it for interop
05:02psykoticit might be better to split it into a separate function rather than deftype
05:02psykoticthe concrete problem for me is that JNA is a piece of shit
05:03psykoticthe only way to hook into their fancy structure type is to implement a subclass of Structure, so their code can reflect over the fields, etc
05:03Chousukehmm :/
05:03clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
05:05psykotichere's the patch:
05:05psykotichttp://gist.github.com/333781
05:10LauJensenInteresting
05:11vyIs deftype/defprotocol the last stone for the beginning of Clojure-in-Clojure?
05:12psykoticLauJensen: no, it's surprisingly tame code, but it took me 2 hours of mistakes to get there :)
05:13Chousukevy: That's my impression
05:21LauJensenChousuke: I think that was reify
05:28callenokay.
05:28callenleinengen needs to be preached to the people from on-high.
05:28callenjust saying.
05:28licoresseyeah
05:29callenlicoresse: would've saved me some pain the other day, but I suppose it's better that I know.
05:29licoresse:)
05:30callenlicoresse: the classpath stuff was making me curse up a storm.
05:46ChousukeLauJensen: Reify alone wasn't enough for implementing the data stuctures
05:47LauJensenRight
05:47psykoticreify*/deftype* are more or less the same
05:47psykoticthey're very different wrappers around Compiler.java's build() function
05:47psykoticerr, very thin
06:18LauJensen~source deftype
06:18clojurebotGabh mo leithscéal?
06:18LauJensen~sourcey reify
06:18clojurebotexcusez-moi
06:18LauJensenhehe
06:18LauJensen~source reify
06:18clojurebotIt's greek to me.
06:19LauJensenargh he gonna make me do it myself
06:31LauJensenhttp://github.com/bagucode/clj-native
06:32psykoticLauJensen: doesn't do much useful :)
06:32LauJensenok
06:32psykoticokay, maybe that isn't true
06:32LauJensenChouser did something similar at one point I think
06:32psykoticit does some useful things but not the difficult thing i'm trying to do.
06:32LauJensenCheck Github if you need inspiration
06:32psykoticyeah, i looked at his stuff too
06:34krainboltgreeneTa-da.
06:34krainboltgreeneIs it me, or is the Clojure website rather...lacking?
06:38defnkrainboltgreene: certainly not on information
06:38defnmaybe on organization
06:38defnive been pining for "examples", which sort of happened with autodoc, but not quite
06:39defni have sort of a plan to take all of the irc logs from #clojure...ever...and parse them for lines of actual code people have written which include various function names, etc. and then tag all of it and make it searchable
06:40zmila,(doc replicate)
06:40clojurebot"([n x]); Returns a lazy seq of n xs."
06:40zmila,(doc repeat)
06:40clojurebot"([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."
06:47defntesting logging...
06:48krainboltgreenedefn: Agreed, organization and presentation.
06:49TDTHmm..there has to be an easier way to do this. If I want to map a function onto a list, and just print out that list, I found I have to do something like: (str "my list: " (into [] (map (fn [x] (* 2 x)) mylist))), I'd use mapcar in CL to do something like this, is there a cleaner way of doing what I'm trying to do?
06:50MaddasTo just print it out -- is there anything wrong with (print (map (fn [x] (* 2 x)) mylist))?
06:51TDTstr concatenates it into a lazy sequence reference, tried that first before doing the into.
06:52TDTElements in mylist, *2? clojure.lang.LazySeq@f6c2640b <-- example output from that type of call
06:54ordnungswidrig(print (apply str (map #(* 2 %) mylist)))
06:56TDTParts of that are a bit cleaner, we lose the formatting of the list though as a result. I'll use elements of both, thanks Maddas and ordnungswidrig
06:57defnwould someone mind rejoining the channel quick to let me test something?
06:57Maddas(print (map #(* 2 %) mylist)) keeps the formatting :-)
06:57defnafter you rejoin just say "tada!"
06:57defn:)
06:58Maddastada!
06:58Maddas:)
06:58defnthanks much
06:58MaddasYou owe me one.
06:58Maddas:-P
06:58defnHaha
06:59TDTMaddas: hmm, so print and println also can concatenate, not just str...intersting
07:00TDTMaddas: (print "foo: " (map #(* 2 %) [1 2 3])) returns "foo: (2 4 6)"
07:03MaddasTDT: I didn't know str worked that way until you asked (I'm a CLer myself) :-)
07:04TDTheh, yeah, str is what's described in the programming clojure book I'm going through. I kinda wish there was just format, format nil and format t feels easier
07:06zmila,(get {120 [(30 40 50)]} 120 [])
07:07clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
07:07zmilamissed ' (
07:07MaddasTDT: I've never used it, but there is pprint which claims to be format-compatible (in clojure-contrib)
07:08TDTMaddas: Thanks, that's one thing I think I'll do once I finish the book is read through the API docs for both core and contrib. I'm sure there's a lot of really cool stuff available in there.
07:32ordnungswidrigre
07:32ordnungswidriggrr
07:58psykoticfor anyone more familiar with deftype and the compiler: type hinted fields don't seem to be defined as specially typed (beyond Object) in the generated class. is that intended?
08:00hoeckpsykotic: thats right, type hinting works only for primitive types
08:00cemerickpsykotic: are you getting reflection warnings when referring to those fields in clojure?
08:01psykoticcemerick: no
08:01hoeckthat was at least my knowledge which may not be up to date anymore
08:01psykoticthe problem is that i'm trying to talk to JNA, which reflects over the public fields and a class and does things depending on types, qualifiers, etc
08:01psykoticthis functionality is not exposed through a less insane interface, unfortunately.
08:01cemerickhoeck: That's certainly not the case.
08:02licoresseWhy can I not do this? (doto frame
08:02licoresse (.setLayout (FlowLayout.) )
08:02licoresse (doseq [idx some-vector] (do-something-with-sideeffects frame idx))
08:02licoresse .pack
08:02licoresse (.setVisible true))
08:03noidilicoresse, frame will be passed as the first argument to doseq
08:03cemericklicoresse: because doto injects 'frame' as the second symbol in each child form. (doseq frame) is nonsense
08:03licoresseaha
08:03licoressedoto is a macro
08:04licoressethanks!
08:04psykoticcemerick: so field hints don't actually affect the types of the generated fields?
08:04psykoticor am i doing something wrong?
08:05psykotic(i'm reflecting over the fields using getFields() on the Class to determine that they're just Object rather than my specified types)
08:08cemerickpsykotic: yes, that appears to be the case. Non primitives are expressed as Object in the generated class. (maybe this is what hoeck was getting at)
08:09psykotichmm
08:09psykoticin any case, my intended course won't work because the autogenerated symbols will confuse JNA
08:09hoeckyes, I meant the "type hinting" of fields in deftype
08:10hoeckwith the goal to generate class fields of the given type
08:10psykoticit would be nice if the current deftype was built on an intermediate abstraction for building java classes
08:10psykoticsomething less oo and ugly than the asm stuff
08:10cemerickhoeck: well, the type hinting works just fine, primitive or not. It appears that the expression of that type in the generated classfiles only applies to primitives.
08:11psykoticcemerick: dumb question but how do i specify an integer primitive type hint? i'm new to the jvm, so i had assumed that Integer was it.
08:11cemerick#^int will do it
08:11psykoticah, i thought that would clash with the coercion function of the same name. thanks.
08:12cemerickpsykotic: I'd ping the mailing list about this, or rhickey when he's around next.
08:12psykoticcemerick: okay.
08:13cemerickpsykotic: Also, a strenuous reading of the deftype et al. docs might expose the state of play.
08:13cemericks/strenuous/thorough :-)
08:13psykoticthe ones on assembla?
08:13cemerickyeah
08:14defni need to build a search engine for a ton of text i have locally. 0 to 255 characters in length. any ideas?
08:14defn(each text grouping is 255chars)
08:14defnapproximately 15MB of these
08:18fogusdefn: How about a trie?
08:18psykoticweird, when i specify the unsynchronized-mutable metadata for a field, it doesn't get generated in the class at all, it seems
08:19defnfogus: could you be more specific? I know about tries, but am totally clueless when it comes to implementing a search engine on top of them
08:19defnfogus: are you thinking of a "suffix tree"?
08:20defndoes fnparse do something like this?
08:20fogusdefn: I can't say for implementing a DB since I don't know enough about your problem... but Tries are ideal for storing string data. Suffix tries are even better for text searching
08:20defnso many questions...
08:20noidiwhy not use something like Lucene? I have never used it, so that's a genuine question :)
08:20noidinot a rhetorical one
08:21defnfogus: i got chouser's 12MB or so of IRC logs. I took out all of the nicks (to protect the innocent of course), and now I have a list of lists, where the inner lists contain a day's worth of IRC conversation
08:21psykoticdefn: there's a unix search engine called grep. have you tried that? :)
08:21defninner list*
08:21fogusI imagine there are 37 implementations of suffix trees in Java floating around the interwebs
08:22chouserthose speaking in #clojure are rarely innocent
08:22defn:X
08:22psykoticdefn: i may be smug but i'm not kidding.
08:23defnpsykotic: nono i know you're not kidding
08:23defnbut for 12-15MB of text? attached to a web interface with 4-5 users searching simultaneously?
08:23fogusdefn: Xach did something vaguely similar to the Naggum archives... you might find something of relevance in his notes. http://www.xach.com/naggum/articles/notes.html
08:23defnfogus: thanks for the help as always
08:23noidi_seems_ simple enough :P http://www.lucenetutorial.com/lucene-in-5-minutes.html
08:24fogusnp
08:24psykoticdefn: i would use grep and if you find yourself burdened by success (4-5 users searching simultaneously, sustained? that's success), try something fancier
08:24defnnoidi: incidental complexity! :)
08:24defn5 minutes you say? *spends 12 hours tinkering*
08:24noiditrue :)
08:25defnnono i dont know anything about it -- im just skeptical when it comes to 5 minutes, 24 hours, etc.
08:25fogusdefn: Is there any reason that chouser's Google search on the IRC logs is not sufficient?
08:25defnnoidi: that does look quite cool actually
08:26psykoticfogus: have you seen this, by the way? http://conal.net/blog/posts/elegant-memoization-with-functional-memo-tries/
08:26defnfogus: i want to do it one better
08:26cemericklucene is great, but don't confuse it for a simple, quick solution to anything :-)
08:26noidibut the converse is also true: spending a week writing a custom db engine is a great way to save 6 hours learning a new API
08:26fogusdefn: Fair enough. :)
08:26defni want to parse for example clojure code
08:26foguscemerick: +1
08:26psykoticcemerick: simple, quick - grep!
08:27defnerr I want to parse the irc log data for "example" clojure code
08:27foguspsykotic: I have not. Thanks for the link.
08:27psykotici'm reminded of this old yegge post: http://steve.yegge.googlepages.com/five-essential-phone-screen-questions
08:27defnso when you search for defn, you get a whole bunch of (defn...) blocks
08:27psykoticgrep for 'grep'
08:28cemerickdefn: if it's really only 15MB of text, then just stream out regex hits. Seriously.
08:29defncemerick: maybe ive been Doing It Wrong(tm), but running a filter using regex hits has seemed mighty slow for the whole data pie
08:29defnbut of course im not streaming
08:29Licenser_defn: do you precompile the regexp?
08:29defnitd be nice to tag lists with search terms that "work", as they work
08:29defnLicenser_: no
08:30Licenser_that might speed things up
08:30defnim not even sure what that means TBPH
08:30SynrGhttp://www.mail-archive.com/clojure@googlegroups.com/msg10884.html
08:30SynrGapparently there are people using solr
08:31defnSolr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project.
08:31defn+2 for Lucene
08:31defnpsykotic: great post by yegge btw
08:31psykoticyeah, if you have five hours to slog through the verbiage :)
08:31noiditoo bad he stopped blogging
08:32cemerickdefn: I just created a 15MB string of spaces, with "duck-streams" in the middle, and (re-find #"duck-streams" mystring) returns in 2ms *shrug*
08:32noidimy theory is that his posts grew longer and longer until one day a post imploded killing him
08:32defncemerick: maybe i should post my nasty code and see what you all think :)
08:33cemericksure, but don't bother with lisppaste8, which is borked
08:34chouserif you use a regex literal in Clojure, it's precompiled.
08:35Licenser_defn: please :D
08:35defncemerick: err what i was saying was that I have something like this: (("hello cemerick" "oh hello george" "nice to see you" "does anyone know of?" "how many licks does it take to get to the center of a tootsie pop?") ("good morning" "good morning!" "LauJensen: check out this code http://www....&quot;))
08:35defnso it's not like " " * 15MB
08:35cemerickdefn: yeah, but that doesn't really matter perf-wise. regexes (as long as they're not pathological) run in linear time.
08:36cemericker, approximately linear time :-)
08:36psykoticback references are the only thing that require more than linear time
08:36defnhmph -- i dont know anything apparently! :)
08:36Licenser_cemerick: if you have things like *? it can get very slow
08:36chouserseveral common patterns can trigger backtracking
08:36psykoticLicenser: "it"? java's regex library?
08:36cemerickLicenser_, psykotic: for his use case, both of those are pathological; you wouldn't let external users submit arbitrary regexes
08:37cemerickI can't remember ever using *?, though :-)
08:37psykoticcemerick: yes, i was mere expanding on your comment re: linear time
08:37cemericksure, just clarifying :-)
08:37Licenser_what kind of regexps are you using exactly?
08:37psykotic*? is quite common
08:37psykoticfor example .*?<some suffix>
08:38defnLicenser_: #".*zipmap.*"
08:38psykoticdefn: don't do that...
08:38Licenser_defn: try #"zipmap" if that is faster
08:38psykoticthat will match the ENTIRE file
08:38psykotic(or the entire line if not in multiline mode i guess)
08:39psykoticany good regexp library will pull out a constant prefix and do boyer-moore string searches to find potential candidates
08:43Licenser_so precompiling the regexp does not seem tow work
08:44chouserin what way does it fail?
08:45defn http://gist.github.com/333921
08:45defnfeel free to tear me apart. Something is not right in the kingdom
08:45Licenser_chouser: as in speed
08:45Licenser_we don
08:45Licenser_'t tear you apart, we just eat your arms
08:46chouser,(or nil? "")
08:46clojurebot#<core$nil_QMARK___4328 clojure.core$nil_QMARK___4328@1551d55>
08:46chouser,(boolean (or nil? ""))
08:46clojurebottrue
08:46Licenser_flatten is in c.c.seq-utils :)
08:46defni..did not know that!
08:46defn:)
08:46chouserlooks like parse-irc-log will always return an empty sequence
08:46Licenser_I ran into that myself :)
08:47Licenser_chouser: don't you test if the nil? function exists there
08:47defnit did remove my ""'s, i threw the nil? in there for god know's why
08:47chouseryeah, but ... it does exist. I don't think that's what's intended.
08:47defni want to remove nils and ""s
08:48chousertry (remove empty? ...) instead
08:48defnbeautiful
08:48Licenser_:)
08:50Licenser_defn: try <.*?>
08:50Licenser_that might make it faster
08:50defnas in #"<.*?>"?
08:50Licenser_#".*<.*?>\s"
08:50Licenser_or even #".*?<.*?>\s"
08:51chouseror #"[^<]*<[^>]*>\s"
08:51defnwow okay, this is much better -- now if my print-length wasnt so tiny i could tell if i hit anything other than nil :)
08:53defnwhat's the harm in irc-parser> (remove nil? (map #(re-find #"zipmap" (str %)) parsed))
08:53defnthat seems to bring things to a stand-still
08:54chousermight just be working hard.
08:54defn4 cores and 8GB of RAM -- if I can't get some results in less than 60sec it's not useful to me either way
08:55defnbut still...
08:56Licenser_if you are looking for a substring there might be a function like pos
08:56Licenser_defn: on what kind of system do you work?
08:56defnOS-wise?
08:56Licenser_and you only use 1 core there ;)
08:56Licenser_I was wanting to ask how large is your dataset :P but I failed
08:57defnOSX, Linux, Windows with a gun to my head
08:58defnoh, it's like 12MB I believe
08:58Licenser_hmm taht isn't too much
08:59defnno it seems kind of silly im having these problems
08:59defni think there is something more fundamental I'm missing
08:59Licenser_is it possible to get a copy of the data? I am kind of curios to experiment :P
09:00defnsure, what's your email
09:00Licenser_heinz@licenser.net
09:00Licenser_also if try (def parsed (pmap flatten (map parse-irc-log (rest dates))))
09:01defnthe main issue seems to occur on: (map #(re-find #"zipmap" (str %)) parsed)
09:01fogusdefn: Me too if you please: http://fogus.me/images/addy.png
09:01Licenser_of cause since untill then no code is ever run
09:01Licenser_the maps are all lazy as hell and don't do a thing untill you actually access some
09:03defnLicenser_: yeah excellent point
09:03Licenser_so try to replace one of the maps with an pmap, as further out the better
09:03Licenser_then you might get a good performance boost from your 4 cores
09:03defn,(doc pmap)
09:03clojurebot"([f coll] [f coll & colls]); Like map, except f is applied in parallel. Semi-lazy in that the parallel computation stays ahead of the consumption, but doesn't realize the entire result unless required. Only useful for computationally intensive functions where the time of f dominates the coordination overhead."
09:04defnooohh!
09:04Licenser_pmap runs map just in paralell
09:05Licenser_clojurebot: can you tell where code is?
09:05clojurebotcode-review is <rhickey> yikes
09:06Licenser_no not exactly
09:06defn"You've got mail!"
09:06defn@fogus, Licenser_
09:06Licenser_I hope you compressed it ;)
09:06defntar.bz2
09:06defn:)
09:06Licenser_good good
09:07defnhopefully you get it -- im sending this via gmail which IIRC has a 10mb limit, but for some reason i remember they increased that
09:07defndue to...you know...microsoft word documents which are 20mb
09:07defn:)
09:08Licenser_did the pmap bring an improvement?
09:08defnI actually don't even get an error
09:08defnit just stops eval'ing and gives me an ;evalkuation aborted
09:09Licenser_oi
09:10defnwhich is russian i think maybe
09:10defn;)
09:11Licenser_I'll try it out once I get something
09:12defnmy client is still churning
09:12defnshould send any second hopefully
09:14defnokay i think it send
09:14defnsent*
09:16defnplease let me know if you received it
09:16defnif not i can put it on my website
09:16defnannnddd.... you didn't! file is too big for your mail provider. :)
09:17chouseroh, I'm sorry guys -- I haven't been paying attention
09:17chouserdefn: the url I sent you originally should still work.
09:18defnhttp://devinwalters.com/clojure-logs.tar.bz2
09:19defnchouser: i lost it somewhere over the last couple of days
09:21defnLicenser_: fogus: http://devinwalters.com/clojure-logs.tar.bz2
09:22Licenser_defn: :) thanks
09:22defnLicenser_: thank chouser. he's the magic man.
09:22Licenser_:D chouser you're incredible
09:39defnAnyway...
09:39Licenser_defn: what I mean is I don't understand what your code wants to know
09:40esjdefn: I know what you mean. Sadly I suck ever more at music.
09:45defnmy code wants to know the strings which contain mention of zipmap, across all of the lists of strings in the list
09:45Licenser_ah :)
09:45defnshould i chunk this?
09:45defnyou might be being too modest. id venture to guess you're better than me by a long intuitive shot at one or the other
09:45defnyou're either a natural born killer, or a hopeless romantic
09:45Licenser_defn: already the parsing stuff seems to take loong
09:45defnLicenser_: yeah, maybe it's the structure? would a vector or a set help?
09:45defnwould tagging each list of strings with metadata for "this list contains mention of such-and-such clojure.core functions..."
09:45defn(:defn :def :interleave ("blah" "foo" "bar"))
09:45Licenser_nah I am still trying to figure it out
09:45defnthat was my shot in the dark -- but "There's got to be a better way!"
09:45Licenser_defn: to me it seems that there is something fundamentally wrong
09:45defnnod
09:47defncould it be the (rest (re-split... ?
09:48Licenser_I am experimenting with chaning the read mode of files
09:50defnflatten practically triples the time to (parse-irc-log (nth dates 3))
09:50Licenser_I try this: (time (count (flatten parsed)))
09:51Licenser_flatten forces everything to evaluate, which in itself isn't bsad
09:51Licenser_bad
09:51defnyeah flatten is the problem here
09:51defni go from .280ms to 1.0msecs the first time i use flatten
09:52defnfor (parse-irc-log (nth dates 4))
09:52defnand that's a small log in comparison
09:54defn,(tree-seq seq? seq '((1 2 (3)) (4)))
09:54clojurebot(((1 2 (3)) (4)) (1 2 (3)) 1 2 (3) 3 (4) 4)
09:54Licenser_ouch user=> (time (count (flatten parsed)))
09:54Licenser_"Elapsed time: 307842.237 msecs"
09:57defnirc-parser> (time (second parsed))
09:57defn"Elapsed time: 0.108 msecs"
10:01defnso the structure actually looks like (((:1) (:2) (:3)) ((:4) (:5) (:6)))
10:01Licenser_user=> (time (count (flatten parsed)))
10:01Licenser_"Elapsed time: 28326.8943 msecs"
10:02defni wonder if this could be done with reduce, concat, or something like that
10:04defnpeek/pop?
10:05Licenser_brb
10:23esjConsider multimethods where you dispatch using isa? on a class hierarchy. If your specific instance is deep in the hierarchy, is there a way to invoke the dispatch methods for its parents, in the way of say "super" in ruby ?
10:23esjthere must be, but I'm having trouble figure out how :(
10:25esjso in the case of (eat my-creature) where type of my-creature is animal->fish->goldfish, i'd like to invoke animal.eat, fish.eat, goldfish.eat in that order (please excuse my OOPish notation)
10:27dnolenesj: you can get the method for a particular dispatch value
10:27dnolen,(doc get-method)
10:27clojurebot"([multifn dispatch-val]); Given a multimethod and a dispatch value, returns the dispatch fn that would apply to that value, or nil if none apply and no default"
10:28esjaaah, then I construct it manually.
10:28dnolenyeah, you'll have to implement something like super yourself, not difficult.
10:28esjok, I get it, thanks dnolen.
10:29dnolensuper also doesn't always make sense since you can have multiple parents
10:29esjyeah, I'lll have to be a bit careful
10:35defnyou could maybe (let [parent-a (fn inner-fn) parent-b (fn inner-fn-two)] ...)
10:35defnso you scope your parents
10:35defn(does that make sense? i dont usually know what im talking about)
10:36Licenser_defn: look at this
10:36Licenser_http://gist.github.com/334024
10:37defnhaha! that's cool
10:37Licenser_it still is waaaay too slow for big data so :()
10:38defnwe'll find a way
10:38defnmy structure is wrong -- i think that re-split sets me up for failure
10:38Licenser_but I'm below one minute :)
10:38Licenser_ (time (count (find-lines "zipmap")))
10:38Licenser_"Elapsed time: 45084.3956 msecs"
10:38defnnot bad!
10:38defnsee im actually find with this
10:38defnbecause id like to build metadata for each log
10:38Licenser_I wonder if pmap does a big improvement here :)
10:39Licenser_no not exactlyu
10:40ordnungswidrigI'd guess the execution is more io bound than cpu bound, right?
10:40Licenser_ah problem is lazyness kilsl pmap
10:40dnolendefn: or if you just dumped your data into CouchDB and used CouchDB-Lucene you could probably get all matches in like 400ms ;)
10:40Licenser_dnolen: pssst!
10:40Licenser_it's about making it good!
10:40Licenser_(time (count (find-lines "zipmap")))
10:40Licenser_"Elapsed time: 20181.8055 msecs"
10:40Licenser_:D 20s
10:40defn:)
10:40Licenser_second run aka java warmup
10:41defnLicenser_: I respect you, sir.
10:41Licenser_and likely IO cache of the OS
10:41defnWhy does laziness kill pmap?
10:41Licenser_I think to think that the pmap is killed since I got only one CPU used
10:41Licenser_defn: this is on a 1.6 GHz system, you'll likely get < 10
10:43Licenser_http://gist.github.com/334024 <- the updated code
10:43remleduffHas anyone had leiningen crash for them on Windows if they don't delete -Xbootclasspath/a:"%CLOJURE_JAR%" from the bat file?
10:43remleduffIt works fine on my other Windows box, but not this one
10:44defnLicenser_: Hm, I'm not able to get it to work here
10:44Licenser_oi?
10:45Licenser_likely the file path of dates is different for you?
10:45Licenser_I had to change that
10:45defnyeah i edited that
10:45Licenser_okay
10:45defnbut im restarting the repl one sec
10:49defnUnable to resolve symbol: reader in this context
10:50defnoh duh, nvm
10:50dnolenLicenser_: nice your code take < 5s on my machine.
10:50Licenser_:D
10:50Licenser_huzza!
10:51Licenser_thanks dnolen
10:56defnlol gahhh
10:56defn.#irc-parser.clj
10:56defnit keeps trying to find that tmp file i have open lol
10:57chouseryou guys do know I have code that parses those files, right? it's on github.
10:57chouseryou guys do know I have code that parses those files, right? it's on github.
10:57chouserit doesn't do search or indexing, but my have some useful regex snippets
10:57Licenser_chouser: that doesn't matter it's about the sport!
10:58Licenser_at least for me it is
10:58chouserheh, ok good enough.
10:58chouserI mean, I understand, just didn't want anyone to be unaware of a resource that might be useful.
10:58LauJensenchouser: Is that what you call an oxymoron? "useful regex"
10:58defnchouser: actually i didnt know that, but either way it's fun to do a little snipe hunting
10:58chouserwell, I parse those raw text logs to generate the .html
11:00chouserhttp://github.com/Chouser/clojure-irc-log/blob/master/irc-log-to-html.clj
11:00chouserugh. I really need to convert that to use enlive or something.
11:04Licenser_I am really scared that a short ruby snipped I wrote for the same code A) finds 10 lines more and B) takes 50% of the time
11:07Licenser_and neither ruby nor clojure outputs the same as grep :P
11:07Licenser_which of cause only takes 0.5 seconds to run
11:07Licenser_so something is very wrong here
11:08Licenser_I mean 100 times slower then grep is bad <tm>
11:10Licenser_this is horrible
11:14Licenser_anyone any idea how that comes?
11:15Licenser_i mean it is scarry, I'm doing something wrong
11:16chousersame performance considerations as always. Just read chapter 10 of Joy of Clojure ... once fogus has written it of course.
11:17fogusMan I will love that chapter
11:17chouser*warn-on-reflection*, profile the code ...
11:17chouserbbl
11:18stuartsierraThe Apress book will have a whole chapter on performance too.
11:18Licenser_I mean I tried to do things good here but it does not help :(
11:18Licenser_and no reflections as it seems
11:19eevar2Licenser_: and no matter what, you'll never match grep for speed
11:19Licenser_(binding [*warn-on-reflection* true] (time (count (find-lines "zipmap")))) ;=> no warnings
11:19stuartsierraIt doesn't work that way.
11:19stuartsierraCall (set! *warn-on-reflection* true) at the top of your source file and reload.
11:19Licenser_eevar2: I know, I don't want to be as as grep BUT I don't want to be twice as slow as ruby :P
11:19Licenser_oh
11:19fogusstuartsierra: I'm excited that you're working on the book. Can't wait to read it.
11:20Licenser_someone over at clojure.de will; have a german book too :d
11:20stuartsierrafogus: Thanks. I wish I could get an updated PDF with my contributions, but Apress has ignored my requests so far.
11:20Licenser_geez i'll get poor this year
11:21fogusstuartsierra: We're having a similar conundrum
11:22psykotici've only heard bad things about working with apress from the author side.
11:23fogusI can't say that our (my) experience has been bad... only that our idea of the ideal release frequency of new material differs from our publisher
11:23Licenser_wow some type hints do wonders
11:23Licenser_1/4th of the time
11:24Licenser_now twice as fast as ruby, that is something that gets in the right direction
11:24Licenser_and only 20 times slower then grep
11:24dnolenLicenser_: there's a lot of laziness in your solution. But it's beautifully elegant. You can make it blazingly fast but you're probably going to have to move to explicit loop/recur, type-hinting, and Java methods. The question is how much do you care? :) If you can't make it 50X faster I
11:24dnolen'd be surprised
11:25Licenser_dnolen: it's for the sports ;)
11:26Licenser_I want to see what I can do
11:27dnolenWhen Uncle Bob complained about Clojure convex hull taking 25s, I came up with a real nasty piece of unsafe single-threaded optimization that did it ~500ms. Then I got bored with optimizing silly programs. But it is a good learning experience. I'd rather rhickey solve those problems for me tho :D
11:28psykoticdnolen: he complained in a blog post? got a link?
11:28Licenser_dnolen: I agree, I like the solution I posted, it is as you say, nice and elegant, but I want to see how much effort it takes to make it fast :P
11:29Licenser_I'm down to 10s on you rsystem it will be <1 now I think
11:29Licenser_with only two type hints
11:29dnolenpsykotic: checking
11:30dnolenpsykotic: http://blog.objectmentor.com/articles/2009/08/11/jarvis-march-in-clojure
11:31dnolenpsykotic: and my type-hinted everything inlined via macros mutable optimization, http://github.com/swannodette/convex-hull/blob/master/convex_hull.clj
11:31psykoticthanks
11:32psykotic,(< [1 2] [2 2])
11:32clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Number
11:32psykoticthat's silly
11:32psykotici just noticed his point-min. it's silly to have to implement lexicographic comparisons on sequences manually.
11:32psykoticeven python offers that by default.
11:33Licenser_http://gist.github.com/334097 < slightly optimized version
11:33psykotichopefully with protocols we can have smarter generic primitives like that without hurting performance on average.
11:34Licenser_down to 8s :D
11:35stuartsierrapsykotic: I think that's a major goal of protocols
11:35stuartsierraWon't happen overnight though.
11:35psykoticstuartsierra: alas :)
11:35psykoticit's one of my few pet peeves with clojure currently. will be glad to see that happen.
11:35Licenser_defn: if you want look at the new paste it is a good bit faster now
11:36dnolenLicenser_: ~50-60ms for me.
11:36dnolener
11:36dnolenoops
11:38psykoticdnolen: i just looked at your code. my eyes! the goggles, they do nothing! :)
11:38dnolenLicenser_: ~200-250ms for me now.
11:38dnolenpyskotic: it's awful and evil yes.
11:39Licenser_dnolen: nice :D
11:40dnolenpsykotic: it made more sense to just call into Java at that point. The java was still 4x-5x faster. And I don't think that algorithm can be made parallel so nothing to gain there.
11:41psykoticfwiw, the quickhull algorithm has an obvious opportunity for parallelism
11:41psykoticit has a straightforward fork/join structure
11:42dnolenpyskotic: Hmm, I couldn't figure it out. You need to create a linked list of all the previous points to figure out the next one. Perhaps misunderstood the algorithm. Do you have a link to parallel version?
11:49psykoticdnolen: i meant quickhull, not jarvis march.
11:49psykoticanyway i have to run to bed. btw, i'd love to see his code test repeated with -server and escape detection, and a one-minute warm-up.
12:17caljunior2braindead java api interop question alert: I'm trying to call a java method with two arguments and no class or instance: crack(message sessionID). This what I do: (.crack message sessionID). I'm doing this within a proxy extending a MessageCracker class and it compiles fine. When I send a message I get an exception: "no matching method found for class".
12:17caljunior2anything obvious I'm missing?
12:18caljunior2(except for a brain of course) :-)
12:18dakronecaljunior2: did you try (.crack this message sessionID) ?
12:18dakroneyour example is equivalent to message.crack(sessionID)
12:18caljunior2no
12:20caljunior2dakrone: seems to work. thanks!
12:20dakronecaljunior2: no problem, good luck!
12:37caljunior2how can I override proxy methods without having to restart an application?
12:40arohnercaljunior: can you re-def the functions you passed to proxy?
12:40Chousukethere are some lower-level functions for editing proxies but I'm not sure how to use them
12:40Chousukesearch the documentation
12:42dakrone,(doc update-proxy)
12:42clojurebot"([proxy mappings]); Takes a proxy instance and a map of strings (which must correspond to methods of the proxy superclass/superinterfaces) to fns (which must take arguments matching the corresponding method, plus an additional (explicit) first arg corresponding to this, and updates (via assoc) the proxy's fn map. nil can be passed instead of a fn, in which case the corresponding method will revert to the default behavior.
12:43arohnerwow that's cool
12:43caljunior2drakone: thanks again!
12:47arohnerI want xpath for clojure maps
12:47dakronearohner: what do you mean by that?
12:48arohnerI have a tree of clojure maps that I need to transform. I'm getting tired of writing recursive reduces. I'm looking for a better abstraction
12:48arohnerI think something like xpath, that can also update nodes, would work well
12:49arohnerI wrote this http://gist.github.com/334206 a few weeks ago
12:49arohnerso now I'm writing get-in-many, but I just realized the solution should be more general
12:50dakroneyea, if you generalized it, could make a nice library
12:50arohnerdakrone: I should probably release my other libraries before I start another :-)
12:50dakronewell, that's true
12:50arohnerI have an ORM that I'm going to release soon
12:51dakronedoesn't mapping objects to things kind of defeat functional data structures?
12:52arohnernot really
12:52dakroneokay, how's it work?
12:52arohnerthink of it as sugar for pulling trees of clojure maps out of a DB
12:52dakroneokay, sounds like it could be useful
12:52arohnerlike a 'normal' ORM, except all the rows are clojure maps
12:52dakroneSQL or NoSQL DBs?
12:53arohnerSQL. Right now it's only tested against postgres
12:53dakronehow are you storing the maps? serializing them?
12:53dakroneJSON?
12:53arohnerin normal DB columns
12:53arohnera row == a clojure map
12:54dakroneoh okay, you're not storing them in trees then?
12:54arohnerno
12:54Licenser_I found json very slow, is that an impression only I have or is that a known fact
12:54Licenser_?
12:54arohnerbut there's good association support, and you can pull trees out, by loading associations
12:54arohner(foo/find-one :where {:id 10} :load [:bar {:baz :qux}}])
12:54dakroneoh okay
12:55dakroneLicenser_: in my experiences, JSON can be pretty fast
12:55arohneryou define tables, and define associations between tables
12:56noidiis there a function like update-in, but that takes many key/fn pairs?
12:56arohnerso that load says 'return a :foo, and load the :bar association. load the :baz association on foo, and load :qux on baz'
12:56Licenser_hmm I found writing it horribly slow as in slow to cry
12:56noidilike (update-in [:foo] update-foo [:bar :baz] update-baz)
12:56noidioops
12:56dakroneLicenser_: maybe it's the particular json library you were using?
12:56noidi(update-in my-map [:foo] update-foo [:bar :baz] update-baz)
12:56Licenser_dakrone: the default clojure one
12:58dakroneLicenser_: http://gist.github.com/316675
12:58dakroneLicenser_: looks like you might want to check out clj-json
12:58hiredmannoidi: you can use -> for that
12:59Licenser_dakrone: thanks for the advice
12:59hiredman,(-> {:a 1 :b 2} (update-in [:a] inc) (update-in [:b] dec))
12:59clojurebot{:a 2, :b 1}
13:00noidihiredman, that's what I'm using now
13:00noidibut thanks
13:03noidiI'll guess I'll have to write update-in* (for lack of a better name) to get rid of repeating (update-in)
13:03Licenser_so got to got for a bit dakrone I'll try that out thanks
13:04dakroneno problem, good luck
13:06hiredman,(reduce (fn [m [p f]] (update-in m p f)) {:a 1 :b 2} {[:a] inc [:b] dec})
13:06clojurebot{:a 2, :b 1}
13:07noidihiredman, heh, that's almost identical to my version :)
13:08crowb4rI love irssi and screen. :)
13:08crowb4rme == to crowbar7
13:24dakrone<3 leiningen
13:24dakroneinstalled lein, did a lein new, symlinked the classes and libs from a giant enterprise java app, lein repl and hurray debugging REPL
13:31polypus~ping
13:31clojurebotPONG!
13:32polypuswhat's the best deftype/defptrotocol doc around right now?
13:32polypus*proto
13:32psykotici don't think you have much to pick from :)
13:32psykoticthe assembla one is outdated in some ways
13:32psykotici'd suggest looking at the source code, which isn't much to go through
13:32polypusk, ty
13:45psykoticrhickey: i noticed that deftype fields with non-primitive type hints generate Object-typed fields rather than the specified types. is that intended behavior?
13:49Chousukeargghfjkj
13:50ChousukeI posted a reply to the monad question and of COURSE my post gets lost somehow
13:51psykoticspeaking of which, i can't remember if i posted my monad code, which uses an alternative implementation method (no symbol macros, for one)
13:51ChousukeI wrote one that uses protocols :D
13:52psykotichttp://gist.github.com/331761
13:52Chousukehttp://gist.github.com/312281
13:53Chousukerather hacky, but it seems to work
13:54psykoticisn't the dynamic binding dangerous if you combine it with lazy sequences?
13:54psykotici decided to use explicit dictionary passing (but hidden away)
13:54Chousukeit is, yes.
13:54Chousukebut it was fun to write
13:54psykotic:)
13:54psykoticthe best reason!
13:55ChousukeI still don't know how I managed to write that lift function
13:55ChousukeI think it works on functions of arbitrary arity.
13:57psykoticyeah, i can't see why that would be difficult? you just create a var-args wrapper that reduces with 'bind' over the monadic arguments.
13:58psykoticbtw, something that felt out of the way i implemented my >> is that the identity monad is actually useful :)
13:58psykotic*fell out
13:59psykotic(run-identity (>>= 42 (- % 2) (* % %)))
13:59psykoticof course, you could easily implement that as a separate macro a la ->/->> that won't require an explicit run-identity
14:05S11001001Is there a way to make clojure.core/compile *not* compile files required in the file whose compilation was directly requested?
14:08cemerickS11001001: unfortunately not at the moment
14:10chouser(binding [*compile-files* nil] (require '...)) doesn't work?
14:10hiredmanbinding is runtime
14:12cemerickIt's definitely worth an enhancement to the compiler to support both modes -- recursive compilation and only those ns' explicitly named.
14:13chouserit works
14:13cemerickpsykotic: as Chousuke said, yes it is. http://muckandbrass.com/web/x/m4BJ
14:14chouserif your only (require 'foo.bar) is wrapped in binding *compile-files* to nil, then foo.bar will not be compiled.
14:14cemerickchouser: oh, right, if the binding is a top level, then compile-time is runtime.
14:15chousersomething like that. :-)
14:15cemerick'course, it's sad to have to put binding around every ns decl that you might AOT compile.
14:15chousercompile-time vs. run-time is really for each top-level form individually.
14:17chouserread-time too, I believe. a top-level form is read, analyzed, byte-code emitted, (saved to a .class file if *comiple-files*), loaded, called, and then the process repeats with the next top-level form.
14:18chousercemerick: right -- it'd be interesting to have it as a flag or something.
14:26LauJensencemerick: Your site has been down recently hasn't it ?
14:26cemerickLauJensen: what, the blog? Not that I know of...
14:26LauJensencemerick: I've been getting a database error of some sort when accessing it earlier today
14:27cemerickhrm, that's no good
14:27LauJensenSomething about concurrent connections and a support link
14:27cemericknothing showing on the monitoring :-/
14:27LauJensenOh its fixed now I see
14:35S11001001chouser: that's how compile is currently implemented (1.1.0), essentially
14:35S11001001oh, that's not what you were saying
14:36chouserS11001001: you see how to solve your immediate problem?
14:36chousernot pretty I admit, but seems to work.
14:38cemerickit shouldn't actually be a problem, just a matter of bloating one's jar/distribution
14:38S11001001I would rather just keep compiling the extras until something better comes along
14:44chouseror pinning a jar to particular compile-time behavior you don't want
14:44chouserbuy yeah, if it's just a matter of .jar bloat, probably not worth the effort.
14:47Licenseraloa
14:47S11001001I'm putting together trees of dependencies in Leiningen, and :excludes doesn't really do what you want if the jar includes classes of the thing you're trying to exclude :)
14:48S11001001or the version clash resolution (shallowest wins) for that matter
15:00duncanmhmm, when i use slime on mac os x (gnu emacs), i don't see a *slime-repl* buffer
15:00duncanmi just get the *inferior-lisp* buffer
15:02drewryour swank process isn't getting synced up properly
15:02drewrdo you see an exception in *inferior-lisp*?
15:10LauJensenI blogged, help make this better: http://www.bestinclass.dk/index.php/2010/03/clojure-ides-the-grand-tour-getting-started/
15:16technomancyLauJensen: looks good; seems to be pretty fair
15:17technomancyI wish you didn't have to paste that big blob of elisp to install package.el, but until it's merged to Emacs trunk it's a necessary evil.
15:17technomancyon the bright side I think it's going to be merged soon
15:17LauJensenReally? :)
15:17LauJensenI'll believe it when I see it
15:18technomancyI have it on good authority (Stefan) that only one feature is blocking its inclusion.
15:18LauJensenGreat
15:18LauJensenWould also be nice to see the amount of well maintained packages grow
15:18technomancyyeah
15:19technomancyLauJensen: also: under the Emacs section what about making "git" link to this page? http://alexvollmer.com/posts/2009/01/18/meet-magit/
15:19LauJensenHmm - Isn't Magit tricky for newcomers? Compared to Egg I mean
15:19LauJensenEgg is lacking in features, but those that are, are well documented
15:19cemerickLauJensen: are you moderating comments?
15:19LauJensenBut ok, the docs are great for magit as well
15:19technomancyI think they are pretty close, but the screencast is pretty thorough
15:19Chousukeegg is pretty much abandoned though :/
15:20LauJensencemerick: Yea I approve all first-time commentators
15:20cemerickah, ok. Glad it didn't drift out of the ether.
15:20LauJensen(there's nothing from you though)
15:20cemerickugh
15:20dakroneLauJensen: oh hey, thanks for the shout out on your post :)
15:21LauJensendakrone: I shouted? :)
15:21cemerickLauJensen: I'm anchored to comment 2193. No good, eh?
15:21dakroneMention? :)
15:21LauJensendakrone: Who are you ?
15:21fliebelWhat is the difference between Eclipse and Intellij?
15:22LauJensencemerick: No, I dont know whats going on - once you succesfully comment I think you actually see the comment, but with a flag that its awaiting moderation
15:22dakroneLauJensen: I write the writequit.org stuff
15:22cemerickbummer. I'll rewrite, I guess.
15:22LauJensendakrone: Ahhh, then I'm the one thanking you, great blogpost you did
15:22LauJensencemerick: Put it in the clipboard, if its a system error I'll deal with it immediately
15:22LauJensen(just so it doesnt get lost again)
15:23technomancythat's prompt service for you! =)
15:23dakroneLauJensen: thanks! Yours was the one that inspired it, so I should be thanking you
15:25LauJensen:)
15:26cemerickLauJensen: attempt #2 submitted, FWIW
15:26cemerickin the clipboard this time, too :-)
15:26psykoticLauJensen: btw, i just saw your post on emacs yesterday. re: color-themes, the one thing vim has on emacs is that the aesthetics of the available themes tends to be much higher. inkpot and so on.
15:27psykoticLauJensen: i have a hacked up color-themes-vim.el i did that uses regexp hacks to parse vim themes though, maybe i'll clean it up and gist it tomorrow, if you want it
15:27LauJensencemerick: If you didn't submit as "Arthur" then I think it got lost, and it might be a local problem, since it just worked for someone else
15:28cemerickheh, no, I'm not arthur
15:28LauJensenAnd Phil just ranted as well :)
15:28LauJensenpsykotic: sounds great - and you dont get any argument from Vim, Emacs has many painful color combinations
15:29mabesfor those of of you with a production clojure (compojure in my case) webapp/service what is your preferred form of deployment/serving?
15:29mabesI've been considering glassfish, but more recently I am leaning towards embedded jetty and having nginx reverse proxy to it.
15:34psykoticLauJensen: in your disparaging comments about vim yesterday. remember, it isn't just a text editor. in fact, it mainly does music: http://www.dina.kvl.dk/~abraham/religion/vi-music :)
15:34LauJensenmabes: Haven't tried Glassfish, but I can vouch for the nginx combo
15:35mabesLauJensen: cool.. seems like a nice simple solution. How do you handle deploys/restarts? I'm thinking of wrapping the embedded apps in monit..
15:36LauJensenHaven't tried that
15:37LauJensenpsykotic: Man that link was awfully boring, beep mode...
15:43woobyLauJensen, sweet post on IDEs!
15:43LauJensenThanks :)
15:44dnolenLauJensen: very nice
15:44woobyi'd be curious, do the visual ide plugins use that IDE's project format or do any of them do lein integration?
15:45dnolenwooby: I saw a recent Lein commit that allows Enclojure to open Lein projects. So hopefully that's just around the corner.
15:45woobydnolen, awesome i'll keep an eye out, thanks
15:46bobo_http://gist.github.com/334417 i dont get it. if i uncomment the redirect, the session doesnt get the login and uid values?
15:46bobo_but without the redirect, it works
15:47technomancywooby: yeah, stuart H added that last night
15:47technomancyjust dump the pom with "lein pom" and you can start a new enclojure, etc. project
15:47dnolentechnomancy: looks like some sweet stuff is in the pipeline for lein, swank-clojure, clojure-mode, et. al.
15:48technomancydnolen: hugod has some awesome swank features coming
15:48dnolenahh how I miss the old days where I had to hack in macro-expansion myself ... not.
15:48Chousukebobo_: my brain keeps telling me it's because session-assoc's return value is not actually stored anywhere, but I suppose it's an evil function that has side-effects.
15:49technomancythe new leiningen features won't be interesting unless you've got several projects that you want to be able to hack simultaneously. it's useful for larger projects, but still kind of edge-casey
15:49bobo_Chousuke: but if i dont redirect, i can navigate to the page later and the session has the correct values?
15:49radstechnomancy: how do you make a leiningen task that uses project files from the classpath? write it as a plugin?
15:50technomancyrads: were you the one asking about that yesterday? I noticed the classpath wasn't set up to find lein tasks in src like you mentioned
15:50technomancyso I fixed it
15:50radsyeah, I missed your response though
15:51technomancyoh, I didn't fix it until much later, so I didn't mention it on IRC
15:51bobo_ah, if i use [] instead of (do ) it works
15:51technomancybut yeah, in general a plugin is better unless the task would never useful for other projects.
15:51cemerickwooby: all of the major IDEs have excellent maven integration, so you could use clojure-maven-plugin and slip right into that.
15:52radstechnomancy: in my case it's project specific. good to see that it's fixed now
15:53Chousukebobo_: huh? so you need to return a seq of values? :/
15:53Chousukebobo_: that sounds weird
15:53Chousukebobo_: unless session-assoc is really a true function and the return value protocol is just something funky :)
15:54bobo_session-assoc is something in compojure
15:54Chousukeyeah
15:54bobo_i think it does alter session in a transaction or something similar
15:57bobo_hm, it is called by the http get, i guess that needs to recieve it.
15:59Chousukebobo_: ah, no, I don't think it does that
16:00Chousukebobo_: I found documentation that says (about the return values of handler functions) that if the return value is a vector, each value in the vector is used to update the response map
16:01Chousukeso session-assoc returns an updated session value, and the redirect yet more updates, and because they are returned in a vector, they get merged to the final response map
16:01DeusExPikachuanyone going to the talk in Reston, VA?
16:01DeusExPikachutomorrow
16:02LauJensenOn a positive note I did a talk yesterday which was announced less than 1 month ago, and about 30 people (only 1 with Clojure experience) showed up to learn about, so that was suprising
16:03LauJensenabout+it
16:03technomancyhttp://p.hagelb.org/thomas.html <= new toy, enjoy. (test-coverage report in 25 lines, name is still tentative)
16:04wthiddenanyone here use clojure to connect to dbus?
16:04chouserI have
16:04chouserit wasn't pretty
16:04wthiddenany luck with removing a sig handler?
16:04wthiddenonce it was added?
16:04chouserhm ... I don't think I tried that.
16:05DeusExPikachurhickey and Stu Halloway are supposed to be at the talk tomorrow
16:05cemericktechnomancy: heh, that's great :-)
16:05hiredmancemerick: any blog posts for starting a project with the clojure maven plugin?
16:05wthiddeni've been using the freedktop dbus java implementation.
16:06wthiddenand most of the stuff works, except I can't remove a sig handler.
16:06dnolentechnomancy: you generated that from emacs right? how did you do that? (also what color theme is that? very nice)
16:06cemerickhiredman: I keep getting that request :-) Maybe this week, depending on how much downtime I get while in NYC.
16:07cemerickhiredman: until then, the pom here is pretty straightforward: http://github.com/talios/clojure-maven-example
16:07cemerickThere's a lot more in the config than is necessary to get started, tho. :-/
16:08cemerickbleh, and the groupId and version isn't right for the plugin. A lot has changed since August.
16:08cemerickhiredman: so, I guess, nevermind that until I post something.
16:08hiredmanhappens
16:09hiredmanI guess I should fine a maven blog post too
16:09Licenserevening hiredman :)
16:10cemerickhiredman: if you really, really want to understand what's going on, the book is the way to go. It's pretty straightforward to pick and choose the material to read as you go along.
16:11hiredmanLicenser: hello
16:11Licenser:)
16:11chouserok, so now ring is installing again. but ... the classpath to use it is going to be atrocious, isn't it.
16:11cemerickhiredman: that is, http://www.sonatype.com/products/maven/documentation/book-defguide
16:11chouserhm -- maybe I should build an uberjar and use that
16:11cemerickoh, and they've split it up now, that's nice
16:11hiredmanright, this is the one that has the oreilly cover?
16:12cemerickhiredman: yeah, but the material has been improved significantly since that publishing. Looks like they're going through lulu now.
16:13cemerickit's all free online, in HTML or PDF *shrug*
16:13hiredmanmmm pdf
16:14bobo_Chousuke: ah, i think i understand then!
16:14cemerickhiredman: oh yeah, full-text-searching goodness. :-)
16:15bobo_thanks alot
16:28technomancydnolen: that's scpaste: http://p.hagelb.org
16:29dnolentechnomancy: nice thx
16:29technomancyfn-level coverage isn't as interesting as branch-level, but it's a lot less invasive
16:42defntechnomancy|away: i like the name "Thomas"
16:42etatehmm, i'm beginning to thread state through functions using maps, along functions that apply to those maps in a succession of "processing" functions, is this basically how monads work or am i confused?
16:43defnwhat's the old haskell monad joke?
16:43defn"Have you read *all* of the monad tutorials?"
16:43defnsomething along those lines
16:43etatelol
16:43technomancydefn: Thomas is from here: http://en.wikipedia.org/wiki/The_Protomen#Story
16:43etatei've just read a clojure monad tutorial, a lil
16:44defntechnomancy: cool!
16:44Chousukeetate: monads can abstract away threading the state, yes.
16:44technomancyif I release it as Thomas, maybe the groupId will be thomas-light-phd
16:45defntechnomancy: For some reason I find "dignified" sounding names make good project names for clojure
16:45Chousukeetate: if contrib monads are too much for you, you can write your own monad infrastructure just for those "stateful" functions. it's not difficult
16:45technomancydefn: generally I take my project names from literature, but I felt I could make an exception for the Protomen
16:45defnlike "Terrence", "Thomas", "Frederick"
16:45etateChousuke: but if you abstract away the state from this you just get 'let-monad'
16:46etateChousuke: sure but are they necessary if let is essentially a monad anyway?
16:46technomancyI am still waiting to start a project awesome enough for me to name it Thursday: http://en.wikipedia.org/wiki/The_Man_Who_Was_Thursday
16:46technomancyperhaps it's vain of me to ever think I will.
16:47LauJensenWhats the fn which shows me where some other fn is defined?
16:47Chousukeetate: I'm not following
16:47etateLauJensen: M-.
16:47hiredmanLauJensen: it's in the metadata on vars
16:47defntechnomancy: technomancy :)
16:47Chousukeetate: let is a monad, but it's fixed in clojure. you can't change the monad it operates under
16:47hiredman,(meta #'+)
16:47clojurebot{:ns #<Namespace clojure.core>, :name +, :file "clojure/core.clj", :line 676, :arglists ([] [x] [x y] [x y & more]), :inline-arities #{2}, :inline #<core$_PLUS___4516 clojure.core$_PLUS___4516@7acb6f>, :doc "Returns the sum of nums. (+) returns 0."}
16:47LauJensenwoa, ERC just wnet nuts
16:48etateChousuke: why would you want to change the monad under let?
16:48Chousukehm, that's somewhat inaccurate
16:48LauJensenThis was a question for #emacs :)
16:48ska2342technomancy: beware, modern times may break your hinted reference: http://thursdaynext.com/
16:48defntechnomancy: ive always wanted to make a "braille" project, but one piece of the puzzle never works
16:48Chousukeetate: hm, I think this line of thinking will lead to a dead end
16:49technomancyska2342: oh snap! I read the first of those books and it was fun, but not nearly as awesome as Chesterton's Thusday
16:49etateChousuke: I'm just trying to work out how monads fit in clojure because its confusing :)
16:49Chousukeetate: so let's restart: basically, the way I see monads is that if something is monadic, it has certain composition behaviour
16:49etateChousuke: like threading state & function through a let?
16:50hiredmanthat is almost the deffinition of a monad
16:50ska2342techomancy: read the rest, it get weirder and weirder. I enjoyed it. But when I'm done writing my book I may consider reading the one you pointed out :-)
16:50Chousukeetate: functions are monadic, and their composition is simple. but operations under the maybe monad are composed differently
16:50Chousukeetate: and similarly, operations in the state monad are composed by threading the state through them
16:51etateChousuke: oh i see, so the maybe monad has a different combinator?
16:51hiredmanfunctions are monads with comp and identity
16:51ska2342technomancy: whoa a new fforde came out and I managed to miss it til today?!
16:51Chousukeetate: the big thing with monads is realising that all kinds of composition can be expressed with a few generic functions, and the specific functions determine how operations are composed.
16:52Chousukethe specific implementations of those functions, I mean
16:52etatei think my mind just imploded
16:53Chousukeetate: to bend your mind even further, some operations are composable under different monads, yielding a different composite operation
16:53hiredmanhttp://channel9.msdn.com/shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads/ this is a very nice video
16:54etateman, and there was I calling everything composite in the code
16:56Chousukednolen: if there are any two operations that you can't compose by simple function composition, monads might help you
16:56etateChousuke: so a function would be a state monad if it took values and yielded a composite operation with a snapshot of immutable state?
16:57hiredmanthe video is good
16:57hiredmanI haven't explicitly used a monad anywhere
16:58LicenserI only have sound here
16:58hiredmanLicenser: you can download the video in various formats
16:58Chousukeetate: a value of a state monad is a function (state -> a). if you call it with a state, you get a plain value back
16:58hiredmanmp4, wmv
16:58Licenserahhha
16:59serabehi
16:59LicenserI really started to love LISPish things
17:00dnolenChousuke: I mean get that, but where is that useful in Clojure?
17:01Licenseraha I found it
17:01etatei'm starting to think clojure is just a set of monads :D
17:01Chousukednolen: that's a good question. I wrote a stateless monadic parser for some ascii codes as an exercise a while back. It made the code clearer because there was less boilerplate :)
17:02hiredmanfnparse uses the monad stuff from contrib under the hood
17:02Chousukednolen: there's nothing you can't do without monads in clojure, but to say they're useless is just not giving the concept enough credit.
17:03hiredmandnolen: I think the main benefit is having clear composition
17:03dnolenChousuke: no no. wasn't saying that. yes monads sound good for parsing. It's just that I don't see their utitlity in an impure functional PL like Clojure.
17:03serabehave a problem with proxy method and a JComponent, anybody could help, please?
17:03dnolenutility -> general utility
17:04dnolenHaskell needs em cause you can't write real damn program w/o them.
17:04Chousukednolen: for example, suppose you're writing a game that has AI agents that can perform actions. but if they wish to perform two actions in a row, some intermediate code is needed as "plumbing" to combine the actions. It sound monadic to me
17:04spreadsheetHi Chousuke
17:04hiredmandnolen: that is a big use in haskell, but really monads are about controling composition
17:05hiredmanin the case of the IO monad controling the composition of IO operations to perserve order
17:17defni really wish there was some documentation for compojure
17:17defnlike...actual documentation as opposed to dated blog posts and WIP documentation
17:18defnconjure has an absolutely stunning amount of documentation
17:18defnbut it's not quite what i was looking for
17:19hiredmancompojure is still changing rapidly
17:19hiredmanwell, relatively rapidly
17:19defn*nod* i suppose that'd be silly to document, only to redo it every few weeks
17:19defnstill, would be nice
17:20hiredmanyes, I think your best bet is #compojure + the mailing list
17:20dnolendefn: well, it is versioned it would be nice if there was documentation at least for 0.3.2. after 0.4 compojure looks like it will probably settle down since it's attacking a very limited "surface area" now.
17:21defndnolen: good point
17:22dnolendefn: the main thing to realize is that compojure hardly does anything. minimal is an understatement.
17:22dnolenwhich is nice.
17:22chouserand yet ... compojure is built on ring, and I'm using a subset of ring's features...
17:30alexykI want to keep outputting strings to a text file, is duck streams the thing to use? when do you NOT want to use them?
17:33dnolenalexyk: duck streams is definitely one way to do it.
17:33alexykdnolen: btw loved your Enlive tutorial. Am going through it.
17:35dnolenalexyk: glad to hear it! I'm just the messenger. props to cgrand mostly.
17:35alexykdnolen: so, is Enlive a stand-alone thing, or does it use Compojure in any way?
17:36dnolenalexky: completely stand alone. Christophe Grand wrote it, http://github.com/cgrand/enlive
17:38alexykdnolen: can you create fast static pages in Enlive, or is it always populated from a database or something? How can you run it on a high-traffic site, if at all?
17:39dnolenalexky: I've done some unscientific tests and it's seems performant compared to other popularing templating engines. I imagine for heavily trafficked you'll need some kind of caching strategy as usual.
17:39remleduffIsn't enlive often or usually used on top of compojure though?
17:41dnolenremleduff: you can use it to transform un-namespaced XML as well. I know cgrand is thinking about adding xml namespace support at some point. I used it to manipulate Amazon Web Service results, it was great for that.
17:42alexykso I want to run a simple site with mostly static tables, think puzzles, and results kept in postgres. Can enlive do that? Do I run it stand-alone, in Apache, Tomcat, or what?
17:43hiredmanenlive doesn't serve html
17:43dakronehmm, if I pass a clojure-vector into a java function that takes a Java Vector, will it be able to coerce it without a problem?
17:43hiredman:(
17:43hiredmanno
17:43hiredmanjava Vectors are old and horrible and not to be used
17:43dakronenot my library, I'll have to create one first then
17:43hiredmanno connection to the clojure vectors
17:44hiredmandakrone: I think java's Vector was retrofited with Collections stuff
17:44dakroneyea
17:44hiredman,(import 'java.util.Vector)
17:44clojurebotjava.util.Vector
17:44hiredman,(Vector. [1 2 3])
17:44clojurebot#<Vector [1, 2, 3]>
17:45dakroneexcellent. that saves me a lot of trouble, thanks hiredman
17:45alexykso my bubble is burst. Is there a PHP-replacement in Clojure serving static or slightly dynamic HTML?
17:45rfgHello all
17:45hiredmanalexyk: you would have to use enlive together with something like compojure
17:45dnolenalexyk: Why not just use compojure? Compojure can serve static pages, you can use Enlive for dynamic pages.
17:46dnolenJetty has good perf from what I've heard.
17:46hiredmanthe other option would be to generate your pages batch style
17:46hiredmanand just serve using apache
17:46eevarhiredman, nginx you mean? :p
17:47dnolenor Apache plus proxy to Compojure. A lots of ways to handle this.
17:47hiredmaneevar: whichever
17:47alexykok I'm confused. If enlive doesn't serve HTML, who will?
17:48dnolenalexyk: your webserver, (Apache, nginx, Compojure, etc.)
17:48hiredmancompojure isn't actually a webserver
17:48hiredmanbut it comes with jetty
17:48dnolen^ what he said.
17:52sethsxor what he said?
17:52seths:-P
17:53hiredman↑ nand.
17:53alexykis ring another web framework?
17:53eevarthere's also conjure or something along those lines
17:54dnolenalexyk: Ring is kind of the plumbing for Compojure. Compojure adds a Rails like route syntax and a couple of other things.
17:55alexykok
17:55hiredmanring is like a monad for composing web frameworks
17:56eevarhttp://github.com/mmcgrana/ring/blob/master/SPEC
17:56alexykhiredman: love the monad description
17:57eevarhmm.. that link wasn't very descriptive, i guess ;)
17:57alexykeevar: good too! :)
17:57alexyklater
18:44powr-tocIs there a reason that (apply str nested-lazy-seqs) doesn't realise the whole collection? Instead I just get clojure.lang.LazySeq@1d1f81Aclojure.lang.LazySeq@0
18:45powr-tocor rather, how can I idiomatically force the above sequence?
18:46The-Kennypowr-toc: Maybe (apply str (flatten coll))
18:47The-Kenny,(str (map identity [1 2 3 4]))
18:47clojurebot"clojure.lang.LazySeq@e93c3"
18:47The-Kenny,(apply str (map identity [1 2 3 4]))
18:47clojurebot"1234"
18:47powr-tocThe-Kenny: yeah, that's actually what I had.. but I'm trying to remove the need to flatten...
18:47powr-tocI might just try consing all the seq's into one... rather than nesting them
18:47The-Kennypowr-toc: Maybe recursively applying str?
18:51Licenserpowr-toc: how about using prn?
18:54Licenser, (pr-str (map identity [1 2 3 4]))
18:54clojurebot"(1 2 3 4)"
19:25seths,clojure.contrib.repl-utils/*feeling-lucky*
19:25clojurebotjava.lang.ClassNotFoundException: clojure.contrib.repl-utils
19:26hiredmanthe json file clojurebot pulls contrib docstrings and such out of is broken
19:28powr-tocHow would you describe inferior-lisp/slime-style interactive development... as opposed to just a REPL?
19:28powr-tocI mean, what do you guys refer to it as? It feels like it should have a name, as it's such a big productivity win over a plain REPL
19:30sethshiredman: *feeling-lucky* doesn't have a docstring unfortunately
19:31sethsand I'm just mystified. There is also feeling-lucky-url
19:33hiredmanseths: did you try grepping the source?
19:34hiredmanare you just looking for where it comes form?
19:34hiredmanfrom
19:34sethshiredman: sorry, lost connection
19:34hiredmanare you just looking for where it comes form?
19:35sethshiredman: nah, I was just curious if it was a serious thing, and if so what it was good for.
19:36hiredmanseths: I believe the javadoc namespace uses it for googling for javadocs
19:36sethshiredman: awesome, thanks
20:16leifwrfg is self-referential, and so am me?
21:46psykoticthe default Object.hashCode() hashes on the pointer, right? is there a way to call that version on an object even if the object's class has implemented its own hashCode?
21:46psykotici would like to use this for conservative memoization.
21:48jah_too weird ... this evaluates to 2, any ideas why? ----> (.length (String. (into-array Byte/TYPE (map byte [-1, -2, 1]))))
21:49psykoticjah: unicode
21:49hiredmanjah_: .length on strin is a character count not a byte count
21:51jah_ah, ok
21:51psykoticah, i found it. System.identityHashCode(x)
21:53jah_hmm .. still not sure I understand
21:53psykoticjah: what are you trying to do?
21:53psykoticdo you want to decode an ascii string into a String?
21:54psykotic(incidentally, standard ascii only uses the first 7 bits, so values like -1 and -2 would be out of range)
21:54jah_byte b[] = new {-1. -2, 1}; System.out.println(new String(b).length()) gives me 3
21:55jah_i need to send 0xff 0xfe 0x01 as consecutive bytes to an output stream
21:55hiredmanactually, it says 3 here
21:55psykoticjah: in that case, don't put them in a string first.
21:56psykoticjah: write the bytes directly.
21:56psykotica string is not a byte container. like hiredman said, it's a character container.
21:57psykoticOutputStream's write() functions are all byte-based
21:58jah_trying now ...
22:16rfgI like kotarak's parenthesis highlighting: http://kotka.de/blog/2010/03/memoize_done_right.html
22:17hiredmanrfg: rainbow parens
22:17rfgAye
22:18hiredmanvimclojure comes with it, and you can find an emacs mode for it
22:18rfgI've just setup highlight-parentheses on emacs to do rainbow except that only highlights expressions containing the current cursor position.
22:19RaynesWith horrible colors to boot.
22:19RaynesI wish I knew how to change them, but I'm too lazy to find out.
22:20rfghiredman, do you know of an emacs mode that render all the parens like the vim mode?
22:22hiredmanrfg: yes, it's called rainbow-pare-mode
22:23psykoticthere's also a mode that visualizes the block nesting with different hues of background/foreground color, etc
22:23psykoticall of these seem to me more flashy than useful or comfortable
22:23hiredmanI love rainbow parens
22:24psykoticreally? do you find it genuinely useful?
22:24hiredmanyes
22:24hiredmanto be able to visually match up parens
22:25hiredman"this is a whole top level form, I can tell because that paren is red and there is the closing red paren there"
22:25psykoticindentation does that for me
22:25RaynesYou indent after every paren?
22:25hiredmanwell sure, but when you start reading other people's code
22:26psykoticRaynes: i referred to his example
22:27JonSmithi do thatwith paren match highlighting
22:27hiredmanbut rainbow parens works without have to move your cursor over every line
22:27JonSmithrainbow is probably prettier though :-)
22:27psykoticyeah, paren match is useful when i'm writing code
22:27psykoticonce it's written, i just go by indentation to identify structure
22:28psykoticanother aesthetic issue is that with the amount of paren nesting in lisp, it's hard to find enough colors that are both easily distinguished but not repulsive in combination :)
22:29rfgpsykotic, one could argue that you've gone too deep and you need to separate the code out.
22:29JonSmithclearly you need both :-)
22:30psykotic6 levels is common in shallow functions
22:30JonSmithalso need meta-paren
22:30psykoticbtw, http://www.lemonodor.com/archives/001207.html
22:30psykotici guess you know this post
22:31rfgAye
22:31JonSmithnobody using pastel colors gets an A?
22:32psykotichaha
22:32psykoticNO SOUP FOR YOU!
22:32psykotiche complains about the pastels and then he calls michaelw's color theme "techy but cold".
22:33psykoticmaybe what he wants is disco inferno.
22:38JonSmithI really want my clojure code to be 3-d
22:38rfgJonSmith, heh I was thinking the same thing, weird.
22:39psykoticdon't forget the cybergloves
22:39JonSmithwell its just the next step after 2-d, right?
22:39JonSmithwe've been stuck in 2-d for the duration of coding for the most part
22:39JonSmith50-60 years
22:39rfgJonSmith, no we're skipping right to 4D.
22:39psykotici remember all the games following the initial wave of low-end 3d games that were called 4D <whatever>
22:40psykoticlike 4D boxing
22:40JonSmithhahaha
22:40JonSmithyou can smell the code
22:40psykotici guess time counts if it animates
22:40psykoticsmellocode
22:40rfgSyntax highlighting could be considered 3D.
22:40psykotici bet there's an RFC for olfactory generators you can program against with emacs
22:41rfg"I'm a paren off, that one's elderberry when it should be apple"
22:42psykoticthat would have the same problem of needing to determine too many problems for all the scents to be distinguishable yet pleasant
22:42psykoticor maybe that's a way of encouraging ....
22:42psykoticgood code smells
22:42rfgheh
22:42psykoticas you go deeper, it starts to smell more rotten
22:42JonSmithas it gets more difficult to understand
22:43psykotics/too many problems/too many levels/
22:43psykoticyeah, durian kicks in at level 8
22:43rfgpsykotic, that is actually a great idea.
22:45psykoticrfg: i'm off filing patents as we speak. this is the wave of the future for IDEs.
22:45rfghttp://en.wikipedia.org/wiki/File:Nasal_Ranger.JPG
22:46JonSmithoh man
22:46psykotichaha
22:46psykotici think he just caught a fart
22:46JonSmithoh man, we better start writing code to invalidate your patents with prior art
22:47JonSmiththe smellternet could be the next thing in computing
22:47pdkhow do you troll on the smellternet
22:47psykoticfor too long, friends, have computers been cold and digital
22:47rfgpdk, with great ease.
22:48dnolenhmm how do you html encode unicode characters in Java?
22:48mebaran151does anybody here use lein.bat for Windows: I'm getting an odd error about RestFn class
22:49hiredmanclojurebot: clojure.lang.RestFn
22:49clojurebotant clean and rebuild contrib
22:49mebaran151do lein need contrib?
22:49psykoticdnolen: http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html
22:49hiredmanthe RestFn means you have a clojure/contrib mismatch
22:49psykoticdnolen: i don't think it's built in (i looked before)
22:50dnolenlame
22:50psykoticactually, there might be a way but it's probably insane
22:50mebaran151ah alright
22:50hiredman,(reduce (fn [s [[n h]] (.replaceAll s n h)) "foo>" {">" "&lt;"})
22:50clojurebotUnmatched delimiter: )
22:50psykoticsomething involving container an xml document placeholder )
22:51hiredman,(reduce (fn [s [n h]] (.replaceAll s n h)) "foo>" {">" "&lt;"})
22:51clojurebot"foo&lt;"
22:51mebaran151oh sweet, I found a different jar from clojurebox, and now everything is working
22:51mebaran151I have the most functional windows codigin environment I've seen in a while
22:52dnolenI need to encode ´and ˜
22:52mebaran151this is the one time I'm glad Emacs is dang monolithic: it actually works decently well in Windows
22:52dnolenluckily some wise soul put org.apache.commons.lang on clojars
22:53rfgmebaran151, yeah it's pretty solid.
22:53mebaran151can I get clojure highlight in the slime repl
22:53mebaran151*highlighting
22:53psykoticdnolen: btw you can always pull from maven central too.
22:53psykoticit's a default source for lein.
22:55dnolenyes! man it's so much easier to get things done now than 1 1/2 years :)
22:56dnolen5 minute turn around from question, to lib acquisition, to working code.
22:57psykoticbtw in the java world is there a standard for distributing source code with jars?
22:57psykotic(alongside the classes)
23:07rfgmebaran151, not sure about that. If you find out let me know.
23:37psykoticif anyone's looking for a fun elisp project for a few hours--a command that searches clojars.com and mvnrepository.com, gives a sorted list of candidates, and when a candidate is clicked, it inserts the lein [group/project "1.2.3"] at point
23:37psykotici'll probably end up doing it myself
23:39rfgI would, but...you know.
23:41psykotic:)
23:42rfg5 points for anyone guessing what I'm referencing.