#clojure logs

2012-05-24

00:05LoganLKis there any reason why http://clojure-libraries.appspot.com/ goes down so much?
00:22technomancykwertii: yeah, it's exposed as a system property
00:22technomancyproject-name.version IIRC
00:22kwertiitechnomancy: thanks
00:23technomancyLoganLK: highly recommend http://clojuresphere.herokuapp.com instead
00:24brainproxyI pasted this into emacs connected to swank-clojure, thinking surely the part that makes it able to run the http request has been elided:
00:24brainproxyhttps://gist.github.com/2779361
00:24brainproxybut nope, it just ran :D
00:25brainproxymaybe it's amazement arising from naivety, but anyway I'm amazed and all happy inside at the same time
00:25ro_sttechnomancy: what's the right way to have swank repl load some stuff on startup?
00:26ro_stusing clojure-jack-in and lein2
00:27technomancyI'm not sure; maybe :repl-init
00:28ro_stactually, perhaps that's the wrong question.
00:29ro_stwhen 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
00:30ro_sthow can i get the swank repl to do what the lein2 repl does?
00:31muhooro_st: i just hacked around it with this: https://www.refheap.com/paste/2853
00:31muhoowhenever i change namespaces,, i just press those keys
00:32ro_stnice! 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?
00:32ro_stwhat goodies do you have in kens.replutils? :)
00:39brainproxymuhoo: thanks for that
00:40ro_styeah. very handy
00:41ro_stok, i've just managed to get live-coding-emacs and clojure-swank and magit all working together nicely
00:41brainproxy..looks into live-coding-emacs
00:42ro_stworth it for the autocompletion popup alone, but the other stuff in l-c-e is also great
00:42brainproxytoday is my first day w/ swank
00:42brainproxybeen emacs'ing since january
00:42ro_stsublime text 2 is now just a .emacs.d browser :)
00:43brainproxyit's funny, when I go to edit stuff in .emacs.d, I drop to the terminal and use vim
00:43brainproxydon't know why, just do it w/o thinking
00:43noidi_alias vim=emacsclient :)
00:44ro_sti use ST2 because i want to be able to browse around with the file browser. ST2's is waaaay better than speedbar
00:44ro_stbut for editing emacs config, emacs, because you can eval-buffer
00:44brainproxyI've gotten to the point where I can work briefly in vim and not get screwed up
00:44brainproxyi mean in close time proximity to working in emacs also
00:45ro_stemezeske: 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
00:46ro_stthe difference was 1404 bytes on a 158kb file
00:46ro_stso jsdoc annos are not necessary for cljs :-)
00:46ro_st(my nick used to be robertstuttaford)
00:52technomancyro_st: don't use doc; use C-c C-d C-d
00:52technomancyC-c S-i mostly replaces pprint
00:53ro_stgah. of course. i've even got both of those on my handwritten post it stuck on my monitor
00:53emezeskero_st: Oh, yeah I vaguely remember that
00:53emezeskero_st: Heh, that's good to know!
00:54emezeskero_st: Thanks for the follow up :)
00:54ro_stemezeske: 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
00:56brainproxyro_st: live-coding-emacs looks like it contains some nice goodies; I've been using bbatsov's prelude, which does some similar things
00:57brainproxybut I may cherry pick some of the fun things like the clojure mode pretifications
00:57dnolenro_st: we regularly get bug reports if things are broken in IE so I think we're doing OK there.
00:57dnolenro_st: shouldn't be any issues on modern mobile browsers far as I know either.
01:00brainproxytechnomancy: is there any way in project.clj or another config file to control where/how swank-clojure looks for `lein`?
01:00emezeskerossabaker: Not that I am aware of.
01:00emezeskerossabaker: Oops, mt
01:00emezeskero_st: Not that I'm aware of. I myself am writing an app targetting school teachers, which are IE-heavy
01:01emezeskero_st: Things work great on mobile so far as I've seen, although I haven't done as much testing there
01:13ro_sti 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?
01:13ro_sti 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
01:13ro_stthanks dnolen
01:14brehautdetecting 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
01:15ro_stbrehaut: i know. i don't want to serve desktop code and media to a mobile device.
01:15ro_stmy current plan is to assume mobile, and detect for tablets and desktops
01:16brehautif 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)
01:17brehautrather than trying to get the server to determine what is best
01:17ro_stit's not just about media. the ui code is going to be significantly different for handheld vs desktop
01:17brehautthats why i was talking specifically about media
01:18ro_stgmail uses client side detection + redirects, i believe
01:18brehautgmail has a horde of programmers working on it too
01:19ro_stindeed :)
01:20brehautalso what do you mean by 'tablet' ?
01:20ro_sti guess tablet is a responsive variant of handset
01:21ro_sttouch based, but differently laid out to take advantage of extra space
01:21technomancybrainproxy: clojure-swank-command IIRC
01:21brehautalternatively its just the desktop site where youve made sure you support touch events as well as mouse and keyboard
01:22brehautbut if thats only really true for the ipad, the 7" android tablets are different again
01:22ro_stit'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
01:24brehautim 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?
01:25brehautit seems if you really need to have wildly different experiences, that you have pretty clearly defined codebases anyway
01:26ro_styeah. i'll have to try a couple things out
01:26scottjro_st: you've looked at the :builds options right? (I haven't)
01:26ro_stscottj: yup. specify a folder, not a namespace. i assume that to mean it'll slurp all the cljs in and bash it together
01:27ro_stgclosure compiler takes a namespace and walks the deps to figure out what to compile. i'm hoping for the same behaviour with cljs
01:27ro_stcos then i can have one codebase
01:36muhooro_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)
01:53michaelr`good morning
02:17muhoois there some clean-ish way to turn a java.util.Collections into a seq?
02:31ro_stanyone using monger and know how to do the equivalent of a WHERE field IN ( … ) sql clause with it?
02:47ro_sti 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?
02:51Borkdudero_st: ##(vals {:a 1, :b 2})
02:52Borkdudethen make that into a map
02:53Borkdude,(apply hash-map (vals {:a 1, :b 2}))
02:53clojurebot{1 2}
02:54ro_stso 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
02:54Borkdudero_st
02:54Borkdudero_st: then you can use (into {} …)
02:55Borkdudero_st: hash-map is also fine
02:56Borkdude,(into {} [[1 2] [3 4]])
02:56clojurebot{1 2, 3 4}
02:56ro_st,(into {} (map #(vals %) '({:old "1" :new "2"} {:old "3" :new "4"} {:old "5" :new "6"})))
02:56clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map$Entry>
02:56Borkdudero_st: ok, you need to have a seq of vectors of size 2
02:56ro_stthe values in question are both strings
02:56Borkdudero_st: those are treated as mapentries
02:57Borkdudeso #(vec (vals %)) will probably do
02:57Borkdude,(into {} (map #(vec (vals %)) '({:old "1" :new "2"} {:old "3" :new "4"} {:old "5" :new "6"})))
02:57clojurebot{"1" "2", "3" "4", "5" "6"}
02:57ro_styay!
02:57ro_stso easy once you know how
02:58ro_stthank you, Borkdude
02:58Borkdudenp
03:20Borkdude,(doc mapv)
03:20clojurebot"([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."
03:21Borkdude,(source mapv)
03:21clojurebotSource not found
03:23kilonmorning all
03:27TEttingerhey all
03:27TEttingerI have a one-liner I am trying to keep fairly short
03:27Iceland_jack'
03:27TEttingerit is supposed to generate a "map" for a text-based game, think nethack
03:27TEttinger(defn -main [] (println "") (doseq [p (take 1920 (shuffle (flatten [ (repeat 200 "T") (repeat 600 ":") (repeat 1200 ".")])))] (print (str p))) (flush))
03:28TEttinger1920 is 80x24, terminal size
03:28TEttingerthe problem is I want to add newlines into the shuffled vector
03:29TEttingerso how would #clojure insert a new entry at a specified step into a vector?
03:30ivanI would (partition 80 yourmap) first
03:30AimHerepartition, interleave, flatten?
03:30TEttingerdoes that return a lazy seq?
03:30ro_st(-> data one two three) this happens in printed order, right?
03:31ivan&(clojure.string/join "" (flatten (interleave (partition 4 "abcdefgh") (repeat '\newline))))
03:32ivan(surely not the simplest way though)
03:34ivan,(clojure.string/join \newline (map clojure.string/join (partition 4 "abcdefgh")))
03:34clojurebot"abcd\nefgh"
03:38TEttingerivan, that and AimHere's suggestion did the trick
03:38TEttinger(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))
03:39TEttingerjust *barely* fits on one line :-)
03:40ro_sti want to turn a seq of {:_id #<ObjectId 4fbde3f7c026db322fdc2799>, :old_id 375} maps into a flat map of {375 #<ObjectId 4fbde3f7c026db322fdc2799> ...}
03:41ro_stthe (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)
03:46ivan,(apply conj {} (map (fn [pair] [(:old_id pair) (:_id pair)]) '({:_id "blah" :old_id 375} {:_id "hello" :old_id 376})))
03:46clojurebot{376 "hello", 375 "blah"}
03:46kralnamaste
03:49ivan,(let [x '({:_id "blah" :old_id 375} {:_id "hello" :old_id 376})] (zipmap (map :old_id x) (map :_id x)))
03:49clojurebot{376 "hello", 375 "blah"}
03:50ro_stwow, ivan. i hope to attain your understanding asap.
03:51ro_stzipmap one looks far simpler!
03:54ivanobfuscation contest:
03:54ivan,(let [x '({:_id "blah" :old_id 375} {:_id "hello" :old_id 376})] (apply zipmap (map #(map % x) [:old_id :_id])))
03:54clojurebot{376 "hello", 375 "blah"}
03:56ivan(I think I might actually enjoy a real obfuscation contest)
03:57ro_sti suspect you'd do well
03:57ivanespecially one like the Underhanded C contest
04:00ro_stwhat's the symbol for the last evaluated repl value? _*?
04:00ivan*1
04:01ro_stthanks
04:01TEttingeryou 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...
04:03TEttingeralternatively, 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
04:04ro_stwhat on earth are you on about, TEttinger? :-)
04:04TEttinger(keyword "ÀÀ") vs. (keyword "ÀÀ")
04:04TEttingerobfuscation
04:06ivanpack your program in a way that requires specific JVM optimizations, requires execution of the packed program
04:06TEttinger(keyword "ÀÀ") "good" (keyword "ÀÀ")
04:06TEttinger,((keyword "ÀÀ") {(keyword "ÀÀ") "good" (keyword "ÀÀ") "bad"})
04:06clojurebot"bad"
04:07TEttinger,((keyword "ÀÀ") {(keyword "ÀÀ") "good" (keyword "ÀÀ") "bad"})
04:07clojurebot"good"
04:07TEttingerthat one is pretty devious
04:30muhoois juxt appropriate for side-effecting functions?
06:21gaussblurinchello! can anybody advise me books/sites/tutorials for beginning? (don't know functional paradigm)
06:26KIMAI would recommend you get the new book Clojure Programming. It has a very good chapter for functional programming
06:27vijaykirangaussblurinc: what's your background/which languages are you familial with ?
06:30gaussblurincvijaykiran: C/C++/C#/Obj-C, SAS, Perl, R-package, Matlab, and a very-very-very-very little with Ruby
06:30gaussblurincKIMA: it is O'Reilly?
06:33vijaykirangaussblurinc: http://java.ociweb.com/mark/clojure/article.html
06:33vijaykiranI think the book KIMA is referring to is indeed O'Reilly's
06:38gaussblurincthank you!
07:14yoggifolks, i'm havving trouble installing cljsbuild on windows http://paste.in.ua/4279 any help appreciated :)
07:19clgvyoggi: check whether you use the less-than function for unsupported parameters
07:20clgvyoggi: use (print-cause-trace exeception) to get more details
07:21Hotroot430 people? Neat, glad to see that this language has an active community =)
07:22HotrootJust seeing if the channel exists, night all
07:24yoggiclgv, i'm just trying to install cljsbuild via 'lein plugin install', so I guess it's not my code, which is causing the problem
07:24kilonlol watched that video screencast yesterday and did not understand a thing :D
07:25clgvkilon: which?
07:25clgvyoggi: oh thats bad.
07:25kilonclgv: http://cemerick.com/2012/05/02/starting-clojure/
07:25clgvyoggi: your leiningen works in general?
07:26clgvkilon: ah right
07:26kilonto be fair , i dont think its aimed for begineers with clojure
07:27yoggi-clgv: yup, leiningen works
07:27yoggi-stable version, 1.5 I guess
07:27clgvkilon: "starting clojure" does sound like it is intended for beginners, though
07:28clgvyoggi-: you can safely upgrade to 1.7.1 and check if it is still bugging you
07:38Borkdudeis there a leiningen 2 plugin that compiles clojurescript ?
07:39p_lcljs-build wokrs
07:39p_l*works
07:39p_lclojurescript-one worked too
07:39Chiron_Hi, how to catch an exception thrown within with-open?
07:40clgv(try (with-open ... ) (catch IOException e ...))
07:40clojurebotLeiningen's "checkout dependencies" feature (see the README) allows you to override a declared dependency with a local copy symlinked inside the ./checkouts dir.
07:41clgvclojurebot: botsnack
07:41clojurebotThanks! Can I have chocolate next time
07:41Borkdudelein bootstrap doesn't work with the clojureone project in leiningen 2
07:43p_lBorkdude: worked for me, but not immediately
07:44p_lI might have dropped an extra lein deps there
07:44p_l(worked as of yesterday)
07:44kilonclgv: good point , now i noticed the title :D , no , certainly not introductory material, it assumes that the user knows already too much about clojure
07:45clgvkilon: I didnt watch it...
07:45kilonit was full of weird terminology i never heard before
07:46clgvkilon: did you read a clojure book yet?
07:47yoggiclgv: 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."
07:48kilonclgv: 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
07:49kilonand buy an actual book
07:51clgvyoggi: well. that sounds like your leiningen installation is somehow corrupt
07:54clgvkilon: you can buy one of the older books to get the main ideas of clojure - they should be cheaper I guess
07:55clgvkilon: I started with "Programming Clojure" which was already outdated by clojure 1.2 when I read it ;)
07:55kilonclgv: 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
07:57kilonthe problem with his introduction being so bad, I have serious doubt about his book
07:57achinkilon: I've found this one to be useful. It's fairly dense, but I like it. http://java.ociweb.com/mark/clojure/article.html
07:59kilonachin: looks reasonably readable , thanks mate , i will read it now
07:59clgvkilon: oh "Programming Clojure" is from Stuart Halloway - you confuse it with "Clojure Programming" ;)
07:59achinkilon: No worries. I don't know if you talked about this already, but most of the Clojure books are available as PDFs, too.
08:00kilonclgv: oh sorry i though you messed up the word order , did not realis you were referring to another book
08:01kilonachin: 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
08:01kilon*pdf
08:37wmealingis there a better method / preferred method of inter-jvm communication other than zeroMQ ?
08:38clgvwmealing: there is `slacker` which is based on RMI afair
08:40wmealingok.. i'll look into it
08:42wmealingclgv: it looks close to what i want
08:44edwllasram: Ellipses: therein lie demons.
09:00Chiron_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)
09:01Chiron_clojurebot: merengues
09:01clojurebotIt's greek to me.
09:13kmicuChiron_: 'with-open' ensures that the reader is closed at the end of the form
09:18michaelr`string template looks like a good thing hmm
09:19michaelr`I mean StringTemplate
09:20michaelr`I think i will replace Hiccup with it
09:23klauernI'm having some trouble calling a Java static method from Clojure.
09:23klauernhttp://docs.oracle.com/javase/7/docs/api/java/nio/file/Paths.html#get(java.lang.String, java.lang.String...)
09:24clgvChiron_: yeah you could write an extended with-open that allows you to specify catch blocks...
09:25klauernThe argument list takes (String, String...) or (URI), but I get different errors trying to call it one way or another
09:25klauern(java.nio.file.Paths/get "C:/") gives me a ClassCastException trying to coerce "C:/" to a URI
09:26klauernand (java.nio.file.Paths/get "C:/" "temp") gives me a ClassCastException trying to coerce a String to a String[]
09:26Chiron_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
09:27michaelr`klauern: in the first case the overloaded method requires an URI object
09:27michaelr`klauern: in the second you have to pass a string array as the second parameter
09:27michaelr`klauern: maybe you can use (into-array) for that
09:27klauernSo what does a string array look like in Clojure?
09:28michaelr`(into-array ["what" "where"])
09:28klauernbecause then it gives me an exception trying to cast a PersistentVector into a String[]
09:28michaelr`&(into-array ["what" "where"])
09:28michaelr`,(into-array ["what" "where"])
09:28klauernok, I'll look at that.
09:28clojurebot#<String[] [Ljava.lang.String;@18a9794>
09:28michaelr`it's a java string array
09:28michaelr`i think it should work
09:28klauernexcellent, that does work
09:28klauernthank you
09:41kilonnow thats what I call a intro -> http://www.youtube.com/watch?v=Aoeav_T1ARU&amp;feature=relmfu
09:42kilonthank you youtube , you rock :D
10:19bobryis it possible to provide default implementation for methods in 'defprotocol'?
10:22si14anyone using closure library with clojurescript?
10:23lucianbobry: yeah, just write a body for that function
10:24lucianbobry: uh, no you can't. ignore me
10:30clgvbobry: if you need that you can use a multimethod instead of a protocol provided that you do not need a java interface & class
10:31syntaxfreeso most of the Incanter website is down. You can download a .dmg or .exe, but there's no documentation.
10:31syntaxfreeIs it in active development?
10:35bderoomsanyone knows how to allocate more memory whe nrunning from leiningen?
10:35bderoomsoh wait.. that's also just a jar
10:42gfredericksbderooms: 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:43mefestohey all
10:44mefestoim 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:45mefestothe flow is something like: run wsimport on some wsdl, package up the classes files in a jar, compile clojure implementation, run endpoint
10:45mefestoi'm not sure how that fits in with leiningen so any advice would be appreciated
10:49gfredericksmefesto: "run endpoint" means run your clojure project?
10:50mefestogfredericks: yeah that's a rough outline
10:50clgvsyntaxfree: what do you mean? incanter.org seems fine#
10:50clojurebotclojure.org is https://refheap.com/paste/1029/raw
10:50elliottwanyone read this: http://denkspuren.blogspot.com/2012/05/root-of-polymorphism-anti-if-campaign.html
10:50mefestogfredericks: ideally lein swank would make sure the ws artifacts are generated from the wsdl and available on the classpath
10:50syntaxfreeclgv: documentation is offline
10:51clgvsyntaxfree: what exactly?
10:52clgvthe documentation link on incanter.org points to data-sorcery.org which is available
10:52clgvapi-documentation page is accessible as well
10:54mefestoi'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:57moogatronicI 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:59hyPiRionWhen it comes to numbers = checks for type and value equality, while == checks for value equality
10:59hyPiRionso ##(vector [(= 1.0 1) (== 1.0 1)])
11:00moogatronichyPiRion: 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:01cgag_that sounds like a bug to me
11:01moogatronichttps://groups.google.com/forum/?fromgroups#!searchin/clojure/transitive$20==/clojure/kJGteQ_JayQ/MSZFy44dwkQJ
11:01hyPiRionmoogatronic: Oh, I filtered away one of the equals
11:02hyPiRion,(== 3 3.0M)
11:02clojurebotfalse
11:02afoolsuchasihey, 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:02hyPiRion,(== 3.0M 3)
11:02clojurebotfalse
11:03hyPiRionHuh.
11:03moogatronic,(== 3 3.0)
11:03clojurebottrue
11:03moogatronic,(== 3.0 3M)
11:03clojurebottrue
11:03dan`bafoolsuchasi: I think you want the "do" form
11:03TimMc,(let [ns [3 3.0 3.0M]] (for [a ns b ns] (str a \space b \space (== a b))))
11:03clojurebot("3 3 true" "3 3.0 true" "3 3.0 false" "3.0 3 true" "3.0 3.0 true" ...)
11:03afoolsuchasidan`b: thanks. ill check it out
11:04hyPiRionafoolsuchasi: If you don't want to run the false-part, you should also check out the when-macro
11:04TimMc([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:04afoolsuchasithanks
11:05TimMcNon-transitivity.
11:06moogatronicTimMc: My question, and the question in the Google Group posting, would be is Non-transitivity 'correct' for == ?
11:06hyPiRionWhat's more interesting is the following
11:07hyPiRion,(== 3.0M 3M)
11:07clojurebotfalse
11:08TimMc,(let [ns [3 3M 3.0 3.0M]] (for [a ns b ns :when (not (== a b))] [a b]))
11:08clojurebot([3 3.0M] [3M 3.0M] [3.0M 3] [3.0M 3M])
11:09TimMcIf 3.0M is getting stored with a non-zero exponent... does that make sense?
11:09moogatronic,(== 0 (.compareTo 3.0M 3M))
11:09clojurebottrue
11:09TimMc,(let [ns [3 3M 3.0 3.0M]] (for [a ns b ns :when (not (.compareTo a b))] [a b]))
11:09clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException>
11:10clgv,*e
11:10clojurebot#<Unbound Unbound: #'clojure.core/*e>
11:10clgvrepl feature^^
11:11hyPiRion,*1
11:11clojurebot#<Unbound Unbound: #'clojure.core/*1>
11:11hyPiRionBetter use clojure.algo.generic.math-functions/approx= for comparisons like that.
11:11hyPiRionAt least for now, I suppose.
11:58zakwilsonhttp://clojure.org/libraries <-- this page needs an update
12:05technomancyzakwilson: probably just needs to be removed
12:13zakwilsontechnomancy: or that, but something with a list of the standard libraries would be useful. I suppose the API page is a better place.
12:13technomancyconsidering the rate at which clojure.org gets updates, anything on there is bound to do more harm than good
12:14technomancyI don't think curating a list of "blessed" libraries is something the maintainers should or want to do.
12:16hyPiRionBetter to just link to their github repos, perhaps.
12:16hiredmantechnomancy: this conversation is almost funny
12:17technomancyclojurebot: http://clojure.org is timeless.
12:17clojurebotIn Ordnung
12:17technomancyin more than one way.
12:18hiredman"that should be removed" "yeah it belongs on another page" "no, it should be removed" "yeah, we should keep that list differently"
12:18technomancyheh
12:22technomancyI just try to point people towards clojuresphere; that helps a lot
12:23technomancyalthough it counts historical dependencies, so stuff like monolithic contrib still ranks highly
12:25daniel___can anyone tell me why i get this error? https://gist.github.com/2782518
12:27Bronsadaniel___: replace [vct] with vct on line 13
12:27hyPiRionProbably because you wrap the vct-vector in a vector
12:28daniel___oh Bronsa
12:28daniel___duh!
12:28daniel___thanks
12:28Bronsa:)
12:32daniel___are there any good practices for setting up test data that is general to all tests?
12:32daniel___stick them in a file in the root test folder and require it where needed?
12:33daniel___it will just be a load of (def blah something)
12:33dnolenEuroClojure sounds fun, anyone there?
12:53daniel___i'm having trouble with namespaces
12:53daniel___ (:use [chess.data.positions] :reload)
12:53daniel___from my root folder, i have data/chess/data/positions.clj
12:53daniel___it says it can't find it
12:53daniel___i tried mirroring the arrangement for test: test/chess/test/
12:54daniel___this ties in with my question above...any good practices for test data?
12:58TimMcdaniel___: Is ./data/ on the classpath?
13:01daniel___not according to the error
13:01daniel___i didnt deal with the classpath because i used lein to create the project
13:02daniel___so /src and /test were automatically added i guess
13:03daniel___i just looked at the classpath, i can see the it adds test-resources/
13:03TimMcdaniel___: Right, src, test, resources, classes, and everything in lib are always added to the classpath. You can change that, though!
13:04daniel___perhaps that's where this kind of data should live?
13:04TimMcSounds right.
13:05daniel___yep, works now
13:06daniel___so i have test-resources/chess/data/positions.clj
13:06daniel___how would i add something to the classpath with leiningen? can i specify extra folders in the project.clj?
13:09jayunit100not sure what this does :
13:09jayunit100 -> #'main-routes
13:09jayunit100in my hacked up ring app.
13:10TimMcjayunit100: It's impossible to tell for sure from that tiny snippet. Pastebin?
13:10jayunit100TimMc Good call
13:10TimMcdaniel___: Check out the sample.project.clj file in lein's repo.
13:11jayunit100http://pastebin.com/raw.php?i=9FRgqEJR
13:11kmicudaniel___: https://github.com/technomancy/leiningen/blob/master/sample.project.clj
13:11tmciverjayunit100: that passes the var to the run-jetty function so that you don't have to restart the server when you make changes.
13:11jayunit100hmmmm what is the syntax doing ?
13:11jayunit100a # is usually a set , right ?
13:12TimMcjayunit100: Are you asking about ->?
13:12TimMcjayunit100: # is reader dispatch
13:12jayunit100oh
13:12jayunit100oops
13:12TimMcSo what's important is the next character. :-)
13:13TimMc#'foo means (var foo), #{foo) means (hash-set foo) or similar, etc.
13:13TimMcerrr #{foo}
13:14TimMcjayunit100: (wrap-file (handler/api (var main-routes)) "public")
13:14jayunit100i like that better :)
13:15jayunit100why is main-routes sent as a var ?
13:15gfredericks,(hash-set 1 2 2 3)
13:15clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: 2>
13:15gfredericksjayunit100: I think that gives you more flexible reloadability
13:15tmciverTimMc: is # still considered a reader dispatch for the set literal #{}?
13:17jayunit100oh , because the var is mutable ?
13:17jayunit100I guess, is the passing/redeclaring of the var making it somehow behave like a mutable variable ?
13:17cpineraHi. 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:18gfredericksjayunit100: yeah it's a reference type
13:18gfrederickswhen a var refers to a function you can treat the var like a function
13:18jayunit100Ah okay
13:18gfredericksso 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:18gfredericksin contrast to if you had passed the function itself to ring originally
13:20TimMcEven if vars of fns couldn't be invoked directly, you could still deref them first.
13:20TimMctmciver: I believe so.
13:21tmciverHmm, 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:21TimMcRan out of characters.
13:22hiredmantmciver: maps have { and vectors have [
13:24hiredman"dispatch" there is just a second table of reader macros
13:24hiredman# means "look at the second table"
13:24hiredman{ is a map in the first, but a set in the second
13:24ibdknoxclever
13:24gfredericks#[1 2 3] could be something
13:27technomancygfredericks: a finger tree, some day?
13:27Bronsaa range?
13:28mefestocan leiningen install a jar file (non-leiningen project) into the local mvn repo or is `mvn install:install-file` the only way?
13:28technomancymefesto: there's a lein-localrepo plugin for that
13:28mefestotechnomancy: thanks
13:29technomancyclojurebot: repeatability?
13:29clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
13:29technomancymefesto: but see the above link for why it's often not a good idea
13:29mefestotechnomancy: i agree but this is a jaxws project
13:29technomancyok, as long as you're aware
13:29mefestotechnomancy: know of a lein-jaxws plugin?
13:29technomancyno, never heard of it
13:30mefestosoap based web services :-\
13:30technomancyI'm sorry =(
13:30mefestothe flow im dealing with is wsdl -> class files -> jar -> copy to lein lib dir -> lein swank :-\
13:31mefestoonce 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:33klauernwhy not use the clojure maven plugin with whatever wsdl -> class files compiler you're using?
13:33mefestoklauern: 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:34klauernI'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:34mefestoklauern: i'll give it a shot. thanks! :)
13:35klauernmefesto: 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:36klauernmefesto: http://cxf.apache.org/docs/how-do-i-develop-a-client.html
13:37samedhiI 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:37hiredmanwhy not just generate the wsdl classes programtically?
13:38mefestohiredman: how so?
13:38mefestowsimport has an api?
13:38klauernwell, the source for the maven plugin probably details how to do it: http://jax-ws-commons.java.net/jaxws-maven-plugin/
13:38samedhiI 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:38mefestoor are you talking about using the dispatch api?
13:39hiredmanmefesto: 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:40mefestohiredman: sounds good but i have no idea how to do that. pointers?
13:40hiredmanfind out how to drive what ever code you are using to generate the wsdl classes programmatically instead of from maven
13:41klauernI 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:42mefestohiredman: 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:43hiredmanwhy couldn't you do that with jax-ws?
13:43mefestohiredman: im probably misunderstanding you also :)
13:43klauernmefesto: 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:43klauernall that class does is process the maven pom.xml parameters and call wsimport to generate .java
13:44mefestoklauern: ahh i see com.sun.tools.ws.WsImport
13:44mefestoi was only looking at the javax.xml.ws / javax.jws namespaces
13:48mefestothis is looking pretty good -- i'll give it a shot
13:49mefestohiredman, klauern: thanks!
13:50klauernyou're welcome
14:06tmarbleibdknox: I am trying to run a 'sh' command from a Noir page, but I'm getting RejectedExecutionException
14:07tmarbleand I'm pretty sure this is not related to lein
14:07tmarbleis there some special policy to set for ThreadPoolExecutor in the web container?
14:09dnolenlynaghk: ping
14:15technomancytmarble: sounds like the agent thread pool got shut down. you wouldn't happen to be on a really old Leiningen, would you?
14:16tmarbletechnomancy: I saw that issue, but I'm on lein 1.7.1 (downrev'd I know!)
14:16technomancyhuh; no idea then =\
14:17tmarbletechnomancy: but, more to the point, I'm running from the jar w/o lein at all
14:17technomancyoh, gotcha
14:19timvisher_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:20timvisher_anyone know of a simpler solution? All I want is a way to create thumbnails quickly and easily
14:20timvisher_would hope not to roll my own
14:26muhootimvisher_: https://www.refheap.com/paste/2857 , lifted originally from briancarper's site, but i forgot the link
14:28S11001001oh, the strange dichotomy of dependency avoidance and dependency refinement
14:28timvisher_muhoo: yep, that's about what i might do if i come up with something myself.
14:28muhooS11001001: co-dependency?
14:28timvisher_couple of problems
14:31muhooseems kind of quiet. maybe everyone is at euroclojure.
14:31timvisher__Problem 1: BufferedImage seems to be fairly draconian in error handling
14:31timvisher__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:32timvisher__well, actually I said a couple of problems
14:32timvisher__that's the big one... :)
14:32timvisher__so i was hoping someone had come up with a swiss army knife for the jvm
14:32jtoyhow do i build up a list incrementally?
14:33timvisher__seems like the best of breed is really imagemagick which ties me basically to shelling out on a box with it installed
14:33timvisher__jtoy: in what context?
14:33matthavenerjtoy: conj appends to a list
14:33jtoyi have to process a bunch of lines of data and return one big list of processed items
14:34timvisher__i think you're looking for map, then
14:34hyPiRionI'd use mapcat or map
14:34timvisher__,(map + [1 2 3 4 5])
14:34clojurebot(1 2 3 4 5)
14:34timvisher__,(map (partial + 1) [1 2 3 4 5])
14:34clojurebot(2 3 4 5 6)
14:34timvisher__;)
14:35jtoyonly certain lines are returned though
14:35jtoymap returns something for each line?
14:35timvisher__,(filter odd? (map (partial + 1) [1 2 3 4 5]))
14:35clojurebot(3 5)
14:35hyPiRionjtoy: I think you have to explain a litte more what you're trying to achieve.
14:36timvisher__map just passes each of the members of the seq to a function and replaces the element with the result
14:37timvisher__i love map/reduce…
14:38jtoyhope i didn't miss the answer
14:38jtoy42
14:38hyPiRionjtoy: I think you have to explain a litte more what you're trying to achieve.
14:39hyPiRionSo you have some lines of data, and want to do something with all of them or some of them?
14:43tmarbletechnomancy: 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:45timvisher__jtoy: did you see the filter/map example that i did?
14:45jtoytimvisher__: yeah
14:45timvisher__that not what you're looking for?
14:45hyPiRionjtoy: Anyway, read yourself up on map, filter and remove. They seem to be what you're out after.
14:45jtoyI'm trying to test it out, but I think I'm doing something wrong
14:49timvisher_jtoy: sorry, lost network
14:49timvisher_what's the results you're getting?
14:52jtoytimvisher_: 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:53timvisher_so maybe you're looking for something like:
14:53timvisher_,(map second (filter (comp odd? first) [[1 2] [3 5] [4 6] [7 9]]))
14:54clojurebot(2 5 9)
14:54timvisher_obviously changed to reflect whatever filtering and positioning you're looking for
14:55TimMc,(let [xs [[1 2] [3 5] [4 6] [7 9]]] (for [[a b] xs :when (odd? a)] b))
14:55clojurebot(2 5 9)
14:56timvisher_TimMc: well aren't you fancy ;)
15:12technomancywhat HTTP response would you use for someone polling for a resource that's being computed asynchronously?
15:12banseljajHey 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:12matthavenertechnomancy: 404? if it doesnt exist (yet)
15:13tmcivertechnomancy: 202 Accepted?
15:13technomancymatthavener: 4xx implies that the request was ill-formed
15:13technomancytmciver: oh, perfect; of course.
15:13tmcivertechnomancy: from wikipedia (http://en.wikipedia.org/wiki/HTTP_status_code) accepted for processing, but the processing has not been completed.
15:15timvisher_technomancy: 420 is sort of applicable :) https://dev.twitter.com/docs/error-codes-responses
15:15technomancyhehe
15:20timvisher_benseljaj: the list is pretty loose with that sort of thing. if you want to, go for it. ^_^
15:21banseljajI Meant I need some place where people can *actually* tell me what they want.
15:23timvisher_the list wouldn't work?
15:29banseljajtimvisher_: That's what I'm aking you guys. :P
15:31brainproxyis there a shortcut for referring to the last value returned by the repl?
15:31brainproxyw/ nodejs's repl it's _
15:32timvisher_well i think you're good to go then. ;)
15:32matthavenerbrainproxy: *1 i thin
15:32timvisher_yep, *1 *2 and *3
15:32brainproxymatthavener: cool, just found that
15:32timvisher_alse *e for fun
15:32timvisher_also*
15:32matthavenertimvisher_: what's *e do?
15:33RaynesRefers to the last exception that occurred in the repl.
15:33timvisher_i believe that's the last thrown exception
15:33solussdtrying 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:34emezeskesolussd: What version of crate, and what does your require look like?
15:35solussdemezeske: [crate.form :as crate-form] and 0.1.0-alpha3
15:36adeelkhsolussd: paste your (ns ...)?
15:36emezeskesolussd: That's a pretty old version of crate
15:36solussdnewest on clojars i believe. :)
15:37emezeskesolussd: Nope.
15:37solussdadeelkh: https://www.refheap.com/paste/4fbe8d26e4b0f71f74353acd
15:37emezeskesolussd: http://clojars.org/search?q=crate , newest is 0.2.0-alpha3
15:37emezeskesolussd: The version you're using doesn't even have a form ns
15:37solussdemezeske: ill swap that in and see if it works. :)
15:37solussdwell that's probably it then.
15:37solussdthanks
15:37emezeskenp
15:38emezeskenote: the newest crate is like the newest hiccup, it's been reorganized
15:38solussdclojurescript stuff is a fast-moving target
15:38emezeskevery.
15:38RaynesYeah, and someone is already writing a book on it.
15:38solussdthankfully we have clojars/leiningen. Can't imagine managing all my deps any other way
15:39timvisher_anyone know of a robust image processing library for the jvm?
15:40timvisher_Raynes: someone has a clear masochistic leaning. :)
15:40solussdtimvisher: opencv + java wrapper
15:40solussderr.. image processing, nevermind
15:40timvisher_lol :)
15:40timvisher_besides, needs to be pure jvm
15:40timvisher_no shell out
15:41timvisher_i already can use imagemagick for that
15:41pipelineawt already supports a lot of image formats doesn't it
15:43timvisher_pipeline, it does but the images appear to need to be well formed
15:44timvisher_http://thefoxisblack.com/desktop-wallpaper/Ellis-Latham-Brown-1280x800.jpg should be readable by your browser and your box
15:44timvisher_but BufferedImage barfs
15:44timvisher_i may not be understanding all the little bits and bobs that BufferedImage needs though
15:45pipelineahah well that sucks
15:45timvisher_Just try an (with-open [is (io/input-stream "http://thefoxisblack.com/desktop-wallpaper/Ellis-Latham-Brown-1280x800.jpg&quot;)] (ImageIO/read is)) at the repl
15:45pandeirosolussd: are you using the newest crate?
15:45pipelinetimvisher_: well, even if you can't shell out, can you at least ship a jni imagemagick ?
15:45jlongsterdnolen: 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:45solussdpandeiro: I am as of a couple minutes ago (newest on clojars)
15:46dnolenjlongster: not valid Clojure
15:46pandeiroi 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:46jlongsterdnolen: yeah, sorry, I'm building them into Outlet
15:46timvisher_pipeline: i don't believe i can on heroku
15:46jlongsterdidn't know if you had any strong opinions on that syntax
15:46timvisher_i probably could on ec2
15:47timvisher_but i was hoping for heroku
15:47pipeline"JNI APIs are not guaranteed to work. Search Dev Center for information about specific JNI services supported by Heroku."
15:47pipelinewell that's wonderfully vague
15:47pipelinemight just have to e-mail them
15:47timvisher_of course i could also deploy this as a service on ec2 and then have that as a seperate product
15:47dnolenjlongster: just depends I think. In the case of Clojure/ClojureScript that directly clashes syntax for referring to namespaces.
15:47timvisher_there are remarkably few good image processing services out there
15:48timvisher_ImageShack is pretty good if all you want to do is scale and crop
15:48timvisher_but i'm eventually going to need more than that
15:49jlongsterdnolen: 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:49adeelkhtimvisher_: https://addons.heroku.com/blitline
15:49dnolenjlongster: it's very unlispy so I don't really like it.
15:50adeelkhtimvisher_: and https://addons.heroku.com/cloudinary but it's in private beta
15:50jlongsterdnolen: unlispy-ness is relative ;) but I agree here.
15:50timvisher_adeelkh: very interesting
15:51adeelkhjlongster: that syntax can't be composed so that's pretty unlispy objectively
15:51dnolenjlongster: no in this this case, you have nested actions outside of sexpr syntax.
15:52dnolenI also agree with adeelkh, complicates transformation.
15:52jlongsteryep, it was just a quick thought
15:53dnolenjlongster: it is currently an edge case that's allowed in CLJS but will probably be purged at some point.
15:53solussdSo 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:54jlongsterdnolen: what's the edge case? .- on function expressions?
15:55dnolenjlongster: (set! foo.bar.baz ...) works today.
15:55emezeskesolussd: 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:56bobryI'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:56solussdemezeske: so the "right way" is to write clojurescript intended for the entire site?
15:56emezeskesolussd: I don't know about "right", but it will be more bandwidth efficient and cache friendly overall
15:56emezeskesolussd: The way I do it is that I have separate cljs namespaces, one for each page, and each one has an "initialize" function
15:57solussdemezeske: the only problem I have with that is using document.ready
15:57emezeskesolussd: It's pretty easy to avoid that, in my experience
15:57dnolenbobry: no executable ctor bodies, so probably not
15:57muhoowith 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:57solussdemezeske: what does the 'initialize' function do? do you detect what page you're on?
15:58dnolenbobry: at least not with deftype syntax
15:58jlongsterdnolen: oh, I didn't know that. yeah, I'm trying to purge those kinds of expressions
15:58solussdemezeske: i'm just getting back into web dev after a few years. :)
15:58emezeskesolussd: No, the initialize function does everything your document.ready handlers do
15:58dnolenbobry: but you can probably accomplish what you want with fn + this-as
15:58bobrydnolen: are there any alternatives? well, except defrecord
15:58emezeskesolussd: And the page itself chooses which initialize function to call
15:58bobrythis-as, hmm, that might work
15:58emezeskesolussd: So /home might call my-cljs.home/initialize
15:59solussdwhat calls it? the page?
15:59emezeskesolussd: Keep in mind this is just my way of doing things, there's not really a best practice yet :)
15:59emezeskesolussd: Yeah, the page has something like <script>$(my-cljs.home.initialize())</script>
16:00emezeskesolussd: And the initialize function is defined with ^:export metadata so it can be called from JS
16:00solussdemezeske: cool. That ought to work well for me. thanks for the insight
16:00adeelkhmuhoo: yeah just push them to clojars with a different groupid
16:01emezeskesolussd: happy to share ideas, maybe you'll share a nice improvement with me sometime :)
16:01solussdemezeske: 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:02emezeskesolussd: pretty much!
16:02dnolenbobry: http://gist.github.com/2783861
16:04pandeirothe main problem i have with cljs is that it's taking 7-8 seconds to compile even the slightest change to src files
16:04pandeironot to mention the 100 second+ initial compile
16:04dnolenpandeiro: with lein-cljsbuild auto?
16:04pandeiro(using lein-cljsbuild)
16:04pandeiroyep, the incrementals are about7-8 secs
16:04emezeskepandeiro: How many lines of cljs? that seems massively high
16:05dnolenpandeiro: I've never seen it take longer than 14 seconds on cold start
16:05bobrydnolen: 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:05pandeirowe're talking less than 50 lines
16:05emezeskepandeiro: Are you compiling with advanced optimizations?
16:05dnolenpandeiro: auto takes <2-4s
16:05pandeiroemezeske: dnolen: which macbooks do you have?
16:05emezeskepandeiro: None?
16:05pandeiroprocessor?
16:06emezeskeAnswer my question first :)
16:06pandeiro:optimizations :simple
16:06dnolenbobry: should no longer be the case in master
16:06dnolenpandeiro: macbook pro 2010 2.66 i7
16:06pandeiroi know that my processor sucks, i am 'in between computers' at the mo
16:06emezeskeHave you tried :whitespace? I'm on a 2.4 GHz AMD.
16:07bobrydnolen: thanks, I'll check it out :)
16:07pandeiroemezeske: i will try whitespace
16:07pbostromsolussd: another alternative is (cond (= js/window.location.pathname "/foo") (foo/init) (= js/window.location.pathname "/bar") (bar/init) ) etc.
16:07emezeskepandeiro: Not sure that it will make a difference :/
16:07pandeiroemezeske: i have noticed the compile times increasing gradually since the early days
16:08adeelkhactually, i usually get 5-8s compilation times with lein cljsbuild auto too
16:08solussdpbostrom: 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:08pandeiroadeelkh: what cpu?
16:09ibdknoxis compiling actually CPU bound?
16:09adeelkh2.4 ghz intel core 2 duo
16:09emezeskeI usually see < 2s compile times on my 2.4 GHz chip from two years ago
16:09pandeiroibdknox: what else would it be?
16:09ibdknoxIO
16:09ibdknoxcompiling is often IO bound
16:09pandeiroi see the java process chewing up >95% in top
16:09dnolenpandeiro: possibly though in my experience Closure completely dominates compile time.
16:11dnolenpandeiro: 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:12emezeskeSo, one thing about lein-cljsbuild is that it doesn't actually do incremental builds
16:12pandeirodnolen: i think on the high end of things it may be negligible but down here it hurts
16:12emezeskeI 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:13emezeskeYou might try not deleting the intermediate dir upon each build, for incremental builds, to see if that's faster
16:13emezeskeI'd be happy to make that a config option if it proves to be useful
16:14dnolenpandeiro: I'm listening - but analysis + patches would help me more.
16:14dnolenw/o advanced opts - I see that CLJS tests compile in 11s cold start.
16:16dnolenif somebody wants to do a rigorous analysis of compilation times on different JVMs, OSes, Archs, I'll happily pay attention.
16:16dnolenalso tree shaker + code optimizer in Clojure itself would be welcome.
16:18jayunit100(map #([%]) [1 2])
16:18jlongsterdnolen: I'm interested in doing some things like that eventually, and I'll definitely share it if I do
16:18pandeiroemezeske: yeah with noir-cljs' compiling middleware things are a little more reasonable, 2-4 seconds
16:18pandeirodnolen: i really wish i could contribute, but i am not there yet
16:19emezeskeI just tested things with lein-cljsbuild allowing incremental compiles, it does shave off quite a bit of time
16:19jayunit100any way we could have a noir dojo in nyc or boston ? i'd like to understand it better myself
16:20dnolenemezeske: sweet!
16:20emezeskednolen: I'm not sure I trust it yet, though
16:20emezeskednolen: Although I should probably make it optional
16:20pandeiroemezeske: that would be fantastic
16:21emezeskednolen: And, even better, figure out why it was breaking things, instead of just using it defensively :)
16:21dnolenemezeske: I think that would be big, people really shouldn't have to pay for recompiling core.cljs
16:21jayunit100any thoughts on why "(map #([%]) [1 2])" fails ?
16:21gfredericksyes
16:21gfredericks#([%]) tries to call the vector as a function
16:21emezeskednolen: Yeah, compiles went from 2.5s to 0.75s for me, depending on which of my input files I touched
16:22gfredericksjayunit100: if you actually want to do that, (map vector [1 2]) should work
16:22jayunit100hmmm ok
16:22jayunit100well, i want to map a vector over a list of parameters, "hydrating" it.
16:23jayunit100(map #([:name %]) ["jayunit100" "gfredricks"])
16:23dnolenpandeiro: 10s for analysis + compilation 8000-9000 lines of Clojure ain't so bad. 20s of that is advanced compilation.
16:23jayunit100thats what i 'really' want to do
16:23LauJensen&(map #(vector :name %) ["jayunit100" "gfredricks"])
16:24dnolenpandeiro: 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:24jayunit100LauJensen: great videos btw
16:24LauJensenjayunit100: thanks.. :) You mean the old ones?
16:25emezeskednolen, pandeiro: I will probably get to this tonight: https://github.com/emezeske/lein-cljsbuild/issues/94
16:25emezeskednolen: I think we could see huge wins by figuring out how to parallelize parts of the compiler
16:26emezeskednolen: No idea about the feasibility of that, though
16:26jayunit100LauJensen I liked the clojureql one
16:26jayunit100i havent seen fluid dynamics
16:26dnolenemezeske: possibly
16:26LauJensenah right. I was actually considering doing another clojureql video, to demo all the new stuff
16:26emezeskednolen: That's on my "far-out todo" list of things I want to explore
16:26pandeiroemezeske: dnolen: thanks a bunch for all the work you've already put in, btw
16:27dnolenemezeske: 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:27emezeskednolen: That's my belief. Who knows, though, maybe the bug went away since I papered over it? :)
16:28dnolenemezeske: 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:28bobryhmm, how do I know which version of clojurescript is used when compiling with cljsbuild?
16:28bobryi have a bunch of them in the classpath
16:28emezeskebobry: are you using lein?
16:28bobryyup
16:29emezeskednolen: I see, interesting
16:29emezeskebobry: You could always "rm -rf lib && lein clean && lein deps"
16:30emezeskebobry: Actually I don't know if that will work
16:30emezeskebobry: Anyway, lein-cljsbuild should always be using the latest tagged version of the clojurescript compiler
16:30bobrynot sure either :)
16:32bobryi wish there was a constantly updating snapshot of clojurescript/master somewhere
16:32emezeskebobry: 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:34bobryemezeske: thanks, that just what I needed
16:34emezeskebobry: sure! maybe one day I'll even distill that thread into a doc :)
16:41muhoopandeiro: fyi i fixed that couch-session thing last night and sent sritchie a pull request
16:41bobrydnolen: thanks! version from 'master' compiled that '(goog.ui.Component ...)' call correctly :)
16:41dnolenbobry: good to hear
16:41bobryemezeske: you can add it to the FAQ section of the README, i guess :)
16:44pandeiromuhoo: awesome i was gonna ask you about that
16:45jayunit100whats the best way to get a function by its string name
16:45technomancytimvisher: hey, did you have a heroku question?
16:45pandeiromuhoo: i remember you saying clutch was returning metadata or something instead of nil for docs that don't exist?
16:45pandeirois that a clutch bug? and are you testing against 0.4.0-SNAPSHOT?
16:49solussdany 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:58brainproxycemerick: (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:00cemerickbrainproxy: I'm glad you're finding it useful. :-)
17:00pandeiroemezeske: :whitespace has ended up being faster, 4-5s vs. 7-8
17:11emezeskepandeiro: 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:15jayunit100Hmmm anyone good at noir ?
17:16jayunit100Trying to forward a request in my GET methods for main-routes . Not sure if there is a "best" way to do it.
17:19jayunit100s/noir/compujure
17:20jayunit100nevermind......... (GET "/" [] (resp/redirect "/index.html")) does it :)
17:52sjlwhat magic incantation do I need to perform to get 'lein new mytemplate foo' to be able to find mytemplate?
17:52sjlI tried 'lein install' in the mytemplate project which succeeded
17:53sjlBut I still get "Could not find tempalte mytemplate on the classpath"
17:53RaynesYou need to add it to your :plugins
17:53RaynesIn ~/.lein/profiles.clj
17:53sjloh, so https://github.com/ibdknox/cljs-template is lying
17:54RaynesNope.
17:54sjlyep, works now, cool
17:54sjl"There's nothing to install: As of preview3, templates are automatically fetched when first used."
17:54sjl(not (= "nothing" "something in your profiles.clj"))
17:55RaynesIf you have a template with the group and artifact-id mytemplate/lein-template it works.
17:55RaynesLook at cljs-template's project.clj.
17:56sjlnow I'm just confused
17:56RaynesI'm not sure why.
17:56sjlso the idea is that the artifact-id is *always* supposed to be lein-template, but for different templates you change the *group* id?
17:57RaynesYes.
17:57sjlso instead of one group with many templates, you have a ton of groups with one template each?
17:57RaynesIf you want to publish your template for easy retrieval without installing.
17:58RaynesYou 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:58RaynesThere aren't many easy ways to do that sort of thing.
17:58Raynestechnomancy choose this particular convention though.
17:58sjlbut why is the more-specific name the *group* and the less-specific name the more-specfic part?
17:58technomancysjl: most templates are part of a larger project
17:58RaynesI imagine because in most cases, your template is a subproject of something else.
17:58jayunit100http://stackoverflow.com/questions/10745693/dynamically-adding-routes-in-compojure
17:59sjltechnomancy: templates *create* projects...
17:59RaynesLike noir has noir/lein-template
17:59technomancyyou 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:59sjlah, so it's just an access-control thing then
17:59technomancyand a grouping thing
17:59RaynesAlso, you can still do template packs.
18:00technomancymost of the time templates center around an existing project like noir or pallet or storm or whatever.
18:00RaynesThis is just a convenience thing.
18:00sjlI guess I think of Clojure projects as using a bunch of libraries, not bring written for a framework like that
18:01sjlbut it could go the other way I guess
18:01technomancysure; if you aren't using a framework then the default templates should suffice
18:02sjlanyway adding it to profiles.clj always works no matter what the name, so that's good enough for me
18:02RaynesIndeed. :D
18:02RaynesThat's the best way to do it if you just want a bunch of little custom templates.
18:02sjll
18:02sjlyep
18:06sritchiemuhoo: just released 1.1.1
18:06technomancysjl: thanks for the review btw
18:06technomancyassuming I have the right sjl
18:06sjltechnomancy: yeah no problem
18:06technomancygot a further rewrite of the profile docs in the works
18:07technomancysjl: got lots of respect for the docs fanaticism in python-land
18:08sjlyeah
18:08sjlhttp://jacobian.org/writing/great-documentation/
18:08technomancy<3 readthedocs.org
18:09technomancy700 pages; whoa
18:10sjlI agree 100% with his "auto-generated docs are bullshit" claim too.
18:10sjl"Here's your car's owners' manual honey, read it all the way through and good luck passing your driver's license test!"
18:11technomancyyeah, I love having docstrings, but putting docstrings on the web misses the point.
18:11technomancydocstrings are about exploring a live process
18:11sjldocstrings are reference once you know which function you need -- unless you already know that they're useless
18:12sjlEven worse is the "literate programming" things that have cropped up recently.
18:12technomancysjl: ok, actual serious question: do you think having `lein new` emit a doc/tutorial.md file by default would actually do any good?
18:12technomancykind of like how it emits failing tests by default
18:12sjl"Watch this documentary on how your car was built and then we'll take you for your driver's test."
18:13technomancyI'm tempted to add it, but I feel like documentation needs just vary too much from project to project.
18:13sjltechnomancy: I think people would just ignore it mostly
18:13sjlyeah
18:13technomancythere's no way to trick people into caring
18:14technomancyI mean public shaming works ok i GUESS, but...
18:14sjlOr make your own library that does what theirs does but is actually documented so other people can use it
18:14sjlthat usually works
18:15sjllots more work though
18:15gf3technomancy, sjl: Agree
18:15gf3I think it would be mostly overlooked
18:15technomancyduplication of effort makes me =(
18:15dnolensjl: I agree w/ some of your points - but Django docs don't help the monstrosities it contains.
18:16sjldnolen: I'd bet there are way more people getting way more things actually done in the real world with Django though
18:16dnolensjl: more power to them
18:16sjlit's not a zero sum game though
18:16gf3What would be cool would be the consolidation of all project docs on a single site
18:16sjlyou can have *good* things with *good* docs
18:17gf3Like the ruby yard docs from gems
18:17technomancysjl: imagine
18:17technomancygf3: clojuredocs.org used to document third-party libs
18:17sjlgf3: meh, as long as the docs are on the internet google will find them -- that's good enough for me
18:18dnolenI wish I could I reclaim the countless hours lost reading about pointless complexities in CakePHP, Rails, Cocoa & Django docs.
18:18gf3dnolen: Really? I find the Rails Guides pretty good...
18:18gf3Cocoa ones aren't bad either – but only for the apple libs
18:19sjlAnd 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:19dnolengf3: the sheer amount of documentation is just a symptom. I'm not talking about how well they are written.
18:20dnolensjl: certainly not saying Clojure is devoid of this problem. Many non-trivial things lead to JavaDocs or Java framework docs.
18:20sjlThe best of both worlds would be to have the wonderful simple ideas but actually have good docs for them too.
18:20dnolensjl: in complete agreement
18:21technomancyyeah, 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:21technomancyI still need someone who actually knows about building web pages to help me make http://leiningen.org not suck
18:22sjlMy 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:22technomancyreally? that'd be great =)
18:22wkmanireWho drew the dude?
18:23technomancywkmanire: my brother-in-law; he works as a game artist.
18:23wkmanireLooks awesome.
18:23technomancythanks
18:23sjlAnd "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:23wkmanireBig moustache+small chin ftw.
18:23gf3technomancy: gianni@runlevel6.org should you need to discuss anything (also my gtalk)
18:23emezesketechnomancy: Maybe this just shows my ignorance about web stuff, but what sucks about leiningen.org?
18:23technomancyemezeske: it's not very well-organized
18:24technomancyI'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:24emezeskeAh, I gotcha, so you almost need a designer-type person?
18:24technomancygf3: are you on the Leiningen mailing list?
18:24technomancyemezeske: well, static site generation would be a part of it too
18:24gf3technomancy: I am not... yet
18:25emezesketechnomancy: I see. I wouldn't be very helpful then :)
18:26gf3Also, if anyone sees _ato around please let him know I'd like to have a quick chat with him
18:27aperiodicgf3: you could send him mail via the bots
18:27technomancygf3: I'll start a thread there if you don't mind hopping on
18:27gf3aperiodic: How does one do such a thing?
18:27aperiodic$mail gf3 see me at once
18:27aperiodicheh, maybe not
18:28aperiodicwait, is lazybot not in the room?
18:28BorkdudeI'm trying out how to build a cljs file into js
18:28Borkdudefrom https://github.com/emezeske/lein-cljsbuild
18:28Borkdudebut I keep running into problems
18:29BorkdudeI guess the plugin is not lein2 ready?
18:30Borkdudemy project.clj looks like this: https://gist.github.com/2784557
18:30gf3technomancy: Joined
18:30emezeskeBorkdude: Last I checked, it worked with lein2. That was a couple weeks ago though
18:31emezeskeBorkdude: Oh, you are using an *ancient* version of lein-cljsbuild
18:31emezeskeBorkdude: 0.0.11 is really, really old
18:31technomancylike over a whole month!
18:31technomancy=)
18:31aperiodicRaynes: where did lazybot go? :(
18:31sjllol
18:31Borkdudeemezeske: I'm using the version that is described as "latest version"
18:31emezesketechnomancy: :P
18:31sjlI love how "ancient" in the clojure community is measured in "months"
18:31Raynesaperiodic: He stepped out for a smoke.
18:31emezeskeBorkdude: Not in your gist, you're not
18:32sjlMercurial is backwards-compatible over the wire to versions released ~5 years ago
18:32Borkdudeemezeske: hmm, where did I get that from, I wonder
18:32gf3sjl: Haha indeed, no commits for two months? Project is abandoned!
18:32emezeskesjl: Clojure years are like dog years
18:32technomancysjl: to be fair, the Clojure language itself has had very few breaking changes
18:32technomancyit's all ecosystem stuff
18:32sjltechnomancy: aside from "remove clojure-contrib and break everything ever"?
18:33wkmaniregf3: 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:33wkmanireheh
18:33aperiodic$mail gf3 here's some mail?
18:33emezeskesjl: That's not the "language itself" though
18:33lazybotMessage saved.
18:33technomancysjl: 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:33sjlyeah
18:33sjl"How do I do this? Use clojure-contrib."
18:33gf3$mail _ato Hey, I'd love to have a quick chat about Clojars.org if you have a sec!
18:33lazybotMessage saved.
18:34sjllater: "It broke. Well yeah, you were using clojure-contrib"
18:34sjlarg
18:34gf3aperiodic: Awesome, thank you
18:34technomancysjl: 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:35aperiodicgf3: you're welcome!
18:35sjltechnomancy: 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:35Borkdudeit works :)
18:35technomancylein-precate seems to have solved that problem for the lein2 transition though; I'm happy how that turned out
18:36sjlClojure 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:36technomancyat least, I haven't heard much from people having trouble upgrading. maybe they are all super frustrated and keeping quiet about it.
18:36sjlt break" one
18:37sjlit was pretty easy for all my projects, though I was never really doing anything crazy with lein in the first place
18:37brainproxyis it possible to use swank-clojure jack in together with cljsbuild's repl-rhino?
18:38sjlVim here as well
18:38aperiodicme too!
18:39technomancyibdknox: 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:40brainproxyI 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:45wei_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:45technomancywei_: there's something to be said for a function that checks a dynamically-bound var and uses println
18:45technomancyI use this in Leiningen.
18:46technomancyhttps://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L19
18:46wei_hmm, that sounds like a better idea
18:46technomancyjava logging is a big bag of crazy
18:46wei_anyone know where println goes if i'm using nailgun/vimclojure?
18:46technomancyit solves problems you don't have
18:46duck1123it's great when it works well
18:47technomancylog4j straight up refuses to log if it hasn't been configured =(
18:48lynaghktechnomancy: speaking of lein2, any timeline on Heroku support?
18:49technomancylynaghk: you can use it now if you set your BUILDPACK_URL; hang on
18:49duck1123I have just recently learned to love setting different namespaces to different levels. It's made me re-think a lot of my logging
18:49lynaghktechnomancy: ohhhh boss, thanks
18:49technomancylynaghk: https://github.com/heroku/heroku-buildpack-clojure/tree/lein-2
18:49technomancyI think there is one bug relating to clearing the m2 cache too aggressively surrounding plugins, which is why I haven't announced it
18:50emezeskewei_: It should go to the console where you're running the vimclojure server, I believe
18:50lynaghkthe side effect of that bug is just slightly longer startup time to download deps?
18:50technomancylynaghk: yeah, provided you're using plugins at runtime
18:50technomancywhich most people don't do
18:51lynaghktechnomancy: 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:51technomancywell actually I guess you don't have to actually be using them
18:51technomancyno, I haven't used Datomic
18:51technomancyany services hosted on AWS should be pretty snappy though.
18:52lynaghktechnomancy: 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:52lynaghk(so, worst comes to worst, we pay Amazon an extra $10 and drink a beer while rebuilding everything from text files)
18:55technomancygf3: just posted an overview of what I'm looking for; thanks!
18:56gf3technomancy: Splendid, I'll have a look
18:56kwertiilynaghk: are you guys using c2 in production to replace d3 sites yet?
19:00BorkdudeI read somewhere that a book about clojurescript is coming up
19:00Borkdudeat o'reilly
19:03mwillhitehey 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:04mwillhitei have OPTIONS set up, and I think I'm returning the right headers, but I'm still getting rejected
19:09mwillhiteare there any runtime debuggers for clojure…something where I can set a breakpoint and step through?
19:11Borkdudemwillhite: you can in eclipse I think
19:12mwillhitethanks Borkdude
19:18seancorfieldmwillhite: CDT let's you do that in Emacs/Slime/Swank
19:19seancorfieldit's been rolled into swank-clojure now, as of 1.4.x I believe
19:19seancorfieldyou can set breakpoints on exceptions and function calls, eval in the context of the stack frame, step in / out / over...
19:19lynaghkkwertii: 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:21lynaghkkwertii: 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:21kwertiilynaghk: 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:22lynaghkkwertii: D3 has a lot more in terms of scales and layouts, but what is in C2 is pretty solid.
19:23lynaghkkwertii: at least, we haven't gotten many bug reports---that just might be because the userbase is tiny though =P
19:23ideally_worldhi seancorfield
19:24kwertiilynaghk: 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:24lynaghkkwertii: 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:24lynaghkkwertii: lein cljsbuild is the defacto standard for CLJS, and it's what we use as well.
19:25lynaghkkwertii: C2 runs on the JVM though, and it's plenty fast there.
19:25kwertiihm
19:25kwertiilynaghk: Is cljs-d3 completely dead now?
19:26kwertiiI'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:26lynaghkkwertii: yep. I think two months ago I added a "depreciated" notice to the readme, and that was the last time I touched it.
19:27lynaghkkwertii: 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:27kwertiilynaghk: 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:27lynaghkkwertii: You could give CoffeeScript a shot too.
19:28lynaghkIf you want to use ClojureScript though, just use the plain interop. it's not too bad.
19:29kwertiiI 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:30lynaghkkwertii: 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:30kwertiinot to mention the endless backbone vs spine vs ember vs whatever flamewars
19:31mwillhitecool thanks seancorfield
19:33ideally_worldthe java code formatting in the Clojure codebase is driving me nuts ;)
19:33lynaghkkwertii: 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:34technomancyideally_world: shield your eyes!
19:35ideally_worldno, forking and reformatting/refactoring
19:36madsy,(bit-and (int (* f t 65536)) 65535))
19:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: f in this context, compiling:(NO_SOURCE_PATH:0)>
19:36madsyOps
19:36madsy,(bit-and (int (* 440.0 0.3 65536)) 65535))
19:36clojurebot0
19:47ideally_worldWow, seems like there is a lot of unused Java code lying about...
19:48ideally_worldat least *according* to IntelliJ
20:05dnolenI love patches like this http://dev.clojure.org/jira/browse/CLJS-268?focusedCommentId=28583#comment-28583
20:07emezeskednolen: New warning + fixes found via new warning? Nice indeed.
20:07technomancyis medusa the only option for pooled futures?
20:08dnolenemezeske: that's actually not the first time its happened :) new warnings generally uncover bugs.
20:09emezeskednolen: Yeah, every time a new warning is added, I find something in my closed-source app
20:09emezeskednolen: The wrong # of args warning is super sweet in that regard
20:10dnolenemezeske: 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:10dnolenlower level stuff, but useful.
20:11emezeskeSounds like good stuff!
20:16ideally_worldthere's no way to open and run Clojure's codebase in IntelliJ without mangling at least the version.properties file? :/
20:24ideally_worldodd seeing a Clojure REPL in Intellij's console :)
20:26nDuffEh? Is there nREPL support available there?
20:28ideally_worldnDuff, no, just compile the Clojure codebase in IntelliJ
20:52kwertii2012 and we still have netsplits?
20:53hiredmanthe alternative, according to xmpp, is streaming xml
20:53hiredmanso by all means, netsplits please
20:55kwertiiugh
21:01ideally_worldfinding it very nice thus far...
21:06kwertiiHow about IRC-over-MQ federations
21:07hiredmanthat's the ticket
21:08hiredmankwertii: 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:08hiredmango nuts
21:08kwertiinice
21:09kwertiiunfortunately, 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:10kwertiihiredman: why'd you pick HornetQ as opposed to some other MQ?
21:14hiredmankwertii: easy jvm interop, and embeddability
21:35dnolena little bit of type inference goes a long way - wart removed from CLJS http://github.com/clojure/clojurescript/commit/af5dc7eff95c1e3af269a3fb999d8c4a74f8f147
21:43klauernIs there a place that collects tips and mini-tutorials on Clojure syntax?
21:43gfredericksclojure has syntax?
21:44gfredericksklauern: the clojure.org page on the reader I think has most of the reader forms
21:45klauernI'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:45tomojsuppose you take PersistentHashMap and change the base to 2. how much should this hurt performance?
21:46hiredmanthe branching factor?
21:46hiredmanI would guess "a lot"
21:46ideally_worldklauern, http://clojuredocs.org/quickref/Clojure%20Core ?
21:47tomojit has been argued to me that it should be 5x as slow
21:47ideally_worldthere's some tips on specific functions, but not sure that is what you are looking for
21:47tomojsince log_2(n) = 5*log_32(n)
21:47tomojI think I buy it
21:48klauernideally_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:48TimMcklauern: That's not syntax, those are core functions.
21:48gfredericksklauern: I think what you're asking for is "experience"
21:49tomojwhich 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:49gfrederickstomoj: well you couldn't make it too large; at some point the benefit drops off
21:49klauernI don't know. Why read books if all you need is (find-doc ) ?
21:50gfrederickstomoj: so it's "magical" in the sense that it's better than the other choices; at least I assume it is.
21:50TimMclazybot: You're back!
21:50gfredericksis he??
21:50lazybotgfredericks: Definitely not.
21:51tomojI 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:51TimMc$findfn 3 (range 10) [[0 1 2] [3 4 5] [6 7 8] [9]] ;; klauern: This works in private message. ;-)
21:51lazybot[clojure.core/partition-all]
21:51gfrederickstomoj: log_33 is also practically O(1)
21:52tomojsure..
21:52tomoj5.04x as fast as log_2
21:52gfredericks:)
21:52tomojlog_1024 is only 10x as fast :(
21:53tomojwhat is the bottleneck that makes log_32 practically O(1) now? memory?
21:55gfredericksbottleneck? log_32 is technically slower than O(1), so "practically O(1)" is optimistic, not pessimistic
21:55TimMcHmm, I wonder if there's a good tensor data structure for Clojure...
21:56tomojI mean, I understand "log_32(n) is practically O(1)" to have a hidden clause "as long as n is less than k"
21:56gfredericksk isn't a fixed thing though
21:57nDuffWell -- as long as hardware limitations restrict the maximum size, the worst-case is known
21:57nDuffO(7), I think?
21:57tomojnDuff: yeah, memory limitations?
21:57gfredericksnDuff: yeah; but of course with this kind of argument all of asymptotics becomes trivial
21:57TimMcget thee to a benchmarking suite
21:58gfredericksalgorithm X will run faster than 10^100000 years, therefore X is O(1)
22:01tomojthe 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:02tomojisn't it?
22:02gfrederickswhat are n1 and n2?
22:02TimMcgfredericks: Any algorithm that will provably terminate (successfully) in a given computer's available memory is O(1).
22:02tomojjust two fixed integers
22:02tomoje.g. 1e6 and 1e9
22:02tomojthe number of items in the collection
22:02gfredericksTimMc: why on earth is algorithms an entire class? they're all fast
22:02TimMcWell, some require O(n) space.
22:03TimMcSo those aren't O(1) via that particular sneakiness.
22:03TimMc*O(1) time
22:03gfredericksTimMc: because you can use S3 which has unlimited capacity?
22:03gfrederickswait no way
22:04gfredericksif an alg has constant time it has constant space
22:04gfredericksthe turing machine can only walk so far in a finite time
22:04TimMcRight, but time can exceed space.
22:04tomojif 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:04tomojis that correct? it makes "practically O(1)" just seem totally misleading to me..
22:04TimMcSpace is limited by time, but time is limited by 2^space.
22:05gfredericksTimMc: sure -- either being constant makes both constant
22:06gfrederickstomoj: misleading because there's an increase?
22:06tomojand exactly the same increase as with base 2
22:06tomoj(ratiowise of course)
22:07gfredericksI think the point with "practically" is that with 32 the max hops down the tree is 6 or 7
22:07tomojwell
22:07gfrederickswhereas with 2 it can be...30 or 35
22:07tomojmy example is flawed because it doesn't take 1 minute to do a PHM lookup with 1e6 items
22:07gfredericks6 or 7 feels much closer to 1 in practical terms than 33
22:09gfredericksand for other real-life reasons the 2 is worse than that
22:21wkmanirehe he he, reason to clean the monitor. That was in fact just a period. Not a semicolon.
22:26zxcvis it possible to upgrade the clojure version that comes with "lein self-install"
22:28TimMczxcv: Lein uses whatever it uses. Your project can use something else.
22:28TimMcHowever, if you start 'lein repl' outside of a project, you get whatever lein uses.
22:29zxcvwhat if i want to make a small script without creating a project, is there a way to upgrade the clojure that lein uses
22:30zxcvfor "lein repl" outside projects
22:32TimMczxcv: lein-oneoff, I think.
22:35zxcvTimMc, that's exactly what I want, thanks
22:35y3diwho was lighttable's second corporate sponsor?
22:36brehauttheres 3 now isnt there?
22:36RaynesMassive Dynamic.
22:48amalloytomoj: "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:49amalloyeg, suppose the running times are exactly 2^n and 32^n, respectively
22:49amalloyer
22:50tomojit would've sounded wrong to me 2 hours ago
22:50tomojis it in fact wrong?
22:50amalloyexcept it wouldn't be 32^n. it'd be...something else? log2(n) and log32(n)
22:50tomojyeah
22:50tomojthe expected ratio is log(n1)/log(n2) no matter the base
22:50amalloyokay, maybe you're right
22:51tomojthe trick is that with 32 the running time of a lookup is small enough that the difference is practically negligible
22:51tomojand I guess that 5x that difference isn't negligible!
22:51amalloypsh obviously. five times *anything* is always huge
23:05brainproxytechnomancy: 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:06brainproxydo you know of a project that makes the two work together? i.e. swank-clojure and the rhino backed cljs repl?
23:21evildaemonIs clojure suitable for Android development?
23:22amalloyevildaemon: 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:22amalloyi think sattvik is the one you'd want to ask if you're looking for more details, but i'm not 100% sure
23:22evildaemonamalloy: Ah, okay. Thanks for being honest. That's a real disappointment.
23:23amalloyevildaemon: but clojurescript is another viable option. create javascript and run that instead
23:23amalloyas a webapp, or whatever
23:25gf3Eh, even ClojureScript
23:25gf3Not sure it's ready for prime time
23:25amalloyandroid development is usually not primetime anyway
23:35mikerahi all. anyone know how to embed an arbitrary Java object in generated code that subsequently gets eval'd?
23:35hiredman"don't"
23:36mikerawhy not?
23:37hiredmanmikera: it sort of depends on the context, if you are just passing a simple form to eval it will work
23:37mikerathe problem is that I want tto put a bufferedimage in my form
23:38mikera`(.getRGB [bufferedimage] 0 0)
23:38mikeraas a simple example....
23:38hiredmanwhy?
23:38clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
23:38mikeraworking on clisk (https://github.com/mikera/clisk)
23:38mikeradoes procedural image synthesis
23:39mikeraI'm trying to create a texture mapping primitive
23:39mikerafor the code generator
23:39hiredman:(
23:39hiredmannone of that answers "why do you want to embedded an arbitrary java object in a clojure form to eval?"
23:40mikerawell I'm generating code that generates images
23:40mikeraat runtime
23:40hiredmanok, sure
23:40mikeracurrently doing it by assembling forms that represent the functions that produce the image
23:40hiredmanbut why do you need eval for that?
23:41mikerathen using eval to compile it into a function
23:41hircusfor a Noir web application, what's a good way of loading site-specific configuration from a file on the server?
23:41mikerathe compiled fuinction gets called a few million times with different co-ordinates to generate the image
23:41hiredmanah
23:41brainproxyhooray, 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:42mikerabasically eval is needed for the compile
23:42amalloymikera: you can just compile to `(let [image# (...)] (fn [] (.getRGB image# 0 0))?
23:42amalloyand then if you want to eval that, you can
23:42hircusI'm using Noir and Korma, and I want to define my database and entities only once
23:42hiredmanmikera: what I would recommend is instead of returning `(.getRGB [bufferedimage] 0 0) return (fn [buffered-image] `(.getRGB ~buffered-image 0 0))
23:43hiredmanthen 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:44amalloyyou can't just shove the image into the code, but you can put in code that will generate an image when evaluated
23:45hiredmanamalloy: or generate a function that takes the image as a parameter
23:45mikerahmmmm image as a parameter is a problem
23:45TimMcMaybe you can, with the new reader dispatch *mrmmff MFRMMFMF MMFRMFF*
23:45amalloysure, 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:45mikerasince the top level function that is generated just take x,y,z,t parameters
23:45hiredmanmikera: evaling a call to proxy like that is pretty gross
23:46hiredmanand proxy is pretty slow
23:46mikerayah I have the image already
23:46hiredmanalso maven is pretty gross
23:46mikeraprior to calling the code generator at least
23:46hiredmanmikera: right, the code generator should return a function you can pass the image to
23:47mikerathe syntax I'm aiming for at the top level is something like:
23:47mikera(generate-image (v+ (v* 0.5 (texture-map image1) (v* 0.5 (texture-map image2))))
23:48hiredmanso?
23:48mikerav+ v* and texture-map all produce / return forms
23:48mikeragenerate-image is a generic function that doesn't know about the textures
23:48hiredmanthey should return functions
23:49hiredmanlike what I said
23:49mikerabut then you can't get performance - primitive boxing kills you......
23:49hiredmanno no
23:49mikeraI tried that first :-)
23:49hiredmanthey should return functions that generate code
23:49hiredmanlike what I said
23:50hiredman(fn [buffered-image] `(.getRGB ~buffered-image 0 0))
23:50mikeraah with you now
23:50hiredmanso the code generator can use these functions to generate a single (fn [image] ...) and eval that
23:51mikerahmmm so that would potentially mean many images passed up the tree?
23:51hiredmanyou generate a single function for the transform right?
23:52mikeraactually a vector of functions (red, green, blus components)
23:52mikerabut the principle is the same
23:52hiredmanthe image isn't passed through the functions, the name (symbol at compile time) the image is bound to (at runtime) is passed around
23:53mikeragot it
23:53mikeraI need to give this some though... could be a sizeable refactor
23:53mikeraif everything has to return a function rather than a form
23:53mikerabut might be the best approach
23:53mikerathanks for the ideas!
23:55hiredmanyou 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:56mikeramakes sense. feels more and more like I'm writing a full compiler :-)
23:57mikeraI havd hoped that I could leverage Clojure's compiler to do all that, hence trying to do it all by constructing forms.....
23:57hiredmanif you can you should replace the proxy with reify, proxy has all kinds of overhead
23:57mikeraI'm not using proxy
23:57hiredmanwell, it is like a cross compiler, you have this dsl you are compiling to clojure code, which the clojure compiler compiles
23:58hiredmanhttps://github.com/mikera/clisk/blob/master/src/main/clojure/clisk/core.clj#L19
23:58hiredmanlooks like proxy to me
23:58mikeraoh yes sorry I am at the top level :-)
23:58brehauteven 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:58mikerawhat's the overhead?
23:58mikeradoesn't it just extend the Java class?
23:58TimMcproxy is a lie
23:58hiredmanmikera: it extends the java class in a very dynamic way
23:58brehautproxy has duck typing magic
23:59mikeraah.... would reify work instead in this case?
23:59hiredmannot in this exact case, reify only works with interfaces and protocols
23:59mikerahmmm I can probably make clisk.Function into an interface