#clojure logs

2015-05-18

00:01Seyleriusamalloy: http://ix.io/iCy
00:01SeyleriusOh!
00:01SeyleriusI realize where I screwed up one of my tests...
00:01amalloyi'm not going to read all that
00:01amalloybut you seem to not be aware of get-in or assoc-in
00:01SeyleriusYep.
00:02Seyleriusconstrain-sheet is returning a seq, not a vector.
00:02amalloyyou have a lot of stuff like (nth (nth x i) j) instead of (get-in x [i j])
00:02SeyleriusYou were right.
00:02Seyleriusamalloy: Oh, wow. That's fscking useful.
00:02amalloyit, too, only works for vectors, but you are kinda committed to vectors over seqs anyway
00:03SeyleriusRight.
00:03SeyleriusVectors are faster for this sort of thing, too.
00:03SeyleriusSo I just need to make everything output vectors.
00:03SeyleriusLovely.
00:05SeyleriusIs there a map that returns vectors?
00:06SeyleriusOr should I just wrap my map calls in vector?
00:07SeyleriusYep, mapv
00:10SeyleriusWhat about a mapvcat?
00:10Seyleriusor mapcatv?
00:12SeyleriusEh, concat mapv will do.
00:13amalloySeylerius: if you are using 1.7 i think the mapcat transducer works on vectors
00:14Seyleriusamalloy: I'm trying make everything that produces pieces of the actual matrix, at any stage, output in vectors, not seqs. But something's producing a LazySeq.
00:15puredangeramalloy: the transducing context decides where the outputs go
00:15amalloypuredanger: right
00:15puredangerinto lets you pick a target, which can be []
00:19SeyleriusPartition returns a LazySeq!
00:19SeyleriusWhat's a partition replacement that returns a vector?
00:20SeyleriusHrm... split-at is close.
00:24puredangerpartition transducer
00:25Seyleriuspuredanger: Hmm?
00:28puredanger,(into [] (partition-all 3) (range 20))
00:28clojurebot[[0 1 2] [3 4 5] [6 7 8] [9 10 11] [12 13 14] ...]
00:28puredangerin 1.7
00:29SeyleriusThat does it...
00:29SeyleriusOkay.
00:29puredangerand you can stack up multiple transformations in there
00:30puredanger,(into [] (comp (map inc) (filter odd?) (partition 3)) (range 30))
00:30clojurebot#error {\n :cause "Wrong number of args (1) passed to: core/partition"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: core/partition"\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$eval49 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang....
00:30puredanger,(into [] (comp (map inc) (filter odd?) (partition-all 3)) (range 30))
00:30clojurebot[[1 3 5] [7 9 11] [13 15 17] [19 21 23] [25 27 29]]
00:30puredangerall of the work happens in a single pass with no intermediate allocation
00:30SeyleriusDamn.
00:30SeyleriusThat's... amazing.
00:30puredangerso it's substantially faster than the seq model for this use case
00:31puredangeryou can also get a lazy seq out if you like:
00:31puredanger,(sequence [] (comp (map inc) (filter odd?) (partition-all 3)) (range 30))
00:31clojurebot#error {\n :cause "Don't know how to create ISeq from: clojure.core$comp$fn__4492"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: clojure.core$comp$fn__4492"\n :at [clojure.lang.RT seqFrom "RT.java" 528]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 528]\n [clojure.lang.RT seq "RT.java" 509]\n [clojure.lang.RT iter "RT.java" 574]\n [cl...
00:31puredangeroh, no []
00:31puredanger,(sequence (comp (map inc) (filter odd?) (partition-all 3)) (range 30))
00:31clojurebot([1 3 5] [7 9 11] [13 15 17] [19 21 23] [25 27 29])
00:32puredangerand eduction is another flavor that delays the initial work (like a lazy seq) but recomputes the entire thing afresh each time
00:32puredanger,(eduction (comp (map inc) (filter odd?) (partition-all 3)) (range 30))
00:32clojurebot([1 3 5] [7 9 11] [13 15 17] [19 21 23] [25 27 29])
00:32puredangercan't really see the difference in printing here of course
00:33puredangerand transduce lets you apply a final reducing function that's something other than accumulating, similar to reduce
00:35Seyleriuspuredanger: Okay. So, I'm trying to replace these two functions with transducers in order to get only vectors out. Tips? http://ix.io/iCz
00:36SeyleriusOr rather, replace their contents with transducers.
00:36puredanger(defn sheet-boxes [sheet] (into [] (comp (partition-all 3) (map break-box-row)) sheet))
00:36puredangersomething like that maybe?
00:38SeyleriusThat looks good so far.
00:38SeyleriusExcept it's claiming the wrong number of args were passed to partition-all
00:38puredangerare you on 1.7?
00:39Seylerius1.6.0-3
00:39SeyleriusThat's why.
00:39puredangeryeah, switch to 1.7.0-beta3
00:40puredanger(defn break-box-row [box-row] (into [] (mapcat #(partition-all 3 %)))) I think?
00:40Seyleriuspuredanger: On Arch, AUR/clojure-git should do the trick?
00:41puredangerdunno - are you not using lein or something to manage your project/classpath/build ?
00:41Seyleriuspuredanger: Yeah, I am.
00:41SeyleriusJust change it in the project.clj?
00:41puredangeryeah
00:42puredangerhttp://clojure.org/transducers btw if you need some background
00:44Seyleriusproject.clj updated, getting deps...
00:46SeyleriusOkay, the transducers work, but something in there is still producing a sequence...
00:48SeyleriusOkay, it's not the sheet-boxes transducer.
00:49SeyleriusIt must be the break-box-row transducer
00:53puredangerthe inner partition-all
00:54puredanger(defn break-box-row [box-row] (into [] (mapcat #(vec (partition-all 3 %))))) ?
00:57Seylerius,(def box-row [[:a :b :c :d :e :f :g :h :i] [:a :b :c :d :e :f :g :h :i] [:a :b :c :d :e :f :g :h :i]])
00:57clojurebot#'sandbox/box-row
00:57Seylerius,(defn break-box-row [box-row] (into [] (mapcat #(vec (partition-all 3 %)))))
00:57clojurebot#'sandbox/break-box-row
00:57Seylerius,(break-box-row box-row)
00:57clojurebot#error {\n :cause "Don't know how to create ISeq from: clojure.core$comp$fn__4492"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: clojure.core$comp$fn__4492"\n :at [clojure.lang.RT seqFrom "RT.java" 528]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 528]\n [clojure.lang.RT seq "RT.java" 509]\n [clojure.core$seq__4125 invoke "core.clj" 1...
00:57SeyleriusSame thing I got on mine.
00:58SeyleriusI need to be getting [[:a :b :c :a :b :c :a :b :c] [:d :e :f :d :e :f :d :e :f] [:g :h :i :g :h :i :g :h :i]]
00:58Seyleriuspuredanger: Any ideas?
00:59puredangeroh, yeah I misunderstand what that was doing
01:00SeyleriusNo worries, you might've missed the fscking hours of discussion going on about it.
01:00puredangeryes :)
01:00SeyleriusEasy to miss a key piece when it goes on that long.
01:01puredanger,(into [] (partition-all 3) box-row)
01:01clojurebot[[[:a :b :c :d :e ...] [:a :b :c :d :e ...] [:a :b :c :d :e ...]]]
01:01SeyleriusTried that.
01:01SeyleriusHeh.
01:01puredanger,(into [] (map #(partition-all 3 %)) box-row)
01:01clojurebot[((:a :b :c) (:d :e :f) (:g :h :i)) ((:a :b :c) (:d :e :f) (:g :h :i)) ((:a :b :c) (:d :e :f) (:g :h :i))]
01:01puredangerjust working through it
01:01puredanger,(source partition-all)
01:01clojurebotSource not found\n
01:02puredangerderp
01:03SeyleriusLemme grab my original break-box-row.
01:03puredanger'sok, I'm just trying to first get rid of the seqs tehre
01:05puredangeryeah, I think the original may be ok here
01:05puredangerI'm sure there are cleverer ways of doing this, esp if you can guarantee fixed size of these things
01:06puredangerI'm heading to bed, hope that helped at least
01:08SeyleriusYeah, you've got me a lot closer.
01:08SeyleriusThanks
01:08Seylerius(inc puredanger)
01:08lazybot⇒ 54
01:09SeyleriusHah! found the original
01:09Seylerius,(apply map concat (map #(partition 3 %) box-row))
01:09clojurebot#error {\n :cause "Unable to resolve symbol: box-row in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: box-row in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6543]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: box-row i...
01:10Seylerius,(def box-row [[:a :b :c :d :e :f :g :h :i] [:a :b :c :d :e :f :g :h :i] [:a :b :c :d :e :f :g :h :i]])
01:10clojurebot#'sandbox/box-row
01:10Seylerius,(apply map concat (map #(partition 3 %) box-row))
01:10clojurebot((:a :b :c :a :b ...) (:d :e :f :d :e ...) (:g :h :i :g :h ...))
01:10SeyleriusOkay, so, given this, how do I make it output only vectors...
01:10SeyleriusHmm...
01:11J_Arcane,(vec (map vec (apply map concat (map #(partition 3 %) box-row))))
01:11clojurebot[[:a :b :c :a :b ...] [:d :e :f :d :e ...] [:g :h :i :g :h ...]]
01:12Seylerius,(apply mapv (into []) (mapv (partition-all 3) box-row))
01:12clojurebot#error {\n :cause "Wrong number of args (1) passed to: core/into"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: core/into"\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$eval127 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler ...
01:12Seylerius,(mapv (partition-all 3) box-row)
01:12clojurebot[#object[clojure.core$partition_all$fn__6805$fn__6806 0x35b19e7f "clojure.core$partition_all$fn__6805$fn__6806@35b19e7f"] #object[clojure.core$partition_all$fn__6805$fn__6806 0x201cbf63 "clojure.core$partition_all$fn__6805$fn__6806@201cbf63"] #object[clojure.core$partition_all$fn__6805$fn__6806 0x3f590d0d "clojure.core$partition_all$fn__6805$fn__6806@3f590d0d"]]
01:13Seylerius,(mapv #(partition 3 %) box-row)
01:13clojurebot[((:a :b :c) (:d :e :f) (:g :h :i)) ((:a :b :c) (:d :e :f) (:g :h :i)) ((:a :b :c) (:d :e :f) (:g :h :i))]
01:14Seylerius(into [] (comp (partition-all 3) (map identity)) box-row)
01:14Seylerius,(into [] (comp (partition-all 3) (map identity)) box-row)
01:14clojurebot[[[:a :b :c :d :e ...] [:a :b :c :d :e ...] [:a :b :c :d :e ...]]]
01:15luxbock,(mapv vec (apply map concat (map (partial partition 3) box-row)))
01:15clojurebot[[:a :b :c :a :b ...] [:d :e :f :d :e ...] [:g :h :i :g :h ...]]
01:17Seylerius,(map #(partition 3 %) box-row)
01:17clojurebot(((:a :b :c) (:d :e :f) (:g :h :i)) ((:a :b :c) (:d :e :f) (:g :h :i)) ((:a :b :c) (:d :e :f) (:g :h :i)))
01:18Seylerius(inc luxbock)
01:18lazybot⇒ 4
01:18Seyleriusluxbock: I didn't even notice until just now.
01:18SeyleriusYou win.
01:18SeyleriusYou win everything.
01:18luxbocktechnically I think J_Arcane won :P
01:19SeyleriusAh.
01:19SeyleriusI didn't notice that either.
01:19Seylerius(inc J_Arcane)
01:19lazybot⇒ 1
01:19Seylerius(inc J_Arcane)
01:19lazybot⇒ 2
01:19SeyleriusThere.
01:19J_Arcane:) luxbock's solution is probably more elegant. I always forget about mapv. XD
01:19J_ArcaneBut thanks.
01:21SeyleriusPoints for both of you.
01:21Seylerius(inc J_Arcane)
01:21lazybot⇒ 3
01:21Seylerius(inc luxbock)
01:21lazybot⇒ 5
01:25luxbock(doseq [p (list-users "#clojure")] (say (format "(inc %)" p)))
01:25luxbockupvotes for everyone
01:26SeyleriusHeh. That might want a , before it.
01:26SeyleriusAnd it might flood the room.
01:26SeyleriusAnd it might get the bot kicked.
01:27Seyleriusluxbock: These would be funny events, but I'm not going to be the one to risk it.
01:27SeyleriusHrm.
01:28luxbockI wish `partition` had a shorter name, given how fun it is to use
01:30luxbockerr, I meant `partial`
02:09devn(let [$ partial] (($ + 1) 2 3))
02:09devn,(let [$ partial] (($ + 1) 2 3))
02:09clojurebot6
02:09devnnow you've got one luxbock
02:09devn:D
02:15SeyleriusOkay... I'm trying to reverse the order of composition in this transducer, because I need to map break-box-row over the partitioned sheet, but it's failing.
02:15Seyleriushttp://ix.io/iCE
02:22SeyleriusI'm having trouble with the order of these transducers: http://ix.io/iCE
02:23SeyleriusI need to map after partition, but I get a complaint about creating an ISeq from a Long
02:24SeyleriusFound it.
02:24pepijndevosI'm going to build some simple CRUD app. Has Clojure produced any frameworks that deal with all the boring stuf? Usually I like to pick my own routing and templating and database stuff, but for this project I just want to say (use user-registration) and have everything taken care of.
02:25SeyleriusThe result: http://ix.io/iCF
02:28SeyleriusWhat the hell?
02:32SeyleriusOkay. The sheet-boxes function is supposed to be a symmetric function that breaks the 9x9 sheet down into 3x3 boxes, and strings those 3x3s out as rows.
02:32SeyleriusDoing it twice is supposed to give you back the original sheet.
02:32SeyleriusBut running it twice is returning the same thing as running it once.
02:33SeyleriusWhat's more interesting is that the result of running it once is correct.
02:35pepijndevosI could throw lib-noir, friend and compojure on a pile and glue it together I guess. But for this project all the assumptions Django makes hold true, so I think that requires less glue.
02:35SeyleriusTake a look at the repl result: http://ix.io/iCG
02:35SeyleriusOh!
02:36SeyleriusLol
02:36pepijndevoshuh?
02:54SeyleriusOkay, the 2d-solver works.
03:03SeyleriusWhere would be the appropriate place in this function to put a try/catch to watch for a failed branch? http://ix.io/iCI
03:04zoti'm doing it wrong with function return types. can anybody steer me in the right direction? https://gist.github.com/anonymous/4ec7ae5158f063df6060
03:05amalloythe metadata ends up on the var, not the function
03:05amalloy(defn ^Boolean foo [x]) (meta #'foo)
03:06Seyleriusamalloy: I'm using exceptions in the fill-square function, watching for any square that gets constrained so far it can't ever be filled, to test for a failed branch in my solver. Where in (http://ix.io/iCI) would you catch the exception and prune the failed branch?
03:07zotamalloy: ahh. interesting. does that mean you cannot hint on anon funcs?
03:08wasamasaanon funcs are anon
03:10SeyleriusGrr... I can't figure out where to stick the try/catch in this (http://ix.io/iCI) to prune failed branches out of my sudoku solver.
03:13borkdudepepijndevos maybe caribou? haven't used it myself
03:14pepijndevos googling...
03:14borkdudepepijndevos other than that, maybe Ruby on Rails (don't know Django). In Clojure it still requires more coding, but I think it's worth the effort. I especially like the Luminus website
03:15borkdudepepijndevos luminus is essentially a guide + leiningen template
03:15pepijndevosI think it's worth the effort for most bigger projects, where you end up having to bend the rules of Rails/Django.
03:16borkdudepepijndevos also if you're going to do any significant front end, I'd go for clojure + clojurescript (Reagent)
03:16pepijndevosYeano. Just a sign in page and reveal.js
03:23devnnow you've got one luxbock
03:23devnwhoops
03:23devndisregard
03:23Seyleriusamalloy: What's the sane way to handle the fact that some branches of my solver will fail?
03:24Seyleriusamalloy: currently fill-square throws an exception if it spots a failed branch, but I'm not sure where to catch it.
03:26amalloySeylerius: not with exceptions. write a recursive function that returns a possibly-empty list of subsolutions, and then iterate over those building up bigger solutions. if the list is empty at any point, iterating over it won't do anything, and you'll automatically short circuit
03:45Seyleriusamalloy: Okay. I've rewritten to replace impossible squares with zero, rows that contain zero with a row of zeros, and sheets that contain a zero-row with a sheet of zeros. I'll filter those out once I get this working right. Unfortunately, the detection of a zero in a row is failing. Code: http://ix.io/iCJ
03:46SeyleriusConveniently, a sheet full of zeros stops the 2d solver, since it uses a sheet full of numbers to know when to stop and return something.
03:47SeyleriusOh!
03:47SeyleriusNvm
04:06Seyleriusamalloy: Okay, what's the best way to ensure that however many times I branch I somehow only keep one level of solutions?
04:07SeyleriusI could pass an empty results vector and add to that...
04:25SeyleriusSo, my solver function (http://ix.io/iCK) branches as many times as necessary, and thus produces a tree-like structure of nested sequences. The actual solutions are 9x9 sudoku grids. How do I flatten out the possible nested sequences without mangling my solutions?
04:26Seyleriusamalloy: Any ideas?
05:10crocketIs http://dpaste.com/0XEYTW6 a good way to re-implement comp function?
05:12mercwithamouthdid anyone else get living clojure? this book is really well written
05:16crocketmercwithamouth, What do you mean?
05:16crocketwell written?
05:20profilcrocket: what about arguments?
05:20crocketWhat arguments?
05:21crocketAnyway
05:21crocketIs http://dpaste.com/0XEYTW6 a good way to re-implement comp function?
05:21crocketI don't really like putting 'identity'.
05:21profilcrocket: comp returns a function, how do you call my-comp with arguments?
05:21clojurebotHuh?
05:22crocketprofil, my-comp also returns a function
05:23crocketI guess I'll have to implement a multi-arity function.
05:33crocketDoes loop support destructuring?
05:45crocketWhy is (fn [first] first+1) wrong?
05:45crocketOops
05:46crocket(+ 1 first)
05:46Kneiva,((fn [first] (+ 1 first)) 2)
05:46clojurebot3
05:47KneivaNothing wrong with it?
05:47crocketI forgot the fact that clojure supports only prefix operations.
05:47crocketinfix operations are not supported.
05:47Kneivaah
05:47sm0ke,(symbol #'clojure.core/inc)
05:47clojurebot#error {\n :cause "clojure.lang.Var cannot be cast to java.lang.String"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.Var cannot be cast to java.lang.String"\n :at [clojure.core$symbol invoke "core.clj" 550]}]\n :trace\n [[clojure.core$symbol invoke "core.clj" 550]\n [sandbox$eval51 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eval "Compiler.java" 6792]\n [cl...
05:47sm0keneed help
05:47Kneivayeah
05:51crocketI re-implemented comp on http://dpaste.com/2XGZPW6
05:51crocketGood
05:51Kneivasm0ke: what are you trying to do?
05:51sm0ketrying to convert var to symbol
05:52Kneivacrocket: nice. I would try to avoid using first as a name since it is a core function.
05:54crocketKneiva, ok
05:58crocketCan clojure return multiple values?
05:58crocketOr, just one value?
05:59hyPiRioncrocket: Technically only one, but effectively many due to destructuring
06:00SeyleriusSo, my solver function (http://ix.io/iCK) branches as many times as necessary, and thus produces a tree-like structure of nested sequences. The actual solutions are 9x9 sudoku grids. How do I flatten out the possible nested sequences without mangling my solutions?
06:01crocketok
06:32SeyleriusHow do you do 3d array slicing in an arbitrary dimension?
06:40SeyleriusBetter question: how do you rotate a 3d array/matrix around an arbitrary axis?
06:42lokeSeylerius: You multiply by a rotation matrix
06:43Seyleriusloke: How do you multiply by a rotation matrix in clojure?
06:43lokehttps://en.wikipedia.org/wiki/Rotation_matrix
06:51tdammersto clarify: first you build a rotation matrix, then you multiply by it
06:51tdammersa rotation matrix is just another matrix
07:40SeyleriusOkay, here's what we've got: a 3d matrix
07:40Seylerius,(def toy-cube [[[1 2 3] [4 5 6] [7 8 9]] [[10 11 12] [13 14 15] [16 17 18]] [[19 20 21] [22 23 24] [25 26 27]]])
07:41clojurebot#'sandbox/toy-cube
07:41SeyleriusWhat it's supposed to look like transposed into the y axis:
07:41Seylerius,(def y-cube [[[1 2 3] [10 11 12] [19 20 21]] [[4 5 6] [13 14 15] [22 23 24]] [[7 8 9] [16 17 18] [25 26 27]]])
07:41clojurebot#'sandbox/y-cube
07:41SeyleriusWhat it's supposed to look in the z-axis:
07:41Seylerius,(def z-cube [[[1 4 7] [10 13 16] [19 22 25]] [[2 5 8] [11 14 17] [20 23 26]] [[3 6 9] [12 15 18] [21 24 27]]])
07:41clojurebot#'sandbox/z-cube
07:41SeyleriusAnd a transpose function that successfully gets it into the y-axis:
07:41Seylerius,(defn transpose-y [mat] (apply mapv vector sheet))
07:41clojurebot#error {\n :cause "Unable to resolve symbol: sheet in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: sheet in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6543]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: sheet in this...
07:42Seylerius,(defn transpose-y [mat] (apply mapv vector mat))
07:42clojurebot#'sandbox/transpose-y
07:42Seylerius,(= y-cube (transpose-y toy-cube))
07:42clojurebottrue
07:42SeyleriusWhat the hell does transpose-z look like?
07:42Seyleriustranspose-y is also conveniently symmetric:
07:43Seylerius(= toy-cube (transpose-y (transpose-y toy-cube)))
07:43Seylerius,(= toy-cube (transpose-y (transpose-y toy-cube)))
07:43clojurebottrue
07:44SeyleriusI've tried ,,(apply mapv interleave toy-cube)
07:44Seylerius,(apply mapv interleave toy-cube)
07:44clojurebot[(1 10 19 2 11 ...) (4 13 22 5 14 ...) (7 16 25 8 17 ...)]
07:44SeyleriusBut that doesn't come nearly close.
07:44Seylerius,toy-cube
07:44clojurebot[[[1 2 3] [4 5 6] [7 8 9]] [[10 11 12] [13 14 15] [16 17 18]] [[19 20 21] [22 23 24] [25 26 27]]]
07:44Seylerius,z-cube
07:44clojurebot[[[1 4 7] [10 13 16] [19 22 25]] [[2 5 8] [11 14 17] [20 23 26]] [[3 6 9] [12 15 18] [21 24 27]]]
07:45Seylerius,(interleave (map transpose-y toy-cube))
07:45clojurebot([[1 4 7] [2 5 8] [3 6 9]] [[10 13 16] [11 14 17] [12 15 18]] [[19 22 25] [20 23 26] [21 24 27]])
07:45Seylerius,(map transpose-y toy-cube)
07:45clojurebot([[1 4 7] [2 5 8] [3 6 9]] [[10 13 16] [11 14 17] [12 15 18]] [[19 22 25] [20 23 26] [21 24 27]])
07:46Seylerius,toy-cube
07:46clojurebot[[[1 2 3] [4 5 6] [7 8 9]] [[10 11 12] [13 14 15] [16 17 18]] [[19 20 21] [22 23 24] [25 26 27]]]
07:46Seylerius,(apply interleave (map transpose-y toy-cube))
07:46clojurebot([1 4 7] [10 13 16] [19 22 25] [2 5 8] [11 14 17] ...)
07:48Seylerius,(into [] (partition-all 3) (apply interleave (map transpose-y toy-cube)))
07:48clojurebot[[[1 4 7] [10 13 16] [19 22 25]] [[2 5 8] [11 14 17] [20 23 26]] [[3 6 9] [12 15 18] [21 24 27]]]
07:49Seylerius,(= z-cube (into [] (partition-all 3) (apply interleave (map transpose-y toy-cube))))
07:49clojurebottrue
07:49SeyleriusOkay, now we're getting somewhere.
07:54gamesbrainiacquick question, what clojure ide gives you the best intellisense?
07:54gamesbrainiac(asking for anywhere between 1 and 3 IDEs here)
07:55the_freyintellisense?
07:55gamesbrainiaccode completion
07:55gamesbrainiac^ the_frey
07:56the_freyemacs + autocomplete?
07:56oddcullycursive
07:56the_freysome guys here use intellij and cursive
07:56gamesbrainiacwhats the main difference between cursive and la clojure?
07:56gamesbrainiacseems rather similar.
07:57oddcullyla clojure is old stuff
07:57oddcullycursive is the future
07:57gamesbrainiacokay then
07:57gamesbrainiaccursive it is
07:57oddcullydon't waste your days with la clojure unless you run on some old idea
08:41noncomgamesbrainiac: oddcully: i still find eclipse ccw to be far more stabile, predictalbe and useable than cursive..
08:42noncomwanted to switch to cursive some time ago and couldn't make it. too much inconsistencies yet. i believe the author will iron them out with time
08:46noncomdid anyone use ztellmans manifold?
08:46oddcullynoncom: i use fireplace myself and played with cursive. since op asked for some ide and some highrollers here use it, i guess it will be easiest start.
08:47H4nsi have something of an architectural question: i'm writing a system that needs to run customized code based on the vendor it is currently talking to. i would like to isolate the vendor specific code in a separate namespace. what would be the best way to get from an externally supplied vendor name to the contents of the name space?
08:48H4nsi know i can look up symbols in any name space with ns-resolve, but would i then just access the definitions in that name space?
08:48noncomH4ns: what is the problem with ns-resolve?
08:49noncomit will enable you to access the contents of the ns.. ?
08:49H4nsnoncom: there is none. now that i have the namespace, what would i do with it?
08:49noncom,(ns-resolve 'clojure.core '+)
08:49clojurebot#'clojure.core/+
08:49H4nsnoncom: let's say i know that every vendor needs to have a function that i can call to get its configuration. would i just require that the name is defined in the name space and call it?
08:50noncomH4ns: yeah
08:50H4nsnoncom: that'd work, but i find it a bit fishy to look up random symbols in foreign name spaces.
08:50H4nsnoncom: just tell me that it is fine and i'm gone :)
08:50noncom,((ns-resolve 'clojure.core '+) 1 2)
08:50clojurebot3
08:50noncomH4ns: well, you say the symbols are random? aren't the names predefined?
08:51H4nsnoncom: they are predefined. ideally, i'd have something of a predefined protocol.
08:51noncomH4ns: then why not use protocols?
08:51H4nsnoncom: i'm not sure :) that's why i am asking dumb questions.
08:52noncomH4ns: i think that protocol would be the most idiomatic clojure solution to that
08:53noncomthen you could access only one object within the ns, which you know the name of
08:53H4nsnoncom: that still does not really change the issue - i'll still have to put something into the vendor namespace that is known from the outside, correct?
08:54noncomwell, you may force the vendor to register the object that realizes the protocol within some global registry
08:54H4ns-or- i could use a multimethod in the environment and have the vendor code specialize that method for its own vendor name.
08:55H4nsthe issue then is that i need to make sure that all vendor code is actually loaded by the java class loader
08:55noncomH4ns: why wouldn't it all be loaded by the classloader?
08:55H4nsnoncom: because the class loader only loads what is :required or :used
08:56noncomso, you will require the vendors namespace, no?
08:56H4nsi think i can do the loading by the way of a magic namespace name and the dispatching by the way of multimethods.
08:56H4nsyes, i will need to require the namespace.
08:57H4nsthanks! i think i've got a plan now.
08:57noncomokay :)
08:58noncomH4ns: just remember that multimethods dispatch on type
08:58H4nsnoncom: hu? they dispatch on whatever i make them dispatch on, no?
08:58noncomH4ns: not really
08:59noncomtake a look: http://blog.8thlight.com/myles-megyesi/2012/04/26/polymorphism-in-clojure.html
08:59noncom(search for multimethods)
09:00noncomH4ns: using (derive), however, makes better things possible
09:00H4nsi just need to dispatch on the vendor name, so i think i don't need to worry.
09:01noncomH4ns: as far as i understand, the names are strings or, keywords, which are all of the same type..
09:01H4nsi'm not dispatching on types, but on literal values
09:01algernonnoncom: multimethods dispatch on the dispatch whatever the dispatch function returns. in the cited example, the dispatch function is 'class'.
09:01Seylerius,(defn big-cube (repeat 9 (repeat 9 (repeat 9 9))))
09:01clojurebot#error {\n :cause "Parameter declaration \"repeat\" should be a vector"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: Parameter declaration \"repeat\" should be a vector, compiling:(NO_SOURCE_FILE:0:0)"\n :at [clojure.lang.Compiler macroexpand1 "Compiler.java" 6644]}\n {:type java.lang.IllegalArgumentException\n :message "Parameter ...
09:01noncomalgernon: so it is possible to make them dispatch on different string values?
09:01algernonnoncom: yes.
09:01H4nsnoncom: sure
09:01Seylerius,(def big-cube (repeat 9 (repeat 9 (repeat 9 9))))
09:01clojurebot#'sandbox/big-cube
09:01noncomoh, i am sorry
09:02H4nsnoncom: no problem :)
09:02SeyleriusHmm... Now, I need to filter everything non-number out of that.
09:02algernonnoncom: see http://clojuredocs.org/clojure.core/defmulti for a few examples.
09:02noncom,(defn big-cube [] (repeat 9 (repeat 9 (repeat 9 9))))
09:02clojurebot#'sandbox/big-cube
09:02Seylerius(I know that the toy example is all numbers, but the real one isn't)
09:03Seyleriusnoncom: Didn't mean to make it a function, actually.
09:03noncomalgernon: oh, thanks, i really should do more basic clojure :)
09:04noncomis anyone familiar with ztellmans manifold ?
09:04Seylerius,(def big-cube (repeat 9 (repeat 9 (repeat 9 9))))
09:04clojurebot#'sandbox/big-cube
09:04Seylerius,(map (partial map (partial map (partial filter number?))) big-cube)
09:04clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
09:05Seylerius,(map (partial map (partial filter number?)) big-cube)
09:05clojurebot(((9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) ...) ((9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) ...) ((9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) ...) ((9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) ...) ((9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9 9 9 ...) (9 9 9...
09:06Kneivanine nine
09:11crocketClojar
09:23edbondcompojure/ring question: When I add plan selmer's wrap-error-page if works on, if I try to add function that depends on env it doesn't compile https://www.refheap.com/101253
09:23noncomSeylerius: what are you trying to acheive anyway?
09:23noncomcrocket: True
09:23crocketTrue?
09:24noncomcrocket: yeah, Clojar :)
09:24Seyleriusnoncom: I'm building a fully-general 3d sudoku solver.
09:24crocket(map #(+ 1 %) [1 2 3])
09:24SeyleriusTakes a 9x9x9 board, outputs _all_ solutions.
09:24crocket,(map #(+ 1 %) [1 2 3])
09:24clojurebot(2 3 4)
09:24crocketgood
09:24crocket,(+ 1 2 3 4)
09:24clojurebot10
09:25noncomedbond: that's the same error as:
09:25noncom,(defn f (+ 1 2))
09:25clojurebot#error {\n :cause "Parameter declaration \"+\" should be a vector"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: Parameter declaration \"+\" should be a vector, compiling:(NO_SOURCE_FILE:0:0)"\n :at [clojure.lang.Compiler macroexpand1 "Compiler.java" 6644]}\n {:type java.lang.IllegalArgumentException\n :message "Parameter declaratio...
09:26edbondnoncom, yeah, I think I need to return a function
09:26edbondthat will take request as arg
09:26xeqiedbond: are you using this in a -> ?
09:26edbondxeqi, no, just defroutes
09:26justin_smithedbond: but wrap-error-page does return a function
09:27justin_smithI suspect that the thing causing the error isn't in that snippet
09:27edbondjustin_smith, yes, thanks
09:27noncomSeylerius: how is it going?
09:27SeyleriusGood.
09:27SeyleriusVery good.
09:27noncomSeylerius: are you going to visualize it in 3d?
09:27SeyleriusNah. Spread the slices out.
09:27SeyleriusHe's using it for a math paper.
09:28edbondI took a look at wrap-error-page and it starts as (fn [request] ....)
09:29Seyleriusnoncom: What's the simplest way to get a 9x9x9 vector from a file into clojure?
09:29xeqiedbond: I think the error comes from the context (surrounding code) of your paste, not from anything in the wrap-error-page function
09:29justin_smithSeylerius: what's the file format?
09:29Seyleriusjustin_smith: Whatever I want it to be.
09:30xeqiSeylerius: (read-string (slurp "board.txt")) w/ a clojure vector in the file
09:30Seyleriusxeqi: There we go.
09:31xeqior clojure.edn/read-string if your gonna run random unchecked files
09:31justin_smithSeylerius: I'd write the file as [[[...][...]...]...] edn - yeah, like xeqi said but I would name it board.edn :)
09:32Seyleriusjustin_smith: Why .edn? I was going to go with .board
09:32justin_smithbecause it's readable as edn data
09:32SeyleriusAh.
09:33justin_smithjust like pom.xml isn't named pom.maven - it's named after the format, not the thing it contains
09:34H4nsjustin_smith: that argument is not very strong
09:35justin_smithH4ns: it's a convention I like - I was explaining my reasoning, not making an airtight case
09:35H4nsjustin_smith: the reason why i name my edn files .edn is that they open in the right mode in emacs. it is a stupid thing to do really, because these files contain very different things and it would be prudent to use an extension that refers to its contents better.
09:36H4nsjustin_smith: it is particularly stupid of me because i can just put in an emacs mode line to make emacs use the right mode :)
09:36justin_smithH4ns: but we put all clojure files in .clj extensions, and xml files in .xml extensions and json files .json extensions - it's about editor modes, knowing which program can read it...
09:37wasamasaemacs can be made to pick a particular mode for a specially named file btw
09:37justin_smithmy audio files are .wav, .mp3, or .flac, regardless of the artist or song
09:37H4nswasamasa: well, emacs can also look at the first line, so just put "# -*- edn -*-" into the first line and you're done :)
09:37H4nsjustin_smith: it is all music to be opened by a music player
09:38wasamasaH4ns: the change I'm thinking of would make all these changes to the files themselves obsolete
09:38wasamasaH4ns: therefore, it's clearly better!!
09:38H4nsjustin_smith: but a, say, database schema is not a configuration file, but .edn would kind of suggest that the same program can be used to read either.
09:38H4nsjust saying :)
09:38justin_smithH4ns: or a music editor, or a file converter, or my synthesis program that can process the data - point being, file extensions are ubiquitously named after the format, not the application specific context of usage
09:38TMAif you would like your windows users to be able to launch your program, consider separate extension (like .docx, .xlsx, pptx, .jar, ... instead of .zip)
09:41TMAs/to launch your program/to launch your program by double clicking the file/
09:43noncomi believe in data-format-related file extensions
09:46TMAhow specific to be, that's the question
10:47allenj12Hey does anyone else have a problem with nesting (vec ..) functions http://pastebin.com/7tc3txWg ?
10:48allenj12i should prolly re past. but f is a function and from and to are ints
10:50wasamasaargh, I hate how dom stuff in om doesn't indent properly out of the box
10:50wasamasathe problem is that customization of indentation in emacs is for specific symbols and I can hardly list every existent html tag
10:51wasamasaso I'd need to hack the indentation function itself, meh
10:52xeqiallenj12: is the NPE coming from inside f ?
10:52allenj12xeqi: in this case f is just the rand function
10:53allenj12xeqi: more specifically f #(- (rand 2) 1)
10:53TimMc,(vec (repeatedly 4 #(vec (repeatedly 5 rand))))
10:53clojurebot[[0.47165066820536605 0.42377557895259943 0.6036932026466391 0.11837856916010481 0.9818197394650808] [0.3311388125331256 0.40528072465618137 0.8313199969240115 0.17863352477061245 0.08883451272205278] [0.36100737028095065 0.6498729000657513 0.6368831682862915 0.6923044894145112 0.8708705117991977] [0.7782367651855273 0.1845124883243502 0.6539499169752068 0.881158585340406 0.49515563809036434]]
10:54TimMcallenj12: ^ One of your arguments to generate-layer must be bad.
10:55allenj12TimMc: maybe, the function fails before i can print out statements, but it runs on the condition I remove the (vec ... )
10:57allenj12and for some reason i cant print the stack :(
10:58xeqiallenj12: if you can get the error at a repl you can run (clojure.repl/pst *e) as the next command to see the trace
10:58SeyleriusWhy can't I make do lein uberjar or lein run?
10:58Seyleriuss/make//
10:59xeqiSeylerius: cause you don't have lein installed ?
10:59Seyleriusxeqi: Nope.
10:59allenj12xeqi: yea i did (use 'clojure.stacktrace) then (print-stack-trace e* 5) but getting an error
11:00allenj12java.lang.Long cannot be cast to java.lang.Throwable
11:00xeqiallenj12: since repeatedly is lazy, removing the vec will remove the forcing of the values. This will make f only be called when needed. I'd expect that plays into why your error appears
11:00allenj12o ment to swap it but still fails lol
11:00Seyleriusxeqi: uberjar complains about being unable to resolve symbol sizes in this context. run was complaining about that, and is now complaining about being unable to create an ISeq from the symbol of my namespace.
11:00allenj12xeqi: I forced it by printing it
11:01allenj12xeqi: when it did work
11:02Seyleriusxeqi: project.clj: http://ix.io/iDd
11:03xeqiSeylerius: :aot should use a []. But you don't need it when using :main
11:03xeqithe other error means you are trying to use 'sizes' somewhere it is not defined. Look at the file/line number to see where
11:06xeqiallenj12: it is impossible to help debug with the limited information. That function works fine with the declared f, as shown by the clojurebot example earlier. The problem will be in the surrounding code or what it is called with
11:06allenj12xeqi: yea
11:07allenj12xeqi: i just wish i could print the stack I get this error: ClassCastException clojure.core.matrix$e_STAR_ cannot be cast to java.lang.Throwable
11:08xeqiallenj12: that error looks like you are doing something like (throw c.c.m/e* ...). Perhaps you meant to call that function instead?
11:10allenj12xeqi: dont think so
11:23justin_smithcould be something in its print-method or toString impl is throwing that exception
11:23TimMcallenj12: Just do (.printStackTrace *e) and don't fuss around with fancy stuff for now
11:23TimMcYou're standing in front of a yak. Just walk away. :-P
11:24allenj12lol
11:25allenj12TimMc: *e is not equal to e* :P got it working and the original problem
11:25TimMchaha
11:25TimMcSo what was the original bug?
11:28justin_smithand what is e* anyway?
11:28justin_smithI mean, clearly it is a long
11:28allenj12TimMc: wasnt checking nil before a let statment ofc something stupid
11:35TimMcallenj12: So the error wasn't in that code after all?
11:35allenj12TimMc: nope :P
11:35TimMcOK, good. :-P
11:52allenj12i might be setting a record for most unproductive day today the way im coding
12:03SeyleriusThis is complaining about "Can't have more than 1 varadic overload": http://ix.io/iDh
12:09drbobbeatySeylerius: Yeah... if you give it three args, how does it know which form to select? That's the rule of thumb I typically use.
12:11drbobbeatySeylerius: You have to make it clear which version will be selected. In this, it's just not clear.
12:12SeyleriusGotcha.
12:54_maddyhi
13:12eraserhdSo this idiom keeps coming up #(if (pred? %) %). Especially with `some`. Is there some function `foo` such that `(foo pred?)` would do the same thing?
13:13eraserhdI keep thinking `keep`, but that's wrong.
13:16eraserhd'Course, it would also make sense if pos? returned false or x
13:25edwI was chatting with a colleague and he mentioned that he heard that "people" were talking about Clojure 2.0, and that lazy sequences were on the chopping block, or that making laziness not the default sequence behavior was at least being considered. Is ANY of this anything but baseless speculation?
13:38TimMcIt's probably under serious consideration. Lazy sequences do create quite a bit of garbage churn and are pretty hard to optimize.
13:40edw And remembering to realize them when interacting with an object with a limited lifespan e.g. a JDBC statement is a top five source of bugs.
13:42andyfedw: Alex Miller is on this channel fairly regularly with nick puredanger. He may know whether that is anything but baseless speculation.
13:42TimMcThere might be other lazy data structures that still have that pitfall even if they solve lazy seq's problems.
13:45edwTim
13:48canweriotnow(println "Hello")
13:48canweriotnow(+ 1 2)
13:48clojurebot3
13:48canweriotnowThanks, clojurebot
13:52edwTimMc: Very true. I was thinking more about the absence of a convenient data sructure that could be used to provide non-counter-intuitive behavior in such situations. (Thinking through the lifetime of a DB cursor is arguably something you should spend some quality time thinking about, but successful at-the-REPL interactions will generally fail when code moves into a real function.)
13:53puredangeredw: that's baseless speculation
13:54puredangerThere are no such plans
13:54edwpuredanger: Yeah, I asked, because it seemed like speculation, and I couldn't find any reference to any public conversation on the issue.
13:56TimMcWhat is being considered for 2.0?
13:56puredangerthere is no such thing :)
13:56andyfI don't think it is known yet which tickets will be included in changes for 1.8 :)
13:57TimMcpuredanger: Ah, well then. :-)
13:57puredangerI've been working on trying to build a list for a next release to discuss with Rich but no conversation has occurred yet
13:57puredangercertainly the socket repl stuff that got cut will be in next release http://dev.clojure.org/display/design/Socket+Server+REPL
13:57TimMc(No that such a thing is really possible at this point; Clojure is too much in-use for a 2.0 to work.)
13:57andyf(inc puredanger)
13:57lazybot⇒ 55
13:58puredangerand very likely the unrolled small collections stuff
13:58edwI recall hearing about some shoulda-woulda-coulda comments from a Haskell bigwig regarding eager Haskell, and the Clojure comments sounded too similar for them to not be a misattribution of those alleged comments to Rich or whoever.
13:59puredangerI'd kinda like to keep scope small and just do a shortish mostly bugfix release, but we'll see
14:01TimMcPython 3k is the closest thing I've heard of to a plausible breaking-change migration path, and that hasn't gone much of anywhere.
14:03xeqi+1 smaller cycles. I'd have loved a tranducers release, and a speedup release w/o cljc
14:04Bronsapuredanger: your patch for CLJ-1706 allows single-element top-level cond-splice forms -- is that intentional?
14:04puredangernot really, although I'm not sure whether it's good or bad
14:04justin_smithedw: isn't haskell without pervasive laziness just ml++ ?
14:05srrubyI've been using vim-fireplace for a while. How do I get cpr to reload the file? It looks like they changed it...
14:05srrubyIt's running tests now
14:32m1dnight_could somebody have a look at my macro? its driving me insane.
14:32m1dnight_https://www.refheap.com/101269
14:32m1dnight_It says clearly its a fucntion, yet errors when I try to execute it. I cant seem to see why..
14:32m1dnight_perhaps some macro quirck im nog aware of?
14:34TimMcm1dnight_: Have you tried macroexpanding?
14:35m1dnight_Yes; i dont see anything wrong with it :p
14:35m1dnight_im trying to replace the function body with something simple; still debugging :p
14:35m1dnight_been at it for a few hours now :<
14:36TimMcTry macroexpanding and substituting the resulting code in for where you would normally use the macro.
14:37TimMcThat might give you a clearer stack trace at least...
14:37m1dnight_oh yeah, might be a good idea
14:38TimMcI feel like the error is coming from inside the handler, not anything to do with the macro.
14:39TimMcRemember to set *print-meta* to true if you need to capture metadata from the macroexpansion.
14:40TimMcI see "at clojure.java.jdbc$create_table_ddl$spec_to_string__6190.invoke(jdbc.clj:1056)" and that makes me think the macro is just fine.
14:42m1dnight_hmm, this time im not even invoking that function. Darn.
14:50m1dnight_found it.
14:50m1dnight_sigh. :p
14:50m1dnight_,(apply + 1 2 3
14:51clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
14:51m1dnight_,(apply + 1 2 3)
14:51clojurebot#error {\n :cause "Don't know how to create ISeq from: java.lang.Long"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: java.lang.Long"\n :at [clojure.lang.RT seqFrom "RT.java" 528]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 528]\n [clojure.lang.RT seq "RT.java" 509]\n [clojure.lang.RT cons "RT.java" 648]\n [clojure.core$cons__4099 in...
14:51m1dnight_:>
14:53TimMchah!
14:57J_Arcanehttps://github.com/whamtet/Excel-REPL
15:01sandbagsis clojars being troublesome for anyone else?
15:01tcrawleysandbags: define: troublesone
15:01tcrawleysome*
15:02sandbagstcrawley: very slow responses & timeouts
15:02amalloyaw, it was a good trick question when you asked for a definition of troublesone
15:02sandbagsfrom clojars.org in the browser and using lein
15:03sandbagsmy connection seems generally sound otherwise
15:03tcrawleysandbags: it is peppy for me. are you behind a proxy?
15:04sandbagstcrawley: no, but I am a Virgin Media customer in the UK so all bets are off
15:07tcrawleysandbags: maybe some network hiccup between you and the linode DC in ATL. things still look good from here
15:07sandbagstcrawley: yeah looking at the mtr traces that appears to be it
15:08sandbagstcrawley: thx
15:08tcrawleymy pleasure!
15:09sandbagsunfortunately i'm now stymied as I cannot get lein repl to start
15:09sandbagsor, at least, i seem to be ... it throws an exception trying to pull in Liberator and then hangs
15:11sandbagsunless there are mirrors of clojars knocking around?
15:11tcrawleysandbags: what version of liberator? can you gist the stack?
15:12sandbags0.13.0
15:12sandbagsi managed to get lein ancient to at least tell me that was the latest version available
15:13creeseWhat's the best way to find the source of a null pointer exception when I don't have the line number?
15:14sandbagstcrawley: ah, clojars says 0.13 not 0.13.0 ... going from the web dev with clojure book it had 0.11.0 so i just changed it to 0.13.0 looks like that was a mistake
15:14TimMcAll you have is NullPointerException and a file?
15:14tcrawleysandbags: 0.13.0 or 0.13? because the former does not exist
15:14tcrawleyheh
15:15sandbagstcrawley: bad assumption that 0.13 and 0.13.0 would be equivalent :)
15:15creeseI have a stack trace.
15:15amalloysandbags: version numbers are just strings that happen to look a lot like numbers most of the time
15:16amalloytreating them like numbers just leads to tears
15:16sandbagsamalloy: indeed
15:16tcrawleyit is odd that he changed the version scheme from x.y.z to x.y with the latest release
15:16sandbagswell something new is happening so that's good
15:17amalloythat is weird, yeah. apparently all previous versions have been x.y.z
15:17creesehttps://gist.github.com/creese/96b4f85ba664829d129e
15:18sandbagsdarn seems to be hung on... something
15:20sandbagsokay 8th times the charm
15:20sandbagsi wonder if the long ass pause was AOT compilation?
15:21sandbagsi only thought to run lein with DEBUG=true on this last run
15:21oddcullyhave you tried something along the lines of a (d|s|k)trace ?
15:23sandbagsoddcully: i'm guessing that was to me... i hadn't but it seems to have worked itself out now, thanks for the suggestion
15:24oddcullysandbags: yes it was. and well then
15:28mdrogalisWould anyone happen to know what's going on with LambdaJam? Speakers were supposed to be announced on Friday, and Twitter is dead quiet
15:29TimMccreese: Are you doing that from the REPL? Sometimes stack traces involving code loaded on the REPL are less useful becuase of the lack of line numbers.
15:33creeseTimMc: I tried from the command line too. The stack trace is the same.
15:36TimMccreese: Why does "user" show up as a namespace, then?
15:41puredangermdrogalis: they're still working on it
15:42puredangerI think they were hoping to announce today but not sure if they've completed selection yet
15:44creeseTimMc: That might be the trace from cider. I'll repost
15:44creesehttps://gist.github.com/creese/52fd70b6df52bf5d64ce
15:45TimMcIn general, exceptions that occur on someone else's thread can be pretty hard to debug.
15:45creeseI'm using core.async.
15:45mdrogalispuredanger: Ah, okay. Thanks for the heads up. :)
15:48Bronsais it just me or is jira unusable today?
15:48TimMcToday?
15:49BronsaTimMc: i'm talking about dev.clojure.org/jira, not jira itself :P
15:51TimMcIt doesn't seem any slower than usual, no.
15:51TimMccreese: Wait, this is while compiling? I hvae a crude debugging tool if you're not sure which def form is blowing up.
15:51Bronsait's taking up to 10 minutes to load a page
15:52TimMcBronsa: Link? I browsed around.
15:53TimMccreese: This script will sprinkle debugging statements all through your code. Remember to commit any changes before running this unless you want to hand-undo it! https://gist.github.com/timmc/7359898
15:53BronsaTimMc: every ticket or the initial page either won't load or it takes ages to load
15:53xeqiBronsa: its quick for me
15:53Bronsaweird
15:54patrickgombertxeqi: +1 it feels faster than usual for me
15:54TimMcBronsa is getting all of our wait times.
15:54patrickgombertBronsa is hitting all of the GC cycles
15:55TimMcSomeone screwed up the speedup loop distributor so that it is insufficiently randomized. :-P
15:56creeseTimMc: found the error. I'll keep your script in mind for the future.
16:01m1dnight_Can somebody tell me what I'm looking at here?
16:01m1dnight_:time #inst "2015-05-18T19:55:01.723000000-00:00"
16:01m1dnight_It's supposed to be a key value pair from a hashmap
16:01m1dnight_bt I dont get what the #inst is doing there
16:01Bronsa,(java.util.Date.)
16:01clojurebot#inst "2015-05-18T20:02:02.191-00:00"
16:02m1dnight_ooooh
16:02Bronsait's a tagged literal
16:02m1dnight_Never seen it before! :) thanks
16:11bensutalking about tagged literals, does anybody here implement a #uri literal?
16:45m1dnight_okay, i have a small final question, if you guys dont mind
16:46m1dnight_im trying to read the git hash for an application
16:47m1dnight_say I know the path (e.g., "/path/to/repo") and I want to call "git rev-parse HEAD" Ifigured I could do something like this: (sh (format "cd %s && git rev-parse HEAD" path))
16:47m1dnight_but I keep getting "no such file or directory"
16:49amalloym1dnight_: clojure.java.shell/sh isn't bash, it's exec (3)
16:49amalloyspecifically, it's not a shell. you're trying to execute a single file named "cd foo && git rev-parse HEAD"
16:50m1dnight_Yeah I figured as much. I thought /usr/bin/git would have solved it but i was wrong
16:50m1dnight_im not really read into all this stuff :)
16:50m1dnight_maybe use a git hook instead
16:50amalloyno, you are not understanding. it's not that PATH isn't loaded from your bashrc, bash is not running at all, there is nothing to parse your command-line or run cd
16:51amalloyif you want bash, you need to run it yourself: (sh (format "bash -c 'cd %s && git rev-parse HEAD'") path)
16:51m1dnight_oooh
16:51m1dnight_now that makes sense
16:52canweriotnowSo I'm having a clojars problem I've never seen before: The SNAPSHOT jar gts created but then lein deploy throws: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection
16:52canweriotnowAny clue at all?
16:54amalloyyour project.clj is probably broken. perhaps something like a misconfigured :repositories setting
16:56canweriotnowmalloy: prject.clj looks normal, but I don't have a :repositories key, didn't think it was necessary for clojars. Should I add that?
16:57amalloyno
16:58tcrawleycanweriotnow: do you get a stack trace? if so, can you gist it?
17:00canweriotnowtcrawley: Here's my project.clj and stacktrace - https://gist.github.com/canweriotnow/37383cf08d9d66cd4d0f
17:00m1dnight_(inc amalloy)
17:00lazybot⇒ 272
17:00m1dnight_got it working! (I did have to put all arguments as an array, instead of a string format)
17:01amalloycanweriotnow: do you have something broken in your ~/.lein/profiles.clj?
17:03tcrawleycanweriotnow: do you have a :repositories or :signing entry there (profiles.clj)?
17:03canweriotnowmaybe, lemme try excluding my user profile, there's some android and datomic stuff in there.
17:04canweriotnowHell yes, it was my ~/.lein/profiles.clj
17:04canweriotnowtcrawley: yep, there was a :signing key for clojure-android. Probably the issue.
17:04canweriotnowThanks!
17:05canweriotnow(inc tcrawley)
17:05lazybot⇒ 2
17:05canweriotnow(inc amalloy)
17:05lazybot⇒ 273
17:05tcrawleymy pleasure!
18:06crocketWhy does leiningen launch an old version of nrepl if it's launched outside a leiningen project?
18:06crocketI specified a recent version of nrepl in ~/.lein/profiles.clj
18:06crocketIs it a bug?
21:05devnreally enjoying reading through Dunaj
21:06devnwhat a great effort, and so many good ideas that i would love to see find their way into clojure
21:23gfrederickshas anybody done file uploads with ring/wrap-multipart-params?
21:23gfredericksmine works for small files but gets a weird EOF for a ~6mb file
21:25gfredericksit happens within 20sec so the max-idle-time option on the run-jetty-function (which defaults to 200sec) is presumably not involved
21:33gfredericksI think upgrading the hell out of ring-jetty-adapter might have fixed it
21:37gfrederickswell the 6mb file works but the 121mb file fails the same way :/
21:38hiredmanif I understand correctly, multipart params uploads files to a temp file, so maybe check to see if wherever it stores those has enough disk space or something
21:40gfredericksit does
21:40gfredericksassuming it's in /tmp, and I thought I saw that it is
21:41hiredmanyou could try using the byte array store to see if that fixes it
21:41gfredericksyeah good idea
21:45gfrederickssame EofException
21:49TimMcgfredericks: Does multipart have to list the size in advance?
21:50TimMcLike, in a request header. I've never looked at this.
22:23xeqigfredericks: are you proxying this behind another server?
22:23xeqior is this just a local jetty dev instance
22:25gfredericksTimMc: dunno about "have to"; should be possible in this case, is just a file upload from an android phone
22:26gfredericksxeqi: no proxies
22:27qsymmachusHello!
22:28gfredericksHello!
22:28qsymmachusI recently started teaching myself clojure and I have a question about `partial`
22:28gfrederickstell us your question
22:29qsymmachusI'm confused by how it is used in some examples
22:29qsymmachuse.g. What is the difference between this: (repeatedly 10 (partial rand-int 10))
22:30qsymmachusAnd this: (repeatedly 10 #(rand-int 10))
22:30qsymmachusThe second version with the function literal makes more sense to me
22:30gfredericksthat's the difference; the version with partial is less readable
22:30qsymmachushaha
22:30qsymmachusSo this would be an example of when not to use partial
22:30gfredericksunless you just really like it that way, and I think some people do
22:31xeqiif your nesting anonymous functions I could see it being useful, but I usually write (fn [x] ...) for one of them
22:32qsymmachusIs (fn [x] ...) another way to write function literals?
22:32gfredericksyep
22:32qsymmachusCool
22:32gfredericksuseful to know because #() does not always suffice
22:33qsymmachusFrankly I find (fn [x] ...) easier to read anyway
22:33qsymmachusProbably because clojure is still new to my eyes
22:34qsymmachusThanks for your help!
22:37amalloyqsymmachus: (fn [x] ...) often is easier to read. don't worry about needing to use #()
22:38amalloyalthough it's a bit wrong to call (fn [x] ...) a function *literal*. it's a list literal, which produces a function when evaluated
22:38gfrederickswhat
22:39lokeamalloy: That's splitting hairs though since after compilation it's a function just like any others, and you don't create a new function every time you evaluate the (fn) form.
22:39lokeYou may, however, create a new closure instance.
22:39gfredericksamalloy: come on man that's not a useful way to use terminology
22:39amalloygfredericks: if literal doesn't mean that, then it doesn't mean anything
22:40gfredericksliteral is a totally useful word without getting into lispy crap
22:40gfrederickspeople use it with their philistine languages all the time
22:41ecelisinteresting, I find easier to read and write #() instead of (fn [x])
22:41ecelisI've been coding in clojure only since March
22:44gfredericksokay I think I just reproduced the problem using netcat instead of jetty
22:45gfredericksso maybe this android browser is incapable of large file uploads or something
22:49xeqigfredericks: could try to hit your jetty instance with a desktop browser and try a large file
22:49gfredericksyeah good idea
22:51gfredericksthese damn phones they just can't computer
22:52gfrederickssame error from a browser :/ now I'm confused
22:52gfredericksmaybe the internet prohibits files >50mb under all circumstances?
22:53xeqibah, I was gonna say that
22:53xeqigfredericks: what status code do you get back on the client when it fails?
22:54gfredericksI expect 500 because I'm recording an exception in my middleware (and re-throwing)
22:54gfredericksorg.eclipse.jetty.io.EofException
22:57gfredericksokay time to give up for the evening
22:57gfredericksthanks for the ideas everybody