2015-06-03
| 03:49 | alanforr | Hello. Could anyone tell me how to use dev dependencies in a Leiningen project? |
| 03:56 | andyf_ | alanforr: You mean, you want an example of the syntax for specifying them? Or you want to know what they are useful for? |
| 03:57 | andyf_ | alanforr: Here is one example of the syntax for specifying dev dependencies: https://github.com/jonase/eastwood/blob/master/project.clj#L13-L26 |
| 04:04 | alanforr | I 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:05 | andyf_ | Do you have a small example handy? |
| 04:07 | andyf_ | for example, what dependency do you have in your project.clj as a dev dependency, and what namespace are you trying to require? |
| 04:10 | alanforr | The dependency is [criterium "0.4.3"]. |
| 04:11 | alanforr | The 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:12 | andyf_ | You do 'lein repl', then (require 'criterium.core) and it fails? |
| 04:13 | alanforr | lein real then (require '[criterium.core :as c]) |
| 04:13 | alanforr | repl not real. |
| 04:14 | andyf_ | Can you put the project.clj in a paste somewhere? I tried a small project like that and the require worked for me. |
| 04:16 | andyf_ | Here is the one I tried that worked for me: https://gist.github.com/jafingerhut/b7135a545241889fdb2b |
| 04:19 | xyz_ | 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:20 | alanforr | the project.clj is here https://gist.github.com/alanforr/7854dfb0f15b135660cb |
| 04:20 | andyf_ | I am pretty sure you need the :profiles keyword in there, too. |
| 04:21 | kasterma | :dependencies needs one more set of [] |
| 04:21 | kasterma | compare the dependencies one level up |
| 04:21 | kasterma | (dev dependencies I meant) |
| 04:22 | andyf_ | Oh, yeah, and the value of dependencies needs to be a vector of vectors. |
| 04:24 | alanforr | Okay, fixed the problem. Thanks. |
| 04:26 | andyf_ | Makes me realize that it would be nice if Eastwood linter checked project.clj file contents |
| 05:05 | IgorL | Hello, does somebody know why the error occurs https://www.refheap.com/102043 ? |
| 05:16 | SagiCZ | when i want to test if something is not nil is this sufficient? |
| 05:16 | SagiCZ | (when val (println "val is not nil")) |
| 05:16 | amalloy | that's a funny error, IgorL. i don't know what it means, but maybe some kind of filesystem character encoding thing? |
| 05:19 | SagiCZ | why cant recur be inside of try block? :( |
| 05:29 | SagiCZ | is this true? |
| 05:29 | SagiCZ | (complement (nil? val)) === val |
| 05:31 | Empperi | SagiCZ: no |
| 05:31 | Empperi | ,(complement (nil? "wut")) |
| 05:31 | clojurebot | #object[clojure.core$complement$fn__4378 0x6f7cb8b1 "clojure.core$complement$fn__4378@6f7cb8b1"] |
| 05:31 | Empperi | ,((complement (nil? "wut"))) |
| 05:31 | clojurebot | #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:32 | Empperi | ,((complement #(nil? "wut"))) |
| 05:32 | clojurebot | true |
| 05:32 | Empperi | as you can see |
| 05:32 | SagiCZ | ,"wut" |
| 05:32 | clojurebot | "wut" |
| 05:32 | SagiCZ | oh ok |
| 05:32 | Empperi | your problem is that nil? function returns a boolean |
| 05:32 | SagiCZ | (complement (nil? val)) === (boolean val) |
| 05:32 | SagiCZ | so this one should be true |
| 05:33 | Empperi | well, you could just do: |
| 05:33 | Empperi | ,(some? nil) |
| 05:33 | clojurebot | false |
| 05:33 | Empperi | ,(some? true) |
| 05:33 | clojurebot | true |
| 05:33 | Empperi | sorry |
| 05:33 | Empperi | ,(some true) |
| 05:33 | clojurebot | #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:33 | SagiCZ | but in an if statement |
| 05:33 | Empperi | fail me |
| 05:33 | SagiCZ | how do i test for not-nil? |
| 05:34 | SagiCZ | (when val ...) |
| 05:34 | Empperi | ,(not (nil? true)) |
| 05:34 | SagiCZ | thats enough right? |
| 05:34 | clojurebot | true |
| 05:34 | Empperi | also |
| 05:34 | hyPiRion | SagiCZ: ##(when false (println "we won't see this")) |
| 05:34 | lazybot | ⇒ nil |
| 05:34 | Empperi | ,(or true false) |
| 05:34 | clojurebot | true |
| 05:34 | Empperi | ,(or false false) |
| 05:34 | clojurebot | false |
| 05:34 | Empperi | ,(or nil false) |
| 05:34 | clojurebot | false |
| 05:34 | SagiCZ | WHAT? slow down |
| 05:34 | SagiCZ | (when val ...) is a test for not-nil. correct/incorrect? |
| 05:35 | hyPiRion | incorrect |
| 05:35 | Empperi | ,(if (or nil false) "true" "false) |
| 05:35 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading string> |
| 05:35 | Empperi | ,(if (or nil false) "true" "false") |
| 05:35 | clojurebot | "false" |
| 05:35 | Empperi | ,(if (or true false) "true" "false") |
| 05:35 | clojurebot | "true" |
| 05:35 | SagiCZ | ,(when "hey" (println "i see this")) |
| 05:35 | SagiCZ | ,(when nil (println "i dont see this")) |
| 05:35 | clojurebot | i see this\n |
| 05:35 | clojurebot | nil |
| 05:35 | Empperi | ,(if (or false false) "true" "false") |
| 05:35 | clojurebot | "false" |
| 05:35 | Empperi | SagiCZ: yup, it should work like that |
| 05:36 | SagiCZ | but it works as you can see from my input.. so why are you saying its incorrect |
| 05:36 | SagiCZ | ,(nil? false) |
| 05:36 | clojurebot | false |
| 05:36 | hyPiRion | ,(if false "is nil" "is not nil") |
| 05:36 | clojurebot | "is not nil" |
| 05:36 | hyPiRion | whoops, got those two mixed up |
| 05:36 | SagiCZ | ok ok sorry i finally got it |
| 05:36 | hyPiRion | ,(if false "is not nil" "is nil") |
| 05:36 | clojurebot | "is nil" |
| 05:37 | SagiCZ | so only correct test for not nil is (not (nil? .. )) |
| 05:37 | Empperi | yes |
| 05:37 | SagiCZ | or (some? ..) |
| 05:37 | Empperi | or (some? nil) |
| 05:38 | Empperi | and some? is actually implemented as (not (nil? x)) |
| 05:38 | SagiCZ | the name is terrible though |
| 05:39 | SagiCZ | also i always mix up some?/some |
| 05:40 | Empperi | well, some? has pretty ok name imho |
| 05:40 | Empperi | not-empty though is so confusing :) |
| 05:40 | Empperi | correction, empty |
| 05:41 | Empperi | empty does veeeery different thing from empty? |
| 05:42 | Empperi | and not-empty makes it more confusing since you can use not-empty as a predicate |
| 05:42 | wink | well punctuation is kind of meaningful in natural language as well :) |
| 05:42 | Empperi | but you can't use empty as predicate |
| 05:43 | Empperi | you have to use empty? |
| 05:43 | Empperi | oh well, I do understand WHY it's like that |
| 05:43 | Empperi | but I've stepped on that mine too many times :) |
| 06:10 | SagiCZ | can 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:16 | schmir | SagiCZ: try https://github.com/ztellman/potemkin |
| 06:16 | schmir | (which is not quite what you want) |
| 06:17 | SagiCZ | this is something that clojure should be able to do |
| 06:17 | SagiCZ | i dont want to have a 5000 lines namespace and I dont want to require 100 namespaces one by one |
| 06:19 | schmir | It's software. everything is possible. But the solution I know of is potemkin's import-vars. |
| 06:31 | J_A_Work | is there a lein command to check for unused dependencies? |
| 06:31 | J_A_Work | will lein deps do it? |
| 06:43 | IgorL | How can I hide search line in LightTable? |
| 07:30 | m1dnight_ | J_A_Work: no there is not. |
| 07:30 | m1dnight_ | You can use eastwood to check for unuses imports though.. |
| 07:30 | m1dnight_ | Well, at least, to my knowledge |
| 07:32 | J_A_Work | Yeah. 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:32 | J_A_Work | Oh well, it’s a small project anyway. |
| 07:41 | m1dnight_ | I asked about this feature a while back too. Maybe somebody can implement it. I have no time at the tim.. |
| 07:41 | m1dnight_ | no time for the moment* |
| 07:47 | m1dnight_ | 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:52 | wink | (it's the premium edition :P) |
| 08:16 | m1dnight_ | im trying to deploy a war file to tomcat but I keep getting config.clj not found |
| 08:16 | m1dnight_ | What i do now is ´lein ring uberwar` and then copy that to /var/lib/tomcat7/webapps |
| 08:16 | m1dnight_ | the app deploys find, but i cant navigate because i get a stacktrace saying config.clj is not found.. |
| 08:17 | m1dnight_ | (the app runs fine with lein ring server-headless though) |
| 08:17 | justin_smith | m1dnight_: are you using io/file or java.io.File for anything? |
| 08:17 | justin_smith | or maybe the wrap-files middleware? because all of those are wrong and bad |
| 08:17 | justin_smith | use io/resource or wrap-resource instead |
| 08:18 | m1dnight_ | justin_smith: its just the refheap project, actually |
| 08:18 | m1dnight_ | And if iirc i could deply it on tomcat |
| 08:42 | justin_smith | m1dnight_: 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:17 | crocket | Why do some people use (partial rand-int 10) instead of #(rand-int 10)? |
| 09:20 | Empperi | well, in your example there isn't a very good reason really |
| 09:20 | Empperi | but there is a very good reason for using partial in overall though |
| 09:21 | Empperi | it's a form of currying, although limited in a way |
| 09:22 | tbaldridge | crocket: 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:22 | crocket | I don't understand why you don't like #() |
| 09:23 | Empperi | #() has few problems, especially the fact you can't use them in a nested manner |
| 09:23 | tbaldridge | crocket: #() isn't that bad, it's when people do stuff like this: #(apply + (- %1 %2) %&) |
| 09:23 | tbaldridge | If I'm going to type that ^^ I might as well learn Perl |
| 09:23 | tbaldridge | :) |
| 09:23 | crocket | How do you do that with partial? |
| 09:24 | tbaldridge | well actually you can't do it with partial. But I would write that code thusly (fn [x y & z] (apply + (- x y) z)) |
| 09:24 | tbaldridge | Which to me is much cleaner, but it might just be personal preference |
| 09:25 | crocket | Right |
| 09:25 | crocket | Does %& refer to %3 and beyond? |
| 09:25 | chouser | crocket: it's hard to know why *other* people choose one over the other. |
| 09:25 | tbaldridge | But I do often do this (filter (partial = 42) coll), which I think is cleaner than (filter #(= 42 %) coll) |
| 09:25 | tbaldridge | crocket: yeah |
| 09:26 | stain | tbaldridge: agreed, that's the kind that (partial) is good for |
| 09:26 | tbaldridge | plus, I feel smart whenever I use partial and comp ;) |
| 09:26 | stain | tbaldridge: (partial) reads like "modify a function", while #() reads like "make a function" |
| 09:26 | crocket | #(rand-int 10) vs (partial rand-int 10) |
| 09:26 | chouser | I sometimes think about how each #() in my code generates another class (and class file) |
| 09:26 | crocket | Why should you care about class? |
| 09:26 | chouser | whereas partial does uses an existing one |
| 09:27 | chouser | crocket: it doesn't matter much, but it's another thing on disk, another thing in memory, another thing in the jar file. |
| 09:27 | crocket | So, is it about squeezing as much performance as possible? |
| 09:28 | chouser | no, I don't actually know which is faster |
| 09:29 | chouser | at runtime they each just make an instance. I think this really is a case of personal preference. |
| 09:29 | stain | no, 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:30 | chouser | Anything 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:31 | Bronsa | partial uses varargs after 3 args, which is slower |
| 09:36 | jonathanj | since 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:37 | oddcully | when 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:37 | crocket | clojureScript can be used on PhoneGap, too. |
| 09:37 | crocket | oddcully, That's what I thought. |
| 09:38 | solussd | chouser: partial is usually slower bc it support variablel arity |
| 09:38 | crocket | partial gives an impression that another parameter is needed. |
| 09:38 | stain | +1 |
| 09:39 | oddcully | the 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:40 | oddcully | but i guess the main use is just for the regular oneliner here and there and it would not matter |
| 09:40 | tbaldridge | solussd: I fixed that in a recent version of Clojure (1.7 I think?) |
| 09:41 | tbaldridge | solussd: 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:42 | pjstadig | why does loop destructuring hold the head of a sequence? https://gist.github.com/pjstadig/202c82d3e9a3fb32bd5a |
| 09:42 | pjstadig | or am I doing it wrong? |
| 09:42 | solussd | tbaldridge: awesome- I like the aesthetics of partial better |
| 09:43 | pjstadig | the 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:45 | pjstadig | maybe it would get cleared out if line 10 bound G_3399 to some new name in the loop*? |
| 09:57 | tbaldridge | pjstadig: that sounds possible |
| 10:14 | pjstadig | tbaldridge: I tried changing loop so that it binds to a new gensym in the loop* binding vector, and it didn't work |
| 10:16 | Bronsa | pjstadig: it's a locals clearing bug |
| 10:17 | Bronsa | pjstadig: full macroexpansion looks like http://sprunge.us/aKbP |
| 10:17 | Bronsa | pjstadig: vec__14, chunk and chunks will never be cleared |
| 10:17 | Bronsa | otoh in this case they will: http://sprunge.us/iHAN |
| 10:18 | Bronsa | the bug is that locals that are never used are never cleared |
| 10:19 | Bronsa | i fixed it in tools.emitter.jvm, don't remember if i made a patch for Compiler.java |
| 10:20 | Bronsa | puredanger: do you remember if there's such a ticket? |
| 10:23 | pjstadig | Bronsa: ah! ... ok. would be nice to get a patch into Compiler.java |
| 10:52 | Bronsa | pjstadig: try http://sprunge.us/TgCW |
| 11:02 | sidharth1 | /quit |
| 11:17 | Bronsa | pjstadig: http://dev.clojure.org/jira/browse/CLJ-1744 |
| 13:09 | sdegutis | What's the best Clojure equivalent of this Python thing? sum(1 for item in items if not item.predicate()) |
| 13:10 | lumafi | (count (filter predicate items)) |
| 13:11 | lumafi | actually, (count (remove predicate items)), didn't spot that "not" |
| 13:17 | pjstadig | Bronsa: puredanger: i suppose its impossible to get 1744 into 1.7 |
| 13:17 | sdegutis | lumafi: then wouldn't it be (count (filter (complement predicate) items)) ? |
| 13:18 | sdegutis | Or (->> items (filter (complement predicate)) (count)) I guess. |
| 13:20 | oddcully | remove is filter with complement |
| 13:23 | Bronsa | pjstadig: dunno, doesn't depend on me |
| 13:25 | bobwilliams | Hello all, somewhat of a clojure n00b here |
| 13:25 | bobwilliams | if anyone wants to make me look dumb...please take a look at https://gist.github.com/bobwilliams/9dc2a37954ba253fac60 |
| 13:25 | bobwilliams | and help me understand the null pointer i'm getting |
| 13:25 | bobwilliams | big thanks in advance too |
| 13:36 | TimMc | bobwilliams: Adding the stack trace to your gist would help. |
| 13:38 | bobwilliams | TimMc: will do...one sec |
| 13:39 | jtmarmon | bobwilliams: could you also maybe add intended output. seems like from the description there might be a simpler way to acheive this |
| 13:45 | luxbock | bobwilliams: normalize-attributes takes a map and returns a lazy-seq, so you can't really use it with reduce |
| 13:45 | luxbock | i.e. the first time it gets called, `data` is a map, and the second time it's a list |
| 13:46 | bobwilliams | TimMc, jtmarmon: I've added the stack traces and an example of return value |
| 13:46 | bobwilliams | I feel i'm thinking too imperative about it |
| 13:46 | bobwilliams | luxbock: ah...so a doseq or something? |
| 13:47 | bobwilliams | just implement it a different way? :) |
| 13:47 | luxbock | doseq is for side-effects |
| 13:47 | bobwilliams | doall |
| 13:47 | luxbock | the problem is not with lazyness |
| 13:47 | sdegutis | oddcully: but with complement, the filter doesnt have to change if the caller wants to invert a function |
| 13:48 | sdegutis | its more independentizable |
| 13:48 | bobwilliams | gotcha |
| 13:48 | bobwilliams | it's the lazy-seq and reduce |
| 13:48 | H4ns | i 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:49 | luxbock | bobwilliams: I suspect your `get-data` function should use map (or mapv if you want to return a vector) instead of reduce |
| 13:51 | justin_smith | H4ns: any particular reason you would need to use clojure.java.io/reader? |
| 13:51 | H4ns | justin_smith: it would be convenient if i could use line-seq to index the file. |
| 13:52 | bobwilliams | luxbock: ok... i'll tool with that and see what I can do |
| 13:52 | H4ns | justin_smith: (and also read it later on) |
| 13:52 | bobwilliams | big thanks once again |
| 13:53 | H4ns | justin_smith: but i guess i can just wrap RandomAccessFile in a lazy-seq to the same effect. |
| 13:53 | justin_smith | H4ns: 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:53 | justin_smith | I think the lazy-seq option is only going to add complexity and difficulty to random access |
| 13:53 | justin_smith | they are paradigms that don't match |
| 13:53 | justin_smith | if you want random-access I'd say skip laziness |
| 13:54 | H4ns | justin_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:56 | justin_smith | H4ns: 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:57 | H4ns | justin_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:57 | justin_smith | how would that even be compatible with random access? |
| 13:57 | justin_smith | I just don't see how they fit |
| 13:58 | H4ns | justin_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:00 | justin_smith | OK, 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:00 | justin_smith | best of luck |
| 14:09 | sdegutis | I have a difficult Clojure problem. |
| 14:09 | sdegutis | It's not a homework problem. |
| 14:10 | sdegutis | I think I must use reduce, but that convolutes the code very much, and I'd like to avoid convolution. |
| 14:10 | sdegutis | Perhaps I can use transients? |
| 14:13 | luxbock | sdegutis: why does using reduce convolute the code? |
| 14:13 | tcrayford____ | 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:13 | tcrayford____ | sdegutis: what about loop/recur? I've found it more readable than reduce in places |
| 14:15 | sdegutis | Well 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:15 | sdegutis | See? |
| 14:16 | TimMc | Sounds perfect for reduce. |
| 14:17 | justin_smith | yeah, some destructuring on the accumulator and it just works |
| 14:19 | sdegutis | Oh yeah I'll try destructuring. |
| 14:20 | xeqi | cfleming: 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:33 | cfleming | xeqi: Not right now unfortunately - it's extensible internally but I haven't opened the API yet |
| 14:34 | cfleming | xeqi: There are complications around loading it at startup which I haven't worked on yet |
| 14:38 | virmundi | hello. |
| 14:38 | virmundi | what is the prefered snippet site tool to use for code questions? |
| 14:40 | virmundi | does partial break lexical scoping? |
| 14:41 | hiredman | nope |
| 14:42 | virmundi | hum. I know the values it’s closing over are set. but I get nils when working with the partial. |
| 14:42 | xeqi | ~paste |
| 14:42 | clojurebot | paste is https://refheap.com/ |
| 14:43 | hiredman | a partial is not a thing, partial is a function that returns a partially applied function |
| 14:44 | virmundi | thats what I thought. I think its a counterclockwise issue then. The values show as null in the debugger. |
| 14:44 | hiredman | replace your call to partial with your own function that does the same thing and it will help you work through what is happening |
| 14:44 | hiredman | ah |
| 14:44 | hiredman | that is locals clearing |
| 14:44 | hiredman | which basically comes down to, clojure clears the jvm locals after last use |
| 14:45 | hiredman | (nothing to do with partial) |
| 14:48 | virmundi | thanks |
| 15:02 | luxbock | whoa, lots of Clojure related talks at Strange Loop |
| 15:05 | tbaldrid_ | well it is run by a Clojure guy ;) |
| 15:06 | luxbock | oh, who runs it? |
| 15:07 | tbaldrid_ | Alex Miller, same guy who works hard on Conj, Clojure/West and spends the rest of his time maintaining Clojure |
| 15:07 | cfleming | tbaldrid_: Not to mention EuroClojure these days |
| 15:07 | tbaldrid_ | yeah, that too |
| 15:08 | luxbock | ohh, I had no idea |
| 15:08 | cfleming | tbaldrid_: Since I'm sure he doesn't have enough to do |
| 15:08 | luxbock | inc puredanger |
| 15:08 | luxbock | (inc puredanger) |
| 15:08 | lazybot | ⇒ 60 |
| 15:08 | blkcat | win 25 |
| 15:08 | blkcat | oops. |
| 15:12 | luxbock | http://www.thestrangeloop.com/2015/transwarp-transducers.html |
| 15:13 | luxbock | this looks really cool |
| 15:26 | sdegutis | heythanks |
| 15:35 | sdegutis | this is the ugliest function i may have ever written |
| 15:37 | wink | pics or it didn't happen :P |
| 15:44 | xemdetia | spruce it up with some ascii art |
| 15:46 | J_Arcane | man everyone keeps reminding me about strangeloop and it gives me the sad |
| 15:48 | wink | I stopped caring :/ |
| 15:49 | wink | it's easier |
| 15:49 | wink | for us Europeans at least :P |
| 15:49 | xemdetia | I 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:50 | J_Arcane | I 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:51 | wink | xemdetia: I prefer conferences for the conversations with people (also about the talks, sure) and not the talks themselves strictly |
| 15:53 | xemdetia | wink, 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:54 | wink | xemdetia: yeah our clojure meetup devolved into functional in general and then also not that much at all. :/ |
| 15:55 | xemdetia | I roll the dice on random other things I don't care about until I find fun communities |
| 15:55 | xemdetia | I have really liked going to sharepoint conferences for some reason |
| 15:55 | xemdetia | I have no interest or desire to work on sharepoint but they have some interesting people tangling with those issues |
| 15:56 | devn | *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:57 | devn | note: I only care about this in the REPL |
| 15:58 | ztellman | devn: this is just for the body of the response? |
| 15:58 | devn | *nod* |
| 15:59 | ztellman | devn: just a guess, but this may be a :throw-exception? issue |
| 15:59 | ztellman | I'm not sure if the ex-info stuff properly truncates |
| 15:59 | devn | ahhh |
| 16:07 | sdegutis | What are some tips to help me learn how to write idiomatic Clojure? |
| 16:07 | sdegutis | What are some common rules of thumbs? |
| 16:11 | arkh | sdegutis: I'd recommend The Joy of Clojure, 2nd edition, or Clojure Programming |
| 16:11 | arkh | sdegutis: or brave clojure |
| 16:12 | sdegutis | no sorry not books, just patterns or concepts |
| 16:12 | sdegutis | I guess one would be to always use destructuring whenever possible |
| 16:14 | arkh | www.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:14 | oddcully | sdegutis: do you know https://github.com/bbatsov/clojure-style-guide ? |
| 16:15 | sdegutis | oddcully: thank you |
| 16:16 | sdegutis | arkh: oh thank you |
| 16:16 | sdegutis | arkh: it says .com so is this a commercial thing then? |
| 16:16 | sdegutis | I can't tell if it's trying to sell something. |
| 16:17 | tbaldrid_ | Of course the best thing about standards is that there are so many to choose from. Same goes for style guides ;-) |
| 16:17 | sdegutis | tbaldrid_: style is different than idiomaticity |
| 16:18 | oddcully | it is not only about formatting your code |
| 16:18 | arkh | sdegutis: they have a publication coming out based on the what's already available for free on their site |
| 16:18 | oddcully | it also contains examples, how to write things "understandable" |
| 16:18 | sdegutis | tbaldrid_: its stylistic to put parens on the same line or next line. its idiomatic to use conj when you dont care what order |
| 16:18 | oddcully | but of course: take it with a metric ton of salt |
| 16:18 | justin_smith | jepsen: 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:18 | sdegutis | arkh: thanks i will look into investigating that further |
| 16:21 | justin_smith | maybe 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:23 | arkh | justin_smith: you could do it at the OS level |
| 16:24 | justin_smith | arkh: isn't that kind of what jepsen does? |
| 16:24 | xemdetia | justin_smith, you can always try comcast https://github.com/tylertreat/Comcast |
| 16:24 | justin_smith | xemdetia: awesome project name :) |
| 16:24 | arkh | justin_smith: I was thinking of something like 'tc' http://stackoverflow.com/questions/614795/simulate-delayed-and-dropped-packets-on-linux |
| 16:24 | xemdetia | not my project but definitely a memorable name |
| 16:24 | xemdetia | it wraps tc |
| 16:24 | xemdetia | and some other core things |
| 16:25 | arkh | wow ... never thought I'd say I'd want to use Comcast |
| 16:26 | justin_smith | xemdetia: the more I look at it the more I like it |
| 16:26 | justin_smith | (inc xemdetia) |
| 16:26 | lazybot | ⇒ 6 |
| 16:34 | sdegutis | (inc justin_smith) |
| 16:34 | lazybot | ⇒ 256 |
| 16:36 | gfredericks | omg |
| 16:36 | gfredericks | such a round number |
| 16:37 | arkh | it bothers me because it's just passed 8 bits unsigned |
| 16:44 | justin_smith | arkh: I'm confused, what's this "unsigned" you speak of? |
| 16:44 | justin_smith | (sorry, bad jvm joke |
| 16:44 | justin_smith | ) |
| 16:45 | alexyakushev | Did someone call a killjoy? |
| 16:45 | alexyakushev | (inc justin_smith) |
| 16:45 | lazybot | ⇒ 257 |
| 16:46 | arkh | justin_smith: I've been using ztellman's excellent byte libraries for too long ; ) |
| 16:47 | ztellman | which will happily overflow to a BigInteger, in the unsigned long case |
| 16:47 | wink | int -> long -> too long |
| 16:47 | alexyakushev | justin_smith: Now your score is symmetric |
| 16:47 | alexyakushev | ,(Integer/toBinaryString 257) |
| 16:48 | clojurebot | "100000001" |
| 16:48 | justin_smith | very nice, thank you |
| 16:49 | ztellman | ha, genuinely did not know that function existed, I've always rolled my own |
| 16:49 | arkh | vertigo.structs/uint8 |
| 16:49 | ztellman | TIL |
| 16:57 | gfredericks | ,(BigInteger/toBinaryString (biginteger 38888888888888888888888888888888888888888N)) |
| 16:57 | clojurebot | #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:57 | gfredericks | probably has it and is called differently |
| 17:08 | amalloy | ztellman: integer will do any radix, not just binary, i'm fairly sure |
| 17:08 | ztellman | amalloy: neat |
| 17:08 | amalloy | ,(Integer/toString 100 5) |
| 17:08 | clojurebot | "400" |
| 17:12 | cfleming | ztellman: I'll be at Curry On, so I'll be available to liveblog Cliff Click for you |
| 17:12 | ztellman | cfleming: ha, looking forward to it |
| 17:14 | cfleming | ztellman: Absolutely. |
| 17:16 | gfredericks | omg. |
| 17:16 | gfredericks | is there any reason why calling (keys &env) would have a side effect? |
| 17:17 | gfredericks | I'm messing with a macro and if I put (keys &env) at the top of the body (ignoring its return value) behavior changes |
| 17:17 | amalloy | uhhhhh, it shouldn't, gfredericks, but i guess it's not impossible |
| 17:17 | amalloy | i'd be curious to see a reproducible case of that |
| 17:18 | gfredericks | this is such a damn rabbit hole but it's too fascinating to ignore |
| 17:18 | gfredericks | I'll try to put this together |
| 17:19 | cfleming | gfredericks: Shave, shave, shave that yak |
| 17:26 | gfredericks | amalloy: oh man I think I figured it out |
| 17:28 | gfredericks | keys meant something else in the namespace I was working in |
| 17:28 | TimMc | haha |
| 17:28 | TimMc | That's a pretty good reason. |
| 17:28 | gfredericks | and the world is sane again |
| 17:30 | TimMc | I was going to posit something wrong with locals clearing. :-P |
| 17:39 | sdegutis | I've had so many misnamed parameters in my code, but the tests kept working. |
| 17:40 | sdegutis | I'd be like "oh wait that variable is misnamed" and change it and be like "oooops" |
| 17:44 | justin_smith | sdegutis: you should use eastwood |
| 17:45 | andyf | sdegutis: Eastwood with an extra command line option to enable warnings that are disabled by default, because they can be noisy. |
| 17:46 | andyf | lein eastwood "{:add-linters [:unused-fn-args :unused-locals]}" https://github.com/jonase/eastwood |
| 17:47 | sdegutis | justin_smith: no sorry it's not about unused locals, it's just misnamed |
| 17:48 | justin_smith | oh you mean like you spelled it wrong? |
| 17:48 | justin_smith | sounds like something an IDE could fix |
| 17:48 | sdegutis | I 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:49 | andyf | sdegutis: These are parameters like {:keys [bad names here]} ? |
| 17:50 | andyf | If 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:51 | andyf | (or another local thing) |
| 17:52 | justin_smith | is there a magic value in prismatic/schema that matches things that are edn but not non-edn things? |
| 17:52 | justin_smith | basically it would be nice if I could be more specific than schema/Any without enumerating edn |
| 17:55 | sdegutis | andyf: unless you misspell it in the param list of the function too. Which is what I did. |
| 17:55 | sdegutis | This 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:22 | amalloy | justin_smith: isn't edn extensible enough that anything is an edn value if you wish hard enough? |
| 18:26 | justin_smith | amalloy: what I want is to assert that I don't get eg a java.util.Date |
| 18:27 | amalloy | justin_smith: doesn't edn have a tagged literal for specifically Date? that seems like a bad example |
| 18:27 | amalloy | and since you can add tagged literals for anything, it's a little bit tricky |
| 18:27 | justin_smith | amalloy: I think I mean edn without any tags |
| 18:29 | justin_smith | yeah, the untagged subset of edn |
| 18:29 | arohner | is there anything better for charting these days than incanter? |
| 19:55 | aaelony | Vega is awesome |
| 19:55 | aaelony | https://trifacta.github.io/vega/ |
| 19:56 | aaelony | arohner: https://trifacta.github.io/vega/ |
| 20:02 | TEttinger | nice, aaelony |
| 20:03 | aaelony | TEttinger: or use it from gorilla-repl, or even gorilla-plot (https://github.com/JonyEpsilon/gorilla-plot/blob/master/src/gorilla_plot/core.clj) |
| 20:04 | aaelony | even better is that there is a cljjsjs for vega |
| 20:04 | aaelony | oops, cljsjs |
| 20:50 | sorbo_ | anyone having trouble with Clojure apps on the new Heroku Cedar-14 stack? |
| 20:50 | sorbo_ | 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:35 | gfredericks | TIL clojure.core/run! |
| 21:35 | gfredericks | I'd kind of been wanting that |
| 21:52 | TEttinger | (doc run!) |
| 21:52 | clojurebot | "([proc coll]); Runs the supplied procedure (via reduce), for purposes of side effects, on successive items in the collection. Returns nil" |
| 21:52 | TEttinger | procedure? |
| 21:52 | TEttinger | is it a form or a fn or what? |
| 21:53 | TEttinger | ,(run! pr [1 2 3 4]) |
| 21:53 | clojurebot | 1234 |
| 21:53 | TEttinger | nice |
| 21:53 | TEttinger | is this new, gfredericks? |
| 21:53 | TEttinger | ,(meta #'run!) |
| 21:53 | clojurebot | {: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:53 | TEttinger | added 1.7, huh |
| 22:46 | hiredman | the 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:48 | hiredman | I 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:53 | jox | Hello? Anybody here? |
| 22:58 | gfredericks | hiredman: reduce is the new cons |
| 22:59 | jox | Buttered cat |