#clojure log - Feb 19 2013

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

0:14 Raynes: callenbot: http://dl.dropbox.com/u/23745600/Screenshots/bRgP.png Think I'm doing a good job moving to laser?

2:07 callenbot: Raynes: nice.

2:07 Raynes: one of my main problems with clabango is that I'm not too sure it escapes HTML. This...concerns me.

2:10 Raynes: callenbot: In previous releases of laser, strings were *always* escaped. Now strings are always escaped unless you wrapped them in a special type, forcing you to actually think before you throw unescaped text into your html.

2:11 callenbot: Raynes: that's more or less what I'd like to clabango. At some point I'm going to need to buckle down and fix it because the next site I am making has users exposed to each others' input.

2:11 to do in*

2:11 Raynes: I keep discovering little things that need to be added/changed as I go along in refheap. Once I'm done with it I'll release 1.0.0.

2:14 callenbot: Also happy to report that I'm not far from finishing up the move to laser in refheap. I buckled down and did biggest part today, since it was a holiday.

2:16 callenbot: Raynes: you had a holiday today?

2:16 god fucking dammit

2:16 Raynes: presidents day!

2:16 callenbot: I need to leave the startup world.

2:18 Raynes: are you working out of a branch?

2:18 Raynes: Yes.

2:19 callenbot: Raynes: code's like a sniper rifle, but awful specific about the markup.

2:19 Raynes: looks a lot more practical than enlv.

2:20 Raynes: callenbot: I'm not sure what 'like a sniper rifle' means in the context of code. :p

2:21 callenbot: Raynes: it reaches out and touches things.

2:21 with an economy of effort.

2:21 Raynes: I think you mean like a laser.

2:21 I'm having serious trouble telling whether you're saying you hate it, or...

2:22 These phrases are bizarre.

2:22 :P

2:22 callenbot: Raynes: I like it, but I don't know if it's for me yet or not.

2:22 Raynes: it's definitely won out over enlive and I'll start sending people that way if they like enlive.

2:22 Raynes: Well if you don't like enlive (and you don't), you probably won't like laser either just because it's generally the same concept.

2:23 Right, I see what you mean.

2:23 "I don't care for this style of templating, but I prefer your library over the other one regardless."

2:23 Appreciated, sir.

2:23 callenbot: Raynes: I'm not really sure what I'd use if I wasn't using clabango.

2:24 I think I'm better off thatching the roof danlarkin made.

2:25 Raynes: Heh

2:25 I wonder...

2:26 ~hmmm, when suddenly...

2:26 clojurebot: Gabh mo leithscéal?

2:26 Raynes: Aw.

2:26 ~suddenly

2:26 clojurebot: BOT FIGHT!!!!!111

2:26 Raynes: callenbot: He used to have a thing where he'd say "CLABANGO" a couple of years ago when you did that.

2:26 callenbot: that's awesome.

2:26 I love how bots are unpredictable.

2:27 Raynes: There was something else named clabango back then.

2:27 I can't remember what that was all about.

2:27 ~suddenly

2:27 clojurebot: BOT FIGHT!!!!!111

2:27 Raynes: ~suddenly

2:27 clojurebot: BOT FIGHT!!!!!111

2:28 Raynes: I know it's in there somewhere.

2:29 callenbot: http://clojure-log.n01se.net/date/2010-08-08.html#03:13

2:29 Apparently danlarkin planned something called clabango several years ago, but only recently actually did a project with that name.

2:30 Maybe he'll give us a history lesson one dya.

2:30 day*

4:49 NeedMoreDesu: Is there something like (arity-match? f arity) function, returning true/false?

4:50 Where f is function, arity is integer.

5:42 alexnixon: NeedMoreDesu: not in the general case, as far as I'm aware. You can look at the :arglists metadata if you have a var though.

5:47 xsyn: Hi all, I wonder if you can help

5:47 I've been building a project with lein

5:48 and everything has been fine

5:48 but I've recently added the clojure-csv library

5:48 and no matter what I do, I get this:

5:48 user=> (use 'clojure-csv.core)

5:48 4 #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure_csv/core__init.class or clojure_csv/core.clj on classpath: >

5:48 I've check in my ~/.m2 and it's there

5:48 I'm not sure what to do?

5:54 ucb: xsyn: check lein classpath see if the jar is there

5:55 xsyn: it is

5:55 ucb: strange

5:56 well, rather, I don't know what might be happening :)

5:56 xsyn: :) thanks

5:57 I even cracked open the jar to check that it was there, and everything seems fine. I suspect this is a case of user error

6:24 borkdude: I'm trying to rebuild some examples from https://github.com/relevance/org-html-slideshow - there is a command "git submodule update" which doesn't seem to to anything

6:26 hmm https://www.refheap.com/paste/11462

6:32 vijaykiran: borkdude: did you try git clone --recursive ?

6:33 borkdude: which version of git are you using ?

6:33 borkdude: aaah, no I didn't

6:33 vijaykiran this is actually the first time I see such a recursive git project

6:38 vijaykiran tnx, it works

6:41 vijaykiran: borkdude: yw :)

6:46 augustl: any suggestions for SOAP clients for Clojure? I'm new to the JVM as well so not familiar with the various libraries I could interop with.

6:50 xsyn: ucb: turns out that you need to restart your nailgun when you add new libraries. The reason it couldn't find it from the repl is that the repl was loaded before the code was added

6:51 ucb: xsyn: oh, nailgun!

6:51 makes sense :)

6:51 I assumed this was fresh JVMs all around

6:51 xsyn: yeah, I had forgotten about it, and was making the same assumption

6:52 the repl I use for editing uses vimclojure, and as such....

8:16 gfredericks: does anybody have a jquery externs file for 1.7.1 (or whatever)?

8:17 the link in the jayq README 404s

8:35 mpenet: gfredericks: that sucks. I will try to fix that

8:36 gfredericks: mpenet: thanks :)

8:36 mpenet: it was here: http://code.google.com/p/closure-compiler/source/browse/#git%2Fexterns

8:36 but for some reason the jquery externs disapeared

8:37 gfredericks: ok http://code.google.com/p/closure-compiler/source/browse/#git%2Fcontrib%2Fexterns

8:38 borkdude: what is the most "common" way to add TODOs to an org-mode document without creating extra headings (so extra structure) for it

8:39 I can of course add comments

8:39 gfredericks: borkdude: a TODO has to be on a heading...so depends what you mean by "extra" I guess?

8:39 mpenet: sweet, thanks!

8:40 borkdude: gfredericks I'm writing documents with org-mode, I want to remind myself to fix some things in the document, but I don't want to change the toc etc, just to add some todos

8:40 gfredericks: hm

8:40 borkdude: more like "inline todos"

8:40 gfredericks: I do slides in org-mode and I end up with a * Meta heading at the top for stuff like that

8:41 which is exactly not inline

8:41 so I guess I don't know an easy way to do what you want

8:41 headings are complected!

8:41 borkdude: gfredericks just curious: how do you export your org-slides?

8:41 gfredericks: html export, the use the org-html-slideshow lib

8:42 borkdude: gfredericks built by stuart sierra et al?

8:42 gfredericks: yep

8:42 borkdude: gfredericks great, I was experimenting with it and I like it

8:42 gfredericks one thing that got me though was that MathJax doesn't work in presentation mode :(

8:42 gfredericks: really?

8:43 does MathJax run some JS at startup?

8:43 borkdude: gfredericks not out of the box at least

8:43 gfredericks yes, I think so

8:43 gfredericks: I have a fork that gives you hooks for manipulating the slides after rendering

8:43 that should probably give you a straightforward way to make it work

8:43 borkdude: gfredericks I also tried #+OPTIONS: LaTeX:dvipng which got me into some -shell-escape problem

8:44 gfredericks: I don't know anything about that :/

8:44 borkdude: gfredericks good, does it allow javascript to be executed?

8:44 gfredericks: borkdude:as in "rather than clojurescript"?

8:45 it's a regular callback, so yeah you can do anything you want

8:45 borkdude: gfredericks I guess I can call mathjax from there

8:45 gfredericks: exactly

8:45 I used it to make an interactive slideshow

8:45 borkdude: gfredericks I was just trying the standard mathjax stuff which org-html-export puts in

8:46 gfredericks I opened an issue for it, but I have not yet the solution myself https://github.com/relevance/org-html-slideshow/issues/12

8:46 augustl: are there any libraries out there that reads XML and outputs hiccup-like data?

8:47 borkdude: augustl why, isn't the "parse" output good enough?

8:47 augustl: borkdude: what are you referring to with "parse"?

8:48 borkdude: augustl http://clojuredocs.org/clojure_core/clojure.xml/parse

8:48 augustl: ah

8:49 gfredericks: borkdude: https://github.com/fredericksgary/org-html-slideshow/blob/com.gfredericks/src/cljs/org_html_slideshow/main.cljs#L282

8:50 borkdude: I'd like to extend that so you can add handlers based on the class of the slide

8:50 (helpful since you can add custom classes to slides in org-mode by just adding more tags)

8:50 borkdude: gfredericks cool, I will look into this later this afternoon

8:50 gfredericks: so e.g. I have slides that want to show two <pre> areas side-by-side, so I mark those with a special class and have a handler than rearranges the html

8:51 borkdude: gfredericks cool

9:16 gfredericks I have smth weird here: I cloned your repo, but I don't see the callback changes in the code, while I see it on github...

9:18 gfredericks ah fixed, it's only in that branch I see

9:18 gfredericks: borkdude: ah yes, sorry

9:19 the com.gfredericks branch is supposed to correspond to the clojars artifacts under the com.gfredericks group

9:19 I kept it off master because I was hoping tamer stuff would get merged back into the main project, but I'm less hopeful about that now

9:19 gavilancomun: Hi. Is it possible to use the new reducers with clojure 1.4.0? I can only find examples using 1.5 beta.

9:20 gfredericks: gavilancomun: I don't think they're included with 1.4

9:21 gavilancomun: OK, thanks.

9:23 borkdude: gfredericks you removed the clj sources from this branch? https://github.com/fredericksgary/org-html-slideshow/tree/com.gfredericks/src

9:23 gfredericks: probably? I removed clojurescript one, maybe that was related

9:23 borkdude: gfredericks I was trying to build

9:24 gfredericks: there aren't too many commits, I think the messages are probably meaningful

9:26 borkdude: gfredericks ah so lein cljsbuild once

9:26 gfredericks: sure

9:27 borkdude: gfredericks yeah, it works :-) (at least, my dummy callback, now let's try to include some mathjs stuff)

9:27 gfredericks: nice

9:31 borkdude: how're you using it? from your own cljs project?

9:32 borkdude: gfredericks how do you mean?

9:33 gfredericks: borkdude: just curious whether you're modifying org-html-slideshow inline, or using it as a lein dep

9:33 borkdude: gfredericks now I'm modifying inline

9:33 gfredericks just to see if I can get it working

9:33 gfredericks: cool

9:33 I think I went out of my way to make it more usable as a library than the original

9:34 borkdude: gfredericks I might consider doing that later

9:34 gfredericks I'm kind of new with clojurescript and all this, even org-mode

9:35 gfredericks: it's definitely more of a toolchain to wrangle than powerpoint

9:36 arkx: lein-cljsbuild doesn't support --debug flag to Google Closure Compiler?

9:36 borkdude: gfredericks yeah, I like it a lot

9:37 dnolen: arkx: lein-cljsbuild can only support what ClojureScript itself supports passing through to Closure

9:38 arkx: Right. ClojureScript itself doesn't support --debug flag? It seems pretty useful.

9:39 I'm still hunting down the bug from yesterday. It wasn't related solely to doseq after all. Instead whenever the advanced compiler decides to emit one function as global function s, it's broken, and whenever it uses u or t instead all works... Really irritating to debug.

9:40 Some other part of the generated code or some library is overwriting the global function s to undefined... sigh.

9:42 borkdude: how do I call MathJax.Hub.Startup.onload() in Clojurescript, like this? (.onload MathJax.Hub.Startup)

9:42 xsyn: Does anybody here use VimClojure

9:42 ?

9:43 dnolen: arkx: that doesn't really make sense - are you sure own code isn't redef'ing something?

9:45 borkdude: or (MathJax.Hub.Startup/onload) ?

9:46 xsyn: I've been using vimcloure, and it's been great, with lein

9:46 dnolen: borkdude: (.onload js/MathJax.Hub.Startup ...)

9:46 xsyn: trouble is I recently made a bunch of changes to my code, passed the function to the vimclojure repl

9:46 and nothing happened

9:46 had to restart the nailgun server

9:47 surely this isn't the best workflow

9:47 am I doing something incorrectly

9:47 borkdude: dnolen trying

9:48 arkx: dnolen: at least not on purpose. Switching away from advanced mode makes all errors disappear.

9:58 dnolen: arkx: yeah I'm skeptical that adv mode overwrites anything (as long as it handles all source files) unless it is happening somewhere in your own code.

10:00 arkx: that said advanced mode is tricky, there are many things which work outside of advanced that don't work under advanced. doing property stuff with strings is a big no no and an easy way to run into trouble.

10:00 arkx: At this point I'm betting it's some js plugin we use.

10:00 Like jQuery datatables..

10:00 dnolen: arkx: and you're using the jQuery extern file and everything is going through closure?

10:00 arkx: Yep.

10:01 The externs file for jQuery.datatable is hand-written though.

10:01 borkdude: does it matter to javascript if I pass a persistentvector or an array

10:02 I mean: do I need to do something special if javascript expects a normal array

10:04 dnolen: borkdude: passing CLJS to JavaScript is not a good idea

10:04 borkdude: into-array presumably then

10:04 dnolen: borkdude: we have cljs->js in core now

10:04 borkdude: dnolen I want to attach a callback function in clojurescript and call a js function that expects an array

10:04 dnolen: borkdude: which handles all the relevant data types

10:05 and is extensible to your own data types

10:05 borkdude: dnolen ok

10:06 ChongLi: marshalling and unmarshalling :(

10:07 arkx: dnolen: anyway, what do you think about adding support for the --debug flag? Seems pretty useful to me until we get source maps

10:07 dnolen: arkx: what does it do?

10:07 arkx: link?

10:08 borkdude: probably I'm doing smth terribly wrong, but I get this: return MathJax.Lb.Zc(tc.b(V(["Typeset", MathJax.Lb])

10:08 dnolen: borkdude: yes because you're using MathJax w/o an externs file

10:08 arkx: https://code.google.com/p/closure-compiler/wiki/FAQ#My_code_broke_when_using_advanced_optimizations!_How_do_I_figure

10:08 dnolen: and running some level of optimization greater than whitespace

10:10 borkdude: dnolen yes, I figured that out :-s

10:10 dnolen I'm new to clojurescript, sorry

10:11 dnolen: arkx: open a ticket. it'll move faster if I get a patch.

10:12 borkdude: hrm tho it shouldn't munge if you're using a leading js/ like I said earlier.

10:12 borkdude: dnolen hmm

10:13 dnolen I'm doing this now (.Queue js/MathJax.Hub (into-array ["Typeset",MathJax.Hub]))

10:15 dnolen: js/MathJax.Hub, foreign stuff always needs leading js/

10:15 borkdude: yes, it works!

10:16 dnolen probably this was a caching thing

10:16 dnolen: borkdude: good to hear was about to get worried there :)

10:16 borkdude: dnolen I can try again now with pretty-print turned off

10:19 does lein cljsbuild / the clojurescript compiler recompile if the source didn't change?

10:19 lein cljsbuild once

10:19 arkx: Nope.

10:19 borkdude: shit, without pretty-printing it doesn't work

10:20 dnolen: borkdude: if you're going to be making many changes auto would be much faster

10:20 borkdude: dnolen I was only changing the compilation settings, not the source

10:20 dnolen but to be sure I deleted the compiled file

10:21 dnolen guess something is wrong after all

10:21 I might be using an old clojurescript version - how do I tell?

10:21 dnolen: borkdude: that it wouldn't work w/o pretty-printing doesn't make much sense

10:22 borkdude: dnolen do you mean, I would need an externs file even when I use js?

10:22 dnolen: borkdude: you only need externs if you're compiling MathJax w/ your own code.

10:22 borkdude: dnolen I don't

10:22 dnolen: then no need

10:23 borkdude: that said it's easy to make simple mistakes w/ CLJS compilation - have you looked at http://github.com/magomimmo/modern-cljs?

10:23 borkdude: dnolen I have this code (.Queue js/MathJax.Hub (into-array ["Typeset",MathJax.Hub])) but it gets translated to MathJax.Lb.Zc(pb.b(V(["Typeset", MathJax.Lb]))

10:24 dnolen: borkdude: hrm, I don't know and I gotta run, ask your question on the CLJS ML, people are pretty active there

10:24 borkdude: dnolen tnx!

10:24 dnolen: borkdude: it maybe a bug with js/, though I'm surprised this hasn't come up before

10:24 borkdude: actually I gotta run too, but will ask this later.

10:25 dnolen: if it is

10:25 ravster: hello all

10:25 bendlas: hi all

10:26 Question: In core.logic (run* [q] (fd/in q (fd/interval 3 3))) throws right now

10:26 is this intended or a bug?

10:26 dnolen: can you tell?

10:30 TimMc: stuartsierra: Hey, how have y'all been testing apps for unbound *read-eval*? When I set -Dclojure.read.eval=unknown in a leiningen project, clojure.main blows up...

10:30 stuartsierra: sorry, busy

10:30 TimMc: kk

10:31 Well, the question is really for anyone who has done so.

10:39 dnolen: bendlas: checking

10:41 bendlas: yeah that's a bug, I don't think that ever worked, file a ticket please

10:50 TimMc: This is just sad: https://en.wikipedia.org/wiki/Scala_%28programming_language%29#Syntactic_flexibility

10:52 ravster: do people prefer liberator or using ring directly for auth?

10:53 NeedMoreDesu: What is the most straightforward way to hold recource file outside of jar in lein?

10:54 I wish to write in that file, not only read it.

10:56 deg: I need to transform equal-sized subsequences of a list. I know I can partition the list and then use mapcat to transform each piece and put them back together, but I'm looking for an idiomatic way to avoid constructing temporary small lists.

10:57 For example, a cleaner way to say (mapcat (fn [[var val]] [(symbol var) val])

10:57 (partition 2 raw-bindings))

11:09 ChongLi: deg: I don't think there's an idiomatic way to do it without some kind of deforestation/fusion library

11:09 gfredericks: constructing temporary small lists is totally idiomatic :)

11:11 TimMc: deg: Unless you can show a severe performance hit, it's not worth trying to avoid those allocations.

11:12 ChongLi: haskell's got some advantage in this area

11:12 ghc rewrite rules are pretty nice

11:13 ravster: Whats the best way to have a system do a basic-auth OR cookie-auth? I'm thinking of using the ring libs for that directly.

11:13 ChongLi: you can probably do the same thing with macros but it'd be tricky

11:14 ravster: Remvee's code looks like it would fail if a request comes in without basic-auth , even though it might still have a cookie

11:17 gfredericks: ChongLi: and then you'd be using macros :(

11:19 TimMc: ChongLi: I think deg's use-case *is* a macro.

11:20 pocho: Is there a better way to get all of the values in a map than (map (fn [x] (get x 1)) (seq my-map))

11:20 TimMc: vals

11:20 bbloom: pocho: ##(doc vals)

11:20 lazybot: ⇒ "([map]); Returns a sequence of the map's values."

11:21 TimMc: $findfn {:a 1 :b 2} [1 2]

11:21 (Slow, or broken?)

11:21 lazybot: [clojure.core/vals]

11:21 olenhad: Hey folks, do namespace based operations (use, require ) etc compile down to js/require when you're compiling for node?

11:22 Bodil: olenhad: No, it still uses Google Closure's package system on Node.

11:24 ChongLi: I wish there was an asynchronous version of auto-complete.el :(

11:24 ac-nrepl is so slow

11:31 NeedMoreDesu: Why use ac when there is nrepl-indent-and-complete-symbol?

11:31 ChongLi: good question

11:32 it doesn't seem to work in clojurescript

11:33 NeedMoreDesu: didn't try it in clojurescript, sorry.

11:33 Bodil: It does with auto-complete?

11:33 ChongLi: let's see here

11:33 nope, it pops up nrepl-error

11:34 I had just been using ac-source-dictionary

11:34 and yasnippet etc.

11:34 Bodil: Yeah, it did sound a bit strange, as Piggieback doesn't rebind anything but eval...

11:35 NeedMoreDesu: Ac can be very slow on low number of letters

11:35 ChongLi: ac is slow because it's synchronous

11:35 they had the same problem doing clang completion

11:36 blocking the UI while talking to a server is not a good idea

11:36 Bodil: ChongLi: Somebody should write an async version of auto-complete. :)

11:36 ChongLi: I wonder if this would apply?

11:36 https://github.com/BinaryPeak/kdcomplete

11:37 gfredericks: #datomic is pretty inactive :/

11:38 Bodil: ChongLi: Oh, that looks _very_ interesting...

11:41 ChongLi: the author puts closing parens on their own lines :(

11:41 clojurebot: author is hiredman

11:41 TimMc: haha

11:42 hiredman: Oh snap, did you see what the bot just said about you?

11:42 ChongLi: fantastic stuff

11:42 NeedMoreDesu: Wait, how do you need to put closing parens?

11:42 Bodil: ChongLi: That's pretty much as discouraging as catching somebody indenting with tabs :(

11:44 ChongLi: speaking of which, something in emacs is inserting tabs randomly

11:44 I have no idea where to start looking

11:45 TimMc: NeedMoreDesu: Consecutive closing parens are generally stuck together with no intervening whitespace.

11:46 It's just a style thing. There's no syntactic significance, but if you give each closing paren its own line, people will look at you as though you are wearing your underpants on the outside.

11:47 craigbro: hey, I sometiems put a closen paren on it's own line

11:47 NeedMoreDesu: Ah, I see the code now.

11:47 gfredericks: craigbro: come on man underpants go on the inside

11:47 TimMc: I've done it very occasionally, where it really made sense. Can't remember why that was.

11:47 NeedMoreDesu: I do put, but close and format afterwards.

11:47 craigbro: specifically, if the containing form is explicitely a list of "things to do" -- like shell scripting commands

11:48 ChongLi: only time I do that is when I comment something out with paredit-comment-dwim

11:48 which forces the closing parens to a new line on its own

11:48 TimMc: craigbro: Yeah, that sounds about right. But you end up with two chunks of parens, not a sequence of lines each with a single paren.

11:48 craigbro: yah, I don't do the staircase thing, on purpose

11:49 NeedMoreDesu: With one exeption: when it's convinient to have plain lines between parens, like large list.

11:49 ChongLi: this is the code we're all talking about:

11:49 https://github.com/BinaryPeak/kdcomplete/blob/master/kdcomplete.el

11:49 kdc-create-completion-types makes my eyes bleed :(

11:50 TimMc: There's definitely some clothing layer inversion going on there

11:50 ChongLi: at least he didn't use camelCase

11:50 rboyd: maybe he gets paid by the line

11:50 NeedMoreDesu: Still, how do I make some resource in the folder near uberjar? I can't edit resource when it's in uberjar, where lein place them.

11:50 ChongLi: if this was clojure I bet he'd have used commas all over the place too!

11:51 resources aren't meant to be edited afaik

11:52 NeedMoreDesu: Well, it's config files.

11:53 ChongLi: (System/getProperty "user.home")

11:53 something like that

11:53 just start spitting files in there :)

11:54 NeedMoreDesu: I'd like to place them all in a folder near .jar

11:54 ChongLi: where is the .jar going to be stored on the client machine?

11:55 NeedMoreDesu: Sort of anywhere. It's runnable.

11:55 ChongLi: it's generally bad form to put user config stuff in places like that

11:55 since the .jar may be run by different users

11:56 and you may not have write permissions there

11:57 NeedMoreDesu: Hm, ok, that may make sense.

11:58 ChongLi: yeah this was a big problem for legacy windows applications

11:58 which would store their configs in the program directory

11:59 alexnixon: Is it a bug that (realized? some-cancelled-future) returns true, despite the docstring which states "Returns true if a value has been produced for a promise, delay, future or lazy sequence."? A related consequence is that an exception is *thrown* if you attempt to print a cancelled future, whereas printing an agent which saw an error *prints* the exception.

12:01 TimMc: ,(doc future)

12:01 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:01 callenbot: TimMc: is it safe to use future to do work in the background from a parent thread that will close before the future finishes?

12:02 TimMc: I believe so.

12:02 callenbot: cool, just trying to avoid needing to use a queue.

12:02 TimMc: (I was just checking the docs above, it was not by way of an answer.)

12:04 alexnixon: ,(let [f (future (Thread/sleep 10000)] (future-cancel f) (prn "realized?" (realized? f)) (prn f))

12:04 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException>

12:04 alexnixon: :-(

12:05 hiredman: that is an unmatched delimiter exception

12:06 TimMc: alexnixon: Missing a paren in the let binding.

12:06 alexnixon: ,(let [f (future (Thread/sleep 10000))] (future-cancel f) (prn "realized?" (realized? f)) (prn f))

12:06 clojurebot: #<SecurityException java.lang.SecurityException: no threads please>

12:06 alexnixon: :-(

12:09 hiredman: ,(let [f (future (Thread/sleep 10000)] (future-cancel f) (prn "realized?" (realized? f)) (prn f))

12:09 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>

12:09 hiredman: ~botsnack

12:09 clojurebot: botsnack is scoobysnack

12:09 alexnixon: well, the output is "true" and then a CancellationException is thrown, which to me feels like a bug as it's inconsistent with the behaviour of other implementators of clojure.lang.IDeref (agents and delays)

12:10 the problem being that (I believe) the intended semantic of `realized?' is "if we deref the IDeref, will we get a value?". And that's broken for cancelled futures.

12:11 augustl: are there any libraries out there for calling a function daily, another function hourly, etc? Other than using cron, of course.

12:12 rboyd: augustl: there's https://github.com/michaelklishin/quartzite

12:13 augustl: rboyd: thanks

12:23 hmm, Quartz seems to be very fond of singletons

12:34 dnolen: bbloom: ping

12:34 bbloom: dnolen: pong

12:34 dnolen: bbloom: http://jsperf.com/om-vs-pam-vs-phm

12:35 so threshold at 8 seems fine to me

12:37 bbloom: dnolen: ok, sounds good

12:37 dnolen: so let's get OM out of there :-)

12:38 dnolen: bbloom: heh, not quite there yet - situation does look as good in other browsers - and I'm curious if we can do better if the compiler understands ^not-native fns

12:39 "doesn't look as good in other browser" I mean

12:41 progo: do you know good clojure projects that used nested namespaces in a good fashion? I'm looking for an example

12:42 borkdude: nested namespaces do not exist as far as I know

12:43 progo: well, just multi-part named namespaces then :)

12:43 bbloom: borkdude: huh? you can just have ./foo/bar.clj and ./foo.clj

12:43 borkdude: that works fine

12:43 progo: I've always written very short namespaces/modules and I'm starting to feel uncomfortable with 500-line files

12:44 bbloom: progo: that's something that took me a while to get used to as well: my rails files were generally ~50 lines max

12:44 (except user.rb, which is always a mess :-P)

12:44 borkdude: bbloom those aren't nested namespaces, those are just two namespaces whose name reflect a directory structure

12:44 bbloom: borkdude: so then what exactly is a "nested namespace"?

12:44 borkdude: bbloom I would say a namespace that lives inside another namespace

12:45 bbloom: progo: 500 lines is getting big, but you should only break it up once you have clear layers/components

12:45 borkdude: i think you're arguing semantics

12:45 borkdude: bbloom yeh probably

12:45 bbloom: progo: like the ClojureScript compiler which has one big compiler.clj at around 2,000 lines. that got broken in half into analyzer.clj and compiler.clj

12:46 progo: bbloom: yeah it consists of hiccup-based page templates and some helpers

12:46 bbloom: progo: just like you shouldn't prematurely optimize or prematurely generalize, you shouldn't prematurely organize :-)

12:46 basically, -ize-ing is bad prematurely :-P

12:46 progo: bbloom: yeah... Might have done that sometimes :p

12:47 borkdude: izing on the cake

12:47 progo: perhaps I should altogether move hiccup-templates to user-configurable space and load-eval them in later on.

12:48 abp: dnolen: Just ran it on my Galaxy S2 in Android Chrome, it's listed as Chrome 18.x, so don't let those results annoy you..

12:50 dnolen: abp: hehe, no it's always good to get mobile numbers

12:50 abp: a pretty fast device

12:51 bbloom: dnolen: abp: yeah, wow, phones are getting fast....

12:51 abp: dnolen: It's just that it's not listed as 'Mobile', so quite misleading. I think Chrome 18 Desktop would be much faster.

12:51 dnolen: abp: I find it hilarious that you're mobile device is competing w/ FireFox nightly

12:52 er I mean 18

12:52 abp: dnolen: Yeah gave me a stop too. Chrome's crazy. Now running in the native browser..

12:52 * TimMc takes away dnolen's ' and e keys

12:52 abp: Next up: Ipad3 :D

12:52 dnolen: FF nightly is actually doing pretty good, especially PAM numbers

12:52 er PHM

12:52 :P

12:53 abp: dnolen: Did not expect that too. Thougt they were still improving on memory usage. ;x

12:54 arkx: dnolen: turns out it was a piece of Flex code defining single-letter global variables through ExternalInterface.

12:54 abp: dnolen: What the.. even faster!

12:54 dnolen: arkx: heh, yuck

12:54 arkx: My thoughts exactly..

12:57 abp: Chrome on iOS is a disaster. Thanks Apple. :)

12:57 dnolen: abp: yeah no JIT'ing I believe

12:59 abp: dnolen: Safari isn't doing any better. So my old smartphone is faster than the IPad 3..

12:59 craigbro: heh

13:00 abp: Or at least the browsers are lightyears ahead.

13:00 bbloom: abp: it's basically only useful for sending tabs to my ipad for reading in bed

13:02 abp: Problem is they don't allow other browsers. All get to use UIWebView.

13:02 Even more horrible than safari.

13:02 dnolen: abp: well I just added iPad mini numbers, they seem only slightly better than Chrome iOS

13:03 borkdude: does clojurescript have a separate mailing list?

13:03 dnolen: borkdude: it does

13:03 borkdude: dnolen I googled but only found discussion on whether it should exists

13:04 dnolen: borkdude: http://groups.google.com/group/clojurescript

13:04 borkdude: dnolen tnx, I will post my issue now there

13:05 dnolen before I post, what relevant version info should I include?

13:05 dnolen: borkdude: I'm assuming your using lein-cljsbuild?

13:05 0.3.0?

13:05 borkdude: dnolen yes

13:06 dnolen: it just pulls the latest, just post your issue

13:06 AtKaaZ: hi, could anyone help me out with this: https://gist.github.com/AtKaaZ/4988320

13:07 TimMc: arkx: This is the doseq issue? How did Flex interfere exactly?

13:08 borkdude: dnolen done

13:08 dnolen: TimMc: it writes JS globals via ExternalInterface

13:08 abp: btw, you can emit your CLJS code w/ a wrapper

13:09 TimMc: I wouldn't expect rogue globals to interfere with doseq.

13:09 dnolen: TimMc: it will interfere w/ everything, doseq was a red herring

13:09 abp: dnolen: Huh?

13:09 TimMc: Huh, OK.

13:09 dnolen: abp: oops sorry

13:10 abp: dnolen: np. :D

13:10 dnolen: arkx: ^ see my comment above about emitting w/ a wrapper

13:12 TimMc: Does that imply that CLJS will (by default) write its own single-letter globals?

13:12 arkx: In advanced mode Google Closure Compiler writes single-letter globals

13:12 TimMc: Oh, gross/

13:13 arkx: dnolen: I was unaware of that. How?

13:13 TimMc: So... it's a collision of two latent bugs.

13:13 AimHere: Probably makes sense if you're optimising JS for space; presumably it renames all your own single letter globals from cljs

13:13 dnolen: TimMc: well just short name globals - a non-issue if you control the source.

13:13 TimMc: Closure behavior is not a bug

13:15 arkx: :output-wrapper true in your cljs-build :compiler options

13:15 arkx: Ah, beautiful.

13:15 Thanks.

13:15 dnolen: arkx: np

13:16 AtKaaZ: ,(eval '`{:a (+ 1 2) :b ~(+ 1 3)}) ;can you replace the "eval '`" part with a macro ? so it's (xmacro {:a (+ 1 2) :b ~(+ 1 3)}) but returns same result

13:16 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

13:16 dnolen: arkx: it may be incompatible w/ ^:export, but I'm not sure

13:16 TimMc: dnolen: Misfeature, then. In JS, you can't really expect to always be the only one playing in the sandbox.

13:17 arkx: I first suspected some JS libraries we were using, but they all used 'var' correctly before their single-letter variables.. gah. :)

13:17 We're rewriting a Flex client with ClojureScript

13:17 dnolen: TimMc: I've worked on many projects where you can assume that.

13:17 arkx: Didn't think that there was some previous uses of ExternalInterface in that inherited code.

13:18 dnolen: TimMc: and arguably the most complex JS apps in the world written by Google also get away w/ this just fine.

13:18 arkx: Still, missing var from declaration is one of *the* most common bugs in JavaScript

13:18 bbloom: dnolen: although to be fair, more and more google stuff is moving from closure -> angular :-P

13:18 augustl: I need to subclass a class, create instances of that class, and be able to get the .class of that subclass. Should I just do that in Java? :)

13:18 TimMc: Is there some insignificant cost to wrapping?

13:19 dnolen: arkx: yes, and wrappers won't really save you there.

13:19 bbloom: dnolen: at least closure UI -> angular. closure compiler is likely still in use

13:19 TimMc: Anyway, just because someone successful gets away with something doesn't mean it's a good idea.

13:19 dnolen: bbloom: that's interesting though I haven't heard such rumblings.

13:19 augustl: bbloom: what Google systems are AngularJS now? The only one I'm aware of is the first one, DoubleClick

13:20 TimMc: Safety is a process, and you process is different from theirs.

13:20 *your (ugh, insane lag)

13:21 bbloom: dnolen: augustl: nothing pre-exsisting

13:21 dnolen: augustl: i just know a few folks working on new(-ish) google stuff w/ angular

13:21 augustl: I see

13:22 bbloom: it also plays nice with closure-ui in the sense that you can embed angular in a div without much pain

13:22 dnolen: bbloom: interesting

13:23 TimMc: in anycase, this not a point I care about much. JS is a mutable anywhere anytime language - there's no real protection from anything.

13:26 TimMc: dnolen: You can work to protect yourself from spending a day or two stuck debugging something nasty like this.

13:27 dnolen: TimMc: trying to protect yourself from a library overwriting some global will take you more than a day. Trust me, the NYTimes is most hostile JS environment I have ever seen.

13:27 TimMc: heh

13:28 Raynes: dnolen: Battleship: NYTimes.

13:28 TimMc: What I mean is, if wrapping by default protects developers from anguish and has little cost, it's probably worth it.

13:28 ChongLi: dnolen: would caja help?

13:29 dnolen: TimMc: yes we use wrappers and all that stuff, doesn't fix some library changing a prototype, or overwriting a global namespace with shared data, or a billion other things.

13:29 ChongLi: I never looked closely at caja, but I doubt - that's more about eval'ing untrusted sources I thought.

13:30 TimMc: Eh, not trying to solve *all* those problems.

13:30 ChongLi: hmm

13:31 dnolen: TimMc: the problem is all of a kind. Closure approach of saying - no everything should and must go through this one whole program compile program process is not a bad solution given that.

13:33 TimMc: What can I say, I'm a belt-and-suspenders kind of guy.

13:37 Raynes: gf3: Dunno if you've committed anything on develop, but just a heads up that I've removed develop and master is the primary branch now. It shouldn't matter regardless of your changes.

13:39 AtKaaZ: is there a textual way to type ` like quote is for ' ?

13:40 type=write

13:40 Chousuke: no

13:40 at least not in jvm clojure

13:40 AtKaaZ: k

13:40 Chousuke: it's implemented purely on the reader level

13:40 dunno about clojurescript

13:40 AtKaaZ: I'm into jvm only

13:40 bbloom: AtKaaZ: Chousuke is correct, but if it did have a way to write it, it would likely be clojure.core/syntax-quote

13:41 Chousuke: clojurescript uses clojure's reader (for now)

13:41 ecmendenhall: Hi, everyone. I'm wrapping some js methods in Clojurescript and wondering about the most idiomatic solution.

13:41 bbloom: AtKaaZ: do you need programatic usage of syntax-quote?

13:41 ecmendenhall: Macros (like `shim` in cljs-d3: https://github.com/lynaghk/cljs-d3/blob/master/src/clj/cljs_d3/macros.clj) need specified arities to avoid trouble with `this`.

13:41 AtKaaZ: bbloom: it appears so, but that's probably because I don't know how to do something

13:42 bbloom: AtKaaZ: what are you trying to do?

13:42 ecmendenhall: Wrapping direcly with lots of `defn`s (eg. jayq: https://github.com/ibdknox/jayq/blob/master/src/jayq/core.cljs) works, but it seems like there should be a better way

13:42 ...and there's always just learning to accept the interop dot.

13:42 Chousuke: write a macro to write the defns?

13:42 AtKaaZ: bbloom: i sent a msg to clojure ML, but basically a macro that returns same as (eval `(quote {:a (+ 1 2) :b ~(+ 1 3)})) but by replacing "eval `" with macroname :)

13:43 ecmendenhall: (In fact, I see some value in keeping the js methods explicit). Is there some widely accepted solution?

13:44 bbloom: AtKaaZ: github.com/brandonbloom/backtick

13:44 AtKaaZ: bbloom: oh sorry, I mean replacing "eval `(quote" with macro

13:45 bbloom: AtKaaZ: let me know if backtick does the trick

13:45 AtKaaZ: bbloom: will do, thanks so far

13:45 ecmendenhall: Chousuke: Yeah, that's where I started. But it's difficult to use `apply`, which compiles to fn.call(null, …) in js.

13:46 Chousuke: difficult in which way?

13:47 I don't know clojurescript specifics much but I can help with macros :P

13:49 ecmendenhall: Chousuke: js functions that use `this` sometimes break (or at least, they did six months ago).

13:49 mpenet: ecmendenhall: how so?

13:50 dnolen: mpenet: because of fn.call(null, ...)

13:50 Chousuke: can't you write your own apply that handles this explicitly instead of passing null?

13:51 dnolen: ecmendenhall: hmm, actually I'm not sure why you're running into issues

13:51 clojurebot: No entiendo

13:51 mpenet: I never encountered an issue with this. and I use this (via this-as) all the time.

13:52 `abp: I'm preparing my first open source library for release. :)

13:52 dnolen: ecmendenhall: if you look at implementation of apply you'll see we invoke via (.apply f f ... args ...)

13:52 in the case of real JS fns

13:53 AtKaaZ: bbloom: template is the macro that I wanted, thanks!

13:54 it is freaking amazing :)

13:55 ecmendenhall: dnolen: Thanks, I'll take a look. Actually, I think I'm thinking too far ahead here. I'm not sure I need to worry about `this` anyways. Back to the REPL!

13:59 bbloom: AtKaaZ: nice! thanks :-)

14:14 Frozenlock: Aw cmon, gmail blocks an outgoing email because there's a .exe in a zip file.

14:15 AtKaaZ: lol, does passwording it work? or + encrypt file names

14:19 Frozenlock: changed .zip to .abc -_-

14:19 Still, I'm really against the idea of gmail deciding what I can and can't send.

14:20 amalloy: vote with your feet, Frozenlock. use another email provider if you're actually "really against" it

14:20 ChongLi: or send files via dropbox!

14:20 pimeys: I have this infinite project to start my own email server

14:20 encrypted, in netherlands

14:20 ChongLi: or numerous other services

14:21 Frozenlock: amalloy: thinking about it.

14:21 AtKaaZ: infinite?

14:21 pimeys: sigh, configuring imap/smtp is just so boring

14:21 AtKaaZ: because I never start it :D

14:21 just talk about it all the time

14:21 Frozenlock: I have my own domain, so I could just use my own mail server.

14:21 AtKaaZ: pimeys: sounds like something I'd do=)

14:21 pimeys: VPS is very cheap now

14:21 3,50 euros per month

14:21 so I can buy two of them

14:26 bbloom: dnolen: so what's the latest on predicate dispatch?

14:29 dnolen: bbloom: uh, not having time to work on it? :)

14:30 bbloom: dnolen: that's what i figured :-)

14:30 dnolen: bbloom: it's waiting a bit on me finding a couple weeks to dedicate to core.match

14:30 TimMc: Frozenlock: cotse.net is not bad.

14:31 bbloom: dnolen: along the lines of the stuff i was showing you on sunday, i've been exploring some of those ideas via fipp. one of the things i discovered is that i need two tools for processing propertied-trees: a transformation language and a style language. roughly XSLT and CSS

14:31 technomancy: Frozenlock: does it block it on the SMTP level or just from the web UI?

14:31 dnolen: bbloom: I'd like to refactor and document everything - and hopefully it'll be easier to see how you could make something like pred dispatch work.

14:31 bbloom: dnolen: things like Enlive covers XSLT for HTML, but there really isn't a comparable solution for arbitrary clojure trees

14:32 dnolen: either way, XSLTs (and CSS for that matter) have a "best matching" behavior, which is very similar to predicate dispatch

14:32 dnolen: ie the most specific selector or the most specific xpath query matches

14:32 dnolen: bbloom: right

14:32 bbloom: dnolen: i'd love to do something like that with arbitrary predicate dispatch

14:33 NeedMoreDesu: Why print doesn't print anything to console, but prints to repl?

14:33 bbloom: dnolen: i made fipp to basically be a playground for those ideas :-) so i might dig into predicate dispatch a bit

14:34 dnolen: bbloom: well you could attempt to understand core.match - I don't get much help w/ that projects sadly.

14:34 bbloom: dnolen: i'll definitely look through it a bit

14:34 dnolen: bbloom: probably best to read the paper first - not much of the codebase will make sense otherwise

14:34 Frozenlock: technomancy: Did not check, I'm usually only using the web UI.

14:34 Yeah I know... I should read my mails in emacs :P

14:34 bbloom: dnolen: i'm rewatching your predicate dispatch talk, since it's been a full year since i thought about this problem. in the process, i have opened all the relevant papers you're mentioning in tabs. heh

14:34 technomancy: not a fan of the UI, but they seem like a reasonable IMAP provider

14:35 TimMc: NeedMoreDesu: The REPL is set up to intercept stdout.

14:35 technomancy: insofar as reasonable and IMAP can go together

14:35 dnolen: bbloom: the Maranget is the most relevant - we only really changed a couple things.

14:35 NeedMoreDesu: TimMc: what should I do, then?

14:35 TimMc: Depends on what you want, I guess.

14:36 NeedMoreDesu: Print to stdout.

14:36 bbloom: dnolen: cool, we'll chat about it more after i have some time to digest

14:36 NeedMoreDesu: And, well, see something on the screen.

14:37 TimMc: You mean, see it once you;ve exited the REPL?

14:37 bbloom: dnolen: in particular, i'm thinking about how to represent XPath or CSS-selector like ideas on arbitrary clojure trees

14:37 NeedMoreDesu: I don't see printed text at all, when I'm not in repl.

14:37 When program is run via lein run

14:37 TimMc: Wait, what am I thinking... the REPL isn't necessarily capturing stdout.

14:37 NeedMoreDesu: lein run isn't a REPL.

14:38 NeedMoreDesu: Yep. print prints to repl only?

14:38 Is there a way to change that?

14:38 dnolen: bbloom: oh right, somebody had mentioned tree matching - not support for that at the moment - Will Byrd has mentioned cata matching and maybe that's good enough. I know the Chez guys use that stuff int their compiler

14:38 so maybe cata matching is good enough for trees?

14:39 AtKaaZ: bbloom: can I resolve them like ` does when using template if I wanted to?

14:40 TimMc: NeedMoreDesu: The behavior you're describing doesn't make sense.

14:41 gfredericks: AtKaaZ: check how template is defined -- you can supply a resolver fn

14:41 AtKaaZ: gfredericks: in process, thx

14:41 TimMc: NeedMoreDesu: I think you need to make a SSCCE.

14:41 ~sscce

14:41 clojurebot: An SSCCE is a Short, Self-Contained, Correct Example <http://sscce.org/&gt;

14:42 dnolen: bbloom: have you looked much at the Chez compiler literature?

14:42 AtKaaZ: gfredericks, bbloom: done dit it: (defquote like-backtick resolve)

14:43 gfredericks: :)

14:43 AtKaaZ: this is so awesome=)

14:43 NeedMoreDesu: jee, I've just needed to println.

14:43 bbloom: AtKaaZ: gfredericks is right. i think that the real clojure implementation is slightly different than just clojure.core/resolve, let me check for you in a few minutes. i migh tjust add that to backtick directly as backtick/syntax-quote

14:43 dnolen: no, i haven't. link?

14:44 NeedMoreDesu: Problem solved.

14:45 dnolen: bbloom: I may be off, but I think any serious dive into compiler approachers for a modern Lisp should probably start here http://www.cs.indiana.edu/~dyb/

14:46 Raynes: NeedMoreDesu, TimMc: Funfact: print doesn't automatically flush.

14:46 bbloom: AtKaaZ: gfredericks: yeah, so the difference is between Compiler.resolveSymbol and Compiler.maybeResolveIn

14:46 AtKaaZ: gfredericks: one returns symbols, the other returns Vars, value objects, etc

14:46 Raynes: If you use print, you need to do (flush) before you'll see anything.

14:47 AtKaaZ: Raynes: but newline does?

14:47 gfredericks: bbloom: any advantage to backtick/syntax-quote over `?

14:48 AtKaaZ: gfredericks: i can write a macro like this: (xmacro {:a (+ 1 2) :b ~(+ 1 3)})

14:48 bbloom: gfredericks: backtick/syntax-quote doesn't exist, i'm creating it right now :-P but the only real advantage would be the ability to (list* `syntax-quote ...) ie in a macro or something.

14:49 Raynes: $(source println)

14:49 Jesus.

14:49 gfredericks: sounds good enough to me

14:49 Raynes: It's my own bot and I can't use it.

14:49 $source println

14:49 lazybot: println is http://is.gd/WCT4fo

14:49 AtKaaZ: boot owner, if you typo :)

14:50 Raynes: Anyways, https://github.com/clojure/clojure/blob/clojure-1.4.0/src/clj/clojure/core.clj#L3306

14:51 When *flush-on-newline* is set, prn flushes.

14:51 And since println calls prn, you get a flush.

14:51 pr (which print calls) does not do this.

14:51 AtKaaZ: cool

14:52 Raynes: println is like one of those automatic toilets with a sensor that flushes when you step away from it. print is a normal toilet with a handle for manual flushing.

14:54 cemerick: Raynes: you need to finish your book, if only so I can see that description in print

14:54 Raynes: Heh

14:59 hyPiRion: That's not far from how System.in works. Except that you receive the stuff flushed from the toilet.

14:59 TimMc: Raynes: I hate those automatic toilets. When I'm wearing a black t-shirt, they randomly decide I've stopped existing.

14:59 hyPiRion: And that you can switch pipes so that the tubes spit out something else instead.

15:00 Raynes: Yikes, hyPiRion.

15:00 Saying that after he said that...

15:00 hyPiRion: And the fact that you can remove some screws from the source and get a constant leaking in

15:00 Raynes: Not the best idea ever.

15:00 hyPiRion: Well, I need to get rid of my System.in anger somewhere

15:01 Comparing it to toilets is a great way of doing it

15:02 `abp: So, Raynes metaphor reaches quite far. Congratulations on a job well done!

15:02 Raynes: I'll pat myself on the back immediately.

15:02 `abp: Instant reward

15:03 Hm, making conflict free DSVs is hard.

15:04 It's LISP, just in vectors. Clojures XML.

15:04 But this time the aspect human readable is actually a truthful guarantee.

15:04 Frozenlock: Is there a way to test lazy stuff in the REPL? For example, when I test a function, everything is fine, but when I try it in production, I find a lazy@sdasfe instead of the actual data.

15:05 gfredericks: I often `(def name expr)` instead of `expr` to keep it from being realized

15:05 well wait

15:05 if you're just talking about printing rather than errors

15:05 s/errors/debugging/

15:05 then you want prn/pr-str, etc?

15:06 Frozenlock: Ok, so instead of just typing 'expr', I should do (pr-str expr)?

15:06 Raynes: That'll do it.

15:08 denlab: watching Clojure/conj 2012 - Lightning Talks / heroku. it's cool

15:09 bbloom: AtKaaZ: almost done with a full syntax-quote macro with resolving. you're not the first person to ask for it, so i figured i'd just get it done

15:10 AtKaaZ: bbloom: awesome, I was just preparing to use just this until then: (backtick/defquote almostLikeBackTick clojure.core/resolve)

15:10 bbloom: AtKaaZ: yeah, that's close. it misses mostly interop forms, like .foo and Bar.

15:13 AtKaaZ: bbloom: also doesn't throw when it doesn't resolve to anything, i just notice it just does nil like (resolve 'f)

15:13 `abp: AtKaaZ: You like camelCase don't you? :)

15:13 bbloom: AtKaaZ: yeah, clojure.core/resolve is pretty different than what you actually need, it only appears to work :-P

15:14 AtKaaZ: `abp: but for the wrong reasons :)

15:15 TimMc: Frozenlock: Or prn

15:15 AtKaaZ: `abp: ie. some-weird-symbol can't be double clicked selected, oh but I just notice it can be triple clicked to select it=) so let's just say I'm reconsidering it

15:16 `abp: if only i could move over it with one Ctrl+left/right-arrow when I want to

15:16 `abp: AtKaaZ: Sounds like you don't use Emacs a lot.

15:16 AtKaaZ: `abp: indeed, in eclipse:)

15:18 `abp: AtKaaZ: Let me tell you this: Two weeks into Emacs and in no way looking back. Clojure, paredit, Javascript, orgmode, eshell, dired etc. It's a dream.

15:18 AtKaaZ: `abp: ah, nevermind tripleclick selects entire line, so close

15:18 `abp: i believe you, but i'm not ready to make the quantum leap i guess

15:19 Frozenlock: `abp: Would be even better if github's support of org-mode wasn't so sketchy.

15:19 Raynes: http://images2.fanpop.com/images/quiz/243000/243987_1246097307737_400_300.jpg

15:20 `abp: AtKaaZ: Actually it's no quantum leap. Read the tutorial built into Emacs, pick emacs live if you don't want to configure everything yourself and you are ready to read up on modes keychors. It's mostly reading about key combinations and memoizing them.

15:20 Raynes: Memoizing them. lol

15:20 I've memoized all my keys.

15:20 `abp: AtKaaZ: You can convert orgmode to markdown

15:21 AtKaaZ: `abp: yeah that's what I tried but I found the key combinations to be different in emacs-live than some other normal emacs configs others use, so some tutorials were not doing what I'd expect

15:21 * Frozenlock has lazy key-sequence

15:22 `abp: AtKaaZ: Those are really only a few you can read up or even comment in the default-keybindings file in your .emacsd.

15:22 AtKaaZ: `abp: if someone could write an emacs tutorial for replacing eclipse , I'd be most interested to read and point out what's missing=)

15:22 `abp: AtKaaZ: Not much interferring except C-h => delete characer, M-h => help instead of C-h

15:23 AtKaaZ: Just a suggestion to improve your worklife

15:24 AtKaaZ: `abp: i don't remember if emacs-live had git support? and some way to diff and compare two commits,

15:25 `abp: i know emacs would be better, but so far eclipse seems easier

15:25 `abp: AtKaaZ: magit

15:25 Frozenlock: AtKaaZ: It's a trap :P

15:25 `abp: AtKaaZ: Yea

15:26 AtKaaZ: You will be stuck forever if you don't leap forward.

15:27 augustl: any suggestions for automating testing of calls to an external SOAP API, without actually calling the external API?

15:28 Frozenlock: "Thankfully, although Emacs has a steep learning curve, once you “get” it — you get it." http://www.masteringemacs.org/articles/2011/11/10/belated-first-anniversary/

15:29 denlab: @<augustl> I've got a project in progress for that (because I have the same problem at work)

15:30 augustl: denlab: I guess I'll just write the code so that I can test it without actually doing HTTP

15:30 bbloom: AtKaaZ: sorry, gotta run for a bit. will release new version of backtick later tonight

15:30 Bodil: augustl: You will if you expect to be able to call your tests unit tests, at least :)

15:31 AtKaaZ: Frozenlock: that's exactly what puts me off with emacs(i think), i need to understand how it uses that elisp code (aside from it being fully elisp or lisp or whatever it is) so that i can know where to look when i want to change a key for example or run some code at startup or on open and stuff

15:32 denlab: augustl: the idea of the project (http-scribe) is to listen to http traffic, record it, then pretend to be the server

15:32 AtKaaZ: bbloom: it's ok, i can wait, tc

15:33 Frozenlock: i'll give that a read , this one: http://www.masteringemacs.org/reading-guide/

15:34 denlab: everyone is talking about microservices & all, but there is no obvious way to test/mock/fake/stub them

15:36 augustl: Bodil: I hate unit tests! :P

15:37 denlab: augustl: I used to love unit tests

15:38 augustl: I do automated testing and test first, but I prefer to only test the actual app (such as doing HTTP requests to an HTTP API)

15:38 and selenium for UI, etc

15:39 denlab: with some technologies it's safer to test everything

15:41 Bodil: What IRC client are you using?

15:42 Bodil: denlab: Irccloud - why, what's it doing wrong? :)

15:43 denlab: Bodil: nothing :) It's just it's only my 2nd time on #clojure and I find my IRC client (XChat) a bit bulky...

15:44 Bodil: I was asking advice

15:45 Bodil: denlab: Well, Irccloud lives in a browser tab, I can recommend it if that's where you prefer to keep your irc session. It's a paid service, though.

15:46 denlab: Bodil: huh?! and then aoutch!?

15:46 Bodil: ;-)

15:47 Bodil: I should try one of the emacs IRC client anyway

15:47 augustl: I hope I can buy and deploy my own irccloud instance when it goes out of beta

15:47 Bodil: denlab: I prefer as few open windows as possible, and I've found Emacs and Chrome to be a minimum. And my Emacs window is where I go to focus on programming, so I don't want my irc client in there. So it has to go in the browser. :)

15:47 hashbang1: denlab: if you are looking for a text-mode client, irssi and weechat are nice.

15:48 Bodil: augustl: Why'd you want the trouble of hosting it yourself?

15:48 denlab: :hashbang1 thx, I'll put it on my org-mode list

15:48 :Bodil it make sense

15:49 Bodil: denlab: +1 for irssi, it's my favourite console client.

15:49 augustl: Bodil: I don't want to pay for it on a monthly basis, I already pay for lots of bandwidth and CPU elsewhere..

15:51 Bodil: augustl: The price is easily worth the lack of bother for me. Life's too short for sysadmin work. :)

15:51 augustl: I'll probably end up paying as well..

15:51 the client is so much better than irssi

15:56 denlab: I will represent Clojure on a code contest next thursday

15:56 with a friend of mine (pair prog contest)

16:01 TimMc: Bodil: I happen to already have a server (well, a laptop that lives under the couch at home), so irssi is a no-brainer.

16:06 Raynes: denlab: You'll want to kill yourself within 5 minutes of using any given Emacs IRC client.

16:06 denlab: XChat is an excellent client though.

16:06 Irccloud would have to give me cookies on a daily basis to get me to pay for them.

16:06 Bodil: TimMc: I have servers to run it on, I've just done too much server admin in my life to pass up on paying someone a couple of dollars to do it for me. :)

16:07 Raynes: The only hting it has going for it is "Stay connected even when you're offline" and I have a znc server for that.

16:07 technomancy: erc is fantastic

16:07 Raynes: thing*

16:07 Bronsa: erc is ^

16:07 Raynes: technomancy: I was implying setup.

16:07 Frozenlock: +1 for erc

16:07 Raynes: Erc is rudimentary if you want to program your IRC client.

16:07 technomancy: Raynes: you don't *have* to turn paredit on in erc you know =)

16:07 Bodil: Raynes: I was super happy with ERC (aside from the bit about interfering with my programming), after spending about a month configuring it...

16:09 denlab: Raynes: What client do you recommand?

16:09 Raynes: denlab: Well, I normally recommend XChat on *nix, but...

16:09 :p

16:09 technomancy: use irissi if you don't use emacs and aren't allergic to perl

16:10 ChongLi: I use irssi despite using emacs!

16:10 Raynes: I'm not a fan of irssi.

16:10 Bronsa: i switched to erc from irssi

16:10 and now my erc looks like irssi :(

16:10 denlab: I'am neutral regarding perl, and in love for emacs

16:11 brainproxy: technomancy: weechat > irssi

16:11 technomancy: denlab: rcirc is another option that ship with emacs; they're nearly indistinguishable these days. erc has more 3rd-party modules; rcirc's codebase is a bit cleaner.

16:11 hashbang1: weechat is nice, and you can extend it with a handful of diff languages

16:11 TimMc: Bodil: What admin is there to do?

16:11 Bodil: hashbang1: If one of them is a lisp, I'm sold.

16:11 hashbang1: Bodil: scheme is one

16:12 Bodil: TimMc: Installing and configuring? :)

16:12 Raynes: Bodil: Like you even use Lisp. You write Clojure editors in CoffeeScript.

16:12 technomancy: there's a big difference between "can extend in lisp" and "written in lisp"

16:12 TimMc: I guess a dedicated IRC service can make sure your client "comes back up" after restart.

16:12 Bodil: sudo apt-get install irssi; irssi

16:12 Raynes: Heh.

16:12 That's like 5 year old buys car, drives.

16:12 Bodil: Raynes: Go hug a pony. :)

16:13 TimMc: Not trying to convert you; just trying to understand the appeal of a web service.

16:13 denlab: I want a great IRC Client, the Emacs integration is secondary (or is it related? ;-)

16:13 Bodil: TimMc: I'd tip you more than what I pay Irccloud just for typing that for me. ;)

16:13 TimMc: How much do they charge?

16:13 Raynes: TimMc: I think the appeal is persistent IRC connections without having to set up znc (which is easy).

16:13 $3 if you don't want to connect to a private IRC network.

16:13 $5 if you do.

16:13 Per month.

16:13 TimMc: Total? Per month?

16:13 brainproxy: my personal setup is znc running on a vps

16:14 then I use weechat running in tmux on my mac to connect to it

16:14 Raynes: brainproxy: I run znc with a web interface and everything and do it as a service to tons of people.

16:14 technomancy: Raynes: znc is easy against one server; it's a nightmare going to multiple though.

16:14 Raynes: technomancy: No it isn't.

16:14 You need to upgrade your znc.

16:14 brainproxy: technomancy: it's not that bad nowadays

16:14 Raynes: 1.0 has multiple server support per user.

16:14 technomancy: hm; the docs I read were horrible

16:14 Raynes: It's damn near perfect now.

16:14 technomancy: huh; that's encouraging

16:15 brainproxy: you can get a $5/month vps from digitalocean

16:15 technomancy: it still uses fauxml, which I try to avoid on principle

16:15 bloop: can someone explain to me why (sort subset? [list of sets]) works sometimes but not other times? It seems like subset? should work as a comparator because it's transitive... is there some property its missing that stops it from making a stable sort?

16:15 Raynes: technomancy: I've set up 5 different accounts and haven't touched a config file in two years because of the web interface.

16:15 TimMc: bloop: subset? is a partial order

16:16 brainproxy: Raynes: agreed, the web interface takes a lot of the pain away

16:16 Raynes: I lie, I had to touch it once to enabled SSL cause I couldn't figure out how to do that in the web interface.

16:16 TimMc: bloop: What is the correct sort for this? [#{} #{3} #{5} #{3 5}]

16:16 technomancy: Raynes: configuring solely through an HTML form is just as bad as learning a bullshit XML dialect though (on a different axis albeit); if I'm going to configure something it's gotta be in version control or it doesn't exist

16:17 bloop: TimMc: Is there a better function to use? I don't care if it's stable - only that subsets appear before supersets.

16:17 technomancy: I guess you could do the config in the web UI and check in the generated files provided it emits them properly?

16:17 Raynes: technomancy: It emits things properly.

16:17 bloop: TimMc: I would say that hat is already "sorted"

16:17 Raynes: The web interface is just an interface to the one config file, technomancy.

16:18 TimMc: bloop: What if I switched the two middle elements?

16:18 technomancy: well that's good to hear; after what I read from earlier versions I didn't have high hopes for them getting things like that right =\

16:18 bloop: TimMc: still "sorted"

16:18 Raynes: Pretty sure the web interface has emitted to the regular config file for ages.

16:18 bloop: TimMc: As long as no supersets appear before a subset

16:18 Raynes: But yeah, znc has had some misses.

16:19 The original one-server-per-user thing was batshit crazy.

16:19 TimMc: bloop: OK, it's not the best example... I need one that doesn't have simple equivalence classes.

16:19 jweiss: what's a common way to share behavior among several related records? i've seen maps of kw to functions be passed around as "behavior". is that as good as anything or is there a more idiomatic way

16:19 Raynes: I nearly hurled myself out the window with excitement when I found out they were fixing it in 1.0.

16:19 bloop: TimMc: it's seems to mess up most often when there is more than one "island" of sets, if you catch my meaning

16:20 amalloy: bloop: "works sometimes but not other times" is not debuggable. what is an x such that (sort subset? x) returns a value you don't like?

16:20 brainproxy: znc also use to have problems with floods if the connection between znc and the irc server/s got interrupted, especially if you were in lots of channels

16:20 but I haven't experienced that problem in awhile

16:21 bloop: TimMc: eg (sort subset? [#{17 18} #{1} #{17} #{1 2} #{2} #{1 2 3 4} #{18}])

16:21 amalloy: though actually the problem is pretty easy to see: as TimMc says, subset? imposes a partial order, whereas sort requires a total order

16:22 TimMc: bloop: Is this sorted? [#{} #{1} #{1 2} #{1 6} #{1 2 3}] -- I suspect you won't like that, but subset relationships are never reveresed in that one.

16:23 bloop: amalloy: yes

16:23 TimMc: yes

16:24 TimMc: You could probably make a "total comparator" by wrapping something around subset?, such as a size check...

16:24 bbloom: gfredericks: updated backtick with full syntax-quote

16:24 amalloy: it's fine to say you want subsets to come before supersets, but if you tell sort that #{17 18} comes before #{1} (because you don't care about their ordering), and then that #{1} comes before #{17} (again, you don't care), it will conclude that #{17 18} comes before #{17} without ever calling subset? on the two of them

16:24 bloop: TimMc: that list is sorted according to my needs: no superset appears before a subset

16:24 amalloy: TimMc: that total comparator is easy: (sort-by count sets)

16:25 bloop: so just sort them by size, as i say above

16:25 you'll never get a larger set before a smaller one, so problem solved

16:25 TimMc: I'm not even sure how sort is supposed to work with a predicate like subset?.

16:26 bloop: ha! thanks guys, I think that works, doesn't it?

16:26 amalloy: TimMc: it probably converts it using copmarator

16:26 TimMc: ,(sort = [1 5 2 8 9])

16:26 clojurebot: (1 5 2 8 9)

16:26 TimMc: ,(doc comparator) Oh, is that a thing?

16:26 clojurebot: "([pred]); Returns an implementation of java.util.Comparator based upon pred."

16:26 amalloy: ah no, it doesn't do that

16:27 TimMc: I'm not sure what *that* does.

16:27 amalloy: clojure functions implement Comparator

16:27 TimMc: it assumes that pred is a function like <, and implements Comparator by calling pred

16:28 TimMc: Oh, fancy. cond (pred x y) -1 (pred y x) 1 :else 0)

16:29 hyPiRion: oh, muha

16:29 ,(sort - [5 1 4 -3 2])

16:29 clojurebot: (-3 1 2 4 5)

16:29 amalloy: which is odd, because i think that's already how (fn) implements Comparator

16:30 clintnewsom: bit of a n00b to clojure

16:30 i have an atom (def my-atom (atom {:turns [] :winner false :game-over false}))

16:31 which i'm trying to update the value :winner

16:31 i know update-in

16:31 is the way to go

16:31 TimMc: amalloy: Interesting, I don't see it in the Java source.

16:31 amalloy: TimMc: Afunction/compare

16:31 AFunction

16:31 clintnewsom: but can't seem to wrap my head around the syntax

16:31 TimMc: Ah, thanks.

16:31 amalloy: (swap! my-atom assoc :winner true)

16:32 clintnewsom: i know updating the :turns vector would be something like

16:32 (swap! my-atom conj [:turns :first])

16:32 hyPiRion: (swap! atom fn-to-use arg1 arg2) => (reset! atom (fn-to-use @atom arg1 arg2))

16:32 dnolen: ,(assoc-in {:turns [] :winner false :game-over false} [:winner] "Bob")

16:32 clojurebot: {:turns [], :winner "Bob", :game-over false}

16:32 hyPiRion: (Except it's atomic, so no issues with that @atom thing)

16:33 clintnewsom: thanks

16:33 dnolen: clintnewsom: in the case of setting a winner you don't really need update-in, just assoc-in

16:33 clintnewsom: that worked

16:33 haha

16:33 i knew i'd see you here

16:33 yes

16:33 thankyou

16:33 TimMc: amalloy: In fact, it's even better than clojure.core/comparator, since it allows use of both booleans and numbers.

16:33 amalloy: yeah

16:33 clintnewsom: oh

16:33 dnolen: update-in is only when you want to change an existing value w/ a function to something else.

16:33 hyPiRion: TimMc: Not sure what you mean by better. What is true, and what is false?

16:34 It's not evident from my perspective.

16:34 (Neither's -1, 0 and 1 though)

16:36 TimMc: hyPiRion: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFunction.java#L51

16:36 If a boolean is returned, the fn may be called again with the params reversed.

16:40 gf3: Raynes: Thanks for the heads up

16:40 Raynes: gf3: There shouldn't be any merge conflicts or anything, so I'm not sure why I bothered you at all.

16:41 gf3: Raynes: BECAUSE YOU'RE A NICE GUY

16:41 Raynes: callenbot: You mentioned a css preprocessor. Are you saying I should use SASS?

16:42 Because we might have to engage in fisticuffs.

16:57 Frozenlock: what would be a clojure way of trying something up to X number of time? (->> (repeatedly 5 do-stuff) (take-while empty?)) ??

16:57 lazybot: Frozenlock: Definitely not.

17:00 TimMc: Two end-conditions, where one is a max iterations and the other depends on output of the body?

17:01 Frozenlock: Yup

17:01 TimMc: Looks like a reasonable approach.

17:01 I'd add a dorun at the end of that, though.

17:02 Frozenlock: I've used a doall...

17:02 TimMc: Or that.

17:02 Frozenlock: I always confuse them..

17:03 Or rather they confuse me.

17:03 TimMc: ,(do (take-while identity (repeatedly 5 #(do (println "x") 1))) '_)

17:03 clojurebot: _

17:03 Frozenlock: *grammar time*

17:03 TimMc: &(do (dorun (take-while identity (repeatedly 5 #(do (println "x") 1)))) '_)

17:03 lazybot: ⇒ x x x x x _

17:04 AtKaaZ: bbloom: hi, is this why I should use the *-fn version? https://www.refheap.com/paste/11487

17:04 bbloom: AtKaaZ: that first line is analogous to ##(-> `'foo)

17:04 lazybot: ⇒ (quote clojure.core/foo)

17:05 AtKaaZ: CompilerException java.lang.RuntimeException: No such var: user/quote, compiling:(NO_SOURCE_PATH:1)

17:05 bbloom: AtKaaZ: oooooooo

17:05 AtKaaZ: you may have discovered a bug: specials

17:06 AtKaaZ: let me look

17:08 AtKaaZ: https://github.com/brandonbloom/backtick/commit/f194cb1e429923a68d3e3a9cc4ec25f0f833b838

17:08 AtKaaZ: I redeployed 0.3.0-SNAPSHOT to clojars

17:08 AtKaaZ: thanks for kicking the tires!

17:08 AtKaaZ: cool

17:10 solussd: anyone know if there is an OAuth2 provider workflow for Friend? I've found Clauth, but it doesn't integrate with friend and I've found friend-oauth2, but it is just an oauth2 client, afaict.

17:21 deg: Is there a standard function like partial, that takes the additional args on the left, rather than the right?

17:25 `abp`: Can I load data readers I just wrote at the repl?

17:26 cmdrdats: deg: sounds like a strange case? you could just #(f % arg1 arg2)?

17:27 mjiig: does anyone know how you're meant to connect to a database with jdbc now since the docs say with-connection is depreciated?

17:27 Raynes: (defn weird-partial [f & args] (fn [& new-args] (apply f (concat new-args args))))

17:27 deg: ^

17:27 deg: cmdrdats: Yes, that's exactly what I'm doing now, but I was hoping for an idiomatic parallel to partial. No biggy.

17:27 Raynes: There is no standard function though.

17:28 deg: Raynes: Ok. Is it worth duplicating the multiple cases implemented by partial (for short arglists)? How much efficiency do they gain?

17:28 clojurebot: One idea I had was to parameterise Keyword with the key it looks up. :a is of (Keyword :a). But that has other issues.

17:29 Raynes: deg: Not really.

17:29 cmdrdats: deg: if it's for a call to a function in your own code, consider flipping it around in the signature?

17:30 weavejester: Does anyone know offhand how to find which resource a namespace comes from?

17:30 deg: cmdrdats: I thought of doing that, and still might, but it makes the code slightly less readable in other contexts. Mostly, I was asking out of curiosity. "weird-partial" seems as useful, in general, as partial.

17:30 weavejester: I have an odd bug where an out of date class is somehow creeping into the classpath

17:31 deg: (Or maybe it's just me. I'm also bothered that -> doesn't have syntax allowing the arg-threading in arbitrary positions.

17:31 hiredman: weavejester: have you cleared classes and/or target classes?

17:31 weavejester: hiredman: Yep

17:31 cmdrdats: deg: I used to write my functions a lot with the partial-able args at the beginning

17:31 cemerick: weavejester: e.g. (clojure.java.io/resource "clojure/set.clj")

17:31 weavejester: cemerick: Yeah, that claims the dependency is up to date

17:32 But I know it isn't

17:32 cmdrdats: deg: but recognized that there's huge value in putting them at the end, especially if you want to use the ->> macro mixed with list transformation functions like map, filter and reduce

17:32 amalloy: deg: arbitrary-position threading is just 'let

17:33 stuartsierra: deg: Clojure 1.5 has as-> which does allow the argument in arbitrary positions

17:33 deg: cmdrdats: Understood. I'm still fighting the language here, as a newbie.

17:34 stuartsierra: What is the syntax for as->? Sounds interesting. Is 1.5 stable enough already for average users?

17:34 hiredman: weavejester: how do you know?

17:34 stuartsierra: it's in the source, and yes

17:34 deg: stuartsierra: Cool. I will try switching up from 1.4 soon.

17:35 weavejester: hiredman: When I run the code in project A, it works, but in project B, it doesn't. The dependencies for the library in question are the same.

17:35 hiredman: weavejester: have you checked the working project for stale classes, etc

17:35 weavejester: io/resource says they're from the same jar

17:36 hiredman: I've lein cleaned before running lein repl

17:36 hiredman: weavejester: and `lein classpath` is the same for both?

17:37 jsabeaudry: I need to serve a lot of json and cheshire.core/generate-string is the bottleneck, any recommendations?

17:37 hiredman: is this on the same machine using the same ~/.m2?

17:37 weavejester: hiredman: The projects have differing dependencies; but the library in question has the same version on both, on the same machine, with the same user.

17:37 dakrone: jsabeaudry: are you using custom encoding?

17:37 hiredman: jsabeaudry: depending on what you are serving you may want to look at some kind of templating instead of a general purpose encoder

17:38 weavejester: ok, so the jar for the library in question in `lein classpath` is the same for both?

17:38 jsabeaudry: dakrone, nope

17:39 dakrone: jsabeaudry: how did you determine encoding is the bottleneck? what version of cheshire?

17:39 weavejester: hiredman: Yes

17:39 jsabeaudry: hiredman, ok some kind of "hardcoded" encoder that only works for my data?

17:39 dakrone: jsabeaudry: what does your data look like?

17:39 weavejester: hiredman: Let me try again, see if I can narrow the issue down with some test code

17:39 hiredman: weavejester: ok, so take the rest of the jars that differ and write a little for loop that searches them for the same resource

17:40 jsabeaudry: my data looks like {:a [0.00001 0.333 0.45555] :b 4 :c 5} x1000

17:40 hiredman: (format "{:a [%s %s %s] :b %s :c %s}" ...)

17:41 well, but with json

17:41 jsabeaudry: dakrone, cheshire 5.0.1 and perhaps I am wrong, it just that when i call the http handler doing the encoding the processor goes up to 100% for a few seconds

17:41 dakrone, could be jetty really bad at serving a string

17:42 dakrone: jsabeaudry: you may need to do profiling to determine where the bottleneck is

17:42 jsabeaudry: dakrone, yes, indeed

17:44 dakrone, is there a limit to the size of the json string? can I serve 100KB strings?

17:45 Getting late, I'll profile that tomorrow

17:46 thanks for the suggestions hiredman and dakrone :) also thanks for cheshire, great little lib :)

17:46 dakrone: jsabeaudry: you should be able to servec strings that size without a problem

17:49 amalloy: could be any number of things. perhaps your data points are generated slowly but lazily, and only realized when cheshire tries to encode them

17:51 `abp`: Do I need to start a new repl everytime I change data_readers.clj?

17:52 ravster: hello all

17:53 brehaut: `abp`: (require :reload 'foo.data-readers)

17:53 `abp`: or :reload-all to reload it, and its dependancies.

17:53 `abp`: there are gotchas with multimethods and protocols

17:54 hiredman: brehaut: he is talking about data_readers.clj

17:54 the magic file for literals

17:54 brehaut: oh right. my bad

17:55 `abp`: I just wondered. ;)

17:55 hiredman: `abp`: data_readers.clj is used to populate *data-readers*, which you can binding via binding or alter the root value of

17:55 weavejester: Is there a way of interrogating a namespace to figure out which classloader it came from?

17:55 cemerick: magic http://3.bp.blogspot.com/-fuukRVObpiI/T_W_LVsivkI/AAAAAAAABB8/YcXkIn4QeDE/s320/magic.gif

17:56 amalloy: weavejester: probably not for a namespace, but you can ask the functions in it

17:56 weavejester: amalloy: That'll do. Do you know offhand how to do that?

17:56 amalloy: ,(.getClassLoader (class inc))

17:56 clojurebot: #<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")>

17:57 weavejester: amalloy: Oh right, because functions are classes. Duh me.

17:57 amalloy: weavejester: functions are objects, man

17:57 weavejester: amalloy: Or objects, rather

17:58 Ohh, interesting

17:59 In the library that works, the classloader is: #<DynamicClassLoader clojure.lang.DynamicClassLoader@816c920>

17:59 In the library that does not, the classloader is: #<AppClassLoader sun.misc.Launcher$AppClassLoader@7361b0bc>

18:00 hiredman: that is aot vs. not

18:00 when code is compiled you get a dynamicclassloader

18:00 so maybe one of your other deps is shipping with an aot compiled version of the lib or something

18:02 `abp`: so, *data-readers* has my readers, but an exception that the reader function for the tag was not found.

18:03 hiredman: `abp: what did you put in *data-readers* ? and how are you reading? and have you loaded the code that implements your data reader before trying to read?

18:03 weavejester: hiredman: Yeah, I figured. And… with .getResource I've found it. I need to remember that it's __init.class instead of .clj

18:04 ravster: whats the best way to make a system both basic-auth and cookie-auth? remvee's basic-auth lib doesn't look like it would allow a request to continue without basic-auth , and I'd like something that supports both.

18:05 `abp: hiredman: I didn't put anything. Clojure loaded them. But requiring the implementing namespace and then trying to use a read form fails.

18:05 a tagged form

18:05 weavejester: Oh, that's strange. It's been compiled by a library that shouldn't have any AOT.

18:05 hiredman: `abp: pastebin your data_readers.clj

18:06 weavejester: none should, really

18:06 `abp: https://gist.github.com/abp/2f7b952d9d9ebf290d5b

18:07 weavejester: hiredman: Yeah. This is a library in a private repo, but it doesn't have any :aot directives, no :main and no :gen-class. I just grepped the source. Yet in .m2 the jar has compiled classes in. Weird!

18:07 arrdem: random musing from the last few days: will the JVM's JIT take {:foo bar :baz bung} and inline it to a struct given sufficient use?

18:07 hiredman: weavejester: if you have stale stuff in classes/ lein may just throw them in to the jar :/

18:07 clojurebot: inner classes are a Java fiction; for the Double "inner class" in Point2D, write Point2D$Double (not Point2D.Double).

18:08 hiredman: `abp: and do you have an example use of the literal?

18:08 weavejester: hiredman: Yeah, that was my next thought, too. My git repo for the lib is at 0.1.2, and the compiled version is 0.1.4 so maybe someone updated it...

18:08 `abp: #route/get :a

18:08 #route/get [1 2 3]

18:08 oh.. wait

18:10 weavejester: "lein jar" doesn't compile any classes so… maybe someone screwed up the packaging somehow.

18:10 `abp: hiredman: Nope, doesn't work

18:11 hiredman: `abp: would those readers return nil?

18:11 `abp: they were returning nil, just printing, now they are returning their argument

18:12 hiredman: even (('routes/post *data-readers*) :a) works

18:13 as well as routes/get in there

18:13 hiredman: `abp: what repl are you using?

18:14 `abp: nrepl via nrepl.el 0.1.6

18:14 hiredman: what happens if you send (read-string "#routes/get :a") ?

18:15 `abp: hiredman: works..?

18:16 hiredman: so somewhere in nrepl something is trying to read the code you send it, but it doesn't have the data readers installed

18:16 `abp: eww oh my god



18:16 hiredman: complain loudly in the github issues for nrepl.el and the jira for nrepl

18:17 `abp: but it's not working with lein repl either

18:17 so more like nrepl?

18:17 hiredman: ^- that was a pretty sweet diagnosis

18:17 weavejester: Yeah, someone, somehow managed to get a bunch of classes in a jar deployed to a private repo. Maybe they compiled it and that left a bunch of classes in the target directory that were picked up by the "lein deploy" command.

18:17 amalloy: afaik that's a known problem with nrepl

18:17 hiredman: `abp: I am not sure how `lein repl` works these days, it is actually pretty complex now

18:17 `abp: amalloy: Uh, that would be tough

18:18 hiredman: amalloy: really, my reader literals seem to work fine?

18:18 well, unless whatever it is doesn't have a corresponding print-method

18:18 amalloy: hiredman: perhaps they fixed it for the common case? i know it used to be a problem

18:18 hiredman: but the reading happens fine in that case

18:18 `abp: I'm on Clojure-1.5.0-RC16 btw

18:20 Oh snap, I'm not.

18:22 Ok still doesn't work.

18:28 hiredman: heh, clojures neat error handling strikes again. last fragment of implementing ns and tag must match up..

18:29 hiredman: that's a connection I didn't know of

18:29 hiredman: huh

18:29 me neither

18:29 `abp: RuntimeException No reader function for tag route/post clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1164)

18:30 that's all it has to say on that..

18:30 hiredman: `abp: are you sure about that? I don't see that in the code anywhere?

18:36 `abp: hiredman: I can't spot anything causing this behaviour either..

18:38 pppaul: anyone here use drip?

18:42 Raynes: pppaul: Well, I use it and work with the guys who wrote it.

18:43 pppaul: how hard is it to get drip working with lein/ring/whatever-clojure?

18:43 Raynes: Not hard at all.

18:43 pppaul: great

18:43 i'm going to install it right now

18:43 Raynes: If you just install drip lein will use it automatically.

18:43 weavejester: I tried drip, but I didn't see any difference between drip-enhanced Lein and normal Lein

18:44 Raynes: weavejester: Did you actually time it?

18:44 Actually, lein won't automatically use it.

18:44 weavejester: Raynes: No, but I was expecting a subjective difference

18:44 Raynes: pppaul: After you install drip, add "export LEIN_JAVA_CMD=drip" to your ~/.profile or ~/.bashrc or whatever.

18:44 And then lein will use it and you'll be good to go.

18:46 weavejester: Raynes: I used someone's plugin a while ago. Perhaps it didn't work. I'll try again with the official instructions.

18:46 Raynes: weavejester: https://www.refheap.com/paste/11490

18:46 weavejester: This is the raw performance gains over using 'java' directly with a Clojure project.

18:47 pppaul: hmmmm

18:47 Raynes: weavejester: However, lein is going to be slow no matter what you do, especially when it uses subprocesses (which means you get the JVM startup anyways, even though drip has cut out the original startup time).

18:47 weavejester: Raynes: Ohhh… maybe that's why it didn't seem to make a difference to Leiningen.

18:48 pppaul: Raynes how will i know if lein is using it?

18:48 Raynes: weavejester: drip is much more useful for actual end-user things. For example, IIRC jruby either ships with it or plans to at some point.

18:48 pppaul: do 'drip kill' and then run `lein version` and then do `drip ps`

18:48 If there are JVMs then leiningen is using drip,.

18:49 pppaul: thank you

18:50 http://librelist.com/browser//leiningen/2012/9/10/ann-drip-a-fast-jvm-launcher/

18:50 Raynes: weavejester: Another thing is that if you try to run two commands in quick succession, one of them will have the startup time since it hasn't given the second drip JVM enough time to spin up. There is some thing you can set that makes drip keep n JVMs running so that you can run several commands back to back without hitting the startup time.

18:50 Not sure how well tested that feature is though.

18:50 muraiki1: Hi all, I'm new to clojure and clojurescript and have run into a problem. I've successfully used org.clojure/math.combinatorics in my clojure project, but now that I'm switched it to cljs I get the following error in the web console when running it: goog.require could not find: clojure.math.combinatorics

18:51 ivan: if there were an easy way to have cleanly isolated Clojure runtimes in the same JVM, you wouldn't need drip, right?

18:51 weavejester: Raynes: I can actually kinda see a difference now

18:52 ivan: muraiki1: the repo suggests there is no cljs version

18:52 pppaul: drip ps -> command not found Raynes

18:52 Raynes: weavejester: https://www.refheap.com/paste/11491

18:52 muraiki1: ivan: heh, now I feel dumb... thanks!

18:52 hiredman: weavejester: now not only do you have to worry about stale classes, but stale jvms

18:53 weavejester: hiredman: Haha

18:53 Raynes: pppaul: Try `which drip`

18:53 hiredman: I kid you not

18:53 Raynes: Sounds like drip isn't on your PATH.

18:53 How did you install it?

18:53 ivan: some CLJS users might know if https://github.com/clojure/math.combinatorics/blob/master/src/main/clojure/clojure/math/combinatorics.clj is all valid CLJS, it might be

18:54 hiredman: I have heard people swear off drip, having been burned by that very thing

18:54 weavejester: hiredman: I believe you. I think I'll try it until it bites me, though.

18:55 Raynes: Eh.

18:55 pppaul: Raynes which drip shows that drip is on my path. drip is running… i don't see lein using it

18:55 Raynes: drip is wildly less volatile than persistent JVMs.

18:56 pppaul: i followed the instructions from the website http://librelist.com/browser//leiningen/2012/9/10/ann-drip-a-fast-jvm-launcher/

18:56 Raynes: And if you think it's causing a problem 'drip kill' will fix it. I've yet to have any sort of issues with it caused by stale jvms.

18:56 muraiki1: ivan: actually it looks like the one function I need works fine in cljs, so I'll just include it in my project for now

18:57 ivan: and my project is also EPL so no worries about license, hehe

18:59 Raynes: pppaul: What version of lein do you have?

18:59 pppaul: 2

18:59 but i'm using fish as my shell

19:00 so the wiki on flatland is giving me trouble

19:00 Raynes: Yeah, I can't help you at all with fish. :p

19:00 pppaul: trying with zsh now

19:00 Raynes: Only thing I know about fish is the name. ;)

19:05 pppaul: what is the jps command in drip?

19:08 oh man, there is a note on the drip wiki that says it doesn't work with lein preview 10....

19:09 weavejester: pppaul: Haven't you upgraded?

19:09 pppaul: hmm

19:09 Raynes: That's kind of why I asked you which version you were using. :p

19:09 pppaul: preview 10 isn't the latest version?

19:10 Raynes: No, there is a final release.

19:10 Upgrade, boy.

19:10 The future is here.

19:10 pppaul: i feel like an old man

19:11 pbostrom: Raynes: I've noticed that clojail will "lose" defs after I've sent it a few things to evaluate

19:11 Raynes: pbostrom: Did you notice this from using clojail itself or from tryclj?

19:11 This was reported on tryclj, but I didn't realize it was a clojail problem specifically.

19:11 pbostrom: I'm using it on my own app, which is similar to tryclj

19:12 Frozenlock: pbostrom: you can change the limit on the number of defs that clojail will accept.

19:12 Raynes: Yeah, but the limit seems to not matter anymore.

19:12 Frozenlock: o_O

19:12 Raynes: The limit is higher than 2 on tryclj yet it drops defs after 2 defs.

19:12 It has magically broken somewhere along the line.

19:12 pbostrom: it seems to lose it if I just reference the def a few times

19:13 Raynes: Yeah, that's what I meant. It's evil.

19:13 pbostrom: Could you open an issue? I'll take a look asap.

19:13 You could probably fix it faster, but I'd be concerned about suicide.

19:14 pbostrom: Raynes: I may look into a bit more, but I don't really now where to begin, I will open an issue though, thanks

19:14 Frozenlock: Is there some kind of forms-helpers for compojure/hiccup?

19:14 Raynes: https://github.com/weavejester/hiccup/blob/master/src/hiccup/form.clj

19:15 Frozenlock: Well yes, but helper for that.

19:15 Input validation, automatic conversion, etc etc

19:16 Raynes: pbostrom: https://github.com/flatland/clojail/blob/master/src/clojail/core.clj#L149 and search for 'def' https://github.com/flatland/clojail/blob/master/src/clojail/core.clj#L221 might help.

19:16 But I don't expect you to fix it.

19:16 Just warning you it might be a little while.

19:17 pbostrom: Raynes: I might be able to look into it, I'll just harass you on irc if I get stuck

19:17 Raynes: Sure thing.

19:17 Frozenlock: Hmm what would be really sweet is a validator maker. Here's an example map <map>, make sure the returned value fit it in, with the correct data-type.

19:18 Must.. not... start ... something ... new...

19:19 weavejester: Frozenlock: There are a few projects under "validation" at http://www.clojure-toolbox.com/

19:20 Frozenlock: weavejester: thanks, looking now!

19:21 weavejester: btw, just tried codox, works like a charm :)

19:22 weavejester: Frozenlock: Excellent :)

19:35 DaReaper5: How would i get the difference between two dates in clojure?

19:36 Do i have to have an ugly loop or use joda?

19:37 Frozenlock: DaReaper5: clj-time

19:39 DaReaper5: (- (years date1)(years date2) ?

19:41 ivaraasen: should buy some more CS books. anyone got recommendations?

19:41 DaReaper5: or: (- (in-years date1)(in-years date2)) ?

19:42 Frozenlock: (in-minutes (duration (date-time 1986 10 2) (date-time 1986 10 14)))

19:45 ravster: I want to write an authorization function for a handler for a particular route. how do I make sure that the authorization function gets the request object. I'm looking at compojure's source, but I'm not understanding it.

19:45 weavejester: ravster: It sounds like you're describing middleware

19:47 ravster: weavejester: the middleware I wrote puts stuff into the :session map. I need an authorization function that will look in the :session map of a request, see if a particular entry matches, and then chooses to pass the request on to the actual handler for the route.

19:47 different routes would have different authorizations, so I can't put it all in a wrapper, right?

19:48 weavejester: ravster: You can assign different middleware to different routes

19:48 ravster: A route is just a Ring handler

19:49 ravster: Compojure is essentially a library for connecting together Ring handlers into bigger handlers.

19:50 Raynes: With weird modified destructuring syntax.

19:50 ;)

19:50 ravster: huh. looking through ring wiki now.

19:51 weavejester: Raynes: For parameters - you can destructure the request normally.

19:51 Raynes: I know.

19:51 It just always makes me squint.

20:00 ravster: so instead of a (GET "/foo" [] handler) I'd do a (wrap-superusers-only (GET "/foo" [] handler)) ?

20:18 yedi_: is :remote-addr the ip address of a user

20:18 (in a compojure request map)

20:19 aperiodic: yes

20:21 ravster: Is there any way I can make the authorization function as part of the compojure handler so I can take advantage of its destructuring? Something like (Get "/foo/:id" [] (authorize id handler)) ?

20:24 aperiodic: you need to put the id param in the arguments vector after the route string and uppercase 'Get', but yeah, that looks good

20:24 keep in mind id will be a string, if you're expecting an integer you'll need to coerce it

20:26 although wait, if authorize is your authorization fn why not just call it there; what's the handler arg doing?

20:27 ravster: handler is the function thats doing whatever the route is supposed to do. (authorize) would be a function that checks the :session to see if we are a user that is allowed to do the stuff.

20:28 so in authorize I'd have something that looks at :session, sees the :id from the params of the request, and does a check to see whether we execute (handler) or not.

20:29 yedi_: how can i view the entire stacktrace while using nrepl in emacs? i'm running lein repl from the terminal and connecting to it via emacs, now when i run commands in the terminal only the error msg shows up

20:29 ravster: I've only ever made handlers that take in the request function and thats it. I'd like to find out how to define a function that will take in the request map and another function.

20:29 yedi_: *nrepl error* doesn't seem to display the stack trace for these errors

20:30 ravster: s/request function/request object

20:32 oh, yikes. I should be able to just do it with an anonymous function.

20:33 aperiodic: ravster: (defn if-authorized [session do-authorized] (if (authorized-pred? session) (do-authorized) {:status 403 :body "VERBOTEN"}))

20:33 ravster: then you pass a fn thunk as do-authorized like #(foo-handler id) or the like

20:36 ravster: so it'll look like (GET "/foo/:id" [] (if-authorized (:session request) #(foo-handler id))) -ish ?

20:58 AtKaaZ: ,#_({:a 2 :a 1})

20:58 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: :a>

20:58 AtKaaZ: is that normal because it happens at compiletime? the {} part as opposed to (hash-map :a 2 :a 1)

20:58 yedi_: can someone help me out with this: https://gist.github.com/yedi/4992075

20:59 what is clojure.lang.IDeref

21:01 brehaut: yedi_: its the interface used to implement reference types, eg (deref (atom 1)) ;=> 1. @a is reader syntax for (deref a). something (whatever the unbound var is) in that is being derefed, and failing. perhaps you havent set up the session storage?

21:03 yedi_: brehaut: ahh you're right. i got passed that error when i lein ring server, i guess testing in the repl wasn't the best idea

21:21 holo: hi

21:21 ,(reduce #(-> %2) '(1 2 3))

21:21 clojurebot: 3

21:22 holo: if %2 stands for the second argument, where is the second argument? i can't sort this out

21:24 jeremyheiler: holo, because 3 is the second argument on the final reduction.

21:24 ,(reduce #(-> %2) '(1 2))

21:24 clojurebot: 2

21:24 jeremyheiler: ,(reduce #(-> %2) '(1 2 3 4))

21:24 clojurebot: 4

21:27 yedi_: my one petpeeve with clojure is that i have to wrap a do around a form if i want to print something, esp with paredit-mode making it kind of a nuisance to type parens (still gettin the hang of it)

21:28 ldh: is there a naming convention for where to put leiningen hooks that I'm missing? it seems that wherever i put the file containing the activate function, i get "cannot resolve my.hook/activate hook"

21:33 jeremyheiler: yedi_, well, only when there isn't an implicit do ;-)

21:33 dnolen: heh, ClojureScript data structures could be constructed a lot, lot faster

21:34 yedi_: jeremyheiler: oh my... are there implicit dos in many places?

21:35 jeremyheiler: yedi_, they're generally where you expect them, like when, loop, and of course fn.

21:35 holo: jeremyheiler, wow thanks.. this solution is pure awesomeness

21:36 ChongLi: yedi_: paredit mode a nuissance?

21:36 no way!

21:36 just use M-(

21:36 yedi_: ChongLi: can't tell if sarcasm

21:36 ChongLi: not sarcasm :)'

21:36 I love paredit

21:37 bbloom: dnolen: what did you find?

21:37 (RE: faster construction of data structures)

21:37 ChongLi: yedi_: do you use all the paredit navigation keys?

21:37 yedi_: ChongLi: oh wow, i've been using C-space, C-M-f, parens

21:37 ChongLi: almost definitely not

21:37 ChongLi: C-M-u is a great one

21:38 yedi_: jeremyheiler: thanks for pointing that out!

21:38 ChongLi: what does that do

21:38 ChongLi: goes up a level

21:39 C-M-d goes down a level

21:39 dnolen: bbloom: ArrayMap can take an array if we have a literal, no work needs to be done

21:39 ChongLi: with those two and C-M-f you can get around quite quickly

21:39 dnolen: bbloom: same for sets

21:39 bbloom: if they use ArrayMaps underneath

21:40 ChongLi: the other ones you usually want are slurp, barf and splice

21:40 bbloom: dnolen: ah, of course :-)

21:40 dnolen: bbloom: currently fromArray(s) code is wasting time building when we don't need to

21:40 bbloom: I was looking at the horrific numbers for constructing sets

21:40 and realized we can make it 10X faster

21:41 bbloom: dnolen: cool. although as long as perf doesn't get *worse* i'm more interested in work moving towards self hosting. although i know you do looove to tweak performance, and having fun certainly counts for something :-)

21:42 dnolen: well these are pretty simple optimizations with fairly big payoffs for users so ...

21:43 bbloom: so go for em!

21:45 callenbot: Raynes: I'm saying you should use SCSS

21:45 Raynes: SASS specifically is for communists. SCSS is amazing.

21:46 * bbloom discovers that he is a communist

21:46 mefisto: I'm trying to remember... isn't there a function that reverses the argument order of a function?

21:46 bbloom: mefisto: (defn reverse-args [f] (fn [& args] (apply f (reverse args))))

21:46 there you go

21:47 ravster: how do I make ring-basic-authentication optional for a route?

21:48 mefisto: hmmm

21:53 amalloy: i've never really gotten the hang of paredit's down and up commands. all the fancy forward, backward, and editing make me content enough that i haven't really tried

21:53 i wonder if you can point out, ChongLi, a case where i'm doing something in a dumb way because the "obviously right" way is with up or down movement

21:55 ChongLi: amalloy: I use the up movement whenever I need to get out of the current level

21:55 perhaps to wrap it with another expression

21:58 alandipert: dnolen: thanks for your cljs optimization work!

22:00 dnolen: alandipert: no problem - I find it quite entertaining

22:02 holo: my solution to problem #21 in 4clojure: http://ctrlv.in/162822 i wonder why no one thought about that 4 character answer :D

22:03 dnolen: writing #{1 2 3} in your CLJS is now 20X faster

22:04 * alandipert fist pumps

22:05 alandipert: holo: crafty!

22:06 bbloom: dnolen: nice!

22:09 dnolen: more and more I'm liking the idea of ^not-native

22:10 alandipert: fn meta i presume? what would it do?

22:11 bbloom: alandipert: https://github.com/clojure/clojurescript/commit/bf4c85c1f17c3f2a26ba57fef896350a7651d8cf

22:12 dnolen: if not-native helps, i'm all for it. but wouldn't any non js/ prefixed type hint constitute a not-native type hint?

22:12 dnolen: ie would it be better to use explicit type names in hints? assuming we had full hinting working

22:13 Frozenlock: Another proof that dnolen do not sleep. Ever.

22:14 dnolen: alandipert: eliminates protocol dispatch

22:14 bbloom: no, because you can pass in native types to core functions

22:15 bbloom: non-native means you're writing some high perf stuff and you want to write in Clojure and you don't want to deal w/ the fact that natives are on a slow protocol path

22:16 bbloom: dnolen: oh, i see, hinting ISeq or PersistantArrayMap or whatever isn't good. you want to hint "any type other than native ones"

22:16 dnolen: I take no credit - Rich suggested it at TechMesh - I was getting annoyed that we could avoid protocol overhead

22:16 bbloom: exactly!

22:16 bbloom: dnolen: still, PersistentArrayMap implies not-native, but ISeq & other protocols don't

22:17 in the case where a concrete type is known, it seems preferable to hint with that, rather than not-native

22:17 dnolen: bbloom: yes, no promise that protocol or concrete type hinting will persist - we'll see. So far I'm seeing more mileage out of non-native in actual code.

22:18 ^ "couldn't avoid protocol overhead" I mean

22:24 hoho

22:25 (let [v [1 2 3]] (set v))

22:25 260ms on CLJ JVM

22:25 282ms on CLJS V8

22:25 bbloom: heh, nice

22:25 how many iterations?

22:25 dnolen: 1e6

22:26 bbloom: dnolen: back to the predicate dispatch topic for a moment

22:26 dnolen: b/c i've been reading etc

22:27 dnolen: (hash-set 1 2 3) in CLJS V8 is faster than hash-set in CLJ JVM

22:27 bbloom: dnolen: eh, i dunno how to formulate the question i'm trying to ask you, so that must mean i don't understand it enough yet to ask :-P

22:27 dnolen: what's the timings on hash-set ?

22:27 and is there an array-set too?

22:28 dnolen: ~190ms on my machine V8, ~240ms for JVM

22:28 clojurebot: fax machine is http://tinyurl.com/ygc9w2

22:28 bbloom: where the fuck does clojurebot get this nonsense from?

22:28 Raynes: callenbot: The problem is that it just accumulated over time. I wouldn't know where to begin. 40% of that file probably doesn't even need to exist anymore. Are there any tools for finding out which things don't matter anymore in a css file?

22:28 dnolen: which means we have decent construction times for all Clojure data structures in ClojureScript - finally!

22:29 bbloom: Raynes: there are, but it's a really hard problem if you've got any javascript involved with creating elements

22:29 Raynes: do you need static analysis (looking at HTML files only) or full dynamic analysis? (looking at which css classes are activated at runtime)

22:29 dnolen: good stuff

22:29 callenbot: Raynes: there are ways to know, they're generally heuristic in nature if you're not using an aggressively declarative asset pipeline

22:29 Raynes: and as bbloom said, if you're using JS, all bets are off.

22:29 Raynes: bbloom: What's the answer for both of those? :p

22:30 callenbot: Raynes: start here: http://meeech.amihod.com/very-useful-find-unused-css-rules-with-google

22:30 bbloom: Raynes: depends, do you create elements or add classes with javascript?

22:30 callenbot: bbloom: stop being pedantic and start feeding him tools to experiment with.

22:30 Raynes: bbloom: Maybe like two or three.

22:30 Now don't be mean. I've got all night, guys. :P

22:30 bbloom: The answer is "not really".

22:31 bbloom: callenbot: i'm not being pedantic, i'm not gonna point him towards a tool if it's gonna be useless to him

22:31 callenbot: I should be happy by all rights. I'm listening to a history podcast, drinking milk, and eating reese's pieces.

22:31 Raynes: The ones it does create are important and I know this, so static analysis should be very helpful.

22:31 bbloom: Raynes: ok, given the "not really" answer, than a static analysis tool works for you. callen's link to the google chrome audit tool is likely a good start

22:31 Raynes: Oh, I didn't even see that in all the noise.

22:31 :p

22:31 callenbot: Raynes: https://addons.mozilla.org/en-US/firefox/addon/css-usage/ https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/

22:31 Raynes: http://meeech.amihod.com/very-useful-find-unused-css-rules-with-google

22:32 Raynes: Oh my, I might have to break out the firefox.

22:32 bbloom: Raynes: and then that's the dynamic analysis tool that callenbot mentions right there too

22:32 Raynes: Thanks guys. :D

22:32 bbloom: but i'd avoid that if you know for sure which selectors you use dynamically

22:32 ChongLi: dnolen: wow congrats on the CLJS optimizations

22:33 bbloom: Raynes: you can create a dummy `display: hidden` div or whatever with all your dynamic classes on it. that would protect a static analysis tool from reporting them as unused

22:33 Raynes: Neat.

22:34 bbloom: Raynes: but first you need to cull your unused html, heh

22:35 Raynes: bbloom: I have unused HTML? 2_2

22:35 bbloom: Raynes: i don't know. i don't even know what project you're discussing

22:35 just saying

22:36 Raynes: Refheap, of course.

22:36 I'm pretty sure I don't have any unused html.

22:36 dnolen: pretty low level stuff - but for the curious http://github.com/clojure/clojurescript/commit/bd8c9af0fd85d99695c45f40f7e20da740395c23

22:37 bbloom: that's good :-) try doing a full site redesign with 100+ templates. you find unused code a couple lines at a time for months afterwards, heh

22:38 dnolen: one fun trick I've been using is that variadic functions generate code like this

22:38 (cljs.core.foo cljs.core_array_seq([1,2,3]))

22:38 so in the foo you can check to see if you got an IndexedSeq and just grab the array out of that.

22:39 list / set perf enhancements use this

22:39 ChongLi: nice

22:39 dnolen: similar tricks are employed in CLJ JVM

22:40 alandipert: cool, i will leverage in priority-map

22:42 pbostrom: Raynes: init-defs old-defs new-defs defs...you are trying to kill me aren't you

22:42 Raynes: I warned you about suicide.

22:44 bbloom: dnolen: despite my nit-picking comments. all these changes LGTM!

22:47 dnolen: bbloom: hehe, nit-picking always appreciated

22:47 bbloom: dnolen: good, b/c it's my specialty

22:53 dnolen: i assume you've written CSS files, but have you ever written an XSLT file?

22:53 (just curious about your background knowledge, so that i can save some typing on an upcoming question)

22:56 dnolen: bbloom: yes I both liked it and hated it

22:56 bbloom: dnolen: liked idea, hated XML, i assume? heh

22:57 dnolen: bbloom: more or less, but it was a long time ago - so maybe I would like XSLT more now?

22:58 bbloom: I'm about to run, if you've got a question shoot!

22:58 bbloom: dnolen: less of a question and more of a thought for you to ponder:

22:59 dnolen: if you think about both XPath expressions and CSS Selectors as predicates, you can think about XSLT template matching and CSS styling as predicate dispatch. the itneresting bit is that CSS matches happen PER RULE, not per selector. so you actually need to do stuff on interior nodes of the decision tree

23:00 dnolen: ie you might have two rules: .foo {color: red} and .foo.bar {background:blue} and then to efficiently style, you need to wallk the decision tree looking for .foo and apply color:red, then keep walking to test for .bar

23:00 dnolen: which is generalized beyond predicate dispatch

23:01 dnolen: just an interesting thought that occurred to me: there are other ways to compile the predicate matrix other than input->method. you could have input->matches where the matches can be a pre or post fix walk

23:01 dnolen: that's all

23:03 heh, and CSS's "important!" is basically prefer-method :-P

23:03 dnolen: yes it's interesting - again this reminds me of tree automata and tree pattern matching, which someone brought up when we first release core.match

23:04 can't say I know much about either - nor how hard it would be to make core.match do something along those lines

23:04 I'm skeptical that core.match's machinery can be hijacked for this purpose

23:04 bbloom: dnolen: ok, i'll google up those keywords

23:04 dnolen: but I could be wrong

23:04 bbloom: dnolen: yeah, i'm not sure. i think i might take a crack at a library that ONLY handles the construction of predicate expressions

23:04 dnolen: we should talk to Chris Frisz & Will Byrd and the other IU folk

23:04 at Clojure/West

23:04 bbloom: absolutely!

23:04 dnolen: they use an interesting cata-matcher in the compiler

23:05 so in the pattern you can have a recursive match

23:05 that gets traversed first

23:05 but perhaps this is ideal for compilers

23:05 but then that makes it more relevant to you.

23:05 bbloom: dnolen: hmm... didn't even think about recursion, heh

23:05 in the patterns, i mean

23:06 dnolen: cata for catamorphism

23:06 http://en.wikipedia.org/wiki/Catamorphism

23:06 bbloom: ok, well i'll dig in to this some more. this is all relatively need ground for me. i hope to add some cool stuff to fipp with all this

23:06 which, in turn, will help my other project ;-)

23:07 dnolen: bbiab

23:07 bbloom: cya

23:09 yedi_: is there an equivalent to python's `in` in clojure?

23:09 i know contains? isn't it cuz that deals with keys/indices

23:12 nvm, found the `some` trick

23:19 brehaut: yedi_: or consider a set rather than a seq/list/vector

23:32 ldh: leiningen profile question: if I declare :profiles {:dev {:dependencies [[some.dependency "0.0.1"]]}}, is it expected that heroku still fetches some.dependency from clojars when I deploy? I'm running using "lein trampoline with-profile production run", shouldn't that override dev dependencies?

23:38 Raynes: dev dependencies shouldn't happen at all because heroku sets LEIN_NO_DEV.

23:38 Not sure if they still get fetched or not.

23:38 I wouldn't expect it.

23:39 ldh: that's what i would think, too.

23:40 technomancy: LEIN_NO_DEV was a hack for 1.x

23:40 but... I think there's a bug where trampoline triggers the dependencies before stripping dev stuff out

23:40 ldh: try swapping the order for now as a workaround

23:40 `lein with-profile production trampoline run`

23:42 ldh: ok. i just did "heroku run bash" and then compared "lein classpath" with "lein with-profile production classpath" and that seemed correct. i'll try swapping the order as well

23:45 i didn't see the log message that it was fetched this time, but maybe it only does that the first time a new dependency is introduced? *shrug*

23:51 Icarot: For a web programmer, does anyone know if using Clojure is actually somewhat mature?

23:51 Compared to, maybe, say Backbone.js or <insert hip framework here>

23:57 xeqi: .. I consider those used for different purposes, or were you asking about clojurescript?

23:59 pbostrom: Raynes: I made a little bit of progress (I think); this line seems to def a new tester sym every time some code is evaluated, which fills up the def quota: https://github.com/flatland/clojail/blob/master/src/clojail/core.clj#L165

Logging service provided by n01se.net