#clojure logs

2012-08-03

00:00nDuffHmm -- latest korma is very slightly behind on c.j.jdbc (0.2.2 vs 0.2.3)
00:01nDuff...same behavior on latest release of both. Trying it raw.
00:11nDuffIssue reproduces with c.j.jdbc
00:14nDuff... :fetch-size appears to have no effect (with the MySQL connector; haven't tested with others).
00:27khuhi, i'm interested in parallel graph computations -- is clojure well suited for this sort of distributed computation?
00:27khusomething similar to the C++ parallel boost graph library
00:35khug
00:38akhudeknDuff: could it be a bug in the connector? The relevant clojure jdbc looks like it should work correctly.
00:38nDuffakhudek: I've filled in some details in a comment to https://github.com/ibdknox/Korma/pull/66
00:41akhudekkhu: without knowing much about parallel graph libraries it's hard to comment, but clojure is general purpose and has good concurency features so I don't see why not
00:49m0smithcljs question; do it support promise/deliver?
00:50nDuffm0smith: No.
00:51m0smithnDuff: thanks. Is there a way to do the same thing?
00:54nDuffm0smith: Depends on exactly what you mean by "the same thing". Haven't run into anything I couldn't do with the facilities available, but I don't have time (or remaining brain facilities -- it's extremely late here) for a discussion now.
00:55m0smithgood night
00:58nsxtany benefit to using java.io over slurp/spit when writing/reading files?
00:58tomojm0smith: if you deref and the value has not been delivered, what do you want to happen?
00:58muhoofor some reason, in nrepl.el, C-c C-l is bound to clojure-load-file not to nrepl-load-file
01:00Raynesnsxt: slurp pulls an entire file into memory as a string.
01:00RaynesI'll leave what happens when you ready a 200GB file with slurp to your imagination.
01:00Raynesread*
01:02nsxtRaynes: thanks
01:03nsxtRaynes: any arguments discouraging the use of spit, or is it the shortcut that clojuredocs makes it out to be?
01:06emezeskensxt: slurp and spit are both great for quickly getting stuff out of or into files
01:07emezeskensxt: Neither one should be discouraged, just keep in mind that their simplicity means you don't get much control
01:07emezeskensxt: If you need more control, then java.io is waiting :)
01:07nsxtemezeske: thank you
01:08Raynesemezeske: I wasn't discouraging it.
01:08RaynesI thought I was clear.
01:08RaynesYou wouldn't want to use slurp to read in and process large files.
01:08emezeskeRaynes: I know! nsxt used the word discourage.
01:08emezeskeRaynes: I was responding to that :)
01:08RaynesYour names are colored similarly in my IRC client, so I assume you're the same person.
01:09RaynesI'll continue assuming that despite any objections.
01:09emezeskeI don't object
01:09RaynesThen I do object. Why would you think you were the same person?
01:09emezeskeI thought who was the same person as what, on when
01:10RaynesI know!
01:29cheezey?
01:50duck1123does doall make sure that all the sequences are realized, or just the top one?
02:22alex_baranoskywhat is the best-maintained clojure csv library out there?
02:24ro_sthttps://github.com/clojure/data.csv/ was last updated a couple months ago
02:32muhoowow, reading cljs/core.cljs is a lot more fun way to explore the inner guts of clojure, than reading the java variant, because it's all in clojure itself.
02:36ro_sti believe it's interesting because it has to do stuff in ways not possible in idiomatic clojure
03:58augustlare there any clojure-isms for shelling out/making sub processes?
04:31muhooaugustl: there's the java shell, or conch in clojure
04:32augustlmuhoo: looking it up, thanks
04:39bprthere's also stevedore, but i'm not sure if that's what you were asking for
04:47magopianhello there
04:48magopianis somebody from the 4clojure.com team around?
04:49augustlbpr: looking that up too, thanks :)
05:15emlI'm having some trouble reading the body of a JSON POST request, anyone have a recent guide/forum post/whatever regarding it that I can steal some code from?
05:16ro_stare you using middleware to do the json parsing?
05:17emlI would be glad to do that. :)
05:20ro_steml: https://www.refheap.com/paste/4022
05:21ro_stand [cheshire "4.0.1"] in project.clj for the middleware to use
05:21ro_stthis will parse json request bodies and :kewordise the keys, and it'll convert clojure data structures to json when emitting response
05:22ro_stmy handlers return {:body <data>} for the response middleware to pick up
05:22ro_stgood luck :-)
05:22emlI've seen some code similar to that, the one thing that confuses me is the (def app-routes ...) and (def app). Not sure what that is :)
05:24ro_st(compojure/defroutes app-routes …)
05:24ro_stassuming you use compojure for routing
05:24emlNope I use (defpage) from Noir :)
05:25emlWhich I failed to mention.. d'oh
05:25ro_styer on yer own, buddy :-)
05:25ro_stbut the middleware i provided works directly with the req/response maps
05:25ro_stso if you can find out how to wrap noir with middleware (i've never had to), you should be ok
05:26ro_sti went for compojure because there's less magic between me and http. wanted to understand what's going on
05:33emldang :)
06:42Raynesro_st, eml: noir.server/add-middleware!
06:43ro_stboom :-)
06:44Raynesro_st: In wrap-json-params, why did you use the name 'req*' in the let?
06:45ro_stit's a copy-paste job from the wrap-json-params in the middleware lib i used
06:45ro_sti did this to add x-url-form-encoded to the check
06:45RaynesWhat middleware lib is that?
06:45ro_sthttps://github.com/ngrunwald/ring-middleware-format
06:46ro_stoh, wait, perhaps it's not a copy-paste of that one
06:46ro_st-shrug- havnae a clue :-)
06:47ro_sti'm guessing your point is that the inner let will bind over the outer, making the * unnecessary?
06:47RaynesI should probably add middleware for this to lib-noir.
06:47RaynesYeah, and bstr is unnecessary and can be inlined.
06:47RaynesI was going to give you those two tips, but if you didn't write the code… *shrug*
06:47Raynes:p
06:48ro_styep. when this code went in, i was … unconcerned with how this code worked, as long as it did
06:49ro_sthere's an expansive question. what is clojure not a good fit for?
06:56ro_st1disconnected. didn't see any responses to my massive question :-)
07:03naeg_is there actually a reason why other lisps don't make use of [] for e.g. vectors or something else?
07:03Bronsacommon lisp uses #() for vectors
07:03cacodaemon&(apply (partial merge-with concat) [{:A [1 2]} {:A [3 4]} {:B "abc"} {:B [:a :b :c]}])
07:03lazybot⇒ {:B (\a \b \c :a :b :c), :A (1 2 3 4)}
07:04cacodaemon&(apply (partial map concat) [[[1 2] [3 4]] [[5 6] [7 8]] ["abc" [:a :b :c]]])
07:04lazybot⇒ ((1 2 5 6 \a \b \c) (3 4 7 8 :a :b :c))
07:25lancerois there any guide online for setting up CDT on windows?
07:28ro_ststep1: install ubuntu OR buy a mac -duck, run-
07:29ro_sti need to check CDT out. it looks great. i've been getting by with swank's break
07:30ro_stRaynes: do you know if nrepl.el has a breakpointer like swank does?
08:44XPheriorHas anyone ever used Noir with multiple view namespaces?
08:44kralnamaste
08:44XPheriorHm?
08:48ohpauleezXPherior: it's a way to show gratitude, respect, thanks, etc
08:48ohpauleeza word*
08:52XPheriorohpauleez: Thanks for the info.
09:09TimMcAlso a greeting, yeah?
09:16ohpauleezTimMc: for sure
09:22ludstonHey, I have a question that someone here might be able to help me with,
09:23ludstonWhat's the answer to managing state in a Java library, such as Swing, functionally?
09:24duck11231Those kind of libraries are annoying, but there's nothing stopping you from using them, they just feel odd
09:25duck11231usually when there's a lib like that, there's a clojure lib wrapping it up
09:25ludstonI'm using a library called seesaw that wraps it, but all it does is provide a better API
09:27ludstonIt doesn't solve the real problem, which is that when state changes in some component, it's really expensive to do the right thing, which would be to completely destroy the UI element and replace it with a new one with new changes
09:28duck11231but short of re-writing all of the internals to be clojurey, what can you do?
09:30ludstonI could theoretically write a wrapper that has some sort of cloned version of the entire api in a clojure that contains all of the actually important info, like the contents of text boxes etc
09:30ludstonBut I was hoping that when I asked, someone could point to where this was already done.
09:31ludstonOr at some magic state wrapping library that does a much better job than I could
09:32duck11231you would have to have a type of text box that supports the structural sharing in order to make those type of ops efficient.
09:34ludstonI need 40 million dollars to hire a team of programmers to make the Lisp that I want.
09:34duck11231it would be cool to see a completely clojure windowing library, but so many wheels to re-invent
09:34ludstonWho's up for it?
09:36bryanlshouldn't "lein deps" show a listing of my deps?
09:37duck11231ok then, in this hypothetical clojure gui library I have a form with a text box. I want to set the value of the text box by assoc-ing on the vew value and getting back a cheap copy. How does the form know to use the new text box
09:37duck11231bryanl: try lein deps :tree
09:37bryanlduck11231: thanks
09:39ludstonThe text doesn't get replaced
09:39joegallo_duck11231: the old gui should stay there unmodified, with a whole new gui rendered in a new window. but, you know, with structural sharing so it's efficient. ;)
09:40ludstonThe GUI creates a monad that presents all of the content contained in it
09:40duck11231"Oh god! why did I map over my window?"
09:41ludstonEach function invoked on the gui causes the entire state of the program to get passed into the clojurey part of the program, which modifies it how it will
09:41ludstonAnd then passes it back, replacing the contents of the old gui
09:42duck11231interesting idea
09:43ludstonAll of the interaction with the gui comes through a single function, called "process-input" or something
09:43ludstonAnd it has datastructures passed to it that explain the change that has occured on the gui
09:44ludstonNone of this 1billion listeners stuff. It uses multimethods to figure out the output it returns
09:45ludstonConstruct the gui in some made up lispy markup language, and then have it throw exceptions if ever a button/combination of input is sent from it that the multimethod underneath can't handle
09:45ludstonAmen.
09:46duck1123so where's your github repo already? :)
09:46ludstonLol I haven't got the time or the skills to make something like that.
09:48ludstonI've only been playing with clojure for about a month, and I still haven't touched the object system
09:49duck1123I wonder if a system like that would make it easier to work around the limitations of updating the gui from other threads.
09:51ludstonIf it was passing the state of the whole UI, it'd have to only be able to interact with one thread,
09:51ludstonBut I guess you could build up the new UI with more than one
09:53ludstonMaybe you *could* split up the UI so each component could individually be sent, or as smaller groups
09:54ludstonBut UI components that affect each other would have to be in the same group
09:56ludstonUnless you split it up so each component would get updated individually by a single change, taking whatever state they needed before coming back...
09:58ludstonStateful UI's can allready do that with listeners...
09:58ludstonThe real boon would be the whole groups that return, or replacing the whole UI in one goe
10:09ludstonThe problem with the Java UI, is that because it's horrible, I can't access its state unless I pass it into the listeners I add to it upon their creation, and that means the state is only accesible via a clojure
10:10ludstonWhich is horrible code design
10:14ludstonAnd it's creating a problem for me with text-listeners, because changes to text objects are handled in two ways, first the change can be caught by a "document filter" which lets me change it into whatever form I want, and then, an
10:14ludston"event listener" will be fired that will look at that change
10:14ludstonAnd there are things that only the event listener can do, such as create menus
10:16ludstonBecause both of those listeners need to share the same function output
10:18ludstonI'm caught between having state, or writing a hacky wrapper around the "Event Listener" part that will immediately undo changes made to the text field, which will trigger another "Event Listener" again, which doesn't really solve the problem, because then that event listener needs state to figure out that it's getting trapped into a recursive loop.
10:18ludstonBlarg.
10:18ludstonWhich I guess is why I asked, what is the solution to state, in the first place.
10:18ludston:(
10:58gtrakTGIF
10:59jolyamen
11:00ohpauleezholler
11:15grcgiven that defn provides :pre and :post condition checking, why is it so rarely used?
11:17devngrc: Take it too far and use it everywhere, and then you'll know why. :)
11:18grcdevn: I was hoping to avoid the pain!
11:19grcBut seriously, Eiffel trades on this, JML tries to implement it for Java but it appears to have been added to the language as A Good Thing but never used
11:19ohpauleezgrc: I think there are two reasons
11:19ohpauleez1.) People move code around like clay - they don't quite think as far ahead or careful as someone like Rich might
11:20ohpauleezit's hard to come up with the constraints of a system that you yourself aren't even sure about
11:20ohpauleez2.) Creating contraints on domain input and output takes practice, just like writing good tests
11:20ohpauleezBUT
11:20ohpauleezyou end up capturing these domains in your tests anyway, you might as well enforce them and program defensively
11:21ohpauleezProgramming to an interface instead of an implementation helps to avoid pointless dependencies between calling pieces of code
11:22grc1) sounds eminently plausible, particularly given the flexible nature of REPL based programming
11:22ohpauleezIf you need more flexibility in your contraints, take a look at trammel
11:22ohpauleezgrc: The REPL isn't an excuse for thinking, it's part of the process
11:23ohpauleezplay in the REPL, build up the solution, pull out the abstracts and widdle them down, then enforce the domain of operation that you're expecting
11:23ohpauleezusually when you're in the REPL, you're already reasoning about input and output domains
11:25ohpauleezabstractions*
11:25acheng(in general do people prefer to be notified when they use the wrong word?)
11:25S11001001acheng: I don't know, but I do
11:26ohpauleezI do
11:26achengs/widdle/whittle
11:26ohpauleezahh yes, thank you
11:26achengI think irc allows private channels but i do not possess that fu
11:27grcohpauleez: widdle is what my 5 year old son does in the bathroom. But I knew what you meant
11:27S11001001acheng: it lets you put a password on
11:27ohpauleezIf someone publicly makes a mistake, you should publicly point it out :)
11:27ohpauleezgrc: :)
11:28S11001001acheng: you don't need a chan to send someone a private message, though, just /msg S11001001 I will hear this
11:28achengah thanks
11:28ohpauleezThat said, easy access to contracts + generative testing has had a serious impact on my general development and my confidence in my solutions
11:29achengohpauleez: does that mean you lean towards or away from :pre :post ? i'm not awake yet
11:30ohpauleezacheng: I'm all for :pre/:post or trammel. A contract + solid comment with example usage + generative testing is a big win
11:30achengdoes that mean you think as far ahead as Rich? :)
11:31cgagohpauleez: is test.generative what you're using? I looked into it a while ago but never tried it. The readme said it was very early days and changing, but it didn't look like it'd been touched in a quite a while.
11:31ohpauleezmatched with pair-wise integration tests, unit tests only when cyclomatic complexity demands it, system tests (top-level functional tests, ideally in a behavior-oriented fashion) make up the rest of the story for me and my teams (usually)
11:32ohpauleezacheng: I think far ahead, but I don't think I'm in the same league as RH
11:32ohpauleezI'm like a AAA far thinker to RH's Hall of Fame league
11:33grcohpauleez: I'm currently struggling through an implementation of high order function contract checking but was hiiting the wall of doubt
11:33grcIf folk don't do first order checking then ,,,
11:33grc(M.Sc. dissertation subject)
11:34ohpauleezfor sure
11:36ohpauleezyou can use contracts though to "control" the boundaries of your system the dependencies it has
11:36ohpauleezwhich is usually as good as you can do in that case - if you really want to enforce at those points
11:36ohpauleezI find as I go higher up in the solution space, the contracts get fewer and fewer
11:37ohpauleez(for better or worse)
11:38ohpauleezcgag: I think test.generative is fine to use
11:56rplevyweird that this is acceptable (keyword "fooo()a")
11:57gtrakrplevy: stop breaking the reader...
11:57rplevyof course the reader will not interpret it that way as a literal
11:57scriptor,(keyword "fooo()a")
11:57clojurebot:fooo()a
11:57rplevygtrak: haha
11:58rplevybut oddly a keyword can contain these characters as demonstrated
12:00rplevyI wonder if there are other things that choke on the keyword once produced
12:01rplevy,(symbol "fooo()a")
12:01clojurebotfooo()a
12:01rplevyodd
12:01muhooludston: ztellman did a great talk at clojurewest on how to wrap stateful libraries like swing. it was at clojurewest, probably up on blip.tv by now
12:04rplevyeven stranger: (symbol "(+ 1 2 3)") I guess I just never thought to try these, so I didn't realize symbol and keyword allow these reader-incompatible symbols and keywords
12:05naegsome men just want to watch the world burn...
12:05rplevythat said, I don't see what good it does, obviously the reader is too slow to run a check each time
12:05rplevythat's probably the reason
12:06bryanlWhy does this happen: https://gist.github.com/3248995 if (:date-of-birth person) returns a Long?
12:06rplevybut you don't need the whole reader, just a check of what characters are allowed
12:06rplevywhich should be a fast regexp
12:07rplevydunno
12:07gtrakit would only make sense to limit symbols and keywords if you're for-sure going to to read them, yea?
12:07rplevyyeah, true
12:07rplevythat's probably the reasoning, and makes sense
12:08rplevythe argument about failing faster/earlier might make sense if these could cause problems
12:09S11001001it would make more sense to have escape syntax for printing symbols and keywords
12:09rplevyS11001001: yeah I agree
12:11bryanlnm.. on my early question. i just set the test up wrong
12:23rplevy,(do (defmacro pointless [s] (type s)) [(type (symbol "(+ 1 2 3)")) , (pointless (symbol "(+ 1 2 3)"))])
12:23clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
12:23rplevyclojail...
12:23rplevyresult is: [clojure.lang.Symbol clojure.lang.PersistentList]
12:25rplevyso I guess if you're reading some weird stuff into keywords, it might be a different type than you expect at macro expansion time
12:25rplevyor symbols
12:25ludstonmuhoo: Do you know what the talk was called?
12:26llasramrplevy: I believe what's happening there is that `pointless` is being passed '(symbol "(+ 1 2 3)")
12:26ludstonIn the mean time: http://danielkeogh.com/blog/view/clojure-architecture-time-functional-gui-library Fleshed out ideas a little on my wishlist. I'd love feedback.
12:26llasram(that is, the quoted list of those literal values)
12:26rplevymaybe lemme check
12:27S11001001rplevy: stick `'~ in pointless def
12:28rplevyllasram: yeah oops
12:32muhooludston: "distilling java libraries", IIRC
12:35muhooludston: sorry, infoq, not blip.tv
12:36muhooludston: slides here https://github.com/strangeloop/clojurewest2012-slides/blob/master/README.md
12:38ludstonmuhoo: Thanks. You're a champion.
12:40muhoonaw, the champion in this case is ztellman.
12:41cgagludston: "however it does not do any more than make the Swing."
12:42cgagis that sentence missing a few words or am i miss reading it?
12:43augustlfor debugging purposes, how do I add a specific free floating jar to my project?
12:43augustlusing lein2
12:44ludstoncgag: Nope, I'm just retarded.
12:46ludstonThere we go. All fixed.
12:46ludstonSleep now.
12:48ckirkendallDoes anyone know how to route clojure.tools.logging to the slime repl
12:52joegallo_(alter-var-root #'clojure.tools.logging/log* (constantly println))
12:52joegallo_a sloppy, but workable solution.
12:53joegallo_i'm sure you could refine that into something better
12:53hiredmandepending on which concrete logging impl you are using it is pretty easy to create an appender that does whatever you want
12:53llasramHuh. I had not considered that one.
12:55llasramYeah, with log4j it's something like (.addAppender (Logger/getRootLogger) (WriterAppender. (SimpleLayout.) *out*))
12:55llasramMmm.... Java APIs...
12:57augustlanyone on adding a free floating jar to a lein2 project for testing purposes? Want to test my own build of a dependency I use.
12:58technomancyaugustl: you can use lein-localrepo
12:58augustltechnomancy: looking it up, thanks
13:00ckirkendallllasram: thanks
13:02joegallo_that said, though, using the ConsoleAppender from log4j (for me), resulted in filling up the *swank* buffer, not writing to my slime repl.
13:02technomancyjust uuuuuuuse priiiiiiintln
13:02joegallo_in all likelihood, though, that was my fault in some way.
13:02joegallo_technomancy: well, yeah, that's why i suggested it
13:03joegallo_or do you mean println debugging?
13:03technomancyno, I mean for logging
13:03technomancyjava logging is clown shoes
13:03joegallo_heh
13:03llasramtechnomancy: But, log levels!
13:03technomancyllasram: (defn debug [& msgs] (when *debug* (apply println msgs))) ; done
13:04technomancyjava log levels can't even be changed on a per-thread basis or even changed at all at runtime reliably; screw that
13:05llasramHmm. I have never even considered that as an option, although I can see how it could be useful to e.g. attach a REPL and raise the log level
13:06llasramMaybe clojure.tools.logging needs a "just use println" backend
13:06technomancyinc
13:06technomancyyou can change the log level at runtime with log4j, but it's super annoying
13:06technomancyand it doesn't work on the other backends
13:06technomancyso it's not exposed in c.t.logging
13:06ckirkendalltechnomancy: I would use println but the need to connect to log4j in prod is out of my control
13:07ckirkendalltechnomancy: I would use println but the need to connect to log4j in prod is out of my control
13:07technomancyckirkendall: yeah, there are some cases where it's appropriate
13:08technomancyit just shouldn't be your first choice
13:10ckirkendallagree
13:20achenghm. The page at www.infoq.com says: null [OK]
13:21acheng(while viewing the page that has all of Zach Tellman's content)
13:42stuartsierraCan someone verify my latest work on CLJS-276?
13:42stuartsierrahttp://dev.clojure.org/jira/browse/CLJS-276?focusedCommentId=29084&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-29084
13:50TimMcclojurebot: java logging is clown shoes
13:50clojurebotc'est bon!
13:50nDuffstuartsierra: Hmm. There's a bunch of stylistic / convention-breaking things we'd jump on for someone proposing that script in #bash, but I don't see anything obvious that would impact functionality.
13:50stuartsierranDuff: I don't care about the style of the Bash code, I only care about the results.
13:51stuartsierraNot to be dismissive of coding style for Bash, it's just not important to me in this case.
13:52nDuff(capitalization of non-exported variables, use of dirname rather than parameter expansion, use of [ ] vs [[ ]], etc)... but yah, it smells fine on readthrough for functionality.
14:01stuartsierranDuff: Can you point me to a quick explanation of "use of dirname rather than parameter expansion"?
14:04ibdknoxtechnomancy: is there a way for me to tell leiningen-core what directory it's in?
14:04nDuffstuartsierra: "${path##*/}" is much faster than "$(basename "$path")" (no fork+exec+read cycle)
14:05stuartsierranDuff: cool, thanks
14:08technomancyibdknox: it should use :root from the project map, but there may be a few places where it still falls back to the JVM process's PWD
14:08technomancy(if so that's a bug)
14:15ibdknoxtechnomancy: ah, I see. thanks :)
14:20nDuffibdknox: Know if anyone has attempted to get streaming resultsets working against MySQL with korma? I'm having rather a rough time of it.
14:20ibdknoxno idea
14:20ibdknoxnDuff: have you seen it work with c.j.jdbc?
14:20ibdknoxif it can work there, it can work with korma
14:28pbostrom__I'm trying to convince myself that the following code will accomplish what I want: https://gist.github.com/3250162 I guess what I'm trying to figure out, are the two actions sent to the agent "atomically" at the end of the transaction, or could another thread step in and send its actions
14:32stuartsierrapbostrom: I wouldn't rely on both agent sends being atomic. Why not send a single function that does both things?
14:33ibdknoxnDuff: I misread your question - the way exec works right now, if there's some magical way of doing a streaming result set, it won't work. Korma intentionally realizes the results, since you'd otherwise have to do a bunch of inversion stuff to get everything into a result-preserving scope
14:34ibdknoxnDuff: i.e. you couldn't pass the seq around, because by the time you do, the results will have closed themselves. You can add a new exec mode that would allow you to tell it what to do
14:35pbostrom__stuartsierra: I guess the question still stands in that case, would a single send be atomic after the transaction is successful, or could the transaction that finishes 2nd still step in and send its println first
14:36stuartsierraI don't know, but even if I did I wouldn't rely on it.
14:37pbostrom__ok, thanks, I should probably think about this some more
14:38ohpauleezI wonder what just happened to freenode (or the internet)
14:40stuartsierraI think IRC is distributed. That's the result of a network failure between nodes.
14:41gtrakhaven't these guys heard of spanning tree?
14:42rlbhttp://en.wikipedia.org/wiki/Netsplit?
14:42clojurebotdakrone maintains clj-http
14:42gtrakclojurebot: http links happen a lot
14:42clojurebotprofiles in clj-http is https://gist.github.com/1846759 an example of the profiles feature in Leiningen 2
14:45weavejesterHas anyone run across any problems using "lein cljsbuild auto" before?
14:57piranha(clojurescript) so if I did a (defrecord Some [] (func1 [this] ...) (func2 [this] (func1 this)), compiler spits warnings. What am I doing wrong here? Methods of record can't use other methods or what?
15:00emezeskeweavejester: Care to be more specific about your "lein cljsbuild auto" question?
15:00muhootechnomancy: thanks for pointing me to nrepl.el. it is fully integrated into my world now. also, nix.
15:00llasrampbostrom_: For exactly what you've got, I believe the "do not want" case can never happen, but you could get e.g. "x 1, x 2, y 2 y 2"
15:01technomancyyay!
15:01weavejesteremezeske: It compiles once, but not any other times. Hm… actually it looks like it can't find Clojurescript.
15:01emezeskeweavejester: That sounds weird
15:02weavejesteremezeske: Hm, it's a problem with domina's dependencies
15:02weavejesterDomina beta4 looks like it has a bad clojurescript dependency
15:02emezeskeweavejester: I see "goog-jar" in domina's deps. That's a sure-fire path to disaster
15:03emezeskeweavejester: Also what you said!
15:03weavejesterWhat does everyone else use for dom manipulation and events in Clojurescript?
15:03ibdknoxweavejester: jayq ;)
15:03pbostrom_I use jQuery
15:03emezeskeI use jayq.
15:03llasrampbostrom_: (that is, the agent dispatches done w/in the transaction will always be ordered wrt each other, but not necessarily wrt to dispatches from other transactions. But since x and y are only incremented and dispatch execution on the agent is serialized, you'll never "travel back in time" and get an old value from the ref deref)
15:04nkkarthikhow does clojurescript compare to parenscript... or are they apples and oranges?
15:04weavejesterjayq it is, then :) - I already have jquery included anyway
15:04muhoowhat are you using for gui libraries in clojurescript? jui stuff, or the google closure widgets?
15:04weavejesternkkarthik: Apples and oranges, really...
15:05emezeskeI would *love* to use a pure cljs DOM manipulation library, but practicality wins out for me, at least with the current state of things
15:06nkkarthikweavejester: hmm... no escaping the jvm overhead, huh :) thanks
15:06weavejesternkkarthik: As far as I know, anyway. My knowledge of parenscript is sketchy, but as far as I know it doesn't do the same transformations as Clojurescript. Clojurescript is a language that compiles into JS; parenscript is a way of representing JS with S-expressions.
15:06weavejesternkkarthik: That's my understanding, but it might be wrong. I haven't looked at parenscript in huge detail.
15:08nkkarthikweavejester: ah ok... guess I will just give a quick shot at it (and not more) then
15:08ibdknoxemezeske: I'm not sure it'll ever be practical to have a pure cljs dom manip library
15:09ibdknoxemezeske: just like in JVM clojure it doesn't make sense for us to write a webserver from scratch
15:09emezeskeibdknox: I guess I didn't mean pure as in "only cljs", just pure as in "designed for cljs"
15:09emezeskeibdknox: I don't care if there's JS under the covers
15:09ThatOneGuybetter to lean on tried and tested Java bytecode
15:09ibdknoxemezeske: ah, I fully agree with you then :)
15:09emezeskeibdknox: "pure" was probably not the right word
15:10ThatOneGuyI think he means like a more idiomatic clojure wrapper on top of a JS Dom manip lib
15:10ibdknoxit'll come, CLJS is still hard for people
15:10emezeskeThatOneGuy: I don't mean that exactly; I want something that is *not* a wrapper
15:10ibdknoxlots of things need to happen for it to get wider adoption
15:10emezeskeThatOneGuy: If there's JS code involved, it's just performance optimizations for an otherwise all-cljs library
15:10emezeskeibdknox: Sooo many things
15:11ibdknoxemezeske: I'm trying to work on one of em ;)
15:11emezeskeibdknox: :)
15:11ThatOneGuywhy not wrap an existing library?
15:11emezeskeibdknox: I think source maps are huge, but unfortunately (fortunately?) I have gotten so used to debugging the compiled JS that I don't need them anymore
15:11emezeskeibdknox: I think that might be why they don't get built
15:12ibdknoxemezeske: someone will
15:12emezeskeibdknox: I know there are a couple people on it
15:12ibdknoxemezeske: we need them, even if you are used to it at this point
15:12ibdknoxit'd still be faster
15:12emezeskeibdknox: Yeah, I really really want them
15:12ibdknoxoh damn
15:12emezeskeibdknox: But not quiiiiite badly enough to do it myself
15:12ibdknoxI forgot to bring up analyzer and column stuff on the dev list
15:13ibdknoxemezeske: haha inertia's a bitch ;)
15:13emezeskeibdknox: aye.
15:14emezeskeThatOneGuy: Well, I don't care if this theoretical library uses some goog.dom tools under the covers or something
15:14emezeskeThatOneGuy: I just think that cljs could lend itself to a new way of dealing with the DOM that hasn't been explored in other languages
15:14emezeskeThatOneGuy: So just writing a thin wrapper for an existing JS lib will not take advantage of things unique to cljs
15:14ThatOneGuyI see
15:15uvtcHi #clojure. I was just looking at https://github.com/yogthos/yuggoth/blob/master/src/yuggoth/models/db.clj#L29 . How does this work? It seems to me that
15:15ThatOneGuyyeah I guess so. Well you could use really low level tools to manipulate the dom and build up the abstraction in cljs.
15:15uvtc`res` would be undefined.
15:16emezeskeThatOneGuy: I guess I really don't care how it's implemented, I just object to more "wrappers"
15:17hiredmanuvtc: with-query-results is a macro
15:17emezeskeThatOneGuy: jayq is a wrapper, and it's super practical, but when you use it you are basically just using JS
15:17hiredmanuvtc: it binds the results of the query to res
15:17hiredman(ind the body)
15:17uvtchiredman: Ah. Thank you. Will go look at the docs for with-query-results.
15:18ThatOneGuywell a good wrapper leverages the underlying system into a process that is more idiomatic to the host language
15:19emezeskeI guess it's just a nit of terminology; to me a wrapper only "idiomizes" things in a very very basic way, if at all
15:19emezeskeE.g. a wrapper is close to a 1:1 mapping
15:19emezeskeBut I suppose the definition of "wrapper" is open
15:20ThatOneGuyYeah I think it is a very broad term in CS. cause you could think of korma as a wrapper because it wrapper SQL scripts into idiomatic clojure
15:21ThatOneGuywraps*
15:22acheng(love the meat-flapping sci fi short story)
15:23emezeskeacheng: They're made of MEAT!
15:24hiredmanwe just need a big route! macro that wiresup events and dom "I want events from X to go to Y" and "I want dom element A to be a child of dom element B"
15:24ThatOneGuyrapper can be applied in the same way ;P
15:25stuartsierraHey everyone, let's play "name that function"!
15:26stuartsierraI need a name for a function that will 1) scan source code directories for files that have changed, 2) unload all the namespaces which have changed, and 3) reload those namespaces.
15:27uvtchiredman: Ah, I see; it's a "with-something-something", which usually means that it's going to set up something for you, then and then close it up once you leave the scope of the "with-".
15:27ThatOneGuyI would break that up into three functions
15:28uvtchiredman: Got distracted a little there, looking up acheng 's "made of meat" sci fi clip. :)
15:29piranhacan somebody please tell me why this logs false on (satisfies? Map (google/make)): https://github.com/piranha/cj-locations/blob/master/src/google.cljs#L9
15:29eggsbywhat's the easiest way to spit out a list of similar clojure maps as a csv?
15:30nDuffamalloy: Where's that from? (My significant other thinks cannibalism is hilarious)
15:30emezeskeamalloy: Your shirt lies! I know you're at least half machine.
15:30stuartsierraThatOneGuy: it already is 3 functions. I want a short, easy-to-type name for the whole process.
15:31amalloyhttp://www.topatoco.com/merchant.mvc?Screen=PROD&amp;Store_Code=TO&amp;Product_Code=QW-MEAT&amp;Category_Code=QW-SHIRTS
15:31piranhastuartsierra: (reload-changes)? :)
15:31arohnerreload-modified-files
15:32ThatOneGuyI would cycle the scanning of directories as a daemon that would signal a reload of the namespace
15:32ThatOneGuybrb lunch
15:33llasramOOC, how does one reload just changed namespaces? Don't other namespaces still have references to the old namespace?
15:33stuartsierraI'm aiming for a single word. Thinking of "ready" as in "ready your troops."
15:33stuartsierrallasram: One builds a DAG of namespace dependencies!
15:33llasramAh! Of course :-)
15:33stuartsierraI've already done that.
15:33emezeskestuartsierra: Just one word? (watch)
15:34stuartsierraemezeske: I'd use 'watch' if it were an on-going process, but it's just a single step for now.
15:34emezeskestuartsierra: Oh!
15:35emezeskeIn that case, I nominate (freshen)
15:36stuartsierraemezeske: not bad
15:36jcrossley3stuartsierra: sweep?
15:36llasram(rerequire)
15:37S11001001llasram: worried about macro expansions?
15:38hiredman"bad-idea-that-is-going-to-break-someone's-protocol-and-defrecord-code"
15:41jcrossley3refresh
15:43stuartsierrahiredman: I'm dealing with that. You still have to be careful.
15:43stuartsierrajcrossley3: 'refresh' is good
15:45hiredmanstuartsierra: how? by scaning code for "defprotocol" and "defrecord" ?
15:45stuartsierraNo, but with the dependency graph I can be sure that 'defprotocols' are reloaded before any 'defrecords' that implement them. You still have to be careful not to hang on to old instances.
15:46hiredmanI suppose you can call that dealing with it if you like
15:47stuartsierraThe problem with reloading protocols gets into how the JVM loads dynamically-generated classes. That's beyond the reach of a library like this.
15:48hiredman*shrug*
15:49FrozenlockIs there a function to transform a map to a vector?
15:49hiredmanwe already get people wandering in here wondering why their code breaks based on the various reloading middle ware for ring
15:49llasramFrozenlock: have you tried `vec`? :-)
15:50stuartsierrahiredman: That's one reason I'm working on this. I want to document and encourage development patterns which are reload-friendly.
15:50Frozenlockllasram: Oh.. no... I was under the impression that vec and [] where the same thing.
15:51amalloyFrozenlock: vector is []
15:52stuartsierraThe naive approach (just reload files on each request) doesn't work.
15:53stuartsierraBy the way, I'm going to go with' refresh'. Thanks, jcrossley3.
16:00jcrossley3stuartsierra: welcome :)
16:00wilfredhI'm looking for a way of reading the properties set in project.clj. Specifically, I'd like to pull out the version passed into defproject. Any pointers?
16:01muhoowhat purpose would the construct @(promise) serve, at the end of a quoted form?
16:01S11001001wilfredh: there is a java system prop that lein sets for version
16:03amalloymuhoo: that sounds like "block forever"
16:03xeqiwilfredh: there was a recent discussion about that on the mailing list - https://groups.google.com/forum/?fromgroups#!topic/leiningen/7G24ifiYvOA
16:03RaynesS11001001: That's if you run the code with lein.
16:04S11001001good luck to anyone trying to pick up project.clj contents without project.clj present
16:04clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
16:04S11001001anyone anyone anyone
16:04Rayneswilfredh, xeqi: What I do is have a hook in project.clj that spits the version out into a file whenever I run… something.
16:04pbostromllasram:, stuartsierra:, I think you both have sufficiently answered my question, but here is what I really intended: https://gist.github.com/3250162 So I don't think I can guarantee against the "do not want" case. I'm wondering what would be a good way to tackle this problem. I think I want some sort of agent-like queue ref of side effect functions that gets updated inside the dosync, but I'm not sure
16:05RaynesI did that because I needed to get the version in a war file, so I spit it into resources.
16:06wilfredhS11001001, xeqi, Raynes: thanks :)
16:09S11001001you can also play little games with the aot
16:21duck11231Raynes: do you have that code somewhere? I have a need for that as well
16:21Raynesduck11231: https://github.com/geni/geni-gedcom project.clj
16:21duck11231nice, thanks
16:23meliponehello
16:24achengmelipone!
16:25meliponeI am trying to read an object serialized by a java program but I get a classcastexception error. Any idea?
16:25achengboth ends use the same compiled version?
16:26meliponeacheng: oh, how can I check that?
16:27achengsorry. i only have questions.
16:29duck11231melipone: try cleaning
16:30meliponeI am using clojure 1.3 on a 64-bit machine. Is there a problem calling a java program compiled for 64-bit within clojure?
16:32meliponeduck11231: cleaning?
16:32achengmelipone: lein clean ?
16:32meliponeacheng: thanks! TGIF
16:32duck11231lein clean. It might not do anything, but can't really hurt
16:33amalloyi think it hurts technomancy's feelings anytime you run lein clean
16:34duck11231It's nice how well it works without needing to clean, but I still run into issues every now and then where it helps
16:34achengmelipone: maybe also clean and compile the java program and regenerate the serialized thing? (start with a clean slate)
16:34duck11231usually only whaen I'm moving code around
16:36llasrampbostrom: Totally an abuse of agents, but: https://gist.github.com/3251293
16:42achengmelipone: if the clojure side depends on the java program, i'd clean/compile the java side first
16:42pbostromllasram: thanks, that looks like what I want
16:45meliponeacheng: my java program is actually in a jar that I load from my local mvn repository.
16:46meliponeacheng: the serialized object is from another program which might be a 32-bit program
16:47meliponeacheng: I am able to read this serialized object fine though outside of clojure by this other 64-bit program
16:48meliponeacheng: it's just when I call the 64-bit java program within clojure that it has problem reading the object
16:49hiredmanmelipone: serialized in what sense?
16:49hiredmanjvm serialized?
16:49meliponehiredman: yes
16:49hiredmanand what error are you seeing?
16:50meliponehiredman: parse.classify=> (new EvaluateModel learner ds) ClassCastException cannot assign instance of java.util.ArrayList to field weka.core.Attribute.m_Values of type weka.core.FastVector in instance of weka.core.Attribute java.io.ObjectStreamClass$FieldReflector.setObjFieldValues (ObjectStreamClass.java:2063)
16:50hiredmanmelipone: there is no such thing as compiling a jvm program for 64bit, java bytecode is java bytecode, and the jvm is the jvm
16:51hiredmanmelipone: that is a type error
16:51meliponehiredman: here learner is a filename and EvaluateModel should read this object from the filename
16:51meliponehiredman: why is javac different then?
16:52hiredmanmelipone: most likely you serialized a type, then changed the type, and are trying to deserialize it
16:52hiredmanyou have different versions of the type
16:52hiredmanso in one version a field is one type, and in another, another type
16:52meliponehiredman: hmmmm... okay
16:53llasramUsing different version of weka on the generating and consuming ends?
16:53hiredmanyeah
16:53meliponebingo!
16:54meliponeokay, thanks, and have a nice weekend!
16:56SegFault1X|work2Is Ring compatible with websockets?
16:56hiredmanring is for http, websockets are not http, so...
16:57SegFault1X|work2Oh, well that answers that.
16:57duck11231aleph supports websockets, but that's not quite the same
16:59dgrnbrghi clojurians
17:01muhoohas anyone found/made a hack to download infoq clojure presentations so they can be watched offline?
17:01muhoothe slides i got, it's the video i'd like to have
17:01llasramoff... line. What is that?
17:02dgrnbrgI am using lein at work w/ custom plugins that are deployed from an internal maven repo. I have been putting that repo & the plugins into everyone's profile.clj, but that causes the scary message that the build isn't repeatable due to the repository being in the profiles.clj. Is there a best practice for deploying plugins in an organization? Or a way to suppress lein's warnings?
17:03emezeskedgrnbrg: Plugins that are just for developer productivity make sense in user profiles. If the plugins affect the build, though, they should be in the project.clj.
17:04dgrnbrgemezeske: The plugins are for developer productivity -- a bunch of lein templates to prepopulate common modules we make, and to do various integration tasks outside of the project
17:04dgrnbrgthe lein templates are the biggest part, though
17:06emezeskeI see, so I guess the problem is just the warning about maven repos in user configs
17:06dgrnbrgemezeske: exactly--is there a solution to that?
17:07dgrnbrgor a way to add a repository that's only used for searching plugins?
17:07muhoo*cough* lein local-repo? *cough*
17:07emezeskeI don't know.
17:08dgrnbrgmuhoo: that doesn't really fit my needs
17:09llasramHmm, I think the lein warning is overly-broad
17:09llasramIt gives that warning if any user profile contains a repository, even a profile which is never applied to the build
17:09dgrnbrgmaybe i'll write a feature for lein to stop that warning by giving it a special plugins-only repo
17:09dgrnbrglike :plugin-repositories ...
17:10llasramWell, that still makes it unrepeatable if the build depends on the plugin :-)
17:11dgrnbrgyeah, but deal ;)
17:11dgrnbrghow else can i distribute templates?
17:11llasramNo, no. What I'm saying is that I think you're doing it right right now
17:12dgrnbrgah
17:12dgrnbrgWell I'll stick with it then
17:12dgrnbrgis there a way to make the plugins use the latest version?
17:12dgrnbrgin the profiles.clj, so that the users don't need to keep changing their profiles.clj?
17:14llasramI think that lein should only complain when you [something] with a user profile with a repository. The [something] part is hard though...
17:15technomancyplugin-repositories seems reasonable
17:15llasramdgrnbrg: You can use a version range http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
17:16llasramdgrnbrg: I understand they're generally bad news for maven dependency resolution, but I think it'd be okay for plugins, isolated in their own profile
17:17dgrnbrgi'm not isolating the plugins, but i have to work with a lot of non-devs using clojure
17:17dgrnbrgso they'll probably be in :user
17:18dgrnbrgso I can put the coordinates as [my-plugin "[1.0.0,)"]?
17:18dgrnbrgi never knew that the convention of using "1.0.0" was a soft dependency
17:19llasramI believe that will work. And yeah, where else is saying what looks like "use exactly this version" considered a "soft" dependency? :-)
17:20dgrnbrgllasram: in that link you pointed out
17:20dgrnbrgit says "[1.0.0]" is a hard dependency, but "1.0.0" is just a recomendation
17:20technomancydgrnbrg: feel free to open an issue for :plugin-repositories if you like
17:20llasramdgrnbrg: Right. I was just saying it's very unexpected vs. the way everything else I've seen works
17:21dgrnbrgllasram: yeah
17:21dgrnbrgtechnomancy: will do :)
17:21pbostromSegFault1X|work2: with aleph you can define a server with both ring HTTP handlers and websocket handlers, so your websocket handler can access the same cookies and sessions as the HTTP handlers
17:23hiredmantechnomancy: I want to be able to open urls at point from clojure-mode
17:24ThatOneGuyclj-http
17:25duck1123hiredman: aside from something like M-x browse-url-at-point ?
17:26hiredmanoh wait, no wonder that doesn't work
17:26hiredmanthis emacs isn't even on this machine
17:26technomancyhaha
17:26duck1123lol
17:26hiredmanthe dream dies
17:27technomancyemacsclient over reverse SSH tunnel
17:27hiredmanhave to write an sqs client in emacs, and have it send links over sqs to my laptop
17:27duck1123use mozrepl and browse-url-gnome-moz
17:27technomancyalso: asciiart QRcodes
17:27technomancythen hold a mirror in front of your screen
17:27hiredmanduck1123: why would I have gnome, or anythign like X?
17:27hiredmantechnomancy: haha
17:28technomancyor wear mirrorshades and have the webcam read the qrcode in the reflection
17:28llasramhiredman: 100% text-only console?
17:28hiredmanI could do mirrorshades
17:29hiredmanllasram: on the headless machine running my vm(s) that I ssh in to? of course
17:29llasramoic
17:29hiredmanheadless machine/foot rest
17:32llasramActually, now that I think about it, Conkeror works that way, and I have no idea how
17:33stankleyHey guys, I've got a question about how to best accumulate a value
17:33gfrederickswith reduce!
17:33stankleyI'm reading from a serial port, and with every character a function gets called
17:33stankleyI can only set the function to be called on a call
17:33llasramI do have Conkeror installed on both machines involved, but when I'm ssh+emacsclient'd into the session on one machine, browse-url-at-point causes my local browser to open the URL. Huh
17:34stankleyShould I just use a mutable data structure?
17:34stankleyI want to read until a newline, then call a function on the accumulated value
17:34stankleyCompletely new to Clojure, but want to solve the problem the Clojure Way
17:36stankleyI tried using a transient, and calling a function with accumulated value upon newline
17:36stankleyBut no idea if that's the right direction or not
17:36hiredmandefinitely do not use a transient
17:36stankleyThat's what I figured
17:36stankleyBecause you can only realize value once per variable name
17:37amalloy(f (take-while (complement #{\newline}) (repeatedly read-from-serial-port)))?
17:37hiredmanamalloy: it soulds like he doesn't have a "read-from-serial-port", he can just say "when there is input, run x"
17:38hiredmanbut the latter combined with a queue could be turned in to the former
17:38amalloyoh, you're right
17:38stankleyexactly, all I get is a function called on each character read
17:38stankleyso I just pass an anonymous function to be called on each character
17:39stankleyThanks for the help by the way, amalloy
17:39amalloyyeah, sounds like a LinkedBlockingQueue or something. put characters on from your callback, and create a sequence reading them
17:39llasramLinkedBlockingQueue? callback pushes characters in, lazy-seq polling them out?
17:39llasramheh,
17:40hiredmanyou could possibly even make it a transferqueue http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TransferQueue.html
17:41amalloyhm. what for?
17:42hiredmandunno, but they are newish and someone should kick the tires
17:42hiredmanhttp://tech.puredanger.com/2009/02/28/java-7-transferqueue/
17:42stankleyhiredman: lol
17:45stankleyllasram: Cool, sounds like that's the strategy I'm going to go with, thanks.
18:02antares_cemerick: JFYI, I'd be happy to review the draft ;)
18:03akhudekare there plans to build out the clojure.browser namespaces?
18:04gerunddevcemerick: Am I missing search support in clutch?
18:04gerunddevcemerick: Would it be a bad idea to use get-view* directly and provide my own path segement with _search instead of _view?
18:08gerunddevCouchDB search might be Cloudant specific, but perhaps someone else has run into this with clutch... I'm trying to hit _design/mydesign/_search/mysearch?q=text
18:09polypus~ping
18:09clojurebotPONG!
18:09gerunddevClutch's get-view function builds it as _design/mydesign/_view/myview, but has a private function called get-view* which takes a path segment param I could build myself
18:10gerunddevSo I'm currently using #'com.ashafa.clutch/get-view*
18:12gerunddevThe Java voice in my head is saying "They made it private for a reason!" and the Python voice is saying "What's private?" :)
18:13treehugwhy is add-classpath deprecated and what should I use instead to load jar files at "runtime"?
18:13muhoowhat's the workflow to test a lein plugin? do i really have to build the plugin jar, install it, then run lein? or is there another way?
18:15akhudekwhoa
18:15akhudekthe goog.editor.SeamlessField produces some unexpected html
18:16akhudekhitting enter in a line of text seems to produce divs, not br tags
18:17hyperboreeanhi guys, I have a lein project in which carmine is specified as a dependency - I fail to import the taoensso/carmine into the repl, can anyone help? (require '[taoensso/carmine :As r])
18:17muhoohyperboreean: try :as instead of :As ?
18:18hyperboreeanmuhoo: that was a typo, sorry, I did try with :as
18:18muhoohyperboreean: make sure the dependency is in your project.clj ?
18:19hyperboreeanmuhoo: [com.taoensso/carmine "0.9.3"] this is what I have in my dependencies entries
18:19hyperboreeanI also ran lein deps
18:19muhootry taonesso.carmine in your require, no /'s
18:19technomancytreehug: pomegranate is the kosher way to do it, but in general it's Fraught with Peril
18:20amalloysomeone squat that library name on clojars
18:21hyperboreeanmuhoo: CompilerException java.lang.RuntimeException: No such namespace: taoensso, compiling:(NO_SOURCE_PATH:1) :(
18:22treehugtechnomancy: that project looks perfect for the job at hand, what things can go wrong though?
18:22Raynesmuhoo: Might help if somebody actually knew the namespace of the library, I think.
18:22RaynesOh, that is the actual namespace.
18:23technomancytreehug: depends on the context. if it's just going to be run via Leiningen or an uberjar you'll be fine. you can run into issues if it's embedded in another context like tomcat or an IDE IIUC
18:23Raynes(require '[taoensso.carmine :as r])
18:23hyperboreeanRaynes: that got me thinking, it's actually . instead of /
18:23hyperboreeanthanks!
18:23RaynesOr in ns (:require [taoensso.carmine :as r])
18:23treehugah ok. thanks
18:23hyperboreeanmuhoo: thank you too
18:35muhoooh cool, i got it .lein-classpath
19:12ToxicFrogThis is completely bizarre
19:13ToxicFrogxml/parse takes several minutes to process even small files, but never goes above 5% CPU usage or so
19:19gtrakhrm... where do I put a web.xml for lein-ring to pick up, that I can also programmically pick up with code to start a jetty from -main?
19:21weavejestergtrak: In your resources, perhaps? What were you planning on doing with your web.xml?
19:21gtrakit's a hybrid of jax-rs servlets and ring handlers
19:22gtrakI was also considering a way to create a ring handler that can delegate to servlets, but that looks hard
19:25weavejestergtrak: Ah, I see
19:26ToxicFrogThis is painful :( I'm going to try 1.3 and see if it works there.
19:30ToxicFrogNope, still broken in 1.3
19:30ToxicFrogWhat the hell is going on here
19:31gtrakToxicFrog: tried profiling?
19:31ToxicFroggtrak: not yet; what's the recommended tool?
19:32ToxicFrogAll I can think is that it must be spending a huge amount of time in iowait, but the file it's loading is tiny
19:32gtrakI use jvisualvm
19:32gtrakit comes with your jdk
19:36amalloyare you using clojure.xml? i wouldn't recommend it
19:37ToxicFrogamalloy: I am
19:37ToxicFrogOr trying to
19:37francisI'
19:38amalloyclojure.data.xml has got to be a better option, at the very least
19:38ToxicFrogIt's kind of hard when it takes several minutes (at effectively no CPU usage, so what the hell is it doing?) to parse even a trivial test file
19:38ivandownloading trojaned DTDs
19:39ToxicFroggtrak: it may come with some JVMs but it apparently doesn't come with this one :/
19:39amalloyclojure.xml is just so old and crusty. most of the file is from 2008
19:39amalloya few lines have been updated to 2009 or 2010
19:39gtrakToxicFrog: ah, hrm, maybe just oracle JDK, but you can download the program anyway
19:40francisI'm working on a 4clojure problem, however I'm rather confused as to a question. Specifically http://www.4clojure.com/problem/137 test case 5
19:40ToxicFroggtrak: yeah, I only have openjdk installed here
19:41francisThe test case says that the answer for converting to base 42 is a sequence of integers. However, my understanding it that base 42 uses chars to represent #s
19:41gtrakToxicFrog: looks like the site is being DoS'd :-)
19:42ToxicFrogfrancis: it might expect a sequence of numbers in the 0..41 range rather than trying to come up with 32 chars to supplement the digits
19:43amalloyyou're conflating number bases with textual representation
19:44francisamalloy & ToxicFrog: thanks, I belive I know what to do now
19:45ToxicFrogamalloy: is data.xml part of core now, or is it a 3PL?
19:45amalloyno; no
19:46amalloyit's part of contrib
19:46ToxicFrogAah
19:46ToxicFrog...where?
19:47ToxicFrogAlso, is it this? http://clojure.github.com/data.xml/
19:52gtrakweavejester: I think I figured it out, jetty has a setResourceBase thing that can deal with classpath resources apparently
19:53gtrakand setDescriptor points to the web.xml file
19:53ToxicFrogreal 2m29.983s user 0m7.452s sys 0m0.472s
19:53ToxicFrogwhat
19:54gtrakToxicFrog: try the profiler or sampler tab, sampler's faster
19:59amalloyi don't know what you're doing, ToxicFrog, but for me a simple xml/parse on a tiny file is instantaneous
20:00amalloyyou probably have something unrelated in your benchmark causing problems
20:00hiredmanamalloy: mostly likely calling it on string
20:00amalloyyes, he says he is
20:00hiredmanhe should read the docstring for parse then
20:01amalloyokay...
20:02hiredmanxml/parse doesn't take a string of xml, it takes a string uri or inputstream
20:02amalloyindeed, if you've been following along he's passing it a uri
20:02amalloyand he's complaining that it's very slow
20:02hiredmanamalloy: I haven't been following along
20:05gtrakhrm, why does lein's resources-path not apply in dev?
20:06gtraki think src/main/resources works from tests in maven
20:07technomancy:resource-paths
20:07gtrakah jeez
20:07gtrakwait, but dev-resources-path seems to work
20:07ToxicFrogWell that was fun
20:08ToxicFrogAnd by "fun" I mean "the profiler at all of my memory and crippled my laptop"
20:08gtrakToxicFrog: :-)
20:08gtraksampler is faster
20:08technomancygtrak: on lein1?
20:08gtrakyea
20:08ToxicFroggtrak: I didn't even get to the point of getting to choose between those
20:08gtrakoh wow
20:09amalloyToxicFrog: it sounds like every program you run is very slow. you should get your computer looked at, not clojure.xml
20:10ToxicFrogamalloy: ...how the hell do you arrive at that conclusion?
20:14gtraktechnomancy: i'm looking at my classpath system property and it looks like it should work, so i guess not a lein problem
20:15gtrakoh damn, it sees it now...
20:17gtrakToxicFrog: well it should start up at least, maybe you were thrashing swap to begin with
20:18ToxicFroggtrak: yeah, I mean, it started, it did the calibration, and then in the process of finding running JVM apps it ran into swap and everything went to shit
20:18emezeskeToxicFrog: How much RAM do you have, out of curiousity?
20:19ToxicFrogbetween lein, IDEA, chrome, and a bunch of other stuff I must have been pushing swap to begin with
20:19ToxicFrogemezeske: 3GB.
20:19gtrak! not enough these days
20:19emezeskeThat is a bit on the low side for a dev machine
20:19ToxicFrogYeah
20:19gtrak8GB is like $20
20:19casion3gb is on the 'decade ago' scale for a dev machine
20:20ToxicFroggtrak: this laptop tops out at 4GB
20:20gtrakah
20:20ToxicFrogSo the cost to upgrade is not "the cost of two 4GB SODIMMs" but "the cost of a new laptop", which is out of my budget right now
20:20technomancy33% boost wouldn't hurt though
20:21gtrakif it's 3GB, it's probably also windows 32-bit
20:21ToxicFrog64bit linux, actually.
20:21gtrakoh ok
20:21technomancyI don't use an IDE though
20:22gtrakeclipse is relatively a hog on my 4GB c2d laptop
20:22ToxicFrogtechnomancy: yeah, I just have to weigh the cost (and pain in the ass, since the second SODIMM slot requires disassembling most of the laptop to access) of that against the fact that once I graduate and am employed I will probably be getting a new laptop anyways
20:22emezeskeIf you are using a modern operating system, you are using all of your RAM all the time
20:22gtrakhow is it even possible
20:23ToxicFrogOk, so the jvisualvm profiler is unhelpful; it reports the program as taking ~3.5s to execute
20:23emezeskeEven if only part of it is being used by programs you're running, the kernel is caching the filesystem there
20:23ToxicFrogemezeske: yes, I'm pretty sure everyone here is well aware of the block cache and means "used by applications" for "used".
20:23gtrakMem: 8102524k total, 7459824k used, 642700k free, 203932k buffers; Swap: 8242284k total, 172328k used, 8069956k free, 3075332k cached
20:23gtrakeffing silly
20:23technomancyhttp://www.linuxatemyram.com/
20:23emezeskeToxicFrog: I'm just saying, for people that are only using a small amount of ram, they are still getting a benefit from having lots of it
20:24emezeskeToxicFrog: "using"
20:24hiredmanof the top 10 processes ordered by memory, 8 are java processes and 1 is firefox
20:24ToxicFroggtrak: ok, so of that 7.5GB "in use", 3GB is the block cache and 200MB is buffers
20:24ToxicFrogSo you're at a bit over 4GB
20:24hiredman(the last is kernel_task)
20:24ToxicFrogI wonder if strace will be any more helpful here
20:24gtrakahh ok
20:24ToxicFroglike maybe it's doing a separate read() for each byte in the file or something else completely insane
20:25gtrakif it's low CPU it sounds like an IO blocking, yea
20:25gtrakI think context-switches still show up as cpu usage
20:25ToxicFrogYeah, I just have no idea what it could possibly be
20:25emezeskeToxicFrog: How big is this xml file?
20:25ToxicFrogIt's a single-threaded program, the only IO it does explicitly is reading a single 30k XML file
20:26emezeskeHmmph.. At 30k, it doesn't even seem like something ridiculous like a read() per byte would cause that bad of a slowdown
20:26emezeskeCrazy.
20:28ThatOneGuysmart move
20:29gtrakit was chrome, really, closing eclipse got me down to 6.9, with chrome got me down to 4439184k used
20:38casionanyone know of an example of loading a wav file using clojure?
20:39gtrakcasion: depending on what you're doing, you might want to check out overtone
20:39casiongtrak: I use supercollider directly daily
20:39gtrakawesome
20:39casionI'm more curious about it as an exercise in clojure
20:40casionsince I'm still learning
20:40riley526Would anyone recommend Friend (https://github.com/cemerick/friend) as a good authentication library for a Clojure noob? Other suggestions?
20:40gtrakcasion: I've played briefly with the java sound APIs, I find them quite painful
20:40gtrakbut check out this: http://www.jsresources.org/examples/
20:40casionI've managed to open the file and parse the header, but reading sample data correctly eludes me
20:41hiredmanriley526: I hear friend is good, but if you actually try and use it, the examples given in the readme, etc, don't work
20:41hiredmanso I dunno
20:41gtrakcasion: that's all I got for you, unfortunately
20:41gtrakhave a good weekend guys
20:41emezeskeriley526: I have used friend successfully, for what it's worth
20:42hiredmanlike, if you want to use friend, you have to crack open the source and figure out "oh this option here isn't being given a default value correctly" and work that all out
20:42cemerickriley526: Yeah, my bad on the error in the current docs. If you give it a roll and hit a snag, you can fall back to looking at the example. https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L100
20:42casiongtrak: thanks :)
20:43riley526cemerick: Oh, perfect. I'll try it out and see what happens. Thanks.
20:49ToxicFrogFound the problem!
20:49ToxicFroggtrak, emezeske: that long delay is it downloading the DTD.
20:49gtrakah.....
20:49gtraksilly validation
20:49gtrakyou can probably turn that off
20:50emezeskeToxicFrog: awesome . O_o
20:51ToxicFrogemezeske: I'm on slow internet here and the W3C's servers are pretty awful to begin with
20:53ToxicFroggtrak: AFAICT, yes, but only by ignoring clojure.xml entirely and using the Java XML API directly (and setting half a dozen poorly documented parser behaviour flags just right)
20:55ToxicFrogdeath to xml
20:57emezeskedeath to xml!
21:00ToxicFrogreal 0m3.905s
21:00ToxicFrogThat's a lot more acceptable