#clojure logs

2012-06-23

00:00Rayneshttps://github.com/Raynes/refheap/blob/develop/src/refheap/models/paste.clj#L228 This is the code you would be replacing.
00:00Shambles_Raynes: I have to admit lack of familiarity with both refheap and pygments. I know of Jython, but never used it. I did use IronPython briefly, but mostly just CPython, which I still use occasionally for now.
00:00mmarczykRaynes: oh cool, I wanted to contribute something useful to RefHeap :-D
00:01Raynesmmarczyk: This was actually the first issue I ever created for refheap. :P
00:01RaynesNobody has ever taken it up though, sadly.
00:01Rayneshttps://github.com/Raynes/refheap/issues/2 Okay, second issue.
00:02mmarczykRaynes: oh cool, might get to close issue #2 :-)
00:02Raynes:D
00:02mmarczyknot quite as good as #1, but hey... I can live with that :-P
00:02RaynesHehe
00:02Shambles_I found refheap, and still dont know what it is. My first guess is something like Pastebin, but it's not clear from the website.
00:03RaynesShambles_: It's exactly a pastebin. There is an 'about' page.
00:03cgagyeah it's a prettier pastebin
00:03Shambles_And it looks like pygments is a syntax highlighter.
00:03mmarczykthere's also a "Paste!" button :-)
00:03RaynesHah
00:03cgagi'd like a copy to clipboard button personally
00:03Shambles_mmarczyk: The "paste" button and fact it didn't act like a REPL was the reason I guessed "a pastebin".
00:04eggsbypygments is the greatest syntax highlighter
00:04Raynescgag: Click the little question mark in the lower right corner. There is a keyboard shortcut that helps with that. It isn't optimal (a two step process) because we didn't want to use flash and there isn't support for copying to the clipboard with it in basically any browser, but it's faster than going to raw and selecting everything.
00:05Rayneswith javascript*
00:05cgagreally? i know there's a button on github, i hadn't considered how it worked to be honest
00:06Raynescgag: alt+r followed by cmd+c to copy a paste, looks like.
00:07Raynescgag: There is a button on Github for that?
00:07cgaghttps://github.com/technomancy/leiningen
00:08cgagthe tiny clipboard next to the sha
00:08cgagon the latest commit
00:08cgaglooks like it is flash though, interesting
00:08RaynesYeah, that's flash.
00:08RaynesIt's the devil.
00:08cgagi was fooled by its size and static nature... i'm used to flash being in my face
00:09RaynesHeh
00:09Raynesmmarczyk: If you do take that up and need any help, let me know.
00:10Shambles_Flash can't be that bad with las3r sticking Clojure in it, can it? ;)
00:11mmarczykRaynes: sure! skimming my old SO reply on Clojure/Jython interop to see how this might work :-)
00:14Shambles_I'm a bit surprised there's not more Clojure being used to make applets.
00:15RaynesApplets suck, so it doesn't surprise me at all.
00:36muhoois there a way to age out ring memory store sessions?
00:36muhooso that, for example, it doesn't become a big ol' leak?
00:36gfredericksdo applets suck in general or just as GUIs?
00:36muhooapplets? what is this, 1997?
00:37gfrederickshow bout that lewinsky eh?
00:37muhoothat was 1998
00:37muhooIIRC it went applets -> flash -> html5
00:38gfredericksI have foresight
00:38gfredericksmuhoo: you forgot <marquee>
00:38jhowarthHey guys, I'm running into a little namespacing/directory structure problem that I can't seem to figure out. lein repl can't seem to find one of my .clj files on the class path. https://gist.github.com/2976869
00:38muhoogfredericks: animated gifs are back with a vengeance, tho
00:39Raynesmuhoo: https://github.com/Raynes/therapy <-- Your tests here lead me to believe you don't know about the (testing "foo" ..) clojure.test feature.
00:39Raynesmuhoo: Just letting you know because it's like the best thing ever.
00:39muhoomy tests?
00:39Raynesmuhoo: Yes.
00:39gfrederickskids use the most superlatives ever
00:40muhooRaynes: wait, noir already has session aging?
00:40Raynesmuhoo: No. This is entirely unrelated to what you were just talking about.
00:41muhooRaynes: what tests specifically do you mean though?
00:41Raynesmuhoo: You added tests for noir's session stuff when you added that other stuff recently. I ripped noir's session stuff out into this library and I saw the tests and it made me want to tell you about testing.
00:41muhoooh cool. i was using clojure.test though.
00:41muhooclojure.test is extremely convenient, thoguh i'm told midje is worth looking at too
00:42Raynesmuhoo: Yes, which has a 'testing' macro.
00:42Raynesmuhoo: http://clojure.github.com/clojure/clojure.test-api.html#clojure.test/testing
00:43muhooRaynes: hehe, oic. i recognize some of that code now :-)
00:43RaynesThis would replace those comments you put between tests.
00:44muhoocool, thanks
00:44jhowarthIs this the appropriate place to ask nooby clojure questions or is there a better place?
00:44muhoojhowarth: i think you've come to the right place.
00:45muhooRaynes: i agree, that really is the best thing evar. especially that therapy-session function
00:46RaynesI'm going to see if weavejester wants to put this in Ring itself.
00:46jhowarthIf I have a lein project with a file in "src/project/db.clj", what would be the namespace for that file?
00:46Raynesproject.db
00:46RaynesIf you have src/league_tip/db.clj it should be league-tip.db
00:47jhowarthOk maybe I have a typo somewhere.
00:47jhowarthThanks.
00:48muhooRaynes: ok, should i replace those comments with that testing macro first then?
00:48muhooor are you doing that?
00:49RaynesI wasn't going to do anything at all with it, but by all means give it a go if you've got a minute.
00:49RaynesI'm lazy.
00:49muhooi suppose that's better than being eager
00:50muhoo(lazy-raynes)
00:51xeqimuhoo: someone announced an aging session store on the ring mailing list today
00:52jhowarthRaynes: It ended up being a syntax error in the file that was causing the problem.
00:52jhowarthNot sure why that manifests as class not found :(
00:52jhowarthfile not found*
00:53muhooxeqi: thanks!
00:53muhoojhowarth: because the class didn't compile? thus, it wasn't found?
00:54jhowarthThe error was that it couldn't find the db.clj on teh classpath
00:54jhowarthBut the file was on the class path
00:55jhowarthjust an odd error msg imo
01:02mmarczykRaynes: oh wait, I'll actually need to install mongo to test...? :-O any recommended version number?
01:03Raynesmmarczyk: Whatever is newest or in your distro's repository if you use Linux. `brew install mongodb` should work too if on OS X.
01:03RaynesNothing has changed between the last kazillion mongo versions.
01:04mmarczykRaynes: I'm currently on a pretty old version of Ubuntu... whatever looks like the newest thing to apt on this box is far from being so
01:05Raynesmmarczyk: It'll probably work, or you can grab the binary release from mongo's web site which should run right out of the box.
01:05mmarczykok, we'll see
01:09mmarczykRaynes: should I be able to use lein2?
01:09Raynesmmarczyk: Yes.
01:10mmarczykwell, it complains about org.mongodb:mongo-java-driver having some problem or other
01:10Raynesmmarczyk: You should not, however, be able to use `lein repl`.
01:10mmarczyklein1 doesn't complain, but lein run breaks
01:10RaynesThat sounds like a congomongo issue.
01:10mmarczykyup
01:11RaynesI don't know what's up with that.
01:11RaynesCertainly doesn't happen to me. :(
01:11mmarczykactually might be a Central issue (again?)
01:11RaynesOr wait, is this with an ancient copy of mongodb?
01:11RaynesPerhaps it just doesn't work with it?
01:12mmarczykhttps://www.refheap.com/paste/3298
01:13Raynestechnomancy!!!!!!!!
01:13Raynestechnomancy: Isn't this the issue you were talking about? lazyseq crap?
01:14muhooi have seen that error before
01:15mmarczykactually I've no idea why mongo driver 2.6.5 would be downloaded, I've got 2.7.3 in ~/.m2 and that's what lein1 copies into lib/
01:15Raynesmmarczyk: I'm getting the same error.
01:15mmarczykRaynes: lein run then?
01:15RaynesLein 1 should work just fine
01:16mmarczykwell, let's see
01:16mmarczykI tried earlier and it took a moment or two to do something noticeable, which was to print out lots of stack trace nonsense
01:17RaynesI sure don't like this at all.
01:17mmarczykguess I'll be updating mongo
01:17RaynesIf I had to restart refheap on heroku right now I'd be screwed.
01:18muhoois this another maven screwup like the one that made clojure disappear?
01:18RaynesI don't know.
01:19mmarczykwell the version of mongo I have here really is a bit out of date
01:19muhooRaynes: testing macro done.
01:19Raynesmuhoo: Already pulled.
01:19xeqiRaynes: the lazyseq error message should be fixed on master
01:19Raynesmmarczyk: I just tried with lein1 and it seems to work.
01:20Raynesxeqi: You lie.
01:20xeqiwait
01:20Raynesxeqi: Unless it was fixed in a push today.
01:20xeqiits fixed in pomegranate
01:20xeqistil waiting on a release for that
01:20RaynesGotcha.
01:20muhooRaynes: damn that was fast. drinking technomancy's seattle coffee at 1am?
01:21muhoocan't deep up with him. he's on faaaayyyyyaaaaah!
01:21muhookeep
01:22Raynesmuhoo: Yeah, therapy was a great name. Unfortunately, therapy-flash doesn't have a very nice ring to it.
01:23xeqiit might be a central problem, there are alot more versions in the repo than in http://central.maven.org/maven2/org/mongodb/mongo-java-driver/maven-metadata.xml
01:23xeqiand I bet `lein deps :tree` is no help since it can't resolve it
01:25muhoothat sounds a lot like what happened a few weeks ago to clojure in maven central :-/
01:27muhooxeqi: thanks, that was exactly what i was looking for (https://github.com/diligenceengine/aging-session)
01:43mmarczykRaynes: got the mongo thing working
01:44Raynesmmarczyk: Excellent!
01:45mmarczykRaynes: a few moments ago, actually... trying to find a nice way to deal with the following absurdity: http://dev.bostone.us/2010/12/01/python-pygments-in-java-with-jython/#awp::2010/12/01/python-pygments-in-java-with-jython/
01:46Raynesmmarczyk: I'm taking off for a while so I wont respond. Email me if you need anything.
01:46mmarczykRaynes: ok
01:48Leonidasall other systems just run external shell commands to interface to pygments *sigh*
01:54mmarczykLeonidas: other than what?
01:55Leonidasmmarczyk: JVM.
01:55mmarczykLeonidas: RefHeap currently does the same thing
01:55LeonidasRefHeap runs on the JVM, right?
01:56mmarczykwell yes, it's written in Clojure
01:56Leonidasso my point is still valid
01:56mmarczykis it?
01:57mmarczykabove I meant that RH shells out to pygmentize
01:57Leonidasmmarczyk: ah, ok then I misunderstood
01:57mmarczykyeah, awkward phrasing on my part
01:58mmarczykwith Jython available it's tempting to run Pygments inside the JVM though
01:59Leonidaswell, Jython doesn't really have the steam behind it as CPython, so you might run into issues that noone before had
01:59mmarczykanyway -- how does one convince lein to put a custom jar (created in a repeatable fashion during a custom bootstrap stage of a project) on the classpath and on the list of things to include in the uberjar?
01:59Leonidas(IronPython even worse)
01:59mmarczykapparently Jython is supposed to be able to run Pygments
02:00newb_clj_0123i have ring + aleph (for websocket) setup; I also have clojurescript setup. I also have moustache setup. I also have google closure posting GET and POST requests. Now, the only that I don't have is the proper way for clojure to respond to ajax requests.
02:00xeqiduring the bootstrap install it to the local maven cache
02:00newb_clj_0123question: what is the correct format for responding to ajax request? is it just json?
02:01mmarczykalbeit not without some weird tricks some aspects of which are tripping me up
02:01xeqinewb_clj_0123: you mean the content-type ?
02:01mmarczykxeqi: heh, right -- thanks
02:01newb_clj_0123xeqi: I mean in my ring handler
02:01mmarczykxeqi: will probably do that for now, though I'd love to avoid it
02:01newb_clj_0123how I should respond
02:09xeqinewb_clj_0123: does https://github.com/ztellman/aleph/wiki/HTTP help?
02:09newb_clj_0123xeqi: I don't thikn so
02:09newb_clj_0123the problem is that on my clojurescript side, I send an ajax request
02:09newb_clj_0123then on the clojure side, I can read the POSt request (I can read the json as a table)
02:09newb_clj_0123then on the clojure side, I send a table back
02:10newb_clj_0123unfortunately, I can't read it as a json on the clojurescript side
02:10newb_clj_0123on the clojurescript side, the response gets read as NULL / empty string
02:10muhoommarczyk: lein local-repo, iirc
02:10newb_clj_0123mentioning aleph was probably a bad idea
02:10newb_clj_0123at the moment, I'm not using web sockets yet
02:11newb_clj_0123since I can't even get something as simple as ajax to work
02:11muhoommarczyk: http://blog.cymen.org/2012/03/12/leiningen-and-lein-localrepo-how-to-create-local-maven-repository-for-jar-files/
02:12mmarczykmuhoo: thanks, that's interesting, though I'll just use mvn install for RefHeap (which shouldn't have too many mvn-related dependencies)
02:13mmarczykprobably
02:14newb_clj_0123xeqi: got it working :-)
02:14newb_clj_0123i needed to use clojure.data.json/json-str
02:15xeqiI was just about to ask what json lib you were using server side
02:15xeqialso look at chesire for that in the future
02:15xeqibut if your doing clojure <-> clojurescript, I don't think you need json
02:15mmarczyknewb_clj_0123: you might want to consider using pr(n) and read-string
02:16xeqiyou can just send clojure data
02:16xeqias mmarczyk is mentioning
02:16muhoopr()n ?
02:16mmarczykright. (:require [clojure.reader :as reader]), (read-string ...)
02:16mmarczykpr and prn
02:16mmarczykthe above on the cljs side; read-string is in core on the jvm
02:17mmarczykalso, I meant to say (reader/read-string ...)
02:17newb_clj_0123it would print 0 n times
02:17newb_clj_0123so for example (pr0n 5) = "00000"
02:17newb_clj_0123one could define it as (defn pr0n [n] (apply str (repeat "0" n)))
02:18newb_clj_0123how would print-string and read-string work ?
02:18newb_clj_0123so my ajax request are sent through google closure library
02:18newb_clj_0123and afaik, google closure was not written with clojurescirpt in mind
02:18mmarczyknewb_clj_0123: suppose you have a map {:foo 1, :bar 2} which you want to get across to the server
02:19newb_clj_0123mmarczyk: sure
02:19mmarczyknewb_clj_0123: you submit a request with (prn {:foo 1, :bar 2}) as the body
02:19mmarczyknewb_clj_0123: you read-string it in on the server side
02:19newb_clj_0123on the server side; I get a XrhIO request object
02:19newb_clj_0123what do I call read-string on? [note, this is the first time in my life i'm using ajax]
02:20mmarczyknewb_clj_0123: well on the server side you're handling a request
02:20newb_clj_0123[learning CLojureScript + Google Closure + Ajax has been quite an experience]
02:20newb_clj_0123so (fn [request] .... )
02:20newb_clj_0123what does in .... ?
02:20newb_clj_0123request is a goog.net.XhrIo object
02:20mmarczyknewb_clj_0123: lots of stuff on your plate :-)
02:20mmarczyknewb_clj_0123: XhrIo lives on the client side
02:20muhoonewb_clj_0123: mmarczyk: there's also http://github.com/ibdknox/fetch too
02:20mmarczyknewb_clj_0123: the server sees a request which it needs to handle
02:21newb_clj_0123this is via compojure
02:21muhoowhich is like ajax in pure clojure
02:21newb_clj_0123so I have something like defrost "/post-request" {params :params} ...
02:21mmarczykoh cool
02:21newb_clj_0123s/defrost/defroutes/
02:21newb_clj_0123defrost != typo; defrost = stupid spell autocrrect
02:22newb_clj_0123I should also add; Chrome's debugger is amazing
02:22mmarczykso you take the request's body
02:22mmarczykread-string it in
02:22mmarczykyou get the map -- {:foo 1, :bar 2}
02:22mmarczykprocess it, say the result is [1 2 3]
02:22newb_clj_0123sure
02:22mmarczykyou prn the result obtaining "[1 2 3]"
02:22newb_clj_0123btw
02:23newb_clj_0123the server reading the ajax request
02:23newb_clj_0123this part already works
02:23mmarczykand send that off to the client as the body of your response
02:23newb_clj_0123compojure handles it very nicely
02:23mmarczykthen an event handler fires off on the client side
02:23mmarczykbecause the response has arrived, right? so you pull out the body of the response and clojure.reader/read-string it in
02:24mmarczykand you get [1 2 3] on the ClojureScript side
02:24newb_clj_0123hang on
02:24newb_clj_0123read-string is also on the clojurescript side
02:24newb_clj_0123hmm
02:24newb_clj_0123interesting
02:24mmarczykyes, as long as you (:require clojure.reader) in your ns declaration
02:24xeqicljs.reader ?
02:24newb_clj_0123call this pain is starting to be worth it
02:24mmarczykah, possibly :-)
02:24mmarczykyeah
02:25mmarczykso (ns foo (:require [cljs.reader :as reader]))
02:25mmarczykyou can also send tagged literals across
02:26mmarczykat least on cljs master... probably latest release too
02:26mmarczykand that's awesome :-D
02:26xeqiwould need 1.4.0 on server side
02:27mmarczykright
02:27xeqialso use (binding [*read-eval* false] (read-string s)) on the serverside
02:28xeqithat *read-eval* false is very important
02:28mmarczyk{:name "Sancho" :uuid #uuid "e308e238-74a9-43db-a69a-39c883bf79ac" :last-seen #inst "2012-06-23T06:28:15.140-00:00"}
03:42Raynesmmarczyk: Any luck?
04:26mich2anyone awake here and has read the paper 'out of the tar pit'?
04:33mich2I see the us is sleeping :O
06:57VickyIyerHi does anybody know of a site where I can find a tutorial where a web app is build using clojure
07:07_ulisesVickyIyer: you can try webnoir.org or the tutorial on heroku
07:07_ulisesVickyIyer: but it really depends on the libs you want/have to use
07:09VickyIyerThank you _ulises question by libs do you mean some kind of fraework like spring or just diffrent APIS of doung the same thing
07:09_ulisesVickyIyer: I'm thinking of things like noir, compojure or just plain ring
07:09_ulisesVickyIyer: it's more to do with templating, routing, etc.
07:10_ulisesVickyIyer: and then of course you need to store your data somehow
07:10VickyIyerok thanks I don't know about these will look them up
07:10_ulisesVickyIyer: noir is tiny and simple; it should get you started in no time
07:25borkdudeVickyIyer Noir is good, but for understanding I also like this article: http://brehaut.net/blog/2011/ring_introduction
08:29cshell_does anyone know how to trigger a recompile of a protocol/record within an REPL so I don't have to bounce it?
08:39cshell_looks like it's as simple as (compile
09:29espeedHow do you import nested Java classes that are in separate files?
09:49gfrederickslein-cljsbuild is driving me nuts
09:51gfrederickswhen I run it on auto I get require errors
09:51gfredericksbut if I do `rm -rf .lein-cljsbuild-compiler-0/ main.js && lein clean && lein cljsbuild once` then I'm okay
10:01mmarczykRaynes: got it working! :-D
10:03mmarczykRaynes: only problem is it involves a rather ugly hack which I'll need to give some extra thought
10:22nonrecursivehello - is there an easy way to debug code in the jars stuck in /lib by leiningen?
10:22nonrecursiveI suppose I could unzip the jar, edit the file, and zip it back up?
10:31cshell_what do you mean debug code?
10:31cshell_just inspect the source?
10:33nonrecursiveI want to modify it
10:33nonrecursivethrow some println's in there
10:33nonrecursiveit would be nice to be able to set breakpoints but I don't know how to do that
10:35nonrecursivei have a noir site running and ideally i'd be able to get a repl in the terminal where "lein run" is running
10:36WillMacNew to clojure. I'm understanding basics, but stuck building first real program. Is there a good tutorial with tips on breaking down a problem?
10:37cshell_nonrecursive: you can use robert.hooke library to wrap methods you're interested in - also you can start noir from the repl as well and then you'll be in the repl where noir is running
10:37cshell_WillMac: The Clojure Programming book has a lot of things like that
10:38nonrecursivecool cool, thanks cshell_
10:38cshell_also, if you want breakpoints you can enable debug just like any other jvm process but I don't know how the line numbers transfer over
10:39cshell_if you're using an ide
10:40nonrecursivecshell_: i'm using emacs. also, just started noir from the repl - this is awesome, thank you :)
10:41cshell_nonrecursive: no problem, glad it helped
10:42nonrecursivei have so much power now
10:42cshell_haha, yeah:)
10:42WillMaccshell_: Thx I've seen it. A friend suggested starting with the data structure for program and then think about the transformations. Would you agree?
10:42cshell_nonrecursive: also, there's a (with-noir ..) macro that can give you all the binding you need if you dont' start the full server up
10:43nonrecursivewow, very nice
10:43cshell_WillMac: Yes, that wouldn't be a bad place to start - get your data right then the coding becomes simple :)
10:43nonrecursivechsell_: thanks a million
10:43cshell_nonrecursive: anytime
10:43nonrecursiveWillMac: what are you thinking of doing? just curious
10:45WillMaccshell_: A fantasy football draft player recommender.....lol...thought it would be fun...I did it in excel last year
10:46cshell_WillMac: those are the kinds of fun things to learn a new programming language with
10:46WillMaccshell_: If I can reproduce what I did in excel, I want to expand it to more advance simulations
10:47cshell_WillMac: cool, well Clojure takes a little time to learn the idiomatic ways of doing things, but once you get there it's very satisfying
10:49WillMaccshell_: I have written the small functions (koans, Euler, etc), but still get lost following larger programs or breaking down the problems without falling back to imperative thinking
10:50VinzentWillMac, be aware of protocols and datatypes: with them you can easily fall into OO design!
10:51cshell_WillMac: One way that might help when trying to think declaratively vs imperatively is that imperative programs can go deep into the stack - declarative stacks tend to be very shallow
10:51cshell_so if you see yourself going into this method then that method then another all under the same call stack, it's an opportunity to switch to declarative
10:51WillMaccshell_: good tip
11:00mmarczyknonrecursive: you could also switch to checkout dependencies (see Leiningen's docs) and just edit the code directly; also, Emacs can edit jar files -- you get a dired-like buffer from which you can open individual files in the jar which you can then edit and save right back into the jar
11:01mmarczykwhich is kinda neat, no? :-)
11:01nonrecursivemmarczyk: very nice, thanks. I was trying to edit the files directly in emacs but they weren't saving for some reason
11:01cshell_mmarczyk: that is cool
11:01mmarczyknonrecursive: oh? I just double checked that it works for me
11:02cshell_mmarczyk: he might not have done the lein checkout deps
11:02mmarczykI mean I double checked the edit-jar-in-Emacs thing
11:02nonrecursivemmarczyk: Yeah I get the message "Selecting deleted buffer"
11:03cshell_will lein re-pull deps from remote repos and overwrite the changes?
11:03mmarczykhm, I'm not sure I know how to troubleshoot this, but the folks in #emacs will
11:03mmarczykcshell_: stuff in checkouts/ takes precendence and lein never touches it
11:05cshell_sweet
11:05mmarczykit is :-)
11:07gfrederickshow do I get emacs to start clojure-mode when opening *.cljs files?
11:07cshell_gfredericks: I thought there was some file you had to add cljs too
11:07cshell_er, to
11:08gfrederickscshell_: well. alright.
11:09nonrecursivegfredericks: I think it'd be something like (add-to-list 'auto-mode-alist '("\\.cljs$" . clojure-mode))
11:09Vinzentgfredericks, up-to-date clojure-mode does it for you
11:09gfredericksoh I need to up-to-date my clojure-mode then
11:09cshell_gfredericks: sorry man, I wish i was better with emacs
11:09gfrederickswhich means I need to remember how I installed it in the first place
11:10gfrederickswhat is font-lock?
11:10Vinzentsyntax highlighting
11:14gfredericksmaybe I need clojurescript-mode.el as well
11:16gfredericksah very nice, that did it
11:42clj_newb_02357this is amazing
11:42clj_newb_02357clojurescript is actually fun now
11:43clj_newb_02357it's just somewhat unfortunate that given the current state of the clojurescript compiler / debugger, the lack of good closure examples, the learning curve is a vertical line
11:44borkdudejust rotate the plane
11:44clj_newb_02357by 135% degrees, then go skiing
11:45clj_newb_02357what's so amazing about learning clojurescript
11:45clj_newb_02357is that coming from no web development background
11:45clj_newb_02357i managed to learn jquery just in the times that I was cursing at clojurescript
11:52mmarczyk:-)
12:01cshell_clj_newb_02357: clojurescript is the same as clojure - so if you know clojure, you'll know clojurescript
12:02cshell_clj_newb_02357: minus some stm and thread stuff
12:02clj_newb_02357except for the whole java vs google closure thing
12:02clj_newb_02357the languages are similar
12:02clj_newb_02357the libraries is another story
12:03cshell_clj_newb_02357: yes, different host languages
12:03clj_newb_02357which results in different developemnt styles
12:03clj_newb_02357for example
12:03clj_newb_02357in clojure, I generally writes lots of code than test
12:03clj_newb_02357in clojurescript, I test after every 3 lines
12:03clj_newb_02357because I love debugging in javascript
12:03progo:)
12:06clj_newb_02357i also wonder if there is (clean) way to setup amcros so that
12:06clj_newb_02357(function [some ajax call]) ends up beging wrapped to ([some ajax call] ... with function as callback handler)
12:06clj_newb_02357basically, despite the fact that ajax calls are async; I'd like to reason about my program as if time flowed in a syncronouhs manner
12:09zomgclj_newb_02357: have you thought about using a library like async? It lets you do that to some degree. It is a JS library, not how well it will flow with ClojureScript though :)
12:09clj_newb_02357no; I started my javascript experience with clojurescript
12:09zomgOh I see
12:10clj_newb_02357yeah; I hear it's slightly better than php
12:10zomgJavaScript or Clojure? :)
12:10zomgWell, no matter, depends on who you ask and what you wanna do I guess :D
12:11nonrecursivein noir, one of my views has ends up doing some image processing - is there a way to throw that in another thread and return a response to the browser?
12:11clj_newb_02357unfortunately, I think market cap of PHP values beats market cap of CLojure Companies
12:12edoloughlinDoes anyone using Compojure know how I supply my own wrap-params to handler/api?
12:18cshell_nonrecursive: user fugures?
12:18cshell_,(doc future)
12:18clojurebot"([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?."
12:18cshell_nonrecursive:oops, I meant 'use futures?'
12:19nonrecursivechsell_: tx - i just tried using an agent and that worked, too. I don't ever dereference the var - does that matter?
12:19oskarth_Trying to install datomic but failing to install it with both leiningen (can't find datomic) and mvn (can't find pom file). Any ideas?
12:22cshell_cshell: if you don't need the value stored in the atom it shouldn't change the fact that it gets updated
12:22cshell_nonrecursive: that was for you
12:22nonrecursivecool thanks cshell_
12:23cshell_nonrecursive: if you're never reading from it, what are you using it for? are you putting the results in an external datastore - side effect like?
12:23nonrecursiveyeah, doing image processing then uploading to s3
12:23oskarth_solved it
12:25cshell_nonrecursive: are you sure that using an atom uses a separate thread?
12:25cshell_,(doc atom)
12:25clojurebot"([x] [x & options]); Creates and returns an Atom with an initial value of x and zero or more options (in any order): :meta metadata-map :validator validate-fn If metadata-map is supplied, it will be come the metadata on the atom. validate-fn must be nil or a side-effect-free fn of one argument, which will be passed the intended new state on any state change. If the new state is unacceptable, the ...
12:25nonrecursiveusing an agent
12:25cshell_ah
12:25nonrecursivePD
12:25nonrecursiveer
12:25nonrecursive:D
12:27cshell_nonrecursive: are you using send or send-off?
12:28nonrecursivecshell_: send
12:28nonrecursivecshell_: oh hmmm i was thinking it's not IO bound bc it doesn't hit my disk but I suppose network traffic counts as IO
12:28cshell_yeah :0
12:28cshell_:)
12:28nonrecursivehaha
12:29cshell_nonrecursive: I think send-off might be better
12:29nonrecursivecshell_: thanks i'll switch to that
12:31cshell_nonrecursive: cemerick's book on page 209 says, "Thus, send must never be used for actions that might perform I/O or other blocking operations"
12:31cshell_nonrecursive: just as a sourced referenced
12:31nonrecursivecshell_: thanks - I read that and thought to myself "Good thing that doesn't apply here!"
12:32cshell_hehe
12:33nonrecursivecemerick's book is definitely my favorite of the three or four that I've gone through
12:33cshell_mine too - it answers almost every question I've had coming from java to clojure
12:34cshell_some of the others are jokes in comparison
12:34nonrecursivecompletely agree
12:34cshell_I'm getting tired of the books that have 14 chapters of building one example
12:35cshell_cemerick's is basically a complete reference
12:35borkdudethe "batteries included" clojure book
12:36nonrecursiveheh yeah
12:36cshell_but now i'm wondering what the difference between agents and futures are - and when to use one over the other
12:36cshell_for shared state between threads?
12:38nonrecursiveit looks like all futures don't give you the control of using a thread pool or not
12:43borkdudefutures are expressions to be executed in the future , agents are data, waiting for functions to be executed on them
12:43alexyakushevHello, can anyone help me, please? I have two Java classes A and B, B extends A. A contains method foo(), B doesn't override it. I'm using gen-class to extend B, and I want to override method foo(), but inside I want to call super.foo(). When I use :expose-methods, it exposes foo() method from B which is non-existent. What should I do?
12:44nonrecursiveborkdude: tx
12:44cshell_borkdude: nice, concise response - thanks
12:51cshell_nonrecursive: do you think that futures are the better way to go since you never look at the data?
12:51nonrecursivecshell_: yeah I think so
12:52cshell_nonrecursive: that's what I was thinking too
12:53nonrecursivecshell_: yeah when I created the agent I passed it some data but it felt shoehorned in
12:59alexyakushevAny ideas?:(
13:01oskarth_Anyone managed to get diatomic working with lein repl? I get a ClassNotFoundException for MapMaker when I try to use datomic.api
13:02borkdudealexyakushev I'm sorry, no idea
13:14SrPxIs clojure a suited language for the creation of a tcp game server?
13:18AimHereIt's a proper general-purpose programming language, so there's no real reason why not
13:19SrPxAimHere: I'm asking this because of the jre i'm not sure how it works or if it can be used for scalable projects
13:20AimHereDedicated networked game server programs are usually quite small dinky things, if I'm not mistaken. Even if it doesn't scale, Clojure is probably a pretty good language for knocking up a quick prototype in
13:21OmerHi
13:24VickyIyerHi I was working out an example from a clojure book I recently bought on reduce, this is what I did (defn number-square [m v]
13:24VickyIyer ((assoc m v(* v v)))) and then I applied reduce (reduce number-square {} [1 2 3 4 5]) this keeps giving me an error, my understanding is reduce will take the function number-square and apply it with {} and each element of the vector wiht the preceeding result, is my understanding correct
13:25alexyakushevVickylyer: you probably don't want two sets of parentheses around your number-square implementation
13:25tmciverVickyIyer: yes, so number-square should be a function of two args
13:26alexyakushev,(reduce (fn [m v] (assoc m v (* v v))) {} [1 2 3 4 5])
13:26clojurebot{5 25, 4 16, 3 9, 2 4, 1 1}
13:26VickyIyeryep got it thanks a lot , I think I had an extra pair or parentheses
13:28OmerHow would I go about downloading an image from a specified URL?
13:29cshell_http get
13:36nonrecursivei'm trying to get a set of all hash values for a particular key
13:36nonrecursiveso far I have
13:36nonrecursive(reduce #(into % [(:team %2)]) #{} [{:team 1} {:team 1} {:team 2}])
13:36nonrecursiveand
13:37nonrecursive(set (map :team [{:team 1} {:team 1} {:team 2}]))
13:37nonrecursivewondering if those make sense, or if there's a more idiomatic way?
13:39tmcivernonrecursive: ##(set (mapcat vals [{:team 1} {:team 1} {:team 2}]))
13:39lazybot⇒ #{1 2}
13:40nonrecursivetmciver: the maps actually have more than one key
13:41tmcivernonrecursive: how about ##(set (mapcat #(:team %) [{:team 1} {:team 1} {:team 2}]))
13:41lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
13:41tmciveroops
13:42nonrecursivethat looks like it does the same as (set (map :team [{:team 1} {:team 1} {:team 2}])) - wondering why I would want to use mapcat?
13:43tmcivernonrecursive: yup, I forgot you put that one. I think that's the most idiomatic then.
13:44nonrecursivetmciver: thanks :)
14:12VickyIyerone more quick question (apply * [1 2 3]) gives 6 which is fine but when I try (apply clojure.String/lower-case ["LOVE" "Clojure]) it gives an error I thought it will give something like loveclojure as answer, can someone explain please
14:13cshell_,(apply clojure.string/lower-case '["LOVE" "Clojure])
14:14clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
14:14cshell_,(apply clojure.string/lower-case '["LOVE" "Clojure"])
14:14clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>
14:14cshell_,(apply clojure.string/lower-case ["LOVE" "Clojure"])
14:14clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>
14:14cshell_,(apply clojure.string/lower-case '("LOVE" "Clojure"))
14:14clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>
14:14cshell_heh
14:14cshell_better to use map
14:14mboeh,(clojure.string/lower-case "LOVE" "Clojure")
14:14clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>
14:14mboehThat's what it expands to
14:15cshell_,(map clojure.string/lower-case '("LOVE" "Clojure"))
14:15clojurebot("love" "clojure")
14:15cshell_,(map (comp str clojure.string/lower-case '("LOVE" "Clojure")))
14:16clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map>
14:16cshell_,(map (comp str clojure.string/lower-case) '("LOVE" "Clojure"))
14:16clojurebot("love" "clojure")
14:16rlb(str "foo" "bar")
14:17rlb(apply str (map clojure.string/lower-case ["LOVE" "Clojure"]))
14:17VickyIyerok the first time the apply applive to "LOVE" and a lowercase is produced now should it should apply ro the second argument and produce clojure, I still don't undestand why it is producing an arity exception
14:17mboehBecause (apply x [a b c]) expands to (x a b c)
14:17cshell_VickyIyer: it applies the function to the list that you provide
14:18cshell_not each arg individually
14:18cshell_that's what map or reduce can do
14:18mboeh* applies to an indefinite number of arguments but lower-case only applies to one
14:18rlbright, lower-case only accepts one argument
14:18rlb(lower-case "x" "y" "z") isn't legal
14:18VickyIyerGot it now thanks a ton
14:19cshell_rlb had it right ,(apply str (map clojure.string/lower-case ["LOVE" "Clojure"]))
14:19rlbor you can invert that
14:19cshell_,(apply str (map clojure.string/lower-case ["LOVE" "Clojure"]))
14:19clojurebot"loveclojure"
14:19rlb(clojure.string/lower-case (apply str ["LOVE" "Clojure"]))
14:22cshell_or even (clojure.string/lower-case (str "LOVE" "Clojure"))
14:22rlbright -- didn't know if we had to assume an input coll.
14:23cshell_good point
14:35TroyMGhi all. I have a dumb clojure question: I realize that clojure is a functional language and thus I shouldn't be mutating state, but I'm trying to whip up a todos app (using Noir) just to teach myself the basics and would like to be able to add/remove todos from a list without having to integrate with a database yet. what is the best way for me to approach that?
14:37rlbTroyMG: I'm sure there are more informed opinions, but for now, I imagine you could use an agent to maintain the state.
14:37tmciverTroyMG: I've done something similar using refs.
14:38TroyMGrlb: I'm reading up on agents now to see how I would use that
14:38TroyMGtmciver: okay, I'll look up refs too
14:39rlbI imagine that whether refs, agents, or both are more appropriate depends on exactly what you want to do.
14:41mboehCould anybody help me in figuring out how to parallelize a little program I've been working on?
14:41rlbmboeh: one way to find out ;>
14:42borkdudeTroyMG just an atom would do
14:42TroyMGrlb: honestly all I want to do is the equivelant of push/pop to an array on get/post in the todos web app
14:42mboehhttps://github.com/mboeh/mass-download/blob/master/src/mass_download/core.clj
14:42TroyMGborkdude: okay thanks - I'll look up atoms
14:42borkdudeTroyMG but an atom isn't per session, but globally
14:42TroyMGborkdude: that is fine for my usage here. obviously if this was a real app I'd be using a database
14:42rlbTroyMG: borkdude may be right too -- atom's the simplest primitive.
14:43TroyMGI'm just trying to constrain which portions I have to learn all at once :-)
14:43mboehI'd like to call http-download in multiple threads but store-file in only one
14:43borkdudemboeh that sounds like agent to me
14:43mboehBecause store-file will eventually be rewritten to store the files in a ZIP archive instead of to the filesystem
14:43borkdudemboeh o no sorry, I didn't read it right
14:43rlbi.e. more or less just a mutable binding with validation, but bear in mind that it may call the mutator more than once.
14:44mboehI've taken several stabs at using agents here and I can't figure it out
14:46rlbmboeh: have to go for a bit, but I may have time to take a look later.
14:47mboehrlb: Cool
15:11TroyMGthanks for hte help borkdude rlb and tmciver - I got what I needed working by using an atom
15:23Raynesmmarczyk: I thought Python *was* an extra ugly hack?
15:23RaynesOOH, BURN.
15:24AimHerePython's surely a pretty hack
15:24AimHereSomeone made pseudocode execute
15:32mmarczykRaynes: heh, I quite like Python actually :-) in case you'd like to have a look at the current WIP branch, https://github.com/michalmarczyk/refheap/tree/pygments-via-jython
15:34mmarczykRaynes: I'll be back later to put the finishing touches on it and maybe make the bootstrap a little less ridiculous
15:35RaynesHaha
15:35Raynesmmarczyk: Can't you just depend on jython?
15:36mmarczykRaynes: tried it, couldn't get it to import pygments
15:37mmarczykRaynes: perhaps an uberjar would work, but I found this solution and wanted to see if everything else works
15:37uvtcmmarczyk, I like Python as well. Very easy to get the hang of, though I'm not crazy about its docs.
15:37mmarczykoh? I thought the standard library docs are quite good
15:38mmarczykI also have an extremely vague recollection of finding the tutorial useful :-)
15:38uvtcmmarczyk, they seem to be complete, but not as useful to me as the Perl 5 docs.
15:38mmarczykah, Perl does seem to have great documentation
15:39uvtcmmarczyk, The Perl 5 docs come right out and tell you at the top how to use a given module. Python docs are more roundabout, IMO.
15:39mmarczykhm, I never learned Perl, but wanted to do it over the summer out of curiosity
15:39mmarczykthat's certainly encouraging
15:40uvtcmmarczyk, Perl 5 is funny: it's got a lot of warts and weirdness, but it's got 2 things that no one else can beat, IMO: (1) great docs and (2) the CPAN.
15:42mmarczykI wonder about the possible utility of Clojure::Script :-)
15:44mmarczykanyway, warts and weirdness can be a boon to one interested in a for-fun summer project, right?
15:45borkdudeI only used Perl superficially, but it looked a lot like PHP to me
15:46borkdudebut I only used PHP superficially as well, for what it matters
15:46Raynesmmarczyk: We also have to make sure we don't do anything that wont work on Heroku, but I don't think you are. Just mentioning it.
15:46uvtcmmarczyk: It's certainly useful to know some Perl 5. Perl 5 is built around being *useful* and handy (for scripting, working with text and the OS). In fact, seems like Clojure has something in common with it, in that context.
15:47Raynesmmarczyk: So, what's cool is that since the bootstrap script gets called when Heroku is building refheap, it puts it in the slug or whatever so the fact that you don't have write access to the file system doesn't seem to matter.
15:49mmarczykRaynes: good. maybe doing lein deps && ./boostrap.sh && lein trampoline run prod would work, with bootstrap placing the reconstructed jython jar in lib
15:49mmarczyk(completely ridiculous)
15:49uvtcborkdude, from what I know of PHP, it's got some cosmetic similarity to Perl. But that's about it. PHP seems to be a handy glue for connecting web <--> other libs.
15:50uvtcSorry, getting a bit off-topic. :)
15:50borkdudeuvtc that must be it, I only remember the $ signs from them ;)
15:51mmarczykuvtc: looking forward to diving in :-)
15:51uvtcmmarczyk: Diving into Perl 5?
15:51mmarczykyup
15:54uvtcmmarczyk, if you're interested in suggestions, I suggest that your first stop be: http://modernperlbooks.com/books/modern_perl/ . Something else that was just written and that I suspect is probably very good is the book discussed at http://blogs.perl.org/users/ovid/2012/06/read-my-book-online-for-free.html .
15:55Raynesmmarczyk: Fwiw, if this is how it has to be, I think I'm okay with it.
15:56Raynesmmarczyk: One thing I'm wondering is how fast this is though, since it does (PythonInterpreter.) every time.
15:56RaynesIs that literally initializing a new Python interpreter every time?
15:57RaynesShouldn't we be able to reuse the same one?
15:57mmarczykuvtc: thanks for the tip!
15:57uvtcmmarczyk, sure, y/w
15:57mmarczykRaynes: yeah, I think so
15:58RaynesThis is really cool though. I tried doing this before but just couldn't figure it out.
15:58RaynesOr I gave up before I figured it out.
15:58RaynesOne or the other.
15:59zach_Noir issue: upgraded from 1.2.1 to 1.3, and all of my tests that called with-noir began to error out with a unable to resolve var exception on noir.session/*noir-flash*... Any ideas?
16:00RaynesThat's weird -- it's still there. One thing to note is that flash sessions completely changed in 1.3 and probably broke the code you have that uses them in strange ways.
16:01zach_Raynes: I have very little code at the moment... I'm currently only testing validations with noir.validation
16:03ibdknoxRaynes: I bet when we added *noir-flash* we just didn't add it to with-noir
16:03Raynesibdknox: No, it's there.
16:03ibdknoxoh weird
16:03RaynesUnless he is using a beta/alpha from before we added it?
16:04ibdknoxmaybe
16:04Rayneszach_: What version are you using?
16:04Raynesbeta8 is the current.
16:04zach_Raynes: That'll likely be the problem. One moment,
16:04frozenlockibdknox: Hey I wanted to thank you, I've been using Noir and it works really well! :)
16:05ibdknoxcan't thank me without thanking Raynes these days :)
16:05ibdknoxbut you are quite welcome
16:05Raynes<3333
16:05frozenlockOh really, my apologies... thank you Raynes :)
16:05RaynesAw shucks mister.
16:05akhudekhmm, I wish bultitude would tell me *which* jar is causing "error opening zip file"
16:06mmarczykRaynes: cool :-)
16:06RaynesAll of them!
16:08akhudekanyone have any tips for how to track this down aside from the usual lein clean && lein deps?
16:08zach_Raynes: new error @ beta-8... ClassNotFound - org.mortbay.jetty.Server. lein2 deps :tree shows org.eclipse.jetty/jetty-server pulled in through the ring jetty adapter?
16:08RaynesI think the packages changed.
16:09Raynesorg.mortbay vs org.eclipse or vice versa
16:09zach_Is there something I can do to fix this on my end?
16:09RaynesI don't know why it'd happen in the first place. I haven't seen anything like that. I use beta8 in production.
16:10zach_Okay, thanks anyways.
16:12akhudekcurious, the error only happens when I use lein run, but not via netbeans repl with deps from pom.xml
16:28zach_Raynes: Hah! Thank god I watched cemerick's why you'll hate clojure talk yesterday... aot compiling was still referencing the old jetty dependency from 1.2.1...
16:28RaynesHah
16:28RaynesAOT is a pain in the ass.
16:33akhudekRaynes: didn't even notice that bultitude is yours until just now. Any idea what the usual cause for the "error opening zip" is? I assume a bad jar, but I'm having a hell of a time tracking it down.
16:33Raynesakhudek: It usually means a jar got corrupted while being downloaded or the jar is actually corrupted on the server. It's pretty hard to track down.
16:34Raynesakhudek: You could delete each artifact in your ~/.m2 one at a time until it stops.
16:34RaynesAssuming it isn't corrupted in the repo.
16:34borkdudeor unzip all and see where that ends
16:34RaynesThat's an option.
16:35RaynesYou could open each jar in Emacs until you find the one that breaks.
16:35mmarczykRaynes: I'm not sure where to download the jython_installer jar from -- can't seem to find a working direct link on sourceforge :-/
16:35akhudekhmm, thanks
16:35Raynesmmarczyk: What is it licensed under?
16:36mmarczykRaynes: Python Software Foundation License Version 2
16:36akhudekI'm trying a sligthly different tactic here, cloning a few functions from bultitude and getting it to print the file names as it goes through them
16:36mmarczykno idea if it's compatible with EPL
16:36mmarczyklet's google
16:37Raynesmmarczyk: Is that code for "You can put this up for download yourself?" is what I'm wondering. We obviously don't want to put it in the repo, but I can host it on my VPS or something if necessary.
16:37RaynesIt doesn't need to be compatible with the EPL for that, methinks.
16:37mmarczykRaynes: ah, yes, distribution is ok
16:37Raynesmmarczyk: Point me to it and I'll throw it on my server.
16:38mmarczykRaynes: http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar/download
16:40RaynesWow, either crisis is turtle slow at the moment or sourceforge is capping my download at like 0.1 bytes per hour.
16:40Raynes:p
16:44Raynesmmarczyk: http://raynes.me/hfiles/jython_installer-2.5.2.jar
16:44mmarczykRaynes: thanks!
16:49mmarczykRaynes: I'm having serious issues with the hotkeys when testing locally, btw -- basically I get locked into a line number prompt whenever I press the super key, which is part of the virtual desktop switching chord I use
16:49RaynesYikes.
16:50Raynesmmarczyk: None of those should even respond to the super key, right?
16:50mmarczykright
16:50RaynesMy javascript guy isn't around.
16:50RaynesIs it usable at all?
16:50mmarczykyeah
16:50mmarczykno big deal
16:50RaynesOpen an issue for it if you don't mind.
16:51mmarczyksure, though I've no idea what the problem is
16:51mmarczyksomething similar happens in confluence when I visit in Chrome -- but there it doesn't involve a popup, so I can pretty much ignore it :-P
16:52RaynesHeh
16:53mmarczykactually I hate it when js captures my keypresses unless it's a browser extension :-P
16:53RaynesWe should probably add a way to turn it off. At least for signed in users, I suppose.
16:53mmarczykhmmm, I could write a patch for that :-)
16:54RaynesWe need more stuff on the user pages anyways.
16:56akhudekaha!
16:56akhudekfound it
16:56akhudeklein-clojars I'm looking at you!
16:56mmarczykRaynes: so the current version (which I've just overwritten the same branch with) reuses an interpreter instance
16:56Raynesakhudek: You don't need that at all.
16:57mmarczyknot sure how much of a win that is (and I sure hope there are no threading issues or the like which would make this problematic...)
16:57Raynes:D
16:57akhudeknope, I installed it before realizing that it wasn't useful :D
16:57borkdude"installed"?
16:58akhudekborkdude: it's a plugin
16:58borkdudeakhudek ah, lein 1?
16:58mmarczykPythonInterpreter instances take all of .2 ms to create on my machine and then we need to execute some code to get the correct lexer anyway (which could be cached with the correct options, I'll look into it)
16:58mmarczykbut anyway, seems to work
16:58akhudekyep
16:59Raynesmmarczyk: Coolio
16:59akhudekHm, I wonder, if I had tried to catch that jar exception, could I have retrieved the problem file that way?
17:00akhudekwould be good to have some easy way to identify problems like this for people
17:00Raynesmmarczyk: Thinking about it, this will almost certainly cause threading issues, wont it? 5 different people executing code in the same interpreter at the same time.
17:00mmarczykthe Jython download slows things down some :-(
17:02mmarczykRaynes: well I've thought about it and I'm not sure, depends on whether Pygments uses globals (why would it? but I dunno)
17:03mmarczykRaynes: simplest option would be to use a fresh PythonInterpreter for each request though
17:03mmarczykRaynes: as in the original patch
17:03RaynesI think you're right.
17:03RaynesIt can't be much worse than shelling out. ;P
17:04mmarczykas mentioned above, PythonInterpreter instantiation is fast
17:04RaynesRight.
17:04RaynesYeah, let's keep doing that.
17:05mmarczyk(why does lein repl tell me I can't connect occasionally? arghs, my tools hate me)
17:08akhudekhm, sadly the zipexception doesn't have enough detail (which makes sense, since the source could be a stream)
17:15mmarczykRaynes: seems to work -- see the branch
17:16mmarczykRaynes: the first PythonInterpreter takes a while to materialize, subsequent instantiations are fast
17:17RaynesExcellent
17:17zach_Can anyone recommend any non-trivial clojure programs using datomic that I could look at?
17:18zach_I found Stu's HN example, which is pretty nice: https://gist.github.com/2948756
17:19mmarczykRaynes: just sent you a pull request, though admittedly calling this well-tested would be a stretch
17:19Raynesmmarczyk: No biggy. I'll test it out some.
17:19mmarczyk:-)
17:20akhudekRaynes: thoughts on this? https://github.com/diligenceengine/bultitude/commit/e12fcc8b5a72de3b9bc0fe9c027049be2ce13622
17:20Raynesakhudek: I'd love that.
17:21RaynesShoot me a pull request
17:22mboehSo I managed to make my mass downloader work in parallel, but I'm mostly just using Java's concurrency library. I feel like it could be more... Clojure-y.
17:23mboehhttps://github.com/mboeh/mass-download/blob/master/src/mass_download/core.clj
17:23mboehAnyone have any tips?
17:25mindbender1what does the different colors in clojure mode represent?
17:26RaynesParts of the rainbow.
17:26gfrederickscljs dev on 512mb linode => swap death
17:26mindbender1indeed
17:28gfrederickswell. I'm still going. So swap life maybe.
17:31technomancyhttps://github.com/quil/quil/pull/19#issuecomment-6528481 <- anyone want to make quil more awesome?
17:32aperiodicalways
17:32technomancy^ I had a flash of insight as I was waking up from a nap and had to put it somewhere, so I put it in a github issue comment.
17:33aperiodichmm, i've had a similar sort of idea, except with protocols
17:33technomancywat
17:34technomancywhy blaspheme the beauty of function composition with protocols?
17:34mmarczykRaynes: oh man, I left the jython dependency in which I guess makes no sense... I'll update the branch in place
17:34aperiodici find myself making a lot of, basically, objects with "tick" and "draw" methods that i just call in the quil draw function
17:34Raynestechnomancy: mmarczyk and I are having some issues with lein2 dependency resolution.
17:35technomancyo rly?
17:35Raynestechnomancy: We can't use `lein2 deps` with refheap's project.clj because it is trying to pull down some non-existent version of a mongo driver or something, while lein1 works fine. Not sure what's up.
17:36aperiodictechnomancy: what i'd like is to just be able to tell quil how often to simulate/render those objects, and it would take care of the rest
17:36mmarczykRaynes: technomancy: as have I
17:36RaynesDelete your org/mongo dir from .m2 and try to pull down congomongo 1.9
17:36mmarczykRaynes: so I just switched to lein1 for now -- but! the bootstrap sort of assumes it's lein1 with that cp jython-full.jar lib
17:37Raynesmmarczyk: Yeah, that's an issue. We probably need to do spit out a pom.xml and `lein install` the jar or something in the bootstrap. *shrug*
17:37technomancyRaynes: you mean lein1 doesn't complain when trying to resolve a non-existent jar?
17:37Raynestechnomancy: No, it seems to resolve the correct jar or doesn't try to resolve the bad one at all.
17:37mmarczykactually since RH is being run by lein, using :extra-...-path (need to look up an appropriate option) will probably work
17:37RaynesI don't know what's going on.
17:38technomancyfun fact: "Mongo" is Javanese for "hello"
17:38technomancybut MongoDB is implemented in C++ =(
17:38technomancyJOKE RUINED
17:38Raynesmmarczyk: Probably.
17:38mmarczykRaynes: right, I'll look into it, then replace the branch
17:39mmarczykI believe lein2 has a different set of options though
17:39technomancyRaynes: so the logic for transitive deps is slightly different?
17:39mmarczykso would be good to have the mongo driver issue resolved first
17:39Raynesmmarczyk: path vs paths in most cases. You can add both.
17:39mmarczykoh
17:39mmarczykok then
17:40Raynestechnomancy: You're the leiningen dude, you tell me. :p
17:40borkdudetechnomancy I like ruined jokes, was it already finished?
17:41technomancyborkdude: potential joke ruined, I guess
17:41technomancyprobably something involving hello world
17:41aperiodictechnomancy: in general i'm dissatisfied with how often the state of whatever's bound to *applet* shows up in my quil sketches... makes it hard to test & compose
17:44mmarczykhm, does lein2 even allow extra jars to be specified? (to be added to the classpath)
17:44technomancyaperiodic: indeed; quil seems to be too thin a layer around processing
17:44mmarczykin fact, does lein1?
17:48mmarczyktechnomancy: any way of telling lein to put a jar automatically generated during custom bootstrap on the classpath?
17:49mmarczykis there any way
17:49aperiodictechnomancy: yeah, i'd like it to feel more like a library and less like a weird DSL where stuff randomly blows up if you step outside the callstack of setup/draw.
17:59technomancymmarczyk: closest thing is adding entries to :source-paths
17:59technomancydesigned for use with directories, but I guess you could abuse it for jars
18:00mmarczyktechnomancy: thanks, I'll give it a shot
18:09mmarczykit works! thanks again
18:16vschlechtanyone awake who knows his way around the crate library, especially the binding functions?
18:16emezeske~anyone
18:16clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
18:19emezeskevschlecht: ^
18:20vschlechtty for the reminder... here comes the question: I'm inserting a table into the dom like this: (em/at js/document
18:20vschlecht ["body"] (em/append
18:20vschlecht (cr/html [:div#whatever (crate.binding/bound an-atom-refering-to-vector-of-vectors a-crate-partial-transforming-the-atom-to-a-table)])))
18:21vschlechtThis works wonderfullly the first time, i.e. I see a table with the values of my atom.
18:21vschlechthowever as soon as I swap, the table is replaced in the DOM by [Object#table] or somesuch
18:22emezeskeDoh, I thought maybe I could help, but that's the one part of crate I'm not super familiar with :(
18:23emezeskevschlecht: I'd guess that you'll have to dive into the crate source, unless ibdknox happens to be around
18:23vschlechtemezeske: thnx for trying anyway :-) the binding part seems a little underdocumented and is probably in flux
18:25ibdknoxhm
18:25emezeskevschlecht: I think you're right.
18:25ibdknoxyeah I threw the binding stuff together because I needed it :)
18:26vschlechtibdknox: no offense meant by calling your code underdocumented :-)
18:26ibdknoxit is haha
18:26RaynesAll ibdknox does is break stuff. I fix them.
18:26ibdknoxpretty much
18:26ibdknoxI am an endless supply of wrenches ;)
18:27ibdknoxvschlecht: can you put up a gist
18:27vschlechtsure, wait a sec
18:31vschlechtibdknox: https://gist.github.com/2980335
18:32vschlechtibdknox: I was just fiddling around ... eval step by step in a browser-repl to reproduce
18:33ibdknoxI assume playboard should be html-board on line 10?
18:33ivanwhere can I find a maintained contrib.duck-streams/read-lines? "Where did X go?" says most of duck-streams moved to java.io, but I don't see it there
18:33ibdknoxvschlecht: just for kicks and giggles, instead of making html-board a partial, make it a function that returns a vector
18:34ivanI want a line-seq that closes the file if I exhaust it or lose my reference to the seq
18:35vschlechtibdknox: 'l trying
18:35vschlechtibdknox: yeah, it should be... I forgot to de-uglify the name before pasting it for the world to see :-)
18:37technomancyivan: read-lines is a resource leak
18:37technomancywhich is why it was removed
18:37ivantechnomancy: I know but it's so convenient to not care
18:37S11001001ivan: (concat some-line-seq (lazy-seq (.close f) nil)) for exhaustion. Using "reference loss" is neither safe nor reliable, and if your program breaks you get to keep both pieces
18:37ivanI've gotten away with it every time in Python using generators
18:38S11001001by python you mean CPython
18:38ivanindeed :-)
18:38S11001001basically you're relying on unspecified GC behavior
18:38S11001001and your programs will break on pypy, jython, or pretty much anything else
18:38bbloomS11001001: namely, reference counting?
18:38ivanwell, in most cases my file was closed because I actually exhausted the file
18:39S11001001bbloom: and the very particular behavior of generators, as it happens
18:39ivanS11001001: and thanks, I'll try that
18:39bbloomoh laziness. how i love and fear you.
18:40S11001001bbloom: the reference-holding behavior is different between generator expressions and functions that use yield. It's evil to use it.
18:40vschlechtibdknox: cool ... if I use a function instead of a table, it works initially, and after swap!-ing, I see a string rendition of the vector ... i.e. the actual string "[:table#grind ([:tr ....."
18:40ibdknoxhm
18:41ibdknoxwait
18:41ibdknoxwhat version of crate are you using?
18:41vschlechtibdknox: 0.2.0-alpha2
18:42ibdknoxtry 0.2.0-alpha4
18:42ibdknoxthat should fix it
18:43ibdknoxyou should be able to leave it as a partial too
18:43S11001001nonstrict evaluation and uncontrolled side-effects go together like fist and face.
18:44vschlechtibdknox: trying ...
18:48vschlechtibdknox: naahh, doesn't fix it, but now the behavior between function and partial is identical
18:48vschlechtI still get a [object HTMLTableElement], though
18:58ibdknoxvschlecht: are you sure you don't have some old stuff lying around? the scenario works for me
18:59ibdknoxthis does what you'd expect: https://www.refheap.com/paste/3299
18:59vschlechtibdknox: lemme check that
19:03vschlechtibdknox: [object HTMLParagraphElement]
19:03vschlechtibdknox: I'm using enfocus, btw
19:04vschlechtibdknox: could that be a factor?
19:13vschlechtibdknox: I just deleted all older versions of crate from my .m2 for good measure, killed all java processes ... so no residues of old code left
19:37rlbmboeh: I'm not sure agents are what you want there. I suppose you could use (doall (pmap fetch urls)) or similar, and there may be some even better clojure idiom I'm not thinking of, but you could also consider Java Executors if pmap's not sufficient.
19:39rlb(Though if you want to make sure to interleave (some of) the fetching and the writing, then doall/pmap's not appropriate either.)
19:41rlbmboeh: oh, wait -- perhaps just use futures.
19:47clj_newb_0245i'm trying to get cemerick's friend ring authorization library to work with clojure
19:48clj_newb_0245unfortunately, all I'm getting back is the "sorry, you're not authorized" page
19:48clj_newb_0245for some reaon, I don't get that pop up that asks me to enter username/password
19:48clj_newb_0245I'm using :workflows [(workflows/http-basic)]
19:48clj_newb_0245anyone has anyidea how to begin debugging this issue?
19:48clj_newb_0245all I want is a stupid pop up window asking for username/password
19:56Wild_Catquick question: what is the recommended Clojure development environment for Windows?
19:57Wild_Cat(and if the answer is Emacs, can you recommend a build that integrates reasonably well with the Windows env?)
20:06emezeskeWild_Cat: a linux vm ^_^
20:08ivanWild_Cat: the official Emacs builds work fine
20:08rlbWild_Cat: I was actually going to say something similar -- it may not help you at all, but I'd be likely to just just use a linux vm, unless you actually have to deploy on windows.
20:09rlbBut I'm admittedly not all that knowledgeable on that front.
20:27cainuscan anyone help a newbie with a 4clojure problem? what am I doing wrong? https://gist.github.com/2980710
20:30rlbcainus: problem 23?
20:31emezeske,(= '() '())
20:31clojurebottrue
20:31emezeske,(= `() '())
20:31clojurebottrue
20:31cainusyessir
20:32emezeskecainus: Is there a space between reverse2 and the square brackets?
20:32cainusno... but that makes no diff... what should it be though?
20:32rlbcainus: probably not critical for the small test cases, but eventually, this might be coded as a tail-recursion so it won't die on very long lists.
20:33rlb(that or a lazy seq)
20:35emezeskecainus: I don't think conj does what you think it does
20:35cainusrlb: I'm mostly just trying to figure out syntax at this point but I'll keep that in mind. thanks
20:35emezeskecainus: conj is going to prepend to lists
20:35cainushmmm
20:35emezeskecainus: conj always adds an element to a collection in the most efficient way
20:36emezeskecainus: for lists, that means prepending
20:36emezeskecainus: for vectors, that would mean appending
20:36cainusahh... so how do I add to either first or last?
20:36cainusspecifically
20:36emezeskecainus: for prepend, cons works
20:37emezeskecainus: for append, you can do (concat '(1 2 3) '(4))
20:37emezeskecainus: although I'm sure there's a better way than concat
20:37rlbcainus: and you *don't* want to be repeatedly appending to a growing list.
20:38rlb(very expensive)
20:39cainusneither gets me I saw some guy just did #(into () %)
20:39cainuserrrrrr
20:39cainusI saw some guy just did #(into () %)
20:39emezeskeI think the best solution is &&(reverse [1 2 3])
20:39cainusbut I doubt that's expected at so early a stage in the problemset
20:39emezeske:P
20:40cainuswell it's supposed to be without reverse ;)
20:40cainuscons and concat both fail me... I'll try it in the repl and see why
20:41emezeskecainus: with concat, the second item needs to be a list
20:41emezeskecainus: I mean a collection
20:41emezeske,(concat '(1 2 3) 4)
20:41clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
20:41emezeske,(concat '(1 2 3) '(4))
20:41clojurebot(1 2 3 4)
20:42rlbemezeske: I think conj or cons are what you probably want, but you need to make sure you're building a list.
20:42cainusit needs to pass this too: (= (__ [[1 2][3 4][5 6]]) [[5 6][3 4][1 2]])
20:43rlbi.e. if you start with a list (as you did) as the base, you're fine.
20:43cainus__ is the fill-in-the-blank
20:43rlbThen you can use either cons or conj (assuming we're ignoring large list issues).
20:43rlb...and a normal recursion
20:44cainusthis doesn't work: https://gist.github.com/2980710
20:44cainusfreezes the repl and gives me weird java errors on 4clojure
20:45cainus"Don't know how to create ISeq from: java.lang.Integer (NO_SOURCE_FILE:0)"
20:48SrpxWhat IDE/Editor/anything you guys recommend for experimenting with clojure (REPL)
20:49rlbcainus: you probably don't want concat -- (at least with normal singly-linked lisp-style lists) it has to walk the entire first list before it can tack on the second list.
20:51cainusrlb: what's your suggestion?
20:52rlbI'd use conj or cons and make sure I start with a list.
20:52rlb(which you did)
20:53rlbi.e. how do you reverse -- start with (), then cons the first element, then...
20:53rlbcainus: I'm happy to help as much as you like, just not sure how much help, or what kind, you want.
20:54cainuswas kind of hoping for syntax help primarily... I think my algorithm is workable, if crappy
20:54cainusbut the repl freezes on it and the 4clojure gives me weird java errors
20:55cainusmaybe I should install clojure and try to the real repl... I'm using a web repl
20:55rlbSrpx: I'd offer a suggestion, but I doubt most people do what I currently do -- just emacs + bash...
20:55cainuswas just thinking someone here might be able to tell me I have a paren out of place or somehting ;)
20:56rlbcainus: I'd absolutely recommend that -- it's *really* easy, but hang on, I'll look at your latest example more closely.
20:56rlb(recommend having a local clojure)
20:56Srpxrlb: why you doubt it?
20:56Srpxand why you suggest it
20:56rlbI think a lot of people use something much fancier.
20:57rlbAnd they'll have to pipe up with whatever it is.
21:04rlbcainus: in your base case you're trying to concat a list and an integer, i.e. (concat ... 1), but concat requires a coll for every argument.
21:04cainusahhh
21:05rlbbtw, you may know this, but from the repl, it's handy to run (doc foo) for the docs. Also, once you've solved a problem, you might want to look at the way clojure itself implements the given function.
21:06rlbThat's easy from here http://clojure.org/cheatsheet.
21:06rlbJust click on the function, then click on the "
21:06cainusalright I'll have to install a real repl to use I guess
21:06rlb+ Source
21:06rlbbutton.
21:06rlbThere's also a source link from the main docs.
21:06cainusI'm not even running java on this machine... it's going to be a tricky install isn't it?
21:06rlbcainus: what os/dist?
21:07cainusubuntu
21:07cainuscan't recall the version
21:07rlbprobably not. At least in debian unstable, you can run "apt-get install clojure1.4" and you're finished.
21:07rlbAnd that might have even propagated to testing, but I'm not sure.
21:08rlbIn any case, clojure's just a jar.
21:08rlbSo all you really need is a moderately recent openjdk.
21:08rlbthen you can just run "java -jar clojure.jar" or whatever.
21:08rlbActually, wait, I use...
21:08cainusaptitude has a clojure1.3, but that's it
21:09rlbcainus: for your purposes, that's fine.
21:09cainusoh alright cool
21:09rlbcainus: and once you get that installed, it's trivial to download/unpack the clojure zip file, and invoke java on that instead.
21:09cainusgreat
21:09rlbcainus: and this is another thing that I'm sure people have fancier ways to handle ;>
21:10rlbNote that you can put this one line at the top of any executable text file, and the rest of the file can be clojure code:
21:11rlb":"; exec java -server -cp .:/usr/share/java/clojure-1.4.jar clojure.main "$0" "$@"
21:11rlb
21:11rlbThe ":" at the beginning is a trick that lets the line be accepted by both bash and clojure.
21:11cainus"Could not find the main class: clojure.main. Program will exit." ?
21:11rlb(the ":";)
21:11rlbcainus: in what context?
21:11cainusI just ran java -cp clojure-1.4.0.jar clojure.main
21:11cainusin a dir with the jar
21:12cainus(following http://clojure.org/getting_started)
21:13cainushmm I can just run some command "clojure" and a 1.3 repl starts though
21:13cainusniiice
21:15cainusalright this is great...thanks rlb
21:16rlbnp
21:16rlbI think you'll find that a lot more effective
21:17rlbcainus: check your clojure-1.4 jar via ls -l.
21:18rlbTo test, I copied it from /usr/share/java via cp -a, and that broke because in Debian it's a local symlink.
21:18rlbNot sure if that was your problem.
21:18rlbBut when I copied it directly, (without -a), it works fine.
21:18cainusI was in the dir of the unpacked zip
21:18rlb$ java -cp clojure-1.4.jar clojure.main
21:18rlbClojure 1.4.0
21:18rlbuser=>
21:18rlb
21:18rlbcainus: is the jar at the top-level? I forget.
21:20cainusha I missed the -beta7 on the jar file name
21:21cainus1.4.0 works nicely now too
21:21cainusvery cool
21:21rlbRight -- 1.4.0's out.
21:21rlbThat other trick with ":"; is just in case you want to make a clojure script.
21:21rlbJust put that as the first line and "chmod +x" the file.
21:22cainusahh... don't know how I missed that
21:22rlb(or perhaps chmod u+x)
21:22cainusalright cool... I'll give it a go
21:22rlband you may or may not want the -server arg.
21:22rlb(depending on what you're doing)
21:23cainusthanks... this be fun
21:23rlbnp, glad to help
21:23cainuserrrr... this'll be fun
21:25rlbcainus: oh, and style-wise, you may want to pull your close parens up, i.e. )))) rather than one-per-line.
21:25cainusokay... good to know...
21:25cainusdoesn't that make it harder to make sure you have a matching paren?
21:26rlbAnd iirc, the recommended way to check if a coll is empty is (seq coll), i.e. instead of (not (empty? coll)).
21:26cainusmaybe syntax high-lighting will solve that for me
21:26rlbcainus: you *abosolutely* should make sure you're using an editor that has extensive support for that sort of thing.
21:26rlbOtherwise you're likely to find clojure miserable.
21:26cainusanyone else using vim? :)
21:27rlb(clojure or any other lisp derivative)
21:27rlbcainus: you're asking the wrong person ;>
21:27cainushaha
21:28rlbcainus: though, I'd suggest if you're willing, that you give emacs a(nother?) try.
21:28cainusnever really tried it actually
21:28cainusmaybe I will
21:28rlbnow's an excellent opportunity
21:28rlbcainus: you can even turn on one of the vi modes, if you'd like to stick with vi commands much of the time.
21:29rlb(emacs has more than one)
21:29cainusit *would* be nice to keep my keybindings
21:29rlbcainus: I suspect you might be OK with emacs' eventually, but it might be a nice intermediate step -- dunno.
21:29cainusalright... just one revolution per day though... I'm going to get deeper into clojure first ;)
21:30rlbAnd I believe the fancy clojure envs I was alluding to are emacs-based.
21:30rlbcainus: vi(m?) may well have some kind of lisp mode too -- if so, I'd turn that on for .clj files (assuming there's nothing clojure specific already available).
21:31cainuswhat would a "lisp mode" entail ?
21:31cainussomething beyond syntax highlighting?
21:31rlbRight, it's more than that -- emacs has support for things like rearranging s-expressions based on their structure, etc.
21:31cainusahhhh okay
21:31rlbThough that's not lisp-specific, emacs can do that with other languages too.
21:32rlb(and there's outline mode, which lets you collapse/uncollapse functions, etc. -- though I rarely use it)
21:32rlbI suspect others love it.
21:32cainusyeah I never got the point of collapse
21:33wreckimnakedI'm thinking of giving emacs a try too
21:33rlbhappy to help if I can
21:33wreckimnakedlast time I didn't have much luck configuring evil for the vi commands
21:34rlbI actually wonder if it might work better to just dive in and see if you can stick with emacs, as-is, but I don't really have the context to know.
21:34wreckimnakedfor regular editing the vi approach is very efficient, don't know much about the emacs side though
21:35rlbThough as far as I'm concerned, the most critical thing is to make sure that CapsLock is a control key.
21:35wreckimnakedI must say that the finger yoga repelled me quite a bit :D
21:36rlbwreckimnaked: I don't know, but I suspect that at least initially, you won't find emacs as "efficient" in your common cases.
21:36aperiodicwreckimnaked: you should check out either slimv or vimclojure: they both give you paredit (structured editing based on s-expressions) and the ability to evaluate s-exps, look up docs, etc, in vim
21:36rlbBut, if that's critical, maybe the modes will help.
21:36rlbOh, or what aperiodic said ;>
21:36wreckimnakedyeah, I'm a vimclojure user
21:36aperiodictheir paredit is missing features that emacs paredit has, though :(
21:36aperiodicoh, k
21:37wreckimnakedbut the emacs clojure mode just seems more natural
21:38wreckimnakedI saw a friend editing latex using emacs and it was mind blowing
21:40aduwreckimnaked: how so?
21:41wreckimnakedit can actually render bits of your latex code inside the editor
21:41wreckimnakedsomething like this http://www.youtube.com/watch?v=LJgOWxwrEMw
21:41wreckimnaked~2:55
21:41clojurebotGabh mo leithscéal?
21:45aduwreckimnaked: why is the cursor on crack?
21:46wreckimnakedadu: hackers
21:46aduwreckimnaked: that's pretty awesome
21:50wreckimnakedadu: yeah, I started reconsidering emacs seeing that live
21:50aduI've been using emacs for 10 years
21:51wreckimnakedadu: any advice for a rookie?
21:51Frozenlockwreckimnaked: lurk in #emacs
21:51adugo through the tutorials
21:51adumy favorite tutorial: http://www.youtube.com/watch?v=TZmhzvL15Hc
21:52wreckimnakedadu: blender?
21:52aduI never said it was an emacs tutorial
21:52Frozenlockhttp://www.masteringemacs.org/ is pretty good too (there's a section for beginners)
21:53Frozenlock,flame adu
21:53clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: flame in this context, compiling:(NO_SOURCE_PATH:0)>
21:53FrozenlockAwwww
21:55Frozenlockadu: those helped me a bunch too http://www.youtube.com/user/rpdillon
21:56aduthe only elisp I've ever written was in init.el
21:59clj_newb_02457how do I get clojure-ring to redirect a page?
21:59clj_newb_02457I wnat to get a response which will redirect cc/GET /login to cc/GET /main
22:00weavejesterclj_newb_02457: In ring.util.response there's a function called redirect
22:00clj_newb_02457holy shit
22:00clj_newb_02457this is like asking a question about C and getting a kerrigan/ritchie response
22:00aduclj_newb_02457: header "Location: /next/page"?
22:00clj_newb_02457oh wait, this is more like a bjarne stroustrup response
22:00clj_newb_02457you wrote compojure, not ring
22:01weavejesterclj_newb_02457: Or you could manually create a 302 response map, e.g. {:status 302, :headers {"Location" "/blah"}}
22:01weavejesterclj_newb_02457: Well, I think most of the code in Ring is mine, but not the original design :)
22:07clj_newb_02457Problem: after login (using com.cemerick friend), my app is left at a blank page with url "localhost:8080/login" . Now, I have my handler print out all (:request-type request) (:uri request) -- and as a result, the "/login" does not actually get to my handler
22:07clj_newb_02457question: is there something similar like :unauthorized-redirect-uri, but instead ,s :authorized-redirect-uri ?
22:07clj_newb_02457i.e. how do I set the page the user ends up at after they login?
22:14clj_newb_02457:default-landing-uri
22:14clj_newb_02457alright, time to setup nginx/apache to get ssl working
22:14clj_newb_02457woot
22:14clj_newb_02457clojurescript for the win
22:36ivanif I AOT everything, can I start a noir/aleph server in < 20 seconds? is this worthwhile?
22:37aduwhat's AOT?
22:37ivanahead-of-time compilation
22:37aduo
23:36cmajor7is there a concise way to say if either 'a' or 'b' or 'c' less than a certain number?
23:38cmajor7without creating a list out of '(a b c) to filter over it, or have three nested (or (< a number) (< b number) (< c number))
23:41y3didoes anyone else's lein repl crash or just take a long time to do stuff?
23:43SrPxWhy is print giving lots of nil as output:
23:55SrPxis there any way to add forms like "a+b" or "!a" or "f . g" (comp f g)
23:58gfredericksSrPx: wat
23:58SrPxwat wat
23:59gfredericksare your two statements related?
23:59SrPxfirst I asked whyy things like (for [a (range 4)] (print a)) output (0123 nil nil nil nil)
23:59gfredericksah ha
23:59gfredericksthat is a good question
23:59SrPxõo?
23:59gfrederickstwo things are happening simultaneously
23:59SrPxhm
23:59y3dihi guys, im having issues with lein plugin install swank-clojure