#clojure logs

2012-03-11

00:01nappingwhen encoding with header, is #(header->body (body->header %)) used to get the codec for the body from the body?
00:01gf3hey ibdknox, is it (easily) possible to share things like partials between noir and noir-cljs?
00:01ztellmannapping: yes
00:02nappingI had the extra arguments to compile-frame switched
00:03napping(compile-frame []) acts oddly - what does it need as arguments?
00:04nappingI'm just getting NPE on encoding, and "Byte left over" even with empty input on decoding
00:04ztellmanha
00:04ztellmanyeah, I don't think that corner case is handled gracefully
00:05ztellmanthe expectation is that there's going to be something that consumes/encodes bytes in the frame
00:10arohnerwhat's the name of the HOF that takes a fn, and returns #(not (f %))?
00:11arohneroh, complement
00:11arohnerI gave up after (comp)
00:12kwertiiis 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)
00:12kwertiicommenting out the top level macro call allows it to compile
00:13TimMckwertii: "Calls macros at the top level", what do you mean? For instance, defn is a macro.
00:14kwertiiTimMc: er. true. It must be my specific macro, then.
00:14kwertiiIs there some caveat or gotcha for running code in general at the top level when compiling (versus at a REPL)?
00:15TimMckwertii: Try running macroexpand-1 on your macro usage, see if that causes the NPE.
00:17kwertiiTimMc: No exception, works fine
00:17kwertiieverything works 100% correctly in the REPL, as far as I can tell
00:17TimMcWell, what if you do the macroexpand call in your file, before the real usage?
00:24dougah, export JVM_OPTS="-Djava.awt.headless=true"
00:24dougdoug++
00:27nappingztellman: to get this to work, I think I need a codec that matches an empty seq to no bytes
00:28ztellmannapping: I feel like that's lurking somewhere in the code
00:29ztellmanlooking now
00:32kwertiiTimMc: no change with putting a macroexpand-1 into the source before the actual call. still fails with NPE
00:32TimMcOK, so your macro's code isn't producing the NPE, your generated code is.
00:33kwertiiTimMc: That seems to be correct
00:33ztellmannapping: eh, nothing quite fits, you'll need to define: https://gist.github.com/2015155
00:33ztellmanlike I said, this should be easier
00:33kwertiido the *__init classes generated by compilation, which are designed to replicate the effect of loading the file, have a different namespace setup?
00:35nappingthat acts the same as (compile-frame [])
00:35kwertiithe 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
00:35nappingah, encode by itself produces nil
00:36nappingthe problem is contiguous returns nil as the byte buffer
00:36nappingso the encoding is actually more or less okay
00:36nappingwell, let me try a larger frame
00:38nappingencoding does work, it was just my test function not handling empty output
00:38nappingthough you might have contiguous return a zero-length byte buffer on empty input rather than nil
00:38nappingdecoding is still giving the error about leftover bytes
00:38ztellmanhmm
00:42nappingin decode it uses empty? on bytes-seq
00:42ztellmanyeah, looking at that now
00:42napping(decode empty-frame nil) works, (decode empty-frame (to-byte-buffer[])) fails
00:43ztellmanok, so (compile-frame []) should do what you want
00:43jonasen,::foo/bar
00:43clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: ::foo/bar>
00:43ztellmanI'm going to fix decode, but my intuition is that if you don't use it in isolation, it should work
00:43nappingit seems to work if it's not by itself
00:43ztellmanyeah
00:43jonasen^^ is that ever a valid form to write?
00:45ztellmannapping: fwiw, you shouldn't need the custom Reader/Writer, (compile-frame []) should suffice
00:45amalloyjonasen: yes
00:45amalloy&(require '[clojure.string :as whatever])
00:45lazybot⇒ nil
00:45amalloy&::whatever/foo
00:45lazybotjava.lang.RuntimeException: Invalid token: ::whatever/foo
00:46jonasenamalloy: I don't understand it
00:46amalloywell. that would work not in a bot
00:46amalloytry those two things in your repl
00:47xeqi&::user/bar
00:47lazybot⇒ :user/bar
00:47jonasenamalloy: Yes, that works
00:47xeqi&(= ::user/bar :user/bar)
00:47lazybot⇒ true
00:48jonasenIs it documented anywhere? I've never seen such a form before
00:50jonasenIt's weird, since the clojure reader can't read it.
00:50jonasen,(read-string "::foo/bar")
00:50clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: ::foo/bar>
00:50nappingIt seems to read it the same as :ns/foo
00:50nappingis foo a valid namespace?
00:51jonasen,:foo/bar
00:51clojurebot:foo/bar
00:51nappingoh, that's odd. It reads it like :ns/foo if ns is a namespace
00:53ztellmannapping: checked in a fix for the decode issue, (compile-frame []) successfully round-trips now
00:53nappingnice. I've still got an NPE on encoding with the full definition, but it's not in (compile-frame []) anymore
00:55nappinghttps://gist.github.com/2015208
00:57ztellmanwhat are you using for 'element'?
00:57nappingfor testing, :int16
00:57ztellmanhow can :int16 be nil?
00:57ztellmanoh, nm
00:57nappingit really shouldn't be, I've probably got something wrong in the base case
00:58nappingis there anything like macro-let or symbol macros?
00:58nappingI was hoping to shove the ugly fixpoint hack into a macro
01:10jonasenamalloy: So there are valid clojure source files which are unreadable: https://refheap.com/paste/1023 ?
01:11amalloynapping: org.clojure/tools.macro
01:11nappingsorry just got it installed and tested
01:11amalloythat's a funny consequence i never thought of, jonasen
01:12napping(mu test (fn [x] (if (> x 0) (inc (test (dec x))) 0))) 12) whee
01:12amalloynapping: wut?
01:12nappingit's a fixpoint
01:12napping(mu self body) expands to your thing with the promises
01:14amalloyyou don't really need it for a function to refer to itself, though, only for mutual recursion between functions and/or data objects
01:15amalloy&((fn test [x] (if (> x 0) (inc (test (dec x)))) 0)) 12)
01:15lazybotclojure.lang.ArityException: Wrong number of args (0) passed to: sandbox6997$eval10419$test
01:15nappingwhere I really need it the top is gloss "header" form, and the self-reference is deeper
01:15ztellmannapping: found the NPE issue: https://gist.github.com/2015256
01:16ztellmancan you see the difference?
01:16nappingah, that would do it
01:17ztellmanI was so convinced it was a fundamental issue with how the header was being used
01:17ztellmantook me a bit
01:17nappingI was pretty sure it was something like that
01:37amalloyso ztellman, napping - i'm not paying that much attention, does this mean you can do it with a header with no particular problems?
01:38ztellmanamalloy: it works for simple cases
01:39nappingIt may have been simpler just to write it directly
01:39ztellmanprobably
01:41seancorfieldis there a way to ask travis-ci to re-run a build?
01:41nappingwhat's the return from read-bytes?
01:41nappinglooks like [success ?? remaining]
01:41seancorfieldcongomongo normally takes 4-5 minutes on travis but for some reason timed out at 30 minutes this evening
01:45ztellmannapping: it's either [true value remainder] or [false next-reader remainder]
01:45ztellmannot the best representation, it should be distinct types
01:45nappingwhat should next-reader be?
01:45ztellmanseancorfield: I had the same thing happen, I couldn't find a way
01:46ztellmannapping: the reader that will get the next chunk of bytes, when they're available
01:46seancorfieldi 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 :)
01:46ztellmanyou can either pass back the current reader, or a modified one that closes over some intermediate state
01:46ztellmanyou'll always get remainder + new bytes, next time around
01:47ztellmanbut if you're scanning over bytes for a delimiter, for instance, you don't want to keep going over the same bytes
01:52nappingI think I see how compose-callback works
01:52nappingwhat is write-bytes supposed to do?
01:53nappingthat's not so obvious from reading convert-sequence
01:54ztellmanwrite-bytes either overwrites 'but', which is assumed to have relative writes
01:54ztellmanor returns a buffer
01:54ztellmanbut => buf
01:55nappingI don't see anything yet that makes a new buf
01:55ztellman(with-buffer …)
01:55nappingis ByteBuffer extensible?
01:55ztellmannope
01:55nappingoh, at the finite bits I suppose
01:56ztellmanyeah, if the size is calculable, then you try to put as many things into a contiguous buffer as possible
01:56ztellmanif not, you just concatenate everything together
01:57ztellmanagain, a few different things are being jammed together
01:58ztellmanit works, but the API could be much cleaner
03:00ztellmanI'm going to call it a night, and probably won't be on IRC tomorrow - if you get stuck send me an email
03:01nappingthanks. I've already got the other code, so I don't really need this version even if I do get stuck
03:02nappingIf 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
03:04ztellmanthanks, will do
03:09muhoothat'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"]
03:11muhooand it's there in project/lib/serial-port-1.1.2.jar , looking right at me?
03:11muhooseriously, wtf?
03:15nappingthe read side of this works, the writing has some error about casting a SingleBufferSequence to nio.Buffer https://gist.github.com/2015393
03:15muhooah, thaht's a little better: UnsatisfiedLinkError no rxtxSerial in java.library.path java.lang.ClassLoader.loadLibrary (ClassLoader.java:1734)
03:15muhoobut it is in fact there, project/lib/rxtx22-1.0.6.jar , looking right at me.
03:19muhoolessee if lein deps fixes it
03:30muhoobah, lein no longer works
03:30muhoo"repl server launch timed out"
03:34muhoohmm, now the repl locks up
03:35muhoowon't take any input.
03:35muhoothis is bad
03:37muhooi get a user=> prompt, and then anything i type, i just get a newline. no response from the repl.
03:50muhooleiningen-2.0.0-preview2 fail.
03:54muhoo*whew*! 1.7.0 works.
04:19muhooheh https://refheap.com/paste/1024
04:30dogenpunkdoes anyone have any information on setting up swank-clojure classpath?
05:21Raynesmuhoo: You've got an errant space between 'serial port and ns-publics
05:21RaynesI spotted it from clear across the URL.
05:44muhooi got it working. i'm tired, i think.
05:50muhooturns out i could have done it in 1 line of bash: echo -n $'\xff' > /dev/ttyUSB0
05:51muhooalso, i was confused, i thought you could do ns-publics on a ns without requiring it first. doh.
06:24si14hello, guys. how can I improve this code: https://gist.github.com/9179918ce8b99cd5f03e ?
06:46muhoosi14: i'm told there is a mapcat function that can consolidate (concat (map )), but i've not yet used it
07:00si14muhoo: thanks for advice, I'll look at it
07:15foodooDoes Clojure always use Object as a parameter to Java-Generic constructors?
08:04raekfoodoo: yes. generics only exist in java and all parameter types are Object on the JVM level
08:07foodooraek: thanks for the answer.
08:39VinzentHi, have someone used Datomic as a local in-memory db? Is it possible?
09:02bsteuberVinzent: like http://datomic.com/company/resources/clojure-api does?
09:03bsteuberyou still need to create the db, though
09:04bsteuberbut as you are not allowed to deliver the datomic jar with your app, it's rather there for testing-only I guess
09:05bsteuberI mean end-user apps
09:07Vinzentbsteuber, 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
09:09Vinzentbsteuber, I won't spread the app, it's for my own use, so I guess it not violates the agreement
09:16bsteubersomewhere they say you can use virtualbox for saving the image to disc
09:18Vinzentbsteuber, it should be automatic, so virtual box thing isn't suitable
09:19bsteuberwell as any db snapshot the app gets is clj data
09:19bsteuberI guess that won't be too hard to store somewhere in a dumb way
09:21bsteuberor better store the transactions
09:24Vinzentbsteuber, yeah that'd be better but then I have to maintain log of transactions, retract it, etc
09:26bsteubermm
09:39hobbit125Hi
09:46si14looks like I've found a bug in clojurescript.
09:46si14or I've missed something.
09:47si14https://gist.github.com/2016505 here is a snippet
09:47si14the interesting thing here is that "(vec children-leafs)" returns vector that is shared between recursive calls.
09:48si14ouch. nope, it's my fault, nevermind
10:05sharat87hi, 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:37Frozenlo`IIIIIIIIIIIII
10:37Frozenlo`Stop it, you pervert!
10:38bsteubersharat87: I don't find any bug here
10:39bsteuberhow are config and config! implemented?
10:39gfrederickssharat87: I would try rewriting it so that the macro is very small and mostly just defers to a function
10:39gfredericksalso while you're at it you could make your macro generate the full handler function instead of just the body
10:40sharat87I don't know if this is a seesaw bug, but using (.setText), it works, in that it doesn
10:40sharat87... 't throw an error, but doesn't set the button's text either
10:40sharat87gfredericks, I don't follow, can you explain a bit? :)
10:41sharat87bsteuber, they are defined in the seesaw.config namespace http://daveray.github.com/seesaw/seesaw.config-api.html
10:41gfrederickssharat87: 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:42gfredericksi.e., I would first write a function called create-btn-handler
10:42gfredericksthat you can use like (action :name "foo" :handler (create-btn-handler (fn [e] ...handle...)))
10:43gfredericksthen when you get tired of writing (fn ...) all the time you can make a macro to sugar that up
10:43gfredericksbut the macro could be very minimal
10:43sharat87gfredericks, oh yeah, get it. Will happen once this works :)
10:44gfrederickssharat87: 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:45sharat87gfredericks, 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:20darevaysharat87: 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:23darevaysharat87: if you're still having trouble ask on seesaw-clj ML. I'm very rarely on IRC. Cheers.
11:47lakeguys, I have a lazy sequence that I would like to A) sum all elements until the sum is greater than a number.
11:47lakeand there is no B. :)
11:48lakei'm a noobie at clojure, too.
11:48RickInGAwould take while work?
11:49TimMclake: Given [1 2 3 4 5] and the limit 9, what would the result be?
11:49lakei tried that but i don't think i did it right
11:50lake[1 2 3]
11:50TimMc&(take 5 (reductions + 0 (range)))
11:50lazybot⇒ (0 0 1 3 6)
11:50TimMc&(take 5 (reductions + (range 1 20)))
11:50lazybot⇒ (1 3 6 10 15)
11:52TimMc&(let [in (range 1 20)] (map first (take-while #(< (second %) 9) (reductions + in))))
11:52lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
11:52TimMc&(let [in (range 1 20)] (map first (take-while #(< (second %) 9) (map list in (reductions + in)))))
11:52lazybot⇒ (1 2 3)
11:52lakeTimMc: wow, i love the live coding
11:52TimMcThat's what REPLs are for!
11:53lakei had not seen the reductions function yet
11:54lakeor in
11:54lakei'm coming from ruby so my brain is twisted
11:54TimMcThat (map list x (foo x)) pattern can be simplified, as can the whole annotate-deannotate pattern.
11:54RickInGAI 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:55rlblake: "in" is just a var there.
11:55rlbi.e. it's bound to the lazy sequence of integers generated by range
11:55lakerlb: yes, just notied that. thanks for the clarification
11:56TimMc&(take 7 (let [in (range 1 20)] (map list in (reductions + in))))
11:56lazybot⇒ ((1 1) (2 3) (3 6) (4 10) (5 15) (6 21) (7 28))
11:56rlb(lake: though there *are* some interesting "*-in" functions...)
11:56rlbi.e. assoc-in, etc.
11:59lakewhat is the difference between "def" and "defn"?
11:59TimMcdefn = def + fn
12:00rlblake: (defn foo [] 42) <==> (def foo (fn [] 42))
12:00lakeis a "def" more like a static var? while defn is allowed to take an arg?
12:01rlblake: def is the more primitive operation
12:01rlblake: defn is just a convenience for defining functions
12:01TimMclake: All def* statements create a var in the current namespace.
12:01TimMcEverything but def is a convenience wrapper, mostly.
12:02TimMcdefn does some extra tricky stuff that allows optimizations.
12:02lakeawesome, thanks for the help
12:02rlb(fn [...] ...) constructs functions
12:02lakeso defn just attached a function to a name.
12:03lake(accessed through a variable in the namespace
12:03qbgYep, defn is basically (def ... (fn [...] ...))
12:03lakegood stuff
12:03rlblake: and there's a shorthand too #(+ %1 5) <==> (fn [x] (+ x 5))
12:04TimMcand that %1 can just be written % :-)
12:05rlbright -- suppose I should have chosen: #(+ %1 %2) <==> (fn [x y] (+ x y))
12:05qbgThe only limitation of #(...) is that you can't nest it
12:06lakeah, maybe that was my problem when i tried to use take-while.
12:06qbgWell, main limitation
12:06lakei think i nested that shortcut.
12:06rlblake: 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:06qbgDo you know why it doesn't make sense to nest it?
12:07lakeno
12:07qbg#(foo #(bar %))
12:08qbgWhat are the arities of the fns?
12:08qbgDoes % come from the inner, or from the outer?
12:08lakeinner?
12:08AimHereI thought you weren't allowed to do that
12:08qbgYou aren't
12:08qbgBecause of that problem
12:08rlbit's ambiguous, so it's disallowed.
12:09AimHereYeah, just use the (fn [foo bar] wibble) form instead
12:09lakegot it. i actually didn't nest them now that i see that.
12:09lakebut it still makes sense
12:09lakethanks for all the info guys. i am having fun getting my brain twisted, coming from ruby.
12:10lakei'll be around later to ask more questions. :p
12:10AimHere<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:10rlbtrue
12:15TimMcheh
12:16foobar27hi
12:17foobar27I'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:17foobar27the best result I could get is still 8.17 times slower than java
12:18gfredericksfoobar27: so the input is x \in [0,1]?
12:18foobar27input is in [0,2^(n*n)-1]
12:19gfrederickssomething along those lines was my second guess
12:19foobar27clojure code is at https://gist.github.com/2016925, java code at https://gist.github.com/2016924
12:20qbgfoobar27: Check out *unchecked-math*
12:20qbg(assuming 1.3)
12:20qbgIs this 1.2?
12:21foobar27I just tried the bleeding edge 1.4 SNAPSHOT
12:21foobar27I'm using unchecked math at almost every location I could think of
12:21TimMcfoobar27: I recommend grabbing VisualVM and seeing if there's still major boxing/unboxing.
12:22qbgSetting *unchecked-math* to true would make that much more readable
12:22qbgSince you math ops would be unchecked by default then
12:22TimMc&(doc *unchecked-math*)
12:22lazybot⇒ "; While bound to true, compilations of +, -, *, inc, dec and the coercions will be done without overflow checks. Default: false."
12:24qbgYou can use use (.y a) instead of (:y a)
12:24qbgYou can make hilbert-to-point-unchecked ^:static
12:25TimMcWhat does :static do?
12:25foobar27TimMc: thanks, *unchecked-math* even gave me a minor boost to a factor 7.8
12:25qbgDoesn't indirect through a var
12:26qbgI believe the ^Point tag is in the wrong spot for hilbert-to-point-unchecked
12:26qbg(should be on the arg vector)
12:26qbgDoesn't matter anyways because it is being boxed in a lazy seq anyways
12:26TimMcqbg: No, on the name.
12:26Frozenlo`&(* 1341264578568973673 23452424756)
12:26lazybotjava.lang.ArithmeticException: integer overflow
12:27foobar27*unchecked-math* gave me a small improvement, but (.y a) makes it 10 times slower
12:27TimMc:tag has to end up on the Var
12:27qbgThat is because you need to hint a
12:27TimMcfoobar27: Needs type hints somehwere, then.
12:27TimMc[a ^Point (first r)] or soemthing
12:28Frozenlo`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:29qbg&(* 1341264578568973673N 23452424756)
12:29lazybot⇒ 31455906606776905222177448788N
12:29Frozenlo`You added an N?
12:29qbgIt is because of the treatment of primitives
12:29qbgThose numbers are longs
12:29qbg&(*' 1341264578568973673 23452424756)
12:29lazybot⇒ 31455906606776905222177448788N
12:29TimMcFrozenlo`: 1.3 dropped autopromotion
12:29qbg* will throw an error on overflow
12:30qbgThat allows it to take and return primitives
12:30qbg*' promotes
12:30foobar27TimMC: that did the trick, gave me another improvement. I'm now at factor 6.8
12:30qbg1N is a BigInt; they are contagious like doubles
12:30TimMcfoobar27: You really should profile it to get a sense of what needs fixing.
12:32Sindikathello 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:32qbgFrozenlo`: The JVM makes methods decide if they are going to return a primitive or an Object
12:32foobar27I'm currently trying to get jvisualvm working
12:33qbgYou need to stay in primitive land to avoid the performance costs of boxing numbers
12:33Frozenlo`Thanks. I'll be sure to remember *' next time I get this integer overflow error.
12:33qbgOr you can use a bigint
12:34Frozenlo`*' is faster to write :p
12:34qbgBigInts are contagious, so you only need the N in one place usually
12:34qbg&(+ 1N 1)
12:34lazybot⇒ 2N
12:35Frozenlo`Oh!
12:35qbgJust like doubles:
12:35qbg&(+ 1.0 1)
12:35lazybot⇒ 2.0
12:36foobar27when I connect with jvisualvm to the clojure instance, nothing happens. I right-click and select open.
12:38qbgfoobar27: You can also use (== 1 ry) instead of (= 1 ry)
12:42foobar27qbg: thanks, but that has no notable difference on my machine. After a jdk update, I can use jvisualvm
12:42qbgThese are microops
12:43qbgOnce visualvm works for you, you can do some profiling
12:44qbgYou could get rid of the lazy seq in red-fast
12:45foobar27yes, jvisualvm says the same (LazySeq.sval)
12:45qbgI recommend using Criterium for benchmarking
12:46qbg(rather than using time)
12:46foobar27qbg: criterium seems to be quite useful
12:50qbgTimMc: From the java_interop page on clojure.org: "For function return values, the type hint can be placed before the arguments vector:"
12:51qbgThat way you can have different hints for different arities
12:51TimMcqbg: Ah! Interesting...
12:54qbgfoobar27: It would be interesting to have a version that uses longs instead of ints
12:54qbgYou wouldn't need to be coercing everything to ints then
12:55foobar27qbg: ok, thought it would be faster with int
12:55foobar27but first I'll rewrite the reduce function
12:55qbgIIRC, on 64 bit vms at least the difference isn't that big
12:57TimMcqbg: I think you can still put the :tag on the name.
12:58TimMcand I'm not sure what happens if you put it on the arglist in the single-arity fn form.
12:59qbgThe single arity form is just a special case, so it should do the same thing
13:00qbgYes, it needs to be on the arg vector
13:00TimMcHmm, having looked into the fn macro... I agree that it will Do The Right Thing on the single-arity case.
13:01qbgThere is an interesting bug with primitive fns
13:02qbgIf you hint the return type as being a subclass of Object, you get an AbstractMethodError when calling it
13:02qbgYou get that behavior with the tag on the arg vector, but not the name
13:02qbgThus it needs to be on the arg vector
13:02TimMcHmm, there are some core.clj fns hinted on the name.
13:03qbgFor example?
13:04TimMcclojure.core/next
13:04TimMcErr... that's a def + fn form
13:04TimMcto-array, then
13:05TimMcThat uses the attr-list form, which I *think* is equivalent to attaching to the name.
13:06TimMcInterestingly, clojure.core/str hints on the arglists *and* in the defn attr-list
13:07qbgPutting the tag on the vector doesn't add it to the var's meta
13:10qbgThe java_interop page is out of date
13:11TimMcUgh, the whole of clojure.org is.
13:11Bronsaclojure.org is out of date
13:11qbgThis 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:11qbgBe nice if it wasn't
13:11TimMcIt's mostly correct, just old.
13:13TimMchttp://www.raynes.me/logs/irc.freenode.net/clojure/2012-02-16.txt
13:14TimMcStart at 17:38:30, go to 18:31:09
13:14Vinzentany idea why this https://refheap.com/paste/1028 loads CPU up to 100% and never terminates?
13:15foobar27I removed the lazy-sec in red-faster, now it's only 5.67 times slower than java. https://gist.github.com/2017155
13:15TimMcOr here: https://refheap.com/paste/1029/raw
13:15TimMcFrozenlo`, qbg: ^
13:16Frozenlo`Thanks. I like the technomancy's idea :)
13:19qbgI wonder how much making Point a deftype instead and marking hilbert-to-point-unchecked as being ^:static would help
13:20TimMcI've never seen an explanation of :static.
13:21qbg1) you can use it for primitive fns
13:21qbg2) The calls are not indirect through vars
13:21qbg(if you change a ^:static fn, you must recompile all code that calls it)
13:21raekhas static been reintroduced?
13:23raekI thought it when away when :dynamic appeared
13:24qbgNo, ^:dynamic doesn't make ^:static obsolete
13:24raekqbg: in which version was it introduced?
13:24qbg1.3
13:25TimMc:static has been around
13:25qbgIt originally showed up in the 1.2 new branch IIRC
13:26qbgIn this case, unless the hilbert function is being called a ton of times, it probably won't make too much of a difference
13:26FrozenlockIf 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:26raekI don't see :static mentioned anywhere in https://github.com/clojure/clojure/blob/1.3.x/changes.txt
13:27raekI assumed that it was removed, but I could be wrong
13:27qbgIt came with this: 2.1 Enhanced Primitive Support
13:27TimMcFrozenlock: I don't think you need to do anything special.
13:28Frozenlock&(source reverse)
13:28lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
13:28TimMcqbg: I think you and raek are maybe talking past each other?
13:29qbg&(clojure.repl/source reverse)
13:29lazybot⇒ Source not found nil
13:29TimMcThat doesn't work in the bot.
13:29TimMc$source reverse
13:29lazybotreverse is http://is.gd/kaaKW0
13:29TimMc...and that's hella outdated
13:30FrozenlockI get the same error on my repl: java.lang.RuntimeException: Unable to resolve symbol: source in this context
13:30foobar27qbg: deftype is substantially slower than defrecord. Unless I need to change the code at another place.
13:30tmciverFrozenlock: you need to (use 'clojure.repl)
13:31TimMcFrozenlock: How are you starting your REPL?
13:31Frozenlocktmciver: thanks!
13:31FrozenlockTimMc: clojure-jack-in
13:31TimMcAh, OK. `lein run` automatically loads the REPL tools.
13:32FrozenlockI'll immediatly add the (use 'clojure.repl) in my .clj file.
13:32tmciverFrozenlock: 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:32FrozenlockBeing able to see the source has been intrumental in my emacs learning; it will probably be too in clojure
13:34foobar27the 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:34glob157conway's game of life, sebastian benz : having issues with the github one :
13:34tmciverFrozenlock: As a (poor, IMO) alternative, you can M-. on a symbol to see the definition of the var.
13:35FrozenlockOh I like it!
13:36glob157java.io.FileNotFoundException: Could not locate simulator/run__init.class or simulator/run.clj on classpath:
13:36glob157http://pastebin.com/XjgRL1zj
13:37qbgfoobar27: Try getting rid of the destructuring swap you have in hilbert-to-point-unchecked
13:37Frozenlocktmciver: It's opened in another buffer, with all the syntax highlighting. In a sense I find it superior to simply using (source ...)
13:39tmciverFrozenlock: 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:40tmciveroops, source is actually a macro.
13:40TimMcI guess it has to be.
13:41TimMc(source-fn #'whatever) could probably work, though
13:47foobar27qbg: Thanks, that reduced the factor to 2.5. I'm now trying to use long, as uncheckedIntCast is the current bottleneck.
13:48qbgLiteral numbers are primitive longs
13:48foobar27qbg: (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:48qbgSo that should make the code look much cleaner :)
13:50qbgIt might be useful to pull a ^:static fn out at some point
13:50qbgTurning the conditional swap into a conditional call
13:50qbgNeed to profile first
13:51foobar27qbg: where do I need to put that ^:static? also before the arg vector?
13:52qbgOn then ame
13:52qbg*name
13:52foobar27qbg: so (defn ^:static hilbert-to-point ...)?
13:52qbgYeah
13:53foobar27I tried that at a previous version, I did not notice any effect, will try it after the change to long
13:53TimMcWhat got it down to 2.5?
13:53TimMcGetting rid of destructuring>
13:53foobar27TimMc: yes
13:54TimMcInteresting.
13:56jayunit100hi guys : http://stackoverflow.com/questions/9657362/main-class-in-clojure-leiningan-conways-game-of-life <---- any thoughts on this one
13:56jayunit100?
13:57TimMcjayunit100: "crashes" doesn't mean anything, you need a stack trace.
13:57TimMcjayunit100: And it requires either 2 or 3 arguments, but you aren't giving it any.
13:58TimMcProject definitely looks broken as is.
14:00foobar27long instead of int got me down to 1.96
14:01foobar27the 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:01foobar27(might be related to the fact that I'm not using a stable clojure)
14:02qbgYes, if you give a primitive hint to the arg, don't hint the return with Point
14:03foobar27qbg: ah, he can deduce the type in that case
14:04qbg(I consider it a bug)
14:04qbgJust hint the value produced where you call it (if needed)
14:17TimMcfoobar27: Hinting is a single tool for multiple completely different purposes.
14:20jayunit100@TimMc yup - giving it 2 args is nec.
14:20jayunit100but not sure what that method does
14:20TimMcHinting 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:29foobar27TimMc: 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:29rlbTimMc: 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:30rlbTimMc: then just use (locking ...) to serialize the request and response.
14:30rlb(that avoids deftype, set!, etc.)
14:31jayunit100sometimes i think that the ' in clojure is just an escape character for the REPL. is that accurate ?
14:31TimMcjayunit100: Nope.
14:31jayunit100:(
14:32jayunit100whats the difference ?
14:32AimHereNot really. It's shorthand for (quote <whatever>)
14:32AimHereIt's a way of telling clojure to not evaulate <whatever>
14:32jayunit100hmmm ... so is the qoute function basically an escape function for the repl ?
14:32TimMcjayunit100: It's an escape function for the *reader*.
14:33jayunit100Ah okay yeah your right. the EPL still works as normal .
14:33TimMcHmmm... or really the evaluator.
14:33rlbjayunit100: it's a language-level concept
14:33jayunit100yup
14:33AimHereWell 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:33TimMcrlb: I've largerly forgotten what little I understood about the mdb thing. :-/
14:33rlbTimMc: just as well.
14:33TimMchaha
14:34rlbs/mdb/mpd/
14:34TimMcfoobar27: Maybe that ^Point hint should be on 'a? I don't use hinting much.
14:34rlbThis approach is good enough for now, and keeps me from mucking about with bits probably better left alone.
14:35foobar27TimMc: yes :)
14:36rlbibdknox: did you arrange your overtone interface buttons via table or something fancier?
14:37jayunit100if 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:37ibdknoxrlb: they're just elements floated left with margins
14:37qbgfoobar27: You need to ^Point hint on a
14:38TimMcHINT ALL THE THINGS
14:41qbgIf you want to be hard core, you could introduce macros
14:42rlbibdknox: thanks - worked perfectly.
14:54jondot1any suggestions about what to use for image metadata
14:56tylergilliescould using an agent be seen as a flavour continuation passing style?
14:57qbgtylergillies: Async code basically is CPS
14:57tylergilliesqbg: ah, ok thanks, that makes sense
14:58foobar27with *unchecked-math*, I am now very slightly below the java execution time
14:59gfredericksfoobar27: "below" == "faster than java"?
15:00foobar27gfredericks: apparently yes, I'm currently switching to criterium to do a more professional benchmark
15:01foobar27gfredericks: and I haven't tried to optimize my java program
15:31jondot1trying to use rinzelight, getting this Unable to resolve classname: clojure.core/ints
15:31jondot1any idea what this is?
15:33foobar27gfredericks: 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:33TimMcjondot1: A broken attempt at hinting?
15:34TimMcjondot1: Or maybe a Clojure version mismatch. (grasping at straws here)
15:35jondot1well this is my project file http://pastie.org/3572683
15:36jondot1other than that, i don't think i even have straws :)
15:36johnmn3anyone ever used java's internal browser? to do a rich client program?
15:36jondot1now 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:36uvtcIf 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:37uvtcI 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:37foobar27anyway, thanks for all your help. I'll cleanup the code after dinner, write test cases and upload it.
15:38uvtcI 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:42jondot1so a given library can target either 1.2 or 1.3?
15:43jondot1looks like rinzelight works on 1.2 but not in 1.3
15:44TimMcjondot1: You can target mutiple Clojure versions, but probably not if you AOT your code.
15:45jondot1so in this case its the library's code not properly supporting interop between versions?
15:46uvtcjondot1, 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:47jondot1uvtc: exactly. is that so rare?
15:48uvtcjondot1, I'm pretty new here. Dunno. Maybe some tinkering around will provide a solution.
15:48uvtcjondot1, there doesn't appear to be too much action on this channel on the weekend.
15:49uvtcjondot1, Maybe try asking again tomorrow after you've experimented some more.
15:49TimMcjondot1: rinzelight depends on contrib
15:49TimMcThat might be a problem.
15:49uvtcjondot1, also, you might consider using https://refheap.com/paste for your pastes.
15:50jondot1so it depends on contrib, but i saw that for 1.3 ints is in core
15:50sritchieAny Clutch users here, w/ CouchDB?
15:50jondot1for now i switched to 1.2.0, no big deal. but the problem is interesting of itself.
15:58TimMcjondot1: 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:59jondot1yup
15:59rlbclojure libs generally shouldn't prefix function names, right?
16:00rlbi.e. (play x) rather than (mpd-play x)
16:00rlbpresumably you'd use :as mpd if you wanted (mpd/play x)...
16:01TimMcright
16:02rlbhah, though I'm not sure about mpd/next.
16:02rlbi.e. previous/next
16:02TimMcDOO EET
16:03TimMcYou can :refer-clojure :rename {next next-no-really} in your ns. :-)
16:05rlbalso mpd/list and mpd/find, hmm...
16:05rlbWonder if that's too confusing.
16:06spoonmanhi, i'm getting an error message, while trying to use vim with clojure, http://pastebin.com/Z76q2ymm, can anyone help me?
16:07mr_rmdoes (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:07qbgPatterns are compile time constants
16:08TimMcrlb: You could :exclude those core fns in your mpd stuff and then :require :as clojure.core again. Maybe name it clj.
16:08mr_rmqbg: does that mean the pattern is compiled when the form is read in?
16:09qbgYes
16:09mr_rmthanks!
16:09qbg&(class #"hello")
16:09lazybot⇒ java.util.regex.Pattern
16:11rlbTimMc: I'm just wondering if it's too cute to have (next mpd), even though that's mpd's name for the operation.
16:11rlb(cute/confusing)
16:11rlbI suppose I could just name them next-song/previous-song.
16:12TimMcblah
16:12mr_rmdoes anyone here use vsclojure?
16:12tylergillieshow do i include java deps in my lein project?
16:13tylergilliesdo i just manually copy the jars to lib?
16:13gfrederickstylergillies: using the maven group/artifact/version, just like clojure deps
16:13mr_rmi'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:14tylergilliesgfredericks: ah, not sure how that system works (not a java guy) is there a clojar-like site for java libraries?
16:14TimMcmr_rm: You may have to specify which namespaces to AOT.
16:14mr_rmtylergillies: it's called maven repositories
16:14TimMctylergillies: Maven Central
16:15tylergilliesTimMc: mr_rm thanks
16:15tylergilliesdoes 'lein search' search maven or just clojar?
16:16mr_rmTimMc: 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:17TimMcmr_rm: It may be as simple as (:gen-class) in your main ns.
16:17mr_rmTimMc: i already have that
16:17TimMcHuh.
16:18brehauttylergillies: presumably it searches all of the repos in your project config (which defaults to maven and clojars)
16:18mr_rmTimMc: in fact, i'm starting out with just a trivial example. a single hello world file
16:18rlbTimMc: for now, I'll just provide next/list/find, and we'll see.
16:18_rccI'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:18jondot1what would you use to import a java class from a jar, but be able to refer to it without a fully qualified name?
16:19gfredericksjondot1: an (:import) statement in the (ns) declaration
16:19gfredericks(ns foo.bar (:import java.util.List))
16:19tylergilliesbrehaut: thnx
16:19mr_rmTimMc: 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:20brehauttylergillies: 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:21jondot1gfredericks: annoyingly, i'm not sure tha works for me
16:21gfredericksjondot1: the dep is declared in your project.clj?
16:21jondot1gfredericks: the jar is just in my /lib folder
16:22_rccStrike my last Q. Sorry. I'm using LNPR in my class and didn't import it
16:22gfredericksjondot1: 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:22jondot1its a private build of a public jar
16:23gfredericksjondot1: clojure project or java project?
16:23jondot1java
16:23gfredericksmight be the easiest thing to do is install it to maven locally -- do you know how to do that?
16:24mr_rmjondot1: (ns something (:import (javax.swing JLabel)))
16:24mr_rmjondot1: then you can just use JLabel
16:25jondot1yes, might be that i've found whats wrong
16:25jondot1i've chained constructor-staticmethod-instancemethod as Foo/STATIC/instance
16:26jondot1which gave off a misleading error for Foo/STATIC not existing as a type
16:27jondot1awesome, everything works now. sometimes i feel java interop is magic :)
16:29spoonmanhi, i'm getting an error message, while trying to use vim with clojure, http://pastebin.com/Z76q2ymm, can anyone help me?
16:31mr_rmspoonman: 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:31mr_rmlooks like it hasn't loaded that namespace, maybe because it can't find the jar file
16:32spoonmanmr_rm: yes, i put the jars in the classpath
16:32mr_rmspoonman: anything silly like you forgot to export the env variable CLASSPATH?
16:32randomnamehereHey guys, what do you think about https://github.com/davidsantiago/stencil ? maybe a full replacement for enlive?
16:33mr_rmspoonman: or restart the ng server after you modified the classpath in the script or whatever?
16:33spoonmanmr_rm: i started with java -cp
16:34brehautrandomnamehere: a mustache implementation is a completely different beast to enlive
16:34brehautrandomnamehere: https://github.com/davidsantiago/tinsel is much more comparable
16:34brehaut(and suitable as a possible alternative to enlive)
16:35ibdknoxbrehaut: different, sure. But I can build anything with stencil that you can with enlive
16:36gfrederickstime for a template-off?
16:36ibdknoxrandomnamehere: fwiw, I've built several sites with stencil and it's worked out well :) https://www.readyforzero.com uses it, for example
16:36brehautibdknox: well of course, but i can build anything with str that you can with stensil. its still not a very useful comparison
16:36ibdknoxgfredericks: everyone would lose :(
16:36RaynesRefHeap is built with stencil. :D
16:36gfredericksRaynes: and vice versa!
16:37ibdknoxif you want erb-style templates, comb is nice
16:37ibdknoxbrehaut: the implication there was as easily
16:41gfredericksI don't suppose there's a macro in any standard lib for creating a recursive memoized fn is there?
16:42TimMcgfredericks: (def foo (memoized (fn ...))) ?
16:43gfredericksTimMc: without defing it?
16:43TimMcOh, I see.
16:44randomnamehereI think I'll replace enlive with stencil
16:44uvtcWhen 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:44gfredericksuvtc: I don't think that's required
16:45randomnamehereThe idea is nice and it is available in many other languages,... Don't know what the performance measurement means that is available...
16:45randomnamehereMaybe it is faster than enlive?
16:45ibdknoxrandomnamehere: in virtually no application is template rendering the bottleneck
16:45randomnamehereThe java solution for it is multithreaded,... (mustache)
16:45uvtcHm... The "register" form is asking me for it...
16:46randomnamehereibdknox: it introduces latency,... remembering my time with php. After smarty template cache was intruduced everything was super-awesome fast
16:46uvtcWhoops. Wait. Found this https://github.com/ato/clojars-web/wiki/ssh-keys . Yup. Use the same one.
16:47ibdknoxrandomnamehere: we're talking on the order of a couple ms
16:47randomnameherems?
16:47ibdknoxmilliseconds
16:47TimMcuvtc: I don't see why it matters.
16:48ibdknoxrandomnamehere: in any case, I very highly doubt it'd be slower than enlive
16:48uvtcArgh... clojars/register it's telling my my pub key is invalid.
16:48TimMcuvtc: 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:49uvtcTimMc, Thanks.
16:49uvtcwhoops again ... think I know what it is.
16:50randomnamehereibdknox: but enlive does more with the templates, doesn't it (parsing, # selectors, replacing in templates,...)?
16:50TimMcpriv key?
16:50ibdknoxrandomnamehere: which is why I said enlive is probably slower :)
16:50brehautrandomnamehere: enlive does that once per template
16:50randomnamehereReadyForZero << it is for americans?
16:51ibdknoxyeah
16:51ibdknoxthe rules for debt in other countries vary wildly
16:51brehautrandomnamehere: well, other than the actual transformations applied in a particular template.
16:51uvtcArg. 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:51randomnamehereMore than one credit card seems to be crazy,... and have short time dept too
16:51uvtcBlistering barnacles!
16:51uvtc(as clojars puts it)
16:52ibdknoxpeople in the US tend to have far more than one lol
16:52randomnamehereand it is normal not to be free of dept? :)
16:53RaynesI don't have any. :D
16:53ibdknoxa bit more than 70% of all American revolve debt on a monthly basis
16:53gfredericks$google don't buy stuff you cannot afford
16:53lazybot[Hulu - Saturday Night Live: Don't Buy Stuff] http://www.hulu.com/watch/1389/saturday-night-live-dont-buy-stuff
16:53RaynesI just charge merch to my ibdknox card.
16:54jondot1wondering if anyone using more traditional template engines with compojure (along the lines of erb/ruby)
16:55ibdknoxjondot1: http://github.com/weavejester/comb
16:55Raynes$google clojure comb weavejester
16:55lazybot[weavejester/comb - GitHub] https://github.com/weavejester/comb
16:55Raynesibdknox: Shut up.
16:55TimMcrandomnamehere: "debt"
16:55ibdknoxsuch a wonderfully simple solution too
16:55ibdknoxI love seeing stuff like that
16:55metajackjondot1: i have an implementation of Django's template langauge (also very similar to Ruby Liquid) that i'm about to release
16:56jondot1thanks
16:56metajackThere is also Fleet
16:56ibdknoxfleet is scary
16:56jondot1now i wonder again - any templating meta-engine such as ruby/tilt to abstract away the detail (caching etc) ?
16:58metajackibdknox: that's one of the reasons I decide to port DTL
16:58randomnameherestencil seems to take care of caching and so on,... will to first experiments this night
16:59ibdknoxjondot1: comb caches the parse template into a function, in other words, it will be as fast as string concatenation
16:59ibdknoxand whatever logic you put into the template itself
16:59ibdknoxmetajack: yeah, comb is the sane implementation of fleet
17:01jondot1so i'm a bit confused, many examples show the markup / template code in the clojure code itself
17:01jondot1i'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:01jondot1disclosure: i'm kinda making a mental bridge from ruby
17:10Raynesjondot1: Best to not expect things.
17:10Raynes;)
17:10RaynesYou'll be less surprised if you expect to be su… oh wait, here we are expecting things again.
17:11gfredericksit's okay cuz it's a meta-expectation
17:14tylergilliesim 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:14brehaut,(class java.net.URL)
17:14clojurebotjava.lang.Class
17:15brehauttylergillies: the simpliest way to create a class is probably with defprotocol though
17:15brehautbut without know what that method is doing with the class
17:16brehautits pretty hard to say what the correct thing to do is
17:16tylergilliesbrehaut: http://wiki.msgpack.org/display/MSGPACK/QuickStart+for+Java+%280.5.0-devel%29#QuickStartforJava%280.5.0-devel%29-Firstserverprogram
17:17brehauttylergillies: sorry thats really long, where is the method wanting a class?
17:18tylergilliesbrehaut: 'svr.serve(new ServerApp());'
17:18brehauttylergillies: thats an object being passed to svr.serve, not a class
17:19gfredericksis there a clojure lib that will convert a number to words?
17:19brehauttylergillies: you can tell by the presence of the 'new' keyword
17:19tylergilliesbrehaut: ah, i guess my real question is how do i create that object in clojure to look like it wants it to look?
17:19brehauttylergillies: i dont know what its doing there, but i would suggest investigating reify
17:20tylergilliesbrehaut: thanks
17:20xeqitry proxy
17:21brehaut,(.foo (reify Object (foo [this x] (inc x))) 1)
17:21tylergilliesxeqi: ok thnx
17:21clojurebot#<CompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: foo, compiling:(NO_SOURCE_PATH:0)>
17:21brehautxeqi: proxy is probably the wrong choice unless you need to to inherit from an abstract class or need the monkey patching
17:22tylergilliesim not inheriting a class
17:22tylergilliesi just need a class object to contain an arbitrary method
17:22tylergilliesnot sure of the correct nomenclature, not a java guy
17:23brehauttylergillies: you need an object, or an instance,
17:23brehauti think you might need to define an interface or protocol as well as the reify?
17:23brehauttylergillies: id hazard a guess that that app (being an RPC system) is using reflection to find the methods
17:23raektylergillies: what type does the argument to svr.serve(...) have?
17:24weavejesterDoes anyone know if there's a way for Leiningen to update a SNAPSHOT dependency?
17:24tylergilliesbrehaut: https://refheap.com/paste/1031
17:25gtrak``weavejester, i think it checks periodically, otherwise you might want the checkouts feature?
17:25raekweavejester: you want it to check for a new version of a dependency?
17:25raekif so, then "lein deps" should be enough
17:25weavejesterraek: Hmm...
17:25weavejesterraek: Nope
17:26xeqilein is set to check for updates daily
17:26gtrak``weavejester, perhaps delete your local SNAPSHOT version from ~/.m2?
17:26weavejesterIf I wipe out the SNAPSHOT in my .m2 folder, it works.
17:26raek...at least I thought so
17:26weavejesterI just wondered if there was a command or something for it.
17:27tylergilliesthink i might need gen-class
17:27tylergillies'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:27raekdid you push the snapshot version just to use it yourself immediately after?
17:27brehauttylergillies: i think genclass is probably overkill
17:27weavejesterraek: Pretty much
17:27tylergilliesbrehaut: ok
17:27RaynesEvery 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:28weavejesterraek: Would you suggest a local dep or something?
17:28brehauttylergillies: have a look at defprotocol and reify
17:28tylergilliesbrehaut: ok thnx
17:28raekweavejester: have you tried the "checkouts" feature?
17:28weavejesterraek: Nope. Let me look it up.
17:28brehauttylergillies: a protocol will create an interface, and you can then reify that as needed
17:28raekweavejester: "lein install" should work too, I think
17:29raekit will add the artifact directly to your .m2 repo
17:29weavejesterAh, the checkouts thing seems just what I need
17:29weavejesterraek: Thanks!
17:30raeknp :)
17:32randomnameherejava.lang.IllegalArgumentException: No implementation of method: :render of protocol: #'stencil.ast/ASTNode found for class: nil
17:32randomnameherehmpf
17:37randomnamehereOkay, the problem: template not found
17:37randomnamehereNow: Exception: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojurestack.core.todo <<< use gen-class ?
17:39randomnamehereI am using: (defrecord todo [task open created])
17:42sritchierandomnamehere: you might need to import it into the namesapce
17:42sritchiewhere you're using it
17:45mdeboardAnyone in San Jose airport for Clojure/West?
18:02gtrakwhat's the current state of the art for db schemas?
18:03gtraklobos I guess?
18:03randomnamehereI tried that: http://dbostwick.posterous.com/using-clojures-deftype-and-defrecord-and-name
18:04randomnameherebut does not work, I'll "lein clean"
18:11lnostdalwhy doesn't get do basic run-time type checking? (get 42 42) => nil
18:24gtraklnostdal, get's null-safe
18:24gtrak,(get nil nil)
18:24clojurebotnil
18:24gtraklike most things in clojure
18:25gtrak,(if nil true false)
18:25clojurebotfalse
18:25lnostdalhm
18:26lnostdali'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:27lnostdalthere's nothing to look up and there never will be; it's just wrong
18:28gtrakis there some particular error that you're running into by passing 42 into your thing that expects a map? doesn't seem likely
18:28gtraki think it makes sense, if 42 were a map, if has no value at the 42 key :-)
18:29lnostdalnever mind
18:29junkieare there any java to clojure converters
18:30gtrakyou could run a decompiler on AOT-compiled clojure to get java I suppose, but not the other way
18:30amalloywell, there's you, junkie
18:31junkienot that i need one
18:33junkieamalloy: indeed
18:35junkieanyone jMonkey game-engining?
18:35foobar27I'm having problems cleaning up my hilbert code.
18:35foobar27If 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:36junkiewhat is hilbert code
18:37amalloythat's a compile-time setting, foobar27
18:37foobar27junkie: https://gist.github.com/2018486
18:37amalloya runtime binding has no effect
18:37junkiefoobar27: Thanks, but what is it?
18:37junkieIn laymans terms
18:39foobar27junkie: it draws a hilbert curve, mainly to do this http://corte.si/posts/visualisation/binvis/index.html
18:39amalloyyou 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:39amalloy$findfn 3 3 6
18:39lazybot[clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]
18:40foobar27amalloy: I used the unchecked-* functions before, and I am now cleaning them up, because I was told the code was unreadable :)
18:41amalloyfoobar27: i'd just macrolet them myself
18:42amalloy(or regular let, which has trivial runtime costs, but a macrolet is free at runtime)
18:43junkiefoobar27: i understand now
18:43junkiefoobar27: fractals
18:43junkiecool
18:45amalloyadd org.clojure/tools.macro as a dependency, and then (clojure.tools.macro/symbol-macrolet [+ unchecked-add, ...] (defn foo [] (... (+ 1 2))))
18:47randomnamehereHow can I construct something like: https://refheap.com/paste/1034
18:49gfredericksrandomnamehere: is there some particular reason you need the records to be vanilla maps?
18:49gfredericksare you printing them out?
18:50randomnamehereyes, stencil
18:50randomnamehereI wanna feed stencil with it
18:50gfredericksand that doesn't work with records?
18:51gfredericksrecords are perfectly good maps 99% of the time I think
18:52randomnameherehow to embed it as an item in a map?
18:52amalloy(fn [todos] {:todo todos})...
18:53gfredericks^ like that
18:53gfredericksamalloy: (partial hash-map :todo)
18:53ferdGurus: I need to compare two data-structures including the metadata declared for some elements. Is there a simple way of doing it?
18:54gfredericksferd: "compare" == "check equality"?
18:54ferdI'm unit-testing a macro... and I want to compare the output of macroexpand-1 with the expected expansion
18:54randomnamehereworks, thx!
18:55foobar27amalloy: thanks, let is too slow for my case. And with macrolet, I can even clean up my code more :)
18:55gfredericksferd: 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:55gfredericksif you need nested metadata you could probably work something up with clojure.walk
18:56gfredericksthere is probably some more clever way I'm not thinking of though...
18:56amalloyno, clojure.walk is what i'd do too
18:56ferdgfredericks: thanks... I'll keep digging
18:56gfredericksI'd be curious if it can be done as a one-liner
18:57gfredericksscratch the subjunctive -- I _am_ curious.
18:58amalloygfredericks: one uncomfortably-long line, two normal-sized lines, i suspect
19:00amalloy&(require 'clojure.walk)
19:00lazybot⇒ nil
19:00amalloy&(clojure.walk/postwalk (juxt identity meta) {:a 1, :b (-> '(f x) (with-meta {:m 1}))})
19:00lazybot⇒ [{[[:a nil] [1 nil]] nil, [[:b nil] [([f nil] [x nil]) nil]] nil} nil]
19:01gfrederickshrm
19:01amalloyhm, why doesn't that work?
19:02gfredericksmaybe it only ends up checking the meta of the output vector most of the time?
19:03gfredericksalso odd that it ended up moving {k1 v1 k2 v2} to {[k1 v1] nil [k2 v2] nil}
19:03gfredericksthough that shouldn't break it I don't think
19:03amalloy&(clojure.walk/postwalk (juxt identity meta) (with-meta [1] {:m 1}))
19:03lazybot⇒ [[[1 nil]] nil]
19:04amalloyoh
19:04amalloywalk is dumping everything into a new vector before it calls the walk function, and the metadata gest lost
19:05gfredericksso we need a meta-sensitive walk?
19:05amalloywell, we don't need nearly as many features as walk has, right? you could coerce everything to a seq
19:05gfredericksdat true
19:05amalloyi guess maybe that messes up map ordering, but in practice it may not matter
19:08amalloyamusingly, i think walk could be made meta-aware just by removing the first three clauses of its cond
19:10stirfooIs there any difference in the behavior of #^ and ^ that I'm missing?
19:10amalloystirfoo: don't think so
19:11ferdstirfoo: I think #^ is the "old" way
19:11stirfoook, the reader calls the same fn, but I didn't know if I was missing some black magic somewhere along the line.
19:12ferdstirfoo: "in Clojure 1.2, introduces reader metadata (in 1.1 you'd use #^ , which still works, but is deprecated in 1.2)"
19:12stirfoothanks ferd
19:12gfrederickswhy would it call it "reader metadata"? is that phrase not appropriate for #^ for some reason I'm missing?
19:13ferdstirfoo: found it quickly thanks to http://symbolhound.com
19:14randomnamehereAny Idea how to reuse the connection if it already exists: https://github.com/kremers/Clojure-Memcached-Connector/blob/master/src/clojurestack/memcache.clj ?
19:14arohner_gfredericks: it's metadata attached to objects at read time
19:14gfredericksarohner_: when is #^ metadata attached to objects?
19:14arohner_gfredericks: at read time
19:14gfredericksokay, I think I misread the sentence fragment
19:15arohner_as opposed to (with-meta {} {:foo :bar}), which attaches at runtime
19:15gfredericksI read it as "^ introduces reader-metadata as opposed to #^ which does something different"
19:15arohnerah, no. They're the same
19:17ferd&((juxt identity meta) (tree-seq seq? identity '(with-meta [1] {:m 1})))
19:17lazybot⇒ [((with-meta [1] {:m 1}) with-meta [1] {:m 1}) nil]
19:17stirfoonice link ferd, that's definitely a bookmark
19:18ferd((juxt identity meta) (tree-seq seq? identity (with-meta [1] {:m 1})))
19:18ferd&((juxt identity meta) (tree-seq seq? identity '(with-meta [1] {:m 1})))
19:18lazybot⇒ [((with-meta [1] {:m 1}) with-meta [1] {:m 1}) nil]
19:18ferd&((juxt identity meta) (tree-seq seq? identity (with-meta [1] {:m 1})))
19:18lazybot⇒ [([1]) nil]
19:22Frozenlo`Is there any libraries similar to vijual, but able to export in svg or pdf?
19:23georgekhi, 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:23georgekFileNotFoundException Could not locate great_mystery/tools__init.class or great_mystery/tools.clj on classpath: clojure.lang.RT.load (RT.java:430)
19:23georgekmy project name is great-mystery; does anyone have a clue where I'm getting the configuration wrong?
19:32tylergilliesis there a function to list the methods on an instance of a class?
19:33randomnameheren8
19:35scottjtylergillies: slime? C-c I
19:35tylergilliesscottj: thnx
19:42gtrakhmm... what's the standard way to handle a vector form input?
19:42gtrakin html I mean
19:42hiredman~logs
19:42clojurebotlogs is http://clojure-log.n01se.net/
19:52aperiodici'm unable to get clojars to accept my ssh key
19:52aperiodici'm sure that the public key in the field is correct
19:57aperiodici'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:07aperiodicwhat kind of key are you using?
20:08gfredericksrsa?
20:09aperiodicwhat length, and is there a password?
20:09gfredericksyes password; not sure about length
20:09gfrederickswc on the private key outputs 30 37 1766 if that tells you anything
20:12aperiodicit's 2048 bits long, then
20:13gfrederickswoah; I didn't know that vector vs list was significant within (ns)
20:22gtrakdoes 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:36SomelauwFor clojure, am I better of with an ide like eclipse or emacs?
20:38gfredericksthat question sounds complicated. An easier question is "what is more popular", and I'm pretty sure that's emacs. at least around here.
20:39justicefriesthat's a question I'm struggling to answer as a vim user, as well.
20:39justicefriesemacs feels like the way to go.
20:39SomelauwYeah, it is that ide's offer a lot of inspection and such, but I noticed that emacs is more popular as well.
20:39justicefriesthe idea of being in insert mode all the time is strange to me.
20:40SomelauwScala programmers all seem to use ide's on the other hand.
20:40gfredericksjusticefries: I found the idea of arbitrary customization irresistible. And also org-mode is seriously the best thing that has ever happened to me.
20:40justicefriesthat's what I hear about org-mode.
20:41gfredericksSomelauw: 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:41justicefriesand the fact that I'm getting mostly interested in Clojure, CLISP, Scheme, etc. from a programming language standpoint and straying from Ruby..
20:42gfredericksjusticefries: but what about all the parentheses!!
20:42justicefriesnever bothered me! :D
20:43gfredericks"lisp took a giant leap into the future when researchers discovered the upper and lower paren..."
20:44Somelauwjusticefries: Yeah, ide's probably work better on static languages.
20:45justicefriesMy big problem right now is I'm in a little bit of OS shock...I dropped OSX.
20:45gfredericksfor?
20:45clojurebotfor is not a loop
20:45gfredericksloop?
20:45clojurebotLOOP is complect complected
20:45gfrederickscomplected?
20:45clojurebotcomplected is not a loop
20:46gfrederickswell then.
20:46gfredericksso I was asking what you dropped OSX for
20:46gfrederickser, what you replaced it with
20:47Somelauwdo?
20:47gfredericksclojurebot: do |does| not
20:47clojurebotYou don't have to tell me twice.
20:47gfredericksdo?
20:47clojurebotdo does not
20:48gfredericksnot?
21:10aperiodici even created a new clojars account, and it still rejects my ssh key
21:11wmealingright location, right permissions ?
21:12aperiodic~/.ssh/id_rsa, 600
21:12clojurebotNo entiendo
21:12wmealingssh -v2 in, see if it says anything odd
21:12wmealing(this is just OS level troubleshooting for me, i dont know enough about clojar spefifically
21:13wmealingspecifically.
21:13amalloyaperiodic: make sure you're using clojars@clojars.org, not youruser@clojars.org
21:13aperiodici had clojars working fine before, then i changed my ssh key, and it hasn't worked since
21:14wmealinglocal permissions ?
21:14aperiodicamalloy: i am scping as the clojars user
21:15aperiodicwmealing: https://gist.github.com/2019134
21:15aperiodici don't know if any of that is "odd"
21:15aperiodicwmealing: the permissions on the private key are 600
21:18gfredericksaperiodic: I know technomancy was updating clojars recently
21:21aperiodicgfredericks: from the commit messages, it doesn't look like the scp stuff has been touched recently
21:22wmealingaperiodic, 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:22wmealinghow are you installing it remotely ?
21:22wmealingssh-copy-id ?
21:22aperiodicwmealing: pasting into the "ssh public key" field in my clojars.org profile
21:24aperiodiccan anyone else make a new clojars account and successfully push to it?
21:24wmealingi dont know enough to be useful in that regards.
21:25aperiodicyeah, this is specifically a clojars.org issue
21:25xeqiif clojars is rejecting it then its failing at https://github.com/ato/clojars-web/blob/master/src/clojars/web/user.clj#L39
21:25aperiodicxeqi: i can update it in the web interface just fine, though
21:35yoklovhow does evaluation order work in clojure?
21:35yoklovis it specified?
21:36gfredericksyou mean like associativity in 3 + 4 - 2 expressions?
21:36yoklovnot really, i mean in (foo (bar) (baz)) will (bar) be evaluated before (baz), or after
21:37gfredericksI'd expect before, but I don't know that I've ever seen that discussed
21:37brehautwith pure functions it shouldnt really matter either
21:37gfredericksprobably if you're counting on it being something you're doing something wrong
21:37yoklovit seems to be before but that could just be my test.
21:37yoklovright, i'm aware it's a bad idea to count on it
21:38gfredericksthat would seem to be the most natural way to compile it
21:39yoklovit's intentionally unspecified in scheme, and i was curious if that was the same in clojure (i would have assumed not)
21:40gfredericks,((constantly nil) (print "foo") (print "bar") (print "baz"))
21:40clojurebotfoobarbaz
21:41gfredericks,(apply (constantly nil) (for [x (range 20)] (print x)))
21:41clojurebot012345678910111213141516171819
21:41yoklovaha: http://clojure.org/evaluation
21:41yoklovleft to right.
21:42gfredericks,(apply (constantly nil) (for [x (take 20 (iterate inc 1))] (print x)))
21:42clojurebot12
21:42gfrederickshaha; that's cool
21:44yoklovbrehaut is right though, the fact that this function isn't pure is the larger problem here :/
21:49yoklovi 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:19uvtcInteresting. 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:20uvtcaperiodic, did you get your issue resolved?
22:21uvtcDoes this channel offer a way to queue a message for a particular user when they're not online?
22:26johnmn3anyone have much experience with seesaw?
22:26johnmn3I can't get some inner containers to be scrollable
22:27johnmn3listbox seems to work, but not (text) or vertical-panel or flow-panel
22:27johnmn3running out of ideas
22:27johnmn3uvtc: never heard of that
22:27johnmn3though it'd probably be a useful function for a bot
22:29johnmn3Give 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:29uvtcjohnmn3, 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:30amalloyuvtc: lazybot will do that
22:30uvtclazybot, help
22:30lazybotYou're going to need to tell me what you want help with.
22:30johnmn3lazybot: tell uvtc I said hy
22:30uvtchi
22:30amalloy$mail uvtc here's a message for later
22:30lazybotMessage saved.
22:30uvtcfoo
22:30johnmn3hah
22:31uvtcOh, neat. Thanks, amalloy.
22:31johnmn3immentently useful buggers
22:31uvtc$mail johnmn3 a message, just for you
22:31lazybotMessage saved.
22:32uvtcjohnmn3, did that work?
22:32johnmn3how do I get my mail?
22:32johnmn3nevermind
22:32uvtcI'm using xchat, and a new heading appeared on the left (under #clojure) named "lazybot".
22:32johnmn3lazybot messaged me
22:33johnmn3worked
22:33uvtcNice.
22:36uvtc$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:36lazybotMessage saved.
22:45yoklovso, there's probably no real answer for this, but: how many assertations should my tests have?
22:46Licenseryoklov enough but not too many
22:47yoklovwell, at what point should i consider breaking a single test into multiple tests
22:47yoklovor should i just not think about it like that
22:47justicefriesas many assertions as it took to test drive your code.
22:47justicefriesor test drive that particular feature.
22:50yoklovblergh, alright, i think i probably have a lot of redundant tests.
23:00justicefrieslinux users: emacs from the command line, or in its own window?
23:01johnmn3wouldn't this be cool with clojure/clojurescript? http://www.ymacs.org/demo/
23:03george`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:04amalloya source file had unbalanced parens
23:04george`thanks
23:05franks42Is 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:06uvtcIs anyone else having trouble pushing to clojars tonight? It's telling me "Permission denied (publickey)."
23:07uvtc(That is, just using the scp command.)
23:09george`uvtc, is it related to https://groups.google.com/group/clojure/browse_thread/thread/5e0d48d2b82df39b
23:12uvtcgeorge`, Thanks. I should've checked for recent messages on the group.
23:14amalloythat's not related at all, or shouldn't be
23:14uvtcgeorge`, Not sure what's necessary to re-hash my password. Tried logging out then logging in again. Still no luck scp'ing though.
23:14xeqiwhen you logged in it would do it
23:15uvtcOne 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:23technomancynothing has changed with scp uploads recently; the changes have just been about the web UI passwords
23:23uvtctechnomancy, Thanks. This is for a new account I just created today.
23:24uvtc(not sure if that matters, but thought I'd mention it)
23:24uvtctechnomancy, 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:26technomancyuvtc: the only check done on the key is that it matches #"(ssh-\w+ \S+|\d+ \d+ \D+).*\s*"
23:28xeqitechnomancy: aperiodic mentioned being unable to scp earlier as well
23:31george`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:31uvtctechnomancy, 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:31danlarkingeorge`: M-x check-parens
23:34uvtctechnomancy, Thanks for finding that regex for me. Is it an "extended" regex (like Perl's /x)?
23:34technomancyuvtc: it's just a clojure regex
23:34technomancyI don't know anything about per
23:34technomancyl
23:35uvtctechnomancy, I ask because it has a lot of spaces in it, but my public has only 2.
23:36uvtc"my public" --> "my public key"
23:36antares_uvtc: mine has two spaces as well but I've just published a new snapshot artifact to clojars just fine
23:37technomancyjust check it in the repl
23:38uvtcOh, the regex. Will try to find out how to do that.
23:40antares_uvtc: (re-find #"abc\s\d+" "abc 1")
23:40uvtcantares_, thanks. Was just reading the docs on that at clojuredocs. :)
23:41wmealingtechnomancy, got a moment for a question about swank ?
23:41technomancyI have a moment, but whether I have an answer ... I can't say.
23:41technomancygo for it
23:42wmealingtechnomancy, can you use it to connect to an android project ?
23:42technomancyI think that should be feasible, yeah
23:43wmealingok, so i'm not going mad, thanks.
23:45george`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:45uvtctechnomancy, trying `(re-find ...)`, the result is: ["ssh-rsa AAAAB3NzaC1y...wgYQ== myemail@address" "ssh-rsa AAAAB3NzaC1y...wgYQ=="]
23:45antares_uvtc: that's a match
23:46uvtctechnomancy, the 2nd one there doesn't have my email address as part of it.
23:46technomancyit sounds like that wasn't why your key was rejected then
23:48uvtcThe command was: `(re-find #"(ssh-\w+ \S+|\d+ \d+ \D+).*\s*" "ssh-rsa AAAAB3NzaC1yc...wgYQ== myemail@address.com")`. Ok. Thanks.
23:49antares_uvtc: you can add an ~/.ssh/config entry that will instruct ssh client and scp to use a specific key for clojars.org
23:49uvtcI'm running the scp command from inside my project dir. It is:
23:49uvtcscp pom.xml trivial-library-example-0.1.0.jar clojars@clojars.org:
23:50uvtcantares_, Hm. I currently have no ~/.ssh/config file.
23:50george`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:51uvtcantares_, I'm on Ubuntu GNU/Linux, and have a global one: /etc/ssh/ssh_config.
23:52uvtcantares_, have never made any changes to it though.
23:52antares_uvtc: try this. Touch ~/.ssh/config && chmod 600 ~/.ssh/config
23:52antares_uvtc: then paste this into it: https://gist.github.com/66c9e34ac08f117fb2a8
23:52antares_uvtc: editing the key path, obviously
23:53antares_uvtc: then try one more time
23:53johnmn3Does anyone know where to find documentation on seesaw's cell-renderer function?
23:55johnmn3nevermind
23:55uvtcantares_, No dice, but thank you very much. BTW, that should be id_rsa, not id_rsa.pub, correct?
23:55uvtcantares_, I get the same error as before.
23:56johnmn3(source seesaw.cells/to-cell-renderer) worked
23:56uvtcantares_, nvm; you wrote "private key", so yeah, id_rsa, not id_rsa.pub.
23:56antares_uvtc: yes