#clojure log - Mar 08 2012

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

0:00 technomancy: oh that's right; what you want is filter-indexed, but for some reason it doesn't exist

0:00 tmciver: ,(apply + (take-nth 2 '(1 2 51 44 66 77)))

0:00 clojurebot: 118

0:00 technomancy: good man

0:01 tmciver: thanks. I'm gettin' there.

0:01 dreampeppers99: great!

0:01 and for even elements

0:01 the take-nth won't work

0:02 (apply + (take-nth 2 (rest '(1 2 51 44 66 77))))

0:02 tmciver: yup

0:02 dreampeppers99: ,(apply + (take-nth 2 (rest '(1 2 51 44 66 77))))

0:02 clojurebot: 123

0:02 dreampeppers99: ,(apply + (take-nth 2 (rest '(1 2 3))))

0:02 clojurebot: 2

0:02 dreampeppers99: ,(apply + (take-nth 2 ('(1 2 3))))

0:02 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>

0:02 dreampeppers99: ,(apply + (take-nth 2 '(1 2 3)))

0:02 clojurebot: 4

0:02 dreampeppers99: perfect :D

0:05 why can't I apply the reduce function instead of + ?

0:05 ,(apply + (take-nth 2 '(1 2 51 44 66 77)))

0:05 clojurebot: 118

0:05 dreampeppers99: ,(reduce + (take-nth 2 '(1 2 51 44 66 77)))

0:05 clojurebot: 118

0:05 dreampeppers99: ,(reduce + (take-nth 2 '(1 2 51)))

0:05 clojurebot: 52

0:05 dreampeppers99: ,(apply + (take-nth 2 '(1 2 51)))

0:05 clojurebot: 52

0:05 dreampeppers99: ,(apply + (take-nth 2 '(1 2)))

0:05 clojurebot: 1

0:05 dreampeppers99: ,(reduce + (take-nth 2 '(1 2)))

0:05 clojurebot: 1

0:06 dreampeppers99: nevermind silliest of mine

0:06 once again thank you guys!

0:06 :D

0:07 Lajla: Why can he dod that and not I?

0:07 technomancy: Did You Know™: it is actually possible to communicate with clojurebot via private /msg calls?

0:07 dreampeppers99: sorry for that!

0:07 I didn't know, my mistake.

0:07 Lajla: dreampeppers99, do not let them take away your freedom

0:07 technomancy: no worries; not much going on in here anyway

0:07 Lajla: your faith

0:08 ibdknox: technomancy: what's the fun in that

0:08 Lajla: your freedom to love, your freedom to hate, your freedom to worship His Divine Shadow

0:08 ibdknox: technomancy: last time I did it, clojurebot was getting inappropriate

0:08 tmciver: lol

0:08 dreampeppers99: is this the "official" irc channel for clojure?

0:08 ibdknox: yes

0:09 tmciver: ibdknox: tell him he has to take you out to dinner first.

0:09 technomancy: ibdknox: "get a room you two"?

0:09 ibdknox: haha

0:09 tmciver: I did, but then he was trying to guilt me saying he's never been outside of #clojure

0:10 tmciver: ibdknox: don't you fall for his tricks; you'll regret it in the morning (I know I did)

0:10 ibdknox: lol

0:10 tricksy little hobbitses, that one

0:11 tmciver: what's it doing?!

0:12 ibdknox: can one of you guys manufacture some more time for me?

0:13 technomancy: to the tardis!

0:13 Null-A: ibdknox: sure, don't sleep tonight.

0:14 dreampeppers99: just for the record I was trying to solve the Peasant Multiplication using Clojure. Since I'm a newbie for Clojure my solution is very poor coded. But, anyway thanks for your helping.

0:14 ibdknox: haha. Touche.

0:14 Null-A: that's what separates from clojure hackers from the boys

0:15 ibdknox: that's what I wanna be when I grow up :D

0:16 Null-A: you will one day young grasshopper

0:16 Iceland_jack: ·

0:24 amalloy: technomancy: filter-indexed strikes me as annoyingly specialized (same with keep-indexed fwiw): don't clutter the stdlib with combinations of existing functions. i'd prefer to see mapcat-indexed added, and from that you can easily derive map-indexed, filter-indexed, keep-indexed, whatever you need for your actual problem

0:24 technomancy: or just ... indexed?

0:25 amalloy: i suppose. that was removed because it leads to a lot more consing, so i was assuming we keep it out

0:27 technomancy: I'd vote for keep the most general and the most efficient

0:28 ibdknox: what's this?

0:28 technomancy: ibdknox: indexed from contrib got promoted into a bunch of core functions: map-indexed, keep-indexed, and maybe another one?

0:29 ibdknox: ah

0:29 amalloy: i can't think of any others

0:29 technomancy: which is annoying because they're complected, but apparently composing map and indexed is "too slow"

0:29 so you're on your own if you want filter-indexed

0:30 you have to do something dumb like (filter f (map-indexed vector coll))

0:42 rlb: I'd like to partition a collection on boundaries defined by a predicate. i.e.:

0:42 (partition-foo #(re-matches "id:.*" %1) ["id: 1" "a" "b" "id: 2" "x"])

0:42 => [["id: 1" "a" "b"] ["id: 2" "x"]]

0:42 Is there already something like that?

0:42 Iceland_jack: separate?

0:42 clojurebot: separate is in clojure.contrib.seq-utils, but just use (juxt filter remove) instead

0:43 sritchie: partition-by?

0:43 hmm, not quite

0:43 ,(partition-by #(re-matches #"id:.*" %1) ["id: 1" "a" "b" "id: 2" "x"])

0:43 clojurebot: (("id: 1") ("a" "b") ("id: 2") ("x"))

0:44 rlb: I want the "id: .." line to be part of the group.

0:45 amalloy: (useful.seq/partition-between (fn [[a b]] (re-matches #"^id:.*" b)) coll), roughly

0:46 https://github.com/flatland/useful/blob/develop/src/useful/seq.clj

0:46 rlb: amalloy: exactly -- thanks.

0:54 gtuckerkellogg: ,(def foo "foo")

0:54 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

0:54 gtuckerkellogg: ,(java.util.regex.Pattern/compile (def foo "foo")

0:54 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

0:54 gtuckerkellogg: ,(java.util.regex.Pattern/compile "foo")

0:54 clojurebot: #"foo"

0:55 gtuckerkellogg: is that the best (only) way to create a regex from a string in Clojure? (supposing (def foo "foo")

0:56 amalloy: hm, it occurs to me there ought to be a cleverer way to implement partition-between, reusing pieces of the input sequence as the args to the split? function

0:56 Raynes: amalloy: It occurs to me that a lot occurs to you.

0:57 amalloy: i'm the occurrence nexus of the country

0:57 Raynes: Have you ever considered seeing if anything occurs to a doctor about how much occurs to you? Perhaps there is a medication for it.

1:04 Null-A: gtuckerkellogg: ,(re-pattern "foo")

1:04 ,(re-pattern "foo")

1:04 clojurebot: #"foo"

1:08 gtuckerkellogg: thanks

1:34 johnmn3: What layout manager is most recommended to use with seesaw?

2:25 gf3: has anyone experience issues with validations in noir 1.2.2?

2:26 I get the following when I try to use validation/rule or validation/errors? →

2:26 ClassCastException clojure.lang.Var$Unbound cannot be cast to clojure.lang.IDeref clojure.core/deref (core.clj:2078)

2:26 with any kind of input

2:29 example → http://cloud.gf3.ca/EqcH

2:44 _ulises: morning all

2:53 seancorfield: if i have some-lib-1.4.2.jar and some-lib-1.4.3.jar on my classpath, is there some mechanism that chooses which one to load? (this question came up in another non-clojure context and after googling i'm not sure what the definitive answer is)

2:54 raek: I think that load-file will search the jars for the file in the order they appear on the classpath

2:54 which can be really bad

2:56 1.4.2 has foo, which uses bar and 1.4.3 has only bar, then if you have them ordered as 1.4.3, 1.4.2 on the classpath and try to load foo, version 1.4.2 of foo will load and cause version 1.4.3 of bar to load

3:00 osa1: can anyone verify that this code works on clojure 1.3 https://github.com/clojure/clojure-contrib/blob/b8d2743d3a89e13fc9deb2844ca2167b34aaa9b6/src/main/clojure/clojure/contrib/zip_filter/xml.clj#L88 ?

3:01 or is there a newer version of this?

3:04 zamaterian: osa1, read http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

3:09 osa1: zamaterian: ok, this doesn't work either https://github.com/clojure/data.zip/blob/master/src/test/clojure/clojure/data/zip/xml_test.clj

3:11 georgek: hi, I'm getting started with cljs and cljs/one, sometimes I kill the cljs/one repl for whatever reason, but if I want to restart the repl I get "BindException Address already in use: JVM_Bind java.net.PlainSocketImpl.socketBind", what's the right way to restart?

3:11 zamaterian: osa1, I have a project where i'm using zip xml from [org.clojure/data.zip "0.1.0"] together with clojure 1.3

3:13 osa1: zamaterian: is it on github? I could have a look

3:14 zamaterian: seancorfield, if you have one or mere lib with conficts in version in the same classpath you could use -Xbootclasspath with suns java bin

3:16 osa1, its in a private repository... 2 sek I will cut the relevant parts out into a gist

3:25 osa1, https://gist.github.com/1999613

3:28 osa1: zamaterian: great, thanks

3:47 does anyone know a function to build get data url for http from a map or vector?

3:50 whatever, I've just wrote one

3:53 zamaterian: osa1, (map slurp ["http://github.com" "http://slashdot.org/&quot;]) :-)

3:57 osa1: zamaterian: sorry for my english. what I meant was, I need to generate URL's for from maps, for example {1 2 3 "a b"} should return me 1=2&3=a+b etc.

4:28 gtuckerkellogg: what's the easiest way to keep the non-nil members of a list?

4:29 lucian: ,(filter (complement nil?) [1 2 3 nil 4 5 nil])

4:29 clojurebot: (1 2 3 4 5)

4:30 gtuckerkellogg: is that considered idiomatic?

4:30 how about

4:30 lucian: i don't really know, tbh. but it works

4:30 tomoj: (keep identity coll) ?

4:31 and/or (filter identity coll)?

4:31 gtuckerkellogg: ,(filter (fn [x] x) (1 2 3 nil 4 5))

4:31 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

4:31 gtuckerkellogg: ,(filter (fn [x] x) '(1 2 3 nil 4 5 ))

4:31 clojurebot: (1 2 3 4 5)

4:32 gtuckerkellogg: although that's not exactly what I asked is it

4:32 hmm

4:32 tomoj: I sometimes imagine that keep has a one-arg version that is (keep identity coll)

4:32 amalloy: (remove nil? xs)

4:32 lucian: why bother with a fn? tomoj suggested identity

4:32 tomoj: oh, right

4:32 if you really want "non-nil"..

4:32 gtuckerkellogg: ok, thanks

4:32 tomoj: (remove nil? coll)

4:34 hmm is xs in fashion or is it just you amalloy

4:35 lucian: tomoj: i've seen it a lot in haskell and ml, like x::xs

4:35 amalloy: *shrug* a list where each element is x, is xs

4:35 tomoj: right

4:35 lucian: "a bunch of x -s" is what it sounds like to me

4:35 amalloy: coll is probably a better answer to this particular question, but i certainly didn't care

4:36 tomoj: I often want to use that style but feel like it's not clojure idiom

4:37 but would probably use it more if I saw it more..

4:39 gf3: hey guys, why would noir *not* use atoms here? https://github.com/ibdknox/noir/blob/1.3/src/noir/session.clj#L13

4:39 clgv: tomoj: 'coll is very descriptive as well^^

4:40 zamaterian: gf3, look at line 83

4:40 s/83/82

4:40 clgv: gf3: because this way you can have multiple request with different sessions at the same time in different threads - that wont be possible with an atom

4:41 gf3: clgv: ahh, makes sense

4:42 clgv: I'm running into issues where I try to access the session and it is unbound

4:42 which is why I asked

4:42 clgv: gf3: then you probably forgot to add a "middleware statement" like wrap-session or something similar

4:43 gf3: this one: https://github.com/ibdknox/noir/blob/1.3/src/noir/session.clj#L55

4:47 gf3: clgv: I don't think I am, hmm

4:47 clgv: it doesn't always fail, just sometimes

4:48 clgv: gf3: if that ring middleware wrap-noir-sessions is registered correctly and you are only accessing it from requests that should be fine

4:49 gf3: if you are in clojure 1.2(.1) then there might be an issue if you access it from a different thread than the request thread

4:49 gf3: clgv: it seems to fail when accessed from a model inside a partial

4:49 page → partial → partial → model

4:53 osa1: I have a map with names for keys and integers for values, how can I sort it's values?

4:55 gf3: osa1: (sort (vals your-map))

4:55 osa1: gf3: I also need keys of this vals after sorting :)

4:57 (sort #(compare (nth %1 1) (nth %2 1)) map)

4:57 gf3: osa1: (sort #(compare (last %1) (last %2)) your-map)

4:59 y3di: hey guys, im starting out with clooj. I defined a (coin-toss) function but when I try to run it in the repl I get this error

4:59 compiling:(NO_SOURCE_PATH:1)

5:00 in full: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: coin-toss in this context, compiling:(NO_SOURCE_PATH:1)>

5:00 vijaykiran: y3di: did you (use 'yournamespace) in the repl ?

5:01 where yournamespace is where you defined your coin-toss

5:01 y3di: nope, thanks

5:02 so i tried this: (use 'gamble-core)

5:02 but i get a file not found exception

5:03 raek: y3di: what is the file path of the namespace? gamble/core.clj or gamble_core.clj?

5:03 y3di: this is what I have at the top of core.clj inside my 'gamble' folder: (ns gamble.core)

5:03 raek: y3di: then do a (use 'gamble.core) :-)

5:03 period in name = subdirectory in file system

5:04 hyphen in name = underscore in file path

5:04 y3di: ok, thanks alot, not sure why i used hyphen in the first place..

5:14 sorry for the newb questions but im getting the same error i was before when i try to run toss-score or t

5:14 https://gist.github.com/2000130

5:15 but (coin-toss) works fine

5:19 vijaykiran: you may need to reload the namespace after you added these functions

5:19 (use 'gamble.core :reload)

5:24 xkb: Hi

5:24 vijaykiran: y3di: ^^

5:24 xkb: Im working on some 4Clojure problems, and my alternative to map blows the heap. Any idea why? code is @ https://gist.github.com/2000178

5:24 vijaykiran: xkb: Hi

5:25 y3di: vijaykiran: thanks, I guess clooj doesn't auto reload on save

5:25 xkb: never mind the strange list/cons action, was trying out some alternative list creation forms

5:26 vijaykiran: btw - why pp is (def pp fn .. ) ? you can use (defn .. ) .. right ?

5:26 xkb: yes

5:26 but in 4clojure you need to answer inline

5:27 as an anoymous function I suppose

5:28 see http://www.4clojure.com/problem/118 for example

5:29 that's the one I'm working on now

5:29 pipeline: 4clojure is pretty awesome

5:30 but the "def is bad" thing drives me a little crazy since it means a bunch of copy/pasting

5:30 xkb: yep

5:30 my whole emacs scatch file is filled with def's for 4clojure :P

5:31 I did like most of the challenges

5:31 I think my solution for this one is not lazy

5:31 pipeline: of course copy/pasting only drives me crazy because some combinatino of my firefox version and the rich text js in 4clojure breaks paste from emacs

5:31 xkb: and that's why it blows

5:31 hehe

5:31 same here

5:31 so I work the other way around

5:31 pipeline: yeah I think that's how they test for laziness: huge sequences

5:31 xkb: from 4clojure past to emacs

5:32 paste*

5:32 reduce works on lazy seq's

5:32 so that can't be it

5:33 so that leaves the seq I'm building

5:34 vijaykiran: may be use lazy-cons ?

5:35 http://clojure.org/lazy

5:38 xkb: hmm good tip

5:38 let's see

5:43 hehe solved it

5:43 using lazy-seq

5:44 vijaykiran: yeah .. sorry lazy-seq not lazy-cons :)

6:03 y3di: why does 'its' break the convention of possession using apostrophes? Is there a particular reason for this?

6:06 loops: ok, have spent 2 hours trying to figure out how to use leiningen, ready to set my hair on fire :oP

6:07 it says you need to run v1 lein install in "leiningen-core subproject directory" where is that directory?

6:08 zamaterian: loops, leiningen is only for lein 2

6:08 loops: zam.. yeah.. i kinda answered my own question.. i just dont have a v1 to use for bootstrapping

6:08 zamaterian: loops, ups leiningen-core is only for lein 2

6:09 loops: so i was checking it out from git history, but of course that removes the v2 leiningen-core directory ;o)

6:10 bit of a catch-22, would be nice if old version wasn't needed for us noobs ;o)

6:13 just checked out v1 and renamed the script to lein1... and used it for bootstrap.. easy once ya grok the problem

6:14 thx zama

6:15 vijaykiran: y3di: I think the rule (or exception rather) is for all the possesive pronouns

6:17 y3di: yea i forgot that it was the same way for his, hers, whose, etc

6:44 randomnamehere: hi ;)

6:45 How can I yield functions for each entry in a list ?

6:45 ("x" "y" "z") << delete (x) delete (y) delete (z) ... ?

6:45 clgv: randomnamehere: example?

6:46 is (map delete '("x" "y" "z")) what you mean?

6:46 &(map inc [1 5 9])

6:46 lazybot: ⇒ (2 6 10)

6:47 randomnamehere: maybe reduce?

6:47 clgv: can you give input and epected output?

6:47 thorwil: map is lazy, isn't it?

6:47 clgv: yes

6:48 randomnamehere: input: ["people_9b59a761-f360-4e53-98b4-d2352b275a70" "people_a563d6e9-841b-4f2c-87c2-c7e697f9d104"]

6:48 output should be function calls to (.delete ... )

6:48 clgv: ah

6:48 (doseq [p people] (.delete p))

6:49 that will call 'delete on each 'p from the 'people collection

6:49 randomnamehere: Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for" << "for" =

6:49 clgv: for is lazy again^^

6:50 randomnamehere: I do not understand the documentation of that ;)

6:50 (doseq [p people] (.delete p)) << where is the "for" ?

6:50 raek: randomnamehere: doseq uses the same syntax as for

6:50 clgv: no for needed. you can use the same optional parameters as in 'for

6:50 (doseq [p people :when (.ugly p)] (.delete p)) ;)

6:51 raek: (for [p people] (.delete p)) yields a lazy sequence of the return values of the .delete calls

6:51 randomnamehere: is it also possible to use: (reduce (.delete p) [p people]) ?

6:51 raek: doseq is similar, but does not create a sequence and is not lazy

6:52 randomnamehere: you cannot call reduce like that

6:52 clgv: randomnamehere: if you dont want to return a value 'reduce is wrong.

6:52 randomnamehere: what's your objection concerning 'doseq ?

6:52 randomnamehere: dosseq documentation: Does not retain the head of the sequence. Returns nil.

6:53 clgv: yep. it's intended for side effects and not returning anything

6:53 randomnamehere: none objection clgv , I only really try to understand what I do

6:53 clgv: randomnamehere: ok. doseq is more like a for-loop in c++ or java

6:53 randomnamehere: okay and if .delete returns futures which can tell if the delete happened i have to use some other things

6:54 raek: (doseq [p people] (.delete p)) expands into something like (loop [ps people] (when (seq ps) (.delete (first ps)) (recur (rest ps))))

6:54 clgv: randomnamehere: than you could use (doall (map #(.delete %) people)) where 'doall is needed to force deletion immediately

6:54 raek: randomnamehere: yes, if you care about the return values, use for or map

6:54 clgv: *then

6:54 randomnamehere: Ahh,... but it does not happen in parallel ;(

6:55 How can I feed a list in and do parallel .delete actions?

6:55 raek: randomnamehere: submit them to an ExecutionService

6:56 randomnamehere: you said that .delete returns a future. does that mean that the work of .delete is performed in another thread?

6:56 randomnamehere: is there no simple solution in clojure, like (doparallel [p people] (.delete p))

6:57 raek: well, there is pmap, which is like map but performs some of the calculation in parallel

6:57 randomnamehere: Ahh raek, you are right...

6:57 raek: but only a fixed number of them at the same time

6:58 randomnamehere: wow, nice. But it seem I do not need pmap cause the java library behind also creates threads

6:58 (doall (map #(.delete %) people)) << this is more kind of functional style, isn't it?

6:58 lucian: you could also use memfn, but it's not really a significant improvement

6:59 raek: if you want to block for all of them to return, you could do (doseq [f (map #(.delete %) people)] (.get f))

6:59 sorry

6:59 (doseq [f (doall (map #(.delete %) people))] (.get f))

6:59 randomnamehere: What does #( %) ?

7:00 % is each item?

7:00 raek: #(.delete %) is a short form for (fn [x] (.delete x))

7:00 you cannot write just ".delete" since java methods are not clojure functions

7:00 lucian: you could also do (map (memfn .delete) people)

7:00 raek: (memfn predates the #(...) shorthand syntax)

7:01 lucian: uh, without the dot. (memfn delete)

7:01 randomnamehere: but delete only tooks one value, not the whole keyset

7:01 lucian: of course, that's what map does

7:02 raek: you're right, i just found it more clear sometimes

7:03 randomnamehere: (doseq [p people :when (.ugly p)] (.delete p)) ;) << i like that one

7:03 raek: randomnamehere: in case you need to do the threading yourself sometime: http://blog.raek.se/2011/01/24/executors-in-clojure/

7:04 the last example is the most relevant

7:04 randomnamehere: (doseq [f (doall (map #(.delete %) people))] (.get f)) << this one?

7:04 raek: sorry, the last repl example in the blog post :-)

7:05 anyway, an explanation of (doseq [f (doall (map #(.delete %) people))] (.get f)):

7:05 randomnamehere: future-call ?

7:05 raek: first it uses map to create a lazy sequence iof (.delete p1) (.delete p2) (.delete p3)...

7:05 randomnamehere: no the one before that

7:06 randomnamehere: ahh ok

7:06 raek: then 'doall' is used to make sure all .delete calls have been forced

7:06 at this point all the .deletes are ticking in the background

7:06 then we iterate over all the futures they returned and wait for them to finish, one by one

7:07 using the doseq loop

7:07 randomnamehere: yeahh!

7:07 super-awesome

7:08 raek: assuming you have the java.util.concurrent.Future kind of futures

7:10 randomnamehere: "doseq should be a vector"

7:11 hmpf

7:13 raek: randomnamehere: did you mean "doseq requires a vector for its binding"?

7:13 randomnamehere: yes

7:13 java.lang.IllegalArgumentException: Parameter declaration doseq should be a vector

7:14 (doseq [f (doall (map #(.delete %) (cget bucket)))] (.get f))

7:14 mh

7:14 raek: the syntax of doseq requires you to first have a vector of name-expression pairs and then one or more body expressions

7:14 randomnamehere: isn't this the case?

7:14 [f ...] (body)

7:14 raek: yes

7:15 randomnamehere: So why doesn't clojure like it?

7:15 raek: randomnamehere: that line parses for me

7:15 does it look exactly like that in your code?

7:16 randomnamehere: (defn cremoveall "Removes all items from collection including the head node" (doseq [f (doall (map #(.delete %) (cget bucket)))] (.get f)))

7:16 ahh

7:17 missed [bucket]

7:17 raek: yeah

7:17 ah, now I see

7:17 you can have variadic defns like this: (defn foo ([] ...) ([x] ...) ([x y] ...))

7:18 and clojure tried to parse your (doseq ...) as a ([x y] ...)

7:18 ergo the "doseq should be a vector"

7:22 randomnamehere: (defn cdeleteall "Removes all items from collection including the head node" [bucket] (doseq [f (doall (map #(.delete (find-connection) %) (cget bucket)))] (.get f)))

7:22 now i need to append the value of bucket to the list returned by cget bucket

7:23 think conj will work

7:48 tutysara_: I am wanted to change the path to the lein executabe, I got this command from techomancy - (setq clojure-swank-command "/path-to-lein/lein jack-in %s"). I am putting this in the scratch bufffer and executing it (M-x eval-buffer). Is that the right way to do this?

7:48 *technomancy

7:49 lucian: i'm assuming you have your real path there

7:51 tutysara_: lucian : yes you are right, i am using this - (setq clojure-swank-command "/cygdrive/c/cygwin/home/Administrator/bin/lein jack-in %s")

7:51 lucian: you might want to put that in your ~/.emacs if you want it to happen when you open emacs

7:53 tutysara_: lucian : if i execute it from scratch buffer will it wont take effect immediately for that session, I am evaluating this command from scratch and the next thing I do is hit M-x clojure-jack-in and see if it works

7:54 lucian : if i execute it from scratch buffer will it wont take effect immediately for that session ?, I am evaluating this command from scratch and the next thing I do is hit M-x clojure-jack-in and see if it works

7:54 lucian: what you eval should take effect

7:56 tutysara_: lucian : any way i will try your suggestion, put that in .emacs and see if that works

7:59 lucian : same error buddy : (

7:59 lucian: what is the error?

8:06 tutysara_: start-process-shell-command: Spawning child process: invalid argument

8:17 gf3: ibdknox: am I wrong in thinking build-dirs should include (:src-dir opts)? https://github.com/ibdknox/noir-cljs/blob/master/src/noir/cljs/watcher.clj#L108

8:25 clgv: gf3: are you using noir with cljs? did you find a good guide for it?

8:25 gf3: clgv: I'm attempting to

8:26 clgv: gf3: will your project be on github?

8:26 gf3: clgv: and no, I haven't found a good guide, I am considering writing one

8:26 clgv: gf3: even better ^^

8:26 gf3: woo

8:27 randomnamehere: I want to remove a part from an entry in memcached...

8:27 clojurestack.memcache=> (with-mc db-nodes (cgetmap "people")) #<HashMap {people_621a0f2c-9376-4476-b23f-57f99ac9c0de="hanna-lena" , people_dfa7df94-39ef-45b7-9cf1-22d3311507bd="martin" }>

8:28 clgv: I have build a little webapp that renders incanter charts for some timeseries. the app could be a little more responsive via js...

8:28 randomnamehere: (defn cdeleteitem "Removes item from collection" [bucket item] (let [bucketcontents (cgetmap bucket)] )

8:28 how to find the item with (= ...) and get the key to remove?

8:30 clgv: randomnamehere: do you know it's key?

8:30 nachtalp: randomnamehere: try to use filter maybe?

8:30 gju: anyone else having problems installing swank-clojure via lein?

8:31 clgv: randomnamehere: if not you can treat the map as collection of key-value-pairs

8:31 randomnamehere: yes clgv this should work

8:35 filter + map

8:38 (filter #(= "martin" (val %)) (with-mc db-nodes (cgetmap "people")))

8:38 ()

8:38 mhh

9:18 gtuckerkellogg: So i have a big long vector, which I'd like to be able to modify in a concurrent fashion.

9:18 there's no coordination needed

9:18 but two thread should not modify the same element

9:19 as I undertand it (and I may not) my recommended option would be to creat this as a vector of atoms

9:20 clgv: gtuckerkellogg: the same element at the same time or the same element at all in the whole runtime?

9:20 gtuckerkellogg: i meean agents

9:20 the same element at the same time

9:21 it's a non-deterministic algorithm where threads can modify individual elements of the array

9:22 so if it's a vector of agents, individual threads can modify them asynchronously and without coordination, and no collisions can ever happen

9:22 clgv: gtuckerkellogg: hm then vector of atoms sounds about right, if concurrent modifiations of the array at different elements are allowed

9:22 gtuckerkellogg: yes, they are

9:23 they can be asynchronous, so it could be agents, right?

9:23 clgv: I dont understand the last question

9:24 gtuckerkellogg: why use atoms instead of agents?

9:26 that's what I was asking in the last question

9:27 chouser: gtuckerkellogg: you might consider a ConcurrentHashMap if performance is a goal. http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html

9:27 Not sure how well a map will work for you instead of a vector.

9:27 gtrak`: atoms are much lighter-weight, if it's not worth the overhead of an STM and task processing consider atoms

9:28 your vector will effectively be a vector of AtomicReferences

9:28 clgv: gtuckerkellogg: it's a question what you want. atoms are just coordinating access to a value. an agent has a value that is modified by jobs in its eventqueue

9:29 gtuckerkellogg: thats' a helpful way of putting i

9:29 it

9:29 randomnamehere: how can I exclude something from a list

9:29 ["people_621a0f2c-9376-4476-b23f-57f99ac9c0de" "people_dfa7df94-39ef-45b7-9cf1-22d3311507bd" "people_fdd5e1f7-464a-4980-a691-d65e1c24a0fe"]

9:29 gtrak`: filter

9:31 clgv: filter

9:31 gtrak`: ,(take 5 (cycle 'filter))

9:31 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>

9:32 clgv: &(take 5 (cycle ['filter]))

9:32 ,(take 5 (cycle ['filter]))

9:32 clojurebot: (filter filter filter filter filter)

9:33 gtrak`: ,(filter #(not (= % 'filter)) (take 5 (cycle ['filter])))

9:33 clojurebot: ()

9:33 gtrak`: ,(filter #(= % 'filter) (take 5 (cycle ['filter])))

9:33 clojurebot: (filter filter filter filter filter)

9:34 lnostdal: i'm using locally generated snapshots; is there some way (an option or something) of making lein not look for updates from various external resources?

9:34 e.g. stuff like "[INFO] snapshot org.clojure:math.numeric-tower:0.0.2-SNAPSHOT: checking for updates from clojars" .. i don't need or want that

9:35 gtrak`: there's the lein checkouts feature

9:36 lnostdal: so i just symlink a checkouts folder to ~/.m2/repository ?

9:37 kinda hard to tell whether it worked because sometimes lein doesn't "check for updates"

9:38 who'd want to update random dependencies at random points in time while doing development? .... doesn't make sense

9:39 clgv: lnostdal: lein's checkouts feature is to link another lein project in the checkouts folder

9:40 gtrak`: lol mindspring

9:40 lnostdal, so basically you skip the part where you generate the snapshot and just link in the source

9:42 lnostdal: gtrak`, i've found that that stuff doesn't actually work; some projects have several directories with source .. which they install via mvn install or lein install as separate mvn projects etc.

9:42 ring seems to do this i think

9:42 gtrak`: ah, yea, I think checkouts assumes just pure clojure source

9:43 lnostdal, I imagine for the ring subprojects you'd have to link in each individually

9:43 lnostdal: yes, something like that .. and it's just stupid; not gonna deal with that

9:44 gtrak`: yea, from looking at it, that's exactly what you'd do

9:44 lnostdal: ..and i recall trying anyways, and it didn't work in some casess

9:50 gtrak`: i think it won't work if the project has custom tasks or plugins or hooks

9:53 clgv: gtrak`: checkouts works with java source as well

9:54 gtrak`: oh, nice, maven projects too?

9:54 clgv: gtrak`: afaik it uses the project.clj of the checkouts project

10:01 randomnamehere: yeah, finished.

10:01 http://goo.gl/0SYZX

10:04 Feel free to improve :) If you have any hints what can be done better this is also welcome

10:05 clgv: randomnamehere: what is memcached?

10:06 randomnamehere: http://memcached.org/

10:06 one of the fastest memory caching systems out there

10:07 You can use it as key value store with http://www.couchbase.com/couchbase-server/features

10:07 Then it is persistent to disc, distributed and so on

10:07 beffbernard: Question: Anyone have success running a swt app on emacs + swank-clojure? It requires the java process run with this switch -XstartOnFirstThread

10:07 dgrnbrg: In clojure.core.jdbc in clojure 1.3, if I have functions that use with-connection, and I call them within another function's with-connection to the same DB, will it reuse that connection?

10:08 randomnamehere: The other NoSQL stuff is full of Logic, Query systems and so on. This makes this kind of systems very slow

10:08 beffbernard: I can run fine with lein run but I'd like to be more interactive and run it on emacs

10:09 randomnamehere: Even faster than sql databases, but memcached has outstanding performance. There are a lot of java applications which put a lot of data (HTTP-Sessions) to memcached instead of the sql-db

10:10 raek: beffbernard: does it work to add that option to the project.clj file?

10:10 beffbernard: raek: I have this in my project.clj :jvm-opts ["-XstartOnFirstThread"]

10:14 randomnamehere: clgv: but memcached offers not functionality to store collections of items. The application has to implement such things itself. It works very well for small pieces of data. On Heroku for example you can store bigger data in EC2 buckets. I a solution like memcached + ec2 seems nice

10:19 If you have any ideas how to improve it, let me know ;)

10:19 lpetit: clgv: hello

10:19 clgv: lpetit: hi

10:20 lpetit: clgv: have you seen the announce for the new beta version of CCW today ?

10:20 clgv: lpetit: oh, not yet. thx

10:20 randomnamehere: what is a CCW?

10:21 lpetit: clgv: it's really just a bunch of paredit/strict mode bug fixes, so really worth upgrading

10:21 clgv: randomnamehere: eclipse plugin for clojure named counterclockwise

10:22 lpetit: clgv: and the leiningen support is going well. Not sure I'll be ready to release at the same time as leiningen 2, we'll see :)

10:22 clgv: lpetit: today I missed something like leiningen support. I had a bugfix in one of my basic libs that required me to alter 5 buildpaths ;)

10:23 lpetit: clgv: I intend to release leiningen support separately from ccw, so that life cycles are separate, until it's good enough to be shipped along ccw.

10:24 clgv: and this will allow me to deliver something quicker, even if not feature complete

10:24 s/quicker/faster/

10:24 clgv: ah ok

10:26 lpetit: clgv: first release either today, either next thursday, with a leiningen class path container, a button to enable/disable "leiningen support" (automatically adding the leiningen container to the build path + a builder re-computing the leinigen dependencies every time the project.clj file is touched) + a button to manually force the re-computation of the leiningen dependencies from the project.clj file.

10:27 clgv: lpetit: =)

10:28 lpetit: I get persuaded more and more that I need to hack CCW's repl view to support history search like in the bash

10:29 lpetit: clgv: I remember you talked about this earlier. Did you also file an issue for this? If not, would be great.

10:30 clgv: lpetit: no issue, yet.

10:30 lpetit: clgv: please, help yourself ;-)

10:31 clgv: lpetit: gotta find an easy way for a 3D plot in java first ;)

10:31 lpetit: clgv: "Take a pause, File an issue" :)

10:36 dgrnbrg: What's the best library for making a CLI program if I'm using lein-uberjar?

10:45 clgv: dgrnbrg: there is a with-command-line macro

10:45 TimMc: What does that do?

10:46 dgrnbrg: clgv: is that the easiest/slickest way? will it work w/ uberjar?

10:46 TimMc: dgrnbrg: Wait, do you want something like GNU GetOpt, or a shell-like interface?

10:47 dgrnbrg: like getopt

10:47 TimMc: check out clojopts

10:47 dgrnbrg: I have a cli program I want to distribute

10:50 TimMc: dgrnbrg: Here's an example of clojopts in use: https://github.com/timmc/kpawebgen/blob/master/clj/src/kpawebgen/core.clj#L44

10:52 clgv: TimMc: looks similar to the with-command-line one. maybe some more features ^^

10:53 TimMc: clgv: Where does with-command-line live?

10:54 clgv: TimMc: good question. I found it via google a long time ago

10:54 TimMc: I see it in contrib...

10:55 I'd trust clojopts more, since it is backed by GetOpt itself.

10:56 Also, I can verify that it uses juxt in at least one place.

11:05 dgrnbrg: I have a jar I depend on that's not in a maven repo

11:05 how do I make uberjar stop deleting it?

11:07 TimMc: dgrnbrg: Put it in a repo.

11:08 dgrnbrg: s3-private-wagon will allow you to keep it in S3

11:08 dgrnbrg: TimMc: that's not an option. It's impossible for me to get maven to work/use a repo at work

11:08 can I copy it somewhere to trick maven?

11:08 or is there another artifacts dir so I can check it into my reop?

11:08 *repo?

11:08 TimMc: Oh, I remember this problem now... you've got this proxy problem.

11:08 dgrnbrg: Yeah

11:09 I did solve that, but it's painful

11:09 and setting up a new repo is impossible (effectively)

11:09 I just need to get tools.jar from java7

11:09 clgv: lpetit: done

11:09 dgrnbrg: you can switch off implict cleans

11:10 dgrnbrg: clgv: how do I do that?

11:10 clgv: dgrnbrg: it's in the example on the leiningen readme

11:10 dgrnbrg: got it, thanks

11:11 TimMc: dgrnbrg: I think you can also add things explicitly to the classpath.

11:12 dgrnbrg: interesting...

11:12 I'll investigate all these things

11:13 TimMc: dgrnbrg: Always worth another skim through the sample project file.

11:13 dgrnbrg: TimMc: indeed it is :)

11:14 I just spend so much time looking up things that I get lazy sometimes ;)

11:15 randomnamehere: (= (list __) '(:a :b :c))

11:15 what might __ be?

11:15 raek: :a :b :c?

11:15 Bronsa: without the question mark.

11:15 raek: it can't be just one value

11:16 randomnamehere: it works, but why?

11:17 Bronsa: ,(list :a :b :c)

11:17 clojurebot: (:a :b :c)

11:18 dgrnbrg: do you know any programmatic APIs to interact w/ the AST of java source? I'm using doclet, but it's really slow and crappy, and I'm concerned it'll be hard to use antlr

11:18 clgv: humm clojars doesnt list my uploaded jar :(

11:18 TimMc: randomnamehere: Doing 4clojure problems?

11:19 randomnamehere: yes TimMc

11:19 ,(:a :b :c)

11:19 clojurebot: :c

11:19 randomnamehere: WTF?

11:19 TimMc: Yeah, I've complained in the past that it's not really clear that a blank can take multiple expressions.

11:20 lucian: randomnamehere: unquoted lists are executed

11:20 raek: dgrnbrg: antlr is actually pretty painless to use from clojure

11:20 TimMc: randomnamehere: Oh, *that* has to do with keywords acting as functions.

11:20 raek: check out the lein-antlr plugin

11:20 lucian: in this case :a is a function, and it's called with :b and :c as arguments

11:20 randomnamehere: lucian: and they are quoted with list ?

11:20 vijaykiran: How can I "replace" a value for key in a vector of maps .. ?

11:20 Bronsa: randomnamehere: thats kinda like (get :b :a :c)

11:20 clgv: what do I need to add to a jar to have it registered in clojars?

11:20 Bronsa: it returns :c because it's not-found-value

11:20 lucian: randomnamehere: (list :a :b :c) means calling the function list with :a :b :c as params

11:20 Bronsa: ,(doc get)

11:20 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

11:20 lucian: ,'(:a :b :)

11:20 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :>

11:20 dgrnbrg: raek: thanks

11:21 lucian: ,'(:a :b :c)

11:21 clojurebot: (:a :b :c)

11:21 randomnamehere: ,(list a b c)

11:21 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0)>

11:21 randomnamehere: whiy isn't this working?

11:21 Iceland_jack: ,(list 'a 'b 'c)

11:21 clojurebot: (a b c)

11:21 randomnamehere: quoting,.mhhh

11:21 TimMc: clgv: Nothing in particular. Just follow the clojars instructions.

11:21 lucian: ,(= (list :a :b :c) '(:a :b :c))

11:21 clojurebot: true

11:21 dgrnbrg: raek: is there a javac task as well?

11:21 Bronsa: randomnamehere: you have to (quote) or ' in order to prevent things to be evaluated

11:21 randomnamehere: ,(list "a" "b" "c")

11:21 clojurebot: ("a" "b" "c")

11:21 clgv: TimMc: hm ok, trying the "POM" wikipage now

11:21 raek: dgrnbrg: yes, that's built in leiningen

11:22 randomnamehere: okay, understood

11:22 TimMc: clgv: Huh? No, the instructions are here: http://clojars.org/

11:22 randomnamehere: but why does :a work when : does no quotation?

11:22 TimMc: clgv: Just `lein jar, pom` and `scp pom.xml mylib.jar clojars@clojars.org:`

11:22 Bronsa: because symbols evaluate to themselves

11:22 amro: :a is a keyword

11:22 Bronsa: ,(eval :a)

11:22 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

11:22 amro: it always evaluates to itself

11:22 Bronsa: oh :(

11:22 clgv: TimMc: it's a java dep not available in any maven repo

11:23 Bronsa: user=> (eval :a)

11:23 :a

11:23 raek: dgrnbrg: this is how my project.clj file looks like https://gist.github.com/2001893

11:23 TimMc: clgv: Ah! Yeah, you'll need to build a pom.xml for it and push both at the same time.

11:23 raek: when I have edited the grammar, I run "lein antlr && lein javac" and restart clojure from emacs by running clojure-jack-in

11:24 dgrnbrg: raek: awesome…that looks perfect/easy

11:24 Bronsa: clgv: use this https://github.com/ato/lein-clojars

11:24 raek: I was really surprised that it worked so well

11:24 Bronsa: then you just need to `lein push`

11:25 TimMc: You'll still need a pom.

11:25 raek: it was way messier to get it working in an eclipse java project

11:25 TimMc: Bronsa: That's for pushing from a lein project, not just some random jar, yeah?

11:25 Bronsa: i think so

11:26 clgv: ah well. seems it worked.

11:32 TimMc: clgv: Which?

11:32 clgv: TimMc: ?

11:32 TimMc: which worked?

11:32 clgv: ah. I added it via the pom

11:32 lein-clojars didnt work for me in the past

11:33 randomnamehere: ,(reverse "DLROW OLLEH")

11:33 clojurebot: (\H \E \L \L \O ...)

11:34 Iceland_jack: ,(apply str (reverse "DLROW OLLEH"))

11:34 clojurebot: "HELLO WORLD"

11:34 Iceland_jack: (:

11:41 frito: Hi, any pointers to calling Java classes with main methods.

11:42 For instance if I instantiate one, is main called implicitly or does it have to be explicit

11:42 clgv: frito: main is a static method and is not called automatically

11:43 frito: OK - thx

11:43 TimMc: frito: You call Foo/main, not (.main (Foo.))

11:43 Well, (Foo/main)

11:44 randomnamehere: (= (__ "Dave") "Hello, Dave!")

11:44 ,(= (str "Hello, " "Dave") "Hello, Dave!")

11:44 clojurebot: false

11:44 TimMc: &(str "Hello, " "Dave")

11:45 Raynes: Can you restart lazybot?

11:45 ,(str "Hello, " "Dave")

11:45 clojurebot: "Hello, Dave"

11:45 randomnamehere: how to move the ! to the end?

11:46 TimMc: randomnamehere: While it is possibleto solve this one by putting two expressions in the blank, you could also use an inline function.

11:46 also, there is a #4clojure channel, just so you know :-)

11:48 clgv: randomnamehere: (format "Hello, %s!" "Dave")

11:48 randomnamehere: java.security.PrivilegedActionException: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)

11:49 ahh seen it

11:49 clgv: ,(#(str "Hello, " % "!") "Dave")

11:49 clojurebot: "Hello, Dave!"

11:49 TimMc: So, kind of the point of 4clojure is to teach yourself this stuff.

11:50 It's kind of weird to ask for answers, or give them (without asking if spoilers are OK)

11:59 clgv: how was the fast way to get a two dimensional vector in a 2-dim array?

11:59 *2-dim double array

12:03 TimMc: Some combo of map and into-array?

12:07 clgv: hmyeah (into-array (map double-array ...))

12:10 lancero: is there any online guide on installing clojure 1.3 / emacs 24 / swank / clojure-mode on windows?

12:10 randomnamehere: lancero: good question ;)

12:12 owain`: Clojure box is a quick way to get set up if you're forced to use Windows for any reason. Not sure what version of Emacs. Might be 23

12:12 http://clojure.bighugh.com/

12:15 llasram: lancero: The first step is to realize that you don't "install" Clojure. To install something that gives you a Clojure environment, install Leiningen. lein supports windows, emacs supports windows, and everything else Should Just Work [1]

12:15 [1] Not tested myself. YMMV :-)

12:17 lancero: llasrm: well I could rephrase my questions to: any online guide to getting lein / clojure 1.3 / emacs 24 / swank / clojure-mode to just work on windows?

12:18 llasram: Follow the official instructions for installing each individual thing?

12:18 Not being facetious

12:35 gf3: is there something like (filter) but it stops after the first match?

12:35 like (some) but it returns the item, not a boolean

12:35 RickInGA: &(some odd? [1 2 3])

12:35 TimMc: gf3: (first (filter ...))

12:36 RickInGA: filter is lazy, so you should be able to take 1

12:36 (take 1 (filter odd? [1 2 3]))

12:36 gf3: okay cool, thx

12:36 RickInGA: &(take 1 (filter odd? [1 2 3]))

12:36 TimMc: RickInGA: But that gives back a seq, not a value.

12:36 RickInGA: is lazybot sleeping, or am I doing something wrong?

12:36 TimMc: *the value

12:37 Yeah, botdown.

12:37 dakrone: ,(take 1 (filter odd? [1 2 3]))

12:37 clojurebot: (1)

12:38 RickInGA: ,(some odd? [1 2 3])

12:38 clojurebot: true

12:38 RickInGA: doh, I thought that returned the first item

12:39 Bronsa: ,(first (filter odd? [1 2 3]))

12:39 clojurebot: 1

12:42 bpsm: (some f xs) returns the first ( f x) which is truthy, not the first x for which (f x) is truthy.

12:43 RickInGA: bpsm: thanks

12:43 bpsm: Presumably there's some clever idiom that takes advantage of that behavior, but I don't know it.

12:45 RickInGA: don't know if anyone on is in the Atlanta area, but a few from this channel are getting together at Harp Irish Pub in Roswell this evening.

12:46 llasram: RickInGA: Doh! I'm in Atlanta, but have other plans tonight

12:46 I didn't actualy realize this city hosted other Clojure users :-)

12:46 gf3: rude

12:47 llasram: Incipient users group?

12:48 RickInGA: llasram I think so. There is a Lisp meetup group, not sure how active it is.

12:48 gf3 rude?

12:49 gf3: (just kidding)

12:49 RickInGA: gf3: ok, :) You're invited too! where are you?

12:49 gf3: sadly I'm in Toronto

12:50 llasram: RickInGA: That'd be pretty cool. I'm definitely interested

12:50 zawzey: Hi, any idea why there's a bug here: https://gist.github.com/6a8fe84c110a54203937

12:50 The number of items in the map is less than the input

12:50 ibdknox: gf3, yeah that should be part of the watcher.

12:51 gf3: ibdknox: okay cool, 'cause I find things are getting a bit messy putting it all in "src/"

12:51 ibdknox: gf3, haha you can tell which codepath I use ;)

12:52 gf3: ibdknox: :D

12:53 dnolen: redinger: think we can starting filling out the GSoC app today?

12:54 zawzey: Formatted to make the code legible

12:54 ibdknox: dnolen, I'm going to add a couple projects tonight

12:54 llasram: zawzey: I don't think sorted-map-by or comparators work the way you think they do

12:54 dnolen: ibdknox: sweet! the more the merrier

12:55 zawzey: llasram: and how would you explain that

12:55 ibdknox: I think a good, pretty easy one would be to create noir-static. A little static site generator that reads Noir's route table

12:55 zawzey: llasram: i'm aware usually for sorted-by keys are being compared, but i would like to sort based on the values

12:55 jkkramer: zawzey: you probably want a priority-map instead. sorted map items that compare as equal are considered the same item

12:55 ibdknox: we can have our own, much cooler jekyll :)

12:55 zawzey: jkkramer: ahh, i see

12:55 llasram: ,(apply sorted-map-by (constantly 0) (range 20))

12:56 jkkramer: zawzey: https://github.com/clojure/data.priority-map

12:56 clojurebot: {0 19}

12:56 zawzey: jkkramer: but then again, if i compare the keys instead of the key-value sorted-map-by works

12:57 gf3: ibdknox: oh, another little issue I noticed, if the path contains "cljs" it fails to parse properly

12:57 jkkramer: zawzey: because the keys are distinct

12:57 gf3: ibdknox: for example the following files won't generate "src/my-app/cljs/core.cljs"

12:57 ibdknox: but this will: "src/my-app/js/core.cljs"

12:58 ibdknox: gf3, weird

12:58 gf3, as in it fails to watch it, or the compiler doesn't compile it?

12:58 zawzey: jkkramer: i see, thanks...

12:58 llasram: gotcha, thanks

12:58 ibdknox: oo

12:58 gf3: ibdknox: both I guess

12:59 ibdknox: gf3, yeah don't do that

12:59 haha

12:59 you're replace cljs.core

12:59 replacing*

12:59 llasram: zawzey: You can just make sure the keys compared are unique: https://gist.github.com/ee28d4333002d516dffd

12:59 gf3: ibdknox: ruh roh

12:59 llasram: s,are unique,are distinct if the keys are actually distinct,

13:00 ibdknox: it should be fine if it's cljs/something/core.cljs

13:00 I think that path is hardcoded in the compiler

13:00 you might want to file a bug for it

13:00 gf3: ibdknox: indeed, just not the watcher

13:01 jkkramer: llasram: zawzey: if you assoc/dissoc that map, though, it will not be sorted by the new values

13:01 llasram: jkkramer: true

13:04 zawzey: llasram: great, thanks

13:05 i should add that example to clojuredocs

13:10 di-csuehs: reminder to self: "for" list comprehension is lazy....still.

13:34 rplevy: does anyone who uses cucumber-clojure (cucumber-jvm) know if reading tabular data is broken?

13:45 jsabeaudry: The disadvantage of using send-off everywhere instead of send is higher resources usage?

13:45 gtrak`: is there a complement to the bean function?

13:46 TimMc: gtrak`: What would that do?

13:46 gtrak`: set properties from a map of keywords to vals on a bean

13:47 TimMc: hmm

13:47 An existing bean object, existing class (instantiating and then pumping in vals), or creating a class for the vals?

13:48 technomancy: (doto (java.util.Properties.) (.putAll {"hello" "world"}))

13:49 raek: jsabeaudry: yes.

13:50 send uses a fixed size thread pool and send-off allocates new threads when needed

13:50 if your functions don't block or take very long time to execute, it's safe to use send

13:51 jonasen: dnolen: Time for another core.logic question?

13:51 dnolen: jonasen: shoot

13:51 jonasen: https://refheap.com/paste/972

13:51 dnolen: the first expression doesn't unify. Why?

13:52 dnolen: you can't just use a dot like that

13:52 (_ . _), (_ _ . _) etc are the only valid ways to use .

13:52 jonasen: dnolen: ok

13:53 gtrak`: TimMc, yes, an existing class, for instance a spring bean

13:53 dnolen: jonasen: actually I guess (. _) currently works, not sure what I think about that.

13:53 Lajla: raek, my love.

13:53 Let us worship His Shadow together.

13:54 dnolen: jonasen: but no, the . only works with list syntax, I don't see an obvious issue at the moment with it working with vectors ... feel free to open a ticket.

13:54 jonasen: I would like to unify (fn [. ?x] (?fun . ?x)) with (fn [x y] (+ x y)) if you know what I mean

13:56 Bronsa: what are the advantages of using core.logic's unifier over core.unify?

13:57 jonasen: dnolen: core.logic is new territory for me... so expect a silly question daily.

13:59 dnolen: jonasen: why not (fn ?args (?fun . ?args)) ?

14:01 jonasen: dnolen: That seems to work. Thanks!

14:01 dnolen: jonasen: out of curiosity whats kinds of features are you all adding?

14:02 jonasen: dnolen: this rule is for suggesting (map inc [1 2 3]) instead of (map #(inc %) [1 2 3])

14:02 gtrak`: TimMc, I found a solution in setter-fn: https://bitbucket.org/kumarshantanu/clj-argutil/src/d4732e993c30/src/main/clj/org/bituf/clj_argutil.clj

14:02 dnolen: jonasen: ha, nice :)

14:03 jonasen: do you all have a lein-kibit yet?

14:05 jonasen: heh, I see that lein kibit already works.

14:07 jonasen: dnolen: yes. It should work. You'll need to use master with lein 2.0 though.

14:08 dnolen: I haven't ventured yet into lein 2.0, does it just work? i.e. no breakage?

14:09 technomancy: dnolen: most of the breakage is in 3rd-party plugins

14:09 all the core changes are handled for you by lein-precate

14:10 _ulises: what's the preferred way of parsing (possibly broken) HTML? is it with enlive?

14:11 technomancy: most of the broken plugins are the more obscure ones; lein-ring and lein-midje are the only widely-used ones that still aren't compatible

14:13 ibdknox: I should go fix mine, huh?

14:14 chouser: _ulises: I've used tagsoup successfully

14:14 ibdknox: there's a clj-tagsoup as well

14:14 https://github.com/nathell/clj-tagsoup

14:15 chouser: data.xml ought to work on top of tagsoup

14:15 technomancy: ibdknox: lein-noir? would be cool to get it on newnew, yeah

14:15 ibdknox: it technically is

14:15 jkkramer: _ulises: I've had best results with jsoup. no clojure wrapper, but it's an html5-compliant parser

14:15 dnolen: jonasen: ohpauleez emailed me about recursively applying rules, did you all sort this out?

14:16 _ulises: interesting

14:16 thanks for the responses, now I have to go and investigate

14:16 dnolen: technomancy: hmm, Exception in thread "main" java.lang.NullPointerException when I try to run lein2

14:18 technomancy: dnolen: there's a known issue when you first run it outside a project without any profiles

14:19 fixed in master, but I haven't pushed an updated preview2 yet

14:21 jonasen: dnolen: I think I know how to do it. Just got to read some prolog literature first :)

14:21 dnolen: jonasen: k, let me know if you all need more pointers

14:21 technomancy: thx, that works

14:23 ivan: is there any literature on dynamically scoped variables? when do you use them instead of passing things around?

14:24 dnolen: ivan: it's instructive to see where Clojure uses them. They are awesome, but really should be used very sparingly. kinda like macros.

14:25 randomnamehere: ,(fn [x & y] (last (sort (y))) 1 8 3 4)

14:25 clojurebot: #<sandbox$eval27$fn__28 sandbox$eval27$fn__28@eb6899>

14:25 randomnamehere: ,(fn [x & y] (doall (last (sort (y)))) 1 8 3 4)

14:25 clojurebot: #<sandbox$eval55$fn__56 sandbox$eval55$fn__56@4bddfd>

14:25 ivan: dnolen: thanks, I'll take a closer look

14:27 `fogus: ,((fn [x & y] (last (sort y))) 1 8 3 4)

14:27 clojurebot: 8

14:37 `fogus: technomancy: What service do you use to print Lein stickers?

14:37 technomancy: `fogus: I used psprint.com; they were fine.

14:38 `fogus: Excellent, thank you

14:38 Raynes: `fogus: Print me some fogus stickers. I'd wear those with pride.

14:42 `fogus: Just pretend this is me: http://www.zazzle.com/lucha_libre_mexican_wrestling_sticker-217976188315608984

14:43 TimMc: `fogus: I already do.

14:43 Raynes: Wait, it isn't?

14:43 tylergillies: lolz

15:03 randomnamehere: ,(apply (fn dx [x & y] (if-not (= nil (next y)) (dx y) y)) [1 2 3 4 5])

15:03 clojurebot: nil

15:03 randomnamehere: why nil? hmpf

15:03 ,(apply (fn dx [x & y] (if-let [d (next y)] (dx y) y)) [1 2 3 4 5])

15:03 clojurebot: nil

15:05 raek: randomnamehere: you're never doing anything with x

15:05 randomnamehere: raek: I know it is just to test

15:05 raek: randomnamehere: what do you expect it to output?

15:06 randomnamehere: the last item

15:07 raek: ,(apply (fn dx [x & y] (if-let [d (next y)] (apply dx y) y)) [1 2 3 4 5])

15:07 clojurebot: (5)

15:07 raek: randomnamehere: ^

15:08 ,(apply (fn dx [x & y] (if (seq y) (apply dx y) x)) [1 2 3 4 5])

15:08 clojurebot: 5

15:08 randomnamehere: ahhh apply does the trick?

15:09 raek: yes

15:09 randomnamehere: why do I need it?

15:09 raek: dx takes the input as separate arguments

15:09 duck1123: without apply, you'd only be passing one

15:09 TimMc: randomnamehere: The same reason apply was used in the original call to dx

15:10 raek: if you do (dx y) you call it with only one argument - the items wrapped in a collection

15:10 randomnamehere: but It should be evaluated if it is in () TimMc ?!

15:10 ahhh raek understand ;)

15:10 TimMc: randomnamehere: Yes... but apply isn't just "call"

15:12 randomnamehere: TimMc: what then?

15:13 TimMc: I mean, it ends up calling the function, but arranges the arguments differently.

15:16 randomnamehere: Found another solution

15:16 v

15:16 #(nth % (dec (count %)))

15:17 It's better than just #(first (reverse %))

15:17 isn't it`

15:17 reverse builds a new list in memory, count does not?!

15:17 TimMc: &(doc count)

15:17 lazybot: ⇒ "([coll]); Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collections and Maps"

15:18 randomnamehere: &(doc reverse)

15:18 lazybot: ⇒ "([coll]); Returns a seq of the items in coll in reverse order. Not lazy."

15:18 randomnamehere: I assume getting the index is better ^^

15:18 TimMc: randomnamehere: count does a constant-time count when possible, but when given a seq it walks it (and realizes it)

15:18 llasram: &(count (range))

15:19 lazybot: Execution Timed Out!

15:19 randomnamehere: How does the bots here work?

15:19 TimMc: llasram: Interestingly, (range) is no longer an infinite seq in 1.3.

15:19 randomnamehere: Is there anywhere the source of the bots

15:19 TimMc: randomnamehere: Yeah, just look on github.

15:19 llasram: TimMc: You mean 1.4...?

15:20 randomnamehere: TimMc: which project?

15:20 TimMc: randomnamehere: I don't know, use Google.

15:20 (or DuckDuckGo, or Bing, or Altavista...)

15:20 randomnamehere: is it your bot? Have you written it?

15:20 TimMc: nope

15:21 llasram: 1.3 switched to non-autopromoting arithmetic by default

15:21 randomnamehere: WTF DuckDuckGo

15:21 llasram: randomnamehere: This is lazybot: https://github.com/flatland/lazybot

15:22 Raynes: Holy crap. lazybot has 65 watchers.

15:22 amalloy: We're being watched.

15:22 Act natural.

15:22 llasram: TimMc: Right... Oh! so therefore it's bounded by maxint!

15:23 TimMc: &(take 2 (range (- Long/MAX_VALUE 64) Double/POSITIVE_INFINITY))

15:23 lazybot: ⇒ (9223372036854775743 9223372036854775744)

15:23 TimMc: &(take 2 (range (- Long/MAX_VALUE 1) Double/POSITIVE_INFINITY))

15:23 lazybot: java.lang.ArithmeticException: integer overflow

15:25 llasram: &(take 2 (range (bigint (- Long/MAX_VALUE 1)) Double/POSITIVE_INFINITY))

15:25 lazybot: ⇒ (9223372036854775806N 9223372036854775807N)

15:25 llasram: So consistent, at least

15:25 That makes complete sense to me

15:25 jsabeaudry: &(send-off (agent {}) (fn [a] (send-off (agent {}) (fn [b] (println "foo") b)) (Thread/sleep 5000) a))

15:25 lazybot: java.lang.SecurityException: You tripped the alarm! send-off is bad!

15:26 jsabeaudry: Can anyone explain why "foo" takes 5 seconds to appear?

15:26 llasram: But it is non-obvious what the correct behavior of (range) should be then :-/

15:26 (to me)

15:27 jsabeaudry: Are agents tasks only sent at the end of the current agent task or something?

15:27 llasram: jsabeaudry: the raison d'etre of agents is to serialize uncoordinated updates to a value

15:27 TimMc: &(take 3 (iterate #(+' % 1) (- Long/MAX_VALUE 1)))

15:27 lazybot: ⇒ (9223372036854775806 9223372036854775807 9223372036854775808N)

15:28 llasram: jsabeaudry: So the second send-off queues the task right away, but it doesn't actually run until the first one finishes

15:29 TimMc: Change one to a send, see what happens.

15:29 jsabeaudry: llasram, even though they are two diffrent agents?

15:29 llasram: blarp

15:29 My brain totally failed to parse that :-)

15:30 jsabeaudry: TimMc, no difference

15:33 This looks like a bug to me

15:33 Raynes: It's not a bug, it's a feature.

15:34 TimMc: You're just saying that.

15:34 Raynes: I say that to all the bugs.

15:35 llasram: Looking at clojure.lang.Agent, it has explicit code to defer queue any other agent executions from within a given agent

15:37 There's static thread-local holding persistent vector. If it's null when the agent action is enqueued, the action is sent to the executor queue right away

15:38 If it's not null, the action is cons'd onto the vector

15:39 TimMc: llasram: How is action failure handled?

15:39 llasram: And when agent actions run the start by setting the thread-local to an empty vector, and finish by enqueueing actions in their thread-local queue to the pool

15:39 TimMc: Is the queue dropped?

15:39 llasram: Ah! Yes

15:39 If the agent fails, any queued agent actions are silently dropped

15:39 TimMc: Same with dosync and failure/retry

15:40 llasram: Slightly unexpected to me, but makes total sense

15:40 jsabeaudry: llasram, Ah that must be the reason why they arent dispatched immediately

15:42 llasram: And it is documented on clojure.org/agents: "If during the [action] function execution any other dispatches are made (directly or indirectly), they will be held until after the state of the Agent has been changed."

15:42 jsabeaudry: Well in this case, I can't use agents, I guess I'll go with good old locks

15:42 llasram: Cool. Good to know.

15:43 jsabeaudry: llasram, Thank you very much for your help!

15:43 llasram: np

15:43 randomnamehere: Can the bot be used to do any damage?

15:43 or is it kind of sandboxed?

15:43 TimMc: Doubly sandboxed.

15:44 randomnamehere: The JVM sandbox prevents I/O, etc.

15:45 randomnamehere: The Clojure sandbox (clojail, for lazybot) prevents you from messing up the Clojure environment (redefining things, etc.)

15:45 Raynes: TimMc: You used the phrase 'doubly sandboxed' -- you must have watched my conj talk.

15:46 TimMc: NOPE.

15:46 Raynes: TimMc: We can't be friends.

15:46 TimMc: YEP.

15:47 randomnamehere: Oh, and clojurebot automatically restarts every 15 minutes, probably because it doesn't have very good Clojure environment sandboxing.

15:47 brehaut: TimMc: lazybot throws out its sandbox too doesnt it?

15:48 TimMc: Don't ask me, I didn't watch Raynes' talk.

15:48 randomnamehere: I wanna watch the talk later

15:48 tmciver: zing!

15:48 randomnamehere: Raynes: is the bot from you?

15:48 Raynes: TimMc: No, it never throws out its sandbox.

15:48 randomnamehere: Or the jail?

15:48 Raynes: randomnamehere: Both the jail and the bot are me and amalloy.

15:48 TimMc: It just dies periodically and has to be restarted.

15:48 randomnamehere: I can't make HTTP Calls, IO or so from the bots? So how do the plugins do?

15:48 TimMc: randomnamehere: clojurebot is run by hiredman

15:49 Raynes: The bot was originally me with some amalloy on top. The jail was both me and amalloy equally, I'd think.

15:49 TimMc: randomnamehere: The jailed eval thingy *is* a plugin.

15:49 Raynes: The sandbox only applies to the code you execute via & and ##. It doesn't apply to the plugins.

15:49 The plugins are free to do whatever they like.

15:49 randomnamehere: nice!

15:50 I thought about also host a bot

15:50 clojure is fun

15:50 but I'm afraid of losing control and be part of a botnet :)

15:50 doug: ok, i've got a freshly-developed clojure app that talks to a browser app via websockets

15:51 randomnamehere: Raynes: is there any documentation about the sandboxing?

15:51 doug: i'm trying to figure out what the best option for deployment is

15:51 packaging everything and running jetty?

15:51 lake: I just created a hello_world.clj file, how do I run it?

15:51 Raynes: randomnamehere: https://github.com/flatland/clojail

15:53 doug: i guess the first issue should be: do people actually use clojure in production?

15:53 if not, i guess lein run is all that's needed

15:53 Raynes: Of course they do.

15:54 TimMc: but lein run can be sufficient for a lot of use cases

15:54 randomnamehere: Hahah Raynes nice text about security in the end

15:54 technicans tend to say, yes that is realistic

15:55 businessman will think, we will not but that :)

15:55 secure-enough... :)

15:55 TimMc: Raynes: I think I've seen the slides, but not the video.

15:55 lake: i found my answer: java -cp /usr/share/clojure/clojure.jar clojure.main problem1.clj

15:55 seems long winded

15:56 TimMc: lake: Use Leiningen, it is way easier.

15:57 the-kenny: Anyone using paredit with Emacs 24? I can't get it to work nicely with { and }

15:57 TimMc: De facto clojure build/dev tool.

15:57 the-kenny: {} works fine in Fundamental mode + paredit, as soon as I enable clojure-mode or any other lisp-mode, curly braces are broken.

15:57 randomnamehere: Is anyone of you rich h. ?

15:58 the-kenny: { inserts the closing } correcly, hitting DEL doesn't remove the matching } anymore. Typing } to move to the closing } is broken too.

15:59 llasram: the-kenny: What does emacs say the } key is bound to?

15:59 the-kenny: llasram: } paredit-close-curly

16:00 { is paredit-open-curly, as expected.

16:00 TimMc: randomnamehere: Not as far as I know. He's only in here rarely, and uses his real name.

16:00 randomnamehere: He can be proud about that big community

16:00 and all that stuff like lein and so on

16:00 the-kenny: As I said, it works fine in Fundamental Mode. The bindings look the same when I switch to lisp-mode, but there paredit-*-curly is broken. (Same in clojure-mode)

16:01 Vinzent: Hi. I wonder why flatten on sets always returns an empty seq?

16:02 As stated in its doc, it "Takes any nested combination of sequential things". Woudn't be better if it'd throw an exception when set is passed?

16:02 tmciver: ,(doc flatten)

16:02 clojurebot: "([x]); Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence. (flatten nil) returns an empty sequence."

16:02 tmciver: sets aren't sequential.

16:02 TimMc: ~flatten

16:02 clojurebot: flatten just means you failed to use ->> and mapcat correctly

16:03 TimMc: ~flatten

16:03 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

16:03 TimMc: &(sequential? #{})

16:03 lazybot: ⇒ false

16:03 tmciver: TimMc: why does clojurebot give two different responses there?

16:03 TimMc: Vinzent: ^ and ^^

16:03 llasram: the-kenny: My elisp-fu is defeating me, but my spider sense is suggesting that your syntax table under clojure-mode doesn't have {} properly paired

16:03 TimMc: tmciver: Multiple factoids stored under "flatten".

16:04 Vinzent: tmciver, yes, I know, I've written about it. The problem is that it doesn't throw an exception, but returns ().

16:04 tmciver: TimMc: so if you keep issuing a ~something it iterates through them?

16:04 TimMc: tmciver: Random selection.

16:04 tmciver: Ask it ~paste repeatedly (in /query clojurebot of course)

16:05 the-kenny: llasram: Hm. But then I must have the same error in lisp-mode and lisp-interaction-mode as well. I haven't changed any variable in these modes.

16:05 jlaskowski: Hi

16:05 Vinzent: TimMc, thanks, but I've asked the question not becuase I'm using flatten, I just found this strange behaviour by accident.

16:05 tmciver: Vinzent: do you expect it to? The doc isn't specific about the behavior with sets.

16:05 jlaskowski: Why am I not able to set a :dynamic metadata for vars in clojure 1.3.0?

16:06 Vinzent: tmciver, well, sets are not sequentials, and flatten expects a sequential. It's pretty clear that sets are not correct input for this function.

16:06 llasram: the-kenny: I think {} aren't usually considered paired in other lisp-modes

16:07 the-kenny: AH, here we go: try having emacs evaluate (string (char-syntax ?\})) in a clojure-mode buffer

16:07 the-kenny: llasram: yup, but paredit ignores this. squared braces works fine there.

16:07 tmciver: jlaskowski: I can set :dynamic meta in my 1.3 repl.

16:07 Vinzent: jlaskowski, (def ^:dynamic *foo*) works for me

16:08 jlaskowski: is ^:dynamic for unbound vars only?

16:08 Raynes: nopw.

16:08 nope*

16:08 jlaskowski: what's your (clojure-version)?

16:08 "1.3.0"

16:09 user=> (def ^:dynamic b 1)

16:09 ^{:ns #<Namespace user>, :name b, :line 1, :file "NO_SOURCE_PATH"} #'user/b

16:09 and binding form warns me about reassignment

16:09 (I've even been looking at the source code of clojure :))

16:10 Vinzent: jlaskowski, maybe it's because you named it b, not *b*

16:10 (just a guess)

16:10 jlaskowski: nope

16:10 tmciver: ,(source flatten)

16:10 clojurebot: Source not found

16:10 jlaskowski: earmuffs just make the warning earlier when used in def

16:10 tmciver: &(source flatten)

16:10 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

16:11 the-kenny: llasram: Huh, wait. I just restarted Emacs, and now the curly braces work in clojure-mode, but still fail in other lisp-modes. Evaluating your code returns ")" in (not broken) clojure-mode and "_" in broken lisp-modes.

16:11 jlaskowski: I've already spent almost half a day and am stuck

16:12 tmciver: Vinzent: a look at the source for flatten has it using sequential? for the branch funtion to tree-seq. Looks like that's why it returns (). It doesn't throw for things that aren't sequential.

16:12 Raynes: tmciver: https://refheap.com/paste/974

16:12 My favorite flatten.

16:12 tmciver: Raynes: Where's that from? Is it yours?

16:13 Raynes: It's in clojail.

16:13 Man, has nobody seen my talk?

16:13 tmciver: Raynes: I saw it . . . I was there. :)

16:13 Raynes: Hahaha, oh.

16:13 This is the flatten-all I mentioned in said talk.

16:13 * jlaskowski will have to ask on the mailing list

16:14 tmciver: Raynes: I haven't memorized that part yet.

16:14 * jlaskowski thanks everybody and leaves for now

16:14 Vinzent: tmciver, I understand it doesn't :) they definitely should start using trammel

16:14 TimMc: jlaskowski: Probably needs more context.

16:14 Raynes: The reason for it is ##(flatten [[{:foo :bar}]])

16:14 lazybot: ⇒ ({:foo :bar})

16:14 Raynes: It doesn't flatten maps.

16:14 flatten-all does

16:14 TimMc: Raynes: And that makes it hard to look for bad symbols, yes.

16:14 <- hasn't seen the talk, though

16:15 the-kenny: llasram: Ah, now I why it doesn't work in *-lisp-mode. clojure-mode does some modifications to the syntax table in order to make { and [ work nicely. While this doesn't explain why M-{ (which didn't work in clojure-mode two hours ago) works flawlessly now, I'm happy. Thanks for your help :)

16:16 Vinzent: Raynes, that makes sense (probably), thank you!

16:16 Raynes: Huh, did I help you?

16:16 Vinzent: don't you?

16:17 Raynes: Oh, were you the one asking about flatten?

16:17 Vinzent: yep

16:17 Raynes: Oh, you're welcome. Come again.

16:18 Bronsa: why is it seq and not just identity?

16:18 amalloy: more characters, bro. gotta trim down that source code

16:19 Raynes: By using juxt.

16:19 Amirite?

16:19 Bronsa: lol

16:27 randomnamehere: Raynes: about RefHeap We aren't entirely satisfied with existing pastebins

16:28 What is your problem with github gist?

16:28 Raynes: I think Gist is great, but there are some things we can do with refheap that they aren't doing with gist.

16:28 For example, simple code evaluation is coming soon.

16:29 Revisions and such as well.

16:29 randomnamehere: Raynes: gist has revisions

16:29 Raynes: Yes, I know.

16:29 ibdknox: also it's going to use the Angelina AI to turn your pastes into a game

16:29 Raynes: I also like our website better in general.

16:30 I like the fact that it is open source and we can do whatever we want with it on a whim.

16:30 It is written in Clojure with an emphasis on Clojure, so if Clojure people want something, they can easily contribute.

16:30 TimMc: Such as add and remove iguanas?

16:30 technomancy: why would you remove an iguana?

16:30 ibdknox: that's just ridiculous

16:30 doug: how can i read an environment variable in clojure?

16:30 TimMc: I don't know, ask Raynes!

16:31 doug: System/getProperty ?

16:31 Raynes: I've done a bit of work on Pygment's Clojure lexer, so the Clojure highlighting is better in refheap than in gist (though once gist updates its pygments, that'll change).

16:31 ibdknox: TimMc: professionalism and all that. Raynes is entering the working world soon, it's tainting him

16:31 Raynes: But our highlighting is more complex in general.

16:31 TimMc: Noooo

16:31 doug: maybe System/getenv

16:31 Raynes: System/getenv

16:31 TimMc: Ah, that's the one.

16:31 ibdknox: System/doTheRightThing

16:32 Raynes: randomnamehere: The biggest thing is that we can do whatever we want with refheap. Can't do that with gist.

16:32 llasram: the-kenny: Cool. Glad to help!

16:32 randomnamehere: Raynes: yeah

16:32 ibdknox: also it's fun?

16:32 that should be enough

16:33 Raynes: RefHeap doesn't really stand out from other pastebins yet, but it will. We've got lots of ideas. The issue tracker has most of them.

16:33 And as long as people like ibdknox are interested in it and using it, I'll still be motivated to work on it.

16:34 doug: not sure i like this

16:34 (if-let [dir (System/getenv "XDG_RUNTIME_DIR")] dir (System/getenv "HOME"))

16:34 randomnamehere: Nice Raynes, I like it

16:35 ibdknox: doug: use or

16:35 Raynes: It's also pretty awesome that it seems to have become the defacto pastebin for #clojure.

16:35 ibdknox: (or (System/getenv "X..") (System/getenv "HOME"))

16:35 Raynes: TimMc despises BrowserID but still recommends the site. :D

16:36 ibdknox: Raynes: I think TimMc might actually be a robot controlled by clojurebot

16:36 so I assume his motives are likely subversive

16:36 doug: ibdknox++

16:38 llasram: (inc ibdknox)

16:38 lazybot: ⇒ 7

16:39 randomnamehere: Raynes: I think the design is a bit dark

16:41 Raynes: Heh

16:41 TimMc: *beep*

16:41 I mean

16:41 ibdknox: Clojure is akin to dark magic

16:41 TimMc: "hah hah"

16:41 ibdknox: PROOF

16:41 Raynes: It'll get even darker when I work in codemirror because I'll be using the same color theme as the pastes.

16:41 * ibdknox takes a screenshot

16:44 randomnamehere: that makes my eyes tired ;(

16:44 ibdknox: huh

16:45 just use gist then :)

16:45 Raynes: I wasn't aware that dark colors easily made eyes tired.

16:46 ibdknox: it's a holy war

16:46 Bronsa: it's proven

16:46 Raynes: No colors I could ever choose would satisfy everybody.

16:47 ibdknox: Bronsa: source?

16:47 every time I've ever seen this come up, I've never seen anything even remotely close to definitive

16:47 Bronsa: i remember an article posted on HN some months ago

16:47 randomnamehere: Raynes: dark, non dark skin, switchable with javascript shortcut and remembering function will be a big plus

16:47 bigs: couple of people did a science

16:48 dan`b: or just tell people to use greasemonkey :-)

16:48 TimMc: or Stylish

16:48 randomnamehere: Write a URL shortener? Nice ?

16:48 I've written an image hosting app

16:48 amalloy: my IRC client is light-themed, and just looking at this discussion makes my eyes tired. counterexample right there?

16:48 dan`b: I find dark text/light backgrounds easiest, but that's just as likely to be habit as anything else

16:48 randomnamehere: but for url-shortener you'll need a short domain

16:48 technomancy: it depends on the lighting of the room you're in, among other things

16:49 tmciver: And I want a pony, and a train set and a . . .

16:49 ibdknox: randomnamehere: huh?

16:49 Raynes: ibdknox: He is talking about an issue.

16:49 bigs: eww url shorteners

16:49 Raynes: ibdknox: Where I mentioned I was considering writing a URL shortener.

16:49 TimMc: randomnamehere: Ugh, don't bring another URL shortner into the world, unless you're prepared to maintain it and defend it against spam.

16:49 ibdknox: oh

16:49 Raynes: TimMc: Me, bro.

16:49 randomnamehere: which is easy to remember and short = $$$

16:49 Raynes: Not him.

16:49 TimMc: Raynes: That goes for you too.

16:50 drostie: tmciver: rainbow dash is mine, get your own pony. :x

16:50 ibdknox: technomancy: we did a basic study at MSFT, the overwhelming majority preferred a dark theme

16:50 Raynes: Switchable colors on refheap are an idea. I'm just not sure people will ever spend so much time on the site as to have a chance to care.

16:51 TimMc: ibdknox: Dark theme allows more colors, as far as I can tell.

16:51 technomancy: the color of the background isn't even really the deciding factor; it's how much contrast is present between the background and the text

16:51 ibdknox: TimMc: significantly

16:51 amalloy: or notice. 75% of features on a website never get noticed by a user

16:51 Raynes: amalloy: That too.

16:51 I would never use it.

16:52 randomnamehere: thx technomancy

16:52 Raynes: RefHeap is bright enough that I can see it in sunlight.

16:52 randomnamehere: the contrast is the problem

16:52 haven't known how to tell...

16:52 Raynes: I was using a higher contrast color theme for the actual code a few days ago.

16:52 But some guy opened an issue complaining about it, and it hurt my eyes as well.

16:53 brehaut: the tricky thing with contrast is that as active lit screens get better, it becomes harder to get a good contrast for everyone

16:53 ibdknox: yeah, I don't sit there and stare at pastes all day that I would care about this

16:55 amalloy: a real friend of Raynes would make the refheap browser window always-on-top

16:55 Raynes: Of course.

16:56 randomnamehere: Raynes: why do you have a checkbox and not a create private & create public button on it?

16:56 Do not want to copy too much from gist? ;)

16:56 Raynes: Because having two buttons to do the same thing in different ways is tacky.

16:56 In slightly different ways*

16:57 Private vs non-private is a 'yes' or 'no' state, which is what a checkbox is for.

16:57 I'd rather have a button there though. A toggle button.

16:57 That changes colors when clicked.

16:57 But I'm not good enough with design to do that.

16:57 ibdknox: go go JavaScript

16:57 TimMc: Raynes: And shape, too.

16:58 Raynes: ibdknox: I think jquery ui has something like this.

16:58 I haven't looked into it though.

16:58 ibdknox: TimMc: it turns into a hypercube

16:58 TimMc: Raynes: I think like 10% of the population has some form of color vision defect or anomaly.

16:58 Raynes: It could be an open padlock icon that when clicked turns into a closed padlock icon.

16:58 randomnamehere: I talked to many people who said it is an advantage not to have a checkbox when adding company code and you miss out the checkbox ;)

16:59 More common than clicking on the wrong button

16:59 TimMc: randomnamehere: Umm... don't put company code on a public pastebin? o.O

16:59 randomnamehere: TimMc: only unsensitive things

16:59 TimMc: *shrug*

17:00 Raynes: Maybe instead of a checkbox or button at all, people can just cover up the pastebox with their hands to keep other people from seeing.

17:00 ibdknox: the troll gaze is strong with this one

17:00 Raynes: Private!

17:00 TimMc: Raynes: WORKS_FOR_ME

17:01 technomancy: more importantly, works for the TSA

17:01 ibdknox: lol

17:01 ~rimshot

17:02 clojurebot: Badum, *tish*

17:06 randomnamehere: TSA?

17:07 ibdknox: ..

17:07 Raynes: $google TSA

17:07 lazybot: [TSA | Transportation Security Administration | U.S. Department of ...] http://www.tsa.gov/

17:07 randomnamehere: nice

17:11 ibdknox: this is definitely going to attract good candidates: http://news.ycombinator.com/item?id=3681659

17:17 technomancy: anyone know enough about lein-ring to explain what the in-war-path does?

17:20 llasram: Provides a source of puns?

17:21 technomancy: yes, I can't help but think staring at all this code about wars is going to leave me with some violent tendencies

17:23 pipeline: ibdknox: i don't see a problem

17:23 ibdknox: my initial reading of it was basically "not very good? You can do this then!"

17:24 just the headline

17:25 TimMc: It looks cool on second glance only.

17:26 randomnamehere: have a look

17:26 https://refheap.com/paste/984

17:27 jodaro: that sounds like taskrabbi

17:27 t

17:35 uvtc: I'm finding that searching clojars for libs is not very fruitful, because the clojar pages I find only tell how to fetch the lib for my project. Very few seem to have a link back to their github page.

17:35 ibdknox: just use google/github search

17:35 or ask here

17:36 technomancy: uvtc: if you can report bugs with libraries that don't have URLs, it would be helpful

17:36 but 90% of them are easily found on github

17:36 how would I test if lein-ring uberwar worked?

17:36 do I need tomcat or something?

17:36 ibdknox: yeah

17:37 technomancy: booooooring

17:37 ibdknox: lol

17:37 I agree

17:37 uvtc: technomancy, I can do that. Maybe the community as a whole should plan a day to just pore over Clojars packages looking for ones that don't have a link ...

17:37 Or maybe that could be automated.

17:38 technomancy: it could and should be automated

17:38 the clojuresphere codebase would make it easy

17:38 sounds like a great starter project for someone looking to learn Clojure! =D

17:38 randomnamehere: Is there a collection of useful clojure links?

17:38 uvtc: Unable to find clojuresphere on clojars search {ducks} :)

17:38 technomancy: haha

17:39 http://clojuresphere.herokuapp.com

17:45 ibdknox: http://www.clojure-toolbox.com/

17:47 jeffdik: off to the Greenville Java Users Group ... I really need to start a Clojure Users Group

17:48 uvtc: ibdknox, thanks for that link. Didn't know about it.

17:48 TimMc: jeffdik: Subvert the acronym and turn it into a JVM Users Group

17:50 uvtc: technomancy, will look into the source code for clojuresphere. Hopefully though someone will beat me to that project.

17:50 s/someone/someone else/

17:53 justicefries: la clojure vs enclojure vs emacs?

17:55 TimMc: Emacs if all else is equal.

17:55 But go with what you know.

17:55 justicefries: I didn't catch that, I had to restart and my ZNC didn't catch me up

17:56 TimMc: justicefries: Emacs if all else is equal, but go with what you know.

17:56 technomancy: don't learn emacs and clojure at the same time

17:56 amalloy: he said if you don't use emacs you're lame

17:56 justicefries: I'm a vim user. :D

17:56 but SLIME seems wrong.

17:56 TimMc: amalloy and technomancy are both correct.

17:56 justicefries: You can use vim with Clojure!

17:57 justicefries: I have the VimClojure plugin.

17:57 * TimMc volunteers Raynes to deal with any vim questions

18:02 gtrak`: should new clojure users use lein 2 or stick to 1.7 for now?

18:05 technomancy: gtrak`: probably best for them to stick with 1.x for now

18:06 gtrak`: that's what I figured

18:12 I emailed that riddell.us guy like two weeks ago to take his shit down, now I have a friend that got confused by him... grrrrr

18:12 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.grrrrr

18:33 acagle: /flush

18:36 seancorfield: hey perezd !

18:36 perezd: hey there

18:38 rfgpfeiffer: org-babel clojure support still requires slime

18:43 technomancy: can I run clojure-jack-in conditionally only when it is not connected yet?

18:45 technomancy: sure, just check slime-connected-p first?

18:47 rfgpfeiffer: thanks, i forgot that emacs uses -p on predicates

18:47 sjl: I've got two libraries I want to glue together: metrics-clojure and ring. What's the right way to structure this? A contrib.ring namespace in metrics-clojure? A separate metrics-clojure-ring project?

18:48 ibdknox: sjl: separate project

18:48 technomancy: rfgpfeiffer: elisp tip: pretend it's the 80s

18:48 sjl: ibdknox: yeah, that's what I was leaning toward

18:48 brehaut: technomancy: replace everything with a 4GL?

18:49 technomancy: brehaut: pretend your language is to primitive to support non-alphanumerics in identifiers is what I was thinking

18:49 brehaut: technomancy: thats probably less of a handicap

18:49 sjl: ibdknox: unrelated, but where can I send pull requests for Noir's website/docs? I don't see a docs/ folder in the noir repo or a gh-pages branch...

18:50 ibdknox: sjl: what's the bug? http://github.com/ibdknox/webnoir

18:51 technomancy: holy smokes; lein-ring is sloooooooow on lein1

18:51 what the heck

18:51 sjl: ibdknox: I think the middleware page should give an example of using a middleware that takes arguments... had to hunt around to figure out it's not (add-middleware (foo "arg")) like it would be if you were using ->

18:53 ibdknox: sjl: ah, looks like the add-middleware docstring could just use a little adjusting

18:54 arohner: If I have a fn that needs to use (locking), is there an idiom for the monitor to use that's similar to _ in variable names?

19:02 technomancy: weavejester: hey

19:03 TimMc: riddell.us 1 2 3 4 testing

19:03 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.testing

19:04 TimMc: amalloy: Why does lazybot append the last word of my msg there?

19:04 qbg: It's too lazy to drop it?

19:07 amalloy: huh

19:07 my lazy regex, i guess

19:09 sjl: hmm, so I'm making a new project that I want to test. I symlinked it into checkouts, but leiningen is still trying to find it online, and I haven't uploaded it yet

19:09 amalloy: actualyl i have no idea. the regex looks fine, and the code for handling it looks fine too

19:09 sjl: do I need to do something special to make it look in checkouts/ for dependencies?

19:09 * qbg generated a cond-like macroexpansion using map + reduce

19:09 TimMc: sjl: I think it will still try to download it, even if it isn't going to be on the classpath.

19:09 Not going to guarantee that, though.

19:09 sjl: hmm

19:09 technomancy: slj: do a lein install in the dependency

19:09 TimMc: Or rather, it is probably *shadowed* on the classpath.

19:10 sjl: so how do I develop the initial version?

19:10 technomancy: the source will still be preferred

19:11 sjl: technomancy: ah, ok, thanks

19:13 qbg: My persistent memory tables for core.logic are statistically significantly faster than rels by a hair. (thanks to criterium for benchmarking)

19:21 sjl: ibdknox: is there any way to use Noir and cheshire at the same time? Right now it seems Noir requires clj-json which requires Jackson 1.5 and Cheshire requires Jackson 1.9.5...

19:22 ibdknox: sjl: 1.3.0-alpha10 is stable despite the name and uses cheshire

19:22 sjl: ibdknox: Hmm... how would I support people running earlier versions of Noir?

19:24 TimMc: sjl: You may be able to pin the version of Jackson to 1.9.5

19:25 which *should* be backwards compatible, since it is the same major version

19:26 ibdknox: I think I tried to do that and it failed epically

19:26 I may have just been doing it wrong though

19:27 technomancy: (ns clj-json.core) (def encode cheshire.core/encode) (def decode cheshire.core/decode)

19:27 ibdknox: actually, I think I just put them in the same project. I didn't force the jackson version

19:29 johnmn3: evenin'

19:53 weavejester: technomancy: Should we talk this over in IRC rather then in the GitHub issues?

19:54 technomancy: works for me =)

19:54 weavejester: technomancy: ring-server depends on Ring 1.0.2, so the beta version of Hiccup 1.0 shouldn't be in your deps

19:55 technomancy: weavejester: oh, super

19:55 weavejester: I guess it only would have been a problem if we moved run-server into ring-devel

19:56 weavejester: technomancy: I don't think it would have been a problem even then…

19:56 technomancy: Is ring-server not working for you?

19:57 technomancy: weavejester: I played around briefly with moving it into ring-devel before I heard about ring-server, and it broke in my project that was using old-hiccup. I haven't tried ring-server

19:57 weavejester: technomancy: Oh, you were using the master branch of Ring?

19:58 technomancy: yeah

19:58 weavejester: technomancy: That's a 1.1 snapshot. I have a "1.0" branch for continuing version 1.0 stuff (patches etc.)

19:58 technomancy: gotcha; cool

19:58 weavejester: technomancy: Mark's always been big on trying stuff as external libraries first, so although ring-server and lein-ring might end up in Ring (maybe 1.2), they'll be separate libraries first.

19:59 technomancy: Can a plugin add a dependency to the project map before running eval-in-project?

19:59 technomancy: i.e. inject a dependency

19:59 technomancy: weavejester: yeah, my WIP branch does that

20:00 weavejester: technomancy: Awesome. Okay so this weekend I'll finish off ring-server. It's nearly done anyway.

20:00 technomancy: weavejester: excellent

20:00 weavejester: technomancy: And then it's just a case of injecting the dep and running eval-in-project.

20:01 technomancy: weavejester: plus a couple other changes to avoid using :library-path

20:01 but yeah, that's all hacked out

20:01 weavejester: technomancy: Do you have code to that effect?

20:01 technomancy: yeah, it's all together on the WIP branch

20:01 for the record, lein2 is waaaay faster to uberwar than lein1

20:02 weavejester: technomancy: Ah, awesome. I'll take a look when it's not 1am :)

20:02 technomancy: heh; sure =)

20:02 weavejester: technomancy: BTW, do you work for Heroku these days?

20:02 technomancy: the war/uberwar stuff works with my existing pull request + the data.xml one

20:02 yeah

20:02 got to spend the morning moving clojars off sha1 for passwords

20:02 weavejester: technomancy: I almost ran into Mark in London. He's at QCon, right?

20:03 technomancy: due to the npm breach

20:03 oh yeah, I think so

20:03 too bad you missed him

20:03 I can't make it to euroclojure this year but am looking forward to next time

20:04 weavejester: technomancy: I was just about to say hi when Rich's talk started, so I figured I'd wait until after, but he snuck out before the second talk

20:05 technomancy: Hopefully I can catch him before he heads back and buy him a drink :)

20:08 callen: technomancy: wait, people actually use sha1 for passwords? :(

20:08 who...why? :(

20:08 technomancy: callen: =(

20:08 callen: it's amazing that clojars has survived for so long without a maintainer

20:09 https://github.com/ato/clojars-web/graphs/impact <- last nontrivial work: nov 2011

20:09 2010 rather

20:10 devn: :(

20:12 technomancy: anyway, as soon as I hear back from him I'm going to deploy the bcrypt branch

20:12 ...and possibly wipe out the existing sha1 hashes

20:20 weavejester: technomancy: Wouldn't that wipe out everyone's passwords?

20:21 technomancy: yes

20:21 but you don't need your password to do anything except change your pubkey and add people to groups

20:21 because everything else goes through SSH

20:24 weavejester: technomancy: So how do I get into my account if the password is wiped?

20:24 technomancy: there's a password reset

20:24 TimMc: technomancy: Would you consider a migration period? Logins match against SHA1 and generate new bcrypt.

20:25 technomancy: we have to wipe the old hashes anyway because not everyone still uses clojars

20:25 TimMc: Wait... this isn't just for login passwords?

20:25 technomancy: this is just for the web ui

20:25 oh crap

20:26 the forgot password functionality emails it in cleartext

20:26 weavejester: The way I've seen migrations done is to add a "password type" column, and mark all the existing passwords as SHA1

20:26 TimMc: technomancy: *nice*

20:26 So you can do the migration!

20:26 gfredericks: technomancy: email an immediately-expired password?

20:26 weavejester: Then when a user logs in, convert the password to BCrypt and change the "password type"

20:27 sritchie: any core.logic experts around?

20:27 weavejester: technomancy: How can the forgot password mail it in cleartext if it's SHA1-hashed?

20:27 gfredericks: probably a new password

20:27 technomancy: weavejester: yeah, it's a new one

20:27 still horrible

20:27 TimMc: oh, OK

20:27 weavejester: Oh right

20:27 gfredericks: technomancy: ROT13!

20:28 technomancy: aw yeah

20:28 weavejester: Horrible why? Because there's no time limit?

20:28 With plaintext email you have to send something that can potentially be subverted.

20:29 technomancy: hmm... I was thinking it's horrible because it doesn't force you to change it once you log in

20:29 weavejester: Ohh

20:29 technomancy: but the fact that it's random is probably enough to convince you to change it =)

20:29 TimMc: weavejester: Best is a one-time login URL that allows password setting.

20:29 gfredericks: technomancy: nah, you just use gmail search whenever you need to enter your password

20:29 TimMc: technomancy: I'd be more convinced to change it if it were "password123".

20:29 weavejester: TimMc: With a time limit on the login

20:29 TimMc: weavejester: right

20:30 weavejester: I had a neat scheme for sending emails over HTTPS...

20:30 gfredericks: diffie-hellman?

20:30 * gfredericks never minds

20:31 weavejester: I need to write it up at some point, even if plaintext email has too much momentum, it's an interesting theoretical exercise.

20:31 technomancy: I guess sending a plaintext fresh password is OK if you make it clear it needs to be changed once they log in

20:31 it's not pratically any different from a reset token

20:32 romanandreg: has anyone had come with this issue on Clojurescript's `cljs.closure/build` function: java.lang.AssertionError: Assert failed: Can't recur here|frame

20:32 ?

20:33 trying to figure out why is happening

20:34 TimMc: Ugh, I've seen that. I think it's a compiler bug?

20:34 romanandreg: do you know what might cause it?

20:35 TimMc: Nah, it's one of the reasons I gave up on writing try-cljs.com

20:35 That was a bit ago, though!

20:37 romanandreg: hehe

20:38 callen: technomancy: so you moved it to bcrypt or some equivalent...riiight?

20:38 technomancy: callen: yeah, just waiting to hear back from ato before I deploy

20:39 https://mobile.twitter.com/technomancy/status/177863341371424768

20:39 callen: technomancy: thank you, I've been trying to kill the "salts are fine" fallacy for several years now.

20:40 or more specifically, fast hash algo + salt

20:40 technomancy: it's pretty cool to just tweak the work factor and watch the slowdown double

20:40 callen: technomancy: >:password "fuuuuuu" \n lol

20:40 clojurebot: Excuse me?

20:41 TimMc: Good stuff.

20:53 technomancy: ok, it turns out rehashing on successful login is easy

20:53 callen: technomancy: I would hope so. you've already got the data, just re-encrypt with bcrypt and stash it.

20:54 technomancy: who is maintaining clojars?

20:54 technomancy: nobody

20:54 well

20:54 I am, now.

20:54 callen: do you have control over the domainz/

20:54 domain?

20:54 technomancy: the original author has agreed to let me move it to heroku once I port it to postgres and s3

20:54 but that's still a ways away

20:55 callen: I always forget you're a heroku employee.

20:55 technomancy: I've got Big Plans for clojars

20:56 alex_baranosky: technomancy, do you have a list of those plans anywhere?

20:57 technomancy: alex_baranosky: the tl;dr: http://p.hagelb.org/clojars-todo.html

20:57 I plan on drafting up a more concrete proposal soon

20:58 once we have HTTP deploy it will be a lot easier to hack on

20:58 alex_baranosky: technomancy, looks great.

20:59 johnmn3: technomancy looks great?

20:59 alex_baranosky: johnmn3, his list of changes to clojars that he posted

20:59 technomancy: heh

20:59 johnmn3: oh.. right...

21:00 sorry, I just came in on the tail end of that conversation. :)

21:00 xeqi: +1 for browse web interface / older versions

21:00 that was gonna be one of the first things I looked at

21:00 johnmn3: I'm pretty stoked about the api

21:01 hoping to see it used in clooj in the future

21:01 technomancy: which api?

21:01 oh, leiningen-core?

21:01 johnmn3: yea

21:02 technomancy: hopefully!

21:03 johnmn3: Thing about clooj though, the source is straight up java written in clojure. I was thinking trying to move some of clooj to seesaw.

21:08 so I'm making a program that helps analysts operate a web interface that they use to process research items. and I'm thinking about what kind of licensing to use when selling the program to their organization.. per seat licensing or per resarch item.

21:09 essentially, the tool takes a ten minute per item processing time and brings it around 4 minutes.

21:10 So it more than doubles productivity, so I'd like to lean toward charging per item.

21:14 anyone have any experience with those kinds of contracts?

21:30 amalloy: that doesn't sound like a #clojure question at all. ask in #what-do-i-charge-for-software or something?

21:30 qbg: They're called "lawyers"

21:30 technomancy: yeah, this is a hippie channel; none of this money stuff.

21:31 qbg: Tort law is hard, get someone who is good at it.

21:32 TimMc: technomancy: I wonder if it's kosher to bcrypt-hash the SHA1 hashes.

21:32 gfredericks: TimMc: I bet it is

21:32 TimMc: I know that double-encrypting can actually make encryption weaker in some circumstances, but I don't know if that applies to hashes.

21:33 technomancy: TimMc: I think with the rehash-on-login we can just hold off and wipe the sha hashes in a couple weeks

21:34 TimMc: OK, great.

21:36 qbg: dnolen: Persistent memory tables for core.logic are coming along great

21:37 technomancy: johnmn3: kidding btw; I just doubt folks in here have much useful experience with that.

21:37 * TimMc sues technomancy for misrepresenting him

21:38 dnolen: qbg: whoa!

21:38 qbg: awesome

21:38 qbg: query performance is a hair faster than rels for the single index case

21:39 (as per criterium)

21:40 Once try to improve on the update functions and maybe write a few more tests, it might be ready for an enhancement on JIRA

21:40 dnolen: qbg: excellent

21:40 qbg: I got a >100x speed up during dev by writing a macro :)

21:41 dnolen: heh

21:41 qbg: They can also be faster than rels in the multiple index case because I do more aggressive query optimization

21:41 Though it does introduce an overhead

21:42 Before I special cased the single index case, it was ~1.3x slower than rels

21:43 gtuckerkellogg: i bought the PDF rough cut of the forthcoming O'Reilly "Clojure Programming" book

21:43 dhconnelly: how is it?

21:43 i just preordered the print book

21:43 gtuckerkellogg: TERRIFIC

21:44 damn it is great

21:44 dhconnelly: awesome

21:44 gtuckerkellogg: i became aware of it because there was a github repo with the code samples, and it pointed me to the book

21:44 but now that i have the book, i can't find the github repo

21:44 D'oh!

21:45 dhconnelly: they have a twitter for the book

21:45 if you haven't seen it

21:45 technomancy: go cemerick =D

21:47 y3di: guys im having trouble understanding this snippet of code from http://eddology.com/post/14592579289/busy-persons-clojure

21:47 (if-let [prev-count (results score)] (assoc results score (inc prev-count)) (assoc results score 1)))

21:47 cemerick: gtuckerkellogg: sample projects will be here once I get them cleaned up: https://github.com/clojurebook

21:48 gtuckerkellogg: follow @ClojureBook or subscribe to the ML on http://clojurebook.com to be notified when it lands

21:48 y3di: specifically, [prev-count (results score)] im not sure I underestand how prev-count works

21:48 gtuckerkellogg: best IRC session ever

21:48 johnmn3: technomancy: okay, how about the eclipse license? What kinds of constraints to I have from a business perspective? If I deploy a gui, do I have to provide my source code?

21:48 cemerick: gtuckerkellogg: and, thanks for the kind words :-) Tell your friends. ;-)

21:49 gtuckerkellogg: cemerick, it's a great read. I'll be notified of its landing when the hard copy arrives on my doorstep :)

21:49 TimMc: cemerick: What audiences does it target?

21:50 tmciver: y3di: [prev-count (results score)] is a binding form; results is a function call with arg score. The result of that function call are bound to the var prev-count.

21:50 cemerick: TimMc: The relevant part of the preface is excerpted at the top of http://clojurebook.com :-)

21:50 TimMc: thanks

21:50 tmciver: y3di: see the docs for let.

21:50 cemerick: tl;dr: engaged Java devs + ruby/python devs

21:50 TimMc: interesting

21:51 cemerick: a.k.a. introduction to Clojure with no bullshit and high expectations

21:52 Christophe put some killer generified maze generation and game of life impls in there.

21:52 brehaut_: it happens to have the best enlive introduction around

21:52 (not surprising)

21:52 cemerick: (just an example)

21:52 gtuckerkellogg: "introduction to Clojure with no bullshit and high expectations" should be the official subtitle

21:53 * cemerick apologizes to #clojure for the plug

21:53 gtuckerkellogg: No need cemerick. I'll shill

21:54 cemerick: I try to avoid it, esp. around here. People are subjected to my yammerings enough as it ls. :-)

21:54 brehaut_: cemerick: s/yammering/fondness for rhetoric/ ;)

21:56 cemerick: brehaut_: hah; I think it was hiredman that said something like "oh, I saw a reply from cemerick, but knew I wouldn't be able to get through the wall of text" :-P

21:56 brehaut_: lol

21:57 cemerick: "let me add my 2¢, but first, I will thrill you with 'Ode to the Closing Parenthesis', in 7 parts"

21:58 brehaut_: haha

21:58 gtuckerkellogg: haha

21:58 qbg: dnolen: It also looks like if Rels are ported to persistent memory tables, a few outstanding JIRA issues could also be closed.

22:06 dnolen: qbg: excellent

22:30 * qbg is becoming slightly annoyed by the British spelling in Criterium

22:30 qbg: b

22:30 hugod: qbg: written by a brit...

22:31 qbg: b

22:32 'optimisations' just looks weird to this American

22:32 But strangely, labour does not

22:32 brehaut: qbg: aluminium or aluminum ?

22:33 technomancy: 'merikins; what do they know about spelling anyway

22:33 qbg: They both look weird :)

22:34 Other than that, Criterium is very excellent

22:35 amalloy: fwiw i prefer optimisations to labour

22:35 but i'm pretty tolerant of british spellings. i read a lot of their books

22:35 hugod: qbg: glad you are finding a use for it :)

22:36 qbg: If I was writing it, the line would be "Warming up the JIT", but it isn't a deal breaker at all :)

22:36 brehaut: about the only american spelling that actually bugs me these days is 'mom'

22:37 qbg: What is the British version of mom again?

22:37 brehaut: mum

22:38 technomancy: amalloy: they do have some good ones, don't they

22:38 mum is fine; mummy still weirds me out a bit

22:38 qbg: Cookie vs biscuit is still something I can't fully comprehend

22:38 jodaro: crisps

22:39 brehaut: technomancy: are we still talking the parential relationship, or the desiccated cloth wrapped corpse?

22:39 amalloy: why can't it be both?

22:39 qbg: Be nice to your mother!

22:39 :p

22:42 hugod: I occasionally catch my self using gas, trunk, or hood, but not very often

22:42 * qbg needs to watch more BBC

22:43 * gfredericks watches QI a lot

22:43 qbg: b

22:43 gfredericks: c

22:43 qbg: Why can't the cursor go where I'm looking? :(

22:44 gfredericks: qbg: you should use longer passwords

22:45 qbg: Don't edit cross VM

22:45 More specifically, don't use Emacs cross VMs

22:45 gfredericks: qbg: two cursors blinking at the same time?

22:45 qbg: Yep

22:46 gfredericks: shell into the vm!

22:46 qbg: I forget why I'm using IRC from Windows, when I could be using it from Linux instead

22:51 brehaut: time for the weekend. later!

22:52 xandrews: is it possible to create an object if I am looking it up at run-time? for example (new (lookup-class :foo))

22:52 qbg: Yes, using reflection

22:53 For example, (.newInstance (Class/forName "java.util.ArrayList"))

22:54 For ctor args you'll have to lookup the appropriate ctor first

22:54 xandrews: ah, didn't know about .newInstance

22:55 that doesn't seem to work for records though

22:55 qbg: .newInstance is for zero arg constructors only

22:59 (.newInstance (.getConstructor (Class/forName "java.util.ArrayList") (into-array Class [java.util.Collection])) (into-array [[1 2 3]]))

22:59 (java.util.ArrayList. [1 2 3]) is so much easier :)

23:00 xandrews: yeah... I could use multimethods, but the body of the method would just be repeated for each type

23:00 qbg: 1.3 defines ctor functions for records

23:01 (defrecord Foo [a b c]) defines ->Foo

23:01 It also defines map->Foo

23:02 Maybe you'll want to use those instead?

23:03 xandrews: ohh map->Foo is nice... not sure it helps in my case... I suppose i could store a reference to map->Foo instead of Foo itself

23:03 qbg: You could reflect on the Clojure namespace

23:04 (resolve (symbol (str "map->" "Foo")))

23:04 or ns-resolve

23:05 xandrews: cool. so i have a couple of decent options now. thanks!

23:05 For some reason .getConstructor is not defined for the record

23:06 qbg: Are you calling it on the class?

23:07 xandrews: yeah. I also tried using class/forName like you did above

23:07 qbg: (.getConstructor Foo (into-array Class [Object Object Object])) works for me

23:10 Are you trying this at a REPL? Did you verify your classes are really classes?

23:10 xandrews: oh my bad.. I guess the argument to getConstructor is the array of arguments?

23:10 qbg: Yes

23:10 It is varargs

23:10 xandrews: ok. that was my problem

23:10 sorry. not a java guy

23:10 qbg: varargs are nasty for interop

23:12 romanandreg: has anyone has had an issue with cljs/gclosure that the cljs.core.fn function is not defined?

23:14 I'm doing development mode, and when I do require in an script tag of the webpage I get this failures https://skitch.com/romanandreg2/8etp1/cljs-issue-1

23:14 super annoying

23:14 also when doing a goog.require('library') I get an error from FF

23:15 https://skitch.com/romanandreg2/8etp5/cljs-issue-2

23:24 dnolen: hmm lein2 foo doesn't seem to work

23:26 technomancy: dnolen: is it the NPE when you run outside a project?

23:26 or something else I should fix before preview2?

23:26 dnolen: technomancy: sorry I meant, lein2 new foo doesn't work

23:27 technomancy: what's wrong?

23:28 dnolen: Exception in thread "main" java.lang.NullPointerException

23:28 at leiningen.core.classpath$resolve_dependencies.doInvoke(classpath.clj:88)


23:28 technomancy: yeah, looks to be the same bug

23:28 fixed on master, but I'll get preview2 out asap

23:28 dnolen: k, thx

23:29 has anyone got the datomic appliance to actually work?

23:39 devn: dnolen: not i...yet

23:40 dnolen: where are you stuck at?

23:40 dnolen: devn: just doesn't work

23:41 devn: that's vague. what's broken?

23:41 like you go to X, and Y never happens...

23:41 dnolen: devn: error starting up the image

23:41 devn: on AWS?

23:41 technomancy: dnolen: "lein2 upgrade" should take care of you

23:41 dnolen: devn: no on my machine via virtual box

23:41 technomancy: thx

23:41 devn: OSX?

23:42 dnolen: devn: yes

23:42 devn: dnolen: hm -- ill give it a try

23:43 dnolen: i finally got to watch the minikanren/ckanren talk from clojure/conj this past year

23:43 dnolen: devn: whadya think?

23:43 devn: I laughed out loud, man.

23:43 fantastic talk. incredibly interesting ideas.

23:44 and good people 'taboot 'taboot. :)

23:44 kibitz is the beginning of the promise that has been core.logic, for me anyway

23:44 and then ambrose tweeting about typed clojure

23:44 * devn *mind explodes*

23:45 devn: this community is wonderful.

23:47 dnolen: devn: haha, yeah the Friedman & Byrd talk is hilarious

23:48 uvtc: Is there a function naming convention regarding leading or trailing hyphens? I see that I'm supposed to use "-main" for the name of my project's "main" fn.

23:48 dnolen: technomancy: thx, seems fixed now!

23:49 devn: also agree that kibit looks neat

23:49 technomancy: great

23:51 uvtc: it means it's a java method

23:51 or it's traditionally used in java method names anyway

23:51 uvtc: technomancy, !

23:53 technomancy, when I write a "main-" fn in my core.clj, I also put a (:gen-class :main true) at the top...

23:54 (in the `ns` call)

23:54 devn: dnolen: it's thanks to you that kibit exists

23:54 technomancy: uvtc: yes, that's necessary to make an uberjar work

23:54 (but not to use "lein run")

23:54 uvtc: technomancy, Right -- I've seen that firsthand.

23:54 devn: dnolen: i have grand plans for unifying all of the exploratory tools that have come to exist in clojure

23:54 dnolen: with some new ones for fun

23:54 pardon me, fn

23:55 uvtc: technomancy, I'm trying to understand what you mean by "it's a java fn"...

23:55 technomancy, sorry -- java method.

23:56 dnolen: devn: thx! but really thanks to lots of people!

23:56 uvtc: In what other case would you write a method with a trailing hyphen?

23:57 devn: dnolen: yeah, I don't mean to give all the credit, but it is a fact that without you core.logic wouldn't exist

23:57 so...thanks, to you and everyone else

23:58 uvtc: Searching for "hyphen" at clojure.org isn't turning anything up for me.

23:59 technomancy: uvtc: by default, gen-class finds all defns with a - prefix to turn them into methods

23:59 (this can be changed)

Logging service provided by n01se.net