#clojure logs

2010-10-06

00:00tomojand similarly for b, c
00:00ztellmanoh, yeah
00:00ztellman(channel) is unidrectional
00:00ztellman(channel-pair) returns two halves
00:00ztellmanthe channels given you by a connection handler is not unidirectional
00:01ztellmanare not*
00:05tomojI see
00:05tomojso you pass the second halves of clients to connection-handler
00:06tomojerr
00:11tomojyeah I see
00:11tomojthanks
00:47defnscottj: that was my guess at a solution
00:52tomojis there a reason to write in two threads instead of having the two threads tell a third to write?
00:56freakazoiduse a lock?
01:30defntomoj: im not sure he either a.) thought of doing that already, or b.) is not allowed by the very rules of the assignment
01:32tomojah
01:33defntomoj: wouldn't you prefer to use Clojure's coordination mechanisms, though?
01:36tomojlike what?
01:36tomojlocking ?
02:50defntomoj: coordinated changes
02:51defntomoj: where is the lock?
02:59LauJensenGood morning
03:00defnmorning Lau
03:00defnAre you going to clojure-conj?
03:01lypanovmorning all.
03:02carkhdefn : for threads, i would use an agent to control the reading/writing, and have my two threads communicating with it
03:03carkhdefn : for processes there is java.nio.channels.FileLock I guess
03:04LauJensendefn: Im sorry to say that Im not :(
03:46tobiasraederhi
03:49LauJensenhi
03:51esjSalut LauJensen !
03:52LauJensenSalut salut mon Edmund !
03:54esjoh oh... he knows my name. I'm in trouble now.
03:54tobiasraederMorning to the two of you :)
03:55esjand you tobiasraeder
03:56tobiasraederdoes any of you fine people know a good example on the gen-class macro with using the state?
04:01tobiasraederi think i found something now
04:04tomojabstract classes can extend concrete classes?!
04:04tobiasraedermight actually be
04:04tobiasraedercan you use the gen-class macro only inside a ns declaration with :gen-class and not on its own like gen-interface?
04:07tomojyou can use it on its own too
04:08sempahhello, I am just checking refs/stm out. If i define a struct (defstruct account :owner :balance), how can I alter the balance in a function?
04:09sempahhave something like this: (dosync (alter - @(from-account :balance) amount)))
04:09raeksempah: structs implement the same interface as maps, so you can use 'assoc'
04:10raekalter takes a function, that when called with the old value shoul return the new value
04:10raek(dosync from-account update-in [:balance] amount)
04:11tobiasraederif i can use gen-class alone, can it be used in the repl to just create a class like gen-interface (and then importing it)? or does it have to be compiled at startup?
04:11raeknew-value = (update-in old-value [:balance] amount)
04:11sempahthx, i will check this
04:11raektobiasraeder: I think it is a no-op, unless you do AOT
04:11tobiasraedermhm
04:12raeksempah: sorry. (dosync from-account update-in [:balance] #(- % amount))
04:12sempahmerci
04:12raekthe previous example was some weird blend of update-in and assoc-in
04:13raek,(doc update-in)
04:13clojurebot"([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
04:13raekah
04:13raek(dosync from-account update-in [:balance] - amount), even
04:13raeknow i gotta go. good luck!
04:15sempahbye
04:18LauJensenHas somebody written a nice log4j wrapper ?
04:24scottjbeyond c.c.logging?
04:28LauJensenscottj: Im asking if something like that exists, otherwise c.c.logging will have to do
04:29tobiasraederdoes anyone know why gen-and-load-class is commented out currently?
04:30scottjLauJensen: you know log4j is one of the backends for c.c.logging right?
04:30LauJensenscottj: I imagined that it was yea
04:54sempahhmm I dont get it
04:55sempah(dosync (ref-set from-account (assoc @from-account :balance amount)))
04:55sempahnow the new balance will be set
04:55sempahbut how can I do something like balance - amount
05:02LauJensen,(let [account (ref {:amount 100})] (dosync (alter account update-in [:amount] - 10)) @account)
05:02clojurebot{:amount 90}
05:02LauJensenfinal deref is just for show
05:04sempahthis works
05:04sempahmuchas gracias ;)
05:05LauJensenno problemo muchachos
05:05jjidois ^ a shortcut for (with-meta)?
05:06hiredmanno
05:07hiredman,(meta ^{:foo true} (conj () 1))
05:07clojurebotnil
05:07hiredman,(meta (with-meta (conj () 1) {:foo true}))
05:07clojurebot{:foo true}
05:07LauJensenAnd in 1.3 ^keyword is {:keyword true}
05:07LauJensen^:keyword, sorry
05:09Chousuke^ attaches metadata at read-time
05:09Chousukewith-meta at runtime
05:17jjidohiredman: LauJensen Chousuke: thanks
05:19LauJensenLooking at disclojure.org this morning, I think Gosling just earned himself another Clojure vs Java - Smackdown blogpost :)
05:19Chousuke:P
05:24jjido,(let [a 2 b 'a] ~b)
05:24clojurebotjava.lang.IllegalStateException: Var clojure.core/unquote is unbound.
05:27esji wonder if we could email him a bag of parentheses ? Seems like something thinkgeek.com should stock.
05:28jjido,(let [a 2 b (delay a)] @b)
05:28clojurebot2
05:28LauJensenesj: Or maybe a copy of "Programming for beginners", since he hasn't learned to look past the superficial yet, seems like a pretty 101 topic
05:29esjeish !
05:29jjido,(let [b (delay a)] (let [a 2] @b))
05:29clojurebotjava.lang.Exception: Unable to resolve symbol: a in this context
05:30jjidoMmh, what is the magic formula?
05:31LauJensenjjido: You had it right in the 2nd try, but I dont think you understand delay
05:32jjidoLauJensen: I don't need delay
05:32LauJensenthen the trick is to stop using it :)
05:32jjidoLauJensen: I need a symbol that I can resolve later
05:33jjido,(let [a 2 b 'a] (eval b))
05:33clojurebotDENIED
05:33defnnaughty eval
05:33esja delay is that, and a promise is related usually for multitheraded. (warning - I am a beginner so prone to error)
05:34esji think the reason your v2 code doesn't work is that a is not in lexical scope when b is defined so it gets no further
05:34defnesj that's actually a neat idea -- code magnets -- with real code
05:34defnhas it been done already?
05:34defn...probably...
05:34esjdefn: ooooh it would be great for clojure, so few keywords !
05:35LauJensenjjido: (defmacro cheat [] `~'a) (let [a 5] (cheat))
05:35defnit would be fun to build gigantic functions using all of the functions only once
05:35defnor try to
05:36esjjjido: you're not looking for declare are you ?
05:36jjidoesj: no I need it in a variable
05:36jjido,(defmacro cheat [] `~'a) (let [a 5] (cheat))
05:36clojurebotDENIED
05:37LauJensenjjido: you need to run that locally, we dont get to play with defmacro here
05:37jjidoLauJensen: (eval) works
05:37LauJensennot here
05:37jjidoin my program
05:40jjidothat gives me 'a: (defmacro cheat [x] `~x) (let [a 5 b 'a] (cheat b))
05:41jjidook I need to keep `~'
05:41jjidoworks as well.
05:42jjidoer, doesn't.
05:43jjidoLauJensen: I will use eval :)
05:43LauJenseneval?
05:43clojureboteval is DENIED
05:43LauJenseneval?
05:43clojureboteval is DENIED
05:43LauJensenoh, usually clojurebot says something funny
05:49defnis there any bad blood between cake and lein? It seems like a merging of the two would be beneficial to all.
05:49LauJensendefn: There are disagreements which cannot be resolved, so use cake
05:50defnGranted they are interoperable for the most part-- I guess I just think about merb and rails in the ruby community and how it was a good thing to merge instead of splinter.
05:50lypanovmerging is silly.
05:50lypanovand thats a bad example, the merb lead is insane.
05:50defnFork when forking is necessary.
05:50lypanov(ly good)
05:51lypanovare you some sort of communist?
05:51defnDon't when the net benefits are < net gain.
05:51lypanov(i always wanted to say that)
05:51defnI'm an Umehricun
05:51lypanovyeah, communist then. :)
05:52defnBuild tool debate is lame.
05:52LauJenseneh?
05:52LauJensenThe build tool debate has so far produced 2 great Clojure build tools
05:53defnYour perception of how I was using "debate" is different than I meant.
05:54defnSome people are quite vocal about which build tool ought to be used. The debate is not the code that has been produced as a result of disagreement over how the build story should go.
05:54LauJensenThe major disagreement was the dependency based task model which cake uses. Phil didn't see a need for it
05:54defnBut I suppose those two things are intertwined.
05:55defnLauJensen: would you mind expanding -- when you say dep based task model I'm not sure exactly what you mean.
05:55LauJensensec
05:55defnAs in -- it has support for (deftask ...), whereas lein doesn't?
05:55sandGorgonis cake written in ruby ?
05:55defnsandGorgon: I'm so glad you mentioned that.
05:55LauJensenhttp://github.com/ninjudd/cake - Read the tasks section and the advanced tasks section
05:55LauJensensandGorgon: No, it has a small (and getting smaller) Ruby bootstrap, which makes it completely crossplatform, where lein is mostly unix since it uses bash instead
05:56defnI was thinking about this earlier -- people's aversion to the fact that something is written in Ruby (not that it is.)
05:56LauJensen(and .bat on Windows)
05:56sandGorgondefn, huh ? I was looking at the docs just now - i'm a bit confused
05:56LauJensenI gotta say I hate Ruby, but I love Ruby for small things like this. It gave cake exactly what it needed, a piggy back distrubtion on top of gems
05:56sandGorgonLauJensen, ah...
05:56defnWhat I wanted to say is that I think when a project like cake is started in a relatively fresh language like Clojure
05:56lypanovLauJensen: and really nice install.
05:56defnit spawns people who will take up the cause
05:57lypanovs/and/with/
05:57sexpbot<lypanov> LauJensen: with really nice install.
05:57defnand turn the ruby into clojure
05:57defnthings like cake where there is ruby inspires community to rise up and port the ruby ideas to clojure
05:57lypanovi personally think competition always helps.
05:57lypanovopen source does what it needs to do.
05:58lypanovpeople merge when merging is what people want to do.
05:58defnas long as it's /healthy/ competition
05:58lypanovforcing or coercing removes the point.
05:58lypanovall competition is inherently annoying to someone.
05:58lypanovbe it due to fragmentation or loss or either side.
05:58lypanovdoesn't mean its bad though. still produces better things than not
05:59lypanovboth projects are still too young to really talk about it in this way anyway.
06:00lypanov(disclaimer, i was involved early on in a competitor to rubygems, and still hate many things about gems, the things that plague it still today in fact)
06:00defnrvm is a way of fixing rubygems
06:00defnthank god for gemsets
06:00defnalso -- one annoyance that has hurt my soul forever...
06:01tomojLauJensen: why would you need a piggyback distribution on top of gems?
06:01defngem search foo returns local results by default -- the majority of searching people do is remote, so with gems you need to gem search -r foo
06:01defngem list foo should return a local list of gems matching foo
06:01defnnot search...
06:01LauJensentomoj: Well you need to piggyback something or write it from scratch
06:02tomojI guess lein did have to write it from scratch
06:02tomojand it isn't pretti
06:02lypanovdefn: for me its the lack of good distribution integration that hurts it most.
06:02defnlypanov: ya i needed to do some weird wrangling on ubuntu to make certain gems behave
06:02tomojthat is not so good for lein either
06:02defnthat's not right.
06:02LauJensentomoj: lein doesnt have it
06:03sandGorgonwhat are the "disagreements" between lein and cake ?
06:03tomojlein has the shell script you run to self-install
06:03defnpersistent jvm, tasks built in
06:03LauJensentomoj: exactly, and it doesnt work on Windows, hence the gems
06:03tomojwhich is 169 lines long
06:03tomojwell, there's a .bat file there
06:03defncake has more features than lein
06:03tomojit doesn't work?
06:03defnthat's the debate
06:03tomoj(also, who cares? :P)
06:03LauJensentomoj: Ive not heard anybody who has got it working yet
06:03LauJensenI care
06:04tomojthe readme suggests it can be done
06:04tomoj"On Windows most users can 1. Download the Windows distribution lein-win32.zip 2. Unzip in a folder of choice. 3. Include the "lein" directory in PATH."
06:04LauJensenThe difference are 1) Cake is cross-platform, lein isnt, 2) Cake has a persistent VM, lein doesnt 3) Cake has a dependency based task system, lein has plugins, 4) Cake does not try to tell you how to name your projects, lein does. 5) Cake is Ivy based, lein is Maven based
06:05tomojouch
06:05tomojI can have cake/ivy using maven's dependency model?
06:06LauJensenYep
06:06mrBlissI use Leiningen on Windows (Cygwin). I only had to modify a couple of lines in the bash script.
06:06tomojdoes cake do that by default?
06:06tomojhmm, that is pretty interesting
06:07tomojit's a rubygem, so I could install it easily with chef, and easily run it during deploys or as a service
06:07LauJensenMaven => Ivy brings Cakes dependencies down from 27 to 7 jars
06:07tomojand I can hook it up to my nexus repo?
06:08hiredmanyou run your build tool when doiing a deploy?
06:10tomojyeah
06:18rrc7czare off topic discussions okay here?
06:19LauJensenrrc7cz: On slow days we sorta accept it, but there's #clojure-casual for chit/chat
06:19LauJensenhiredman has a zero tolerance policy on everything though :(
06:19rrc7czLauJensen: it's IT/archetecture related, not directly Clojure
06:19rrc7czaha
06:19LauJensenshoot
06:22LauJensenrrc7cz: I said: shoot
06:22LauJensen:)
06:22rrc7czwe have a hairy problem with no clear answer, and we can't seem to reach any conclusion or plan. We have lots of data, lots of apps, and multiple (distributed geographically) development teams. You have the typical legacy app problem found in most internal IT depts: mish mashed chaos for app integration. Some apps directly access other's dbs, some file system integration is used (copy to shared dir or FTP to shared dir), some primative
06:22rrc7czweb services, some RMI, the whole bit. Some of us - myself included - have been pushing for asynchronous messaging + local read-only data caches to be used for the majority of integration moving forward.
06:25rrc7czothers would like to see a "giant app". By this I mean: if you have 4 apps that all require access to largely the same data, perhaps they should be combined into a single, larger app. Multiple teams would work on this app using branches, CI, libraries, etc. to try and still segment/modularize their work as much as possible, but the final deployable artifact would be a single application. Now there are pros and cons to both
06:25rrc7czapproaches. The distributed messaging pro is that apps/functionality are largely decoupled: one app goes down but others stay up since they have their local read-only caches of the data. The con is that it's more complex and you could have data sync issues, though we'd be using JTA to mitigate this as much as possible. The Pro of "giant app" is you have no data sync issues, but you have let's say.. development issues. Vastly different
06:25rrc7czfeatures and teams and customers all on this one codebase, scheduling, sychronizing, some technical issues like library versions, etc.
06:26rrc7czsorry, didn't mean to flood the channel, just trying to explain it clearly
06:28rrc7czof course there are many more pros/cons to both approaches, but I think you'd know them
06:28esjloose decoupling and modularisation seem to me to be most important
06:29rrc7czand there are various bits of middle ground I didn't mention: multiple WARs but packaged in a single EAR, or using sync web service calls instead of async messaging, thereby solving the data sync/duplication of a local read-only cache, but more tightly coupling the apps so one "source" failure takes down all consumers
06:29esjlots of teams seem to rave about async msg queues
06:30sandGorgonhow would you build a async msg system on clojure - aleph ? ring ?
06:30jjidois there a better way to do (letfn [(foo ([a] (foo a 0)) ([a b] (+ a b)))] foo)?
06:30rrc7czesj: that's what most of us were pushing for. The main argument against it comes from management because there is a _clear_ technical overhead to it (JMS infrastructure, JTA, etc), while the overhead of "giant app" I feel is harder to perceive; it's mostly in "soft" areas like coordinating teams, customer requests, PM, etc
06:31rrc7czesj: I should say, that's what most *developers* were pushing for. Ops + management is taking more of the other side. For operations it's clear: JMS + many smaller apps is much more work, infrastructure, and overhead for them
06:31esjin most cases its easier to get a technical thing correct than a soft/managerial thing because you can define and control is clearly
06:32rrc7czsandGorgon: our implementation would look like ActiveMQ as the JMS message broker + Java apps using Spring Integration to wrap JMS w/JTA
06:32hiredmanouch, I don't think I've ever heard anything good about activemq
06:32rrc7czsandGorgon: I recently pushed (hard) for Clojure to be approved as a dev language here, but the best I was able to do was Scala. The reasons were 100% personel related (where can I hire Clojure devs, etc)
06:32esjrrc7cz: not rabbitmq ?
06:33tomojI lucked out and happened to get a new boss who loves clojure :)
06:34rrc7czhiredman, esj: we selected ActiveMQ because it appeared to have the largest number of adapters (we also need to support .Net, some other weird stuff), it had enough books/consulting available to back up an "enterprise" (barf at the name, but..) and so on
06:34hiredmanrrc7cz: you can buy copies of http://www.amazon.com/Enterprise-Integration-Patterns-Designing-Deploying/dp/0321200683 for everyone
06:34rrc7czhiredman: I have it and read it. It's actually what started my push for async messaging
06:36sandGorgonhiredman, what I was about to say. the inventors of OpenAMQ are getting behind zeromq and the Stomp protocol (rather than JMS)
06:36rrc7czhiredman: there seems to be general agreement that in a world with no schedule and unlimited resources, async messages - where it's applicable - is the absolute best way to do things. Of course when we talk about JMS infrastructure, local data caches, JMS adapters, etc. the additional cost is clear. We know "giant app" has additional costs too, but as I said they are less clear and hence less painful to discuss
06:36esjrrc7cz: another stick to beat them with is testing. Small pieces are significantly easier.
06:36esjrrc7cz: although you have the extra layer....
06:37hiredmanrrc7cz: what you described, multiple teams, multiple projects, seems like the ideal case for the flexible approach of async messaging
06:37tomojjjido: (fn ([a] a) ([a b] (+ a b)))
06:37rrc7czI should also say that very little async messaging has been deployed so far, and what is there was coded against the JMS API. What I mean to say is that we could still swap out message brokers if we wanted to, but that isn't our main problem. Our main problem is the larger picture of which model to use and when. Right now we understand we're going to use both models, but how do you select one of ther other?
06:38sandGorgonrrc7cz, if u dont mind my asking - what is the use case ? trading desks, company-internal messaging systems ?
06:38bmhDoes anyone have recommendations for clojure parser generators?
06:38jjidotomoj: that was just an example LOL. I don't want code duplication between the body for both arities
06:38rrc7czesj: we thought about the testing argument. To some degree "giant app" isn't any worse; you can still write plenty of unit and integration tests for your code. The place where we DID argue testing is: one team can bring down the entire app. One team blowing out the heap affects everyone. As such we agreed that QA was a much higher priority in the "giant app" model
06:39jjidois there a better way to do (letfn [(foo ([a] (foo a 0)) ([a b] (do-something-complicated-with a b)))] foo)?
06:40tomoj(fn foo ([a] (foo a 0)) ([a b] (+ a b)))
06:40hiredmanuh, well, "integration" still means it is a giant app, the components of which use a particular communication style that allows for maximum flexibility
06:40hiredmanqa is still very important
06:41rrc7czhiredman: most of us agree that it's ideal, but in some of the projects it's not as clear. Obviously it's a gradient. There is a point where combining apps makes some sense. Our pain is not having a clear idea of how to decide/what factors to use. Right now we're just thinking "when an app is pullilng A LOT of data from system X, maybe it should be part of system X". But what is "a lot" of data? How much is too much?
06:41hiredmanI don't see how that follows at all
06:42rrc7czsandGorgon: Salesforce apps + custom legacy CRM + document publishing/workflow systems + Product management systems + user (internal & external) systems + data analysis and tracking systems + public website + product distribution
06:42esjhiredman: on the money. with a monolithic giant system its up to you to define the interconnects. you'll fail.
06:42sandGorgonahh.....
06:42rrc7czsandGorgon: and about 100 more I won't bother mentioning, inlcluding a bunch of desktop VBA/.Net tools used by 1000+ ppl
06:42hiredmanrrc7cz: data sources are just data sources, they are not the app
06:43rrc7czhiredman: that's true about "integration". I think the "giant app" side is thinking "how can we get this project done the fastest with the least resources and the least infrastructure" while the async msg side is thinking "how can we build the most robust solution"
06:44rrc7czhiredman: not sure what doesn't follow
06:44rrc7czhiredman: about the interconnects: there is an argument that "giant app" will detect contract breaks at compile time, while distributed systems will detect it at run time
06:45rrc7czhireman: to expand on the point, integration in a giant app is one module directly invoking (method invoke) the api of another module. if that api changes, you see that at compile time
06:46rrc7czhiredman: with async msg, you have to manage a contract through something like an XML Schema or something, whose changes might not be apparently as quickly to the other parties in the contract
06:46hiredmanwhich makes changing modules very difficult
06:47hiredmana schema is pretty heavy weight, really you just want be sending maps with some agreed upon keys
06:50rrc7czhiredman: if you said, "I don't see how that follows at all" regarding the existance of a gradient, think of this: you have a user management system. Now you want to add biographies to the users. You probably wouldn't build a "User Biography" app, because the overhead wouldn't make sense. That Bio app would probably be pulling every single user field from the User Management app. You'd basically be making a heavyweight UI. You'd instead
06:50rrc7czjust add the functionality to the existing User Management "getting more giant" app. So there is a lot of gray area in deciding. "how much data" feels like one gague. "how related is the functionality" seems like another gague. But it's not clear cut
06:55hiredmanuh
06:56hiredmanthat is a change to you datastorage (to store the bios) and a change to your ui to display them
06:56rrc7czyes, that's right
06:57hiredmanif your ui and your datastorage are so intertwined as all that then you have already lost
06:57rrc7czI don't understand at all.
06:58rrc7czthis was an example: you want to expand the data model of a user. The example was: where do you put that extra functionality
07:01hiredmanthe ui parts go in the ui, the storage parts going in storage, connected by your message bus
07:02rrc7czso you're recommending (in this example) that the UI and the storage logic (repository/dao/orm/whatever) are separated by a message bus? That doesn't seem to make sense
07:02rrc7czthe UI would have to cache the entire user data model locally just to display it
07:02rrc7czunless you're talking about sync service bus or something
07:03rrc7czin that case it does make sense
07:03hiredmanrrc7cz: why would it have to cache the entire user data model?
07:04rrc7czhiredman: because when the UI needs to display a user it needs that user's data model. If it connects to the storage system via a sync service of some sort, it can invoke the Get method and have the model immediately (or over the wire at delay) and we're fine
07:04rrc7czhiredman: but we're talking mostly about using async messaging. Which means you'd either need to cache the user data locally when you get a "hey a new user was added to the storage system" message
07:05rrc7czOR you'd have to use the async messaging system in a sync way (which it does support) by sending a "get me user X" message, then waiting for the reply
07:05hiredmanyou can easily do callbacks across a message queue
07:05rrc7czbut in that second case, you're not really using async messaging; if the storage system goes down, so does your UI. This also doesn't work in some cases where the data model is huge and you need performance. In those cases you have to have it locally.
07:06rrc7czhiredman: absolutely, but then you're using async messaging in name only. What you're really doing is making a sync call
07:06hiredmantomato tomato
07:07hiredmanso you are saying your dataset is too large for messages
07:08rrc7czhiredman: in almost all cases, not at all, but the point is using a callback = sync service call = tight coupling which means it's really no different then using some web service or RMI
07:08hiredmanit different
07:08hiredmanit is
07:08rrc7czhow?
07:08clojurebotwith style and grace
07:09rrc7czyou make the invocation and callback handler async, sure, but you don't address the coupling problem: when system X goes down, so does system Y
07:10hiredmanbut the ui logically depends on storage, if storage goes down, how would the ui continue to display information?
07:10hiredmanyou can cache data
07:10rrc7czwell in this storage/ui example I wouldn't use async messaging at all. I'd use sync calls for that very reason
07:11hiredmanbut if you use a message queue and keep your ui decoupled from storage, dropping a cache in between is easy
07:11rrc7czbut think about systems that aren't split into those horizonal tiers like this UI/storage example. Think of a User System and a Content system that need to talk
07:11carkhbmh: i've been successfull using joshuas choi parser library at http://github.com/joshua-choi/fnparse
07:12bmhcarkh: I had a look at that, I wouldn't have minded more documentation
07:13carkhbmh : there is a sample jsion parser which is a great start for understanding the beast
07:13hiredmanrrc7cz: it really sounds to me like you are stuck on this idea of all Noun realated functionality living in a single place
07:15rrc7czhiredman: maybe. I feel like we're stuck between a more robust, but more expensive solution and a simpler, but more fragile solution. And clear answers only live on the peripheries
07:17rrc7czhiredman: on one extreme you have User System supports First Name. Add Last Name. Okay it's clear, just add it to the existing User System. On the other extreme you have Public Website needs some data from the Accouting System. You wouldn't propose combining them. You'd just pull the data somehow. In between these extremes lives a lot of gray, and it's sometimes hard to navigate.
07:43jjidotomoj: (belated) thanks that is much better than letfn!
08:04LauJensenDoes anybody have a simple yet up to date example of using c.c.logging with log4j ?
08:15esji've got a working setup....
08:15esjLauJensen: it uses maven though :P
08:16LauJensenlink?
08:16clojurebotyour link is dead
08:17esjLauJensen: no link just local code
08:18esjit was just a case of get the deps, put the log4j config file in the right place (use c.c.logging) and (warn "blah blah blah")
08:18esjprobably you want to do something more complex
08:19esji just have the logs going to socket on a remote server
08:19LauJensenBasically I need to know how c.c.logging interfaces with log4j. Is there are config file you must initialize?
08:20cemerickLauJensen: have you tried it? It just works.
08:20LauJensenno
08:20esjyeah, you need the config in resources
08:20esjor I guess anywhere is the class path
08:20cemerickwrite yourself a simple log4j.properties, done
08:20esja comprehensive example is : http://www.johnmunsch.com/projects/Presentations/docs/Log4J/log.properties
08:21cemerickjeez
08:21cemerickkitchen sink, more like :-)
08:21cemerickSocketAdapter? :-P
08:21esjthat's what I'm using....
08:21esjcemerick: is that a mistake ?
08:21cemerickesj: not if if you need it
08:22cemerickI can't say I've ever logged over sockets
08:22cemericklogged to couchdb, but not sockets :-)
08:22esjcemerick: well, I like to have a big screen on the wall with the log from all the systems displayed on it.
08:22cemericknifty
08:22cemerickAll I've got is an iPad :-)
08:23esjthat's much more impressive actually
08:23LauJensenthx
08:23cemerickoh?
08:24esjwell, smaller is harder.
08:25esjyou have to remember to look at it :) A flashing red bar on the wall is easy, thus less impressive.
08:27esji use the app chainsaw (not great) for watching the logs. If you try apt-cache search for it in ubuntu all it gives you is perl..... :P
08:27cemerickAdding a red flash and an ominous-sounding alarm when things went sideways was a big improvement for the monitoring app :-)
08:27esjcemerick: the darth vader theme ?
08:28cemerickHrm, I wasn't so clever.
08:28cemerickI don't quite remember where I got the audio. It's not anything notable.
08:48LauJensencemerick: You can probably make sense of the new contrib build - Whats the artifact I need for c.c.logging ?
08:48chousermaybe org.clojure.contrib:logging:jar:1.3.0-SNAPSHOT ?
08:49cemerickI've not used anything in the 1.3.0 contrib at all.
08:49cemerickbut chouser's suggestion seems reasonable.
08:49LauJensenk
08:49LauJensenGuess 1.3 is still a little too bleeding
08:50cemerickplenty of people are using it
08:51LauJensenBy plenty you mean stuartsierra? :)
08:51cemerickeverything should be considered bleeding until it's got an RC label on it IMO
08:51kryftMmm, I can't wait getting started with clojure. (I just got Joy of Clojure yesterday.)
08:52cemerickLauJensen: nah, at least a dozen mentions of using 1.3.0 stuffs in here the past week
08:52chousercemerick: have you settled on a tool for your presentation slides?
08:52cemerickok, maybe not 'plenty'.
08:52kryftBy the way, what kind of performance can one general expect compared to, say, C++?
08:52esjkryft: you're in for a treat.
08:52kryfts/general/in general
08:52kryftesj: :)
08:53cemerickchouser: I was never actually considering using anything other than powerpoint.
08:53chousercemerick: oh, I misunderstood your question?
08:54cemerickchouser: I think so. I was having a little fun w/ people writing code for such things. :-)
08:54cemerick"How do I rotate this text?" "Oh, there's a jquery plugin for that."
08:55cemerickback to the minimalistic hacker ethos, I guess
08:55chouseroh, I didn't see those.
08:55chouserI'm having a blast with it. Best slide-creating experience I've ever had.
08:56cemerickthat's a fabricated set of quotes.
08:56cemerickI could see using 280slides, but I'm not sure why I would.
08:57kryftchouser: A blast with what?
08:57chouserkryft: http://github.com/schacon/showoff
08:58cemerick"How do I add an image?" "Put your image in this directory over here, refer to it in your markdown, and then refresh your browser."
08:58cemerickOK, I'll shut up now.
08:59kryftchouser: Ah. :) Looks fun indeed.
09:01chouserI'm using embedded SVGs for charts and such. I can have one open in inkscape and have much more powerful tools than any presentation program I've ever seen. Then to see my changes in the preso is almost instantaneous: save the svg, reload in the browser.
09:10esjwell that's all well and good but you'll have to sim your own BSOD.
09:10esjworthless
09:13chousercemerick: how do you include a syntax-colored source snippet on a slide in powerpoint?
09:14cemerickchouser: I've never worried about syntax coloring in slides
09:16cemerickgosh, I hope that and svg support are the only benefits :-P
09:16cemerickThis is going to degrade into the same track as the typical LaTeX v. everything else discussion.
09:20chouserNah, we can leave it right here, each of us quitely and smugly self-assured that we each have a better presentation tool than the other.
09:21cemerickhrm, "better" is always a dodge. Everything is "better" than everything else, for someone.
09:22chouserwhich is how we can both be right
09:22chouserand smug
09:23cemerickI've beat a lot of it out of myself, but it crops up again sometimes.
09:29kryftAre there any nice presentation tools that allow you to use LaTeX for embedding math?
09:29chouserI get too defensive too easily. I need to keep working on internalizing that when I say "foo is really nice" and someone else says "you only think so because you're dumb" that they don't mean it personally.
09:30chouserkryft: I can't tell you're serious or if you're just trolling cemerick.
09:31kryftchouser: Haha! I'm serious - sorry if my question was sufficiently stupid that it made you wonder. ;)
09:32abrenkkryft: LaTeX using beamer class -> PDF -> using impressive (ex keyjnote) to display
09:32LauJensenkryft: Muse for Emacs
09:32chouserkryft: not at all, but I'm scared to answer. If you prefer latex to markdown, I bet it wouldn't be hard to tweak something like showoff to do it.
09:33kryftSo far I've used latex-beamer for anything math-heavy, but frankly I'd prefer something a bit more wysiwyg for making slides.
09:33chouseressentially convert your latex source to a live presentation on-the-fly when the browser loads it.
09:34chouserclicking reload shows you the up-to-date version of the slide you were already looking at.
09:34cemerickchouser: oftentimes, they *do* mean it personally, which is a condition that is good to be able to detect and ignore as well.
09:34chousercemerick: :-)
09:35kryftchouser: Heh, I hadn't even heard of markdown until you mentioned it. :P
09:36chouserkryft: my opinion-framework about document source formats is in complete shambles at the moment, so I have nothing to say about markdown except that it exists.
09:37kryftchouser: Heh, fair enough.
09:37chouseroh, and we used it sorta to right a book.
09:37chouserwrite
09:37kryftJoC?
09:37s450r1`heh
09:37chouserkryft: yeah
09:38kryftchouser: Ah. I've only started reading it, but I don't expect to see a lot of equations. :)
09:38chouser:-) no
10:14shoover__chouser: I can't believe you haven't moved over to split-screen emacs presentations yet
10:15shoover__But I guess if you must have fancy graphics...
10:18chouser:-)
10:18chouserbut surely emacs and org-mode support graphics...
10:19shoover__only if you export to pdf, or html, but that diminishes the value of the live REPL
10:22LauJensenshoover__: You can have images in a regular buffer
10:23shoover__ok, sorry, I have to exlain this joke. Chouser once attended a little presentation I did for .NET developers, in which I displayed a simple outline in emacs and just typed in a REPL on the bottom half of the screen. An old VS developer was like, "What is this device?"
10:23LauJensenhehe
10:23shoover__LauJensen: ok, send the commands over to Chouser
10:24chousernot today. today I'm all about maven and eclipse
10:24LauJensenshoover__: When it comes to tools, Chouser and cemerick are those akward uncles that we just accept because of their lovable nature
10:24shoover__hee hee
10:25chouser"you only think so because you're dumb"
10:25shoover__now they're using each other's words against us
10:26chouserheh
10:31LauJensenWhats the practical differences between RollingFileAppender and FileAppender?
10:31chouserI'm not too sure but I think RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.
10:32drewrLauJensen: I think it's just rotation
10:32LauJensenk
10:32shooverLauJensen: you can roll by size or age, but practically it just makes it easier to open in a text editor if it would otherwise by dozens of MB
10:32chouserYou can set the maximum size that the output file is allowed to reach before being rolled over to backup
10:32LauJensenI thought both did that actually but I must be wrong
10:33chouserand also how many backup files are kept before the oldest is erased.
10:34LauJensenI just want a flat file to tail -f, if I put this https://gist.github.com/a7de1a2b43a229f229df in my resources/ shouldn't that be enough to get started?
10:34chouserFor example, the value "10KB" will be interpreted as 10240. setQWForFiles protected
10:34chouseroops, pasted too much that time, sorry.
10:41LauJensenWhere in the .war file are you guys putting log4j.properties?
10:49LauJensencemerick: ?
10:51hugodLauJensen: mine ends up in WEB-INF/classes/log4j.properties
10:51LauJensenhugod: using a maven trick ?
10:52hugodI have it in src/main/resources, which is declared as a resource directory in the pom
10:53LauJensenok
10:55ztellmanis 1.3 supposed to play nicely with jars compiled by 1.2?
11:00LauJensenztellman: I think yes, with anything thats not AOTed. However 1.3 does mess with a few things like the = operator
11:00ztellmanLauJensen: I have a counter-example (bug?)
11:01LauJensenWhats causing the problem?
11:01ztellmantrying to use aleph-core, which doesn't use AOT but was turned into a jar with 1.2
11:02ztellmanopening a 1.3.0-alpha1 repl with it causes the exception "NoSuchMethodError clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V"
11:03ztellmancreating a jar for aleph-core with 1.3.0-alpha1 makes the problem go away
11:03LauJensenWell. Lookups are also different in 1.3, so theres a possible breakage. In 1.2 keywords of longs / ints wouldnt match, they do now. Could be related
11:03ztellmanan intentional breakage?
11:03LauJensenA necessary one
11:03LauJensenSo yea
11:03ztellmanok, fair enough
11:04LauJensen,(assoc {(long 1) 2} 1 5)
11:04clojurebot{1 5, 1 2}
11:04LauJensenThat has become fixed now, thanks to .equals being strict about types
11:09abrenkztellman: "turned into a jar with 1.2" if there are only .clj files in the jar the clojure version shouldn't matter
11:09ztellmanabrenk: that's what I thought
11:09abrenkztellman: NoSuchMethodError can only occur with class files
11:10abrenkand there are class files in the aleph-core jar
11:10ztellmanhmm
11:10abrenkare you sure there's no AOT involved?
11:10ztellmanoh, I changed the :main setting in my project.clj
11:10abrenkI guess, you just pushed that to clojars?
11:11ztellmanI wanted to set the default namespace in the repl
11:11ztellmanthat probably has some AOT consequences, doesn't it
11:12abrenkI guess so.
11:12ztellmanleiningen sample.project.clj confirms
11:12abrenkotherwise there wouldn't be a main method
11:12ztellmanok, thanks
11:12ztellmanI thought that was a weird problem to have
11:13chouserIn ecplise with CCW, I tried importing clojure itself as a maven project. That looks ok, but when I turn on clojure support for that project the src directory disappears from the package explorer pain
11:13chouserer, pane, though I guess either is accurate
11:13LauJensenztellman: main is AOT compiled to make jars executable they must have a gen-classed main/-main
11:14ztellmanLauJensen: I just wanted the repl to start up with the main namespace loaded
11:14ztellmanI guess I should just have a start script specified
11:14LauJensenztellman: k, dunno how to do that, ask ninjudd :)
11:18abrenkchouser: clojure as a maven project? but it doesn't really use maven, does it?
11:18chouserit has a pom.xml. I guess I was hoping that was enough
11:18chouserI clearly don't really know what I'm doing. :-)
11:18abrenkchouser: not really, the source paths etc. are neither the maven standard nor specified in pom.xml
11:19chouseroh
11:19chouserHow would I go about opening clojure properly then, in eclipse?
11:19abrenkso the pom.xml really is just to put into the repository
11:19abrenkyou cannot build clojure using maven
11:19abrenkjust import a simple java project i guess
11:20chouserI don't want to build it, just open it. But eclipse is a mystery to me
11:21abrenkchouser: create a new java project and then select from existing source
11:23abrenkchouser: maybe new java project from existing ant buildfile works
11:24chouserabrenk: thanks, I'll try those
11:26abrenkchouser: don't try "from existing ant buildfile" - just tried it, looks weird
11:26chouserok
11:33AWizzArdI've just studied gvec.clj and came to the conclusion, that I can't find out what the primitive type of (vector-of :short) is. That is, it does not expose this information through a function call, such as (.getPrimitiveType (vector-of :short)) ==> :short
11:33AWizzArd(class (first (conj (vector-of :short) 0))) would be an option though
11:40LauJensenFor all tomcat users, dont trust this information: http://tomcat.apache.org/tomcat-5.5-doc/logging.html#log4j - I just wasted a couple of hours not realizing that this will void any servlets own logging configs
11:40BahmanHi all!
11:41esjLauJensen: I think RollingFileAppender 'rolls the logs' ie, puts an upper limit on log size
11:44chouserAWizzArd: not a bad solution, as long as it doesn't decide to give an error when the wrong type of item is conj'ed.
11:44chouserAWizzArd: You might consider using peek instead of first
11:45AWizzArdchouser: yes, or nth 0
11:45AWizzArdgood point
11:46chouserright, something that doesn't have to create a seq
11:46AWizzArdkotarak benchmarked first vs nth for vectors, and (for me) surprisingly first runs 10x as long as nth.
11:50chousercloser to 4 or 5 times slower for me, but yeah.
11:51hiredmanfirst creates a seq from the vector first
11:51chouserso true
11:53chousercreating a java project of my existing clojure source dir still doesn't include the src dir in the Package Explorer pain
11:59abrenkhow come you're messing around with eclipse?
12:02chouseroh, I dunno. Because I want a featureful dev environment I can extend using Clojure
12:02chouserwhich doesn't describe vim or emacs.
12:03abrenkcreating a new java project a selecting the existing clojure automatically adds src/jvm as a java source folder
12:04abrenks/a sel/and sel/
12:04sexpbot<abrenk> creating a new java project and selecting the existing clojure automatically adds src/jvm as a java source folder
12:05chouserok, I've got that now. it at least allows linking around within the java sources.
12:07abrenkchouser: then in the project's properties add src/clojure to the java build path as a source folder
12:07chouserah, cool
12:07chouserthanks!
12:10abrenkchouser: and if there were any jars built by ant around when you created the project you might want to remove them from the libraries tab
12:21abrenkLauJensen: http://logging.apache.org/log4j/1.2/faq.html#a3.5
12:22abrenkLauJensen: log4j has its complications in a container context with differenct classloaders
12:22LauJensenabrenk: So I learned
12:22LauJensenBut you'd think they would mention it on a "logging 101" page
12:23abrenkthere are articles about that dating back to 2003...
12:23LauJensenabrenk: But you started at the 101 page right? right...
12:23abrenk...so I guess they just expect everyone to know that know.
12:24abrenkthat's why they developed slf4j. to get rid of all the problems of commons-logging and log4j
12:24technomancyonly in Java-land are there more logging adapters than actual logging implementations...
12:24abrenkLauJensen: I learned about those problems the hard way, too. So please don't be offended by my 2003 comment!
12:25LauJensenThats why I love my own blog - I can mess things up, and blog about them, and never forget :)
12:25LauJensenabrenk: Im not offended. I just dont benefit from knowing that its written elsewhere, when my problem is with the introduction :) In a bit it'll by on my blog as well
12:25LauJensena bit = the time it takes tomoj to make a screencast
12:45chouserso this is definitely better in some ways than what I was doing before.
12:45chouserAny chance of jumping from a java method used in a .clj file to it's definition in a .java file?
12:45chouserecplise/ccw still
12:46LauJensensure you just press M-.... oh, in eclipse. dunno
12:49chouserLauJensen: emacs can find the correct definition for a polymorphic method call?
12:51chouserI mean, if my cursor is on the word seq in ((Seqable) coll).seq(), it can take me to Seqable.java's seq def, not any of the other dozens of .java files that define a seq method?
12:51abrenkchouser: in java files it's f3, but in clojure files that does not work
12:52chouserabrenk: yeah, I was using it in the .java files -- works quite nicely.
12:53chouserclojure being dynamically typed could be essentially undecidable in a lot of cases, but it'd be nice if it worked when it could -- static method calls for example.
12:56abrenkchouser: I guess lpetit wouldn't mind you implementing that
12:57chouserI might not mind implementing that, if I can do so in Clojure. plenty to learn first though
12:58dnolenklang: cool, many people interested in Clojure there?
13:00klangdnolen: the rules of clojure-bingo are: you get a point every time Clojure is mentioned in an otherwise unrelated talk .. at almost all the talks I attended points were given ;-)
13:01dnolenklang: nice! :D but I meant more like among attendees
13:02klangdnolen: I tink the talks specifically about Clojure was well attended (full to the max), so yes, I would say so.
13:03dnolenklang: did you see rhickey's talk? how was that?
13:04klangdnolen: very good .. shedding a bit of light on the thought behind the STM
13:05klangdnolen: .. or more .. the folly of expecting participation of places, when you want to act upon them.
13:11shooverklang: as opposed to actors?
13:13klangshoover: no. I don't think so.
13:20ninjuddalexyk: figured out how to get paren matching in cake repl. just add 'set blink-matching-paren on' to ~/.inputrc
13:20alexykninjudd: or .editrc? remember I'm on Mac with libedit
13:21ninjuddalexyk: i thought you recompiled ruby to use readline
13:21ninjuddalexyk: are you using the built in apple ruby?
13:21alexykninjudd: not yet, in fact using the built-in and editrc is respected
13:22alexykI do have MacPorts so a ruby from there should work too, I'm sure
13:22ninjuddalexyk: yeah, i'm using REE from homebrew. not sure how to do paren matching in libedit
13:24alexykninjudd: I have a more serious question about protobuf performance. This func was loading a 600 MB tokyo cabinet OK of int maps, chokes on 1.6 GB of double maps: http://gist.github.com/613717
13:26alexykit fills the whole 30 GB JVM with compressed oops
13:26ninjuddcan you gist to .proto file?
13:26alexykthe fun part is, I wrote the cabinet easily from same JVM!
13:27alexykadded
13:28alexykthe top level data is a map string -> daily doubles, which is a map int->double
13:29alexykso I can write with pmap and creating protobufs, but I can't read back -- something's exploding in protobuf creation perhaps
13:29ninjuddalexyk: you're saying int -> int is fast, but int -> double is slow?
13:30alexykninjudd: yep. Also writing is reasonably fast, reading just hangs for the same cabinet
13:30ninjuddalexyk: do you still have the problem if you remove [(map) = true]?
13:30alexykninjudd: what will happen then? I thought I need it for the maps to serialize properly?
13:31ninjuddalexyk: just remove it and do a read test to see if that is the problem
13:31ninjuddalexyk: you may want to play with the tc bnum too
13:31alexykninjudd: with the same data?
13:32alexykmeaning read back what I created already with [(map...]?
13:32ninjuddalexyk: yes
13:32alexykkk
13:33ninjuddalexyk: you likely need to increase the bnum though, the default isn't very big
13:34alexykninjudd: how do we do comments in protos?
13:35ninjuddalexyk: //
13:37alexykthx... didn't know about bnum, will have to play
13:38alexykninjudd: btw, one issue might have been a cake JVM hung in GC -- it didn't go away and cake kill all failed to stop it, as did cake stop, restart, etc.
13:39bartjis there a blog which picks insightful conversations from Clojure IRC logs ?
13:40LauJensenbartj: No, but its a good idea
13:40LauJensenHow about at small web interface where you just picked start datetime -> stop datetime and then it blogged? :)
13:41bartjLauJensen, since I am learning so much here...I thought it would be nice thing
13:41alexykbartj: grep chouser|rhickey will do :)
13:42LauJensenalexyk: thats definitely a start :)
13:43alexykLauJensen: |LauJensen too of course :)
13:43LauJensenhaha, nice try
13:44chouserthe log page already supports start/end times, though the up/down arrows code goes a bit wonkey
13:44chousershould add list of nicks to filter on, per cemerick's suggestion the other day.
13:44alexykdetecting what's a conversation is big research, not to mention insightfulness
13:45LauJensenalexyk: I think there's at least one guy in here who could do it
13:45bartjalexyk, I have been thinking about that for a while too :)
13:45LauJensenAWizzArd: What do you think?
13:45alexykI know folks who got grants to detect IRC conversations
13:46bartjalexyk, omg
13:46LauJensenalexyk: Just to detect a conversation? I could do that in 50 lines of code :)
13:46LauJensenor 2000 in Scala if you like
13:46alexykLauJensen: try it when I don't mention you :)
13:47alexykLauJensen: Scala will crawl out of Skagerrak and devour you one night
13:47alexyk:)
13:47LauJensenalexyk: Skagerrak? It tried, I bitchslapped it with parentheses, or didnt you see that blogpost? :) Oh wait, that was Python
13:47alexykit moonglights as a sea monster and is not amused at being made fun of by clojurers
13:48LauJensen"Clojurians"
13:48AWizzArdLauJensen: one sec, just came back home from work
13:48bartjLauJensen, what is this skagerrak you talk about ?
13:49LauJensenbartj: Its a place in the north of jutland, not far from where I grew up. Actually I partly grew up there
13:49alexykhttp://en.wikipedia.org/wiki/Skagerrak
13:49AWizzArdLauJensen: ah, I see what you mean. I can't say anything about it, especially not in public. It's more targetted at you :)
13:50LauJensenAWizzArd: Fine :)
13:51bartjok
13:52LauJensenalexyk: Which are?
13:53alexykthat Skagerrak and Kattegat came to mind right away! From like 8th grade :)
13:53LauJensenNice
13:54LauJensenYou're not in 9th grade now by any chance? :)
13:54alexykLauJensen: in about 36th by now :)
13:55alexyknot to mention the Battle of Jutland, of course, where teh British navy was so soundly trounced
13:55LauJensenhehe, Denmark has a pretty bad track record when it comes to fighting. I think I think we're probably the first in the world
13:56LauJensenAnd as Chouser reminded me, our country is invaded right now and we're just playing WWII all over again, doing nothing :)
13:56kryftalexyk: Hi again, Alexy. What kind of performance can I expect from clojure for numerics? (I got the impression yesterday that you have some experience in this area)
13:57alexykninjudd: well JVM quickly eats up all its memory :( I don't know if bnum should help, but I'll try
13:57klangVi bringer hilsner til Peter, Hanne, Anders, Birgitte, Liv, Olaf, ..
13:57alexykkryft: I'm pretty nonnumeric yet, but from the infer/incanter I see they use Colt which is fairly strong-ish :)
13:57LauJensenkryft: You can expect exactly the same performance as Java in version 1.3. You can pass and return primitives
13:58bartjI am looking at the clojure logs
13:58alexykklang: aren't you a Scala guy?
13:58kryftLauJensen: Hmm, and how far is Java from (say) C these days?
13:58LauJensenkryft: As fast, soon faster according to Cliff Clicks talk last night
13:58klangalexyk: no, I'm pretty hooked on Clojure ..
13:59kryftLauJensen: Ok, great. :)
13:59alexykklang: OK, I'm mixing some tweets probably :)
14:00kryftEven if clojure were as slow as matlab, I'd still want to use it, but if I can get performance fairly close to C, there's no reason not to use it for everything. ♥
14:00klangalexyk: I was not fast enough to get 'klang' on twitter :-(
14:00LauJensenkryft: thats certainly true
14:00alexykkryft: well OCaml and Haskell still beet it by a factor of about 2 in my huge benchmark to be published this month
14:00LauJensenActually Im planning a blogpost about fast numerics coming up soon
14:01LauJensenalexyk: Im guessing your not using primitives then ?
14:01alexykLauJensen: not numerically, datastructures and iterations
14:01LauJensenOk, look forward to seeing and debunking it
14:01alexykLauJensen: absolutely
14:01kryft:)
14:02alexykLauJensen: if I raise $$$ for Conj, I hope to show it then if given an opportunity
14:02KirinDavetechnomancy: Hey, quick emacs question. do you know why slime-mode might refuse to fire when hooked into a clj buffer?
14:02LauJensenI actually did a blogpost where Clojure eventually outperformed Haskell on something like fibonacci or something similar, man did I get flooded with emails from Haskaloonies flaming me about not using the correct compiler switched etc etc
14:02alexykit is the largest program ever in Haskell in terms of memory usage and overflown its GC
14:02kryftalexyk: Even if that were the case, a factor of 2 is not too bad. :)
14:02alexykClojure is OK memory-wise :)
14:02LauJensenwow
14:02KirinDavetechnomancy: I have this thing where slime-mode doesn't understand namespaces and stuff, and it really messes with my completion. Slowly driving me mad.
14:03tomojKirinDave: any metadata at all in the ns?
14:03KirinDavetomoj: No
14:03tomojfound it it's not just docstrings that break it
14:03tomojshoot
14:03KirinDaveEven naive (ns namespace) lines don't register. It still says [Clojure user] in the modeline.
14:04technomancyKirinDave: I've only ever heard of that happening with weird metadata being added to the ns
14:04technomancybut ns detection uses a regex, so it's not the greatest mechanism
14:05KirinDavetechnomancy: I am basically at a loss. I don't understand what I have to do to fix this. I'm using new swank, only elpa, and nothing fancy in my config.
14:05KirinDavetechnomancy: But it means completion in buffers is broken, etc.
14:05LauJensenKirinDave: By completion you dont mean dabbrev-expand then?
14:06technomancyKirinDave: if you want to debug you can look into the clojure-find-package namespace and see what it returns
14:06KirinDaveLauJensen: I mean slime-complete-symbol
14:06technomancysorry, the clojure-find-package defun (in elisp)
14:07KirinDavetechnomancy: It seems to understand that it should be the right package.
14:07LauJensenKirinDave: ah ok
14:07technomancyKirinDave: and slime-find-buffer-package-function is set to that function?
14:08KirinDavetechnomancy: I'll check
14:13bobo_LauJensen: the urls in your atom feed seems wrong
14:13LauJensenbobo_: Yea I've had some trouble with the feed today
14:14bobo_i liked your 404 anyway :-)
14:15KirinDavetechnomancy: http://cl.ly/2hXm
14:15LauJensenThanks -On the upside I get to show it off until I find time to fix this
14:18technomancyKirinDave: it should be different inside a clojure-mode buffer
14:18mvidis there a way to have leiningen pull the latest stable version?
14:18technomancymvid: yes, using version ranges, but it's usually a bad idea
14:19KirinDavetechnomancy: I M-: and type in that function name while in a clojure buffer and it comes up the same.
14:19mvidtechnomancy why is it a bad idea?
14:20technomancyKirinDave: there's your problem; that should be getting set by clojure-mode near the bottom
14:20technomancyoops; gotta jet
14:25KirinDaveNow I've made it even worse
14:35KirinDaveSo i can get clojure-mode to assert itself if I run clojure-mode-enable-slime-for-open-buffers
14:35KirinDaveBut before I run that, it won't do anything
14:45raekKirinDave: quick question, do you use auto-complete?
14:45KirinDaveraek: No.
14:45KirinDaveI mean, I use complete-symbol
14:45KirinDave(or I used to)
14:45KirinDaveit's sorta working now.
14:46raekhttp://github.com/purcell/ac-slime caused some problems for me (the namespace-file association didn't work)
14:50cemerickuncles?
14:50cemerickchouser: I think we should show up to the conj wearing those "old guys rule" tshirts
14:50chouserheh
14:56LauJensenoh hi chas :)
14:56hvWhat is the current solution for the jvm slow startup problem? Is nailgun still the only solution?
14:57LauJensenhv: in which setting?
14:57hvLauJensen: which setting has a better solution?
14:58LauJensenhv: For building applications, for running them, for development?
14:58hv(since you asked about the setting I interpreted that there is a setting that has a better solution)
14:58hvrunning, and also probably development
14:59arkhif I have a (defrecord R [one two]) and (let [r R. (1 2)] ... ), is it more common to refer to 'r' as (:one r) or (r :one) ?
14:59LauJensenOk, for a desktop program you can use the switch -client, then the jvm starts in about 1 second. Though using a different optimizer
14:59LauJensenhv: For development, just use swank
14:59arkher .. should be (let [r (R. 1 2)] ... )
15:00defnAnyone here check out George Jahad's CDT?
15:00hvLauJensen: I often use swank, but sometimes I need to run programs outside emacs.
15:00defnWow.
15:00LauJensenarkh: (:one r) unless you implement invoke for your record. keywords are functions, your record is not a function taking a keyword
15:00LauJensendefn: I checked out his screencast
15:01LauJensenhv: I dont follow... outside of Emacs?
15:01arkhLauJensen: thank you
15:01defnLauJensen: pretty impressive stuff.
15:01LauJensendefn: extremely much so, yea
15:02defna fancy (dbg ...) macro is nice, but wow -- showing you the java source and everything... pretty amazing.
15:02LauJensenyea, and evaluating individual lines of java, just wow
15:02LauJensendefn: team up with mrBliss
15:02hvLauJensen: what is the swank equivalent of "stuff | java -cp '...' clojure.main your-script/main | other stuff"
15:03LauJensenhv: dunno
15:03defnLauJensen: link?
15:03LauJensendefn: link to mrBliss ?
15:03LauJensendefn: he's the guy who wrote this: http://github.com/mrBliss/dotfiles/blob/master/.emacs.d/clojure.el
15:03defnmrBliss: oh I didn't see you there -- do you have a github repo for what you're working on?
15:03LauJensenHe's lurking in here atm
15:03defnty LauJensen
15:03LauJensendefn: Im like, soo much ahead of you
15:04LauJensen:)
15:04defn:D
15:04mrBlisswhat Lau posted is all I got
15:04hvumm, what is CDT?
15:04RaynesClojure Debugging Toolkit
15:04RaynesOr something similar.
15:04defnmrBliss: Let's start a google doc and link to gists/dotfile repos that have ideas we could role up into a single clojure.el
15:05defnmaybe have some options from clojure.el to turn on and off lein functionality, toggle testing frameworks, etc.
15:05mrBlissdefn: good idea
15:05LauJensendefn: ehm, try cake
15:05defnLauJensen: I use cake
15:06defnthat was why i suggested turning on and off lein, toggles and such -- it'd be nice to say "I use lein -- integrate things." or "I use cake -- make it work."
15:06mrBlissI'm not that proficient in Elisp, I'm just good at scavenging other people's dotfiles ;-)
15:06mrBlissbut a standard clojure.el for beginners (and advanced) users is a good idea
15:06defnmrBliss: same here -- but it's not too hard to learn. I just hate the regexen.
15:07mrBlisstrue that
15:07LauJensendouble true
15:07defnI think that's a song...
15:07LauJensenRaynes: You've been very absent the last days havent you ? Started sleeping at night again ?
15:07defntrue that. // (double true)
15:09defnmrBliss: http://gist.github.com/613890 -- that's a mess I made while adding things to technomancy's starter-kit
15:10defnhttp://gist.github.com/337280 is worth a peek
15:11mrBlissI remember having those commented out lines (L43 etc) in my clojure.el for months. I removed them because I heard somewhere that fuzzy matching doesn't come with slime from ELPA
15:11jashmennif im defining a method in extend-type can i / how do access 'super' ?
15:11hvbtw, is there an easy way to eval clojure code in arbitrary emacs buffers?
15:11mrBlissdefn: a good start would be figuring out what each line/form exactly does, so we can purge the redundant crap
15:13defnmrBliss: to me a nice clojure.el includes the ability to have CDT running, a swank connection for your project, and possibly a continuous integration-style test framework like lazytest
15:13defnso you can say M-x start-lazytest, M-x start-cdt
15:13defnor something like that
15:14hiredmanyou might want to checkout http://github.com/technomancy/durendal too
15:15mrBlissI saw the CDT screencast and honestly, I don't see what's so special about it. (I was a bit distracted while watching)
15:15mrBlisshiredman: was thinking of using durendal too
15:15defnhiredman: beautiful
15:15defntechnomancy: double beautiful
15:15mrBlissI have durendal-dim-sldb-font-lock in my clojure.el but I see no effect
15:15alexykninjudd: would bnum help with GC overhead anyhow?
15:16_rata_what's CDT?
15:16LauJensen_rata_: scroll up 25 lines or so :)
15:16_rata_ok
15:17ninjuddalexyk: tokyocabinet does not get garbage collected. it is in C
15:18alexykninjudd: exactly, so what I think is filling up JVM upon read is either its JNI or protobuf :)
15:18ninjuddalexyk: you have the same problem without [(map) = true]?
15:18alexykninjudd: seems so
15:21RaynesLauJensen: I've been sleeping at night, yes, but that isn't why I've been inactive. I've just been busy for the past couple of days.
15:23RaynesLike today. Doctor's appointment. This particular doctor is never in a hurry, so I'm sure to not be back until around 10pm.
15:24hvcemerick: what are the improvements?
15:25hiredman((IFn)RT.var("some", "fn")).invoke();
15:28cemerickhv: little stuff: there should be an RT.var or Var.find that takes a single string; an IFn wrapper should be available that catches Exceptions and rethrows unchecked ones; there are other small things that I can't remember at the moment
15:29hvyeah, I agree
15:30cemerickoh, there should be an RT.require
15:30chouserhow about a Clojure class for Java-facing static methods to live in?
15:30cemerickaside from RT, you mean?
15:31cemerickso people don't have to wade through *everything* ;-)
15:31chouserhm, would that unecessarily bifercating things? I dunno, just brainstorming.
15:31cemerickno, I think that's a great idea
15:31mrBlissdefn: I'll start rebuilding my clojure.el (adding function by function from my current clojure.el) and I'll try to document each setting.
15:32chouserClojure.require(), Clojure.evalString("(...)")
15:32defnmrBliss: Want me to make a github repo?
15:32chousermaybe it's actually a seperate lib
15:32cemericknah, I want that everywhere
15:32mrBlissdefn: as soon as we have something tangible
15:32cemerickit's just a cleaner delegate for RT
15:33cemerick*with javadocs*! :-P
15:34defnso there is lazytest, clojure.test, and ive seen a couple others -- failing to remember them now...
15:34duck1123circumspec
15:34defnno one has touched that since April unfortunately
15:35defnConducta is another I guess
15:35defntesting frameworks are the new irc bot
15:36mrBlissdefn: Conducta is even older (Jan 2009)
15:36defnhttp://github.com/marick/Midje
15:37mrBlissI've seen a screencast about Midje's emacs mode
15:37defndoes it do continuous testing?
15:37TeXnomancyif you're already in Emacs, continuous testing is easy with an after-save-hook
15:37TeXnomancydoesn't need to be supported by the test lib
15:38mrBlissdefn: don't know, haven't looked into it yet, still on my todo list (TeXnomancy: good to know, thanks)
15:38defnTeXnomancy: right, but having a nice easy way to turn it on for multiple testing frameworks would be nice OOTB
15:39defnTeXnomancy: what was that plugin that played harmonic tones if your tests passed?
15:39jjidois there a (forget) function for the interactive prompt?
15:40antares_technomancy: hey
15:40cemerickchouser, bv: http://www.assembla.com/spaces/clojure/tickets/452
15:41defnthat's too bad -- I can't seem to find it anywhere now...
15:41cemericker, hv ^^
15:41defnsomeone created an awesome little lein plugin that would play dissonant notes for the number of failed tests
15:42defnan audio feedback look
15:42defnloop
15:43MayDaniel_defn: lein-play ?
15:43defnMayDaniel_: no this was more interesting
15:44defnif your tests passed it would play (midi i think) a nice consonant chord
15:44defnif your tests failed it was become dissonant
15:44defnbut it changed depending on the number of passes/fails
15:44defnit was really smart and interesting
15:44defnalas I can't find it on github anymore
15:50defnfound it! http://github.com/bgruber/lazytest-listen
15:51mrBlissdefn: gotta go now, but I'll certainly continue working on clojure.el :-)
15:52defnmrBliss: pm me just to remind me
15:52mrBlisswill do
15:53mrBlissbye for now
15:53defnciao
16:12_rata_is there any way in clojure to develop a GUI that can be compiled (without modifications or with small ones) to be a web page (RIA) and a traditional GUI? is anything like that in any programming language indeed?
16:12jjidoI used (def x (with-meta ... {:type (var myclass)})) ... @(type x), now I have a new class created by a function. Can I use {:type (var (somefunc 1 2 3))}? What else?
16:13bobo__rata_: i think that was one of the goals with javafx
16:14hiredmanjjido: no you don't
16:14_rata_bobo_, and does it do a good job work?
16:14_rata_s/work//
16:14sexpbot<_rata_> bobo_, and does it do a good job ?
16:15_rata_hahahaaha... thanks sexpbot
16:15bobo__rata_: well... havent seen any real example. and javafxscript is canceld to be replaced with a java api that doesnt exist yet :-)
16:15jjidohiredman: ref then?
16:16hiredmanjjido: what about it?
16:16bobo__rata_: but if you write a very thin gui and abstract away everything. the result will be alot nicer for not that much more work, fi you wirte a separate gui for web and thick
16:16jjidoI used (def x (with-meta ... {:type (var myclass)})) ... @(type x), now I have a new class created by a function. Can I use {:type (ref (somefunc 1 2 3))}?
16:16hiredmanno you don't
16:17jjidommh, why?
16:17hiredmanwhy what?
16:19raekjjido: can you show some example of how this is used?
16:19jjidoraek: I need to cook up something a little simpler, one minute
16:20raekI can see that you are attempting to do some kind of custom type tagging system
16:20hiredmanthe are at least two things wrong with what you said, so your simple case will undoubtably have more things wrong with it, I suggest you spend more time reading docs
16:21bobo_http://gist.github.com/613998 is that possible to make it work? ie appending id to the key for the selector?
16:25dnolen,(keyword (str "div#" "foo"))
16:25clojurebot:div#foo
16:25dnolenbobo: ^
16:25dnolen,[(keyword (str "div#" "foo"))]
16:25clojurebot[:div#foo]
16:26dnolen,(let [id "foo"] [(keyword (str "div#" id))])
16:26clojurebot[:div#foo]
16:28dnolenjjido: yeah you're going to have to explain what you're doing. ah-hoc typing maps via metadata and Java classes don't have much in common.
16:31bobo_dnolen: awesome thanks
16:34jjidoso it starts like that http://gist.github.com/614023
16:38chouserjjido: what are you trying to accomplish?
16:38jjidochouser: that is some code I use to translate my own language into Clojure code
16:38jjidoI mean, to represent my own language?
16:41chouserit looks like you're trying to devise your own method distpatch mechanism, but I don't understand how you want it to behave.
16:43jjidoupdated the gist. Yes I have my own dispatch. The names ending in "Class" represent classes with class fields and methods.
16:45chouserwhat are you trying to do?
16:47chouserwhat is the :type metadata value supposed to represent?
16:47raekone piece of advice: clojure tend to keep as much as possible unconflated with types. for example: hierarchies, dynamic dispatch (multimethods), objects holding data are ordinary maps, rather than one class for each "thing" that data can be about...
16:48raeknow to the point: it is not necessary to use records for normal data representation
16:49raekI think very many (of not most) Clojure programs can be written entierly without records
16:50raekif they don't implement any protocols, they aren't much more that maps
16:51raek</rant-by-guy-that-got-into-clojure-before-1.2>
16:51raek:-)
16:52chouserheh
16:52tomojdon't they get faster access times?
16:52tomoj(not to suggest we should turn all our maps into records for that reason...)
16:53TeXnomancyI don't think they get faster access times, just that they save a bit of memory by storing the keyset once
16:53TeXnomancyif you've got loads of em
16:57jjidoI used to implement protocols, but I had to remove them
16:58jjidoeither they did not relate well to what I wanted to define or they were not flexible enough
16:58fliebelTeXnomancy: So isn;t that the same thing as structs?
16:58tomojwhat's the thing where a literal keyword access is optimized somehow? for all maps?
16:59jjidothe program I posted doesn't work, don't know what I do different
16:59TeXnomancyfliebel: it's the same speed improvement, yes. modulo protocols I think they are very similar
16:59TeXnomancythat is to say: protocols are what make records interesting
16:59chouserlookup by keyword on a record can be as much as 30x faster than lookup on a small array-map
17:00raekrecords are stored in a more compact manner, since the fields are real instance variables of the resulting class
17:00chouserBUT don't even begin to think about that until your concepts are proven, such as by having code that works
17:02dnolenjjido: that seems overly complicated, and it's still not clear what the 'point' is.
17:03dnolenjjido: and by that I just mean, what are you trying to accomplish
17:05tomojdnolen: "Since Aleph conforms to Ring, you could just use Compojure's routing library." that works for routing synchronous requests, but what about async? I mean, the channel won't thread through moustache's app handlers
17:06jjidodnolen: I want to use my own type definitions, my own dispatch and be able to manipulate said type by "overriding methods" (which translates into replacing the function associated with a keyword in the type)
17:06dnolentomoj: I think Brenton Ashworth is discussing that very thing on the Aleph ML
17:06dnolentomoj: plus I would talk to ztellman about that anyway ;)
17:06dnolenjjido: purely for educational purposes?
17:07jjidodnolen: no, that's my first implementation of my language.
17:07dnolenjjido: ah you want to implement a language on top of Clojure?
17:08jjidodnolen: yes
17:12dnolenjjido: you're going to have to familiarize yrself some more with deftype/defrecord and ad-hoc typing first off. and then decide if the approach you're taking is the right one, to me it seems overly convoluted.
17:14dnolenjjido: I would first use those technique in an idiomatic way and see how they would actually fit in whatever framework yr trying to build. I've never seen any try to combine ad-hoc typing, defrecord, vars, and maros in the way you've combined them in yr gist.
17:14dnolens/any/anyone
17:16jjidodnolen: when I tried using protocols I found that multimethods cause name clashes
17:16jjidothen I found that there is no (letrecord) or (letprotocol)
17:17raektemporary types?
17:17jjidoraek yes
17:18raekI can't recall that I have seen that in any language... (if you don't count private types)
17:18chouserwhy aren't you just using maps of functions?
17:18jjidomy example was supposed to show a temporary type
17:18dnolenjiddo: hmm, what did trying protocols have to do with multimethods?
17:18jjidochouser: I am close to that
17:19amalloyspeaking of protocols, is there a protocol or a multimethod for arithmetic? eg a Numberable protocol for custom types, or a multimethod for + [type1, type2]?
17:19chouseramalloy: nope
17:19jjidodnolen: when you implement a protocol, you use the multimethod mechanism to select the appropriate function body
17:20jjidowell it looks that way
17:20chouseramalloy: But you can have your own + in any namespace you want
17:20dnolenjjido: not true at all
17:20raekamalloy: there is this, though: http://clojure.github.com/clojure-contrib/generic.arithmetic-api.html
17:20dnolenjjido: protocols and multimethods are conceptually related, but not in usage at all.
17:21raek"alternate" arithmetic fns, that are extendable
17:21jjidodnolen: ok I jumped to conclusions.
17:23raekyou can do an awful lot of things with only maps and functions...
17:24dnolenjjido: multimethod are a generic dispatch mechanism, you can provide you're own dispatcher.
17:25jjidodnolen: I am not sure I understand what you're saying, but it sounds interesting
17:25lancepantzlol
17:26amalloythanks raek. i don't have a need to do this in any real code atm, i'm just trying to see how close to a built-in type i could make complex numbers, for rosettacode
17:27dnolenjjido: you can provide your own dispatch fn. that means you can dispatch on whatever you want, type, length, whether something conforms to a protocol, wether an argument is divisible by 3, etc.
17:28arkhare there times, other than closures, when memory is not 'guaranteed' to be freed by moving out of something's lexical scope?
17:30cemerickholding onto the head of a realized lazy seq can certainly lead to more allocation than one expects
17:31amalloyarkh: dynamic bindings, right?
17:31amalloy,(doc with-bindings)
17:31clojurebot"([binding-map & body]); Takes a map of Var/value pairs. Installs for the given Vars the associated values as thread-local bindings. The executes body. Pops the installed bindings after body was evaluated. Returns the value of body."
17:31arkhamalloy: yes, with (let) in my case
17:32arkhamalloy: oh ...
17:32amalloyarkh: but let is lexical, not dynamic. my point is that dynamic bindings extend beyond lexical scope, or are sorta orthogonal to it, depending how you think about it
17:33arkhamalloy: ok, that makes sense
17:33arkhI'm doing some java interop and because I'm not doing any of the above, I should probably look at my use of Java for the memory leak I'm seeing
17:43jjido,(doc def-multi)
17:43clojurebotIt's greek to me.
17:43jjido,(doc defmulti)
17:43clojurebot"([name docstring? attr-map? dispatch-fn & options]); Creates a new multimethod with the associated dispatch function. The docstring and attribute-map are optional. Options are key-value pairs and may be one of: :default the default dispatch value, defaults to :default :hierarchy the isa? hierarchy to use for dispatching defaults to the global hierarchy"
17:43plathropThe clojurebot makes me happy
17:43jjidolol
17:45jjidoMy gist now runs, I fixed it http://gist.github.com/614023 . I may find another way of doing it but for now it seems ok.
17:58jjidoCan a macro insert a newline character in the code? I have trouble with line numbers for errors
18:01raekjjido: macros don't work on text
18:02jjidoraek: all right, this one does postwalk-replace
18:04amalloyclojurebot: botsnack
18:04clojurebotthanks; that was delicious. (nom nom nom)
18:04amalloyplathrop-away: ^^
18:06jjidoclojurebot: botbed
18:06clojurebotTitim gan éirí ort.
18:06jjidommh, I tried.
19:05konrIs there an http client that can handle sessions and cookies, like cURL does?
19:06AWizzArdIs there a foo that does (foo keyword? [[1] [2] [3] :x 1 :y 2]) ==> (([1] [2] [3]) (:x 1 :y 2))? I thought about something like 'split-at-first'
19:07AWizzArdSplitting a sequence into two as soon an element with specific properties is found?
19:22tomoj,(split-with (complement keyword?) [[1] [2] [3] :x 1 :y 2])
19:22clojurebot[([1] [2] [3]) (:x 1 :y 2)]
19:26AWizzArdyes, that seems good
19:29AWizzArdtomoj: good idea
19:29amalloyAWizzArd: partition-by also works, depending on what behavior you want
19:30amalloy,(partition-by keyword? [[1] [2] [3] :x 1 :y 2])
19:30clojurebot(([1] [2] [3]) (:x) (1) (:y) (2))
19:30amalloyoh nm, i see that's not the behavior you want :P
19:33AWizzArdamalloy: yes, partition-by is what I used first (let [[f & xs] (partition-by …), map (apply hash-map (apply concat xs))] (calculate-something-with f) (be-happy-with map))
22:01scottj,(mapcat (fn [[a b]] (vector (inc a) b)) (partition 2 [1 2 3 4]))
22:01clojurebot(2 2 4 4)
22:02scottjIs there a shorter version of that, where inc would be any one arg fn?
22:05tomojhmm
22:05tomoj,(map #(if (even? %2) (inc %1) %1) [1 2 3 4] (range))
22:05clojurebot(2 2 4 4)
22:05tomojbit shorter
22:06scottj,(map-indexed #(if (odd? %1) %2 (inc %2)) [1 2 3 4])
22:06tomoj,(map-indexed #(if (even? %1) (inc %2) %2) [1 2 3 4])
22:06clojurebot(2 2 4 4)
22:06clojurebot(2 2 4 4)
22:06tomoj:)
22:07scottjthanks
22:55duck1123What do I need to do if I want to import a class named Object?
22:56duck1123is there a way to exclude importing classes in java.lang.*
23:02tomojwhy the hell did someone make a class named Object?
23:02tomojtry (ns-unmap *ns* 'Object)
23:03tomojor you could refer to it fully qualified
23:03tomoj(def NotObject foo.bar.Object)
23:03duck1123that seemed to do it
23:03tomojwonder if you can do (NotObject.) after that
23:04tomojnope, you can't
23:04duck1123doesn't seem like it
23:52_rata__how do I change the indentation for a form in emacs? (I'm using swank-clojure)
23:52_rata__I'd like the (complex [] ...) macro from fnparse library to be indented like let