#clojure log - Feb 27 2013

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

0:43 dcolish: alandipert: i have to say i find the similarities between these forms disturbing, but i dont see a nice way to factor them out without adding more complexity elsewhere or with a macro https://gist.github.com/dcolish/c810e10ea928d78c2ca2

0:44 i came up with something close but innermost fn kept receiving the wrong arity for some reason

0:45 Raynes: alandipert: laser 1.1.1 has xml support.

0:47 alandipert: Raynes: sweetness, thx!

0:47 Raynes: I saw the ping and thought you called me sweetness for a second there.

0:47 alandipert: dcolish: it's kinda tricky too because they start with different classes

0:47 dcolish: if it were me i'd probly leave as is, it's clear now what the differences are imo

0:48 dcolish: and at least for me, a macro would make the situation less clear probly

0:48 dcolish: yeah its just turning out to be a mess; i guess i'm just not sure how far to push things and what is really idiomatic

0:48 alandipert: Raynes: na i can't ever visit you if you have a restraining order against me

0:49 * Raynes sets the paperwork aside just in case.

0:50 alandipert: dcolish: are you making more than 2 of those functions?

0:50 dcolish: because if you had like 5+ in play i'd say macro time

0:51 Raynes: lol

0:52 dcolish: alandipert: no there is really only a need for a read and a write builder

0:53 those are really the only ops you can do against a cube

0:54 its still way better than the raw interop i had before

1:01 is it common to hoist inner java classes/enums into a flatter namespace?

1:05 nonuby: whats the easiest way to 3000 to $3,000 ? tried clj money backed by org.joda.Money but the only .toString yields "USD 3000.00"

1:07 amalloy: $google java currency format

1:07 lazybot: [Java Currency Number format - Stack Overflow] http://stackoverflow.com/questions/2379221/java-currency-number-format

1:07 dcolish: did you set it to use grouping?

1:08 nonuby: yeah :D (.format (NumberFormat/getCurrencyInstance) 3000)

1:12 dcolish: seems like this would work http://joda-money.sourceforge.net/apidocs/org/joda/money/format/MoneyAmountStyle.html#ASCII_DECIMAL_POINT_GROUP3_COMMA ?

1:18 hmm nope that's only for reading in

1:18 what a confusing api

1:20 nonuby: just went with java.text.NumberFormat, cant see a need for heavy weight org.joda.Money

1:33 leku: hey should I bother trying to get clojure going in Windows, or just run this on a Linux VM?

1:33 looks like leiningen might not be as well supported on Win as *nix

1:34 rabbit_airstrike: I haven't tried running clojure on windows but I can tell you it's pretty frictionless in an ubuntu VM

1:34 leku: yeah i'll just go to that

1:34 I wanted to play with the lighttable IDE, maybe I can connect to my project hostd on the ubuntu VM

1:36 rabbit_airstrike: whoa, that looks like a pretty IDE :)

1:37 leku: ah I see you're unaware..

1:37 it was all the rage a few months ago I think because of a slashdot post

1:38 rabbit_airstrike: yeah I'm kind of new at this community thing

1:39 a few months ago I was a research assistant in a cognitive neuroscience lab on the academic track. Then I took a bit of a left turn and became a software developer

1:40 leku: hah cool

1:40 and you found clojure?

1:40 rabbit_airstrike: it's what the company I joined was using, so I picked it up.

1:40 leku: cool

1:40 rabbit_airstrike: I love it so much more than R and Matlab

1:40 and I thought I loved R

1:40 leku: interesting

1:41 I was going to do the free codeschool.com class on R, haven't gotten around to it yet

1:41 rabbit_airstrike: trying to code in R after getting access to real primitive data structure support was tough

1:41 named lists just aren't the same as maps

1:42 leku: hmm.. well i'm gonna get back to this

1:42 http://www.chris-granger.com/2012/11/09/lighttable-and-the-node-knockout/

1:43 rabbit_airstrike: yeah, I'm totally going to look into that too

1:43 leku: werd

1:43 enjoy

1:48 shriphani: hi everyone. I have a question about using a java class with clojure. What is considered the best practice for (require [])'ing a java class ? Should we just do the namespace or is the class ok too ?

1:51 leku: (ns my-app

1:51 (:use what.ever)

1:51 (:require [what.else] :as something]))

1:59 shriphani: leku: I have another question about a require. I have this maven repo in my project.clj and lein deps runs ok. How do I go and import it (using require) in my project file: http://mvnrepository.com/artifact/org.jwat/jwat-warc

2:00 leku: i don't even know if i answered your qusetion i'm a clojure noob..

2:00 i was just looking at some sample 'noir' code

2:00 shriphani: ah..

2:01 leku: sorry

2:01 shriphani: I find clojure's error msgs quite hard to penetrate else I would've googled around.

2:05 Sgeo_: use/require is for Clojure code, to mention a Java class smoothly, you need to use import

2:05 shriphani: Sgeo_: I see.

2:06 Sgeo_: (ns blah (:import (some.package aclass))

2:06 )

2:06 I think

2:06 (doc import)

2:06 clojurebot: "([& import-symbols-or-lists]); import-list => (package-symbol class-name-symbols*) For each name in class-name-symbols, adds a mapping from name to the class named by package.name to the current namespace. Use :import in the ns macro in preference to calling this directly."

2:06 Sgeo_: You should also be able to just use the fully qualified name of the class, without import

2:46 Frozenlock: If I have two compojure webserver (A and B), would it be possible for A to connect to B, and then for B to become the 'client' while maintaining the connection? My goal here is to to browse A, which is behind a firewall, by using B.

2:50 nonuby: hiccup code, got a for loop (for [villa (get-villas) [:li (:villaName villa)]) but now I want to include the index so 0 - name1 1 - name2 and so forth, easiest way?

2:52 Frozenlock: nonuby: Not really the answer you are looking for, but there's now a css property to add count in a list.

2:52 but I don't remember the name... :(

2:52 nonuby: yeah but this public web facing so I dont think ie8 works.

2:53 Frozenlock: You have a bad attitude. The correct attitude is 'fuck IE'.

2:54 nonuby: my clients is attitude is 'fuck you nonuby, 52% of our visitors are ie (with most being 8)

2:55 Frozenlock: Sad...

2:55 nonuby: it is indeed

2:55 Frozenlock: A possible solution could be to use `dotimes'

2:58 nonuby: sure someone will shoot me but what about (for [villa (zipmap (get-villas) (range)] (s-exp))

2:59 with destructing (for [[villa index] (zipmap (get-villas) (range)] (s-exp))

3:04 Frozenlock: , (let [villas ["a" "b" "c"]] (->> (interleave villas (-> villas count range)) (partition 2)))

3:04 clojurebot: (("a" 0) ("b" 1) ("c" 2))

3:06 efjboss: map-indexed would perhaps be better

3:06 nonuby: found I can use (map (fn [villa index] [:p index (:name villa) ]) (get-villas) (iterate inc 1))

3:06 doh map-indexed perfect fit

3:07 * Frozenlock adds map-indexed in his must use' functions list

3:07 Frozenlock: 'must use'

3:08 headshot: 'must-use

3:08 shriphani: hi. another question about clojure. I have a java function that is to be used like while ((wrec = obj.getNextObject()) != null). Is there a way to wrap around this so that I can map etc in clojure. The while loop looks awkward in clojure.

3:09 Frozenlock: I'm not very good at reading java, but are you looking for `take-while'?

3:10 shriphani: Frozenlock: the object isn't an iterator either.

3:13 Frozenlock: (take-while true? (enumeration-seq <some-java-enum>))

3:14 Or is an iterator the same thing as an enumeration?

3:14 arrr.. true? isn't the correct one

3:15 shriphani: I could try using repeatedly on the object and wrap a seq that way.

3:15 nonuby: (take-while identity (repeat #(.getNextObject obj)) ) maybe

3:15 shriphani: nonuby: identity ?

3:17 nonuby: should work (take-while identity [0 1 2 3 nil nil nil 4 5 6])

3:17 shriphani: oh so a java null is false in clojure ?

3:18 I'm sorry I am such a noob. I've only used racket in the past as my primary lisp.

3:18 nonuby: nil is java null, and i null and false are the only falsey values in clj - i believe (newb here too)

3:18 Frozenlock: I don't think null is in clojure...

3:18 , null

3:18 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: null in this context, compiling:(NO_SOURCE_PATH:0:0)>

3:19 Frozenlock: But I know nothing of this dirty java :p

3:20 shriphani: google tells me a clojure nil is a java null.

3:20 should I trust that ?

3:20 nonuby: yes

3:21 verify by inversion (.indexOf "abcdef" nil) gives you a null pointer exception

3:24 shriphani: nonuby: that seems to work. Thank you very much

3:28 pwned: with all the parentheses clojure still looks short https://gist.github.com/anonymous/5046280

3:29 shriphani: hi. I have another question. I can see that the docs allow something like obj.foo(). How do I do obj.foo.bar() ?

3:29 (foo/bar obj) isn't working.

3:29 nonuby: could be written (map (partial * 2) [1 2 3]) technically longer but no # or %

3:30 Raynes: shriphani: Count the parentheses.

3:30 shriphani: Raynes: my editor says the parens are balances.

3:30 nonuby: shirphani (-> (.foo obj) .bar)

3:31 shriphani: wow wtf...

3:31 pwned: nonuby: so partial is lambda ?

3:31 Raynes: The Ruby and Python versions both have 4 brackets of varying types. The Clojure version has 6. That means there are merely two more brackets than those other versions.

3:32 The distance between them isn't that great.

3:32 It's more about where the parens are in the Clojure code.

3:32 pwned: Raynes: yes, for some reason sexpr start and end with parens

3:32 I wish it didn't.

3:32 nonuby: pwned, I would have to google what exactly the formal definition of lambda is, but partial returns a function ready to use, currying I believe its called

3:33 Raynes: That isn't currying.

3:33 It's partial application.

3:33 pwned: nonuby: can partial take multiple params ?

3:33 nonuby: shirpani you could do (.bar (.foo obj)) too but in instances like such the -> macro works well

3:33 pwned: say partial * partial [1 2 3] [3 4 5]

3:33 [1* 3 2* 4 3* 5]

3:34 nonuby: yes (map (partial * 2) [1 2 3] [1 2 3])

3:34 Raynes: Clojure's lambda is (fn [args] body) or #(body). In the #() version, args are referred to as % %2 %3 an so on where it is the first, second, and third arg (and so on) respectively.

3:34 nonuby: yes (map (partial * 2 10) [1 2 3] [1 2 3])

3:34 pwned: oh ok

3:34 that's cool

3:36 shriphani: nonuby: is there a cleaner way of doing that ?

3:38 nonuby: in addition to -> macro? Im not sure, still stratching the surface of clojure myself

3:38 scratching

3:41 pwned: Raynes: I guess I'm doing it wrong. (map (fn[a](* 2)) [1 2 3]) gives me (2 2 2)

3:42 pisketti: You need to use the argument

3:42 Raynes: You're doing (* 2).

3:42 &(* 2)

3:42 lazybot: ⇒ 2

3:42 nonuby: pwned if you want to do it that way use (map (fn [a] (* 2 a))

3:42 pwned: I know what I'm doing wrong. Clojure isn't QBasic you don't just learn it by guesswork :-)

3:43 borkdude: pwned you learn a lot by guessing and messing and then turning to the books, and then messing and guessing again

3:43 pwned: oh I forgot the operand order

3:43 nonuby: clojure koans really helped me https://github.com/functional-koans/clojure-koans

3:43 pwned: almost did it with guesswork : D(map (fn [a] (* a 2)) [1 2 3])

3:44 ook thanks a lot people

3:45 borkdude: hmm, using :D as a repl prompt, it might be nice

3:45 :D (+ 1 2 3) ;;=> 6

3:46 pwned: => becomes :)

3:46 you can call this "nice repl"

3:46 borkdude: pwned the joy of clojure

3:47 shriphani: nonuby: that take-while solution you gave me doesn't terminate.

3:48 and doing a first on that seq produces a seq object. Do I need to do something else to get the contained object ?

3:51 nonuby: nvm, I am an idiot.

3:56 nonuby: can I show you some pastebin code. I am doing something stupid but I can't put my finger on it.

4:03 hi. In this http://pastebin.ca/2317378, if I do (first (get-warc-seq stream)), I don't get a record object but a seq object (I think), what is the workaround?

4:07 clgv: shriphani: workaround? describe your problem and ask a precise question.

4:08 shriphani: clgv: so I have a java function .getNextRecord which returns null when it is out of records to return. I turned it into a clojure seq using get-warc-seq. Now that doesn't seem to terminate and I am out of ideas.

4:08 clgv: shriphani: one first hint, since you seem to aim for side-effects you need to use `repeatedly` instead of `repeat`

4:09 shriphani: clgv: I see.

4:09 clgv: shriphani: yeah thats because of `repeat`. it will return the first object infinitely

4:09 shriphani: o.

4:10 clgv: shriphani: if you want to use side-effects there is often a second function in clojure, e.g. `for` vs `doseq`

4:13 shriphani: clgv: thanks that was very helpful.

4:13 Also, what is the deal with contrib? I see it used a lot on s/overflow questions.

4:14 clgv: shriphani: there is no single all-in-one contrib lib anymore. instead there are several standalone libs which are hosted on github under the `clojure` group

4:15 shriphani: and of course there are a lot of third-party or "non-official" libs for a lot of purposes available

4:33 NeedMoreDesu: Can I have clojure.lang.DynamicClassLoader in Thread/currentThread.getContextClassLoader, when running uberjar with java -jar?

5:02 mye: what is a good way to protect state when reloading files in the REPL eg. a database connection?

5:03 I tried bound? with refer and a def but that lead to all kinds of pain

5:03 nightfly: defonce

5:04 mye: nightfly: thx!

5:21 leku: hey i'm doing these clojure koans and i noticed something weird

5:21 whats the best way to paste code here?

5:22 bmaddy: gist.github.com works pretty well.

5:22 borkdude: leku via refheap

5:22 leku this pleases Raynes so the chance increases he will help

5:22 leku: haha

5:22 ok

5:23 borkdude: leku also if you paste it via emacs to refheap it will please even more people, although this is a debated topic

5:23 leku: well i'm running this stuff in the repl

5:23 bmaddy: Oh yeah, I forgot about refheap. Use that for Raynes. :)

5:23 leku: not in the emacs repl

5:23 https://www.refheap.com/paste/11866

5:23 borkdude: leku never mind, just refheap ;)

5:24 leku: i need to learn emacs better but one thing at a time (clojure)

5:24 so my question is around subvec

5:25 why is the 3rd vector in the list "and" and not jelly?

5:25 katratxo: "Returns a persistent vector of the items in vector from

5:26 start (inclusive) to end (exclusive)."

5:26 Raynes: &(doc subvec)

5:26 lazybot: ⇒ "([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."

5:26 Raynes: Oh, right.

5:26 katratxo beat me to it.

5:26 katratxo: :p

5:26 Raynes: borkdude: Yep, and I even got out of bed for this one.

5:26 borkdude: Raynes didn't mean to wake you, sorry

5:26 Raynes: I wasn't asleep. :p

5:26 leku: hmm

5:26 so i guess it's still a little unclear

5:26 borkdude: Raynes please don't give any more details

5:26 Raynes: I had just laid down. I just heard the beep.

5:27 Oh God, no. I was *going* to bed.

5:27 :p

5:27 borkdude: :)

5:27 katratxo: Raynes: every time you get mentioned you get a beep?

5:27 Raynes: A beep from my computer.

5:27 I don't have a pager.

5:27 leku: pro-tip: don't sleep with a computer nearby

5:27 borkdude: Raynes ah, hammock time, I totally get it

5:27 Raynes: I sleep with netflix going, leku.

5:27 leku: lol

5:27 nice

5:27 Raynes: Usually people don't ping me until after I'm asleep.

5:27 :p

5:28 leku: netflix work on linux?

5:28 i guess with flash eh

5:28 Raynes: Nope, but I have a macbook.

5:28 leku: ah

5:28 Raynes: Netflix uses silverlight.

5:28 octe: forming a question is hard..

5:28 leku: isn't microsoft trying to shitcan that?

5:28 Raynes: Dunno.

5:29 octe: i'm trying to understand zippers/xml/zip filters, if i have a zipper made from an xml doc with (xml-zip), i can extract values with zip.xml/xml->, but can i make a partial filtering and later on do more?

5:29 i'll show with code i think

5:29 borkdude: I remember silverlight was mentioned in some magazine in 2006 or so, and I thought: maybe it's worth digging into this new thing, but I'm glad I never did ;)

5:30 leku: lol

5:30 Raynes: Yeah, I wonder if Netflix ever said anything about whether or not it was worth throwing turds at Linux users.

5:30 leku: last I heard MSFT was trying to get away from it

5:31 octe: https://www.refheap.com/paste/11867

5:31 what would i do instead of the rows-object i create?

5:33 Raynes: borkdude: It was worth getting up for. Your comments made me chuckle. It was like "If you sacrifice your first born child, Raynesgod will make your crops grow far and wide and your wealth be plentiful!"

5:33 leku: lol

5:34 borkdude: hehe

5:35 leku: <3 clojure koans

5:35 these are a neat way to learn a programming language

5:36 bmaddy: Yeah they're a blast. After those 4clojure is a lot of fun too

5:38 borkdude: gtg

5:41 leku: thanks bmaddy

5:41 I'll check that out next

5:42 bmaddy: You can follow others on there and see how they solved problems. I've learned a lot that way.

5:43 octe: nevermind, i figured it out.

7:09 https://www.refheap.com/paste/11869 is that idiomatic?

7:17 * leku sweeps the leg

7:20 hyPiRion: octe: Actually, I'm not sure. maybe cond-> ?

7:21 clgv: octe: I think it is a bit confusing

7:21 hyPiRion: Well, actually, it's not that simple either.

7:23 clgv: octe: you are not really using a predicate there

7:23 octe: it seems you want a shortcut for `cond` to not have to write (string? x), (map? x) and so on

7:27 octe: you can write yourself a `condf` macro that does that

7:32 octe: clgv, yes

7:32 basically what i want

7:37 thanks

7:37 clgv: octe: try (defmacro condf [expr & clauses] (let [x (gensym "x")] `(let [~x ~expr] (cond ~@(apply concat (for [[p e] (partition-all 2 clauses)] [(if (keyword? p) p `(~p ~x)) e]))))))

7:37 octe: syntax is (condf {} string? "string" map? "map" :else "unknown)

7:38 octe: that worked, thanks :)

7:40 clgv: octe: try with macroexpand to see if it expands right. I just wrote it down here without testing ;)

7:51 octe: clgv, impressive :)

7:51 clojure-newb: hi guys, how do I filter on this structure : ((:phone "234") ([:phone "123"] [:postcode "abc"])) only getting items which have nested items which include the ':postcode' item ? so I should get : '([:phone "123"] [:postcode "abc"])' returned

7:52 oh, sorry.. original structure should be : (([:phone "234"]) ([:phone "123"] [:postcode "abc"]))

7:54 leku: are you doing some koans?

7:54 clgv: clojure-newb: are those maps you called `seq` on?

7:54 clojure-newb: clgv yes

7:55 clgv: clojure-newb: ##(filter :postcode [{:phone "234"} {:phone "123" :postcode "abc"}])

7:55 lazybot: ⇒ ({:postcode "abc", :phone "123"})

7:55 clojure-newb: clgv: cool, thanks I'll have a go

7:56 clgv: clojure-newb: if {:postcode nil} must show up in the result you need to use #(contains? % :postcode) instead...

7:56 clojure-newb: clgv: no don't need to worry about that

8:06 clgv: thanks for the help

8:06 all working here now

8:32 wreckimnaked: hey everyone

8:34 I was thinking about participating on gsoc2013 and developing something related to clojurescript seemed like a nice idea.

8:34 Now I'm having a look at the codebase to understand a bit more of its internals. Any tips on that?

8:35 pjstadig: wreckimnaked: unfortunately i don't know if there is a mentoring org for clojure this year

8:36 wreckimnaked: pjstadig: I saw something related on the mailing list, I'll look it up.

8:36 https://groups.google.com/forum/?fromgroups=#!topic/clojure/vDiha4tYC_s

8:56 pjstadig: wreckimnaked: oh, right on

9:07 augustl: is (= (count values) (count (set values))) a sensible way to check if a list contains duplicates?

9:08 seems (apply distinct? values) would be another way

9:09 hyPiRion: augustl: yeah, that's what I'd use.

9:09 augustl: makes more sense too :)

9:09 hyPiRion: hm

9:10 ,(apply distinct? nil) ; crashes though

9:10 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$distinct-QMARK->

9:10 hyPiRion: And an empty list doesn't contain dupes, so heh.

9:10 augustl: ah, good to know

9:10 hyPiRion: You could bypass it with, hm.

9:10 augustl: I wonder why it doesn't return true

9:10 hyPiRion: ,(apply distinct? (gensym) nil)

9:11 clojurebot: true

9:11 hyPiRion: though that's not exactly idiomatic.

9:11 augustl: I call distinct with the result of a map operation so I'm safe for now ;)

9:18 TimMc: ,(doc distinct?)

9:18 clojurebot: "([x] [x y] [x y & more]); Returns true if no two of the arguments are ="

9:19 TimMc: Ah, it's an inequality operator, not a collection predicate. THat explains the args.

9:19 This would be irritating to debug: ##(distinct? [1 1 2 1])

9:19 lazybot: ⇒ true

9:23 hyPiRion: TimMc: yeah, it's max-key all over again

9:23 clgv: augustl: you could create a set while traversing the sequential and stop as soon as you find a double

9:23 augustl: TimMc: you have any idea why it doesn't have a [] version too, that always returns true?

9:23 hyPiRion: clgv: that's what distinct? does though

9:24 ,(distinct? (cycle (range 10)))

9:24 clojurebot: true

9:24 hyPiRion: ups

9:24 ,(apply distinct? (cycle (range 10)))

9:24 clgv: hyPiRion: ah, that function exists already. I knew only `distinct`

9:24 clojurebot: false

9:24 TimMc: ,(doc distinct)

9:24 clojurebot: "([coll]); Returns a lazy sequence of the elements of coll with duplicates removed"

9:24 TimMc: Not confusing at all, nope.

9:25 augustl: Seems like a bug. Check Jira.

9:25 hyPiRion: Well wow, that should be fixed

9:26 when I think of it.

9:26 augustl: seems related http://dev.clojure.org/jira/browse/JDBC-31

9:26 ..maybe

9:28 AdmiralBumbleBee: man, I haven't been able to use clojure in months :|

9:29 it's nice to have time again

9:29 hyPiRion: augustl: related, but not exact. I'll pop up an issue and a fix later today.

9:30 augustl: hyPiRion: great :)

10:04 jcromartie: can I not :use or :require a namespace created in a repl?

10:05 i.e. if I just do (ns foo) (def …) (ns bar (:use foo)) that fails

10:05 because it can't find a class or .clj file

10:36 TimMc: Nullary distinct? should return true, yeah?

10:36 There are no two = elements.

10:37 S11001001: TimMc: yep

10:37 TimMc: And it preserves the invariant of (distinct? a b ... y z) implies (distinct? b ... y z).

10:54 kittylyst: Am giving Emacs a spin for Clojure development - followed the instructions here: http://unschooled.org/2011/10/how-to-setup-emacs-for-clojure-on-mac-os-x-lion/

10:54 but am unable to get a REPL

10:54 Syntax highlighting works, and there were a couple of errors when installing paredit

10:55 Anyone have more up-to-date instructions?

10:55 I am on Mac 10.7, Emacs 24.2

10:55 dan_b: if you have emacs 24 you can skip step 3 in those instructions I think

10:56 znDuff: kittylyst: my preferred approach is to use emacs-live, since that provides a single bundle with everything

10:56 ivan: kittylyst: you want nrepl.el, https://github.com/kingtim/nrepl.el

10:56 znDuff: kittylyst: (and installing it as simple as a git clone)

10:56 dan_b: kitty: and then yeah, what ivan says

10:57 znDuff: kittylyst: ''git clone https://github.com/overtone/emacs-live.git ~/.emacs.d'' ...and start emacs, and you're done.

10:57 dan_b: I've only used nrepl foir about ten minutes but it looks a lot less crufty than swank

10:59 kittylyst: Nrepl is complaining about End of buffer: byte-code: End of buffer [3 times]

10:59 And I don't seem to have anything which looks like a REPL :(

11:00 * znDuff can (kinda', as an end-user) support the nrepl.el that ships with emacs-live, but not any other version/configuration.

11:01 kittylyst: Interesting. I'm seeing the ClassCastException I was getting yesterday

11:01 Exception in thread "main" java.lang.ClassCastException: clojure.tools.nrepl.server.Server cannot be cast to compile__stub.clojure.tools.nrepl.server.Server

11:01 I thought that got fixed after I hosed & reinstalled lein

11:09 OK, weird. For some reason, lein is trying to download older versions of clojure - 1.3.0 & 1.3.0-alpha5

11:09 Anyone seen this before / know if there's a funky default set somewhere?

11:09 TimMc: kittylyst: Perhaps one of your dependencies has a version range?

11:10 Version ranges can cause some pretty weird behavior.

11:11 dcolish: So I am trying to unpack a variable length vector into macro args, but i am finding that apply will not help me because I am using doto, https://gist.github.com/dcolish/5049108

11:12 there is a finite set of arities, so I could use a helper fn, however I'd like to try and see why the apply doesnt work with doto or if it is possible to unpack the vector as I had hoped

11:15 kittylyst: TimMc: Indeed, it was a dodgy dependency. Thx

11:15 llasram: dcolish: Not quite following... Do you have an example of what you'd like to be able to do?

11:15 TimMc: dcolish: You're still trying to use macros inappropriately.

11:16 dcolish: :(

11:17 so that's just a simplified macro of the one I am actually attempting to write because the real one requires a few depenedencies

11:17 znDuff: dcolish: What's the reason for using a macro rather than a regular function?

11:18 dcolish: I have a few functions which have roughly the same form and I wanted to see if they could be done using a macro

11:18 its entirely academic

11:18 ohpauleez: that was my comment as well - a function would do fine here

11:18 TimMc: dcolish: Try doing it as a fn, first.

11:18 znDuff: dcolish: how about looking at whether they can be done with a higher-order function? :)

11:18 ohpauleez: ahh gotcha

11:18 TimMc: dcolish: https://gist.github.com/anonymous/5049173

11:19 Oh, new is going to be an issue, nvm.

11:19 dcolish: that wont work

11:20 oh you got it

11:21 TimMc: dcolish: OK, then this: https://gist.github.com/anonymous/5049196

11:21 gfredericks: if I have :omit-default-repositories true in my project.clj and don't mention clojars anywhere, it's not going to accidentally deploy to clojars, correct?

11:21 dcolish: this is roughly what i am trying to do https://gist.github.com/dcolish/5049199

11:21 well yeah, but i wanted to have it instansiate in the fn and not as an arg

11:22 i thought having it as an arg didnt look as nice

11:22 TimMc: dcolish: Ah, so you want to unpack a set of arguments to a method.

11:22 dcolish: yup, the (.at)

11:22 TimMc: dcolish: OK, that may be appropriate for a macro. :-) The first step is to write down a sample invocation and the syntax that the desired macro would emit.

11:22 dcolish: so i can do (fn [obj# [x# y#]] ..., but thats not general enough

11:23 if you see the two defn above that macro in progess, the (.at x y) or (.at x y z) is what i am attempting to unpack

11:23 znDuff: ...well, it _can_ be done without a macro, but involves reflection.

11:24 dcolish: znDuff: definitely true

11:25 i guess the goal is to make the java look more like clojure and i felt that having (Class. ) as params everywhere didnt really accomplish that, neither did reflection.

11:25 i can't stress enough that its purely asthetic

11:25 and to see how it could be done

11:26 znDuff: Waitamoment -- do you control the Java API here?

11:26 dcolish: yes

11:26 znDuff: If you do, and use varargs, then this is all trivial/mooted.

11:26 dcolish: thats a good idea, unfortunately the argument types are different

11:27 znDuff: ...so it's Object... then

11:27 dcolish: heh

11:27 true

11:27 znDuff: There was a link to the Java end of this yesterday, no?

11:27 dcolish: well the java API is using generics here and I would probably have my commit access revoked if i pushed code like that

11:28 yeah, here it is https://github.com/urbanairship/datacube/blob/master/src/main/java/com/urbanairship/datacube/WriteBuilder.java

11:28 znDuff: *shrug*. It's still Object... in the generics case -- just a compiler fiction that pretends otherwise. :)

11:28 TimMc: dcolish: https://gist.github.com/anonymous/5049270

11:29 (builder (StringBuilder.) .append [1] ["a"])

11:29 znDuff: dcolish: I don't see how that API would be accepting a list of arguments at all here.

11:29 dcolish: znDuff: yeah, i know... well i could write a small vararg wrapper in my clojure project

11:29 znDuff: it doesnt, thats why i want to unpack the vectors

11:30 znDuff: ...okay. So this isn't arbitrary-length vectors.

11:30 This is easy, then. :)

11:30 No need for a macro if you aren't handling arbitrary argument counts.

11:31 dcolish: well sure, i could also use a variable arity helper

11:32 TimMc: dcolish: Is this what you want? https://gist.github.com/timmc/5049288

11:32 dcolish: TimMc: i'm checking out that first link you pasted, let me see

11:32 TimMc: The second expands on it.

11:33 dcolish: ah yes, that is what I am trying to accomplish

11:33 there's a lot of new stuff in there, I'll have to study that for a bit

11:33 TimMc: list* is just apply list

11:34 oh, except it returns a seq, just to confuse you

11:34 gfredericks: a non-list seq

11:35 ,(map list? ['(1 2) (list* [1 2]) (list* '(1 2)])

11:35 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>

11:35 gfredericks: ,(map list? ['(1 2) (list* [1 2]) (list* '(1 2))])

11:35 clojurebot: (true false true)

11:35 gfredericks: ,(map list? ['(1 2) (list* [1 2]) (list* '(1 2)) (list* 17 '(1 2))])

11:35 clojurebot: (true false true false)

11:35 dcolish: oh thats fun

11:35 is that because its the result of an apply?

11:36 gfredericks: ,(type (list* 7 '(1 2)))

11:36 clojurebot: clojure.lang.Cons

11:36 gfredericks: a cons is not a list apparently

11:36 I think this is because lists are supposed to know their length, but list* can't do that without walking a potentially lazy sequence

11:37 dcolish: is list a protocol?

11:37 gfredericks: ,(nth (list* 1 2 (range)) 20)

11:37 clojurebot: 18

11:37 gfredericks: ,(nth (apply list 1 2 (range)) 20)

11:37 clojurebot: #<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>

11:38 dcolish: ah yes list returns an IPersistentList

11:38 gfredericks: ,(supers (class (list 1 2)))

11:38 &(supers (class (list 1 2)))

11:38 lazybot: ⇒ #{clojure.lang.Counted clojure.lang.IObj clojure.lang.Sequential java.io.Serializable clojure.lang.IPersistentCollection clojure.lang.Seqable java.lang.Object java.util.List clojure.lang.ISeq clojure.lang.Obj clojure.lang.IPersistentStack java.util.Collection c... https://www.refheap.com/paste/11879

11:38 gfredericks: java.util.List is an interface

11:38 dcolish: TimMc: ok I see why that works, thank you for the help

11:43 TimMc: dcolish: clojure.template may also be interesting to you.

11:44 dcolish: oh, that is pretty cool

11:45 although, i do worry that i'm not doing things the clojure way

11:49 kittylyst: TimMc: Spoke too soon. Actually looks like it's being caused by running Clojure on OpenJDK 8

11:50 TimMc: dcolish: I'd not use that builder form myself unless there were at least (I don't know) 6 invocations with the same method in one block.

11:50 kittylyst: Oh? That doesn't make sense to me.

11:55 kittylyst: Me neither

11:55 But it does seem to be the factor

11:56 I reduced my test case to a lein new ; lein repl

11:56 TimMc: Crashes on 8, not on 7

11:57 TimMc: If I can find someone who knows the Clojure internals better, I could help debug from the JDK8 / JVM side

11:57 TimMc: I am not that good at Clojure's innards yet :(

11:58 TimMc: I know that 8 has classloading changes which may be relevant here ...

11:59 antares_: ohpauleez: hey, do you have a couple of minutes?

12:09 deg: In Emacs, what keystroke will abort a runaway evaluation in nrepl?

12:11 arkx: deg: C-c C-b I think

12:12 deg: arkx: Nope... and I don't see anything yet in the help.

12:12 arkx: https://github.com/kingtim/nrepl.el C-c C-b: Interrupt any pending evaluations. Also bound to C-c C-c.

12:13 deg: Yup... did work now... must have just been sluggish to respond.

12:13 Thanks... I didn't want to lose the built-up state.

12:14 jjl`: is lobos the best thing for managing db migrations?

12:20 antares_: jjl`: lobos is a bit heavyweight, consider trying ragtime first https://github.com/weavejester/ragtime

12:22 jjl`: what are the tradeoffs?

12:22 heh, named sql files

12:24 okay, given that i'm using postgres and i can have ddl transactions (and thus ensure i only run a given migration once and if anything fails it will rollback), does ragtime actually buy me anything?

12:25 dgrnbrg: Hello Clojurians! Does anyone know which classloader import uses to determine if a class exists?L

12:27 znDuff: dgrnbrg: Depends. Sometimes it's the thread context classloader, and sometimes it's clojure.lang.Compiler/LOADER

12:27 dgrnbrg: znDuff: I set the ContextClassLoader to be a GroovyClassLoader chaining to the old ContextClassLoader, which is Clojure's

12:28 but when I do an (import ...), it fails and the stacktrace indicates it's only looking at the dynamic classloader from clojure

12:28 znDuff: dgrnbrg: How is *use-context-classloader* set?

12:28 dgrnbrg: true

12:28 znDuff: (also, to be clear -- while I've fought and bested this problem, that was a substantial while ago, and I've forgotten most of what I learned)

12:28 dgrnbrg: Is this at a REPL? If so, are you using nREPL or Swank?

12:29 dgrnbrg: I looked at the code that import generates, and it appears to get *ns*, push a "context" enum value defined in compiler.java, then do class.forName on that

12:29 but I don't understand what's going on--is it calling ns.forName?

12:31 ohshoot

12:31 technomancy: jjl`: lobos vs ragtime doesn't really have anything to do with DDL or whatever; it has to do with finding the right level of abstraction. lobos attempts to offer an abstraction that's impossible to deliver upon.

12:32 dgrnbrg: I see, it happens becasue clojure.lang.Compiler.LOADER.isBound() == true, which causes it to bypass the contextclassloader

12:32 ohpauleez: antares_: Here now

12:33 znDuff: dgrnbrg: ...yup -- so, for instance, in clojure.osgi, we re-bind that: Var.pushThreadBindings(RT.map(Compiler.LOADER, aLoader));

12:34 dgrnbrg: Got it!

12:34 antares_: ohpauleez: I am writing an email about making http://clojure-doc.org more visible. Do you think it's a good idea to just ask for a link from clojure.org?

12:34 dgrnbrg: znDuff: So, should I be rebinding the Compiler.LOADER if I want to include another language's runtime?

12:34 znDuff: or should I set the Thread's contextClassLoader, and rebind the compiler.LOADER?

12:35 znDuff: dgrnbrg: *shrug*. Not sure. You'd have to go back in time 6-8 months if you wanted to talk to a version of me that had all this in their head. :)

12:35 antares_: ohpauleez: there is some stuff left to be done that I consider major, but beginners won't have to worry about it for a while (macros, gen-class, implementing clojure.lang.* interfaces for your own data structures, etc)

12:35 dgrnbrg: znDuff: heh :)

12:35 antares_: dgrnbrg: ask on the mailing list?

12:36 dgrnbrg: antares_: which mailing list?

12:36 antares_: dgrnbrg: clojure?

12:36 dgrnbrg: I'll give that a shot

12:37 ohpauleez: antares_: I would just write and say, "The community has worked hard at building up easily digestible documentation. I'd love to see it linked to from high-traffic areas like clojure.org"

12:38 It'd be a good idea to leave all politics out, just ask for the link :)

12:43 gfredericks: any tips for tracking memory leaks with jvisualvm?

12:43 just knowing class names from heap snapshots doesn't seem to help too much

12:45 antares_: gfredericks: you can generate snapshots with allocation stack traces

12:46 gfredericks: http://rejeev.blogspot.ru/2009/04/analyzing-memory-leak-in-java.html

12:46 gfredericks: antares_: nice, thanks!

12:46 jjl`: technomancy: sorry, i wasn't clear. i can fake everything ragtime does by using DDL transactions, a migrations table and a trick that will trigger division by zero

12:47 technomancy: jjl`: I'm saying the advantage of ragtime is that it does *less* than lobos

12:47 jjl`: i'm inclined to agree with you

12:47 technomancy: lobos tricks you into thinking it's possible to paper over the differences between various DB's DDL the same way it is with SQL

12:47 which is tempting, but false

12:47 jjl`: i'm just wondering if it buys me anything over my (admittedly pg-specific) hack

12:48 technomancy: OTOH even ragtime does to much IMO for some apps

12:48 https://github.com/ato/clojars-web/blob/master/src/clojars/db/migrate.clj

12:48 DB migrations can be simple enough not to justify pulling a library for them

12:49 jjl`: and my one concern from reading the ragtime documentation (at least with the lein plugin) is that changing databases could be a pain since it wants it hardcoding into the file. ideally i'd be able to pass in host and database via command line args

12:49 (though in principle i like the lein plugin)

12:58 pjstadig: jjl`: you could also checkout http://github.com/pjstadig/migratus

13:06 * si14 guys, I'm quite confused. how one can implement a variation of take while that preserves first "failed" element?

13:07 antares_: if you care about Clojure documentation, please read this and pass the link on: https://groups.google.com/forum/?fromgroups=#!topic/clojure/3aBMazxVCrk

13:08 bbloom: si14: run (source take-while) it should be pretty clear how to extend it to be a take-while-inclusive or whatever

13:09 si14: bbloom: yeah, I've already done that, thanks. Just had a hope that I'm missing something and this can be done reasonably without duplicating Clojure's code.

13:09 bbloom: si14: it's not duplicating, you need a different function :-P

13:10 si14: don't be afraid to create your own utilities when you need them

13:11 si14: bbloom: ok :) thank you!

13:19 shriphani: Hi. I have a question about clojure. I see that the set! operates only on globals. is there any particular reason for this ?

13:20 technomancy: shriphani: good code doesn't use set!

13:21 bbloom: shriphani: it also operates on java fields

13:22 shriphani: technomancy: I have a choice of doing (count seq) and then (doall (l seq) (op l)) but is there a way to do it in step without a set ?

13:22 joegallo: shriphani: to echo technomancy, you might be looking at this and thinking "but i really need set!" and then answer is basically -- no, you don't.

13:23 bbloom: shriphani: your question isn't super clear, can you provide a paste on refheap ?

13:24 Frozenlock: ,(-> :a str)

13:24 ... Cmon bot

13:24 TimMc: slobot

13:24 Frozenlock: ,(-> :a (fn [x] (str x)))

13:24 TimMc: ~ping

13:25 bbloom: &(-> :a str)

13:25 lazybot: ⇒ ":a"

13:25 Frozenlock: Anywho, is it normal that the second one doesn't work?

13:25 shriphani: bbloom: I need to count the no. of items in a seq + do an op per item in seq, any way of doing that in 1 step ?

13:25 TimMc: Frozenlock: (fn :a [x] ...)

13:25 bbloom: Frozenlock: use macroexpand

13:25 Bronsa: &(-> :a ((fn [x] (str x))))

13:25 lazybot: ⇒ ":a"

13:25 bbloom: &(macroexpand '(-> :a (fn [x] (str x))

13:25 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

13:25 bbloom: &(macroexpand '(-> :a (fn [x] (str x)))

13:25 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

13:25 bbloom: &(macroexpand '(-> :a (fn [x] (str x))))

13:25 lazybot: java.lang.UnsupportedOperationException: nth not supported on this type: Keyword

13:25 shriphani: I could use recursion but clojure doesn't seem to like tail-call-optimization so I am not sure.

13:25 bbloom: apparently i suck

13:26 TimMc: &(macroexpand-1 '(-> :a (fn [x] (str x))))

13:26 lazybot: ⇒ (fn :a [x] (str x))

13:26 bbloom: TimMc: dur, thanks

13:26 Frozenlock: Bronsa: Yeah that's what I'm doing in my code, but the additional paren is bugging me.

13:26 Bronsa: &(let [f (fn [x] (str x))] (-> :a f))

13:26 lazybot: ⇒ ":a"

13:27 Bronsa: either that or this

13:27 bbloom: Frozenlock: yeah, what Bronsa suggests

13:27 Bronsa: I don't think there's another way to do it otherwise

13:27 bbloom: shriphani: is your seq expected to be large or of unknown size?

13:27 shriphani: or is it generally going to be small?

13:27 TimMc: &(((((-> x (fn [] x))))))

13:27 lazybot: ⇒ #<sandbox20321$eval56691$x__56692 sandbox20321$eval56691$x__56692@c986aa>

13:28 Frozenlock: Bronsa: I like that a lot

13:29 shriphani: bbloom: yes. it is a set of records from a 1gig gzip file.

13:29 bbloom: shriphani: ok and you want to operate on the entire sequence?

13:29 shriphani: bbloom: filter about a third of the elements out.

13:29 bbloom: shriphani: ok, you probably want to use reduce

13:30 you can use a map as the reduction state with one key for the count, one key for the reduced set, etc

13:30 shriphani: ah. you're right!

13:30 is there a reduce quirk (like map has with lazy seqs ?)

13:30 bbloom: (reduce (fn [state x] ...) {:count 0 :result #{}} big-huge-seq)

13:31 what quirk are you referring to?

13:31 shriphani: bbloom: I had to use doseq as opposed to map.

13:32 bbloom: shriphani: that's not a "quirk" so much as it was the fact that you need to eliminate laziness

13:32 shriphani: does your operation have any side effects?

13:32 it probably shouldnt....

13:32 shriphani: bbloom: it does print out stats of the records to a file.

13:33 bbloom: shriphani: reduce is eager, so it should't be a problem, but before i give you the go-ahead with that design let me ask another question

13:33 shriphani: what is the nature of the stats? are they progress reports during the operation? or just a summary at the end?

13:33 shriphani: are they a constant size? or does their size vary with the number of entries in the input?

13:37 shriphani: bbloom: records are not constant size, stats are mostly a summary at the end.

13:37 bbloom: shriphani: so just store your stats inside your reduce state accumulator

13:37 make your reduction function pure

13:37 and you can print the results at the end

13:37 shriphani: right that sounds good.

13:37 bbloom: this separates your side effects, making your code easier to test and modify

13:38 if you want intermediate results, you can use `reductions` instead of `reduce` to see the intermediate values

13:38 &(reduce + 0 (range 5))

13:38 lazybot: ⇒ 10

13:38 bbloom: &(reductions + 0 (range 5))

13:38 lazybot: ⇒ (0 0 1 3 6 10)

13:39 shriphani: aha! that's pretty neat.

13:40 so another question. How slow is clojure compared to scala ?

13:40 bbloom: and you can even get progress reports occasionally!

13:40 (take-nth 50 (reductions + 0 (range 1000)))

13:40 &(take-nth 50 (reductions + 0 (range 1000)))

13:40 lazybot: ⇒ (0 1225 4950 11175 19900 31125 44850 61075 79800 101025 124750 150975 179700 210925 244650 280875 319600 360825 404550 450775 499500)

13:43 dnolen_: shriphani: typical Clojure is probably compares favorably to a functional Scala style that emphasizes immutability. Clojure has a low-level subset of the language that is pretty zippy but few people write in it.

13:45 shriphani: dnolen_: ah. So both are about 2x C++ ? And in terms of memory usage ?

13:45 rasmusto: can anyone foresee problems using pmap with clojure.java.shell?

13:46 ohpauleez: shriphani: I have yet to write a real piece of production code that wasn't fast enough (or wasn't easily optimized)

13:46 * znDuff _has_ written production code that wasn't fast enough, but it wasn't the language's fault.

13:46 dnolen_: shriphani: yeah performance of the JVM is the upperbound

13:47 znDuff: (for instance, choosing to use the map-based abstraction for Esper, with glue for Clojure keyword->value maps, vs using the Object[] abstraction)

13:47 ohpauleez: shriphani: Depends on what you're doing (if a lot of object allocations are happening and you're making a lot of ephemeral garbage). But like dnolen_ you're only really limited by the JVM

13:48 znDuff: ...and it was actually possible to optimize that to a point where its performance was adequate without changing the abstraction -- but if I want to go much further with it, the library is going to need a rewrite to support that other form.

13:48 dnolen_: shriphani: programming in a functional style definitely works GC - fortunately the JVM is pretty good.

13:49 ohpauleez: znDuff: Yes, I guess I should clarify, I've certainly written naive code, that I later when back (either because I knew I had to or because of a profile) and easily adjusted.

13:49 Raynes: cemerick: https://www.refheap.com/paste/11888 Is all I put together last night. It was mostly an observation that what I'm going to do might not be very interesting. One thing I'll point out is that it'd be nice if writing workflows was less densely documented.

13:50 ohpauleez: to follow on the GC point - I've dialed in both G1 and ParGC with great success, and with more pieces of JRockit moving into the standard JVM, it'll only get better

13:50 znDuff: ohpauleez: *nod*. I wouldn't actually call the initial implementation naive in my project -- it just anticipated different (less performance-sensitive) use cases than the ones it was eventually used for, and knowingly chose to prioritize flexibility over performance for that reason.

13:51 ohpauleez: ahh, just balancing tradeoffs :)

13:51 znDuff: ohpauleez: ...by the way, have any starting points to reference re: GC tuning?

13:52 ohpauleez: znDuff: Have you done JVM based stuff before?

13:52 like Java or Scala?

13:52 there are a few general tweaking guides and overviews of the GCs

13:52 znDuff: ohpauleez: I've owned Ops in a Java shop before -- actually spent a lot of time working with JRockit's profiling tools in that context.

13:53 ohpauleez: Ahh good news for you then, supposedly all of those tools should be (if not already) available

13:53 antares_: ohpauleez: this is what I ended up posting, by the way https://groups.google.com/forum/?fromgroups=#!topic/clojure/3aBMazxVCrk

13:53 ohpauleez: but it's been my experience each app, once "stable" involves its own round of GC and JVM tweaks

13:53 cemerick: Raynes: I'm not sure what's going on there. But, "less densely documented"? Like, there's some sweet spot between no docs and comprehensiveness that I'm missing? ;-P

13:54 znDuff: ohpauleez: *nod* -- my current employer has a YourKit license, which is what I used when trying to work on performance in my current project. That said, the work I did was mostly around code changes, as opposed to being effective at tuning GC parameters, hence the question.

13:54 cemerick: Raynes: FWIW, a WIP: https://friend-demo.herokuapp.com/

13:55 ohpauleez: znDuff: Let me see if I can pull out some links for you. As I've said, I usually set targets, figure out the best options to adjust, turn one knob, measure, turn another knob, measure… until I hit the target

13:56 cemerick: Raynes: from what I understand of browserid, then the multi-factor workflow impl might be relevant

13:56 Raynes: cemerick: More like it's a truck with 30 thousand pounds of information trying to drive over a bridge with 10 thousand capacity.

13:56 ohpauleez: Most of the stuff I need to adjust is latency sensitive, so G1 has been particularly great

13:56 TimMc: &((->> 5 #(class %&)))

13:56 lazybot: ⇒ 5

13:57 cemerick: Raynes: I would have wrote a tighter README, but I hadn't the time.

13:57 s/wrote/written

13:57 feh

13:57 ohpauleez: antares_: That looks awesome

13:57 TimMc: "I didn't have time to write a short README, so I wrote a long one instead." -- Mark Twain

13:58 (Looks like there are other versions of the quote, and many, many attributions.)

13:58 bbloom: Yeah, that Mark Twain has a sick GitHub profile!

13:58 cemerick: I had no idea someone had applied it to READMEs before :-P

13:58 bbloom: :-P

14:01 ohpauleez: znDuff: It seems most of my favorite articles are listed here: http://www.javaperformancetuning.com/

14:02 Raynes: cemerick: Anyways, the way personas works is: user clicks button on website, enters email; personas comes up with an identity assertion that is posted to your server and then you have to verify this assertion which my function does. If this is okay, user is auth'd. It's simple enough.

14:02 cemerick: Sure, sounds fine

14:04 Raynes: My tweet was last night was out of me not being able to see what I gain by integrating with friend over what I've got now. The amount of code that will be removed from refheap will be negligible. My primary motivation was to do it so I could use that new fancy rate limiting middleware that is integrated with friend, but I'd have to write a different workflow for my token-based auth for that anyways.

14:05 - that first 'was'.

14:07 cemerick: Raynes: Sure. Friend isn't ever going to make things much easier for workflow implementors. The benefit is being able to trivially use multiple workflows and a single authorization regime in your apps.

14:08 Raynes: Multiple workflows?

14:08 How often do people use multiple authentication workflows?

14:08 Or am I misunderstanding?

14:08 cemerick: constantly

14:08 e.g. form-based for humans + HTTPS Basic for an API

14:08 Raynes: I've never had to log in with a username and password, then auth with openid and click a personas sign in button.

14:09 Oh, so separate workflows for different parts of things?

14:09 TimMc: Parallel not series.

14:09 Raynes: And the benefit is that you use the same authentication function in both places?

14:09 cemerick: Raynes: or the same set of handlers/routes, if they're content-negotiated, etc.

14:09 one piece of middleware, one policy throughout the app

14:10 Raynes: *shrug*

14:10 I guess friend just isn't for me right now.

14:10 cemerick: ~guards

14:10 Raynes: I feel like it'd make things wildly more complicated. Maybe it's just this specific scenario.

14:10 TimMc: $guards

14:10 arrdem: ...

14:10 is clojurebot down?

14:10 TimMc: WHERE ARE THE GUARDS

14:11 arrdem: ~gourds

14:11 no gourds either... eval someone?

14:11 NeedMoreDesu: How can I reload program at runtime? I'm trying to make hot-updates, with program running.

14:11 lazybot: SEIZE HIM!

14:11 cemerick: the bots have let me down

14:11 TimMc: I guess you're not their... friend.

14:11 Raynes: ~gourds

14:12 TimMc: hiredman: Can you cycle clojurebot? It seems to be down.

14:12 NeedMoreDesu: Start it from the REPL, then use require with :reload as needed.

14:12 hiredman: clojurebot: ping?

14:12 TimMc: NeedMoreDesu: You'll probably want to use defonce for bits of state.

14:13 clojurebot: eval service is offline

14:13 eval service is offline

14:13 eval service is offline

14:13 Raynes: We noticed

14:13 We noticed

14:13 We noticed

14:13 pjstadig: sqs backups again?

14:13 TimMc: Ah, the ever-reliable cloud.

14:13 pjstadig: hiredman: did you forget to pay your amazon bill?

14:13 hiredman: clojurebot: ping?

14:14 TimMc: Introduce latency in new and exciting places!

14:14 NeedMoreDesu: TimMc: I want to make java -jar runnable uberjar.

14:14 arrdem: hehehe

14:14 TimMc: NeedMoreDesu: mumble mumble nREPL drawbridge mumble

14:14 hiredman: hmmm

14:14 TimMc: hiredman: lazybot is being quite slow -- possibly coincidence?

14:15 arrdem: NeedMoreDesu: http://travis-whitton.blogspot.com/2009/09/hot-code-swapping-with-clojure.html

14:15 TimMc: out from under my bridge!

14:15 * gfredericks starts to use nrepl.el for the first time

14:16 gfredericks: do folk use paredit in they repl buffer?

14:17 * arrdem can't deal with paraedit for normal editing

14:17 gfredericks: I only use it for editing sexpressions :P

14:18 hiredman: TimMc: the irc part of clojurebot only allows 4 threads responding at a time, the eval service oomed, and some how all 4 threads got wedged there

14:18 arrdem: I mean that's all it's desinge for but I still find it cumbersome.

14:20 antares_: gfredericks: I do

14:22 chronno: gfredericks: I like to have it around whenever I'm writing sexps

14:22 Raynes: gfredericks: I do.

14:23 gfredericks: ninjudd gave me some fancy elisp for using it in the nrepl buffer.

14:23 gfredericks: https://www.refheap.com/paste/11892

14:27 NeedMoreDesu: TimMc: that code gives me CompilerException java.lang.IllegalArgumentException: More than one matching method found: submit, compiling:(NO_SOURCE_PATH:7) (line 20)

14:29 amalloy: Raynes: M-u, M-e? are you using ninjudd's keyboard layout too?

14:29 Raynes: amalloy: No.

14:29 TimMc: NeedMoreDesu: What code? The thing arrdem sent you?

14:30 Raynes: amalloy: I don't use those, I just haven't bothered to change them.

14:30 arrdem: TimMc: I assume so...

14:30 NeedMoreDesu: (full disclosure) I saw that two days ago and haven't tried to run it yet.

14:31 NeedMoreDesu: Imma give it a shot and see if I can duplicate. the post is from 2008 so the bit rot may be strong.

14:31 NeedMoreDesu: oh uh.~

14:31 * dobladez wondering if anybody knows of discount code for the ClojureScript training on March 17 (before ClojureWest @ Portland)

14:37 NeedMoreDesu: arrdem: That would be nice, if you'll try. It would be sad if I can't handle that.

14:37 arrdem: NeedMoreDesu: k gimme a few.

14:43 NeedMoreDesu: error confirmed

14:44 NeedMoreDesu: hm, what do one do with that error? Is there a way to say which method to use?

14:45 arrdem: yeah trying to puzzle that out now

15:03 devn: best way to make this transformation?

15:03 https://gist.github.com/devn/b356d6186d845ceadad5

15:03 arrdem: NeedMoreDesu: CHEEVO GET REPL SURGERY

15:04 NeedMoreDesu: okay I got this working...

15:04 it's a raw tty repl with no tab complete or anything so "

15:04 could use some attention"

15:04 ohpauleez: devn: there's a function for that - I've used it, let me dig around

15:05 devn: tree-seq maybe?

15:05 group-by?

15:06 ohpauleez: I think I used group-by, I had a seq of maps

15:09 devn: hm

15:09 ohpauleez: could you show me what you mean?

15:10 ohpauleez: devn: Totally. My data looked similar to the second example on: http://clojuredocs.org/clojure_core/clojure.core/group-by

15:10 alandipert: devn: invert? https://gist.github.com/alandipert/4949466

15:11 ohpauleez: You could transform your data to have a vector of maps where :date :date1 and :date :date2

15:11 then group-by date or group-by metric

15:12 does that make sense?

15:13 devn: ohpauleez: i think so, playing with it now

15:14 massaging some data

15:14 Raynes: devn: How are things?

15:14 ohpauleez: devn: Solid - ping me if you stumble up on something, I'll give it a try

15:15 devn: Raynes: things are good :) and you?

15:15 ohpauleez: thanks

15:15 Raynes: Excellent.

15:15 amalloy: devn: https://gist.github.com/amalloy/5051301 ?

15:16 it makes a nested map intead of this weird map-of-lists-of-maps-of-lists-of-maps thing

15:19 devn: word

15:19 thanks

15:28 gfredericks: I upgraded to the new clojure-mode and now my RET doesn't automatically tab

15:28 hiredman: :(

15:28 technomancy: gfredericks: someone pointed out that clojure-mode's behaviour was wrong

15:28 hiredman: never upgrade

15:28 technomancy: supposedly C-j is the "correct" way to do that

15:29 gfredericks: technomancy: sweet, that works; thanks

15:29 nice to have two options

15:29 technomancy: I just rebound RET in my own dotfiles because I think it's dumb, but whatever

15:32 amalloy: i actually use C-j for the times i want to avoid clojure-mode's RET behavior (which is normally what i want)

15:33 gfredericks: technomancy: oh man yeah it's awful for pasting code

15:34 hyPiRion: hiredman: rebind RET to newline-and-indent then

15:34 hiredman: hyPiRion: nope, never upgrade

15:34 hyPiRion: heh

16:00 * znDuff pokes at Avout; curious as to whether the lack of recent work means it's good enough for everyone using it in production, or that nobody is using it in production.

16:04 tyler_: is there a way to switch threading order midway through? e.g.

16:04 (->> (util/build-url "/v1/twitter/status" {:user-id 9429332 :par "user-id"}) (sh "curl") :out (json/decode true) pprint)

16:05 i need the output to be first threaded not last thread on json/decode

16:22 devn: znDuff: I've heard spotty things about zookeeper

16:23 znDuff: devn: Our ops team has had issues with it under heavy load, but the currently envisioned use case doesn't involve heavy load.

16:25 hiredman: http://stackoverflow.com/questions/1479442/real-world-use-of-zookeeper

16:26 it is everywhere

16:26 datomic's ability to use riak for storage uses zookeeper

16:27 joegallo: i used it once to punish some misbehaving children, i made them watch the whole thing http://www.imdb.com/title/tt1222817/

16:28 brianwong: yeah that was a bad movie

16:32 bbloom: zookeeper is needlessly complex and provides an extremely poor programming model, but it can be forced to behave with enough blunt force

16:32 netflix has all the code you need: https://github.com/netflix

16:33 https://github.com/Netflix/curator and https://github.com/Netflix/exhibitor

16:44 heiz: Hi! Tell me please why clojure evaluates special forms before looking up in scope.

16:48 dnolen_: heiz: because that's the way it is, you can't override specials.

16:48 wink: hmm, I'm just playing around with Racket and xexpr totally reminds me of hiccup

16:49 noprompt: occasionally i'll get an java.io.FileNotFoundException when using macros with cljs and ring, any idea why this happens?

16:50 once i refresh it disappears though.

16:51 hiredman: noprompt: you are using some kind of cljsautobuild and some kind of auto referesh for ring

16:52 noprompt: hiredman: i'm using cljsbuild auto yes.

16:52 hiredman: autobuild deletes the file before writing a new one, and your auto refresher hits the middle

16:53 noprompt: hiredman: ah, yes that makes sense.

16:53 hiredman: either that or you are seeing the FileNotFoundException from your browser looking for a favicon

16:58 patchwork: ,(take 2 "yellow")

16:58 clojurebot: (\y \e)

16:59 patchwork: ,(str (take 2 "yellow"))

16:59 clojurebot: "clojure.lang.LazySeq@12cd"

16:59 patchwork: ,(str (doall (take 2 "yellow")))

16:59 clojurebot: "clojure.lang.LazySeq@12cd"

16:59 patchwork: Anyone know how to get the first two letter from a string in a better way than that?

16:59 *letters

16:59 It keeps printing "clojure.lang.LazySeq"

16:59 even with a doall

16:59 ?

17:00 katox: ,(.substring "yellow" 0 2)

17:00 clojurebot: "ye"

17:01 patchwork: Ah, java!

17:01 no clojure way to do it?

17:01 I can use java if necessary, was looking for a pure clojure approach

17:01 frenchyp: (apply str (doall (take 2 "yellow")))

17:02 amalloy: &(clojure.string/subs "yellow" 0 2)

17:02 lazybot: java.lang.RuntimeException: No such var: clojure.string/subs

17:02 amalloy: &(subs "yellow" 0 2)

17:02 lazybot: ⇒ "ye"

17:02 patchwork: sweet, thanks!

17:05 katox: could anyone point me to some docs or blog how to get a reasonable workflow in cljs?

17:05 clojurescriptone looked promising but it's broken atm

17:05 I looked around and found only relying on cljsbuild auto to recompile and browser refresh

17:06 this tutorial is quite nice https://github.com/magomimmo/modern-cljs/

17:06 but the presented workflow is not very appealing

17:08 pbostrom: katox: might want to check out https://github.com/cemerick/piggieback too

17:10 katox: pbostrom: thanks, will do

17:11 i didn't know there is a clojure-tools google group, another good hint there

17:11 + the first post I've seen is the guy from a clojure users group here in town ;)

17:22 jasonbray: cljs interop: If you need to pass a js fn into a js library you're consuming, how do you go about it?

17:22 dnolen_: jasonbray: just pass it in

17:22 jasonbray: pass the cljs fn?

17:23 amalloy: cljs functions are just javascript functions

17:23 well, "just". they're probably some other stuff as well

17:25 jcromartie: I just added a command to nrepl.el to speak the doc for the symbol under the point

17:25 :P

17:25 C-c C-p

17:25 no way to stop it though

17:25 that will come later :P

17:25 dnolen_: amalloy: they really are just JS fns w/ some extra properties tacked on - which is a pretty normal pattern in JS land

17:27 jasonbray: I suppose I'm surprised since we use clj->js for data structures, but that's great - thanks

17:28 amalloy: jasonbray: clj data structures can't be just js data structures, because theirs need to mutate and ours need not to. but functions can just be functions

17:28 dnolen_: jasonbray: there may be some performance arguments for doing things differently, but the convenience of being able to pass CLJS functions as JS fns is pretty high.

17:29 jasonbray: thanks fellas, interesting

17:32 cemerick: dnolen_: there are some subtleties that I haven't entirely grokked. e.g. with-meta yields a value that is fn?, but isn't goog.isFunction.

17:35 dnolen_: cemerick: oh right, because we add meta via reification, don't have a solution in mind for that.

17:36 ravster: hey all

18:09 katox: interesting that cljs fns are just js functions

18:10 why is that if I have an event like onclick and a listener function (which is cljs) why does it stay the same on redefinition?

18:10 what's the intent

18:11 dnolen: katox: because you assigned a value not reference.

18:12 katox: no way around that really - you can circumvent that in Clojure you have the indirection of vars.

18:12 katox: dnolen: I noticed that cljs code reflects the change

18:13 so I guess there is a map but to js it's just a value then

18:13 dnolen: katox: because you're using the name (a reference)

18:13 katox: well, I used domina.event/listen! so it was a bit opaque ;)

18:31 shriphani: hi everyone. I am trying to open a file (and append if it exists) in a specified directory. I am unable to find any path joining function in clojure.java.io. Where should I be looking ?

18:32 essentially, the python version to open(os.path.join(dirname, filename), 'a+')

18:32 technomancy: shriphani: clojure.java.io/file does that

18:48 katox: do I need clojurescript sources to run piggieback?

18:49 cljsbuild worked fine but piggieback complains that cljs.repl.rhino.RhinoEnv is missing

18:52 Frozenlock: saperlipopette

18:52 I successfully loaded a uberjared project into another one.

18:54 shriphani: https://www.refheap.com/paste/11905 Hi everyone. I am doing something stupid here. I am trying to create a csv file and write to it but I get a Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: clojure.lang.Keyword . Can someone point out my mistake to me ?

19:05 katox: bah, probably resolved

19:05 piggieback needs a newer clojurescript version

19:06 0.0-1424 just failed, it seems to work with an extra dependency set to 0.0-1586

19:07 the older one came as a transitive dependency of domina 1.0.0, for the record

19:15 amalloy: shriphani: the args you're passing to io/file look bogus, as you'd expect from that error message

19:16 on line 26

19:16 shriphani: amalloy: I fixed that. Now it terminates silently but I don't see a csv file anywhere on the filesystem

19:17 amalloy: does :append expect the file to exist ?

19:55 johnmn3: what is the equivalent javascript: "var output = [];" in clojurescript? do I need to do something like as-array?

19:55 dnolen: (def output (array))

19:58 johnmn3: dnolen: thanks

20:12 when I have: "document.getElementById('list').innerHTML = 'blah' " would I use aset on that?

20:12 (aset (.innerHTML ...) "blah")

20:13 dnolen: johnmn3: use (set! (.-innerHTML ...) "blah")

20:13 johnmn3: dnolen: Thank you sir!

20:13 noprompt: dnolen: i was curious about that. what's the difference?

20:14 dnolen: noprompt: aset is really for arrays, but can be used to mutate arrays or objects since it gets compiled down to foo["bar"] = baz;

20:15 only recommended for interop

20:15 noprompt: is there a place where stuff like aset, oset, etc. are documented?

20:15 dnolen: there is no oset

20:15 noprompt: the cljs book doesn't make mention of them.

20:16 amalloy: doesn't (.-innerHTML x) get munged/minified by the compiler, dnolen? i would have thought this is the kind of thing you want aset for

20:16 noprompt: i saw oset! here https://gist.github.com/lynaghk/3856153

20:16 i'm guessing that might be outdated

20:16 dnolen: aset happens to have a dual use - but it's really intended to be used as it's used in Clojure

20:17 noprompt: he's defined his own oset! at the top

20:17 amalloy: Closure knows about common DOM symbols.

20:18 noprompt: omg. i think i need to take a break. :)

20:18 caught a cold over the weekend. :(

20:21 johnmn3: where do I read up on what the hyphen is for "(.-innerHTML ..." in all the cljs I see?

20:23 noprompt: johnmn3: it's for property access

20:23 johnmn3: so only use hyphen if it is a property... and a property is... something that stores data...?

20:24 noprompt: johnmn3: if you leave the - off it's a function/method call

20:24 johnmn3: k

20:25 dnolen: johnmn3: on the JVM the distinction is not necessary, since the JVM knows whether something is a field or a method

20:25 noprompt: dnolen: beat me too it!

20:25 dnolen: johnmn3: there are no methods really in JS, just properties. thus the need for a distinction.

20:26 johnmn3: k. So this: var files = evt.target.files; would be (def files (.-files (.target evt))) ???

20:26 lazybot: johnmn3: Yes, 100% for sure.

20:26 johnmn3: thanks lazybot

20:26 dnolen: johnmn3: no

20:26 noprompt: (def files (.-files (.-target evt)))

20:27 dnolen: or (def files (.. evt -target -files))

20:27 noprompt: love that macro

20:27 johnmn3: oy vey.. I'm having trouble discerning between methods and properties

20:27 noprompt: johnmn3: you're familiar with js?

20:27 johnmn3: no

20:28 first time here

20:28 do you have to be familiar with the object to know whether it is a property or method?

20:29 noprompt: johnmn3: objects in js are fairly simple

20:29 johnmn3: var obj = {prop: "value"}

20:29 johnmn3: k

20:29 noprompt: johnmn3: var obj = {prop: function(x) { return x }}

20:30 so if i say obj.prop in the first case i'll get "value"

20:30 johnmn3: k, where "function(x) { return x}" is the value

20:30 noprompt: in the second case i'll get back the function

20:31 if i wanted to call the function it'd just be a matter of obj.prop(1)

20:31 johnmn3: k, but if you want to return the function..

20:31 ?

20:32 noprompt: in cljs you could still use .- to get the function

20:32 johnmn3: ok

20:32 noprompt: but if you want to call it simple .

20:32 johnmn3: ok

20:32 noprompt: s/simple/simply

20:34 johnmn3: so for var files = evt.target.files; why would it be: (def files (.-files (.-target evt))) ??? what makes you think they want to assign the function to files rather than the value?

20:34 noprompt: since (funcname args …) is a function call in clj, cljs has to make a distinction between property access and "method" calls

20:34 otherwise you'd end up trying to call a string or something and get complaints

20:34 dnolen: did i explain that right?

20:34 sometimes i feel like i suck at explaining things

20:35 johnmn3: its making a lot of sense.

20:35 noprompt: since functions are first class citizens in js it's quite common to use them as property values

20:36 bbloom: probably a good idea to have some javascript experience before digging into clojurescript

20:36 noprompt: johnmn3: i tend to agree with bbloom in this instance

20:36 johnmn3: hmmm

20:36 bbloom: unfortunately, clojurescript inherints warts from both clojure and clojurescript, so you should probably be comfortable with each

20:37 noprompt: johnmn3: js is fairly easy to pick up, it has some nasty gotchas though

20:37 bbloom: you shouldn't need to be an expert in either, just basic debugging skills will help

20:37 noprompt: bbloom: +1

20:37 johnmn3: I'm pretty good with clj

20:37 better than with java, but I know java well enough

20:37 noprompt: johnmn3: take a few days to play with javascript

20:38 johnmn3: it's pretty easy to use the browser console, or node js for that sort of thing

20:38 johnmn3: yea, I oughta do those online interactive courses

20:39 noprompt: johnmn3: the js knowledge will be handy when you intended to use js libs from cljs

20:40 understanding the semantics is a bit important if you want to be able to translate examples, etc.

20:40 johnmn3: if I'm not passing in a parameter, can I assume it is a property access?

20:42 noprompt: obj.foo is property access obj.foo() is a call

20:42 but i'm with bbloom on this one, pick up some js. it'll make more sense.

20:43 dnolen: johnmn3: David Herman's Effective JavaScript looks good or Marijn Haverbeke's http://eloquentjavascript.net

20:43 noprompt: yeah that's a great free book

20:44 johnmn3: I'm on it folks... Thanks for the guidance!

20:44 ryanf: eloquent javascript is good

20:55 tyler_: what are thoughts on using if to test if value is set?

20:55 should i do (if (not= nil search)

20:55 or (if search

20:55 bbloom: tyler_: "set" depends on a bunch of things

20:56 there is a nil? predicate

20:56 tyler_: bbloom: checking existence

20:56 bbloom: and if-not

20:56 so you can do (if-not (nil? search) ...)

20:56 tyler_: ah

20:56 bbloom: there is also when-not

20:56 tyler_: bbloom: thnx

20:56 bbloom: but if you know for a fact search won't be a boolean, it's totally reasonable to just (if search ...) or (when search ...)

20:57 tyler_: search is a string

20:57 bbloom: tyler_: yeah, so just go with (if search ...)

20:57 tyler_: i feel dirty when i use if to check non booleans

20:58 bbloom: tyler_: *shrug* no reason, there are exactly two falsey values in clojure: nil and false

20:58 that's an intentional design

20:58 tyler_: i feel like they took that from ruby, and i feel dirty doing it in ruby as well

20:58 heh

20:59 hiredman: feh, it certainly predates ruby

20:59 bbloom: tyler_: unlikely, considering "nil punning" is a very old idea

20:59 tyler_: ok

20:59 ruby didn't influence clojure

21:01 johnmn3: okay, I think I have a question that is worthy of the present audience, with or without js knowledge... how do you map across a js object and/or array?

21:02 tyler_: (map js-object array)

21:02 johnmn3: so map just works then...

21:03 tyler_: i was tongue-in-cheek

21:03 how to map over an array in javascript?

21:03 johnmn3: yea

21:04 tyler_: arr.map(function(element){ return element.foo })

21:04 johnmn3: k

21:04 bbloom: you can't rely on that across browsers

21:05 tyler_: oh browser javascript?

21:05 bbloom: that's why people use things like $.each in jQuery

21:05 tyler_: i don't touch that

21:05 bbloom: or underscore's _.map

21:05 tyler_: prolly underscore

21:05 johnmn3: well, I have a "for ..." construct in some example js...

21:05 can I replace that with a map, is what I'm wondering

21:06 tyler_: most if not all fors can be replaced with map

21:06 bbloom: johnmn3: the behavior of "for" in javascript has a giant bag of caveats

21:06 johnmn3: and the specific object is: var files = evt.target.files; // FileList object

21:06 tyler_: why not ask in #javascript?

21:07 johnmn3: because I'm translating it to clojurescript

21:07 brehaut: "the behavior of javascript has a giant bag of caveats" FTFY bbloom

21:07 bbloom: brehaut: true story

21:07 johnmn3: clojure's protocols are extended to javascript arrays in some cases

21:08 johnmn3: same as with JVM clojure:

21:08 johnmn3: thats what I figured

21:08 bbloom: (map inc (array 1 2 3))

21:08 johnmn3: right

21:08 bbloom: ,(map inc (array 1 2 3))

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

21:09 johnmn3: to-array?

21:09 bbloom: er, 'array is a function in cljs

21:09 nott clj

21:09 anyway, you get a seq when you map, not an array

21:09 johnmn3: k

21:09 bbloom: so you need to (to-array (map inc (array 1 2 3)))

21:10 which is significantly less efficient since it's going to create a lazy sequence just to be mapped back to an array eagerly

21:10 so, if you need perf or interop, consider using functions from Google Closure

21:10 that's what it's there for!

21:11 goog.array/map, for example

21:12 noprompt: that's news to me. good to know.

21:12 bbloom: think of Google Closure like the JVM Base Class Library

21:16 noprompt: where do clj->js, array, js-obj, and the like come from?

21:20 Frozenlock: How does one test compojure in a repl? (handler "some-url") ?

21:25 amalloy: $google clojure ring spec

21:25 lazybot: [ring/SPEC at master · mmcgrana/ring · GitHub] https://github.com/mmcgrana/ring/blob/master/SPEC

21:27 amalloy: Frozenlock: ^

21:34 Frozenlock: amalloy: Thanks!

21:55 tommo_: ,(* 1700 17)

21:55 clojurebot: 28900

22:33 xeqi: is there a keybinding for clojure-mode to pretty print an sexp?

22:39 Frozenlock: So many java errors.. Is there something about static methods that makes them not working with normal interop?

22:39 (.method-name java-object args)

22:39 gfredericks: Frozenlock: you have to call them with (Class/method ...)

22:40 Frozenlock: o_O

22:40 gfredericks: ,(Math/pow 3 4)

22:40 Frozenlock: I'll be back..

22:40 clojurebot: 81.0

22:41 Frozenlock: Well that worked. Thanks :)

22:41 Now I must remember that a method is not the same thing as a static method.

22:43 Raynes: gfredericks: You should write this Personas workflow for friend for me.

22:44 imo

22:46 gfredericks: o_O I don't even know what that means

22:46 brehaut: raynes is personas the thing you use for auth in refheap?

22:46 Raynes: brehaut: Yes.

22:48 * gfredericks is just trying to figure out how to scale a raphael thinger

23:14 mindbender1: how do i troubleshoot a ring server that is giving me http error 503.

23:19 what is the default version of jetty in ring-jetty. Is there a way to specify a version?

23:20 egghead: mindbender1: https://clojars.org/org.clojars.mmcgrana/ring-jetty-adapter

23:22 my mistake mindbender1: https://clojars.org/ring/ring-jetty-adapter/versions/1.2.0-SNAPSHOT

23:39 johnmn3: Okay, so with lein trampoline cljsbuild listen-repl ... What if I want to fire up the page on another computer to see how it interacts? The other machine attempts to reach back to "localhost:9000" and it ends up breaking the js on the page.

23:41 I'm thinking about putting in some kind of conditional, like "if a service is listening on localhost:9000, attempt to connect" but I don't think that can be done in js/cljs

23:41 oh, but I could do a try catch thing

Logging service provided by n01se.net