#clojure log - Mar 11 2012

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

0:01 napping: when encoding with header, is #(header->body (body->header %)) used to get the codec for the body from the body?

0:01 gf3: hey ibdknox, is it (easily) possible to share things like partials between noir and noir-cljs?

0:01 ztellman: napping: yes

0:02 napping: I had the extra arguments to compile-frame switched

0:03 (compile-frame []) acts oddly - what does it need as arguments?

0:04 I'm just getting NPE on encoding, and "Byte left over" even with empty input on decoding

0:04 ztellman: ha

0:04 yeah, I don't think that corner case is handled gracefully

0:05 the expectation is that there's going to be something that consumes/encodes bytes in the frame

0:10 arohner: what's the name of the HOF that takes a fn, and returns #(not (f %))?

0:11 oh, complement

0:11 I gave up after (comp)

0:12 kwertii: is there some trick to compiling code that calls macros at the top level? I get a NullPointerException when compiling (the code works fine at the REPL)

0:12 commenting out the top level macro call allows it to compile

0:13 TimMc: kwertii: "Calls macros at the top level", what do you mean? For instance, defn is a macro.

0:14 kwertii: TimMc: er. true. It must be my specific macro, then.

0:14 Is there some caveat or gotcha for running code in general at the top level when compiling (versus at a REPL)?

0:15 TimMc: kwertii: Try running macroexpand-1 on your macro usage, see if that causes the NPE.

0:17 kwertii: TimMc: No exception, works fine

0:17 everything works 100% correctly in the REPL, as far as I can tell

0:17 TimMc: Well, what if you do the macroexpand call in your file, before the real usage?

0:24 doug: ah, export JVM_OPTS="-Djava.awt.headless=true"

0:24 doug++

0:27 napping: ztellman: to get this to work, I think I need a codec that matches an empty seq to no bytes

0:28 ztellman: napping: I feel like that's lurking somewhere in the code

0:29 looking now

0:32 kwertii: TimMc: no change with putting a macroexpand-1 into the source before the actual call. still fails with NPE

0:32 TimMc: OK, so your macro's code isn't producing the NPE, your generated code is.

0:33 kwertii: TimMc: That seems to be correct

0:33 ztellman: napping: eh, nothing quite fits, you'll need to define: https://gist.github.com/2015155

0:33 like I said, this should be easier

0:33 kwertii: do the *__init classes generated by compilation, which are designed to replicate the effect of loading the file, have a different namespace setup?

0:35 napping: that acts the same as (compile-frame [])

0:35 kwertii: the code in question is calling a function in another namespace, and the NPE is something like file__init.load -> clojure.core$ns_name.invoke -> the_ns.invoke -> find_ns.invoke -> clojure.lang.Namespace.find() -> j.util.concurrent.ConcurrentHashMap.get() -> NPE

0:35 napping: ah, encode by itself produces nil

0:36 the problem is contiguous returns nil as the byte buffer

0:36 so the encoding is actually more or less okay

0:36 well, let me try a larger frame

0:38 encoding does work, it was just my test function not handling empty output

0:38 though you might have contiguous return a zero-length byte buffer on empty input rather than nil

0:38 decoding is still giving the error about leftover bytes

0:38 ztellman: hmm

0:42 napping: in decode it uses empty? on bytes-seq

0:42 ztellman: yeah, looking at that now

0:42 napping: (decode empty-frame nil) works, (decode empty-frame (to-byte-buffer[])) fails

0:43 ztellman: ok, so (compile-frame []) should do what you want

0:43 jonasen: ,::foo/bar

0:43 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: ::foo/bar>

0:43 ztellman: I'm going to fix decode, but my intuition is that if you don't use it in isolation, it should work

0:43 napping: it seems to work if it's not by itself

0:43 ztellman: yeah

0:43 jonasen: ^^ is that ever a valid form to write?

0:45 ztellman: napping: fwiw, you shouldn't need the custom Reader/Writer, (compile-frame []) should suffice

0:45 amalloy: jonasen: yes

0:45 &(require '[clojure.string :as whatever])

0:45 lazybot: ⇒ nil

0:45 amalloy: &::whatever/foo

0:45 lazybot: java.lang.RuntimeException: Invalid token: ::whatever/foo

0:46 jonasen: amalloy: I don't understand it

0:46 amalloy: well. that would work not in a bot

0:46 try those two things in your repl

0:47 xeqi: &::user/bar

0:47 lazybot: ⇒ :user/bar

0:47 jonasen: amalloy: Yes, that works

0:47 xeqi: &(= ::user/bar :user/bar)

0:47 lazybot: ⇒ true

0:48 jonasen: Is it documented anywhere? I've never seen such a form before

0:50 It's weird, since the clojure reader can't read it.

0:50 ,(read-string "::foo/bar")

0:50 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: ::foo/bar>

0:50 napping: It seems to read it the same as :ns/foo

0:50 is foo a valid namespace?

0:51 jonasen: ,:foo/bar

0:51 clojurebot: :foo/bar

0:51 napping: oh, that's odd. It reads it like :ns/foo if ns is a namespace

0:53 ztellman: napping: checked in a fix for the decode issue, (compile-frame []) successfully round-trips now

0:53 napping: nice. I've still got an NPE on encoding with the full definition, but it's not in (compile-frame []) anymore

0:55 https://gist.github.com/2015208

0:57 ztellman: what are you using for 'element'?

0:57 napping: for testing, :int16

0:57 ztellman: how can :int16 be nil?

0:57 oh, nm

0:57 napping: it really shouldn't be, I've probably got something wrong in the base case

0:58 is there anything like macro-let or symbol macros?

0:58 I was hoping to shove the ugly fixpoint hack into a macro

1:10 jonasen: amalloy: So there are valid clojure source files which are unreadable: https://refheap.com/paste/1023 ?

1:11 amalloy: napping: org.clojure/tools.macro

1:11 napping: sorry just got it installed and tested

1:11 amalloy: that's a funny consequence i never thought of, jonasen

1:12 napping: (mu test (fn [x] (if (> x 0) (inc (test (dec x))) 0))) 12) whee

1:12 amalloy: napping: wut?

1:12 napping: it's a fixpoint

1:12 (mu self body) expands to your thing with the promises

1:14 amalloy: you don't really need it for a function to refer to itself, though, only for mutual recursion between functions and/or data objects

1:15 &((fn test [x] (if (> x 0) (inc (test (dec x)))) 0)) 12)

1:15 lazybot: clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox6997$eval10419$test

1:15 napping: where I really need it the top is gloss "header" form, and the self-reference is deeper

1:15 ztellman: napping: found the NPE issue: https://gist.github.com/2015256

1:16 can you see the difference?

1:16 napping: ah, that would do it

1:17 ztellman: I was so convinced it was a fundamental issue with how the header was being used

1:17 took me a bit

1:17 napping: I was pretty sure it was something like that

1:37 amalloy: so ztellman, napping - i'm not paying that much attention, does this mean you can do it with a header with no particular problems?

1:38 ztellman: amalloy: it works for simple cases

1:39 napping: It may have been simpler just to write it directly

1:39 ztellman: probably

1:41 seancorfield: is there a way to ask travis-ci to re-run a build?

1:41 napping: what's the return from read-bytes?

1:41 looks like [success ?? remaining]

1:41 seancorfield: congomongo normally takes 4-5 minutes on travis but for some reason timed out at 30 minutes this evening

1:45 ztellman: napping: it's either [true value remainder] or [false next-reader remainder]

1:45 not the best representation, it should be distinct types

1:45 napping: what should next-reader be?

1:45 ztellman: seancorfield: I had the same thing happen, I couldn't find a way

1:46 napping: the reader that will get the next chunk of bytes, when they're available

1:46 seancorfield: i switched it to a local mongodb instance and it passed in just over a minute... guess using a non-local db instance is a bad idea :)

1:46 ztellman: you can either pass back the current reader, or a modified one that closes over some intermediate state

1:46 you'll always get remainder + new bytes, next time around

1:47 but if you're scanning over bytes for a delimiter, for instance, you don't want to keep going over the same bytes

1:52 napping: I think I see how compose-callback works

1:52 what is write-bytes supposed to do?

1:53 that's not so obvious from reading convert-sequence

1:54 ztellman: write-bytes either overwrites 'but', which is assumed to have relative writes

1:54 or returns a buffer

1:54 but => buf

1:55 napping: I don't see anything yet that makes a new buf

1:55 ztellman: (with-buffer …)

1:55 napping: is ByteBuffer extensible?

1:55 ztellman: nope

1:55 napping: oh, at the finite bits I suppose

1:56 ztellman: yeah, if the size is calculable, then you try to put as many things into a contiguous buffer as possible

1:56 if not, you just concatenate everything together

1:57 again, a few different things are being jammed together

1:58 it works, but the API could be much cleaner

3:00 I'm going to call it a night, and probably won't be on IRC tomorrow - if you get stuck send me an email

3:01 napping: thanks. I've already got the other code, so I don't really need this version even if I do get stuck

3:02 If you're taking another look at the interface you might want to compare http://hackage.haskell.org/package/binary , and on the output side http://hackage.haskell.org/package/binary

3:04 ztellman: thanks, will do

3:09 muhoo: that's weird! this clojar http://clojars.org/serial-port, will not show up in (loaded-libs), even if i have it in my :dependencies [serial-port "1.1.2"]

3:11 and it's there in project/lib/serial-port-1.1.2.jar , looking right at me?

3:11 seriously, wtf?

3:15 napping: the read side of this works, the writing has some error about casting a SingleBufferSequence to nio.Buffer https://gist.github.com/2015393

3:15 muhoo: ah, thaht's a little better: UnsatisfiedLinkError no rxtxSerial in java.library.path java.lang.ClassLoader.loadLibrary (ClassLoader.java:1734)

3:15 but it is in fact there, project/lib/rxtx22-1.0.6.jar , looking right at me.

3:19 lessee if lein deps fixes it

3:30 bah, lein no longer works

3:30 "repl server launch timed out"

3:34 hmm, now the repl locks up

3:35 won't take any input.

3:35 this is bad

3:37 i get a user=> prompt, and then anything i type, i just get a newline. no response from the repl.

3:50 leiningen-2.0.0-preview2 fail.

3:54 *whew*! 1.7.0 works.

4:19 heh https://refheap.com/paste/1024

4:30 dogenpunk: does anyone have any information on setting up swank-clojure classpath?

5:21 Raynes: muhoo: You've got an errant space between 'serial port and ns-publics

5:21 I spotted it from clear across the URL.

5:44 muhoo: i got it working. i'm tired, i think.

5:50 turns out i could have done it in 1 line of bash: echo -n $'\xff' > /dev/ttyUSB0

5:51 also, i was confused, i thought you could do ns-publics on a ns without requiring it first. doh.

6:24 si14: hello, guys. how can I improve this code: https://gist.github.com/9179918ce8b99cd5f03e ?

6:46 muhoo: si14: i'm told there is a mapcat function that can consolidate (concat (map )), but i've not yet used it

7:00 si14: muhoo: thanks for advice, I'll look at it

7:15 foodoo: Does Clojure always use Object as a parameter to Java-Generic constructors?

8:04 raek: foodoo: yes. generics only exist in java and all parameter types are Object on the JVM level

8:07 foodoo: raek: thanks for the answer.

8:39 Vinzent: Hi, have someone used Datomic as a local in-memory db? Is it possible?

9:02 bsteuber: Vinzent: like http://datomic.com/company/resources/clojure-api does?

9:03 you still need to create the db, though

9:04 but as you are not allowed to deliver the datomic jar with your app, it's rather there for testing-only I guess

9:05 I mean end-user apps

9:07 Vinzent: bsteuber, yes, but I also want to be able to save db on disk, e.g. just dump the whole db in the file every hour. I'm just wondering would it cause any problems

9:09 bsteuber, I won't spread the app, it's for my own use, so I guess it not violates the agreement

9:16 bsteuber: somewhere they say you can use virtualbox for saving the image to disc

9:18 Vinzent: bsteuber, it should be automatic, so virtual box thing isn't suitable

9:19 bsteuber: well as any db snapshot the app gets is clj data

9:19 I guess that won't be too hard to store somewhere in a dumb way

9:21 or better store the transactions

9:24 Vinzent: bsteuber, yeah that'd be better but then I have to maintain log of transactions, retract it, etc

9:26 bsteuber: mm

9:39 hobbit125: Hi

9:46 si14: looks like I've found a bug in clojurescript.

9:46 or I've missed something.

9:47 https://gist.github.com/2016505 here is a snippet

9:47 the interesting thing here is that "(vec children-leafs)" returns vector that is shared between recursive calls.

9:48 ouch. nope, it's my fault, nevermind

10:05 sharat87: hi, I'm having some trouble writing a macro for wrapping my seesaw button event handlers, http://paste.pocoo.org/show/564177/ I must be missing something basic here... any ideas?

10:36 * gfredericks takes a look

10:37 * Frozenlo` is naked

10:37 Frozenlo`: IIIIIIIIIIIII

10:37 Stop it, you pervert!

10:38 bsteuber: sharat87: I don't find any bug here

10:39 how are config and config! implemented?

10:39 gfredericks: sharat87: I would try rewriting it so that the macro is very small and mostly just defers to a function

10:39 also while you're at it you could make your macro generate the full handler function instead of just the body

10:40 sharat87: I don't know if this is a seesaw bug, but using (.setText), it works, in that it doesn

10:40 ... 't throw an error, but doesn't set the button's text either

10:40 gfredericks, I don't follow, can you explain a bit? :)

10:41 bsteuber, they are defined in the seesaw.config namespace http://daveray.github.com/seesaw/seesaw.config-api.html

10:41 gfredericks: sharat87: the macro is just syntactic sugar -- all the rest of the functionality could be accomplished by a (fn [f widget]) that calls (f) just inside a try block

10:42 i.e., I would first write a function called create-btn-handler

10:42 that you can use like (action :name "foo" :handler (create-btn-handler (fn [e] ...handle...)))

10:43 then when you get tired of writing (fn ...) all the time you can make a macro to sugar that up

10:43 but the macro could be very minimal

10:43 sharat87: gfredericks, oh yeah, get it. Will happen once this works :)

10:44 gfredericks: sharat87: I was just thinking it'd be easier to debug a function than a macro, so it could be part of figuring out what's wrong

10:45 sharat87: gfredericks, yeah, I am currently debugging with all sorts of prn's in the :handler function, outside of the wrap macro (between lines 15 and 16)

11:20 darevay: sharat87: I'm not quite sure why it's complaining, but your approach won't work anyway. Since body is executed on the UI thread, the button won't repaint until after its completed. That is, the UI will be frozen and the button will never show "Loading...". Do long operations in a background thread and use (invoke-later) so send updates to the ui.

11:23 sharat87: if you're still having trouble ask on seesaw-clj ML. I'm very rarely on IRC. Cheers.

11:47 lake: guys, I have a lazy sequence that I would like to A) sum all elements until the sum is greater than a number.

11:47 and there is no B. :)

11:48 i'm a noobie at clojure, too.

11:48 RickInGA: would take while work?

11:49 TimMc: lake: Given [1 2 3 4 5] and the limit 9, what would the result be?

11:49 lake: i tried that but i don't think i did it right

11:50 [1 2 3]

11:50 TimMc: &(take 5 (reductions + 0 (range)))

11:50 lazybot: ⇒ (0 0 1 3 6)

11:50 TimMc: &(take 5 (reductions + (range 1 20)))

11:50 lazybot: ⇒ (1 3 6 10 15)

11:52 TimMc: &(let [in (range 1 20)] (map first (take-while #(< (second %) 9) (reductions + in))))

11:52 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

11:52 TimMc: &(let [in (range 1 20)] (map first (take-while #(< (second %) 9) (map list in (reductions + in)))))

11:52 lazybot: ⇒ (1 2 3)

11:52 lake: TimMc: wow, i love the live coding

11:52 TimMc: That's what REPLs are for!

11:53 lake: i had not seen the reductions function yet

11:54 or in

11:54 i'm coming from ruby so my brain is twisted

11:54 TimMc: That (map list x (foo x)) pattern can be simplified, as can the whole annotate-deannotate pattern.

11:54 RickInGA: I just started an inferior-lisp session, is there a way I can test whether the running repl is a clojure repl or clojurse-script repl?

11:55 rlb: lake: "in" is just a var there.

11:55 i.e. it's bound to the lazy sequence of integers generated by range

11:55 lake: rlb: yes, just notied that. thanks for the clarification

11:56 TimMc: &(take 7 (let [in (range 1 20)] (map list in (reductions + in))))

11:56 lazybot: ⇒ ((1 1) (2 3) (3 6) (4 10) (5 15) (6 21) (7 28))

11:56 rlb: (lake: though there *are* some interesting "*-in" functions...)

11:56 i.e. assoc-in, etc.

11:59 lake: what is the difference between "def" and "defn"?

11:59 TimMc: defn = def + fn

12:00 rlb: lake: (defn foo [] 42) <==> (def foo (fn [] 42))

12:00 lake: is a "def" more like a static var? while defn is allowed to take an arg?

12:01 rlb: lake: def is the more primitive operation

12:01 lake: defn is just a convenience for defining functions

12:01 TimMc: lake: All def* statements create a var in the current namespace.

12:01 Everything but def is a convenience wrapper, mostly.

12:02 defn does some extra tricky stuff that allows optimizations.

12:02 lake: awesome, thanks for the help

12:02 rlb: (fn [...] ...) constructs functions

12:02 lake: so defn just attached a function to a name.

12:03 (accessed through a variable in the namespace

12:03 qbg: Yep, defn is basically (def ... (fn [...] ...))

12:03 lake: good stuff

12:03 rlb: lake: and there's a shorthand too #(+ %1 5) <==> (fn [x] (+ x 5))

12:04 TimMc: and that %1 can just be written % :-)

12:05 rlb: right -- suppose I should have chosen: #(+ %1 %2) <==> (fn [x y] (+ x y))

12:05 qbg: The only limitation of #(...) is that you can't nest it

12:06 lake: ah, maybe that was my problem when i tried to use take-while.

12:06 qbg: Well, main limitation

12:06 lake: i think i nested that shortcut.

12:06 rlb: lake: clojure has a number of interesting conveniences like that (some of which originally made me a little grumpy, coming from Scheme, but I got over it ;>).

12:06 qbg: Do you know why it doesn't make sense to nest it?

12:07 lake: no

12:07 qbg: #(foo #(bar %))

12:08 What are the arities of the fns?

12:08 Does % come from the inner, or from the outer?

12:08 lake: inner?

12:08 AimHere: I thought you weren't allowed to do that

12:08 qbg: You aren't

12:08 Because of that problem

12:08 rlb: it's ambiguous, so it's disallowed.

12:09 AimHere: Yeah, just use the (fn [foo bar] wibble) form instead

12:09 lake: got it. i actually didn't nest them now that i see that.

12:09 but it still makes sense

12:09 thanks for all the info guys. i am having fun getting my brain twisted, coming from ruby.

12:10 i'll be around later to ask more questions. :p

12:10 AimHere: <rlb> right -- suppose I should have chosen: #(+ %1 %2) <==> (fn [x y] (+ x y)) <- why not use '+' instead of either, unless you want it to barf on !=2 args?

12:10 rlb: true

12:15 TimMc: heh

12:16 foobar27: hi

12:17 I'm trying to optimize a fn which maps points on a Hilbert curve to their coordinates (see http://en.wikipedia.org/wiki/Hilbert_curve )

12:17 the best result I could get is still 8.17 times slower than java

12:18 gfredericks: foobar27: so the input is x \in [0,1]?

12:18 foobar27: input is in [0,2^(n*n)-1]

12:19 gfredericks: something along those lines was my second guess

12:19 foobar27: clojure code is at https://gist.github.com/2016925, java code at https://gist.github.com/2016924

12:20 qbg: foobar27: Check out *unchecked-math*

12:20 (assuming 1.3)

12:20 Is this 1.2?

12:21 foobar27: I just tried the bleeding edge 1.4 SNAPSHOT

12:21 I'm using unchecked math at almost every location I could think of

12:21 TimMc: foobar27: I recommend grabbing VisualVM and seeing if there's still major boxing/unboxing.

12:22 qbg: Setting *unchecked-math* to true would make that much more readable

12:22 Since you math ops would be unchecked by default then

12:22 TimMc: &(doc *unchecked-math*)

12:22 lazybot: ⇒ "; While bound to true, compilations of +, -, *, inc, dec and the coercions will be done without overflow checks. Default: false."

12:24 qbg: You can use use (.y a) instead of (:y a)

12:24 You can make hilbert-to-point-unchecked ^:static

12:25 TimMc: What does :static do?

12:25 foobar27: TimMc: thanks, *unchecked-math* even gave me a minor boost to a factor 7.8

12:25 qbg: Doesn't indirect through a var

12:26 I believe the ^Point tag is in the wrong spot for hilbert-to-point-unchecked

12:26 (should be on the arg vector)

12:26 Doesn't matter anyways because it is being boxed in a lazy seq anyways

12:26 TimMc: qbg: No, on the name.

12:26 Frozenlo`: &(* 1341264578568973673 23452424756)

12:26 lazybot: java.lang.ArithmeticException: integer overflow

12:27 foobar27: *unchecked-math* gave me a small improvement, but (.y a) makes it 10 times slower

12:27 TimMc: :tag has to end up on the Var

12:27 qbg: That is because you need to hint a

12:27 TimMc: foobar27: Needs type hints somehwere, then.

12:27 [a ^Point (first r)] or soemthing

12:28 Frozenlo`: My question might seems naive (and it surely is), but why can't clojure do this simple multiplication, while both Emacs and Clisp can do it without any problems?

12:29 qbg: &(* 1341264578568973673N 23452424756)

12:29 lazybot: ⇒ 31455906606776905222177448788N

12:29 Frozenlo`: You added an N?

12:29 qbg: It is because of the treatment of primitives

12:29 Those numbers are longs

12:29 &(*' 1341264578568973673 23452424756)

12:29 lazybot: ⇒ 31455906606776905222177448788N

12:29 TimMc: Frozenlo`: 1.3 dropped autopromotion

12:29 qbg: * will throw an error on overflow

12:30 That allows it to take and return primitives

12:30 *' promotes

12:30 foobar27: TimMC: that did the trick, gave me another improvement. I'm now at factor 6.8

12:30 qbg: 1N is a BigInt; they are contagious like doubles

12:30 TimMc: foobar27: You really should profile it to get a sense of what needs fixing.

12:32 Sindikat: hello everyone! i did 'lein plugin install swank-clojure 1.3.4', and now in my ~/.lein/bin/swank-clojure there is '/home/phil/' in CLASSPATH variable. is that ok?

12:32 qbg: Frozenlo`: The JVM makes methods decide if they are going to return a primitive or an Object

12:32 foobar27: I'm currently trying to get jvisualvm working

12:33 qbg: You need to stay in primitive land to avoid the performance costs of boxing numbers

12:33 Frozenlo`: Thanks. I'll be sure to remember *' next time I get this integer overflow error.

12:33 qbg: Or you can use a bigint

12:34 Frozenlo`: *' is faster to write :p

12:34 qbg: BigInts are contagious, so you only need the N in one place usually

12:34 &(+ 1N 1)

12:34 lazybot: ⇒ 2N

12:35 Frozenlo`: Oh!

12:35 qbg: Just like doubles:

12:35 &(+ 1.0 1)

12:35 lazybot: ⇒ 2.0

12:36 foobar27: when I connect with jvisualvm to the clojure instance, nothing happens. I right-click and select open.

12:38 qbg: foobar27: You can also use (== 1 ry) instead of (= 1 ry)

12:42 foobar27: qbg: thanks, but that has no notable difference on my machine. After a jdk update, I can use jvisualvm

12:42 qbg: These are microops

12:43 Once visualvm works for you, you can do some profiling

12:44 You could get rid of the lazy seq in red-fast

12:45 foobar27: yes, jvisualvm says the same (LazySeq.sval)

12:45 qbg: I recommend using Criterium for benchmarking

12:46 (rather than using time)

12:46 foobar27: qbg: criterium seems to be quite useful

12:50 qbg: TimMc: From the java_interop page on clojure.org: "For function return values, the type hint can be placed before the arguments vector:"

12:51 That way you can have different hints for different arities

12:51 TimMc: qbg: Ah! Interesting...

12:54 qbg: foobar27: It would be interesting to have a version that uses longs instead of ints

12:54 You wouldn't need to be coercing everything to ints then

12:55 foobar27: qbg: ok, thought it would be faster with int

12:55 but first I'll rewrite the reduce function

12:55 qbg: IIRC, on 64 bit vms at least the difference isn't that big

12:57 TimMc: qbg: I think you can still put the :tag on the name.

12:58 and I'm not sure what happens if you put it on the arglist in the single-arity fn form.

12:59 qbg: The single arity form is just a special case, so it should do the same thing

13:00 Yes, it needs to be on the arg vector

13:00 TimMc: Hmm, having looked into the fn macro... I agree that it will Do The Right Thing on the single-arity case.

13:01 qbg: There is an interesting bug with primitive fns

13:02 If you hint the return type as being a subclass of Object, you get an AbstractMethodError when calling it

13:02 You get that behavior with the tag on the arg vector, but not the name

13:02 Thus it needs to be on the arg vector

13:02 TimMc: Hmm, there are some core.clj fns hinted on the name.

13:03 qbg: For example?

13:04 TimMc: clojure.core/next

13:04 Err... that's a def + fn form

13:04 to-array, then

13:05 That uses the attr-list form, which I *think* is equivalent to attaching to the name.

13:06 Interestingly, clojure.core/str hints on the arglists *and* in the defn attr-list

13:07 qbg: Putting the tag on the vector doesn't add it to the var's meta

13:10 The java_interop page is out of date

13:11 TimMc: Ugh, the whole of clojure.org is.

13:11 Bronsa: clojure.org is out of date

13:11 qbg: This still probably holds true: "Almost every time someone presents something they are trying to optimize with hints, the faster version has far fewer hints than the original. If a hint doesn't improve things in the end - take it out."

13:11 Be nice if it wasn't

13:11 * Frozenlo` was using clojure.org to learn clojure :(

13:11 TimMc: It's mostly correct, just old.

13:13 http://www.raynes.me/logs/irc.freenode.net/clojure/2012-02-16.txt

13:14 Start at 17:38:30, go to 18:31:09

13:14 Vinzent: any idea why this https://refheap.com/paste/1028 loads CPU up to 100% and never terminates?

13:15 foobar27: I removed the lazy-sec in red-faster, now it's only 5.67 times slower than java. https://gist.github.com/2017155

13:15 TimMc: Or here: https://refheap.com/paste/1029/raw

13:15 Frozenlo`, qbg: ^

13:16 Frozenlo`: Thanks. I like the technomancy's idea :)

13:19 qbg: I wonder how much making Point a deftype instead and marking hilbert-to-point-unchecked as being ^:static would help

13:20 TimMc: I've never seen an explanation of :static.

13:21 qbg: 1) you can use it for primitive fns

13:21 2) The calls are not indirect through vars

13:21 (if you change a ^:static fn, you must recompile all code that calls it)

13:21 raek: has static been reintroduced?

13:23 I thought it when away when :dynamic appeared

13:24 qbg: No, ^:dynamic doesn't make ^:static obsolete

13:24 raek: qbg: in which version was it introduced?

13:24 qbg: 1.3

13:25 TimMc: :static has been around

13:25 qbg: It originally showed up in the 1.2 new branch IIRC

13:26 In this case, unless the hilbert function is being called a ton of times, it probably won't make too much of a difference

13:26 Frozenlock: If I want to be able to use the `source' function, I need to get clojure source? Where should I put it? (I'm using leiningen)

13:26 raek: I don't see :static mentioned anywhere in https://github.com/clojure/clojure/blob/1.3.x/changes.txt

13:27 I assumed that it was removed, but I could be wrong

13:27 qbg: It came with this: 2.1 Enhanced Primitive Support

13:27 TimMc: Frozenlock: I don't think you need to do anything special.

13:28 Frozenlock: &(source reverse)

13:28 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

13:28 TimMc: qbg: I think you and raek are maybe talking past each other?

13:29 qbg: &(clojure.repl/source reverse)

13:29 lazybot: ⇒ Source not found nil

13:29 TimMc: That doesn't work in the bot.

13:29 $source reverse

13:29 lazybot: reverse is http://is.gd/kaaKW0

13:29 TimMc: ...and that's hella outdated

13:30 Frozenlock: I get the same error on my repl: java.lang.RuntimeException: Unable to resolve symbol: source in this context

13:30 foobar27: qbg: deftype is substantially slower than defrecord. Unless I need to change the code at another place.

13:30 tmciver: Frozenlock: you need to (use 'clojure.repl)

13:31 TimMc: Frozenlock: How are you starting your REPL?

13:31 Frozenlock: tmciver: thanks!

13:31 TimMc: clojure-jack-in

13:31 TimMc: Ah, OK. `lein run` automatically loads the REPL tools.

13:32 Frozenlock: I'll immediatly add the (use 'clojure.repl) in my .clj file.

13:32 tmciver: Frozenlock: it would be nice if clojure-jack-in use'd clojure.repl automatically. I've asked technomancy to do it but he claims it difficult.

13:32 Frozenlock: Being able to see the source has been intrumental in my emacs learning; it will probably be too in clojure

13:34 foobar27: the bottleneck of my hilbert code now seems to be clojure.lang.RT.nth, then RT.vector (twice as slow) and unchecked-int-cast (again twice as slow)

13:34 glob157: conway's game of life, sebastian benz : having issues with the github one :

13:34 tmciver: Frozenlock: As a (poor, IMO) alternative, you can M-. on a symbol to see the definition of the var.

13:35 Frozenlock: Oh I like it!

13:36 glob157: java.io.FileNotFoundException: Could not locate simulator/run__init.class or simulator/run.clj on classpath:

13:36 http://pastebin.com/XjgRL1zj

13:37 qbg: foobar27: Try getting rid of the destructuring swap you have in hilbert-to-point-unchecked

13:37 Frozenlock: tmciver: It's opened in another buffer, with all the syntax highlighting. In a sense I find it superior to simply using (source ...)

13:39 tmciver: Frozenlock: yes, there's something to be said for it but I'd still like to have default access to the source function in the repl for times when you don't have easy access to the function in question in your own buffer.

13:40 oops, source is actually a macro.

13:40 TimMc: I guess it has to be.

13:41 (source-fn #'whatever) could probably work, though

13:47 foobar27: qbg: Thanks, that reduced the factor to 2.5. I'm now trying to use long, as uncheckedIntCast is the current bottleneck.

13:48 qbg: Literal numbers are primitive longs

13:48 foobar27: qbg: (although I didn't know how to remove the destructuring without repeating the (== 1) checks. But I trust the JIT, until jvisualvm convinces me.

13:48 qbg: So that should make the code look much cleaner :)

13:50 It might be useful to pull a ^:static fn out at some point

13:50 Turning the conditional swap into a conditional call

13:50 Need to profile first

13:51 foobar27: qbg: where do I need to put that ^:static? also before the arg vector?

13:52 qbg: On then ame

13:52 *name

13:52 foobar27: qbg: so (defn ^:static hilbert-to-point ...)?

13:52 qbg: Yeah

13:53 foobar27: I tried that at a previous version, I did not notice any effect, will try it after the change to long

13:53 TimMc: What got it down to 2.5?

13:53 Getting rid of destructuring>

13:53 foobar27: TimMc: yes

13:54 TimMc: Interesting.

13:56 jayunit100: hi guys : http://stackoverflow.com/questions/9657362/main-class-in-clojure-leiningan-conways-game-of-life <---- any thoughts on this one

13:56 ?

13:57 TimMc: jayunit100: "crashes" doesn't mean anything, you need a stack trace.

13:57 jayunit100: And it requires either 2 or 3 arguments, but you aren't giving it any.

13:58 Project definitely looks broken as is.

14:00 foobar27: long instead of int got me down to 1.96

14:01 the only problem I encountered was that type-hinting the parameters of hilbert-to-point-unchecked by ^long gave me an AbstractMethodError. But anyway, no type hints are needed there.

14:01 (might be related to the fact that I'm not using a stable clojure)

14:02 qbg: Yes, if you give a primitive hint to the arg, don't hint the return with Point

14:03 foobar27: qbg: ah, he can deduce the type in that case

14:04 qbg: (I consider it a bug)

14:04 Just hint the value produced where you call it (if needed)

14:17 TimMc: foobar27: Hinting is a single tool for multiple completely different purposes.

14:20 jayunit100: @TimMc yup - giving it 2 args is nec.

14:20 but not sure what that method does

14:20 TimMc: Hinting primitives in locals (fn args, let locals) allows you to prevent boxing in several different places. Hinting classes in .interop sites allows you to avoid reflection.

14:29 foobar27: TimMc: I think I still don't understand hinting properly. I hinted the value produced by hilbert-to-point-unchecked, but I still get a reflection warning at the recur of red-faster: https://gist.github.com/2017554

14:29 rlb: TimMc: wrt my questions yesterday about locking, I thought of a somewhat less ugly way -- just use an atom to store the connection. Worst case, you might race and create a redundant one (that you just drop).

14:30 TimMc: then just use (locking ...) to serialize the request and response.

14:30 (that avoids deftype, set!, etc.)

14:31 jayunit100: sometimes i think that the ' in clojure is just an escape character for the REPL. is that accurate ?

14:31 TimMc: jayunit100: Nope.

14:31 jayunit100: :(

14:32 whats the difference ?

14:32 AimHere: Not really. It's shorthand for (quote <whatever>)

14:32 It's a way of telling clojure to not evaulate <whatever>

14:32 jayunit100: hmmm ... so is the qoute function basically an escape function for the repl ?

14:32 TimMc: jayunit100: It's an escape function for the *reader*.

14:33 jayunit100: Ah okay yeah your right. the EPL still works as normal .

14:33 TimMc: Hmmm... or really the evaluator.

14:33 rlb: jayunit100: it's a language-level concept

14:33 jayunit100: yup

14:33 AimHere: Well you can use quote in places not associated with the reader; the 'backtick' you see in a lot of macros is another piece of syntactic sugar for something with quote in it

14:33 TimMc: rlb: I've largerly forgotten what little I understood about the mdb thing. :-/

14:33 rlb: TimMc: just as well.

14:33 TimMc: haha

14:34 rlb: s/mdb/mpd/

14:34 TimMc: foobar27: Maybe that ^Point hint should be on 'a? I don't use hinting much.

14:34 rlb: This approach is good enough for now, and keeps me from mucking about with bits probably better left alone.

14:35 foobar27: TimMc: yes :)

14:36 rlb: ibdknox: did you arrange your overtone interface buttons via table or something fancier?

14:37 jayunit100: if anyone interested in helping me to resurrect this fork ? https://github.com/jayunit100/clojure-game-of-life ///// ill add as collab. thanks in advance.

14:37 ibdknox: rlb: they're just elements floated left with margins

14:37 qbg: foobar27: You need to ^Point hint on a


14:41 qbg: If you want to be hard core, you could introduce macros

14:42 rlb: ibdknox: thanks - worked perfectly.

14:54 jondot1: any suggestions about what to use for image metadata

14:56 tylergillies: could using an agent be seen as a flavour continuation passing style?

14:57 qbg: tylergillies: Async code basically is CPS

14:57 tylergillies: qbg: ah, ok thanks, that makes sense

14:58 foobar27: with *unchecked-math*, I am now very slightly below the java execution time

14:59 gfredericks: foobar27: "below" == "faster than java"?

15:00 foobar27: gfredericks: apparently yes, I'm currently switching to criterium to do a more professional benchmark

15:01 gfredericks: and I haven't tried to optimize my java program

15:31 jondot1: trying to use rinzelight, getting this Unable to resolve classname: clojure.core/ints

15:31 any idea what this is?

15:33 foobar27: gfredericks: after cleaning up the java code, both implementations are exactly as fast. If I use int instead of long in java, I get a 15% improvement (AMD64)

15:33 TimMc: jondot1: A broken attempt at hinting?

15:34 jondot1: Or maybe a Clojure version mismatch. (grasping at straws here)

15:35 jondot1: well this is my project file http://pastie.org/3572683

15:36 other than that, i don't think i even have straws :)

15:36 johnmn3: anyone ever used java's internal browser? to do a rich client program?

15:36 jondot1: now i see rinzelight's clojure dep is 1.2.0 but then i wonder, if i'm using 1.3.0 how is everything supposed to click?

15:36 uvtc: If I've got a project where I'm developing a simple library within one namespace, is there any way to start the repl with the namespace loaded already with an alias?

15:37 I see that I can do this: `lein repl my-simple-library`, but what I want is `lein repl my-simple-library :as msl`. Any way to have lein do that?

15:37 foobar27: anyway, thanks for all your help. I'll cleanup the code after dinner, write test cases and upload it.

15:38 uvtc: I also see that I can start the repl, then do `(require '[my-simple-library :as msl])` ... just just wondering if there's a way to save a step.

15:42 jondot1: so a given library can target either 1.2 or 1.3?

15:43 looks like rinzelight works on 1.2 but not in 1.3

15:44 TimMc: jondot1: You can target mutiple Clojure versions, but probably not if you AOT your code.

15:45 jondot1: so in this case its the library's code not properly supporting interop between versions?

15:46 uvtc: jondot1, I think what you're asking is, what if you specify clojure 1.3.0 in your own project, but you also specify a dependency on a library that itself claims that it depends upon Clojure 1.2. Interesting.

15:47 jondot1: uvtc: exactly. is that so rare?

15:48 uvtc: jondot1, I'm pretty new here. Dunno. Maybe some tinkering around will provide a solution.

15:48 jondot1, there doesn't appear to be too much action on this channel on the weekend.

15:49 jondot1, Maybe try asking again tomorrow after you've experimented some more.

15:49 TimMc: jondot1: rinzelight depends on contrib

15:49 That might be a problem.

15:49 uvtc: jondot1, also, you might consider using https://refheap.com/paste for your pastes.

15:50 jondot1: so it depends on contrib, but i saw that for 1.3 ints is in core

15:50 sritchie: Any Clutch users here, w/ CouchDB?

15:50 jondot1: for now i switched to 1.2.0, no big deal. but the problem is interesting of itself.

15:58 TimMc: jondot1: You might take a look through rinzelight's source and see how hard it would be to migrate it to 1.3 or make it compatible.

15:59 jondot1: yup

15:59 rlb: clojure libs generally shouldn't prefix function names, right?

16:00 i.e. (play x) rather than (mpd-play x)

16:00 presumably you'd use :as mpd if you wanted (mpd/play x)...

16:01 TimMc: right

16:02 rlb: hah, though I'm not sure about mpd/next.

16:02 i.e. previous/next

16:02 TimMc: DOO EET

16:03 You can :refer-clojure :rename {next next-no-really} in your ns. :-)

16:05 rlb: also mpd/list and mpd/find, hmm...

16:05 Wonder if that's too confusing.

16:06 spoonman: hi, i'm getting an error message, while trying to use vim with clojure, http://pastebin.com/Z76q2ymm, can anyone help me?

16:07 mr_rm: does (re-find) have to parse the regular expression string every time it's called, assuming you are passing the same expression, like in a loop?

16:07 qbg: Patterns are compile time constants

16:08 TimMc: rlb: You could :exclude those core fns in your mpd stuff and then :require :as clojure.core again. Maybe name it clj.

16:08 mr_rm: qbg: does that mean the pattern is compiled when the form is read in?

16:09 qbg: Yes

16:09 mr_rm: thanks!

16:09 qbg: &(class #"hello")

16:09 lazybot: ⇒ java.util.regex.Pattern

16:11 rlb: TimMc: I'm just wondering if it's too cute to have (next mpd), even though that's mpd's name for the operation.

16:11 (cute/confusing)

16:11 I suppose I could just name them next-song/previous-song.

16:12 TimMc: blah

16:12 mr_rm: does anyone here use vsclojure?

16:12 tylergillies: how do i include java deps in my lein project?

16:13 do i just manually copy the jars to lib?

16:13 gfredericks: tylergillies: using the maven group/artifact/version, just like clojure deps

16:13 mr_rm: i've been trying to figure out if you are supposed to be able to create a .NET executable with it. i'm able to run .NET stuff in the repl with no problem but it doesn't seem to do aot compiles. building the project just copies the clj to the bin folder

16:14 tylergillies: gfredericks: ah, not sure how that system works (not a java guy) is there a clojar-like site for java libraries?

16:14 TimMc: mr_rm: You may have to specify which namespaces to AOT.

16:14 mr_rm: tylergillies: it's called maven repositories

16:14 TimMc: tylergillies: Maven Central

16:15 tylergillies: TimMc: mr_rm thanks

16:15 does 'lein search' search maven or just clojar?

16:16 mr_rm: TimMc: ok, i'll have to figure out how to do that in the context of vsclojure. i don't see any obvious project configuration for that but i'll poke around more. thanks

16:17 TimMc: mr_rm: It may be as simple as (:gen-class) in your main ns.

16:17 mr_rm: TimMc: i already have that

16:17 TimMc: Huh.

16:18 brehaut: tylergillies: presumably it searches all of the repos in your project config (which defaults to maven and clojars)

16:18 mr_rm: TimMc: in fact, i'm starting out with just a trivial example. a single hello world file

16:18 rlb: TimMc: for now, I'll just provide next/list/find, and we'll see.

16:18 _rcc: I'm trying to do a 'lein run' from the terminal. I'm seeing this error: "IllegalArgumentException: Unable to resolve classname: LineNumberingPushbackReader". LNPR is used my server.socket and is in the clojure.lang package. What do I need to do to make this work? server.socket already imports c.l.LNPR

16:18 jondot1: what would you use to import a java class from a jar, but be able to refer to it without a fully qualified name?

16:19 gfredericks: jondot1: an (:import) statement in the (ns) declaration

16:19 (ns foo.bar (:import java.util.List))

16:19 tylergillies: brehaut: thnx

16:19 mr_rm: TimMc: also, when i do debug/run it does the build (successfully) but then does nothing else. can't set breakpoints or anything. i've been doing clojure using eclipse/ccw for a while and was curious how usable visual studio and .net is for clojure apps. having trouble getting going

16:20 brehaut: tylergillies: im guessing though; ive not looked at the code and it takes so long to pull down the maven index's that ive never had the command complete

16:21 jondot1: gfredericks: annoyingly, i'm not sure tha works for me

16:21 gfredericks: jondot1: the dep is declared in your project.clj?

16:21 jondot1: gfredericks: the jar is just in my /lib folder

16:22 _rcc: Strike my last Q. Sorry. I'm using LNPR in my class and didn't import it

16:22 gfredericks: jondot1: I'm not sure if that works. I'd use maven for it; is it a public lib or a private jar you've created?

16:22 jondot1: its a private build of a public jar

16:23 gfredericks: jondot1: clojure project or java project?

16:23 jondot1: java

16:23 gfredericks: might be the easiest thing to do is install it to maven locally -- do you know how to do that?

16:24 mr_rm: jondot1: (ns something (:import (javax.swing JLabel)))

16:24 jondot1: then you can just use JLabel

16:25 jondot1: yes, might be that i've found whats wrong

16:25 i've chained constructor-staticmethod-instancemethod as Foo/STATIC/instance

16:26 which gave off a misleading error for Foo/STATIC not existing as a type

16:27 awesome, everything works now. sometimes i feel java interop is magic :)

16:29 spoonman: hi, i'm getting an error message, while trying to use vim with clojure, http://pastebin.com/Z76q2ymm, can anyone help me?

16:31 mr_rm: spoonman: i have never used nailgun but did you check what the error msg is telling you? that the ng server has the right jar files in the classpath?

16:31 looks like it hasn't loaded that namespace, maybe because it can't find the jar file

16:32 spoonman: mr_rm: yes, i put the jars in the classpath

16:32 mr_rm: spoonman: anything silly like you forgot to export the env variable CLASSPATH?

16:32 randomnamehere: Hey guys, what do you think about https://github.com/davidsantiago/stencil ? maybe a full replacement for enlive?

16:33 mr_rm: spoonman: or restart the ng server after you modified the classpath in the script or whatever?

16:33 spoonman: mr_rm: i started with java -cp

16:34 brehaut: randomnamehere: a mustache implementation is a completely different beast to enlive

16:34 randomnamehere: https://github.com/davidsantiago/tinsel is much more comparable

16:34 (and suitable as a possible alternative to enlive)

16:35 ibdknox: brehaut: different, sure. But I can build anything with stencil that you can with enlive

16:36 gfredericks: time for a template-off?

16:36 ibdknox: randomnamehere: fwiw, I've built several sites with stencil and it's worked out well :) https://www.readyforzero.com uses it, for example

16:36 brehaut: ibdknox: well of course, but i can build anything with str that you can with stensil. its still not a very useful comparison

16:36 ibdknox: gfredericks: everyone would lose :(

16:36 Raynes: RefHeap is built with stencil. :D

16:36 gfredericks: Raynes: and vice versa!

16:37 ibdknox: if you want erb-style templates, comb is nice

16:37 brehaut: the implication there was as easily

16:41 gfredericks: I don't suppose there's a macro in any standard lib for creating a recursive memoized fn is there?

16:42 TimMc: gfredericks: (def foo (memoized (fn ...))) ?

16:43 gfredericks: TimMc: without defing it?

16:43 TimMc: Oh, I see.

16:44 randomnamehere: I think I'll replace enlive with stencil

16:44 uvtc: When registering for clojars account, I'm supposed to use the same public key (my ~/.ssh/id_rss.pub) that I used to set up my github account, correct?

16:44 gfredericks: uvtc: I don't think that's required

16:45 randomnamehere: The idea is nice and it is available in many other languages,... Don't know what the performance measurement means that is available...

16:45 Maybe it is faster than enlive?

16:45 ibdknox: randomnamehere: in virtually no application is template rendering the bottleneck

16:45 randomnamehere: The java solution for it is multithreaded,... (mustache)

16:45 uvtc: Hm... The "register" form is asking me for it...

16:46 randomnamehere: ibdknox: it introduces latency,... remembering my time with php. After smarty template cache was intruduced everything was super-awesome fast

16:46 uvtc: Whoops. Wait. Found this https://github.com/ato/clojars-web/wiki/ssh-keys . Yup. Use the same one.

16:47 ibdknox: randomnamehere: we're talking on the order of a couple ms

16:47 randomnamehere: ms?

16:47 ibdknox: milliseconds

16:47 TimMc: uvtc: I don't see why it matters.

16:48 ibdknox: randomnamehere: in any case, I very highly doubt it'd be slower than enlive

16:48 uvtc: Argh... clojars/register it's telling my my pub key is invalid.

16:48 TimMc: uvtc: I mean, most people have no reason to have more than one key, but there's nothing saying you have to use the same one for both.

16:49 uvtc: TimMc, Thanks.

16:49 whoops again ... think I know what it is.

16:50 randomnamehere: ibdknox: but enlive does more with the templates, doesn't it (parsing, # selectors, replacing in templates,...)?

16:50 TimMc: priv key?

16:50 ibdknox: randomnamehere: which is why I said enlive is probably slower :)

16:50 brehaut: randomnamehere: enlive does that once per template

16:50 randomnamehere: ReadyForZero << it is for americans?

16:51 ibdknox: yeah

16:51 the rules for debt in other countries vary wildly

16:51 brehaut: randomnamehere: well, other than the actual transformations applied in a particular template.

16:51 uvtc: Arg. No. I thought it was because Emacs was putting in a backslash for continuing long lines, and I was pasting in that backslash. But that appears now to not be the case.

16:51 randomnamehere: More than one credit card seems to be crazy,... and have short time dept too

16:51 uvtc: Blistering barnacles!

16:51 (as clojars puts it)

16:52 ibdknox: people in the US tend to have far more than one lol

16:52 randomnamehere: and it is normal not to be free of dept? :)

16:53 Raynes: I don't have any. :D

16:53 ibdknox: a bit more than 70% of all American revolve debt on a monthly basis

16:53 gfredericks: $google don't buy stuff you cannot afford

16:53 lazybot: [Hulu - Saturday Night Live: Don't Buy Stuff] http://www.hulu.com/watch/1389/saturday-night-live-dont-buy-stuff

16:53 Raynes: I just charge merch to my ibdknox card.

16:54 jondot1: wondering if anyone using more traditional template engines with compojure (along the lines of erb/ruby)

16:55 ibdknox: jondot1: http://github.com/weavejester/comb

16:55 Raynes: $google clojure comb weavejester

16:55 lazybot: [weavejester/comb - GitHub] https://github.com/weavejester/comb

16:55 Raynes: ibdknox: Shut up.

16:55 TimMc: randomnamehere: "debt"

16:55 * ibdknox is a winner ;)

16:55 ibdknox: such a wonderfully simple solution too

16:55 I love seeing stuff like that

16:55 metajack: jondot1: i have an implementation of Django's template langauge (also very similar to Ruby Liquid) that i'm about to release

16:56 jondot1: thanks

16:56 metajack: There is also Fleet

16:56 ibdknox: fleet is scary

16:56 jondot1: now i wonder again - any templating meta-engine such as ruby/tilt to abstract away the detail (caching etc) ?

16:58 metajack: ibdknox: that's one of the reasons I decide to port DTL

16:58 randomnamehere: stencil seems to take care of caching and so on,... will to first experiments this night

16:59 ibdknox: jondot1: comb caches the parse template into a function, in other words, it will be as fast as string concatenation

16:59 and whatever logic you put into the template itself

16:59 metajack: yeah, comb is the sane implementation of fleet

17:01 jondot1: so i'm a bit confused, many examples show the markup / template code in the clojure code itself

17:01 i'd expect just a folder named /views to contain my templates and compjure or the templating engine to be able to pick those up

17:01 disclosure: i'm kinda making a mental bridge from ruby

17:10 Raynes: jondot1: Best to not expect things.

17:10 ;)

17:10 You'll be less surprised if you expect to be su… oh wait, here we are expecting things again.

17:11 gfredericks: it's okay cuz it's a meta-expectation

17:14 tylergillies: im using a java library that has a function that takes a class as an argument, how do i create a class in clojure to feed to the function?

17:14 brehaut: ,(class java.net.URL)

17:14 clojurebot: java.lang.Class

17:15 brehaut: tylergillies: the simpliest way to create a class is probably with defprotocol though

17:15 but without know what that method is doing with the class

17:16 its pretty hard to say what the correct thing to do is

17:16 tylergillies: brehaut: http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Java+%280.5.0-devel%29#QuickStartforJava%280.5.0-devel%29-Firstserverprogram

17:17 brehaut: tylergillies: sorry thats really long, where is the method wanting a class?

17:18 tylergillies: brehaut: 'svr.serve(new ServerApp());'

17:18 brehaut: tylergillies: thats an object being passed to svr.serve, not a class

17:19 gfredericks: is there a clojure lib that will convert a number to words?

17:19 brehaut: tylergillies: you can tell by the presence of the 'new' keyword

17:19 tylergillies: brehaut: ah, i guess my real question is how do i create that object in clojure to look like it wants it to look?

17:19 brehaut: tylergillies: i dont know what its doing there, but i would suggest investigating reify

17:20 tylergillies: brehaut: thanks

17:20 xeqi: try proxy

17:21 brehaut: ,(.foo (reify Object (foo [this x] (inc x))) 1)

17:21 tylergillies: xeqi: ok thnx

17:21 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: foo, compiling:(NO_SOURCE_PATH:0)>

17:21 brehaut: xeqi: proxy is probably the wrong choice unless you need to to inherit from an abstract class or need the monkey patching

17:22 tylergillies: im not inheriting a class

17:22 i just need a class object to contain an arbitrary method

17:22 not sure of the correct nomenclature, not a java guy

17:23 brehaut: tylergillies: you need an object, or an instance,

17:23 i think you might need to define an interface or protocol as well as the reify?

17:23 tylergillies: id hazard a guess that that app (being an RPC system) is using reflection to find the methods

17:23 raek: tylergillies: what type does the argument to svr.serve(...) have?

17:24 weavejester: Does anyone know if there's a way for Leiningen to update a SNAPSHOT dependency?

17:24 tylergillies: brehaut: https://refheap.com/paste/1031

17:25 gtrak``: weavejester, i think it checks periodically, otherwise you might want the checkouts feature?

17:25 raek: weavejester: you want it to check for a new version of a dependency?

17:25 if so, then "lein deps" should be enough

17:25 weavejester: raek: Hmm...

17:25 raek: Nope

17:26 xeqi: lein is set to check for updates daily

17:26 gtrak``: weavejester, perhaps delete your local SNAPSHOT version from ~/.m2?

17:26 weavejester: If I wipe out the SNAPSHOT in my .m2 folder, it works.

17:26 raek: ...at least I thought so

17:26 weavejester: I just wondered if there was a command or something for it.

17:27 tylergillies: think i might need gen-class

17:27 'While proxy is usually sufficient for dealing with Java APIs, there are occasions when nothing but a real, concrete Java class will do. You can create such classes in Clojure with the gen-class macro, which takes a series of key-value pairs as arguments'

17:27 raek: did you push the snapshot version just to use it yourself immediately after?

17:27 brehaut: tylergillies: i think genclass is probably overkill

17:27 weavejester: raek: Pretty much

17:27 tylergillies: brehaut: ok

17:27 Raynes: Every time you paste to refheap, a kitten gets its fur. Unless it is a naturally hairless cat, in which case it gets a slice of salmon.

17:28 weavejester: raek: Would you suggest a local dep or something?

17:28 brehaut: tylergillies: have a look at defprotocol and reify

17:28 tylergillies: brehaut: ok thnx

17:28 raek: weavejester: have you tried the "checkouts" feature?

17:28 weavejester: raek: Nope. Let me look it up.

17:28 brehaut: tylergillies: a protocol will create an interface, and you can then reify that as needed

17:28 raek: weavejester: "lein install" should work too, I think

17:29 it will add the artifact directly to your .m2 repo

17:29 weavejester: Ah, the checkouts thing seems just what I need

17:29 raek: Thanks!

17:30 raek: np :)

17:32 randomnamehere: java.lang.IllegalArgumentException: No implementation of method: :render of protocol: #'stencil.ast/ASTNode found for class: nil

17:32 hmpf

17:37 Okay, the problem: template not found

17:37 Now: Exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojurestack.core.todo <<< use gen-class ?

17:39 I am using: (defrecord todo [task open created])

17:42 sritchie: randomnamehere: you might need to import it into the namesapce

17:42 where you're using it

17:45 mdeboard: Anyone in San Jose airport for Clojure/West?

18:02 gtrak: what's the current state of the art for db schemas?

18:03 lobos I guess?

18:03 randomnamehere: I tried that: http://dbostwick.posterous.com/using-clojures-deftype-and-defrecord-and-name

18:04 but does not work, I'll "lein clean"

18:11 lnostdal: why doesn't get do basic run-time type checking? (get 42 42) => nil

18:24 gtrak: lnostdal, get's null-safe

18:24 ,(get nil nil)

18:24 clojurebot: nil

18:24 gtrak: like most things in clojure

18:25 ,(if nil true false)

18:25 clojurebot: false

18:25 lnostdal: hm

18:26 i'm not sure what that means .. java.lang.Long cannot possibly be the right thing to pass as a 'map' argument? .. it cannot be any kind of composite structure?

18:27 there's nothing to look up and there never will be; it's just wrong

18:28 gtrak: is there some particular error that you're running into by passing 42 into your thing that expects a map? doesn't seem likely

18:28 i think it makes sense, if 42 were a map, if has no value at the 42 key :-)

18:29 lnostdal: never mind

18:29 junkie: are there any java to clojure converters

18:30 gtrak: you could run a decompiler on AOT-compiled clojure to get java I suppose, but not the other way

18:30 amalloy: well, there's you, junkie

18:31 junkie: not that i need one

18:33 amalloy: indeed

18:35 anyone jMonkey game-engining?

18:35 foobar27: I'm having problems cleaning up my hilbert code.

18:35 If I set! *unchecked-math* globally to true, the code runs at optimal speed. If I bind that variable inside my fn via (binding [*unchecked-math* true], Var.pushThreadBindings slows down the code, but the checked Math methods from Numbers.java are still called (clojure 1.3.0).

18:36 junkie: what is hilbert code

18:37 amalloy: that's a compile-time setting, foobar27

18:37 foobar27: junkie: https://gist.github.com/2018486

18:37 amalloy: a runtime binding has no effect

18:37 junkie: foobar27: Thanks, but what is it?

18:37 In laymans terms

18:39 foobar27: junkie: it draws a hilbert curve, mainly to do this http://corte.si/posts/visualisation/binvis/index.html

18:39 amalloy: you want to set unchecked-math to true before your function is compiled, and then set it back. or, use unchecked-math functions by hand instead of letting that compiler flag convert + to unchecked-add-int for you

18:39 $findfn 3 3 6

18:39 lazybot: [clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]

18:40 foobar27: amalloy: I used the unchecked-* functions before, and I am now cleaning them up, because I was told the code was unreadable :)

18:40 * gfredericks just realized he'd been writing all his code underneath the defproject in his project.clj

18:41 amalloy: foobar27: i'd just macrolet them myself

18:42 (or regular let, which has trivial runtime costs, but a macrolet is free at runtime)

18:43 junkie: foobar27: i understand now

18:43 foobar27: fractals

18:43 cool

18:45 amalloy: add org.clojure/tools.macro as a dependency, and then (clojure.tools.macro/symbol-macrolet [+ unchecked-add, ...] (defn foo [] (... (+ 1 2))))

18:47 randomnamehere: How can I construct something like: https://refheap.com/paste/1034

18:49 gfredericks: randomnamehere: is there some particular reason you need the records to be vanilla maps?

18:49 are you printing them out?

18:50 randomnamehere: yes, stencil

18:50 I wanna feed stencil with it

18:50 gfredericks: and that doesn't work with records?

18:51 records are perfectly good maps 99% of the time I think

18:52 randomnamehere: how to embed it as an item in a map?

18:52 amalloy: (fn [todos] {:todo todos})...

18:53 gfredericks: ^ like that

18:53 amalloy: (partial hash-map :todo)

18:53 ferd: Gurus: I need to compare two data-structures including the metadata declared for some elements. Is there a simple way of doing it?

18:54 gfredericks: ferd: "compare" == "check equality"?

18:54 ferd: I'm unit-testing a macro... and I want to compare the output of macroexpand-1 with the expected expansion

18:54 randomnamehere: works, thx!

18:55 foobar27: amalloy: thanks, let is too slow for my case. And with macrolet, I can even clean up my code more :)

18:55 gfredericks: ferd: metadata by definition doesn't effect equality. You might try passing the objects to a function that makes the metadata explicit; e.g., for just top-level metadata (juxt identity meta) should work

18:55 if you need nested metadata you could probably work something up with clojure.walk

18:56 there is probably some more clever way I'm not thinking of though...

18:56 amalloy: no, clojure.walk is what i'd do too

18:56 ferd: gfredericks: thanks... I'll keep digging

18:56 * ferd walking clojure.walk

18:56 gfredericks: I'd be curious if it can be done as a one-liner

18:57 scratch the subjunctive -- I _am_ curious.

18:58 amalloy: gfredericks: one uncomfortably-long line, two normal-sized lines, i suspect

19:00 &(require 'clojure.walk)

19:00 lazybot: ⇒ nil

19:00 amalloy: &(clojure.walk/postwalk (juxt identity meta) {:a 1, :b (-> '(f x) (with-meta {:m 1}))})

19:00 lazybot: ⇒ [{[[:a nil] [1 nil]] nil, [[:b nil] [([f nil] [x nil]) nil]] nil} nil]

19:01 gfredericks: hrm

19:01 amalloy: hm, why doesn't that work?

19:02 gfredericks: maybe it only ends up checking the meta of the output vector most of the time?

19:02 * ferd trying to follow along

19:03 gfredericks: also odd that it ended up moving {k1 v1 k2 v2} to {[k1 v1] nil [k2 v2] nil}

19:03 though that shouldn't break it I don't think

19:03 amalloy: &(clojure.walk/postwalk (juxt identity meta) (with-meta [1] {:m 1}))

19:03 lazybot: ⇒ [[[1 nil]] nil]

19:04 amalloy: oh

19:04 walk is dumping everything into a new vector before it calls the walk function, and the metadata gest lost

19:05 gfredericks: so we need a meta-sensitive walk?

19:05 amalloy: well, we don't need nearly as many features as walk has, right? you could coerce everything to a seq

19:05 gfredericks: dat true

19:05 amalloy: i guess maybe that messes up map ordering, but in practice it may not matter

19:08 amusingly, i think walk could be made meta-aware just by removing the first three clauses of its cond

19:10 stirfoo: Is there any difference in the behavior of #^ and ^ that I'm missing?

19:10 amalloy: stirfoo: don't think so

19:11 ferd: stirfoo: I think #^ is the "old" way

19:11 stirfoo: ok, the reader calls the same fn, but I didn't know if I was missing some black magic somewhere along the line.

19:12 ferd: stirfoo: "in Clojure 1.2, introduces reader metadata (in 1.1 you'd use #^ , which still works, but is deprecated in 1.2)"

19:12 stirfoo: thanks ferd

19:12 gfredericks: why would it call it "reader metadata"? is that phrase not appropriate for #^ for some reason I'm missing?

19:13 ferd: stirfoo: found it quickly thanks to http://symbolhound.com

19:14 randomnamehere: Any Idea how to reuse the connection if it already exists: https://github.com/kremers/Clojure-Memcached-Connector/blob/master/src/clojurestack/memcache.clj ?

19:14 arohner_: gfredericks: it's metadata attached to objects at read time

19:14 gfredericks: arohner_: when is #^ metadata attached to objects?

19:14 arohner_: gfredericks: at read time

19:14 gfredericks: okay, I think I misread the sentence fragment

19:15 arohner_: as opposed to (with-meta {} {:foo :bar}), which attaches at runtime

19:15 gfredericks: I read it as "^ introduces reader-metadata as opposed to #^ which does something different"

19:15 arohner: ah, no. They're the same

19:17 ferd: &((juxt identity meta) (tree-seq seq? identity '(with-meta [1] {:m 1})))

19:17 lazybot: ⇒ [((with-meta [1] {:m 1}) with-meta [1] {:m 1}) nil]

19:17 stirfoo: nice link ferd, that's definitely a bookmark

19:18 ferd: ((juxt identity meta) (tree-seq seq? identity (with-meta [1] {:m 1})))

19:18 &((juxt identity meta) (tree-seq seq? identity '(with-meta [1] {:m 1})))

19:18 lazybot: ⇒ [((with-meta [1] {:m 1}) with-meta [1] {:m 1}) nil]

19:18 ferd: &((juxt identity meta) (tree-seq seq? identity (with-meta [1] {:m 1})))

19:18 lazybot: ⇒ [([1]) nil]

19:22 Frozenlo`: Is there any libraries similar to vijual, but able to export in svg or pdf?

19:23 georgek: hi, I'm creating a new application within ClojureScript One; I forked One, renamed it, and am modifying the /sample dirs. My first try at lein repl gave me REPL started; server listening on localhost port 54472

19:23 FileNotFoundException Could not locate great_mystery/tools__init.class or great_mystery/tools.clj on classpath: clojure.lang.RT.load (RT.java:430)

19:23 my project name is great-mystery; does anyone have a clue where I'm getting the configuration wrong?

19:32 tylergillies: is there a function to list the methods on an instance of a class?

19:33 randomnamehere: n8

19:35 scottj: tylergillies: slime? C-c I

19:35 tylergillies: scottj: thnx

19:42 gtrak: hmm... what's the standard way to handle a vector form input?

19:42 in html I mean

19:42 hiredman: ~logs

19:42 clojurebot: logs is http://clojure-log.n01se.net/

19:52 aperiodic: i'm unable to get clojars to accept my ssh key

19:52 i'm sure that the public key in the field is correct

19:57 i've tried using my usual key (2048 bit RSA w/password), and several keys i generated just for clojars (2048 and 1024 bit, no pass), with no luck

20:07 * gfredericks just uploaded to clojars successfully

20:07 aperiodic: what kind of key are you using?

20:08 gfredericks: rsa?

20:09 aperiodic: what length, and is there a password?

20:09 gfredericks: yes password; not sure about length

20:09 wc on the private key outputs 30 37 1766 if that tells you anything

20:12 aperiodic: it's 2048 bits long, then

20:13 gfredericks: woah; I didn't know that vector vs list was significant within (ns)

20:22 gtrak: does ac-slime autocomplete stuff that's require'd for you guys? name/<tab> does nothing for me for some reason, but the repl works ok with standard completions

20:36 Somelauw: For clojure, am I better of with an ide like eclipse or emacs?

20:38 gfredericks: that question sounds complicated. An easier question is "what is more popular", and I'm pretty sure that's emacs. at least around here.

20:39 justicefries: that's a question I'm struggling to answer as a vim user, as well.

20:39 emacs feels like the way to go.

20:39 Somelauw: Yeah, it is that ide's offer a lot of inspection and such, but I noticed that emacs is more popular as well.

20:39 * gfredericks switched from vim to emacs

20:39 justicefries: the idea of being in insert mode all the time is strange to me.

20:40 Somelauw: Scala programmers all seem to use ide's on the other hand.

20:40 gfredericks: justicefries: I found the idea of arbitrary customization irresistible. And also org-mode is seriously the best thing that has ever happened to me.

20:40 justicefries: that's what I hear about org-mode.

20:41 gfredericks: Somelauw: I think eclipse and its "inspection and such" is probably more effective on a static language like scala than it would be for clojure

20:41 justicefries: and the fact that I'm getting mostly interested in Clojure, CLISP, Scheme, etc. from a programming language standpoint and straying from Ruby..

20:42 gfredericks: justicefries: but what about all the parentheses!!

20:42 justicefries: never bothered me! :D

20:43 gfredericks: "lisp took a giant leap into the future when researchers discovered the upper and lower paren..."

20:44 Somelauw: justicefries: Yeah, ide's probably work better on static languages.

20:45 justicefries: My big problem right now is I'm in a little bit of OS shock...I dropped OSX.

20:45 gfredericks: for?

20:45 clojurebot: for is not a loop

20:45 gfredericks: loop?

20:45 clojurebot: LOOP is complect complected

20:45 gfredericks: complected?

20:45 clojurebot: complected is not a loop

20:46 gfredericks: well then.

20:46 so I was asking what you dropped OSX for

20:46 er, what you replaced it with

20:46 * wmealing resists

20:47 Somelauw: do?

20:47 gfredericks: clojurebot: do |does| not

20:47 clojurebot: You don't have to tell me twice.

20:47 gfredericks: do?

20:47 clojurebot: do does not

20:48 gfredericks: not?

21:10 aperiodic: i even created a new clojars account, and it still rejects my ssh key

21:11 wmealing: right location, right permissions ?

21:12 aperiodic: ~/.ssh/id_rsa, 600

21:12 clojurebot: No entiendo

21:12 * wmealing thinks

21:12 wmealing: ssh -v2 in, see if it says anything odd

21:12 (this is just OS level troubleshooting for me, i dont know enough about clojar spefifically

21:13 specifically.

21:13 amalloy: aperiodic: make sure you're using clojars@clojars.org, not youruser@clojars.org

21:13 aperiodic: i had clojars working fine before, then i changed my ssh key, and it hasn't worked since

21:14 wmealing: local permissions ?

21:14 aperiodic: amalloy: i am scping as the clojars user

21:15 wmealing: https://gist.github.com/2019134

21:15 i don't know if any of that is "odd"

21:15 wmealing: the permissions on the private key are 600

21:18 gfredericks: aperiodic: I know technomancy was updating clojars recently

21:21 aperiodic: gfredericks: from the commit messages, it doesn't look like the scp stuff has been touched recently

21:22 wmealing: aperiodic, from what i'm reading your client side is offering the keys correctly, no errors there. The remote host isnt accepting your RSA key.

21:22 how are you installing it remotely ?

21:22 ssh-copy-id ?

21:22 aperiodic: wmealing: pasting into the "ssh public key" field in my clojars.org profile

21:24 can anyone else make a new clojars account and successfully push to it?

21:24 wmealing: i dont know enough to be useful in that regards.

21:25 aperiodic: yeah, this is specifically a clojars.org issue

21:25 xeqi: if clojars is rejecting it then its failing at https://github.com/ato/clojars-web/blob/master/src/clojars/web/user.clj#L39

21:25 aperiodic: xeqi: i can update it in the web interface just fine, though

21:35 yoklov: how does evaluation order work in clojure?

21:35 is it specified?

21:36 gfredericks: you mean like associativity in 3 + 4 - 2 expressions?

21:36 yoklov: not really, i mean in (foo (bar) (baz)) will (bar) be evaluated before (baz), or after

21:37 gfredericks: I'd expect before, but I don't know that I've ever seen that discussed

21:37 brehaut: with pure functions it shouldnt really matter either

21:37 gfredericks: probably if you're counting on it being something you're doing something wrong

21:37 yoklov: it seems to be before but that could just be my test.

21:37 right, i'm aware it's a bad idea to count on it

21:38 gfredericks: that would seem to be the most natural way to compile it

21:39 yoklov: it's intentionally unspecified in scheme, and i was curious if that was the same in clojure (i would have assumed not)

21:40 gfredericks: ,((constantly nil) (print "foo") (print "bar") (print "baz"))

21:40 clojurebot: foobarbaz

21:41 gfredericks: ,(apply (constantly nil) (for [x (range 20)] (print x)))

21:41 clojurebot: 012345678910111213141516171819

21:41 yoklov: aha: http://clojure.org/evaluation

21:41 left to right.

21:42 gfredericks: ,(apply (constantly nil) (for [x (take 20 (iterate inc 1))] (print x)))

21:42 clojurebot: 12

21:42 gfredericks: haha; that's cool

21:44 yoklov: brehaut is right though, the fact that this function isn't pure is the larger problem here :/

21:49 i rationalized it at first by thinking "I have state, but at least i'm being explicit about my state", but it has made my program notably harder to debug :(

22:19 uvtc: Interesting. Earlier, I was having trouble getting clojars.org to accept my public key when creating an account. While I was offline, looks like aperiodic was having a related issue. Just tried again though, and it works now.

22:20 aperiodic, did you get your issue resolved?

22:21 Does this channel offer a way to queue a message for a particular user when they're not online?

22:26 johnmn3: anyone have much experience with seesaw?

22:26 I can't get some inner containers to be scrollable

22:27 listbox seems to work, but not (text) or vertical-panel or flow-panel

22:27 running out of ideas

22:27 uvtc: never heard of that

22:27 though it'd probably be a useful function for a bot

22:29 Give each user an outbox that they can store up the 3 messages in. When the recipient (a registered user) logs in, they receive the /msg and a slot is freed up in the senders outbox

22:29 uvtc: johnmn3, thanks. The Perl 6 channel has one (named phenny). It listens for something like, "phenny, tell johnmn3 whatever", and the next time you comment it gives you the message.

22:30 amalloy: uvtc: lazybot will do that

22:30 uvtc: lazybot, help

22:30 lazybot: You're going to need to tell me what you want help with.

22:30 johnmn3: lazybot: tell uvtc I said hy

22:30 uvtc: hi

22:30 amalloy: $mail uvtc here's a message for later

22:30 lazybot: Message saved.

22:30 uvtc: foo

22:30 johnmn3: hah

22:31 uvtc: Oh, neat. Thanks, amalloy.

22:31 johnmn3: immentently useful buggers

22:31 uvtc: $mail johnmn3 a message, just for you

22:31 lazybot: Message saved.

22:32 uvtc: johnmn3, did that work?

22:32 johnmn3: how do I get my mail?

22:32 nevermind

22:32 uvtc: I'm using xchat, and a new heading appeared on the left (under #clojure) named "lazybot".

22:32 johnmn3: lazybot messaged me

22:33 worked

22:33 uvtc: Nice.

22:36 $mail aperiodic Hi. I had a similar issue with clojars earlier. I tried creating an account and it wouldn't take my public key. I had to be afk for a while, and when I came back, I tried again and it worked. Weird.

22:36 lazybot: Message saved.

22:45 yoklov: so, there's probably no real answer for this, but: how many assertations should my tests have?

22:46 Licenser: yoklov enough but not too many

22:47 yoklov: well, at what point should i consider breaking a single test into multiple tests

22:47 or should i just not think about it like that

22:47 justicefries: as many assertions as it took to test drive your code.

22:47 or test drive that particular feature.

22:50 yoklov: blergh, alright, i think i probably have a lot of redundant tests.

23:00 justicefries: linux users: emacs from the command line, or in its own window?

23:01 johnmn3: wouldn't this be cool with clojure/clojurescript? http://www.ymacs.org/demo/

23:03 george`: hi, can anyone help me understand this error I get when starting a ClojureScript One dev server, 'Exception: clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: EOF while reading, starting at line 1', full paste here http://pastebin.com/phcwP6wU

23:04 amalloy: a source file had unbalanced parens

23:04 george`: thanks

23:05 franks42: Is there an (easy) way to save your environment of all required, refered, aliased namespaces and vars such that you can get back in the repl to work within that same space?

23:06 uvtc: Is anyone else having trouble pushing to clojars tonight? It's telling me "Permission denied (publickey)."

23:07 (That is, just using the scp command.)

23:09 george`: uvtc, is it related to https://groups.google.com/group/clojure/browse_thread/thread/5e0d48d2b82df39b

23:12 uvtc: george`, Thanks. I should've checked for recent messages on the group.

23:14 amalloy: that's not related at all, or shouldn't be

23:14 uvtc: george`, Not sure what's necessary to re-hash my password. Tried logging out then logging in again. Still no luck scp'ing though.

23:14 xeqi: when you logged in it would do it

23:15 uvtc: One thing that's weird. When I run `scp -v ...`, it tells me "debug1: Offering public key: /home/john/.ssh/id_rsa" but, of course, the public key is the one ending in ".pub". Odd.

23:23 technomancy: nothing has changed with scp uploads recently; the changes have just been about the web UI passwords

23:23 uvtc: technomancy, Thanks. This is for a new account I just created today.

23:24 (not sure if that matters, but thought I'd mention it)

23:24 technomancy, When I created the account, it failed a number of times telling me something was wrong with the public key. But then when I tried later, it just worked. Any idea why that might be? I did the same thing as earlier.

23:26 technomancy: uvtc: the only check done on the key is that it matches #"(ssh-\w+ \S+|\d+ \d+ \D+).*\s*"

23:28 xeqi: technomancy: aperiodic mentioned being unable to scp earlier as well

23:31 george`: what would be a way to narrow down which file might have unbalanced parens if you get an EOF while reading error? I've tried compiling the files but so far they all are compiling cleanly

23:31 uvtc: technomancy, my public key consists of "ssh-rsa" then a space, then a long string of letters, numbers, digits, slashes, some plus signs, then "==", a space, and my email address.

23:31 danlarkin: george`: M-x check-parens

23:34 uvtc: technomancy, Thanks for finding that regex for me. Is it an "extended" regex (like Perl's /x)?

23:34 technomancy: uvtc: it's just a clojure regex

23:34 I don't know anything about per

23:34 l

23:35 uvtc: technomancy, I ask because it has a lot of spaces in it, but my public has only 2.

23:36 "my public" --> "my public key"

23:36 antares_: uvtc: mine has two spaces as well but I've just published a new snapshot artifact to clojars just fine

23:37 technomancy: just check it in the repl

23:38 uvtc: Oh, the regex. Will try to find out how to do that.

23:40 antares_: uvtc: (re-find #"abc\s\d+" "abc 1")

23:40 uvtc: antares_, thanks. Was just reading the docs on that at clojuredocs. :)

23:41 wmealing: technomancy, got a moment for a question about swank ?

23:41 technomancy: I have a moment, but whether I have an answer ... I can't say.

23:41 go for it

23:42 wmealing: technomancy, can you use it to connect to an android project ?

23:42 technomancy: I think that should be feasible, yeah

23:43 wmealing: ok, so i'm not going mad, thanks.

23:45 george`: it seems like the parens in my files are OK; to further test I inserted a lone paren in a file and then tried lein repl, and the process died with 'Unmatched delimiter' before the repl could launch. Before I was getting all the way to launching the dev server for cljs one...could it be umatched parens in some generated file?

23:45 uvtc: technomancy, trying `(re-find ...)`, the result is: ["ssh-rsa AAAAB3NzaC1y...wgYQ== myemail@address" "ssh-rsa AAAAB3NzaC1y...wgYQ=="]

23:45 antares_: uvtc: that's a match

23:46 uvtc: technomancy, the 2nd one there doesn't have my email address as part of it.

23:46 technomancy: it sounds like that wasn't why your key was rejected then

23:48 uvtc: The command was: `(re-find #"(ssh-\w+ \S+|\d+ \d+ \D+).*\s*" "ssh-rsa AAAAB3NzaC1yc...wgYQ== myemail@address.com")`. Ok. Thanks.

23:49 antares_: uvtc: you can add an ~/.ssh/config entry that will instruct ssh client and scp to use a specific key for clojars.org

23:49 uvtc: I'm running the scp command from inside my project dir. It is:

23:49 scp pom.xml trivial-library-example-0.1.0.jar clojars@clojars.org:

23:50 antares_, Hm. I currently have no ~/.ssh/config file.

23:50 george`: when you get a trace from Jetty, how do you tell where the error started in your files? Is it commonly the first of your files in the trace? The last?

23:51 uvtc: antares_, I'm on Ubuntu GNU/Linux, and have a global one: /etc/ssh/ssh_config.

23:52 antares_, have never made any changes to it though.

23:52 antares_: uvtc: try this. Touch ~/.ssh/config && chmod 600 ~/.ssh/config

23:52 uvtc: then paste this into it: https://gist.github.com/66c9e34ac08f117fb2a8

23:52 uvtc: editing the key path, obviously

23:53 uvtc: then try one more time

23:53 johnmn3: Does anyone know where to find documentation on seesaw's cell-renderer function?

23:55 nevermind

23:55 uvtc: antares_, No dice, but thank you very much. BTW, that should be id_rsa, not id_rsa.pub, correct?

23:55 antares_, I get the same error as before.

23:56 johnmn3: (source seesaw.cells/to-cell-renderer) worked

23:56 uvtc: antares_, nvm; you wrote "private key", so yeah, id_rsa, not id_rsa.pub.

23:56 antares_: uvtc: yes

Logging service provided by n01se.net