#clojure log - Jun 23 2012

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

0:00 Raynes: https://github.com/Raynes/refheap/blob/develop/src/refheap/models/paste.clj#L228 This is the code you would be replacing.

0:00 Shambles_: 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.

0:00 mmarczyk: Raynes: oh cool, I wanted to contribute something useful to RefHeap :-D

0:01 Raynes: mmarczyk: This was actually the first issue I ever created for refheap. :P

0:01 Nobody has ever taken it up though, sadly.

0:01 https://github.com/Raynes/refheap/issues/2 Okay, second issue.

0:02 mmarczyk: Raynes: oh cool, might get to close issue #2 :-)

0:02 Raynes: :D

0:02 mmarczyk: not quite as good as #1, but hey... I can live with that :-P

0:02 Raynes: Hehe

0:02 Shambles_: 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.

0:03 Raynes: Shambles_: It's exactly a pastebin. There is an 'about' page.

0:03 cgag: yeah it's a prettier pastebin

0:03 Shambles_: And it looks like pygments is a syntax highlighter.

0:03 mmarczyk: there's also a "Paste!" button :-)

0:03 Raynes: Hah

0:03 cgag: i'd like a copy to clipboard button personally

0:03 Shambles_: mmarczyk: The "paste" button and fact it didn't act like a REPL was the reason I guessed "a pastebin".

0:04 eggsby: pygments is the greatest syntax highlighter

0:04 Raynes: cgag: 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.

0:05 with javascript*

0:05 cgag: really? i know there's a button on github, i hadn't considered how it worked to be honest

0:06 Raynes: cgag: alt+r followed by cmd+c to copy a paste, looks like.

0:07 cgag: There is a button on Github for that?

0:07 cgag: https://github.com/technomancy/leiningen

0:08 the tiny clipboard next to the sha

0:08 on the latest commit

0:08 looks like it is flash though, interesting

0:08 Raynes: Yeah, that's flash.

0:08 It's the devil.

0:08 cgag: i was fooled by its size and static nature... i'm used to flash being in my face

0:09 Raynes: Heh

0:09 mmarczyk: If you do take that up and need any help, let me know.

0:10 Shambles_: Flash can't be that bad with las3r sticking Clojure in it, can it? ;)

0:11 mmarczyk: Raynes: sure! skimming my old SO reply on Clojure/Jython interop to see how this might work :-)

0:14 Shambles_: I'm a bit surprised there's not more Clojure being used to make applets.

0:15 Raynes: Applets suck, so it doesn't surprise me at all.

0:36 muhoo: is there a way to age out ring memory store sessions?

0:36 so that, for example, it doesn't become a big ol' leak?

0:36 gfredericks: do applets suck in general or just as GUIs?

0:36 muhoo: applets? what is this, 1997?

0:37 gfredericks: how bout that lewinsky eh?

0:37 muhoo: that was 1998

0:37 IIRC it went applets -> flash -> html5

0:38 gfredericks: I have foresight

0:38 muhoo: you forgot <marquee>

0:38 jhowarth: Hey 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

0:38 muhoo: gfredericks: animated gifs are back with a vengeance, tho

0:39 Raynes: muhoo: https://github.com/Raynes/therapy <-- Your tests here lead me to believe you don't know about the (testing "foo" ..) clojure.test feature.

0:39 muhoo: Just letting you know because it's like the best thing ever.

0:39 muhoo: my tests?

0:39 Raynes: muhoo: Yes.

0:39 gfredericks: kids use the most superlatives ever

0:40 muhoo: Raynes: wait, noir already has session aging?

0:40 Raynes: muhoo: No. This is entirely unrelated to what you were just talking about.

0:41 muhoo: Raynes: what tests specifically do you mean though?

0:41 Raynes: muhoo: 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.

0:41 muhoo: oh cool. i was using clojure.test though.

0:41 clojure.test is extremely convenient, thoguh i'm told midje is worth looking at too

0:42 Raynes: muhoo: Yes, which has a 'testing' macro.

0:42 muhoo: http://clojure.github.com/clojure/clojure.test-api.html#clojure.test/testing

0:43 muhoo: Raynes: hehe, oic. i recognize some of that code now :-)

0:43 Raynes: This would replace those comments you put between tests.

0:44 muhoo: cool, thanks

0:44 jhowarth: Is this the appropriate place to ask nooby clojure questions or is there a better place?

0:44 muhoo: jhowarth: i think you've come to the right place.

0:45 Raynes: i agree, that really is the best thing evar. especially that therapy-session function

0:46 Raynes: I'm going to see if weavejester wants to put this in Ring itself.

0:46 jhowarth: If I have a lein project with a file in "src/project/db.clj", what would be the namespace for that file?

0:46 Raynes: project.db

0:46 If you have src/league_tip/db.clj it should be league-tip.db

0:47 jhowarth: Ok maybe I have a typo somewhere.

0:47 Thanks.

0:48 muhoo: Raynes: ok, should i replace those comments with that testing macro first then?

0:48 or are you doing that?

0:49 Raynes: I wasn't going to do anything at all with it, but by all means give it a go if you've got a minute.

0:49 I'm lazy.

0:49 muhoo: i suppose that's better than being eager

0:50 (lazy-raynes)

0:51 xeqi: muhoo: someone announced an aging session store on the ring mailing list today

0:52 jhowarth: Raynes: It ended up being a syntax error in the file that was causing the problem.

0:52 Not sure why that manifests as class not found :(

0:52 file not found*

0:53 muhoo: xeqi: thanks!

0:53 jhowarth: because the class didn't compile? thus, it wasn't found?

0:54 jhowarth: The error was that it couldn't find the db.clj on teh classpath

0:54 But the file was on the class path

0:55 just an odd error msg imo

1:02 mmarczyk: Raynes: oh wait, I'll actually need to install mongo to test...? :-O any recommended version number?

1:03 Raynes: mmarczyk: Whatever is newest or in your distro's repository if you use Linux. `brew install mongodb` should work too if on OS X.

1:03 Nothing has changed between the last kazillion mongo versions.

1:04 mmarczyk: Raynes: 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

1:05 Raynes: mmarczyk: It'll probably work, or you can grab the binary release from mongo's web site which should run right out of the box.

1:05 mmarczyk: ok, we'll see

1:09 Raynes: should I be able to use lein2?

1:09 Raynes: mmarczyk: Yes.

1:10 mmarczyk: well, it complains about org.mongodb:mongo-java-driver having some problem or other

1:10 Raynes: mmarczyk: You should not, however, be able to use `lein repl`.

1:10 mmarczyk: lein1 doesn't complain, but lein run breaks

1:10 Raynes: That sounds like a congomongo issue.

1:10 mmarczyk: yup

1:11 Raynes: I don't know what's up with that.

1:11 Certainly doesn't happen to me. :(

1:11 mmarczyk: actually might be a Central issue (again?)

1:11 Raynes: Or wait, is this with an ancient copy of mongodb?

1:11 Perhaps it just doesn't work with it?

1:12 mmarczyk: https://www.refheap.com/paste/3298

1:13 Raynes: technomancy!!!!!!!!

1:13 technomancy: Isn't this the issue you were talking about? lazyseq crap?

1:14 muhoo: i have seen that error before

1:15 mmarczyk: actually 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/

1:15 Raynes: mmarczyk: I'm getting the same error.

1:15 mmarczyk: Raynes: lein run then?

1:15 Raynes: Lein 1 should work just fine

1:16 mmarczyk: well, let's see

1:16 I tried earlier and it took a moment or two to do something noticeable, which was to print out lots of stack trace nonsense

1:17 Raynes: I sure don't like this at all.

1:17 mmarczyk: guess I'll be updating mongo

1:17 Raynes: If I had to restart refheap on heroku right now I'd be screwed.

1:18 muhoo: is this another maven screwup like the one that made clojure disappear?

1:18 Raynes: I don't know.

1:19 * Raynes wipes tears away and bites his nails

1:19 mmarczyk: well the version of mongo I have here really is a bit out of date

1:19 muhoo: Raynes: testing macro done.

1:19 Raynes: muhoo: Already pulled.

1:19 xeqi: Raynes: the lazyseq error message should be fixed on master

1:19 Raynes: mmarczyk: I just tried with lein1 and it seems to work.

1:20 xeqi: You lie.

1:20 xeqi: wait

1:20 Raynes: xeqi: Unless it was fixed in a push today.

1:20 xeqi: its fixed in pomegranate

1:20 stil waiting on a release for that

1:20 Raynes: Gotcha.

1:20 muhoo: Raynes: damn that was fast. drinking technomancy's seattle coffee at 1am?

1:21 can't deep up with him. he's on faaaayyyyyaaaaah!

1:21 keep

1:22 Raynes: muhoo: Yeah, therapy was a great name. Unfortunately, therapy-flash doesn't have a very nice ring to it.

1:23 xeqi: it 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

1:23 and I bet `lein deps :tree` is no help since it can't resolve it

1:25 muhoo: that sounds a lot like what happened a few weeks ago to clojure in maven central :-/

1:27 xeqi: thanks, that was exactly what i was looking for (https://github.com/diligenceengine/aging-session)

1:43 mmarczyk: Raynes: got the mongo thing working

1:44 Raynes: mmarczyk: Excellent!

1:45 mmarczyk: Raynes: 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/

1:46 Raynes: mmarczyk: I'm taking off for a while so I wont respond. Email me if you need anything.

1:46 mmarczyk: Raynes: ok

1:48 Leonidas: all other systems just run external shell commands to interface to pygments *sigh*

1:54 mmarczyk: Leonidas: other than what?

1:55 Leonidas: mmarczyk: JVM.

1:55 mmarczyk: Leonidas: RefHeap currently does the same thing

1:55 Leonidas: RefHeap runs on the JVM, right?

1:56 mmarczyk: well yes, it's written in Clojure

1:56 Leonidas: so my point is still valid

1:56 mmarczyk: is it?

1:57 above I meant that RH shells out to pygmentize

1:57 Leonidas: mmarczyk: ah, ok then I misunderstood

1:57 mmarczyk: yeah, awkward phrasing on my part

1:58 with Jython available it's tempting to run Pygments inside the JVM though

1:59 Leonidas: well, Jython doesn't really have the steam behind it as CPython, so you might run into issues that noone before had

1:59 mmarczyk: anyway -- 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?

1:59 Leonidas: (IronPython even worse)

1:59 mmarczyk: apparently Jython is supposed to be able to run Pygments

2:00 newb_clj_0123: i 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.

2:00 xeqi: during the bootstrap install it to the local maven cache

2:00 newb_clj_0123: question: what is the correct format for responding to ajax request? is it just json?

2:01 mmarczyk: albeit not without some weird tricks some aspects of which are tripping me up

2:01 xeqi: newb_clj_0123: you mean the content-type ?

2:01 mmarczyk: xeqi: heh, right -- thanks

2:01 newb_clj_0123: xeqi: I mean in my ring handler

2:01 mmarczyk: xeqi: will probably do that for now, though I'd love to avoid it

2:01 newb_clj_0123: how I should respond

2:09 xeqi: newb_clj_0123: does https://github.com/ztellman/aleph/wiki/HTTP help?

2:09 newb_clj_0123: xeqi: I don't thikn so

2:09 the problem is that on my clojurescript side, I send an ajax request

2:09 then on the clojure side, I can read the POSt request (I can read the json as a table)

2:09 then on the clojure side, I send a table back

2:10 unfortunately, I can't read it as a json on the clojurescript side

2:10 on the clojurescript side, the response gets read as NULL / empty string

2:10 muhoo: mmarczyk: lein local-repo, iirc

2:10 newb_clj_0123: mentioning aleph was probably a bad idea

2:10 at the moment, I'm not using web sockets yet

2:11 since I can't even get something as simple as ajax to work

2:11 muhoo: mmarczyk: http://blog.cymen.org/2012/03/12/leiningen-and-lein-localrepo-how-to-create-local-maven-repository-for-jar-files/

2:12 mmarczyk: muhoo: thanks, that's interesting, though I'll just use mvn install for RefHeap (which shouldn't have too many mvn-related dependencies)

2:13 probably

2:14 newb_clj_0123: xeqi: got it working :-)

2:14 i needed to use clojure.data.json/json-str

2:15 xeqi: I was just about to ask what json lib you were using server side

2:15 also look at chesire for that in the future

2:15 but if your doing clojure <-> clojurescript, I don't think you need json

2:15 mmarczyk: newb_clj_0123: you might want to consider using pr(n) and read-string

2:16 xeqi: you can just send clojure data

2:16 as mmarczyk is mentioning

2:16 muhoo: pr()n ?

2:16 mmarczyk: right. (:require [clojure.reader :as reader]), (read-string ...)

2:16 pr and prn

2:16 * muhoo contemplates writing a function called pr0n , but can't think of what it would do

2:16 mmarczyk: the above on the cljs side; read-string is in core on the jvm

2:17 also, I meant to say (reader/read-string ...)

2:17 newb_clj_0123: it would print 0 n times

2:17 so for example (pr0n 5) = "00000"

2:17 one could define it as (defn pr0n [n] (apply str (repeat "0" n)))

2:18 how would print-string and read-string work ?

2:18 so my ajax request are sent through google closure library

2:18 and afaik, google closure was not written with clojurescirpt in mind

2:18 mmarczyk: newb_clj_0123: suppose you have a map {:foo 1, :bar 2} which you want to get across to the server

2:19 newb_clj_0123: mmarczyk: sure

2:19 mmarczyk: newb_clj_0123: you submit a request with (prn {:foo 1, :bar 2}) as the body

2:19 newb_clj_0123: you read-string it in on the server side

2:19 newb_clj_0123: on the server side; I get a XrhIO request object

2:19 what do I call read-string on? [note, this is the first time in my life i'm using ajax]

2:20 mmarczyk: newb_clj_0123: well on the server side you're handling a request

2:20 newb_clj_0123: [learning CLojureScript + Google Closure + Ajax has been quite an experience]

2:20 so (fn [request] .... )

2:20 what does in .... ?

2:20 request is a goog.net.XhrIo object

2:20 mmarczyk: newb_clj_0123: lots of stuff on your plate :-)

2:20 newb_clj_0123: XhrIo lives on the client side

2:20 muhoo: newb_clj_0123: mmarczyk: there's also http://github.com/ibdknox/fetch too

2:20 mmarczyk: newb_clj_0123: the server sees a request which it needs to handle

2:21 newb_clj_0123: this is via compojure

2:21 muhoo: which is like ajax in pure clojure

2:21 newb_clj_0123: so I have something like defrost "/post-request" {params :params} ...

2:21 mmarczyk: oh cool

2:21 newb_clj_0123: s/defrost/defroutes/

2:21 defrost != typo; defrost = stupid spell autocrrect

2:22 I should also add; Chrome's debugger is amazing

2:22 mmarczyk: so you take the request's body

2:22 read-string it in

2:22 you get the map -- {:foo 1, :bar 2}

2:22 process it, say the result is [1 2 3]

2:22 newb_clj_0123: sure

2:22 mmarczyk: you prn the result obtaining "[1 2 3]"

2:22 newb_clj_0123: btw

2:23 the server reading the ajax request

2:23 this part already works

2:23 mmarczyk: and send that off to the client as the body of your response

2:23 newb_clj_0123: compojure handles it very nicely

2:23 mmarczyk: then an event handler fires off on the client side

2:23 because the response has arrived, right? so you pull out the body of the response and clojure.reader/read-string it in

2:24 and you get [1 2 3] on the ClojureScript side

2:24 newb_clj_0123: hang on

2:24 read-string is also on the clojurescript side

2:24 hmm

2:24 interesting

2:24 mmarczyk: yes, as long as you (:require clojure.reader) in your ns declaration

2:24 xeqi: cljs.reader ?

2:24 newb_clj_0123: call this pain is starting to be worth it

2:24 mmarczyk: ah, possibly :-)

2:24 yeah

2:25 so (ns foo (:require [cljs.reader :as reader]))

2:25 you can also send tagged literals across

2:26 at least on cljs master... probably latest release too

2:26 and that's awesome :-D

2:26 xeqi: would need 1.4.0 on server side

2:27 mmarczyk: right

2:27 xeqi: also use (binding [*read-eval* false] (read-string s)) on the serverside

2:28 that *read-eval* false is very important

2:28 mmarczyk: {:name "Sancho" :uuid #uuid "e308e238-74a9-43db-a69a-39c883bf79ac" :last-seen #inst "2012-06-23T06:28:15.140-00:00"}

3:42 Raynes: mmarczyk: Any luck?

4:26 mich2: anyone awake here and has read the paper 'out of the tar pit'?

4:33 I see the us is sleeping :O

6:57 VickyIyer: Hi does anybody know of a site where I can find a tutorial where a web app is build using clojure

7:07 _ulises: VickyIyer: you can try webnoir.org or the tutorial on heroku

7:07 VickyIyer: but it really depends on the libs you want/have to use

7:09 VickyIyer: Thank you _ulises question by libs do you mean some kind of fraework like spring or just diffrent APIS of doung the same thing

7:09 _ulises: VickyIyer: I'm thinking of things like noir, compojure or just plain ring

7:09 VickyIyer: it's more to do with templating, routing, etc.

7:10 VickyIyer: and then of course you need to store your data somehow

7:10 VickyIyer: ok thanks I don't know about these will look them up

7:10 _ulises: VickyIyer: noir is tiny and simple; it should get you started in no time

7:25 borkdude: VickyIyer Noir is good, but for understanding I also like this article: http://brehaut.net/blog/2011/ring_introduction

8:29 cshell_: does anyone know how to trigger a recompile of a protocol/record within an REPL so I don't have to bounce it?

8:39 looks like it's as simple as (compile

9:29 espeed: How do you import nested Java classes that are in separate files?

9:49 gfredericks: lein-cljsbuild is driving me nuts

9:51 when I run it on auto I get require errors

9:51 but if I do `rm -rf .lein-cljsbuild-compiler-0/ main.js && lein clean && lein cljsbuild once` then I'm okay

10:01 mmarczyk: Raynes: got it working! :-D

10:03 Raynes: only problem is it involves a rather ugly hack which I'll need to give some extra thought

10:22 nonrecursive: hello - is there an easy way to debug code in the jars stuck in /lib by leiningen?

10:22 I suppose I could unzip the jar, edit the file, and zip it back up?

10:31 cshell_: what do you mean debug code?

10:31 just inspect the source?

10:33 nonrecursive: I want to modify it

10:33 throw some println's in there

10:33 it would be nice to be able to set breakpoints but I don't know how to do that

10:35 i have a noir site running and ideally i'd be able to get a repl in the terminal where "lein run" is running

10:36 WillMac: New 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:37 cshell_: 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:37 WillMac: The Clojure Programming book has a lot of things like that

10:38 nonrecursive: cool cool, thanks cshell_

10:38 cshell_: 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:39 if you're using an ide

10:40 nonrecursive: cshell_: i'm using emacs. also, just started noir from the repl - this is awesome, thank you :)

10:41 cshell_: nonrecursive: no problem, glad it helped

10:42 nonrecursive: i have so much power now

10:42 cshell_: haha, yeah:)

10:42 WillMac: cshell_: 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:42 cshell_: 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:43 nonrecursive: wow, very nice

10:43 cshell_: WillMac: Yes, that wouldn't be a bad place to start - get your data right then the coding becomes simple :)

10:43 nonrecursive: chsell_: thanks a million

10:43 cshell_: nonrecursive: anytime

10:43 nonrecursive: WillMac: what are you thinking of doing? just curious

10:45 WillMac: cshell_: A fantasy football draft player recommender.....lol...thought it would be fun...I did it in excel last year

10:46 cshell_: WillMac: those are the kinds of fun things to learn a new programming language with

10:46 WillMac: cshell_: If I can reproduce what I did in excel, I want to expand it to more advance simulations

10:47 cshell_: 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:49 WillMac: cshell_: 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:50 Vinzent: WillMac, be aware of protocols and datatypes: with them you can easily fall into OO design!

10:51 cshell_: 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:51 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:51 WillMac: cshell_: good tip

11:00 mmarczyk: nonrecursive: 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:01 which is kinda neat, no? :-)

11:01 nonrecursive: mmarczyk: very nice, thanks. I was trying to edit the files directly in emacs but they weren't saving for some reason

11:01 cshell_: mmarczyk: that is cool

11:01 mmarczyk: nonrecursive: oh? I just double checked that it works for me

11:02 cshell_: mmarczyk: he might not have done the lein checkout deps

11:02 mmarczyk: I mean I double checked the edit-jar-in-Emacs thing

11:02 nonrecursive: mmarczyk: Yeah I get the message "Selecting deleted buffer"

11:03 cshell_: will lein re-pull deps from remote repos and overwrite the changes?

11:03 mmarczyk: hm, I'm not sure I know how to troubleshoot this, but the folks in #emacs will

11:03 cshell_: stuff in checkouts/ takes precendence and lein never touches it

11:05 cshell_: sweet

11:05 mmarczyk: it is :-)

11:07 gfredericks: how do I get emacs to start clojure-mode when opening *.cljs files?

11:07 cshell_: gfredericks: I thought there was some file you had to add cljs too

11:07 er, to

11:08 gfredericks: cshell_: well. alright.

11:09 nonrecursive: gfredericks: I think it'd be something like (add-to-list 'auto-mode-alist '("\\.cljs$" . clojure-mode))

11:09 Vinzent: gfredericks, up-to-date clojure-mode does it for you

11:09 gfredericks: oh I need to up-to-date my clojure-mode then

11:09 cshell_: gfredericks: sorry man, I wish i was better with emacs

11:09 gfredericks: which means I need to remember how I installed it in the first place

11:10 what is font-lock?

11:10 Vinzent: syntax highlighting

11:14 gfredericks: maybe I need clojurescript-mode.el as well

11:16 ah very nice, that did it

11:42 clj_newb_02357: this is amazing

11:42 clojurescript is actually fun now

11:43 it'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:44 borkdude: just rotate the plane

11:44 clj_newb_02357: by 135% degrees, then go skiing

11:45 what's so amazing about learning clojurescript

11:45 is that coming from no web development background

11:45 i managed to learn jquery just in the times that I was cursing at clojurescript

11:52 mmarczyk: :-)

12:01 cshell_: clj_newb_02357: clojurescript is the same as clojure - so if you know clojure, you'll know clojurescript

12:02 clj_newb_02357: minus some stm and thread stuff

12:02 clj_newb_02357: except for the whole java vs google closure thing

12:02 the languages are similar

12:02 the libraries is another story

12:03 cshell_: clj_newb_02357: yes, different host languages

12:03 clj_newb_02357: which results in different developemnt styles

12:03 for example

12:03 in clojure, I generally writes lots of code than test

12:03 in clojurescript, I test after every 3 lines

12:03 because I love debugging in javascript

12:03 progo: :)

12:06 clj_newb_02357: i also wonder if there is (clean) way to setup amcros so that

12:06 (function [some ajax call]) ends up beging wrapped to ([some ajax call] ... with function as callback handler)

12:06 basically, 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:09 zomg: clj_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:09 clj_newb_02357: no; I started my javascript experience with clojurescript

12:09 zomg: Oh I see

12:10 clj_newb_02357: yeah; I hear it's slightly better than php

12:10 zomg: JavaScript or Clojure? :)

12:10 Well, no matter, depends on who you ask and what you wanna do I guess :D

12:11 nonrecursive: in 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:11 clj_newb_02357: unfortunately, I think market cap of PHP values beats market cap of CLojure Companies

12:12 edoloughlin: Does anyone using Compojure know how I supply my own wrap-params to handler/api?

12:18 cshell_: nonrecursive: user fugures?

12:18 ,(doc future)

12:18 clojurebot: "([& 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:18 cshell_: nonrecursive:oops, I meant 'use futures?'

12:19 nonrecursive: chsell_: tx - i just tried using an agent and that worked, too. I don't ever dereference the var - does that matter?

12:19 oskarth_: 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:22 cshell_: cshell: if you don't need the value stored in the atom it shouldn't change the fact that it gets updated

12:22 nonrecursive: that was for you

12:22 nonrecursive: cool thanks cshell_

12:23 cshell_: 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:23 nonrecursive: yeah, doing image processing then uploading to s3

12:23 oskarth_: solved it

12:25 cshell_: nonrecursive: are you sure that using an atom uses a separate thread?

12:25 ,(doc atom)

12:25 clojurebot: "([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:25 nonrecursive: using an agent

12:25 cshell_: ah

12:25 nonrecursive: PD

12:25 er

12:25 :D

12:27 cshell_: nonrecursive: are you using send or send-off?

12:28 nonrecursive: cshell_: send

12:28 cshell_: 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:28 cshell_: yeah :0

12:28 :)

12:28 nonrecursive: haha

12:29 cshell_: nonrecursive: I think send-off might be better

12:29 nonrecursive: cshell_: thanks i'll switch to that

12:31 cshell_: 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:31 nonrecursive: just as a sourced referenced

12:31 nonrecursive: cshell_: thanks - I read that and thought to myself "Good thing that doesn't apply here!"

12:32 cshell_: hehe

12:33 nonrecursive: cemerick's book is definitely my favorite of the three or four that I've gone through

12:33 cshell_: mine too - it answers almost every question I've had coming from java to clojure

12:34 some of the others are jokes in comparison

12:34 nonrecursive: completely agree

12:34 cshell_: I'm getting tired of the books that have 14 chapters of building one example

12:35 cemerick's is basically a complete reference

12:35 borkdude: the "batteries included" clojure book

12:36 nonrecursive: heh yeah

12:36 cshell_: but now i'm wondering what the difference between agents and futures are - and when to use one over the other

12:36 for shared state between threads?

12:38 nonrecursive: it looks like all futures don't give you the control of using a thread pool or not

12:43 borkdude: futures are expressions to be executed in the future , agents are data, waiting for functions to be executed on them

12:43 alexyakushev: Hello, 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:44 nonrecursive: borkdude: tx

12:44 cshell_: borkdude: nice, concise response - thanks

12:51 nonrecursive: do you think that futures are the better way to go since you never look at the data?

12:51 nonrecursive: cshell_: yeah I think so

12:52 cshell_: nonrecursive: that's what I was thinking too

12:53 nonrecursive: cshell_: yeah when I created the agent I passed it some data but it felt shoehorned in

12:59 alexyakushev: Any ideas?:(

13:01 oskarth_: Anyone managed to get diatomic working with lein repl? I get a ClassNotFoundException for MapMaker when I try to use datomic.api

13:02 borkdude: alexyakushev I'm sorry, no idea

13:14 SrPx: Is clojure a suited language for the creation of a tcp game server?

13:18 AimHere: It's a proper general-purpose programming language, so there's no real reason why not

13:19 SrPx: AimHere: 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:20 AimHere: Dedicated 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:21 Omer: Hi

13:24 VickyIyer: Hi 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:24 ((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:25 alexyakushev: Vickylyer: you probably don't want two sets of parentheses around your number-square implementation

13:25 tmciver: VickyIyer: yes, so number-square should be a function of two args

13:26 alexyakushev: ,(reduce (fn [m v] (assoc m v (* v v))) {} [1 2 3 4 5])

13:26 clojurebot: {5 25, 4 16, 3 9, 2 4, 1 1}

13:26 VickyIyer: yep got it thanks a lot , I think I had an extra pair or parentheses

13:28 Omer: How would I go about downloading an image from a specified URL?

13:29 cshell_: http get

13:36 nonrecursive: i'm trying to get a set of all hash values for a particular key

13:36 so far I have

13:36 (reduce #(into % [(:team %2)]) #{} [{:team 1} {:team 1} {:team 2}])

13:36 and

13:37 (set (map :team [{:team 1} {:team 1} {:team 2}]))

13:37 wondering if those make sense, or if there's a more idiomatic way?

13:39 tmciver: nonrecursive: ##(set (mapcat vals [{:team 1} {:team 1} {:team 2}]))

13:39 lazybot: ⇒ #{1 2}

13:40 nonrecursive: tmciver: the maps actually have more than one key

13:41 tmciver: nonrecursive: how about ##(set (mapcat #(:team %) [{:team 1} {:team 1} {:team 2}]))

13:41 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

13:41 tmciver: oops

13:42 nonrecursive: that 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:43 tmciver: nonrecursive: yup, I forgot you put that one. I think that's the most idiomatic then.

13:44 nonrecursive: tmciver: thanks :)

14:12 VickyIyer: one 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:13 cshell_: ,(apply clojure.string/lower-case '["LOVE" "Clojure])

14:14 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>

14:14 cshell_: ,(apply clojure.string/lower-case '["LOVE" "Clojure"])

14:14 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>

14:14 cshell_: ,(apply clojure.string/lower-case ["LOVE" "Clojure"])

14:14 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>

14:14 cshell_: ,(apply clojure.string/lower-case '("LOVE" "Clojure"))

14:14 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>

14:14 cshell_: heh

14:14 better to use map

14:14 mboeh: ,(clojure.string/lower-case "LOVE" "Clojure")

14:14 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: string$lower-case>

14:14 mboeh: That's what it expands to

14:15 cshell_: ,(map clojure.string/lower-case '("LOVE" "Clojure"))

14:15 clojurebot: ("love" "clojure")

14:15 cshell_: ,(map (comp str clojure.string/lower-case '("LOVE" "Clojure")))

14:16 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map>

14:16 cshell_: ,(map (comp str clojure.string/lower-case) '("LOVE" "Clojure"))

14:16 clojurebot: ("love" "clojure")

14:16 rlb: (str "foo" "bar")

14:17 (apply str (map clojure.string/lower-case ["LOVE" "Clojure"]))

14:17 VickyIyer: ok 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:17 mboeh: Because (apply x [a b c]) expands to (x a b c)

14:17 cshell_: VickyIyer: it applies the function to the list that you provide

14:18 not each arg individually

14:18 that's what map or reduce can do

14:18 mboeh: * applies to an indefinite number of arguments but lower-case only applies to one

14:18 rlb: right, lower-case only accepts one argument

14:18 (lower-case "x" "y" "z") isn't legal

14:18 VickyIyer: Got it now thanks a ton

14:19 cshell_: rlb had it right ,(apply str (map clojure.string/lower-case ["LOVE" "Clojure"]))

14:19 rlb: or you can invert that

14:19 cshell_: ,(apply str (map clojure.string/lower-case ["LOVE" "Clojure"]))

14:19 clojurebot: "loveclojure"

14:19 rlb: (clojure.string/lower-case (apply str ["LOVE" "Clojure"]))

14:22 cshell_: or even (clojure.string/lower-case (str "LOVE" "Clojure"))

14:22 rlb: right -- didn't know if we had to assume an input coll.

14:23 cshell_: good point

14:35 TroyMG: hi 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:37 rlb: TroyMG: I'm sure there are more informed opinions, but for now, I imagine you could use an agent to maintain the state.

14:37 tmciver: TroyMG: I've done something similar using refs.

14:38 TroyMG: rlb: I'm reading up on agents now to see how I would use that

14:38 tmciver: okay, I'll look up refs too

14:39 rlb: I imagine that whether refs, agents, or both are more appropriate depends on exactly what you want to do.

14:41 mboeh: Could anybody help me in figuring out how to parallelize a little program I've been working on?

14:41 rlb: mboeh: one way to find out ;>

14:42 borkdude: TroyMG just an atom would do

14:42 TroyMG: rlb: honestly all I want to do is the equivelant of push/pop to an array on get/post in the todos web app

14:42 mboeh: https://github.com/mboeh/mass-download/blob/master/src/mass_download/core.clj

14:42 TroyMG: borkdude: okay thanks - I'll look up atoms

14:42 borkdude: TroyMG but an atom isn't per session, but globally

14:42 TroyMG: borkdude: that is fine for my usage here. obviously if this was a real app I'd be using a database

14:42 rlb: TroyMG: borkdude may be right too -- atom's the simplest primitive.

14:43 TroyMG: I'm just trying to constrain which portions I have to learn all at once :-)

14:43 mboeh: I'd like to call http-download in multiple threads but store-file in only one

14:43 borkdude: mboeh that sounds like agent to me

14:43 mboeh: Because store-file will eventually be rewritten to store the files in a ZIP archive instead of to the filesystem

14:43 borkdude: mboeh o no sorry, I didn't read it right

14:43 rlb: i.e. more or less just a mutable binding with validation, but bear in mind that it may call the mutator more than once.

14:44 mboeh: I've taken several stabs at using agents here and I can't figure it out

14:46 rlb: mboeh: have to go for a bit, but I may have time to take a look later.

14:47 mboeh: rlb: Cool

15:11 TroyMG: thanks for hte help borkdude rlb and tmciver - I got what I needed working by using an atom

15:23 Raynes: mmarczyk: I thought Python *was* an extra ugly hack?

15:23 OOH, BURN.

15:24 AimHere: Python's surely a pretty hack

15:24 Someone made pseudocode execute

15:32 mmarczyk: Raynes: 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:34 Raynes: I'll be back later to put the finishing touches on it and maybe make the bootstrap a little less ridiculous

15:35 Raynes: Haha

15:35 mmarczyk: Can't you just depend on jython?

15:36 mmarczyk: Raynes: tried it, couldn't get it to import pygments

15:37 Raynes: perhaps an uberjar would work, but I found this solution and wanted to see if everything else works

15:37 uvtc: mmarczyk, I like Python as well. Very easy to get the hang of, though I'm not crazy about its docs.

15:37 mmarczyk: oh? I thought the standard library docs are quite good

15:38 I also have an extremely vague recollection of finding the tutorial useful :-)

15:38 uvtc: mmarczyk, they seem to be complete, but not as useful to me as the Perl 5 docs.

15:38 mmarczyk: ah, Perl does seem to have great documentation

15:39 uvtc: mmarczyk, 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:39 mmarczyk: hm, I never learned Perl, but wanted to do it over the summer out of curiosity

15:39 that's certainly encouraging

15:40 uvtc: mmarczyk, 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:42 mmarczyk: I wonder about the possible utility of Clojure::Script :-)

15:44 anyway, warts and weirdness can be a boon to one interested in a for-fun summer project, right?

15:45 borkdude: I only used Perl superficially, but it looked a lot like PHP to me

15:46 but I only used PHP superficially as well, for what it matters

15:46 Raynes: mmarczyk: 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:46 uvtc: mmarczyk: 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:47 Raynes: mmarczyk: 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:49 mmarczyk: Raynes: good. maybe doing lein deps && ./boostrap.sh && lein trampoline run prod would work, with bootstrap placing the reconstructed jython jar in lib

15:49 (completely ridiculous)

15:49 uvtc: borkdude, 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:50 Sorry, getting a bit off-topic. :)

15:50 borkdude: uvtc that must be it, I only remember the $ signs from them ;)

15:51 mmarczyk: uvtc: looking forward to diving in :-)

15:51 uvtc: mmarczyk: Diving into Perl 5?

15:51 mmarczyk: yup

15:54 uvtc: mmarczyk, 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:55 Raynes: mmarczyk: Fwiw, if this is how it has to be, I think I'm okay with it.

15:56 mmarczyk: One thing I'm wondering is how fast this is though, since it does (PythonInterpreter.) every time.

15:56 Is that literally initializing a new Python interpreter every time?

15:57 Shouldn't we be able to reuse the same one?

15:57 mmarczyk: uvtc: thanks for the tip!

15:57 uvtc: mmarczyk, sure, y/w

15:57 mmarczyk: Raynes: yeah, I think so

15:58 Raynes: This is really cool though. I tried doing this before but just couldn't figure it out.

15:58 Or I gave up before I figured it out.

15:58 One or the other.

15:59 zach_: 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:00 Raynes: That'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:01 zach_: Raynes: I have very little code at the moment... I'm currently only testing validations with noir.validation

16:03 ibdknox: Raynes: I bet when we added *noir-flash* we just didn't add it to with-noir

16:03 Raynes: ibdknox: No, it's there.

16:03 ibdknox: oh weird

16:03 Raynes: Unless he is using a beta/alpha from before we added it?

16:04 ibdknox: maybe

16:04 Raynes: zach_: What version are you using?

16:04 beta8 is the current.

16:04 zach_: Raynes: That'll likely be the problem. One moment,

16:04 frozenlock: ibdknox: Hey I wanted to thank you, I've been using Noir and it works really well! :)

16:05 ibdknox: can't thank me without thanking Raynes these days :)

16:05 but you are quite welcome

16:05 Raynes: <3333

16:05 frozenlock: Oh really, my apologies... thank you Raynes :)

16:05 Raynes: Aw shucks mister.

16:05 akhudek: hmm, I wish bultitude would tell me *which* jar is causing "error opening zip file"

16:06 mmarczyk: Raynes: cool :-)

16:06 Raynes: All of them!

16:08 akhudek: anyone have any tips for how to track this down aside from the usual lein clean && lein deps?

16:08 zach_: 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:08 Raynes: I think the packages changed.

16:09 org.mortbay vs org.eclipse or vice versa

16:09 zach_: Is there something I can do to fix this on my end?

16:09 Raynes: I don't know why it'd happen in the first place. I haven't seen anything like that. I use beta8 in production.

16:10 zach_: Okay, thanks anyways.

16:12 akhudek: curious, the error only happens when I use lein run, but not via netbeans repl with deps from pom.xml

16:28 zach_: 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:28 Raynes: Hah

16:28 AOT is a pain in the ass.

16:33 akhudek: Raynes: 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:33 Raynes: akhudek: 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:34 akhudek: You could delete each artifact in your ~/.m2 one at a time until it stops.

16:34 Assuming it isn't corrupted in the repo.

16:34 borkdude: or unzip all and see where that ends

16:34 Raynes: That's an option.

16:35 You could open each jar in Emacs until you find the one that breaks.

16:35 mmarczyk: Raynes: I'm not sure where to download the jython_installer jar from -- can't seem to find a working direct link on sourceforge :-/

16:35 akhudek: hmm, thanks

16:35 Raynes: mmarczyk: What is it licensed under?

16:36 mmarczyk: Raynes: Python Software Foundation License Version 2

16:36 akhudek: I'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:36 mmarczyk: no idea if it's compatible with EPL

16:36 let's google

16:37 Raynes: mmarczyk: 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:37 It doesn't need to be compatible with the EPL for that, methinks.

16:37 mmarczyk: Raynes: ah, yes, distribution is ok

16:37 Raynes: mmarczyk: Point me to it and I'll throw it on my server.

16:38 mmarczyk: Raynes: http://sourceforge.net/projects/jython/files/jython/2.5.2/jython_installer-2.5.2.jar/download

16:40 Raynes: Wow, either crisis is turtle slow at the moment or sourceforge is capping my download at like 0.1 bytes per hour.

16:40 :p

16:44 mmarczyk: http://raynes.me/hfiles/jython_installer-2.5.2.jar

16:44 mmarczyk: Raynes: thanks!

16:49 Raynes: 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:49 Raynes: Yikes.

16:50 mmarczyk: None of those should even respond to the super key, right?

16:50 mmarczyk: right

16:50 Raynes: My javascript guy isn't around.

16:50 Is it usable at all?

16:50 mmarczyk: yeah

16:50 no big deal

16:50 Raynes: Open an issue for it if you don't mind.

16:51 mmarczyk: sure, though I've no idea what the problem is

16:51 something 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:52 Raynes: Heh

16:53 mmarczyk: actually I hate it when js captures my keypresses unless it's a browser extension :-P

16:53 Raynes: We should probably add a way to turn it off. At least for signed in users, I suppose.

16:53 mmarczyk: hmmm, I could write a patch for that :-)

16:54 Raynes: We need more stuff on the user pages anyways.

16:56 akhudek: aha!

16:56 found it

16:56 lein-clojars I'm looking at you!

16:56 mmarczyk: Raynes: so the current version (which I've just overwritten the same branch with) reuses an interpreter instance

16:56 Raynes: akhudek: You don't need that at all.

16:57 mmarczyk: not 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:57 Raynes: :D

16:57 akhudek: nope, I installed it before realizing that it wasn't useful :D

16:57 borkdude: "installed"?

16:58 akhudek: borkdude: it's a plugin

16:58 borkdude: akhudek ah, lein 1?

16:58 mmarczyk: PythonInterpreter 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:58 but anyway, seems to work

16:58 akhudek: yep

16:59 Raynes: mmarczyk: Coolio

16:59 akhudek: Hm, I wonder, if I had tried to catch that jar exception, could I have retrieved the problem file that way?

17:00 would be good to have some easy way to identify problems like this for people

17:00 Raynes: mmarczyk: 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:00 mmarczyk: the Jython download slows things down some :-(

17:02 Raynes: well I've thought about it and I'm not sure, depends on whether Pygments uses globals (why would it? but I dunno)

17:03 Raynes: simplest option would be to use a fresh PythonInterpreter for each request though

17:03 Raynes: as in the original patch

17:03 Raynes: I think you're right.

17:03 It can't be much worse than shelling out. ;P

17:04 mmarczyk: as mentioned above, PythonInterpreter instantiation is fast

17:04 Raynes: Right.

17:04 Yeah, let's keep doing that.

17:05 mmarczyk: (why does lein repl tell me I can't connect occasionally? arghs, my tools hate me)

17:08 akhudek: hm, sadly the zipexception doesn't have enough detail (which makes sense, since the source could be a stream)

17:15 mmarczyk: Raynes: seems to work -- see the branch

17:16 Raynes: the first PythonInterpreter takes a while to materialize, subsequent instantiations are fast

17:17 Raynes: Excellent

17:17 zach_: Can anyone recommend any non-trivial clojure programs using datomic that I could look at?

17:18 I found Stu's HN example, which is pretty nice: https://gist.github.com/2948756

17:19 mmarczyk: Raynes: just sent you a pull request, though admittedly calling this well-tested would be a stretch

17:19 Raynes: mmarczyk: No biggy. I'll test it out some.

17:19 mmarczyk: :-)

17:20 akhudek: Raynes: thoughts on this? https://github.com/diligenceengine/bultitude/commit/e12fcc8b5a72de3b9bc0fe9c027049be2ce13622

17:20 Raynes: akhudek: I'd love that.

17:21 Shoot me a pull request

17:22 mboeh: So 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:23 https://github.com/mboeh/mass-download/blob/master/src/mass_download/core.clj

17:23 Anyone have any tips?

17:25 mindbender1: what does the different colors in clojure mode represent?

17:26 Raynes: Parts of the rainbow.

17:26 gfredericks: cljs dev on 512mb linode => swap death

17:26 mindbender1: indeed

17:28 gfredericks: well. I'm still going. So swap life maybe.

17:31 technomancy: https://github.com/quil/quil/pull/19#issuecomment-6528481 <- anyone want to make quil more awesome?

17:32 aperiodic: always

17:32 technomancy: ^ 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:33 aperiodic: hmm, i've had a similar sort of idea, except with protocols

17:33 technomancy: wat

17:34 why blaspheme the beauty of function composition with protocols?

17:34 mmarczyk: Raynes: oh man, I left the jython dependency in which I guess makes no sense... I'll update the branch in place

17:34 aperiodic: i find myself making a lot of, basically, objects with "tick" and "draw" methods that i just call in the quil draw function

17:34 Raynes: technomancy: mmarczyk and I are having some issues with lein2 dependency resolution.

17:35 technomancy: o rly?

17:35 Raynes: technomancy: 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:36 aperiodic: technomancy: 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:36 mmarczyk: Raynes: technomancy: as have I

17:36 Raynes: Delete your org/mongo dir from .m2 and try to pull down congomongo 1.9

17:36 mmarczyk: Raynes: 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:37 Raynes: mmarczyk: 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:37 technomancy: Raynes: you mean lein1 doesn't complain when trying to resolve a non-existent jar?

17:37 Raynes: technomancy: No, it seems to resolve the correct jar or doesn't try to resolve the bad one at all.

17:37 mmarczyk: actually since RH is being run by lein, using :extra-...-path (need to look up an appropriate option) will probably work

17:37 Raynes: I don't know what's going on.

17:38 technomancy: fun fact: "Mongo" is Javanese for "hello"

17:38 but MongoDB is implemented in C++ =(

17:38 JOKE RUINED

17:38 Raynes: mmarczyk: Probably.

17:38 mmarczyk: Raynes: right, I'll look into it, then replace the branch

17:39 I believe lein2 has a different set of options though

17:39 technomancy: Raynes: so the logic for transitive deps is slightly different?

17:39 mmarczyk: so would be good to have the mongo driver issue resolved first

17:39 Raynes: mmarczyk: path vs paths in most cases. You can add both.

17:39 mmarczyk: oh

17:39 ok then

17:40 Raynes: technomancy: You're the leiningen dude, you tell me. :p

17:40 borkdude: technomancy I like ruined jokes, was it already finished?

17:41 technomancy: borkdude: potential joke ruined, I guess

17:41 probably something involving hello world

17:41 aperiodic: technomancy: 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:44 mmarczyk: hm, does lein2 even allow extra jars to be specified? (to be added to the classpath)

17:44 technomancy: aperiodic: indeed; quil seems to be too thin a layer around processing

17:44 mmarczyk: in fact, does lein1?

17:48 technomancy: any way of telling lein to put a jar automatically generated during custom bootstrap on the classpath?

17:49 is there any way

17:49 aperiodic: technomancy: 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:59 technomancy: mmarczyk: closest thing is adding entries to :source-paths

17:59 designed for use with directories, but I guess you could abuse it for jars

18:00 mmarczyk: technomancy: thanks, I'll give it a shot

18:09 it works! thanks again

18:16 vschlecht: anyone awake who knows his way around the crate library, especially the binding functions?

18:16 emezeske: ~anyone

18:16 clojurebot: Just 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:19 emezeske: vschlecht: ^

18:20 vschlecht: ty for the reminder... here comes the question: I'm inserting a table into the dom like this: (em/at js/document

18:20 ["body"] (em/append

18:20 (cr/html [:div#whatever (crate.binding/bound an-atom-refering-to-vector-of-vectors a-crate-partial-transforming-the-atom-to-a-table)])))

18:21 This works wonderfullly the first time, i.e. I see a table with the values of my atom.

18:21 however as soon as I swap, the table is replaced in the DOM by [Object#table] or somesuch

18:22 emezeske: Doh, I thought maybe I could help, but that's the one part of crate I'm not super familiar with :(

18:23 vschlecht: I'd guess that you'll have to dive into the crate source, unless ibdknox happens to be around

18:23 vschlecht: emezeske: thnx for trying anyway :-) the binding part seems a little underdocumented and is probably in flux

18:25 ibdknox: hm

18:25 emezeske: vschlecht: I think you're right.

18:25 ibdknox: yeah I threw the binding stuff together because I needed it :)

18:26 vschlecht: ibdknox: no offense meant by calling your code underdocumented :-)

18:26 ibdknox: it is haha

18:26 Raynes: All ibdknox does is break stuff. I fix them.

18:26 ibdknox: pretty much

18:26 I am an endless supply of wrenches ;)

18:27 vschlecht: can you put up a gist

18:27 vschlecht: sure, wait a sec

18:31 ibdknox: https://gist.github.com/2980335

18:32 ibdknox: I was just fiddling around ... eval step by step in a browser-repl to reproduce

18:33 ibdknox: I assume playboard should be html-board on line 10?

18:33 ivan: where 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:33 ibdknox: vschlecht: just for kicks and giggles, instead of making html-board a partial, make it a function that returns a vector

18:34 ivan: I want a line-seq that closes the file if I exhaust it or lose my reference to the seq

18:35 vschlecht: ibdknox: 'l trying

18:35 ibdknox: yeah, it should be... I forgot to de-uglify the name before pasting it for the world to see :-)

18:37 technomancy: ivan: read-lines is a resource leak

18:37 which is why it was removed

18:37 ivan: technomancy: I know but it's so convenient to not care

18:37 S11001001: ivan: (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:37 ivan: I've gotten away with it every time in Python using generators

18:38 S11001001: by python you mean CPython

18:38 ivan: indeed :-)

18:38 S11001001: basically you're relying on unspecified GC behavior

18:38 and your programs will break on pypy, jython, or pretty much anything else

18:38 bbloom: S11001001: namely, reference counting?

18:38 ivan: well, in most cases my file was closed because I actually exhausted the file

18:39 S11001001: bbloom: and the very particular behavior of generators, as it happens

18:39 ivan: S11001001: and thanks, I'll try that

18:39 bbloom: oh laziness. how i love and fear you.

18:40 S11001001: bbloom: the reference-holding behavior is different between generator expressions and functions that use yield. It's evil to use it.

18:40 vschlecht: ibdknox: 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:40 ibdknox: hm

18:41 wait

18:41 what version of crate are you using?

18:41 vschlecht: ibdknox: 0.2.0-alpha2

18:42 ibdknox: try 0.2.0-alpha4

18:42 that should fix it

18:43 you should be able to leave it as a partial too

18:43 S11001001: nonstrict evaluation and uncontrolled side-effects go together like fist and face.

18:44 vschlecht: ibdknox: trying ...

18:48 ibdknox: naahh, doesn't fix it, but now the behavior between function and partial is identical

18:48 I still get a [object HTMLTableElement], though

18:58 ibdknox: vschlecht: are you sure you don't have some old stuff lying around? the scenario works for me

18:59 this does what you'd expect: https://www.refheap.com/paste/3299

18:59 vschlecht: ibdknox: lemme check that

19:03 ibdknox: [object HTMLParagraphElement]

19:03 ibdknox: I'm using enfocus, btw

19:04 ibdknox: could that be a factor?

19:13 ibdknox: 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:37 rlb: mboeh: 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:39 (Though if you want to make sure to interleave (some of) the fetching and the writing, then doall/pmap's not appropriate either.)

19:41 mboeh: oh, wait -- perhaps just use futures.

19:47 clj_newb_0245: i'm trying to get cemerick's friend ring authorization library to work with clojure

19:48 unfortunately, all I'm getting back is the "sorry, you're not authorized" page

19:48 for some reaon, I don't get that pop up that asks me to enter username/password

19:48 I'm using :workflows [(workflows/http-basic)]

19:48 anyone has anyidea how to begin debugging this issue?

19:48 all I want is a stupid pop up window asking for username/password

19:56 Wild_Cat: quick question: what is the recommended Clojure development environment for Windows?

19:57 (and if the answer is Emacs, can you recommend a build that integrates reasonably well with the Windows env?)

20:06 emezeske: Wild_Cat: a linux vm ^_^

20:08 ivan: Wild_Cat: the official Emacs builds work fine

20:08 rlb: Wild_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:09 But I'm admittedly not all that knowledgeable on that front.

20:27 cainus: can anyone help a newbie with a 4clojure problem? what am I doing wrong? https://gist.github.com/2980710

20:30 rlb: cainus: problem 23?

20:31 emezeske: ,(= '() '())

20:31 clojurebot: true

20:31 emezeske: ,(= `() '())

20:31 clojurebot: true

20:31 cainus: yessir

20:32 emezeske: cainus: Is there a space between reverse2 and the square brackets?

20:32 cainus: no... but that makes no diff... what should it be though?

20:32 rlb: cainus: 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:33 (that or a lazy seq)

20:33 * emezeske 's mind is blown that you don't need a space between a symbol and a vector.

20:35 emezeske: cainus: I don't think conj does what you think it does

20:35 cainus: rlb: I'm mostly just trying to figure out syntax at this point but I'll keep that in mind. thanks

20:35 emezeske: cainus: conj is going to prepend to lists

20:35 cainus: hmmm

20:35 emezeske: cainus: conj always adds an element to a collection in the most efficient way

20:36 cainus: for lists, that means prepending

20:36 cainus: for vectors, that would mean appending

20:36 cainus: ahh... so how do I add to either first or last?

20:36 specifically

20:36 emezeske: cainus: for prepend, cons works

20:37 cainus: for append, you can do (concat '(1 2 3) '(4))

20:37 cainus: although I'm sure there's a better way than concat

20:37 rlb: cainus: and you *don't* want to be repeatedly appending to a growing list.

20:38 (very expensive)

20:39 cainus: neither gets me I saw some guy just did #(into () %)

20:39 errrrrr

20:39 I saw some guy just did #(into () %)

20:39 emezeske: I think the best solution is &&(reverse [1 2 3])

20:39 cainus: but I doubt that's expected at so early a stage in the problemset

20:39 emezeske: :P

20:40 cainus: well it's supposed to be without reverse ;)

20:40 cons and concat both fail me... I'll try it in the repl and see why

20:41 emezeske: cainus: with concat, the second item needs to be a list

20:41 cainus: I mean a collection

20:41 ,(concat '(1 2 3) 4)

20:41 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

20:41 emezeske: ,(concat '(1 2 3) '(4))

20:41 clojurebot: (1 2 3 4)

20:42 rlb: emezeske: I think conj or cons are what you probably want, but you need to make sure you're building a list.

20:42 cainus: it needs to pass this too: (= (__ [[1 2][3 4][5 6]]) [[5 6][3 4][1 2]])

20:43 rlb: i.e. if you start with a list (as you did) as the base, you're fine.

20:43 cainus: __ is the fill-in-the-blank

20:43 rlb: Then you can use either cons or conj (assuming we're ignoring large list issues).

20:43 ...and a normal recursion

20:44 cainus: this doesn't work: https://gist.github.com/2980710

20:44 freezes the repl and gives me weird java errors on 4clojure

20:45 "Don't know how to create ISeq from: java.lang.Integer (NO_SOURCE_FILE:0)"

20:48 Srpx: What IDE/Editor/anything you guys recommend for experimenting with clojure (REPL)

20:49 rlb: cainus: 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:51 cainus: rlb: what's your suggestion?

20:52 rlb: I'd use conj or cons and make sure I start with a list.

20:52 (which you did)

20:53 i.e. how do you reverse -- start with (), then cons the first element, then...

20:53 cainus: I'm happy to help as much as you like, just not sure how much help, or what kind, you want.

20:54 cainus: was kind of hoping for syntax help primarily... I think my algorithm is workable, if crappy

20:54 but the repl freezes on it and the 4clojure gives me weird java errors

20:55 maybe I should install clojure and try to the real repl... I'm using a web repl

20:55 rlb: Srpx: I'd offer a suggestion, but I doubt most people do what I currently do -- just emacs + bash...

20:55 cainus: was just thinking someone here might be able to tell me I have a paren out of place or somehting ;)

20:56 rlb: cainus: I'd absolutely recommend that -- it's *really* easy, but hang on, I'll look at your latest example more closely.

20:56 (recommend having a local clojure)

20:56 Srpx: rlb: why you doubt it?

20:56 and why you suggest it

20:56 rlb: I think a lot of people use something much fancier.

20:57 And they'll have to pipe up with whatever it is.

21:04 cainus: 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:04 cainus: ahhh

21:05 rlb: btw, 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:06 That's easy from here http://clojure.org/cheatsheet.

21:06 Just click on the function, then click on the "

21:06 cainus: alright I'll have to install a real repl to use I guess

21:06 rlb: + Source

21:06 button.

21:06 There's also a source link from the main docs.

21:06 cainus: I'm not even running java on this machine... it's going to be a tricky install isn't it?

21:06 rlb: cainus: what os/dist?

21:07 cainus: ubuntu

21:07 can't recall the version

21:07 rlb: probably not. At least in debian unstable, you can run "apt-get install clojure1.4" and you're finished.

21:07 And that might have even propagated to testing, but I'm not sure.

21:08 In any case, clojure's just a jar.

21:08 So all you really need is a moderately recent openjdk.

21:08 then you can just run "java -jar clojure.jar" or whatever.

21:08 Actually, wait, I use...

21:08 cainus: aptitude has a clojure1.3, but that's it

21:09 rlb: cainus: for your purposes, that's fine.

21:09 cainus: oh alright cool

21:09 rlb: cainus: and once you get that installed, it's trivial to download/unpack the clojure zip file, and invoke java on that instead.

21:09 cainus: great

21:09 rlb: cainus: and this is another thing that I'm sure people have fancier ways to handle ;>

21:10 Note 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:11 ":"; exec java -server -cp .:/usr/share/java/clojure-1.4.jar clojure.main "$0" "$@"

21:11

21:11 The ":" at the beginning is a trick that lets the line be accepted by both bash and clojure.

21:11 cainus: "Could not find the main class: clojure.main. Program will exit." ?

21:11 rlb: (the ":";)

21:11 cainus: in what context?

21:11 cainus: I just ran java -cp clojure-1.4.0.jar clojure.main

21:11 in a dir with the jar

21:12 (following http://clojure.org/getting_started)

21:13 hmm I can just run some command "clojure" and a 1.3 repl starts though

21:13 niiice

21:15 alright this is great...thanks rlb

21:16 rlb: np

21:16 I think you'll find that a lot more effective

21:17 cainus: check your clojure-1.4 jar via ls -l.

21:18 To test, I copied it from /usr/share/java via cp -a, and that broke because in Debian it's a local symlink.

21:18 Not sure if that was your problem.

21:18 But when I copied it directly, (without -a), it works fine.

21:18 cainus: I was in the dir of the unpacked zip

21:18 rlb: $ java -cp clojure-1.4.jar clojure.main

21:18 Clojure 1.4.0

21:18 user=>

21:18

21:18 cainus: is the jar at the top-level? I forget.

21:20 cainus: ha I missed the -beta7 on the jar file name

21:21 1.4.0 works nicely now too

21:21 very cool

21:21 rlb: Right -- 1.4.0's out.

21:21 That other trick with ":"; is just in case you want to make a clojure script.

21:21 Just put that as the first line and "chmod +x" the file.

21:22 cainus: ahh... don't know how I missed that

21:22 rlb: (or perhaps chmod u+x)

21:22 cainus: alright cool... I'll give it a go

21:22 rlb: and you may or may not want the -server arg.

21:22 (depending on what you're doing)

21:23 cainus: thanks... this be fun

21:23 rlb: np, glad to help

21:23 cainus: errrr... this'll be fun

21:25 rlb: cainus: oh, and style-wise, you may want to pull your close parens up, i.e. )))) rather than one-per-line.

21:25 cainus: okay... good to know...

21:25 doesn't that make it harder to make sure you have a matching paren?

21:26 rlb: And iirc, the recommended way to check if a coll is empty is (seq coll), i.e. instead of (not (empty? coll)).

21:26 cainus: maybe syntax high-lighting will solve that for me

21:26 rlb: cainus: you *abosolutely* should make sure you're using an editor that has extensive support for that sort of thing.

21:26 Otherwise you're likely to find clojure miserable.

21:26 cainus: anyone else using vim? :)

21:27 rlb: (clojure or any other lisp derivative)

21:27 cainus: you're asking the wrong person ;>

21:27 cainus: haha

21:27 * rlb is trying to finish packaging emacs24 as we speak.

21:28 rlb: cainus: though, I'd suggest if you're willing, that you give emacs a(nother?) try.

21:28 cainus: never really tried it actually

21:28 maybe I will

21:28 rlb: now's an excellent opportunity

21:28 cainus: you can even turn on one of the vi modes, if you'd like to stick with vi commands much of the time.

21:29 (emacs has more than one)

21:29 cainus: it *would* be nice to keep my keybindings

21:29 rlb: cainus: I suspect you might be OK with emacs' eventually, but it might be a nice intermediate step -- dunno.

21:29 cainus: alright... just one revolution per day though... I'm going to get deeper into clojure first ;)

21:30 rlb: And I believe the fancy clojure envs I was alluding to are emacs-based.

21:30 cainus: 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:31 cainus: what would a "lisp mode" entail ?

21:31 something beyond syntax highlighting?

21:31 rlb: Right, it's more than that -- emacs has support for things like rearranging s-expressions based on their structure, etc.

21:31 cainus: ahhhh okay

21:31 rlb: Though that's not lisp-specific, emacs can do that with other languages too.

21:32 (and there's outline mode, which lets you collapse/uncollapse functions, etc. -- though I rarely use it)

21:32 I suspect others love it.

21:32 cainus: yeah I never got the point of collapse

21:33 wreckimnaked: I'm thinking of giving emacs a try too

21:33 rlb: happy to help if I can

21:33 wreckimnaked: last time I didn't have much luck configuring evil for the vi commands

21:34 rlb: I 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:34 wreckimnaked: for regular editing the vi approach is very efficient, don't know much about the emacs side though

21:35 rlb: Though as far as I'm concerned, the most critical thing is to make sure that CapsLock is a control key.

21:35 wreckimnaked: I must say that the finger yoga repelled me quite a bit :D

21:36 rlb: wreckimnaked: I don't know, but I suspect that at least initially, you won't find emacs as "efficient" in your common cases.

21:36 aperiodic: wreckimnaked: 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:36 rlb: But, if that's critical, maybe the modes will help.

21:36 Oh, or what aperiodic said ;>

21:36 wreckimnaked: yeah, I'm a vimclojure user

21:36 aperiodic: their paredit is missing features that emacs paredit has, though :(

21:36 oh, k

21:37 wreckimnaked: but the emacs clojure mode just seems more natural

21:38 I saw a friend editing latex using emacs and it was mind blowing

21:40 adu: wreckimnaked: how so?

21:41 wreckimnaked: it can actually render bits of your latex code inside the editor

21:41 something like this http://www.youtube.com/watch?v=LJgOWxwrEMw

21:41 ~2:55

21:41 clojurebot: Gabh mo leithscéal?

21:45 adu: wreckimnaked: why is the cursor on crack?

21:46 wreckimnaked: adu: hackers

21:46 adu: wreckimnaked: that's pretty awesome

21:50 wreckimnaked: adu: yeah, I started reconsidering emacs seeing that live

21:50 adu: I've been using emacs for 10 years

21:51 wreckimnaked: adu: any advice for a rookie?

21:51 Frozenlock: wreckimnaked: lurk in #emacs

21:51 adu: go through the tutorials

21:51 my favorite tutorial: http://www.youtube.com/watch?v=TZmhzvL15Hc

21:52 wreckimnaked: adu: blender?

21:52 adu: I never said it was an emacs tutorial

21:52 Frozenlock: http://www.masteringemacs.org/ is pretty good too (there's a section for beginners)

21:53 ,flame adu

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

21:53 Frozenlock: Awwww

21:55 adu: those helped me a bunch too http://www.youtube.com/user/rpdillon

21:56 adu: the only elisp I've ever written was in init.el

21:59 clj_newb_02457: how do I get clojure-ring to redirect a page?

21:59 I wnat to get a response which will redirect cc/GET /login to cc/GET /main

22:00 weavejester: clj_newb_02457: In ring.util.response there's a function called redirect

22:00 clj_newb_02457: holy shit

22:00 this is like asking a question about C and getting a kerrigan/ritchie response

22:00 adu: clj_newb_02457: header "Location: /next/page"?

22:00 clj_newb_02457: oh wait, this is more like a bjarne stroustrup response

22:00 you wrote compojure, not ring

22:01 weavejester: clj_newb_02457: Or you could manually create a 302 response map, e.g. {:status 302, :headers {"Location" "/blah"}}

22:01 clj_newb_02457: Well, I think most of the code in Ring is mine, but not the original design :)

22:07 clj_newb_02457: Problem: 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:07 question: is there something similar like :unauthorized-redirect-uri, but instead ,s :authorized-redirect-uri ?

22:07 i.e. how do I set the page the user ends up at after they login?

22:14 :default-landing-uri

22:14 alright, time to setup nginx/apache to get ssl working

22:14 woot

22:14 clojurescript for the win

22:36 ivan: if I AOT everything, can I start a noir/aleph server in < 20 seconds? is this worthwhile?

22:37 adu: what's AOT?

22:37 ivan: ahead-of-time compilation

22:37 adu: o

23:36 cmajor7: is there a concise way to say if either 'a' or 'b' or 'c' less than a certain number?

23:38 without creating a list out of '(a b c) to filter over it, or have three nested (or (< a number) (< b number) (< c number))

23:41 y3di: does anyone else's lein repl crash or just take a long time to do stuff?

23:43 SrPx: Why is print giving lots of nil as output:

23:55 is there any way to add forms like "a+b" or "!a" or "f . g" (comp f g)

23:58 gfredericks: SrPx: wat

23:58 SrPx: wat wat

23:59 gfredericks: are your two statements related?

23:59 SrPx: first I asked whyy things like (for [a (range 4)] (print a)) output (0123 nil nil nil nil)

23:59 gfredericks: ah ha

23:59 that is a good question

23:59 SrPx: õo?

23:59 gfredericks: two things are happening simultaneously

23:59 SrPx: hm

23:59 y3di: hi guys, im having issues with lein plugin install swank-clojure

Logging service provided by n01se.net