#clojure logs

2014-10-09

00:00Jesterman81thanks for the help guys, appreciate it
00:00awwaiidoh even fancier
00:01justin_smith,(map (juxt :foo :bar) [{:foo "foo" :bar "dummy" :axe "blood"} {:foo "baz" :bar "dummy"}]) ; if you want two specific keys
00:01clojurebot(["foo" "dummy"] ["baz" "dummy"])
00:57kenrestivothere's also select-keys
00:57kenrestivooic, backscroll
01:54ddellacostakind of a Java question, but: how do I add something to the java.library.path (in Mac OS X)? I'm trying LD_LIBRARY_PATH in my bashrc but it's not working. Can I pass it in directly via lein?
02:02ddellacostanevermind, figured it out, I guess that's what jvm-opts is for
02:11xinixwho knows Storm by clojure?
02:13xinixa real-time streaming style computation framework...who has its source code?
02:14Rhainurxinix: ???
02:14lazybotRhainur: How could that be wrong?
02:14Rhainurxinix: it's open source: https://github.com/apache/storm
02:32cflemingSo I have a question about circular namespace dependencies in Clojure
02:32cflemingI thought they were actually illegal, but it seems like this might not be the case.
02:33cflemingztellman's manifold library has a bad case of them, by using require in the middle of a file.
03:18xsynI have a stupid question
03:18xsynif I have a function which has a datalog query inside it
03:18xsynand the query is (q '[:find]… )
03:19xsynand I want to pas the :where clause of the query a value
03:19xsynhow do I get it to eval that value?
03:19xsynso that the query sees it?
03:19xsyncurrently I'm getting: Unable to resolve symbol: id in this context
03:55xsynNevermind, found my solution
03:55xsynmy problem was that I was trying to use datalog to query a csv
03:57ddellacosta(Java interop question:) er, how do I call a static method on a nested class?
03:57amalloyddellacosta: use the right name for the nested class
03:57amalloyit's not Foo/Bar or Foo.Bar, it's Foo$Bar
03:58ddellacostaamalloy: yeah, I've got that far, but this doesn't seem to be working for me: (.staticMethod Foo$Bar) <- is that wrong?
03:58amalloythat's not how you call static methods on any class
03:58ddellacostaamalloy: yeah, so, I'm wholly ignorant of that I guess. :-(
03:59amalloy(Foo$Bar/staticMethod)
03:59ddellacostaamalloy: ah, right, thanks. Found it here simultaneously: http://clojure.org/java_interop
04:31yedidoes anyone use cljs on the client with a non-clj lang on the server? curious about people's experiences and common dev practices
04:38CookedGryphonis there a neat way to do a count with transducers? I'm mapping a function over a coll, and then want to count how many items now pass a predicate
04:38CookedGryphonpreviously I was doing a filter then counting the result, but it I shouldn't need to construct an intermediate sequence at all
04:39CookedGryphonI mean i could map (constantly 1) and then transduce +, but that feels a bit clunky too
05:05keedsyedi: fynder.io use cljs with Haskell
05:55cflemingCan anyone point me to some information about &form & &env, in particular describing when they have to be explicitly passed, and when they should appear in argument lists?
05:57cflemingI understand that they have to be passed when calling a different arity of the same macro
05:58tickingDoes anybody know why the IAtom protocol of cljs is empty?
05:58Bronsacfleming: they should never be explicitly passed
05:59cflemingShould they ever appear in arg lists of defmacro? They appear in the arg list of defn, but that's an fn marked with ^:macro
05:59Bronsano they shouldn't, that's an implementation detail
05:59cflemingBronsa: According to this, you sometimes have to: http://stackoverflow.com/a/25569059/155368
06:00Bronsacfleming: that's a horrible thing to do
06:00Bronsacfleming: you're invoking the macro as a function there
06:00cflemingBronsa: It's not me - sadly as a tool developer I have to support people who do horrible things :-)
06:00cflemingBronsa: This is for arity checking in Cursive
06:00Bronsaone should do instead (defmacro x ([] `(x 1)) ([x] x))
06:01cflemingBronsa: defn has them explicitly in its arg list
06:01Bronsacfleming: that's because defn is implemented before defmacro
06:02cflemingBronsa: Right. I'm just trying to figure out the rule for arity checking - currently Cursive thinks defn accepts 3 args and a rest.
06:03cflemingBronsa: Neat trick in your alternative there, but I can't say it's intuitive.
06:03Bronsait's not a trick, it's the only way to do it right :)
06:04Bronsacfleming: eeeh, I disagree, you're saying it's more intuitive to expect a macro to work like a function inside its decl?
06:04cflemingWell, or use a helper function as suggested in that post - or just not have multi-arity macros :-)
06:05Bronsanote that in the stackoverflow example he's doing (macro &form &env a b) and expects a and b to be evaluated at call time
06:05cflemingI think the helper function is probably the clearest solution of all of them.
06:05Bronsame too
06:06Bronsacfleming: but it's not always feasable. see e.g. c.c/or or c.c/and
06:06cflemingI think I'm just going to filter out &form and &env from arg lists and calls for checking arity, and anyone who does anything crazy like let-binding something and then explicitly passing it will get what they deserve.
06:06Bronsaheh
06:07Bronsacfleming: how are you doing arity checking anyway? using :arglists?
06:07cflemingIf it weren't for defn I'd just ignore the whole edge case.
06:07Bronsaif so, good luck with that. people are overwriting :arglists, it's unreliable
06:07cflemingNo, I use the actual function arglists, so for defn it'll just be name & rest
06:07Bronsaah ok
06:08cflemingWhich is not very useful.
06:08cflemingYeah, I'd love to be able to rely on :arglists for more things (parameter info etc) but it's basically useless for my purposed.
06:08cflemingpurposes.
06:09cflemingThis arity checking is more useful for functions.
06:09cflemingI also have to ignore any calls with unquote-splicing
06:09cflemingLike (assoc ~map ~@kvs)
06:10Bronsayeah. I proposed to split :arglists into :arglists and :doc-arglists months ago so that :arglists can be used by tools/compilers safely but it never got attention from core.
06:10cflemingFortunately when I index I get both - it would be great to have it in the language.
06:10Bronsacfleming: ah I didn't realize you're analyzing the unexpanded code
06:11cflemingBronsa: Yeah, Cursive only works on source.
06:11cflemingBronsa: Which has its ups and downs, but mostly ups :-)
06:12cflemingBronsa: So I use :arglists when showing docs and so forth, and the actual arglists for this kind of thing.
06:13Bronsayeah that's the only sensible way to do it
06:13cflemingBronsa: I implemented a parsing framework for macros similar to seqex, so I'll potentially be able to use that to show more useful errors in the editor for forms that have an associated parser.
06:14Bronsain eastwood we are actually using :arglists, but there are issues when users overwrite the default :arglists
06:14cflemingEastwood parses source sometimes too, right?
06:15Bronsayes it does, but mostly relies on the expanded AST & runtime informations
06:15cflemingI'm actually planning to pillage Kibit and Eastwood for inspections in Cursive soon.
06:15Bronsaawesome
06:16Bronsacfleming: really good work with Cursive btw, I'm super impressed. I unfortunately don't use it myself as I've invested way too much time in emacs but I'll definitely be suggesting cursive to everyone who asks
06:16Bronsa(inc cfleming)
06:16lazybot⇒ 4
06:16cflemingI can do some interesting other ones too, like (if-let [x (something)] ...) - if x is never referred to I can offer to update it to (if (something) ...)
06:16cflemingThanks, I'm glad you like it!
06:17cflemingI'll be talking at the conj about the difference in approach between Cursive and practically everything else
06:17cflemingi.e. the pros and cons of using source
06:17cflemingIt allows some really nice functionality
06:17cflemingAnd means that everything just works with cljs
06:19cflemingI'll let you know when the Kibit/Eastwood stuff is in so you can take a look. One of the many nice things about using IntelliJ is that that's all real time in the editor, and the quickfixes are right there too.
06:20Bronsacool
06:21cflemingThey seem to have improved their indexes in v14 too, which allows them to do this sort of thing: http://blog.jetbrains.com/idea/2014/10/automatic-notnullnullablecontract-inference-in-intellij-idea-14/
06:21Guest_may I ask, as a new Clojure learner, dabbling in Light Table - what I benefit from Cursive?
06:22Guest_(would , not what)
06:22cflemingThe interesting thing there is that they have a global graph structure, but still show the results in real time - I don't know how they do that.
06:22Bronsamagic that Just Works™ :)
06:23cflemingThat means that I might be able to do some limited global type inference (which fns return seqs, for example) and provide useful warnings.
06:23cflemingBronsa: That's the idea :-)
06:23cflemingI'll be able to mark globally unused vars shortly.
06:24cflemingGuest_: Sure, it depends a bit what you're doing. Generally Cursive is very easy to set up and get going.
06:24cflemingGuest_: If you're doing CLJS LightTable still has a lot going for it in terms of ease of use.
06:25cflemingGuest_: But IMO Cursive has more functionality that you can grow into it as you learn more about it and get more used to Clojure.
06:27Guest_I see - have to try ... so I'm getting IntelliJ first and then more
06:27Guest_thanks for answering
06:27cflemingGuest_: Think of it as probably roughly equivalent power to Emacs but without a lot of the swearing :-)
06:27Guest_great
06:27cflemingIf you have problems, either hit me up here or on cursive@cursiveclojure.com
06:27Guest_I'm not going to learn emacs right now, I guess ...
06:28Guest_:-)
06:28cflemingIf you're just learning Clojure, I wouldn't recommend learning both at the same time, no.
06:28dysfunand of course emacs will ultimately be more extensible than cursive
06:28cflemingdysfun: Sure, no doubt.
06:28Guest_right now I'm in the "easy" section of 4clojure
06:28dysfunnot that i didn't have to work quite hard on some things
06:29Bronsadysfun: the question is if you really need all that extinsibility when coding
06:29cflemingdysfun: That said, there's a lot that Cursive can do that Emacs can't either - different pros and cons.
06:29dysfunof course. like everything.
06:29dysfunpersonally i use emacs because a) my fingers are hardwired b) IDEs just irrationally irritate me
06:30BronsaI mean, I've built emacs into my OS, but as for editing clojure I'm not sure clojure-mode + SLIME is much superior to Cursive at this point
06:30dysfunSLIME? nrepl-cider
06:30Bronsano thanks
06:30dysfunheh, i patched that
06:30dysfuni use ac-nrepl-compliment sometimes too
06:31BronsaI've tried switching from slime to nrepl/cider at least 5 differnt times, everytime I went back crying.
06:31cflemingYeah, there's still a bunch of Emacs functionality I'm catching up with, but it's all fairly doable. But there are a lot of things that an AST and global indexes allow that are really cool.
06:32dysfuni was never a SLIME user and i gravitated towards cider
06:32cflemingBronsa: I'm actually going to have to add a minimal REPL to Cursive - there are a surprising number of people who basically want inferior-lisp
06:33cflemingI was surprised, anyway.
06:33dysfunwhat functionality do you provide that you consider replaces it?
06:34dysfunpresumably something like lighttable's live eval?
06:34cflemingThat I consider replaces what?
06:34dysfunthe need for a repl
06:34cflemingOh, I don't - Cursive has full nREPL integration
06:34dysfunoh i see what you mean
06:35dysfuni'll have to give it a play sometime. when i last used it, it was pretty terrible for actually writing lisp
06:35cflemingBut there are a lot of people who don't want that - they just want a prettier wrapper around clojure.main, basically
06:35cflemingWhat was, IntelliJ?
06:36Bronsacfleming: I'm actually not surprised -- one of the things I dislike most of both Cursive & CCW is actually their repl interface
06:36dysfunCursive
06:36cflemingdysfun: If you try it again I'd be interested to know what you're missing.
06:37cflemingBronsa: It's not so much the interface, people don't want nREPL, and especially lots of magic in middleware.
06:37Bronsacfleming: ah well, I don't know anything about that :)
06:38cflemingBronsa: see https://gist.github.com/levand/b1012bb7bdb5fcc6486f
06:39clgvBronsa: what is bad about repl interface in CCW & Cursive?
06:39milos_cohagenIf 95% of the time I use emacs+cider to eval forms and get back response in mini-buffer, would that be called using a repl?
06:40dysfuncfleming: it was more that i didn't even have things i consider basic like rainbow parens
06:40cflemingdysfun: It does have that, you have to turn it on
06:40milos_cohagenI'll pull up the repl buffer if I print something big.
06:41TEttingerdysfun, yeah I loved that in light table. but nightcode doesn't have rainbow parens yet
06:41clgvcfleming: do you use tools.analyzer to get the AST for Cursive?
06:42cflemingclgv: No, I use a custom parser
06:42cflemingclgv: The AST elements have to be derived from IntelliJ base classes
06:42clgvcfleming: ah ok. a translation from a tools.analyzer would have been difficult?
06:42CookedGryphonDoes anyone know if count can work with transducers?
06:43clgv+AST
06:43CookedGryphonI don't want to build the intermediate collection, just count the things that end up coming through after my mappings and filters
06:43clgvCookedGryphon: should be doable though you will need a volatile for the counting state
06:43cflemingclgv: I'm actually not sure - I started out using a custom parser before tools.analyzer was around, and I haven't investigated whether it would be worth switching.
06:44clgvcfleming: ah so that is the main reason
06:44CookedGryphonclgv: Is there nothing in the standard library, this doesn't feel like something I should need to roll my own for
06:44clgvCookedGryphon: probably not yet since transducers are alpha
06:44clgvor ebta?
06:45cflemingclgv: The parser is actually pretty simple since I have to maintain all source information (comments etc) too, so it's very much just the basic forms - lists, symbols, keywords etc. The more interesting stuff I build on top of that myself.
06:45clgvCookedGryphon: but you could come up with a `counting` function and submit it as patch
06:46cflemingclgv: Speed is also an important issue since Cursive parses a *lot* - the current parser is actually Java
06:47clgvcfleming: interesting, though you could just use clojure with mutable stuff (deftype with mutable fields)
06:48clgvcfleming: to gain similar/same speed
06:48Bronsaclgv: there are actually issues with that b/c clojure functions have to box chars
06:49clgvBronsa: ah well, didn't know you need to store primitive chars for that...
06:51Bronsaclgv: cfleming I actually don't think using tools.analyzer for guiding an editor/IDE gains you that much TBH
06:51clgvBronsa: yeah, I am not really satisfied with the implementation of Clojure's primitive function
06:51clgvBronsa: but if you have no parser at the start of your project?
06:51clgv*no other parser
06:51clgv+analyzer
06:52Bronsaclgv: the thing is, t.a helps you if you can actually evaluate each form as you go. if you can't, you have to work your way to lie to tools.analyzer and make it believe everything's fine
06:53Bronsathis is a consequence of clojure's compilation model btw, there's nothing I can do about it
06:54clgvBronsa: ah ok, in short it is not analyzing statically?
06:55Bronsaclgv: it is analyzing statically, the issue is that the compilation level is the top-level form
06:55Bronsacompilation unit*
06:57clgvBronsa: so you mean you got to maintain the context that was evaluated before the current top-level form?
06:57Bronsaclgv: yeah well, I just plug into clojure's namespaces
06:58Bronsaclgv: the POC is this: (defn x [] 1) (defmacro y [] (x)) (defn z [] (y))
06:58Bronsaclgv: you could analyze just fine the first two forms without any evaluation
06:59Bronsabut when you get to z, you need x to be evaluated in order to be able to do the macroexpansion
06:59clgvok
07:00Bronsaracket has a mechanism to work around this issue, by defining some sort of compilation levels but basically all lisps that I'm aware of have this "issue" that emerges
07:05cflemingBronsa: Do you know why the extra attr-map at the end of the multi-arity form of defn is required?
07:06Bronsacfleming: no, I never understood why it's there
07:06Bronsanor have I ever seen it actually used FWIW
07:06cflemingBronsa: Me either, it's not even in a different scope - it's really weird.
07:07cflemingThat's good to know.
07:09clgvcfleming: yeah that one is strange.
07:23Guest_newbie looking for help in understanding recursive example
07:23Guest_the assignment ist http://www.4clojure.com/problem/28
07:24Guest_the (working) solution I have is:
07:24Guest_(defn -flatten [coll]
07:24Guest_ (if (coll? coll)
07:24Guest_ (mapcat -flatten coll)
07:24Guest_ [coll]))
07:24clgvGuest_: post it on refheap.com please
07:24Guest_ah, ok
07:25Guest_[learning how to do this]
07:25Guest_https://www.refheap.com/91454
07:25clgvGuest_: what is you question about that function?
07:26Guest_trying to analyze what's going on inside the recursive loop
07:27Guest_I inserted a (println coll) to look at ir
07:28Guest_like so:
07:28Guest_https://www.refheap.com/91454
07:28Guest_why do I never see the complete coll in the prints?
07:28Guest_(I#M feeling dense ...)
07:29schmirGuest_: the println changes the return value
07:30Guest_ah ...
07:31Guest_recursive thinking need alot of practicing, I guess
07:33Guest_what would be the best way to look into the iterations of a recursive loop?
07:34Guest_(I thought println would be sensible)
07:34schmirthe problem you introduced has nothing to do with recursion.
07:34Guest_ok
07:34schmirprintln returns nil
07:34Guest_yes
07:35Guest_I had the println before the mapact
07:35schmirso, the function with the println returns nil, since you put the println at the end of the do block
07:35clgvGuest_: just add (println coll) after [coll]
07:35Guest_(sorry)
07:35clgvthen you see the collection per function call
07:36Guest_in a (do ..) ?
07:36clgvno
07:36Guest_ok
07:36Guest_thanks
07:36clgvjust before the `if` the `defn` has an implicit `do` for its body
07:36Guest_(I know this questions are very newbish)
07:37clgvGuest_: you got a book to learn those basics quickly?
07:37Guest_yes
07:37clgv,(defn -flatten [coll] (if (coll? coll) (mapcat -flatten coll) [coll]))
07:37clojurebot#'sandbox/-flatten
07:37clgvGuest_: then best interleave reading and experimenting at the repl
07:38Guest_yes, just now in Light Table
07:38Guest_"#'sandbox" is something I can look up?
07:39clgv,(-flatten (last (take 100 (iterate list nil))))
07:39clojurebot(nil)
07:39clgv,(-flatten (last (take 500 (iterate list nil))))
07:39clojurebot(nil)
07:39clgv,(-flatten (last (take 5000 (iterate list nil))))
07:39clojurebot#<StackOverflowError java.lang.StackOverflowError>
07:39clgvGuest_: `sandbox` is the namespace where the bot evaluates our commands
07:40Guest_ah, sorry
07:40clgvGuest_: in your repl you likely have `user`
07:40Guest_understood
07:40Guest_thanks
07:40clgvthe last expression demonstrates that the -flatten is subject to a stackoverflow. but maybe you wait until later to find out what the problem is ;)
07:41Guest_could be solved by recur, I guess
07:42clgvGuest_: for a lazy-seq approach there should be no stacked `concat` which is implicitely called in `mapcat`
07:42Guest_ah ...!
07:42Guest_good, that is something to think about
07:43Guest_"interleave reading and experimenting at the repl" is what I do since a few days
07:43clgv,(flatten (last (take 5000 (iterate list nil))))
07:43clojurebot(nil)
07:43clgvgooad ^^. next you should get an individual irc name so that people can remember you around here ;)
07:43Guest_ok
07:44Guest_thanks again!
07:57mmeixdone
07:57clgvgood.
08:00mmeix"stacked 'concat' " was the point, I hadn't quite understood
08:00mmeixbut it gets clear
08:02mmeix(I'm positively surprised by the helpfulness I experienced here in te last days)
08:04clgvmmeix: you usually get good help here. usually you should find a minimal version of your source that produces the same problem and describe what you expect and what happens to get fast answers
08:04mmeixyes, I'm trying ...
08:05mmeixfor a newcomer the question is often not so clear, but it's getting better :-)
08:05mmeixback to 4clojure
08:06clgvlazybot can also help you if you know examples that specify your function ;)
08:06mmeixwhat/who is lazybot?
08:06clgv$findfn odd? (range 5) [1 3]
08:06clgv&42
08:06lazybot⇒ 42
08:06clgvthat guy ^^
08:06mmeixa robot I guess
08:07lazybotExecution timed out.
08:07lazybot[]
08:07clgv$findfn odd? [0 1 2 3 4] [1 3]
08:08lazybotExecution timed out.
08:08clgvah well maybe that feature broke...
08:08lazybot[]
08:59justin_smith$findfn 6 3 3
09:00lazybotExecution timed out.
09:00lazybot[clojure.core/max-key clojure.core/cond clojure.core/char-escape-string clojure.core/-' clojure.core/*data-readers* clojure.core/- clojure.core/default-data-readers clojure.core/unchecked-subtract clojure.core/*clojure-version* clojure.core/unchecked-subtract-int clo... https://www.refheap.com/91458
09:01justin_smithso it times out, and it also finds me a bunch of answers
09:01justin_smithcool
09:03greghendershottI want to split a URL string into the components (scheme, host, port, etc.). In Racket I'd use string->url. What's a good way to do that in Clojure?
09:04justin_smith,(bean (java.net.URL. "http://www.google.com&quot;))
09:05clojurebot#<MalformedURLException java.net.MalformedURLException: denied>
09:05justin_smithgreghendershott: if you run that locally you will see the "bean" abstraction for that class - but each key in that map also represents a more efficient method call that you can call directly
09:06greghendershottjustin_smith: Ah, so Java interop for that. Thanks!
09:06justin_smith,(.getProtocol (java.net.URL. "http://www.google.com&quot;))
09:06clojurebot#<MalformedURLException java.net.MalformedURLException: denied>
09:06justin_smith:P
09:06sw1nnhi, can anyone offer any suggestions on avoiding this stack overflow using transducers? Problem exists in clojure and clojurescript (running in chrome 37). Not sure if I'm doing something dumb, but for small values of the repeat it works as expected, but larger values cause Overflow. https://gist.github.com/sw1nn/f8463b5bfed6db7a9f30
09:07justin_smithgreghendershott: yeah, the jvm interop for the net stuff is decent, and you can use various apache libs for more advanced functionality too (by including them in your project.clj of course)
09:08dnolen_greghendershott: note using bean means you can use interact with the url as a map, (:protocol (bean (java.net.URL. "http://google.com&quot;)))
09:08vermaTIL about bean
09:08justin_smithdnolen_: yeah, that's why I showed that first - do you happen to know how big the overhead on bean is?
09:09greghendershottjustin_smith: dnolen_: Thanks. A (correct) regexp for splitting URLs is non-trivial, so happy to use something "official".
09:09dnolen_justin_smith: probably not small but this doesn't sound like he's going to stick it in a loop
09:09justin_smithfair point :)
09:10greghendershottFeeling a little worried I don't know enough Java, and how much will I need to learn to be effective in Clojure. But, I'm just getting started.
09:10dnolen_sw1nn: I'm somewhat confused as to why that code is written that way
09:10greghendershottOpen mind, turn on firehose
09:11justin_smithgreghendershott: knowing java is not a huge concern, knowing how to search and read javadoc (and use what it describes via interop) will help you a lot
09:12greghendershottjustin_smith: Ah right I meant the libs/ecosystem, what's out there to use. Not the lang. Thanks for the tip re javadoc and interop.
09:12justin_smithgreghendershott: I find the javadoc-search-pane (for chrome and firefox) really helpful for finding what I want
09:13justin_smithhttps://chrome.google.com/webstore/detail/javadoc-search-frame/mfgkihmpcjjnijmkchojlbccbmhcdfcd?hl=en
09:13justin_smithit does completion of potential matches as you type, which is a huge help
09:13sw1nndnolen_: well, it's an experiment with transducers, so it could be artificial. I'm receiving sequences [0 1 0 1 0] I want to total up all the 1s basically.
09:14sw1nnie. [[0 1 0 1 0][1 0 0 1 0] ... [1 1 1 0 0]]
09:14greghendershottjustin_smith: Thanks!
09:16dnolen_sw1nn: in any case the stack trace is clear, it looks like you have build up a bunch of lazy map ops and you realize it at the end and blow the stack. Nothing much to do w/ transducers.
09:17Bronsasw1nn: what dnolen_ said. if you replace map with a mapv it should work fine
09:17Bronsaor (doall (map
09:17sw1nndnolen_: ahh..I was being dumb :-), mapv works.
09:19justin_smithgreghendershott: dnolen_: turns out the standard deviation of bean is greater than the execution time of a direct method call. https://www.refheap.com/91459 0.28 vs. 8.4 µs
09:20justin_smithFor what it's worth. I had heard bean had a big overhead but had not microbenchmarked it before.
09:24ckirkendallAnyone out there run into the clojurescript compiler hanging indefinitely when dealing with large quoted forms.
09:25dnolen_ckirkendall: haven't heard of this being a problem, but entirely possible - somebody may have never tried that before
09:25dnolen_ckirkendall: I know at one point large EDN structures were an issue until a parsing fix landed in Closure Compiler
09:26stuartsierrajustin_smith: oh yeah, `bean` does full reflection on every call; wildly inefficient.
09:26Bronsastuartsierra: on every call? couldn't it do it once and cache?
09:27stuartsierraCouldn't I fly if I flapped my wings hard enough?
09:30ckirkendallThis is a large edn file being brought in as a quoted structure through a macro.
09:31Bronsackirkendall: in clojure it's often not a good idea to include big literals in code, I suppose it might be similar for cljs
09:31ckirkendalldnolen_: it compiles find if optimizations is set to none.
09:31dnolen_ckirkendall: so it's a Google Closure thing it sounds like
09:31ckirkendalldnolen_: that is the feeling I have.
09:32dnolen_ckirkendall: you may be hitting another parse corner case in Closure, what version of Google Closure do you see via lein deps :tree?
09:33ckirkendalldnolen_ Bronsa: v20140625
09:35schmirhow do I exclude some namespaces from an uberjar?
09:35dnolen_ckirkendall: yeah pretty recent, you might want glance over the generated :none JS to see if something stands out
09:36dnolen_ckirkendall: also might make sense to describe how much JS you are generating - megabytes?
09:36ckirkendalldnolen_: will do. In the mean time I think we will take Bronsa's suggestion and try loading this at run time.
09:37dnolen_ckirkendall: yeah that's the simpler solution - another option is to just give Google Closure more memory - there's really no such thing as too much in my experience.
09:37justin_smithupdated - with more fields accessed, and a hash-map created, the performance difference is much smaller
09:38justin_smithhttps://www.refheap.com/91459
09:38ckirkendalldnolen_: going to look at the memory thing right now., If that is the issue its easy to fix.
09:40justin_smithschmir: if you only need those libs at dev time, you can put them in a dev profile http://blog.japila.pl/2012/06/exclude-dependencies-from-uberjar-in-leiningen-2/
09:40justin_smithoh wait, namespaces...
09:41justin_smithyou could put the namespaces in a separate folder that is in your :dev :source-paths so that they are only found during dev time
09:43schmirjustin_smith: right. but I'm looking for another solution. I'd like to keep the files in the same directory.
09:43justin_smitha hacky way to do it would be deleting the .class files from the uberjar - it's just a zip file after all
09:43xeqischmir: In that case use :uberjar-exclusions https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L385
09:44justin_smithoh that's much better
09:44justin_smith(inc xeqi)
09:44lazybot⇒ 14
09:45schmirxeqi: ok, will try that. I thought this is only for resource files. let's see
09:46justin_smithresource vs. class stuff is a very leaky abstraction - it's all just stuff that ends up on the classpath
09:52schmirxeqi: thanks. that seems to work, though it still aot compiles the excluded files.
09:52schmir(inc xeqi)
09:52lazybot⇒ 15
09:52ckirkendalldnolen_ memory doesn't seem to be the issue. On to the javascript.
09:58arrdemmdrogalis: lol @ pool request
10:04mdrogalisarrdem: :D
10:04mdrogalisI'm a doofus in the morning.
10:05greghendershottjustin_smith: So the map from (bean (java.net.URL. "http://www.google.com&quot;)) includes `:content #<HttpInputStream sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@56e01e8a>`
10:05greghendershottIs that b/c `bean` is calling getContent http://docs.oracle.com/javase/7/docs/api/java/net/URL.html#getContent%28%29 which opens a connection?
10:05greghendershottb/c I don't want a connection, I just want to parse the URL into its components.
10:05greghendershottHmm....
10:06justin_smithgreghendershott: that would be a good reason to use the accessors directly, and likely, yes, that is what is happening
10:06greghendershottMaybe I can not use `bean`, and somehow call the members individually?
10:06greghendershottAh OK I'll work with that. Thanks.
10:06justin_smithright - did you see my updated paste? it includes creating a hash map directly using the accessor methods
10:07justin_smithhttps://www.refheap.com/91459 see the very last benchmark
10:07greghendershottjustin_smith: Oh sorry, no I missed that. scrolling.... back. You posted it again. :) Thanks! Got it.
10:08greghendershottOK so this is cool. I didn't expect I'd need to learn interop basics this early, but it's fine, that's good.
10:08justin_smithit's pretty simple
10:08justin_smith(mostly)
10:09greghendershottSimple things are simple, I imagine? :)
10:10justin_smithit's not just that - there's little things that expose differences between how clojure uses the jvm and how java uses it -- varargs are a bit weird, and things that specialize on int
10:11clgvjustin_smith: did you typehint `loc` or is it's type inferable by the compiler?
10:11clgv-' :(
10:12justin_smithclgv: loc is defined before the other forms are compiled
10:13justin_smithor does that not help?
10:13justin_smithI can try with typehinting and see if it makes a difference
10:13clgvjustin_smith: if it has a typehint on the var it's fine otherwise there is reflection involved
10:13ckirkendalldnolen_: the quoted form that seems to be giving it trouble is 49k when compiled with no optimizations. I don't see anything that is odd obout the javascript.
10:14justin_smithclgv: so I need (def loc ^java.net.URL (java.net.URL. "http://www.google.com&quot;)) ?
10:14justin_smithI'll try it
10:14clgvno on the var
10:14clgvmove it one position to the front
10:14justin_smithclgv: got it, thanks
10:14justin_smiththis hinting stuff keeps surprising me
10:16clgvjustin_smith: vars are an indirection so the compiler has no clue which type of value they refer to (it could change during runtime). with the type hint you tell the compiler that the type remains the specified one
10:17justin_smithOK
10:18TimMcThat's a really good point.
10:20justin_smithoh wow, that is a huge difference, paste updated - that makes the direct access version very fast https://www.refheap.com/91459
10:20justin_smith(inc clgv)
10:20lazybot⇒ 29
10:22clgvah yes, that's more like it :D
10:22BronsaI am always moderately annoyed that clojure doesn't have any option to turn on simple global type inference on things like (def a (Foo. ))
10:23justin_smithyeah, it was counterintuitive that it wouldn't attempt that
10:23justin_smithI mean, that's a pretty safe thing to add a hint to
10:23clgvBronsa: but you still would need something like (def ^:infer-constant-type foo (Foo.))
10:23Bronsabuild profiles are getting to the top of my wish-list pretty fast
10:23clgvsince you are allowed to rebind the var to anything
10:24Bronsaclgv: no a per-form config option wouldn't make sense, agreed
10:24clgvBronsa: damn I forgot to mention the work on "static" functions as feature I want in the survey
10:25hyPiRionHave people talked about how they want better error messages yet?
10:25Bronsaclgv: build profiles are way more essential IMHO
10:26clgvBronsa: just my perspective ;)
10:26Bronsaclgv: adding features to the compiler right now is really painful
10:26clgvBronsa: I'll agree on build profiles being number one if there are performance optimization for production builds included ;)
10:26Bronsaclgv: sure, that's the whole point :) but you need the infrastructure in place before adding those or it will get a mess
10:27clgvBronsa: agreed
10:28Bronsaunfortunately I doubt there's any interest in refactoring the compiler ATM
10:28justin_smithclgv: what about automatically hinting by default on def when the class is trivial to determine at compile time? what's the counter argument for doing that?
10:28Bronsajustin_smith: you might be at the repl and later want to rebind the var to a different type
10:28justin_smithyes we are allowed to rebind a def to a different class, but even with hinting that wouldn't break anything would it? you just get the wrong type hint
10:29clgvjustin_smith: what Bronsa said.
10:29Bronsaand if you have already evaluated a function that does interop on that var, it's broken
10:29justin_smithahh
10:29justin_smithgot it
10:29justin_smiththat's what I was looking for, thanks
10:29justin_smith(inc Bronsa)
10:29lazybot⇒ 58
10:29clgvjustin_smith: primitive functions that are called accordingly are a good example for that
10:30clgvwhen you reevaluate the function without the primtive typehints the callsite will throw
10:31BronsaI'd like to see a benchmark to see how much an impact compiling to (if (instance? primInterface x) (.invokePrim x ..) (invoke x ..)) instead of directly yo (.invokePrim x ..) has
10:32Bronsaprotocols callsites compile to something like that and they are pretty fast so I'm not sure it would be a prohibitive enhancement
10:32justin_smithcheaper than reflection to be sure
10:32clgvBronsa: or (try (.invokePrim x ..) (catch ApropriateExceptio e (.invoke x ..))
10:33Bronsaclgv: oh yeah
10:33Bronsait might have some impact on jvm inlining though
10:34clgvBronsa: both? or just the try-catch version?
10:35Bronsaboth, or neither :P I don't really know enough about it
10:35clgvBronsa: I have no clue about the internals of inlining on the jvm ;)
10:38clgvBronsa: maybe I try that, I was working on more flexible primitive functions anyway
10:38Bronsaclgv: I'd be interested to know about that
10:43clgvBronsa: currently I am just hacking the compiler from a library
10:44clgvi.e. reusing its class generation features for reify
11:10yedidoes anyone use cljs on the client with a non-clj lang on the server? curious about people's experiences and common dev practices
11:12daniel___yedi, dont think so
11:12daniel___thats crazy
11:12yedi=p , jc to know if ppl have written about their experiences somewhere
11:13justin_smithdaniel___: saw some guy on twitter talking about using cljs with rails
11:13shemyedi: i'm doing such a thing right now. cljs/om in the client, perl in the server (for legacy reasons). communication via json
11:14muraikishem: are you doing anything with websockets in perl?
11:14justin_smithdaniel___: a coworker of mine made some great stuff using cljs on the frontend and google app-engine and node.js on the backend (two different projects)
11:14shemmuraiki: nope
11:15yedishem: cool! i guess it's been working out pretty well?
11:15muraikishem: I work at a perl shop and our internally developed framework doesn't really have a way to easily fit in something like websockets... was just curious if you had explored that in perl :)
11:15shemyedi: it's certainly more fun than doing mostly everything on the server side with perl
11:16yedishem: for packaging different cljs code for different webpages and sending them to the client, how do you go about that? do you simply just build a bunch separate js files from the cljs and choose which ones to included in the html markup?
11:17yedioooo clojure cup results are out
11:17shemyedi: i use simple routing inside the root component like this: https://github.com/swannodette/om/issues/235#issuecomment-53092555
11:18shemyedi: btw there's a #clojurescipt channel which might be more appropriate for this
11:18yedishem: oh it's in the style of a one page application? all your pages require the same cljs?
11:18clojurebotexcusez-moi
11:18yediah true, i forget ##clojurescript is a thing
11:19cka3yc1
11:19shemyedi: yeah, one page logically. but many completely different views
11:21yedishem: right, so when loading a view that isn't the index or main page. do you send the base/root js to the client and then it requests what's needed from the server to generate to view? so two round trips instead of 1?
11:21yedithe winning app: http://youmusic.clojurecup.com/ doesn't even seem to work for me
11:21shemnope, no communication with server
11:22shemi just change the route-name in app state and om renders a different view
11:24yedishem: ah ok, seems simple enough. thanks for sharing
11:24cka3ycHello, trying to read tar.gz file like so :
11:24cka3yc(with-open [in (java.util.zip.GZIPInputStream.
11:24cka3yc (clojure.java.io/input-stream
11:24cka3yc "my-file-name.gz")
11:24cka3ycand getting "Not in GZIP format", but i can open this archive in my file manager without any problems, what can be the problem here? I'm on Windows 7
11:25p_lit's probablyt not a gzip file
11:32daniel___justin_smith: wasnt completely serious, it could obviously work
11:32daniel___its a bit strange if you have a choice in the matter though
11:40justin_smithyeah, those examples had client requirements that ruled out clj on the back end
11:43seangroveI'm really starting to get attracted to the idea of a clojure-flavored haskell. Could be a lot of fun.
11:44justin_smithseangrove: flavor as in syntax or semantics?
11:45seangroveClojore-syntax, clojurescript-macros, haskell/ghc typing
11:45justin_smithahh, OK
11:45seangroveNo runtime macros, but we don't have them in cljs anyway
11:46seangroveAlso, the degree of purity Haskell has means the compiler is free to do a lot more
11:46seangroveIt's an interesting set of ideas, I can definitely see why Haskell is academia's playground
11:55dnolen_seangrove: I think this idea doesn't really make any sense - you already have core.typed, HM style typing while preserving Cljoure semantics. What you're talking about sounds like Haskell w/ Lisp syntax http://clemens.endorphin.org/ILC07-Liskell-draft.pdf - it wouldn't feel like Clojure at all same way that Haskell does not
11:56seangrovednolen_: Yeah, certainly I'd rather it be closer to Liskell (not a fan of Haskell syntax at this point), but core.typed being optional makes it largely useless without a ton of discipline and buy in from everyone
11:56seangrovednolen_: I like core.typed too, but having seen it in a large code base, it's really subject to bitrot
11:57seangroveIt's just an idea I'm considering playing with a bit more though
11:59dnolen_seangrove: I don't see how this any different from evolving code conventions, deprecated libraries / APIs, etc.
11:59dnolen_investing in anything is a shit ton of work
12:00seangrovednolen_: Except if the libraries aren't doing the typing as well, then you're doing a huge amount of work for every library that you bring in
12:00seangroveJust a cultural thing that causes a lot more pain for core.typed users than for ocaml/haskell users
12:00dnolen_seangrove: what you're saying still doesn't make sense given the larger goals of gradual typing
12:01dnolen_seangrove: the the point is not to type everything in the world
12:01dnolen_this is a waste of time
12:01seangrovednolen_: Ah, yes, I'm sorry. I'm saying that gradual typing is a really tough problem
12:01seangroveDon't mean to open up a debate, it's not a hugely interesting problem
12:01dnolen_seangrove: no static typing has the same problem
12:01bbloomseangrove: gradual typing is rapidly becoming pretty well understood :-)
12:01dnolen_seangrove: there's thing called Type Providers in F# for a reason
12:02seangrovednolen_: I'll have to look up type providers, thanks. Haven't looked into F# at all yet
12:02dnolen_seangrove: even if you did come up with such a thing good luck providing semantics for interop anyhow
12:03bbloomtype providers are pretty damn cool
12:04dnolen_which is another thing that core.typed doesn't get enough credit for, attempting to give semantics to host
12:05seangrovednolen_: How so?
12:05zotis there any notion of directly accessing the parent namespace? e.g., i'm in foo.bar.baz, and want to access foo.bar/funk — is there a relative/.. style access, or do i just need to explicitly say foo.bar/funk?
12:05dnolen_seangrove: dude, read the paper :)
12:05seangrovednolen_: Will do
12:05clgvzot: no. there is no such runtime concept as parent namespaces
12:05bbloomzot: relative imports are a bad idea
12:06clgvzot: actually, there is no guarantee that a namespace class for a parent (according to your definition) exists at all
12:06clgvzot: use aliases as in (:refer [foo.bar :as fb])
12:06technomancybbloom: why is that?
12:07zoti don't have a need for guarantees, but i too am curious about the bad idea flag :)
12:07zots/flag/flag-in-the-ground/ :)
12:07bbloomb/c it makes it harder to grep for usages of namespaces
12:07clojurebotIt's greek to me.
12:07bbloomb/c it saves like ~20 characters in an entire file
12:07bbloomb/c you should use aliases anyway
12:08bbloomb/c there's no such thing as a parent directory in unix
12:08bbloomi'm sure i could think of a few more :-)
12:09sritchietechnomancy: oh man, I finally found it: https://github.com/zcaudate/lein-repack
12:09bbloomb/c it makes the meaning of a file's code depend on the location of the file
12:09bbloomnothing else does that right now
12:09bbloombtw python 3 removes relative imports ...
12:10bbloomor rather *implicit* ones, i bleieve
12:10technomancybbloom: racket has them
12:10bbloomtechnomancy: racket has everything
12:10technomancythe grep thing I'd buy; the other reasons are bogus
12:10technomancyI'm still wondering what it would look like if you could chop of a subtree of namespaces and treat them as an isolated unit
12:11technomancyI think you could solve a lot of dependency problems that way
12:11bbloomyou can't cat a file to the compiler and have it work if you've got relative imports
12:11bbloomb/c you need to know the file's path
12:11sritchietechnomancy: that plugin I just sent you allows you to do that with a lein proj (I just jumped in so I’m probably missing a ton of context)
12:11bbloomnothing else in clojure is source location dependent
12:11technomancyyou can't cat a file to the compiler and have it work anyway
12:11bbloomsure you can
12:11technomancyFSVO of "work" that includes line numbers
12:11bbloomthat's basically what load-file does
12:12bbloombut it does know the file path ;-)
12:12technomancyright
12:12bbloomthe way people use inferior lisp probablyw ouldn't work b/c it really just does pipe stuff, as far as i udnerstand
12:12bbloombut i'm not a emacs guy
12:12technomancyany definition of "work" that doesn't give you useful error messages is not a definition I buy
12:12milanjhi, what's best way to extend exception
12:12bbloommilanj: use ex-info and ex-data
12:12bbloommilanj: or if you absolutely must make a custom subclass for interop purposes, write java
12:13milanjI don't want it for inter opt purposes
12:13bbloom(doc ex-info)
12:13clojurebot"([msg map] [msg map cause]); Create an instance of ExceptionInfo, a RuntimeException subclass that carries a map of additional data."
12:13bbloom^^ that's what you want
12:13milanjok, let me check those
12:22milanjbbloom, thanks
12:22milanjbtw. this doesn't look nice
12:23bbloomwhat's not nice about it?
12:23technomancyit's a lot nicer than subclassing Exception
12:24milanjthat is right
12:24lvhreiddraper: Hi! You wouldn't happen to know if there's a URL generator, or, maybe more generally, generator-generator from instaparse, or generator-generator from ABNF?
12:24milanjbbloom, well, you manually comparing things from map that you put in exception
12:24milanjprobably can be made better with some macro
12:25jeremyheilerlvh: this might help: https://github.com/bowmanb/schema-contrib
12:25jeremyheilerfor urls
12:25milanjI can, judging by this you only need on Exception class
12:25jeremyheilerit uses instaparse under the hood
12:25lvhjeremyheiler: Yeah, I'm using that. It has a URI schema, I'm trying to turn that into a test.check generator
12:25bbloommilanj: i'm not sure i understand your complaint
12:26technomancymilanj: it is a shame there's no built-in macro to pattern-match against ex-data
12:26mdrogalismilanj: I think I know what you're saying. You're repeating the keywords in the map?
12:26mdrogalisYou'd have to repeat the method call to Exception's subclass. It's a superficial difference, if I understand correctly.
12:27milanjif java was like this we would throw only OneException with map in it and then compare it by hand
12:27technomancyjava sucks at having syntax for data though
12:27milanjyes, cool thing is that lisp allow it to play with syntax
12:27reiddraperlvh: nothing that i'm familiar with, but a url generator would not be difficult to write
12:28technomancymilanj: there's sort of pattern-matchy stuff in slingshot that works on ex-infos
12:28Bronsahow cool would it be if catch could destructure ex-infos?
12:28technomancyhttps://github.com/scgilardi/slingshot
12:28lvhreiddraper: yeah, I just try to avoid writing code :) any particularly good contrib libs that I could contribute a generator to?
12:28milanjtechnomancy, thanks, I'll check that for sure
12:28milanjnative solution is ugly
12:29technomancymilanj: it gives you all the building blocks you need, but it's low-level
12:29reiddraperlvh: hmm, maybe https://github.com/gfredericks/test.chuck
12:29reiddrapercc gfredericks ^
12:29lvhreiddraper: awesome, thank you :)
12:29reiddrapernp
12:30milanjtechnomancy, sure, but exception handling is something that is basic enough to have good solution in core language
12:30milanjso anyone can use the same solution
12:30technomancymilanj: and so is pattern matching; I agree =)
12:30lvhparticularly gen'/for seems very useful for my url maker :)
12:31technomancymilanj: but if you ever tried to contribute a change to clojure you'd understand why it's this way
12:32milanjtechnomancy, I just started with clojure, coming mainly from CL world (and Java in last couple of years)
12:32mdrogalisWelcome :)
12:32milanj(don't make me mention cl conditions system) : ))
12:33Bronsatechnomancy: things are a bit better now than before though, puredanger is actually responsive :)
12:33milanjok, thanks to all
12:33technomancymilanj: yeah the only thing I'm still jealous of CL about =)
12:33mister_zombieHi, I'm new to clojure, as an introductory project I wanted to build a thing that parses a webpage to check for missing alt properties on img tags
12:34milanjbtw. is that decision because of interopt with java or something else (not to have conditions) ?
12:34technomancyBronsa: I've seen fixes go through better than in the old days, but I'd still much rather contribute to slingshot than clojure itself.
12:35justin_smithmilanj: you keep calling interop (inter operation) interopt (inter optimization?)
12:35mister_zombieI don't really want to start off building a parsing library, is there any good one out there?
12:35danneuwhat's a nice way to implement (select-keys2 {:a 1, :b 2} [:a :b :c]) -> {:a 1, :b 2, :c nil}
12:35milanjI meant inter-op
12:36danneunvm zipmap+juxt comes to mind
12:36ckirkendallmister_zombie: enlive has some tools that would make this easy.
12:37mister_zombieI tried it but I couldn't get it to work
12:37mister_zombieI had issues with attributes
12:37justin_smith,(into {} (map (juxt identity {:a 1, :b 2}) [:a :b :c])) ; danneu
12:37clojurebot{:a 1, :b 2, :c nil}
12:38lvhreiddraper: If (gen/sample my-generator) returns a bunch of duplicates, is that a bug in my generator, or considered OK behavior?
12:38reiddraperlvh: totally depends, try (gen/sample my-generator 100) and see if you get more diverse data
12:39ckirkendallmister_zombie: can you give me an idea of the type of problem you had.
12:39lvhreiddraper: ah; that made me realize the answer actually
12:40reiddraperlvh: sampling is also (just like testing) subject to sizing, and the size increases as you ask for more tests, or more samples
12:40lvhreiddraper: (basically it's just a fixed url + a fixed pair + an optional pair with only five or so possible values; so as soon as sample *can* ask for more than, oh, 6 types or so, it's going to repeat itself)
12:40lvhreiddraper: I guess it could be rephrased as: does every generator need to be able to produce arbitrary examples
12:40gfredericksreiddraper: I had great success with exponential hops down the shrink tree the other day; such a bizarre tactic though
12:40lvhreiddraper: or can it say "these are all the things I have, sorry"
12:41lvhreiddraper: I guess it's not usually a problem because most real generators, especially composed ones, will be able to produce many more examples than you can ever check
12:41reiddraperlvh: test.check doesn't care if there's lots of duplication, but it also doesn't take advantage or do anything smart with that
12:41lvhreiddraper: ok, cool, thanks again :)
12:41reiddrapergfredericks: hmm, we should talk about that, still thinking next week might be good to meet up?
12:41gfredericksI down it's worth considering as an official shrink strategy but it was fun
12:41gfredericksoh urm
12:42gfredericksreiddraper: maybe next week is bad actually
12:42gfredericksanything later is probably fine. also RIGHT NOW would work.
12:43reiddrapergfredericks: i'm in my last two days at basho, so now probably isn't good... :) , we'll figure it out
12:49ckirkendallmister_zombie: https://gist.github.com/ckirkendall/4fca64e381067f999f35
13:02mister_zombieckirkendall: Oh. That's very cool.
13:06sritchieso, with environ and the 12 factor thing of sharing config through environment variables,
13:07sritchieif I’m never supposed to check them into source control, how am I supposed to sync a dev environment between team members?
13:09technomancysritchie: nothing wrong with checking dev default values into source control
13:09justin_smithsritchie: relevant page for reference http://12factor.net/config
13:10justin_smithtechnomancy: depends on what you use - I have seen for example the credentials to an internally used mysql server accidentally get open sourced
13:10justin_smithtechnomancy: which config via env would have prevented
13:10technomancyjustin_smith: developing against a server that isn't on your laptop? =(
13:10sritchiejustin_smith: so how would you get those credentials to new devs?
13:10justin_smithsritchie: a scrit that sets up all the dev time env, that isn't in vc
13:11sritchieand just gets emailed around or something?
13:11sritchieI can see putting that in a separate project,
13:11sritchieunder VC, which just never gets open sourced -
13:11sritchieseems just as “secure” as any other distribution channel
13:11justin_smithtechnomancy: it's a cms, the designer needs to be able to create asset handles, the frontend needs to be able to create content placeholders, etc. and everyone should have this stuff in sync
13:12justin_smithtechnomancy: acknowledged it is a specific workflow, but this kind of thing is not super uncommon
13:12sritchieactually, here’s one config question I had for you guys -
13:12technomancyI actually put default settings in the code itself, only because you have to restart the whole JVM to change actual env vars
13:12sritchieI’m moving all my config over to the env, but having strict “dev” and “prod” configs isn’t quite working,
13:12sritchiesince I might want to run production stripe queries, or send mandrill emails, from my repl
13:13sritchie(but not actually store production DB info locally)
13:13sritchieso that requires switching just one config variable, the stripe key, and nothing else
13:13sritchieone way to do that is to prefix environment variables with “DEV_” or “PROD_”, but that’s pretty busted,
13:14sritchie(and then have a dynamic variable that I can override for specific repl calls)
13:14sritchieor is there some other, cleaner way to accomplish this -
13:14sritchieof maintaining granularity at the repl
13:15justin_smithsritchie: how about this for flexibility: the vars come in through the env, that is used to populate system properties (which are all updatable at runtime)
13:15mi6x3mCan someone explain:
13:15mi6x3m,(var '+)
13:15clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)>
13:16mi6x3ma, wait, it's a macro lol
13:16justin_smithsritchie: the reason not to put this into system properties directly is the jvm prints out properties at boot, which you probably don't want for credentials
13:16mi6x3m,(var +)
13:16clojurebot#'clojure.core/+
13:16hiredmanmi6x3m: (var ...) is a special form
13:16sritchiejustin_smith: haha, sure
13:16Bronsami6x3m: not a macro, a special form
13:16justin_smith,'(var '+)
13:16clojurebot(var (quote +))
13:16sritchiejustin_smith: but then to override, I’d need some way of having the dev AND prod loaded at the same time,
13:16hiredman#'+
13:16mi6x3many way to get the var from a symbol?
13:16sritchieso that I could switch between them
13:16sritchiejustin_smith: that’s what seems to break the 12 factor
13:16Bronsa,(resolve '+)
13:16clojurebot#'clojure.core/+
13:17danneu(or (:db-uri *env-override*) (:db-uri env) "datomic:mem://localhost:4334/dev")
13:17hiredman,(apropos "var")
13:17clojurebot(clojure.core/*allow-unresolved-vars* clojure.core/alter-var-root clojure.core/find-var clojure.core/var-get clojure.core/var-set ...)
13:17hiredmanetc etc
13:17justin_smithsritchie: you would have a function that populates the properties from the env at boot, but you can also update individual keys (since they are in properties) in runtime
13:17mi6x3mdamn, I totally forgot about resolve although I use it once every mins...
13:17mi6x3m(inc Bronsa)
13:17lazybot⇒ 59
13:18sritchiejustin_smith: I just meant as far as naming conventions. Since, to override, I’d need access to the prod variable as well
13:18sritchiejustin_smith: I know I can make it work, I have been, it just requires a bunch of switches,
13:18sritchieor embedding the environment mode in the variable name
13:18justin_smithyeah
13:19justin_smithI wonder if this could be addressed with some usage of environ + component?"
13:19justin_smiths/"//
13:20danneuyeah, components could init with an optional config map that's merged into environ.core/env
13:21technomancysritchie: consider carica too; IMO the env var stuff falls over for more complicated use cases, especially when you want nested data.
13:23TimMcI generally store my entire program as an environment variable.
13:24sritchieTimMc: :)
13:24sritchietechnomancy: nice, looking
13:24TimMcUnfortunately, they're trying to "patch" the "bug" I've been using to do that.
13:26sritchietechnomancy: looks like carica wants you to check the entire config into source, yeah?
13:29technomancysritchie: no, it's designed to have prod config overlaid at deploy time
13:30martinklepschwhen using pipeline-async I wouldn't be able to pipe intermediate into the to-chan right? (lets say the progress of a file being uploaded)
13:33mi6x3mhas anyone here used a plugin to copy files with leiningen?
13:33mi6x3mlike for resources
13:34danneugulp.js ;)
13:40sritchietechnomancy: so, with heroku, I’d still need a deploy tool to transfer the carica config file over, yeah?
13:40sritchietechnomancy: I’m currently on dokku and using environ, which works well there -
13:40technomancysritchie: oh yeah, carica isn't really heroku-friendly
13:43sritchietechnomancy: figaro has a script that dumps all variables to heroku - that would probably solve it for carica
13:43sritchiehave some way to read from the env as well, with some convention for the nesting,
13:43sritchiethen inject all variables into heroku’s env
13:43technomancysritchie: you kinda lose the advantages of carica though
13:44technomancysupporting non-string types, etc
13:44sritchiesure
13:58vermain clojurescript how do I check if a certain object is a native javascript arraybuffer type, or in other words can reliably check types of native JS types? js/Array js/ArrayBuffer js/Float32Array etc.
14:01vermain cljs repl (type "hello") gives me #<function String() { [native code] }>
14:01eriktjacobsenI’m using clojure.java.jdbc 0.3.4… even in the simplest test case of a primary key select on a table with 4 rows, i’m seeing queries take 900ms-1200ms where they are 100ms on the mysql commandline client. Same client, same host, same query. Brief internet search doesn’t show any outstanding known performance issues… any ideas to debug ?
14:02justin_smitheriktjacobsen: just a shot in the dark, try using a connection pool?
14:03justin_smithbut that is a huge overhead, and just creating a connection would not explaian a delay like that
14:04eriktjacobsenjustin_smith: thanks looking into c3p0 now
14:06noonianverma: you can probably do (= (array) js/Array)
14:06noonianverma: i mean (= (type (array)) js/Array)
14:09xeqiis there a core.logic relation to say something is a symbol?
14:09vermanoonian, checking
14:10vermanice, that works, that check is a function against functin check :)
14:10noonianyep :)
14:10verma(type (array)) returns a function like object
14:10verma:P
14:10verma(inc noonian)
14:10lazybot⇒ 6
14:10noonianyeah, just typing Array in a js console returns the same thing pretty much
14:11vermaoh yes, true
14:11noonianbecause in js the constructor function *is* the type
14:12vermathis is however, far better type checking compared to what native js offers
14:15eriktjacobsenjustin_smith: hmm the current c3p0 seems broken… as soon as I add [jdbc.pool.c3p0 :as pool] to require, it causes java.jdbc to break “Could not locate jdbc/core__init.class”
14:15doctormCan any vim-fireplace users tell me what :Require is supposed to do? I was thinking you could use it to eval a namespace in your repl, but all it does for me is pitch an error.
14:15mister_zombieHow would I go around packing my compojure app as a standalone jar I can run?
14:16justin_smitheriktjacobsen: hmm - you may need to exclude its version, or it may be developed against an archaic version of jdbc
14:17mister_zombieI put a "main" setting in my project.clj, pointing to the correct namespace, but I don't know what to do after that.
14:17eriktjacobsenI think its just out of date… deps tree doesn’t show it trying to include jdbc: “ [clojure.jdbc/clojure.jdbc-c3p0 "0.3.0"]
14:17eriktjacobsen [com.mchange/c3p0 "0.9.5-pre8"]
14:17eriktjacobsen [com.mchange/mchange-commons-java "0.2.7"]
14:17eriktjacobsen
14:18noonianmister_zombie: just run 'lein uberjar' from the project directory; you will need a -main fn defined for the entry point
14:18mister_zombienoonian: What do I put in the main?
14:18noonianmister_zombie: it will create a verbosely named jar in target
14:19noonianmister_zombie: in project.clj under :main put a symbol telling it what namespace your -main function is in
14:19noonianand in that namespace have a (defn -main [& args] (println "hello world"))
14:23kjellskijust starting out with clojure, wasn't there a syntax element that lets you specify the var and functions to apply to it all after each other? and you don't need to repeat the var all the time?
14:23justin_smitheriktjacobsen: to back up and take a different tack for a moment: you could profile (the jdk comes with jvisualvm for example) and figure out what the app is trying to do when those delays happen
14:23justin_smitheriktjacobsen: or maybe even jstack (command line utility, shows all stack traces of all threads)
14:24eriktjacobsenkjellski: You can pipeline stuff such as (-> data fn1 fn2 fn3 fn4)
14:24kjellskieriktjacobsen, agh, I'll fiddle with that one in the repl :) is it a macro?
14:25nooniankjellski: if you want to do things to the return values you can use '->' for java object interop (like using a bunch of setters) you can use (doto (MyObj.) (setSomething "bar") (setSomethingElse "baz"))
14:25justin_smithkjellski: if you repeated the var you would not get stacked results - do you want a sequence of stacked effects, or parallel operations on the original?
14:25nooniankjellski: yeah its a macro
14:25noonian,(macroexpand-1 '(-> {:foo 17} (assoc :bar "bar") println))
14:25clojurebot(println (assoc {:foo 17} :bar "bar"))
14:25mikerodI'm a bit saddened that http://dev.clojure.org/jira/browse/CLJ-1224 is not making it into clj 1.7
14:26kjellskinoonian, ah, I needed this for javascript interop, that might help to set some stuff on easeljs shapes, thanks!
14:26mikerodI can't wait until records can make efficient keys in maps
14:26nooniankjellski: yeah, np
14:26kjellskiI think doto is what I needed :) thanks @all!
14:26puredangermikerod: I'll take the hit on that one, sorry (just didn't get to screening it)
14:27mikerodpuredanger: I forgive you. hah :-P - It's ok. Transducers sooner than later is a Good Thing.
14:30mister_zombieI get this when I try to compile or run now : Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V, compiling:(ring/middleware/params.clj:1:1)
14:31kjellskinoonian, much cleaner, thanks :)
14:32mister_zombieProject file: http://pastie.org/9635118 code file: http://pastie.org/9635122
14:38nkozocore.async question: I have a go-loop receiving data from a chan, it must be sure the data is not mutated after is sent to his chan, there is a way to make the chan execute a transformation function (to clone the data) everytime an element is put into it, but synchronously? I mean, when (>! c v) returns is assured v is already transformed to v2, and the go-loop only sees v2 values
14:42weavejesternkozo: You’re sending mutable data through a channel?
14:42nkozoweavejester: is a compromise
14:43weavejesternkozo: What’s the situation?
14:43nkozoi want to keep a client api simple, so they can send bytebuffer's over the chan without doing anything special
14:44nkozonever used chan transducers / pipelines, so I'm not sure this is possible
14:45weavejesterWhy would the client want to send bytebuffers over a channel?
14:46nkozoto compose network packets
14:47weavejesterOkay, so the client is sending a byte buffer to a channel, which is then being delivered to a socket or somesuch?
14:47nkozoyep
14:47weavejesterWhat’s the purpose of using a channel?
14:47nkozoasynchronicity
14:47nkozoand homogeneous api
14:48nkozoi know there are other alternatives, I want to know if this specific one is possible :)
14:48weavejesterWhy a bytebuffer over something like an array?
14:49weavejesterSo you want a channel that clones the data coming in to ensure immutability?
14:49nkozoarrays are mutable also, same problem
14:49nkozoweavejester: exactly
14:50nkozoweavejester: executes a function when a value is put in him and uses the return value as the new one
14:50weavejesterIs cloning a bytebuffer each time more efficient than just using a vector?
14:50nkozosuposse yes :)
14:51weavejesterOkay, I’ll suppose you’ve benchmarked it
14:51weavejesterYou could use clojure.core.async/map> I believe to apply a function to the input before putting it on the channel
14:52nkozono, I'm doing only a thinking exercise, also to learn the core.async api
14:52Bronsaweavejester: well each assoc/dissoc on a vector you're always cloning at least one array
14:52clojurebotExcuse me?
14:52Bronsaerr, conj
14:52weavejesterBronsa: Yeah, but the arrays are a fixed and relatively small size.
14:53Bronsaright
14:53weavejesterBronsa: Cloning a byte buffer n times is likely to be less efficient, I suspect, than putting the byte buffer into a vector once.
14:54weavejesterBut for a hypothetical exercise, I guess that doesn’t matter
14:54Bronsaweavejester: yeah, depends on the size
14:56weavejesterDoes anyone happen to have any suggestions for what to name a function that takes in a configuration and spits out a handler?
14:56weavejesterI was thinking “endpoint”, but that might be a little overloaded
14:56justin_smithendpointFactory
14:56justin_smith(not really)
14:56kjellskiis there something like a step function that creates a lazy seq of numbers as is defined by the gap between the numbers?
14:57llasram,(range 1 10 2)
14:57clojurebot(1 3 5 7 9)
14:57mister_zombieWould any of you mind telling me what I'm doing wrong? "lein run" fails, and so does "lein uberjar" — Project file: http://pastie.org/9635118 code file: http://pastie.org/9635122
14:57kjellskillasram, thanks! :) I only tried the second argument!
14:57nkozothe general problem is how to put a mutable value1 to a chan and making the chan executing automatically a function that extracts an immutable value2 from value1, sends value2 to the chan reader and makes (>! c value1) return after value2 was extracted (so value1 can be safely mutated)
14:58danneumister_zombie: what's the err
14:58weavejestermister_zombie: You’ve specified your main function as a handler function.
14:59danneuyeah, your root handler is millepattes.handler/app
14:59danneuyour -main fn is a fn that boots the server
15:00weavejesterYou also have (use ‘ring.adapter.jetty) sitting at the top level for some reason
15:01weavejesterBut then refer to jetty/run-jetty down at the bottom
15:01noonian:ring {:handler millepattes.handler/-main} should be millepattes.handler/-main instead
15:01noonianer millepattes.handler/app instead
15:12mister_zombieSo I corrected the thing for :ring, how do I make my -main okay?
15:12weavejestermister_zombie: You have a bad ‘use’ statement at the top you need to fix.
15:13weavejesterYou want to remove it, and add: [ring.adapter.jetty :as jetty] to your requires
15:17noonianmister_zombie: yeah, your -main function looks ok to me, you just need to fix the other little things that are throwing errors when the namespace gets loaded
15:18mister_zombieI get this now: Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V, compiling:(ring/util/servlet.clj:1:1)
15:19weavejestermister_zombie: Oh, you have an ancient ring-jetty dependency in your project file for some reason
15:19weavejestermister_zombie: Update it to 1.3.1
15:20vermaman I can never get vim-fireplace + piggieback to work correctly, it was working fine, and now its totally stopped working, no matter what I do, it never starts
15:20weavejestermister_zombie: It’s worth noting that with lein-ring you don’t need a -main function, since lein ring server / lein ring uberjar cover its usecases
15:21mister_zombieweavejester: Really? lein ring uberjar was all I needed? XD
15:22weavejestermister_zombie: Yes, so “lein ring server” will start up a dev server, and “lein ring uberjar” will create an uberjar with an automatic main function
15:24vermaanyone here use vim-fireplace + piggieback?
15:28mister_zombieThank you all, much appreciated
15:32mister_zombieSay I want to deploy to an application container, would the uberjar do just fine?
15:33kjellskiIs there an easier way to create this squence of vectory then this?
15:33kjellski,(map vec (partition 2 (interleave (range 0 1000 100) (range 0 1000 100))))
15:33clojurebot([0 0] [100 100] [200 200] [300 300] [400 400] ...)
15:35TimMc,(map (fn [x] [x x]) (range 0 1000 100)))
15:35clojurebot([0 0] [100 100] [200 200] [300 300] [400 400] ...)
15:35TimMckjellski: ^
15:36kjellskiTimMc, :D thanks, now I feel like I haven't seen the obvious solution...
15:40weavejestermister_zombie: The uberjar is for standalone apps, but there’s an uberwar option (lein ring uberwar) for deploying to servlet containers
15:41doctorm_verma: I got disconnected, did you get an answer to your Piggieback question?
15:41mister_zombieweavejester: Awesome
15:44aztakgood evening!
15:44mmgis there a way to see jvm parameters in the clojure rpl? specifically -Xmx ?
15:45dbasch,(System/getenv)
15:45clojurebot#<AccessControlException java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.*)>
15:45dbaschmmg try that
15:45amalloydbasch: that's not and environment var
15:45aztakmmg: I think you need to hit the JMX subsystem to get info about -Xmx params
15:45dbaschdepending on how you ran the jvm I guess
15:45aztak(Runtime/getRuntime et. al)
15:47dbasch(.totalMemory (Runtime/getRuntime))
15:47amalloyi don't think that actually works, does it?
15:48amalloyif your heap hasn't grown to use up all the space allocated yet, then .totalMemory only returns the heap size
15:48aztakmmg: http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html or if you need more info: http://docs.oracle.com/javase/7/docs/api/index.html?javax/management/remote/JMXConnectorServerMBean.html
15:48amalloythat is, it returns the current heap size, not the max heap size
15:49mmgthanks!
15:49mi6x3mdoes anyone have some experience with lein-resource?
15:49amalloyman, it is really hard to find the right words to distinguish between "size of heap" and "size of objects allocated on heap"
15:50aztakamalloy: used/committed/max ? :)
15:50amalloyexcellent, well done
15:52dbaschactually why do you need to know Xmx from a repl? Did someone else run the repl?
15:52dbaschotherwise it’s whatever you told it
15:55amalloydbasch: like an episode of the price is right? "we started this clojure repl...now guess how much ram it has!"
15:55mi6x3mis there any piece of code to edit leiningen structures
15:55mi6x3mlike removing a dependency
15:58dbaschamalloy: am I allowed to do stuff inside the repl before guessing? That may be fun
15:59amalloyyou can do whatever you want, we're not really on tv
16:08nooniani'd watch that tv show if it existed
16:11vermadoctorm_, no :(
16:11doctorm_verma: What are you trying to use it with? I’ve got it to work with weasel successfully
16:12vermadoctorm_, I just have a cljs project, which I connect over the default austin repl (rhino) and its been sort of unpredictable
16:12vermait works sometimes and everything is great, but then just totally stops
16:12vermadoctorm_, I've been hearing about weasel, let me check that
16:13doctorm_verma: Give it a shot, I haven’t tried austin, because I heard about similar things happening
16:13vermadoctorm_, I would hope that its austin specific stuff that's not working, and piggieback is doing its job fine :)
16:14doctorm_verma: Cool, ping me if you run into trouble connecting to weasel
16:14vermadoctorm_, sure thing, thanks!
16:17amalloyhuh. i just got a stack overflow from running `lein deps :tree`
16:17technomancyamalloy: 2.5.0 or older?
16:17amalloyoh, for sure. 2.3.4, apparently
16:19technomancyshould be fixed, yeah
16:19amalloywhat was the issue?
16:19technomancydunno; xeqi fixed it iirc
16:20TimMctechnomancy has people for that kind of thing
16:24m1dnightIs there a cleaner way to check "(or (= x y) (= x z))"?
16:24technomancy(#{y z} x)
16:25m1dnighthah! I knew it! :) Thank you
16:27amalloyunless one of y or z is false or nil
16:27m1dnightnope, checking if a keyevent is either one or the other
16:27justin_smith(contains? #{x y} z)
16:28m1dnightI'm jealous of the people who write proper functional code
16:29m1dnightI try,but I don't always manage. Kinda stuck in OO coding.
16:31dbaschm1dnight: your or statement is perfectly functional
16:32dbaschI see nothing unclean with it btw
16:32m1dnightwell, yes it is. But byfunctional I mean the dense functional code that you can never get in OO or other languages
16:32m1dnightAn experienced functional programmer writes way more elegant FP code than somebody like me
16:32m1dnightAnd I envy that :p
16:35ustunozgura bit off-topic but , is anyone aware of any articles that compares functional programming and frequency domain representation of signals?
16:35ustunozguras in oop vs functional ~ time domain vs freq domain
16:35justin_smithustunozgur: I found a great paper applying information theory to code reading / bug detection
16:37ustunozgurjustin_smith: which one is it?
16:39justin_smithustunozgur: http://macbeth.cs.ucdavis.edu/natural.pdf
16:40ustunozgurThank you.
16:42ustunozgurRichard Hamming also had some thought on the matter in his Art of Science and Eng book. A quote: "Until we better understand languages of communication involving humans as they are (or can be easily trained) then it is unlikely many of our software problems will vanish."
16:43ustunozgurit's chapter 4 for the curious worrydream.com/refs/Hamming-TheArtOfDoingScienceAndEngineering.pdf
17:01_pr0t0type_Hey guys, is there a gdb/pdb for lein projects I can to set break points?
17:01_pr0t0type_I want to be able to halt the application at some line and inspect stuff
17:07ustunozgur_pr0t0type_: http://www.reddit.com/r/Clojure/comments/28udm4/does_clojure_have_a_breakpoint_capable_debugger/
17:08vermadoctorm_, even the regular non-weasel stuff is failing the same way, e.g. (cemerick.austin.repls/exec)
17:10vermadoctorm_, and (cemerick.piggieback/cljs-repl) never returns the prompt back :(
17:10vermagoing on a killall frenzy
17:11technomancy_pr0t0type_: breakpoints are easy as long as you don't need stepping
17:11vermaok, I had a ton of zombie repls running, checking again
17:12vermaok, got a prompt this time :)
17:19seangroveWow, madness http://1010.co.uk/gneve.html
17:20amalloyseangrove: if you can't do it in emacs, it's not worth doing, after all
17:22amalloy40,000 lines of warnings from `lein deps :tree` about conflicting dependency versions. kill me now
17:22mgaareseangrove: I must use this
17:23jeremyheileramalloy: i'l rm -rf your code base if you'll rm -rf mine
17:25vermaok, I am done with this shit man :( .. what's a good starting point into trying emacs with clojure?
17:25vermaI am going to use it with evil mode of course :P
17:26jeremyheilerverma: i switched cold turkey from vim
17:26jeremyheileri felt like evil-mode would've just gotten in the way of properly learning emacs
17:27vermaI don't want to really learn emacs :( .. I just want a good dev env for clojure, and vim + fireplace is failing me right now :(
17:27noonianverma: clojure for the brave and true has a good walkthrough for getting emacs setup nicely with clojure: http://www.braveclojure.com/
17:27jeremyheilerverma: have you tried intellij with cursive?
17:27technomancyverma: the one at clojure-docs.org is good too
17:27technomancyhttp://clojure-doc.org/articles/tutorials/emacs.html
17:28mgaareverma: emacs prelude is not a bad starting point either
17:28technomancycider's super unstable ATM though
17:28eriktjacobsenI just use Vim and a repl in another window… honestly I dont think you need fireplace or any workins
17:28WildBamboo-JoshJust be aware that if you go down the Cider route in Emacs, I think it's advisable to stick to the stable 0.7 version. 0.8 is a big rewrite and quite unstable at the mo
17:28noonianyeah, even with emacs i use lein repl most of the time
17:28technomancyeven 0.7 isn't that stable
17:28WildBamboo-Joshoh ok, lol
17:29jeremyheileri thought 0.7 was a big rewrite..
17:29vermaeriktjacobsen, its nice to be able to send stuff to repl sometimes I guess, do you have a workflow for that?
17:30vermatechnomancy, noonian WildBamboo-Josh so emacs + cider 0.7 is the recommended way right now?
17:30brehautjust use melpha, then nothing will be stable, and cider will seem like a rock
17:30eriktjacobsenI generally have a split off on the side with repl-friendly macro-expanded or variable-injected values ready to copy / paste
17:30technomancyverma: I would stick with 0.6 or nrepl.el
17:30eriktjacobsenJust a scratch buffer that never gets saved, just for common queries and expanded things
17:32WildBamboo-Joshbrehaut: lol
17:33amalloyeriktjacobsen: that sounds unbearable
17:33vermaeriktjacobsen, you copy and paste stuff?
17:34eriktjacobsenyup, two windows vertically split or on separate monitors, and 3 key strokes (copy,switch,paste)
17:34eriktjacobsennever bothered me and works fine over ssh
17:35technomancyoh good; the clojure-doc.org article no longer recommends ESK
17:35mgaarefor what it's worth, I run cider 0.8 and haven't really had problems
17:36dbaschverma: I downgraded from 0.7 to 0.6 a while back
17:36dbasch0.7 did not like something about my setup
17:36technomancythe simplest thing is just to use nrepl.el; it's still on marmalade
17:37brianwonghello, i am trying to catch a java.io.FileNotFoundException around 'with-open'
17:37vermatechnomancy, is it awesome?
17:37technomancyverma: it's ... fine?
17:37brianwongthe problem is, the file never closes when i catch this exception
17:37technomancyI haven't been keeping up with the fancy new features
17:37technomancybut it's enough for me
17:37brianwongis there a common idiom for this problem?
17:38brehauttechnomancy: time to implement nrepl directly in atreus
17:38brianwonghttps://www.refheap.com/91498
17:38brianwongso when a filepath is given that doesnt exist, the exception is caught, but the file isnt closed, so the program gets stuck
17:39mdrogalisbrianwong: I think with-open closes it in a finally block, no?
17:39brianwongi thought that was built into the macro as well
17:40brianwongthat is why im a bit confused
17:40dbaschbrianwong: if the path doesn’t exist, there is no file to close
17:40dbaschwhat do you mean the file isn’t closed?
17:40mdrogalisSeems to be https://github.com/clojure/clojure/blob/clojure-1.6.0/src/clj/clojure/core.clj#L3512
17:40mdrogalisYeah, heh. That's a good point, dbasch.
17:41brianwongdbasch, that is a good point. my command-line tool hangs with this try/catch
17:41brianwongif i remove the try catch, the exception just propagates as expected
17:42brianwongmaybe it is somewhere else in my prgram that doesnt handle the return value well
17:42brianwongill do more research
17:42dbaschbrianwong: check that the file exists before calling with-open
17:42dbaschor don’t use with-open, and do your own try/catch
17:42vermaman, I was in the middle of this awesome clojure flow, and now all this env issues :(
17:44brianwongthanks for the advic
17:44brianwongadvice
18:07m1dnightIf I want to use trace in a simple lein repl, where would I put the dependency?
18:07m1dnightI.e., not in a project workspace
18:09jeremyheilerm1dnight: the :dev profile in ~/.lein/profiles.clj, I think
18:10technomancyjeremyheiler: user profile actually
18:10m1dnightjeremyheiler: That worked!
18:10m1dnightDidn't know about that file :x
18:12jeremyheilertechnomancy: what differentiates user from dev?
18:12technomancyjeremyheiler: :dev is for per-project stuff
18:12jeremyheilergotcha
18:17_pr0t0type_clojure.data.json (json/read-str) returns a hashmap with strings as keys. Does anyone know how to make that return keywords instead during deserialization? ie from {"data" []} to —> {:data []}
18:18mister_zombieHow do I pull my namespace in the lein repl?
18:18AeroNotix_pr0t0type_: if you pass :key-fn you can run arbitrary stuff on the key of the JSON
18:18m1dnight(ns ..) ?
18:18m1dnightthat should work..
18:18AeroNotixso you could pass the function keyword
18:19m1dnightOr do you mean (use 'name.space) ?
18:19mister_zombieI have my stuff in some namespace, i'm in the root of the project (with the project.clj file), I want to toy with some functions in my namespace
18:20AeroNotixmister_zombie: is the namespace a part of the project where project.clj is
18:20SegFaultAXmister_zombie: You can just require/use it as normal.
18:20mister_zombieyes
18:21AeroNotixmister_zombie: lein repl will pull it in by default
18:21SegFaultAXmister_zombie: You can also use in-ns to operate in the context of that ns.
18:21_pr0t0type_AeroNotix: pass in? Can you elaborate a bit on that?
18:21AeroNotix_pr0t0type_: such as (json/read-str some-str :key-fn keyword)
18:22AeroNotixand it'll apply the function `keyword` to all keys in the JSON objec
18:22mister_zombieThanks!
18:22AeroNotixobject*
18:22mister_zombieSweet!
18:23_pr0t0type_AeroNotix: awesome, thanks dude!
18:23SegFaultAXmister_zombie: This is the de facto blog post on Clojure namespaces (including refer/use/require/import)
18:23SegFaultAXhttp://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
18:23AeroNotix_pr0t0type_: nw friend
18:23mister_zombieThanks!
18:24AeroNotixI want to draw bar charts from clojure -- any good/cool libraries?
18:24amalloyAeroNotix: 4clojure uses incanter
18:25AeroNotixamalloy: wow ok, that looks good
18:26dbasch_pr0t0type_: with cheshire you can do (parse-string str true) and it gives you keywords for keys
18:41doctormverma: Sorry, just got back. I can walk you through the way I set up weasel if you haven’t already mastered emacs. I’ll do a little write up and post it, although it is mostly documented on the github page.
18:44vermadoctorm, thanks! I am just looking at emacs right now, didn't really start anything yet, setting up evil mode right now.
18:44vermadoctorm, I am having trouble with all repls basically
18:45vermanot sure what to do
18:45vermaI can launch them from the command line lein repl .. and use the
18:45vermam
18:45vermabut only to a certain degree though, that stops working after a while too
18:46doctormverma: Yeah, it’s something I’m struggling with too. I’m in the process of moving to LightTable (just getting vimlike modal editing figured out there). vim-fireplace is good, but not quite good enough (mainly stack traces don’t seem to show in the repl, ever)
18:46vermaif you're writing a doc, you'd be doing a huge flavour to vim people wanting to use it for clojure dev, all resources are scattered around, and the docs mostly don't tell you exactly what to do, and I am too lazy to read so much stuff
18:47doctormBut I’ll still do a writeup with weasel, because that is something I got figured out, and I didn’t experience it breaking like you described
18:49vermalol, s/flavour/favor/g
18:55justin_smithdoctorm: stack traces may be suppressed there by default, there is always (clojure.repl/pst) which will show the most recent stack trace
18:55justin_smithor, more accurately, I should say, shows the stack trace for the most recent exception
18:57doctormjustin_smith: Thanks, I’ll check that out. It’s not the only reason for moving to LightTable, I also like the idea of using an editor whose architecture I can understand and is written in the language I’m using.
18:59eriktjacobsenjustin_smith: earlier you recommended jvisualvm…. any guides you’d recommend. I’m used to gdb / valgrind in c. Don’t see a call tree, and it seems so much time is spent in clojure.tools.nrepl.transport and various core stuff its hard to decompress
19:01justin_smitheriktjacobsen: if you want something like gdb, there is jdb
19:01justin_smithand as I mentioned, jstack will show a stack trace of every thread
19:04justin_smitheriktjacobsen: also, specifically in jvisualvm, the CPU profiler/cpu panel and the threads view may help you figure out what's happening with those long running jdbc queries
19:12lodinIs there any way to unload a class (created with deftype)? This is for auto reloading purposes.
19:13justin_smitheriktjacobsen: for example here is me profiling a call to jdbc: http://i.imgur.com/RJTZh2R.png notice the cpu time is in jdbc$get_connection and jdbc.util.ReadAheadInputStream.fill
19:13amalloylodin: if there are outstanding references to instances of that class you can't unload it, and if there aren't you don't need to
19:14amalloyprobably. i guess maybe that last bit isn't true?
19:14amalloytldr i don't actually know much about classloaders
19:15lodinamalloy: If I reload a file and the deftype has been removed, I can still reference it.
19:15eriktjacobsenjustin_smith: hmm first time using jvisualvm, what are you using for settings in “start profiling from” and profile / dont profile? Im not seeing any jdbc entries when profiling the jdbc code. looking up the jvisualvm docs now
19:15justin_smitheriktjacobsen: all I did was double click on the process on the left pane, and go to the profiler pane, then click on "CPU"
19:16lodinamalloy: And that's a problem, because next time I run it it will fail.
19:16justin_smitheriktjacobsen: it should all be evident from my screenshot
19:16lodinamalloy: I tried pretty hard to get rid of references, even remove-ns, but that didn't help.
19:16justin_smitheriktjacobsen: I never got an option of where to profile from, I just clicked on the CPU button, then ran my query, and watched those red bars move
19:17amalloylodin: yeah, indeed. i don't really know of a way to unload classes
19:17lodinI also found that doing the deftype repeatedly, overwriting the class with an identical class, leaks memory.
19:18justin_smithhttp://stackoverflow.com/questions/148681/unloading-classes-in-java this makes me think class unloading is incompatibe with how clojure does things
19:18justin_smiththe claim is that the only way to unload a class is to garbage collect the classloader that brought it in, clojure just uses one classloader
19:19amalloyjustin_smith: the first part of that is true, pretty sure the second isn't
19:19justin_smithor is it possible to specify a custom classloader in clj such that it can later be unloaded?
19:19eriktjacobsenjustin_smith: gotcha. with default settings i’m not seeing anything but clojure internals: http://imgur.com/R2VJMj6
19:20eriktjacobsenwill dig
19:20justin_smithfor doall to be doing that much, makes it sound like an expensive or very large lazy seq is being forced?
19:21justin_smithbut the fact that no jdbc classes show up there at all is suspicious
19:22amalloyjustin_smith: i think clojure makes a new DynamicClassLoader per eval request and daisy-chains them together, but it's probably more complex than that
19:22dbaschI wonder if all this is still accurate http://stackoverflow.com/a/7473707/586880
19:22eriktjacobsenthe internals of all those calls are the same. lots of clojure.core and clojure.lang, nothing from my own libraries or jdbc
19:23justin_smitheriktjacobsen: yeah, it makes me think something else that did not get captured is realizing something very large and / or very expensive
19:23justin_smitheriktjacobsen: it may be informative to look at the threads view and see which threads are working - many of them have informative names
19:24justin_smitheriktjacobsen: also, some jstack calls from the command line while a query is running should show where each thread is - the stack trace should reveal who is spending all this CPU time on a doall
19:37eriktjacobsenThank you a bunch for the info
19:37lodinjustin_smith, amalloy: So the conclusion is that no, it's not currently possible and probably won't be a for a while?
19:37amalloyi believe so
19:40doctormverma: https://www.refheap.com/91502
19:40doctormverma: While testing it, I ran into a bunch of different problems depending on the order I did certain things
19:42doctormverma: So try it out in that order, and see if you have any more luck. I’ll be away for a bit, but back later tonight. Let me know if it works
19:44xeqiamalloy: I believe it was a space leak from lazyness, though when I fixed that I redid most of the pedantic code and changed some algorithms
19:44amalloyxeqi: yeah, that sounds consistent
19:46TimMcNext week I'll be working on a wrapper for liverepl that will provide line-editing, injection of dependencies (w/ pomegranate), and limited classloader leakage
19:46TimMcWish me luck.
19:46lodinIs it worth submitting a bug report about (do (deftype Foo []) (deftype Foo [])) leaks memory? I.e., the shadowed class is not GCed.
19:48brehautlodin: hmm, i am super vague on the details, but i think classes are stored in the permgen, so theres no way to free them until the next vesion of java that ditches permgen is available
19:50brehautjava 8 is the version that ditches permgen
19:51TimMcThe permanent generation in Java's generational GC.
19:51brehautlodin: google JEP 122 as well
19:51brehautwhich is to say, the generation that is not collected (because its permenant)
19:52Jaoodwho needs clojure when you have java 8?
19:53hiredmanlodin: how sure are you it leaks memory?
19:54Jaoodtough crowd
19:54brehautJaood: you get more laughs with funny jokes ;)
19:54Jaood;)
19:54hiredmanhttp://dev.clojure.org/jira/browse/CLJ-1152 mentions some java command line flags to turning on logging of classloading/unloading
19:55lodinhired: I wouldn't put a number on it. :-) But it seemed to me, looking at the memory used by the java process, that it leaked.
19:55brehautlodin: a lot of non-reference count based collectors collect at non-deterministic times.
19:56hiredmanlodin: how comfortable are you monitoring the memory usage of a java process?
19:56hiredmanit is a known stumbling point
19:56brehautlodin: dead objects arent collected until there is a reason to do so (ie, memory pressure requires more free space)
19:56hiredmanmost jvms also don't return memory to the os, even if it is "free"
19:57hiredmanthey hang on to it incase they need it later
19:57lodinYeah I know, but I figured based on the previous discussion that the observation agreed with leakage.
19:57Jaoodgreedy jvm
19:58lodinSo let's take a step back. :-)
19:58hiredmanI think the gc behaviour of classes was a little more subtle then just "the never get gc'ed" even before java 8
19:58lodinIt looks like deftype leaks memory. Does it?
19:59hiredmanlodin: it may, or may not, I dunno, you haven't presented evidence either way
20:00lodinhiredman: I'm asking for evidence. :-)
20:00devnhiredman: im cribbing most of what you did on your branch to pull it into weavejester/lein-ring, but i got stuck... https://github.com/weavejester/lein-ring/pull/130
20:01devnwould be curious to know if you have any ideas
20:01mthvedtnew classes do not leak memory, they get garbage collected when the class is no longer referenced
20:01mthvedtsame with deftype
20:01hiredmandeftype in itself cannot leak memory
20:01mthvedtalthough in clojure you must explicitly remove the namespace
20:02mthvedtif your deftype is in one
20:02lodinmthvedt: Could you elaborate on that?
20:02hiredmanbut it generates a java class, and if the java runtime you are using (there are several) doesn't reclaim classes that could happen
20:02johannhey guys, i'm trying to write some images online to disk. i just tried using pmap and agents to make it concurrent. the images on disk aren't filling out to the full dimensions for reasons beyond me. anyone know what may cause this?
20:03mthvedthiredman: ok, the recent sun/oracle JVMs garbage collect classes.
20:03hiredmanthe ability to redef a deftype like you did using do depends on clojure's DynamicClassloader, which does keep a reference to classes in a map in a static field, but it only keeps the last class with a given name
20:03lodinhiredman: I did another test, and it does look like it just releases the classes later rather than sooner.
20:04lodinat least on this machine.
20:04mthvedtlodin: a class is no longer referenced in java when its objects, class objects, classloader, and “sibling” classes from the same classloader are all out of scope.
20:04mthvedt…if i remember right.
20:05TimMcclazz.parentNode.nextSibling
20:05TimMcoh wait, this isn't the DOM
20:05mthvedtin clojure you can achieve the class/classloader conditions by unmapping the ns, which i’ve actually done successfully in experiments
20:06mthvedtwith generating arbitrary numbers of deftypes
20:09amalloybrehaut: hasn't every version since like java 5 been the one that ditches permgen?
20:09amalloyit's not actually a "java" thing so much as a detail of various jvms, not necessarily all of them, anyway
20:10lodinmthvedt: I'm not sure I follow. How did you unmap the ns? remove-ns?
20:11mthvedtlodin: yes iirc
20:15devnhiredman: with your version of lein-ring, do you specify servlet-class and servlet-name, or is that not necessary? do you specify init and handler like you normally would?
20:25lodinmthvedt: I tried http://pastebin.com/1hiLyWpJ . What am I missing?
20:34mthvedtlodin: not sure tbh, been a while since i messed around with that. it looks like that shouldn’t happen though.
20:38squeedeeHey folks. Whats the general concensus on name collisions with core? Like i felt that 'lsystem.iterate' was a great function name...
20:40justin_smithsqueedee: :refer-clojure in your ns block
20:41lodinhiredmen: Can I call that a bug at least? ;-) (Seriously though, any insights into why it works like that would really be appreciated.)
20:41lodin*hiredman
20:42squeedeejustin so the idiom is to name things as they should be. Consumers just need to exclude?
20:42justin_smithwhy exclude? :use is bad anyway
20:42brehautamalloy: i think with java 8 you can actually download an oracle jvm that implements it
20:43brehautamalloy: perhaps as part of something called meatspace (if my rememberng is correct)
20:43brehaut(its probably not correct, that sounds nuts)
20:43amalloynot sure if serious...
20:43amalloymetaspaace
20:43squeedeewell i guess i should try it, but i thought you mean refer-clojure :exclude iterate
20:43squeedeemeant*
20:43hiredmanlodin: what are you trying to do?
20:44justin_smithsqueedee: oh yeah, I thought you meant consumers of your lib
20:44brehautamalloy: that sounds a lot more sane than my recollecting and would make more sense
20:44lodinhiredman: http://pastebin.com/1hiLyWpJ
20:44justin_smithsqueedee: yeah, use :exclude in :refer-clojure, name things the name that makes sense
20:44lodinhiredman: I want to get rid of the class.
20:44hiredmanlodin: you can't
20:45squeedeejustin_smith thanks :D
20:45lodinmthvedt, hiredman: I'm getting different bets here ...
20:45amalloyhuh, interesting. i got pull requests to flatland/useful this morning. i thought forks couldn't get pulls
20:45hiredmanlodin: I have mthvedt on ignore, so I have no idea what he is saying
20:46hiredmanlodin: but if he told you unmapping the namespace would do anything there he is very mistaken
20:47squeedeeamalloy on github?
20:48mthvedti don’t understand the passive-aggression
20:48amalloysqueedee: yes
20:48squeedeeamalloy: anything can get pulls
20:48squeedeeyou can make a pr to a branch
20:49dbaschpermgem was indeed removed in java 8, TIL
20:49squeedeeif its public, it can be done. fork or no fork
20:49dbaschPermGen
20:50squeedeebtw amalloy, you've helped me a lot today :D (with all your comments, stackoverflow and elsewhere)
20:51amalloyi have?
20:51squeedeeyep. most of the useful answers i've found today have been in part thanks to you.
20:55amalloyman, a whole heck of a lot of pull requests to amalloy/useful have piled up. apparently my notification settings were not sending them to me
20:56jeremyheileramalloy: finally!
20:56jeremyheilerlol
20:58amalloyweird. i was unwatching the repo
20:58lukecosseyAnyone ever tried to get the goog.fx.css3.Transitions working with Safari?? Every other browser is fine.
21:02amalloyhey, here's a pull request by me from two years ago. it is thoroughly unfamiliar to me: https://github.com/amalloy/useful/pull/13
21:06technomancyamalloy: happens to me all the time
21:06technomancy(github magically unwatching repos for me)
21:06amalloytechnomancy: it was a pull request to my own repo!
21:06amalloyoh
21:06vermathanks doctorm, I will give it a shot
21:06technomancyyeah, that one ... not so sure what's going on
21:07amalloytechnomancy: i expect the unwatching was my fault, as some weird side effect of splitting up the flatland stuff into amalloy/ninjudd/raynes repos
21:07technomancyamalloy: it's happened waaaaaay too often to me IME for it to be something I hit by accident
21:08lodinhiredman, amalloy, et al.: I'm off. Thanks for your comments and pointers.
21:09mthvedtlodin: still there?
21:09lodinmthvedt: Yes.
21:10mthvedtlodin: i’ve been playing with a repl/profiler, and it looks like i’m wrong about deftypes being GCed. however, NSes do get GCed, but only if unmapped.
21:11mthvedti’m not sure if that’s correct behavior, just a tidbit for you.
21:12lodinmthvedt: How did you get to the conclusion that deftypes not being GCed?
21:12mthvedtlodin: generated a large number of them and watched the profiler.
21:13mthvedtthat is, a number larger than current allocated memory.
21:14lodinmthvedt: That's what I did as well, but I don't know enough about how JVM and the OS handles memory to be certain I interpret that correctly.
21:15lodinExcept I didn't use the profile. I just watch the java process memory.
21:16justin_smithlodin: wouldn't one test be to see if you can make the jvm run out of space? give a relatively low max permgen and max heap, then repeatedly make classes that should be collectible. See if you can make it crash just doing that.
21:16mthvedtlodin: sun/oracle JVM will prefer garbage collecting to expanding the heap. growing heap + a lot of objects hanging around = they aren’t being garbage collected.
21:16justin_smithalso, profiling is not super hard, the jdk comes with a profiler, other ones are not hard to find
21:18lodinjustin_smith: Yeah, this has given me a reason to look into profilers and JVM settings. I'm not a java guy, so this is new territory for me.
21:18vermacrap, trying to start cljs env in cider nrepl gives me this: UnsupportedOperationException count not supported on this type: Symbol clojure.lang.RT.countFrom (RT.java:556)
21:18vermahas anyone seen this before?
21:28vermawhat is this page basically asking me to do? (sorry for off-topic)
21:28vermahttp://www.emacswiki.org/HighlightCurrentLine
21:29vermais it asking me to (require 'hl-line) ?
21:30justin_smithverma: if you want to load that library, yeah that's how you would do it
21:31justin_smiththen you would turn on the minor mode in a buffer where you want it
21:31justin_smithverma: you can do it interactively via M-:
21:31justin_smithfollowed by M-x hl-line-mode in any buffer where you want it turned on
21:31vermajustin_smith, I want to highlight the current line, really, that means I load that and set some variable to enable it?
21:31vermaoh ok
21:31justin_smithit's pretty intense, I am turning it off again now
21:32vermahow do I get it to enable all the time? (setq hl-line-mode 1) in ~/.emacs ?
21:32justin_smithrequire loads conditionally, just like in clojure
21:32arrdemGrimoire beta build if anyone cares to kick it around http://arrdem.com:4000
21:32arrdemlooks like there are six bots in this channel that crawl everything..
21:32justin_smithverma: hl-line-mode is buffer local, though there may be a global variant
21:32justin_smithglobal-hl-line-mode
21:32justin_smithyeah
21:32vermajustin_smith, nice thanks
21:33vermaits looks nice, its not that intense :P
21:33justin_smithmaybe it just sucks with my color scheme
21:33danielcomptonamalloy: thanks for the quick build, I was just about to make an internal release
21:33vermanow i need horizontal line and I'd be one step away from CAD software
21:33vermaI mean vertical
21:33justin_smithhaha
21:33justin_smithI am sure it is possible
21:33arrdemverma: there's a script I saw a while back that did both...
21:33vermayeah, I stumbled across it just now
21:34justin_smithverma: it would be cool to have it as a hairline crosshairs overlay
21:34justin_smithrather than highlighting the entire line
21:34vermamedia would so pick that up
21:34amalloydanielcompton: of useful? i actually haven't pushed the release to clojars yet. i can't figure out how to without going into the office, since clojars no longer takes scp uploads and i'm not set up here to do whatever the new stuff is
21:34vermahackers targetting your bytes
21:34lodinjustin_smith, mthvedt: I tried what justin_smith said, and to me it seems like it collects the classes when the memory limit is hit.
21:35danielcomptonamalloy: also, just saw that we need to go to 0.11.3
21:35danielcompton0.11.2 was released in feb https://github.com/flatland/useful/commit/bdd3634cce5f42ae2e3e8d0cba449a47a45c2cd7
21:35justin_smithlodin: if you attach jvisualvm, there is a histogram of memory usage and gc events, you should see a nice chart of it
21:35mthvedtlodin: interesting, can i see a refheap?
21:37danielcomptonamalloy: no idea why that commit doesn't show up in https://github.com/flatland/useful/commits/develop/project.clj
21:38vermawhat do people usually use here to open files super fast? something similar to ctrlp in vim?
21:38danielcomptonverma: clojure.java.io is usually fast enough
21:38dbaschamalloy: there’s a lein target for deploying to clojars now, but you have to set up gpg first
21:38amalloydbasch: yeah, i have that all set up at work
21:38dbaschI did that a couple of days ago
21:39dbaschit takes a minute
21:39vermadanielcompton, oh sorry, should have mentioned, I am off-topicing a little bit, was interested in something like ctrlp+vim for emacs
21:39amalloyor i think i do, anyway. i'm even ssh'd into work, so you'd think it would work, but something weird happens to the gpg agent
21:40vermathis looks like exactly what I need: https://github.com/d11wtq/fiplr
21:41technomancyI use https://github.com/technomancy/find-file-in-project/
21:41technomancybut that's probably just because I wrote it
21:42verma:D
21:42vermatechnomancy, that's awesome!
21:42vermatechnomancy, you have a screenshot of what it looks like? is it fuzzy finder sort of?
21:42technomancyit is??
21:42lazybottechnomancy: Uh, no. Why would you even ask?
21:42lodinmthvedt: jvisualvm confirmed that the classes are GCed. No need to use ns-remove either.
21:42mthvedtlodin: and these are deftypes?
21:43technomancyverma: it looks the same as the one you linked to
21:43lodinmthvedt: Yes. I did eval of deftype in a doseq.
21:43mthvedttonight i’ve gotten gc to work with ordinary stuff like evaling to get a closure, but not with deftypes
21:43mthvedtcan i see?
21:43vermatechnomancy, oh
21:44technomancyverma: oh, mine requires GNU find FWIW
21:44lodinmthvedt: Yeah, maybe we're talking about different things.
21:44technomancyI should add a readme... I wrote this in 2007 or so
21:45vermaI think I will use flipr, since it has a screenshot and a readme :P
21:47technomancyI'm heartbroken
21:49technomancyhttp://p.hagelb.org/10sad.gif
21:49lodinmthvedt: I do (doseq [_ (range 100000)] (eval (read-string "(deftype Foo [])"))) and once it hits about 40000 classes in my case (-Xmx100m and -XX:MaxPermSize=100m), it collects all but 3000-5000 of them.
21:51scottjfake! a) technomany no longer lives in rainy seattle, but sunny southern california. b) no facial hair
21:53lodinmthvedt: I apparently had a rather large permgen size when I first tested it.
21:53technomancyscottj: [artist's conception]
21:54amalloywait, does technomancy really live in southern california now?
21:54lodinjustin_smith: jvisualvm was brilliant for seeing this. Thanks.
21:55technomancyamalloy: san diego area
21:55amalloywhy was this not on the evening news?
21:56technomancyI'm on the run from the law
21:56arrdemwait that would have _put_ it on the evening news...
21:56mthvedtlodin: which JVM are you using? this is not working for me.
21:57mthvedtand also which clojure?
21:57Jaoodthe NSA is after him, to much stallman koolaid
22:00vermaman why does fiplr look different for me, its fuzzy search sucks as well :( .. I just see all matches concatenated and not listed like from top to bottom like in the screenshot
22:00technomancyverma: that's ido-vertical
22:00hiredmanclojurebot: technomancy is on the run from the three laws of robotics
22:00Jaoodtechnomancy: doesn't ido do fuzzy matching?
22:00clojurebotYou don't have to tell me twice.
22:01technomancyJaood: that's another setting too
22:02technomancyido-flex-match iirc
22:02technomancyit's *simple* =)
22:02scottjimo best to look at flx and flx-ido
22:02vermatechnomancy, so I don't need fiplr at all?
22:02scottjif you want fuzzy matching on from the start. default is only to do fuzzy if there are no non-fuzzy matches
22:02technomancyverma: different libs/settings do different things. what do you want?
22:03vermaCtrl-T -> shows file listing from current directory -> I type in a few characters for the file I am interested -> finds and highlights most relevant result -> I hit enter -> opens the selected file
22:04technomancyfind-file-in-project doesn't bias in favour of the current dir
22:04vermawhat does it favor?
22:04technomancyhistorical chocies
22:05vermaoh?
22:05technomancyif you want something in the current dir, just use C-x C-f
22:05mthvedtlodin: try (doseq [_ (range 1000000)] (eval `(deftype ~(gensym "Foo") []))) , should cause an OOM.
22:05vermaso it would remember sort of which projects I am working on etc.?
22:05mthvedtwhat i think is happing is clojure keeps references to each class name hanging around. so if you keep redefining Foo, this won’t cause an OOM.
22:06lodinmthvedt: clojure 1.6.0, and java 1.7.0_51 on 64-bit Win 8, and clojure 1.6.0 java 1.7.0_21 (openjdk) on 64-bit linux mint.
22:06technomancyverma: it won't look beyond the current project
22:07technomancydunno what flipr does
22:07brehauttechnomancy: isnt that a startup?
22:07vermaI added a ton of folders to ignore (5 actually) and it seems to be finding stuff that I want
22:07technomancybrehaut: it's a good bet
22:07lodinmthvedt: That makes sense. It shouldn't be release, because you might want to use it. Right?
22:07vermaearlier I would search for core.cljs and it would open something I don't care about under .repl/...
22:07vermaso now .repl is in ignore list sort of
22:08brehauttechnomancy: i guess flipr spends a lot of venture moeny with no actual business plan, and tries to get bought by facebook then
22:08vermabrehaut, isn't that called enterpreneurship :P
22:09mthvedtlodin: right. but in a more complicated example where you remove the ns periodically, i still get OOM. my understanding of remove-ns is it’s supposed to remove those mappings.
22:09vermathanks for all the help technomancy
22:09verma(inc technomancy)
22:09lazybot⇒ 143
22:09vermaoh jeez
22:09verma:D
22:09vermahow do you see score without incing?
22:09arrdem(identity verma)
22:09lazybotverma has karma 0.
22:09vermaoh what?? :(
22:10arrdem(identity amalloy)
22:10lazybotamalloy has karma 173.
22:10Jaood(dec verma)
22:10lazybot⇒ -1
22:10verma:(
22:10arrdem(dec Jaood) ;; MAD at work
22:10lazybot⇒ 3
22:10verma(inc verma) ; :P
22:10lazybotYou can't adjust your own karma.
22:10verma:D
22:10nullptr(map identity [Jaood verma])
22:10Jaoodonly 170 left to be amalloy
22:11lodinmthvedt: Yeah. I would've expected that as well.
22:11verma(identity verma)
22:11lazybotverma has karma -1.
22:11verma:D
22:11vermaIts like I belong to the dark side
22:11Jaood(inc verma)
22:11lazybot⇒ 0
22:11Jaood(inc verma)
22:11lazybot⇒ 1
22:11vermalike just started getting dark
22:11Jaood(inc verma)
22:11lazybotDo I smell abuse? Wait a while before modifying that person's karma again.
22:11verma:(
22:11Jaood(inc verma)
22:11lazybotDo I smell abuse? Wait a while before modifying that person's karma again.
22:11mthvedt(inc lazybot)
22:11lazybot⇒ 31
22:11arrdemlol @ ratelimit
22:12verma:)
22:12amalloyclojurebot: what does abuse smell like?
22:12clojurebotTitim gan éirí ort.
22:12bar1(inc verma)
22:12lazybot⇒ 2
22:12bar1(inc verma)
22:12lazybot⇒ 3
22:12bar1(inc verma)
22:12lazybot⇒ 4
22:12bar1(inc verma)
22:12lazybotDo I smell abuse? Wait a while before modifying that person's karma again.
22:12bar2(inc verma)
22:12lazybot⇒ 5
22:12bar2(inc verma)
22:12lazybot⇒ 6
22:12bar2(inc verma)
22:12lazybot⇒ 7
22:12vermalol
22:12lodinmthvedt: As the paste above showed, the class survives the remove-ns.
22:13mthvedtlodin: yup
22:14vermaargh, super annoying that my repl opens in a horizontal split
22:14Jaoodverma: with cider?
22:15vermayeah
22:15vermaJaood, ^
22:17Jaoodverma: depending on your window size it chooses vertical vs horizontal split
22:17vermaoh
22:17vermancie
22:17vermanice
22:18Jaoodbut moving it its trivial anyway :)
22:18vermaoh nice
22:18vermait did split nicely now :)
22:19lodinmthvedt: If you find some hack to get rid of (or even just hide) the class when the ns is removed, please let me know. :-)
22:25arrdemambrosebs: the idea is that /store and friends will represent a .m2 equivalent structure that you can walk to see other artifacts/groups
22:26arrdemambrosebs: UI needs work I guess... but the idea is that core.typed, tools.analyzer and the rest can sit in the same tree now with no changes
22:27ambrosebsarrdem: nice
22:28arrdemadding articles now so there's a structure for sharing long form commentary like destructuring and macro notes
22:28arrdemor even just linking to other resources in a sharable (across documentation) way
23:21ghadishaybanreiddraper: I'm using test.check to verify transducers vs. lazy seqs right now... it's not supposed to be this fun!
23:21arrdem(inc reiddraper)
23:21lazybot⇒ 3
23:21arrdemoh that's just wrong
23:22ghadishaybanI am trying to think of the minimal crappy functions to map and mapcat and take-while with
23:22reiddraperghadishayban :), i'm sure we'll all be curious to see the results
23:22ghadishaybanbut I'm not doing a very good job yet
23:22reiddraperfun project to play with though
23:23ghadishaybanI'm ending up with functions like (drop-while odd? (filter even? (range...)))
23:23ghadishaybanwhich is blowing up the jvm
23:24reiddraperah fun, hmmm
23:25ghadishaybanhow to balance having a good test of a chain of collection transformers that doesn't need the halting problem solved?
23:25ghadishaybanvs. just getting it working but having it be a so-so test
23:25ghadishaybani'd pay a beer for the latter right now
23:25reiddraperindeed
23:26reiddraperit's often fruitful with property-based testing to start with a worse test, assure yourself the SUT is correct, and then improve the test
23:26reiddraper(correct w/r/t the current state of the test)
23:28ghadishaybanYeah I'm using the same generator for arguments to filter and remove
23:28ghadishaybanwhich is broken if they're both in a chain of operations with the same args
23:29ghadishaybanfor a minimal SUT I'll just vary the operations themselves, but not the arguments to them
23:33reiddraperseems like a great start
23:51ghadishaybanboth bugs christophe grand found today were related to r#'educed handling
23:52ghadishayban#'reduced
23:52ghadishaybanto check collections, you'd want to exercise that well.