#clojure logs

2014-01-19

00:04marcopolo`ggherdov: the clj-webdriver is pretty nice. It's a layer on top of selenium
00:04marcopolo`You can also use phantomjs as a webdriver for headless stuff
00:09ddellacostaggherdov: I've done some testing with clj-webdriver, it works reasonably well but is still young. Lately I've been considering moving to something wholly removed from clojure however, as this is so nice to work with: http://sebuilder.github.io/se-builder/
00:10ddellacostaggherdov: for high-level acceptance tests it's pretty amazing. For everything else, I use clojure.test/clojurescript.test.
00:11carkis there some automated re-testing thing for clojurescript ?
00:11ddellacostacark: what is re-testing?
00:12dsrxregexp-testing? :p
00:12carki mean automated, when the code/compiled js changes
00:12ddellacostacark: if you are using midje, autotest is built in. With clojure.test, you can use prism: https://github.com/aphyr/prism
00:12carkand that works with clojruescript ?
00:13ddellacostacark: not sure about expectations, but maybe it has a similar mechanism. Re: clojurescript, I don't know--I haven't tried prism with clojurescript.
00:14carki'll check it out
00:15dsrxcark: do you already have cljs tests, and you want to re-run them?
00:15dsrxer, auto-run them when your src files change
00:15marcopolo`cark: if you are using clojurescript.test you can add your tests to your cljsbuild
00:16carknot really, but i'm starting to feel i need some tests, and would not do that with some automated way to do it
00:16carkwithout*
00:16carki usually do unit test only for low level data structure code
00:16cark"low level"
00:17carkwe're still talking clojure =P
00:17ggherdovthanks ddellacosta
00:17ddellacostaggherdov: np
00:18ddellacostathere is also https://github.com/reiddraper/simple-check which I haven't tried yet, I guess it is inspired by Haskell's quick-check.
00:18ddellacostaer, QuickCheck
00:18ggherdovbookmarked :)
00:20carkmarcopolo`: yes looks like cljsbuild can help with the building of tests, maybe a short library that reloads the js could be done quite quickly..thanks
00:23marcopolo`reloads?
00:23ggherdovmarcopolo`: forgot to thank you for your reply above -- doing it now :)
00:23carkmarcopolo`: i don't want to launch a browser each time the code changes, i want to see the result as fast as possible
00:23marcopolo`ggherdov: no worries :) you're welcome
00:26marcopolo`cark: gotcha, I think it uses phantomjs
00:26marcopolo`ddellacosta: se-builder is really cool! thanks for that
00:26marcopolo`(inc ddellacosta)
00:26lazybot⇒ 1
00:27ddellacostamarcopolo`: your welcome. :-) I really love it, it saves me so much time...
00:27ddellacosta*you're
00:33dsrxhmmm i wonder if you can use karma with cljs
00:33dsrxeasily, I mean
00:34marcopolo`karma?
00:34jeremyheilerdsrx: you'd at the very least need to swap out the jdbc lib for a js lib
00:34dsrxerrrr
00:35dsrxi don't mean the clj library, i mean the js test runner :)
00:35dsrxsorry, very confusing
00:35jeremyheileroh, hah
00:37marcopolo`is there such thing as cljsbuild hooks? Like a command to run after a build?
00:37dsrxmarcopolo`: it runs your tests in a bunch of targets (local or remote browsers) and aggregates your results in a CLI, so very handy for CI builds
00:37dsrxor if you want to run tests on a mobile device for example
00:38marcopolo`hmmm, I'll look into it
00:44eggheaddsrx: you can run arbitrary commands for your cljsbuild tests if you want
00:44eggheadI was doing phantomjs for a while for example
00:45eggheadhttps://github.com/emezeske/lein-cljsbuild/blob/master/doc/TESTING.md
00:46dsrxoh hm nice, thanks egghead
00:47marcopolo`can you have it always run tests after a compile
01:33arrdemis there a good library for running agents on other hosts?
01:33arrdemI see technomancy's die-roboter, but that seems to be the only remotely capable thing
01:59bitemyapparrdem: wryyyy
02:02arrdembitemyapp: I realized what I had done only after hitting enter...
02:05bitemyapp"arrdem and agents": http://i.imgur.com/0OQRtBb.jpg
02:10arrdembitemyapp: lolz
02:20bitemyappoh MAN
02:20bitemyapparrdem: React.js is practically made for a typed language!
02:21bitemyappthis is gonna be GREAT
02:24arrdembitemyapp: if it's any cosolation we lost the two games you missed
02:24arrdembitemyapp: tidehunter can just get out
02:25bitemyapparrdem: tidehunter is good ban. Game is hard.
02:32arrdemevidently tonight is my night for exploring two year old libraries..
02:32bitemyapparrdem: revise isn't two years old! You take that back!
02:33arrdembitemyapp: I didn't start using that tonight now did I. that was last night
02:36arrdemscrewit. I'm just gonna run my own remote worker solution.
02:39bitemyapparrdem: the rabbit hole is widening to accommodate your sanity.
02:39arrdembitemyapp: <od>you're insane</od>
02:41bitemyappDocumentation for allowed element and attribute types isn't clickable in React.js documentation. MFW
02:42bitemyappHowever, when there is only a single child, this.props.children will be the single child component itself without the array wrapper. This saves an array allocation. -- Without sum types? you're braver than I thought guys.
02:48arrdemokay. do I go with an aleph http stream, or a raw TCP client/server...
02:50bitemyapparrdem: http://avout.io/ http://blog.paralleluniverse.co/post/56519815799/distributed-actors-in-java-and-clojure
02:51bitemyapparrdem: https://github.com/amitrathore/swarmiji http://martinsprogrammingblog.blogspot.com/2012/05/distributed-actors-in-clojure.html
02:51marcopolo`can you have it always run tests after a compile
02:52bitemyappmarcopolo`: http://www.gnu.org/software/make/
02:52marcopolo`that was weird, that was something i typed a while ago
02:53bitemyappmarcopolo`: compile:\nlein uberjar\n\ntest: compile\nlein test
02:53marcopolo`but thanks for the super fast reply
02:53bitemyappmarcopolo`: `make test`
02:56arrdembitemyapp: thanks for the links, I find none of these to be incrementally simpler than rolling my own atop aleph.
02:56bitemyapparrdem: really? I figured avout would be pretty straight-forward.
02:56bitemyappOTOH, I guess some people would find zookeeper kinda hateful.
02:57bitemyappoh my god why am I writing JS willingly?
02:57xuseryou know you like it
02:57arrdemI mean the problem I'm trying to solve is bloody simple: one host has a queue of tasks to be done, others poll looking for work. I could encode this with a multi-host atom (why bother) or I could just have a server streaming the next piece of work with aleph.
02:57bitemyappxuser: no, I like *Fay*
02:58bitemyappxuser: I just like making toys for Fay.
02:58bitemyapparrdem: how many machines are you working with?
02:58arrdembitemyapp: probably six or eight...
02:58bitemyappI'm surprised it isn't more worth your time to figure out something faster on a single machine.
02:58clojurebotHuh?
02:59bitemyappclojurebot: fay |is| awesome and makes frontend more fun.
02:59clojurebotIn Ordnung
02:59bitemyapp~fay
02:59clojurebotfay is awesome and makes frontend more fun.
02:59bitemyappdamn straight.
02:59arrdemlol
03:00arrdemhum... if my bound is fetching data from the website... I could probably pipeline this some more on one host...
03:01bitemyappsaw some people on identi.ca wringing their hands over the renaming of the nodejs binary from node to nodejs. I was puzzled why anybody cared if the lives of node programmers were convenient or not. I can only assume it means node users don't understand how symlinks work.
03:01bitemyapparrdem: I didn't know that was your bound. I thought the db-client was choking via thread-pool.
03:02arrdembitemyapp: if I'm using blocking writes, then my bound is that I can't do more than about 50 parallel page fetches before I get rate limited by the server.
03:02arrdembitemyapp: that then maxes me at 50 workers waiting on DB transactions so that I don't blow the pool.
03:02bitemyapparrdem: you should be able to run a lot more threads concurrently than 50.
03:03arrdembingo, if I can prefetch the web data.
03:03arrdemwhich should be trivial...
03:04bitemyapparrdem: so rejiggering it into a dataflow, then distributing?
03:04bitemyappI'm just thinking of the losses and unreliablity from talking to other servers and cringing.
03:06arrdemyeah fuckit I'll just have a queue of prefetched pages and a worker thread fetching monotonically fast as it can.
03:07bitemyapparrdem: I would be sorely tempted to start firing off futures with a counter just to see how long it took before it broke.
03:08arrdembitemyapp: since it'll entertain you, lets see if I can kill this thing with run-async again...
03:09bitemyapp yisss. death.
03:14arrdembitemyapp: I started failing to fetch pages before I pushed over the write queue.
03:14bitemyapparrdem: wait what.
03:14bitemyappI don't even
03:14bitemyapparrdem: you are having the hardest time I've ever seen anybody have with this.
03:15arrdemokay. so here's the now vs then.
03:15arrdemnow I have a threadpool of 50 workers.
03:15bitemyappI'm actually kind of impressed, usually I'm the instability plague-bearer but it's a relief to know I've passed the curse onto somebody else.
03:15arrdemeach one fetches its own HTML, parses it, destructures it and writes it to the db.
03:15arrdemthe rate at which these guys run is mainly bounded by writing back to the database: a bound which is removed if I do async writes
03:16bitemyapparrdem: how large is the content?
03:16arrdembitemyapp: this means that I can massively out-rate my source with this model
03:16bitemyappbut in this scenario, why would you begin to fail to fetch web pages?
03:16arrdemthe host begins to ratelimit me with 503s
03:17bitemyapparrdem: what's your I/O on the db-side?
03:18arrdembitemyapp: not an issue. until I hit the datasource's rate wall I hit over 1k W/s
03:18bitemyapparrdem: so the problem is you're going too fast and overloading the data source?
03:19arrdembitemyapp: correct. originally I was extremely slow and serial in my access to the websource. now I'm parallel and really friggin fast.
03:19bitemyappyou keep seeming to change what the actual problem is so I can't really get a clear picture of what's holding you up at the moment.
03:19bitemyappokay.
03:19bitemyappso rate-throttle
03:19arrdemworking on it...
03:19bitemyappassuming you do so, do any problems remain?
03:19arrdemwe'll have to find out the hard way..
03:22dissipateanyone know if Luminus (http://www.luminusweb.net/) is a good web framework?
03:23bitemyappdissipate: it's not a framework per se, more of a project template and way to learn standard Clojure web dev.
03:25dissipatebitemyapp, standard Clojure web dev as in Ring and Compojure?
03:25bitemyappdissipate: yes
03:25dissipatebitemyapp, i see, cool.
03:25TEttingerCaribou actually is a framework, right?
03:25TEttingerdon't know if it's good, haven't used it myself
03:26bitemyappframework'ish.
03:26bitemyappit has components.
03:35logic_progI find it easier to use larger fonts (rather than high resolution fonts on a tiny screen). Now that the 17" mbp is no longer available, what is a good laptop to code on?
03:35bitemyapplogic_prog: dinkbook
03:35logic_progcna't find it on google
03:35bitemyapplogic_prog: with noob-boob-tu installed
03:35logic_progis this a joke ?
03:36bitemyapplogic_prog: don't make fun of me just because I have a code and a stuffed node.
03:36logic_progif there was a distro named noob-boob-tu, I'd probably use it
03:36bitemyapplogic_prog: say it out loud, then all will make sense.
03:37`cbp_a thinkpad
03:37`cbp_hurry get them before they turn them into tablets too!
03:37bitemyapplogic_prog: yeah, that.
03:37logic_progI don't see a 17" thinkbook
03:38ddellacostaTEttinger: read through a bunch of the docs now. Really seems like Rails built in Clojure.
03:38logic_progddellacosta: is this pedestal of halon ?
03:38bitemyappddellacosta: considering mr. smith works for a consultancy...
03:39ddellacostalogic_prog: what's halon?
03:39logic_proghalon = http://hoplon.io/
03:39bitemyapplogic_prog: good lord is that a stretched analogy. Don't ever do that again.
03:39ddellacostabitemyapp: are you talking about this gent? https://github.com/noisesmith
03:39bitemyapplogic_prog: Orwell is spinning in his grave ya sadist.
03:40bitemyappddellacosta: possibly? probably? justin_smith in IRC.
03:40ddellacostabitemyapp: oh, justin_smith is associated with Caribou? Didn't know that!
03:40clojurebotAck. Ack.
03:40bitemyapp~justin_smith
03:40clojurebot
03:40bitemyapp...
03:40TEttingerlogic_prog, I have seen a bunch of QuadHD (better than 1080p) display laptops on techbargains lately
03:40bitemyapp~justin_smith
03:40clojurebot
03:40bitemyappddellacosta: so I thought.
03:40TEttingerahha
03:41ddellacosta~bitemyapp
03:41clojurebotbitemyapp is unfuck your stack with monads!
03:41ddellacostahahaha
03:41ddellacosta~ddellacosta
03:41clojurebotTitim gan éirí ort.
03:41ddellacostawhat does that mean
03:42bitemyappclojurebot: ddellacosta |showers| daily and thus avoids zen stink.
03:42clojurebotAlles klar
03:42ddellacostahuh, seems rather rude
03:42bitemyappddellacosta: it means, "beg your pardon?"
03:42ddellacostaah
03:42bitemyapp~ddellacosta
03:42clojurebotddellacosta showers daily and thus avoids zen stink.
03:42ddellacostaI just looked it up here: http://www.ireland-information.com/irishphrases.htm
03:43ddellacostabitemyapp: why did you put |showers| between pipes like that?
03:43bitemyappddellacosta: oh, weird. usually it says "beg your pardon?" in Irish.
03:43bitemyappddellacosta: that verbs it.
03:43bitemyapplook.
03:43bitemyapp~ddellacosta
03:43clojurebotddellacosta showers daily and thus avoids zen stink.
03:43bitemyappso that it doesn't have to be "is"
03:43ddellacostabitemyapp: ah, thanks
03:43ddellacostaI wonder if it can handle non-Latin characters
03:44arrdembitemyapp: rate limited to 5 gets per second.. holding 115 writes/sec with no apparent memory leaking...
03:44ddellacostaclojurebot: ddellacosta 疲れた
03:44clojurebotTitim gan éirí ort.
03:44bitemyappddellacosta: gotta provide a verb.
03:44ddellacosta~ddellacosta
03:44clojurebotddellacosta showers daily and thus avoids zen stink.
03:44bitemyappddellacosta: SOV could really fuck you here.
03:44bitemyappddellacosta: no, it gave you an error again.
03:44TEttingerlogic_prog: http://www.techbargains.com/news_displayItem.cfm/385841 is very similar to the one I'm on now, but I'm not a normal typist (I do what is basically a blind hunt-and-peck on memorized key positions), so the keyboard quality may be different for you
03:44ddellacostaclojurebot: ddellacosta is super 疲れた
03:44clojurebotAlles klar
03:44ddellacosta~ddellacosta
03:44clojurebotddellacosta showers daily and thus avoids zen stink.
03:44ddellacostanope
03:45ddellacostaso, what is confirmation that it got it?
03:45TEttingerit chooses a random one
03:45logic_progTEttinger: I've tried an laptop like that before
03:45bitemyappddellacosta: in a foreign language.
03:45logic_progI hate non-centered keyboards
03:45TEttinger~TEttinger
03:45clojurebotCool story bro.
03:45bitemyappddellacosta: you just need to know the responses.
03:45logic_progthe "number pad" on a laptop seems weird
03:45ddellacostahmm.
03:45bitemyappclojurebot: TEttinger |surprisingly| is not a Stasi spy.
03:45clojurebotIk begrijp
03:45bitemyapp^^ see.
03:45TEttingerclojurebot: TEttinger |writes| really hideous clojure
03:45clojurebotOk.
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46ddellacostawhat
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46bitemyappdamn you.
03:46TEttingerheehee
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46bitemyappclojurebot: TEttinger |surprisingly| is not a Stasi spy.
03:46clojurebot'Sea, mhuise.
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46bitemyapp~TEttinger
03:46clojurebotTEttinger writes really hideous clojure
03:46bitemyappI give up.
03:46bitemyappSorry for the noise.
03:46bitemyappnow I'm just grumpy it faulted with a false confirmation.
03:47ddellacostahaha
03:47ddellacostaah well.
03:47TEttingerwhat noise, that was only 16 nick pings
03:47bitemyappddellacosta: I've noticed searching for anything like "tired" in Japanese always brings up cute pictures.
03:47ddellacostabitemyapp: seriously?
03:47bitemyappddellacosta: try it.
03:47bitemyappddellacosta: I googled.
03:47TEttingertired-chan
03:47ddellacostabitemyapp: I would guess that, searching for most anything in Japanese brings up 1) cute pics, 2) porn, 3) cute porn
03:47ddellacostatired-chan, haha
03:47bitemyappddellacosta: makes sense.
03:48ddellacostaseriously, it's amazing what will bring up porn.
03:48bitemyappTEttinger: I can do Katyusha in IRC pings if you like
03:48logic_progclojurebot: logic_prog |is| awesome.
03:48clojurebotYou don't have to tell me twice.
03:48bitemyappddellacosta: trying to look up rhyme nursery lyrics in Japanese must be really treacherous.
03:48logic_prog~logic_prog
03:48clojurebotlogic_prog is awesome.
03:48bitemyapp~forget logic_prog is awesome.
03:48clojurebotIn Ordnung
03:48bitemyapp~logic_prog
03:49clojurebotlogic_prog is awesome.
03:49ddellacostabitemyapp: ha
03:49bitemyappwhy do I even bother?
03:49`cbpu bad at this
03:49logic_progha
03:49ddellacostaclojurebot: clojurebot is broken
03:49clojurebotRoger.
03:49arrdembitemyapp: I friggin wrote you an article on how to use forget
03:49ddellacosta~clojurebot
03:49arrdembitemyapp: y u fail so hard
03:49clojurebotclojurebot will become skynet
03:49TEttingerclojurebot: bitemyapp |licks| batteries.
03:49clojurebot'Sea, mhuise.
03:49ddellacostadamnit
03:49bitemyapp~bitemyapp
03:49clojurebotbitemyapp is it amuses me to mock other peoples' gods
03:49bitemyappclose enough.
03:49ddellacostahahaha
03:49logic_progclojurebot: logic_prog |is| so clojure much awesome such macro wow!
03:49clojurebot'Sea, mhuise.
03:49logic_prog~logic_prog
03:49clojurebotlogic_prog is awesome.
03:50TEttingerhaha this is like 2 screens of spam
03:50ddellacostaoh, so you always need the pipes, I failed to grasp that
03:50ddellacostaclojurebot: ddellacosta |is| いない
03:50clojurebotYou don't have to tell me twice.
03:50ddellacosta~ddellacosta
03:50bitemyapp~ddellacosta
03:50clojurebotddellacosta is super 疲れた
03:50clojurebotddellacosta showers daily and thus avoids zen stink.
03:50ddellacostawhat
03:50bitemyappperfect.
03:51ddellacostaheh
03:51arrdembitemyapp: cranked it up to 128 workers with the same 5/1s rate limit on gets... doing about 275 writes/sec stable...
03:51logic_progclojurebot: logic_prog |so| clojure much awesome such macro wow!
03:51clojurebot'Sea, mhuise.
03:51logic_prog~logic_prog
03:51bitemyapparrdem: "now you're thinking with pipes!"
03:51clojurebotlogic_prog is so clojure much awesome such macro wow!
03:52arrdembitemyapp: okay lets see if I can replicate that 400 write/second number..
03:52bitemyapparrdem: I'm greatly enjoying the vicarious mad-science.
03:53arrdembitemyapp: we're all mad here
03:53bitemyapparrdem: oh...I can think of madder.
03:53logic_progclojurebot: pi |is| 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 82148 08651 32823 06647 09384 46095 50582 23172 53594 08128 48111 74502 84102 70193 85211 05559 64462 29489 54930 38196 44288 10975 66593 34461 28475 64823 37867 83165 27120 19091 45648 56692 34603 48610 45432 66482 13393 60726 02491 41273 72458 70066 06315 58817 48815 20920 96282 92540 917
03:53clojurebotIn Ordnung
03:53logic_prog~pi
03:53clojurebotpi is 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 82148 08651 32823 06647 09384 46095 50582 23172 53594 08128 48111 74502 84102 70193 85211 05559 64462 29489 54930 38196 44288 10975 66593 34461 28475 64823 37867 83165 27120 19091 45648 56692 34603 48610 45432 66482 13393 60726 02491 41273 72458 70066 06315 58817 48815 20920 96282 92540 917
03:53logic_progin case anyone ever needs to use pi
03:53ddellacostaum
03:54arrdemlolz?
03:54`cbpsorry but im a tau person
03:54arrdembitemyapp: halving the wrate limit only bumped it up a little bit... better throw more workers at it..
03:55bitemyapparrdem: you're not doing this by C-c'ing and lein run'ing over and over are you?
03:55arrdemawright. 256 threads.. show me what you're built of Awaited...
03:55bitemyappnice round number.
03:56arrdemcaptain, we have 500 writes/second
03:56arrdemarse I'm 503ing again.
03:56bitemyappyou made it mad.
03:56arrdemI should really re-design this around a queue which does incremental backoff on the rate limit..
03:57arrdembut mad science is way more fun
03:57bitemyapparrdem: how long is it going to take at 300/second?
03:57bitemyappback-pressure ist gut.
03:57arrdembitemyapp: well... if nothing explodes I've already reached 2010 from 2008.
03:58arrdembitemyapp: so it should finish overnight.
04:01bitemyapparrdem: http://i.imgur.com/lGGWYtE.jpg
04:01arrdembitemyapp: thank you for the 3am doge
04:01arrdemwarms what I call a heart
04:03arrdembitemyapp: well I've managed to kill something...
04:03arrdemnot sure how to inspect the JVM internal contension however...
04:04bitemyapparrdem: a profiler.
04:04arrdemyeah.... lemme switch back to synchronous writes and see if this goes away...
04:18arrdembitemyapp: http://i.imgur.com/xg7HaX8.jpg
04:18arrdemI just lost it
04:19bitemyapparrdem: laft.
04:19bitemyappaut lawd.
04:19bitemyapparrdem: also applicable: Haskell, Erlang.
04:20arrdembitemyapp: heh. yeah it's definitely something with run-async.
04:21ddellacostaarrdem: yah, a functional language would have packed more punch there, but still, quite funny
04:22bitemyappddellacosta: agree.
04:25arrdembitemyapp: RethinkDB wins forever. I just added a replica while writing and nothing broke.
04:29bitemyapparrdem: :)
04:40quizdrTwo threads walk into a bar. The barkeeper looks up and yells, "hey, I want don't any conditions race like time last!"
04:44stirfoowoohoo! 4 hours later I got glDrawElements to work
04:44stirfoohad to fish around the LWJGL source
04:44quizdrcongrats stirfoo i know how messy gl can be
04:45stirfooaye, but wrapping gl with clojure *is* kinda fun
04:46carkstirfoo: so what was the trouble ?
04:46stirfooendiannessness for one, and I had to flip the buffer
04:46carkhuh
04:46carkare you on mac ?
04:47stirfoobyte ordering
04:47stirfoolinux
04:47carkstrange
04:47stirfooactually, no I didn't have to flip the buffer, but lwjgl seems to requre that, given some examples I found
04:48stirfoohttps://github.com/LWJGL/lwjgl/blob/master/src/java/org/lwjgl/BufferUtils.java
04:49stirfoothat first createByteBuffer fn did the trick, I wasn't calling order
04:51stirfooare float, double, etc sizes always fixed in Java? even for 32bit vs 64bit operating systems?
04:51carki think so yes
04:53carki'm currently reviewing some old gl2 java code i have, i don't see any fliping or "native" anywhere
04:54stirfoo(.flip buf) or (.rewind buf)
04:55carkohwell, that'll remain a mystery to me =)
04:55stirfooI need to experiment with java.nio.*Buffer more
04:56carkyou need to go to later opengl versions, there is so much oportunity for speed
04:57domino14i created a utils/vector_math.clj in my current directory
04:57stirfoowell, actually for rendering meshes, glDrawElements is pretty fast
04:57domino14(ns euler-144 (:require [utils.vector_math :refer [magnitude dot cos-theta euclidean-distance]]))
04:57carkstirfoo: but you'll have to construc your buffer each time
04:58domino14what is wrong with that? it tells me Exception No namespace: utils.vector_math clojure.core/refer (core.clj:3832)
04:58stirfoocark: true
04:59carkstirfoo: with later versions you send your buffers (separated by use like texture coords or vertex position etc) to the gpu, then only update the ones that change each frame
04:59carkdomino14: what's your directory structure ?
04:59domino14i have a folder named utils and in it a file named vector_math.clj
05:00domino14and i'm in the same directory as the utils folder
05:00stirfoo- not _ ?
05:00stirfoo@ domino14
05:00domino14file names should have dashes too?
05:00carkyour ns form should say vector-math
05:01carkdon't change the file name
05:01stirfoomodule names have _, references to those have -
05:01domino14java.lang.Exception: No namespace: utils.vector-math
05:01domino14do i need to put anything special in my utils/vector_math.clj file?
05:02carkazre you using lein ?
05:02carki mean, how are you compiling ?
05:03carkor launching the repl
05:05domino14got it, i needed to (ns utils.vector-math) in my vector_math.clj file
05:05domino14yes was using lein exec plugin
05:05domino14nite nite
05:05carkahh :)
05:06stirfoonite cark, maybe you can talk me out of the 90's with opengl =)
05:06stirfoothanks for the suggestions
05:06carkstirfoo: gnight
05:38alewwhat's up with hoplon?
05:57Glenjaminjust heard Rich Hickey pronounce "EDN" as "eden" instead of "E-D-N" - is that common?
06:05lvhalew: I don't know. I want to like it, I guess, but there's not enough docs for me to consider it :)
06:23quizdrwhy does (doc letfn) say it is a special form, when the source shows it as a macro?
06:25Raynes&(doc letfn)
06:25lazybot⇒ "Macro ([fnspecs & body]); fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+) Takes a vector of function specs and a body, and generates a set of bindings of functions to their names. All of the names are available in all of the definitions of the functions, as well as the body."
06:26quizdr,(doc letfn
06:26clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
06:26quizdr,(doc letfn)
06:26clojurebot"([fnspecs & body]); fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+) Takes a vector of function specs and a body, and generates a set of bindings of functions to their names. All of the names are available in all of the definitions of the functions, as well as the body."
06:26quizdrhm on mine it shows it as a Special Form
06:26RaynesEh, it's because they have different doc macros.
06:27RaynesThe source does not show it as a macro.
06:27RaynesI mean, it does
06:27RaynesBut it's :special-form true
06:27quizdrso letfn is not a special form, it's a macro? the metadata is there to say it is a special form when it really isn't? why would that be?
06:28RaynesBecause it translates directly to a special form.
06:28RaynesThat's the only reason I can think of/
06:28quizdrwhat is let* and letfn* and why are they not in the core API docs?
06:28quizdri see them all the time in source
06:28RaynesThey
06:32RaynesDamn keyboard
06:32RaynesI'm at a terrible angle. :p
06:32quizdrha i was trying to figure out what you meant
06:32Raynesquizdr: They are the actual special forms. If you look at the source for the macros, they're very simple wrappers around them.
06:32RaynesYou can't associate docs with a special form
06:32RaynesSo if the macros weren't there, there wouldn't be any documentation to say they are special forms, etc.
06:33RaynesIt makes sense to just pretend that the macros are special forms, because it makes no practical difference.
06:33RaynesMacros without the special forms couldn't do what the special forms do. As such, they aren't just normal macros.
06:33RaynesThey're specifically the only way to do certain things
06:34quizdrare you referring to let* and letfn* now, or to letfn.
06:34RaynesThey are quite special in that regard.
06:34RaynesThe macros are the leftfn, let, etc.
06:34RaynesThe special forms are letfn*, let*
06:34quizdrah, ok.
06:35quizdrso the docs for letfn would essentially be the same docs as for letfn*
06:35RaynesYes. But you have no real reason to use letfn* directly
06:41quizdrand also no reason to use let* i'd image, right?
06:41quizdr*imagine
06:50quizdri guess letfn is similar to common lisps "labels"
06:54AeroNotixhow do I typespec something which is a generic type?
06:54AeroNotixi.e. ArrayList<T> in java
06:58carkAeroNotix: you don't ... due to type erasure ArrayList<T> is just ArrayList
06:59AeroNotixthat's what I was worried about
06:59carkwhy ? just use ArrayList and you're good
06:59AeroNotixwell, I wanted mo' documentation really
07:00khaledo/
08:20rurumate,#=(inc 1)
08:20clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
08:28rurumatewill (defn add5 [n] (+ #=(+ 4 1) n)) have better performance than (defn add5 [n] (+ (+ 4 1) n)) ?
08:28corecodebenchmark it?
08:29rurumatecorecode: benchmarks seem to show that the performance is the same, but I cannot benchmark every time I calculate a constant in my code
08:30rurumatethe question is, is the compiler smart enough to replace closed expressions with constants?
08:30rurumatei.e. expressions with no free variables, like (+ 4 1)
08:32funkotronrurumate: how does the compiler know which expressions are closed?
08:33hyPiRionfunkotron: by checking whether they have any free variables
08:34hyPiRionrurumate: I think you effectively will get the same performance, due to JIT optimisation
08:36rurumateyes.. but it would be nice to be sure about these things. For instance, is it still true on openjdk? I was hoping the clojure compiler would just evaluate closed expressions
08:38rurumatethat's why I was trying =# but it seems its behaviour depends on the value of *read-eval*, which makes it less predictable
09:06ddellacostais java.lang.Math/log the idiomatic way to do logarithmic calculations?
09:07ddellacostaoh, I see that's the natural log
09:36jonathanjso the analyzed-patients function in this section seems to have an error: http://www.braveclojure.com/functional-programming/#2__Living_with_Immutable_Data_Structures
09:37jonathanj`analyzed?` is not defined anywhere
09:37jonathanjwhat should that code read instead?
09:40jonathanjoh, i think that's just some not-implemented-here function
09:40insamniacThat's what I'm guessing after looking at it..
09:40insamniacnot a function you can just paste into your repl
09:42jonathanjlooking at the Javascript example, what would be a reasonable implementation of `analyzed?`? (defn analyzed? [patient] (:analyzed patient))
09:42jonathanjperhaps?
10:32ProfpatschIs there something like cond for maps, taking only specified keys out of the map?
10:33ProfpatschI tried (condp contains? the-map :foo "result" :bar "other result") but contains takes the arguments in the wrong order for that.
10:37pmlarocque(apply dissoc {:foo 1, :bar 2, :baz 3} [:foo :bar]) ?
10:37dnolenProfpatsch: just write a swap helper that flips the contains? argument order
10:38dnolen(condp (swap contains?) the-map ...)
10:39ProfpatschOh, right, I could do that.
10:39Profpatsch#(contains %2 %1) ?
10:39dnolenProfpatsch: yep
10:39ProfpatschMan, this is high-level stuff…
10:39ProfpatschComing from Java and Python land.
10:40ProfpatschA little elisp, but not too functional.
10:40dnolenProfpatsch: you could do it in Python, but being so functional is not generally considered idiomatic I think.
10:41ProfpatschI noticed half of my Python code was list expressions, so the question was: Why not write in a functional language in the first place? :)
10:43ProfpatschStill, you can’t replace Python for Gtk3 stuff. And I don’t know Haskell yet.
10:44ProfpatschAnd I don’t know if doing WIMP monad-style is such a great idea.
10:46ProfpatschIs there any project that aims for a functional wrapper around the java bindings of Gtk?
11:08ProfpatschSo, this is the best I came up with: (condp #(get %2 %1) {:foo 42} :foo :>> identity) returns 42.
11:09ProfpatschIs there an easier way to do it?
11:10ProfpatschThis is for side-effects.
11:12ProfpatschOh, condp is short circuiting, so it doesn’t make much sense. oO
11:12BronsaProfpatsch: what about ##(select-keys {:a 1 :b 2 :c 3 :d 4} [:a :d])
11:12lazybot⇒ {:d 4, :a 1}
11:14ProfpatschI guess that makes more sense, with a map afterwards. Yeah, thought in the wrong direction.
11:15BronsaProfpatsch: if you want to execute side effects on specific keys on a map you could so something like
11:15Bronsa(mapv (fn [[k v]] (({:b println} k identity) v)) {:a 1 :b 2 :c 3})
11:15Bronsa(mapv (fn [[k v]] (({:b println} k identity) v)) {:a 1 :b 2 :c 3})a,
11:15Bronsa,(mapv (fn [[k v]] (({:b println} k identity) v)) {:a 1 :b 2 :c 3})
11:15clojurebot2\n[1 3 nil]
11:16Bronsaor something similar with a doseq
11:16Bronsa,(doseq [[k v] {:a 1 :b 2 :c 3} :let [f ({:b println} k)] :when f] (f v))
11:16clojurebot2\n
11:40jitais there any web framework in clojure which is equivalent to django in python ?
11:41lvhjita: If by that you mean "comes with everything" then no
11:41lvhring is the standard thing, but it's fairly low level. people have built higher level things on top of that.
11:41dnolenjita: probably caribou, http://let-caribou.in
11:42lvhvery few of them tell you how to do everything (templating, routing, orm...) as django does; no major ones I know of
11:42dnolenlvh: caribou does a lot of stuff, it's very Django/Rails-eseque
11:42ambrosebsBronsa: I had a quick play with t.a.j yesterday. Stunning what you've done, very impressive.
11:42jitalvh: I am looking for rapid web development framework
11:42dnolenjita: it's not quite as fancy as Django, but that's a good thing IMO
11:43jitadnolen: i will have a look, thanks for suggestion
11:43dnolenjita: at some point Pedestal might offer a more complete solution too but it's in flux.
11:44jitaok thanks
11:44Bronsaambrosebs: thanks! it's really close to a stable release
11:44ambrosebsBronsa: great!
12:06l1xjita: Ring / composure gives you enough to get started there plenty of templating libs as well
12:07l1xand i like safari's spellchecker
12:08jitaok thanks
12:08jitaCan someone recommend me a good book for clojure too ?
12:16ProfpatschWhat’s the difference between put! and >!?
12:17Profpatsch(let [c (chan)] (put! c 4) (go (.log js/console (<! c)))) does work as expected.
12:18ProfpatschI’d expect (let … (go (>! c 4) (.log … (<! c))) to have the same effect, but it doesn’t! Why is that?
12:19ProfpatschI just hope dnolen is still here. :)
12:20dnolenProfpatsch: that's not going to work. I suggest reading up on core.async a bit more before diving into it
12:20dnolenProfpatsch: there's a good video from the Conj as well one that I did
12:20dnolenProfpatsch: short story, >! <! are blocking operations
12:20dnolenjita: O'Reilly book is good
12:21ProfpatschOkay, gonna do that. I did read all that stuff and watch your video, but I always make the mistake of not directly trying out what I heard. So I forget most of it again. ;(
12:21ProfpatschYou’re an entertaining speaker btw.
12:21dnolenProfpatsch: thx
12:21jitadnolen: is it better than "programming clojure"
12:21dnolenjita: IMO yes
12:22noonianthat would work if each blocking op was in a different go block right?
12:22dnolennoonian: that is correct
12:22noonianthanks
12:23jitadnolen: thanks
12:31Profpatschdnolen: @blocking operators: I got that, but why would (>! c 4) block the go thread? It puts a value on c and then <! immediately takes it again. So why would anything block?
12:31dnolenProfpatsch: what you just said is contradictory :)
12:32dnolenProfpatsch: >! <! are blocking operations plain and simple. Everything falls out of that.
12:32bbloomProfpatsch: you can only put things in a buffer, if there is no buffer, somebody has to take it from you
12:32bbloomProfpatsch: So when unbuffered >! and <! block until the sender and receiver are blocking together
12:33ProfpatschOhhh, I get it. I somehow assumed that (chan) creates a buffer with one slot.
12:33ProfpatschBut of course it doesn’t.
12:33noonianexecution never reaches the call to read because the call to put blocks
12:35ProfpatschDo blocking channels take any cycels btw? I guess they have to loop internally to see new input, right?
12:35Profpatsch*cycles
12:35Profpatsch* use any cicles. Ugh.
12:36ProfpatschOkay, now I did a mistake in every correction. What’s going on with me‽
13:20RickInAtlantaI am reading the reasoned schemer right now, and in chapter 2 they have a function eqo. does anyone know the core.logic equivelant?
13:21insamniacI bet dnolen does!
13:22insamniacI actually just bought that book too.
13:22dnolenRickInAtlanta: I don't think so, but easy enough to implement. I thought eqo was just unification anyhow
13:22RickInAtlantaok, thanks. I will play with it some
13:22insamniacdnolen should get a cut from The Reasoned Schemer sales.
13:24RickInAtlantaI should have turned the page
13:24RickInAtlanta(defn eqo (fn [x y] (== x y)))
13:26ior3kdnolen: sorry if someone has asked this of you already... do you use light table as your primary development environment?
13:32ior3ks/of //. I knew there was something wrong with that...
13:32dnolenior3k: no not yet, but it's pretty compelling. support for plugin development now is pretty rough, I think when those issues get resolved I think LT will really take off.
13:33RickInAtlantadnolen: did you see Chris's tweets about the other language plugins being written
13:33dnolenRickInAtlanta: yes I follow ibdknox
13:34RickInAtlantaIt was cool to see Don Syme's tween about F# support
13:35ior3kdnolen: thanks. It felt a bit rough to me, and seems to be single window centric, so I'll wait a bit more before taking another look
13:35dnolenior3k: I use Emacs so single window doesn't really bother me much
13:36dnolenRickInAtlanta: yes it was
13:36ior3kdnolen: I use emacs too, but I use multiple frames (tiling wm)
13:37dnolenior3k: tabsets accomplish the same thing, but there's isn't vertical tabset support yet
13:37dnolenin LT
13:37dnolenior3k: oh sorry multiple frames
13:37dnolenior3k: yeah got it
13:38ior3kdnolen: yeah sorry about the interchanging of terms :)
13:41l1xjita: there are 3 or 4 clojure books out there, i have read all of them, and each one is good for different things
13:42jital1x: which one do you recommend for a beginner in functional language?
13:42l1xhuh, great question
13:42RickInAtlantathx again for help
13:42RickInAtlantagotta run
13:47l1xclojure is kind of two fold story, there is the Java/JVM part and there is the LISP part, if you want to learn how to LISP I would recommend to read http://mitpress.mit.edu/sicp/ if you learn how to utilize the JVM best from Clojure probably Programming Clojure (Halloway & Bedra), if you want to see how deep the rabbit hole goes with Clojure than you should
13:47l1xread "The Joy of Clojure"
13:48l1xthere is the 3rd book, "Clojure Programming" that is not my favorite book, because the examples are kind of cryptic and hard to understand, but it covers everything, you can use it sort of like a reference book
13:49ProfpatschHow would you do unique IDs?
13:50bbloomProfpatsch: depends on what you mean by "unique"
13:50bbloomunique globally? per process? per thread?
13:51ProfpatschAh, right. Easiest would be to use UUIDs, but there’s no function for it (at least not in cljs).
13:51ProfpatschI thought something like an auto-incrementing value would suffice. But: atom, ref or something else?
13:52bbloomProfpatsch: uuid only makes sense if you need global uniqueness
13:52bbloomif you're doing cljs, there is only really one thread anyway, so process unique == thread unique
13:52bbloomi'd probably just use an atom with a number in it
13:52ProfpatschWell, since they are not very costly to generate, I tend to use them everywhere.
13:53ProfpatschSo (def ^:private *id-count* (atom))?
13:53bbloomProfpatsch: the *earmuffs* usually mean :dynamic
13:53bbloomProfpatsch: the atom function takes an initial value argument
13:53ProfpatschOh, right, the def is not changing, the atom is.
13:53bbloombut yeah, that's one solution
13:54bbloomyou can (swap! id-count inc) and use the return value from that
13:54ProfpatschYep.
13:54ProfpatschThanks, got it.
14:35arrdembitemyapp: this is why you don't let me do mad science.... I managed to push it to 1.1K writes/sec...
14:36jitaWhich IDE/text editor is mostly preferred for clojure development ?
14:37arrdemjita: emacs
14:38jitaarrdem: can one do professional coding using a basic text editor like sublime text ?
14:38bbloomjita: choose whatever you're most comfortable with while learning the language. you don't want to be learning a language and an editor at the same time
14:39arrdemjita: bbloom gives good advice here. you can of course use another text editor. I mention Emacs only because it has in my experience the best REPL integration. it is by no means the only editor therewith however.
14:39jitabbloom: I am familiar with Sublime text and it has good support for python too, it has linter and syntax highlights for python, dont know about clojure though
14:39Glenjaminit can mostly highlight clojure
14:39Profpatschjita: If you want to learn the language I very much advise you to use LightTable.
14:39arrdemjita: I didn't pick up Emacs until long after I had come to Clojure, so I cannot comment on learning both at once.
14:39lvhEmacs is pretty great as a basic text editor too, though; especially if you leave menu bars on
14:40lvhmaybe paredit is kinda weird.
14:40bbloomjita: if you're used to what i'd call "modern graphical osx text editors" then you will probably find light table to be highly approachable & has great clojure support
14:40bbloomjita: otherwise, i'd recommend just using what you know and copy/pasting in to your repl until you get the hang of the basics
14:41jitathanks a lot for suggestions, much appreciated. I will definitely look into LightTable
14:41Profpatschjita: I am a heavy Vim and Emacs user and tried LightTable only a few days ago (after integrating Clojure into Emacs as good as possible) and it comletely blew me away.
14:42jitaProfpatsch: downloading :)
14:42Profpatschjita: bbloom The very best tool for learning Clojure quickly is the Instarepl in LightTable imho.
14:42ProfpatschYou don’t even have to bother pasting into a repl, it just shows the flow of data right beside your sexps.
14:43jitaProfpatsch: will definitely check it out, thanks
14:44Profpatschjita: Oh, and you’ll definitely want to keep this open in your browser: http://jafingerhut.github.io/cheatsheet-clj-1.3/cheatsheet-tiptip-cdocs-summary.html
14:45jitaok ty
14:45Profpatschjita: Best served downloaded as a local file. ;)
14:45carkjita: by using a simple text editor with no repl support (or instarepl), you might miss out what's one of clojure main selling points
14:47jitaI wonder if anyone tried this http://sublimerepl.readthedocs.org/en/latest/ ?
14:48jitaits mentioned here too http://dev.clojure.org/display/doc/Getting+Started+With+Sublime+Text+2
14:48NotteHi, would anyone tell me why when i load this source file with (load-file ...) from repl, it loads just the last function, please ? http://hastebin.com/dolosawifi.lisp
14:49jitaI am not sure how it would stack against LightTable though
14:49carknotte : i'm not sure if anyone ever uses load-file
14:50Nottecark: how should i load a code from a file within the repl?
14:50carkwith require or use
14:51carkso in this case you would type (require 'xi-ranker.core) , then change namespace to it in order to start playing with it
14:52carkerr i mean (require '(blah.blah))
14:52Nottecark: i was missing the change of namespace. Thank you so much :)
14:52cark=)
15:33logic_proggiven a list, how do I get a list of all items in the list that appears atpeast twice ?
15:34danneulogic_prog: frequencies and filter?
15:34logic_progdamn, frequenies
15:34logic_progthat's what I was loking for
15:34ProfpatschHuh, where is the difference between (conj {:a 1} {:a 42 :b 1}) and (into {:a 1} {:a 42 :b 1})? oO
15:35danneuProfpatsch: id look at the source but i think into uses transients and is just a reduce of conjs
15:41Profpatschdanneu: Why does conj then behave like into for maps? vec: [2 4] -> [2 4 [1 3]] list: '(2 4) -> '((1 3) 2 4) map: {2 "a", 4 "b"} -> {1 "c" 2 "a" 3 "d" 4 "b"}
15:46bbloomProfpatsch: think of maps as sets of key value pairs
15:46bbloom,(conj {} [5 10 15]) ; this is nonsense
15:46clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Vector arg to map conj must be a pair>
15:47Profpatschbbloom: Oh, right.
15:47bbloomProfpatsch: also worth noting, into is basically just (reduce conj to from)
15:47ProfpatschSo it doesn’t matter which one I use for maps? I think into sounds more expressive.
15:48ProfpatschOf course that reduce is another function call.
15:48bbloominto operates on a "from" collection
15:48Wild_CatProfpatsch: I have strong doubts you'll notice the performance hit :p
15:49bbloomit's a different thing from conj or assoc which operate on to-be-added elements directly
15:49bbloomwhat does "sounds more expressive" even mean?
15:50ProfpatschWell, it says exactly what I want to do. Merge these values into the other map.
15:50bbloomit's (into dest-coll src-coll) vs (conj dest-coll x y z)
15:50ProfpatschWhile with conj you have to first know that conj does that with maps (of course it’s obvious once you think hard ;) ).
15:51bbloomProfpatsch: if you want to operate on maps concretely, use assoc
15:51bbloomconj is intentionally polymorphic
15:51ProfpatschBut with assoc I first need the keys and values separately.
15:51ProfpatschI already have them in another map.
15:52ProfpatschSo it’s either conj or into.
15:52carkbbloom: doesn't into use transients underneath ?
15:52bbloomcark: yes
15:52bbloomcark: hence the "basically" qualifier
15:52bbloomProfpatsch: you didn't say you had a particular use case, you asked for a comparison. can't expect me to read your mind :-)
15:52carkqo into is the best solution
15:52carkso*
15:53carkProfpatsch: if you have 2 maps, you can merge too
15:53Profpatschbbloom: Of course. :)
15:54Profpatschcark: So there are three operations that do the same? oO
15:54carkthey don't do the same think, only in the case of maps
15:54carkthing*
15:54ProfpatschYep.
15:54carkconj, adds an item to a collection
15:55carkinto adds multiple items to a collection, using transients and like conj is polymorphic
15:55carkand merge is for maps
15:55carkand sets maybe ...
15:55carkhehe
15:55bbloomjust maps
15:55carkah ok =)
15:55carkwasn't sure naymore
15:55bbloommerge also handles nil arguments and treats them as empty maps
15:56ProfpatschSo merge is the best for maps.
15:56bbloom,(merge nil {:x 1} nil {:y 2} nil {:x 3})
15:56clojurebot{:y 2, :x 3}
15:56Profpatsch,(into {} {:x 1} nil)
15:56clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/into>
15:56bbloominto is not variadic
15:56carkProfpatsch: i think it should be, but last time i checked it was a fairly naive implementation
15:57bbloomyeah, merge's implementation does not take advantage of transients
15:57carkwasn't checking for smallest map before doing the merging, and didn't use transients
15:57bbloominto is idiomatic as well
15:57bbloomcark: it shouldn't check for the smallest map b/c it assumes left-to-right overrides
15:57carkbbloom: ah indeed
15:57ProfpatschFascinating. So there is still room for improvement in the core I see.
15:58bbloomProfpatsch: isn't that a fact of anything?
15:58ProfpatschOf course, but for some things more than for others. ;)
15:59carkProfpatsch: i think it comes down to the fact merge was implemented long before transients existed
15:59pyrtsa,(into {} (concat {:x 1} nil))
15:59clojurebot{:x 1}
15:59carkalso there a cost (O(1) but still) to converting to transient
15:59pyrtsa,(into {} (concat {:x 1} nil {:y 2}))
15:59clojurebot{:x 1, :y 2}
16:00carkthere is*
16:02bbloomcark: yeah, transients generally don't help below a certain number of conj! operations
16:02bbloomprobably somewhere < 15 or so
16:02bbloomthey probably even start to hurt further below that
16:02bbloomhaven't benchmarked it myself though, so not sure
16:04carkbbloom: so maybe it's for the best that merge is like it is
16:04carkmost of the time, maps are small
16:05bbloomcark: except for when they are big :-P
16:05bbloomanyway, it's the transient overhead isn't worrying about, it's very small and constant
16:05carkbbloom: but there can't be as many since they're so big =)
16:05carkbbloom: if the constant time is 6 hours, it's still a worry
16:06bbloomcark: the question is do you want to pay O(numMaps) transient cost or O(numElements) conj cost?
16:06Profpatschcark: bbloom: You could always make the function variadic and use transients at x upwards
16:06bbloomProfpatsch: that won't help if you have ONE argument and it's a large collection to copy from
16:07NotteWhy does this code give me an error? http://hastebin.com/gosurokaha.coffee
16:07Profpatschbbloom: Or measure the size and use that to decide?
16:07NotteThe file is readable
16:07bbloomProfpatsch: what if you have an uncounted source collection? like a lazy seq, which is the usual case
16:08pyrtsaNotte: Because map is lazy.
16:08bbloomProfpatsch: turns out, this shit is hard. so the simpler thing that is generally fast enough is the right decision
16:08pyrtsaNotte: Wrap it in a doall or use mapv instead.
16:08bbloomProfpatsch: if it's not fast enough, copy paste the source code & make it do what you need. but don't do that until your thing is working correctly
16:08Profpatschbbloom: At least the map to append to must be realized.
16:08carkProfpatsch: if you have special needs, make a function and do it yourself, that's no rocket science anyways =)
16:08pyrtsaLaziness implies that the line-seq is consumed later than the with-open block closes.
16:08Nottepyrtsa: ok, thanks.
16:09bbloomProfpatsch: but if you need to realize it to count it, you need to hold on to it b/c you can't realize it again w/o side effects being an issue, so you need linear memory instead of constant memory
16:09Profpatschbbloom: cark Nah, not anyway near that. I was just speculating about one could improve it.
16:09Profpatsch*about how one
16:09carkProfpatsch: this discussion made me change my mind about the merge implementation, i think it is as it should be now, thanks both
16:10pyrtsabbloom: Reminder that you don't have to consume the whole sequence to find out if its size is greater than a given threshold. ;)
16:10ProfpatschMy respect for Rich is rising with everything I learn.
16:11bbloompyrtsa: yes, this is true. but then you have to pay THAT constant cost, when you might as well have just paid the constant cost to produce the transient
16:11pyrtsaSure.
16:11bbloompoint is, dumb thing works & is generally fast enough: do that :-P
16:11pyrtsaAnd makes sense that both ways are available when the programmer knows which way to go.
16:11Profpatschbbloom: But you don’t have to realize any values at all. You just have to count hash values.p
16:12ProfpatschBut yeah, until one has done lots of benchmarks there is no sense in improving it.
16:12clojurebotIn Ordnung
16:12bbloomProfpatsch: i have no idea what you're talking about
16:13Profpatschbbloom: About the existing map. Its size matters, too.
16:13bbloomin order to count (even partially count) a sequence (the common case in a pipeline) you need to realize the head N items of that sequence
16:13Profpatschbbloom: I’d suspect that this map is way bigger than the one merged into it in most cases (with an entity-model you could have thousands of elements in it).
16:14bitemyapparrdem: how'd you reach 1.1k?
16:14arrdembitemyapp: I threw two more hosts at the problem.
16:14Profpatschbbloom: But a map is a collection, not a sequence. ;)
16:14bbloom,(coll? (seq [5 10 15]))
16:14clojurebottrue
16:15bbloomProfpatsch: a sequence is a collection
16:15Profpatschbbloom: I know, but merge only accepts maps as first argument.
16:15bbloomProfpatsch: oh, i see what you're getting at. you're saying that merge can assume the arguments are "counted?"
16:16bbloomProfpatsch: but the issue is the count of the not-first arguments:
16:16bbloom,(merge {:x 1} (seq {:y 2 :z 3}))
16:16clojurebot{:y 2, :z 3, :x 1}
16:16Profpatschbbloom: Since all args to merge have to be maps, I’d think they should be easily countable.
16:17bbloomProfpatsch: see above ^^ your assumption is incorrect
16:17bbloomseqs are perfectly fine arguments to merge
16:17ProfpatschOh, that’s fascinating. Then the docs are wrong.
16:17ProfpatschOr at least not general. ;)
16:18Profpatsch.(doc merge)
16:18hiredmanyeah, that is weird, you used to have to apply merge
16:18Profpatsch,(doc merge)
16:18clojurebot"([& maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result."
16:18ProfpatschLet’s git blame. :)
16:18bbloomit might be abusing an implementation detail to pass a seq instead of a map
16:18bbloombut it's unlikely to change now
16:18bbloomthere are lots of things that use seqs of pairs and treats them like maps
16:20hiredmanah, that makes sense, of course merge is just calling seq on the passed in maps anyway
16:20bbloomyup
16:21Profpatsch(when (some identity maps)
16:21Profpatsch (reduce1 #(conj (or %1 {}) %2) maps))
16:21ProfpatschThat’s merge.
16:22ProfpatschThe when is just to get the firsit non-nil value, right?
16:22Profpatsch*first
16:43sveriso, du hast doch gesagt du kennst dich jetzt mit der selector syntax von enlive aus :D
16:43sverihups, sry, wrong channel^^
16:46bitemyapparrdem: scalin' >:)
17:00daGrevishi! i have a list of numbers. i would like to get first numbers until multiplication of them is X. i dunno how could i say it functionally. i need to go through the list and in each step do (* x %) and check if it's X already. if so, stop the loop
17:01daGrevisthis is what i have so far :( http://vpaste.net/0OjiF
17:01TEttingerdaGrevis, reduced . hang on a sec
17:02Mandarhi
17:02Mandarfirefox keeps crashing, as soon as I launch a javascript heavy page
17:02brehautMandar: are you sure you are asking the question in the right channel?
17:02BronsaMandar: and.. what has that to do with clojure?
17:03Mandarbrehaut, heh
17:03Mandarthought i was on #gentoo
17:03Mandar:D
17:03brehautnot quite ;)
17:03Mandarsorry guys!
17:03brehautit happens. np
17:03TEttinger,(reduce #(if (<= %1 100) (* %1 %2) (reduced %1)) 1 (range 1 1000))
17:03clojurebot120
17:04BronsaTEttinger not quite. he wants back the list of numbers
17:04brehaut(doc reduced)
17:04clojurebot"([x]); Wraps x in a way such that a reduce will terminate with the value x"
17:04brehautnice
17:04daGreviswoah, thanks, TEttinger. give me some time to understnd it
17:04daGrevisBronsa, TEttinger: ye, i need a list back with numbers that together * make up X
17:05TEttingerohhhh like factors?
17:05TEttingerfor 6, you mean 1, 2, 3 ?
17:05TEttinger(and 6)
17:06daGrevisye exactly like factors :)
17:06Bronsa,(reduce (fn [[m l] n] (if (<= m 100) [(* m n) (conj l n)] (reduced l))) [1 []] (range 1 100))
17:06clojurebot[1 2 3 4 5]
17:06TEttingerdo the factors need to be prime?
17:06Bronsaif you want to use reduce/reduced
17:07daGrevisTEttinger, yes
17:07daGrevisim doing this https://projecteuler.net/problem=3
17:07daGrevisi have all primes of X and now I would like to get out prime factors
17:07clojurebotGabh mo leithscéal?
17:08TEttingeryou mean you've made a list of primes less than 600851475143 ?
17:09Bronsaarrdem: I can do that for you if you want.
17:09daGrevisTEttinger, well i know it's not efficient.just trying to do something before optimization. currently im working with 13195
17:09arrdemBronsa: with or without manual JVM bytecode generation...
17:09AimHereOuch. I think a very quick course in number theory is in order
17:09daGrevisTEttinger, friend did this task in C++ with pure bruteforce and it run like 1sec
17:10arrdemdaGrevis: just because brute force is viable doesn't mean we'll help you do it :D
17:10AimHereFirst off, consider taking only the primes up to and including Sqrt(X), because
17:11bitemyapparrdem: amusingly, you might've had a better time (not necessarily faster) with something that behaved more like BEAM
17:11AimHereIf you know that ab=x, and a<sqrt(x), then b> sqrt(x)
17:11bitemyapparrdem: especially when you wanted to just send-off willy nilly.
17:11Bronsaarrdem: I lost count of the times I made the jvm crash while playing with jna/llvm
17:11bitemyappthat having been said, the unbounded mailboxes in Erlang are an exceedingly bad idea.
17:11arrdemBronsa: haha yeah that isn't something I'm looking forwards too...
17:12arrdembitemyapp: playing with aleph some more trying to get a handle on the queue semantics...
17:13daGrevisAimHere, about sqrt - i can do / 2 to avoid looping throught half of a list http://vpaste.net/Ubo3o
17:13bitemyapparrdem: I'm reading code I didn't write.
17:14AimHeredaGrevis, sqrt(2) < 2 for all numbers that matter. Use that instead!
17:14daGrevisAimHere, is sqrt in core lib?
17:14AimHereSorry sqrt(n) < n/2
17:14arrdemdaGrevis: of course it is
17:14AimHereIt's in Java.
17:14AimHereMath/sqrt
17:15AimHere,(Math/sqrt 13195)
17:15clojurebot114.86949116279744
17:15daGreviscool
17:15AimHereIt's not that cool. It's not first classy like most clojure functions
17:16arrdemAimHere: math.numeric-tower...
17:16AimHere,(map Math/sqrt [1 2 3 4 5 6])
17:16clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>
17:16daGrevisfunny that i can use range with floats
17:17daGrevisohh ye num-twr, but it's a 3rd party
17:17lvhtoo much crypto for me
17:17lvhI'm going "huh? what the heck is a *static* field? maybe it can't do it over integers, but ..."
17:18lvhthen I realized: jvm.
17:18AimHeredaGrevis, also, fundamental theorem of arithmetic would *really* help you out. If you find out that prime p|n, then to find the other primes that divide n, those are exactly the primes that divide n/p
17:19daGrevisAimHere, thanks, I'll look into it. ;)
17:23sverihi, in the enlive tutorial (https://github.com/swannodette/enlive-tutorial/) the guy uses this syntax for the selector: "(def ^:dynamic *story-selector*...", why does he choose to make it dynamic? from my understanding a selector should not change during a request, any ideas?
17:28bitemyappsveri: why are you doing the enlive tutorial?
17:28sveribitemyapp: cause i want to use enlive?
17:28bitemyappsveri: that was a given, what's your use-case?
17:29marcopolo`I think he's doing that because that tutorial is meant to be done in a repl, so you could change the selector and play around with it
17:29sveribitemyapp: sry, i understand now, i am just picking a rest service and provide the data to some html, so during one request that wont change at my place
17:29marcopolo`if you didn't change the selector it would work just the same if it weren't dynamic
17:29sverimarcopolo`: that makes sense
17:29sverii just was not sure if i missed something or misunderstood the dynamic attribute
17:30bitemyappsveri: Perhaps https://github.com/raynes/laser/ would involve less time being utterly lost?
17:30sveribitemyapp: so you would prefer laser over enlive?
17:31bitemyappsveri: I'm a hypocrite, I don't prefer anything in this case, I'm just trying to save you some grief.
17:31marcopolo`You are creating html?
17:32sveribitemyapp: ok, thank you then, i am just getting started together with a friend and we thought we go with enlive as it seems to be broadly used
17:32sverimarcopolo`: yea
17:32bitemyappsveri: not really.
17:32bitemyappsveri: it just has good marketing.
17:32sveribitemyapp: hehe
17:34bitemyappucb: http://www.youtube.com/watch?v=jTW1VsqiNV4
17:34marcopolo`sveri: I like enlive, but I've only used it for reading/parsing html
17:35sverimarcopolo`: well, as far as i read it works both ways
17:35marcopolo`but if you are you creating html, you might want to look at hiccup
17:35marcopolo`https://github.com/weavejester/hiccup
17:35marcopolo`haha let's overload you libraries!
17:35sveri:D
17:35sverii seen that one to
17:36sveribut really, as a newbie in clojure land in general its hard to see the pros and cons of every lib and my feeling is i just have to go with one of them and see how it works
17:38marcopolo`yup!
17:39sveridoes template reloading work with laser? thats one thing that bugs me currently with enlive
18:23nopromptdnolen: you around?
18:25bitemyappnoprompt: long time no see.
18:26dnolennoprompt: what's up?
18:26nopromptbitemyapp: the 100% pairing at the new gig has made it hard to be here during the day.
18:26bitemyappnoprompt: I hear that.
18:27bitemyappnoprompt: could I interest you in some Fay and React.js tinkering?
18:27nopromptdnolen: i've run in to some weird behavior w/ "private" channels w/in components.
18:27bitemyappnoprompt: there's a CLJS meetup coming up
18:27dnolennoprompt: private?
18:27nopromptdnolen: i'm building out a generic table sorter with om.
18:27nopromptdnolen: eh, maybe that's the wrong word for it.
18:28nopromptdnolen: basically i have a component which creates a thead, whenever asc/desc buttons are clicked information is put on a channel which is passed in via opts in the parent component.
18:28nopromptdnolen: the parent component then uses that information to sort the table.
18:29dnolennoprompt: what's the actual problem w/ the channels?
18:29nopromptdnolen: the problem happens when the table component gets swapped out say via a route change and a new "page" is rendered.
18:29nopromptdnolen: the channel starts recieving an unstoppable flow of puts.
18:30nopromptdnolen: and the browser locks up :(
18:30bitemyapp"unstoppable flow of puts"
18:30nopromptbitemyapp: not sure how else to describe it.
18:30dnolennoprompt: hmm, definitely would like to see a minimal example of this
18:30bitemyappnoprompt: just found it a funny mental image.
18:31nopromptdnolen: let me see if i can reduce my little demo here to something simple.
18:31nopromptdnolen: i was planning to write a blog post about making reusable components like this.
18:32dnolennoprompt: that would help
18:32dnolennoprompt: sounds cool
18:32dnolenOm 0.2.0 just went out
18:32nopromptdnolen: i have the channel being created in IInitState and close!ed in IWillUnmount
18:32dnolenbreaking changes for anyone using :opts
18:32dnolennot replace by :state and :init-state, examples updated
18:33dnolens/not replace/now replaced
18:33nopromptdnolen: yeah, just noticed the last few commits.
18:33nopromptdnolen: i check it everyday :)
18:33dnolennoprompt: heh, I really struggled on this one by I think this is right direction
18:33dnolennoprompt: I hated that people could accidentally refer to stale opts
18:33dnolennoprompt: also the fact that you couldn't set state from parent component
18:34nopromptdnolen: i started a new gig this week and so far the guys i've been pairing with are excited about it.
18:34dnolennoprompt: that's great!
18:34nopromptdnolen: most of them aren't big in to front end and it actually got them excited about building apps with cljs.
18:34dnolennoprompt: I'm pretty excited about it too, I think I can commit to documenting things now and writing real tutorials.
18:34dnolennoprompt: next phase is the time management stuff
18:35nopromptdnolen: well i think i'm going to be sharing little nuggets like this moving forward. two guys said i should write up something.
18:36nopromptdnolen: i sort of wanna "borrow" your latex looking blog theme.
18:36AmLearning: : rating 5. 0/5 - 54 votes [+] 54 likes [-] 0 dislikes : :
18:36nopromptdnolen: it's got that "academic" feel. :)
18:36AmLearningnow days if ai even thin or feel threatened, i will brandish weapon "after yelling aloud"
18:36nopromptbitemyapp: i think we could get back on the haskell horse next week.
18:36AmLearningit's you're
18:36nopromptbitemyapp: had to get used to the new workday. starting at 7am, etc.
18:37AmLearningdefinition [1/1]: the short nickname for the word: tsundere. "tsun tsun" is used for cold/blunt/curt attitude, while "dere dere" is used when a person becomes embarrassed in front of his/her lover.
18:37bitemyappnoprompt: okie-dokie.
18:37AmLearningnoprompt: there's a cljs meetup coming up
18:38nopromptbitemyapp: you going to clojure west?!
18:38AmLearning! ud twat
18:38bitemyappnoprompt: I'm going to the CLJS meetup this month, I dunno about C/W
18:38SparkySparkyBoomAmLearning, are you a furry
18:38nopromptbitemyapp: c'mon!
18:38AmLearningSparkySparkyBoom, channel
18:38SparkySparkyBoom?
18:38nopromptbitemyapp: it's practically in your backyard.
18:38lockswhat’s happening in here.
18:39bitemyapplocks: trulls.
18:39arrdembitemyapp: the run finished overnight, but I managed to kill react with sharding settings. re-running...
18:39bitemyappnoprompt: yeah but, it's about Clojure.
18:39bitemyapparrdem: RethinkDB?
18:39bitemyapparrdem: what settings did it break under? Did you report to their github?
18:39arrdembitemyapp: yeah I meant rethink.
18:39nopromptbitemyapp: it's also about friendship. ;)
18:40arrdembitemyapp: I didn't because it's my fault that it broke.
18:40arrdembitemyapp: turns out syncing 1.8M records to a new shard totally locks up even my gaming box.. I think I got a kernel panick.
18:40bitemyapparrdem: report it anyway
18:41bitemyappnoprompt: that's the main incentive right now, but I'll end up using it as an opportunity to spread the joy of types.
18:41bitemyappnoprompt: I'd probably spend most of the conference interested in anything Datomic related, teaching Haskell/Fay, and playing GO.
18:41bitemyapp(baduk)
18:42lockswhat’s with clojure programmers and Go
18:42nopromptdnolen: got a new rig w/ a quad core I7 + 16GB ram, cljs compiles like laser beams. :D
18:43nopromptlocks: i don't play go.
18:43bitemyapplocks: it's not like I play Go well.
18:44dnolennoprompt: haha awesome :)
18:44nopromptdnolen: w/ source-maps builds are ~5s.
18:44mcohen3basic question for anyone with some core.async knowledge.....
18:45locksbitemyapp: how did you learn to play it?
18:45bitemyapplocks: losing
18:45jasonppStarted developing with Clojure and LightTable recently and noticed battery life on my new-ish Macbook Pro has dropped. Could JVM be responsible?
18:45mcohen3is it "thread safe" to reference vars in the outer (closure) scope from within a go block?
18:46locksbitemyapp: haha. did you play online? I don’t think there’s too many places where I can play go around here
18:46bitemyapplocks: yes.
18:47bitemyappjasonpp: I would guess yes, but science is always an option.
18:47eggheadin cljs should I be using cljs.reader/read-string and prn-str on the server or is it better to do something else?
18:48mcohen3for example....https://gist.github.com/mcohen01/8512579
18:48jasonppbitemyapp: Activity Monitor didn't really offer any answers
18:48mcohen3inside the go block i'm referencing url and foo, which are in scope prior to the go block
18:49dnolennoprompt: haha awesome
18:49jasonppNo significant CPU but RAM obviously quite high but I don't know if this accounts for (relative) battery drain
18:49bitemyappjasonpp: not substantially.
18:49mcohen3does core.async take care of saving that whole closure scope state when it "parks" the thread?
18:49nopromptdnolen: well it seems like the problem is with close!ing the channel.
18:49nopromptdnolen: if i don't close it during unmount everything is fine.
18:49mcohen3such that multiple threads will see the "correct" values of those vars inside the go block?
18:52eggheadis it better to go `server edn -> client edn` or `server edn -> server json -> client json -> client edn`
18:53marcopolo`egghead: better to stay with edn
18:53marcopolo`however I think edn might be a little slower than json, but you won't notice unless you are doing thousands of parsing
18:54nopromptdnolen: https://gist.github.com/noprompt/8512620
18:55michaniskinegghead: http://github.com/tailrecursion/cljson
18:55nopromptdnolen: do i not need to worry about close!ing the channel when the component unmounts?
18:56nopromptbitemyapp: well, if you don't wanna go to clojure west that's cool. ;_;
18:56eggheadoh cool thanks michaniskin
18:56bitemyappnoprompt: I do sorta. I just want to save the money for leaving this state even more.
18:57bitemyappor time, for that matter.
18:58nopromptbitemyapp: you're gonna move to a northern european country and join a type safe cult.
18:58insamniaclulz
18:58bitemyappnoprompt: I was thinking Austin or Seattle. Northern European usually implies Erlang.
18:59nopromptbitemyapp: given my taste in sweaters recently i'm could mistaken for a haskell programmer.
18:59nopromptbitemyapp: although i have been busting out the math books more.
19:00bitemyappnoprompt: check out Awodey's Category Theory :)
19:01nopromptbitemyapp: i've been working through a probability book and an abstract algebra one in my free time. this weekend i was messing with parametric equations and doing fun stuff with curves.
19:01bitemyappnoprompt: the CT will tie into abstract algebra.
19:02nopromptbitemyapp: yeah, that's why i wanna get a handle on it before i look at CT any more.
19:02bitemyappnoprompt: no need.
19:03bitemyappnoprompt: CT is pretty minimal in terms of prereqs
19:03nopromptbitemyapp: sure, but i'm not as interested in it as AA.
19:03bitemyappnoprompt: fair
19:04nopromptbitemyapp: in my experience with math it's always better to have a good foundation in subtopics before moving higher up the abstraction chain.
19:04nopromptbitemyapp: plus there's a ton of stuff in AA that's useful.
19:04dnolennoprompt: sorry I gotta run
19:04dnolennoprompt: you definitely have to be concerned about channel closing
19:05dnolennoprompt: anyone listening needs to be ready for that.
19:05nopromptdnolen: alrighty. if you get a chance to run the code and give me feedback that'd be helpful. i don't wanna put a blog post out there with borked code.
19:08wafflepilotsoftware = fun
19:09TEttingergah http://clojuredocs.org/clojure_core/clojure.core/_dot_dot
19:10patrickodwhat's the most idiomatic of having multiple dependent if-lets in sequence? I'm writing a small web service that creates 2 dependent models from a request and if-let only supports one binding
19:10patrickodis nesting them the best practice ?
19:11nopromptpatrickod: i wouldn't worry about the idioms so much. if if-let isn't going to work in your case then don't use it.
19:12nopromptpatrickod: use whatever will make your code work will expressing your intent clearly.
19:12noprompt*while expressing
19:12patrickodnoprompt fair enough. given it's my first clojure project I just wondered what idioms existed if any for such things. this is a learning project not something serious :)
19:12patrickodthanks!
19:12alewpatrickod: I had a similar issue and came up with a macro with the help of a few people here
19:13danneupatrickod: yeah, sort of like when-let -- it'd be nice to have syntax for "when all of these bind, then do this".
19:13alewpatrickod: It's like an inverted cond that also lets you have binding forms in it
19:13alewbut yeah you could just write a if-all-let
19:15danneu,(-> 42)
19:15clojurebot42
19:15danneu,(->> 42)
19:15clojurebot42
19:15danneuoh what
19:16nopromptpatrickod: fwiw, in my experience it's best to focus on writing idiomatic code once you've gotten used to a new language. you'll be significantly less stressed though you'll probably write more verbose/ugly code. :)
19:16patrickodthis is true. much less stressful when you just don't care
19:17nopromptdanneu: how's it going?
19:17nopromptdanneu: i don't think we've ever spoken outside of GH issues.
19:18danneunoprompt: hey man. it's going well. i am probably garden's biggest user.
19:18danneui want to freeze time so that i can extract my stuff back into github repos
19:18nopromptdanneu: haha, thanks! that'd be awesome.
19:19nopromptdanneu: hey did you ever get a chance to check that lein-garden issue?
19:21danneunoprompt: i havent yet tried your update
19:22nopromptdanneu: eh, that pluginn needs work. i think i jumped the gun promoting it. i got busy the past couple months and haven't been givin garden or the plugin enough attention.
19:22nopromptdanneu: there's a pile of things i want to improve.
19:22danneuill give it a shot. i've been using my own loop where i hard-code the paths so i'll see if i can get it working
19:22nopromptdanneu: keyframes, the compiler, colors; all need work.
19:23nopromptdanneu: the big thing i want is a compiler protocol which people can safely use.
19:23danneuyeah. me too. my compass port turned into two different projects. one is a library of helpers. the other is a compile/build tool.
19:23nopromptdanneu: well i'm definitely open to any ideas you've got.
19:24nopromptdanneu: most of the "big" features have been handled.
19:26danneua hiccup + garden codebase is pretty comical.
19:26ryantm,5d2
19:26nopromptoh, it's so weird isn't it?
19:26clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 5d2>
19:26brehauti prefer a 5e3 myself
19:26nopromptdanneu: i built a little web app where i was sharing selectors between hiccup/garden. my mind was melting.
19:27danneunoprompt: the power is overwhelming for me unless i take breaks to square up my abstractions. but when i get it right, it's insane
19:28nopromptdanneu: my feeling exactly. have you messed much w/ macros? that was the biggest mind blowing moment for me.
19:29ryantm^,(+ 1 1)
19:29danneunoprompt: i'm pretty bad at them, but i try.
19:29nopromptdanneu: the funny thing is i spent more time working on garden than actually using it seriously. when i finally got the chance it was an interesting experience.
19:30danneui think i've inadvertently rewritten most of Twitter Bootstrap with garden though in my current proj
19:30nopromptdanneu: oh man, you should definitely share that.
19:30nopromptdanneu: i'd link to the repo in the README.
19:30danneuthe hard part is just that this stuff gets so coupled with my production code so it's a fulltime job just to extract things
19:31noprompti hear ya.
19:31bitemyapparrdem: doters?
19:32nopromptdanneu: one thing that needs to happen is an api for client-side garden. right now it's just garden on the client, but it's much better to just manipulate the CSSOM directly.
19:32noprompthaven't figured out how best to handle that.
19:34danneunoprompt: what kind of stuff would that allow you to do? i don't have much experience on the client-side.
19:36nopromptdanneu: it'd just allow you to manipulate the CSSOM directly instead of generating strings and setting the style attribute of stuff directly.
19:36nopromptdanneu: so something like (update-rule! :.foo styles..)
19:38nopromptdanneu: what's nice about it is that you can be more declarative. ie. you don't have to say select these elements and set their style attribute to x.
19:39nopromptdanneu: you just update the stylesheet and everything is gravy.
19:41danneunoprompt: oh yeah, of course. you're just updating a datastructure.
19:41arrdembitemyapp: maybe later. crunching on more homework and Awaited is 50% through the 2nd crawl run.
19:42arrdembitemyapp: I may hop on the texas server 8-10ish
19:42arrdemor sooner if these retards keep dancing in the library..
19:44marcopolo`So here's something weird my -main fn sets up a go-loop, does work in it. In the go-loop goes on indefinetely, but when I run it with lein run it exits after a bit. Is there some JVM flag I should set?
19:50mischovmarcopolo: -XX:+StopScrewingWithMe? :P
19:50marcopolo`haha
19:51marcopolo`now when I do Thread/sleep in the main before exiting it does my go-routine work, so I'm pretty sure it thinks the main thread is done and exits.
19:52arrdemmischov: hah well played
19:53bitemyappmarcopolo`: fork a JVM keep-alive thread, provide a channel to it to kill it off when you're ready for the process to terminate.
19:53bitemyappmarcopolo`: core.async "threads" are not JVM threads, it can't tell it's supposed to keep the lights on for somebody.
19:53marcopolo`yeah I figured that was the problem
19:53bitemyappwell you say that.
19:54marcopolo`what's a keep-alive thread?
19:54bitemyappmarcopolo`: it's not a reified thing. I incorporated the purpose of the thread into the noun.
19:54arrdemmarcopolo`: a thread that just spins
19:55bitemyappit wouldn't even spin, it's just going to park on a channel wait.
19:55bitemyappwhen it receives *anything* from that channel, it dies and takes your process down with it.
19:55quizdrif you take the nth element of a huge lazy sequence , i assume the reason it won't overflow the stack is because it is not holding onto references to the previous elements, even if they are needed to calclate nth, it is throwing them away, right?
19:56marcopolo`bitemyapp: gotcha, thanks
19:56arrdemquizdr: no... that would be a heap overflow
19:56arrdemquizdr: a stack overflow is too many recursive function calls were made
19:56quizdrok, but an overflow regardless, so it is throwing away the intermediate calculations to avoid this, right?
19:56arrdemquizdr: but yes, lazy sequences can potentially conserve memory by garbage collecting unused subseq.
19:57quizdrin which case, if you asked for nth again, it would need to calculate again, unless you memoize for that particular nth request?
19:57arrdemquizdr: no. that model only applies to stream accessed lazy sequences
19:58arrdemquizdr: if you use nth on a lazy seq, everything up to the nth block is realized and cached.
19:58arrdemquizdr: with no hope of garbage collection
19:58quizdrcached how? so you could use up the heap then?
19:58arrdemwell.. the block where the nth element resides...
19:58arrdemquizdr: correct. observe.
19:58arrdem,(doall (range))
19:58clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
19:59jack_rabbitheh
19:59arrdemquizdr: I just told the bot to fully compute an infinite sequence.
19:59quizdrthen how is it possible to request some ridiculously large nth value from a sequence of infinite fibonacci numbers, for example, without using up the heap?
20:01arrdemquizdr: for a fibonacci sequence incrementally defined as a lazy list, computing the nth term requires fully computing the previous n terms, right?
20:02arrdemquizdr: it's just that a lazy sequence can perform this computation in constant space.
20:02quizdrbut if those n terms are cached, aren't they taking up heap space?
20:02arrdem,(doc realized?)
20:02clojurebot"([x]); Returns true if a value has been produced for a promise, delay, future or lazy sequence."
20:03danneuHow does noir.util.crypt/compare know what salt to use? https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/crypt.clj#L50
20:03arrdemquizdr: I'm actually not sure under what circumstances a lazy sequence will become realized/cached.
20:04arrdemquizdr: in this case the sequence should not become realized because any reasonable fibonacci sequence definition will, thanks to being recursive, unroll into incrememental loop calculation form.
20:04arrdemquizdr: so accessing the nth element here will not cause caching of the previous n.
20:05arrdemquizdr: however if you have a lazy sequence of finite size, and traverse it in its entirety, then the lazy sequence will become fully realized and cached.
20:06arrdemquizdr: does that distinction make sense to you?
20:08quizdrarrdem, consider this lazy fibb definition:
20:08arrdemquizdr: refheap paste please.
20:09quizdr,(def fibb [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))
20:09clojurebot#<CompilerException java.lang.RuntimeException: Too many arguments to def, compiling:(NO_SOURCE_PATH:0:0)>
20:09quizdrah
20:09quizdr,(def fibb [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N]))))
20:09clojurebot#<CompilerException java.lang.RuntimeException: Too many arguments to def, compiling:(NO_SOURCE_PATH:0:0)>
20:09quizdrcopy paste madness
20:09quizdr,(defn fibb [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))
20:09clojurebot#'sandbox/fibb
20:10quizdr,(def lots-o-fibs (take 1000000000 (fibo)))
20:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fibo in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:10quizdr(def lots-o-fibs (take 1000000000 (fibb)))
20:10quizdr,(def lots-o-fibs (take 1000000000 (fibb)))
20:10clojurebot#'sandbox/lots-o-fibs
20:10quizdrgrr sorry
20:10arrdem,(let [lst (fibb)] (println (nth 50 lst) (realized? lst))
20:10clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
20:10quizdrso when i do this:
20:10quizdr,(nth lots-o-fibs 100)
20:10arrdem,(let [lst (fibb)] (println (nth 50 lst) (realized? lst)))
20:10clojurebot354224848179261915075N
20:10clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Number>
20:11arrdem,(let [lst (fibb)] (println (nth lst 59) (realized? lst)))
20:11clojurebot956722026041N true\n
20:11quizdrit is saying it is realized, but only up to the 59th element, right?
20:12quizdr,(realized? lots-o-fibs)
20:12clojurebottrue
20:12arrdemquizdr: I think so... however the 59 alignment is doubtful. map is a chunked lazy sequence, so it's more likely to have computed 64 terms and only shown the 59th.
20:13quizdrthat's fine, but what I want to know is: are all those elements 0 - 59 or 64 consuming heap space? i wouldn't think so. so how can they be realized or cached?
20:13quizdr,(nth lots-o-fibs 1000)
20:13clojurebot43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875N
20:14quizdrobviously, clojure is not keeping 1000 of these huge numbers in memory
20:14quizdryet it can extract the 1000th
20:14arrdemquizdr: if they have not been garbage collected (which they won't be so long as the head of the seq is referenced) they must be sucking up storage.
20:14arrdemand yes it can keep 1000 huge numbers in memory...
20:14quizdrif they *are* garbage collected, then asking for them again means they are calculated again, even if they are already realized, right?
20:15arrdemthey won't be, because the head of the sequence is retained.
20:15hyPiRion,(last losts-of-fibs)
20:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: losts-of-fibs in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:15hyPiRion,(last lots-of-fibs)
20:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: lots-of-fibs in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:15arrdemhyPiRion: lolz
20:15hyPiRion,(last lots-o-fibs)
20:15arrdemhyPiRion: stick around... you can probably answer this better than I can
20:15quizdrby "head" you mean the first 0 - 59 elements?
20:15clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
20:16arrdemquizdr: no, by head I mean the object constituting the "lazy" sequence.
20:16arrdemthis thing
20:16arrdem,lots-o-fibs
20:16clojureboteval service is offline
20:16arrdemah shit.
20:16hyPiRionarrdem: I think I just broke it
20:16arrdemhyPiRion: you or me, its dead either way :P
20:16hyPiRionanyway, realized? returns true if the next element in the lazy seq is realized
20:16hyPiRionnot the entire thing
20:17arrdem,(next lots-o-fibs)
20:17quizdrok, so explain to me how the system can not store the calculations for all those hundreds or thousands of results from 0 to n-1 and thus not use heap space, but also not have to recaculate them?
20:17clojureboteval service is offline
20:18arrdemhttp://reactiongifs.me/wp-content/uploads/2013/08/shia-labeouf-magic-gif.gif
20:18hyPiRionquizdr: it did, that's why I tried to pick the last element in the list of all those fibs
20:18arrdemquizdr: it does store those. the lazy-sequence object contains a cache of the realized (computed) subsequence of the sequence.
20:19arrdemquizdr: so when you say (nth seq 5000), it computes and stores the first 5000 and just returns the last one to you.
20:19arrdemquizdr: this all obviously consumes heap space.
20:19quizdri see. why is the heap overflow only happening when you request to view one of those that has been stored, rather than in the act of actually storing them to begin with?
20:19hyPiRionarrdem: well
20:20arrdemhyPiRion: mod some handwaving and seq internals which I need to learn..
20:20arrdemquizdr: you cannot achieve a heap overflow re-accessing an element.
20:21arrdemquizdr: what hyPiRion and I have demonstrated is accessing an element so far out the lazy sequence that computing the cache kills the JVM
20:21gtraktpope: have you been working on a middleware for the jump-to-symbol?
20:21hyPiRionquizdr: the elements aren't generated unless they have to be used (e.g. by using next/rest)
20:21quizdrif you are correct, then when I request the 1000th fib, then 1000 fibs are stored in the heap somewhere. but if I try to do the same with an un-lazy sequence, you get memory overflow errors right away. whether it is lazy or not, 1000 of these numbers takes up the same amount of memory, right?
20:22arrdemhyPiRion: which in this case they have to be by definition of iterate...
20:22quizdrhyPiRion so you are saying the elements 0 - 999 are *not* being stored because they are not being requested, right?
20:22arrdemhyPiRion: so his (map first (iterate)) is totally going to exhibit this behavior because it's based on next.
20:23hyPiRionhmm
20:23arrdem,(doc iterate)
20:23clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
20:23arrdemquizdr: how do you think iterate is implemented?
20:23hyPiRionquizdr: first off, storing 1000 elements takes roughly the same space for both a lazy and an eager seq
20:23arrdemquizdr: it feeds the last computed value into a lazy-seq expression for the next value.
20:24hyPiRionhowever, an eager seq will at some point have all the elements in the heap. This is not necessarily true for a lazy seq
20:24quizdrso a lazy seq could then "forget" some of those elements at some point?
20:24hyPiRionbut that depends on whether or not you retain the head of the lazy seq, and how you generate said lazy seq
20:26quizdrso I retained the head when I did this: (def lots-o-fibs (take 1000000000 (fibb))) if I did not do that, then I might technically be able to access elements further out in the space without getting memory errors, since the prior elements would be immediate garbage collected, is that right? storing the head reduces how far out you can get stuff?
20:26hyPiRionquizdr: Consider a linked list. If I do (def a my-list), then (def a (rest my-list)), then the first element of my-list can be garbage collected
20:27hyPiRionquizdr: yeah
20:27S11001001quizdr: that's accurate
20:27quizdrhyPiRion, ahh, so it really depends on how the head is stored in this case.
20:28hyPiRionquizdr: right. If you define lots-o-fibs as a function returning (take 1e10 (fibb)) instead, you'd generate a new list every time (and not retain its head)
20:28quizdrso the advantage of storing the head is that elements in the sequence are cached once they are calcualted, and you don't have to wait for those calcualtes again. the advantage of not storing the head is you can access nearly anything in the sequence even way far out, in ways you could not do when storing the head.
20:28hyPiRionquizdr: exactly
20:28quizdrin which case, you choose what you need, whether storing or not fits your needs
20:28alewwhen you hold onto the head, the gc can't touch anything in the lazy seq because you can get to any part of the lazy seq through the head
20:29quizdrso if time was not an issue, but you wanted to access nearly anything in an infinite sequence, storing the head is a bad idea.
20:29hyPiRionyup.
20:30quizdrwherease, if time is important and you frequently need the same elements over and over again, sacrificing the extent to which you can access inifinity is worth the benefit of retaining prior realizations
20:30hyPiRionquizdr: yeah, or you can eagerly compute the results if you know you need them anyway. I some cases, directly inserting the values into a vector may be beneficial for random access times
20:31hyPiRion*In some cases
20:31alewyou can still access farther out points of the lazy seq and have them be cached
20:31alewif you retain the head of the lazy seq 1000 places in
20:32bbloomalthough if you need to retain that and do multiple ops on it later, maybe worth paying the cost to build a vector :-)
20:32quizdrvery interesting stuff. so I should reasonably expect a stored lazy seq and an "eager" seq to flake out in memory around the same point in the sequence, since they are both storing their elements
20:36S11001001quizdr: the lazy representation typically has stacks more memory overhead per element, though chunks alleviate this when available.
20:40quizdrinteresting. lazy sequences use more memory for their retained elements than eager sequences?
20:41S11001001quizdr: indeed
20:41bbloomquizdr: the implementations are quite approchable to read
20:42quizdrbbloom that's true
20:42bbloomhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LazySeq.java
20:43quizdrso is the entire implementation of clojure open source? one could go and build clojure for use?
20:43bbloomlazy sequences are essentially cons cells, but each cell needs an extra possible function thunk field
20:43bbloomvectors, for example, use 32-wide arrays and are much cheaper than cons cells per item
20:43quizdrthat makes sense.
20:43bbloomquizdr: clojure is open source yes, i just linked you to it
20:44quizdrso one could technically build a version of clojure with reader macros, for example, by adding that functionality
20:44mrhankyis it possible to include jquery-migrate via foreign-libs in lein-cljsbuild?
20:45S11001001quizdr: eh, could you take it seriously if it wasn't? :)
20:46quizdrwell i'd seen comments in the clojure mailing list about guys who wanted to add various things, and the consensus then being "no they won't be added." but I would think those guys could just do it for themselves. i hadn't realied till just now that the java implementation was also open source
20:46quizdri don't know much java so never thought to check on it
20:47flamingnomsis it normal for a nested list to be flattened when map'd if said list is a lazy sequence?
20:48carkmrhanky: you might want to check the :preamble option in compiler settings of cljsbuild
20:48S11001001quizdr: the cost/benefit analysis of forking clojure is more complicated than "do I have the skills to implement this?"
20:48quizdri'd imagine it is
20:49S11001001quizdr: i.e. sure, you can implement reader macros, and then use them in your libraries. But who will use your libraries then?
20:49S11001001anyway there are lots of bad ideas too, good to have principled maintenance
20:50quizdrreader macros for example would have a truly transformative power for live music coding via overtone, hence my mentioning them. not likely that pragmatic for other cases.
20:50carkthere are many good use cases for reader macros
20:51flamingnomssuch as making FORTRAN 95 valid lisp?
20:51carkactually we have quite a few of these appearing from time to time in standard clojure
20:51carkmost recently the #js reader macro was added to clojurescript, it is really a valuable addition
20:52quizdrcark, yes, but their criticism are well justified in most cases. they don't really add functionality to what you can *do* with your algorithms and those don't add power in that way. but for live music coding, where the speed in which you type affects the performance of your music (via the amazing clojure system "overtone"), they would be extraordinarily useful
20:52quizdranyway, i didn't mean to start a reader macro debate, sorry
20:52carkthey do add expressive power
20:53mrhankycark, is it just me or is there no documentation about this option?
20:53carkthe same criticism is oftentimes applied to macros
20:53eraserhdDoes anyone know of an existing Java or clojure implementation of editor-type buffers? E.g. like emacs buffers or vim buffers?
20:53carkmrhanky: ah possibly =P
20:53mrhankythat's bad :)
20:54mrhankycan you explain what this option does?
20:54quizdrregular macros truly extend the power of the language itself, while reader macros are primarily a convenience for your fingers
20:54carkmrhanky: in your cljs-build config do this :compiler {:output-to "main.js" :preamble ["js/gl-matrix-min.js"]}
20:54carkmrhanky: and so on
20:55carkmrhanky: it will add the javascript code at the beginning of your compiled cljs files, after compilation is done
20:56carkquizdr: yet they're usefull enough to have many of these inside clojure
20:57carkquizdr: #(), #', #{} ... and so on
20:58sritchiedo you guys know if there's a way to track down unused clojure functins?
20:58sritchiefunctions*?
21:00mrhankycark, are you sure this works with :foreign-libs ?
21:01carkmrhanky: actually i don't know the first thing about :foreign-libs ...
21:01carkmrhanky: actually i think foreign-libs is doing that process, before compilation
21:02carkmrhanky: but then you need a library which is compatible with the closure copiler
21:02carkcompiler
21:02carkdon't quote me on that tho, i'm not sure
21:03mrhankylibs added with :foreign-libs do not need to be compatible with closure
21:04carkmrhanky: ahyes you're right, i remember trying to make that work, but never made it
21:05carkmrhanky: for that gl-matrix.js thing, i eventually added it like i showed you, then made a cljs namespace to "import" everything
21:06carkmrhanky: like so : (def mat2d (js* "mat2d")) (def clone (aget mat2d "clone")) ...etc...
21:06carkmrhanky: not the most elegant, but it works =)
21:07danneuDatomic-free's 2-peer limit means that if I have a Prod and Staging server behind a load balancer and they connect to the same database, then I can't connect to Datomic from a `lein repl`, right?
21:10dissipatecan someone tell me why it is worth it to pay for Datomic when there are tons of NoSQL and SQL databases out there for free? not trolling here, just curious.
21:10mrcheekseraserhd: that could be just a JPanel with a CardLayout and what you need to do in there (editorkit, inputmap, etc.)..
21:12quizdrdissipate there are many commercial database options and many free database options. the question is highly dependent on your individual needs.
21:12dissipatequizdr, what is the main use case for Datomic?
21:12bitemyappdissipate: OLTP
21:13bitemyappdissipate: you don't have to pay for Datomic.
21:13bitemyappdissipate: there aren't any other viable historical databases that I'm aware of, so there aren't the plethora of options you're making it out to be.
21:14dissipatebitemyapp, sounds like a good possible solution for a stock market application?
21:14bitemyappthat is way too broad of a question to answer.
21:14bitemyappThere are a million and one things that can involve a database and the "stock market"
21:14quizdrdissipate you are not interpreting the word "historical" correctly. any database can store historical market data.
21:15dissipatebitemyapp, well, in a stock market app you need ACID
21:15eraserhdmrcheeks: I'm not interested in the graphical part, but the efficient storage, insertion, changing, and deletion.
21:15bitemyappquizdr: to be fair, datomic works better with any sort of "arrow of time" queries.
21:15bitemyappdissipate: 1. No you don't 2. good thing Datomic is ACID
21:15dissipatequizdr, what do you mean by 'historical'?
21:15bitemyappdissipate: you should be asking what *I* meant by historical.
21:15arrdembitemyapp: ok I'm coffee burned. grabbing food and gonna hop on dotaz or something.
21:15bitemyapparrdem: kk
21:15dissipatebitemyapp, what do *you* mean by historical?
21:22mrcheekseraserhd: that you'll likely need to implement it yourself..
21:23danneudissipate: i have a forum that uses datomic
21:24danneuhistory gives me a simple way to manage post edits. user can 'undo'. kinda cute
21:24dissipatedanneu, and do you use the historical feature?
21:24danneuit also gives me "moderator logging".
21:24dissipatedanneu, interesting
21:25danneudatomic is a pleasure to work with. and i can't imagine what else i'd use in clojure. sql strings? sql dsl and sometimes have to break out into sql strings?
21:26danneuthe hard part for me is the unfamiliarity
21:26dissipatedanneu, in short, what is the 'historic' feature of Datomic?
21:27danneudissipate: i dont have much of a technical understanding. i just took a chance with datomic. but a practical example is that if you have a User and they edit their email 100 times, you have all that on record
21:28danneuor if you edit their username as a moderator, you can query for all of their historical usernames.
21:28dissipatedanneu, very interesting. i'm going to have to investigate this some more.
21:28danneuthat's just a topical example
21:29xuserdissipate: haven't use it but I think is just means that a original copy of the data is kept everytime is modified
21:30xuserdissipate: think persistent data structures
21:32hyPiRiondissipate: More interesting examples is the debugging possibilities. If someone tells you they had an issue with e.g. posting a reply at 10:40 am, you can recreate the situation by specifying that queries shall run as if it were 10:40 am.
21:42arrdembitemyapp: rebooting
21:46socksyeraserhd: may be wrong, but perhaps something like a finger tree is what you're looking for?
22:11eraserhdsocksy: It seems I want a rope rather than a finger tree.
22:12eraserhdWe don't seem to have a clojure implementation around.
22:13eraserhdWell, a rope with some specific adaptation for reading files in blocks and finding things by line number.
22:14hadronzooWhat is the best way to run clj/cljs integration tests? Use clojure.test and make cljs calls using cemerick/austin?
22:16hadronzoo(I want to ensure that the clj and cljs versions of some functions produce identical values without hardcoding the results into the clj and cljs unit tests)
22:23TEttingereraserhd, http://www.ibm.com/developerworks/library/j-ropes/ this should be usable from clojure, GPL licensed though
22:27eraserhdTEttinger: Cool, thanks!
22:27eraserhdAt the moment, it seems like what I want is a core.rrb-vector of byte blocks. Still researching.
22:27TEttingerif you can read simple F#, http://fssnip.net/4e might be convertable
22:28eraserhdIt seems like rrb-vector does all the rebalancing and tree-ing.
22:30eraserhdTEttinger: the F# one only implements append, no logic for insertion (necessary in my case).
22:31TEttingerooooh I just found something
22:31TEttingerhttp://lua-users.org/wiki/SplayRopes
22:32TEttingerthese can use a pure functional datatype, splay trees, internally
22:35eraserhdTEttinger: Ooh, neat!
22:37TEttingeralso apparently they're very slow according to https://news.ycombinator.com/item?id=1370847
22:37TEttingernot sure if they're slower that stringbuilder
22:38eraserhdI don't know if they're slower, but I think for my editor use case, they should be faster.
22:38eraserhdThe whole file is rarely traversed.
22:39TEttingerhttp://programmingpraxis.com/2013/01/22/splay-heaps/#comment-6799 splay heap here, not sure how different it is
22:39eraserhdMostly the blocks of text in the editor window are accessed, so that should be O(1) after the first lookup.
22:40TEttinger(that one IS clojure)
22:43eraserhdTEttinger: splay ropes it is. That's a beautiful solution, it is.
22:44TEttingerheh, I think with all... 2 implementations, each unsuitable in different ways, mixing and matching should result in something at least. put in on github when you're done maybe?
22:44TEttingerI'd like to see it, and I bet it will be shorter than the lua impl
22:45eraserhdYeah, I'll do it in a separate repo.
23:11notsonerdysunnyis there clojure-toolbox.com like thing for clojurescript?
23:13danielszmulewiczhttps://github.com/shaunxcode/clojurescript-ecosystem/wiki/libraries
23:13notsonerdysunnyI am new to clojurescript .. what are the alternatives I should consider for shoreleave before picking
23:13notsonerdysunnydanielszmulewicz: thanks let me check that
23:14danielszmulewicznotsonerdysunny: the new rage seems to be all about React. Try Om and Cloact.
23:15technomancyI don't know anything about clojurescript, but my guess is that it would depend on what you're trying to do?
23:16notsonerdysunnyI have actually built a basic widget with cloact .. Now I needed to some communication with the server so was looking what is the right thing to do..
23:16danielszmulewiczTransfer edn with core.async?
23:16notsonerdysunnymind you I only javascript that clojurescript has taught me I am new to this browser programming thing
23:17notsonerdysunnyok let me take a look
23:19mischovYou might get some ideas googling "clojurescript xhr"
23:25sreenathhi
23:25sreenathgot a question about lein repl stand alone
23:26sreenathHow can I add jars to lein stand alone repl?
23:26technomancysreenath: you can put them in :plugins, but that's not really what it's for
23:27sreenathplugins inside a project you mean
23:27technomancyoh, I mean in the :user profile
23:28sreenathoh OK.
23:28sreenathWHat do you mean that's not really what its for?
23:28technomancywell :plugins is for plugins =)
23:29ryantmplugins are supposed to modify leiningen not inject code into your clojure env?
23:29technomancyit just happens that a standalone repl runs inside Leiningen's process, so anything you tell it is a plugin gets put on the classpath
23:29sreenathyes :). Looks like there is no simple way
23:29technomancyright; Leiningen is designed for use with projects. you can use it for other things, but that's not the original intention.
23:30technomancymaybe the lein-try plugin would help for what you want though
23:30technomancyhaven't used it myself, but from what I heard it sounds similar
23:31sreenathThanks. I have been playing around with repl for project euler problems. how can I use math dependencies
23:31sreenathin repl without project
23:31technomancythe simplest thing to do is `lein new euler` and run in that
23:31sreenathI just want to use repl lein or the clojure one
23:31sreenathOK
23:32sreenathBut I want to say one thing though. I can't understand why the math functions are not there in core
23:33technomancyhttp://p.hagelb.org/mystery.gif
23:33sreenathI mean they are available in other FP languages like Scala etc
23:34ryantmtechnomancy, did you see the GitHub pull req from davidegrayson improving lein help?
23:34sreenathAnyway Thanks technomancy
23:35technomancyryantm: yeah; I hope to take a look tomorrow; actually need to sign off for tonight
23:35ryantmtechnomancy, great
23:38eggheadhm, I have a question about cljs and packaging, you need a different html for dev/release so how is this managed?
23:38eggheadfor example a single js file vs multiple js files
23:38eggheadI know cljsbuild can give me the different outputs, but how do projects deal with the different html?
23:52flamingnomsi'm confused about lazy sequences. When I map symbol to a lazy-sequence of strings from a file, they all turn to symbols. When I map keyword, only the first is a keyword.
23:52ryantmegghead, where is your html file coming from right now?
23:52eggheadryantm: static html served by ring
23:54flamingnomsnvm, its just the behavoir of keyword
23:55ryantmegghead, are you using wrap-resource to serve it?
23:56eggheadryantm: I am doing this: https://github.com/eggsby/warden/blob/master/src/clj/warden/handler.clj#L9