#clojure logs

2015-06-03

03:49alanforrHello. Could anyone tell me how to use dev dependencies in a Leiningen project?
03:56andyf_alanforr: You mean, you want an example of the syntax for specifying them? Or you want to know what they are useful for?
03:57andyf_alanforr: Here is one example of the syntax for specifying dev dependencies: https://github.com/jonase/eastwood/blob/master/project.clj#L13-L26
04:04alanforrI know to specify dev dependencies. But when I use "lein repl" and try to require the dev dependency lein tells me that it can't locate the dependency on the class path.
04:05andyf_Do you have a small example handy?
04:07andyf_for example, what dependency do you have in your project.clj as a dev dependency, and what namespace are you trying to require?
04:10alanforrThe dependency is [criterium "0.4.3"].
04:11alanforrThe namespace doesn't include criterium by default, but when I had criterium in ordinary dependencies it would load without a problem when I required it.
04:12andyf_You do 'lein repl', then (require 'criterium.core) and it fails?
04:13alanforrlein real then (require '[criterium.core :as c])
04:13alanforrrepl not real.
04:14andyf_Can you put the project.clj in a paste somewhere? I tried a small project like that and the require worked for me.
04:16andyf_Here is the one I tried that worked for me: https://gist.github.com/jafingerhut/b7135a545241889fdb2b
04:19xyz_Hello, not sure if this is ok, but I just posted a question on stackoverflow related to clojure/friend (http://stackoverflow.com/questions/30614474/basic-http-auth-in-clojure-friend). I need some help setting it up, it would be great if someone could help.
04:20alanforrthe project.clj is here https://gist.github.com/alanforr/7854dfb0f15b135660cb
04:20andyf_I am pretty sure you need the :profiles keyword in there, too.
04:21kasterma:dependencies needs one more set of []
04:21kastermacompare the dependencies one level up
04:21kasterma(dev dependencies I meant)
04:22andyf_Oh, yeah, and the value of dependencies needs to be a vector of vectors.
04:24alanforrOkay, fixed the problem. Thanks.
04:26andyf_Makes me realize that it would be nice if Eastwood linter checked project.clj file contents
05:05IgorLHello, does somebody know why the error occurs https://www.refheap.com/102043 ?
05:16SagiCZwhen i want to test if something is not nil is this sufficient?
05:16SagiCZ(when val (println "val is not nil"))
05:16amalloythat's a funny error, IgorL. i don't know what it means, but maybe some kind of filesystem character encoding thing?
05:19SagiCZwhy cant recur be inside of try block? :(
05:29SagiCZis this true?
05:29SagiCZ(complement (nil? val)) === val
05:31EmpperiSagiCZ: no
05:31Empperi,(complement (nil? "wut"))
05:31clojurebot#object[clojure.core$complement$fn__4378 0x6f7cb8b1 "clojure.core$complement$fn__4378@6f7cb8b1"]
05:31Empperi,((complement (nil? "wut")))
05:31clojurebot#error {\n :cause "java.lang.Boolean cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Boolean cannot be cast to clojure.lang.IFn"\n :at [clojure.core$complement$fn__4378 invoke "core.clj" 1373]}]\n :trace\n [[clojure.core$complement$fn__4378 invoke "core.clj" 1373]\n [sandbox$eval49 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eva...
05:32Empperi,((complement #(nil? "wut")))
05:32clojurebottrue
05:32Empperias you can see
05:32SagiCZ,"wut"
05:32clojurebot"wut"
05:32SagiCZoh ok
05:32Empperiyour problem is that nil? function returns a boolean
05:32SagiCZ(complement (nil? val)) === (boolean val)
05:32SagiCZso this one should be true
05:33Empperiwell, you could just do:
05:33Empperi,(some? nil)
05:33clojurebotfalse
05:33Empperi,(some? true)
05:33clojurebottrue
05:33Empperisorry
05:33Empperi,(some true)
05:33clojurebot#error {\n :cause "Wrong number of args (1) passed to: core/some"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: core/some"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 32]\n [sandbox$eval169 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler ...
05:33SagiCZbut in an if statement
05:33Empperifail me
05:33SagiCZhow do i test for not-nil?
05:34SagiCZ(when val ...)
05:34Empperi,(not (nil? true))
05:34SagiCZthats enough right?
05:34clojurebottrue
05:34Empperialso
05:34hyPiRionSagiCZ: ##(when false (println "we won't see this"))
05:34lazybot⇒ nil
05:34Empperi,(or true false)
05:34clojurebottrue
05:34Empperi,(or false false)
05:34clojurebotfalse
05:34Empperi,(or nil false)
05:34clojurebotfalse
05:34SagiCZWHAT? slow down
05:34SagiCZ(when val ...) is a test for not-nil. correct/incorrect?
05:35hyPiRionincorrect
05:35Empperi,(if (or nil false) "true" "false)
05:35clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
05:35Empperi,(if (or nil false) "true" "false")
05:35clojurebot"false"
05:35Empperi,(if (or true false) "true" "false")
05:35clojurebot"true"
05:35SagiCZ,(when "hey" (println "i see this"))
05:35SagiCZ,(when nil (println "i dont see this"))
05:35clojureboti see this\n
05:35clojurebotnil
05:35Empperi,(if (or false false) "true" "false")
05:35clojurebot"false"
05:35EmpperiSagiCZ: yup, it should work like that
05:36SagiCZbut it works as you can see from my input.. so why are you saying its incorrect
05:36SagiCZ,(nil? false)
05:36clojurebotfalse
05:36hyPiRion,(if false "is nil" "is not nil")
05:36clojurebot"is not nil"
05:36hyPiRionwhoops, got those two mixed up
05:36SagiCZok ok sorry i finally got it
05:36hyPiRion,(if false "is not nil" "is nil")
05:36clojurebot"is nil"
05:37SagiCZso only correct test for not nil is (not (nil? .. ))
05:37Empperiyes
05:37SagiCZor (some? ..)
05:37Empperior (some? nil)
05:38Empperiand some? is actually implemented as (not (nil? x))
05:38SagiCZthe name is terrible though
05:39SagiCZalso i always mix up some?/some
05:40Empperiwell, some? has pretty ok name imho
05:40Empperinot-empty though is so confusing :)
05:40Emppericorrection, empty
05:41Empperiempty does veeeery different thing from empty?
05:42Empperiand not-empty makes it more confusing since you can use not-empty as a predicate
05:42winkwell punctuation is kind of meaningful in natural language as well :)
05:42Empperibut you can't use empty as predicate
05:43Empperiyou have to use empty?
05:43Empperioh well, I do understand WHY it's like that
05:43Empperibut I've stepped on that mine too many times :)
06:10SagiCZcan i somehow join multiple ns so i can require them with one line and specify alias? something like all ns that start with mypackage.* ?
06:16schmirSagiCZ: try https://github.com/ztellman/potemkin
06:16schmir(which is not quite what you want)
06:17SagiCZthis is something that clojure should be able to do
06:17SagiCZi dont want to have a 5000 lines namespace and I dont want to require 100 namespaces one by one
06:19schmirIt's software. everything is possible. But the solution I know of is potemkin's import-vars.
06:31J_A_Workis there a lein command to check for unused dependencies?
06:31J_A_Workwill lein deps do it?
06:43IgorLHow can I hide search line in LightTable?
07:30m1dnight_J_A_Work: no there is not.
07:30m1dnight_You can use eastwood to check for unuses imports though..
07:30m1dnight_Well, at least, to my knowledge
07:32J_A_WorkYeah. I found eastwood. Sadly it threw fits about the dev namespace in my project, so I may just have to deal with things manually.
07:32J_A_WorkOh well, it’s a small project anyway.
07:41m1dnight_I asked about this feature a while back too. Maybe somebody can implement it. I have no time at the tim..
07:41m1dnight_no time for the moment*
07:47m1dnight_Raynes: Sorry to bother you but I was looking at the refheap source. Do you happen to know why the intial input textfield for pastes is rather primitive in the cloned edition and the one on refheap.com is zo pretty? :)
07:52wink(it's the premium edition :P)
08:16m1dnight_im trying to deploy a war file to tomcat but I keep getting config.clj not found
08:16m1dnight_What i do now is ´lein ring uberwar` and then copy that to /var/lib/tomcat7/webapps
08:16m1dnight_the app deploys find, but i cant navigate because i get a stacktrace saying config.clj is not found..
08:17m1dnight_(the app runs fine with lein ring server-headless though)
08:17justin_smithm1dnight_: are you using io/file or java.io.File for anything?
08:17justin_smithor maybe the wrap-files middleware? because all of those are wrong and bad
08:17justin_smithuse io/resource or wrap-resource instead
08:18m1dnight_justin_smith: its just the refheap project, actually
08:18m1dnight_And if iirc i could deply it on tomcat
08:42justin_smithm1dnight_: well the thing that fails to find config.clj in an uberwar but can find it when you do lein run is usually that you are looking for a file, which is wrong in an uberwar, generally
09:17crocketWhy do some people use (partial rand-int 10) instead of #(rand-int 10)?
09:20Empperiwell, in your example there isn't a very good reason really
09:20Empperibut there is a very good reason for using partial in overall though
09:21Empperiit's a form of currying, although limited in a way
09:22tbaldridgecrocket: I tend to use partial, because I don't like the syntactic sugar of #() and (fn [x] ) requires me to think of a name for an argument
09:22crocketI don't understand why you don't like #()
09:23Empperi#() has few problems, especially the fact you can't use them in a nested manner
09:23tbaldridgecrocket: #() isn't that bad, it's when people do stuff like this: #(apply + (- %1 %2) %&)
09:23tbaldridgeIf I'm going to type that ^^ I might as well learn Perl
09:23tbaldridge:)
09:23crocketHow do you do that with partial?
09:24tbaldridgewell actually you can't do it with partial. But I would write that code thusly (fn [x y & z] (apply + (- x y) z))
09:24tbaldridgeWhich to me is much cleaner, but it might just be personal preference
09:25crocketRight
09:25crocketDoes %& refer to %3 and beyond?
09:25chousercrocket: it's hard to know why *other* people choose one over the other.
09:25tbaldridgeBut I do often do this (filter (partial = 42) coll), which I think is cleaner than (filter #(= 42 %) coll)
09:25tbaldridgecrocket: yeah
09:26staintbaldridge: agreed, that's the kind that (partial) is good for
09:26tbaldridgeplus, I feel smart whenever I use partial and comp ;)
09:26staintbaldridge: (partial) reads like "modify a function", while #() reads like "make a function"
09:26crocket#(rand-int 10) vs (partial rand-int 10)
09:26chouserI sometimes think about how each #() in my code generates another class (and class file)
09:26crocketWhy should you care about class?
09:26chouserwhereas partial does uses an existing one
09:27chousercrocket: it doesn't matter much, but it's another thing on disk, another thing in memory, another thing in the jar file.
09:27crocketSo, is it about squeezing as much performance as possible?
09:28chouserno, I don't actually know which is faster
09:29chouserat runtime they each just make an instance. I think this really is a case of personal preference.
09:29stainno, it's about readability I think, specially when the function is just one of the many parameters going through to the parent.. and where there might be more than two arguments
09:30chouserAnything with more than 1 or 2 args I probably wouldn't use #(), anything with more than 1 or 2 nested forms I wouldn't use partial. I often end up with (fn ...)
09:31Bronsapartial uses varargs after 3 args, which is slower
09:36jonathanjsince cljs is javascript and javascript dependencies are mostly found on npm, is there some integration between cljs and declaring dependencies that can be found on npm?
09:37oddcullywhen using partial in that case, it could misslead the reader into thinking, that at least another param would be needed (not the case for rand-int)
09:37crocketclojureScript can be used on PhoneGap, too.
09:37crocketoddcully, That's what I thought.
09:38solussdchouser: partial is usually slower bc it support variablel arity
09:38crocketpartial gives an impression that another parameter is needed.
09:38stain+1
09:39oddcullythe arity error for the partial case will name rand-int, what might even confuse things even more (given i only got hold of the def from somewhere)
09:40oddcullybut i guess the main use is just for the regular oneliner here and there and it would not matter
09:40tbaldridgesolussd: I fixed that in a recent version of Clojure (1.7 I think?)
09:41tbaldridgesolussd: variable arity is only used now with +3 args to partial'd function. So ((partial swap! (atom 0) +) 1) will not invoke through a restfn
09:42pjstadigwhy does loop destructuring hold the head of a sequence? https://gist.github.com/pjstadig/202c82d3e9a3fb32bd5a
09:42pjstadigor am I doing it wrong?
09:42solussdtbaldridge: awesome- I like the aesthetics of partial better
09:43pjstadigthe macro expansion does a double destructuring, but it doesn't necessarily look like it is holding the head, unless it is just confusing the locals clearing https://gist.github.com/pjstadig/295d8825c13646b3e8ff
09:45pjstadigmaybe it would get cleared out if line 10 bound G_3399 to some new name in the loop*?
09:57tbaldridgepjstadig: that sounds possible
10:14pjstadigtbaldridge: I tried changing loop so that it binds to a new gensym in the loop* binding vector, and it didn't work
10:16Bronsapjstadig: it's a locals clearing bug
10:17Bronsapjstadig: full macroexpansion looks like http://sprunge.us/aKbP
10:17Bronsapjstadig: vec__14, chunk and chunks will never be cleared
10:17Bronsaotoh in this case they will: http://sprunge.us/iHAN
10:18Bronsathe bug is that locals that are never used are never cleared
10:19Bronsai fixed it in tools.emitter.jvm, don't remember if i made a patch for Compiler.java
10:20Bronsapuredanger: do you remember if there's such a ticket?
10:23pjstadigBronsa: ah! ... ok. would be nice to get a patch into Compiler.java
10:52Bronsapjstadig: try http://sprunge.us/TgCW
11:02sidharth1 /quit
11:17Bronsapjstadig: http://dev.clojure.org/jira/browse/CLJ-1744
13:09sdegutisWhat's the best Clojure equivalent of this Python thing? sum(1 for item in items if not item.predicate())
13:10lumafi(count (filter predicate items))
13:11lumafiactually, (count (remove predicate items)), didn't spot that "not"
13:17pjstadigBronsa: puredanger: i suppose its impossible to get 1744 into 1.7
13:17sdegutislumafi: then wouldn't it be (count (filter (complement predicate) items)) ?
13:18sdegutisOr (->> items (filter (complement predicate)) (count)) I guess.
13:20oddcullyremove is filter with complement
13:23Bronsapjstadig: dunno, doesn't depend on me
13:25bobwilliamsHello all, somewhat of a clojure n00b here
13:25bobwilliamsif anyone wants to make me look dumb...please take a look at https://gist.github.com/bobwilliams/9dc2a37954ba253fac60
13:25bobwilliamsand help me understand the null pointer i'm getting
13:25bobwilliamsbig thanks in advance too
13:36TimMcbobwilliams: Adding the stack trace to your gist would help.
13:38bobwilliamsTimMc: will do...one sec
13:39jtmarmonbobwilliams: could you also maybe add intended output. seems like from the description there might be a simpler way to acheive this
13:45luxbockbobwilliams: normalize-attributes takes a map and returns a lazy-seq, so you can't really use it with reduce
13:45luxbocki.e. the first time it gets called, `data` is a map, and the second time it's a list
13:46bobwilliamsTimMc, jtmarmon: I've added the stack traces and an example of return value
13:46bobwilliamsI feel i'm thinking too imperative about it
13:46bobwilliamsluxbock: ah...so a doseq or something?
13:47bobwilliamsjust implement it a different way? :)
13:47luxbockdoseq is for side-effects
13:47bobwilliamsdoall
13:47luxbockthe problem is not with lazyness
13:47sdegutisoddcully: but with complement, the filter doesnt have to change if the caller wants to invert a function
13:48sdegutisits more independentizable
13:48bobwilliamsgotcha
13:48bobwilliamsit's the lazy-seq and reduce
13:48H4nsi have a large line sequential data file which i would like to index and then access in a random fashion. can anyone recommend any clojure libraries that'd help me with that? i have started digging into java.io.channels and friends, but that route does not seem to compose well with clojure.java.io/reader
13:49luxbockbobwilliams: I suspect your `get-data` function should use map (or mapv if you want to return a vector) instead of reduce
13:51justin_smithH4ns: any particular reason you would need to use clojure.java.io/reader?
13:51H4nsjustin_smith: it would be convenient if i could use line-seq to index the file.
13:52bobwilliamsluxbock: ok... i'll tool with that and see what I can do
13:52H4nsjustin_smith: (and also read it later on)
13:52bobwilliamsbig thanks once again
13:53H4nsjustin_smith: but i guess i can just wrap RandomAccessFile in a lazy-seq to the same effect.
13:53justin_smithH4ns: line-seq would give you a lazy-seq of lines, and I guess you could combine that with line numbering, but for "large" input you wouldn't want to keep it in memory either
13:53justin_smithI think the lazy-seq option is only going to add complexity and difficulty to random access
13:53justin_smiththey are paradigms that don't match
13:53justin_smithif you want random-access I'd say skip laziness
13:54H4nsjustin_smith: hm. well, i'll fool around a bit. i was wondering if someone had solved a similar problem before and made it into a library, but it does not seem to be hard to implement it using RandomAccessFile and a little glue code. Thanks!
13:56justin_smithH4ns: in my experience I will set out to do something lazily and find out it's push rather than pull, or that it's random access rather than linear access, and at that point laziness just gets in the way
13:57H4nsjustin_smith: in my experience, laziness rarely gets into the way and in particular when processing large amounts of data, lazy seq + partition is both powerful and convenient.
13:57justin_smithhow would that even be compatible with random access?
13:57justin_smithI just don't see how they fit
13:58H4nsjustin_smith: as i said - i need to index which is a full sequential scan and partition will be rad for that, and i will then need random access to segments of the file, where i will create a lazy seq once i've seeked to the right file position.
14:00justin_smithOK, that's a bit more nuanced than I first imagined, and it may well work, I guess the trick would be going from seeking to line-seq
14:00justin_smithbest of luck
14:09sdegutisI have a difficult Clojure problem.
14:09sdegutisIt's not a homework problem.
14:10sdegutisI think I must use reduce, but that convolutes the code very much, and I'd like to avoid convolution.
14:10sdegutisPerhaps I can use transients?
14:13luxbocksdegutis: why does using reduce convolute the code?
14:13tcrayford____sdegutis: seems unlikely to me - transients are just used in the same way as normal clojure calls (you have to use their return value)
14:13tcrayford____sdegutis: what about loop/recur? I've found it more readable than reduce in places
14:15sdegutisWell I have [a b cs] and I have to call (my-function a b c) for each c, which returns [a b d] and I have to add all the ds together, but the new a and b need to be fed back into the new call to my-function. Ultimately I have to return [a b ds].
14:15sdegutisSee?
14:16TimMcSounds perfect for reduce.
14:17justin_smithyeah, some destructuring on the accumulator and it just works
14:19sdegutisOh yeah I'll try destructuring.
14:20xeqicfleming: is the macro understanding system for cursive extensible? I've got a macro that wraps let, and I'd love to remove the "cannot be resolved" warnings
14:33cflemingxeqi: Not right now unfortunately - it's extensible internally but I haven't opened the API yet
14:34cflemingxeqi: There are complications around loading it at startup which I haven't worked on yet
14:38virmundihello.
14:38virmundiwhat is the prefered snippet site tool to use for code questions?
14:40virmundidoes partial break lexical scoping?
14:41hiredmannope
14:42virmundihum. I know the values it’s closing over are set. but I get nils when working with the partial.
14:42xeqi~paste
14:42clojurebotpaste is https://refheap.com/
14:43hiredmana partial is not a thing, partial is a function that returns a partially applied function
14:44virmundithats what I thought. I think its a counterclockwise issue then. The values show as null in the debugger.
14:44hiredmanreplace your call to partial with your own function that does the same thing and it will help you work through what is happening
14:44hiredmanah
14:44hiredmanthat is locals clearing
14:44hiredmanwhich basically comes down to, clojure clears the jvm locals after last use
14:45hiredman(nothing to do with partial)
14:48virmundithanks
15:02luxbockwhoa, lots of Clojure related talks at Strange Loop
15:05tbaldrid_well it is run by a Clojure guy ;)
15:06luxbockoh, who runs it?
15:07tbaldrid_Alex Miller, same guy who works hard on Conj, Clojure/West and spends the rest of his time maintaining Clojure
15:07cflemingtbaldrid_: Not to mention EuroClojure these days
15:07tbaldrid_yeah, that too
15:08luxbockohh, I had no idea
15:08cflemingtbaldrid_: Since I'm sure he doesn't have enough to do
15:08luxbockinc puredanger
15:08luxbock(inc puredanger)
15:08lazybot⇒ 60
15:08blkcatwin 25
15:08blkcatoops.
15:12luxbockhttp://www.thestrangeloop.com/2015/transwarp-transducers.html
15:13luxbockthis looks really cool
15:26sdegutisheythanks
15:35sdegutisthis is the ugliest function i may have ever written
15:37winkpics or it didn't happen :P
15:44xemdetiaspruce it up with some ascii art
15:46J_Arcaneman everyone keeps reminding me about strangeloop and it gives me the sad
15:48winkI stopped caring :/
15:49winkit's easier
15:49winkfor us Europeans at least :P
15:49xemdetiaI don't know why it'd be so upsetting- most of it ends up on youtube and makes some good bleary-eyed midnight watching
15:50J_ArcaneI was invited to give a talk at another smaller conference that's semi-co-located with STL, and I can't afford to go. :P
15:51winkxemdetia: I prefer conferences for the conversations with people (also about the talks, sure) and not the talks themselves strictly
15:53xemdetiawink, I guess I make do with my local free conference scene for the talking and just like to watch the talks like people watch tv on netflix
15:54winkxemdetia: yeah our clojure meetup devolved into functional in general and then also not that much at all. :/
15:55xemdetiaI roll the dice on random other things I don't care about until I find fun communities
15:55xemdetiaI have really liked going to sharepoint conferences for some reason
15:55xemdetiaI have no interest or desire to work on sharepoint but they have some interesting people tangling with those issues
15:56devn*print-length* and *print-level* aren't respected for clj-http trace info. how do I truncate gigantic responses in 4xx or 5xx responses?
15:57devnnote: I only care about this in the REPL
15:58ztellmandevn: this is just for the body of the response?
15:58devn*nod*
15:59ztellmandevn: just a guess, but this may be a :throw-exception? issue
15:59ztellmanI'm not sure if the ex-info stuff properly truncates
15:59devnahhh
16:07sdegutisWhat are some tips to help me learn how to write idiomatic Clojure?
16:07sdegutisWhat are some common rules of thumbs?
16:11arkhsdegutis: I'd recommend The Joy of Clojure, 2nd edition, or Clojure Programming
16:11arkhsdegutis: or brave clojure
16:12sdegutisno sorry not books, just patterns or concepts
16:12sdegutisI guess one would be to always use destructuring whenever possible
16:14arkhwww.braveclojure.com is very accessible; I've been programming in clojure for years and continue to look for ways to do things idiomatically. I.e., your question has a big answer
16:14oddcullysdegutis: do you know https://github.com/bbatsov/clojure-style-guide ?
16:15sdegutisoddcully: thank you
16:16sdegutisarkh: oh thank you
16:16sdegutisarkh: it says .com so is this a commercial thing then?
16:16sdegutisI can't tell if it's trying to sell something.
16:17tbaldrid_Of course the best thing about standards is that there are so many to choose from. Same goes for style guides ;-)
16:17sdegutistbaldrid_: style is different than idiomaticity
16:18oddcullyit is not only about formatting your code
16:18arkhsdegutis: they have a publication coming out based on the what's already available for free on their site
16:18oddcullyit also contains examples, how to write things "understandable"
16:18sdegutistbaldrid_: its stylistic to put parens on the same line or next line. its idiomatic to use conj when you dont care what order
16:18oddcullybut of course: take it with a metric ton of salt
16:18justin_smithjepsen: I'm floating the proposal to test our system with jepsen to establish how we behave in certain degenerate states (misbehaving api, network issues, etc.) - how long should I estimate that it would take to get the core parts of our app hooked up to be tested with jepsen?
16:18sdegutisarkh: thanks i will look into investigating that further
16:21justin_smithmaybe this isn't even the right tool... is there a better option for testing how clojure code that talks to the network works in worst case scenarios?
16:23arkhjustin_smith: you could do it at the OS level
16:24justin_smitharkh: isn't that kind of what jepsen does?
16:24xemdetiajustin_smith, you can always try comcast https://github.com/tylertreat/Comcast
16:24justin_smithxemdetia: awesome project name :)
16:24arkhjustin_smith: I was thinking of something like 'tc' http://stackoverflow.com/questions/614795/simulate-delayed-and-dropped-packets-on-linux
16:24xemdetianot my project but definitely a memorable name
16:24xemdetiait wraps tc
16:24xemdetiaand some other core things
16:25arkhwow ... never thought I'd say I'd want to use Comcast
16:26justin_smithxemdetia: the more I look at it the more I like it
16:26justin_smith(inc xemdetia)
16:26lazybot⇒ 6
16:34sdegutis(inc justin_smith)
16:34lazybot⇒ 256
16:36gfredericksomg
16:36gfrederickssuch a round number
16:37arkhit bothers me because it's just passed 8 bits unsigned
16:44justin_smitharkh: I'm confused, what's this "unsigned" you speak of?
16:44justin_smith(sorry, bad jvm joke
16:44justin_smith)
16:45alexyakushevDid someone call a killjoy?
16:45alexyakushev(inc justin_smith)
16:45lazybot⇒ 257
16:46arkhjustin_smith: I've been using ztellman's excellent byte libraries for too long ; )
16:47ztellmanwhich will happily overflow to a BigInteger, in the unsigned long case
16:47winkint -> long -> too long
16:47alexyakushevjustin_smith: Now your score is symmetric
16:47alexyakushev,(Integer/toBinaryString 257)
16:48clojurebot"100000001"
16:48justin_smithvery nice, thank you
16:49ztellmanha, genuinely did not know that function existed, I've always rolled my own
16:49arkhvertigo.structs/uint8
16:49ztellmanTIL
16:57gfredericks,(BigInteger/toBinaryString (biginteger 38888888888888888888888888888888888888888N))
16:57clojurebot#error {\n :cause "No matching method: toBinaryString"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: No matching method: toBinaryString, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6740]}\n {:type java.lang.IllegalArgumentException\n :message "No matching method: toBinaryString"\n :at [c...
16:57gfredericksprobably has it and is called differently
17:08amalloyztellman: integer will do any radix, not just binary, i'm fairly sure
17:08ztellmanamalloy: neat
17:08amalloy,(Integer/toString 100 5)
17:08clojurebot"400"
17:12cflemingztellman: I'll be at Curry On, so I'll be available to liveblog Cliff Click for you
17:12ztellmancfleming: ha, looking forward to it
17:14cflemingztellman: Absolutely.
17:16gfredericksomg.
17:16gfredericksis there any reason why calling (keys &env) would have a side effect?
17:17gfredericksI'm messing with a macro and if I put (keys &env) at the top of the body (ignoring its return value) behavior changes
17:17amalloyuhhhhh, it shouldn't, gfredericks, but i guess it's not impossible
17:17amalloyi'd be curious to see a reproducible case of that
17:18gfredericksthis is such a damn rabbit hole but it's too fascinating to ignore
17:18gfredericksI'll try to put this together
17:19cfleminggfredericks: Shave, shave, shave that yak
17:26gfredericksamalloy: oh man I think I figured it out
17:28gfrederickskeys meant something else in the namespace I was working in
17:28TimMchaha
17:28TimMcThat's a pretty good reason.
17:28gfredericksand the world is sane again
17:30TimMcI was going to posit something wrong with locals clearing. :-P
17:39sdegutisI've had so many misnamed parameters in my code, but the tests kept working.
17:40sdegutisI'd be like "oh wait that variable is misnamed" and change it and be like "oooops"
17:44justin_smithsdegutis: you should use eastwood
17:45andyfsdegutis: Eastwood with an extra command line option to enable warnings that are disabled by default, because they can be noisy.
17:46andyflein eastwood "{:add-linters [:unused-fn-args :unused-locals]}" https://github.com/jonase/eastwood
17:47sdegutisjustin_smith: no sorry it's not about unused locals, it's just misnamed
17:48justin_smithoh you mean like you spelled it wrong?
17:48justin_smithsounds like something an IDE could fix
17:48sdegutisI had "question-template" when I should have just had "question". Very different things. But it didn't matter, I was somehow using the right function on it (or wrong, if you thought the variable name was correct).
17:49andyfsdegutis: These are parameters like {:keys [bad names here]} ?
17:50andyfIf you misspell a function arg name in the body of the function, the only way you will not get a compilation error that I can think of is if the name is correctly spelled for something global.
17:51andyf(or another local thing)
17:52justin_smithis there a magic value in prismatic/schema that matches things that are edn but not non-edn things?
17:52justin_smithbasically it would be nice if I could be more specific than schema/Any without enumerating edn
17:55sdegutisandyf: unless you misspell it in the param list of the function too. Which is what I did.
17:55sdegutisThis schema is just so complex that it's easy to get lost in which entity type you're dealing with in any given function.
18:22amalloyjustin_smith: isn't edn extensible enough that anything is an edn value if you wish hard enough?
18:26justin_smithamalloy: what I want is to assert that I don't get eg a java.util.Date
18:27amalloyjustin_smith: doesn't edn have a tagged literal for specifically Date? that seems like a bad example
18:27amalloyand since you can add tagged literals for anything, it's a little bit tricky
18:27justin_smithamalloy: I think I mean edn without any tags
18:29justin_smithyeah, the untagged subset of edn
18:29arohneris there anything better for charting these days than incanter?
19:55aaelonyVega is awesome
19:55aaelonyhttps://trifacta.github.io/vega/
19:56aaelonyarohner: https://trifacta.github.io/vega/
20:02TEttingernice, aaelony
20:03aaelonyTEttinger: or use it from gorilla-repl, or even gorilla-plot (https://github.com/JonyEpsilon/gorilla-plot/blob/master/src/gorilla_plot/core.clj)
20:04aaelonyeven better is that there is a cljjsjs for vega
20:04aaelonyoops, cljsjs
20:50sorbo_anyone having trouble with Clojure apps on the new Heroku Cedar-14 stack?
20:50sorbo_my app was fine before but after migrating it times out (doesn't bind to port within 60 seconds) about 2/3 of the time
21:35gfredericksTIL clojure.core/run!
21:35gfredericksI'd kind of been wanting that
21:52TEttinger(doc run!)
21:52clojurebot"([proc coll]); Runs the supplied procedure (via reduce), for purposes of side effects, on successive items in the collection. Returns nil"
21:52TEttingerprocedure?
21:52TEttingeris it a form or a fn or what?
21:53TEttinger,(run! pr [1 2 3 4])
21:53clojurebot1234
21:53TEttingernice
21:53TEttingeris this new, gfredericks?
21:53TEttinger,(meta #'run!)
21:53clojurebot{:arglists ([proc coll]), :doc "Runs the supplied procedure (via reduce), for purposes of side\n effects, on successive items in the collection. Returns nil", :added "1.7", :line 7363, :column 1, ...}
21:53TEttingeradded 1.7, huh
22:46hiredmanthe project I am working on at work has a utils namespace for reduce related odds and ends and it seems to be constantly growing
22:48hiredmanI have a pr that adds a "before" and "after" transducer that let you apply a function to the accumulator before the step function runs, and after the step function runs
22:53joxHello? Anybody here?
22:58gfrederickshiredman: reduce is the new cons
22:59joxButtered cat