#clojure log - May 18 2015

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:01 Seylerius: amalloy: http://ix.io/iCy

0:01 Oh!

0:01 I realize where I screwed up one of my tests...

0:01 amalloy: i'm not going to read all that

0:01 but you seem to not be aware of get-in or assoc-in

0:01 Seylerius: Yep.

0:02 constrain-sheet is returning a seq, not a vector.

0:02 amalloy: you have a lot of stuff like (nth (nth x i) j) instead of (get-in x [i j])

0:02 Seylerius: You were right.

0:02 amalloy: Oh, wow. That's fscking useful.

0:02 amalloy: it, too, only works for vectors, but you are kinda committed to vectors over seqs anyway

0:03 Seylerius: Right.

0:03 Vectors are faster for this sort of thing, too.

0:03 So I just need to make everything output vectors.

0:03 Lovely.

0:05 Is there a map that returns vectors?

0:06 Or should I just wrap my map calls in vector?

0:07 Yep, mapv

0:10 What about a mapvcat?

0:10 or mapcatv?

0:12 Eh, concat mapv will do.

0:13 amalloy: Seylerius: if you are using 1.7 i think the mapcat transducer works on vectors

0:14 Seylerius: amalloy: 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.

0:15 puredanger: amalloy: the transducing context decides where the outputs go

0:15 amalloy: puredanger: right

0:15 puredanger: into lets you pick a target, which can be []

0:19 Seylerius: Partition returns a LazySeq!

0:19 What's a partition replacement that returns a vector?

0:20 Hrm... split-at is close.

0:24 puredanger: partition transducer

0:25 Seylerius: puredanger: Hmm?

0:28 puredanger: ,(into [] (partition-all 3) (range 20))

0:28 clojurebot: [[0 1 2] [3 4 5] [6 7 8] [9 10 11] [12 13 14] ...]

0:28 puredanger: in 1.7

0:29 Seylerius: That does it...

0:29 Okay.

0:29 puredanger: and you can stack up multiple transformations in there

0:30 ,(into [] (comp (map inc) (filter odd?) (partition 3)) (range 30))

0:30 clojurebot: #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....

0:30 puredanger: ,(into [] (comp (map inc) (filter odd?) (partition-all 3)) (range 30))

0:30 clojurebot: [[1 3 5] [7 9 11] [13 15 17] [19 21 23] [25 27 29]]

0:30 puredanger: all of the work happens in a single pass with no intermediate allocation

0:30 Seylerius: Damn.

0:30 That's... amazing.

0:30 puredanger: so it's substantially faster than the seq model for this use case

0:31 you can also get a lazy seq out if you like:

0:31 ,(sequence [] (comp (map inc) (filter odd?) (partition-all 3)) (range 30))

0:31 clojurebot: #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...

0:31 puredanger: oh, no []

0:31 ,(sequence (comp (map inc) (filter odd?) (partition-all 3)) (range 30))

0:31 clojurebot: ([1 3 5] [7 9 11] [13 15 17] [19 21 23] [25 27 29])

0:32 puredanger: and eduction is another flavor that delays the initial work (like a lazy seq) but recomputes the entire thing afresh each time

0:32 ,(eduction (comp (map inc) (filter odd?) (partition-all 3)) (range 30))

0:32 clojurebot: ([1 3 5] [7 9 11] [13 15 17] [19 21 23] [25 27 29])

0:32 puredanger: can't really see the difference in printing here of course

0:33 and transduce lets you apply a final reducing function that's something other than accumulating, similar to reduce

0:35 Seylerius: puredanger: Okay. So, I'm trying to replace these two functions with transducers in order to get only vectors out. Tips? http://ix.io/iCz

0:36 Or rather, replace their contents with transducers.

0:36 puredanger: (defn sheet-boxes [sheet] (into [] (comp (partition-all 3) (map break-box-row)) sheet))

0:36 something like that maybe?

0:38 Seylerius: That looks good so far.

0:38 Except it's claiming the wrong number of args were passed to partition-all

0:38 puredanger: are you on 1.7?

0:39 Seylerius: 1.6.0-3

0:39 That's why.

0:39 puredanger: yeah, switch to 1.7.0-beta3

0:40 (defn break-box-row [box-row] (into [] (mapcat #(partition-all 3 %)))) I think?

0:40 Seylerius: puredanger: On Arch, AUR/clojure-git should do the trick?

0:41 puredanger: dunno - are you not using lein or something to manage your project/classpath/build ?

0:41 Seylerius: puredanger: Yeah, I am.

0:41 Just change it in the project.clj?

0:41 puredanger: yeah

0:42 http://clojure.org/transducers btw if you need some background

0:44 Seylerius: project.clj updated, getting deps...

0:46 Okay, the transducers work, but something in there is still producing a sequence...

0:48 Okay, it's not the sheet-boxes transducer.

0:49 It must be the break-box-row transducer

0:53 puredanger: the inner partition-all

0:54 (defn break-box-row [box-row] (into [] (mapcat #(vec (partition-all 3 %))))) ?

0:57 Seylerius: ,(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]])

0:57 clojurebot: #'sandbox/box-row

0:57 Seylerius: ,(defn break-box-row [box-row] (into [] (mapcat #(vec (partition-all 3 %)))))

0:57 clojurebot: #'sandbox/break-box-row

0:57 Seylerius: ,(break-box-row box-row)

0:57 clojurebot: #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...

0:57 Seylerius: Same thing I got on mine.

0:58 I 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]]

0:58 puredanger: Any ideas?

0:59 puredanger: oh, yeah I misunderstand what that was doing

1:00 Seylerius: No worries, you might've missed the fscking hours of discussion going on about it.

1:00 puredanger: yes :)

1:00 Seylerius: Easy to miss a key piece when it goes on that long.

1:01 puredanger: ,(into [] (partition-all 3) box-row)

1:01 clojurebot: [[[:a :b :c :d :e ...] [:a :b :c :d :e ...] [:a :b :c :d :e ...]]]

1:01 Seylerius: Tried that.

1:01 Heh.

1:01 puredanger: ,(into [] (map #(partition-all 3 %)) box-row)

1:01 clojurebot: [((: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))]

1:01 puredanger: just working through it

1:01 * Seylerius nods

1:01 puredanger: ,(source partition-all)

1:01 clojurebot: Source not found\n

1:02 puredanger: derp

1:03 Seylerius: Lemme grab my original break-box-row.

1:03 puredanger: 'sok, I'm just trying to first get rid of the seqs tehre

1:05 yeah, I think the original may be ok here

1:05 I'm sure there are cleverer ways of doing this, esp if you can guarantee fixed size of these things

1:06 I'm heading to bed, hope that helped at least

1:08 Seylerius: Yeah, you've got me a lot closer.

1:08 Thanks

1:08 (inc puredanger)

1:08 lazybot: ⇒ 54

1:09 Seylerius: Hah! found the original

1:09 ,(apply map concat (map #(partition 3 %) box-row))

1:09 clojurebot: #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...

1:10 Seylerius: ,(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]])

1:10 clojurebot: #'sandbox/box-row

1:10 Seylerius: ,(apply map concat (map #(partition 3 %) box-row))

1:10 clojurebot: ((:a :b :c :a :b ...) (:d :e :f :d :e ...) (:g :h :i :g :h ...))

1:10 Seylerius: Okay, so, given this, how do I make it output only vectors...

1:10 Hmm...

1:11 J_Arcane: ,(vec (map vec (apply map concat (map #(partition 3 %) box-row))))

1:11 clojurebot: [[:a :b :c :a :b ...] [:d :e :f :d :e ...] [:g :h :i :g :h ...]]

1:12 Seylerius: ,(apply mapv (into []) (mapv (partition-all 3) box-row))

1:12 clojurebot: #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 ...

1:12 Seylerius: ,(mapv (partition-all 3) box-row)

1:12 clojurebot: [#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"]]

1:13 Seylerius: ,(mapv #(partition 3 %) box-row)

1:13 clojurebot: [((: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))]

1:14 Seylerius: (into [] (comp (partition-all 3) (map identity)) box-row)

1:14 ,(into [] (comp (partition-all 3) (map identity)) box-row)

1:14 clojurebot: [[[:a :b :c :d :e ...] [:a :b :c :d :e ...] [:a :b :c :d :e ...]]]

1:15 luxbock: ,(mapv vec (apply map concat (map (partial partition 3) box-row)))

1:15 clojurebot: [[:a :b :c :a :b ...] [:d :e :f :d :e ...] [:g :h :i :g :h ...]]

1:17 Seylerius: ,(map #(partition 3 %) box-row)

1:17 clojurebot: (((: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)))

1:18 Seylerius: (inc luxbock)

1:18 lazybot: ⇒ 4

1:18 Seylerius: luxbock: I didn't even notice until just now.

1:18 You win.

1:18 You win everything.

1:18 luxbock: technically I think J_Arcane won :P

1:19 Seylerius: Ah.

1:19 I didn't notice that either.

1:19 (inc J_Arcane)

1:19 lazybot: ⇒ 1

1:19 Seylerius: (inc J_Arcane)

1:19 lazybot: ⇒ 2

1:19 Seylerius: There.

1:19 J_Arcane: :) luxbock's solution is probably more elegant. I always forget about mapv. XD

1:19 But thanks.

1:21 Seylerius: Points for both of you.

1:21 (inc J_Arcane)

1:21 lazybot: ⇒ 3

1:21 Seylerius: (inc luxbock)

1:21 lazybot: ⇒ 5

1:25 luxbock: (doseq [p (list-users "#clojure")] (say (format "(inc %)" p)))

1:25 upvotes for everyone

1:26 Seylerius: Heh. That might want a , before it.

1:26 And it might flood the room.

1:26 And it might get the bot kicked.

1:27 luxbock: These would be funny events, but I'm not going to be the one to risk it.

1:27 Hrm.

1:28 luxbock: I wish `partition` had a shorter name, given how fun it is to use

1:30 err, I meant `partial`

2:09 devn: (let [$ partial] (($ + 1) 2 3))

2:09 ,(let [$ partial] (($ + 1) 2 3))

2:09 clojurebot: 6

2:09 devn: now you've got one luxbock

2:09 :D

2:15 Seylerius: Okay... 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.

2:15 http://ix.io/iCE

2:22 I'm having trouble with the order of these transducers: http://ix.io/iCE

2:23 I need to map after partition, but I get a complaint about creating an ISeq from a Long

2:24 Found it.

2:24 pepijndevos: I'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.

2:25 Seylerius: The result: http://ix.io/iCF

2:28 What the hell?

2:32 Okay. 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.

2:32 Doing it twice is supposed to give you back the original sheet.

2:32 But running it twice is returning the same thing as running it once.

2:33 What's more interesting is that the result of running it once is correct.

2:35 pepijndevos: I 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.

2:35 Seylerius: Take a look at the repl result: http://ix.io/iCG

2:35 Oh!

2:36 Lol

2:36 pepijndevos: huh?

2:54 Seylerius: Okay, the 2d-solver works.

3:03 Where would be the appropriate place in this function to put a try/catch to watch for a failed branch? http://ix.io/iCI

3:04 zot: i'm doing it wrong with function return types. can anybody steer me in the right direction? https://gist.github.com/anonymous/4ec7ae5158f063df6060

3:05 amalloy: the metadata ends up on the var, not the function

3:05 (defn ^Boolean foo [x]) (meta #'foo)

3:06 Seylerius: amalloy: 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?

3:07 zot: amalloy: ahh. interesting. does that mean you cannot hint on anon funcs?

3:08 wasamasa: anon funcs are anon

3:10 Seylerius: Grr... 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.

3:13 borkdude: pepijndevos maybe caribou? haven't used it myself

3:14 pepijndevos: googling...

3:14 borkdude: pepijndevos 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

3:15 pepijndevos luminus is essentially a guide + leiningen template

3:15 pepijndevos: I think it's worth the effort for most bigger projects, where you end up having to bend the rules of Rails/Django.

3:16 borkdude: pepijndevos also if you're going to do any significant front end, I'd go for clojure + clojurescript (Reagent)

3:16 pepijndevos: Yeano. Just a sign in page and reveal.js

3:23 devn: now you've got one luxbock

3:23 whoops

3:23 disregard

3:23 Seylerius: amalloy: What's the sane way to handle the fact that some branches of my solver will fail?

3:24 amalloy: currently fill-square throws an exception if it spots a failed branch, but I'm not sure where to catch it.

3:26 amalloy: Seylerius: 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

3:45 Seylerius: amalloy: 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

3:46 Conveniently, 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.

3:47 Oh!

3:47 Nvm

4:06 amalloy: Okay, what's the best way to ensure that however many times I branch I somehow only keep one level of solutions?

4:07 I could pass an empty results vector and add to that...

4:25 So, 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?

4:26 amalloy: Any ideas?

5:10 crocket: Is http://dpaste.com/0XEYTW6 a good way to re-implement comp function?

5:12 mercwithamouth: did anyone else get living clojure? this book is really well written

5:16 crocket: mercwithamouth, What do you mean?

5:16 well written?

5:20 profil: crocket: what about arguments?

5:20 crocket: What arguments?

5:21 Anyway

5:21 Is http://dpaste.com/0XEYTW6 a good way to re-implement comp function?

5:21 I don't really like putting 'identity'.

5:21 profil: crocket: comp returns a function, how do you call my-comp with arguments?

5:21 clojurebot: Huh?

5:22 crocket: profil, my-comp also returns a function

5:23 I guess I'll have to implement a multi-arity function.

5:33 Does loop support destructuring?

5:45 Why is (fn [first] first+1) wrong?

5:45 Oops

5:46 (+ 1 first)

5:46 Kneiva: ,((fn [first] (+ 1 first)) 2)

5:46 clojurebot: 3

5:47 Kneiva: Nothing wrong with it?

5:47 crocket: I forgot the fact that clojure supports only prefix operations.

5:47 infix operations are not supported.

5:47 Kneiva: ah

5:47 sm0ke: ,(symbol #'clojure.core/inc)

5:47 clojurebot: #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...

5:47 sm0ke: need help

5:47 Kneiva: yeah

5:51 crocket: I re-implemented comp on http://dpaste.com/2XGZPW6

5:51 Good

5:51 Kneiva: sm0ke: what are you trying to do?

5:51 sm0ke: trying to convert var to symbol

5:52 Kneiva: crocket: nice. I would try to avoid using first as a name since it is a core function.

5:54 crocket: Kneiva, ok

5:58 Can clojure return multiple values?

5:58 Or, just one value?

5:59 hyPiRion: crocket: Technically only one, but effectively many due to destructuring

6:00 Seylerius: So, 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?

6:01 crocket: ok

6:32 Seylerius: How do you do 3d array slicing in an arbitrary dimension?

6:40 Better question: how do you rotate a 3d array/matrix around an arbitrary axis?

6:42 loke: Seylerius: You multiply by a rotation matrix

6:43 Seylerius: loke: How do you multiply by a rotation matrix in clojure?

6:43 loke: https://en.wikipedia.org/wiki/Rotation_matrix

6:51 tdammers: to clarify: first you build a rotation matrix, then you multiply by it

6:51 a rotation matrix is just another matrix

7:40 Seylerius: Okay, here's what we've got: a 3d matrix

7:40 ,(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]]])

7:41 clojurebot: #'sandbox/toy-cube

7:41 Seylerius: What it's supposed to look like transposed into the y axis:

7:41 ,(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]]])

7:41 clojurebot: #'sandbox/y-cube

7:41 Seylerius: What it's supposed to look in the z-axis:

7:41 ,(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]]])

7:41 clojurebot: #'sandbox/z-cube

7:41 Seylerius: And a transpose function that successfully gets it into the y-axis:

7:41 ,(defn transpose-y [mat] (apply mapv vector sheet))

7:41 clojurebot: #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...

7:42 Seylerius: ,(defn transpose-y [mat] (apply mapv vector mat))

7:42 clojurebot: #'sandbox/transpose-y

7:42 Seylerius: ,(= y-cube (transpose-y toy-cube))

7:42 clojurebot: true

7:42 Seylerius: What the hell does transpose-z look like?

7:42 transpose-y is also conveniently symmetric:

7:43 (= toy-cube (transpose-y (transpose-y toy-cube)))

7:43 ,(= toy-cube (transpose-y (transpose-y toy-cube)))

7:43 clojurebot: true

7:44 Seylerius: I've tried ,,(apply mapv interleave toy-cube)

7:44 ,(apply mapv interleave toy-cube)

7:44 clojurebot: [(1 10 19 2 11 ...) (4 13 22 5 14 ...) (7 16 25 8 17 ...)]

7:44 Seylerius: But that doesn't come nearly close.

7:44 ,toy-cube

7:44 clojurebot: [[[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]]]

7:44 Seylerius: ,z-cube

7:44 clojurebot: [[[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]]]

7:45 Seylerius: ,(interleave (map transpose-y toy-cube))

7:45 clojurebot: ([[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]])

7:45 Seylerius: ,(map transpose-y toy-cube)

7:45 clojurebot: ([[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]])

7:46 Seylerius: ,toy-cube

7:46 clojurebot: [[[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]]]

7:46 Seylerius: ,(apply interleave (map transpose-y toy-cube))

7:46 clojurebot: ([1 4 7] [10 13 16] [19 22 25] [2 5 8] [11 14 17] ...)

7:48 Seylerius: ,(into [] (partition-all 3) (apply interleave (map transpose-y toy-cube)))

7:48 clojurebot: [[[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]]]

7:49 Seylerius: ,(= z-cube (into [] (partition-all 3) (apply interleave (map transpose-y toy-cube))))

7:49 clojurebot: true

7:49 Seylerius: Okay, now we're getting somewhere.

7:54 gamesbrainiac: quick question, what clojure ide gives you the best intellisense?

7:54 (asking for anywhere between 1 and 3 IDEs here)

7:55 the_frey: intellisense?

7:55 gamesbrainiac: code completion

7:55 ^ the_frey

7:56 the_frey: emacs + autocomplete?

7:56 oddcully: cursive

7:56 the_frey: some guys here use intellij and cursive

7:56 gamesbrainiac: whats the main difference between cursive and la clojure?

7:56 seems rather similar.

7:57 oddcully: la clojure is old stuff

7:57 cursive is the future

7:57 gamesbrainiac: okay then

7:57 cursive it is

7:57 oddcully: don't waste your days with la clojure unless you run on some old idea

8:41 noncom: gamesbrainiac: oddcully: i still find eclipse ccw to be far more stabile, predictalbe and useable than cursive..

8:42 wanted 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

8:46 did anyone use ztellmans manifold?

8:46 oddcully: noncom: 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.

8:47 H4ns: i 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?

8:48 i 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?

8:48 noncom: H4ns: what is the problem with ns-resolve?

8:49 it will enable you to access the contents of the ns.. ?

8:49 H4ns: noncom: there is none. now that i have the namespace, what would i do with it?

8:49 noncom: ,(ns-resolve 'clojure.core '+)

8:49 clojurebot: #'clojure.core/+

8:49 H4ns: noncom: 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?

8:50 noncom: H4ns: yeah

8:50 H4ns: noncom: that'd work, but i find it a bit fishy to look up random symbols in foreign name spaces.

8:50 noncom: just tell me that it is fine and i'm gone :)

8:50 noncom: ,((ns-resolve 'clojure.core '+) 1 2)

8:50 clojurebot: 3

8:50 noncom: H4ns: well, you say the symbols are random? aren't the names predefined?

8:51 H4ns: noncom: they are predefined. ideally, i'd have something of a predefined protocol.

8:51 noncom: H4ns: then why not use protocols?

8:51 H4ns: noncom: i'm not sure :) that's why i am asking dumb questions.

8:52 noncom: H4ns: i think that protocol would be the most idiomatic clojure solution to that

8:53 then you could access only one object within the ns, which you know the name of

8:53 H4ns: noncom: 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?

8:54 noncom: well, you may force the vendor to register the object that realizes the protocol within some global registry

8:54 H4ns: -or- i could use a multimethod in the environment and have the vendor code specialize that method for its own vendor name.

8:55 the issue then is that i need to make sure that all vendor code is actually loaded by the java class loader

8:55 noncom: H4ns: why wouldn't it all be loaded by the classloader?

8:55 H4ns: noncom: because the class loader only loads what is :required or :used

8:56 noncom: so, you will require the vendors namespace, no?

8:56 H4ns: i think i can do the loading by the way of a magic namespace name and the dispatching by the way of multimethods.

8:56 yes, i will need to require the namespace.

8:57 thanks! i think i've got a plan now.

8:57 noncom: okay :)

8:58 H4ns: just remember that multimethods dispatch on type

8:58 H4ns: noncom: hu? they dispatch on whatever i make them dispatch on, no?

8:58 noncom: H4ns: not really

8:59 take a look: http://blog.8thlight.com/myles-megyesi/2012/04/26/polymorphism-in-clojure.html

8:59 (search for multimethods)

9:00 H4ns: using (derive), however, makes better things possible

9:00 H4ns: i just need to dispatch on the vendor name, so i think i don't need to worry.

9:01 noncom: H4ns: as far as i understand, the names are strings or, keywords, which are all of the same type..

9:01 H4ns: i'm not dispatching on types, but on literal values

9:01 algernon: noncom: multimethods dispatch on the dispatch whatever the dispatch function returns. in the cited example, the dispatch function is 'class'.

9:01 Seylerius: ,(defn big-cube (repeat 9 (repeat 9 (repeat 9 9))))

9:01 clojurebot: #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 ...

9:01 noncom: algernon: so it is possible to make them dispatch on different string values?

9:01 algernon: noncom: yes.

9:01 H4ns: noncom: sure

9:01 Seylerius: ,(def big-cube (repeat 9 (repeat 9 (repeat 9 9))))

9:01 clojurebot: #'sandbox/big-cube

9:01 noncom: oh, i am sorry

9:02 H4ns: noncom: no problem :)

9:02 Seylerius: Hmm... Now, I need to filter everything non-number out of that.

9:02 algernon: noncom: see http://clojuredocs.org/clojure.core/defmulti for a few examples.

9:02 noncom: ,(defn big-cube [] (repeat 9 (repeat 9 (repeat 9 9))))

9:02 clojurebot: #'sandbox/big-cube

9:02 Seylerius: (I know that the toy example is all numbers, but the real one isn't)

9:03 noncom: Didn't mean to make it a function, actually.

9:03 noncom: algernon: oh, thanks, i really should do more basic clojure :)

9:04 is anyone familiar with ztellmans manifold ?

9:04 Seylerius: ,(def big-cube (repeat 9 (repeat 9 (repeat 9 9))))

9:04 clojurebot: #'sandbox/big-cube

9:04 Seylerius: ,(map (partial map (partial map (partial filter number?))) big-cube)

9:04 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

9:05 Seylerius: ,(map (partial map (partial filter number?)) big-cube)

9:05 clojurebot: (((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...

9:06 Kneiva: nine nine

9:11 crocket: Clojar

9:23 edbond: compojure/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

9:23 noncom: Seylerius: what are you trying to acheive anyway?

9:23 crocket: True

9:23 crocket: True?

9:24 noncom: crocket: yeah, Clojar :)

9:24 Seylerius: noncom: I'm building a fully-general 3d sudoku solver.

9:24 crocket: (map #(+ 1 %) [1 2 3])

9:24 Seylerius: Takes a 9x9x9 board, outputs _all_ solutions.

9:24 crocket: ,(map #(+ 1 %) [1 2 3])

9:24 clojurebot: (2 3 4)

9:24 crocket: good

9:24 ,(+ 1 2 3 4)

9:24 clojurebot: 10

9:25 noncom: edbond: that's the same error as:

9:25 ,(defn f (+ 1 2))

9:25 clojurebot: #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...

9:26 edbond: noncom, yeah, I think I need to return a function

9:26 that will take request as arg

9:26 xeqi: edbond: are you using this in a -> ?

9:26 edbond: xeqi, no, just defroutes

9:26 justin_smith: edbond: but wrap-error-page does return a function

9:27 I suspect that the thing causing the error isn't in that snippet

9:27 edbond: justin_smith, yes, thanks

9:27 noncom: Seylerius: how is it going?

9:27 Seylerius: Good.

9:27 Very good.

9:27 noncom: Seylerius: are you going to visualize it in 3d?

9:27 Seylerius: Nah. Spread the slices out.

9:27 He's using it for a math paper.

9:28 edbond: I took a look at wrap-error-page and it starts as (fn [request] ....)

9:29 Seylerius: noncom: What's the simplest way to get a 9x9x9 vector from a file into clojure?

9:29 xeqi: edbond: I think the error comes from the context (surrounding code) of your paste, not from anything in the wrap-error-page function

9:29 justin_smith: Seylerius: what's the file format?

9:29 Seylerius: justin_smith: Whatever I want it to be.

9:30 xeqi: Seylerius: (read-string (slurp "board.txt")) w/ a clojure vector in the file

9:30 Seylerius: xeqi: There we go.

9:31 xeqi: or clojure.edn/read-string if your gonna run random unchecked files

9:31 justin_smith: Seylerius: I'd write the file as [[[...][...]...]...] edn - yeah, like xeqi said but I would name it board.edn :)

9:32 Seylerius: justin_smith: Why .edn? I was going to go with .board

9:32 justin_smith: because it's readable as edn data

9:32 Seylerius: Ah.

9:33 justin_smith: just like pom.xml isn't named pom.maven - it's named after the format, not the thing it contains

9:34 H4ns: justin_smith: that argument is not very strong

9:35 justin_smith: H4ns: it's a convention I like - I was explaining my reasoning, not making an airtight case

9:35 H4ns: justin_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.

9:36 justin_smith: it is particularly stupid of me because i can just put in an emacs mode line to make emacs use the right mode :)

9:36 justin_smith: H4ns: 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...

9:37 wasamasa: emacs can be made to pick a particular mode for a specially named file btw

9:37 justin_smith: my audio files are .wav, .mp3, or .flac, regardless of the artist or song

9:37 H4ns: wasamasa: well, emacs can also look at the first line, so just put "# -*- edn -*-" into the first line and you're done :)

9:37 justin_smith: it is all music to be opened by a music player

9:38 wasamasa: H4ns: the change I'm thinking of would make all these changes to the files themselves obsolete

9:38 H4ns: therefore, it's clearly better!!

9:38 H4ns: justin_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.

9:38 just saying :)

9:38 justin_smith: H4ns: 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

9:38 TMA: if you would like your windows users to be able to launch your program, consider separate extension (like .docx, .xlsx, pptx, .jar, ... instead of .zip)

9:41 s/to launch your program/to launch your program by double clicking the file/

9:43 noncom: i believe in data-format-related file extensions

9:46 TMA: how specific to be, that's the question

10:47 allenj12: Hey does anyone else have a problem with nesting (vec ..) functions http://pastebin.com/7tc3txWg ?

10:48 i should prolly re past. but f is a function and from and to are ints

10:50 wasamasa: argh, I hate how dom stuff in om doesn't indent properly out of the box

10:50 the problem is that customization of indentation in emacs is for specific symbols and I can hardly list every existent html tag

10:51 so I'd need to hack the indentation function itself, meh

10:52 xeqi: allenj12: is the NPE coming from inside f ?

10:52 allenj12: xeqi: in this case f is just the rand function

10:53 xeqi: more specifically f #(- (rand 2) 1)

10:53 TimMc: ,(vec (repeatedly 4 #(vec (repeatedly 5 rand))))

10:53 clojurebot: [[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:54 TimMc: allenj12: ^ One of your arguments to generate-layer must be bad.

10:55 allenj12: TimMc: maybe, the function fails before i can print out statements, but it runs on the condition I remove the (vec ... )

10:57 and for some reason i cant print the stack :(

10:58 xeqi: allenj12: 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:58 Seylerius: Why can't I make do lein uberjar or lein run?

10:58 s/make//

10:59 xeqi: Seylerius: cause you don't have lein installed ?

10:59 Seylerius: xeqi: Nope.

10:59 allenj12: xeqi: yea i did (use 'clojure.stacktrace) then (print-stack-trace e* 5) but getting an error

11:00 java.lang.Long cannot be cast to java.lang.Throwable

11:00 xeqi: allenj12: 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:00 allenj12: o ment to swap it but still fails lol

11:00 Seylerius: xeqi: 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:00 allenj12: xeqi: I forced it by printing it

11:01 xeqi: when it did work

11:02 Seylerius: xeqi: project.clj: http://ix.io/iDd

11:03 xeqi: Seylerius: :aot should use a []. But you don't need it when using :main

11:03 the other error means you are trying to use 'sizes' somewhere it is not defined. Look at the file/line number to see where

11:06 allenj12: 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:06 allenj12: xeqi: yea

11:07 xeqi: 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:08 xeqi: allenj12: that error looks like you are doing something like (throw c.c.m/e* ...). Perhaps you meant to call that function instead?

11:10 allenj12: xeqi: dont think so

11:23 justin_smith: could be something in its print-method or toString impl is throwing that exception

11:23 TimMc: allenj12: Just do (.printStackTrace *e) and don't fuss around with fancy stuff for now

11:23 You're standing in front of a yak. Just walk away. :-P

11:24 allenj12: lol

11:25 TimMc: *e is not equal to e* :P got it working and the original problem

11:25 TimMc: haha

11:25 So what was the original bug?

11:28 justin_smith: and what is e* anyway?

11:28 I mean, clearly it is a long

11:28 allenj12: TimMc: wasnt checking nil before a let statment ofc something stupid

11:35 TimMc: allenj12: So the error wasn't in that code after all?

11:35 allenj12: TimMc: nope :P

11:35 TimMc: OK, good. :-P

11:52 allenj12: i might be setting a record for most unproductive day today the way im coding

12:03 Seylerius: This is complaining about "Can't have more than 1 varadic overload": http://ix.io/iDh

12:09 drbobbeaty: Seylerius: 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:11 Seylerius: You have to make it clear which version will be selected. In this, it's just not clear.

12:12 Seylerius: Gotcha.

12:54 _maddy: hi

13:12 eraserhd: So 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:13 I keep thinking `keep`, but that's wrong.

13:16 'Course, it would also make sense if pos? returned false or x

13:25 edw: I 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:38 TimMc: It's probably under serious consideration. Lazy sequences do create quite a bit of garbage churn and are pretty hard to optimize.

13:40 edw: 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:42 andyf: edw: Alex Miller is on this channel fairly regularly with nick puredanger. He may know whether that is anything but baseless speculation.

13:42 TimMc: There might be other lazy data structures that still have that pitfall even if they solve lazy seq's problems.

13:45 edw: Tim

13:48 canweriotnow: (println "Hello")

13:48 (+ 1 2)

13:48 clojurebot: 3

13:48 canweriotnow: Thanks, clojurebot

13:52 edw: TimMc: 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:53 puredanger: edw: that's baseless speculation

13:54 There are no such plans

13:54 edw: puredanger: Yeah, I asked, because it seemed like speculation, and I couldn't find any reference to any public conversation on the issue.

13:56 TimMc: What is being considered for 2.0?

13:56 puredanger: there is no such thing :)

13:56 andyf: I don't think it is known yet which tickets will be included in changes for 1.8 :)

13:57 TimMc: puredanger: Ah, well then. :-)

13:57 puredanger: I've been working on trying to build a list for a next release to discuss with Rich but no conversation has occurred yet

13:57 certainly the socket repl stuff that got cut will be in next release http://dev.clojure.org/display/design/Socket+Server+REPL

13:57 TimMc: (No that such a thing is really possible at this point; Clojure is too much in-use for a 2.0 to work.)

13:57 andyf: (inc puredanger)

13:57 lazybot: ⇒ 55

13:58 puredanger: and very likely the unrolled small collections stuff

13:58 edw: I 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:59 puredanger: I'd kinda like to keep scope small and just do a shortish mostly bugfix release, but we'll see

14:01 TimMc: Python 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:03 xeqi: +1 smaller cycles. I'd have loved a tranducers release, and a speedup release w/o cljc

14:04 Bronsa: puredanger: your patch for CLJ-1706 allows single-element top-level cond-splice forms -- is that intentional?

14:04 puredanger: not really, although I'm not sure whether it's good or bad

14:04 justin_smith: edw: isn't haskell without pervasive laziness just ml++ ?

14:05 srruby: I've been using vim-fireplace for a while. How do I get cpr to reload the file? It looks like they changed it...

14:05 It's running tests now

14:32 m1dnight_: could somebody have a look at my macro? its driving me insane.

14:32 https://www.refheap.com/101269

14:32 It says clearly its a fucntion, yet errors when I try to execute it. I cant seem to see why..

14:32 perhaps some macro quirck im nog aware of?

14:34 TimMc: m1dnight_: Have you tried macroexpanding?

14:35 m1dnight_: Yes; i dont see anything wrong with it :p

14:35 im trying to replace the function body with something simple; still debugging :p

14:35 been at it for a few hours now :<

14:36 TimMc: Try macroexpanding and substituting the resulting code in for where you would normally use the macro.

14:37 That might give you a clearer stack trace at least...

14:37 m1dnight_: oh yeah, might be a good idea

14:38 TimMc: I feel like the error is coming from inside the handler, not anything to do with the macro.

14:39 Remember to set *print-meta* to true if you need to capture metadata from the macroexpansion.

14:40 I 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:42 m1dnight_: hmm, this time im not even invoking that function. Darn.

14:50 found it.

14:50 sigh. :p

14:50 ,(apply + 1 2 3

14:51 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

14:51 m1dnight_: ,(apply + 1 2 3)

14:51 clojurebot: #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:51 m1dnight_: :>

14:53 TimMc: hah!

14:57 J_Arcane: https://github.com/whamtet/Excel-REPL

15:01 sandbags: is clojars being troublesome for anyone else?

15:01 tcrawley: sandbags: define: troublesone

15:01 some*

15:02 sandbags: tcrawley: very slow responses & timeouts

15:02 amalloy: aw, it was a good trick question when you asked for a definition of troublesone

15:02 sandbags: from clojars.org in the browser and using lein

15:03 my connection seems generally sound otherwise

15:03 tcrawley: sandbags: it is peppy for me. are you behind a proxy?

15:04 sandbags: tcrawley: no, but I am a Virgin Media customer in the UK so all bets are off

15:07 tcrawley: sandbags: maybe some network hiccup between you and the linode DC in ATL. things still look good from here

15:07 sandbags: tcrawley: yeah looking at the mtr traces that appears to be it

15:08 tcrawley: thx

15:08 tcrawley: my pleasure!

15:09 sandbags: unfortunately i'm now stymied as I cannot get lein repl to start

15:09 or, at least, i seem to be ... it throws an exception trying to pull in Liberator and then hangs

15:11 unless there are mirrors of clojars knocking around?

15:11 tcrawley: sandbags: what version of liberator? can you gist the stack?

15:12 sandbags: 0.13.0

15:12 i managed to get lein ancient to at least tell me that was the latest version available

15:13 creese: What's the best way to find the source of a null pointer exception when I don't have the line number?

15:14 sandbags: tcrawley: 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:14 TimMc: All you have is NullPointerException and a file?

15:14 tcrawley: sandbags: 0.13.0 or 0.13? because the former does not exist

15:14 heh

15:15 sandbags: tcrawley: bad assumption that 0.13 and 0.13.0 would be equivalent :)

15:15 creese: I have a stack trace.

15:15 amalloy: sandbags: version numbers are just strings that happen to look a lot like numbers most of the time

15:16 treating them like numbers just leads to tears

15:16 sandbags: amalloy: indeed

15:16 tcrawley: it is odd that he changed the version scheme from x.y.z to x.y with the latest release

15:16 sandbags: well something new is happening so that's good

15:17 amalloy: that is weird, yeah. apparently all previous versions have been x.y.z

15:17 creese: https://gist.github.com/creese/96b4f85ba664829d129e

15:18 sandbags: darn seems to be hung on... something

15:20 okay 8th times the charm

15:20 i wonder if the long ass pause was AOT compilation?

15:21 i only thought to run lein with DEBUG=true on this last run

15:21 oddcully: have you tried something along the lines of a (d|s|k)trace ?

15:23 sandbags: oddcully: i'm guessing that was to me... i hadn't but it seems to have worked itself out now, thanks for the suggestion

15:24 oddcully: sandbags: yes it was. and well then

15:28 mdrogalis: Would anyone happen to know what's going on with LambdaJam? Speakers were supposed to be announced on Friday, and Twitter is dead quiet

15:29 TimMc: creese: 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:33 creese: TimMc: I tried from the command line too. The stack trace is the same.

15:36 TimMc: creese: Why does "user" show up as a namespace, then?

15:41 puredanger: mdrogalis: they're still working on it

15:42 I think they were hoping to announce today but not sure if they've completed selection yet

15:44 creese: TimMc: That might be the trace from cider. I'll repost

15:44 https://gist.github.com/creese/52fd70b6df52bf5d64ce

15:45 TimMc: In general, exceptions that occur on someone else's thread can be pretty hard to debug.

15:45 creese: I'm using core.async.

15:45 mdrogalis: puredanger: Ah, okay. Thanks for the heads up. :)

15:48 Bronsa: is it just me or is jira unusable today?

15:48 TimMc: Today?

15:49 Bronsa: TimMc: i'm talking about dev.clojure.org/jira, not jira itself :P

15:51 TimMc: It doesn't seem any slower than usual, no.

15:51 creese: Wait, this is while compiling? I hvae a crude debugging tool if you're not sure which def form is blowing up.

15:51 Bronsa: it's taking up to 10 minutes to load a page

15:52 TimMc: Bronsa: Link? I browsed around.

15:53 creese: 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:53 Bronsa: TimMc: every ticket or the initial page either won't load or it takes ages to load

15:53 xeqi: Bronsa: its quick for me

15:53 Bronsa: weird

15:54 patrickgombert: xeqi: +1 it feels faster than usual for me

15:54 TimMc: Bronsa is getting all of our wait times.

15:54 patrickgombert: Bronsa is hitting all of the GC cycles

15:55 TimMc: Someone screwed up the speedup loop distributor so that it is insufficiently randomized. :-P

15:56 creese: TimMc: found the error. I'll keep your script in mind for the future.

16:01 m1dnight_: Can somebody tell me what I'm looking at here?

16:01 :time #inst "2015-05-18T19:55:01.723000000-00:00"

16:01 It's supposed to be a key value pair from a hashmap

16:01 bt I dont get what the #inst is doing there

16:01 Bronsa: ,(java.util.Date.)

16:01 clojurebot: #inst "2015-05-18T20:02:02.191-00:00"

16:02 m1dnight_: ooooh

16:02 Bronsa: it's a tagged literal

16:02 m1dnight_: Never seen it before! :) thanks

16:11 bensu: talking about tagged literals, does anybody here implement a #uri literal?

16:45 m1dnight_: okay, i have a small final question, if you guys dont mind

16:46 im trying to read the git hash for an application

16:47 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:47 but I keep getting "no such file or directory"

16:49 amalloy: m1dnight_: clojure.java.shell/sh isn't bash, it's exec (3)

16:49 specifically, it's not a shell. you're trying to execute a single file named "cd foo && git rev-parse HEAD"

16:50 m1dnight_: Yeah I figured as much. I thought /usr/bin/git would have solved it but i was wrong

16:50 im not really read into all this stuff :)

16:50 maybe use a git hook instead

16:50 amalloy: no, 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:51 if you want bash, you need to run it yourself: (sh (format "bash -c 'cd %s && git rev-parse HEAD'") path)

16:51 m1dnight_: oooh

16:51 now that makes sense

16:52 canweriotnow: So 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:52 Any clue at all?

16:54 amalloy: your project.clj is probably broken. perhaps something like a misconfigured :repositories setting

16:56 canweriotnow: malloy: 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:57 amalloy: no

16:58 tcrawley: canweriotnow: do you get a stack trace? if so, can you gist it?

17:00 canweriotnow: tcrawley: Here's my project.clj and stacktrace - https://gist.github.com/canweriotnow/37383cf08d9d66cd4d0f

17:00 m1dnight_: (inc amalloy)

17:00 lazybot: ⇒ 272

17:00 m1dnight_: got it working! (I did have to put all arguments as an array, instead of a string format)

17:01 amalloy: canweriotnow: do you have something broken in your ~/.lein/profiles.clj?

17:03 tcrawley: canweriotnow: do you have a :repositories or :signing entry there (profiles.clj)?

17:03 canweriotnow: maybe, lemme try excluding my user profile, there's some android and datomic stuff in there.

17:04 Hell yes, it was my ~/.lein/profiles.clj

17:04 tcrawley: yep, there was a :signing key for clojure-android. Probably the issue.

17:04 Thanks!

17:05 (inc tcrawley)

17:05 lazybot: ⇒ 2

17:05 canweriotnow: (inc amalloy)

17:05 lazybot: ⇒ 273

17:05 tcrawley: my pleasure!

18:06 crocket: Why does leiningen launch an old version of nrepl if it's launched outside a leiningen project?

18:06 I specified a recent version of nrepl in ~/.lein/profiles.clj

18:06 Is it a bug?

21:05 devn: really enjoying reading through Dunaj

21:06 what a great effort, and so many good ideas that i would love to see find their way into clojure

21:23 gfredericks: has anybody done file uploads with ring/wrap-multipart-params?

21:23 mine works for small files but gets a weird EOF for a ~6mb file

21:25 it happens within 20sec so the max-idle-time option on the run-jetty-function (which defaults to 200sec) is presumably not involved

21:33 I think upgrading the hell out of ring-jetty-adapter might have fixed it

21:37 well the 6mb file works but the 121mb file fails the same way :/

21:38 hiredman: if 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:40 gfredericks: it does

21:40 assuming it's in /tmp, and I thought I saw that it is

21:41 hiredman: you could try using the byte array store to see if that fixes it

21:41 gfredericks: yeah good idea

21:45 same EofException

21:49 TimMc: gfredericks: Does multipart have to list the size in advance?

21:50 Like, in a request header. I've never looked at this.

22:23 xeqi: gfredericks: are you proxying this behind another server?

22:23 or is this just a local jetty dev instance

22:25 gfredericks: TimMc: dunno about "have to"; should be possible in this case, is just a file upload from an android phone

22:26 xeqi: no proxies

22:27 qsymmachus: Hello!

22:28 gfredericks: Hello!

22:28 qsymmachus: I recently started teaching myself clojure and I have a question about `partial`

22:28 gfredericks: tell us your question

22:29 qsymmachus: I'm confused by how it is used in some examples

22:29 e.g. What is the difference between this: (repeatedly 10 (partial rand-int 10))

22:30 And this: (repeatedly 10 #(rand-int 10))

22:30 The second version with the function literal makes more sense to me

22:30 gfredericks: that's the difference; the version with partial is less readable

22:30 qsymmachus: haha

22:30 So this would be an example of when not to use partial

22:30 gfredericks: unless you just really like it that way, and I think some people do

22:31 xeqi: if your nesting anonymous functions I could see it being useful, but I usually write (fn [x] ...) for one of them

22:32 qsymmachus: Is (fn [x] ...) another way to write function literals?

22:32 gfredericks: yep

22:32 qsymmachus: Cool

22:32 gfredericks: useful to know because #() does not always suffice

22:33 qsymmachus: Frankly I find (fn [x] ...) easier to read anyway

22:33 Probably because clojure is still new to my eyes

22:34 Thanks for your help!

22:37 amalloy: qsymmachus: (fn [x] ...) often is easier to read. don't worry about needing to use #()

22:38 although it's a bit wrong to call (fn [x] ...) a function *literal*. it's a list literal, which produces a function when evaluated

22:38 gfredericks: what

22:39 loke: amalloy: 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:39 You may, however, create a new closure instance.

22:39 gfredericks: amalloy: come on man that's not a useful way to use terminology

22:39 amalloy: gfredericks: if literal doesn't mean that, then it doesn't mean anything

22:40 gfredericks: literal is a totally useful word without getting into lispy crap

22:40 people use it with their philistine languages all the time

22:41 ecelis: interesting, I find easier to read and write #() instead of (fn [x])

22:41 I've been coding in clojure only since March

22:44 gfredericks: okay I think I just reproduced the problem using netcat instead of jetty

22:45 so maybe this android browser is incapable of large file uploads or something

22:49 xeqi: gfredericks: could try to hit your jetty instance with a desktop browser and try a large file

22:49 gfredericks: yeah good idea

22:51 these damn phones they just can't computer

22:52 same error from a browser :/ now I'm confused

22:52 maybe the internet prohibits files >50mb under all circumstances?

22:53 xeqi: bah, I was gonna say that

22:53 gfredericks: what status code do you get back on the client when it fails?

22:54 gfredericks: I expect 500 because I'm recording an exception in my middleware (and re-throwing)

22:54 org.eclipse.jetty.io.EofException

22:57 okay time to give up for the evening

22:57 thanks for the ideas everybody

Logging service provided by n01se.net