#clojure log - Feb 02 2013

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

0:10 yedi: is it me or has clojure been hitting the frontpage of hn a lot lately

0:11 ChongLi: confirmation bias :)

0:12 arrdem: lol

0:12 best bias to have :)

0:12 ChongLi: sure, as long as it doesn't lead to blue laws and/or violence

0:18 arrdem: I'm sure if you cared enough you could crawl HN's API and show that the current spurt of CLJ related headlines is statistically significant..

0:21 ChongLi: http://www.google.ca/trends/explore#q=clojure

0:21 seems like a pretty sharp increase since 2008 or so

0:21 late 2007

0:22 arrdem: haha "clojure for"

0:22 good lord traffic from northern CA

0:24 frozenlock: Let's compare... http://www.google.ca/trends/explore#q=clojure%2C%20java&cmpt=q

0:25 arrdem: frozenlock with the circlejerk killer...

0:25 ChongLi: should only be a few more years until we catch up!

0:25 frozenlock: Almost there :P

0:25 arrdem: C++ and Python are almost flat...

0:25 interesting.

0:26 ChongLi: from 100% down to 30%

0:26 java's really dropping like a stone

0:26 frozenlock: So is Emacs :(

0:26 arrdem: what's interesting to me is that Python is too..

0:26 ChongLi: that's ok

0:26 light table will fill the void!

0:26 arrdem: so what language is picking up the slack?

0:27 ChongLi: http://www.google.ca/trends/explore#q=lighttable%2C%20emacs&cmpt=q

0:27 lighttable is catching up even faster!

0:27 frozenlock: ChongLi: Must be 100% FOSS for that. Will LightTable be?

0:27 ChongLi: yeah

0:27 arrdem: eventually (tm)

0:27 ChongLi: lighttable will give you the editor as a value!

0:44 arrdem: is there some way to profile my ring/noir server and see why it's spinning?

0:53 Raynes: It's trying to tell you to switch to Compojure + lib-noir.

0:54 arrdem: haha

0:55 yeah that's on the todo list but getting my /resume page up to date comes first

1:50 headshot: hahaa "everything emacs can do, vi can do in an alternate universe way"

1:51 Raynes: headshot: I don't think so, actually.

1:52 I emulate vim in Emacs every day. I'd love to see someone emulate Emacs in vim.

1:52 headshot: i'm quoting stuart halloway

1:52 Raynes: I knew that guy was dumb.

1:52 I'll tell him he is dumb at the next conj.

1:53 But then again, at the last conj I saw him coming back all sweaty from a work out. I have a feeling he could kick my ass.

2:00 AtKaaZ: can this be done? namespace X uses namespace Y and namespace Y wants to make a function from namespace Z public to X without redefining it in Y ? (refer ?)

2:01 namespace X doesn't use namespace Z, obviously

2:01 Raynes: AtKaaZ: https://github.com/flatland/useful/blob/develop/src/flatland/useful/ns.clj#L19

2:03 AtKaaZ: so it can't be done with refer that's for sure, right? thanks

2:04 Raynes: You can't do it without aliasing.

2:12 AtKaaZ: Raynes, can I not name it the same name ? https://gist.github.com/4696402 do I have to somehow exclude deftest from :use ?

2:15 I'm failing to find docs for ns

2:16 ok found something here: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/ns

2:18 ok got it to work: https://gist.github.com/4696402

2:26 is there something that would auto indent clojure code ie. https://www.refheap.com/paste/9175

2:40 mattmoss: AtKaaZ: clojure.pprint/pprint

2:41 AtKaaZ: mattmoss: excellent! Thank you!

2:42 h0bbit: I vaguely recall reading that clojure 1.5 will have a function that will allow me to break out of a reduce

2:42 does anyone remember the name of that function?

2:50 AtKaaZ: can refheap do something like: there's an updated version of this paste (like pastebin can) ?

2:54 Raynes: AtKaaZ: You have to be logged in, but you can edit pastes if you are.

2:54 AtKaaZ: cool

3:04 new and is are so picky

3:05 got forbit I pass them a symbol or var or anything that's a non-class

3:06 s/forbit/forbid

3:09 by 'is' I mean, (is (thrown? clshere ...)) and by 'new' i mean (new clshere ...)

3:15 alex_baranosky: after using a lot of keyword args in prod code, and while trying to get real work done, I find that something I do often enough that it is annoying is to accidentally pass a typo in a keyword arg. So, I'm write a macro defn-kw that would behave like this: https://www.refheap.com/paste/9177

3:15 now I can remove a class of things that waste my time :)

3:38 amalloy: h0bbit: reduced

3:38 h0bbit: amalloy, ty. reading up on it now.

3:41 amalloy, how is this supposed to work?

3:41 the doc string says : "Wraps x in a way such that a reduce will terminate with the value x"

3:42 but there isn't an example of how to use it.

3:52 Sgeo: ,reduced

3:52 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reduced in this context, compiling:(NO_SOURCE_PATH:0)>

3:52 Sgeo: Do any of the bots have access to it?

3:53 AtKaaZ: ,*clojure-version*

3:53 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

5:50 borkdude: xeqi nice video about friend

6:34 AtKaaZ: is it possible to make fixtures apply only to a certain test? I need something like before and after but only for a specific deftest

6:42 (without moving it into a new namespace to live alone)

6:45 babilen: AtKaaZ: Something along the lines of https://github.com/marick/Midje/wiki/Setup%2C-Teardown%2C-and-State but for clojure.test you mean?

6:47 AtKaaZ: babilen, exactly, except must not use midje :)

6:48 babilen: AtKaaZ: I don't think that's possible. Why can't you use midje? It would allow you to keep your "old" tests while being able to write "new" midje ones

6:48 AtKaaZ: babilen: it's mainly because it just executes/compiles all .clj files it can find when doing lein midje

6:49 babilen: AtKaaZ: My understanding of clojure.test (and one of the reasons why I started to use midje ages ago) was that fixtures are strictly per-namespace with something that runs once or before/after every test.

6:49 AtKaaZ: that's how I understand them also

6:49 babilen: Well, unless somebody knows better we at least understand it in the same way :)

6:50 AtKaaZ: alrighties then, I'm now allowing myself to find a way, since I assume there's none (in clojure not midje) already

7:41 thalassios_xelon: hello :) i want to make a jar from eclipse,i have counterclockwise installed,how can i do it? any tutorial to read or help?

7:42 i've never made a jar before

7:46 abp: thalassios_xelon, never tried that, probably just use leiningen from the command line?

7:46 thalassios_xelon: how to do it from lein?

7:46 any tutorial?

7:46 i found one ,online

7:47 i will try it...

7:47 abp: thalassios_xelon, http://code.google.com/p/counterclockwise/wiki/Documentation#Distribute_as_a_jar

7:47 thalassios_xelon: abp i tried that i i couldnt do it

7:48 thx i will try again

7:50 abp: thalassios_xelon, ok, never tried from eclipse. lein uberjar is easy enough https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#what-to-do-with-it

7:53 thalassios_xelon: thx i am reading it ....

8:07 borkdude: not clojure related per se, but I need to represent some tabular data which can be drilled down into detail. any libraries that support this?

8:12 it could just be smth client side with static data

8:12 which can be provided with a map for example

8:43 pepijndevos: Is there a regex that will produce ["foo" "bar" "," "baz" "?"] for the following string? (s/split "foo bar, baz?" #".......")

8:44 OscarZ_: trying to get started with Clojure dev in Eclipse, created a new project with lein new, then added a lein-eclipse dev dependency and ran "lein deps". I am still getting "eclipse is not a task" when I run "lein eclipse"

8:45 pepijndevos: #"\b" produces ["" "foo" " " "bar" ", " "baz" "?"], which is close, but not quite right

8:49 OscarZ_, lein 1 or 2? I can;t help you much, beyond observing that it might be a version incompatability.

8:49 lein 2 has a new plugin system

8:50 OscarZ_: yeah thanks, I just found out about the lein 2 having different plugin system ... I was reading some example for lein 1

8:50 i have to write ~/.lein/profiles.clj apparently

8:52 hyPiRion: ,(mapcat (partial re-seq #"[^,?]+|[,?]") (re-seq #"[^\ ]+" "foo bar, baz?"))

8:52 clojurebot: ("foo" "bar" "," "baz" "?")

9:00 borkdude: pepijndevos hehe http://txt2re.com/index-java.php3?s=foo%20bar,%20baz?&amp;-23&24&2&4&3

9:00 pepijndevos: weee

9:02 I also found this one: http://stackoverflow.com/a/5214338/183662

9:41 thalassios_xelon: hello, i want to put a argument in main, '(and a b) and call a function with that argument,how to do it?

9:42 (defn -main [&args] (table args)) wont work

9:45 jeremyheiler: Do you want to pass in the args vector as a parameter, or each element in args as parameters?

9:45 to the table function.

9:45 thalassios_xelon: args is the parameter

9:46 '(and a b) is a possible args

9:46 jeremyheiler: solussd, the quoted list is what you want to pass into table, right?

9:46 so*

9:46 thalassios_xelon: (-main '(and a b) sould call (table '(and a b))

9:46 solussd: :D

9:47 jeremyheiler: sorry solussd, must of autocompleted lol

9:47 solussd: ha

9:48 jeremyheiler: The code you provided is effectively calling this (-main ('(and a b)))

9:49 args is presented to you as a list, so you need to unwrap it.

9:49 try (apply table args)

9:50 or (table (first args))

9:51 thalassios_xelon: (table (first args)) calls (table '(and )

9:51 i think

9:51 ......

9:51 the args is array seq not a list.........

9:52 thx jeremyheiler i didnt solve the problem but i will try again

10:02 pepijndevos: whoa, I just realised one coul write a program in core.logic to generate all possible questions to which the answer is 42.

10:02 jeremyheiler: thalassios_xelon, that shouldn't matter. https://www.refheap.com/paste/9179

11:04 cemerick: Adding [lein-swank "1.4.5"] to my project.clj's :plugins seems to force my project to use clojure 1.2.1. Global :exclusions of [org.clojure/clojure] seem to not apply. Thoughts?

11:09 OK, I think I'm having issues because I'm trying to not use an org.clojure/clojure dep

11:12 xeqi: cemerick: https://www.refheap.com/paste/9180 look ok to me

11:12 ah

11:14 cemerick: In any case, I think :exclusions isn't being applied *globally*-globally :-P

11:18 xeqi: with https://www.refheap.com/paste/9181 `lein swank` uses 1.5.0

11:18 but I could believe the global exclusions bug

11:21 cemerick: hrm

11:24 nbeloglazov: Hi. How do I implement syncrhonous mutable queue in clojure? Can I do it using atom/refs or need to use low-level locking? My main concern about "get" method that should modify queue and return first item from it. I don't want to use built-in java classes because I need to perform custom stuff in put and get.

11:26 craigbro: agent shoudl do it

11:26 hyPiRion: nbeloglazov: use clojure.lang.PersistentQueue/EMPTY

11:27 xeqi: (inc hyPiRion)

11:27 lazybot: ⇒ 12

11:27 nbeloglazov: craigbro: How I can do it with agent? How do I implement get method?

11:27 hyPiRion: but it's immutable. How do add mutability to it?

11:28 hyPiRion: nbeloglazov: (ref (clojure.lang.PersistentQueue/EMPTY))

11:28 nbeloglazov: what about get method?

11:28 xeqi: (let [q (atom clojure.lang.PersistentQueue/EMPTY)] (swap! q conj 1) (swap! q pop))

11:28 cemerick: nbeloglazov: Just use a queue from java.util.concurrent

11:28 oh, sorry, didn't finish reading your msg :-P

11:28 nbeloglazov: (swap! q pop) make no sense to me

11:29 Because I can't get removed element

11:29 cemerick: In any case, you can provide "put" and "get" fns that do whatever custom bits you want, but which are backed by a j.u.c queue that will just work.

11:33 hyPiRion: (let [q (ref clojure.lang.PersistentQueue/EMPTY)] (dosync (alter q conj 1)) (dosync (let [v (peek (ensure q))] (alter q pop) v))) should work fine.

11:34 First dosync is insertion, second is popping elements.

11:35 Consider replacing alter with commute if actions are commutative.

11:35 nbeloglazov: Actually I need some kind of priority synchronized queue that ensure uniqueness of the elements. It shouldn't be really fast or smart so I was going to do it using usuall set for uniqueness and find "least" element on every "get" and remove it. I wondered if I can do it using atom/ref/agents.

11:35 hyPiRion: I'll check it now

11:39 abp: Hi cemerick, the "write end dead"-exception in nrepl seems to become worse for some windows users. I think it's with the most recent nrepl-version but can't tell you for sure. Co-workers experience it through nrepl.el and I've seen it with eclipse ccw twice today.

11:46 cemerick: abp: "write end dead"?

11:48 abp: cemerick, I think as in https://groups.google.com/forum/?fromgroups=#!topic/clojuredev-users/eh1pjfI_iHQ

11:49 cemerick: abp: oh, this is related to *in*?

11:49 abp: cemerick, haven't copied my stacktrace, this time it's on windows 7 machines, at least three different, only thing in common between these is latest nrepl-version

11:49 cemerick, probably

11:51 cemerick: ok

11:52 The *in* support is included in the automated tests, but I don't use it

11:53 abp: the best bet would be to have someone who uses it regularly (hint!) to dig in and see what might be the underlying problem.

11:53 abp: cemerick, I really have no idea what triggers it. Seems not reproducible, but sometimes it can get nasty and occurs every few seconds after repl restart.

11:53 cemerick: abp: but is it only when you're using *in*?

11:54 abp: cemerick, how do I know that?

11:54 cemerick: if you're using read-line or something similar

11:54 That's what the ML thread is about, anyway

11:55 abp: cemerick, oh, he yes, I think so. We were doing a console-app competition.

11:55 cemerick: right

11:55 Both nrepl.el and ccw have horrible UIs for such things

11:56 abp: cemerick, phew that's not as severe as I thought then. :)

12:09 borkdude: I like it that nrepl also works from outside a project

12:11 btw is it possible to have every repl on my system (set! *print-length* 200) without manually doing so?

12:12 hyPiRion: borkdude: use :repl-options inside a :user profile in your $LEIN/profiles.clj

12:13 borkdude: hyPiRion what's the syntax for that

12:13 :repl-options {*print-length* 200} ?

12:18 hyPiRion I got this, but it doesn't seem to catch on https://www.refheap.com/paste/9182

12:20 craigbro: borkdude: do you realize that that example with *print-length* is going to save hours of my life?

12:21 borkdude: craigbro no, but I'm glad

12:21 craigbro: haha, I am dealing with some gigantic data structures, and if I accidently eval something that returns them, it nearly kills my emacs

12:21 never even thought of setting that, derp

12:21 borkdude: craigbro there's also print-level I think

12:21 ,(binding [*print-length* 10] (range))

12:21 clojurebot: (0 1 2 3 4 ...)

12:22 borkdude: haha, binding doesn't work there?

12:22 hmm, what happens if you nest bindings

12:23 ,(binding [*print-length* 10] *print-length*)

12:23 clojurebot: 10

12:24 borkdude: ,*print-level*

12:24 clojurebot: 10

12:24 borkdude: ,*print-length*

12:24 clojurebot: 5

12:37 mindbender1: how does ring-jetty serve static files. Is there a way of knowing where jetty looks for static file or changing where it does?

12:38 weavejester: mindbender1: It doesn't. :)

12:38 mindbender1: You need to explicitly add middleware (or in Compojure, a route) to serve static files.

12:39 You can serve static files from a directory using ring.middleware.file/wrap-file or compojure.route/files

12:39 But the recommended route (no pun intended) is to serve static files from Java resources, using ring.middleware.resource/wrap-resource or compojure.route/resources

12:40 That way your resources aren't tied to the filesystem - they could be packaged up in a jar (for instance)

12:41 mindbender1: weavejester: thanks for clarifying this. I have been avoiding asking this questiom trying to figure out myself but I guess you've set my mind straight

12:41 xeqi: is there a middleware for adding cache headers when serving from a jar?

12:41 and also checking them

12:41 weavejester: xeqi: Not currently, but probably for Ring 1.2

12:42 Actually… let me check that.

12:42 xeqi: I've seen a couple of pastes in places for something similar, but hadn't found one packaged up yet

12:45 weavejester: xeqi: Yes, Ring 1.2 does it with resource-response.

12:45 I actually should release a beta of that.

12:47 There are three things in Ring 1.2 left to add, and they're all 90% done. I just need to make that last effort :)

12:48 I wish github would improve their search

12:49 The results it gives back are still rubbish.

12:49 xeqi: is there a middleware for checking If-Modified-Since and returning 304s?

12:50 weavejester: xeqi: In Ring 1.2 there is wrap-not-modified

12:50 Let me release a beta version today

12:50 xeqi: haha, I completely missed that scanning the filenames

12:50 thanks

13:43 OscarZ_: I've setup a project using compojure template in Eclipse.. how do I get this thing running so I can get hello world to browser? :) I tried right clicking handler.clj and running it as Clojure application but its not listening to 8080

13:43 REPL is up

13:44 weavejester: Try port 3000? I'm not familiar with the compojure template for Eclipse, unless it hooks into the one for Leiningen.

13:45 OscarZ_: its not on 3000 either..

13:45 sorry, I created the project with lein new compojure compojure-test

13:46 weavejester: OscarZ_: In which case, try running "lein ring server"

13:47 OscarZ_: yes that works

13:47 thanks... is there a way to launch it directly from Eclipse by a run configuration?

13:48 hmm it seems to pick up the changes I make to classes on the fly, so I guess I dont need that

13:51 craigbro: has anyone else transition a noir app to compojure + libnoir?

13:51 I have a rather large one

13:51 weavejester: Hum, tools.namespace now has a lot of the functionality I need for ns-tracker, but lacks a few critical areas.

13:51 craigbro: I would hate to have to reconfigure all my defpages

13:54 weavejester: Bleh, updating ns-tracker is going to be a pain. tools.namespace does *almost* what I want, but is one step behind ns-tracker in certain areas.

14:06 amalloy: weavejester: perhaps bultitude has what you want?

14:06 abedra: gfredericks: what were your concerns with using Util.hasheq for CLJ-1106?

14:06 versus copying the logic from APersistentMap ?

14:07 weavejester: amalloy: No, it's mostly around the dependencies.

14:07 tools.namespace assumes order doesn't matter a lot of the time.

14:07 Which lead to problems that I fixed in ns-tracker.

14:08 abedra: stuarthalloway_: do you see any downsides with the Util.hasheq approach?

14:09 weavejester: amalloy: But thanks for the reference anyway

14:09 stuarthalloway_: context for abedra's question: http://dev.clojure.org/jira/browse/CLJ-1106?

14:09 abedra: yes sorry

14:09 stuarthalloway_: Util.hasheq seems correct, but if that is true, it should be used as an optimization for maps as well as for sets

14:10 abedra: +1

14:10 that was my next question

14:11 stuarthalloway_: a good generative test covering equality semantics would help add confidence

14:11 jimduey: brainproxy: Just put up my post on comonads. http://www.clojure.net/2013/02/02/Comonads/

14:11 and the library. https://github.com/jduey/comonads

14:12 ravster: hello all

14:12 weavejester: Ack, I'm really beginning to regret having merged these changes. The PR looked okay, but I missed a whole bunch of things I now have to fix. *sigh*

14:13 rboyd: weavejester: on compojure or where?

14:14 weavejester: rboyd: ns-tracker

14:14 To be fair the PR is mostly okay

14:14 But because tools.namespace does so much now, there's a lot of opportunity for code reuse

14:14 And the PR didn't include a test but added a new feature.

14:14 stuarthalloway_: abedra: presumably set equality with Integers is broken in 1.3 and 1.4?

14:15 abedra: good question

14:15 for 1.4 yes

14:15 that's what we are using

14:15 I can look at 1.3

14:17 yep

14:17 1.3 is also affected

14:18 stuarthalloway_: abedra: I think both of those patches are broken, and would break .equals

14:19 abedra: stuarthalloway_: interesting

14:19 i'm up for putting together a generative test

14:19 are they wired up directly from test.generative?

14:19 or added to the project itself now?

14:19 stuarthalloway_: APersistentSet equiv calls equals

14:20 abedra: ah

14:20 stuarthalloway_: at first glance, that can't be right

14:20 abedra: yes

14:20 it does

14:22 gfredericks: abedra: oh hi

14:23 abedra: I hadn't looked into the issue in detail; Bo had; my impression was that the obvious thing to do is make sets act like the other data structures, and whether there's a better way to handle all of them is a separate question

14:23 stuarthalloway_: gfredericks: agreed, except the fix just moves the problem somewhere else

14:24 abedra: yeah

14:24 that's what I am starting to see

14:24 stuarthalloway_: i.e. fixing = breaks .equals

14:24 gfredericks: stuarthalloway_: the problem being incorrectness or performance?

14:24 oh

14:24 stuarthalloway_: incorrectness

14:24 gfredericks: okay, I don't fully understand the issue then :)

14:24 stuarthalloway_: the fact that Set equiv calls equals seems to me to be the real problem

14:24 abedra: stuarthalloway_: gfredericks found the issue at work the other day

14:25 yes

14:25 stuarthalloway_: if you look at map, it has equiv and equals as two separate parallel worlds

14:25 abedra: APersistentMap calls mapEquals

14:26 stuarthalloway_: Set would need to have two parallel equality methods, like .mapEquals and .equiv in Map

14:26 abedra: yes

14:27 stuarthalloway_: abedra: can you add another comment on the ticket summarizing this thinking

14:28 abedra: yes

14:28 I'll start working on another patch

14:32 gfredericks: the purpose of .equals is to be like .equiv but without comparing across numeric types?

14:33 brainproxy: jimduey: thanks for the heads up!

14:34 stuarthalloway_: gfredericks: yes, more generally, to comply with Java' s rules for such comparisons

14:36 gfredericks: oh that sounds like a good google

14:36 are the java rules more than consistency with .hash?

14:37 * gfredericks reads

14:50 ravster: do cemerick/friend user roles have to be in the form of '::foo' ?

14:51 gfredericks: ravster: that would surprise me; I've never used friend though.

14:51 ravster: okay.

14:56 and should friend wrap over ring/wrap-session?

14:58 qz: how do i split one namespace into several source files? if i go with one main file doing (load ..) on others i have problems with lein-ring reloading when i change stuff

14:58 gfredericks: qz: it's not recommended

14:59 qz: gfredericks: not recommended splitting namespaces at all?

14:59 gfredericks: qz: correct

15:00 qz: gfredericks: i'm total clojure newb and writing web application, and i want my views to sit it one namespace, but having them all in one file would be overkill.. what's preferred way to work around it?

15:00 gfredericks: why do you want them in one namespace?

15:01 qz: gfredericks: because they all share common require/use, because i'd like to group them anyways (having one namespace per page, would create too many namespaces)

15:03 gfredericks: the first point might suggest some refactorings; I'm not one to defend in detail the file<->namespace correspondence though. I just know that if you try to go against that you'll have an uphill battle and unidiomatic project structure.

15:05 qz: gfredericks: i see, i just found http://stackoverflow.com/questions/4690758/splitting-a-clojure-namespace-over-multiple-files and thought its pretty much idiomatic way, as answer comes from one of "joy of clojure" authors

15:06 gfredericks: I did not know clojure.core did that

15:09 weavejester: clojure.core isn't always idiomatic, because of concerns of performance and bootstrapping

15:09 gfredericks: weavejester: hard to imagine either of those justifying this case though; only downsides I know of inlining the files is an even bigger core.clj

15:09 tmciver: qz: it's still not recommended. Concerning web app views, I would do something like views/html/widget1.clj, views/html/widget2.clj etc.

15:10 qz: tmciver: and then require them all in a controller ?

15:10 weavejester: gfredericks: Well, clojure.core by its nature has to contain all the base functions.

15:11 gfredericks: weavejester: sure but that could be accomplished by putting everything in the same file

15:11 tmciver: qz: sure. Personally I keep all my views in one views/html.clj file, but then I only have small toy web apps.

15:11 ravster: cemerick: do the roles of users for use by 'friend' have to be '::foo'? I ask because I want to save stuff in datomic, and it will be easier to do it as a string.

15:11 qz: weavejester: wow, hiccup/compojure author here :) how do you organize views in your web apps?

15:12 cbp`: hello i have a question, using korma, does anyone know why the following select doesn't do a join with the Location table? https://www.refheap.com/paste/1c6f596ebd765dcdc16c05276

15:12 weavejester: gfredericks: Yes, but normally if your file is getting too big, you can separate it out into different namespaces. With clojure.core, that obviously isn't possible.

15:12 qz: tmciver: i see, will try to merge pages into one file also

15:12 gfredericks: cbp`: is "Ubicacion" in line 6 a typo?

15:12 weavejester: Regarding the use of in-ns/load to split a namespace across several files, it does make life more difficult for tools

15:13 But I wouldn't say it was necessarily wrong.

15:13 cbp`: yes it's supposed to be Location sorry

15:13 gfredericks: cbp`: is that your issue?

15:13 cbp`: no

15:13 weavejester: The next version of ns-tracker (which lein-ring uses behind the scenes) will support dependencies through in-ns

15:14 cbp`: I just translated the names from spanish to english for no reason but that's beside the problem

15:14 weavejester: qz: But… in general, I'd say that if your views are getting very large, there may be some refactoring you can do to reduce their size.

15:15 cbp`: I just editted it

15:15 weavejester: cbp`: Isn't it

15:15 oops

15:15 qz: weavejester: every individual view is not large, but there will be many pages (many views) and combined - that's lots of code

15:15 weavejester: i'm doing a port of rails app

15:16 weavejester: cbp`: Isn't it "join" rather than "with" to do a join?

15:16 qz: Ah, I see. Rails doesn't necessarily do a good job at DRY when you get to the view layer.

15:16 gfredericks: qz: weavejester: I coulda sworn with worked like that; I'm puzzled

15:17 cbp`: weavejester: I believe join would do a manual join which isn't what i wanted to do. If the relation changes to has-one then (with Location) does the left join but that's the wrong relation

15:17 weavejester: gfredericks: I though "with" created a lazy seq of selects.

15:17 For has-many at least.

15:17 cbp`: I suppose with has-may one has to do a manual join

15:18 gfredericks: weavejester: oh right!

15:18 I knew it did that

15:18 but I forgot that it then wouldn't show up in the sql

15:18 qz: so it's probably working fine, it just doesn't do joins, it does subsequent queries

15:18 weavejester: qz: There may be parts of the view code you can refactor to be smaller. Other than that, you may have to go down the splitting the namespace up into files.

15:19 gfredericks: qz: whoops not you

15:19 abp: cbp`, or you need to add (pk :type) on location?

15:19 gfredericks: cbp`: ^

15:20 cbp`: but the pk is id, i don't wanna use varchars for pk's :(

15:22 abp: cbp`, don't worry, I just guessed {:fk :type} needs to reference a pk

15:22 geoffs: Does anybody know how to eval code in an external file in the context of the current namespace? Do you just have to bind *ns*?

15:23 cbp`: oh

15:23 i just realized im really dumb

15:25 wait sorry this is really confusing i'll come back later

15:25 hugod: geoffs: yes, you may want to look at leiningen.core.project/read for an example

15:26 cbp`: I should probably just stick to doing sql manually

15:28 geoffs: hugod: thanks! That looks exactly like what I want

15:34 abedra: stuarthalloway_: I have a working patch

15:34 Just making sure it applies cleanly and I will push it to Jira

15:36 Frozenlock: Do users nowadays expect permalinks, or do you have to explicitly tell them "yes, you can copy the URL"?

15:37 abedra: stuarthalloway_: gfredericks ok it's up there

15:37 gfredericks: Frozenlock: probably it all feels like witchcraft

15:38 abedra: thanks for looking at it

15:38 Frozenlock: gfredericks: As in what's the odd bar in my browser with letters in it? :P

15:38 gfredericks: Frozenlock: http://gfredericks.com/gfrlog/posts/42

15:39 Frozenlock: gfredericks: Just before I start reading that, I want to mention that my grandparents are incredibly good with computers, perhaps more than my parents.

15:40 gfredericks: Frozenlock: I wrote this 3 years ago when there was an entirely different generation of grandparents

15:40 times were different then

15:42 Frozenlock: that's an interesting observation though

15:42 cbp`: oh so the problem was that it does the join but lazily, which is actually annoying

15:44 Because sql-only doesn't give me the entire sql command

15:44 gfredericks: cbp`: correct

15:44 Frozenlock: gfredericks: Very true. Valid for a bunch of thing in computing in fact; everything built on top of traditions. If you didn't follow along, you might get lost.

15:45 Also, I like the ASCII style.

15:45 gfredericks: Frozenlock: haha, thanks

15:47 Frozenlock: Anyhow, I just worked very hard to make sure a JS enabled page would update its URL at each user's (notable) action, insuring that they can copy/paste the url in an email. I was wondering if I had to tell them they could do so.

15:48 gfredericks: if you want them to be conscious of it, probably

15:48 sritchie: hey, are any of you guys using leiningen with clojure.test.generative?

15:51 jeremyheiler: Is there a way stop the args vector from moving in-line with the docstring when using M-q?

15:54 ljos: Anyone have any experience testing ring web-apps with clj-webdriver? I was just wondering how you would do it with starting the server. I don't always have the test server up and running, but I want the server to start when I run the tests. I am also using midje if that matters.

15:54 arohner: jeremyheiler: I insert a newline, then M-q, then remove the newline

15:54 amalloy: ljos: don't start the server, just call your handler function with request maps by hand

15:55 arohner: amalloy: that doesn't work for browser tests

15:55 ljos: amalloy: like arohner says, I would like to do browser tests.

15:56 arohner: ljos: I just lein run my main init namespace, and leave the server running

15:56 then swank/nrepl in, and run the tests from the repl

15:56 jeremyheiler: arohner, heh thanks.

15:56 gfredericks: does anybody know any examples of &env being used in a macro?

15:56 ljos: arohner: that is accetable, but it would be nice to be able to just `lein midje` and everything justs goes automagically.

15:57 arohner: ljos: I have a namespace that sets everything up for testing, and that starts the server

15:57 then the test nses all require the test-init ns

16:00 ljos: arohner: That sounds like something I could do. Thanks!

16:01 cbp`: hmm so there's no way in korma to get all the queries that are going to be sent to the db before they are sent?

16:02 dry-run only gets the first query right and the rest are incorrect

16:02 and sql-only only gets the first query

16:04 ljos: arohner: wait. I am using ring.adapter.jetty to start the server, but how do I turn it off again after the tests have finished?

16:04 gfredericks: cbp`: in what sense are the dry-run queries incorrect?

16:05 cbp`: gfredericks: for example if i join according to an id, the first query gets the id right and the second query will just default the id to 1

16:05 arohner: ljos: I don't normally stop my server, but if you hold on to the variable returned by r.a.jetty/run-jetty, you can stop it with noir.server/stop

16:05 gfredericks: cbp`: dry-run uses some dummy data since some of its values depend on things it doesn't actually have -- does that explain it?

16:07 ljos: arohner: Thanks. When I think about it it might actually be more of a hindrance then help to have it like this, but we'll see.

16:07 cbp`: gfredericks: Yes, however I was looking for a way to get both queries as they are going to be sent to the db

16:10 I'm assuming there isn't something already built in so I guess I'll make it myself sometime later

16:10 weavejester: ljos: You can set the :join? option to false in the adapter

16:10 cbp`: When i have more time to look at the source

16:10 alex_baranosky: anyone know if there's a way to get Cheshire to decode numbers as Longs instead of decoding them as Integers?

16:12 amalloy: &(class (int 1))

16:12 lazybot: ⇒ java.lang.Integer

16:13 amalloy: alex_baranosky: maybe go back to clojure 1.3? it had a bug that made that sort of thing happen a lot more often :)

16:13 alex_baranosky: ha!

16:15 gfredericks: alex_baranosky: I'm curious why you need that

16:15 sritchie: alex_baranosky: dude! I'm back on irc :)

16:15 alex_baranosky: qq for you

16:15 did you guys ever get generative testing into midje

16:15 ?

16:15 alex_baranosky: just want consistency in our serializing/deserializing to HBase… don't really NEED it per se

16:15 amalloy: alex_baranosky: just looking at cheshire.parse and jackson's parser, i'd say that's not possible

16:16 you'd have to do a post-processing step yourself

16:16 sritchie: alex_baranosky: if you're on scala, you should check out github.com/twitter/bijection for that

16:16 alex_baranosky: sritchie: there's a namespace called formulas.clj inMidje, but I can't find it, since Marick's been doing a lot of changes with the namespaces

16:17 sritchie: gotcha

16:17 I'm playing with clojure.test.generative now, finally time to get back into this

16:17 and have been using scalacheck quite a bit

16:17 I'd be happy to help with the generative stuff if you want to wake it back up

16:17 alex_baranosky: amalloy: thanks, I think it's not important i=enough to add post-processing

16:18 sritchie: give it a try, let me find a link to the namespace for you

16:18 ah, I see, it is now being interned into midje.sweet https://github.com/marick/Midje/blob/master/src/midje/sweet.clj#L50

16:19 sritchie: nice

16:19 TimMc: Wait, why is CLJ-1153 marked as "minor"?

16:19 sritchie: looks like there are no default ones?

16:19 which is fine

16:19 TimMc: It should be "Critical", or at least "Major".

16:19 ljos: weavejester: that is a good idea :D

16:19 gfredericks: TimMc: do those things have agreed-upon definitions?

16:20 TimMc: I'm going to change it.

16:21 gfredericks: haha

16:21 hyPiRion: TimMc: +1

16:22 gfredericks: I love how this thing is simultaneously an intentional feature and a critical defect

16:22 TimMc: "Minor" is just the default value.

16:29 alex_baranosky: amalloy: there's always alter-var-rooting the function having this line https://github.com/dakrone/cheshire/blob/master/src/cheshire/parse.clj#L45 so that it calls .getLongValue http://jackson.codehaus.org/1.2.1/javadoc/org/codehaus/jackson/JsonParser.html#getLongValue()

16:30 gfredericks: clojurebot: cheshire is <reply> there's always alter-var-rooting

16:30 clojurebot: You don't have to tell me twice.

16:30 amalloy: clojurebot: clojurebot is a time-capsule for snark

16:30 clojurebot: Ack. Ack.

16:31 jondot: aphyr: here?

16:31 cbp`: mmm what's the relation for an entity that has multiple references to location, for instance Address has multiple references to Location

16:32 cemerick: ravster: they can be other types, but then you can't use hierarchies to represent those relationships

16:33 ravster: datomic certainly allows you to store keywords, though

16:33 hyPiRion: Arg, I wish every? could support multiple colls.

16:35 sritchie: alex_baranosky: hey dude, do you know if you can put multiple expectations within a given formula?

16:35 hyPiRion: I find myself doing (every? (fn [[e1 e2 .. en]] ..) (map vector x1 x2 .. xn)) too often

16:36 ljos: Sometimes I don't really understand how clojure/lein finds libraries. I add the release version of a library as a dependency, but clojure/lein can not find it when I use it in the test `ns`. Then I add the beta version and it suddenly works. No other changes in code. I suspect is because something goes wrong during the

16:36 linking.

16:36 Is there a way to get lein to do the linking again?

16:36 alex_baranosky: sritchie, yes!

16:37 sritchie: funky, I'm seeing

16:37 There are too many expections in your formula form:

16:37 alex_baranosky: this is bad ass, by the way

16:37 raek: ljos: are you sure that the library namespace did not change between the versions?

16:37 alex_baranosky: thanks :)

16:37 I have been so busy with all my other projects I never really added scrinking to it

16:37 sritchie: yeah, no worries

16:37 alex_baranosky: shrinking*

16:38 sritchie… oh so maybe you cannot. I wrote it forever ago, my mistake

16:39 raek: ljos: you can run "lein classpath" to see what dependencies will be available when you start clojure. you can peek inside the jar files listed by that command to find out what namespaces will be available

16:39 alex_baranosky: it might have simplified the implementation to only have one arrow per…. YOu know, I bet the reason was since I wanted to add shrinking. How can you shrink a failure if there are more than one failure per formula? I think you could not sanely do it

16:39 ljos: raek: God damn it. You are right. It is the documentation that is wrong -.-

16:39 alex_baranosky: I bet it could be changed to accept more than one arrow, if I officially admit I'll never add shrinking

16:40 raek: ljos: I don't think you usually call something "linking" on the JVM. things don't work like in C

16:41 "class loading" is perhaps the term

16:41 stuarthalloway_: I am pleased to announce the release of Simulant, a framework for simulation-based testing built using Datomic and Clojure: https://github.com/Datomic/simulant

16:42 feedback on docs solicited

16:42 ravster: cemerick: oh, okay. Cool. Thanks.

16:42 * gfredericks corrects a typo on the simulant wiki

16:44 alex_baranosky: sritchie: I'm curious if you remove this cond case, if the formulas just work fine w/ multiple arrows/checks: https://github.com/marick/Midje/blob/master/src/midje/parsing/0_to_fact_form/formulas.clj#L112

16:45 sritchie: hmm, maybe

16:47 Bronsa: stuarthalloway_: would you mind doing the "boring work" for blind (to be tools.reader) too?

16:48 stuarthalloway_: @Bronsa: link for context?

16:48 nevermind, found it, boring away

16:48 Bronsa: ok, I was trying to find the thread, thanks

16:53 stuarthalloway_: in blind there's a commit by chris granger, is that a problem?

16:53 stuarthalloway_: has he signed a CA?

16:53 Bronsa: yes

16:54 Raynes: Did he give a blood sample though?

16:54 stuarthalloway_: then you just need him to send an email acking the transfer to contrib

16:54 Raynes: ibdknox: ^

16:54 * gfredericks tries hard to remember why org-html-slideshow reloads the page

16:55 stuarthalloway_: Bronsa: are you Nicola Mometto?

16:55 Bronsa: I am indeed

16:57 stuarthalloway_: tools.reader boring work complete

16:58 Bronsa: thanks, now I only need to get ibdknox to declare he is ok to transfering to contrib and I should be good to go?

17:00 ljos: raek: That is true, but it was not the loading I was concerned with. It was more that the class path might be incorrect and the first word that popped into my mind was linking (and I don't even really do C :P).

17:00 That is what you get for not being born with english. :{

17:01 stuarthalloway_: @Bronsa: as far as I know, yes

17:05 Bronsa: stuarthalloway_: actually, I'd need commit rights too :P

17:05 stuarthalloway_: @Bronsa, stand by

17:05 Bronsa: or will they be given me once ibdknox write the mail?

17:05 ok

17:06 stuarthalloway_: contrib permissions are group, I just didn't know you weren't in the group

17:07 @Bronsa: done

17:07 Bronsa: thanks

17:14 benmoss: can anyone recommend a recent "intro to web development with clojure" guide?

17:15 gfredericks: So if that cemerick patch (for read-eval) gets merged in, what would that mean for data-readers? i.e., if print-dup isn't used for embedding objects in code, what is?

17:20 michaelr`: what is all the talk about read-eval?

17:20 any links?

17:20 ragge: does anyone have any experience with parsley, by cgrand?

17:21 maio: any idea how to bind some key only in nREPL REPL buffer? (and also not in Clojure buffer)

17:22 gfredericks: michaelr`: you've seen the jira issue?

17:22 ragge: maio: nrepl-mode-map?

17:23 cbp`: does korma not support multiple foreign keys?

17:24 maio: ragge: that seems to be also active in any Clojure buffer

17:30 geoffs: Does anyone have suggestions for good reading on testing with clojure? I've gone through a couple tutorials on midje and speclj but I still feel like I'm not "getting" it...

17:31 jondot: geoffs: is it something clojure related or testing related that you're not feeling comfortable with?

17:32 geoffs: specifically testing in clojure. I feel fairly confident doing testing in java, c etc.

17:33 stuarthalloway_: geoffs: I would be interested in your reaction to https://github.com/Datomic/simulant

17:33 geoffs: I mean, I use the repl for little tests, but then capturing those into any of the testing frameworks I've seen isn't clicking

17:34 stuarthalloway: I'll take a look at it, thanks!

17:36 jballanc: stuarthalloway_: maybe this is a stupid question, but is simulant intended to be a load-testing solution? or just behavior simulation?

17:36 stuarthalloway_: an interesting question actually

17:36 you can use simulant for or in parallel to simulation testing

17:37 jballanc: I'll definitely be looking at it more...

17:37 stuarthalloway_: e.g. we have created simulant models for loads, but we have also created loads outside of simulant, and run them against a system that was simultaneously being simulated

17:38 jballanc: very cool

17:38 Bronsa: stuarthalloway_: sorry to bother you again, but I think I need an account on hudson too

17:39 stuarthalloway_: Bronsa: not sure I know how to do that, looking

17:40 Bronsa: ok, I'll ping the ml if it's a problem for you to do that

17:40 jondot: stuarthalloway_: more like a functional test infrastructure is it? something in the concept of FitNesse/StoryTeller?

17:41 stuarthalloway_: I don't think non-technical users could use Simulant as they might use Fitnesse

17:41 although one might build a fitnesse-like layer on top of simulant

17:41 jondot: right, that's interesting.

17:43 jballanc: any thoughts on joining Simulant with CLJS to do browser-action modeling?

17:43 ...along the lines of Selenium?

17:44 stuarthalloway_: Simulant might use e.g. Selenium to implement actions

17:45 jballanc: have you tried using it for any "scientific" sorts of applications? or just system testing?

17:45 i.e. it might be fun to use this in an itterated prisoner's dilema simulation

17:50 stuarthalloway_: jballanc: in the future I will have copious free time and do scientific simulation stuff

17:50 but today, no

17:50 jballanc: :)

17:51 my thesis research was evolutionary modeling, so these sorts of simulations are very interesting to me...

17:51 been meaning to go back and rewrite some of that code, and this looks like it could be the perfect solution

17:58 geoffs: stuarthalloway_: It looks like simulant could actually replace the entire application I'm now building... Or at least provide a helpful framework to write it in.

17:59 stuarthalloway_: nice!

17:59 geoffs: though it looks to have a not inconsiderable learning curve

17:59 stuarthalloway_: agreed, not sure yet if that is intrinsic or I suck at explaining

18:00 geoffs: I think it's not helped by the fact that I've never worked with datomic, but I'd be willing to give feedback on the explanations as I run through them

18:56 gfredericks: ,((fn f [n] (apply + 1 (repeatedly (rand-int n) #(f n)))) 2)

18:56 clojurebot: 6

18:56 gfredericks: ,((fn f [n] (apply + 1 (repeatedly (rand-int n) #(f n)))) 3)

18:56 clojurebot: 24

18:56 gfredericks: ,((fn f [n] (apply + 1 (repeatedly (rand-int n) #(f n)))) 3)

18:56 clojurebot: 195

18:56 callenbot: I want to provide a global context map in a Ring application, I'm thinking a dynamically bound var or a ref. Is the better approach to merge maps into the global ref or to assoc a dynamically bound var?

18:57 Am I implicitly relying on the thread-per-request semantics of Ring+Jetty if I use a dynamically bound var for context? Will it break the moment I use Aleph?

18:57 gfredericks: callenbot: what behavior do you want when two threads are handling a request at the same time?

18:58 callenbot: gfredericks: two threads handling two different requests?

18:58 gfredericks: callenbot: yeah

18:58 callenbot: because when I talk about a ref, I mean a dynamically bound ref vs. dynamically bound map

18:58 weavejester: callenbot: A dynamically scoped binding would give you a variable that lasts for the duration of the request.

18:58 callenbot: gfredericks: I want per-request state isolation.

18:58 gfredericks: callenbot: so that would be a dynamically bound ref of a map?

18:58 callenbot: gfredericks: yeah, or a bare map

18:58 weavejester: that's precisely what I want, but is that going to work in netty/aleph?

18:59 gfredericks: callenbot: I don't know what a thread-local ref is useful for

18:59 weavejester: callenbot: It depends on whether you pass the asynchronous channel to another thread.

18:59 You'd have to do that explicitly

18:59 For instance, by adding the channel to an atom

18:59 callenbot: fuck. I'll punt in netty/aleph for now until I understand the semantics better.

19:00 weavejester: And at the same time you could pass along the global context.

19:00 callenbot: dynamic var bound to map, merge provided context from render function on top of the current global context -> template context.

19:00 the point of this is to not be kicking the arguments around all over the place

19:00 particularly since keyword args in Clojure are pain incarnate.

19:01 it sounds like a dynamically bound map that gets bound to an initial state is what I want. Maybe init'd with ring middleware.

19:01 weavejester: callenbot: Why are they painful?

19:01 callenbot: weavejester: it's awkward to use them. Python did it better, sadly.

19:01 whenever I realize I need kwargs for something in clj I cringe really hard.

19:02 weavejester: callenbot: Are you referring to the problems with applying a map to a function?

19:02 gfredericks: (defmacro kw-fn [args & body] (list* 'fn {:keys args} body))

19:02 (defmacro kw-fn [args & body] (list* 'fn ['& {:keys args}] body)) ;; whoops

19:03 weavejester: I wouldn't even bother with a macro, myself.

19:03 (defn foo [{:keys [bar baz]}] …)

19:04 gfredericks: that's presumably what he thinks is awkward and cringeful

19:04 callenbot: yes

19:04 weavejester: Pretty lightweight -> def fn(required_arg, kw_arg=default_value, kwarg_two=2)

19:04 weavejester: My problem with keyword args is that you can't apply a map.

19:04 gfredericks: ~mapply

19:04 clojurebot: You could (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))

19:04 weavejester: (apply foo {:bar 1 :baz 2}) => (apply foo [:bar 1] [:baz 2])

19:04 callenbot: weavejester: also in Python: fn(400, **{"kw_arg":2})

19:05 weavejester: So usually I just keep options as a map.

19:05 callenbot: * + args and ** + kwargs is a nice pattern.

19:05 * gfredericks assumes that anybody with a question in #clojure just needs the right macro

19:05 weavejester: Well, it's true that Python's behaviour could be mimiced with a macro :)

19:06 callenbot: weavejester: I don't necessarily want to proliferate non-idiomatic code

19:06 weavejester: and a global state that gets injected into templates is more to the point.

19:06 weavejester: Yes, although I get nervous around dynamic scope.

19:06 callenbot: weavejester: Flask seems to manage with g

19:06 weavejester: It's shorter to write, but less flexible.

19:07 Well, sure, you can do it - but it's technically not as useful as lexical scope. Whatever the language.

19:08 callenbot: weavejester: well I need access to some kind of global request-lifecycle state that can be auto-included in template context so that I can {% if (logged_in (:user context)) %} in my templates.

19:08 weavejester: and I am not going to kick around a context/options/user state manually between every view -> template flow.

19:08 weavejester: callenbot: Oh, I'm not saying you shouldn't do it.

19:08 callenbot: I use computers so that I can do less repetitious work, not more.

19:09 weavejester: how could it bite me, outside of aleph?

19:09 weavejester: It's just one of those things, like macros, that should be used with caution.

19:09 callenbot: I'm cautiously impatient with kicking state around manually.

19:09 weavejester: callenbot: It won't bite you, I don't think. Unless you explicitly open up a new thread, you should be good.

19:10 It's just harder to compose functions with dynamic scope.

19:11 Effectively you're adding another variable to every function within the request

19:11 Which is fine, but the more variables you have, the more things that can go wrong.

19:12 gfredericks: also laziness

19:12 weavejester: Laziness?

19:12 clojurebot: laziness means not traversing anything twice

19:12 seangrove: Anyone using carica with lein-cljsbuild? It doesn't seem to be picking up on the different config files

19:12 gfredericks: any unrealized lazy values returned get realized without the binding

19:14 is it fair to say that the only thing gained from the existence of &form is the symbol that referred to the current macro?

19:23 Brave: s

19:24 www.akran.net

19:32 augustl: Clojure/west ticket booked, gonna be good!

19:32 weavejester: did you find any good information about the XHR + CSRF token stuff?

19:33 weavejester: augustl: Oh, sorry, I haven't had time to look into it quite yet.

19:33 augustl: Ring 1.2 should be released within a week or two, however, which should free up some time.

19:36 augustl: weavejester: I see, no probs

19:36 I'll see if I can find some information and post it to the pull req

19:44 callenbot: weavejester: thanks for the pointes

19:44 pointers*

19:44 gfredericks: you too

19:45 cbp`: mm i think korma should allow multiple relations between 2 tables or accept a vector of foreign keys

19:55 seangrove: Ah, had to `lein trampoline with-profile prod cljsbuild prod`

20:00 sshack: Anyone here got a java library with JNI component working with clojure/lein before?

20:04 augustl: sshack: yeah, I just did that a couple of days ago

20:04 sshack: I also blogged about it, perhaps you'll find it useful :) http://augustl.com/blog/2013/using_zeromq_from_clojure/

20:04 sshack: Did you have any issues? I've got a vendor supplied Jar and JNI dylib for mathematica. It's having a problem finding the dynlib part.

20:05 This is clojuratica, fwiw.

20:05 Reading that now.

20:05 augustl: sshack: the method I outline works fine, the actual "reusable" part is -Djava.library.path

20:06 sshack: Is there a way I can add that to my leon project file?

20:06 s/leon/lein/

20:06 augustl: see the blog post :)

20:06 sshack: It's loading. I got into swap here doing a db ingest...

20:06 Time for more memory.

20:07 augustl: hah

20:07 sshack: :jvm-opts ["-Djava.library.path=../jzmq-2.1.0-SNAPSHOT/lib"]}

20:08 I hardcode that into my project.clj, and assume that the jni module exists in ../

20:09 sshack: Makes sense.

20:09 Wish there were an easier way though.

20:10 by easier, I mean, cleaner/more well defined.

20:12 Wait, what is :native-path?

20:15 arrdem: you guys know of an emacs plugin for HTML editing?

20:16 M-tab doesn't seem to work on tags by default.

20:16 augustl: sshack: :native-path is for output or something like that, don't remember

20:16 sshack: technomancy said he wanted a cleaner way to do this than -Djava.library.path

20:18 I wonder if there's some Right Way via maven to work with JNI modules

20:19 with rubygems, for example, the gems with native extensions compile themselves upon install

20:19 sshack: I am wondering that too. complicating this is it's a vendor library. It's not something that could be added to some public maven repo.

20:21 augustl: sshack: that's the problem with the jzmq module, it can't be added to a shared repo

20:21 the .jar file you build also contain .c files and is related to the ZeroMQ installation on your box

20:21 so it has to be built for each machine

20:21 sshack: As soon as this import finishes, I'll play with this stuff.

20:22 augustl: sshack: I have 17 days uptime and still no page outs, lots of RAM ftw

20:23 sshack: Great.

20:38 casperc: Anyone know of a way to trace how long individual function calls take in eg a namespace?

20:39 something like what clojure,tools.trace does, but it doesn't seem to be able to trace time taken

20:43 warz: hrm, so maven has all of the required jars on my system already. is there a way to include that top level maven directory on the class path, and itll recursively look in there for dependencies?

20:45 tmciver: warz: if you're using lein, it should be using ~/.m2 already

20:48 warz: im building a plugin for use in a minecraft server, and everything needs to be available on the class path, if i dont build an uberjar. uberjars are fine i guess, though.

20:48 just get a little large.

21:51 amalloy: gfredericks: &form also has metadata

21:51 gfredericks: amalloy: oh interesting; good point

21:52 amalloy: of particular importance, it has :line metadata

21:53 gfredericks: oh how did that get there?

21:54 looks like all lists have it at compile-time?

21:54 amalloy: yeah

21:54 gfredericks: ,(meta (read-string "(+ 1 2)"))

21:54 clojurebot: nil

21:54 gfredericks: I guess that means the normal reader is different from read-string

22:08 sshack: augustl: I got my JNI going.

22:09 :native-path didn't work, and I will investigate.

22:10 I ended up monkeying with the jvm-opts

22:10 :jvm-opts ["-Djava.library.path=/Applications/Mathematica.app/SystemFiles/Links/JLink/SystemFiles/Libraries/MacOSX-x86-64"]

22:10 Nast, put it works. I can factor an integer.

22:17 doc_brown: i am looking at some code ... im seeing after every defn a string describing the function followed by a newline and '[]'

22:17 whats up with the '[]' ? and the uncommented string ?

22:17 gfredericks: [] would be the argument list

22:17 so the function has no arguments

22:17 the string is a docstring, which is a feature of defn

22:17 doc_brown: ooh

22:17 gotcha

22:18 the new lines threw me off

22:18 gfredericks: the string gets added as metadata on the var, which can be useful for tooling; also see clojure.repl/doc, which prints out docstrings

22:18 doc_brown: kk

22:18 gfredericks: ,(doc first)

22:18 clojurebot: "([coll]); Returns the first item in the collection. Calls seq on its argument. If coll is nil, returns nil."

22:18 gfredericks: ^ that was trivial for clojurebot to do because the docstring is available at runtime

22:19 doc_brown: what was the comma for ?

22:19 gfredericks: to make clojurebot eval the expression

22:19 doc_brown: ah

23:40 and where does Thread come from?

23:40 i see a call to it with future ... (future (Thread/sleep 3000) ...)

23:40 is that in clojure.core ?

23:42 Sgeo: It's from Java

23:42 It's java.lang.Thread

23:43 sleep is a static method on java.lang.Thread. in Java it would be called similarly to Thread.sleep(3000)

23:45 doc_brown: ah ok

23:46 ChongLi: whoa, wait a minute doc. are you telling me that my mother has got the hots for me?

23:49 tmciver: You made a time machine . . . out of a Delorian?

23:49 ChongLi: whoa, this is heavy

23:51 tmciver: doc_brown: biff_tannen hangs out here once in a while. I hear that he kills you ove a matter of 80 dollars.

23:55 doc_brown: shot in the back?

23:55 over a matter of 80 dollars !?

Logging service provided by n01se.net