#clojure logs

2010-07-14

00:00miltondsilvaI know it's hard...
00:01technomancywell, it's a fact that referential transparency results in more maintainable code all other things being equal
00:01technomancybut sometimes you care so much about performance that you are willing to sacrifice maintainability for it.
00:01miltondsilvabut I honestly get the felling that there is a right way of doing things... and that that can be proven
00:02tomojhave to define "right" before you can prove anything :(
00:02jhawk28you are assuming that programming is science or engineering
00:02jhawk28but it also has a strong craft side
00:03miltondsilvaright means: more maintainable, more performance, less hours to produce a solution
00:03jhawk28how can you get 2 groups of similar expertise to be able to do a side by side creation of the same product in 2 separate languages
00:04jhawk28and then see anything other than weak correllations
00:04technomancywell sometimes you just have to choose between maintainability and performance.
00:05wwmorganActually, the peopleware people did such a study. I believe the result was that language choice didn't matter, except for those who wrote in assembly (they took longer). Lemme see if I can find it
00:06jhawk28relavance was supposed to do something like it with clojure, not sure I saw the result
00:07miltondsilvatechnomancy don't you think.. that the more complex systems get the harder it will become to "optimize" by hand?
00:09miltondsilvajhawk28 the idea would be to choose a large sample... and to have a questionare where you could get data about the people involved in the experiment
00:09jhawk28but the best coders skew the dataset
00:10jhawk28so is it because of the language or that the language just attracts better coders
00:10miltondsilvaI woudl think that by making good use of statistics I could get some useful data?
00:11wwmorgandemarco and lister studied the relationship between language choice and productivity. peopleware 2ed, chs 1 and 2
00:11miltondsilvajhawk28 .. ok that's a valid point
00:12miltondsilvawwmorgan thanks.. i'll look it up
00:14miltondsilvajhawk28.. on the other hand.. maybe the language actually made them better programmers.. at least I feel a bit like that towards clojure
00:14DeusExPikachuwhy can't I do this? (def z (let [d 3] (fn [] d))) (eval `(identity ~z) --> java.lang.ExceptionInInitializerError, if z didn't have a closure, than it works
00:19wwmorganDeusExPikachu: what does the working code look like?
00:19DeusExPikachu(def y (fn [] 3) (eval `(identity ~y))
00:20DeusExPikachuputting the fn in a closure causes problems
00:20wwmorganhm. I get the same error on both snippets
00:20qbgHaving a literal function in the source code is not typical
00:21DeusExPikachuqbg, it works normally just not if its a closure
00:23wwmorganwhat version of clojure?
00:23DeusExPikachuwwmorgan, 1.2.0-snapshot
00:23DeusExPikachunot the latest though
00:24DeusExPikachulike a week old or so
00:25DeusExPikachuhmm according to git its up to date
00:30technomancyclojurebot: who knows what eval lurks in the hearts of men?
00:31clojurebotsingle-segment namespaces is unsupported. (foo instead of foo.core) they may work in a few circumstances, but you shouldn't rely on them.
00:32tomojDeusExPikachu: imo that it works in some cases is strange and you shouldn't rely on it
00:33DeusExPikachutomoj, is there a rule against evaling function literals?
00:33tomojthere are no function literals
00:34wwmorganthat it works at all for the no-closure case is surprising and new in 1.2
00:39tomoj,(eval +)
00:39clojurebotDENIED
00:39tomojoh, of course
00:39DeusExPikachuso what should I do instead of (eval `(some-fn ~(my-map :keyword)))?
00:39DeusExPikachuI'm trying to generate optimized fns
00:40tomoj(my-map :keyword) is a fn?
00:40DeusExPikachutomoj, yes
00:40qbg(some-fn (my-map :keyword))
00:41DeusExPikachuits more like (eval `(fn [] ~@(bunch of fns)))
00:41DeusExPikachuand bunch of fns depends on runtime-params
00:42tomojI have no idea what you mean :(
00:43DeusExPikachutrying to do (eval `(fn [] ~@(filter some-pred collection-of-fns)))
00:43DeusExPikachushould expand to, (fn [] (fna) (fnb) (fnd))
00:44DeusExPikachuso really I'd need a for, not a filter
00:44qbgHave collection-of-fns be the list containing the code for the calls
00:49DeusExPikachuso coll-of-fns turns to coll-of-calls, that means there is a lookup for each fn though
00:49DeusExPikachucause my fns are not mapped to a symbol, they are in a map
00:50wwmorganDeusExPikachu: what sort of predicate do you want to run on a fn?
00:50DeusExPikachusimple keyword predicate
00:51qbgIf you want direct binding, produce a closure
00:51DeusExPikachusorry, the predicate is not on the function, its on a map of fns
00:52DeusExPikachuqbg, do you have a code snippet example?
00:53qbgTake a look at http://clojure.github.com/clojure-contrib/macros-api.html#clojure.contrib.macros/with-direct-linking
00:54qbgEssentially, if you call a let-bound symbol, that call should be direct
00:56DeusExPikachuso I can put the literal fns in the "bindings" of the let?
00:57qbgNope
00:57qbgYou have to put the code to get the function there
00:58DeusExPikachuah I see now
00:58DeusExPikachucool, thanks
00:58DeusExPikachuits not a typical thing to do I know
02:12semperosusing slime to connect to swank (started with lein swank in a leiningen-managed project)
02:12semperoswant to set the Java heap to allow more memory use
02:12semperoscan anyone provide an explanation or point me to somewhere with one?
02:14bozhidarsemperos: http://osdir.com/ml/clojure/2010-07/msg00093.html
02:15semperosbozhidar: many thanks; that makes sense
02:22semperosby just adding the usual -Xms and -Xmx args to that last command in the lein executable, not seeing any difference in performance of my script
02:24semperossorry, not true
02:25semperosjust filling up that heap space rather quickly
02:25semperosthanks again; back to better coding
02:25bozhidarnp
02:42nathanmarzcan someone explain to me why this is invalid code? (try 1 (finally (for [a [1 2 3]] (println a))))
02:42nathanmarzi get java.lang.UnsupportedOperationException: Cannot recur from catch/finally
02:51bartjnathanmarz: why would you use a for in "finally" in the first place ?
02:51bartjnathanmarz: since, you wouldn't expect a "finally" to return a lazy sequence as "for" does
02:54nathanmarzwell, that was just an example
02:55nathanmarzin the code that ran into the problem my finally was doing a (dorun (for ...)) to cleanup some files
02:55nathanmarzi was able to move the cleanup code into a separate function and have it work but found it weird that it's invalid in the first place
03:12semperosshould probably stop coding at 3am, but still learning
03:13semperosI have an agent
03:13semperoswhich is a map
03:13semperosall values are integers
03:13semperosgiven a keyword
03:13semperosI want to increment the respective value
03:13semperosI know (send) takes the agent, then a function to apply to the state of that agent, and then arguments to that function
03:14semperosbut I'm just not putting it all together with (assoc), etc.
03:14semperosany help appreciated for complete newbie
03:16mikem(send agent #(assoc % :key (inc (% :key))) -- would that work?
03:17hoeck(send <agent> update-in [<key>] inc)
03:17semperosah, update-in
03:18semperoswas the answer to my last agent question as well
03:18semperosmikem: that was the general idea I was following; trying to get the state in an anonymous function
03:18semperosbut hoeck, I like that; keeps the send syntax legible
03:18semperosthanks to you both
03:18mikemyah, hoeck's is nicer :) and i learned about update-in
03:19semperos:)
03:20semperosah, a vector of keys...
03:20semperoskeep killing my agents
03:21hoeckyeah, update in is very powerful, works on vectors and nested structures too
03:22hoeck,(update-in [1 {:a 1} 3] [1 :a] dec)
03:22clojurebot[1 {:a 0} 3]
03:22semperosright
03:22semperosvery nice
03:22mikemah cool, the list of vectors is a list of "nestings to traverse"
03:24mikemsemperos: how do you handle the case where the key does not exist in your map yet?
03:24semperosjust looking at that :)
03:24semperosget and get-in look nice
03:25semperosreturn value mapped to key if there, nil if not
03:26hoeck,fnil
03:26clojurebot#<core$fnil clojure.core$fnil@5550c2>
03:26hoeck(doc fnil)
03:26clojurebot"([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."
03:27hoeckcool, fnil is finally in core!
03:27semperoshoeck: high five; thanks again
03:27hoeck,(update-in {} [:a] (fnil inc 0))
03:27clojurebot{:a 1}
03:27semperosnice
03:28semperoswhere was it previously?
03:28hoecksemperos: np, now I have to do some refactoring too :)
03:28mikemhoeck: that's perfect :)
03:28hoecksemperos: it was a ticket on assembla
03:28hoeckhttps://www.assembla.com/spaces/clojure/tickets/257-add-fnil-for-wrapping-functions-to-handle-nil
03:28semperosgotcha
03:29semperosthat is amazingly handy
03:29semperoswas not looking forward to if's
04:25mikemis there a function to perform the opposite of zip?
04:26AWizzArd,(doc zip)
04:26clojurebotGabh mo leithscéal?
04:26AWizzArdWhat is zim doing?
04:26AWizzArdzip even
04:26mikemzip merges two lists into one... i guess map does that
04:27mikem(map (fn [x y] [x y]) [1 2 3] [:a :b :c])
04:27mikem,(map (fn [x y] [x y]) [1 2 3] [:a :b :c])
04:27clojurebot([1 :a] [2 :b] [3 :c])
04:28mikemso I'd like to reverse the process, I have that result list and I want the original two lists
04:28AWizzArd,(map vector [1 2 3] [:a :b :c])
04:28clojurebot([1 :a] [2 :b] [3 :c])
04:29mikemyep :)
04:31AWizzArdWell, I am not aware of an "unzip" fn. So maybe you will need something homebrew
04:33AWizzArdObviously something such as [(map first x) (map second x)] would do the job.
04:34mikemhm...
04:34mikem,(map vector [1 2 3] [:a :b :c])
04:34clojurebot([1 :a] [2 :b] [3 :c])
04:34mikem,(apply map vector [[1 :a] [2 :b] [3 :c]])
04:34clojurebot([1 2 3] [:a :b :c])
04:35mikem,(apply map vector (map vector [1 2 3] [:a :b :c]))
04:35clojurebot([1 2 3] [:a :b :c])
04:35cais2002mikem: that's the same answer to my transpose question yesterday
04:35mikemcais2002: yeah, i thought i saw something like this asked recently, so I looked in the logs: http://clojure-log.n01se.net/date/2010-07-13.html
04:36ragnardAWizzArd: maybe partition does what you want?
04:36AWizzArdragnard: you mean mikem :)
04:36ragnardyup, probably :)
04:37ragnard,(partition (:a 1 :b 2))
04:37clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to keyword: :a
04:37AWizzArdbut no, partition is not what he wants
04:37ragnard,(partition [:a 1 :b 2])
04:37clojurebotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$partition
04:37ragnarddoh.
04:37bozhidar,(partition 3 (range 1 10))
04:37clojurebot((1 2 3) (4 5 6) (7 8 9))
04:37ragnard,(partition 2 [:a 1 :b 2])
04:37clojurebot((:a 1) (:b 2))
04:39AWizzArdBut really, (map vector x1 x2 ... xn) is going into the one direction, while (apply map vector on-the-result) goes back.
04:39cais2002,((fn transpose [m] (let [s (count m)] (partition s (apply interleave m)))) [ [ 1 2 3] [:a :b :c]])
04:39clojurebot((1 :a) (2 :b) (3 :c))
04:47esjMoin
04:48cais2002
05:21cais2002is there a way to forcefully terminate even if there are pending agent actions?
05:43neotykcais2002: shutdown-agents
05:43neotyk,(doc shutdown-agents)
05:43clojurebot"([]); Initiates a shutdown of the thread pools that back the agent system. Running actions will complete, but no new actions will be accepted"
05:49cais2002it says "running actions will complete"
05:50cais2002not sure whether that includes sent but not-executed actions
06:03neotykcais2002: I think it refers to ExecutorService shutdown
06:04neotykhttp://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/concurrent/ExecutorService.html#shutdown()
07:22rhudson,(clojure-version)
07:22clojurebot"1.2.0-master-SNAPSHOT"
07:23robtphi all - does http://gist.github.com/475301 (my implemenation of heapsort) seem well and good?
07:23robtpfrom a clojure-style pov?
07:24robtpwell, i should mention, it's not full heapsort, just a structure that maintains a max-heap invariant
07:36rhudsonrobtp: not== could just as well be a function
07:37robtprhudson: that was just for fun, but yeah
07:37rhudsonI think for the first half-dozen macros I wrote, I later realized 4 or 5 of them could have been functions
07:38rhudsonIn fact, where you use not==, you could have written (if-not (== largest i) ...
07:39rhudsonor (if (== ... )) and reversed the result exprs
07:39robtpi'd just like to avoid another level of parens, if possible
07:40Chousukeif-not avoids the extra parens :)
07:40robtpChousuke: how so (if-not (== a b)) vs (not== a b)
07:41rhudsonvs (if (not== a b))
07:41robtpoh
07:41robtphrm, right
07:41robtphaha
07:56Kttmmhi, i've got some problem with leiningen and the checkout dependencies features, did somebody else try it?
08:02robtpKttmm: i can't really help you, except to say, can you give more details?
08:05Kttmmi've got a link to the other project in checkouts directory, but when the jar of this project is in the lib directory, loading a source will always load from the JAR and not from the other project
08:06Kttmmremoving the JAR from lib works, but that's not what i want, i want to be able to do "lein deps && lein repl" and then hacking on the second project and (use :reload-all ....) should work
08:13bartjer, can anyone plz point out what is wrong with this - (ns my-ns (use (clojure.contrib.string :only (tail))))
08:16AWizzArdbartj: try (:use ...) and not (use ...)
08:17esjalso, i had issues with using - in my namespaces sometime back, suggest you might try myns
08:18AWizzArddashes in NSes are okay
08:18AWizzArdJust translate those in filenames to underscores '_'
08:18Kttmmbartj: should be (ns my-ns (:use [clojure.contrib.string :only (tail)]))
08:19esjAWizzArd: thanks.
08:19Kttmmrobtp: any idea?
08:20bartjAWizzArd, if I have a file-name.clj when I use/require it in another file I should use file_name ?
08:20robtpbartj: you shouldn't have file-name.clj :)
08:20esjbartj: other way around
08:20AWizzArdright
08:21robtpKttmm: sorry, not really, i'm pretty novice at this
08:21robtpgood luck though...!
08:22AWizzArdbrandonw: for example, look at http://github.com/richhickey/clojure-contrib/blob/master/src/main/clojure/clojure/contrib/command_line.clj
08:22rhickeyhrm: http://www.infoworld.com/d/developer-world/top-five-scripting-languages-the-jvm-855
08:22bartjgee thanks!
08:22AWizzArdyou see that the file is named command_line.clj, but the ns is named c.c.command-line
08:25AWizzArdrhickey: well, the authors opinion is not more than that, and his explanations are flawed. But anyway, we should look at the number of postings in the group, number of people in here, number of articles in newspapers, etc. And they all show an obvious trend.
08:29robtpi can offer an anecdote that several people i know (in the bioinformatics community) are starting to adopt clojure/incanter for projects, when possible (versus ruby/rsruby python/rpy)
08:33Hodapprobtp: interesting.
08:33Hodappstill stuck with MATLAB here for most prototyping, though I've been using SciLab lately since it's easier than trying to track down a legal, licensed copy of MATLAB herre
08:34bartjKttmm, thank you very much
08:35bartjalso, why is (:use...) preferred over (use...) ?
08:38AWizzArdbartj: :use is optically nicer when used inside a NS, because this underlines its declarative nature, while use is a fn.
08:47Kttmmis there any project aiming to support leiningen for Netbeans?
08:48jfieldswhat's the easiest way to get the name of a var from a var?
08:49jfieldsuser=> (str (var user/x))
08:49jfields"#'user/x"
08:50jfieldsif I only want user/x should I just do some string manipulation or is there something already available?
08:52chouserjfields: I think there's nothing already available.
08:52jfieldscool. thanks chouser.
08:52chouser,(let [v #'map] (str (.name (.ns v)) "/" (.sym v)))
08:52clojurebot"clojure.core/map"
08:53chouserbut I'm not sure that's any better than slicing two chars off
08:54jfieldsI'm writing a ClojureTestRunner to create custom suites of clojure tests that run as part of JUnit, so it's not a big deal. I think I may just leave those two characters on for now. I'm being lazy.
08:54chouserthough neither solution will handle anonymous vars without a special case
08:56jfieldschouser, on another note, in chapter for where you have (from memory): (pos even? [1 2 3 4]) returning [1 3], that's somewhat confusing as 1 3 are indexes, but also values.
08:56jfieldssorry, chapter four, not for.
08:56jfieldsI didn't think it was important enough to do anything formal, but I thought I might as well mention in here. :)
08:57chouserhm, good point.
08:58dnolen_http://dosync.posterous.com/clojure-multi-core-amazon-cluster-compute-lat
08:58dnolenstarting to playaround with Clojure on the new Amazon Cluster Compute
09:01rhudsondnolen: cool post!
09:04AWizzArddnolen: is this ec2?
09:01dnolenAWizzard: yes
09:02AWizzArdone short question regarding this: is the runtime of your programs restricted in some way? Can you have a program running for hours or weeks?
09:02AWizzArdIn contrast Googles Cloud system seems to support only calculations that are triggered by a request of some user.
09:04dnolenAWizzard: limited only by your bank account :) Cluster instances are not cheap when running all the time. $1.60 hour. But it's easy to create an account, an image with Clojure on it, and an IP. They charge pennies for persisting those.
09:04dnolenyou can spin up your image whenever you feel like trying something out.
09:05AWizzArddnolen: I just thought this may be interesting as a supercomputing service, if fast results are needed, and my company is willing to pay 200 for them, or something like that
09:08dnolenAWizzard: seems like a great solution for "on-demand" supercomputing service.
09:10Hodappdnolen: ahhh, gotta love those paradigms from 1970-1980 that a lot of people still refuse to acknowledge are useful.
09:11AWizzArddnolen: yes!
09:15AWizzArddnolen: what now would be even more interesting is such a Cloud Computing service offering an Azul Systems Vega 3 machine (:
09:16AWizzArd864 cores, 768 GB RAM, best Java GC, uuh :)
09:16AWizzArdhttp://en.wikipedia.org/wiki/Azul_Systems
09:24stuarthallowayis there a way to get the maven ant tasks to generate md5 and sha1 checksums, or do I really, in 2010, have to write my own ant target to do that
09:30lpetitstuarthalloway: maybe this can help http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html#createChecksum
09:30stuarthallowaylpetit: the createChecksum flag there appears to not exist in the ant tasks
09:31stuarthallowayactually reading the source code to the maven ant tasks right now to see why
09:32stuarthallowayrelated question. The previous clojure releases included "slim" and "sources" artifacts on the maven box, but those are not referenced from the pom
09:32stuarthallowayis this a convention?
09:32stuarthallowaydoes anybody use them?
09:33AWizzArdNo, because they are not available on build.clojure.org
09:33AWizzArdFor development the sources version would be interesting though.
09:36lpetitstuarthalloway: sorry, didn't read your question carefully enough
09:36stuarthallowayAWizzard: yes, they are: http://build.clojure.org/releases/org/clojure/clojure/1.1.0/
09:38defnIf it is it, it is it, if it is, it is it, it is!
09:40cemerickstuarthalloway: seems like the pom should include those different artifacts using reasonable qualifiers.
09:41cemerickIMO, the clojure project should have a stable, valid pom anyways (rather than generating a fairly useless pom for deployment purposes only).
09:49ohpauleez,(memfn substring 0 2)
09:49clojurebotjava.lang.Exception: Unsupported binding form: 0
09:50ohpauleezam I missing something, or is that broken now?
09:52bozhidaryou need a string object
09:52bozhidaron which to call a string method...
09:52ohpauleezbozhidar: look at the doc and source
09:52ohpauleezthat macro creates a function that you pass a target object too
09:53bozhidarmemfn is deprecated in favour of lambda functions
09:53bozhidarAFAIK
09:55cemerickohpauleez: the args should be symbols, not suspended argument values
09:55lpetitstuarthalloway: your question concerning md5sum and maven ant tasks is related to those "slim" "source" variant artifacts ?
09:55cemerick,(memfn substring a b)
09:55clojurebot#<sandbox$eval498465$fn__498466 sandbox$eval498465$fn__498466@e301e0>
09:56ohpauleezall, cool. thanks cemerick
09:56cemerick,((memfn substring a b) "foobar" 0 2)
09:56clojurebot"fo"
09:56chouser,((memfn substring i) "hello" 3)
09:56stuarthallowaylpetit: all the artifacts
09:56clojurebot"lo"
09:56cemerickohpauleez: but bozhidar is right in that memfn is virtually unused given #(...)
09:56ohpauleezright
09:56lpetitstuarthalloway: but why doesn't the maven install plugin, with the createChecksum option, work for you ?
09:56stuarthallowaybecause clojure deploy is via ant, and that option does not exist in ant
09:57cemerickprobably should be properly deprecated; not sure there's a good use case for it anymore
10:03lpetitstuarthalloway: ok, I'm lost, but unfortunately I cannot stay here anymore today to try understand better. Last thought: if clojure build and clojure deploy is via ant, why try do this via maven ?
10:04stuarthallowayI have to produce maven artifacts or nobody can use maven or lein to get clojure!
10:05bozhidarthis can be automated
10:06stuarthallowaybozhidar and by "this" you mean?
10:06bozhidarthe production of maven artifacts
10:06lpetitstuarthalloway: there's a way to "install" / "deploy" in a local or remote repository a pre-made jar file, from the command line. For example shut down your network, try to do some maven goal on a project where you do not have all the dependencies locally installed, and maven will complain and give you the command line (something like mvn install -D... -D....)
10:07lpetitmust go, good luck
10:07stuarthallowaylpetit: cheers
10:15cemerickstuarthalloway: what's the problem, exactly? Are you having difficulty doing a maven deploy from ant?
10:15stuarthallowaycemerick: here is the (draft) of "How to Release Clojure" http://clojure02.managed.contegix.com/display/doc/Cutting+a+Clojure+Release
10:16stuarthallowayproblem is neither the clojure or contrib steps actually produce the artifacts I need to copy remote
10:16stuarthallowayoh, and let me create you a confluence login -- it doesn't seem to allow anonymous despite my attempts to make it do so
10:20danlarkindid our hudson setup not work for you stu? Or do you want to build the slim-* etc artifacts too
10:20stuarthallowaydanlarkin: I need to build a stable release, not a daily build
10:20stuarthallowayis there stuff in hudson to automate that?
10:21danlarkinperhaps you want to keep the daily builds, but lock to a snapshot in your pom/project.clj? that's what we do
10:21cemerickThis might be begging the question, but why wouldn't a stable release simply be a promoted daily build?
10:21stuarthallowayI would rather run it locally and test it before publishing, so I don't really think Hudson is the way to goo
10:21stuarthallowaycemerick: metadata has to change
10:23stuarthallowaye.g. how do you promote a build without rebuilding to set *clojure-version*
10:23cemerickstuarthalloway: I wasn't implying that promotion is just a cp or something. I'm saying, when you commit the final change to the version properties, etc., the automated build should run, doing all the usual tests, with the resulting artifacts deployed.
10:24stuarthallowaypatch most welcome!
10:24stuarthallowaythat certainly isn't where we seem to be now
10:24cemerickwhat patch?
10:24cemericka commit to git should kick of a build
10:24cemerickoff*
10:24stuarthallowayto make the world work as you just describe
10:25stuarthallowaycemerick: yes, and the build has to be smart enough to know to copy the artifacts
10:25stuarthallowayand the build is done from a different branch
10:25stuarthallowayeverything you say is possible, it just doesn't work that way atm
10:25cemerick*copy* the artifacts?
10:26stuarthallowayci-build puts the nightly artifacts where they belong
10:26cemerickoh, local repo
10:26stuarthallowaystable-build *might* do the right thing for a release
10:27cemerickstuarthalloway: automatically kicking off builds for multiple branches isn't an issue with the hudson git plugin -- is that being used?
10:28stuarthallowayit isn't just that
10:28stuarthallowaywe *only* want the stable build to run for things marked stable
10:28stuarthallowayso just building the 1.2.x branch on every commit would be wrong
10:29stuarthallowaycemerick: I believe currently configured to build only master
10:29stuarthallowayI don't mind the release build being an explicit separate step
10:29stuarthallowayI just want it to be automated from tehre
10:30cemerickright
10:30cemerickwell, it's sort of up to you if you're in ant-land
10:30cemerickthe release plugins, warts and all, is a big win in this area IMO
10:30stuarthallowayso let's talk maven land for a minute
10:30stuarthallowayI am trying to do contrib now
10:31stuarthallowayI am following the draft instructions, which tell me to run "mvn install"
10:32bartjIf I were to read a file which contained stop-words
10:32cemerickstuarthalloway: I can't see the draft, but that'll only put the artifacts in the local repo.
10:32stuarthallowaythis gives me only the main jar and pom, so I need to add flags to that command to (1) generate the checksums and (2) (maybe) generate the slim and sources versions
10:32bartjwould storing the stop-words in a sorted-set be appropriate ?
10:32bartjmy attempt is here: http://pastebin.org/395493
10:32stuarthallowaycemerick: that works for the moment, I need to ship this and we can fix the process later
10:33stuarthallowayI just need the maven command to generate all the artifacts locally
10:33stuarthallowaycemerick: I sent you a username/password for assembla
10:33cemerickstuarthalloway: well, mvn deploy is what generates the checksums. I don't think checksums are ever generated for installed artifacts (writing to disk is assumed to be reliable).
10:36stuarthallowaycemerick: ok, mvn deploy is trying to copy to the build box (a good sign) but I need to change the user is it using. Where would that setting hide?
10:37cemerickstuarthalloway: probably the settings.xml
10:37cemerickstuarthalloway: re: sources artifact, see http://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html
10:37esjwhich, for comedy, they hide in ~/.m2
10:37cemerickas long as the sources in question are defined in the POM, that'll do the trick
10:38stuarthallowaylooks like the pom for contrib is just wrong
10:38stuarthallowayit wants to put snapshots and releases in the same place
10:38stuarthallowayok, screw this for now, I am going to do this by hand and create a ticket
10:39stuarthalloway... begging for help
10:39cemerickhrm, yup. Copy-paste snafu.
10:39cemerickstuarthalloway: SS is just down the hall, no?
10:39stuarthallowaycemerick: he's in a meeting
10:40cemerickheh
10:40cemerickstuarthalloway: Just camp the door & greet him with a nerf bat or something. ;-)
10:40danlarkinseconded
10:41cemerickspeaking of snapshots and releases going to the same place, I wonder what it would take to get clojars fixed in that regard
10:42stuarthallowaycemerick: planning a real maven repos with a clojure web front end and repl support, to replace clojars completely
10:43danlarkinwhy?
10:43clojurebotwhy not?
10:43cemerickstuarthalloway: stellar, very happy about that. Are you guys in contact with sonatype so as to get red-carpet treatment w.r.t. central promotion?
10:43stuarthallowayno, need to do that
10:44cemerickif nexus is in the background, then it's apparently crazy-simple
10:47neotykGuys, I've just released first version of Async Http Client for Clojure
10:47neotykhttp://groups.google.com/group/clojure/browse_thread/thread/a0bbc655bf53c15e#
10:47neotykdo tell what you think of it
10:47AWizzArdneotyk: so is that in some sense the counter-part of Aleph?
10:48neotykAWizzArd: could be, though I haven't figured out how Aleph could
10:48neotykdo HTTP Streaming
10:48neotykwhile ahc-clj can consume those
10:49ohpauleezneotyk: because you pipeline the promise?
10:49neotykbut yes, in general it is lightweight, not wasting threads http client
10:50neotykohpauleez: what do you mean ?
10:50AWizzArdneotyk: multiple concurrent http requests within one thread?
10:51neotykit will be more than one, but should not increase when are doing
10:51neotykmore requests
10:51ohpauleezI wanted to know how you were able to handle streaming whereas aleph wasn't. I was assuming it was because of the use of promise pipelining
10:55AWizzArdneotyk: I think you can unify the fns get, post, put, delete, head and options
10:59AWizzArdneotyk: in request.clj in headers-collect there is a (do ..) missing, otherwise your fn can run into a NPE
10:59neotykAWizzArd: they are unified in request.clj
11:00neotykohpauleez: I use java wrapper that does all netty pipeline stuff
11:00neotyk from clojure only callback and provided
11:00neotykAWizzArd: looking into it
11:00ohpauleezahh cool
11:01AWizzArdneotyk: well, what I mean is client.clj where you have six fns that are all identical with the exception of one keyword, namely :put, :delete, :get, etc.
11:02neotykAWizzArd: headers-collect seems fine it is (if headers (dysync) (println))
11:02AWizzArdhttp://github.com/neotyk/ahc-clj/blob/master/src/async/http/client/request.clj#L61
11:02AWizzArd,((println "Received empty headers, aborting.") :abort))
11:02clojurebotjava.lang.NullPointerException
11:02neotykAWizzArd: I thought it would be more convenient fo rusers
11:03neotykAWizzArd: got it
11:03AWizzArdneotyk: yes, there can be all those different functions, but those can just call/inline the 1-2 fns that represent the core. Just an idea :)
11:04neotykthis is how it is done now
11:04neotykall those GET PUT fns are calling execute-request and help
11:04neotykpreparing request
11:06neotykAWizzArd: NPE fixed, will wait for potential other issues and do
11:06neotyk minor release later today
11:06AWizzArdgreat
11:06AWizzArdfast guy (:
11:18dabdsorry to post this here but leiningen channel is low traffic. running lein help gives me the following exception: Exception in thread "main" java.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Named (help.clj:5)
11:19dabdshould I use the development version instead of the stable one?
11:28bozhidardabd: I think you're using an old development snapshot of 1.2
11:28bozhidarI had some similar problems recently
11:28dnolenanother source of Clojure misunderstanding, http://www.infoworld.com/d/developer-world/top-five-scripting-languages-the-jvm-855?page=0,5#jvm6
11:28dabdbozhidar: I was using http://github.com/technomancy/leiningen/raw/stable/bin/lein then I switched to the development version and it is working now
11:29Raynesdabd: That is a known bug in 1.1. You're right, it's fixed in the development version.
11:30dabdRaynes: http://github.com/technomancy/leiningen/raw/stable/bin/lein
11:31dabdthey should link to this version instead in the tutorial: http://github.com/technomancy/leiningen/raw/master/bin/lein
11:35arohnerok, I'm pulling my hair out over this. I have two boxes running my clojure app. one is Snow Leopard, on is Ubuntu 10.04. The osx box runs the app no problem. The ubuntu box gets the dreaded Caused by: java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V
11:35qbgSounds like a wrong clojure version is being used
11:35arohnerboth are running identical jars, and same Sun JVM version
11:35cemerickarohner: you've got 1.1 in your ubuntu box's classpath
11:37arohnercemerick: ah! even though I'm starting them with lein?
11:38cemerickarohner: Yes, though 1.1 vs. 1.2 is ideally orthogonal to your build/deployment tools.
11:39arohnerso I don't have a $CLASSPATH in env, and there's only a clojure-1.2 in lib/. Where else could clojure-1.1 be hiding?
11:41qbgWhat about clojure-contrib?
11:42hsarvelldnolen: That article is hilarious "sits between CL and Scheme". Yeah whatever.
11:43qbgThat article needs to be fixed
11:45cemerickarohner: how exactly are you starting the app?
11:50arohnercemerick: lein test-out
11:50arohnercemerick: which is a plugin I wrote that calls eval-in-project
11:51arohnerI get the same behavior with lein test
11:52cemerickso you have the clojure version defined in project.clj?
11:52arohnercemerick: yes, and the clojure jars in lib/ have identical SHA1s
11:53arohnerand I'm running lein 1.1 on both boxes
11:53cemerickarohner: I'm not certain about whether lein uses the jars in lib/ or in ~/.m2/repository
11:53cemerickI'd blow away both of those dirs on the ubuntu box (the latter will take some time to rebuild, so take this under advisement) and try again.
11:54arohnercemerick: lein's jvm uses the clojure jar in ~/.m2/leiningen/lein-version-standalone.jar
11:54cemerickwhich presumably isn't 1.2?
11:55arohnercemerick: yes, lein 1.1 runs clojure 1.1, but it starts another process that does use the clojure.jar in lib/
11:56cemericktry dumping (System/getProperty "java.class.path") from your app if you can.
11:59arohnerhmm, lein swank is blowing up the same way
11:59pedroteixeiraanyone knows how to prevent emacs from creating .#file.clj every time you edit a buffer? the maven clojure plugin tries to compile these files :p
12:00arohnerpedroteixeira: they go away if you do C-x s, right?
12:00pedroteixeiraarohner: yep, they do
12:01pedroteixeiraarohner: i managed to change the autosave dir, backup dir. but could not find any resource on how to change the dir for these symbolic hidden files
12:10arohnercemerick: I think my ubuntu box is blowing up before lein spawns the child clojure process
12:11arohnerand I'm getting pages of java.util.zip.ZipException: error in opening zip file
12:11arohner at java.util.zip.ZipFile.open(Native Method)
12:14cemerickarohner: sounds like it's time to repave things; ~/.m2/*, lein itself, etc.
12:23arohnercemerick: thanks for the advice.
12:23arohnerc
12:23cemerickgood to go, then?
12:23arohnercemerick: while we're on the subject of broken jars, why does maven policy allow bad checksums into Central?
12:24arohnercemerick: no, but I have enough hints now to continue on my own
12:24cemerickarohner: does it? I don't know much about the details of central administration.
12:25arohnercemerick: the nexus UI says there are known invalid checksums on certain artifacts. There are maven bug reports about "fix the checksum on artifact X to match the jar"
12:25technomancyarohner: I've had issues with different maven central mirrors containing different jars claiming to be the same version.
12:25arohnertechnomancy: exactly. This seems easy to fix. Kick out any jar without a checksum, kick out any jar that doesn't match its checksum
12:26arohneron upload, verify the checksum, etc
12:31cemerickheh, maven artifacts by bittorrent? :-P
12:31arohnercemerick: http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&amp;mode=hide&amp;jqlQuery=project+%3D+MEV
12:32arohnercemerick: these are the bug reports on maven central. Notice the number of bad checksums
12:32technomancycemerick: couchdb replication maybe?
12:33cemerickarohner: yeah, I've no idea about that. Presumably it's a known issue?
12:33cemericktechnomancy: sure...that's presumably only among repos though?
12:34cemerickThe thing about distributed repos of any flavor is that they'd require that all artifacts get signed....which is rare these days AFAIK.
12:34technomancyyes, signing is key. distributed trust is hard. =\
12:35arohnercemerick technomancy: isn't it just enough to SHA1 everything?
12:35cemerickarohner: no, because you have to have some way of ensuring that the jar you just got from random-artifact-node-439 is authentic
12:36cemericki.e. was built and released by its author, who has the private keys to prove it.
12:36cemerickThen you have to ask who's credentialing people, and then the toolchains are a mess.
12:36cemerickyikes :-/
12:37arohnergit handles a lot of the identity part, just not the "approval" part
12:38cemerickgit doesn't do any signing of anything....?
12:38arohnergit makes sure you have an ssh private key, and signs commits
12:38arohnerso it's pretty trivial to extend that to signing a jar
12:39cemerickThe commits have a hash representing all history up to that point, but the key is used only for ssh auth, etc.
12:39cemerickAFAIK
12:39arohnerhttp://linux.die.net/man/1/git-verify-tag
12:40arohner "git format-patch" learned --signature option and format.signature
12:40arohner configuration variable to customize the e-mail signature used in the
12:40arohner output.
12:40arohnerhttps://wincent.com/wiki/Git_1.7.2.rc1
12:40dabdthe labrepl pom.xml contains a plugins section but there is no corresponding section (if it is allowed) in the project.clj file. Is there a mechanism in leiningen to specify maven plugins?
12:41cemerickarohner: interesting. I wonder if anyone's going to bother using it. :-)
12:41BjeringWhat code-paste page do you recommend for clojure?
12:41cemerickgists are pretty typical these days
12:42Bjeringthank you
12:43cemerickdabd: lein doesn't interop with maven plugins AFAIK. Look at clojure-maven-plugin.
12:43dabdcemerick: but I think you are not supposed to edit the pom leiningen generates. So how do you add the clojure-maven-plugin to the pom?
12:44technomancydabd: not yet, but that's a good idea.
12:44dabdtechnomancy: I can add the plugins section by hand but if I run 'lein pom' it will overwrite it....
12:50BjeringNot sure if this is an enclojure specific question or if its ok to post here, but I just created a new clojure 1.1 project in enclojure/netbeans, wrote this class http://gist.github.com/475658 , now I still cannot run it, when I select run it says "No main classes found", what am I missing?
12:54cemerickBjering: what do you have set as the main class in the Run section of your project's properties?
12:56Bjeringcemerick: Altright, thank you, that did it :) Now I couldnät use browse in there, had to manually name the class. I guess if it had been .java defined class it would have picked it up by reflection or something like that? (I am new to Netbeans overall too...)
12:57cemerickBjering: Yeah, all of the class lookup tools (run, debug, etc) in NB are oriented towards Java.
13:05TimMcMan, labrepl is great!
13:07TimMcThis has the best explanation of namespaces, symbols, and keywords I've seen yet.
13:12KirinDaveHey guys, I've been on vacation and buried in some other work lately
13:12KirinDaveIs there a good summary of what's in the beta of 1.2?
13:13KirinDaveAnd in particular I'm behind on how people are using ^:static, etc to improve performance. I know cgrand had a blog post about it recently but I was out of town when it came out and didn't have time to read.
13:14qbgKirinDave: There is a document about the changes in the 1.2.x branch
13:14KirinDaveSo the release notes is the best bet?
13:15KirinDaveThe last I saw concrete was like in june w/ http://clj-me.cgrand.net/
13:15qbgI think ^:static, etc. is targeted for 1.3
13:16KirinDaveThat was in 1.2 snapshots for awhile.
13:16KirinDaveDid it get rolled back
13:16qbgAll that was in separate branches
13:19KirinDavels
13:19KirinDaveI see
13:22KirinDaveAhh, but annoations made it in. Netty and jetty users will be happy.
13:27AWizzArdKirinDave: why? What do those two do with annotations?
13:27KirinDaveAWizzArd: Netty really needs annotations.
13:27AWizzArdDo you have an example?
13:28KirinDaveAWizzArd: Many people find it irritating to have to have one or two java classes in their source just to fulfill those requirements.
13:28KirinDaveAWizzArd: I dunno, the documentation for netty?
13:28KirinDaveAWizzArd: E.g., http://github.com/ngocdaothanh/telchat-clojure/blob/master/src/main/java/telchat/net/Handler.java
13:29KirinDaveThat's why I didn't write my original chat server blog post wit netty. I didn't want to needlessly complicate my post and build procedure by including extra files.
13:29AWizzArdic
13:29KirinDaveAWizzArd: We're almost to the point where you need to write a single line of java to get awesome performance out of the JVM. I wonder how long it will be before Clojure becomes self-hosted.
13:32AWizzArdWhere we need it, or where we don't need it?
13:33KirinDaveSorry
13:33KirinDavewhere we don't need to
13:33AWizzArdright
14:42bhenryhow can i stop an aleph server to avoid the "address already in use" problem when i change my routes?
14:48dnolenbhenry: one trick w/o having to restart the server is to pass the var which holds the handler to run-netty instead of the actual handler function, like #'handler
14:49bhenryi'll give it a shot. thanks.
14:49dnolenbhenry: if you stored the server return by run-netty in a var, you can also call stop on that
14:50dnolen(stop server0
14:50dnolener (stop server)
14:51bhenryoh. i tried something like that but it couldn't resolve stop. where does it come from? either way, #'handler worked like a charm.
15:09lypanovanyone know state of clojurescript / clojure in clojure with js given that 1.2.0 is coming to a close?
15:25arohnerlypanov: neither is anywhere near functional
15:26arohnerlypanov: there is scriptjure though: github.com/arohner/scriptjure
15:27arohnerfar less ambitious, but it works
15:33ohpauleezis it possible to overload macros by arity?
15:40ohpauleezActually, what I really want to know is, can I overload the macro and have it call another version of itself
15:47pedroteixeirais there any way to define a default namespace for the reader macro :: different than the current namespace?
15:49kotarakpedroteixeira: you can use an alias. (ns my.namespace (:require [other.namespace :as o])) ::o/foo.bar
16:02dsantiagoDoes anyone know why #^ was changed to ^?
16:02arohnerdsantiago: because #^ is ugly, and metadata is a common operation
16:02dsantiagoI see.
17:11djpowellHmm, is the doc to extend-protocol out of date?
17:12djpowellit talks about using ::MyDefType - which I think isn't used now?
17:58neotykGuys what would you say to infinite lazy seq of tweets?
17:59lancepantzthat's about how i feel about twitter
17:59neotyklancepantz: so API would be very intuitive for you ;-)
17:59lancepantz:P
18:01neotyktoday at Amsterdam Clojurians meetup we created prototype of it
18:02lancepantzoh cool
18:02lancepantzhow's the turnout there?
18:02neotyktoday we where 8 in total
18:06lancepantzprobably more than we could get here
18:06lancepantzpretty sure it would just be my co-worker and myself
18:06neotyktry it
18:07neotykonce we where about 15, that was max so far
18:07neotykbut also we had 4 person meetings as well
18:20bmhWhat is the preferred way to reduce over the values in a map?
18:22qbgYou can get a seq of the values with (values <map>)
18:23bmhqbg: Thanks. I recently arrived from Scheme/Haskell land and everything looks sort of familiar. It's disorienting! :-)
18:32technomancydabd: hey, I missed replying to you earlier. I think allowing lein to spit out a plugins section in the pom would be a great idea for a plugin
18:34technomancydabd: your plugin can include a hook to wrap the pom task to add a plugin section
18:39RaynesWhat is the best way to map a function to every other element in a sequence?
18:40qbgWhat do you want to do with the other ones?
18:40qbgLeave them the same?
18:42qbg,(map #(%1 %2) (cycle [inc identity]) [1 2 3 4 5 6 7 8 9 10])
18:42clojurebot(2 2 4 4 6 6 8 8 10 10)
18:42qbgThat would be one way
18:43dnolenAnyone at the clojure NYC meetup at google?
18:43dnolenHere in the lobby but no idea where to go.
18:44bmhWhy don't you ask at reception? Based on the existence of a reception desk at Google Cambridge, I assume there must be one at Google NYC. ;-)
18:45dnolenBoone here at the reception desk. No instructions where to go on meetup.com :(
18:45dnolenNoone
18:46Raynesqbg: In case you didn't get my last message, it was: <Raynes> Keep them in place.
18:46ohpauleezRaynes: -> qbg: ,(map #(%1 %2) (cycle [inc identity]) [1 2 3 4 5 6 7 8 9 10])
18:47ohpauleez,(map #(%1 %2) (cycle [inc identity]) [1 2 3 4 5 6 7 8 9 10])
18:47clojurebot(2 2 4 4 6 6 8 8 10 10)
18:47bmhwhat does the #(%1 %2) mean?
18:47RaynesAh, cool.
18:47qbgbmh: Anonymous function taking two arguments
18:48qbgIt calls the first with the second
18:49bmhgot it. I presume arity is determined by the number of arguments you use?
18:50qbgCorrect
19:02qbgHmm... Steve Yegge says "C++, Java and Perl code bases seem to grow almost linearly with the functionality, but carefully engineered Lisp code bases have a way of growing at a rate that feels closer to the log of the feature complexity."
19:05alexykhey chouser!
20:09bettspHi guys, where would be a good place to ask about debugging VimClojure + Nailgun
20:11bettspI'm sure that I'm doing something wrong, but there's no error messages
20:11bettspThe interactive keybindings just don't work
20:11bettsp(which is what VimClojure does if something goes pear-shaped)
20:14Raynesbettsp: http://groups.google.com/group/vimclojure/topics Appears to be a mailing list specifically for it.
21:33dabdtechnomancy: thx
21:38cais2002morning
21:40lancepantzevening
21:40qbgEvening
21:41cais2002hmm, I thought we now use UGT?
21:42qbgI find it more amusing to use actual time
21:46brweber2hey tomoj
21:46tomojhello
21:47brweber2tomoj, how are you?
21:49tomojgood, and you
21:50brweber2tomoj doing great. You were able to help me a few times before, do you have a second for a clojure 1.2 question?
21:51tomojsure
21:52brweber2so... when I use :gen-class and I do not specify a name, it uses the namespace excluding the name of the file being compiled. But, if I use defrecord/deftype/defprotocol it compiles to a package that includes the file name itself.
21:52brweber2tomoj that seems inconsistent to me.... are you aware of any reason for this behavior?
21:53tomojno idea
21:55arohneris there a way to measure read latency on the JVM?
21:56brweber2tomoj k, thanks. I was hoping maybe I'd get lucky... :)
22:04dysingerhelp
22:04dysingeroops wrong win :) (blush)
23:28cais2002is there a simple way to know what actions are pending on an agent?
23:33tomojit seems like mvn clojure:swank runs two jvms
23:35tomojand so takes up 350MB of RAM
23:35tomojish
23:58nathanmarzis there a way for methods created using gen-class to take in byte array arguments?