#clojure log - Aug 09 2011

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

1:08 bogner: Anyone know whether http://dev.clojure.org/display/design/Android+Support is up to date?

1:13 hiredman: bogner: the status of android support isn't very fast changing, so it seems likely to be up to date

1:14 bogner: hiredman: Fair enough. Is there anywhere I should go/anyone I should talk to if I'm interested in trying to help?

1:14 hiredman: mailing list I guess, dunno

1:14 bogner: Cool.

1:14 hiredman: you have a ca?

1:15 bogner: define ca

1:15 hiredman: ~ca

1:15 clojurebot: CA is Contributor Agreement: http://clojure.org/contributing

1:15 hiredman: a decent first step, kind of a pain

1:15 bogner: No, haven't forayed into hacking on clojure yet.

1:16 Thanks.

1:44 amac: is there a symbol that lets anonymous fns catch variadic args?

1:45 along the lines of &%

1:47 amalloy: amac: good guess

1:47 %&

1:47 amac: err, scratch that, will just use fn instead of #(

1:47 oh, really?

1:47 handy

1:48 amalloy: that said, i use fn instead. i don't think i've ever actually used %&

1:49 kencausey: yeah one would think rest args are going to require a bit more than a line of code or two, unless the are simply passed onto another function as is I guess

1:50 amac: they're being dumped into a partial fn so don't really need to be named

1:51 I'd rather save 5 keystrokes than have maintainable code! /s

2:22 thorwil: in dnolen's announcement, i read "mad patterns" at first 0.o

2:24 depy: what's a "mad patterns" ?

2:25 leonid: patterns that are mad

2:25 depy: O_ô

3:07 Any1 has link to dnolens tweeter? Somebody said he tweeted about some interesting pattern matching?

3:07 amalloy: @swannodette

3:40 ejackson: morning good people

3:51 depy: morning

3:52 amac: 4am here, why can't I sleep like normal people :(

3:52 ejackson: i think that may be locally normal

3:53 amac: true.

3:53 its the others that are weird, not us.

3:53 depy: 10am here... At work already.. :/

3:53 ejackson: 9 here, work is at home :)

3:53 depy: lucky u :)

3:53 amac: are you in the UK by any chance?

3:54 depy: Slovenia actually

3:54 amac: ah, probably for the best -- I was wondering what the status of the riots in London were.

3:55 depy: I'm really frustrated... :/ I hate when people take some open source solution and think that they have a golden hammer that can solve everything...

3:58 ejackson: amac: yup

3:59 but not in London, happily.

4:02 amac: sadly, reporting on european issues is spotty over here (Canada)

4:03 ejackson: its spotty here too... nobody seems to be owning up to the reason for these riots.

4:12 depy: What was the reason for these riots? O_ô

4:15 amac: someone got shot by the police, but the details on it are fuzzy

4:16 depy: I see. I'm reading about it but there nothign concrete on it ye...

4:20 ejackson: yup, if the Met has managed to kill yet another innocent dude its going to be ugly

5:04 fhd: Is anybody using a mocking framework? If so, which one?

5:04 Couldn't find much. Midje looks like a test framework + mocking framework, but I'm quite happy with clojure.test and a bit reluctant about switching.

5:07 clgv: fhd: what do you want to mock? functions only?

5:10 fhd: clgv: Mocking java objects would be cool, too

5:11 clgv: Something like Mockito for Java (mocking and stubbing etc.)

5:11 clgv: fhd: for functions have a look at this macro: https://github.com/joyofclojure/book-source/blob/e9f8e99b76e575371c1e927eb22840f258e54783/src/joy/misc.clj#L146

5:51 robonobo: hi

5:51 is there a Right Way to add local jars to a leiningen project?

5:51 i've copied two into libs, but lein doesn't seem to pick them up

5:52 ordnungswidrig: robonobo: I'd put them into a local repository and reference them like every other dependency

5:53 ejackson: lein deps ?

5:53 robonobo: ejackson: running lein deps removes them from the lib directory

5:53 ordnungswidrig: isn't that a bit overkill?

5:54 ordnungswidrig: robonobo: where do the local jars come from?

5:54 ejackson: robonobo: i'm confused. List the deps in your project.clj file, and then run lein deps. It will copy them from ~/.m2/... to ./lib

5:54 or it should :)

5:54 robonobo: ordnungswidrig: they're form the zxing library

5:55 i downloaded them, but clojars doesn't have them

5:55 ejackson: aaah, then you need put them into your local repository

5:55 robonobo: how? do i just copy the jars into the m2 dir,

5:55 ?

5:56 ejackson: or somehow inform lein of the repo where they can be found

5:56 ordnungswidrig: robonobo: http://code.google.com/p/zxing/issues/detail?id=88

5:56 robonobo: there is actually a maven repository having these libs.

5:56 robonobo: sweet

5:57 ordnungswidrig: robonobo: https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md

5:57 robonobo: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

5:57 robonobo: the rest is on you :-)

5:58 ejackson: the last ling is how to get the jar into your local repo, from which lein can find it

5:58 that's what i'd do

5:59 ordnungswidrig: ejackson: I'd refer to the existing repo, because there is one :-)

5:59 ejackson: ordnungswidrig: how do you tell leiningen about remote repos other than clojars ?

5:59 clojurebot: http://github.com/technomancy/leiningen

5:59 ejackson: (i'm a recent refugee from maven)

6:00 ordnungswidrig: ejackson: the first link above (...DEPLOY.md) shows you

6:00 ejackson: cool, thanks.

6:01 ha :repositories

6:08 robonobo: i got it to work with the repo you sent me, ejackson, thanks guys

6:09 ejackson: groovy

6:21 Borkdude: Guys, I just got a fresh Macbook Air and installed Aquamacs. What is the common way to get Clojure working, with Slime/Swank, etc?

6:22 tufflax: Say I have a map with lots of entries in it, and I want a map where I keep just a few of them, maybe it could look something like this: (keep-entries :a :b :c) is there a function that does something like this already?

6:23 Borkdude though I don't use emacs myself, I guess leiningen with lein swank or whatever it's called is reasonable

6:23 Borkdude: tufflax: what do you use?

6:23 tufflax: vim

6:23 but emacs is more popular

6:24 ordnungswidrig: tufflax: ,(select-keys {:a 1 :b 2 :c 3} [:b :c])

6:24 clgv: tufflax: select-keys solves your problem

6:24 ordnungswidrig: ,(select-keys {:a 1 :b 2 :c 3} [:b :c])

6:24 clojurebot: {:c 3, :b 2}

6:24 tufflax: ok thanks guys

6:25 oh, i forgot the map in my imagined keep-entries :p

7:59 thorwil: i still wonder if it would be a good idea to handle articles and comments as a single entity in my blog

8:00 so the journal view (list of articles) could also render an article-with-comments view, perhaps

8:02 the relation between article and 1st level comments would be the same as between nth and (inc nth) level comments

8:17 robonobo: hi

8:18 i don't think i fully understand how lazy-seq works when reading from disk

8:18 i have this https://gist.github.com/1133895 code

8:19 that takes a list of java.util.File-objects and that should lazily make them in to bufferedimages using imageio

8:19 but even if i go (first (imgs-from-files ...)), when the filelist is long, it throws an OutOfMemoryException

8:20 shouldn't it be reading and converting the first file only?

8:32 clgv: robonobo: depends on how exactly you use it

8:32 robonobo: clgv: what do you mean?

8:32 clgv: robonobo: if you hold on to the head of the lazy sequence all its elements will be kept in memory

8:33 opqdonut: well he's not hanging on to it

8:33 robonobo: and if i just do (first (lazy-sequence ..))

8:33 ?

8:33 opqdonut: hmm, that is weird

8:34 clgv: opqdonut: where do you want to see that? there is no call to that function in the snippet.

8:34 opqdonut: I mean, if he's calling (first (imgs-from-files ...))

8:34 robonobo: hmm, i seem to have it working now

8:34 depy: what was wrong?

8:34 clgv: robonobo: if you do (first (imgs-from-files ...)) you are only evaluating the first entry

8:34 robonobo: the problem might have been that i didn't reload (stupid)

8:34 clgv: so that one might consume too much memory.

8:35 depy: lol, :D

8:35 robonobo: that always gets me

8:35 raek: robonobo: I don't see any problem with the definition of imgs-from-file, but you can also write it as (defn imgs-from-files [files] (map load-image files))

8:36 robonobo: raek: ha, yes, ofcourse

8:36 raek: but the lazy iteration looks like what you would get if you expanded the map call

9:31 mdrogalis: Is there a function in Clojure similiar to Python's zip? Takes two sequences and returns them in pairs. Example: [1 2 3] [4 5 6] => [(1 4) (2 5) (3 6)]

9:32 chouser: mdrogalis: (map vector v1 v2)

9:35 mdrogalis: Ah, nice. Thanks chouser!

9:36 chouser: np

9:39 solussd: is there an easy way to remove all symbols in my current namespace brought in with 'use' ?

9:39 like (unuse 'some.namespace)

9:40 chouser: huh, interesting. That's a very reasonable request that I'd never considered.

9:41 depy: why is that usefull?

9:42 solussd: I'm working in a repl and i've moved some stuff around in my namespaces and completely removed one namespace and would like to avoid having to restart my repl to remove the referred symbols from my now nonexistent namespace

9:42 chouser: for when you accidentally type a naked 'use' when you meant "use only ..."

9:42 solussd: I don't think it can be done perfectly because use'ing can overwrite an existing refer in a way that can't be restored.

9:43 solussd: I figured a naked 'use' is acceptable when experimenting / building libraries

9:43 chouser: This is, a perfect "undo" isn't currently possible, I think.

9:43 but remove-all-vars-used-from-foo should be

9:46 solussd: I guess I can (ns-unmap 'user 'sym) for each one for now

9:46 chouser: solussd: yep. Gimme a sec.

9:46 solussd: :)

9:51 hugod: solussd: you could also use remove-ns on the namespace and reload it

9:52 solussd: hugod: the polluted namespace is user

9:52 just poling around on the repl

9:52 *poking

9:52 chouser: (defn un-use [ns-sym] (doseq [[k v] (.getMappings *ns*) :when (and (var? v) (= ns-sym (.name (.ns v))))] (ns-unmap *ns* k)))

9:53 should use ns-map instead of .getMappings

9:56 solussd: nice

9:56 thanks chouser!

10:02 wastrel: Good morning.

10:07 manutter: Hmm, this is interesting: http://goo.gl/yHWie

10:08 Title is "Google Closure: How NOT to write JavaScript"

10:09 Couple years old though, hopefully Google has shored up the weak spots since then.

10:13 chouser: This is better, no undocumented object interop: (defn un-use [ns-sym] (doseq [[k v] (ns-map *ns*) :when (and (var? v) (= (str ns-sym) (str (:ns (meta v)))))] (ns-unmap *ns* k)))

10:14 Scriptor: manutter: that piece got ripped apart a bit :) http://news.ycombinator.com/item?id=937175

10:15 manutter: Scriptor: well, he is kind of asking for it :)

10:51 Is cemerick around? I have another Spring Security question.

10:52 * cemerick looks for something to hide behind ;-)

10:52 manutter: Or anybody else would be welcome to answer too: does Spring Security presume that you are running in Tomcat or some similar container

10:52 cemerick: No.

10:53 Hrm. Well…

10:53 manutter: I'm thinking if I convert my app to Spring Security and then want to deploy on, say, heroku...

10:53 cemerick: *spring* doesn't assume that — spring-security, yes, it does. At least, it's typical deployment is via a servlet filter, which assumes a servlet container.

10:54 manutter: but even just jetty has me wondering, because I don't know if jetty reads web.xml to get the filtering

10:54 ok, that's what I was thinking

10:54 cemerick: If your deployment environment uses/respects the web.xml, then spring-security will work.

10:55 manutter: Ok, that's what I thought, thanks for the confirmation

10:55 cemerick: If it doesn't (i.e. you're deploying using embedded jetty and wiring things up programmatically without any reference to a web.xml that includes the spring-security filter), then you're going to have a hard time.

10:55 Such arrangements bother me though, insofar as I don't want to waste programming cycles on such guff.

10:56 Does heroku not just pick up a war file and run with it?

10:56 manutter: No, you basically push it a git repo

10:56 chouser: heroku uses source-deployment

10:57 manutter: Or I should say, I'm a heroku noob too, so I don't know what it would do if you offered it a web.xml file

10:57 cemerick: and there's a file somewhere that specifies what var holds your top-level ring handler or something?

10:57 manutter: Yeah, there's a procfile that calls lein run

10:57 chouser: there is a class of problems for which heroku is beautiful

10:57 cemerick: certainly

10:58 manutter: Yeah, it's a nice hammer, I'm just looking for the right nail ;)

10:58 cemerick: or, I can imagine so :-)

10:58 chouser: manutter: you may be able to deploy tomcat to heroku ... somehow... :-/

10:58 cemerick: Right, so heroku is Ring-only then.

10:58 manutter: Could be, but I'm thinking that heroku might not be your first choice if your product is a WAR file.

10:59 chouser: ^

10:59 chouser: manutter: that's probably true. Have you looked at CloudBees?

10:59 manutter: Oo, a new name, googling now....

10:59 lnostdal: hi, anyone noticing quite severe memory leaks using emacs-snapshot? ( http://emacs.naquadah.org/ .. i'm using the one from the ubuntu natty repo)

11:00 cemerick: If deployment options are being tossed out, see Elastic Beanstalk

11:00 * cemerick is a recalcitrant AWS fanboy

11:00 cemerick: manutter: ^^

11:01 manutter: cemerick: yeah, I've looked at the AWS stuff, it's attractive too

11:01 also checking out rackspace options

11:01 chouser: cemerick: heroku is a layer of service on top of AWS

11:02 cemerick: chouser: Yeah, I knew *that*. ;-)

11:02 chouser: oh, ok.

11:03 Dunno if CloudBees uses AWS or not.

11:03 cemerick: I'm mostly suspicious of pure PaaS options.

11:03 chouser: but they've got *eleven* "Elite Developers" on their team, so that's something.

11:03 ejackson: yeah even matlab has got the AWS thing working nicely now. Virtually transparant for embarrasingly parallel problems.

11:04 cemerick: I have a draft post flaming Rackspace. Not sure if I should bother publishing it though. Scary stuff.

11:04 ejackson: oooh, elite developers.

11:04 must be black belt

11:04 cemerick: 4th degree, even :-P

11:04 chouser: actually, they're all elite developers *and* architects.

11:05 I wonder who builds the thing if the entire technical staff is architects.

11:05 ejackson: no way ! where did they find these ninja dragon lords ?

11:05 manutter: flaming rackspace? (pretty vivid mental image, btw) What's the issue or issues?

11:07 ejackson: manutter: a flaming elastic beanstalk is also amusing....

11:07 manutter: lol

11:07 cemerick: Just a smattering of security-related WTFs. It was enough to keep me from bothering with them after an hour or so.

11:08 manutter: cemerick: hmm, that'd be an interesting post to read

11:09 cemerick: I'd want to have someone else that isn't an idiot w.r.t. security proof it before I started yelling Fire!

11:13 TimMc: cemerick: Have you tried sending your concerns to them?

11:16 Not that it will *necessarily* do any good, but there might be one or two items that they can address to your satisfaction or confirm their ignorance on. :-)

11:16 cemerick: TimMc: Beyond a WTF-flavored tweet, no. It's obvious stuff, fundamental to how their cloud servers handle root passwords, API keys, etc. It's a widely-used service, and apparently acceptable enough that there hasn't been a post about it AFAIK already.

11:17 danlarkin: it's always polite to go behind the scenes first

11:17 cemerick: Anyway, it creeped me out enough that I killed the node I started and walked away. AWS spoiled me, I guess.

11:17 danlarkin: I know if I were on the RS security team I'd appreciate it

11:18 AND it can save you public embarrassment if you're wrong :)

11:18 cemerick: danlarkin: True, noted. Exactly why I didn't bother publishing so far.

11:18 Clearly, it's not a problem for a lot of other people, presumably more security-conscious than I. So, perhaps I am just flat-wrong. :-)

11:19 * ejackson hands cemerick the tinfoil

11:21 cemerick: ejackson: I need it! Turns out my headphones sometimes pick up CB traffic (faintly!) from the nearby highway when I'm in the right room. I thought I was going nuts for a few nights.

11:21 ejackson: lmao !

11:21 pdk: i had that a few times like 10 years ago

11:22 i recall my old tiny speakers picking up a barber shop quartet on the radio

11:39 wastrel: ~/win 7

11:39 clojurebot: It's greek to me.

11:40 chouser: The clojure ggroup had double the number of messages in Jul as Jun, the most messages since March 2009

11:46 dnolen: chouser: I noticed that the other day. Though some really contentious threads contributed to that as well :)

11:48 chouser: yeah. I thought perhaps clojurescript, but that wasn't announced until lat in the month, right?

11:51 wastrel: what's clojurescript?

11:52 cemerick: wastrel's afternoon just got nuked ;-)

11:52 clojurescript?

11:52 clojurebot: clojurescript is Chouser's baby

11:52 cemerick: oy

11:52 clojurescript?

11:52 clojurebot: clojurescript is Chouser's baby

11:52 cemerick: clojurebot: ClojureScript is https://github.com/clojure/clojurescript

11:52 clojurebot: You don't have to tell me twice.

11:52 cemerick: wastrel: ^^

11:53 wastrel: oh that is super cute

11:53 cemerick: does clojurebot have `X is not Y` support?

11:53 pjstadig: clojurebot: forget clojurescript is Chouser's baby

11:53 clojurebot: You don't have to tell me twice.

11:54 pjstadig: ~clojurescript

11:54 clojurebot: clojurescript is Chouser's baby

11:54 pjstadig: usually works

11:54 clojurebot: forget clojurescript |is| Chouser's baby

11:54 clojurebot: I forgot that clojurescript is Chouser's baby

11:54 pjstadig: ~clojurescript

11:54 clojurebot: ClojureScript is https://github.com/clojure/clojurescript

11:54 pjstadig: thar

11:56 cemerick: nice

11:56 * cemerick hopes chouser has an easter egg somewhere in neo-ClojureScript that betrays its forebear ;-)

11:57 * ejackson wonders what cemerick has against the easter bunny.

12:11 clgv: When using delay & force is the delayed computation only calculated ones when multiple threads force it at the same time?

12:11 hiredman: yes

12:12 clgv: so the first calling thread to delay calculates the result and the others wait for it?

12:12 hiredman: yes

12:13 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Delay.java#L30

12:13 clgv: ah ok

12:33 dnolen: hey match on HN front page.

12:34 joegallo: who do i talk to about getting a jira account? i have a confluence account, but no jira account, or so it seems :/

12:35 Menthy: Does anyone know if ClojureQL supports functions like max(field) or lower(field), or what the general expression is to create such function ?

12:36 joegallo: ah, found it on my own

12:39 ambrosebs: dnolen: +1ed :)

12:46 crazyFox: When i do (unchecked-remainder a b) at the REPL, i get an exception: CompilerException java.lang.RuntimeException: Unable to resolve symbol: unchecked-remainder in this context, compiling:(NO_SOURCE_PATH:14). Im using clojure-1.3.0-beta1. Any thoughts what the reason is?

12:47 arohner: ibdknox: I have an idea for noir: optionally naming pages.

12:47 hiredman: crazyFox: there is no function called unchecked-remainder

12:47 arohner: ibdknox: I'd like to do something like (defpage [foo :get "/"] {id :id}), so that somewhere else, I can do (link-to (url-for foo) "a link")

12:48 crazyFox: http://clojuredocs.org/clojure_core/clojure.core/unchecked-remainder what about this one? is it only 1.2.0?

12:49 hiredman: crazyFox: open up core.clj and look

12:49 dnolen: crazyFox: some of the math stuff changed in 1.3.0.

12:50 crazyFox: you have unchecked-remainder-int now.

12:51 crazyFox: also (set! *unchecked-math* true) followed by (rem ...) will probably do what you want.

12:51 crazyFox: thats a nice pointer. it works. thank you!

12:52 dnolen: so, are all math ops after (set! *unchecked-macht* true) unchecked, until i set it to false again?

12:53 *math

12:53 raek: crazyFox: I think it is a compiler flag, like *warn-on-reflection*, that is read when the defns are compiled

12:54 dnolen: crazyFox: yes

13:02 clgv: I have several instance files that are loaded into my programm and then an algorithm is repeatedly executed on those instances. when the execution is sequential in one thread it lasts about 14secs when I use 4 parallel threads I get the results of all 4 of them after around 37secs. what might I do wrong?

13:03 currently I load the files via a memoized like approach with delay & force so that only one thread has to access the filesystem

13:06 ah the machine the program is running on has 12 physical cores

13:15 any idea?

13:27 manutter: And NetBeans 7 once again decides to fall over and die because I allowed it to upgrade itself. Sigh.

13:27 Yet another reason why I love working in PHP at my day job.

13:28 clgv: try eclipse ;)

13:28 cemerick: manutter: what does "die" mean, specifically?

13:29 manutter: cemerick: It tells me that it could not install a module (lucene something) and that therefore 61 other modules must be disabled, including all my PHP functionality

13:29 cemerick: ah

13:29 manutter: plus arbitrarily deleting some of my preferences and saved settings.

13:30 cemerick: NetBeans was segfaulting for me and others circa 6.8. I'd +1 the eclipse suggestion.

13:31 manutter: Well, I've got a couple reasons why that's an appealing alternative now

13:31 The other reason is I'm running the Zend server, and have a licensed copy of Zend Studio

13:32 but it's a hog (on my machine at least)

13:32 cemerick: I just finished eliminating the last vestige of PHP in my control. </relief>

13:33 manutter: o rub it in :P

13:33 cemerick: Just empathizing ;-)

13:33 TimMc: cemerick: Did you do it by replacing the PHP or ceding ownership? :-P

13:33 cemerick: replacing/eliminating

13:34 TimMc: bless you, then

13:34 cemerick: That also means I have no more apache or lighttpd instances under my control, which is nice

13:34 manutter: heh, maybe I can just look forward to that some day

13:34 no apache? you're all tomcat now or something?

13:34 cemerick: Yup

13:35 I get bashed for that here and there, but I've never quite understood why. Tomcat has always workedforme.

13:35 Hodapp: I am using Tomcat here. It's been working quite well.

13:35 manutter: Any limitations on it in a production environment?

13:36 clgv: ok a different question: how to implement a producer consumer scenario in clojure?

13:36 manutter: I mean, I'm sure it must have some limitations, everything does

13:36 but anything in particular that bothers you?

13:36 clgv: I have k producers and 1 consumer

13:37 manutter: clgv: I thought I recently saw some discussion about that, and IIRC someone recommended using plain old Java queues or something

13:38 clgv: manutter: I tired to do it like that as well, but somehow on a 12 core machine 10 threads spent most of the time in monitors...

13:39 cemerick: manutter: It was somewhat late to the party with the servlet 3 support (async requests) and such, I think. Maybe that's behind the griping.

13:41 manutter: cemerick: could be

13:41 clgv: I'm out of my depth at this point :/

13:42 oh gawd, I fired up Eclipse/ZendStudio since NB is hosed, and it's saying, "Upgrade available!"

13:42 Gaaaahh!

13:42 amalloy: clgv: one consumer? sounds like an agent

13:43 clgv: amalloy: could be an agent. but how to manage the k producers?

13:43 amalloy: *shrug* depends on your application

13:43 simplest off-the-cuff answer is "start up a future for each of them"

13:44 clgv: ok. or pmap then I guess

13:44 amalloy: pmap doesn't sound like a good plan to me

13:45 clgv: why?

13:45 clojurebot: why not?

13:45 clgv: clojurebot: kick

13:45 clojurebot: No entiendo

13:45 technomancy: clojurebot: how?

13:45 clojurebot: with style and grace

13:46 amalloy: i mean, how would you use it? pmap never has more than N active threads at a time (for some N)

13:46 if your producers block, or need to run indefinitely, then you can't run them all at once with pmap

13:46 clgv: ok.

14:28 crazyFox: what are these random answers of clojurebot sometimesß

14:28 ?

14:30 manutter: clojurebot is monitoring the clojars.org site for new uploads, and reporting them.

14:30 or else he's just bored

14:30 crazyFox: random. who programmed this thing?

14:31 manutter: hmm, I think clojurebot is hiredman's?

14:31 Not sure.

14:31 chouser: yes

14:32 crazyFox: clojurebot: who is your author?

14:32 clojurebot: author is hiredman

14:32 crazyFox: :)

14:32 Scriptor: hehehe

14:32 manutter: clojurebot scares me sometimes

14:33 amalloy: ~guards

14:33 clojurebot: SEIZE HIM!

14:33 crazyFox: manutter: right on to that

14:33 manutter: clojurebot: what is skynet?

14:33 clojurebot: I will become skynet. Mark my words.

14:33 * manutter looks for a rock to crawl under.

14:35 manutter: ~botsnack

14:35 clojurebot: Thanks! Can I have chocolate next time

14:35 amalloy: i forget who taught him that one. his built-in botsnack response is more entertaining

14:36 clojurebot: forget botsnack is |reply| Thanks! Can I have chocolate next time

14:36 clojurebot: I forgot that botsnack is reply Thanks! Can I have chocolate next time

14:36 manutter: ~chocolate

14:36 clojurebot: Titim gan éirí ort.

14:36 amalloy: ~botsnack

14:36 clojurebot: Thanks, but I prefer chocolate

14:36 amalloy: sigh

14:39 solussd: ~botsnack

14:39 clojurebot: Thanks, but I prefer chocolate

14:39 solussd: ~chocolate

14:39 clojurebot: It's greek to me.

14:39 solussd: ~don't get fat

14:39 clojurebot: Pardon?

14:41 solussd: ~(reduce + '(12 3 5 1))

14:41 clojurebot: ,(let [testar (fn [x y] (cond (= (reduce + (filter odd? (range 0 x))) y) (str y " is an square perfect")), :else("nao eh") )] (testar 10 25))

14:42 manutter: what the heck?

14:43 solussd: ,(let [testar (fn [x y] (cond (= (reduce + (filter odd? (range 0 x))) y) (str y " is an square perfect")), :else("nao eh") )] (testar 10 25))

14:43 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>

14:51 hugod: dnolen: congrats on match - looking very useful

14:51 do you have plans on pushing a jar for it?

15:06 arohner: ibdknox: I made a longer post to the clj-noir group about url-for

15:08 ibdknox: arohner: yeah, that's not an uncommon request

15:08 arohner: I'm not opposed to being able to name a page

15:08 arohner: ibdknox: do you have opinions on syntax?

15:09 ibdknox: arohner: I think I like this one the best: (defpage foo [:get "/foo/:id] {id :id}

15:09 arohner: k

15:10 ibdknox: arohner: or the same (depage foo "/foo/:id" {id :id} ...)

15:10 Vinzent: btw, jaco already has named routes

15:10 https://github.com/dnaumov/jaco

15:11 ibdknox: arohner: I think it should be optional though

15:12 arohner: ibdknox: sure.

15:27 ibdknox: arohner: did you *want* to take a stab at a patch? I'm happy to do it later.

15:27 arohner: ibdknox: yeah, I want to work on it, this is sort of blocking me. I should have something in a few hours

15:28 ibdknox: kidoke

15:28 if you just want to be unblocked

15:28 you can call a route via (render)

15:28 though it's not as pretty as what you've laid out there

15:35 dnolen: hugod: thx

15:35 Would like to get a couple more things in there first before pushing a jar.

15:45 hiredman: we'll have to see if technomancy can get rid of my 'match' on clojars

16:10 technomancy: hiredman: Do you really want to remove the "match" group and jar? [y/N]

16:10 hiredman: Yeah

16:11 technomancy: done

16:12 hiredman: dun dun dun

16:40 arohner: ibdknox: how do you run the tests?

16:42 ibdknox: arohner: lein test

16:46 arohner: make sure you do it against the vnext branch

16:46 mattmitchell: is there a built in function that will tell me if a list of numbers is either all in descending or ascending order?

16:46 technomancy: mattmitchell: < and >

16:46 arohner: ,(< 1 7 10)

16:46 clojurebot: true

16:46 mattmitchell: technomancy: awesome! thanks

16:46 arohner: ,(< 3 1 2)

16:46 clojurebot: false

16:46 mattmitchell: arohner: exactly what i was looking for, thank you

16:47 technomancy: they should really be thought of as increasing? and decreasing? rather than greater-than? and less-than?

16:53 joegallo: that's a nice way of thinking about it, technomancy

16:53 scottj: +1

17:15 amalloy: technomancy: going to rename <= non-decreasing too?

17:16 manutter: Does Eclipse play nicely with leiningen? I just installed Eclipse/CCW at home for the first time

17:16 and I've exhausted the "Getting Started" page at dev.clojure.org

17:17 amalloy: manutter: shouldn't you be reading help documents for ccw rather than whatever's at clojure.org?

17:17 manutter: That's where I started, but it led me on a chain of links to the page at dev.clojure.org

17:18 amalloy: ken wesson would love to hear that you're having trouble finding help with ccw, i'm sure :P

17:18 manutter: lol

17:18 amalloy: manutter: really though i've no idea. maybe cemerick can help

17:18 manutter: eh, I should probably ask earlier in the day, the main CCW guys are in France, aren't they?

17:19 amalloy: manutter: lpetit is, but i know cemerick does some work on it and is an advocate

17:19 manutter: yeah, it's partly cemerick's urging that got me here

17:20 * cemerick takes all possible credit, and ducks all possible blame :-P

17:20 manutter: Dunno what's wrong with my setup at work--I started Eclipse, and in 1 hr and 15 minutes I (a) opened a php file and (b) tried to run it in Debug mode

17:21 Finally I left to come home, and Eclipse was still cranking away at "Building workspace (75%)"

17:21 technomancy: manutter: worst case scenario is you do "lein pom" and treat it like a maven project

17:21 manutter: Sounds promising

17:21 cemerick: manutter: There is no Leiningen plugin for Eclipse. Use `lein pom` to produce a pom.xml you can use as a basis for a maven project in eclipse.

17:21 Feh. :-)

17:21 manutter: Eclipse Indigo at home is pretty cool, I'll be playing with it some more

17:22 * cemerick has been contemplating building a lein-eclipse plugin.

17:22 manutter: Is there a shell script plugin? That'd meet most of my needs

17:23 (where "my needs" == "too lazy to switch windows")

17:23 cemerick: "shell script plugin"?

17:23 manutter: eh, something that would let me run commandline commands or scripts from within eclipse

17:24 of course, that would end up being me calling "lein foo" from within eclipse, since lein is a script

17:24 it's no biggie of course, I just have to pop open a terminal window

17:25 I'm just kicking the tires and stuff, haven't played with eclipse in years and don't remember what all it does.

17:26 cemerick: manutter: That's built-in. Menus: Run > External Tools > External Tools Config. Create a new "program" config. Specify your path to lein, and I think there's a property you can use to dynamically choose your working directly based on "current project". Command line args of "pom".

17:26 Bind that to a keystroke, and you've got `lein pom`.

17:26 manutter: cool, that's the ticket :)

17:27 thanks guys, I'm off to play some more then

17:28 cemerick: manutter: The above is untested, BTW ;-) …but should work

17:28 manutter: I'll test it then :)

17:31 cemerick: Huh, nifty. ${container_loc} as working directory works nicely :-)

17:31 manutter: ^^

17:32 manutter: awesome, thanks

17:32 cemerick: That's probably going to key off of the active (or most-recently-active) editor to determine "active project".

17:39 manutter: Cool, lein pom works

17:39 lein deps is going to have issues because the lein directory structure is different from eclipse's

17:39 amalloy: manutter: both of those are trivially configurable

17:40 manutter: aha thanks

17:40 cemerick: manutter: eclipse doesn't have a particular directory structure…

17:40 manutter: I sould be able to track that down then

17:40 s/sould/should/

17:40 lazybot: <manutter> I should be able to track that down then

17:52 manutter: so before I chase this too far, what's the usual eclipse way to add, say, compojure to a clojure project? I suspect it's not lein deps...?

17:53 Scriptor: manutter: yep, nothing to do with eclipse

17:54 just add the latest compojure to project.clj and do lein deps

17:54 manutter: ok, that's good news for plugin related stuff too (lein noir new foo)

17:55 and I just have to add lib/*.jar to the classpath

17:55 after lein deps

17:56 So far I've got two clojures tho: lib/clojure-1.2.1.jar and Eclipse's native clojure.jar at the root level

17:56 Scriptor: wait, why do you need to add them to the classpath?

17:56 lein handles most classpath stuff

17:56 well, not sure how it integrates with eclipse, I guess

17:57 manutter: That's what I'm wondering abou

17:57 *about

17:57 I'm cool with emacs and cli lein, just not sure how to achieve the same results in eclipse

17:58 I suppose I could use lein deps and lein swank, and just use Eclipse's "connect to external REPL" command

18:02 ibdknox: manutter,

18:02 someone had a noir "template" for eclipse

18:02 https://github.com/yogthos/Noir-Eclipse-Template-Project

18:03 you could use that as a rough guide on setting up the classpath/project file for eclipse correctly

18:03 *disclaimer* I haven't tried it

18:13 technomancy: manutter: use lein repl instead of swank; it starts a socket repl

18:27 ibdknox: arohner: I left a couple comments. The patch looks good, just don't want a contrib dependecy

18:27 arohner: ibdknox: ok

18:27 I'll have those fixed tomorrow

18:27 ibdknox: awesome, good work sir!

18:32 manutter: ibdknox, technomancy: thanks!

18:33 ibdknox: manutter: anytime

18:47 justicefries: what are the good/recommended clojure books?

18:47 Raynes: All of them.

18:48 justicefries: fair enough. ;)

18:51 Raynes: justicefries: Programming Clojure is horribly out of date at this point, though I hear they're currently writing the second edition.

18:51 justicefries: ah ha.

18:51 Raynes: Beyond that, you should be fine.

18:51 justicefries: I'm going through the Clojure reference now, was looking at Joy of Clojure as well

18:51 Raynes: Practical Clojure + The Joy of Clojure tends to be a popular combo.

18:51 justicefries: ah

18:51 perfect

18:52 Raynes: When my book comes out it'll (obviously) take over the world.

18:52 But until then, you people just have to deal.

18:52 justicefries: ha! What's the book?

18:52 Raynes: meetclj.raynes.me

18:52 justicefries: nice. I'm straying away from Ruby-land.

18:52 Raynes: Not cool enough to have its own domain name.

18:52 justicefries: into clojure.

18:53 gfrlog: clojure has totally ruined ruby for me

18:53 * cemerick nabed clojure-book.com :-P

18:53 justicefries: yup.

18:53 been doing obj-C and clojure.

18:53 Raynes: cemerick: Damn you all to hell.

18:54 technomancy: programming clojure isn't that out of date

18:54 amalloy: Raynes: just hack his website

18:54 Raynes: technomancy: It's pretty well out of date.

18:54 cemerick: Raynes: Surely the right domain will get you #2 in google results? ;-)

18:54 technomancy: the only thing that's confusing is that it talks about structs

18:54 gfrlog: Raynes: what is chapter 7 about?

18:54 technomancy: the lack of protocols/records shouldn't be an issue for an introductory book

18:54 Raynes: gfrlog: Lisp. It's the macro chapter and such/

18:54 technomancy: Doesn't it make use of contrib libraries that don't even exist anymore?

18:54 gfrlog: Raynes: and how do you pronounce the chapter name?

18:55 Raynes: gfrlog: You don't.

18:55 And those chapter names are tentative and likely to change as I think of cleverer names.

18:55 gfrlog: oh now I have to just to be contrary

18:55 Raynes: You can pronounce it "chapter 7"

18:55 technomancy: hm... I guess there's a fair amount of contrib stuff there

18:55 amalloy: gfrlog: i think it sounds like a raspberry

18:55 gfrlog: I think my first instinct is to pronounce it as if it were a long string of 'f's

18:56 ibdknox: technomancy: I had a friend go through it recently, and there was a fair amount I had to help with

18:56 Raynes: The order of the chapters is probably not final either.

18:56 amalloy: technomancy: when Raynes said "all of them", i reminded him of all the poor souls who ask how to use duck-streams with clojure-1.0.0-SNAPSHOT or some equally absurd version

18:56 ibdknox: lol

18:57 justicefries: i have beginningclojure.com :)

18:57 technomancy: people pick on programming clojure because it doesn't cover records, but I don't think that's a fault. if you've only got 200 pages, it's perfectly reasonable

18:57 * gfrlog has lolwaffle.com

18:57 amalloy: technomancy: totally agree there. who cares

18:58 the fewer new users who hear about records, the happier #clojure will be

18:58 ibdknox: haha

18:58 Raynes: My book will probably cover twice as much as Programming Clojure in the same number of pages. Whether that's a good thing or not remains to be seen.

18:58 gfrlog: what's the concisest/cleverest way to reverse an interleave operation?

18:58 amalloy: gfrlog: that's a question on 4clojure. best answer has been tweeted

18:59 gfrlog: amalloy: okay I'll go browse

18:59 amalloy: &(->> [[1 2 3 4] [:a :b :c :d]] (apply interleave) (partition 2) (apply map list))

18:59 lazybot: ⇒ ((1 2 3 4) (:a :b :c :d))

19:00 amalloy: gfrlog: (for your convenience)

19:00 gfrlog: amalloy: thanks. That is exactly as clever as I was hoping it would be.

19:01 * amalloy learns a lot from following the #4clojure tag

19:02 justicefries: Raynes: when'll the book be finished?

19:02 (hurry up.)

19:02 Raynes: justicefries: Sometime in the next 10 years or so, I imagine.

19:04 My deadline with my publisher is November unless they extend it. I kind of skipped the last 4 months with very little work on the book. If by some miracle I manage to finish it by November and/or my publisher doesn't drop me like a brick for being slow, sometime early next year would be my best guess.

19:07 And to anybody thinking me lazy, just you try to keep yourself motivated to write a book when you have to spend half of your day fighting with OpenOffice to do it. Just... you... try...

19:07 amalloy: take a detour to write a program that converts markdown into their crazy openoffice format

19:07 how long can that take...

19:07 Raynes: Man, the stuff that OpenOffice generates...

19:07 ibdknox: LaTeX

19:08 :p

19:08 Raynes: It isn't even natural. It isn't human.

19:08 It's like a Dalek core dump.

19:10 justicefries: OO is nasty. Do it in Byword

19:10 .

19:11 Raynes: justicefries: They have this insane OpenOffice template that I have to use. Picture this: 3 different styles applies to three different portions of a single code block and *every* single code block.

19:11 justicefries: what? that sounds wild.

19:11 Raynes: CodeA for the first line, CodeB for the middle lines, CodeC for the final lines.

19:12 cemerick: You don't know how good you have it, man.

19:12 cemerick: Raynes: I'm _very_ aware of my markup nirvana. :-)

19:13 justicefries: that sounds pretty ugly.

19:13 cemerick: Raynes: If I were you, I wouldn't bother with their templates or openoffice at all until you're 98% *done*. At that point, pick through as you need to match what's required.

19:14 * cemerick joins in on the bikeshedding :-P

19:14 Raynes: cemerick: I think it's likely more tolerable to apply the styles as I go, because there are a lot of them. A l-o-t of them.

19:14 amalloy: i imagine cemerick is right

19:15 because then you can edit stuff

19:15 Raynes: Well, I can edit stuff anyways.

19:15 cemerick: constantly going type-3-words, mouse around, type-6-words, mouse around would drive me batty.

19:15 * cemerick may be being uncharitable — perhaps it's not that bad

19:16 Raynes: It's pretty bad. I should have self published.

19:16 carlo_au: Raynes: why not LaTeX?

19:16 Raynes: carlo_au: Because my publisher doesn't like it.

19:16 And I don't really like it either.

19:17 Don't really want to learn a new language to write a book.

19:17 If they just had an asciidoc or docbook workflow like every other decent publisher, things would be easy.

19:17 cemerick: I thought conversion to emacs required a tour of duty in the LaTeX mission?

19:18 carlo_au: Raynes: there's not that much to LaTeX

19:19 the horrible details are best left to a publisher

19:19 cemerick: Raynes: Right, see, you should just march in there and set them straight. ;-)

19:20 Raynes: I've complained so hard.

19:20 * cemerick was being sarcastic…

19:20 Raynes: I know, but I seriously have.

19:20 I seem to recall saying something like "Please, oh please, come up with some sort of markup workflow. If not for me, for future writers."

19:20 cemerick: Things like this are fundamentally not worth fighting for.

19:21 Raynes: Why not?

19:22 cemerick: Because you have no stake in the inner bowels of a publisher you have no stake in, and even if you were to convince them to change things, that change would surely not go into effect in time for you to take advantage.

19:23 It's like me walking into a department store and trying to get them to change their POS system.

19:24 Raynes: My editor said that he had been working on getting some sort of asciidoc or markdown workflow going, but hadn't been successful yet. I mostly encouraged him. I didn't really elevate my position.

19:25 cemerick: Sure. I've seen people invest a lot of resources into pitched battles like this. I guess it was a generalized comment.

19:26 technomancy: manning used to require _word_ files, so... it could be worse

19:30 amalloy: technomancy: i have this bizarre mental image of sending them a book comprised of a zillion single-word files and waiting for them to stitch it all back together

19:31 technomancy: amalloy: sounds about right; isn't that how Office works behind the scenes?

19:31 * gfrlog wonders how different these conversations are among _non_-technical authors

19:31 amalloy: it would explain the size of the .doc files

19:32 cemerick: gfrlog: non-technical people in general aren't so picky and irritable as we are.

19:32 Raynes: cemerick: Paragraph styles are easy for the most part. The template automatically uses the right paragraph styles and switches them when they need to be switched. The only time I have to set a paragraph style manually is when I'm pasting a block of code or doing something equally... different.

19:32 Character styles are a problem.

19:32 amalloy: gfrlog: "Isn't it great that you can send Word files? Last time I published you had to supply your own ink and typewriter"

19:32 Raynes: There are a lot of 'literal' words (names of functions and such) in my book so I have to set literal, write the word, set default, continue.

19:33 gfrlog: amalloy: that's the kind of thing I was thinking. that maybe word files are literally the best that a publisher could possibly offer.

19:33 cemerick: Raynes: asciidoc inline styles: _foo_, `bar`, *baz* </rubbing-it-in> :-D

19:33 gfrlog: Raynes: you have keyboard shortcuts for all that?

19:33 kwertii: learning LaTeX was highly annoying. it has a bizarre and archaic syntax, and a million subpackages for every little thing. it was a very steep and painful learning curve. BUT now everything prints EXACTLY as I want it to.

19:33 Raynes: I have a keybinding for that though. As a matter of fact, keybindings would make nearly all of this irrelevant but OpenOffice shortcuts are completely destroyed on OS X.

19:35 cemerick: One fantastic thing is that I get to use wingdings. Never thought I'd get to do that.

19:35 cemerick: Raynes: for what?

19:36 Raynes: Numbering lines in code so that I can address each line individually in my text.

19:36 Stuff like that.

19:36 cemerick: Right, callouts.

19:37 asciidoc callouts are pretty nifty http://www.methods.co.nz/asciidoc/chunked/ch17.html#CO1-3

19:38 Raynes: Man, this conversation has sucked like an hour of productivity out of my work day. You should all be ashamed.

19:38 cemerick: I do wish github had better asciidoc support. It blows markdown out of the water completely.

19:41 technomancy: markdown is totally a least-common-denominator

19:42 cemerick: Perhaps, but it's better than a lot of other options.

19:42 I could never stand textile, for example. There's another extraordinarily verbose markup out there that is popular for reasons passing understanding, the name for which escapes me.

19:43 technomancy: mediawiki?

19:44 Raynes: Whatever pathetic markup that JIRA uses?

19:44 cemerick: heh, that's not it, but it's worse than all the others combined

19:44 amalloy: argh jira

19:44 Raynes: $kill

19:44 lazybot: KILL IT WITH FIRE!

19:56 hiredman: you can tell emacs is a serious editor because it runs as part of its own build process

21:18 leo2007: Good morning.

21:18 When I run swank-clojure shell script, it prints back: user=> Connection opened on null port 4005

21:18 but slime-connect fails

21:18 Connecting to Swank on port 4005.. [2 times] open-network-stream: make client process failed: connection refused, :name, SLIME Lisp, :buffer, nil, :host,, :service, 4005, :nowait, nil

21:19 ideas?

22:06 fmw: I posted a clojurescript related post to HN: http://news.ycombinator.com/newest

22:06 not linking directly on purpose, because the HN system detects any upvotes from that as cheating ;)

22:24 amac_: I've having a few problems with namespaces: I need to intern a bunch of defs to partial fns at runtime, the first problem is that if I intern to *ns* it doesn't refer to the ns of the caller it's hitting some global ns (lein points to 'user, running the jar dumps in 'clojure.core(?!)), the second is that regardless of where they are interned I can't seem to call them (they don't pass the compiler check that they exist,

22:26 hiredman: *ns* is a compile time construct

22:26 vars are resolved at compile time

22:26 amac_: damn.

22:27 leo2007: why the means I use to connect to internet interfere with slime connection to swank-clojure?

22:27 on the same machine of course.

22:28 amac_: leo2007: what problem are you seeing?

22:29 leo2007: for example, when I am connecting to internet through my iphone, I am getting Connecting to Swank on port 4005.. [2 times] open-network-stream: make client process failed: connection refused, :name, SLIME Lisp, :buffer, nil, :host,, :service, 4005, :nowait, nil

22:29 amac_: hiredman: is there a proper way to define things at runtime and have them be visable?

22:29 hiredman: "don't"

22:29 amac_: hah

22:29 amalloy: amac_: good advice

22:30 amac_: leo2007: could be how your phone is routing traffic

22:30 hiredman: I mean, you can do it, but if you find yourself doing it, you should stop and do something better

22:30 leo2007: amac_: common lisp swank works just fine.

22:31 amac_: It was just meant to be some syntactic niceness in an orm I'm writing, map the crud fns to nice names that are defined outside the scope of the script

22:31 leo2007: that's odd, how are you launching swank?

22:32 leo2007: I run the swank-clojure script in .lein/bin

22:32 amac_: scratch that, use the lein plugin

22:32 leo2007: what?

22:32 clojurebot: what is bla

22:32 amac_: then just go to your project and type "lein swank"

22:33 are you familiar with lein?

22:33 leo2007: amac_: I can only tested it later since I cannot disconnect now.

22:33 amac_: a little bit by reading lein --help

22:33 I am comfortable with lisp and slime/swank though.

22:34 amac_: lein is a dependency/build tool, and pretty standard for most clojure projects, it also has a plugin for easily launching swank

22:35 take a look at the github page for instructions

22:36 leo2007: amac_: I need to modify swank-clojure to work with latest slime. Loading that old slime.el screw over my setups for common lisp and scheme.

22:36 amac_: thanks for the pointer.

22:37 jweiss: this is a bizarre bug. with my project (mix clojure java) using lein's classpath, a simple test with xmlrpc client deadlocks waiting for a connection. if I remove src/ and resources/ from the classpath, it works. but leaving either one in, deadlocks.

22:37 the test is entirely a java codepath, so the clojure source being in the classpath shouldn't matter

22:37 and certainly not the png files in resources/

22:39 amac_: leo2007: np, ping me later if its still not working for you

22:41 leo2007: amac: thanks a lot.

23:13 gfrlog: ,(println ",(println :foobar)")

23:13 clojurebot: ,(println :foobar)

23:13 gfrlog: drat

23:18 amac: gfrlog: Isn't there a second bot in here still? Get them to talk to each other. :)

23:19 amalloy: jesus. do we have to do attempt-and-fail a bot-storm every week?

23:20 amac: yes.

23:21 gfrlog: amac: I thought of that one a while ago. Why it took me this long to try clojurebot on itself, I'm not sure.

Logging service provided by n01se.net