#clojure logs

2013-02-02

00:10yediis it me or has clojure been hitting the frontpage of hn a lot lately
00:11ChongLiconfirmation bias :)
00:12arrdemlol
00:12arrdembest bias to have :)
00:12ChongLisure, as long as it doesn't lead to blue laws and/or violence
00:18arrdemI'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..
00:21ChongLihttp://www.google.ca/trends/explore#q=clojure
00:21ChongLiseems like a pretty sharp increase since 2008 or so
00:21ChongLilate 2007
00:22arrdemhaha "clojure for"
00:22arrdemgood lord traffic from northern CA
00:24frozenlockLet's compare... http://www.google.ca/trends/explore#q=clojure%2C%20java&cmpt=q
00:25arrdemfrozenlock with the circlejerk killer...
00:25ChongLishould only be a few more years until we catch up!
00:25frozenlockAlmost there :P
00:25arrdemC++ and Python are almost flat...
00:25arrdeminteresting.
00:26ChongLifrom 100% down to 30%
00:26ChongLijava's really dropping like a stone
00:26frozenlockSo is Emacs :(
00:26arrdemwhat's interesting to me is that Python is too..
00:26ChongLithat's ok
00:26ChongLilight table will fill the void!
00:26arrdemso what language is picking up the slack?
00:27ChongLihttp://www.google.ca/trends/explore#q=lighttable%2C%20emacs&cmpt=q
00:27ChongLilighttable is catching up even faster!
00:27frozenlockChongLi: Must be 100% FOSS for that. Will LightTable be?
00:27ChongLiyeah
00:27arrdemeventually (tm)
00:27ChongLilighttable will give you the editor as a value!
00:44arrdemis there some way to profile my ring/noir server and see why it's spinning?
00:53RaynesIt's trying to tell you to switch to Compojure + lib-noir.
00:54arrdemhaha
00:55arrdemyeah that's on the todo list but getting my /resume page up to date comes first
01:50headshothahaa "everything emacs can do, vi can do in an alternate universe way"
01:51Raynesheadshot: I don't think so, actually.
01:52RaynesI emulate vim in Emacs every day. I'd love to see someone emulate Emacs in vim.
01:52headshoti'm quoting stuart halloway
01:52RaynesI knew that guy was dumb.
01:52RaynesI'll tell him he is dumb at the next conj.
01:53RaynesBut 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.
02:00AtKaaZcan 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 ?)
02:01AtKaaZnamespace X doesn't use namespace Z, obviously
02:01RaynesAtKaaZ: https://github.com/flatland/useful/blob/develop/src/flatland/useful/ns.clj#L19
02:03AtKaaZso it can't be done with refer that's for sure, right? thanks
02:04RaynesYou can't do it without aliasing.
02:12AtKaaZRaynes, can I not name it the same name ? https://gist.github.com/4696402 do I have to somehow exclude deftest from :use ?
02:15AtKaaZI'm failing to find docs for ns
02:16AtKaaZok found something here: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/ns
02:18AtKaaZok got it to work: https://gist.github.com/4696402
02:26AtKaaZis there something that would auto indent clojure code ie. https://www.refheap.com/paste/9175
02:40mattmossAtKaaZ: clojure.pprint/pprint
02:41AtKaaZmattmoss: excellent! Thank you!
02:42h0bbitI vaguely recall reading that clojure 1.5 will have a function that will allow me to break out of a reduce
02:42h0bbitdoes anyone remember the name of that function?
02:50AtKaaZcan refheap do something like: there's an updated version of this paste (like pastebin can) ?
02:54RaynesAtKaaZ: You have to be logged in, but you can edit pastes if you are.
02:54AtKaaZcool
03:04AtKaaZnew and is are so picky
03:05AtKaaZgot forbit I pass them a symbol or var or anything that's a non-class
03:06AtKaaZs/forbit/forbid
03:09AtKaaZby 'is' I mean, (is (thrown? clshere ...)) and by 'new' i mean (new clshere ...)
03:15alex_baranoskyafter 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
03:15alex_baranoskynow I can remove a class of things that waste my time :)
03:38amalloyh0bbit: reduced
03:38h0bbitamalloy, ty. reading up on it now.
03:41h0bbitamalloy, how is this supposed to work?
03:41h0bbitthe doc string says : "Wraps x in a way such that a reduce will terminate with the value x"
03:42h0bbitbut there isn't an example of how to use it.
03:52Sgeo,reduced
03:52clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reduced in this context, compiling:(NO_SOURCE_PATH:0)>
03:52SgeoDo any of the bots have access to it?
03:53AtKaaZ,*clojure-version*
03:53clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
05:50borkdudexeqi nice video about friend
06:34AtKaaZis it possible to make fixtures apply only to a certain test? I need something like before and after but only for a specific deftest
06:42AtKaaZ(without moving it into a new namespace to live alone)
06:45babilenAtKaaZ: Something along the lines of https://github.com/marick/Midje/wiki/Setup%2C-Teardown%2C-and-State but for clojure.test you mean?
06:47AtKaaZbabilen, exactly, except must not use midje :)
06:48babilenAtKaaZ: 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
06:48AtKaaZbabilen: it's mainly because it just executes/compiles all .clj files it can find when doing lein midje
06:49babilenAtKaaZ: 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.
06:49AtKaaZthat's how I understand them also
06:49babilenWell, unless somebody knows better we at least understand it in the same way :)
06:50AtKaaZalrighties then, I'm now allowing myself to find a way, since I assume there's none (in clojure not midje) already
07:41thalassios_xelonhello :) i want to make a jar from eclipse,i have counterclockwise installed,how can i do it? any tutorial to read or help?
07:42thalassios_xeloni've never made a jar before
07:46abpthalassios_xelon, never tried that, probably just use leiningen from the command line?
07:46thalassios_xelonhow to do it from lein?
07:46thalassios_xelonany tutorial?
07:46thalassios_xeloni found one ,online
07:47thalassios_xeloni will try it...
07:47abpthalassios_xelon, http://code.google.com/p/counterclockwise/wiki/Documentation#Distribute_as_a_jar
07:47thalassios_xelonabp i tried that i i couldnt do it
07:48thalassios_xelonthx i will try again
07:50abpthalassios_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
07:53thalassios_xelonthx i am reading it ....
08:07borkdudenot clojure related per se, but I need to represent some tabular data which can be drilled down into detail. any libraries that support this?
08:12borkdudeit could just be smth client side with static data
08:12borkdudewhich can be provided with a map for example
08:43pepijndevosIs there a regex that will produce ["foo" "bar" "," "baz" "?"] for the following string? (s/split "foo bar, baz?" #".......")
08:44OscarZ_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"
08:45pepijndevos#"\b" produces ["" "foo" " " "bar" ", " "baz" "?"], which is close, but not quite right
08:49pepijndevosOscarZ_, lein 1 or 2? I can;t help you much, beyond observing that it might be a version incompatability.
08:49pepijndevoslein 2 has a new plugin system
08:50OscarZ_yeah thanks, I just found out about the lein 2 having different plugin system ... I was reading some example for lein 1
08:50OscarZ_i have to write ~/.lein/profiles.clj apparently
08:52hyPiRion,(mapcat (partial re-seq #"[^,?]+|[,?]") (re-seq #"[^\ ]+" "foo bar, baz?"))
08:52clojurebot("foo" "bar" "," "baz" "?")
09:00borkdudepepijndevos hehe http://txt2re.com/index-java.php3?s=foo%20bar,%20baz?&amp;-23&amp;24&amp;2&amp;4&amp;3
09:00pepijndevosweee
09:02pepijndevosI also found this one: http://stackoverflow.com/a/5214338/183662
09:41thalassios_xelonhello, i want to put a argument in main, '(and a b) and call a function with that argument,how to do it?
09:42thalassios_xelon(defn -main [&args] (table args)) wont work
09:45jeremyheilerDo you want to pass in the args vector as a parameter, or each element in args as parameters?
09:45jeremyheilerto the table function.
09:45thalassios_xelonargs is the parameter
09:46thalassios_xelon'(and a b) is a possible args
09:46jeremyheilersolussd, the quoted list is what you want to pass into table, right?
09:46jeremyheilerso*
09:46thalassios_xelon(-main '(and a b) sould call (table '(and a b))
09:46solussd:D
09:47jeremyheilersorry solussd, must of autocompleted lol
09:47solussdha
09:48jeremyheilerThe code you provided is effectively calling this (-main ('(and a b)))
09:49jeremyheilerargs is presented to you as a list, so you need to unwrap it.
09:49jeremyheilertry (apply table args)
09:50jeremyheileror (table (first args))
09:51thalassios_xelon(table (first args)) calls (table '(and )
09:51thalassios_xeloni think
09:51thalassios_xelon......
09:51thalassios_xelonthe args is array seq not a list.........
09:52thalassios_xelonthx jeremyheiler i didnt solve the problem but i will try again
10:02pepijndevoswhoa, I just realised one coul write a program in core.logic to generate all possible questions to which the answer is 42.
10:02jeremyheilerthalassios_xelon, that shouldn't matter. https://www.refheap.com/paste/9179
11:04cemerickAdding [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:09cemerickOK, I think I'm having issues because I'm trying to not use an org.clojure/clojure dep
11:12xeqicemerick: https://www.refheap.com/paste/9180 look ok to me
11:12xeqiah
11:14cemerickIn any case, I think :exclusions isn't being applied *globally*-globally :-P
11:18xeqiwith https://www.refheap.com/paste/9181 `lein swank` uses 1.5.0
11:18xeqibut I could believe the global exclusions bug
11:21cemerickhrm
11:24nbeloglazovHi. 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:26craigbroagent shoudl do it
11:26hyPiRionnbeloglazov: use clojure.lang.PersistentQueue/EMPTY
11:27xeqi(inc hyPiRion)
11:27lazybot⇒ 12
11:27nbeloglazovcraigbro: How I can do it with agent? How do I implement get method?
11:27nbeloglazovhyPiRion: but it's immutable. How do add mutability to it?
11:28hyPiRionnbeloglazov: (ref (clojure.lang.PersistentQueue/EMPTY))
11:28nbeloglazovwhat about get method?
11:28xeqi(let [q (atom clojure.lang.PersistentQueue/EMPTY)] (swap! q conj 1) (swap! q pop))
11:28cemericknbeloglazov: Just use a queue from java.util.concurrent
11:28cemerickoh, sorry, didn't finish reading your msg :-P
11:28nbeloglazov(swap! q pop) make no sense to me
11:29nbeloglazovBecause I can't get removed element
11:29cemerickIn 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:33hyPiRion(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:34hyPiRionFirst dosync is insertion, second is popping elements.
11:35hyPiRionConsider replacing alter with commute if actions are commutative.
11:35nbeloglazovActually 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:35nbeloglazovhyPiRion: I'll check it now
11:39abpHi 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:46cemerickabp: "write end dead"?
11:48abpcemerick, I think as in https://groups.google.com/forum/?fromgroups=#!topic/clojuredev-users/eh1pjfI_iHQ
11:49cemerickabp: oh, this is related to *in*?
11:49abpcemerick, 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:49abpcemerick, probably
11:51cemerickok
11:52cemerickThe *in* support is included in the automated tests, but I don't use it
11:53cemerickabp: 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:53abpcemerick, 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:53cemerickabp: but is it only when you're using *in*?
11:54abpcemerick, how do I know that?
11:54cemerickif you're using read-line or something similar
11:54cemerickThat's what the ML thread is about, anyway
11:55abpcemerick, oh, he yes, I think so. We were doing a console-app competition.
11:55cemerickright
11:55cemerickBoth nrepl.el and ccw have horrible UIs for such things
11:56abpcemerick, phew that's not as severe as I thought then. :)
12:09borkdudeI like it that nrepl also works from outside a project
12:11borkdudebtw is it possible to have every repl on my system (set! *print-length* 200) without manually doing so?
12:12hyPiRionborkdude: use :repl-options inside a :user profile in your $LEIN/profiles.clj
12:13borkdudehyPiRion what's the syntax for that
12:13borkdude:repl-options {*print-length* 200} ?
12:18borkdudehyPiRion I got this, but it doesn't seem to catch on https://www.refheap.com/paste/9182
12:20craigbroborkdude: do you realize that that example with *print-length* is going to save hours of my life?
12:21borkdudecraigbro no, but I'm glad
12:21craigbrohaha, I am dealing with some gigantic data structures, and if I accidently eval something that returns them, it nearly kills my emacs
12:21craigbronever even thought of setting that, derp
12:21borkdudecraigbro there's also print-level I think
12:21borkdude,(binding [*print-length* 10] (range))
12:21clojurebot(0 1 2 3 4 ...)
12:22borkdudehaha, binding doesn't work there?
12:22borkdudehmm, what happens if you nest bindings
12:23borkdude,(binding [*print-length* 10] *print-length*)
12:23clojurebot10
12:24borkdude,*print-level*
12:24clojurebot10
12:24borkdude,*print-length*
12:24clojurebot5
12:37mindbender1how does ring-jetty serve static files. Is there a way of knowing where jetty looks for static file or changing where it does?
12:38weavejestermindbender1: It doesn't. :)
12:38weavejestermindbender1: You need to explicitly add middleware (or in Compojure, a route) to serve static files.
12:39weavejesterYou can serve static files from a directory using ring.middleware.file/wrap-file or compojure.route/files
12:39weavejesterBut 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:40weavejesterThat way your resources aren't tied to the filesystem - they could be packaged up in a jar (for instance)
12:41mindbender1weavejester: 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:41xeqiis there a middleware for adding cache headers when serving from a jar?
12:41xeqiand also checking them
12:41weavejesterxeqi: Not currently, but probably for Ring 1.2
12:42weavejesterActually… let me check that.
12:42xeqiI've seen a couple of pastes in places for something similar, but hadn't found one packaged up yet
12:45weavejesterxeqi: Yes, Ring 1.2 does it with resource-response.
12:45weavejesterI actually should release a beta of that.
12:47weavejesterThere 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:48weavejesterI wish github would improve their search
12:49weavejesterThe results it gives back are still rubbish.
12:49xeqiis there a middleware for checking If-Modified-Since and returning 304s?
12:50weavejesterxeqi: In Ring 1.2 there is wrap-not-modified
12:50weavejesterLet me release a beta version today
12:50xeqihaha, I completely missed that scanning the filenames
12:50xeqithanks
13:43OscarZ_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:43OscarZ_REPL is up
13:44weavejesterTry port 3000? I'm not familiar with the compojure template for Eclipse, unless it hooks into the one for Leiningen.
13:45OscarZ_its not on 3000 either..
13:45OscarZ_sorry, I created the project with lein new compojure compojure-test
13:46weavejesterOscarZ_: In which case, try running "lein ring server"
13:47OscarZ_yes that works
13:47OscarZ_thanks... is there a way to launch it directly from Eclipse by a run configuration?
13:48OscarZ_hmm it seems to pick up the changes I make to classes on the fly, so I guess I dont need that
13:51craigbrohas anyone else transition a noir app to compojure + libnoir?
13:51craigbroI have a rather large one
13:51weavejesterHum, tools.namespace now has a lot of the functionality I need for ns-tracker, but lacks a few critical areas.
13:51craigbroI would hate to have to reconfigure all my defpages
13:54weavejesterBleh, 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:06amalloyweavejester: perhaps bultitude has what you want?
14:06abedragfredericks: what were your concerns with using Util.hasheq for CLJ-1106?
14:06abedraversus copying the logic from APersistentMap ?
14:07weavejesteramalloy: No, it's mostly around the dependencies.
14:07weavejestertools.namespace assumes order doesn't matter a lot of the time.
14:07weavejesterWhich lead to problems that I fixed in ns-tracker.
14:08abedrastuarthalloway_: do you see any downsides with the Util.hasheq approach?
14:09weavejesteramalloy: But thanks for the reference anyway
14:09stuarthalloway_context for abedra's question: http://dev.clojure.org/jira/browse/CLJ-1106?
14:09abedrayes sorry
14:09stuarthalloway_Util.hasheq seems correct, but if that is true, it should be used as an optimization for maps as well as for sets
14:10abedra+1
14:10abedrathat was my next question
14:11stuarthalloway_a good generative test covering equality semantics would help add confidence
14:11jimdueybrainproxy: Just put up my post on comonads. http://www.clojure.net/2013/02/02/Comonads/
14:11jimdueyand the library. https://github.com/jduey/comonads
14:12ravsterhello all
14:12weavejesterAck, 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:13rboydweavejester: on compojure or where?
14:14weavejesterrboyd: ns-tracker
14:14weavejesterTo be fair the PR is mostly okay
14:14weavejesterBut because tools.namespace does so much now, there's a lot of opportunity for code reuse
14:14weavejesterAnd the PR didn't include a test but added a new feature.
14:14stuarthalloway_abedra: presumably set equality with Integers is broken in 1.3 and 1.4?
14:15abedragood question
14:15abedrafor 1.4 yes
14:15abedrathat's what we are using
14:15abedraI can look at 1.3
14:17abedrayep
14:17abedra1.3 is also affected
14:18stuarthalloway_abedra: I think both of those patches are broken, and would break .equals
14:19abedrastuarthalloway_: interesting
14:19abedrai'm up for putting together a generative test
14:19abedraare they wired up directly from test.generative?
14:19abedraor added to the project itself now?
14:19stuarthalloway_APersistentSet equiv calls equals
14:20abedraah
14:20stuarthalloway_at first glance, that can't be right
14:20abedrayes
14:20abedrait does
14:22gfredericksabedra: oh hi
14:23gfredericksabedra: 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:23stuarthalloway_gfredericks: agreed, except the fix just moves the problem somewhere else
14:24abedrayeah
14:24abedrathat's what I am starting to see
14:24stuarthalloway_i.e. fixing = breaks .equals
14:24gfredericksstuarthalloway_: the problem being incorrectness or performance?
14:24gfredericksoh
14:24stuarthalloway_incorrectness
14:24gfredericksokay, I don't fully understand the issue then :)
14:24stuarthalloway_the fact that Set equiv calls equals seems to me to be the real problem
14:24abedrastuarthalloway_: gfredericks found the issue at work the other day
14:25abedrayes
14:25stuarthalloway_if you look at map, it has equiv and equals as two separate parallel worlds
14:25abedraAPersistentMap calls mapEquals
14:26stuarthalloway_Set would need to have two parallel equality methods, like .mapEquals and .equiv in Map
14:26abedrayes
14:27stuarthalloway_abedra: can you add another comment on the ticket summarizing this thinking
14:28abedrayes
14:28abedraI'll start working on another patch
14:32gfredericksthe purpose of .equals is to be like .equiv but without comparing across numeric types?
14:33brainproxyjimduey: thanks for the heads up!
14:34stuarthalloway_gfredericks: yes, more generally, to comply with Java' s rules for such comparisons
14:36gfredericksoh that sounds like a good google
14:36gfredericksare the java rules more than consistency with .hash?
14:50ravsterdo cemerick/friend user roles have to be in the form of '::foo' ?
14:51gfredericksravster: that would surprise me; I've never used friend though.
14:51ravsterokay.
14:56ravsterand should friend wrap over ring/wrap-session?
14:58qzhow 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:58gfredericksqz: it's not recommended
14:59qzgfredericks: not recommended splitting namespaces at all?
14:59gfredericksqz: correct
15:00qzgfredericks: 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:00gfrederickswhy do you want them in one namespace?
15:01qzgfredericks: 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:03gfredericksthe 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:05qzgfredericks: 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:06gfredericksI did not know clojure.core did that
15:09weavejesterclojure.core isn't always idiomatic, because of concerns of performance and bootstrapping
15:09gfredericksweavejester: 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:09tmciverqz: it's still not recommended. Concerning web app views, I would do something like views/html/widget1.clj, views/html/widget2.clj etc.
15:10qztmciver: and then require them all in a controller ?
15:10weavejestergfredericks: Well, clojure.core by its nature has to contain all the base functions.
15:11gfredericksweavejester: sure but that could be accomplished by putting everything in the same file
15:11tmciverqz: sure. Personally I keep all my views in one views/html.clj file, but then I only have small toy web apps.
15:11ravstercemerick: 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:11qzweavejester: wow, hiccup/compojure author here :) how do you organize views in your web apps?
15:12cbp`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:12weavejestergfredericks: 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:12qztmciver: i see, will try to merge pages into one file also
15:12gfrederickscbp`: is "Ubicacion" in line 6 a typo?
15:12weavejesterRegarding the use of in-ns/load to split a namespace across several files, it does make life more difficult for tools
15:13weavejesterBut I wouldn't say it was necessarily wrong.
15:13cbp`yes it's supposed to be Location sorry
15:13gfrederickscbp`: is that your issue?
15:13cbp`no
15:13weavejesterThe next version of ns-tracker (which lein-ring uses behind the scenes) will support dependencies through in-ns
15:14cbp`I just translated the names from spanish to english for no reason but that's beside the problem
15:14weavejesterqz: 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:15cbp`I just editted it
15:15weavejestercbp`: Isn't it
15:15weavejesteroops
15:15qzweavejester: every individual view is not large, but there will be many pages (many views) and combined - that's lots of code
15:15qzweavejester: i'm doing a port of rails app
15:16weavejestercbp`: Isn't it "join" rather than "with" to do a join?
15:16weavejesterqz: Ah, I see. Rails doesn't necessarily do a good job at DRY when you get to the view layer.
15:16gfredericksqz: weavejester: I coulda sworn with worked like that; I'm puzzled
15:17cbp`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:17weavejestergfredericks: I though "with" created a lazy seq of selects.
15:17weavejesterFor has-many at least.
15:17cbp`I suppose with has-may one has to do a manual join
15:18gfredericksweavejester: oh right!
15:18gfredericksI knew it did that
15:18gfredericksbut I forgot that it then wouldn't show up in the sql
15:18gfredericksqz: so it's probably working fine, it just doesn't do joins, it does subsequent queries
15:18weavejesterqz: 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:19gfredericksqz: whoops not you
15:19abpcbp`, or you need to add (pk :type) on location?
15:19gfrederickscbp`: ^
15:20cbp`but the pk is id, i don't wanna use varchars for pk's :(
15:22abpcbp`, don't worry, I just guessed {:fk :type} needs to reference a pk
15:22geoffsDoes 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:23cbp`oh
15:23cbp`i just realized im really dumb
15:25cbp`wait sorry this is really confusing i'll come back later
15:25hugodgeoffs: yes, you may want to look at leiningen.core.project/read for an example
15:26cbp`I should probably just stick to doing sql manually
15:28geoffshugod: thanks! That looks exactly like what I want
15:34abedrastuarthalloway_: I have a working patch
15:34abedraJust making sure it applies cleanly and I will push it to Jira
15:36FrozenlockDo users nowadays expect permalinks, or do you have to explicitly tell them "yes, you can copy the URL"?
15:37abedrastuarthalloway_: gfredericks ok it's up there
15:37gfredericksFrozenlock: probably it all feels like witchcraft
15:38gfredericksabedra: thanks for looking at it
15:38Frozenlockgfredericks: As in what's the odd bar in my browser with letters in it? :P
15:38gfredericksFrozenlock: http://gfredericks.com/gfrlog/posts/42
15:39Frozenlockgfredericks: Just before I start reading that, I want to mention that my grandparents are incredibly good with computers, perhaps more than my parents.
15:40gfredericksFrozenlock: I wrote this 3 years ago when there was an entirely different generation of grandparents
15:40gfrederickstimes were different then
15:42gfredericksFrozenlock: that's an interesting observation though
15:42cbp`oh so the problem was that it does the join but lazily, which is actually annoying
15:44cbp`Because sql-only doesn't give me the entire sql command
15:44gfrederickscbp`: correct
15:44Frozenlockgfredericks: 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:45FrozenlockAlso, I like the ASCII style.
15:45gfredericksFrozenlock: haha, thanks
15:47FrozenlockAnyhow, 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:48gfredericksif you want them to be conscious of it, probably
15:48sritchiehey, are any of you guys using leiningen with clojure.test.generative?
15:51jeremyheilerIs there a way stop the args vector from moving in-line with the docstring when using M-q?
15:54ljosAnyone 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:54arohnerjeremyheiler: I insert a newline, then M-q, then remove the newline
15:54amalloyljos: don't start the server, just call your handler function with request maps by hand
15:55arohneramalloy: that doesn't work for browser tests
15:55ljosamalloy: like arohner says, I would like to do browser tests.
15:56arohnerljos: I just lein run my main init namespace, and leave the server running
15:56arohnerthen swank/nrepl in, and run the tests from the repl
15:56jeremyheilerarohner, heh thanks.
15:56gfredericksdoes anybody know any examples of &env being used in a macro?
15:56ljosarohner: that is accetable, but it would be nice to be able to just `lein midje` and everything justs goes automagically.
15:57arohnerljos: I have a namespace that sets everything up for testing, and that starts the server
15:57arohnerthen the test nses all require the test-init ns
16:00ljosarohner: That sounds like something I could do. Thanks!
16:01cbp`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:02cbp`dry-run only gets the first query right and the rest are incorrect
16:02cbp`and sql-only only gets the first query
16:04ljosarohner: 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:04gfrederickscbp`: in what sense are the dry-run queries incorrect?
16:05cbp`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:05arohnerljos: 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:05gfrederickscbp`: dry-run uses some dummy data since some of its values depend on things it doesn't actually have -- does that explain it?
16:07ljosarohner: 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:07cbp`gfredericks: Yes, however I was looking for a way to get both queries as they are going to be sent to the db
16:10cbp`I'm assuming there isn't something already built in so I guess I'll make it myself sometime later
16:10weavejesterljos: You can set the :join? option to false in the adapter
16:10cbp`When i have more time to look at the source
16:10alex_baranoskyanyone know if there's a way to get Cheshire to decode numbers as Longs instead of decoding them as Integers?
16:12amalloy&(class (int 1))
16:12lazybot⇒ java.lang.Integer
16:13amalloyalex_baranosky: maybe go back to clojure 1.3? it had a bug that made that sort of thing happen a lot more often :)
16:13alex_baranoskyha!
16:15gfredericksalex_baranosky: I'm curious why you need that
16:15sritchiealex_baranosky: dude! I'm back on irc :)
16:15sritchiealex_baranosky: qq for you
16:15sritchiedid you guys ever get generative testing into midje
16:15sritchie?
16:15alex_baranoskyjust want consistency in our serializing/deserializing to HBase… don't really NEED it per se
16:15amalloyalex_baranosky: just looking at cheshire.parse and jackson's parser, i'd say that's not possible
16:16amalloyyou'd have to do a post-processing step yourself
16:16sritchiealex_baranosky: if you're on scala, you should check out github.com/twitter/bijection for that
16:16alex_baranoskysritchie: 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:17sritchiegotcha
16:17sritchieI'm playing with clojure.test.generative now, finally time to get back into this
16:17sritchieand have been using scalacheck quite a bit
16:17sritchieI'd be happy to help with the generative stuff if you want to wake it back up
16:17alex_baranoskyamalloy: thanks, I think it's not important i=enough to add post-processing
16:18alex_baranoskysritchie: give it a try, let me find a link to the namespace for you
16:18alex_baranoskyah, I see, it is now being interned into midje.sweet https://github.com/marick/Midje/blob/master/src/midje/sweet.clj#L50
16:19sritchienice
16:19TimMcWait, why is CLJ-1153 marked as "minor"?
16:19sritchielooks like there are no default ones?
16:19sritchiewhich is fine
16:19TimMcIt should be "Critical", or at least "Major".
16:19ljosweavejester: that is a good idea :D
16:19gfredericksTimMc: do those things have agreed-upon definitions?
16:20TimMcI'm going to change it.
16:21gfrederickshaha
16:21hyPiRionTimMc: +1
16:22gfredericksI love how this thing is simultaneously an intentional feature and a critical defect
16:22TimMc"Minor" is just the default value.
16:29alex_baranoskyamalloy: 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:30gfredericksclojurebot: cheshire is <reply> there's always alter-var-rooting
16:30clojurebotYou don't have to tell me twice.
16:30amalloyclojurebot: clojurebot is a time-capsule for snark
16:30clojurebotAck. Ack.
16:31jondotaphyr: here?
16:31cbp`mmm what's the relation for an entity that has multiple references to location, for instance Address has multiple references to Location
16:32cemerickravster: they can be other types, but then you can't use hierarchies to represent those relationships
16:33cemerickravster: datomic certainly allows you to store keywords, though
16:33hyPiRionArg, I wish every? could support multiple colls.
16:35sritchiealex_baranosky: hey dude, do you know if you can put multiple expectations within a given formula?
16:35hyPiRionI find myself doing (every? (fn [[e1 e2 .. en]] ..) (map vector x1 x2 .. xn)) too often
16:36ljosSometimes 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:36ljoslinking.
16:36ljosIs there a way to get lein to do the linking again?
16:36alex_baranoskysritchie, yes!
16:37sritchiefunky, I'm seeing
16:37sritchie There are too many expections in your formula form:
16:37sritchiealex_baranosky: this is bad ass, by the way
16:37raekljos: are you sure that the library namespace did not change between the versions?
16:37alex_baranoskythanks :)
16:37alex_baranoskyI have been so busy with all my other projects I never really added scrinking to it
16:37sritchieyeah, no worries
16:37alex_baranoskyshrinking*
16:38alex_baranoskysritchie… oh so maybe you cannot. I wrote it forever ago, my mistake
16:39raekljos: 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:39alex_baranoskyit 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:39ljosraek: God damn it. You are right. It is the documentation that is wrong -.-
16:39alex_baranoskyI bet it could be changed to accept more than one arrow, if I officially admit I'll never add shrinking
16:40raekljos: I don't think you usually call something "linking" on the JVM. things don't work like in C
16:41raek"class loading" is perhaps the term
16:41stuarthalloway_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:42stuarthalloway_feedback on docs solicited
16:42ravstercemerick: oh, okay. Cool. Thanks.
16:44alex_baranoskysritchie: 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:45sritchiehmm, maybe
16:47Bronsastuarthalloway_: would you mind doing the "boring work" for blind (to be tools.reader) too?
16:48stuarthalloway_@Bronsa: link for context?
16:48stuarthalloway_nevermind, found it, boring away
16:48Bronsaok, I was trying to find the thread, thanks
16:53Bronsastuarthalloway_: in blind there's a commit by chris granger, is that a problem?
16:53stuarthalloway_has he signed a CA?
16:53Bronsayes
16:54RaynesDid he give a blood sample though?
16:54stuarthalloway_then you just need him to send an email acking the transfer to contrib
16:54Raynesibdknox: ^
16:55stuarthalloway_Bronsa: are you Nicola Mometto?
16:55BronsaI am indeed
16:57stuarthalloway_tools.reader boring work complete
16:58Bronsathanks, now I only need to get ibdknox to declare he is ok to transfering to contrib and I should be good to go?
17:00ljosraek: 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:00ljosThat is what you get for not being born with english. :{
17:01stuarthalloway_@Bronsa: as far as I know, yes
17:05Bronsastuarthalloway_: actually, I'd need commit rights too :P
17:05stuarthalloway_@Bronsa, stand by
17:05Bronsaor will they be given me once ibdknox write the mail?
17:05Bronsaok
17:06stuarthalloway_contrib permissions are group, I just didn't know you weren't in the group
17:07stuarthalloway_@Bronsa: done
17:07Bronsathanks
17:14benmosscan anyone recommend a recent "intro to web development with clojure" guide?
17:15gfredericksSo 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:20michaelr`what is all the talk about read-eval?
17:20michaelr`any links?
17:20raggedoes anyone have any experience with parsley, by cgrand?
17:21maioany idea how to bind some key only in nREPL REPL buffer? (and also not in Clojure buffer)
17:22gfredericksmichaelr`: you've seen the jira issue?
17:22raggemaio: nrepl-mode-map?
17:23cbp`does korma not support multiple foreign keys?
17:24maioragge: that seems to be also active in any Clojure buffer
17:30geoffsDoes 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:31jondotgeoffs: is it something clojure related or testing related that you're not feeling comfortable with?
17:32geoffsspecifically testing in clojure. I feel fairly confident doing testing in java, c etc.
17:33stuarthalloway_geoffs: I would be interested in your reaction to https://github.com/Datomic/simulant
17:33geoffsI 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:34geoffsstuarthalloway: I'll take a look at it, thanks!
17:36jballancstuarthalloway_: maybe this is a stupid question, but is simulant intended to be a load-testing solution? or just behavior simulation?
17:36stuarthalloway_an interesting question actually
17:36stuarthalloway_you can use simulant for or in parallel to simulation testing
17:37jballancI'll definitely be looking at it more...
17:37stuarthalloway_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:38jballancvery cool
17:38Bronsastuarthalloway_: sorry to bother you again, but I think I need an account on hudson too
17:39stuarthalloway_Bronsa: not sure I know how to do that, looking
17:40Bronsaok, I'll ping the ml if it's a problem for you to do that
17:40jondotstuarthalloway_: more like a functional test infrastructure is it? something in the concept of FitNesse/StoryTeller?
17:41stuarthalloway_I don't think non-technical users could use Simulant as they might use Fitnesse
17:41stuarthalloway_although one might build a fitnesse-like layer on top of simulant
17:41jondotright, that's interesting.
17:43jballancany thoughts on joining Simulant with CLJS to do browser-action modeling?
17:43jballanc...along the lines of Selenium?
17:44stuarthalloway_Simulant might use e.g. Selenium to implement actions
17:45jballanchave you tried using it for any "scientific" sorts of applications? or just system testing?
17:45jballanci.e. it might be fun to use this in an itterated prisoner's dilema simulation
17:50stuarthalloway_jballanc: in the future I will have copious free time and do scientific simulation stuff
17:50stuarthalloway_but today, no
17:50jballanc:)
17:51jballancmy thesis research was evolutionary modeling, so these sorts of simulations are very interesting to me...
17:51jballancbeen meaning to go back and rewrite some of that code, and this looks like it could be the perfect solution
17:58geoffsstuarthalloway_: 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:59stuarthalloway_nice!
17:59geoffsthough it looks to have a not inconsiderable learning curve
17:59stuarthalloway_agreed, not sure yet if that is intrinsic or I suck at explaining
18:00geoffsI 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:56gfredericks,((fn f [n] (apply + 1 (repeatedly (rand-int n) #(f n)))) 2)
18:56clojurebot6
18:56gfredericks,((fn f [n] (apply + 1 (repeatedly (rand-int n) #(f n)))) 3)
18:56clojurebot24
18:56gfredericks,((fn f [n] (apply + 1 (repeatedly (rand-int n) #(f n)))) 3)
18:56clojurebot195
18:56callenbotI 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:57callenbotAm 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:57gfrederickscallenbot: what behavior do you want when two threads are handling a request at the same time?
18:58callenbotgfredericks: two threads handling two different requests?
18:58gfrederickscallenbot: yeah
18:58callenbotbecause when I talk about a ref, I mean a dynamically bound ref vs. dynamically bound map
18:58weavejestercallenbot: A dynamically scoped binding would give you a variable that lasts for the duration of the request.
18:58callenbotgfredericks: I want per-request state isolation.
18:58gfrederickscallenbot: so that would be a dynamically bound ref of a map?
18:58callenbotgfredericks: yeah, or a bare map
18:58callenbotweavejester: that's precisely what I want, but is that going to work in netty/aleph?
18:59gfrederickscallenbot: I don't know what a thread-local ref is useful for
18:59weavejestercallenbot: It depends on whether you pass the asynchronous channel to another thread.
18:59weavejesterYou'd have to do that explicitly
18:59weavejesterFor instance, by adding the channel to an atom
18:59callenbotfuck. I'll punt in netty/aleph for now until I understand the semantics better.
19:00weavejesterAnd at the same time you could pass along the global context.
19:00callenbotdynamic var bound to map, merge provided context from render function on top of the current global context -> template context.
19:00callenbotthe point of this is to not be kicking the arguments around all over the place
19:00callenbotparticularly since keyword args in Clojure are pain incarnate.
19:01callenbotit sounds like a dynamically bound map that gets bound to an initial state is what I want. Maybe init'd with ring middleware.
19:01weavejestercallenbot: Why are they painful?
19:01callenbotweavejester: it's awkward to use them. Python did it better, sadly.
19:01callenbotwhenever I realize I need kwargs for something in clj I cringe really hard.
19:02weavejestercallenbot: Are you referring to the problems with applying a map to a function?
19:02gfredericks(defmacro kw-fn [args & body] (list* 'fn {:keys args} body))
19:02gfredericks(defmacro kw-fn [args & body] (list* 'fn ['& {:keys args}] body)) ;; whoops
19:03weavejesterI wouldn't even bother with a macro, myself.
19:03weavejester(defn foo [{:keys [bar baz]}] …)
19:04gfredericksthat's presumably what he thinks is awkward and cringeful
19:04callenbotyes
19:04callenbotweavejester: Pretty lightweight -> def fn(required_arg, kw_arg=default_value, kwarg_two=2)
19:04weavejesterMy problem with keyword args is that you can't apply a map.
19:04gfredericks~mapply
19:04clojurebotYou could (defn mapply [f & args] (apply f (apply concat (butlast args) (last args))))
19:04weavejester(apply foo {:bar 1 :baz 2}) => (apply foo [:bar 1] [:baz 2])
19:04callenbotweavejester: also in Python: fn(400, **{"kw_arg":2})
19:05weavejesterSo usually I just keep options as a map.
19:05callenbot* + args and ** + kwargs is a nice pattern.
19:05weavejesterWell, it's true that Python's behaviour could be mimiced with a macro :)
19:06callenbotweavejester: I don't necessarily want to proliferate non-idiomatic code
19:06callenbotweavejester: and a global state that gets injected into templates is more to the point.
19:06weavejesterYes, although I get nervous around dynamic scope.
19:06callenbotweavejester: Flask seems to manage with g
19:06weavejesterIt's shorter to write, but less flexible.
19:07weavejesterWell, sure, you can do it - but it's technically not as useful as lexical scope. Whatever the language.
19:08callenbotweavejester: 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:08callenbotweavejester: and I am not going to kick around a context/options/user state manually between every view -> template flow.
19:08weavejestercallenbot: Oh, I'm not saying you shouldn't do it.
19:08callenbotI use computers so that I can do less repetitious work, not more.
19:09callenbotweavejester: how could it bite me, outside of aleph?
19:09weavejesterIt's just one of those things, like macros, that should be used with caution.
19:09callenbotI'm cautiously impatient with kicking state around manually.
19:09weavejestercallenbot: It won't bite you, I don't think. Unless you explicitly open up a new thread, you should be good.
19:10weavejesterIt's just harder to compose functions with dynamic scope.
19:11weavejesterEffectively you're adding another variable to every function within the request
19:11weavejesterWhich is fine, but the more variables you have, the more things that can go wrong.
19:12gfredericksalso laziness
19:12weavejesterLaziness?
19:12clojurebotlaziness means not traversing anything twice
19:12seangroveAnyone using carica with lein-cljsbuild? It doesn't seem to be picking up on the different config files
19:12gfredericksany unrealized lazy values returned get realized without the binding
19:14gfredericksis it fair to say that the only thing gained from the existence of &form is the symbol that referred to the current macro?
19:23Braves
19:24Bravewww.akran.net
19:32augustlClojure/west ticket booked, gonna be good!
19:32augustlweavejester: did you find any good information about the XHR + CSRF token stuff?
19:33weavejesteraugustl: Oh, sorry, I haven't had time to look into it quite yet.
19:33weavejesteraugustl: Ring 1.2 should be released within a week or two, however, which should free up some time.
19:36augustlweavejester: I see, no probs
19:36augustlI'll see if I can find some information and post it to the pull req
19:44callenbotweavejester: thanks for the pointes
19:44callenbotpointers*
19:44callenbotgfredericks: you too
19:45cbp`mm i think korma should allow multiple relations between 2 tables or accept a vector of foreign keys
19:55seangroveAh, had to `lein trampoline with-profile prod cljsbuild prod`
20:00sshackAnyone here got a java library with JNI component working with clojure/lein before?
20:04augustlsshack: yeah, I just did that a couple of days ago
20:04augustlsshack: I also blogged about it, perhaps you'll find it useful :) http://augustl.com/blog/2013/using_zeromq_from_clojure/
20:04sshackDid 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:05sshackThis is clojuratica, fwiw.
20:05sshackReading that now.
20:05augustlsshack: the method I outline works fine, the actual "reusable" part is -Djava.library.path
20:06sshackIs there a way I can add that to my leon project file?
20:06sshacks/leon/lein/
20:06augustlsee the blog post :)
20:06sshackIt's loading. I got into swap here doing a db ingest...
20:06sshackTime for more memory.
20:07augustlhah
20:07augustlsshack: :jvm-opts ["-Djava.library.path=../jzmq-2.1.0-SNAPSHOT/lib"]}
20:08augustlI hardcode that into my project.clj, and assume that the jni module exists in ../
20:09sshackMakes sense.
20:09sshackWish there were an easier way though.
20:10sshackby easier, I mean, cleaner/more well defined.
20:12sshackWait, what is :native-path?
20:15arrdemyou guys know of an emacs plugin for HTML editing?
20:16arrdemM-tab doesn't seem to work on tags by default.
20:16augustlsshack: :native-path is for output or something like that, don't remember
20:16augustlsshack: technomancy said he wanted a cleaner way to do this than -Djava.library.path
20:18augustlI wonder if there's some Right Way via maven to work with JNI modules
20:19augustlwith rubygems, for example, the gems with native extensions compile themselves upon install
20:19sshackI 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:21augustlsshack: that's the problem with the jzmq module, it can't be added to a shared repo
20:21augustlthe .jar file you build also contain .c files and is related to the ZeroMQ installation on your box
20:21augustlso it has to be built for each machine
20:21sshackAs soon as this import finishes, I'll play with this stuff.
20:22augustlsshack: I have 17 days uptime and still no page outs, lots of RAM ftw
20:23sshackGreat.
20:38caspercAnyone know of a way to trace how long individual function calls take in eg a namespace?
20:39caspercsomething like what clojure,tools.trace does, but it doesn't seem to be able to trace time taken
20:43warzhrm, 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:45tmciverwarz: if you're using lein, it should be using ~/.m2 already
20:48warzim 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:48warzjust get a little large.
21:51amalloygfredericks: &form also has metadata
21:51gfredericksamalloy: oh interesting; good point
21:52amalloyof particular importance, it has :line metadata
21:53gfredericksoh how did that get there?
21:54gfrederickslooks like all lists have it at compile-time?
21:54amalloyyeah
21:54gfredericks,(meta (read-string "(+ 1 2)"))
21:54clojurebotnil
21:54gfredericksI guess that means the normal reader is different from read-string
22:08sshackaugustl: I got my JNI going.
22:09sshack:native-path didn't work, and I will investigate.
22:10sshackI ended up monkeying with the jvm-opts
22:10sshack:jvm-opts ["-Djava.library.path=/Applications/Mathematica.app/SystemFiles/Links/JLink/SystemFiles/Libraries/MacOSX-x86-64"]
22:10sshackNast, put it works. I can factor an integer.
22:17doc_browni am looking at some code ... im seeing after every defn a string describing the function followed by a newline and '[]'
22:17doc_brownwhats up with the '[]' ? and the uncommented string ?
22:17gfredericks[] would be the argument list
22:17gfredericksso the function has no arguments
22:17gfredericksthe string is a docstring, which is a feature of defn
22:17doc_brownooh
22:17doc_browngotcha
22:18doc_brownthe new lines threw me off
22:18gfredericksthe string gets added as metadata on the var, which can be useful for tooling; also see clojure.repl/doc, which prints out docstrings
22:18doc_brownkk
22:18gfredericks,(doc first)
22:18clojurebot"([coll]); Returns the first item in the collection. Calls seq on its argument. If coll is nil, returns nil."
22:18gfredericks^ that was trivial for clojurebot to do because the docstring is available at runtime
22:19doc_brownwhat was the comma for ?
22:19gfredericksto make clojurebot eval the expression
22:19doc_brownah
23:40doc_brownand where does Thread come from?
23:40doc_browni see a call to it with future ... (future (Thread/sleep 3000) ...)
23:40doc_brownis that in clojure.core ?
23:42SgeoIt's from Java
23:42SgeoIt's java.lang.Thread
23:43Sgeosleep is a static method on java.lang.Thread. in Java it would be called similarly to Thread.sleep(3000)
23:45doc_brownah ok
23:46ChongLiwhoa, wait a minute doc. are you telling me that my mother has got the hots for me?
23:49tmciverYou made a time machine . . . out of a Delorian?
23:49ChongLiwhoa, this is heavy
23:51tmciverdoc_brown: biff_tannen hangs out here once in a while. I hear that he kills you ove a matter of 80 dollars.
23:55doc_brownshot in the back?
23:55doc_brownover a matter of 80 dollars !?