#clojure logs

2015-05-03

00:10wizzohi, i was looking if a function exists that would kind of act like a cross between map and ->. something that takes a function, a value and a list of arguments
00:10wizzoand it would go through the argument list apply it to the function and the value
00:10wizzoand thread the result of value through
00:10wizzois that a thing?
00:10justin_smithreduce? you could do something like that with reduce
00:11wizzoi tried reduce but it seems to be giving the entire argument list at once
00:11wizzobut i want it to iterate each just one at a time
00:11justin_smithyou need a little more than that
00:11wizzoi think i can do it fine with loop but just wondering if something already exists
00:11justin_smith,(reduce (fn [v f] (f v)) 1 [inc #(* % %) inc])
00:12clojurebot5
00:12justin_smithso you abstract that as a function, so the last two args are supplied by the user
00:13justin_smith,(reduce #(%2 %) 1 (take 30 (cycle [inc /])))
00:13clojurebot987/1597
00:13wizzohmm ok i might need to play more than, i'm not getting the same behaviour
00:13wizzoor at least i don't think so
00:14wizzothanks!
00:42wizzojustin_smith that worked perfect, just a problem with a function i used to generate the arguments
00:42wizzothanks again for your help
00:42justin_smithnp
00:51TEttinger,(reductions #(%2 %) 1 (take 30 (cycle [inc /])))
00:51clojurebot(1 2 1/2 3/2 2/3 ...)
00:58justin_smithhaha, if I look at it locally, so many of the numbers in the ratios are in the fibonacci sequence...
00:59justin_smiththere is some deeper mathematical reason for this that would be easier for me to puzzle out if I had less wine in me
01:01TEttingerI am not sure how I would implement a sobol sequence one-liner in clojure. the impl is pretty small in apache commons math but uses a massive embedded resource that stores the "direction information" needed to generate points in dimensions from 2-1000
01:02TEttingerI did a halton sequence one-liner
01:22tomjack,(numerator 1/1)
01:22clojurebot#error{:cause "java.lang.Long cannot be cast to clojure.lang.Ratio", :via [{:type java.lang.ClassCastException, :message "java.lang.Long cannot be cast to clojure.lang.Ratio", :at [clojure.core$numerator invoke "core.clj" 3460]}], :trace [[clojure.core$numerator invoke "core.clj" 3460] [sandbox$eval25 invoke "NO_SOURCE_FILE" 0] [clojure.lang.Compiler eval "Compiler.java" 6792] [clojure.lang.Compil...
01:24TEttingerhmmm
01:24TEttinger,(type 1/1)
01:24clojurebotjava.lang.Long
01:24TEttinger,(type 3/3)
01:24clojurebotjava.lang.Long
01:25justin_smithfunny that it does that, but 1.0 remains a double
01:25TEttinger,(type 6/3)
01:25justin_smith,(type (+ 1/2 1/2))
01:25clojurebotjava.lang.Long
01:25clojurebotclojure.lang.BigInt
01:25justin_smithsorry
01:25justin_smith,(type (+ 1/2 1/2))
01:25clojurebotclojure.lang.BigInt
01:25TEttingerhmmmm
01:25tomjackouch..
01:26tomjacknot that I've ever used numerator for anything other than dicking around
01:26justin_smithclearly you need a numerator multimethod
01:27justin_smith(returning N for every non-ratio input)
01:27TEttingerhm, how would #clojure approach this... I have a "random" number generator that produces double results in the range [0,1)
01:27tomjackI would think it should err on floating point
01:27tomjackalso bigdec?
01:27tomjackdunno
01:27justin_smithbigdec is guaranteed to have a rational representation isn't it?
01:28tomjackhttps://www.refheap.com/df016418a88c9cd199a8d837d
01:28TEttingerI want to make any input flipped. so 0.5 stays 0.5 or very close, but 0.25 becomes 0.75 or very close, and 0 becomes just shy of 1
01:28justin_smithyes, what a weird way to derive a duplicated fibonacci :)
01:29durka42TEttinger: … subtract from 1?
01:29justin_smith(inc durka42)
01:29lazybot⇒ 1
01:29TEttingerthat's (0,1]
01:30TEttingerI need [0,1)
01:30TEttingerso really if there's a way to get the value one step below one representable by a double, that works
01:31durka42I would imagine it is (- 1 Double/EPSILON) or something
01:31TEttinger(- 1.0 Double/EPSILON)
01:31TEttinger,(- 1.0 Double/EPSILON)
01:31clojurebot#error{:cause "Unable to find static field: EPSILON in class java.lang.Double", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to find static field: EPSILON in class java.lang.Double, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6543]} {:type java.lang.RuntimeException, :message "Unable to find static field:...
01:31TEttingermmmm
01:31justin_smithTEttinger: this could call for one of my favorite functions - rangemap (defn rangemap [x a b a' b'] (+ a' (* (- x a) (/ (- b' a') (- b a)))))
01:31justin_smithof course you can optimize it by returning a function for that range
01:32durka42,(= 1.0 (- 1.0 Double/MIN_VALUE))
01:32TEttingerjustin_smith: uh that doesn't appear to be doing any mapping
01:32clojurebottrue
01:33justin_smith(defn make-rangemapper [a b a' b'] (let [scale (/ (- b' a') (- b a))] (fn [x] (+ a' (* (- x a) scale)))))
01:33durka42aha
01:33justin_smithTEttinger: it's a mapping
01:33durka42,(= 1.0 (- 1.0 (Math/ulp 1.0)))
01:33clojurebotfalse
01:33durka42,(Math/ulp 1.0)
01:33clojurebot2.220446049250313E-16
01:33justin_smithTEttinger: in the mathematical sense of map
01:34TEttinger,(- 1.0 (Math/ulp 1.0))
01:34clojurebot0.9999999999999998
01:35tomjackbrilliant
01:35TEttinger,(+ 1.0 (* -1.0 (Math/ulp 1.0)) (Math/ulp 1.0))
01:35clojurebot1.0
01:35TEttingernice
01:35justin_smith (defn make-rangemapper [a b a' b'] (let [scale (/ (- b' a') (-
01:35justin_smith b a))] (fn [x] (+ a' (* (- x a) scale)))))
01:35durka42ulp(0.0) is different from ulp(1.0), though
01:35justin_smithergh
01:35justin_smith,(defn make-rangemapper [a b a' b'] (let [scale (/ (- b' a') (- b a))] (fn [x] (+ a' (* (- x a) scale)))))
01:35clojurebot#'sandbox/make-rangemapper
01:36justin_smith(def flippy (make-rangemapper 0.0 0.5 1.0 0.5))
01:36justin_smith,(def flippy (make-rangemapper 0.0 0.5 1.0 0.5))
01:36clojurebot#'sandbox/flippy
01:36TEttinger,flippy
01:36clojurebot#object[sandbox$make_rangemapper$fn__145 0x48c95e2f "sandbox$make_rangemapper$fn__145@48c95e2f"]
01:36justin_smith,(flippy 0.0)
01:36clojurebot1.0
01:36justin_smith,(flippy 0.5)
01:36TEttingeroh justin_smith
01:36clojurebot0.5
01:36justin_smithyou define an input line, and an output line
01:36justin_smithit maps points on one, to points on the other
01:36TEttinger,(flippy (- 1.0 (Math/ulp 1.0)))
01:36clojurebot2.220446049250313E-16
01:37justin_smithwell, it returns a function that does said mapping
01:37justin_smithwhich you can then use in your random range thing
01:37justin_smithif you add an exponent, you can even make it map in a curved manner :)
01:37TEttingerwell the ulp thing seems to be the solution
01:37TEttinger(inc durka42)
01:37lazybot⇒ 2
01:37justin_smithoh, interesting
01:38justin_smithTEttinger: the 2d version of rangemapper is called a projection
01:40TEttinger,(Math/nextDown 1.0)
01:40clojurebot#error{:cause "No matching method: nextDown", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.IllegalArgumentException: No matching method: nextDown, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6740]} {:type java.lang.IllegalArgumentException, :message "No matching method: nextDown", :at [clojure.lang.Compiler$StaticMethodExpr <i...
01:40justin_smithTEttinger: I think that's a java8 thing
01:40justin_smith,*java-version*
01:40clojurebot#error{:cause "Unable to resolve symbol: *java-version* in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: *java-version* in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6543]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: *java-version*...
01:40justin_smither
01:40justin_smith,(clojure-version)
01:40clojurebot"1.7.0-master-SNAPSHOT"
01:40TEttinger&(Math/nextDown 1.0)
01:40lazybotjava.lang.IllegalArgumentException: No matching method: nextDown
01:41justin_smith,(System/getProperty "java.version")
01:41clojurebot#error{:cause "denied", :via [{:type java.lang.SecurityException, :message "denied", :at [clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]}], :trace [[clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69] [clojurebot.sandbox.proxy$java.lang.SecurityManager$Door$f500ea40 checkPropertyAccess nil -1] [java.lang.System getProperty "System.java" 708] [sa...
01:41justin_smith:P
01:43TEttinger,(Math/nextAfter 1.0 0.0)
01:43clojurebot0.9999999999999999
01:43TEttingermmmm
01:43TEttingerthat's not the same as the ulp one
01:43TEttinger,(> (Math/nextAfter 1.0 0.0) (- 1.0 (Math/ulp 1.0)))
01:43clojurebottrue
01:44TEttinger,(= (Math/nextAfter 1.0 0.0) 0.9999999999999999)
01:44clojurebottrue
02:03justin_smith,0.9999999999999999
02:03clojurebot0.9999999999999999
02:04TEttinger,(= (Math/nextAfter 1.0 0.0) 0.99999999999999999)
02:04clojurebotfalse
02:04TEttingerhm
02:04TEttinger,0.99999999999999999
02:04clojurebot1.0
02:04TEttingerah!
02:04TEttinger,0.99999999999999991
02:04clojurebot0.9999999999999999
02:04TEttinger,0.99999999999999995
02:04clojurebot1.0
02:04justin_smith,(nth (iterate #(Math/nextAfter % 0.0) 1.0) 1000)
02:04TEttingerthat's the line
02:04clojurebot0.999999999999889
02:05justin_smithso funny to realize there are 1000 distinct floating point values between 1.0 and 0.999999999999889
02:05TEttingerheh
02:05justin_smith,(nth (iterate #(Math/nextAfter % 0.0) 1.0) 10000)
02:05clojurebot0.9999999999988898
02:05justin_smith,(nth (iterate #(Math/nextAfter % 0.0) 1.0) 100000)
02:05clojurebot0.9999999999888978
02:05TEttingernice
02:05justin_smithhow far do we need to go before we break 0.8...
02:06justin_smith,(nth (iterate #(Math/nextAfter % 0.0) 1.0) 1000000)
02:06clojurebotExecution Timed Out
02:06justin_smiththat returns 0.9999999998889777
02:13justin_smith (nth (iterate #(Math/nextAfter % 0.0) 1.0) 100000000) ... takes for ever ... => 0.9999999888977698
02:19durka42user=> (count (take-while (partial < 0.8) (iterate #(Math/nextAfter % 0.0) 1.0)))
02:19durka42justin_smith: … this oughta run for a bit…
02:19justin_smithhaha
02:19durka42I hope #'count doesn't hold on to its head
02:19justin_smithno, it definitely does not
02:20justin_smithdurka42: likely it would be faster for a human to just go look up the floating point spec and do the math for how many distinct values can exist between 1.0 and 0.8
02:22durka42probablyu
02:22justin_smithso for an ieee 754 double, you get 53 bits in a significand
02:23justin_smitheverything from 0.8 to 1.0 would have the same exponent
02:24justin_smithactually, more precisely 0.1 through 0.9999... should all have the same exponent
02:25justin_smith,(/ (- 1.0 0.1) (- 1.0 0.8))
02:25clojurebot4.500000000000001
02:26justin_smith,(/ (Double/pow 2 52) 4.500000000000001)
02:26clojurebot#error{:cause "No matching method: pow", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.IllegalArgumentException: No matching method: pow, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6740]} {:type java.lang.IllegalArgumentException, :message "No matching method: pow", :at [clojure.lang.Compiler$StaticMethodExpr <init> "Compiler....
02:26justin_smithergh
02:26justin_smith,(/ (Math/pow 2 52) 4.500000000000001)
02:26clojurebot1.0007999171934434E15
02:27justin_smithso there you have it
02:27durka42,(apply - (map #(Double/doubleToLongBits %) [1.0 0.8]))
02:27clojurebot1801439850948198
02:28justin_smith~ 1000799917193443.4 distinct values between 0.8 and 1.0 ?
02:28clojurebotNo entiendo
02:28durka42,(Math/log10 (apply - (map #(Double/doubleToLongBits %) [1.0 0.8])))
02:28clojurebot15.255619765854984
02:28durka42~1E15, I concur :)
02:28clojurebotCool story bro.
02:28justin_smithhaha, much more direct, nice
03:20WickedShellI'm finding lots of different methods for writing/reading from files with clojure, but I'm having trouble sifting through what is simply stale information/vs what is good practice. Ideally I'd like to avoid stepping back to simply interoping with bufferedwriters, although if thats the best method then that's fine. (Also of note: I need to work almost entirely with binary streams, rather then character streams)
03:21WickedShellIE slurp/split look like they don't address working with binary data well (or at all?) and past that I;m fininding mostly fallbacks to BufferedWriter
03:22TEttingeryeah, slurp and spit are for strings. it sounds like you want an equivalent for byte arrays?
03:23TEttingeror binary streams, right
03:23TEttingerthis is the point when we check ztellman's github to see if he wrote something already :)
03:23TEttinger$google ztellman github
03:23lazybot[ztellman (Zach Tellman) · GitHub] https://github.com/ztellman
03:24TEttingerhttps://github.com/ztellman/gloss it seems
03:25justin_smithdepending on what you want from that binary stream
03:25justin_smithif you just want bytes, it's still easiest to just use interop
03:28TEttingerah! https://github.com/ztellman/byte-streams
03:28WickedShellwell for now I'm simply throwing the bytes at the disk, and later will reload the fetched data as an image (which is fairly easy). At somepoint down this road I will need to figure out how I'm handling actually breaking apart some binary packed structs, but that part isn't related to the filesystem
03:31WickedShellTEttinger: that looks really helpful actually, solves one of the things that traditionally blows up in java...
03:31WickedShelland I had yet to find that via google
03:36TEttingergreat!
03:59WickedShellprotip: don't allow the output from a HTTP request to print in the windows command prompt, you may end up stuck listening to 30 seconds of terminal bells (also don't use windows, but hey)
04:04edbond&(/ 1M 3M)
04:04lazybotjava.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
04:04edbond&(/ 1 3)
04:04lazybot⇒ 1/3
04:04edbond&(type (/ 1 3))
04:04lazybot⇒ clojure.lang.Ratio
05:11WickedShellsay i want to spool up a series of identical worker threads, rather then copy pasting the code to create each thread, or call the create function several times with identical arguments is there a way to easily spawn all the threads? (best I've come up with is a for loop, which seems rather wrong in the clojure enviorment)
06:31the-kennyWickedShell: `dotimes'?
06:59himangshujNeed a bit of advice, I am running a few backend jobs in clojure, the jobs are being triggered using lein trampoline run which are being triggered via crontab, is there a framework container for running clojure code . I do not want a full fledged tomcat and quartz
07:09WickedShellthe-kenny, yeah that does the trick quite nicely... thanks :P
07:47bbloompuredanger: hey, i'm super stoked about clojure.lang.TaggedLiteral, but, in a truly never satisfied way, i'd love to chat about a protocol for conversion to EDN: see http://dev.clojure.org/display/design/Representing+EDN
07:48bbloompuredanger: if we had such a protocol, people could write very simple functions to transform their data types & get pretty printing for free
07:56bbloomi'm also wondering. is the #< unreadable form now totally obsolete? ie unknown tags replace them?
08:14the-kennyhimangshuj: why not just use a webserver embedded in your Clojure application? Immutant or so.
09:45justin_smith$mail himangshuj consider building uberjars and using jsvc
09:45lazybotMessage saved.
09:47justin_smithrunning lein from crontab is as silly as running make/gcc from crontab, imho
10:29dssedadddssd/load -rs GlobalFind.mrc
10:31dssedadddssd/load -rs GlobalFind\GlobalFind.mrc
11:49ConfusionistIs there a simple way to bring the functions from a namespace in scope in every other namespace of the code? I'm running a repl and would like to add some trace statements without having to go through the hassle to change my 'require' forms there and back again.
11:50justin_smithConfusionist: you can use tools.trace to add trace statements without altering the code or the target namespace
11:53Confusionistjustin_smith, and that should work without having to explicitly call (clojure.tools.trace/trace ..._
11:53TimMcFSVO "altering"
11:53Confusionist?
11:53justin_smithTimMc: well the file isn't altered
11:54justin_smithConfusionist: you would still need to call tools.trace, with your namespace or function as an argument
11:54justin_smithbut this would be done from user
11:54justin_smithnot from the namespace you are tracing
12:06jacksonjeis there a way to "introspect" the keywords a function may take if its not documented?
12:21underplankQuestion about using the repl and Cider. Do most people swtich to the namespace of the file they are working in, and evaluate forms? or do people tend to just do things in the user namespace? Pro’s? cons?
12:24wasamasaI switch to the file namespace as soon as I've got something working together
12:28underplankis that because its easier to refer to the vars in that namespace when you are in the namespace?
12:28wasamasauhuh
12:35Cheerytrying to get myself a GLL parser.
12:35Cheerymanaged to write a recognizer while ago.
12:40tomjackjacksonje: not really
12:41tomjackconsider (fn [m] (:foo m)) and many more complicated functions? also (fn [m] (k m)) for some non-literal k, etc
12:42tomjackif it's a {:keys [...]} thing you can _try_ to grab that out of the (meta (:arglists #'your/fn)), but probably not very robustly
12:43tomjacker, (:arglists (meta #'your/fn))
12:53jacksonjetoo bad, i was looking at for example, spit and :append, but its not in the doc, the meta or the source
12:58jstewI've got an app that I want a dead simple crud interface on. I'll be using compojure, and can write all of the routes myself, but is there anything that can do most of the work for me? basic get/post/put/delete on database backed resources.
13:05bensujstew: have you looked at liberator?
13:11jstewI'm looking at liberator right now, as a matter of fact. :). I'm curious as to whether there are other options that I'm not considering.
13:21TimMcHuh, since when is .lein/repl-history a binary file?
13:21justin_smithwat
13:22TimMc~/.lein/repl-history, not .lein-repl-history in each project
13:22clojurebotExcuse me?
13:22TimMcor maybe something is borked here...
13:22justin_smithTimMc: mine is repl forms
13:22justin_smithyeah, I think something on your end is borked
13:23TimMcOh, and running `lein repl` outside of a project and hitting up-arrow gives me garbage. Just borked, then.
13:23nkozoI have modified some source from https://github.com/clojure/clojure , how I run the tests to see nothing is break?
13:24puredangermvn clean test
13:24nkozopuredanger: thanks
13:25puredangerSee http://dev.clojure.org/display/community/Developing+Patches for lots more info
13:27nkozogreat
13:48mcescher
14:01bitcycleHey all. How does one validate that a command-line argument is not-nil/not-null? here's what I've got so far: https://github.com/sochoa/compressit/blob/master/src/compress/core.clj
14:04ztellmanbitcycle: in your particular case you can just do #(and % (< 0 % 0x10000))
14:04ztellmanthat also will fail when the input is 'false', but that's not possible for your CLI use case
14:05justin_smithI also like using some-> for this generally (though it doesn't work with second position in <)
14:05bitcycleztellman: sorry, I'm not sure I follow you. I copied the validation from somewhere else to give me a starting point. The -in argument is just a file path.
14:06justin_smithor you could just add identity to :validate
14:06TimMc:validate only takes one validator?
14:06justin_smithbitcycle: in that case, if you just want to test that it isn't nil, use :validate [some?]
14:07justin_smith,(some? false)
14:07clojurebottrue
14:07justin_smith,(some? "")
14:07clojurebottrue
14:07justin_smith,(some? nil)
14:07clojurebotfalse
14:08TimMcbitcycle: How about this? :validate [some? "Must be provided", #(< 0 % 0x10000) "Must be a number between 0 and 65536"]
14:08bitcyclejustin_smith: what is "some" in clojure? Is that reserved?
14:08justin_smithit's called some?
14:08justin_smith(doc some?)
14:08clojurebot"([x]); Returns true if x is not nil, false otherwise."
14:09bitcycleTimMc: That's awesome. I'll just need to check to see if the file exists instead of whether its a number between 0 and 65536.
14:09irctcI am new to clojure, but is not the point of having lazy seqs to be able to execute each element down the chain till you hit a non lazy operation. I am using using double map over a lazy seq(range 10). the second map executes after the first map has processed all the elements. Is there a way to be able to process elements in depth first manner?
14:09bitcyclejustin_smith: interesting. I'm coming from Python/C++/Ruby/Bash/C# ... so forgive my silly questions.
14:10justin_smithno problem
14:10justin_smithbitcycle: check out http://conj.io
14:10justin_smithit has a nice overview of commonly used functions, most of core
14:11bitcyclesweet, ty.
14:11tomjackirctc: you are seeing an implementation detail
14:11tomjacktry it with (range 100)
14:11justin_smithirctc: sure, if you composed your maps as a transducer, that would be depth first, or if you applied the second map before the first was realized
14:11tomjack(not sure if I understood you)
14:12justin_smith,(take 1 (map println (range 100)))
14:12clojurebot(0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\nnil)
14:12justin_smiththat's what tomjack is referring to ^
14:17tomjackirctc: demo https://www.refheap.com/e3cc981908094464336680cdf
14:18tomjack(of course, one should not typically do side-effects in a map function..)
14:19justin_smithbut if you care about breadth vs. depth first, then you are doing side effects
14:20irctc<justin_smith> I will look into that. But if I try with (range 100) it is not sequential, it seems lazy(well first map processes about 10 elements the it goes to the second map. Some weird stuff:)). So do I really need transducers? I am trying to achieve LINQ behaviour if anyone is familiar with c#
14:21justin_smithtransduers were a tangent
14:28bitcyclejustin_smith: quick question. how would I coorce the argument here? ["-in" "what file to compress" :validate [some? "Must be provided", #(.exists (as-file))]]))
14:29bitcyclenm, I got it. :)
14:29justin_smithbitcycle: yeah, no coercion is needed for some? to work
14:37justin_smithbitcycle: also there is a more specific test you could use - string?
14:38TimMcbitcycle: You can also leave "file exists" stuff for later; it's not necessarily appropriate for first-pass validation.
14:38TimMce.g. checking that the file exists may not be relevant depending on some other options
14:39TimMcvalidate only allows you to check each one in isolation
14:44dfletcherheh well justin_smith after our discussion yesterday and reading through https://github.com/edn-format/edn I actually ended up just wrapping java.util.Preferences. It's just much simpler and don't have to think about where they're stored on disk, and I don't really need to treat them as a collection. thanks for pushing me towards a globally mutable state though - when reading about clojure this seems like a big no-no, but a necessary evil
14:47bitcyclejustin_smith: So, here's what I've got now. It looks right, but when I dont pass any argument to the jar, it doesn't report failure. https://github.com/sochoa/compressit/blob/master/src/compress/core.clj
14:55elvis4526I'm having with a production app deployed on a server with nginx
14:56elvis4526I'm sending some custom headers when calling the rest api on the frontend
14:56elvis4526when I run the app locally, the backend can catch the custom header
14:56elvis4526when the app is running with nginx (+ its over https), the backend doesn't seem to see the custom header
14:57elvis4526is there anything particular about ssl and HTTP in general that i'm not aware off ?
14:57elvis4526Is there an #http channel or something like that
15:10justin_smithelvis4526: my suspicion would be that nginx is ignoring and thus not forwarding the header
15:10justin_smithand #nginx would be a good place to ask regardless, I bet
16:03danielcomptoncfleming: I was stoked to be able to run a Clojure REPL by right clicking on a pom.xml
16:42kaiyinIs there a clojure library for reading epub?
16:48WickedShellI think I'm being an idiot here, but I'm trying to import a java library, that I have in a jar file. No matter how I try and import from the commandline I can't seem to succeed in resolving the import. If I pass javap the jar file as the classpath it finds it succesfully, and I can see in clojure that the jar file is in the classpath, but I can't seem to import any of the classes or actually use them, any idea what might be happening? I suspect tha
16:48WickedShellt I am having a problem relating to java packages and paths but I'm pretty lost
16:52Yosheehi
16:53Yosheehi guys
16:54justin_smithWickedShell: how are you setting your classpath? are you using a tool like lein or boot?
16:55YosheeYes
16:55WickedShelljustin_smith, I'm using lein the jar is specified through the :resource-paths at the moment (not sure that is actually correct)
16:55YosheeWickedShell
16:55YosheeHow are you ?
16:56justin_smithin order of preference: ask for the jar as a maven dep, install it locally then require that, explicitly put the absolute path of the jar itself on your resource-paths
16:57WickedShellI've never touched maven, and had to build the jar myself, is it worth delving into maven for a jar that I will need to maintain?
16:57justin_smithWickedShell: no no, lein deps are just maven coords
16:57justin_smithso put it in your deps
16:58justin_smithif you had to build it, then you can also use mvn to install locally
16:58justin_smithbut better if you can ask for it from a public repo of course
17:00brainproxywhy does putting metadata on a function make invocations of that function slower?
17:00WickedShellyeah, I'm not sure if that's an option to do yet, the java files are actually generated content...
17:00brainproxyand is there anything I can do about it, i.e. if I really need to have metadata on the function
17:00justin_smithWickedShell: you can manually install any jar to your local maven cache, which is what lein uses to find deps
17:00WickedShelljustin_smith, do you have a link handy related to adding a local jar to maven? (haven't found it via google yet)
17:01justin_smithbrainproxy: usually metadata would go on vars, not functions
17:01WickedShellsplit developing between windows and *nix and maven is not an installed tool, or at least from the commandline
17:01justin_smithyes, it is an install tool
17:01cflemingdanielcompton: Nice! yeah, I need to make some easier REPL start options.
17:02justin_smith$google mvn install arbitrary jar
17:02lazybot[How to include custom library into maven local repository?] http://www.mkyong.com/maven/how-to-include-library-manully-into-maven-local-repository/
17:02danielcomptoncfleming: well that was about as easy as I could expect for a pom
17:02justin_smithWickedShell: ^ see link
17:02oddcullyWickedShell: search for mvn install http://stackoverflow.com/questions/442230/how-to-manually-install-an-artifact-in-maven-2
17:03justin_smithWickedShell: anyway, it's a one liner with a few magic command line switches, and after that you can just require the jar like you would any other dep from lein
17:03brainproxyjustin_smith: i need it on the funcs
17:04justin_smithbrainproxy: interesting, I have never heard of that perf issue, but I wouldn't be surprised by it either
17:08danielcomptoncfleming: but lein REPL invocation could be a touch easier
17:09cflemingdanielcompton: Yeah - I plan to create the run config by default, and put a button in the empty toolwindow to start it.
17:09danielcomptoncfleming: perfect
17:09cflemingdanielcompton: I might actually also prompt the user if they try to send something to the REPL and there isn't one running.
17:10danielcomptoncfleming: that would be good too
17:10cflemingdanielcompton: BTW with lein you can also right-click on project.clj, as you did with pom.xml.
17:11danielcomptoncfleming: question, is there a way to tell when a REPL is ready for use? After the startup, it doesn't have a visual indication that it's ready for input (that I could see)
17:11cflemingdanielcompton: No, there's really no good way to tell that that I'm aware of. I'd love to fix that though, since several people have reported that loading things into the REPL while it's still starting can leave it in a funky state.
17:13cflemingdanielcompton: Right, I don't focus the editor window until the REPL is supposedly ready, but it's not very reliable.
17:20WickedShelljustin_smith, I think I got it in with maven, it shows up in deps tree, I still see the same problem on importing though http://pastebin.com/TVMCYSPb for reference Parser is a java class located in com.MAVLink, there is no clojure in the jar file
17:24justin_smithWickedShell: does Parser not have a package?
17:24WickedShellits within the com.Mavlink package
17:25justin_smiththen the correct way to import it is (import com.MAVLink.Parser)
17:26justin_smithyou don't need to quote it, because jvm class loading is used to resolve it before you import
17:26WickedShellso that's what I thought to, but that ends up throwing a ClassNotFoundException (and the jar is in the classpath)
17:27justin_smithis parser a normal class? is it an inner class? anything else that might be special about it?
17:27justin_smithif it is an inner class, use $ instead of .
17:27justin_smithcom.MAVLink$Parser (but com is a terrible package to be using so I doubt it is that)
17:28WickedShellnope, parser is a very standard class
17:33WickedShellis there a method to dump *all* classes that the REPL can see? (outside of the simple presence of the classpath) I have to wonder if I built my JAR file wrong (although javap makes me feel better about it)
17:41tomjack"(wrong name: com/MAVLink/Parser)" interesting
17:41tomjackis it `package com.mavlink` or `package com.MAVLink`?
17:42WickedShellpackage com.MAVLink;
17:42WickedShellwhich is the worstname in my opnion, I hate the selected casing on MAVLink.....
17:45tomjackand it's in com/MAVLink/Parser.class on the classpath? curious whether you're on a mac
17:46tomjackI guess it hopefully shouldn't matter if it's inside a jar?
17:46tomjackwait, what: (import 'Parser) ??
17:46lazybottomjack: Uh, no. Why would you even ask?
17:46WickedShellit's a windows machine, if I dump the classpath within clojure I only see the jar of course
17:47tomjackyou have it as just Parser.class on the classpath?
17:47tomjacki.e. inside that jar
17:47tomjackit needs to be at com/MAVLink/Parser.class inside the jar
17:49WickedShell*cough* um yeah that makes sense... not really sure why the entire thing doesn't just build that way... well imma go coerce it so that makes sense and see what happens
17:52tomjackthen your import should be fixed to what justin_smith indicated
17:55justin_smithso the issue is that the file had a mismatched package / directory structire, sounds like
17:56WickedShelltomjack, justin_smith yeah that was it, thanks a lot! I admit the jar came out looking different then I was used to, but I expected that the creators new what they were doing with it... (clearly not)
19:01danielcomptonWhat is the impact of having unused requires in a namespace? I presume it adds to compilation time, is there anything else?
19:20the-kennydanielcompton: The namespace might cause some side effects. Or some code walks through all project namespaces to do something.
19:21danielcomptonthe-kenny: ah yes, side effecting require's, my favourite
19:21the-kennydanielcompton: yeah :D
19:21the-kennydanielcompton: well. The other thing might be more valid.
19:47afhammadhow can I add a local dependancy during development in leiningen?
19:48irctc\w
19:53jleglerCan anyone point me to any tutorials or example code of using http-kit with an async library that isn't websockets?
19:55jleglerAll I want to do is take get a request, asynchronously grab some data from postgres, and respond. Apparently it's the first time anyone has tried to do it.
19:55jleglerSorry, I'm really frustrated.
20:01lvhjlegler: I don't know to what extent http-kit does that, but aleph definitely does, and also uses the ring api
20:02danielcomptonjlegler: you could have a look at https://crossclj.info/ns/http-kit/2.1.19/project.clj.html to see libraries which use http-kit
20:02lvhjlegler: more importantly, aleph uses manifold, which is a library specifically built around the idea of being able to do the plumbing between all of these async concepts :)
20:02lvhjlegler: also let-flow is basically the best thing ever <3
20:03jleglerI will take a look at it. I'm a Scala dev primarily, and it just kind of shocks me that the async is so bad. I have to be doing something wrong.
20:04jleglerI like a lot about this language, but the async stuff is driving me kind of nuts.
20:07jleglerManifold looks good. This is more like how I expect an async library to work. Thank you.
20:19maxpenguinHey I've got this in my project.clj: :profiles {:uberjar {:aot :all} :lib {:aot :none}}, but running lein with-profile lib uberjar it does aot
20:20maxpenguinI want to have one clojure project that has a main with aot (so it can be used as a console app) but also can be built as a library (without aot, main .class etc.)
20:21maxpenguinany suggestions or ideas?
20:23TimMcmaxpenguin: Generally, a lib would not be an uberjar anyhow, not that that answers your question.
20:25justin_smithyou could make an optional shim class or ns with main. or use the clojure.rt api or load inside a method at runtme so aot is not transitive to the lib code
20:26maxpenguinjustin_smith: interesting, let me look into that - thanks :)
20:28TimMcmaxpenguin: look at lein-otf for inspiration
20:29maxpenguinTimMc: thanks, will do
21:14cmhobbsjust posted this in #clojure-beginners, anyone here have an idea?
21:14cmhobbshello, all! i'm new to clojure and i'm not sure what exactly this stack trace is pointing at. could this be an issue with my code or does it seem like i don't have the proper packages installed on my system? here's the error: https://gist.github.com/cmhobbs/151715947143a9f95aa6 and it appears to be complaining about this line: https://github.com/madetomeasure/madetomeasure/blob/readme_and_config/test/madetomeasure_api/test/routes/subscribers.cl
21:14cmhobbsj#L10
21:15cmhobbsmigrations work just fine for me (with clj-sql-up). i'm on debian wheezy and i have postgres and the postgres jdbc drivers
21:19TEttingercmhobbs, it seems like the lower error is the most relevant; the problem seems to be when it tries to load your db-spec
21:21cmhobbsTEttinger, i'll start looking that direction, thanks
21:22TEttingercmhobbs, there seems like there might be a quirk here, though I have 0 experience with JDBC: https://github.com/madetomeasure/madetomeasure/blob/readme_and_config/src/madetomeasure_api/db/core.clj#L12
21:22TEttingerit says that the expected string has one ":" in it
21:22TEttingerbut you're splitting into 3 parts and discarding the first
21:23cmhobbsTEttinger, i'll look there
21:23cmhobbsthanks again
21:23TEttingernp
21:47crimeministerhey folks, are there any pedestal gurus about by any chance?
21:47xeqi~anyone
21:47clojurebotanyone is anybody
21:49crimeministerin that case… I posted this on StackOverflow: http://stackoverflow.com/questions/29998012/how-does-one-configure-sibling-pedestal-routes-so-that-all-are-accessible-when-u
21:50crimeministertrying to decide if I've mucked up my terse routes or if I'm encountering something… odd
22:08cmhobbsTEttinger, just for reference, you were absolutely correct. i changed the database strings from "jdbc:postgresql://host/dbname?user=bob&password=123" to "jdbc:postgresql:bob:123@host/dbname" (the canonical jdbc format). i believe the split on ':' in db-spec was there to support the other connection string format
22:08cmhobbsfor whatever reason
22:08cmhobbsthanks again for pointing me in the right direction
22:10durka42(inc TEttinger)
22:10lazybot⇒ 52
22:19TEttingercmhobbs, that's great! what's also great is you solved that, and i got ice cream!
22:19TEttinger(inc ice cream)
22:19lazybot⇒ 1
22:32david_____hi there -- I recently built the dev clojure on my system and was interesting in beginning to contribute. Anyone have any pointers for tasks that are relatively simple that will help me get in the flow of contributing?
22:36david_____interested**
22:37TimMcdavid_____: For contributing to clojure core itself? That's relatively tough.
22:38david_____nope -- any libs
22:38TimMcAh, OK. Well, leiningen has a set of issues labeled "newbie" that should be relatively low-hanging fruit.
22:42david_____awesome -- I will look into these thank you Tim
23:19lvhThat also has the benefit that most folks are using lein, so your code will probably end up helping tons of folks