#clojure log - May 24 2012

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

0:05 LoganLK: is there any reason why http://clojure-libraries.appspot.com/ goes down so much?

0:22 technomancy: kwertii: yeah, it's exposed as a system property

0:22 project-name.version IIRC

0:22 kwertii: technomancy: thanks

0:23 technomancy: LoganLK: highly recommend http://clojuresphere.herokuapp.com instead

0:24 brainproxy: I pasted this into emacs connected to swank-clojure, thinking surely the part that makes it able to run the http request has been elided:

0:24 https://gist.github.com/2779361

0:24 but nope, it just ran :D

0:25 maybe it's amazement arising from naivety, but anyway I'm amazed and all happy inside at the same time

0:25 ro_st: technomancy: what's the right way to have swank repl load some stuff on startup?

0:26 using clojure-jack-in and lein2

0:27 technomancy: I'm not sure; maybe :repl-init

0:28 ro_st: actually, perhaps that's the wrong question.

0:29 when i use lein2 repl, i get a nice repl where (doc foo) and (pprint foo) just work. in swank, i have to use clojure.repl and use clojure.pprint all the time

0:30 how can i get the swank repl to do what the lein2 repl does?

0:31 muhoo: ro_st: i just hacked around it with this: https://www.refheap.com/paste/2853

0:31 whenever i change namespaces,, i just press those keys

0:32 ro_st: nice! wouldn't it be better to bind that to "C-c M-p" - which sets the repl's NS to that of the current buffer's as well?

0:32 what goodies do you have in kens.replutils? :)

0:39 brainproxy: muhoo: thanks for that

0:40 ro_st: yeah. very handy

0:41 ok, i've just managed to get live-coding-emacs and clojure-swank and magit all working together nicely

0:41 brainproxy: ..looks into live-coding-emacs

0:42 ro_st: worth it for the autocompletion popup alone, but the other stuff in l-c-e is also great

0:42 brainproxy: today is my first day w/ swank

0:42 been emacs'ing since january

0:42 ro_st: sublime text 2 is now just a .emacs.d browser :)

0:43 brainproxy: it's funny, when I go to edit stuff in .emacs.d, I drop to the terminal and use vim

0:43 don't know why, just do it w/o thinking

0:43 noidi_: alias vim=emacsclient :)

0:44 ro_st: i use ST2 because i want to be able to browse around with the file browser. ST2's is waaaay better than speedbar

0:44 but for editing emacs config, emacs, because you can eval-buffer

0:44 brainproxy: I've gotten to the point where I can work briefly in vim and not get screwed up

0:44 * emezeske high fives brainproxy.

0:44 brainproxy: i mean in close time proximity to working in emacs also

0:45 ro_st: emezeske: remember i asked about jsdoc type annotations for clojurescript? as a test, i stripped out all the jsdoc annotations from my 'traditional' gclosure codebase to see what effect it has on the outputted advanced-mode js

0:46 the difference was 1404 bytes on a 158kb file

0:46 so jsdoc annos are not necessary for cljs :-)

0:46 (my nick used to be robertstuttaford)

0:52 technomancy: ro_st: don't use doc; use C-c C-d C-d

0:52 C-c S-i mostly replaces pprint

0:53 ro_st: gah. of course. i've even got both of those on my handwritten post it stuck on my monitor

0:53 emezeske: ro_st: Oh, yeah I vaguely remember that

0:53 ro_st: Heh, that's good to know!

0:54 ro_st: Thanks for the follow up :)

0:54 ro_st: emezeske: are there any known issues with CLJS in general that would prevent me from developing an app intended for a broad audience? eg, issues with mobile browsers or IE

0:56 brainproxy: ro_st: live-coding-emacs looks like it contains some nice goodies; I've been using bbatsov's prelude, which does some similar things

0:57 but I may cherry pick some of the fun things like the clojure mode pretifications

0:57 dnolen: ro_st: we regularly get bug reports if things are broken in IE so I think we're doing OK there.

0:57 ro_st: shouldn't be any issues on modern mobile browsers far as I know either.

1:00 brainproxy: technomancy: is there any way in project.clj or another config file to control where/how swank-clojure looks for `lein`?

1:00 emezeske: rossabaker: Not that I am aware of.

1:00 rossabaker: Oops, mt

1:00 ro_st: Not that I'm aware of. I myself am writing an app targetting school teachers, which are IE-heavy

1:01 ro_st: Things work great on mobile so far as I've seen, although I haven't done as much testing there

1:13 ro_st: i notice lein-cljsbuild doesn't have a parameter for the 'main' namespace. does this mean that i can't compile multiple binaries off of a single codebase?

1:13 i ask because i'd like to build 3 apps from one codebase: handheld, tablet, desktop. all sharing the model and service layer code but implementing their own uis

1:13 thanks dnolen

1:14 brehaut: detecting mobile devices is a bit of a horrible piece of hackery (equivalent to old school browser detection) youd be better off trying to avoid it if at all possible

1:15 ro_st: brehaut: i know. i don't want to serve desktop code and media to a mobile device.

1:15 my current plan is to assume mobile, and detect for tablets and desktops

1:16 brehaut: if you are doing a JS heavy app, you can do the media server on a per client basis (based on dimensions of the window etc)

1:17 rather than trying to get the server to determine what is best

1:17 ro_st: it's not just about media. the ui code is going to be significantly different for handheld vs desktop

1:17 brehaut: thats why i was talking specifically about media

1:18 ro_st: gmail uses client side detection + redirects, i believe

1:18 brehaut: gmail has a horde of programmers working on it too

1:19 ro_st: indeed :)

1:20 brehaut: also what do you mean by 'tablet' ?

1:20 ro_st: i guess tablet is a responsive variant of handset

1:21 touch based, but differently laid out to take advantage of extra space

1:21 technomancy: brainproxy: clojure-swank-command IIRC

1:21 brehaut: alternatively its just the desktop site where youve made sure you support touch events as well as mouse and keyboard

1:22 but if thats only really true for the ipad, the 7" android tablets are different again

1:22 ro_st: it's not that simple. the desktop ui is designed to take advantage of hover. i have to add hackery to get scrolling areas right on mobile. etc

1:24 brehaut: im not an expert on the cljs infrastructure, but why couldnt you just create a library for the common code, and then independant projects if you must have seperate build targets?

1:25 it seems if you really need to have wildly different experiences, that you have pretty clearly defined codebases anyway

1:26 ro_st: yeah. i'll have to try a couple things out

1:26 scottj: ro_st: you've looked at the :builds options right? (I haven't)

1:26 ro_st: scottj: yup. specify a folder, not a namespace. i assume that to mean it'll slurp all the cljs in and bash it together

1:27 gclosure compiler takes a namespace and walks the deps to figure out what to compile. i'm hoping for the same behaviour with cljs

1:27 cos then i can have one codebase

1:36 muhoo: ro_st: i'm pretty sure i put it up somewhere, but i don't remember under what name. replutils was too generic (or was taken, or something)

1:53 michaelr`: good morning

2:17 muhoo: is there some clean-ish way to turn a java.util.Collections into a seq?

2:31 ro_st: anyone using monger and know how to do the equivalent of a WHERE field IN ( … ) sql clause with it?

2:47 i have a seq of {:old_id "x1" :_id "y1"} maps. i want to convert that into a map like this: {"x1" "y1"}. how would i do this?

2:51 Borkdude: ro_st: ##(vals {:a 1, :b 2})

2:52 then make that into a map

2:53 ,(apply hash-map (vals {:a 1, :b 2}))

2:53 clojurebot: {1 2}

2:54 ro_st: so i end up with a list of lists : ((1 2) (3 4)). i need to some how flatten this list before hash-map will work on it

2:54 Borkdude: ro_st

2:54 ro_st: then you can use (into {} …)

2:55 ro_st: hash-map is also fine

2:56 ,(into {} [[1 2] [3 4]])

2:56 clojurebot: {1 2, 3 4}

2:56 ro_st: ,(into {} (map #(vals %) '({:old "1" :new "2"} {:old "3" :new "4"} {:old "5" :new "6"})))

2:56 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map$Entry>

2:56 Borkdude: ro_st: ok, you need to have a seq of vectors of size 2

2:56 ro_st: the values in question are both strings

2:56 Borkdude: ro_st: those are treated as mapentries

2:57 so #(vec (vals %)) will probably do

2:57 ,(into {} (map #(vec (vals %)) '({:old "1" :new "2"} {:old "3" :new "4"} {:old "5" :new "6"})))

2:57 clojurebot: {"1" "2", "3" "4", "5" "6"}

2:57 ro_st: yay!

2:57 so easy once you know how

2:58 thank you, Borkdude

2:58 Borkdude: np

3:20 ,(doc mapv)

3:20 clojurebot: "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a vector consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."

3:21 Borkdude: ,(source mapv)

3:21 clojurebot: Source not found

3:23 kilon: morning all

3:27 TEttinger: hey all

3:27 I have a one-liner I am trying to keep fairly short

3:27 Iceland_jack: '

3:27 TEttinger: it is supposed to generate a "map" for a text-based game, think nethack

3:27 (defn -main [] (println "") (doseq [p (take 1920 (shuffle (flatten [ (repeat 200 "T") (repeat 600 ":") (repeat 1200 ".")])))] (print (str p))) (flush))

3:28 1920 is 80x24, terminal size

3:28 the problem is I want to add newlines into the shuffled vector

3:29 so how would #clojure insert a new entry at a specified step into a vector?

3:30 ivan: I would (partition 80 yourmap) first

3:30 AimHere: partition, interleave, flatten?

3:30 TEttinger: does that return a lazy seq?

3:30 ro_st: (-> data one two three) this happens in printed order, right?

3:31 ivan: &(clojure.string/join "" (flatten (interleave (partition 4 "abcdefgh") (repeat '\newline))))

3:32 (surely not the simplest way though)

3:34 ,(clojure.string/join \newline (map clojure.string/join (partition 4 "abcdefgh")))

3:34 clojurebot: "abcd\nefgh"

3:38 TEttinger: ivan, that and AimHere's suggestion did the trick

3:38 (defn -main [] (doseq [p (flatten (interleave (take 24 (partition 80 (shuffle (flatten [ (repeat 200 "T") (repeat 600 ":") (repeat 1200 ".")])))) (repeat 24 "\n")))] (print (str p))) (flush))

3:39 just *barely* fits on one line :-)

3:40 ro_st: i want to turn a seq of {:_id #<ObjectId 4fbde3f7c026db322fdc2799>, :old_id 375} maps into a flat map of {375 #<ObjectId 4fbde3f7c026db322fdc2799> ...}

3:41 the (vals) solution that Borkdude only works if the items are in the right order in the source maps, which they aren't. i can't seem to specify the order, either (it's coming from mongodb via monger)

3:46 ivan: ,(apply conj {} (map (fn [pair] [(:old_id pair) (:_id pair)]) '({:_id "blah" :old_id 375} {:_id "hello" :old_id 376})))

3:46 clojurebot: {376 "hello", 375 "blah"}

3:46 kral: namaste

3:49 ivan: ,(let [x '({:_id "blah" :old_id 375} {:_id "hello" :old_id 376})] (zipmap (map :old_id x) (map :_id x)))

3:49 clojurebot: {376 "hello", 375 "blah"}

3:50 ro_st: wow, ivan. i hope to attain your understanding asap.

3:51 zipmap one looks far simpler!

3:54 ivan: obfuscation contest:

3:54 ,(let [x '({:_id "blah" :old_id 375} {:_id "hello" :old_id 376})] (apply zipmap (map #(map % x) [:old_id :_id])))

3:54 clojurebot: {376 "hello", 375 "blah"}

3:56 ivan: (I think I might actually enjoy a real obfuscation contest)

3:57 ro_st: i suspect you'd do well

3:57 ivan: especially one like the Underhanded C contest

4:00 ro_st: what's the symbol for the last evaluated repl value? _*?

4:00 ivan: *1

4:01 ro_st: thanks

4:01 TEttinger: you can only interact with the map that holds all data in the program using phrases from russian literature run through (keyword), every time. you can only tell what one of the map's values is by looking up the metadata of another value...

4:03 alternatively, keyword combined with a string using combining diacritical characters... in a fake-accented character phishing attack-style way of messing with people trying to read your program

4:04 ro_st: what on earth are you on about, TEttinger? :-)

4:04 TEttinger: (keyword "ÀÀ") vs. (keyword "ÀÀ")

4:04 obfuscation

4:06 ivan: pack your program in a way that requires specific JVM optimizations, requires execution of the packed program

4:06 TEttinger: (keyword "ÀÀ") "good" (keyword "ÀÀ")

4:06 ,((keyword "ÀÀ") {(keyword "ÀÀ") "good" (keyword "ÀÀ") "bad"})

4:06 clojurebot: "bad"

4:07 TEttinger: ,((keyword "ÀÀ") {(keyword "ÀÀ") "good" (keyword "ÀÀ") "bad"})

4:07 clojurebot: "good"

4:07 TEttinger: that one is pretty devious

4:30 muhoo: is juxt appropriate for side-effecting functions?

6:21 gaussblurinc: hello! can anybody advise me books/sites/tutorials for beginning? (don't know functional paradigm)

6:26 KIMA: I would recommend you get the new book Clojure Programming. It has a very good chapter for functional programming

6:27 vijaykiran: gaussblurinc: what's your background/which languages are you familial with ?

6:30 gaussblurinc: vijaykiran: C/C++/C#/Obj-C, SAS, Perl, R-package, Matlab, and a very-very-very-very little with Ruby

6:30 KIMA: it is O'Reilly?

6:33 vijaykiran: gaussblurinc: http://java.ociweb.com/mark/clojure/article.html

6:33 I think the book KIMA is referring to is indeed O'Reilly's

6:38 gaussblurinc: thank you!

7:14 yoggi: folks, i'm havving trouble installing cljsbuild on windows http://paste.in.ua/4279 any help appreciated :)

7:19 clgv: yoggi: check whether you use the less-than function for unsupported parameters

7:20 yoggi: use (print-cause-trace exeception) to get more details

7:21 Hotroot: 430 people? Neat, glad to see that this language has an active community =)

7:22 Just seeing if the channel exists, night all

7:24 yoggi: clgv, i'm just trying to install cljsbuild via 'lein plugin install', so I guess it's not my code, which is causing the problem

7:24 kilon: lol watched that video screencast yesterday and did not understand a thing :D

7:25 clgv: kilon: which?

7:25 yoggi: oh thats bad.

7:25 kilon: clgv: http://cemerick.com/2012/05/02/starting-clojure/

7:25 clgv: yoggi: your leiningen works in general?

7:26 kilon: ah right

7:26 kilon: to be fair , i dont think its aimed for begineers with clojure

7:27 yoggi-: clgv: yup, leiningen works

7:27 stable version, 1.5 I guess

7:27 clgv: kilon: "starting clojure" does sound like it is intended for beginners, though

7:28 yoggi-: you can safely upgrade to 1.7.1 and check if it is still bugging you

7:38 Borkdude: is there a leiningen 2 plugin that compiles clojurescript ?

7:39 p_l: cljs-build wokrs

7:39 *works

7:39 clojurescript-one worked too

7:39 Chiron_: Hi, how to catch an exception thrown within with-open?

7:40 clgv: (try (with-open ... ) (catch IOException e ...))

7:40 clojurebot: Leiningen's "checkout dependencies" feature (see the README) allows you to override a declared dependency with a local copy symlinked inside the ./checkouts dir.

7:41 clgv: clojurebot: botsnack

7:41 clojurebot: Thanks! Can I have chocolate next time

7:41 Borkdude: lein bootstrap doesn't work with the clojureone project in leiningen 2

7:43 p_l: Borkdude: worked for me, but not immediately

7:44 I might have dropped an extra lein deps there

7:44 (worked as of yesterday)

7:44 kilon: clgv: good point , now i noticed the title :D , no , certainly not introductory material, it assumes that the user knows already too much about clojure

7:45 clgv: kilon: I didnt watch it...

7:45 kilon: it was full of weird terminology i never heard before

7:46 clgv: kilon: did you read a clojure book yet?

7:47 yoggi: clgv: well, I've updated to 'lein 1.7.1' and now I have a new exception "Could not find the main class: Files. Program will exit."

7:48 kilon: clgv: the ones recommended are not free , so no, I am still reading the main reference in main website but i dont think it will help me much, so I am still looking for some good free documentation that is really for begineers and not think it is for begineers ;) and if clojure convice me from the first read then I am ready to spend money on it

7:49 and buy an actual book

7:51 clgv: yoggi: well. that sounds like your leiningen installation is somehow corrupt

7:54 kilon: you can buy one of the older books to get the main ideas of clojure - they should be cheaper I guess

7:55 kilon: I started with "Programming Clojure" which was already outdated by clojure 1.2 when I read it ;)

7:55 kilon: clgv: even if i decide to buy , it will take weeks for the book to arrive in Greece. Unless I am lucky and find one in the greek bookshops but I seriously doubt it

7:57 the problem with his introduction being so bad, I have serious doubt about his book

7:57 achin: kilon: I've found this one to be useful. It's fairly dense, but I like it. http://java.ociweb.com/mark/clojure/article.html

7:59 kilon: achin: looks reasonably readable , thanks mate , i will read it now

7:59 clgv: kilon: oh "Programming Clojure" is from Stuart Halloway - you confuse it with "Clojure Programming" ;)

7:59 achin: kilon: No worries. I don't know if you talked about this already, but most of the Clojure books are available as PDFs, too.

8:00 kilon: clgv: oh sorry i though you messed up the word order , did not realis you were referring to another book

8:01 achin: yeah i realise that, but if i spend money i prefer getting actual books , but yeah having also the pdg available its welcomed until the book arrives to me

8:01 *pdf

8:37 wmealing: is there a better method / preferred method of inter-jvm communication other than zeroMQ ?

8:38 clgv: wmealing: there is `slacker` which is based on RMI afair

8:40 wmealing: ok.. i'll look into it

8:42 clgv: it looks close to what i want

8:44 edw: llasram: Ellipses: therein lie demons.

9:00 Chiron_: using this code: (try (with-open ... ) (catch IOException e ...)) what the idea of with-open ? not really different from try/catch/finally (except the implicit finally)

9:01 clojurebot: merengues

9:01 clojurebot: It's greek to me.

9:13 kmicu: Chiron_: 'with-open' ensures that the reader is closed at the end of the form

9:18 michaelr`: string template looks like a good thing hmm

9:19 I mean StringTemplate

9:20 I think i will replace Hiccup with it

9:23 klauern: I'm having some trouble calling a Java static method from Clojure.

9:23 http://docs.oracle.com/javase/7/docs/api/java/nio/file/Paths.html#get(java.lang.String, java.lang.String...)

9:24 clgv: Chiron_: yeah you could write an extended with-open that allows you to specify catch blocks...

9:25 klauern: The argument list takes (String, String...) or (URI), but I get different errors trying to call it one way or another

9:25 (java.nio.file.Paths/get "C:/") gives me a ClassCastException trying to coerce "C:/" to a URI

9:26 and (java.nio.file.Paths/get "C:/" "temp") gives me a ClassCastException trying to coerce a String to a String[]

9:26 Chiron_: with-open ensures the reader is closed but exceptions are extremely normal when dealing with streams. I only think that with-open needs to deal with exception. just a thought

9:27 michaelr`: klauern: in the first case the overloaded method requires an URI object

9:27 klauern: in the second you have to pass a string array as the second parameter

9:27 klauern: maybe you can use (into-array) for that

9:27 klauern: So what does a string array look like in Clojure?

9:28 michaelr`: (into-array ["what" "where"])

9:28 klauern: because then it gives me an exception trying to cast a PersistentVector into a String[]

9:28 michaelr`: &(into-array ["what" "where"])

9:28 ,(into-array ["what" "where"])

9:28 klauern: ok, I'll look at that.

9:28 clojurebot: #<String[] [Ljava.lang.String;@18a9794>

9:28 michaelr`: it's a java string array

9:28 i think it should work

9:28 klauern: excellent, that does work

9:28 thank you

9:41 kilon: now thats what I call a intro -> http://www.youtube.com/watch?v=Aoeav_T1ARU&feature=relmfu

9:42 thank you youtube , you rock :D

10:19 bobry: is it possible to provide default implementation for methods in 'defprotocol'?

10:22 si14: anyone using closure library with clojurescript?

10:23 lucian: bobry: yeah, just write a body for that function

10:24 bobry: uh, no you can't. ignore me

10:30 clgv: bobry: if you need that you can use a multimethod instead of a protocol provided that you do not need a java interface & class

10:31 syntaxfree: so most of the Incanter website is down. You can download a .dmg or .exe, but there's no documentation.

10:31 Is it in active development?

10:35 bderooms: anyone knows how to allocate more memory whe nrunning from leiningen?

10:35 oh wait.. that's also just a jar

10:42 gfredericks: bderooms: I think your project runs in a separate java process than leiningen; if you want more memory for your project, I think lein has config options for that

10:43 mefesto: hey all

10:44 im working on a soap-based web service (ew) using jax-ws and i'd like to use clojure to implement everything. is it possible to use this with leiningen?

10:45 the flow is something like: run wsimport on some wsdl, package up the classes files in a jar, compile clojure implementation, run endpoint

10:45 i'm not sure how that fits in with leiningen so any advice would be appreciated

10:49 gfredericks: mefesto: "run endpoint" means run your clojure project?

10:50 mefesto: gfredericks: yeah that's a rough outline

10:50 clgv: syntaxfree: what do you mean? incanter.org seems fine#

10:50 clojurebot: clojure.org is https://refheap.com/paste/1029/raw

10:50 elliottw: anyone read this: http://denkspuren.blogspot.com/2012/05/root-of-polymorphism-anti-if-campaign.html

10:50 mefesto: gfredericks: ideally lein swank would make sure the ws artifacts are generated from the wsdl and available on the classpath

10:50 syntaxfree: clgv: documentation is offline

10:51 clgv: syntaxfree: what exactly?

10:52 the documentation link on incanter.org points to data-sorcery.org which is available

10:52 api-documentation page is accessible as well

10:54 mefesto: i'd settle for an easy way to include an arbitrary jar file on the classpath with leiningen w/out having to install it in my local mvn repo

10:57 moogatronic: I just ran into a transitivity issue with == : (== 3 3.0 3.0M) vs (== 3 3.0M 3.0) and saw that there was a posting on Google Groups - Does anyone know if this is considered a 'bug' or if it's just something to be aware of with == ?

10:59 hyPiRion: When it comes to numbers = checks for type and value equality, while == checks for value equality

10:59 so ##(vector [(= 1.0 1) (== 1.0 1)])

11:00 moogatronic: hyPiRion: yeah, but if you run those two that I mention, one returns true, and the other returns false, due to the order of compairisons.

11:01 cgag_: that sounds like a bug to me

11:01 moogatronic: https://groups.google.com/forum/?fromgroups#!searchin/clojure/transitive$20==/clojure/kJGteQ_JayQ/MSZFy44dwkQJ

11:01 hyPiRion: moogatronic: Oh, I filtered away one of the equals

11:02 ,(== 3 3.0M)

11:02 clojurebot: false

11:02 afoolsuchasi: hey, new to clojure simple question: if i have an "if" form, how do i combine multiple forms to run on the true condition? is there like a progn?

11:02 hyPiRion: ,(== 3.0M 3)

11:02 clojurebot: false

11:03 hyPiRion: Huh.

11:03 moogatronic: ,(== 3 3.0)

11:03 clojurebot: true

11:03 moogatronic: ,(== 3.0 3M)

11:03 clojurebot: true

11:03 dan`b: afoolsuchasi: I think you want the "do" form

11:03 TimMc: ,(let [ns [3 3.0 3.0M]] (for [a ns b ns] (str a \space b \space (== a b))))

11:03 clojurebot: ("3 3 true" "3 3.0 true" "3 3.0 false" "3.0 3 true" "3.0 3.0 true" ...)

11:03 afoolsuchasi: dan`b: thanks. ill check it out

11:04 hyPiRion: afoolsuchasi: If you don't want to run the false-part, you should also check out the when-macro

11:04 TimMc: ([3 3 true] [3 3.0 true] [3 3.0M false] [3.0 3 true] [3.0 3.0 true] [3.0 3.0M true] [3.0M 3 false] [3.0M 3.0 true] [3.0M 3.0M true])

11:04 afoolsuchasi: thanks

11:05 TimMc: Non-transitivity.

11:06 moogatronic: TimMc: My question, and the question in the Google Group posting, would be is Non-transitivity 'correct' for == ?

11:06 hyPiRion: What's more interesting is the following

11:07 ,(== 3.0M 3M)

11:07 clojurebot: false

11:08 TimMc: ,(let [ns [3 3M 3.0 3.0M]] (for [a ns b ns :when (not (== a b))] [a b]))

11:08 clojurebot: ([3 3.0M] [3M 3.0M] [3.0M 3] [3.0M 3M])

11:09 TimMc: If 3.0M is getting stored with a non-zero exponent... does that make sense?

11:09 moogatronic: ,(== 0 (.compareTo 3.0M 3M))

11:09 clojurebot: true

11:09 TimMc: ,(let [ns [3 3M 3.0 3.0M]] (for [a ns b ns :when (not (.compareTo a b))] [a b]))

11:09 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException>

11:10 clgv: ,*e

11:10 clojurebot: #<Unbound Unbound: #'clojure.core/*e>

11:10 clgv: repl feature^^

11:11 hyPiRion: ,*1

11:11 clojurebot: #<Unbound Unbound: #'clojure.core/*1>

11:11 hyPiRion: Better use clojure.algo.generic.math-functions/approx= for comparisons like that.

11:11 At least for now, I suppose.

11:58 zakwilson: http://clojure.org/libraries <-- this page needs an update

12:05 technomancy: zakwilson: probably just needs to be removed

12:13 zakwilson: technomancy: or that, but something with a list of the standard libraries would be useful. I suppose the API page is a better place.

12:13 technomancy: considering the rate at which clojure.org gets updates, anything on there is bound to do more harm than good

12:14 I don't think curating a list of "blessed" libraries is something the maintainers should or want to do.

12:16 hyPiRion: Better to just link to their github repos, perhaps.

12:16 hiredman: technomancy: this conversation is almost funny

12:17 technomancy: clojurebot: http://clojure.org is timeless.

12:17 clojurebot: In Ordnung

12:17 technomancy: in more than one way.

12:18 hiredman: "that should be removed" "yeah it belongs on another page" "no, it should be removed" "yeah, we should keep that list differently"

12:18 technomancy: heh

12:22 I just try to point people towards clojuresphere; that helps a lot

12:23 although it counts historical dependencies, so stuff like monolithic contrib still ranks highly

12:25 daniel___: can anyone tell me why i get this error? https://gist.github.com/2782518

12:27 Bronsa: daniel___: replace [vct] with vct on line 13

12:27 hyPiRion: Probably because you wrap the vct-vector in a vector

12:28 daniel___: oh Bronsa

12:28 duh!

12:28 thanks

12:28 Bronsa: :)

12:32 daniel___: are there any good practices for setting up test data that is general to all tests?

12:32 stick them in a file in the root test folder and require it where needed?

12:33 it will just be a load of (def blah something)

12:33 dnolen: EuroClojure sounds fun, anyone there?

12:53 daniel___: i'm having trouble with namespaces

12:53 (:use [chess.data.positions] :reload)

12:53 from my root folder, i have data/chess/data/positions.clj

12:53 it says it can't find it

12:53 i tried mirroring the arrangement for test: test/chess/test/

12:54 this ties in with my question above...any good practices for test data?

12:58 TimMc: daniel___: Is ./data/ on the classpath?

13:01 daniel___: not according to the error

13:01 i didnt deal with the classpath because i used lein to create the project

13:02 so /src and /test were automatically added i guess

13:03 i just looked at the classpath, i can see the it adds test-resources/

13:03 TimMc: daniel___: Right, src, test, resources, classes, and everything in lib are always added to the classpath. You can change that, though!

13:04 daniel___: perhaps that's where this kind of data should live?

13:04 TimMc: Sounds right.

13:05 daniel___: yep, works now

13:06 so i have test-resources/chess/data/positions.clj

13:06 how would i add something to the classpath with leiningen? can i specify extra folders in the project.clj?

13:09 jayunit100: not sure what this does :

13:09 -> #'main-routes

13:09 in my hacked up ring app.

13:10 TimMc: jayunit100: It's impossible to tell for sure from that tiny snippet. Pastebin?

13:10 jayunit100: TimMc Good call

13:10 TimMc: daniel___: Check out the sample.project.clj file in lein's repo.

13:11 jayunit100: http://pastebin.com/raw.php?i=9FRgqEJR

13:11 kmicu: daniel___: https://github.com/technomancy/leiningen/blob/master/sample.project.clj

13:11 tmciver: jayunit100: that passes the var to the run-jetty function so that you don't have to restart the server when you make changes.

13:11 jayunit100: hmmmm what is the syntax doing ?

13:11 a # is usually a set , right ?

13:12 TimMc: jayunit100: Are you asking about ->?

13:12 jayunit100: # is reader dispatch

13:12 jayunit100: oh

13:12 oops

13:12 TimMc: So what's important is the next character. :-)

13:13 #'foo means (var foo), #{foo) means (hash-set foo) or similar, etc.

13:13 errr #{foo}

13:14 jayunit100: (wrap-file (handler/api (var main-routes)) "public")

13:14 jayunit100: i like that better :)

13:15 why is main-routes sent as a var ?

13:15 gfredericks: ,(hash-set 1 2 2 3)

13:15 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: 2>

13:15 gfredericks: jayunit100: I think that gives you more flexible reloadability

13:15 tmciver: TimMc: is # still considered a reader dispatch for the set literal #{}?

13:17 jayunit100: oh , because the var is mutable ?

13:17 I guess, is the passing/redeclaring of the var making it somehow behave like a mutable variable ?

13:17 cpinera: Hi. I'm looking for a clojure library for Neo4j, and I see there's plenty of options. Does anyone have a recommendation? I would prefer something as idiomatic as possible.

13:18 gfredericks: jayunit100: yeah it's a reference type

13:18 when a var refers to a function you can treat the var like a function

13:18 jayunit100: Ah okay

13:18 gfredericks: so ring calls the var each time a request comes in, and when you rebind the var to a new function it gets updated effortlessly

13:18 in contrast to if you had passed the function itself to ring originally

13:20 TimMc: Even if vars of fns couldn't be invoked directly, you could still deref them first.

13:20 tmciver: I believe so.

13:21 tmciver: Hmm, seems yes, # is the reader dispatch macro for set as well (http://clojure.org/reader#The%20Reader--Macro%20characters). Seems strange to me that set literals get a special reader macro syntax and maps and vectors don't.

13:21 TimMc: Ran out of characters.

13:22 hiredman: tmciver: maps have { and vectors have [

13:24 "dispatch" there is just a second table of reader macros

13:24 # means "look at the second table"

13:24 { is a map in the first, but a set in the second

13:24 ibdknox: clever

13:24 gfredericks: #[1 2 3] could be something

13:27 technomancy: gfredericks: a finger tree, some day?

13:27 Bronsa: a range?

13:28 mefesto: can leiningen install a jar file (non-leiningen project) into the local mvn repo or is `mvn install:install-file` the only way?

13:28 technomancy: mefesto: there's a lein-localrepo plugin for that

13:28 mefesto: technomancy: thanks

13:29 technomancy: clojurebot: repeatability?

13:29 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

13:29 technomancy: mefesto: but see the above link for why it's often not a good idea

13:29 mefesto: technomancy: i agree but this is a jaxws project

13:29 technomancy: ok, as long as you're aware

13:29 mefesto: technomancy: know of a lein-jaxws plugin?

13:29 technomancy: no, never heard of it

13:30 mefesto: soap based web services :-\

13:30 technomancy: I'm sorry =(

13:30 mefesto: the flow im dealing with is wsdl -> class files -> jar -> copy to lein lib dir -> lein swank :-\

13:31 once the wsdl is stable enough then i'll just install the jar in my local repo and use the normal lein dependency mechanism but until then this is all i have :(

13:33 klauern: why not use the clojure maven plugin with whatever wsdl -> class files compiler you're using?

13:33 mefesto: klauern: im not too familiar with maven but the last time i tried using maven with jaxws it was a pain (this was a while ago)

13:34 klauern: I've used a bunch of maven plugins with wsdl -> java (axis2, cxf, jaxws, etc), and for the most part, the plugins all work pretty equally well

13:34 mefesto: klauern: i'll give it a shot. thanks! :)

13:35 klauern: mefesto: good luck with it. Might be easier just to do the wsdl -> java in a maven project, then it installs the .jar to your .m2, then you can use lein projects on the other end

13:36 mefesto: http://cxf.apache.org/docs/how-do-i-develop-a-client.html

13:37 samedhi: I am attempting to use clojure 1.4.0, because I want it for datomic, but i also wanted to use fetch. However, when I add fetch to my project.clj, I am automatically downgraded to clojure 1.2.1? How can I find out why?

13:37 hiredman: why not just generate the wsdl classes programtically?

13:38 mefesto: hiredman: how so?

13:38 wsimport has an api?

13:38 klauern: well, the source for the maven plugin probably details how to do it: http://jax-ws-commons.java.net/jaxws-maven-plugin/

13:38 samedhi: I can see a tree of dependencies using "lein pom; mvn dependency:tree", but I don't see it actually requiring 1.2.1 anywhere.

13:38 mefesto: or are you talking about using the dispatch api?

13:39 hiredman: mefesto: I am not talking about using a particular api, just have a macro that feeds the wsdl into whatever class generator then loads the classes

13:40 mefesto: hiredman: sounds good but i have no idea how to do that. pointers?

13:40 hiredman: find out how to drive what ever code you are using to generate the wsdl classes programmatically instead of from maven

13:41 klauern: I think you could just borrow from the maven plugin that calls the wsimport apis: http://java.net/projects/jax-ws-commons/sources/svn/show/trunk/jaxws-maven-plugin/src/main/java/org/jvnet/jax_ws_commons/jaxws?rev=987

13:42 mefesto: hiredman: im not sure you can do that with jax-ws. perhaps another ws stack but jax-ws is all that im (somewhat) familiar with.

13:43 hiredman: why couldn't you do that with jax-ws?

13:43 mefesto: hiredman: im probably misunderstanding you also :)

13:43 klauern: mefesto: sure you could. Look at the WsImportMojo.java http://java.net/projects/jax-ws-commons/sources/svn/content/trunk/jaxws-maven-plugin/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java?rev=987

13:43 all that class does is process the maven pom.xml parameters and call wsimport to generate .java

13:44 mefesto: klauern: ahh i see com.sun.tools.ws.WsImport

13:44 i was only looking at the javax.xml.ws / javax.jws namespaces

13:48 this is looking pretty good -- i'll give it a shot

13:49 hiredman, klauern: thanks!

13:50 klauern: you're welcome

14:06 tmarble: ibdknox: I am trying to run a 'sh' command from a Noir page, but I'm getting RejectedExecutionException

14:07 and I'm pretty sure this is not related to lein

14:07 is there some special policy to set for ThreadPoolExecutor in the web container?

14:09 dnolen: lynaghk: ping

14:15 technomancy: tmarble: sounds like the agent thread pool got shut down. you wouldn't happen to be on a really old Leiningen, would you?

14:16 tmarble: technomancy: I saw that issue, but I'm on lein 1.7.1 (downrev'd I know!)

14:16 technomancy: huh; no idea then =\

14:17 tmarble: technomancy: but, more to the point, I'm running from the jar w/o lein at all

14:17 technomancy: oh, gotcha

14:19 timvisher_: so i just declared a dependency on this hairball for nothing but this one class http://www.jarvana.com/jarvana/view/org/swinglabs/swingx/0.9/swingx-0.9-javadoc.jar!/org/jdesktop/swingx/graphics/GraphicsUtilities.html

14:20 anyone know of a simpler solution? All I want is a way to create thumbnails quickly and easily

14:20 would hope not to roll my own

14:26 muhoo: timvisher_: https://www.refheap.com/paste/2857 , lifted originally from briancarper's site, but i forgot the link

14:28 S11001001: oh, the strange dichotomy of dependency avoidance and dependency refinement

14:28 timvisher_: muhoo: yep, that's about what i might do if i come up with something myself.

14:28 muhoo: S11001001: co-dependency?

14:28 timvisher_: couple of problems

14:31 muhoo: seems kind of quiet. maybe everyone is at euroclojure.

14:31 timvisher__: Problem 1: BufferedImage seems to be fairly draconian in error handling

14:31 for instance, all of the images here which are fine in the browser, for imagemagick, etc. can't be read by it: http://www.thefoxisblack.com/2012/04/25/we-were-dead-before-the-ship-even-sank-by-modest-mouse-wallpaper-by-ellis-latham-brown/

14:32 well, actually I said a couple of problems

14:32 that's the big one... :)

14:32 so i was hoping someone had come up with a swiss army knife for the jvm

14:32 jtoy: how do i build up a list incrementally?

14:33 timvisher__: seems like the best of breed is really imagemagick which ties me basically to shelling out on a box with it installed

14:33 jtoy: in what context?

14:33 matthavener: jtoy: conj appends to a list

14:33 jtoy: i have to process a bunch of lines of data and return one big list of processed items

14:34 timvisher__: i think you're looking for map, then

14:34 hyPiRion: I'd use mapcat or map

14:34 timvisher__: ,(map + [1 2 3 4 5])

14:34 clojurebot: (1 2 3 4 5)

14:34 timvisher__: ,(map (partial + 1) [1 2 3 4 5])

14:34 clojurebot: (2 3 4 5 6)

14:34 timvisher__: ;)

14:35 jtoy: only certain lines are returned though

14:35 map returns something for each line?

14:35 timvisher__: ,(filter odd? (map (partial + 1) [1 2 3 4 5]))

14:35 clojurebot: (3 5)

14:35 hyPiRion: jtoy: I think you have to explain a litte more what you're trying to achieve.

14:36 timvisher__: map just passes each of the members of the seq to a function and replaces the element with the result

14:37 i love map/reduce…

14:38 jtoy: hope i didn't miss the answer

14:38 42

14:38 hyPiRion: jtoy: I think you have to explain a litte more what you're trying to achieve.

14:39 So you have some lines of data, and want to do something with all of them or some of them?

14:43 tmarble: technomancy: alas you were right! I thought I was streamlining code paths, but the (shutdown-agents) got called just aftern the Noir (run...) -> problem solved!

14:45 timvisher__: jtoy: did you see the filter/map example that i did?

14:45 jtoy: timvisher__: yeah

14:45 timvisher__: that not what you're looking for?

14:45 hyPiRion: jtoy: Anyway, read yourself up on map, filter and remove. They seem to be what you're out after.

14:45 jtoy: I'm trying to test it out, but I think I'm doing something wrong

14:49 timvisher_: jtoy: sorry, lost network

14:49 what's the results you're getting?

14:52 jtoy: timvisher_: so i have a list of (["a" "b"] ["c" "d"] ) i process each line of a file and if the first element matches, then I want to return the second element, that is exactly what i am doing and I'm doing it wrong

14:53 timvisher_: so maybe you're looking for something like:

14:53 ,(map second (filter (comp odd? first) [[1 2] [3 5] [4 6] [7 9]]))

14:54 clojurebot: (2 5 9)

14:54 timvisher_: obviously changed to reflect whatever filtering and positioning you're looking for

14:55 TimMc: ,(let [xs [[1 2] [3 5] [4 6] [7 9]]] (for [[a b] xs :when (odd? a)] b))

14:55 clojurebot: (2 5 9)

14:56 timvisher_: TimMc: well aren't you fancy ;)

14:56 * TimMc monocle

15:12 technomancy: what HTTP response would you use for someone polling for a resource that's being computed asynchronously?

15:12 banseljaj: Hey guys, I have made headway in Lambda, the linux for clojurists. I believe I will have something workable in a month. Should I announce it on the Mailing List?

15:12 matthavener: technomancy: 404? if it doesnt exist (yet)

15:13 tmciver: technomancy: 202 Accepted?

15:13 technomancy: matthavener: 4xx implies that the request was ill-formed

15:13 tmciver: oh, perfect; of course.

15:13 tmciver: technomancy: from wikipedia (http://en.wikipedia.org/wiki/HTTP_status_code) accepted for processing, but the processing has not been completed.

15:14 * emezeske agrees with tmciver.

15:15 timvisher_: technomancy: 420 is sort of applicable :) https://dev.twitter.com/docs/error-codes-responses

15:15 technomancy: hehe

15:20 timvisher_: benseljaj: the list is pretty loose with that sort of thing. if you want to, go for it. ^_^

15:21 banseljaj: I Meant I need some place where people can *actually* tell me what they want.

15:23 timvisher_: the list wouldn't work?

15:29 banseljaj: timvisher_: That's what I'm aking you guys. :P

15:31 brainproxy: is there a shortcut for referring to the last value returned by the repl?

15:31 w/ nodejs's repl it's _

15:32 timvisher_: well i think you're good to go then. ;)

15:32 matthavener: brainproxy: *1 i thin

15:32 timvisher_: yep, *1 *2 and *3

15:32 brainproxy: matthavener: cool, just found that

15:32 timvisher_: alse *e for fun

15:32 also*

15:32 matthavener: timvisher_: what's *e do?

15:33 Raynes: Refers to the last exception that occurred in the repl.

15:33 timvisher_: i believe that's the last thrown exception

15:33 solussd: trying to use crate and I'm getting an error while trying to 'require' crate.form: ERROR: JSC_MISSING_PROVIDE_ERROR. required "crate.form" I don't get this error when requiring crate.core, any suggestions?

15:34 emezeske: solussd: What version of crate, and what does your require look like?

15:35 solussd: emezeske: [crate.form :as crate-form] and 0.1.0-alpha3

15:36 adeelkh: solussd: paste your (ns ...)?

15:36 emezeske: solussd: That's a pretty old version of crate

15:36 solussd: newest on clojars i believe. :)

15:37 emezeske: solussd: Nope.

15:37 solussd: adeelkh: https://www.refheap.com/paste/4fbe8d26e4b0f71f74353acd

15:37 emezeske: solussd: http://clojars.org/search?q=crate , newest is 0.2.0-alpha3

15:37 solussd: The version you're using doesn't even have a form ns

15:37 solussd: emezeske: ill swap that in and see if it works. :)

15:37 well that's probably it then.

15:37 thanks

15:37 emezeske: np

15:38 note: the newest crate is like the newest hiccup, it's been reorganized

15:38 solussd: clojurescript stuff is a fast-moving target

15:38 emezeske: very.

15:38 Raynes: Yeah, and someone is already writing a book on it.

15:38 solussd: thankfully we have clojars/leiningen. Can't imagine managing all my deps any other way

15:39 timvisher_: anyone know of a robust image processing library for the jvm?

15:40 Raynes: someone has a clear masochistic leaning. :)

15:40 solussd: timvisher: opencv + java wrapper

15:40 err.. image processing, nevermind

15:40 timvisher_: lol :)

15:40 besides, needs to be pure jvm

15:40 no shell out

15:41 i already can use imagemagick for that

15:41 pipeline: awt already supports a lot of image formats doesn't it

15:43 timvisher_: pipeline, it does but the images appear to need to be well formed

15:44 http://thefoxisblack.com/desktop-wallpaper/Ellis-Latham-Brown-1280x800.jpg should be readable by your browser and your box

15:44 but BufferedImage barfs

15:44 i may not be understanding all the little bits and bobs that BufferedImage needs though

15:45 pipeline: ahah well that sucks

15:45 timvisher_: Just try an (with-open [is (io/input-stream "http://thefoxisblack.com/desktop-wallpaper/Ellis-Latham-Brown-1280x800.jpg")] (ImageIO/read is)) at the repl

15:45 pandeiro: solussd: are you using the newest crate?

15:45 pipeline: timvisher_: well, even if you can't shell out, can you at least ship a jni imagemagick ?

15:45 jlongster: dnolen: in ClojureScript, you reference properties like (.-property object). what do think about the syntax .object.property ? just curious, I need to build some host interop forms myself.

15:45 solussd: pandeiro: I am as of a couple minutes ago (newest on clojars)

15:46 dnolen: jlongster: not valid Clojure

15:46 pandeiro: i think crate.core/h has a bug? or maybe it's only supposed to escape the _first_ html tag in a string? (that would be weird)

15:46 jlongster: dnolen: yeah, sorry, I'm building them into Outlet

15:46 timvisher_: pipeline: i don't believe i can on heroku

15:46 jlongster: didn't know if you had any strong opinions on that syntax

15:46 timvisher_: i probably could on ec2

15:47 but i was hoping for heroku

15:47 pipeline: "JNI APIs are not guaranteed to work. Search Dev Center for information about specific JNI services supported by Heroku."

15:47 well that's wonderfully vague

15:47 might just have to e-mail them

15:47 timvisher_: of course i could also deploy this as a service on ec2 and then have that as a seperate product

15:47 dnolen: jlongster: just depends I think. In the case of Clojure/ClojureScript that directly clashes syntax for referring to namespaces.

15:47 timvisher_: there are remarkably few good image processing services out there

15:48 ImageShack is pretty good if all you want to do is scale and crop

15:48 but i'm eventually going to need more than that

15:49 jlongster: dnolen: ah, ok. makes sense. I also just realized it doesn't work well with arbitrary expressions like (.-property (foo object)), so that's nice

15:49 adeelkh: timvisher_: https://addons.heroku.com/blitline

15:49 dnolen: jlongster: it's very unlispy so I don't really like it.

15:50 adeelkh: timvisher_: and https://addons.heroku.com/cloudinary but it's in private beta

15:50 jlongster: dnolen: unlispy-ness is relative ;) but I agree here.

15:50 timvisher_: adeelkh: very interesting

15:51 adeelkh: jlongster: that syntax can't be composed so that's pretty unlispy objectively

15:51 dnolen: jlongster: no in this this case, you have nested actions outside of sexpr syntax.

15:52 I also agree with adeelkh, complicates transformation.

15:52 jlongster: yep, it was just a quick thought

15:53 dnolen: jlongster: it is currently an edge case that's allowed in CLJS but will probably be purged at some point.

15:53 solussd: So i'm using noir-cljs, and afaict there is no way to have different cljs files be available to different "pages". has anyone tried to do this?

15:54 jlongster: dnolen: what's the edge case? .- on function expressions?

15:55 dnolen: jlongster: (set! foo.bar.baz ...) works today.

15:55 emezeske: solussd: You might not want to do that; the compiled js output for each page has a bunch of google closure library stuff in it that the client's going to be downloading separately for each page

15:56 bobry: I'm trying to come up with a way of extending 'goog.ui' components from clojurescript, unforunately, this requires some extra work in the type constructor (see http://code.google.com/p/closure-library/wiki/IntroToComponents) -- is it possible in clojurescript?

15:56 solussd: emezeske: so the "right way" is to write clojurescript intended for the entire site?

15:56 emezeske: solussd: I don't know about "right", but it will be more bandwidth efficient and cache friendly overall

15:56 solussd: The way I do it is that I have separate cljs namespaces, one for each page, and each one has an "initialize" function

15:57 solussd: emezeske: the only problem I have with that is using document.ready

15:57 emezeske: solussd: It's pretty easy to avoid that, in my experience

15:57 dnolen: bobry: no executable ctor bodies, so probably not

15:57 muhoo: with lein/heroku, i have a project that needs to depend on my own forks of several libraries. what's the simplest way to handle that? push my own versions to clojars and change the groupid? create a private s3 repo?

15:57 solussd: emezeske: what does the 'initialize' function do? do you detect what page you're on?

15:58 dnolen: bobry: at least not with deftype syntax

15:58 jlongster: dnolen: oh, I didn't know that. yeah, I'm trying to purge those kinds of expressions

15:58 solussd: emezeske: i'm just getting back into web dev after a few years. :)

15:58 emezeske: solussd: No, the initialize function does everything your document.ready handlers do

15:58 dnolen: bobry: but you can probably accomplish what you want with fn + this-as

15:58 bobry: dnolen: are there any alternatives? well, except defrecord

15:58 emezeske: solussd: And the page itself chooses which initialize function to call

15:58 bobry: this-as, hmm, that might work

15:58 emezeske: solussd: So /home might call my-cljs.home/initialize

15:59 solussd: what calls it? the page?

15:59 emezeske: solussd: Keep in mind this is just my way of doing things, there's not really a best practice yet :)

15:59 solussd: Yeah, the page has something like <script>$(my-cljs.home.initialize())</script>

16:00 solussd: And the initialize function is defined with ^:export metadata so it can be called from JS

16:00 solussd: emezeske: cool. That ought to work well for me. thanks for the insight

16:00 adeelkh: muhoo: yeah just push them to clojars with a different groupid

16:01 emezeske: solussd: happy to share ideas, maybe you'll share a nice improvement with me sometime :)

16:01 solussd: emezeske: may be, I'm standing on top of a web stack where it seems everything north of compojure was written by chris granger. :D

16:02 emezeske: solussd: pretty much!

16:02 dnolen: bobry: http://gist.github.com/2783861

16:04 pandeiro: the main problem i have with cljs is that it's taking 7-8 seconds to compile even the slightest change to src files

16:04 not to mention the 100 second+ initial compile

16:04 dnolen: pandeiro: with lein-cljsbuild auto?

16:04 pandeiro: (using lein-cljsbuild)

16:04 yep, the incrementals are about7-8 secs

16:04 emezeske: pandeiro: How many lines of cljs? that seems massively high

16:05 dnolen: pandeiro: I've never seen it take longer than 14 seconds on cold start

16:05 bobry: dnolen: ouch, the first line translates to 'goog.ui.Component.call(null, self__69240, opt_dom_helper)' is there any way to get over this 'null'?

16:05 pandeiro: we're talking less than 50 lines

16:05 emezeske: pandeiro: Are you compiling with advanced optimizations?

16:05 dnolen: pandeiro: auto takes <2-4s

16:05 pandeiro: emezeske: dnolen: which macbooks do you have?

16:05 emezeske: pandeiro: None?

16:05 pandeiro: processor?

16:06 emezeske: Answer my question first :)

16:06 pandeiro: :optimizations :simple

16:06 dnolen: bobry: should no longer be the case in master

16:06 pandeiro: macbook pro 2010 2.66 i7

16:06 pandeiro: i know that my processor sucks, i am 'in between computers' at the mo

16:06 emezeske: Have you tried :whitespace? I'm on a 2.4 GHz AMD.

16:07 bobry: dnolen: thanks, I'll check it out :)

16:07 pandeiro: emezeske: i will try whitespace

16:07 pbostrom: solussd: another alternative is (cond (= js/window.location.pathname "/foo") (foo/init) (= js/window.location.pathname "/bar") (bar/init) ) etc.

16:07 emezeske: pandeiro: Not sure that it will make a difference :/

16:07 pandeiro: emezeske: i have noticed the compile times increasing gradually since the early days

16:08 adeelkh: actually, i usually get 5-8s compilation times with lein cljsbuild auto too

16:08 solussd: pbostrom: yeah, that's one less thing to remember to include in the html. Using enlive with noir so the graphic design guys don't have to know much about the underlying model.

16:08 pandeiro: adeelkh: what cpu?

16:09 ibdknox: is compiling actually CPU bound?

16:09 adeelkh: 2.4 ghz intel core 2 duo

16:09 emezeske: I usually see < 2s compile times on my 2.4 GHz chip from two years ago

16:09 pandeiro: ibdknox: what else would it be?

16:09 ibdknox: IO

16:09 compiling is often IO bound

16:09 pandeiro: i see the java process chewing up >95% in top

16:09 dnolen: pandeiro: possibly though in my experience Closure completely dominates compile time.

16:11 pandeiro: to compile & run all CLJS tests used to take 24-25s for me. I see it now takes 32s. So there's room for improvement but things have not gotten dramatically slower.

16:12 emezeske: So, one thing about lein-cljsbuild is that it doesn't actually do incremental builds

16:12 pandeiro: dnolen: i think on the high end of things it may be negligible but down here it hurts

16:12 emezeske: I was getting a lot of bug reports for a while, and this fixed them: https://github.com/emezeske/lein-cljsbuild/blob/master/support/src/cljsbuild/compiler.clj#L57

16:13 You might try not deleting the intermediate dir upon each build, for incremental builds, to see if that's faster

16:13 I'd be happy to make that a config option if it proves to be useful

16:14 dnolen: pandeiro: I'm listening - but analysis + patches would help me more.

16:14 w/o advanced opts - I see that CLJS tests compile in 11s cold start.

16:16 if somebody wants to do a rigorous analysis of compilation times on different JVMs, OSes, Archs, I'll happily pay attention.

16:16 also tree shaker + code optimizer in Clojure itself would be welcome.

16:18 jayunit100: (map #([%]) [1 2])

16:18 jlongster: dnolen: I'm interested in doing some things like that eventually, and I'll definitely share it if I do

16:18 pandeiro: emezeske: yeah with noir-cljs' compiling middleware things are a little more reasonable, 2-4 seconds

16:18 dnolen: i really wish i could contribute, but i am not there yet

16:19 emezeske: I just tested things with lein-cljsbuild allowing incremental compiles, it does shave off quite a bit of time

16:19 jayunit100: any way we could have a noir dojo in nyc or boston ? i'd like to understand it better myself

16:20 dnolen: emezeske: sweet!

16:20 emezeske: dnolen: I'm not sure I trust it yet, though

16:20 dnolen: Although I should probably make it optional

16:20 pandeiro: emezeske: that would be fantastic

16:21 emezeske: dnolen: And, even better, figure out why it was breaking things, instead of just using it defensively :)

16:21 dnolen: emezeske: I think that would be big, people really shouldn't have to pay for recompiling core.cljs

16:21 jayunit100: any thoughts on why "(map #([%]) [1 2])" fails ?

16:21 gfredericks: yes

16:21 #([%]) tries to call the vector as a function

16:21 emezeske: dnolen: Yeah, compiles went from 2.5s to 0.75s for me, depending on which of my input files I touched

16:22 gfredericks: jayunit100: if you actually want to do that, (map vector [1 2]) should work

16:22 jayunit100: hmmm ok

16:22 well, i want to map a vector over a list of parameters, "hydrating" it.

16:23 (map #([:name %]) ["jayunit100" "gfredricks"])

16:23 dnolen: pandeiro: 10s for analysis + compilation 8000-9000 lines of Clojure ain't so bad. 20s of that is advanced compilation.

16:23 jayunit100: thats what i 'really' want to do

16:23 LauJensen: &(map #(vector :name %) ["jayunit100" "gfredricks"])

16:24 dnolen: pandeiro: when other optimization work settles down I can look at the compilation side of things more closely - but until optimization happens on the Clojure source itself, I'm not sure how much we can decrease the Closure compilation time.

16:24 jayunit100: LauJensen: great videos btw

16:24 LauJensen: jayunit100: thanks.. :) You mean the old ones?

16:25 emezeske: dnolen, pandeiro: I will probably get to this tonight: https://github.com/emezeske/lein-cljsbuild/issues/94

16:25 dnolen: I think we could see huge wins by figuring out how to parallelize parts of the compiler

16:26 dnolen: No idea about the feasibility of that, though

16:26 jayunit100: LauJensen I liked the clojureql one

16:26 i havent seen fluid dynamics

16:26 dnolen: emezeske: possibly

16:26 LauJensen: ah right. I was actually considering doing another clojureql video, to demo all the new stuff

16:26 emezeske: dnolen: That's on my "far-out todo" list of things I want to explore

16:26 pandeiro: emezeske: dnolen: thanks a bunch for all the work you've already put in, btw

16:27 dnolen: emezeske: incremental compilation may be with in CLJS closure itself - so if it turns out that's the culprit I can help do some detective work there too.

16:27 emezeske: dnolen: That's my belief. Who knows, though, maybe the bug went away since I papered over it? :)

16:28 dnolen: emezeske: I mean closure.clj, I think there's some incremental compilation logic there - which is probable made sense early days - not so much now that we have better build tools.

16:28 bobry: hmm, how do I know which version of clojurescript is used when compiling with cljsbuild?

16:28 i have a bunch of them in the classpath

16:28 emezeske: bobry: are you using lein?

16:28 bobry: yup

16:29 emezeske: dnolen: I see, interesting

16:29 bobry: You could always "rm -rf lib && lein clean && lein deps"

16:30 bobry: Actually I don't know if that will work

16:30 bobry: Anyway, lein-cljsbuild should always be using the latest tagged version of the clojurescript compiler

16:30 bobry: not sure either :)

16:32 i wish there was a constantly updating snapshot of clojurescript/master somewhere

16:32 emezeske: bobry: the bottom of this thread describes how to use a git checkout of it with cljsbuild: https://github.com/emezeske/lein-cljsbuild/issues/58

16:34 bobry: emezeske: thanks, that just what I needed

16:34 emezeske: bobry: sure! maybe one day I'll even distill that thread into a doc :)

16:41 muhoo: pandeiro: fyi i fixed that couch-session thing last night and sent sritchie a pull request

16:41 bobry: dnolen: thanks! version from 'master' compiled that '(goog.ui.Component ...)' call correctly :)

16:41 dnolen: bobry: good to hear

16:41 bobry: emezeske: you can add it to the FAQ section of the README, i guess :)

16:44 pandeiro: muhoo: awesome i was gonna ask you about that

16:45 jayunit100: whats the best way to get a function by its string name

16:45 technomancy: timvisher: hey, did you have a heroku question?

16:45 pandeiro: muhoo: i remember you saying clutch was returning metadata or something instead of nil for docs that don't exist?

16:45 is that a clutch bug? and are you testing against 0.4.0-SNAPSHOT?

16:49 solussd: any crate users know why calling crate.core/html on the result of crate.form/select-options returns nothing? can I not use select-options directly?

16:58 brainproxy: cemerick: (and the other auths if they're hanging in chan) just wanted to say that working through the Cloj Prog book alongside emacs + swank-clojure is a fantastic experience

17:00 cemerick: brainproxy: I'm glad you're finding it useful. :-)

17:00 pandeiro: emezeske: :whitespace has ended up being faster, 4-5s vs. 7-8

17:11 emezeske: pandeiro: good to hear. check back for cljsbuild 0.1.11 later this week, too, I bet you'll get down to 1.5s (total guess)

17:15 jayunit100: Hmmm anyone good at noir ?

17:16 Trying to forward a request in my GET methods for main-routes . Not sure if there is a "best" way to do it.

17:19 s/noir/compujure

17:20 nevermind......... (GET "/" [] (resp/redirect "/index.html")) does it :)

17:52 sjl: what magic incantation do I need to perform to get 'lein new mytemplate foo' to be able to find mytemplate?

17:52 I tried 'lein install' in the mytemplate project which succeeded

17:53 But I still get "Could not find tempalte mytemplate on the classpath"

17:53 Raynes: You need to add it to your :plugins

17:53 In ~/.lein/profiles.clj

17:53 sjl: oh, so https://github.com/ibdknox/cljs-template is lying

17:54 Raynes: Nope.

17:54 sjl: yep, works now, cool

17:54 "There's nothing to install: As of preview3, templates are automatically fetched when first used."

17:54 (not (= "nothing" "something in your profiles.clj"))

17:55 Raynes: If you have a template with the group and artifact-id mytemplate/lein-template it works.

17:55 Look at cljs-template's project.clj.

17:56 sjl: now I'm just confused

17:56 Raynes: I'm not sure why.

17:56 sjl: so the idea is that the artifact-id is *always* supposed to be lein-template, but for different templates you change the *group* id?

17:57 Raynes: Yes.

17:57 sjl: so instead of one group with many templates, you have a ton of groups with one template each?

17:57 Raynes: If you want to publish your template for easy retrieval without installing.

17:58 You can name it whatever you want, but you have to name it like that if you don't want users to have to add it to their :plugins

17:58 There aren't many easy ways to do that sort of thing.

17:58 technomancy choose this particular convention though.

17:58 sjl: but why is the more-specific name the *group* and the less-specific name the more-specfic part?

17:58 technomancy: sjl: most templates are part of a larger project

17:58 Raynes: I imagine because in most cases, your template is a subproject of something else.

17:58 jayunit100: http://stackoverflow.com/questions/10745693/dynamically-adding-routes-in-compojure

17:59 sjl: technomancy: templates *create* projects...

17:59 Raynes: Like noir has noir/lein-template

17:59 technomancy: you wouldn't want to allow someone to push to noir's lein-template if they didn't have access to the noir group on clojars

17:59 sjl: ah, so it's just an access-control thing then

17:59 technomancy: and a grouping thing

17:59 Raynes: Also, you can still do template packs.

18:00 technomancy: most of the time templates center around an existing project like noir or pallet or storm or whatever.

18:00 Raynes: This is just a convenience thing.

18:00 sjl: I guess I think of Clojure projects as using a bunch of libraries, not bring written for a framework like that

18:01 but it could go the other way I guess

18:01 technomancy: sure; if you aren't using a framework then the default templates should suffice

18:02 sjl: anyway adding it to profiles.clj always works no matter what the name, so that's good enough for me

18:02 Raynes: Indeed. :D

18:02 That's the best way to do it if you just want a bunch of little custom templates.

18:02 sjl: l

18:02 yep

18:06 sritchie: muhoo: just released 1.1.1

18:06 technomancy: sjl: thanks for the review btw

18:06 assuming I have the right sjl

18:06 sjl: technomancy: yeah no problem

18:06 technomancy: got a further rewrite of the profile docs in the works

18:07 sjl: got lots of respect for the docs fanaticism in python-land

18:08 sjl: yeah

18:08 http://jacobian.org/writing/great-documentation/

18:08 technomancy: <3 readthedocs.org

18:09 700 pages; whoa

18:10 sjl: I agree 100% with his "auto-generated docs are bullshit" claim too.

18:10 "Here's your car's owners' manual honey, read it all the way through and good luck passing your driver's license test!"

18:11 technomancy: yeah, I love having docstrings, but putting docstrings on the web misses the point.

18:11 docstrings are about exploring a live process

18:11 sjl: docstrings are reference once you know which function you need -- unless you already know that they're useless

18:12 Even worse is the "literate programming" things that have cropped up recently.

18:12 technomancy: sjl: ok, actual serious question: do you think having `lein new` emit a doc/tutorial.md file by default would actually do any good?

18:12 kind of like how it emits failing tests by default

18:12 sjl: "Watch this documentary on how your car was built and then we'll take you for your driver's test."

18:13 technomancy: I'm tempted to add it, but I feel like documentation needs just vary too much from project to project.

18:13 sjl: technomancy: I think people would just ignore it mostly

18:13 yeah

18:13 technomancy: there's no way to trick people into caring

18:14 I mean public shaming works ok i GUESS, but...

18:14 sjl: Or make your own library that does what theirs does but is actually documented so other people can use it

18:14 that usually works

18:15 lots more work though

18:15 gf3: technomancy, sjl: Agree

18:15 I think it would be mostly overlooked

18:15 technomancy: duplication of effort makes me =(

18:15 dnolen: sjl: I agree w/ some of your points - but Django docs don't help the monstrosities it contains.

18:16 * dnolen is tired of verbose documentation of crap ideas

18:16 sjl: dnolen: I'd bet there are way more people getting way more things actually done in the real world with Django though

18:16 dnolen: sjl: more power to them

18:16 sjl: it's not a zero sum game though

18:16 gf3: What would be cool would be the consolidation of all project docs on a single site

18:16 sjl: you can have *good* things with *good* docs

18:17 gf3: Like the ruby yard docs from gems

18:17 technomancy: sjl: imagine

18:17 gf3: clojuredocs.org used to document third-party libs

18:17 sjl: gf3: meh, as long as the docs are on the internet google will find them -- that's good enough for me

18:18 dnolen: I wish I could I reclaim the countless hours lost reading about pointless complexities in CakePHP, Rails, Cocoa & Django docs.

18:18 gf3: dnolen: Really? I find the Rails Guides pretty good...

18:18 Cocoa ones aren't bad either – but only for the apple libs

18:19 sjl: And I wish I could reclaim the hours spent searching around for the way to do the beautiful, simple thing X in Clojure this particular week.

18:19 dnolen: gf3: the sheer amount of documentation is just a symptom. I'm not talking about how well they are written.

18:20 sjl: certainly not saying Clojure is devoid of this problem. Many non-trivial things lead to JavaDocs or Java framework docs.

18:20 sjl: The best of both worlds would be to have the wonderful simple ideas but actually have good docs for them too.

18:20 dnolen: sjl: in complete agreement

18:21 technomancy: yeah, leiningen profiles cleaned up a lot of messy things from lein1, but for a while unless you were hanging out in the #leiningen channel there was no chance you could actually benefit from them

18:21 I still need someone who actually knows about building web pages to help me make http://leiningen.org not suck

18:22 * gf3 raises his hand

18:22 sjl: My own rule for my own projects is basically: if something isn't fully documented, it's an implementation detail that I can't brag about as a feature.

18:22 * gf3 stares at technomancy unblinking

18:22 technomancy: really? that'd be great =)

18:22 wkmanire: Who drew the dude?

18:23 technomancy: wkmanire: my brother-in-law; he works as a game artist.

18:23 wkmanire: Looks awesome.

18:23 technomancy: thanks

18:23 sjl: And "fully documented" means "explained in prose as if teaching someone a skill" not "has a docstring that happens to be rendered on the web somewhere"

18:23 wkmanire: Big moustache+small chin ftw.

18:23 gf3: technomancy: gianni@runlevel6.org should you need to discuss anything (also my gtalk)

18:23 emezeske: technomancy: Maybe this just shows my ignorance about web stuff, but what sucks about leiningen.org?

18:23 technomancy: emezeske: it's not very well-organized

18:24 I'd like the static docs like the tutorial, faq, plugin guide, etc to be part of the site rather than linking out to github

18:24 emezeske: Ah, I gotcha, so you almost need a designer-type person?

18:24 technomancy: gf3: are you on the Leiningen mailing list?

18:24 emezeske: well, static site generation would be a part of it too

18:24 gf3: technomancy: I am not... yet

18:25 emezeske: technomancy: I see. I wouldn't be very helpful then :)

18:26 gf3: Also, if anyone sees _ato around please let him know I'd like to have a quick chat with him

18:27 aperiodic: gf3: you could send him mail via the bots

18:27 technomancy: gf3: I'll start a thread there if you don't mind hopping on

18:27 gf3: aperiodic: How does one do such a thing?

18:27 aperiodic: $mail gf3 see me at once

18:27 heh, maybe not

18:28 wait, is lazybot not in the room?

18:28 Borkdude: I'm trying out how to build a cljs file into js

18:28 from https://github.com/emezeske/lein-cljsbuild

18:28 but I keep running into problems

18:29 I guess the plugin is not lein2 ready?

18:30 my project.clj looks like this: https://gist.github.com/2784557

18:30 gf3: technomancy: Joined

18:30 emezeske: Borkdude: Last I checked, it worked with lein2. That was a couple weeks ago though

18:31 Borkdude: Oh, you are using an *ancient* version of lein-cljsbuild

18:31 Borkdude: 0.0.11 is really, really old

18:31 technomancy: like over a whole month!

18:31 =)

18:31 aperiodic: Raynes: where did lazybot go? :(

18:31 sjl: lol

18:31 Borkdude: emezeske: I'm using the version that is described as "latest version"

18:31 emezeske: technomancy: :P

18:31 sjl: I love how "ancient" in the clojure community is measured in "months"

18:31 Raynes: aperiodic: He stepped out for a smoke.

18:31 emezeske: Borkdude: Not in your gist, you're not

18:32 sjl: Mercurial is backwards-compatible over the wire to versions released ~5 years ago

18:32 Borkdude: emezeske: hmm, where did I get that from, I wonder

18:32 gf3: sjl: Haha indeed, no commits for two months? Project is abandoned!

18:32 emezeske: sjl: Clojure years are like dog years

18:32 technomancy: sjl: to be fair, the Clojure language itself has had very few breaking changes

18:32 it's all ecosystem stuff

18:32 sjl: technomancy: aside from "remove clojure-contrib and break everything ever"?

18:33 wkmanire: gf3: It's starting to seem that way. Now that you mention it, I do check the commit history for projects before I use them.

18:33 heh

18:33 aperiodic: $mail gf3 here's some mail?

18:33 emezeske: sjl: That's not the "language itself" though

18:33 lazybot: Message saved.

18:33 technomancy: sjl: I get the feeling part of the reason that stuff wasn't part of Clojure itself was that they could say "I told you so" when everything broke =(

18:33 sjl: yeah

18:33 "How do I do this? Use clojure-contrib."

18:33 gf3: $mail _ato Hey, I'd love to have a quick chat about Clojars.org if you have a sec!

18:33 lazybot: Message saved.

18:34 sjl: later: "It broke. Well yeah, you were using clojure-contrib"

18:34 arg

18:34 gf3: aperiodic: Awesome, thank you

18:34 technomancy: sjl: the worst part was it would not have been very difficult to provide a transitionary 1.3-compatible contrib; just no one on core cared.

18:35 aperiodic: gf3: you're welcome!

18:35 sjl: technomancy: yeah, if it had at least been "hey, this will be deprecated in a year so you might want to move off of it now" that would have been better

18:35 Borkdude: it works :)

18:35 technomancy: lein-precate seems to have solved that problem for the lein2 transition though; I'm happy how that turned out

18:36 sjl: Clojure seems to generally have a "let's make things better/simpler/more beautiful/cooler" philosophy rather than a "let's make sure things don'

18:36 technomancy: at least, I haven't heard much from people having trouble upgrading. maybe they are all super frustrated and keeping quiet about it.

18:36 sjl: t break" one

18:37 it was pretty easy for all my projects, though I was never really doing anything crazy with lein in the first place

18:37 brainproxy: is it possible to use swank-clojure jack in together with cljsbuild's repl-rhino?

18:37 * emezeske unfortunately knows nothing about emacs.

18:37 * gf3 is a vimmer

18:38 sjl: Vim here as well

18:38 aperiodic: me too!

18:39 technomancy: ibdknox: you suggested switching to a single column for leiningen.org and gave me a nice example of a good project site that did that well; do you remember off the top of your head?

18:40 brainproxy: I can go back and forth, but if spend more than a minute or two in vim then I'm all screwed up when I go back to emacs ... have to "reset my brain" according to some ineffable algorithm

18:45 wei_: are there any alternatives for logging besides log4j? I'm having a lot of trouble with configuration, and logs not going to the right place

18:45 technomancy: wei_: there's something to be said for a function that checks a dynamically-bound var and uses println

18:45 I use this in Leiningen.

18:46 https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L19

18:46 wei_: hmm, that sounds like a better idea

18:46 technomancy: java logging is a big bag of crazy

18:46 wei_: anyone know where println goes if i'm using nailgun/vimclojure?

18:46 technomancy: it solves problems you don't have

18:46 duck1123: it's great when it works well

18:47 technomancy: log4j straight up refuses to log if it hasn't been configured =(

18:48 lynaghk: technomancy: speaking of lein2, any timeline on Heroku support?

18:49 technomancy: lynaghk: you can use it now if you set your BUILDPACK_URL; hang on

18:49 duck1123: I have just recently learned to love setting different namespaces to different levels. It's made me re-think a lot of my logging

18:49 lynaghk: technomancy: ohhhh boss, thanks

18:49 technomancy: lynaghk: https://github.com/heroku/heroku-buildpack-clojure/tree/lein-2

18:49 I think there is one bug relating to clearing the m2 cache too aggressively surrounding plugins, which is why I haven't announced it

18:50 emezeske: wei_: It should go to the console where you're running the vimclojure server, I believe

18:50 lynaghk: the side effect of that bug is just slightly longer startup time to download deps?

18:50 technomancy: lynaghk: yeah, provided you're using plugins at runtime

18:50 which most people don't do

18:51 lynaghk: technomancy: yeah, won't be an issue for my use case. Have you had a chance to play around with Datomic on Heroku at all?

18:51 technomancy: well actually I guess you don't have to actually be using them

18:51 no, I haven't used Datomic

18:51 any services hosted on AWS should be pretty snappy though.

18:52 lynaghk: technomancy: yep, that's my understanding. I haven't used Datomic much at all, but we're rolling it out as a datastore for immutable / historical weather data.

18:52 (so, worst comes to worst, we pay Amazon an extra $10 and drink a beer while rebuilding everything from text files)

18:55 technomancy: gf3: just posted an overview of what I'm looking for; thanks!

18:56 gf3: technomancy: Splendid, I'll have a look

18:56 kwertii: lynaghk: are you guys using c2 in production to replace d3 sites yet?

19:00 Borkdude: I read somewhere that a book about clojurescript is coming up

19:00 at o'reilly

19:03 mwillhite: hey all - I'm having a hell of a time trying to get x-domain requests working with compojure/ring…anyone have experience with that?

19:04 i have OPTIONS set up, and I think I'm returning the right headers, but I'm still getting rejected

19:09 are there any runtime debuggers for clojure…something where I can set a breakpoint and step through?

19:11 Borkdude: mwillhite: you can in eclipse I think

19:12 mwillhite: thanks Borkdude

19:18 seancorfield: mwillhite: CDT let's you do that in Emacs/Slime/Swank

19:19 it's been rolled into swank-clojure now, as of 1.4.x I believe

19:19 you can set breakpoints on exceptions and function calls, eval in the context of the stack frame, step in / out / over...

19:19 lynaghk: kwertii: yes, we've used C2 on several projects for clients. None of them are public facing at this time, as far as I'm aware

19:21 kwertii: right now we're in the early stages of an iOS app that will leverage Clojure & C2; that may be public by the end of the summer.

19:21 kwertii: lynaghk: nice. I'm starting a project now that I was planning to use D3 on, then found C2 and was wondering if it's solid yet

19:22 lynaghk: kwertii: D3 has a lot more in terms of scales and layouts, but what is in C2 is pretty solid.

19:23 kwertii: at least, we haven't gotten many bug reports---that just might be because the userbase is tiny though =P

19:23 ideally_world: hi seancorfield

19:24 kwertii: lynaghk: What are you using to compile your cljs to js? I was trying it with noir-cljs, but the generated bootstrap.js always crashed with a weird undebuggable error in the generated code

19:24 lynaghk: kwertii: D3 is much much faster, so if you're targeting older browsers or have very large datasets it might be a better choice. I'm actually porting Hiccup to CoffeeScript though, which should bring C2 speed to within an order of magnitude.

19:24 kwertii: lein cljsbuild is the defacto standard for CLJS, and it's what we use as well.

19:25 kwertii: C2 runs on the JVM though, and it's plenty fast there.

19:25 kwertii: hm

19:25 lynaghk: Is cljs-d3 completely dead now?

19:26 I'm still deciding whether to generate stuff on the server, or try this newfangled client-side UI logic stuff the kids are doing these days

19:26 lynaghk: kwertii: yep. I think two months ago I added a "depreciated" notice to the readme, and that was the last time I touched it.

19:27 kwertii: depends on your use case, as always. Serving static content is hella faster for all involved and will save you a world of pain w.r.t. old browsers.

19:27 kwertii: lynaghk: you did. was hoping someone might take over. if I have to use D3, I'd much rather write it in cljs than js :)

19:27 lynaghk: kwertii: You could give CoffeeScript a shot too.

19:28 If you want to use ClojureScript though, just use the plain interop. it's not too bad.

19:29 kwertii: I like the ability to provide instant perceived responsiveness by putting all the UI logic in the client. Just not sure that the libraries out there are developed enough at this stage to make it worth it

19:30 lynaghk: kwertii: yeah. I ended up writing a lot of cljs libs for the work at Keming. Some of them have been open sourced, others need some time to simmer and get cleaned up.

19:30 kwertii: not to mention the endless backbone vs spine vs ember vs whatever flamewars

19:31 mwillhite: cool thanks seancorfield

19:33 ideally_world: the java code formatting in the Clojure codebase is driving me nuts ;)

19:33 lynaghk: kwertii: The semantics of ClojureScript make a lot of the functionality in those libs unnecessary. The past few CLJS apps we've done have been centered around mutable state, using a state machine abstraction to handle juggling the UI. Then again, we don't really do typical CRUD-type apps, so I don't know how well that architecture would fit into that stuff.

19:34 technomancy: ideally_world: shield your eyes!

19:35 ideally_world: no, forking and reformatting/refactoring

19:36 madsy: ,(bit-and (int (* f t 65536)) 65535))

19:36 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: f in this context, compiling:(NO_SOURCE_PATH:0)>

19:36 madsy: Ops

19:36 ,(bit-and (int (* 440.0 0.3 65536)) 65535))

19:36 clojurebot: 0

19:46 * ideally_world is fighting with IntelliJ trying to get the Clojure codebase to compile and run a REPL...

19:47 ideally_world: Wow, seems like there is a lot of unused Java code lying about...

19:48 at least *according* to IntelliJ

20:05 dnolen: I love patches like this http://dev.clojure.org/jira/browse/CLJS-268?focusedCommentId=28583#comment-28583

20:07 emezeske: dnolen: New warning + fixes found via new warning? Nice indeed.

20:07 technomancy: is medusa the only option for pooled futures?

20:08 dnolen: emezeske: that's actually not the first time its happened :) new warnings generally uncover bugs.

20:09 emezeske: dnolen: Yeah, every time a new warning is added, I find something in my closed-source app

20:09 dnolen: The wrong # of args warning is super sweet in that regard

20:10 dnolen: emezeske: definitely. Another one I want - misnamed protocols, and warning under advanced compilation that a protocol is incomplete. Also that if you implement ISeq you probably want to implement ICollection and ISeqable.

20:10 lower level stuff, but useful.

20:11 emezeske: Sounds like good stuff!

20:16 ideally_world: there's no way to open and run Clojure's codebase in IntelliJ without mangling at least the version.properties file? :/

20:24 odd seeing a Clojure REPL in Intellij's console :)

20:26 nDuff: Eh? Is there nREPL support available there?

20:28 ideally_world: nDuff, no, just compile the Clojure codebase in IntelliJ

20:52 kwertii: 2012 and we still have netsplits?

20:53 hiredman: the alternative, according to xmpp, is streaming xml

20:53 so by all means, netsplits please

20:55 kwertii: ugh

21:01 * ideally_world is walking through LispReader

21:01 ideally_world: finding it very nice thus far...

21:06 kwertii: How about IRC-over-MQ federations

21:07 hiredman: that's the ticket

21:08 kwertii: https://github.com/danlarkin/subrosa is an ircd written in clojure, https://github.com/hiredman/vespa-crabro has some code for running and embedded hornetq server

21:08 go nuts

21:08 kwertii: nice

21:09 unfortunately, the real world has a monopoly on my time right now. and I suspect everyone else's, too, which is why we still have netsplits.

21:10 hiredman: why'd you pick HornetQ as opposed to some other MQ?

21:14 hiredman: kwertii: easy jvm interop, and embeddability

21:35 dnolen: a little bit of type inference goes a long way - wart removed from CLJS http://github.com/clojure/clojurescript/commit/af5dc7eff95c1e3af269a3fb999d8c4a74f8f147

21:43 klauern: Is there a place that collects tips and mini-tutorials on Clojure syntax?

21:43 gfredericks: clojure has syntax?

21:43 * gfredericks kids a bit

21:44 gfredericks: klauern: the clojure.org page on the reader I think has most of the reader forms

21:45 klauern: I'm thinking small tidbits of knowledge like how to use (interleave x y) and use cases where you might not think of applying it

21:45 tomoj: suppose you take PersistentHashMap and change the base to 2. how much should this hurt performance?

21:46 hiredman: the branching factor?

21:46 I would guess "a lot"

21:46 ideally_world: klauern, http://clojuredocs.org/quickref/Clojure%20Core ?

21:47 tomoj: it has been argued to me that it should be 5x as slow

21:47 ideally_world: there's some tips on specific functions, but not sure that is what you are looking for

21:47 tomoj: since log_2(n) = 5*log_32(n)

21:47 I think I buy it

21:48 klauern: ideally_wor: I don't think that's exactly what I'm after. I mean, I can read about all of the forms and such, but I never really know when to use them, or rather, nothing in my brain ever triggers that (into-array ) will do what you want for this case

21:48 TimMc: klauern: That's not syntax, those are core functions.

21:48 gfredericks: klauern: I think what you're asking for is "experience"

21:49 tomoj: which makes the 32 seem less magical, it's just 5x as fast as a binary tree, which just happened to bring the implementation within range of interest due to the other constant factors involved

21:49 gfredericks: tomoj: well you couldn't make it too large; at some point the benefit drops off

21:49 klauern: I don't know. Why read books if all you need is (find-doc ) ?

21:50 gfredericks: tomoj: so it's "magical" in the sense that it's better than the other choices; at least I assume it is.

21:50 TimMc: lazybot: You're back!

21:50 gfredericks: is he??

21:50 lazybot: gfredericks: Definitely not.

21:51 tomoj: I mean I had this mantra "log_32 therefore practically O(1)" which is very different to me than "log_32 therefore O(log n) with a constant factor 1/5 that of a log_2 impl"

21:51 TimMc: $findfn 3 (range 10) [[0 1 2] [3 4 5] [6 7 8] [9]] ;; klauern: This works in private message. ;-)

21:51 lazybot: [clojure.core/partition-all]

21:51 gfredericks: tomoj: log_33 is also practically O(1)

21:52 tomoj: sure..

21:52 5.04x as fast as log_2

21:52 gfredericks: :)

21:52 tomoj: log_1024 is only 10x as fast :(

21:53 what is the bottleneck that makes log_32 practically O(1) now? memory?

21:55 gfredericks: bottleneck? log_32 is technically slower than O(1), so "practically O(1)" is optimistic, not pessimistic

21:55 TimMc: Hmm, I wonder if there's a good tensor data structure for Clojure...

21:56 tomoj: I mean, I understand "log_32(n) is practically O(1)" to have a hidden clause "as long as n is less than k"

21:56 gfredericks: k isn't a fixed thing though

21:57 nDuff: Well -- as long as hardware limitations restrict the maximum size, the worst-case is known

21:57 O(7), I think?

21:57 tomoj: nDuff: yeah, memory limitations?

21:57 gfredericks: nDuff: yeah; but of course with this kind of argument all of asymptotics becomes trivial

21:57 TimMc: get thee to a benchmarking suite

21:58 gfredericks: algorithm X will run faster than 10^100000 years, therefore X is O(1)

22:01 tomoj: the expected ratio between running times on a binary tree going from n1 to n2 is exactly the same as on a 32-ary tree

22:02 isn't it?

22:02 gfredericks: what are n1 and n2?

22:02 TimMc: gfredericks: Any algorithm that will provably terminate (successfully) in a given computer's available memory is O(1).

22:02 tomoj: just two fixed integers

22:02 e.g. 1e6 and 1e9

22:02 the number of items in the collection

22:02 gfredericks: TimMc: why on earth is algorithms an entire class? they're all fast

22:02 TimMc: Well, some require O(n) space.

22:03 So those aren't O(1) via that particular sneakiness.

22:03 *O(1) time

22:03 gfredericks: TimMc: because you can use S3 which has unlimited capacity?

22:03 wait no way

22:04 if an alg has constant time it has constant space

22:04 the turing machine can only walk so far in a finite time

22:04 TimMc: Right, but time can exceed space.

22:04 tomoj: if you have a binary algorithm that takes 5 minutes on 1e6 items, then it should take 7.5 minutes on 1e9 items. then the 32-ary one will take 1 minute on 1e6 items and 1.5 minutes on 1e9 items

22:04 is that correct? it makes "practically O(1)" just seem totally misleading to me..

22:04 TimMc: Space is limited by time, but time is limited by 2^space.

22:05 gfredericks: TimMc: sure -- either being constant makes both constant

22:06 tomoj: misleading because there's an increase?

22:06 tomoj: and exactly the same increase as with base 2

22:06 (ratiowise of course)

22:07 gfredericks: I think the point with "practically" is that with 32 the max hops down the tree is 6 or 7

22:07 tomoj: well

22:07 gfredericks: whereas with 2 it can be...30 or 35

22:07 tomoj: my example is flawed because it doesn't take 1 minute to do a PHM lookup with 1e6 items

22:07 gfredericks: 6 or 7 feels much closer to 1 in practical terms than 33

22:09 and for other real-life reasons the 2 is worse than that

22:21 wkmanire: he he he, reason to clean the monitor. That was in fact just a period. Not a semicolon.

22:26 zxcv: is it possible to upgrade the clojure version that comes with "lein self-install"

22:28 TimMc: zxcv: Lein uses whatever it uses. Your project can use something else.

22:28 However, if you start 'lein repl' outside of a project, you get whatever lein uses.

22:29 zxcv: what if i want to make a small script without creating a project, is there a way to upgrade the clojure that lein uses

22:30 for "lein repl" outside projects

22:32 TimMc: zxcv: lein-oneoff, I think.

22:35 zxcv: TimMc, that's exactly what I want, thanks

22:35 y3di: who was lighttable's second corporate sponsor?

22:36 brehaut: theres 3 now isnt there?

22:36 Raynes: Massive Dynamic.

22:48 amalloy: tomoj: "the expected ratio between running times on a binary tree going from n1 to n2 is exactly the same as on a 32-ary tree" sounds totally wrong

22:49 * gfredericks hopes he didn't endorse it

22:49 amalloy: eg, suppose the running times are exactly 2^n and 32^n, respectively

22:49 er

22:50 tomoj: it would've sounded wrong to me 2 hours ago

22:50 is it in fact wrong?

22:50 amalloy: except it wouldn't be 32^n. it'd be...something else? log2(n) and log32(n)

22:50 tomoj: yeah

22:50 the expected ratio is log(n1)/log(n2) no matter the base

22:50 amalloy: okay, maybe you're right

22:51 tomoj: the trick is that with 32 the running time of a lookup is small enough that the difference is practically negligible

22:51 and I guess that 5x that difference isn't negligible!

22:51 amalloy: psh obviously. five times *anything* is always huge

22:56 * gfredericks hopes he endorsed it

23:05 brainproxy: technomancy: I played around for a little while trying to get swank-clojure / SLIME REPL talking to the rhino backed cljs repl, but there seem to be some issues w/ stdin ... ended up just opting to fire up repljs in eshell

23:06 do you know of a project that makes the two work together? i.e. swank-clojure and the rhino backed cljs repl?

23:21 evildaemon: Is clojure suitable for Android development?

23:22 amalloy: evildaemon: you can make it run, but it's pretty cutting-edge at the moment, so it's slow, hard, and probably broken in some places

23:22 i think sattvik is the one you'd want to ask if you're looking for more details, but i'm not 100% sure

23:22 evildaemon: amalloy: Ah, okay. Thanks for being honest. That's a real disappointment.

23:23 amalloy: evildaemon: but clojurescript is another viable option. create javascript and run that instead

23:23 as a webapp, or whatever

23:25 gf3: Eh, even ClojureScript

23:25 Not sure it's ready for prime time

23:25 amalloy: android development is usually not primetime anyway

23:35 mikera: hi all. anyone know how to embed an arbitrary Java object in generated code that subsequently gets eval'd?

23:35 hiredman: "don't"

23:36 mikera: why not?

23:37 hiredman: mikera: it sort of depends on the context, if you are just passing a simple form to eval it will work

23:37 mikera: the problem is that I want tto put a bufferedimage in my form

23:38 `(.getRGB [bufferedimage] 0 0)

23:38 as a simple example....

23:38 hiredman: why?

23:38 clojurebot: Why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

23:38 mikera: working on clisk (https://github.com/mikera/clisk)

23:38 does procedural image synthesis

23:39 I'm trying to create a texture mapping primitive

23:39 for the code generator

23:39 hiredman: :(

23:39 none of that answers "why do you want to embedded an arbitrary java object in a clojure form to eval?"

23:40 mikera: well I'm generating code that generates images

23:40 at runtime

23:40 hiredman: ok, sure

23:40 mikera: currently doing it by assembling forms that represent the functions that produce the image

23:40 hiredman: but why do you need eval for that?

23:41 mikera: then using eval to compile it into a function

23:41 hircus: for a Noir web application, what's a good way of loading site-specific configuration from a file on the server?

23:41 mikera: the compiled fuinction gets called a few million times with different co-ordinates to generate the image

23:41 hiredman: ah

23:41 brainproxy: hooray, found the instructions I was looking for, missed them earlier among other blog posts and whatnot .. https://groups.google.com/forum/#!topic/clojure/_JWvqc3fENQ

23:42 mikera: basically eval is needed for the compile

23:42 amalloy: mikera: you can just compile to `(let [image# (...)] (fn [] (.getRGB image# 0 0))?

23:42 and then if you want to eval that, you can

23:42 hircus: I'm using Noir and Korma, and I want to define my database and entities only once

23:42 hiredman: mikera: what I would recommend is instead of returning `(.getRGB [bufferedimage] 0 0) return (fn [buffered-image] `(.getRGB ~buffered-image 0 0))

23:43 then you can generate code that let binds the image to a gensym'ed symbole and call the function on the gensymed symbol and stick it in the fn body to eval it

23:44 amalloy: you can't just shove the image into the code, but you can put in code that will generate an image when evaluated

23:45 hiredman: amalloy: or generate a function that takes the image as a parameter

23:45 mikera: hmmmm image as a parameter is a problem

23:45 TimMc: Maybe you can, with the new reader dispatch *mrmmff MFRMMFMF MMFRMFF*

23:45 amalloy: sure, it's not yet clear to me exactly what he wants; i got the impression he has the image available at compile time and wants to hard-code it into the returned function

23:45 mikera: since the top level function that is generated just take x,y,z,t parameters

23:45 hiredman: mikera: evaling a call to proxy like that is pretty gross

23:46 and proxy is pretty slow

23:46 mikera: yah I have the image already

23:46 hiredman: also maven is pretty gross

23:46 mikera: prior to calling the code generator at least

23:46 hiredman: mikera: right, the code generator should return a function you can pass the image to

23:47 mikera: the syntax I'm aiming for at the top level is something like:

23:47 (generate-image (v+ (v* 0.5 (texture-map image1) (v* 0.5 (texture-map image2))))

23:48 hiredman: so?

23:48 mikera: v+ v* and texture-map all produce / return forms

23:48 generate-image is a generic function that doesn't know about the textures

23:48 hiredman: they should return functions

23:49 like what I said

23:49 mikera: but then you can't get performance - primitive boxing kills you......

23:49 hiredman: no no

23:49 mikera: I tried that first :-)

23:49 hiredman: they should return functions that generate code

23:49 like what I said

23:50 (fn [buffered-image] `(.getRGB ~buffered-image 0 0))

23:50 mikera: ah with you now

23:50 hiredman: so the code generator can use these functions to generate a single (fn [image] ...) and eval that

23:51 mikera: hmmm so that would potentially mean many images passed up the tree?

23:51 hiredman: you generate a single function for the transform right?

23:52 mikera: actually a vector of functions (red, green, blus components)

23:52 but the principle is the same

23:52 hiredman: the image isn't passed through the functions, the name (symbol at compile time) the image is bound to (at runtime) is passed around

23:53 mikera: got it

23:53 I need to give this some though... could be a sizeable refactor

23:53 if everything has to return a function rather than a form

23:53 but might be the best approach

23:53 thanks for the ideas!

23:55 hiredman: you could switch to something more ast like {:free '#{image} :body '(.getRGB image 0 0)} and then you would have some like (bind '{image foo} '(.getRGB image 0 0)) that would walk the code and do the replacement

23:56 mikera: makes sense. feels more and more like I'm writing a full compiler :-)

23:57 I havd hoped that I could leverage Clojure's compiler to do all that, hence trying to do it all by constructing forms.....

23:57 hiredman: if you can you should replace the proxy with reify, proxy has all kinds of overhead

23:57 mikera: I'm not using proxy

23:57 hiredman: well, it is like a cross compiler, you have this dsl you are compiling to clojure code, which the clojure compiler compiles

23:58 https://github.com/mikera/clisk/blob/master/src/main/clojure/clisk/core.clj#L19

23:58 looks like proxy to me

23:58 mikera: oh yes sorry I am at the top level :-)

23:58 brehaut: even if you do it by constructing forms, if your source language is at all different semantically from clojure, then you are going to end up with something compiler shaped.

23:58 mikera: what's the overhead?

23:58 doesn't it just extend the Java class?

23:58 TimMc: proxy is a lie

23:58 hiredman: mikera: it extends the java class in a very dynamic way

23:58 brehaut: proxy has duck typing magic

23:59 mikera: ah.... would reify work instead in this case?

23:59 hiredman: not in this exact case, reify only works with interfaces and protocols

23:59 mikera: hmmm I can probably make clisk.Function into an interface

Logging service provided by n01se.net