#clojure log - Feb 14 2013

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

0:03 Raynes: Rich_Morin: Either way, they're still pulling the plug soon.

0:03 Youtube is the canonical location for Clojure videos now.

0:03 Rich_Morin: cool; tnx

0:05 antares_: Raynes: did you ever figure out how to read and update project.clj programmatically? e.g. to do releases?

0:09 cemerick: there's ~3 plugins for that

0:09 I can't vouch for any, but...

0:10 antares_: cemerick: I need to do something other than releases, so I'm afraid those plugins won't help in my case

0:20 callenbot: Raynes: first time deploying clojure with monger to Heroku - getting an NPE on DB connect!, you wouldn't happen to know what's up, would you?

0:21 Raynes: callenbot: antares_ wrote in monger to refheap, so I wouldn't know. :(

0:21 antares_: callenbot: posting stack trace may help

0:21 Raynes: antares_: I noticed you still inc the version every once in a while too. You're pretty cool!

0:22 callenbot: antares_: https://www.refheap.com/paste/11274

0:22 antares_: Raynes: ocassionally even to incorrect versions ;)

0:22 Raynes: Haha

0:22 callenbot: (mg/connect-via-uri! (config :dburi))

0:23 antares_: callenbot: maybe config has no :dburi?

0:23 callenbot: antares_: it most certainly does.

0:23 antares_: the question is why does it care at compile time?

0:23 antares_: callenbot: but why does it happen during code compilation? are you connecting in top-level code?

0:23 Raynes: That's strange.

0:24 callenbot: antares_: yes @ top-level.

0:24 antares_: I'm a bad monkey. I know.

0:24 antares_: callenbot: that's wrong

0:24 * callenbot sulks

0:24 * callenbot goes to read refheap code s'more.

0:24 antares_: do it in -main or initializer functions

0:24 at compile time I suspect config is empty, although I don't know much about heroku

0:25 cemerick: anyone clojurescripting?

0:26 callenbot: antares_: I put it in my lein-ring :init, thanks.

0:26 tommo: having a hard time with clojure, care to help me out :p? http://pastebin.com/FtkRjfbU

0:26 it throws an arityexception wrong number of args to me

0:27 it's probably very wrong and impossibly un-idiomatic ^.^

0:28 oops, forgot i had the % in the arguments

0:29 antares_: tommo: yeah, I was going to ask what % is about

0:29 callenbot: note that Monger docs demonstrate connection in -main, at least I tried to make them do so

0:30 exactly because connecting at compile time makes no sense and will fail if you use Heroku URIs and such

0:30 callenbot: antares_: they still have the compile-time thing in the docs...

0:30 antares_: I should've known better anyway. Thanks.

0:30 antares_: callenbot: where?

0:30 dnolen: cemerick: you running into more trouble?

0:30 callenbot: dnolen: carthago delenda est.

0:30 cemerick: dnolen: my middle name of late, it seems

0:33 tommo: antares_: any ideas what's wrong with it? it just returns with nilnil - http://pastebin.com/TtE0bM6u

0:33 cemerick: dnolen: I'm just wondering about current wisdom re: writing macros and coping with the resolving of symbols to Clojure (and not ClojureScript) namespaces by `

0:33 Just ~' everywhere?

0:34 antares_: tommo: c is always greater than i in the first iteration

0:34 tommo: if will return nil if it only has 1 branch and it does not "match". Everything is an expression.

0:35 dnolen: cemerick: hmm yeah, I think that can only be avoided if the namespace of the macro file matches the source file?

0:36 tommo: antares_: oh i thought (< 5 8) meant 5 < 8, doesnt it?

0:36 ,(< 5 8)

0:36 clojurebot: true

0:36 tommo: oh nvm, now i understand, xD

0:37 cemerick: dnolen: right; and there's some special-casing of clojure.core/* symbols in the analyzer, so e.g. (clojure.core/+ 1 1) will evaluate successfully

0:38 IMO, it'd almost be better if that special-casing didn't exist, just to have some consistency

0:39 dnolen: cemerick: no longer following

0:39 cemerick: as in I don't understand what you're saying

0:40 cemerick: dnolen: evaluating (clojure.core/+ 1 1) in a cljs repl works, presumably as a concession to many (most?) symbols coming out of macros being resolved to clojure.core

0:40 tommo: antares_: well now i switched the i and c around, but i still cant figure out why its not working :s

0:41 dnolen: cemerick: I still don't understand your point - (clojure.core/+ 1 1) ... ok .. but in relation to what?

0:41 tommo: how do i know where recur actually "recurs" to?

0:42 antares_: tommo: in loop to the beginning of the loop. In function bodies, to the top of the function

0:42 tommo: antares_: thanks

0:46 cemerick: dnolen: in relation to the quoting that is (sometimes) required in cljs macros. e.g. `(+ x# y#) will work, but `(other-fn x# y#) won't. Anyway, nm, was just wondering if there were better options.

0:47 dnolen: cemerick: I think you may be confused (though I may be wrong about that)

0:49 cemerick: the issue is that macro symbol resolution happens in Clojure, nothing to do w/ the analyzer far as I know

0:52 cemerick: dnolen: yeah, I know Clojure is doing the symbol resolution; I was just noting the special-casing of clojure.core-namespaced symbols in the analyzer https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L162

0:52 tommo: if conj appends an item to the front of a list, what appends to the end?

0:53 cemerick: ...presumably to avoid the need for ~' for some portion of cljs macros

0:53 llasram: tommo: ##(map #(conj % :bar) '(:foo) [:foo])

0:53 lazybot: clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox8276$eval23657$fn

0:54 llasram: tommo: Ok, let's try again ##(map #(conj % :bar) ['(:foo) [:foo]])

0:54 lazybot: ⇒ ((:bar :foo) [:foo :bar])

0:55 tommo: i dont quite understand :p

0:56 llasram: tommo: There isn't a function which appends onto the end of a list. Instead, you have a different data structure (vectors) which `conj` places onto then end

0:57 tommo: llasram: ahh ok, well i just solved it by reversing once finished

0:57 dnolen: cemerick: hmm, I can't say I understand exactly what that is for. not sure what macros would emit clojure.core/foo and not clj.core/foo

0:58 cljs.core/foo I mean

0:58 llasram: tommo: And that's a common solution in other Lisps, but generally in Clojure you solve that by using list vs vector to build your result in the order you want to start with

1:00 tommo: llasram: i see, the reason i was using a list weas because the problem (4clojure) specifically used lists

1:00 ,(= '(1 2 3) [1 2 3])

1:00 llasram: Ah, fair enough

1:00 cemerick: dnolen: `(+ x# y#) will emit (clojure.core/foo x_sym y_sym); only `(cljs.core/+ x# y#) will emit cljs.core/+

1:00 clojurebot: true

1:00 tommo: oh that works, cool

1:01 cemerick: (unless *ns* is 'cljs.core, I suppose)

1:01 tommo: llasram: care to check if my code is horrendous :p? http://pastebin.com/VV2RJskc

1:02 llasram: tommo: I've seen worse :-p

1:03 dnolen: cemerick: right because in the macro file + will refer to clojure.core/+

1:03 cemerick: if you did not exclude it and make it refer to something else

1:03 tommo: llasram: thats very reassuring :D, well it's literally some of the first lines of code i've written so hopefully i'll improve :p

1:04 cemerick: dnolen: Of course. All I was saying is that it's interesting (odd?) that the analyzer swaps the effective namespace of any symbols qualified to clojure.core.

1:05 llasram: tommo: Cool! Welcome to Clojure, then :-)

1:05 dnolen: cemerick: s/odd/expedient

1:05 cemerick: :-)

1:06 llasram: tommo: specific code-wise though -- isn't `i` always going to be less than `c` right off the bat? Well, assuming positive `c` arguments

1:06 Oh, right

1:06 Glorm

1:06 It's getting a bit late EST

1:07 Less specific (even though it's getting a bit late), -- in general, loop/recur is a tool you need pretty rarely. Unless the 4clojure problem calls for them, you can probably solve this more compactly using seq operations

1:08 dnolen: cemerick: I don't really see a better solution then naming the macro file the same as the source file. at least then your symbols to default to the same ns.

1:08 cemerick: clojure.core/foo just seems like a simple hack to avoid a lot of tediousness

1:09 clojure.core/foo -> cljs.core/foo I mean

1:11 cemerick: dnolen: The other options might be either not adjusting namespaces at all (which might make understanding the difference in behaviour easier), or — less trivially — offering an unhygenic ~ that doesn't resolve symbols at all

1:13 dnolen: cemerick: neither sound like improvements to me

1:15 michaelr525: good morning

1:16 cemerick: Fair enough.

1:20 llasram: Hmm, bug? ##(class (read-string (pr-str (/ 0.0 0.0))))

1:20 lazybot: ⇒ clojure.lang.Symbol

1:20 callenbot: Raynes: it's time.

1:20 Raynes: http://www.youtube.com/watch?v=8OB28fTKSds

1:22 cemerick: llasram: ##(/ 0.0 0.0)

1:22 lazybot: ⇒ NaN

1:22 llasram: cemerick: Right. I found the ticket. http://dev.clojure.org/jira/browse/CLJ-1074

1:23 Raynes: callenbot: This is reasonable music.

1:23 callenbot: I've got one for you!

1:24 callenbot: http://www.youtube.com/watch?v=AypvuzhVlrc

1:25 I suddenly realized I love this woman today. Weirdest music.

1:27 andyfingerhut: Ahhhh. 1.5.0 looks like it is pretty close now. Good.

1:27 callenbot: Raynes: Lana Del Rey makes me want to go gay.

1:28 Raynes: callenbot: I take that as "I hate this woman so much I'd prefer to…"

1:28 How much have you heard from her? This song is pretty peculiar.

1:28 You might like others.

1:29 callenbot: Raynes: this song is very unlike her breakout album.

1:32 michaelr525: nice song actually..

1:32 i'm not sure I want to hear more songs like these in the close future but it's nice..

1:34 Raynes: michaelr525: None of her songs are anything like this, to be fair.

1:34 At least, none of the others seem similar to me.

1:34 I just enjoy the vocal variety in this song.

1:35 michaelr525: it's something in her voice.. it's nice but after a couple of minutes you don't want to hear it anymore ;)

1:35 Raynes: I didn't have quite that experience. :p

1:36 callenbot: If you do decide to go gay, LA would be perfect for you.

1:36 michaelr525: when i'm satisfied i just roll over and ignore her.. ;)

1:36 Raynes: Hahaha

1:39 callenbot: Raynes: too bad I hate California. If I switched teams it'd be more BBM than LA fab.

1:39 Raynes: I'm gtfo'ing this state ASAP

2:14 aeosynth: i've never programmed seriously in a lisp language; should i learn clojure first, or can i dive in with the clojurescript tutorial?

2:17 danebez: anyone familiar with installing auto-compile in emacs? emacs newbie here

2:20 callenbot: Raynes: http://www.youtube.com/watch?v=u3ltZmI5LQw

2:22 michaelr525: aeosynth: i think you can start with clojurescript as well.. although it will probably be harder and more confusing

2:45 magopian: i know what :foo is, and i know what '(1 2 3) is, but what about 'foo ? (working through the clojure koans)

2:49 andyfingerhut: It is a shorthand for (quote foo), where foo is a symbol

2:50 magopian: mmm, a symbol?

2:53 andyfingerhut: yes. It is a kind of data that was introduced in Lisp long ago, and Clojure has it, too. It isn't a string, or a number, or a keyword (like :foo). It isn't a collection like '(1 2 3) or [1 2 3]. It is an indivisible thing.

2:54 It is equal to itself, but not equal to any other symbol with another name.

2:55 magopian: andyfingerhut: strange, so it's like a keyword, but it's not a keyword

2:56 andyfingerhut: magopian: It has many similarities to a keyword. I'm at a loss for the moment to give a great explanation for all the ways it is and isn't like a keyword, unfortunately :)

2:58 Ah, one important difference: keywords always evaluate to themselves, whereas symbols can be used as names of vars that can hold values, or via let can be bound to values.

2:59 e.g. you can do (let [foo 5] (+ foo foo) to get 10, but you can't put :foo in place of the three foo's there and have it work, because you can't bind values to a keyword.

3:00 magopian: mmm, so a symbol is "a bit" like an unassigned variable, some kind of value holder

3:00 maybe i'll understand better if i see them used in some code, thanks a lot andyfingerhut for the explanation !

3:01 andyfingerhut: symbols in Clojure can be used as names for things, but they can also be used as part of a collection, e.g. '(a b c) is a list of three symbols, a, b, and c.

3:01 Yes, if you are going through the koans I'm sure you will get a better idea of things as you work through them.

3:06 magopian: andyfingerhut: is '(a b c) valid even if you didn't "let" a, b and c previously?

3:07 andyfingerhut: Yes. At least in that case, because of the ' in front, the (a b c) does not get evaluated, so none of a, b, nor c need have been given a value before that.

3:08 and they don't ever need to be assigned values in order for that to work.

3:09 magopian: andyfingerhut: but if you try to use (first '(a b c)) then it'll fail

3:11 andyfingerhut: If you've got Clojure installed and can start a REPL, experimenting can sometimes help understanding (but can also be confusing at first). (first '(a b c)) when evaluated will return the value that is the symbol a. Not a's value, just the symbol a

3:11 magopian: i do have a REPL, yes, sorry for not just trying it straight away ;)

3:12 it's still "early" in the morning, i need my brain cell to wake up :)

3:12 (i've been awake for a few hours now, but today seems like a slow day for my brain ;)

3:12 andyfingerhut: No problem. I said it can be confusing at first, because while the REPL will give you some kind of answer, there is no "why did it just do that?" button :)

3:13 AimHere: Well other than 'emacs clojure/src/clojure/core.clj' or whatever ;)

3:19 lpetit: Hello

3:19 andyfingerhut: Bonjour

3:20 lpetit: I'm having right now some crazy ideas for Counterclockwise, so I'd like some feedback from users or challengers, either to encourage me or to refrain me … let's see :)

3:21 magopian: lpetit: ccw ? the eclipse plugin?

3:22 lpetit: If there must be *ONE* thing all JVM languages, libraries, frameworks, project tools, etc. agree upon, it's that project dependencies must be hosted in maven repositories, right ?

3:22 magopian: right. I'm the developer of CCW.

3:22 magopian: ok ;)

3:23 i'm not (anymore) a user of eclipse, so i won't be able to help, sorry ;)

3:24 lpetit: And yet, CCW, being an Eclipse plugin, follows Eclipse conventions of managing plugins, and their dependencies, in "P2" repositories (P2 are repositories of OSGi bundles. OSGi bundles are "enhanced" maven artifacts, with ways to declare extension points, imported packages from other bundles, exported packages to other bundles, etc.)

3:25 But it's a shame, because it forces CCW to be less friendly with maven. Right now you have either to choose between OSGi or maven.

3:25 Or so it seemd

3:26 It seems there are ways to use as few of OSGi as possible to please Eclipse, and then be able to fall back to maven land. Because there are some ways, in Eclipse, to "hook" into the class loader machinery and (i hope), add dynamically (when launched) additional entries to the plugin classpath.

3:26 .

3:27 See what I mean ?

3:28 CCW could declare no dependency "the OSGi way", and all its dependency "the maven/leiningen way". Then at runtime, the regular Eclipse platform will wire my plugin with no other OSGi bundle, but then my contributed Eclipse "platform hook" would enhance the class loader with dependencies found in ~/.m2/repository !

3:28 andyfingerhut: It is possible that the intersection of people on the channel, paying attention, and understanding the nuances of your statements is empty :-(

3:29 lpetit: andyfingerhut: Rubber duckies never answer questions :-)

3:30 andyfingerhut: it's a private joke between grand and me, I'm generally his "rubber ducky" when he tries to articulate new ideas I barely understand :-)

3:30 andyfingerhut: lpetit: Thanks for explaining. I tried Googling that phrase and it wasn't very helpful :)

3:32 lpetit: andyfingerhut: you have references to it, as far as I remember, in "The mythical man month" from Frederick P. Brooks. Something like: a professor told his students to first explain their problems to the rubber ducky next to the entrance in his office. More than often, having forced them to articulate their problem made them find out an answer by themselves, saving him time :-)"

3:33 andyfingerhut: lpetit: My lack of having read that book is once again reminded to me. I should fix that some day.

3:34 lpetit: andyfingerhut: and it's a quick and easy read, but quite enjoyable. Old material giving almost universal lessons.

3:35 andyfingerhut: lpetit: I read "Soul of a New Machine" a couple of years ago, and although the events are mid to late 1970s, the motivations and personalities of typical computer engineers haven't changed much since then.

3:35 lpetit: andyfingerhut: interesting

4:06 pimeys: ok, three days in a row without touching vim, only emacs

4:07 now my evil mode starts to feel complete

4:09 magopian: pimeys: so, how does it feel, switching to emacs? (i used to only use emacs, a long long time ago, but it never "clicked" the way it did with vim)

4:13 pimeys: magopian: well, I have to emulate the whole vim command mode

4:13 to be able to do my work

4:13 so evil-mode is great

4:13 but the whole emacs ecosystem seems to be much better

4:13 magopian: wow, ok, maybe that's a bit over the top ;)

4:13 pimeys: only thing where vim shines is the editor

4:13 vimscripts suck

4:14 elisp doesn't suck

4:14 magopian: pimeys: i've been told that emacs is a pretty good operating system, it just lacks a decent editor :P

4:14 pimeys: well, with evil-mode it has a decent editor :)

4:14 magopian: have you tried slimv ?

4:14 pimeys: not yet

4:15 but some repl I did try

4:15 wasn't worth it

4:20 Foxboron: I am not sure who wrote "slurp" and "spit", but i am sure they are the most awsome function names ever.

4:20 noidi: :)

4:30 rcg: Foxboron, imho http://clojuredocs.org/clojure_contrib/clojure.contrib.java-utils/wall-hack-method is the greatest function name :D

4:31 and its companion http://clojuredocs.org/clojure_contrib/clojure.contrib.java-utils/wall-hack-field

4:33 Foxboron: rcg: hahahaha, i have actually not seen those before

4:34 clgv: rcg: but remember that the old contrib is deprecated

4:34 rcg: Foxboron, :)

4:35 clgv, well that was just a quick google for that name ;)

4:38 clgv: rcg: yeah, just wanted to mention it. some new people still think they should use old contrib since it is mentioned in the older books ;)

4:41 rcg: clgv, roger that :)

4:47 lpetit: clgv: hello

4:47 clgv: lpetit: hello

4:49 lpetit: clgv: I CCW started to install parts of it from maven repositories instead of only software update sites, would that make a difference for you ?

4:49 s/I/If

4:49 clgv: lpetit: as end-user?

4:49 lpetit: yes, would that make you uneasy, for instance ?

4:50 clgv: lpetit: depends on how it works. do you want to implement silent updates?

4:50 lpetit: This would mean some of CCW dependencies would be picked from e.g. ~/.m2/repository

4:51 When installing a new version of CCW, first the update site which would download a rather thin jar (ccw proper), then pick up remaining dependencies (clojure, leiningen 2, parsley, nrepl, etc.) from ~/.m2/repository (re-downloading them when required, when the plugin starts)

4:52 clgv: humm the global repository could be dangerous, I guess. couldnt it use maven in a "CCW-local" repository?

4:53 lpetit: clgv: yeah, maybe, using a local repository private to CCW, located in the private repo eclipse allows for plugin stuff

4:54 clgv: lpetit: your purpose is to not have to build eclipse artifacts everytime but to just release them to maven/clojars and have CCW pull in the latest stable automatically?

4:54 lpetit: clgv: it would be indeed unfortunate if ccw breaks down (or takes forever to restart) each time the user resets its private local repo

4:54 I have several purposes in mind, some short term, some long term

4:55 clgv: first, simplifying ccw internals. And simplifying the addition of dependencies to ccw

4:56 currently, this means "ossifying" (or Eclipse-plugification if you want) of dependencies, and their transitive dependencies, etc. A mess. A real barrier to innovation.

4:56 clgv: lpetit: I think if you have "CCW-local" repo that should be safe for the start

4:56 lpetit: clgv: ok, so I'll investigate this way this way

4:57 clgv: leptit: did you already include the repl settings in beta channel?

4:57 *repl history settings I meant

4:57 lpetit: clgv: I can also create a maven repository proxy hosted on the same server as ccw update site, so that I don't depend on the rest of the internet

4:58 clgv: no, I've been stuck by "analysis paralysis" these last few weeks, and only recovering now that I'm finally figuring out a way out of the current status quo

4:58 clgv: lpetit: oh right, this is another concern to have a reliable source for the deps

4:58 the proxy I meant ^^

5:01 lpetit: clgv: and I also have future ideas about how to contribute to CCW via lightweight contributions. E.G. just lightweight clojure scripts or leiningen projects. So if CCW itself already uses leiningen to manage its dependencies, the path will be easy

5:02 clgv: lpetit: ah great. exposing leiningen tasks in eclipse/CCW would be a nice and probably not that complicated addition as well

5:03 lpetit: clgv: yes, and using leiningen for ccw itself will help find the motivation to develop this :-)

5:03 clgv: so right now, ccw has its internals totally open in front of me, and I'm rearranging things so that it will hopefully work again someday :)

5:04 clgv: lpetit: that means you toe your local CCW codebase apart totally? :P

5:04 *tore

5:05 lpetit: clgv: no, don't be afraid :-). but i'm removing totally the ccw.clojure, ccw.clojure-contrib, clojure.osgi away. And also the need to have nrepl and contrib. incubator bundles in the development target platform.

5:05 clgv: and I also want to get rid of ccw.parsley as well.

5:06 All these will become regular maven dependencies now.

5:06 clgv: ah thats great. I hated the nrepl dependency that one needs to put in the runtime dep folder manually^^

5:06 lpetit: me too :-)

5:07 clgv: on my new work computer Clojure development with Eclipse is lighting fast now :)

5:07 lpetit: clgv: and I'm still not sure about bundles internal to ccw : ccw.debug, ccw.leiningen, ccw.util. 2 possibilities : I merge their content into ccw.core. Or I keep them around as ccw.core plugin fragments

5:07 clgv: cool :-)

5:08 clgv: lpetit: what is preventing you from having them as lein/maven dependencies as well?

5:08 lpetit: clgv: I also want a more stable CCW. There has been reports, recently, of people having weird exceptions like "-?> not found", etc.

5:09 clgv: well, they are part of ccw, and tied to it (meaningless without ccw)

5:09 tho not ccw.util, maybe

5:09 clgv: lpetit: one thought about version updates. it's probably a good idea to be able to choose which CCW version one wants to have - just in case there are bugs that break in ones production environment

5:10 lpetit: clgv: ?

5:10 ccw.core will remain managed via eclipse software update site

5:11 clgv: ok. and ccw.core with a version say 0.X.Y will have hard-wired dependency versions?

5:11 lpetit: yep

5:11 we don't loose configuration management with this move

5:11 clgv: ah good. so updating will involve updating the eclipse plugin from the software update site

5:13 lpetit: yes. cgrand wants to go a step further, by having just a "shell" installed from the software update site, which would then download ccw clojure sources e.g. from github (and updating would just mean switching to another commit). I think we may eventually do this,but I'm not ready yet.

5:13 But still, this would not mean loosing configuration management. Each commit would list the right versions of dependencies to use.

5:15 clgv: right, thats more effort on the UI part of selecting the versions then ;)

5:16 lpetit: clgv: right, and since nobody has written a SWT / JFace wrapper yet :-)

5:17 clgv: lpetit: that's exactly what is missing to write CCW in pure clojure ;)

5:17 lpetit: clgv: then I need to go full-time on the subject and launch a kickstarter :-)

5:18 clgv: lpetit: we need a sponsorship for the seesaw guy to have him work on SWT/JFace ;)

5:18 lpetit: yeah -)

5:18 clgv: lpetit: or that. but I dont know if that would succeed since light-table already succeeded. the question "why another kichstarter financed clojure IDE? doesnt lighttable suffice?"

5:18 will arise

5:19 lpetit: indeed, light-table people were there first, nice of them

5:19 so far for use :-(

5:19 s/use/us/

5:20 clgv: people do to much webdev with clojure. otherwise someone should have started an SWT wrapper already.^^

5:20 lpetit: clgv: so, for ccw stability, I want to get rid of the "clever" clojure.osgi plugin. And have, "at runtime", everything into a single bundle class loader, so everything into a single class loader: clojure, its dependencies, the remaining java code of ccw, etc.

5:21 clgv: *too

6:00 piranha: I wonder what am I doing wrong with ClojureScript, if executing "cljs.core.type_satisfies_(cljs.core.ISeqable, new cljs.core.PersistentVector())" in browser console returns false?

7:03 yedi: is anyone here using aws beanstalk for any clojure deployments? if so how's it going?

7:03 it says beanstalk supports java, so i'm assuming that means it supports clojure by extension

7:05 babilen: Hi all -- I am facing an issue with reducers and am not entirely sure how to solve it. I have a reducer which is the result of multiple applications of various r/map, r/filter, ... calls. At the end of all these transformations I want have to call a single function solely for its side-effects for every element in the reducer. How can I do that? Will it be done in parallel? What if the entire collection does not fit in memory?

7:05 s/want have/have to/

7:41 llasram: babilen: Just do something like (r/reduce #(do (your-side-effecting-call %2) nil) coll)

7:42 `r/reduce` won't be parallelized, even if the underlying collection supports it -- that's only possible with the `r/fold` semantics

7:43 And nothing from the generated stream of values is held in memory -- your reducer stack collapses to a single composed function

7:43 babilen: llasram: Exactly, but IIRC r/fold explicitly states that I cannot fold with non-pure functions.

7:44 llasram: Right. So yes, you cannot do that :-)

7:47 babilen: llasram: Ok, so it is essentially not possible to get parallel performance if I cannot hold the entirety of data in a vector - That means that I have to either be able to partition a reducer into smaller pieces or simply use smaller data sets from the start.

7:48 llasram: To make it a bit less abstract: I am essentially working on data I read from N files, do something with that data and then write it somewhere. I would love to have the precessing done parallel, but I fail to get the end (non-pure) step right in a parallel fasjion

7:53 llasram: babilen: Well, it's impossible to do it using reducers. The semantics surrounding reducers are all about, well, reduction.

7:53 If you're going for side effects, you can always stick with seq. Or split your initial sequence and `pmap` a chain of reducers finishing with `r/reduce` on each one

7:56 babilen: yeah, thanks for the heads up. The latter sounds as if it is exactly what I want.

7:57 dch: noob question, I've added some dependent snapshot jars for a project into ./libs and expecting lein to pick them up. Is this supposed to work?

7:57 llasram: dch: It is not

7:57 dch: lein is still only checking on clojars for the site.

7:57 llasram: ~jars

7:57 Awww

7:58 clojurebot: clojars migration is done simply with a bunch of sql defns in a single namespace: https://github.com/ato/clojars-web/blob/master/src/clojars/db/migrate.clj

7:58 llasram: Hmm, not quite clojurebot!

7:59 clgv: dch: not anymore

7:59 dch: llasram: not working for me still unfortunately.

7:59 clgv: dch: you have to add them as dependencies in your project.clj

7:59 that means you have to at least install them in your local maven repository

8:00 dch: its not my project (githubc cloned). oh was hoping to avoid maven repo, not ventured this far before.

8:00 llasram: Free-floating JAR files make your project build unreproducable. There is a hack to use them, but it may not be the best

8:01 Is this a "normal" dependency which just isn't in a repo, or is it something odd-ball?

8:01 dch: its a build off master to see if the fix for my issue fixes my issue.

8:01 so it has a ..-SNAPSHOT.jar at the moment

8:02 llasram: Ah, so a normal dep, and you just need to get it to pick up the new version? Then yeah -- like clgv said, installing in your local maven repo and bumping your dep version is the way to go

8:02 dch: ok I might be better off leaving this for the moment, and setting up a local maven repo when i have time to figure that out. Thanks for the guidance!

8:02 llasram: Oh, you already have one!

8:03 If the dep project was built with lein, junt run `lein install`

8:03 s,junt,just,

8:03 clgv: dch: if it is a leiningen project you checked out, just do `lein install`

8:06 AdamC: has anybody here played with pomegranate and separate classloaders?

8:07 I have a core program which I want to pull in optional modules at runtime, and I'd like to have the pulled in modules in separate classloaders to avoid dependency conflicts

8:07 possible?

8:09 dch: llasram: oh right, I see `lein install` stashes stuff in /~.m2/repository/ I think that is what I needed! After doing that in the dependencies all is well again - thanks.

8:10 llasram: dch: np. Sorry for all the obfuscation, and glad you did run off before finding there was an obvious solution :-)

8:10 Er, didn't

8:11 dch: llasram: actually the lein / clojure docs are pretty awesome. just annoying that the books I've got don't quite match up to the current state. par for the course.

8:12 llasram: lein has always had great documentation, and I think having good doco is starting to be an important part of Clojure engineering culture. But it does move fast, so alas for the poor dead trees...

8:13 dch: etrees in this case, but the publishers drag so

9:35 solussd: is there a function in core that takes n functions and applies them to n items in a seq? e.g. (apply-funcs [myfunc1 myfunc2] [data1 data2]) => [(myfunc1 data1) (myfunc2 data2)] ?

9:36 could be handy for mapping across a seq of seqs

9:37 magopian: that looks like something very easy to do with map

9:39 solussd: but it's always a special case, e.g. (map (fn [[x y]] [(myfunc1 x) (myfunc2 y)]) [[data1 data2] [data3 data4]])

9:40 magopian: [x &y]

9:40 solussd: i'd want to replace that anonymous function w/ (partial func-im-looking-for [myfunc1 myfunc2])

9:40 ?

9:41 magopian: you can write functions which take an arbitrary number or elements

9:41 solussd: i'm looking for the "opposite" of juxt. :)

9:41 that's not my problem.

9:41 magopian: i think i don't understand your issue properly then ;)

9:42 solussd: e.g. juxt takes several functions and returns a seq of the results of applying those functions to one value

9:42 i want to take n functions and apply them to n values and return n results

9:42 magopian: applying those functions to _one_ value ?

9:42 ah, ok, n values, that's what i understood

9:43 alexnixon: ,(map #(%1 %2) [inc dec] [10 20])

9:43 clojurebot: (11 19)

9:43 Bronsa: ,(map deliver [inc dec] [1 2])

9:43 clojurebot: (2 1)

9:43 alexnixon: Bronsa: nifty

9:43 magopian: ,(doc deliver)

9:43 clojurebot: "([promise val]); Alpha - subject to change. Delivers the supplied value to the promise, releasing any pending derefs. A subsequent call to deliver on a promise will throw an exception."

9:43 solussd: Bronsa: that's what I want!

9:43 magopian: ahhh nice

9:43 Bronsa: it relies on the curet implementation of deliver though.

9:44 solussd: though… using deliver is .. interesting. :)

9:44 borkdude: huh

9:44 Bronsa: current*

9:44 magopian: ,(map deliver [inc dec] [1 2 3 4])

9:44 clojurebot: (2 1)

9:44 Bronsa: well, that's how map works

9:44 magopian: sure

9:44 just testing ;)

9:45 borkdude: ,(map trampoline [inc dec inc] [10 20 30])

9:45 clojurebot: (11 19 31)

9:46 borkdude: :P

9:46 Bronsa: there is a actually a function that takes a collection and returns an infinite lazy seq of the concat of that coll with itself

9:46 but I don't remember how it's called.

9:46 solussd: cycle

9:46 Bronsa: that.

9:47 ,(map deliver (cycle [inc dec]) [1 2 3 4 5])

9:47 clojurebot: (2 1 4 3 6)

9:47 borkdude: or:

9:47 ,(map trampoline (cycle [inc dec]) [1 2 3 4 5])

9:47 clojurebot: (2 1 4 3 6)

9:48 borkdude: far from idiomatic though ;)

9:49 ,(map (fn [f & args] (apply f args)) (cycle [inc dec]) [1 2 3 4 5]) ;; is better imho

9:49 clojurebot: (2 1 4 3 6)

9:50 solussd: ,(apply hash-map (mapv trampoline (cycle [keyword identity]) '(mykey "myval" mykey2 "anotherval" mykey3 6)))

9:50 clojurebot: {:mykey2 "anotherval", :mykey3 6, :mykey "myval"}

9:52 canweriotnow: ,(reduce + '(1 2 3 4))

9:52 clojurebot: 10

9:52 canweriotnow: zomg the channel is a repl.

9:52 solussd: :D

9:53 Bronsa: borkdude: definitely.

9:53 canweriotnow: (def my-mind "blown")

9:54 solussd: i feel like there should be a more generically named function with the implementation of 'deliver'

9:54 borkdude: canweriotnow yes, it's not a session aware repl though, it's all on off

9:54 one

9:54 clgv: canweriotnow: clojurebot is "a repl" ;)

9:54 Bronsa: solussd: funcall :)

9:54 clgv: ,*ns*

9:54 clojurebot: #<Namespace sandbox>

9:54 borkdude: yeah funcall

9:54 solussd: we dont have funcall, do we?!?

9:54 clgv: &*ns*

9:54 lazybot: ⇒ #<Namespace sandbox15649>

9:54 Bronsa: no

9:54 canweriotnow: borkdude - yeah, I assumed that. Still. ZOMG.

9:54 clgv: &*ns*

9:54 lazybot: ⇒ #<Namespace sandbox15649>

9:54 clgv: there is my session^^

9:55 borkdude: solussd nope, but apparently trampoline and deliver both behave as funcall

9:55 &*ns*

9:56 lazybot: ⇒ #<Namespace sandbox15649>

9:56 clgv: ah damn^^

9:56 solussd: cool, thanks all

9:56 clgv: but clojail can be used to implement repl sessions^^

9:56 alexnixon: borkdude: trampoline doesn't quite

9:56 borkdude: ,(trampoline inc 1)

9:56 clojurebot: 2

9:56 canweriotnow: Now we just need a twitter-bot that eval's tweets :D

9:56 borkdude: ,(deliver inc 1)

9:56 clojurebot: 2

9:57 alexnixon: ,(deliver (fn [_] (constantly 7 )) 2)

9:57 clojurebot: #<core$constantly$fn__2351 clojure.core$constantly$fn__2351@31aba72e>

9:57 alexnixon: ,(trampoline (fn [_] (constantly 7 )) 2)

9:57 clojurebot: 7

9:57 borkdude: alexnixon I see

9:58 canweriotnow: ,(iterate inc 5)

9:58 clojurebot: (5 6 7 8 9 ...)

9:58 borkdude: alexnixon another reason not to abuse those

9:58 solussd: yeah, i wont be using deliver for this- it'll confuse anyone reading it. :)

9:58 canweriotnow: ,(take 100 (iterate (partial * 2) 1))

9:58 clojurebot: (1 2 4 8 16 ...)

10:11 alexnixon: solussd: also see https://github.com/flatland/useful/blob/develop/src/flatland/useful/fn.clj#L94-L100

10:11 solussd: alexnixon: that is _exactly_ what I was looking for, thanks

10:53 TimMc: ,*1

10:54 clojurebot: #<Unbound Unbound: #'clojure.core/*1>

10:54 gfredericks: ,(binding [*1 "HAR"] (str *1 "!"))

10:54 clojurebot: "HAR!"

10:54 gfredericks: ,(meta #'*1)

10:54 clojurebot: {:ns #<Namespace clojure.core>, :name *1, :dynamic true, :added "1.0", :doc "bound in a repl thread to the most recent value printed", ...}

10:54 borkdude: any org-mode knowers here? how do I produce a verbatim string literal, like ~"foo"~

10:55 gfredericks: borkdude: why doesn't that work?

10:55 jweiss: if i have two sets of functions that do the same thing but in different ways (in my case, communicate with an app i'm testing either via its UI or API), is there some way to switch between implementations? all i can think of is just use java interface and methods.

10:55 borkdude: gfredericks I have no clue, but it doesn't

10:55 gfredericks: borkdude: this is for HTML export?

10:55 borkdude: gfredericks yes and latex

10:56 gfredericks: borkdude: I do the html export all the time and that syntax works fine for me; also you can use = instead of ~

10:56 it wraps with <code> tags

10:56 TimMc: jweiss: As in, dynamically switch?

10:56 borkdude: gfredericks I get this ~"de data zijn gelijk"~ in the HTML

10:57 gfredericks: borkdude: what org-mode version?

10:57 jweiss: TimMc: yes, but also it would be nice if i'd get a compile error if one or the other impl diverged from the interface

10:57 borkdude: gfredericks 7.9.3d

10:57 jweiss: or from each other

10:58 gfredericks: borkdude: mine is 6.33x

10:58 borkdude: not sure what else to say; you're not in a funny context like a code block are you?

11:00 TimMc: jweiss: Ah, you want static typing! :-P

11:01 borkdude: gfredericks lemme paste on refheap - o wait, I've got refheap.el installed… now I can use it :)

11:01 jweiss: TimMc: well, doesn't reify throw an error if you dont, for example implement the interface correctly?

11:01 TimMc: Sure.

11:01 borkdude: gfredericks https://www.refheap.com/paste/11287 (at the bottom)

11:02 jweiss: TimMc: i'm just saying that's the kind of checking i'd like, vs just 2 collections of functions where nothing checks the fn signatures against anything.

11:02 TimMc: jweiss: But you could just as well write a test that checks if both namespaces contain the required defns. :-)

11:02 gfredericks: borkdude: do your = expressions export correctly?

11:02 borkdude: gfredericks yes

11:03 TimMc: It feels slightly silly, but I don't actually see anything wrong with it.

11:03 gfredericks: borkdude: what about switching your ~ expressions to =?

11:03 borkdude: gfredericks same error

11:03 gfredericks: borkdude: what about switching your = to ~? :)

11:03 vijaykiran: borkdude: "Geef de String =de data zijn gelijk= terug" works for me

11:03 TimMc: Try ALL the ASCII!

11:03 vijaykiran: borkdude: org-version - 7.9.3.e

11:04 gfredericks: man my org so old

11:04 borkdude: vijaykiran I want a string literal, so surrounded with "

11:04 gfredericks: I wish I knew how to do computers

11:04 borkdude: gfredericks I updated org-mode from marmalade (or something, I just type package-list-packages)

11:05 * gfredericks knows what marmalade is hell if

11:05 * gfredericks is the worst emacs user ever

11:05 borkdude: also ~ blocks not seem to work when you start with =

11:05 vijaykiran: or el-get-update org-mode

11:05 borkdude: so ~=~ is a function in clojure

11:06 ah wait, that works

11:06 vijaykiran I haven't got that one

11:07 I will do without the surrounding " for now

11:07 "~de data zijn gelijk~" works though

11:07 * gfredericks imagines what "de data zijn gelijk" means

11:08 borkdude: gfredericks the dates are equal

11:08 gfredericks: "the data is gaelic"?

11:09 borkdude: updating my practicum exercises (created by students last year): first step, convert from latex to org-mode and then change the exercises themselves

11:10 vijaykiran: borkdude: http://orgmode.org/manual/shebang.html#shebang seems to have what you want to have - may be you can try checking the source of that :)

11:11 borkdude: vijaykiran hmm yeh

11:12 vijaykiran hm, next challenge: find the source for this

11:12 vijaykiran http://stackoverflow.com/questions/4209611/is-the-org-mode-manual-available-in-org-file <- argh

11:13 vijaykiran: ah - crap

11:14 borkdude: vijaykiran of course, some websites about clojure are also written in ruby right

11:18 vijaykiran: borkdude: http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg01417.html

11:19 borkdude: vijaykiran tnx!

11:24 I did customize variable on that one and now it works - but where did it save this change when I pressed "save for future sessions"?

11:24 gfredericks: your .emacs file?

11:25 borkdude: gfredericks I have no .emacs file, only init.el and nothing changed in there

11:25 gfredericks: that's my only guess then; I only know that org-mode has a habit of editing my .emacs

11:32 borkdude: gfredericks added it manually anyway

11:42 dnolen: `fogus: 85 people signed up for Confo, crazy!

11:42 gfredericks: (inc confo)

11:42 lazybot: ⇒ 1

11:42 dnolen: `fogus: I would have been excited about 30!

11:43 borkdude: dnolen maybe core.logic was used for marketing and yielded the entire possible search space for people interested in it

11:46 dnolen I didn't mean that in a positive way

11:46 dnolen I did. typo.

11:47 gfredericks: ~rimshoto

11:47 clojurebot: Badum, *tish*o

11:47 dnolen: borkdude: heh :)

11:51 borkdude: is it possible to have multiple headings in org-mode but to start only numbering at the second one?

11:57 `fogus: dnolen: It's wild! I'm hoping for 100 ;-)

11:59 dnolen: I think Friedman was expecting ~12

11:59 including speakers.

12:08 dnolen: `fogus: hehe

12:13 SurlyFrog: Is there a standard way to `pr` a date as an EDN #inst such that it can then be read back by `clojure.tools.reader.edn/read`? I don't see an appropriate formatter in clj-time.

12:14 gfredericks: SurlyFrog: I've just done a defmethod for print-method and print-dup

12:14 SurlyFrog: what do you mean by a date? java.util.Date already works that way doesn't it?

12:15 SurlyFrog: gfredericks: not that I can see. If I `(pr (time/now))` I get #<DateTime 2013-02-14T17:16:05.578Z>

12:15 where time is clj-time.core

12:16 gfredericks: ah that's probably a Joda thing then

12:16 I'll find you what we have

12:16 SurlyFrog: thanks so much. I really appreciate it. I'm not entirely sure what the whole Joda time thing is...

12:16 I imagine it's my basic Java naivety

12:17 gfredericks: SurlyFrog: https://www.refheap.com/paste/11290

12:17 Joda is just a java library for time

12:17 that clj-time uses

12:17 technomancy: Joda is the thing that saves you from the insanity of the built-in Java date/time handling classes

12:17 SurlyFrog: :-)

12:18 gfredericks: thanks again

12:21 gfredericks: SurlyFrog: no problem

12:21 SurlyFrog: if you figure out how to do it without the java.util.Date conversion let me know :)

12:21 SurlyFrog: :-

12:21 :-)

12:22 Where would `clojure.instant` be documented?

12:22 gfredericks: no idea :)

12:22 I hardly knew about it

12:22 in the source maybe?

12:23 ghadishayban: https://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj

12:23 the formatters namespace in clj-time has useful methods that you can leverage to print out #inst literals

12:24 SurlyFrog: ghadishayban: thanks. I still get confused as to whether I should be looking at docs from clojure.org, clojuredocs.org, ....

12:24 technomancy: clojure.org has some good essays on it, but it's not a good reference other than that

12:29 dabd: anyone knows why pattern matching is not in the clojure.core? https://github.com/clojure/core.match/wiki/Overview

12:30 gfredericks: dabd: not often necessary? the lib isn't fully baked yet?

12:30 easy enough to use as a lib

12:31 dabd: i don't mean this implementation but pattern matching in general, like Ocaml has

12:31 dnolen: dabd: definitely fully baked and pattern matching will probably never make it in.

12:31 dabd: rhickey doesn't like pattern matching

12:31 dabd: really? any reason?

12:31 dnolen: definitely *not* fully baked I meant

12:31 gfredericks: phew

12:31 * gfredericks feared he had just insulted dnolen

12:31 technomancy: dnolen: we got to give core.match a run at the last seajure; it was a lot of fun

12:32 dnolen: dabd: pattern matching is order complected and closed

12:32 technomancy: sweet

12:32 SurlyFrog: So is there any advantage to using a DateTime versus a java.util.Date object?

12:33 gfredericks: SurlyFrog: java.util.Date is mutable

12:33 SurlyFrog: technomancy: thanks for the tip on clojure.org vs. clojuredocs.org

12:33 oh

12:33 got it

12:33 dabd: dnolen: "order complected and closed" not sure I understand this but google brings me to rhickey's talk http://www.infoq.com/presentations/Simple-Made-Easy :-)

12:33 technomancy: error messages had everyone in the room confused at a few points, but we figured it out

12:33 I'd buy the whole "hard-baked ordering is bad" argument a lot more easily if I'd ever seen anyone actually use prefer-method.

12:33 SurlyFrog: java.util.Date is completely batshit

12:34 dabd: dnolen: maybe he criticized pattern matching in this talk?

12:34 dnolen: technomancy: heh, core.match uses prefer-method in several places

12:34 SurlyFrog: technomancy: okay then….I'll take your word for it and stear clear :-)

12:34 dnolen: dabd: he does talk about why he does like it

12:35 technomancy: dnolen: is there a prefer-method for protocols?

12:35 dnolen: it seems to me even the Scala luminaries now look down on overuse of pattern matching

12:35 technomancy: no, but I use multimethods in core.match, I may even switch to them completely in the future, pattern match compilation speed is not a bottleneck

12:36 technomancy: right; makes sense for core.match

12:36 dabd: maybe pattern matching is more interesting in statically typed languages?

12:36 dnolen: dabd: no

12:36 technomancy: I'm just saying in general, that's not a problem people encounter frequently, and prefer-method with derivation hierarchies easily makes for code that's very difficult to follow.

12:36 SurlyFrog: Actually, it looks like I have to use java.util.Date anyways as that's what the edn reader returns:

12:36 dnolen: dabd: racket has a completely rocking pattern matcher which is extensible.

12:36 SurlyFrog: (type (edn/read-string "#inst \"2013-02-14T17:09:12.503Z\"")) ; => java.util.Date

12:37 gfredericks: SurlyFrog: that's configurable

12:37 dnolen: dabd: most typed languages the pattern matching is a pretty frozen language feature

12:37 SurlyFrog: gfredericks: oh

12:37 I'll look at that

12:37 gfredericks: SurlyFrog: just put this in /src/data_readers.clj: {inst clj-time.format/parse}

12:37 * gfredericks wonders if people normally put that in /resources

12:37 mefisto: pattern matching seems quite nice for clearer algorithm expression

12:38 dabd: then I don't understand why you said first that rhickey doesn't like pattern matching but you said in the talk he says why he likes it

12:38 dnolen: dabd: quite a few papers on improving pattern matching in statically typed languages - esp. F# & Haskell

12:38 dabd: anyway going to watch it now

12:38 SurlyFrog: gfredericks: I didn't follow that. Does that go in /my/ code, or in the tools.reader code someplace?

12:38 dnolen: dabd: er mistyped, he says why he doesn't like it in the talk.

12:38 dabd: dnolen: ok

12:38 gfredericks: SurlyFrog: that goes in your project; the reader looks for it and uses it to read data literals

12:39 SurlyFrog: see the bottom of (or all of) clojure.org/reader

12:39 SurlyFrog: Seriously? Inside any file, or in a file specifically named 'data_readers.clj'

12:39 gfredericks: the latter

12:40 SurlyFrog: Got it

12:40 dabd: well it looks useful and the overtone project uses pattern matching

12:40 gfredericks: SurlyFrog: if you're on the latest 1.5 this might be slightly different; I'm not sure how the dust settled

12:40 SurlyFrog: I'm on 1.4, so no worries about that, though thanks for the heads up

12:42 dnolen: dabd: pattern matching is useful, and I like it regardless of what rhickey thinks :) core.match works great as a lib.

12:42 dabd: dnolen: definitely I am going to use it

12:42 will you keep working on it?

12:43 dnolen: dabd: yes - it needs refactoring, internal documentation, & bug squashing. still a bit busy with core.logic tho so I haven't given it much love.

12:47 technomancy: dnolen: the other thing that tripped us up was the divide between seqs and vectors; having two things that = considers equivalent not match led to bugs that were difficult to find

12:47 is that one of the things you'd revisit?

12:48 dnolen: technomancy: yes that misfeature will be eliminated

12:48 technomancy: great

12:48 dnolen: technomancy: only vector syntax, no :seq stuff

12:48 technomancy: yeah, that's how everyone assumed it worked =)

12:49 but that kind of thing isn't always obvious from the outset from an API design standpoint

12:50 dnolen: technomancy: yeah, it was a fun experiment - seq matching is really fast - but it's best left as a feature for some else to add if they need it who understands the issues around it.

12:50 SurlyFrog: The sentence: "I'm doing this because according to technomancy; 'java.util.Date is completely batshit.'" was just committed as a comment in my source :-)

12:50 technomancy: heh

12:51 (java.util.Date. 2013 2 14) -> #inst "3913-03-14T07:00:00.000-00:00" ; wat

12:52 SurlyFrog: o_O

12:53 TimMc: I just realized that conversion between 24-hour time and 12-hour time has a corner case at midnight.

12:54 progo: almost like a branch cut.

12:54 TimMc: ?

12:54 progo: complex analysis, nvm

12:55 TimMc: I've always been uncomfortable with 12:00 AM belonging to the following day (or existing at all), but I hadn't realized that aspect.

12:55 gfredericks: technomancy: it's just the principle of weirdest surprise

12:55 TimMc: I made a lib for plain dates so I could stop worrying about that nonsense when it didn't matter

12:55 dabd: I got this: Exception Can't connect to native server - no compatible libraries for your system are available. overtone.sc.machinery.server.connection/boot-internal-server (connection.clj:202)

12:55 technomancy: gfredericks: the best part is how Javascript was all "where should we get ideas about how to design our Date API" they were like "I KNOW JAVA"

12:55 dabd: after evaluating (use 'overtone.live)

12:56 anyone knows what could be the cause?

12:56 technomancy: or rather "I KNOW, JAVA"

12:56 gfredericks: dabd: you've read the docs about the system requirements and such?

12:56 ivan: https://en.wikipedia.org/wiki/12-hour_clock not with Japanese legal convention

12:57 dabd: gfredericks: I was following the readme, I didn't find any system requirements there

12:57 gfredericks: dabd: okay; I've barely used it but I remember having to have a server for something or other installed at the OS level

12:59 dabd: gfredericks: probably I have to install supercollider

13:00 technomancy: TimMc: yet another reason not to use 12-hour time

13:07 TimMc: ivan: I love how German train schedules work: "Departs at 22:00, arrives at 27:15."

13:08 siscia: Hi guys, I do have a problem with rest

13:09 I want a function that work like so:

13:09 (defn func [f a & more] (map f a more))

13:09 but it doesn't really works...

13:10 dnolen: siscia: what is that supposed to do?

13:11 siscia: dnolen, it is a little more complex that it...

13:11 dnolen, however I want to apply map to nested structure

13:11 dnolen, something like:

13:12 SegFaultAX: siscia: Have you looked at clojure.walk?

13:12 siscia: (map + [[1 2] [2 3]] [[1 2] [2 3]])

13:12 [[2 4] [2 6]]

13:12 dnolen, nope, I didn't...

13:12 Let me take a look...

13:14 dnolen: ,(map #(map + %1 %2) [[1 2] [2 3]] [[1 2] [2 3]])

13:14 clojurebot: ((2 4) (4 6))

13:14 dnolen: siscia: ^

13:14 siscia: yeah ok, but what if it is deeper nested...

13:14 dnolen,

13:14 Thanks SegFaultAX

13:16 no other ideas ?

13:16 ChongLi: siscia: explicit recursion (as a last resort)

13:16 dnolen: siscia: I'm sure you can come up with something that does what you want

13:16 siscia: ChongLi, I was doing something like so:

13:17 let me gits it...

13:18 https://gist.github.com/siscia/4954934

13:18 but it doesn't work with the rest

13:18 I am honestly thinking is just a syntax proble,..

13:22 TimMc: ,(apply str (mapcat (fn [c n] [\u0003 (-> n str first) c \u0003]) "COLORS" (range 2 10)))

13:22 clojurebot: "COLORS"

13:22 TimMc: Oh, huh.

13:23 Well, that was a lot prettier in PM with clojurebot.

13:23 gfredericks: everything's prettier when in PM with clojurebot

13:24 TimMc: Now, is that a client issue or a difference in how the bots handle PM and channels?

13:25 ChongLi: TimMc: that'd be my guess; they don't want people messing up the channel with colors

13:26 TimMc: :-(

13:26 technomancy: IIRC there's no standard for colors in IRC; some clients just copy mIRC

13:26 the spec doesn't even tell you what encoding to use =\

13:27 TimMc: Oh, I know how to test this.

13:27 C

13:27 OK, it's the bots.

13:32 SurlyFrog: I forget, do all Clojure files need to be named foo_bar.clj instead of foo-bar.clj?

13:32 that's what Java wants, right??

13:32 lazybot: SurlyFrog: Definitely not.

13:32 Bronsa: hiredman: https://github.com/clojure/tools.reader/commit/9c3fead6083d5b39a7f7755223dc0e838bc30f4b here you are.

13:32 SurlyFrog: okay

13:33 ivan: "Because of IRC's Scandinavian origin, the characters {}|^ are considered to be the lower case equivalents of the characters []\~, respectively. This is a critical issue when determining the equivalence of two nicknames, or channel names."

13:33 dnolen: SurlyFrog: yes dashes must become underscores

13:33 SurlyFrog: okay..

13:39 TimMc: ivan: wat

13:53 austinh: dnolen: Thanks for your resonses about that bug report I filed (and sorry for the noise).

13:55 dnolen: TRS had really made me think conde/condi clause ordering was important, but I can see how that evolved (and I was also conflating goal ordering with clause ordering).

13:55 dnolen: austinh: no problem - it's a bit strange - but it really is how it's supposed to work. yes things have changed since TRS

13:56 austinh: TRS preserved Prolog depth first, but miniKanren is only conde now and no promises are made about order

13:57 ChongLi: this?: https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer

13:57 austinh: dnolen: I saw the comment that core.logic's conde is TRS's condi, but I still understood condi to operate top-down, and I had a mental model of a depth first search.

13:59 dnolen: austinh: yeah trying to get answers in a specific order just will never work in miniKanren nore core.logic

13:59 modern miniKanren

13:59 ChongLi: I really need to get TRS and learn this stuff

13:59 borkdude: why is add-watch still alpha/subject to change in clojure-1.5-RC16

14:00 TimMc: Perpetual alpha.

14:05 austinh: dnolen: That investigation began with this bit of core.logic code that is overflowing the stack: https://gist.github.com/austinhaas/4955349

14:06 dnolen: austinh: huh ... overflow and not non-termination?

14:07 austinh: dnolen: Yes. java.lang.StackOverflowError

14:08 dnolen: It works fine with vectors, and also if that last clause of matcha only wraps a single list around a.

14:08 dnolen: austinh: the stack overflow is definitely a bug, please open a ticket for that with that example program.

14:11 austinh: dnolen: Ok.

14:13 dnolen: austinh: the conda/u code was slightly wrong and I can see why your code would produce a SO error - so this needs fixing

14:13 austinh: thanks

14:16 austinh: in that particular example did you try swapping with matche?

14:17 austinh: dnolen: Yes. Same error.

14:20 rhg135: Hello all, is there any proper way to call a protected method using gen-class?

14:21 dnolen: austinh: huh, OK will look into it

14:22 TimMc: rhg135: gen-class allows you to define methods, not call them.

14:23 rhg135: then can you suggest an alternative I'm quite new to clojure

14:23 TimMc: What are you trying to do?

14:24 ToBeReplaced: i find myself doing (apply hash-map (interleave (map func values) values)) often; am i missing a more idiomatic alternative?

14:24 technomancy: ToBeReplaced: zipmap prolly

14:24 rhg135: I

14:25 austinh: dnolen: Any tips on debugging? I can't seem to get any print statements to go to the repl in my core.logic code.

14:25 ToBeReplaced: technomancy: yep thanks

14:25 rhg135: I'm trying to subclass PircBot's class and call setName

14:25 SegFaultAX: ToBeReplaced: That is a nifty way to do the same thing, though :)

14:26 TimMc: rhg135: Ah, you want to call a protected method from inside a gen-class method?

14:27 rhg135: yeah from post-init, I have a class i wrote in java which works from clojure

14:27 dnolen: austinh: core.logic is lazy, you need to wrap in doall. Also you need to use the logging goals, or just put your println in (fn [a] (println ...) a)

14:27 austinh: the joys of monadic code

14:28 austinh: dnolen: Ok. Thanks.

14:29 amalloy: ToBeReplaced: or (into {} (map (juxt func identity) values))

14:30 ToBeReplaced: amalloy: that's even cuter, ha

14:45 rhg135: hello?

14:45 clojurebot: BUENOS DING DONG DIDDLY DIOS, fRaUline rhg135

14:45 devn: whoa

14:45 rhg135: lol

14:45 devn: rhg135: hi

14:46 pppaul: you broke clojurebot

14:47 SegFaultAX: clojurebot is on the frtiz.

14:49 technomancy: eh, that's pretty typical

14:51 seangrov`: Goodness, angry people are angry

14:51 pppaul: you talking about me?

14:52 seangrov`: technomancy: You've got to stop misleading people about lein being an IDE

14:52 technomancy: what, it's not integrated enough for you?

14:52 seangrov`: No, just a customer/user that spewed a lot of anger on olark to me, and the clojure ml thread about "Why is this so difficult" or something along those lines

14:53 technomancy: (that was a joke fwiw)

14:53 seangrov`: It needs to be more "develop-y"

14:53 gfredericks: pjstadig: ping

14:53 pppaul: lein is great

14:53 technomancy: seangrov`: maybe more environmental too? I've been working on supporting compostable functions for the next release.

14:54 pppaul: what is a compostable function?

14:54 seangrov`: pppaul: Only organic materials

14:54 pppaul: organic functions

14:55 gfredericks: artesian parentheses?

14:55 egghead: technomancy: is there a way to tell 'lein deploy' how to create the jar?

14:55 pppaul: will you support the raw function movement as well?

14:55 egghead: I'm using the lein ring plugin so I need to use 'lein ring uberjar' to create my jar

14:55 technomancy: we're also looking at using fair-trade vars for 2.5, but you can't just blindly follow certifications.

14:55 egghead: however 'lein deploy' seems to just 'lein uberjar'

14:56 technomancy: egghead: hrm; yeah currently that's not possible since it calls the jar defn directly rather than going through apply-task

14:56 you'd have to write your own task. could be quick if you stoop to a with-redefs.

14:57 just ignore this guy: http://www.netmeister.org/blog/images/dijkstra-quick-n-dirty.jpg

14:57 egghead: you raise a good point that deploy should be easier to parameterize. if you open an issue we can address it in a future release perhaps.

14:58 egghead: thanks technomancy

14:58 so lein deploy doesn't uberjar currently? just calls 'lein jar' and ships the result off to sonatype or w/e ?

14:58 looks like I'll have to go another route, thanks technomancy :)

14:59 technomancy: yeah; I mean from what I understand mvn repos are designed with single jars in mind rather than uberjars. it might work with uberjars; there might be subtle gotchas to watch out for. but Leiningen shouldn't prevent it.

15:15 xavriley: small announcement - I've forked the clojuredocs site to make documentation for the Overtone project. It's here if anyone is interested - http://overtone-docs.herokuapp.com/

15:17 austinh: C-c C-p is a great feature I should've learned earlier.

15:18 finnj: can anyone point me in the general direction to how I do mocking in Clojure?

15:18 llasram: finnj: ##(doc with-redefs)

15:18 lazybot: java.lang.SecurityException: You tripped the alarm! with-redefs is bad!

15:18 llasram: ha

15:18 &(doc with-redefs)

15:18 lazybot: java.lang.SecurityException: You tripped the alarm! with-redefs is bad!

15:18 llasram: ,(doc with-redefs)

15:18 clojurebot: "([bindings & body]); binding => var-symbol temp-value-expr Temporarily redefines Vars while executing the body. The temp-value-exprs will be evaluated and each resulting value will replace in parallel the root value of its Var. After the body is executed, the root values of all the Vars will be set back to their old values. These temporary changes will be visible in all threads. Useful for mockin...

15:18 llasram: Srsly, lazybot

15:19 rhg135: Can someone please help be able to use protected java methods?

15:20 SurlyFrog: Anyone know why trying to force a Long to print as a 64-bit hexadecimal value isn't always consistent? Doing `(printf "%#016x" Long/MAX_VALUE)` yields what I would expect, but `(printf "%#016x" 1)` seems to be missing two nibbles of zeros.

15:20 finnj: lol ok thanks llasram

15:22 llasram: SurlyFrog: ##(format "%#03x" 1)

15:22 lazybot: ⇒ "0x1"

15:23 llasram: SurlyFrog: It seems that Java counts the '0x' in the length

15:23 SurlyFrog: llasram: oh, …. well that's dumb.

15:23 er, I should say…I didn't expect that to be the case...

15:24 llasram: It seems consistent-ish. I actually didn't know about the '#' format flag -- always do "0x%016x" myself

15:25 SurlyFrog: llasram: thanks much

15:43 tommo: ,(false)

15:43 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn>

15:50 akhudek: whoa, korma's delete results all the results

15:50 returns rather

15:50 I did not expect that

15:51 abp: akhudek: in production? :o

15:51 akhudek: abp: no, but it caused my dev server to blow it's heap

15:53 I'm really starting to feel that straight jdbc is perhaps the best way to go. I've had too many surprises like this with korma.

15:53 TimMc: Returns *what* results?

15:53 brehaut: akhudek: straight jdbc has been my conclusions re:korma too. its just too often surprising as an abstraction. jdbc is blunt but at least its pretty predictable

15:54 akhudek: I think it's intended to return the keys of the tuples being deleted. But since it does this naively it will read all the tuples then select out the keys. When you do this with a bunch of tuples containing binary data, it's not exactly performant.

15:55 I had a similar problem at one point inserting into a write only table.

15:56 TimMc: Haha, nice.

15:56 akhudek: Insert also reads back it's data by default.

15:57 thalassios_xelon: hello :))

15:58 i am using a chain of functions that get a lazyseq as argument,and returns another lazyseq

15:59 borkdude: how can I use parse on just a string representing xml? wrap the string in some object?

15:59 thalassios_xelon: is that normal?

15:59 TimMc: thalassios_xelon: Sure.

15:59 borkdude: thalassios_xelon yes, that's quite normal

16:00 thalassios_xelon: ok :) something else might be the bug thx

16:00 TimMc: thalassios_xelon: Any side-effects involved?

16:00 thalassios_xelon: no

16:01 if you want to check is something is a collection how you do it?

16:01 TimMc: coll?

16:01 clojurebot: Reader syntax of collections has gotchas

16:02 thalassios_xelon: ok :)

16:02 goodnight

16:06 i think my function works ok for a list,and not with a lazyseq,could this happen?

16:07 TimMc: thalassios_xelon: Not if you're using generic collection and seq fns.

16:08 Can you make a small example of what's not working?

16:08 thalassios_xelon: f is a lazyseq that represents a simple list

16:09 (evaluate-postfix (apply list f) demorgan add-parenthensis) its works

16:09 (evaluate-postfix f demorgan add-parenthensis) its doesnt work...

16:13 gfredericks: ,(conj {} [1 2])

16:13 clojurebot: {1 2}

16:13 gfredericks: ,(conj {} '(1 2))

16:13 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>

16:15 Frozenlock: gfredericks: ... why?

16:15 TimMc: gfredericks: Yeah, but lists and seqs and basically the same thing.

16:15 gfredericks: Frozenlock: why does it do that or why do I mention it?

16:16 Frozenlock: Why does it do that

16:16 gfredericks: ,(doc conj)

16:16 clojurebot: "([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type."

16:16 Frozenlock: You forced me to type the entire question, damn you!

16:16 brehaut: because magic

16:16 gfredericks: ,(conj {} (list [1 2] [3 4]))

16:16 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry>

16:17 gfredericks: ,(conj {} {1 2 3 4})

16:17 clojurebot: {3 4, 1 2}

16:17 gfredericks: :/

16:17 Frozenlock: gfredericks: stop confusing me!

16:17 gfredericks: do any other types have varying behavior with conj?

16:18 I bet that annoyed the crap out of ambrose

16:19 also what is the use case for conjing a map onto a map?

16:19 dnolen: gfredericks: I don't see why second arg to conj must necessarily be Any I would think

16:20 gfredericks: dnolen: well if the first arg is a map then it's only going to accept a vector, a map-entry, or a seq of map-entries, AFAICT

16:20 whereas for most other collection types I think the second arg can be anything

16:22 dnolen: gfredericks: oh you're right, http://github.com/frenchy64/typed-clojure/blob/master/src/typed/ann.clj#L374

16:23 gfredericks: huh; I'm not used to reading these but I don't _think_ the case for a seq of entries is there?

16:39 ayia: Hi Guys, I am reading one intro to clojure... Russion version of the http://www.lisperati.com/casting.html for clojure... And I am trying to understand this line of code: (defmacro defspel [& rest] `(defmacro ~@rest)). Actually I don't understand it... Can somebody explain? What does ~@ mean?

16:40 vijaykiran: ayia: http://stackoverflow.com/questions/4571042/can-someone-explain-clojures-unquote-splice-in-simple-terms

16:41 technomancy: ayia: someone can explain it, but if I recall that tutorial correctly, that line is one you're just supposed to enter and ignore; it gets explained much later in the tutorial.

16:41 it's just a clever trick to make Clojure fit better into the metaphor he's using

16:42 ayia: technomancy: i see... I understand the purpose... But want understand the root:) Is anybody using this "SPELs" technique in real life?

16:42 technomancy: I recommend coming back to it after you've finished the tutorial; it will probably make sense then.

16:44 ayia: technomancy: ok will try)

16:44 vijaykiran: thanks bro, got the meaning of ~@ !

16:44 vijaykiran: ayia: shh -- just follow technomancy's advice :)

16:45 tommo: people always know better ;p

16:47 dnolen: cemerick: good catch, so you see a warning *and* an error?

16:47 jro_: do you know any CMS apps written in clojure?

16:48 vijaykiran: jro_: like https://github.com/fmw/vix ?

16:48 jro_: depends on what you mean by CMS though

16:50 jro_: thanks!

16:51 I wrote a social training blog app, which has gained small userspace, and thought that if there are some projectes, from which I could find some useful functionality

16:52 vijaykiran: jro_: cool - url ?

16:52 jro_: http://ontrail.net or http://www.github.com/jrosti/ontrail

16:54 (and, my friend wrote most of the clientside functionality)

16:55 vijaykiran: jro_: sorry, what language is the TODO in ? (Google translate thinks its german)

16:55 jro_: finnish :-|

16:57 vijaykiran: jro_: site looks nice - though I can't read finnish

16:58 jro_: thanks. I've been very happy with clojure as a backend language.

16:59 vijaykiran: jro_: where do you run it ? on your own server or "cloud" >

16:59 jro_: it is a small finnish iaas-cloud provider called upcloud.

17:00 devinus: is there a complex number library for clojure?

17:02 magopian: guys, is there a "better" (cleverer, other?) way of doing that? https://github.com/magopian/clojure-koans/commit/0b8a8889f4fcd125eb300830b1f2f087ed6cc7e9#L0R25

17:02 (context: it's the clojure-koans)

17:03 (do you say "guys" when you're also addressing gals?)

17:04 technomancy: magopian: I often open up with "greetings, humans" but then the bots feel left out. you really can't win.

17:05 * technomancy broadcasts good will to all sentient creatures including those which may become sentient in the future and happen to be reviewing their channel logs

17:06 magopian: haha technomancy ;))

17:06 vijaykiran: try "hey gang"

17:06 magopian: hey, there :)

17:06 anyway, i'll just take my answer (in the github link) as the correct one (for now), and go to sleep

17:07 i'll see tomorrow if somebody told me that i was wrong ;) nighty night

17:07 hiredman: future sentients are the worst, they are always so smug just because they live in a universe with higher entropy

17:18 devinus: anybody know of a complex number library for clojure? (imaginary numbers)

17:18 dnolen: devinus: haven't heard of anything

17:19 jro_: Apache Commons Math

17:19 it is rather good for basic math stuff

17:20 devinus: if it only supported clojures "numeric tower"

17:21 jro_: devinus? "numeric tower"?

17:22 devinus: jro_: it's what this library calls the way Clojure can handle different types : https://github.com/clojure/math.numeric-tower

17:25 gfredericks: I hacked up my own complex number stuff for clojurescript

17:30 ayia: technomancy: vijaykiran: so... reading further the "casting" tutorial... There is a function definition there: (defn have? [object] (some #{object} (inventory))). Inventory is a function that returns list of objects. object is supposed to be one of them, or not:). Question: How does it work? I read what (some pred coll) do... But can't understand how it works in this example...

17:31 technomancy: ayia: are you familiar with the #{} syntax?

17:31 ayia: I assume this is a set, no?

17:31 technomancy: right

17:31 and you know what happens when you call a set as a function?

17:32 gfredericks: ermahgerd we need a normal seq-contains? function :(

17:32 ayia: ups, got it... sorry)

17:32 amalloy: gfredericks: be sure to make it subtly wrong in some way

17:33 ayia: technomancy: I have just tested in in the REPL... Now I see...

17:33 gfredericks: amalloy: if you call it with finger trees it evals something from the internet

17:34 * gfredericks creates clojure.core/*finger-treeval*

17:34 technomancy: hah

17:34 ayia: technomancy: sorry... I tried to test this in REPL before asking, but made a mistake, called a set as a function but gave it a list of objects, not the object as parameter... Got weid error, and decided to ask here...

17:35 gfredericks: let's start an underground core.incubator

17:35 it can have update and seq-contains? and exactly five more things

17:37 * gfredericks sends core.incubator into rot13 and gets pber.vaphongbe

17:37 hiredman: ugh, those things are all yuck

17:38 gfredericks: those two functions are yuck?

17:38 the-kenny: Someone should start beaming IRC sessions to random directions of the sky

17:38 hiredman: gfredericks: yes

17:38 gfredericks: hiredman: I am interested in why you think that

17:39 hiredman: gfredericks: because seqs are not sets, if you want to check for membership, use a set

17:39 if you want to filter, use filter

17:39 gfredericks: what if you have a seq? putting it in a set just for that seems silly

17:40 hiredman: gfredericks: then don't put it in a set just for that

17:40 (use sets more often everywhere)

17:41 gfredericks: I am not a set hater

17:42 technomancy: yes you are gfredericks just admit it

17:42 gfredericks: I like the reasoning, I just think there are a lot of cases where seq-contains? would be useful and loading the seq into a set might be overkill

17:42 hiredman: how about (defn update [m k f & args] (apply update-in m [k] f args))?

17:42 hiredman: gfredericks: I think the arguement there cuts both ways "oh, it a small enough dataset to just do a linear search"

17:43 gfredericks: use update-in

17:43 gfredericks: 90% of my update-in uses have a single key

17:43 hiredman: gfredericks: and?

17:43 gfredericks: it is rather repetitive

17:46 clojure likes functions that are more general to support 10% more use cases

17:46 arohner: is anyone else having trouble requiring clj-time 0.4.4 on CLJ-1.5.0-RC16?

17:46 amalloy: gfredericks: a problem with the update function is that its contract is not immediately obvious

17:46 brehaut: is it possible to hook clj-time into java.jdbc so that time fields are translated from stupid java date objects and joda dates?

17:47 amalloy: does it use the varargs to act like assoc, or like update-in?

17:47 gfredericks: brehaut: I think we've been doing this

17:47 amalloy: update-in seems more expected to me

17:47 oh

17:47 I see why

17:48 brehaut: we forked java.jdbc to have a read-result-set protocol so the java.sql types come out as joda

17:48 there's a jira ticket for it but not much has happened

17:48 brehaut: gfredericks: oh well. thanks anyways

17:49 AtKaaZ: hi, how would you create a subclass of java.land.RuntimeException with the purpose of having a class with a different name (so without adding methods and stuff) ?

17:49 technomancy: AtKaaZ: ex-info

17:49 it doesn't do what you are asking, but it does what you need =)

17:49 Raynes: lol

17:49 AtKaaZ: ok:)

17:50 technomancy:

17:50 AtKaaZ: dojo?

17:50 technomancy: https://en.wikipedia.org/wiki/Mu_(negative)

17:50 gfredericks: well you can't catch ExceptionInfo based on contents :/

17:51 amalloy: gfredericks: sure you can, with slingshot

17:51 gfredericks: I looked at that today; it looked like it's still AOT?

17:51 AtKaaZ: i'm using ccw, so aot = not working

17:51 ibdknox: technomancy: thoughts on the rapgenius HN thing? It's getting a bit ridiculous heh

17:51 AtKaaZ: else I would've used gen-class I think

17:52 hiredman: gfredericks: I would be surprised if that is the case

17:53 https://github.com/scgilardi/slingshot/blob/master/project.clj

17:53 amalloy: gfredericks: slingshot is? no, it uses ex-info if it's on clojure 1.4+

17:53 technomancy: ibdknox: they're doing a good job of getting a lot of attention, but the way that they're doing so nearly drowns out the fact that there is a legitimate problem at the root.

17:53 gfredericks: well I don't know how lein works then

17:54 hiredman: technomancy: rails?

17:54 ~rimshot

17:54 clojurebot: Badum, *tish*

17:54 gfredericks: hiredman: that's what I was thinking

17:54 ibdknox: eh

17:54 it has nothing to do with rails :p

17:54 technomancy: hiredman: heh... well yeah, the way they've framed it as "you hate rails" makes it seem pretty lolworthy

17:54 gfredericks: single-threaded servers?

17:54 ibdknox: gfredericks: all servers

17:54 doesn't matter whether they're single threaded or not

17:55 technomancy: but the lack of a runtime-agnostic way to indicate loadedness back upstream to a load balancer is a real problem

17:55 not a problem that's specific to Heroku at all; it's just more obvious at Heroku's scale

17:55 ibdknox: technomancy: it seems like you could cheat

17:55 you control the flow in and out

17:55 just keep count

17:55 technomancy: ibdknox: not across a cluster as large as our routing cluster

17:55 ibdknox: do a naively intelligent load-balancing scheme based on that

17:56 technomancy: not sure I understand which part of that won't scale?

17:56 technomancy: anyway, I'm not supposed to talk about it; there'll be a blog post coming out about it soon

17:56 ibdknox: mm

17:57 p_l: technomancy: fun fact - I stumbled upon rapgenius claims just after reading instructions on how the same change involved support for concurrency and how to use that with rails to get ~4 times the speed

17:57 technomancy: it's a really difficult problem; the way they framed it trivializes the hard parts while ignoring the demands of modern runtimes, but that doesn't mean it's not a problem

17:58 the second image here is pretty telling: http://code.dblock.org/in-defense-of-heroku

17:58 p_l: ibdknox: afaik pre-cedar there was some kind of counting, but I'm not a heroku person :)

17:58 ibdknox: p_l: well pre-cedar the problem was *much* simpler

17:59 p_l: technomancy: I prefer the post that someone put with description on how to use Unicorn with fork() workers to get I think even 8x ther request/s :>

17:59 ibdknox: artificially limiting a server to one request isn't going to cut it these days though

17:59 p_l: unicorn doesn't actually solve the problem though, it simply moves it to a higher scale factor

17:59 brehaut: question. how does internet beef differ from grain feed or grass feed beef?

18:00 ibdknox: brehaut: it's not kosher.

18:00 p_l: ibdknox: yes, but it helps deal with low support for concurrency in certain too-magical frameworks

18:01 AtKaaZ: where do I find ex-info usage examples? and why isn't there one here: http://clojuredocs.org/search?x=0&y=0&q=ex-info

18:02 gfredericks: AtKaaZ: the docstrings for ex-info and ex-data?

18:02 they're not that complicated

18:02 AtKaaZ: oh you may be right, I was using google so far

18:02 gfredericks: the ExceptionInfo class lets you stuff a map into the exception

18:03 thheller: @AtKaaZ : (throw (ex-info "msg" {:some data}))

18:03 gfredericks: apparently slingshot is okay to use if you want to filter based on the data

18:03 AtKaaZ: thheller: thanks, I was mostly wondering about the ex-data / catching

18:03 gfredericks: I looked at it for ex-info in the tests, but found none

18:04 thheller: (catch ExceptionInfo e (do-with-ex-data (ex-data e))) :P

18:04 hiredman: just make sure to read the slingshot docs if you use it

18:04 thheller: no idea about conditional catching

18:05 austinh: [core.logic] Is there a way to instruct run not to reify certain terms?

18:05 AtKaaZ: thheller. thanks but where is ExceptionInfo

18:05 hiredman: ok

18:05 hiredman: don't ask run for them

18:06 austinh: if you introduce new terms via fresh they will not be in the result

18:06 (run [q a b c] ...) vs (run [q] (fresh [a b c] ...))

18:06 austinh: hiredman: And there is no way to inhibit that? It's the same if you introduce them with lvar.

18:06 thheller: @AtKaaZ: clojure.lang.ExceptionInfo

18:07 hiredman: austinh: inhibit what?

18:07 austinh: if you don't ask for a value you don't get it

18:07 austinh: hiredman: the reification of certain terms, like a binder

18:08 hiredman: austinh: binder?

18:09 austinh: hiredman: nom/tie

18:09 hiredman: austinh: still doesn't mean anything to me

18:09 AtKaaZ: actually slingshot does look like better

18:10 austinh: hiredman: A binder is a term introduce by tie, which is in the nominal library. But that doesn't matters, s/binder/lvar

18:10 gfredericks: austinh: what is the problem you're observing?

18:11 hiredman: austinh: are you asking about how to limit the which logic vars are included in the result of run?

18:11 austinh: hiredman: no

18:11 hiredman: ah, ok, then I have no idea

18:13 ravster: is there a way to use friend to do authorization dependant on params sent in the URL?

18:13 austinh: gfredericks: I'm not observing any problem. There are times when it makes sense to create a logic var outside of run (to be used later).

18:13 gfredericks: I'm asking if it is possible to write a logic program that returns an un-reified lvar.

18:14 hiredman: austinh: have you tried just calling clojure.core.logic/lvar ?

18:14 ayia: technomancy: vijaykiran: so... I have finished reading... Actually it did not clarified me all stuff... So... The tutorial says: put (defmacro defspel [& rest] `(defmacro ~@rest)) in your code and then you can (defspel walk [direction] `(walk-direction '~direction)). But why can't I just write like: (defmacro walk [direction] `(walk-direction '~direction)) ?

18:14 hiredman: (outside of run)

18:14 that is the function that creates lvars

18:15 technomancy: ayia: you can, and that's what people actually do in real life. the "spel" metaphor is a cute way he tries to work "magic" thematically into the tutorial.

18:16 it's like an alias

18:16 austinh: hiredman: Yes, calling lvar doesn't make a difference.

18:16 technomancy: basically he is concerned that when people see the term "macro" they think "oh, I know how this works; it's like in C" and completely misunderstand what's going on, so he in engaged in his own Rectification of Names

18:16 hiredman: austinh: what are you trying to do with lvar outside of run?

18:17 unify it with the same value across different calls to run?

18:17 (because the environment is doesn't exist out side of a call to run, so that is not going to work)

18:17 ayia: technomancy: hm... So - (defmacro defspel [& rest] `(defmacro ~@rest)) - just makes the "defspel" alias for "defmacro"...

18:17 austinh: hiredman: I'm not using lvar. I'm trying to create binders to use in a theorem prover.

18:18 technomancy: ayia: basically, yes

18:19 ayia: technomancy: hm... so the guy tried to change the world, but finally he did not...

18:19 austinh: hiredman: If you look at the sudoku example here: https://github.com/clojure/core.logic/wiki/Examples there is a call to "repeatedly" generate lvars outside of a run expression.

18:19 technomancy: ayia: well I don't know if he intended his terminology to be used outside a learning context. it may be that if you know C, that is a good way to avoid falling into a common trap.

18:19 abp: I'm reducing some code of my contribution to nothing. Can't stop.

18:20 hiredman: austinh: sure, which is sort of exactly what I thought I asked about, calling lvar, but you said that doesn't work?

18:20 technomancy: but yeah, it's a bit capricious.

18:20 austinh: hiredman: I'm asking if it is possible to replace that repeatedly expression with a call to run.

18:22 hiredman: austinh: I dunno, but I doubt it, and I have trouble seeing why you want that given that the environment (where lvars are constrained or bound) exists only inside run, and is not globally shared between calls to run

18:22 so if you got a lvar back, it would be just the same as the lvars created outside of run

18:23 ayia: So I hope, as a Lisper, you'll consider supporting this new term- Naturally, any new memes like this have a very low likelihood of success.

18:23 If you have a library or are a Lisp implementation author, please drop everything you are doing right now and add the following line to your library:

18:23 (defmacro defspel (&rest rest) `(defmacro ,@rest))

18:23 technomancy: that was an exceprt from the tutorial... seems like he really intended.... Here is the exceprt: ""

18:23 technomancy: ayia: that's funny... I can't tell if he's joking or not.

18:24 hiredman: technomancy: on the internet the crazier it is the more likely it is to be serious

18:24 technomancy: hiredman: this is Conrad Barski though

18:25 dude spoke at the conj

18:25 hiredman: serious бизнес

18:25 technomancy: I bet he'd like Racket though; Racket is all about defining new languages.

18:25 hiredman: technomancy: https://github.com/bbatsov/clojure-style-guide/issues/14

18:26 * technomancy 's stomach churns

18:26 hiredman: yep

18:27 austinh: hiredman: The alphaLeanTap implementation here: https://github.com/namin/leanTAP rewrites expressions to include binders. This occurs outside of a run. The expressions are fed to a theorem prover that uses run.

18:27 technomancy: well if anyone submits a pull request for that to clojure-mode you can assure it will be closed with extreme prejudice

18:27 can be assured

18:27 austinh: hiredman: I was wondering if it is possible to rewrite the expression parser as a logic program (which means that it would have to produce un-reified binders).

18:29 hiredman: austinh: it looks like it builds them as clojure forms (not a core.logic thing) and passes them in to run

18:29 technomancy: hiredman: attempted to pre-emptively shoot it down; fingers crossed

18:29 austinh: hiredman: Yes. That is what it does.

18:29 hiredman: just from scanning the code there

18:30 TimMc: reiddraper: Meetup was cancelled?

18:31 hiredman: austinh: so if that is an example of what you want to do, why not just do what it does

18:31 ?

18:32 austinh: hiredman: I'm exploring my options.

18:35 Frozenlock: technomancy: I might make a pull request just for the trolling :)

18:36 technomancy: Frozenlock: a little drama helps keep things exciting

18:36 Frozenlock: He could however make a clojure-hiccup mode; this is clearly what he was asking it for.

18:37 technomancy: Frozenlock: sure, if he wants to never get a pull request from someone not using clojure-hiccup mode =\

18:39 devinus: is there a way to import only a specific function?

18:41 Frozenlock: In your namespace? (:require [some-other-ns :refer [fn-name]])

18:42 devinus: Frozenlock: it's a java function

18:42 ivan: Java has functions?

18:42 * Frozenlock is confused by the java/function thing

18:43 devinus: java method

18:43 >.>

18:44 Frozenlock: devinus: why 'just one'? I'm no expert, but shouldn't (import '(some.java.class)) do the job?

18:45 devinus: Frozenlock: sure, but then id have to use the namespace every time

18:45 e.g.

18:45 Math/sqrt

19:02 Frozenlock: Is there an ever smaller webrepl than tryclj?

19:02 *even

19:04 llasram: devinus: Old clojure-contrib had import-static, but it didn't make the 1.3+ move. You can pull it into your code if you really want it: https://github.com/clojure/clojure-contrib/blob/1.2.x/src/main/clojure/clojure/contrib/import_static.clj

19:04 But there's a reason no one took ownership -- honestly isn't that big of a deal to just reference static methods as Class/method

19:16 TimMc: llasram: I did make org.baznex/imports

19:16 llasram: Oh, cool

19:16 * callenbot spits on java-esque org namespace

19:16 TimMc: bots can't spit

19:16 llasram: Well now I know, and can so-inform future questioners

19:17 callenbot: TimMc: way to blow my cover.

19:17 Raynes: $latest me.raynes/laser

19:17 llasram: callenbot: Actually, why are you bot?

19:17 lazybot: [me.raynes/laser "0.1.22"] -- https://clojars.org/me.raynes/laser

19:17 callenbot: llasram: long story, very sad. Involves node.js and tales of horror.

19:17 llasram: Or rather, I think you're lying, and are not in fact a bot

19:17 callenbot: llasram: I am now a cyborg.

19:17 llasram: Hmm. Well, that's plausible then

19:17 callenbot: I speak through my bot for technical reasons.

19:17 my normal nick (callen) is indisposed...

19:17 hrm yes, I need to implement that this weekend actually.

19:18 llasram: I need to go back properly group-id my libraries...

19:19 TimMc: llasram: Honestly, (.importClass *ns* 'P2D java.awt.geom.Point2D$Double) is better than pulling in org.baznex/imports just for #'rename.

19:20 cljScrub: Clojure + GUI question: because of immutability concurrent programming is a far less tricky beast to tackle right? So how effective would it be to write the core of an app in Clojure and pass relevant data to a rendering engine for processing in real time? Would the transaction time be too large to allow smooth rendering? Is it better to keep these

19:20 two processes more closely coupled?

19:20 llasram: TimMc: Err. If I felt compelled to do that, I'd like *some* layer of abstraction separating me from implementation details

19:21 hiredman: changing names is not an abstraction

19:22 TimMc: llasram: Here's an actual example: (.importClass *ns* 'AddrType javax.mail.Message$RecipientType)

19:22 llasram: hiredman: I was referring to Namespace#importClass

19:22 TimMc: And then I can say AddrType/TO.

19:23 llasram: TimMc: Oh, I can totally see the draw. I just meant I'd rather use your library than depend on the implementation of the Clojure namespace class remaining unchanged :-)

19:23 ravster: I'm using 'friend'. I've got the following identity stuff in my session. What is the best way to extract the ':id'?

19:23 TimMc: llasram: Then copy my implementation of #'rename and use that in the same file. :-P

19:23 llasram: Heh

19:23 ravster: https://www.refheap.com/paste/11307

19:24 callenbot: ravster: 1. Don't use friend

19:24 llasram: ...

19:24 callenbot: ravster: there is no step 2

19:25 ravster: ouch. Not a fan?

19:25 amalloy: step 0 is to ignore advice given by people who sound angry

19:25 callenbot: ravster: listen to amalloy, but don't use friend either.

19:25 ravster: friend is a great idea if you're integrating with a complicated system

19:25 ravster: if you don't need to manage the complexity of a complicated system...don't use friend.

19:27 ravster: https://www.refheap.com/paste/11308

19:27 abp: callenbot: It works pretty well in my apps. :P

19:27 callenbot: abp: I'm so glad you have that kind of free time.

19:28 * technomancy was impressed with how easy it was to work github oauth into Syme without any special libs

19:29 callenbot: what technomancy said.

19:29 technomancy: two functions and a compojure route: https://github.com/technomancy/syme/blob/master/src/syme/web.clj#L31

19:29 of course, you can only get away with that if you're lucky, but if you can... man.

19:29 callenbot: more to the point: https://github.com/technomancy/syme/commit/114a47a602e80427fda4e7de3ce57f407e6562dd

19:29 ravster: wow. good stuff.

19:30 callenbot: ravster: in my code...don't ask about put-context.

19:30 ravster: you...don't want to know.

19:30 ravster: callenbot: lol

19:30 callenbot: ravster: magic I wrote

19:30 I needed RequestContext.

19:30 Ring didn't have it, so I made it.

19:30 in like, 3 lines of code.

19:32 weavejester: callenbot: RequestContext?

19:32 abp: callenbot: request context is still the request map. :P

19:32 ravster: wow. okay. so use friend if dealing with something that already exists? Else roll your own thing that satisfies your requirements?

19:32 callenbot: weavejester: https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext

19:32 ravster: that's my opinion. It's a complexity trade-off.

19:33 I prefer to refactor on-demand rather than building for more complexity than I actually need to handle.

19:33 ravster: cool

19:33 callenbot: ravster: if you understand friend and can use it, cool - but you seemed to be having trouble.

19:33 ravster: it's worth implementing some auth middleware manually just so you understand Ring better anyway

19:34 it's more valuable to understand Ring natively than it is some middleware.

19:34 ravster: makes sense

19:34 weavejester: callenbot: What's the purpose of RequestContext? It's hard to tell from the docs.

19:34 callenbot: weavejester: template context processors

19:34 weavejester: GLOBULL DATA!

19:34 weavejester: sie enemy, according to you :)

19:34 ravster: IME: Ring doesn't have any particularly good tutorials or documentation, so you have to implement middleware to really learn it.

19:35 I think Vijay's tutorial might touch on it.

19:35 sorta.

19:35 technomancy: I thought the ring spec was pretty thorough, if not particularly suited for an introduction.

19:35 abp: callenbot: I wrote paging today using a middleware that takes paging information from the route and puts it into the request under :paging, while striping down the route. Routes that invoke paging views do (view (:paging request)) now.

19:35 callenbot: technomancy: https://github.com/mmcgrana/ring/blob/master/SPEC really?

19:36 abp: pagination?

19:36 technomancy: callenbot: hm; I guess it's been a while

19:36 weavejester: callenbot: Ah, I see. Out of interest, what are you using it for? As in, what global data are your templates using?

19:36 callenbot: technomancy: you know too much.

19:36 abp: callenbot: An example for general information retrieval.

19:36 callenbot: weavejester: user, principally.

19:36 I'm not going to manually kick around a user document all over the place. stupid.

19:37 weavejester: http://codespatter.com/2008/12/22/django-requestcontext-example/

19:37 weavejester: https://github.com/ring-clojure/ring/wiki/Concepts is perhaps a little more descriptive than the spec

19:37 abp: callenbot: It's stupid to pass a map along and not extend it but instead make your own little atom store just for convinience. :P

19:37 callenbot: abp: don't diss my atom store damn you.

19:38 abp: callenbot: I'll do till it dies.

19:38 callenbot: abp: it just merges the provided context on top of the template context anyway.

19:38 er, provided context overrides global

19:38 ravster: thanks again callenbot, I'll be looking at those links you posted.

19:38 weavejester: callenbot: I tended to use a *user* dynamic var for that, but I've been thinking about alternatives

19:38 callenbot: ravster: I've got an example Clojure app I'm slapping together. You could use that or refheap to learn.

19:38 weavejester: mine is better.

19:38 weavejester: mine doesn't reify specific datapoints.

19:38 weavejester: it's generally applicable and nice.

19:39 weavejester: callenbot: Reify datapoints?

19:39 Raynes: $latest me.raynes/laser

19:39 lazybot: [me.raynes/laser "0.1.22"] -- https://clojars.org/me.raynes/laser

19:39 callenbot: weavejester: *user* is a reference to a single datapoint

19:40 weavejester: things like that don't merit reification to being a top-level var.

19:40 Raynes: Maybe I can finish moving refheap to laser this weekend and up laser's version to 1.0.0.

19:40 callenbot: weavejester: just use an atom container of a map.

19:40 Raynes: I look forward to it.

19:40 Raynes: I'll update the benches tonight or tomorrow.

19:40 Raynes: Update them to what?

19:40 callenbot: Raynes: type-hint for laser.

19:40 Raynes: Oh, with the type hinted benchmark I added?

19:40 Yeah, no big deal.

19:40 I don't recall it being significant.

19:41 callenbot: I know but I feel bad :(

19:41 Raynes: I'm still surprised it's faster than enlive and happy that it is as such.

19:41 technomancy: (:require [me.raynes.laser :as pew.pew.pew])

19:41 weavejester: callenbot: The advantage of using a dynamic var is that you explicitly declare what data you're going to make dynamic.

19:41 Raynes: (for the benchmarks, at least)

19:41 weavejester: And you can't mutate it - only override it

19:41 Raynes: technomancy: That's the spirit!

19:41 callenbot: weavejester: you do declare a dynamic var. the context.

19:41 Raynes: Oh my God.

19:41 I've missed such a grand opportunity!

19:41 callenbot: Raynes: yeah you messed up there.

19:41 technomancy: Raynes: there is still time

19:42 Raynes: technomancy: I could have named 'document' and 'fragment' 'pew' and 'pewpew' respectively!

19:42 In all seriousness, I have an 'at' function that works on a single node. I should rename it to 'pew', just as a little easter egg.

19:42 weavejester: callenbot: If I'm understanding correctly, you have an atom bound to a dynamic var that acts as a context for the life of the request

19:42 callenbot: weavejester: da comrade

19:43 weavejester: callenbot: Like… (defn [handler] (fn [request] (binding [*context* (atom {})] (handler request))))

19:43 callenbot: weavejester: https://www.refheap.com/paste/11310

19:43 weavejester: not quite.

19:43 weavejester: it might be semantically incorrect but works for me.

19:44 weavejester: https://github.com/bitemyapp/neubite/blob/master/src/neubite/middleware.clj please ignore the really dumb database queries. kthxbai.

19:45 amalloy: callenbot: isn't this totally un-threadsafe, whereas weavejester's code does the exact same thing but safely?

19:45 weavejester: callenbot: Where's the (binding [g (atom {})] ) part?

19:45 loliveira: is there a numpy alike in clojure?

19:45 weavejester: What amalloy said :)

19:47 It's not thread safe. You want something more like: https://gist.github.com/weavejester/4957775

19:47 Although I'd personally avoid an atom in this case.

19:48 callenbot: weavejester: I figured it might not be. Thanks!

19:48 weavejester: But I see what you're doing

19:48 callenbot: weavejester: of course you do. It's simple.

19:49 weavejester: I tend to prefer to keep data constrained, which is why I prefer a *user* over a more general context map

19:49 If a function doesn't need a piece of data, ideally it shouldn't have access to it :)

19:49 callenbot: weavejester: every single view needs the data in g.

19:50 weavejester: callenbot: But the only thing in g is the user? Or do you have more data?

19:55 callenbot: weavejester: user, superuser, staff.

19:56 weavejester: it's simpler than complecting stuff concerned exclusively with security.

19:56 weavejester: the g is a "nexus" designed to make it simpler to decomplect things like security from how users are stored, how templates are rendered from how users are auth'd, etc.

19:56 too many people rely on invasive dependencies in Clojure code to maintain statelessness. It's not worth it.

19:57 weavejester: callenbot: To my mind it adds complexity

19:57 callenbot: hardly.

19:57 Raynes: To his mind.

19:57 weavejester: Well, lets say you have 3 dynamic vars instead

19:57 Then you've isolated them from one another

19:57 Putting them together in a global map adds connections

19:57 callenbot: I can change how users are auth'd behind the scene and not worry how other functions or templates are made aware of users.

19:58 weavejester: It ties them together when perhaps they don't need to be.

19:58 But you could do that with a *user* var as well

19:58 callenbot: a one-stop-shop is simpler than littering the namespace with miscellaneous data.

19:58 and it makes it more sensible to just merge the contexts for the templates.

19:58 weavejester: Not in the sense of simple being a way of avoiding tangling things together

19:59 callenbot: I already said it helped avoid that.

19:59 I've seen too much hiccup code calling directly into the database. absurd.

19:59 weavejester: Isolated variables are "simpler" than variables combined into one data structure.

19:59 callenbot: I can't even fathom something @g would make more complicated for me, let alone what it already makes simpler.

20:00 weavejester: It might make things easier

20:01 callenbot: weavejester: you appear to value your religious aesthetic over sensible, maintainable, modifiable code.

20:01 weavejester: No, no, quite the opposite

20:02 I want things to be maintainable, and functions that are isolated are easier to reason able than functions that have more data

20:02 Pure functions are amazing when you can have them

20:02 You give it only the data it needs

20:03 And you get a return value with no side effects

20:03 That's wonderful from a maintainabily and testability point of view

20:03 callenbot: oh please.

20:03 you talk as if there is going to be a swarm of race conditions or threads

20:04 it's just a way to kick around a map without explicit dependence.

20:04 weavejester: If the map has a small number of keys, then I can't see it doing much harm

20:05 But if it only has a small number of keys, why not make them explicit with vars?

20:05 And if it has a large number of keys, then each function is getting more data than it needs.

20:06 callenbot: weavejester: it's made my life a lot simpler, especially in auth/security.

20:06 weavejester: you can pry it from my cold dead fingers.

20:06 weavejester: Haha :)

20:06 I think it's made your life easier

20:06 I'm not certain about simpler, at least in the "rich hickey" sense

20:07 callenbot: weavejester: I know the distinction and you're wrong, in this case.

20:08 weavejester: look at user and is_superuser

20:08 weavejester: Why? I mean, why is tying variables together in one map simpler than isolating them?

20:08 callenbot: weavejester: think carefully about the implications if I let is_superuser be defined in terms of user exclusively with a *user* var.

20:08 weavejester: it complects the data dependencies.

20:08 Not worth it.

20:09 yedi: is anyone here using aws beanstalk for any clojure deployments? if so how's it going?

20:09 weavejester: yedi: I have. I also need to update it at some point.

20:10 yedi: weavejester: did you hit any major road bumps when setting it up for the first time?

20:11 weavejester: callenbot: I'm not sure I follow. In the example you give, it seems like "superuser?" should be a predicate on a user.

20:12 callenbot: i.e. you'd have (superuser? user) to check if a particular user was a superuser

20:12 callenbot: weavejester: what if you need a superuser status that exists outside of the user subsystem?

20:12 weavejester: one that isn't statefully or logically bound to the user data?

20:12 weavejester: yedi: No, although the default environments for lein-beanstalk are a bit screwy.

20:13 callenbot: weavejester: do you use AWS a lot?

20:13 weavejester: you seem to write a lot of stuff for it.

20:13 weavejester: callenbot: So then you'd have a *superuser?* var, although I'm not sure I can see the purpose of that

20:14 callenbot: A fair bit, yep.

20:14 callenbot: we agree to disagree. :)

20:14 weavejester: Sure :)

20:14 technomancy: callenbot: doesn't seem like your style

20:14 callenbot: weavejester: I'm not a fan of the performance I saw with the EC2 nodes, or much of anything else.

20:14 technomancy: seems so.

20:15 weavejester: callenbot: The performance of EC2 nodes has never really been relevant to me

20:15 Most of the stuff I do is I/O bound or embarrassingly parallel

20:15 callenbot: weavejester: I prefer to reserve AWS for overflow/batch stuff.

20:15 weavejester: dude, I/O is horrible on EC2.

20:15 EBS is a travesty.

20:16 weavejester: Network I/O, not disk I/O

20:16 technomancy: my uncle is a travesty https://github.com/technomancy/sokoban/blob/master/README.md

20:17 callenbot: technomancy: heroku's infrastructure is open source?

20:17 how did I miss this?

20:17 technomancy: eh; some is and some isn't?

20:17 everything I'm working on is either OSS or being replaced by OSS

20:17 callenbot: obviously your funky router queueing mechanism isn't

20:17 abp`: lol

20:17 technomancy: yeah, I don't have enough erlang chops to hack on that part

20:18 * callenbot jots down note that it's written in erlang

20:18 technomancy: it's a router, of course it's written in erlang =)

20:18 callenbot: technomancy: my github score is increasing.

20:18 technomancy: I'll be caught up to isaacs within a month >:)

20:18 brehaut: technomancy: surely node.js would give you better scalability

20:18 callenbot: brehaut: because node.js is webscale and FAST

20:19 technomancy: brehaut: https://twitter.com/mongodbfacts/status/302181757174833153

20:19 brehaut: technomancy: sorry im late to the jokes

20:19 callenbot: technomancy: LOL

20:19 technomancy: the funny thing is, I use MongoDB :(

20:21 "Using MongoDB is like getting a free ticket to a magic show. Where'd your data go?"

20:22 Raynes: I use and am happy I use mongodb.

20:22 *shrug*

20:22 refheap doesn't mind it.

20:23 callenbot: Raynes: I use MongoDB happily too

20:23 Raynes: that doesn't mean I don't know it's silly. :)

20:23 Raynes: I don't know that it's silly because I've never cared enough to learn why it's silly.

20:24 I use it for a relatively simple open source website.

20:26 callenbot: see, the fact you don't care and it "just works" is a lot of why it has grown popular.

20:27 there's no pilgrim's path to travel like with PGSQL

20:27 Raynes: callenbot: Well, I don't care for a specific reason.

20:27 callenbot: Raynes: oh?

20:27 akhudek: there is a pilgrims path for PGSQL?

20:27 callenbot: akhudek: if you didn't already know how proper SQL databases worked, yes.

20:27 akhudek: ah

20:27 Raynes: I don't care because the data isn't so important that whatever horrible things are wrong with mongodb. I have backups that would work just fine in a catastrophe.

20:28 callenbot: Raynes: to be fair, if you were that worried about catastrophe you wouldn't have used Heroku :)

20:28 Raynes: I don't know what you mean.

20:28 callenbot: Raynes: I'm making fun of Heroku :(

20:29 Raynes: Oh. I think I'm okay with that these days.

20:29 callenbot: Raynes: they go down more regularly than a vegas escort.

20:29 Raynes: They take my money, idle me after an hour of no activity, and then go down for 12 hours on two occasions.

20:29 I'm happy to leave.

20:29 :p

20:29 callenbot: the spin up times with my clojure apps is really frustrating.

20:30 technomancy: you should rewrite the slug compiler in node.js so it goes faster.

20:31 technomancy: totes

20:32 Raynes: technomancy should hook me up with Heroku sponsorship so I get a free SSL endpoint addon and maybe a second free dyno. He could get Heroku people using refheap internally.

20:33 technomancy: the frustrating thing is we can't do SSL properly (where properly here means "in a way where we don't go down when amazon's ELBs go down) without SNI, and uptake on SNI has been slow on the client side

20:34 Raynes: I thought you had SSL covered by keming?

20:34 Raynes: For a year, yes. But I don't want to have to hold another fundraiser and try to explain why I need money for something I can do for free, since amalloy currently pays for our vps.

20:35 cause <3 amalloy.

20:35 So it's really just "Meh. This is open source. Our Linode is super stable. I don't have to pay an extra $20 per month for SSL."

20:36 But I don't blame Heroku for having to pay for the SSL addon.

20:36 I think I read that that cost is passed on to amazon or something.

20:36 So it comes with the territory, I suppose.

20:38 technomancy: yeah... I have high hopes for a better solution with SNI that wouldn't cost a bundle, but I'm not sure of the priorities on that

20:38 given that it would give some abysmal error message in older versions of IE or something

20:39 Raynes: technomancy: Hah. IE.

20:39 They should provide it anyways then. Make it the "I don't give a fuck about IE" option.

20:42 Frozenlock: Ok this is a long shot... I'm trying to implement a repl just like tryclj.com in my webserver. Everything seems to work, but the web REPL gives me this error every time I try to type something in it: "java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.Atom" So at least I can tell that the communication between the page and the jvm works, but nothing more... Does this error rings a bell to someone?

20:42 Like I said: long shot.

20:47 gfredericks: Frozenlock: the only vars I know of that are unbound are *1 *2 *3 *e unquote unquote-splicing

20:48 Frozenlock: check wherever you call swap!?

20:48 Frozenlock: Yes I do

20:49 Ohhhh

20:49 I think I forgot to add the noir session middleware.

20:52 Well, at least I progress: java.lang.NullPointerException :)

21:01 gfredericks: the best kind of PointerException

21:17 warz: the docs for -> say that it threads the value through the forms. does this literally mean using threads?

21:18 Iceland_jack: warz: no

21:30 egghead: warz: it "threads" in the same way that "comp" threads

21:31 warz: ok, i figured it was just the terminology used

21:31 yedi: weavejester: i'm gonna push a clojure service to beanstalk, mind if i ping you if i get stuck somewhere?

21:31 egghead: i.e. (dec (inc 3)) (-> 3 inc dec)

21:31 warz: so its just a different syntax, basically

21:31 egghead: it's a macro, ya

21:32 warz: cool

21:32 egghead: &(-> 1 (* 10) (+ 3))

21:32 lazybot: ⇒ 13

21:32 warz: now thats neat

21:33 so hard to think about what macros to use and stuff, for me. haha.

21:33 im sure time will help there

21:34 Iceland_jack: warz: you can make use of macroexpand, it should clear it up

21:34 pppaul: you aint seen nothing yet

21:35 &(-> + (apply [1 2 3 4]) (->> (* 7))

21:35 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

21:35 pppaul: awww

21:35 &(-> + (apply [1 2 3 4]) (->> (partial * 7))

21:35 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

21:36 pppaul: &(-> + (apply [1 2 3 4]) (->> (partial * 7)))

21:36 lazybot: ⇒ #<core$partial$fn__4072 clojure.core$partial$fn__4072@3503e7>

21:36 pppaul: well, i fucked that up

21:36 abp`: pppaul: partially

21:36 warz: ive been programming in mostly c-like languages since like 1998, and i can admit that trying to learn clojure and sitting in here i basically feel like im reading a foreign language every day

21:37 but that makes me want to comprehend it all, haha

21:37 abp`: &(-> + (apply [1 2 3 4]) (->> (* 7)))

21:37 lazybot: ⇒ 70

21:37 egghead: :)

21:37 threading fns through forms, aw ya

21:37 abp`: pppaul: But then the thread last isn't necessary at all

21:37 warz: my goal is to make it through 1 day while understanding everything said in here

21:37 pppaul: warz, (diff) (xml-seq) (file-seq) and zippers are pretty cool stuff too look into

21:38 abp`i wasn't trying to write something that made sense

21:38 egghead: zippers

21:38 abp`: pppaul: Yes but i thought getting results from useless code would be helpful. ;)

21:39 egghead: pppaul: do you know of a good writeup on clj zippers, I've been trying to get a better understanding of them

21:39 pppaul: i don't get results. i get paid

21:40 abp`: That's my current neatest threading usage in the code I'm working on: https://www.refheap.com/paste/11313

21:41 egghead: What do you want to do? Just learn about zippers?

21:41 tmciver: pppaul: you get paid to not get results?

21:41 :)

21:42 Iceland_jack: tmciver: He doesn't make sense, he gets paid.

21:42 abp`: egghead: http://www.ibm.com/developerworks/library/j-treevisit/index.html?cmp=dw&cpb=dwjav&ct=dwnew&cr=dwnen&ccy=zz&csr=092211 That's the best I know.

21:44 egghead: thanks abp`

21:44 pppaul: i'm a pro at getting paid

21:44 don't know what the hell results are

21:44 sounds like a variable name

21:44 abp`: pppaul: accumulator please. :P

21:45 gfredericks: warz: I have a coworker who can't use the phrase "threading macro" because he associates it with multithreading so he calls it "stabby"

21:45 pppaul: ahahaha

21:45 it's a pipe

21:45 abp: He, let me stab my forms throuhgh what I dislike.

21:45 pppaul: pipe macro

21:45 there are a bunch of thread macros, though… i was looking at as-> the other day

21:45 looks interesting

21:46 gfredericks: bunch got added in 1.5

21:46 used to be just -> and ->>

21:46 egghead: did the nil short circuit one get added

21:46 -?> or w/e

21:46 abp: some->

21:46 pppaul: i didn't see it

21:46 gfredericks: they're in core.incubator

21:46 pppaul: i saw some-> didn't realize it was the same as -?>

21:46 abp: as well as as-> and let->

21:47 gfredericks: pppaul: it's not the same

21:47 oh maybe it is

21:48 not sure how -?> handles false

21:48 S11001001: I believe it stops on nil only

21:48 gfredericks: man I don't know anything about anything

21:48 pppaul: false is sometimes useful

21:48 abp: oah written nonsense, some->, let-> and cond->

21:48 pppaul: nil means 'missing' a lot

21:48 S11001001: which makes it compatible with maybe-m defined in algo.monads

21:57 AtKaaZ: hey, is there some way to prevent (ns ...) from implicitly doing a (:use clojure.core) ?

21:58 or can I do a :refer-clojure with :except everything?

21:58 I mean :exclude

21:59 ChongLi: you're not going to have a very usable environment if you do that

22:00 AtKaaZ: I'm thinking that I could include only what I need after doing that

22:01 oh wait, I can do (in-ns 'newns) instead of (ns newns) ?

22:02 and then (clojure.core/use 'clojure.core) if I want the old (ns...) behaviour back

22:02 is there something else I would be missing?

22:03 ChongLi: I don't know, I've never tried it

22:04 AtKaaZ: oki

22:04 ChongLi: why do you want to do this?

22:05 AtKaaZ: to avoid some warnings/errors as per reported here: https://groups.google.com/d/msg/clojure/Yht7g3Hi6VI/GxZ2l4jirTcJ

22:06 ChongLi: why not just follow Raynes' advice and do require instead of use

22:06 ?

22:06 it's not really a good habit to pull everything into one namespace

22:07 namespaces are a very good organizational tool

22:07 AtKaaZ: but then I have to qualify it

22:07 ChongLi: you can make a short alias with :as

22:07 AtKaaZ: so if I want to switch to clojure.core behavior i have to search/replace

22:08 yes a one char alias I had in mind like o/

22:08 ChongLi: why do you want to switch behaviour back and forth? just for learning?

22:08 AtKaaZ: thing is, it's easy to forget to qualify it and it will thus use the clojure.core one

22:09 i guess just for the idea of it or something

22:09 ChongLi: generally I don't think it's very common to want to exactly duplicate functions from clojure.core

22:09 AtKaaZ: it's just too easy to fall back to using the "wrong" one that I don't want by forgetting to qualify, assuming I get many overridden eventually

22:10 not sure waht you mean by that

22:10 ChongLi: why not do this:

22:11 (require '[clojure.core :as c])

22:11 AtKaaZ: does that work? trying...

22:11 ChongLi: yes

22:12 bttf: does leiningen 2.0 deal with :hooks differently now?

22:13 ChongLi: I'm not sure

22:13 AtKaaZ: ChongLi, where did you mean that I should put that? not in the (ns...) ?

22:13 ChongLi: if you put it in the ns form

22:13 it has to look like this

22:13 (:require [clojure.core :as c])

22:14 AtKaaZ: true but, what does that do? other than add c/sorted? but also sorted? would work

22:14 ChongLi: right

22:14 but now you can switch between c/ and o/

22:14 easily

22:14 bttf: well .. i've got src/leiningen/js.clj with (ns leiningen.js) ... in my project.clj i've got :hooks [leiningen.js] ... and it's complaining "unable to resolve leiningen.js/activate hook"

22:14 AtKaaZ: true but I'm still getting the warn/errors :/

22:15 bttf: i'm thinking that its trying to access an 'activate' function but it seems thats not the case, after i renamed my js function to activate

22:15 ChongLi: AtKaaZ: that's because you're still doing :use

22:16 bttf: I don't know, I've never written a leiningen hook

22:16 hopefully someone who has will show up :)

22:16 bttf: ok

22:16 Frozenlock: Compojure: Is there something to do to get query string into a route arguments?

22:16 bttf: i'm going to try using lein 1.7 in the meantime

22:17 AtKaaZ: ChongLi: you do have a point, but if I do require and :as I'm still stuck with sorted? and c/sorted? still working; or I don't understand what :use you meant (not the implicit refer 'clojure.core from ns)

22:17 ChongLi: AtKaaZ: I don't see why that's a problem

22:18 it's just not a common use case to blow away the clojure.core namespace

22:18 since you'd then have to bootstrap everything

22:18 AtKaaZ: ChongLi: that's why i have both sorted? from clojure.core and from my ns, which are causing the warning/errors in ccw

22:18 ChongLi: but I think I could just do with in-ns

22:19 ChongLi: there doesn't seem to be a clean way with (ns...)

22:19 If :refer-clojure is not used, a default (refer 'clojure) is used.

22:20 abp: Frozenlock: {q :query-string} or [a b :as {q :query-string}]

22:21 ChongLi: AtKaaZ: I still don't see the problem

22:21 those warnings are there for a good reason

22:21 AtKaaZ: i agree, except currently they are breaking ccw but that will probably be fixed (in a month xD j/k)

22:22 ChongLi: yeah it sounds like a problem with ccw

22:22 I don't use it so I can't say

22:23 AtKaaZ: ChongLi: really thank you for your time on this! I appreciate it. I'll see what I can do with in-ns, it seems to be what I want, even though it's far from clojure idiomatic

22:23 ChongLi: AtKaaZ: if you like you can ns-unmap everything from clojure.core

22:23 but that'll give you a pretty useless environment

22:24 AtKaaZ: how?

22:24 clojurebot: with style and grace

22:24 AtKaaZ: lol

22:26 ChongLi: just use ns-unmap and ns-publics

22:27 AtKaaZ: like: (map #(ns-unmap 'clojure.core (first %)) (ns-publics 'clojure.core))

22:27 ChongLi: ns-publics returns a map

22:27 so you'll want (keys (ns-publics 'clojure.core))

22:28 AtKaaZ: oh I should've specified my own namespace for ns-unmap xD

22:30 ok this: (clojure.core/map #(clojure.core/ns-unmap clojure.core/*ns* %) (clojure.core/keys (clojure.core/ns-publics 'clojure.core)))

22:32 Frozenlock: abp: thanks!

22:38 AtKaaZ: ChongLi: looks like ccw is loading clojure.core after done executing my file, because pasting that in repl works but in file doesn't and the warning is after the return value of the last thing in my file

22:39 abp: Frozenlock: That's because (GET "/" {{:keys [id]} :params :as request} ...) = (GET "/" [id :as request] ...)

22:40 Frozenlock: Yeah, I was expecting the query paramaters to go into the arguments automagically.

22:40 Just found out I needed a middleware for that.

22:42 abp: Frozenlock: what? xxx?a=1&b=2 = (GET "/xxx" [a b] ...)

22:42 Frozenlock: o_O

22:43 daphok

22:43 I tried again and again...

22:43 abp: Frozenlock: https://github.com/weavejester/compojure/wiki/Destructuring-Syntax read point 2 at the top about destructuring

22:43 it merges all the parameters

22:43 into params

22:43 ChongLi: AtKaaZ: yeah I don't know how to get around that

22:43 blame ccw

22:43 AtKaaZ: i'll check with in-ns also

22:43 abp: :params rather

22:48 AtKaaZ: ChongLi: it works ok with in-ns but i lost ccw functionality ie. switching to the loaded namespace or specifically switching to it (Ctrl+Alt+N), oh well, time to stop

23:10 sgarrett: I'm trying to create a server using Ring/Compojure. I have several routes setup. Once I run `lein ring server` it opens a tab in my web browser and the correct response is shown, however when trying to make a call via javascript in the site that I'm building I get an error. Any ideas?

23:11 abp: sgarrett: On which side do you include the js? How do you include the js? How do you return resources from the server?

23:11 *which site

23:11 tmciver: sgarrett: try confirming the request and uri with the browser debugger.

23:12 sgarrett: I'm including the js on my index.html page at localhost:8000/. The responses from the ring server are rendering fine if I do something like localhost:8100/user or localhost:8100/user/id.

23:13 tmciver: With the browser debugger I see the request going out, just no response. :S

23:13 abp: sgarrett: hm :8000 and :8100 look distinct

23:14 sgarrett: Yep. I have the site running via nginx on port 8000 and specifically have the port for ring setup to 8100.

23:14 abp: ok

23:14 sgarett: and you can view the url you request from javascript from the browser?

23:15 sgarrett: I'm using jQuery .ajax() to make the call to the compojure server. Yep, the url is hitting localhost:8100/user

23:16 abp: sgarrett: Probably because that's cross-site scripting.

23:16 warz: yes, cant make ajax calls cross domains

23:16 ports count

23:16 sgarrett: Ah damn.

23:16 Okay.

23:17 I guess I could use compojure to serve my site as well and skip nginx.

23:17 warz: if youre using nginx, its simple enough to put both of those behind the same uplink of whatever the term nginx uses is

23:17 been awhile since ive used nginx

23:17 sgarrett: Okay. I'll see if I can find anything with compojure and nginx.

23:18 warz: upstream, thats it

23:18 well you can crteate multiple upstreams for both of your web services, and create some rules in nginx that if a request matches a route then use upstream A, otherwise use upstream B

23:19 you can also try jsonp

23:19 or cors

23:19 sgarrett: warz: I see. I'd still run the compojure server with `lein ring 8000` then right?

23:20 warz: sgarrett, yea and in your nginx config youd use that as an upstream

23:20 localhost:8000, for example

23:20 sgarrett: warz: Okay cool. I think that will be simple enough.

23:20 Thanks for the help. :)

23:21 warz: its using nginx for what its good at, which is request proxying

23:24 sgarrett: warz: this is what you're talking about right: http://stackoverflow.com/a/5877989/1183294

23:26 warz: yup

23:26 if you see there, he specifies several upstream sources

23:26 and in the locations, he proxies to one of the servers

23:26 based on route

23:27 sgarrett: warz: Yep, which is nice. Didn't think about doing load balancing with it.

23:27 warz: so for yours, you could proxy anything matching /api to your ring server

23:27 yaaa i wouldnt classify it as true load balancing

23:28 but at work we have 2 production systems using that setup

23:28 sgarrett: warz: Gotcha. This will definitely work for now. Thanks again!

23:36 warz: hm, ring-json's wrap-json-response middleware doesnt seem to be working with compojure for me. im most likely doing it wrong.

23:36 it just returns text/plain with no data

Logging service provided by n01se.net