#clojure log - Jan 31 2013

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

0:19 ominen1: I am not perfect. I have said and done a lot of things I am not proud of. I don't love my life but I love my parents too much to leave them. I need to know what you want from me, the last thing I want is to step on anyone's toes. I feel sorry every time I know I have acted without thinking about how others feel. I just say things on my mind. That is why I read a lot so I can see others emotions and be better with people. Because I

0:19 really really love being around people. You make me happy in a way nothing else can give me. Even people who want me bad things I wanna give a second chance to because I know we all have bad sides and that you and me can change. Life feels empty without us loving each other. I know that no matter how much I wanna sit down and talk the chance for that is close to zero. But at least I have said what is on my mind. Even if you are going t

0:19 take away everything from me I have no regrets. My life is not much worth in my eyes. I just wanted to contribute what I am good at before I disappear. All I wanna do is just that not trying to be a rich guy. If you wanna talk to me please do .. it would be off the record, the world needs communication and not people killing people … we need to trust and love eachother no matter how hard it is .. we can go against our DNA filled

0:19 with selffishness and tell mother nature that we won't give up on our soul for short term gains

0:20 sorry for spamming this channel like this. it won't happen again

0:20 TimMc: ominen1: Accidental paste?

0:34 hiredman: win 15

0:35 xumingmingv: a leiningen question, I want to execute some code after `lein repl`, the code is just to use a namespace of my simple library, is it possible?

0:35 *after lein repl is loaded

0:42 technomancy: xumingmingv: you can add :repl-options {:init-ns my.ns} to project.clj

0:42 njdwl: xum... check out the repl-options here https://github.com/technomancy/leiningen/blob/stable/sample.project.clj, does init-ns do what you want?

0:42 jinks

0:45 ~OT -- best practice for emacs w/ periodic need for switching between cl+slime and clojure+nrepl?

0:45 clojurebot: clojurebot has a poetic soul

0:46 njdwl: two copies of my init.el seems kinda ugly

0:46 technomancy: njdwl: part of the point of nrepl is that you don't *need* to switch between a CL-compatible version of slime and a clojure-compatible one

0:55 njdwl: headscratch... so I fire up either lein repl and it fondly shares the port deets, SBCL, not so much... TIA...

1:01 xumingmingv: technomancy: njdwl: thanks, I will take a look at

1:03 technomancy: the namespace I want to use is not in the the current lein project, so I need to add the dependency somewhere? I'd dont want to add in the :dependency slot, since it is just some help functions useful in repl

1:05 njdwl: xum: check out the profiles on the previous link

1:06 tomoj: could there possibly be a reason to manually give a fn "once semantics" ?

1:06 bbloom: tomoj: thunks?

1:07 tomoj: which aren't just delays?

1:17 bbloom: tomoj: delay is a macro and takes a body of statements, you need to instantiate clojure.lang.Delay directly since there is no delay-fn or anything, but that's probably trivial

1:17 tomoj: oh yeah

1:17 bbloom: also, you might want a thunk that has no return value, so deref doesn't really mean anything

1:17 tomoj: it means "do it"?

1:18 bbloom: well yeah, but then you can't differentiate between nil and void, if you need that

1:18 so there are cases to make custom thunk types

1:18 Delay only offers isRealized, no sense of success/failure

1:18 or if you're doing runtime profiling or optimistic evaluation of thunks, you might need extra info like estimated cost, etc

1:19 there are plenty of reasons to implement similar semantics if you want/need them

1:19 tomoj: and so in those cases ^:once will give you better locals clearing, iiuc?

1:19 bbloom: i don't know much about ^:once

1:19 amalloy: delay and lazy-seq both use the :once flag on their function, which as i understand it has the effect that the compiler will make the function's closed-over locals garbage-collectable as soon as they're no longer needed

1:20 rather than waiting until the function itself can be GCed

1:20 bbloom: ah, that makes sense

1:21 in fact, we probably need that in clojurescript (if we don't have it already) for a bunch of IE memory leak issues that are common when you hold onto element references in callback closures

1:21 basically just (set! element-variable nil) at the end

1:22 tomoj: IE what? :(

1:23 bbloom: the older the version of IE, the more memory leaks they have when it comes to js code holding on to element references

1:23 b/c they use COM reference counting, not garbage collection

1:23 and don't do cycle detection

1:24 tomoj: I only have to support IE9 I think

1:24 bbloom: so you see stuff like `var div = ...; ...; div = null; ....` pretty frequently

1:24 probably fine in IE9

1:34 wei_: in crate: is there an idiomatic way to set inline css on a dom element?

1:35 frozenlock: wei_: [:div {:style "font-size: small;"}]?

1:36 wei_: gotcha, I was wondering whether crate had a map => css string function

1:37 frozenlock: yup, same as hiccup

1:38 How come you are not asking this on #clojurescript? :P

1:38 * frozenlock is trying to get people into #clojurescript

1:38 amalloy: i bet counting the number of people in that channel vs this one would give a good guess as to why

1:40 wei_: frozenlock: I wasn't aware of #clojurescript, thanks. will try to promote :)

1:40 frozenlock: Yeah, it's a thing :)

1:46 seangrove: ls

1:46 lazybot: bin etc home lib lost+found media mnt opt root selinux src srv swap usr

1:46 tagrudev: frozenlock, try octopus

1:46 rm ~

1:46 :D

1:46 frozenlock: tagrudev: octopus?

1:47 tagrudev: frozenlock, https://github.com/tchandy/octopus

1:47 wah sorry wrong chan :D

2:05 skybound: got a question about zippers; need to do a sub-tree traversal ("next"?), modify each node and finally return the starting loc (of the updated tree); is counting the steps and applying "prev" really the best option?

2:06 more like: the only option i can conceive

2:14 tomoj: https://github.com/conal/MemoTrie/blob/master/src/Data/MemoTrie.hs#L528-534

2:14 :(

2:16 hiredman: skybound: you can just call next until end returns true

2:16 the you will have walked the entire tree and will be back at the root

2:18 skybound: hiredman: the zipper root? I need the sub-node where the traversal began?

2:21 tagrudev: I need a good start book for clojure can you recommend me one ?

2:21 ChongLi: http://www.clojurebook.com/

2:22 tagrudev: ty

3:00 bbloom: Raynes: you there?

3:00 Raynes: bbloom: No.

3:00 gf3: Awkward

3:01 bbloom: Raynes: ok, just checking. i guess i'll wait for you to come back

3:01 Raynes: bbloom: What do you want from me, Brandon?

3:02 bbloom: Raynes: curious if you through at all about a more declarative version of laser or similar libraries

3:02 Raynes: bbloom: Don't know what you mean.

3:02 bbloom: Raynes: so laser is a combinator library. it produces functional closures that are later executed, right?

3:03 i'm interested in a declarative model for which there is an interpreter or compiler

3:03 Raynes: Yeah, I didn't think about that.

3:03 bbloom: however, i'm interested in styling, not templating

3:04 i want something similar to CSS -- although not necessarily for XML, Hiccup forms, Hickory maps, etc. i'm still thinking about what the data shapes supported should be

3:05 Raynes: So are there benefits of something like this for laser, or...?

3:05 bbloom: but the main thing is that the input document shape is likely to be very similar to the output shape (modulo some stuff like CSS pseudo elements like :before :after etc

3:05 Raynes: it would be a separate library i write, since my documents aren't really XML or HTML

3:06 my primary motivation is that i need composability

3:06 Raynes: Did you just want somebody to tell this to? :P

3:06 bbloom: Raynes: nah, i wanted your thoughts

3:06 since you seem to be opinionated on these sorts of transformation things

3:06 Raynes: I don't think I have any.

3:06 bbloom: heh, ok then

3:06 Raynes: Sounds like you're doing something completely different from what I'm doing.

3:07 bbloom: heh, it's definitely very different

3:07 Raynes: I also probably don't understand what you're wanting very well either.

3:08 bbloom: but enlive, tinsel, laser, etc, are all very XSL/XSLT-like and that stuff is often contrasted against CSS or LaTeX styles, which is what i'm thinking about now

3:08 Raynes: So if you do a proof of concept or something I'd be interested in seeing it.

3:08 bbloom: ok

3:10 the main goals are 1) just data, not functions 2) cascading behavior like CSS 3) extensible

3:12 Raynes: btw, do you ever sleep?

3:12 Raynes: Yes.

3:13 tomoj: extensible means something like you can write a function and plug it in with a namespaced symbol/keyword?

3:13 bbloom: coulda fooled me

3:13 Raynes: It's only 12:13PM in LA. I'm not there quite yet, but meh.

3:13 bbloom: tomoj: yeah, just like css allows vendor prefixes, this would allow namespaced keywords to mean things

3:13 Raynes: Er, AM.

3:15 tomoj: is this for fipp?

3:16 bbloom: tomoj: among other things

3:17 tomoj: fipp was a test bed for several ideas, but i got mega side tracked by making it use the fanciest algorithm available :-)

3:18 right now i'm thinking that the most promising literature on this project is gonna be regarding the scheme-based DSSSL, which seems to have been a CSS competitor back in the day

3:19 tomoj: both of the tutorial links for dsssl are 404s :(

3:20 bbloom: yeah.... it's early web days lol

3:20 easily google-able tho

3:21 what a strange and different world it would have been if scheme and DSSSL beat javascript and css

3:22 i'm on a mission to reinvent the full rich client stack on top of the good ideas in clojure :-)

3:25 tomoj: if you write a binary adder in core.logic, can you do css positioning/sizing constraints?

3:26 or can you do that in core.logic without writing a binary adder? :)

3:27 bbloom: tomoj: i'd prefer to enforce particular complexity bounds on selectors, layouts, etc

3:28 would have to use finite domain constraints to do that and it would just be too complex

3:28 i'd like to ensure that extensions can't willy-nilly add features that would kill your performance

3:28 i'm not sure if that's possible, but i am sure that core.logic would make inefficient selectors, layouts, etc, trivial :-P

3:29 tomoj: hmm

3:30 I don't understand the binary adder, but I'd think (hope?) the main source of inefficiency would be that you are working with a bunch of booleans as logic vars instead of numbers

3:30 so some overhead on whatever math you need

3:30 but why should using core.logic make layout slow otherwise?

3:32 nightfly: Someone mentioned that it does operations on items and not sets

3:35 ejackson: tomoj: you don't need the binary adder, as bbloom say the fd stuff allows arithmetic

3:35 provided you keep to a finite grid

3:35 tomoj: right..

3:35 so grid size, what, 5px?

3:35 1px?

3:36 ejackson: yeah, that would be fine

3:36 tomoj: that does sound slow to me :)

3:36 though I have no clue about the fd stuff

3:36 ejackson: could be 100px if you like

3:36 whatever, all you need to get the fd going is to be using integers, not reals

3:38 tomoj: it doesn't do stupid stuff like (pluso 70 ?x 100) checking 0 through 29 or something?

3:39 ejackson: i have no idea, but i'd wager not

3:43 bbloom: tomoj: we need an immutable web too... sooo many broken links when reading about DSSSL

3:43 tomoj: sweet, I finally tried the arithmetic

3:44 it apparently doesn't cope with negative integers?

3:45 oh, hmm

3:48 bbloom: tomoj: not sure why it wouldn't... although i know a lot of linear algebra solvers use slack variables to avoid negative numbers

3:48 but it seems like a finite domain solver wouldn't need such tricks

3:48 those linear solvers are floating point

3:50 tomoj: (interval Integer/MIN_VALUE Integer/MAX_VALUE) :D

3:50 I must not be exercising it properly, I expect it to blow up but it seems to work

5:05 ominen1: TimMc: it was for this channel to tell the people who have stolen my work and are now acting like i am working with them on my own work so that they can own it later on

5:12 i have always tried to be nice to people .. why are you playing me like this

5:21 bawr: ominen1: What happened?

5:32 ominen1: bawr: to be clear before i start .. i don't know who you are or TimMc or anyone else here except callen (Chris Allen) who i met just once in Mountain View. people have stolen my work and are trying to make it look like i know them and work for or with them through messages. they gather all this "evidence" to use it against me .. i wanted to talk with them what they want from me but no one admits, yet they keep planting more and more

5:32 "evidence" all the time in between the lines .. i wanna make it very clear here and now that i have nothing to do with anyone in the US or anywhere regarding my personal work so they cannot use this so called "evidence" in messages including the ones here in IRC to say that they knew me at all except from the data they have stolen from my computers

5:33 bawr: ominen1: It would probaby help you more if you mentioned the project name. Or your own name, I guess.

5:35 hyPiRion: Huh, thos sounds serious. Though as bawr said, some more information would help.

5:55 ominen1: they stole from me and tried to set me up that i was there for business

5:57 bawr: How do I put it... since you're posting about it here, I'm assuming this is of some relevance to the Clojure community. But most of us have no idea who you are, apparently, so even if "they" make contact with us, we have no way of knowing, based on the scant information you did provide.

5:59 Raynes: ominen1: This sounds like legal stuff that doesn't have anything to do with anyone but the specific person who you're accusing of whatever it is you're accusing. Perhaps you should speak to this person directly or get an attorney or something? I'm not sure how we can help you.

5:59 What you're saying is pretty vague, so I'm not sure how this pertains to Clojure or the community at all.

6:00 bawr: Yeah, what Raynes said. I mean, other than the fact that you posted about it in here, there's no reason to even assume any of it is related to #clojure.

6:01 Raynes: Don't take it the wrong way or anything, it is terrible if someone stole from you, but this has nothing to do with us and this isn't a medium for calling people out.

6:03 bawr: If you want to diassociate yourself from someone in here, that would sort of work, except that we only know your IRC handle.

6:03 Raynes: And we have no idea who the other person is.

6:53 weavejester: https://github.com/http-kit/http-kit

6:54 weavejester: Raynes: ?

6:54 Raynes: weavejester: Another library for the toolbox.

6:54 weavejester: Raynes: Ohh, right :)

7:09 dignati: Hi guys

7:11 Im basically looking for some kind of advanced (map). I want to call a function on every combination of elements from 2 seqs

7:11 Is some sort of thing done yet?

7:11 *this

7:23 clgv: dignati: you can use (for [a seq1 b seq2] (f a b))

7:25 dignati: clgv: But this would apply f on (first seq1) and (first seq2) and then f on (second seq1) and (second seq 2) and so on, right?

7:26 clgv: dignati: no

7:26 ,(for [i (range 3) j (range 3)] [i j])

7:26 clojurebot: ([0 0] [0 1] [0 2] [1 0] [1 1] ...)

7:26 clgv: &(for [i (range 3) j (range 3)] [i j])

7:26 lazybot: ⇒ ([0 0] [0 1] [0 2] [1 0] [1 1] [1 2] [2 0] [2 1] [2 2])

7:26 clgv: &(for [i (range 3) j (range 3) :when (< i j)] [i j])

7:26 lazybot: ⇒ ([0 1] [0 2] [1 2])

7:27 dignati: clgv: Oh then I completely misunderstood that. Thanks!

7:28 clgv: I was planning on mapping map on each element

7:28 clgv: if you need the other behavior map is right. ##(map vector (range 3) (range 3))

7:28 lazybot: ⇒ ([0 0] [1 1] [2 2])

7:30 dignati: clgv: like how the contrib.combinatorics implemented permutations https://github.com/richhickey/clojure-contrib/blob/2ede388a9267d175bfaa7781ee9d57532eb4f20f/src/main/clojure/clojure/contrib/combinatorics.clj#L160

7:30 clgv: I will try both and compare performance

7:31 clgv: dignati: use `for` since it is simple when you know the number of seqs at coding time

7:32 dignati: clgv: Yes, seems more reasonable. Thanks ;)

8:55 TimMc: Raynes: Unless ominen1 is simply horrible at communication, I'm going to guess it's a persecutory delusion. :-/

9:10 ticking: I was wondering, is there a shorter way to split a set into two disjoint subsets by a boolean function than using group-by and a lot of into :D?

9:12 hyPiRion: Hmm

9:12 ,(group-by odd? #{1 2 3 4 5})

9:12 clojurebot: {true [1 3 5], false [2 4]}

9:13 hyPiRion: ,(map set ((juxt filter remove) odd? #{1 2 3 4 5}))

9:13 clojurebot: (#{1 3 5} #{2 4})

9:14 foodoo: ,(map set (vals (group-by odd? #{1 2 3 4 5})))

9:14 clojurebot: (#{1 3 5} #{2 4})

9:15 ticking: hyPiRion: that use of juxt ist pretty cool :D

9:17 clgv: ticking: though not pretty efficient for larger sets since it's parsing the set two times ;)

9:17 ticking: yeah

9:18 I've never seen it in action though :D

9:19 clgv: ,((juxt (comp set filter) (comp set remove)) odd? #{1 2 3 4 5})

9:19 clojurebot: [#{1 3 5} #{2 4}]

9:19 clgv: to put it to its limits ^^

9:19 ticking: hrhr

9:19 yeah

9:20 TimMc: &((apply juxt (map (partial comp set) [filter remove])) odd? #{1 2 3 4 5})

9:20 lazybot: ⇒ [#{1 3 5} #{2 4}]

9:21 clgv: TimMc: that's gotten uglier now ;)

9:22 TimMc: Indeed!

9:22 ticking: use all the functions!

9:22 TimMc: I couldn't figure out how to work fnil or reductions into it.

9:23 hyPiRion: Hmm.

9:24 clgv: ,((apply juxt (map #(comp set %) [filter remove])) odd? #{1 2 3 4 5})

9:24 clojurebot: [#{1 3 5} #{2 4}]

9:24 clgv: less redundancy ;)

9:26 oh lol^^

9:26 humm is having partial in there an avantage or not ;)

9:27 hyPiRion: ,(map #([`#{~%}](+)) ((juxt filter remove) odd? #{1 2 3 4 5}))

9:27 clojurebot: (#{(1 3 5)} #{(2 4)})

9:27 hyPiRion: ,(map #([`#{~@%}](+)) ((juxt filter remove) odd? #{1 2 3 4 5}))

9:27 clojurebot: (#{1 3 5} #{2 4})

9:27 amphtrox: hi, im trying to write a small try-clause macro and im getting some problems, http://pastebin.com/NbApYJeH anyone care to take a look?

9:28 jcromartie: "the true zero of a monoid" … can someone help me learn enough math to keep up with fold and/or reducers

9:29 clgv: amphtrox: you need some `let` there for your bindings

9:29 hyPiRion: ,(let [bit-and &] (map #([`#{~@%}](+)) ((juxt filter remove) #(= (+) (& % (*))) #{1 2 3 4 5}))

9:29 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

9:35 clgv: jcromartie: you probably just need group theory

9:38 amphtrox: clgv could you show how it would look like? im new to this and really unfamiliar with this syntax

9:39 TimMc: The zero of a monoid, like 0 for + and 1 for *?

9:39 clgv: TimMc: usually it should be called neutral element

9:40 hyPiRion: TimMc: and {} for hash-map, #{} for set, etc.

9:40 hash-set, rather.

9:41 jcromartie: so, what *is* a monoid in clojure

9:41 clgv: amphtrox: you want with-open I guess

9:42 jcromartie: the wikipedia page is rather opaque to me

9:42 "… they can be regarded as categories with a single object. Thus, they capture the idea of function composition within a set"

9:43 so a monoid is a set

9:43 and a binary operation

9:45 and such helpful illustrative examples such as "Every bounded semilattice is an idempotent commutative monoid"

9:45 TimMc: That's wikipedia for you.

9:45 math explanations : Wikipedia :: programming : point-free

9:46 jcromartie: I think MathWorld is better for this stuff

9:47 Wikipedia just seems like where mathemeticians go to mathsturbate

9:47 TimMc: ding ding ding

9:47 jcromartie: you can quote me on that

9:47 Oh look, three sentences with all the links you need: http://mathworld.wolfram.com/Monoid.html

9:47 arcatan: wikipedia occasionally has good stuff on math, but usually it won't very helpful if you don't know the math beforehand

9:47 jcromartie: or four

9:49 TimMc: "Mathematically, a Yang–Mills instanton is a self-dual or anti-self-dual connection in a principal bundle over a four-dimensional Riemannian manifold that plays the role of physical space-time in non-abelian gauge theory." <-- the author of that particular line: https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/tumblr_md95uagwKT1qck737.gif

9:50 jcromartie: hah hah hah

9:50 actually laughing here

9:50 TimMc: That used to be the second sentence of [[Instanton]], although they've toned it down since.

9:52 PudgePacket: whoa, that's pretty terrible

9:54 jcromartie: I suppose I need Java 7 to use reducers in Clojure 1.5?

9:56 lpetit: jcromartie: only if you want to leverage the multicore "fold" feature. You can leverage the "no object creation" reduce without Java 7, I think.

9:57 (because fold requires Fork/Join, either the jdk 6 back port, either java 7)

9:57 jcromartie: under Java 6, (require 'clojure.core.reducers) yields a java.lang.ClassNotFoundException: jsr166y.ForkJoinPool

9:57 lpetit: :(

9:58 alexnixon: jcromartie: try adding [org.codehaus.jsr166-mirror/jsr166y "1.7.0"] to your deps

9:59 jcromartie: I was playing with reducers a while back and someone told me to add that. Seemed to make things work.

10:00 jcromartie: alexnixon: that does the trick

10:01 alexnixon: jcromartie: cool, have fun ^_^

10:13 jcromartie: alright well I've had enough mind bending for the morning

10:29 borkdude: I'm giving an OO design course from next week and I'm constantly strugling: is OO not evil? how would I do this in Clojure? Is there any purpose to life?

10:29 so thank you

10:30 ChongLi: OO has some good ideas but it complects them

10:37 lpetit: is twitter dead for you too, or is it just us in France?

10:38 Bronsa: here in Italy too

10:38 ejackson: me too

10:38 in UK

10:38 kognate: twitter ok in the states, but real slow

10:39 lpetit: maybe … maybe th whole Internet is under attack. Now twitter, in a few minutes, IRC …. good bye my friends, good bye, I was glad to have the opportunity to know you al :-)

10:39 kognate: whoops, I just got some kind of broken robot telling me something is technically wrong

10:40 * ejackson waves !

10:44 TimMc: lpetit: Twitter has been dead to me since the beginning.

10:44 Oh, *for* me. nvm

10:44 lpetit: TimMc: just since, says 20 minutes for me

11:06 Anderkent: why is reevaluating (defmulti) a noop? Seems like changing the dispatch function should be possible, but isnt.

11:07 ejackson: Anderkent, yeah, you have ns-unmap the dispatch

11:08 Anderkent: yea, I just found that out, I was more interested in the reason. (defmulti) seems to specifically check if the var is already declared - why?

11:08 ChongLi: it does some hairy things behind the scenes, perhaps?

11:09 Anderkent: I'd think the worst that can happen is all the defmethods point to the old defmulti until you reevaluate them, which is fine for the common case of fixing your dispatch fn and reevaluating the namespace

11:09 amalloy: Anderkent: no, what would happen otherwise is the old defmethods no longer exist until you reevaluate them

11:10 methods don't point to multis; it's the other way around. so if you delete the multimethod, all implementations go with it

11:10 Anderkent: still fine for the most common case, I suppose

11:10 amalloy: most people seem to agree that would be better than quietly making your repl do things that don't make sense, but that's the way it is

11:10 S11001001: Anderkent: that really would hurt in the case of defmethods being in other files

11:11 Anderkent: otoh, making the dispatch fn fixable is as easy as #'

11:12 Anderkent: S11001001: not sure what you mean? I just went with (def my-multi nil) (defmulti my-multi ...) for now

11:13 S11001001: Anderkent: put your dispatch fn in a separate defn

11:13 Anderkent: it already is

11:13 S11001001: Anderkent: then refer to it from your defmulti form by saying #'my-fn instead of my-fn

11:13 Anderkent: now simply updating my-fn's definition will affect the dispatch

11:13 Anderkent: uh, I suppose that works

11:14 S11001001: and, unlike defmulti not being idempotent, doesn't have the side effect of trashing other namespaces that happen to have added methods to the multi.

11:14 tmarsh: I'm trying to reify a webbit websockethandler but it overloads onMessage, how do I add type hints?

11:34 no7hing: @tmarsh in general ^Type argument-name

11:35 tmarsh: @no7hing thanks! I'd forgotten to add the ^void return type

11:35 no7hing: np

11:37 amalloy: you shouldn't need to hint the return type. clojure can infer it from the arguments

11:37 (and the interface)

11:46 ChongLi: http://stopwritingramblingcommitmessages.com/

11:46 ahhh, fantastic!

12:14 hyPiRion: ChongLi: I thought 72 was common for short messages as well. Shows how much I know about idiomatic git use.

12:16 nDuff: What? Someone who wants _fewer_ informative or useful commit logs?

12:16 *aghast*

12:17 ...oh, favoring paragraph formatting; that's fine.

12:20 hyPiRion: nDuff: It's more about being concise, I suppose.

12:20 And not breaking the 80-terminal line.

12:21 clgv: I had in mind 80 instead of 72^^

12:22 technomancy: maslow's hierarchy of formatting

12:22 nDuff: hyPiRion: Concision isn't the primary issue I see when going through revision control logs.

12:22 technomancy: let's get people to stop committing 120-column lines in source before we go after the git messages =)

12:22 nDuff: hyPiRion: (err, a lack of)

12:22 Anderkent: feels kinda inconsistent with the 'store raw data and let the client figure it out' approach used for everything else (see: not tracking moves, not annotating commits with branches etc). Not that I disagree with formatting commits decently

12:22 nDuff: ...an excess of concision is a much bigger concern.

12:23 hyPiRion: technomancy: I think I did that once, and in hindsight I feel terrible for doing it.

12:24 frozenlock: Anderkent: My thoughts exaclty: shouldn't whatever interface you are using to read the logs be able to format them?

12:24 technomancy: frozenlock: once we have AI capable of taking a paragraph and distilling a single coherent summary out of it we can start doing that =)

12:24 hyPiRion: Here we are, in 2012, bound to the limits of the IBM card format designed in 1928.

12:26 clgv: lets dont commit lines at all buts-expressions ;)

12:26 *s-expressions

12:26 frozenlock: technomancy: Sure; I was mainly taking about the scrolling. Just automatically warp the lines.

12:27 wrap even

12:28 TimMc: hyPiRion: I thought it only went back to TTYs.

12:28 ...which were probably designed for an optimal line length for reading.

12:29 technomancy: hyPiRion: could be worse: http://www.naciente.com/essay94.htm

12:29 jasonbray: anyone using core.cache in production?

12:38 frozenlock: I have many vectors ready to be put into a map. However some vectors may have duplicate keys. If it's the case, I would like the resulting map to contain a coll of the values. [[:a 1] [:a 2]] ---> {:a [1 2]}. Is there a premade function for this?

12:39 TimMc: merge-with is close...

12:39 hyPiRion: ,(reduce #(update-in conj %1 %2) {} [[:a 1] [:a 2]])

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

12:40 hyPiRion: ,(reduce #(update-in conj %1 %2) {} [[:a 1] [:a 2]])

12:40 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>

12:40 hyPiRion: oh yeah. Hmm.

12:40 frozenlock: merge-with is really close indeed.

12:41 clgv: &(reduce-kv #(update-in %1 [%2] conj %3) {} [[:a 1] [:a 2]])

12:41 lazybot: ⇒ {1 ([:a 2]), 0 ([:a 1])}

12:41 clgv: ups^^

12:41 &(reduce #(update-in %1 [(first %2)] conj (second %3)) {} [[:a 1] [:a 2]])

12:41 lazybot: clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox8276$eval86428$fn

12:41 clgv: &(reduce #(update-in %1 [(first %2)] conj (second %2)) {} [[:a 1] [:a 2]])

12:41 lazybot: ⇒ {:a (2 1)}

12:42 clgv: &(reduce #(update-in %1 [(first %2)] (fnil conj []) (second %2)) {} [[:a 1] [:a 2]])

12:42 lazybot: ⇒ {:a [1 2]}

12:43 TimMc: &(let [data [[:a 1] [:a 2] [:b 3]]] (->> (for [[k v] data] {k [v]}) (apply merge-with concat)))

12:43 lazybot: ⇒ {:b [3], :a (1 2)}

12:43 hyPiRion: ,(reduce #(apply update-in %1 (take 1 %2) conj (rest %2)) {} [[:a 1] [:a 2]])

12:43 clojurebot: {:a (2 1)}

12:43 hyPiRion: Oh well.

12:43 TimMc: Then a post-processing step to unwrap the singletons?

12:43 frozenlock: Wow thank you very much :)

12:44 TimMc: &(reduce #(update-in %1 [(first %2)] (fnil conj []) (second %2)) {} [[:a 1] [:a 2] [:b 3]])

12:44 lazybot: ⇒ {:b [3], :a [1 2]}

12:47 frozenlock: I just learned about fnil today. Achievement unlocked.

12:49 arrdem: frozenlock: thanks for sharing that's an interesting one.

12:50 jweiss_: is there a lib or blog post about how to represent and work with a graph structure in clojure?

12:50 i saw clojure.contrib.graph has no replacement

12:51 i have signed the CA so i could see if i could get it working but thought there may be something else.

12:54 loganlinn: JDBC question: does the naming strategy only pertain to getting data from the database? as in, it doesn't apply when inserting values? This doesn't seem to work: (sql/with-naming-strategy underscore->dash (sql/insert-record :table {:my-col 123})) and use my_col

12:54 where underscore->dash is something like {:keyword #(.replace % "_" "-")}

12:54 arrdem: jweiss_: check out zippers....

12:54 closest thing I know of but it's really aimed at directed trees

12:54 jweiss_: arrdem: i've used zippers but only for trees.

12:55 graphs wouldn't work would it? nodes can have more than one 'parent'

12:55 arrdem: yeah...

12:56 (up) wouldn't work with multiple parents

13:07 SegFaultAX: loganlinn: You want to replace all underscores with dashes, but your table doesn't have any underscores in its name?

13:08 Or your column in this case.

13:09 loganlinn: And furthermore, I think it should be something like #(.replace (name %) "_" "-")

13:09 amalloy: TimMc, frozenlock: ##(apply merge-with into (for [[k v] [[:a 1] [:a 2] [:b 3]]] {k [v]}))

13:09 lazybot: ⇒ {:b [3], :a [1 2]}

13:11 TimMc: into, much better

13:11 loganlinn: SegFaultAX: my column has underscores, but the maps i'd like to pass to insert-record(s) have dashes

13:11 SegFaultAX: loganlinn: Then shouldn't you be replacing dashes with underscores?

13:11 hyPiRion: I was under the impression that the result should've been {:b 3, :a [1 2]}.

13:11 oh well.

13:12 SegFaultAX: &(#(.replace (name %) "-" "_") :my-awesome-keyword)

13:12 lazybot: ⇒ "my_awesome_keyword"

13:12 amalloy: hyPiRion: that seems to have been what he asked for, but that's such a useless result i'm not going to help :P

13:12 i'll instead pretend he wanted something good instead of bad

13:13 loganlinn: SegFaultAX: hmm, true. i was using the same strategy for selecting values (underscores->dashes), let met try a reverse naming strategy

13:19 SegFaultAX: loganlinn: Well that might make sense for columns coming OUT of the database when it's trying to convert them to keywords. But going the other direction you have to use the opposite strategy I'd assume.

13:20 frozenlock: amalloy: If you have an insight on how to do this in a way that isn't 'bad', be my guest https://www.refheap.com/paste/9133

13:21 amalloy: what you've pasted is not bad: you get out a map of keys to lists of values

13:21 i was objecting to the notion that, if the list of values has only one item, you might want it to not be a list

13:22 frozenlock: That's the case, I would still prefer that: it would reflect the initial query

13:25 loganlinn: SegFaultAX: looks like naming strategies just aren't used on inserts.

13:25 the source seems to imply this too

13:26 SegFaultAX: loganlinn: Lame. Sorry about that.

13:36 jweiss_: i'm going to take a shot at updating clojure.contrib.graph. it seems to work fine as-is but it uses structs (just 2 fields, :nodes and :neighbors). i guess i should make it a record instead? or not bother and just use maps or even a 2-item vector?

13:41 seangrove: I don't understand how this can be a good idea: Backbone.on('got_weather', function...)

13:41 If you're going to assign a callback/listener, it has to have a handle/name/something to list and retrieve it by

13:41 Otherwise you've assigned it, and it's gone

13:42 And even *if* your framework/library has kept track of which listeners (possibly anon functions) are on which events, it's not at all immediately obviously *why* they're there

13:43 TimMc: frozenlock: Oh, this is for URLs?

13:43 frozenlock: It is.

13:44 TimMc: THen you'll want vectors, not a mix of vectors and strings.

13:44 Provide two accessors: get-last, and get-all

13:45 Otherwise the data types are controlled by user input, leading to surprise bugs.

13:49 frozenlock: TimMc: You mean like giving an undefined symbol?

13:49 Ember-: hmm, having a problem with lein-ring, it's not updating sources on fly

13:49 known issue?

13:49 or should I know something

13:50 frozenlock: For example "?b=hello" instead of "?b=\"hello\""?

13:50 Ember-: I've set :auto-reload? to true

13:50 frozenlock: (decoded for clarity)

13:57 Ember-: this sucks, makes my development process slow

13:57 :(

13:57 btw, I noticed that the reload does work but inconsistently

13:57 TimMc: frozenlock: As in, you ask for the value of foo, and you call .indexOf on it, but someone has passed in ?foo=bar&foo=baz so you get a runtime exception.

13:57 Except it could be a much worse error.

13:57 Ember-: got to check if I find the reason

13:59 for some reason if I edit the source file where I've defined the ring handler it updates perfectly

13:59 technomancy: Ember-: I recommend starting jetty from a repl session

13:59 Ember-: but if I edit any other file it doesn't work like it should

14:01 technomancy: doesn't help

14:01 same issue

14:01 amalloy: also don't forget the danger of calling read-string on arbitrary user input, due to undocumented but intentional security holes

14:02 Ember-: or actually it works even worse

14:02 hmph

14:03 frozenlock: :(

14:03 Ember-: decided to build my new app with lib-noir + compojure but so far this experience is really bad :(

14:03 compared to noirs "it just works" considering auto update of sources

14:04 amalloy: maybe we should start describing *read-eval* as a backdoor rhickey left for himself in every clojure app

14:04 so he can fix your bugs for you

14:09 frozenlock: Eh.. and I thought that getting a hold of the URL query would be a 15 min job... -_-

14:09 Wouldn't a safe-read fn also work in cljs? https://www.refheap.com/paste/9134

14:11 Ember-: oohkay, so if I delete the route mapping from my handler, refresh the browser, edit the file behind the route mapping and then reapply the mapping then the changes come visible

14:11 not exactly the way I want to work

14:12 and when launching server from REPL nothing get updated, not even after forcing file reload into REPL

14:12 get+s

14:13 I'm like this close abandoning lib-noir+compojure

14:15 amalloy: Ember-: so use ring's wrap-reload middleware

14:15 i don't know what lein-ring does, but apparently it's not working for you; wrap-reload should

14:15 Ember-: amalloy: tried that too

14:15 no go

14:17 only thing that triggers reload is editing the handler file

14:19 like, I edit another file, refresh and nothing changes

14:19 then I *remove* wrap-reload from handler and refresh, now the changes appear

14:19 after that, I edit the other file again and refresh, nothing

14:20 reapply the wrap-reload, *poof* changes appear

14:20 apparently only the handler file changes are detected and applied

14:23 amalloy: are you telling wrap-reload what namespace to reload? it probably default to just the current namespace

14:23 epitron: Ember-: what OS are you using?

14:24 Ember-: epitron: win 7

14:25 epitron: ah

14:25 (i don't have an answer, i'm just curious if that might be related to file notification stuff)

14:25 Ember-: and noir's auto reload works like charm

14:25 technomancy: Ember-: if you launch jetty from a repl that's connected to your editor you can easily pick up recompiles

14:25 epitron: making file notifications cross-platform is always tricky

14:25 Ember-: technomancy: like I said, I've tried that

14:25 this is related to compojure

14:26 amalloy: epitron: most reload middleware just blindly reloads, not relying on tricky notifications

14:26 Ember-: even in REPL changes don't get registered

14:26 technomancy: Ember-: oh, because you're not going through a var?

14:26 epitron: amalloy: nice simple solution :)

14:26 technomancy: Ember-: (run-jetty #'app {...})

14:26 vs (run-jetty app {...})

14:26 Ember-: that I am not doing, will try

14:26 epitron: Ember-: is your editor changing the timestamp on the file when you save it?

14:26 oh snap

14:26 technomancy: yeah, if you pass a bare function to a handler like that then the handler holds on to it and can't tell when the var has changed

14:27 epitron: tehcnomancy got it

14:27 Ember-: no, didn't work

14:27 epitron: oh snap he didn't

14:28 Ember-: (defn start-server [] (run-jetty #'my-handler {:port 8080 :join? false}))

14:28 and

14:28 * technomancy remains skeptical

14:28 * nDuff <- also skeptical

14:28 epitron: is it time to take remote control of Ember-'s desktop and figure out what he's doing wrong? :)

14:28 nDuff: (actively using code much like what Ember- is describing here)

14:28 Ember-: (def my-handler (-> (handler/site root-view/views (resources "") (not-found (not-found-page)))

14:29 TimMc: Ember-: Just put a read-string in your code and epitron will be in shortly. :-P

14:29 Ember-: stuff gets updated when I update something in that file

14:29 but if I edit anything in root-view/views it doesn't

14:29 in there:

14:30 (defroutes views (GET "/" [] "<h1>woot</h1>"))

14:30 seangrove: Damnit

14:30 Ember-: that's pretty much everything I have

14:30 seangrove: Compiling cljs in debug mode and suddenly: "Uncaught Error: Namespace "goog.string" already declared. "

14:30 Ember-: in project.clj:

14:31 seangrove: Ah nevermind, chrome is pulling it from a cache or something

14:31 Ember-: :ring {:handler myns/my-handler :open-browser? false :auto-reload? true}

14:32 ah, screw it. I'm going back to noir

14:34 or not

14:34 lol

14:34 found it

14:34 what technomancy said

14:34 except I also (of course...) had to pass the route mappings as vars too

14:34 bah

14:34 I feel so stupid now

14:44 amalloy: that's what computers are for, Ember-

14:44 it would be a tragedy if we had to make ourselves feel stupid

14:46 TimMc: The automation of obnoxiousness.

14:51 frozenlock: Is there a thing to make ourselves feel smart?

14:52 mattmoss: Beer.

14:52 technomancy: I recommend anyone who maintains a Leiningen template for an application (not libraries) should add something like this until *read-eval* is fixed upstream: https://github.com/technomancy/leiningen/commit/3aec2e4de9

14:53 ^ yogthos|away

14:53 frozenlock: technomancy: I was sure *read-eval* was defaulted to false for a while now.

14:53 Seems I dreamed that.

14:54 TimMc: Hopefully it's a premonition.

14:54 technomancy: frozenlock: it's a dream I share

14:54 frozenlock: for 1.5?

14:54 technomancy: we can hope, but it seems unlikely

14:54 TimMc: D-:

14:54 technomancy: http://dev.clojure.org/jira/browse/CLJ-1153 <- vote here, not that it will make a difference

14:56 frozenlock: Is .core really that hard to contribute too?

14:57 s/too/to

14:57 technomancy: yes

14:58 TimMc: Tom voted for it!

14:59 Maybe he will pressure his brother.

14:59 technomancy: family ties are the strongest

14:59 loganlinn: what's an idiomatic way to check if a regex matches anything?

14:59 TimMc: re-match I think?

15:00 loganlinn: there's re-matcher and re-matches

15:00 hiredman: re-find

15:00 ChongLi: and re-find

15:00 dakrone: re-find

15:00 ChongLi: yeah

15:00 loganlinn: ok

15:00 thx

15:01 pjstadig: isn't the point with reader literals to basically run arbitrary code at read time?

15:01 TimMc: &(apropos #"^re-")

15:01 lazybot: ⇒ (re-attr re-id re-class re-pattern re-matches re-matcher re-groups re-find re-seq re-groups*)

15:01 technomancy: pjstadig: sure, where "arbitrary" is defined by data_readers.clj

15:01 TimMc: pjstadig: Not user-supplied.

15:01 ChongLi: re-matches is more strict than re-find

15:02 re-matches tries to match the whole string

15:09 loganlinn: ChongLi: good point… re-matches is actually what I needed

15:10 dabd: Double/parseDouble is not a function. How can I make it a function so I can map it? Is there a shorter way then #(Double/parseDouble %) ?

15:10 TimMc: Nope, sorry.

15:13 I believe the compiler needs to know (statically) what the arity is for any Java method call.

15:26 michaelr525: hello

15:30 S11001001: dabd: also Double/valueOf might be more efficient

15:30 amalloy: S11001001: s/more/less?

15:30 S11001001: amalloy: more, or less, depending on who's calling #(Double/?? %)

15:32 amalloy: i doube if #(Double/valueOf %) will ever be faster than #(Double/parseDouble %)

15:33 i mean, you can save one method-call by going direct to valueOf. but if you forget to typehint (as here), then you suddenly get hundreds of times slower because the compiler has to do reflection to decide which overload to call

15:33 S11001001: depends on who's better at boxing doubles

15:34 amalloy: that's an interesting point. boxing overhead will be dominated by parsing and reflection work, but i hadn't thought of that as a possible slowdown

15:36 S11001001: definitely reflection would kill it

15:36 but without that...

15:37 amalloy: *nod* reflection is the only reason, but it's a big one

15:37 and now you've made me curious what kind of boxing the compiler emits for #(Double/parseDouble %). gonna go find that out

15:39 S11001001: it's less serious than it could be. I mainly thought of it because in SBCL, if you start hinting for unboxed full-word (no type marker) ints: by cutting through unbox/box barriers (like unoptimized mapcar), you can make your performance much worse than just leaving things in boxed representation, so you end up needing all this compiler information about where the box/unbox barriers are.

15:39 so as to diagnose things

15:41 I would bet this is a problem with unboxed fns in Clojure too. I've never gone beyond algorithmic improvements for clojure performance, though, so couldn't say from experience

15:42 amalloy: S11001001: yes, it is a problem you can have in clojure too

15:42 boxing and unboxing all the time, instead of just staying boxed, is what i think you're referring to, anyway, and that's a problem

15:42 S11001001: yeah

15:43 amalloy: anyway, it turns out that the bytecode emitted for #(Double/parseDouble %) just wraps a Double/valueOf around it, which should be the same boxing that javac would do

15:43 ie, as efficient as possible

15:43 S11001001: heh

15:44 ,(-> #(Double/parseDouble %) class superclasses)

15:44 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: superclasses in this context, compiling:(NO_SOURCE_PATH:0)>

15:44 S11001001: ,(-> #(Double/parseDouble %) class supers)

15:44 clojurebot: #{java.lang.Runnable clojure.lang.IFn java.io.Serializable java.util.concurrent.Callable java.util.Comparator ...}

15:44 S11001001: ,(->> #(Double/parseDouble %) class supers (drop 5))

15:44 clojurebot: (clojure.lang.IObj clojure.lang.AFunction clojure.lang.IMeta clojure.lang.Fn clojure.lang.AFn ...)

15:44 S11001001: ,(->> #(Double/parseDouble %) class supers (drop 10))

15:44 clojurebot: (java.lang.Object)

15:44 S11001001: Hm.

15:44 amalloy: you won't find clojure.lang.IFn.DO there, or whatever primitive interface

15:45 S11001001: amalloy: Yeah, that's what I was looking for. Why not?

15:46 amalloy: no fundamental reason, i suppose

15:46 at the moment, even if it were done it wouldn't help, because the compiler only emits .invokePrim methods on calls through vars, not lambdas

15:47 S11001001: Does it unconditionally choose the invokePrim path?

15:47 if it chooses it at all

15:47 amalloy: if it has locals of the right types, yes (as far as i know)

15:48 S11001001: Interesting; then it probably has enough information to warn about boxing.

15:49 amalloy: or, are you asking what happens when you have like (let [x (Double. 10)] (foo x)) where foo implements IFn.DO?

15:49 ie, does it prefer to unbox x and invokePrim, or leave it boxed and use IFn? i don't know the answer to that

15:50 S11001001: rather, (let [x 10] (foo x)) where foo implements IFn.(whatever takes Long)

15:50 amalloy: in that case it definitely uses invokePrim

15:50 S11001001: maybe not that, but rather (let [^Long x 10] (foo x)) because doing it for inferred cases could get annoying fast

15:51 warning about boxing, that is

16:11 amalloy: $mail S11001001 it looks like the compiler unconditionally chooses the .invokePrim route if the function has a primitive arglist of the right length, and shoehorns the locals into fitting that however possible

16:11 lazybot: Message saved.

16:14 jweiss_: i updated clojure.contrib.graph to drop structs in favor of records, called it clojure.graph, tests pass, what do i do to make this a real replacement component for clojure.contrib.graph

16:16 deg: (Perhaps more a leiningen/maven question, but...) I have several linked Clojure projects, with one acting as a library to the others. For the sake of my users, I've deployed the library. How do I set up the dependencies so that I can work on the real source while other users (and me, when testing) have it in the maven cache?

16:19 ohpauleez: jweiss_: Do you have a signed CA?

16:19 jweiss_: ohpauleez: yeah i signed it a while back, that's all taken care of

16:20 hyPiRion: jweiss_: Ask on the clojure-dev list.

16:20 ohpauleez: jweiss_: Make the proposal on the clojure-dev mailing list for the migration

16:20 then we'll all say, "sounds good, let's adjust the namespace"

16:20 then you stuart sierra will setup some build stuff for you and you can setup the repo

16:21 jcrossley3: Are you making it to Clojure/West?

16:21 jweiss_: cool. i'm kind of surprised, no one else is using graphs?

16:21 jcrossley3: ohpauleez: yeppers

16:21 ohpauleez: excellent!

16:22 amalloy: well, everyone is using a graph at some level (hooray garbage collection!). but app-level stuff that needs graph-theory algorithms applied to it isn't that common

16:22 and most of it isn't that hard to roll by hand, so nobody's been interested in resurrecting contrib.graph

16:23 (btw, i recommend clojure.algo.graph at the name)

16:23 jweiss_: i'm writing a test harness, want to arrange tests by dependency. i'm using trees now but that isn't right, because a test can depend on more than one other test.

16:25 seems like anything that needs to calculate dependencies (not as part of compilation but data dependencies), would need graphs.

16:28 TimMc: $latest jkkramer/loom

16:28 lazybot: [jkkramer/loom "0.2.0"] -- https://clojars.org/jkkramer/loom

16:28 TimMc: jweiss_: ^ check this out as well

16:29 jweiss_: TimMc: i did, but the very first sentence on the readme is "Caveat coder: this lib is alpha-stage."

16:30 so it didn't seem like a good thing to build on top of

16:30 amalloy: every clojure lib is secretly in alpha-stage, because everyone refuses to release 1.0 of anything

16:30 jkkramer is just willing to admit it

16:30 technomancy: secretly?

16:31 amalloy: mmm, perhaps secretly is the wrong word

16:33 implicitly?

16:34 Raynes: amalloy: Hey, I plan to do a 1.0.0 of laser as soon as I've got refheap running on it.

16:34 :>

16:34 hiredman: it is a a grand game of chicken

16:34 Raynes: I'm being a good boy.

16:36 ohpauleez: jweiss_: You might want to subsume loom as a move into contrib

16:37 jweiss_: ohpauleez: good point.

16:37 technomancy: jweiss_: have you thought about the pros and cons of a contrib lib?

16:37 jweiss_: technomancy: to be honest, no :)

16:38 technomancy: jweiss_: something you should consider before signing up as maintainer

16:38 just because something was part of monolithic contrib doesn't mean it has to become a new-style contrib to continue its existence

16:39 jweiss_: true, but that seems like an admission that the old contrib was too big. which may be true, i had just assumed that if it was good enough once, it would be again.

16:40 maybe it's better to see if there are other libs that end up coming out ahead before settling on one to go to contrib

16:40 technomancy: jweiss_: it's not a question of "good enough"

16:41 contrib libraries are not "better" in any way than libraries that aren't in contrib

16:41 just more hassle to maintain and contribute to

16:41 jweiss_: i didn't mean good enough as in code quality. i meant, "enough people need a graph lib that it's worth going into contrib"

16:41 technomancy: (you have to use maven, hudson, and jira, and are not allowed to accept pull requests or patches from people whose paperwork you haven't verified, etc)

16:41 clojurebot: max people is 317

16:42 jweiss_: i'm perfectly happy to not bother with contrib. i guess the "what happened to the contrib lib" page makes it look like a to-do list

16:43 but i guess that is not really the case.

16:43 amalloy: jweiss_: people need a lot of web servers and html templaters, but none of them are in contrib. users have no trouble finding ring and compojure

16:44 jweiss_: true day

16:44 dat

16:44 technomancy: it's your call; I'd just caution you to think about the tradeoffs rather than assuming it's a net gain.

16:45 jcromartie: https://gist.github.com/4686797

16:45 jweiss_: technomancy: sure, i appreciate the warning :)

16:47 TimMc: jweiss_: Perhaps you could make it non-contrib but still add a note to the contribs page. :-P

16:48 jweiss_: ok

16:48 TimMc: amalloy: I'm proud to say that I recently went through all my releases and bumped everything to 1.0 where appropriate.

16:48 jweiss_: all i know at this point is i need to make graphs and traverse them and that i want to reuse someone else's code if i can :)

16:48 amalloy: (inc TimMc)

16:48 lazybot: ⇒ 32

16:49 frozenlock: (identity Frozenlock)

16:50 technomancy: wow, the issue for changing read-eval to false has the highest number of votes of any in jira after 1 day

16:50 TimMc: ALl that's left to do is get signing set up, but that's blocked by lein not having a key selection mechanism.

16:50 si14: jweiss_: not sure if graph contrib is easy or even doable.

16:50 technomancy: and TimMc's patch to document said is #5

16:50 * technomancy glances around nervously

16:51 TimMc: Why nervous?

16:51 technomancy: vague feeling like I might get sucked into doing something =)

16:52 si14: jweiss_: the thing is that its not easier than that matrix contrib. It's possible to represent graph in different ways and every one is better in some task.

16:53 jweiss_: si14: yeah maybe but that is also true of trees. yet zippers are official.

16:53 amalloy: yeah, technomancy, i was also impressed by the support for changing read-eval. even cynical old men like you and i can hope something might happen

16:53 Raynes: It's about time.

16:54 technomancy: amalloy: I'm just wondering given StuH's "Clojure 1.5.0-RC4 wants to become 1.5.0" post

16:55 si14: jweiss_: a list of edges? Matrix of edges? Matrix of nodes? Facts like in core.logic? A lazy infinite structure?

16:55 amalloy: well, every RC wants to be the final release. that's the point

16:55 si14: jweiss_: there are way less options with trees.

16:55 Raynes: Poor abandoned RCs.

16:55 jweiss_: si14: that is true

16:55 technomancy: amalloy: for only 2 jira votes a day, this poor release candidate could be made a healthy and happy final release. donate today. </puppydog-eyes>

16:56 jweiss_: i suppose i am thinking of a DAG but that is not the general case of a graph

16:56 * jweiss_ only needs DAGs

16:56 amalloy: you could call it algo.stuff.jweiss.needs

16:56 then there's room for all kinds of stuff

16:56 dnolen: a fun FD core.logic snippet

16:56 http://gist.github.com/4686830

16:57 every list of size M of natural numbers that adds up to N

16:57 si14: jweiss_: so I think it's a good idea, but it should be widely discussed with some grandmasters. It's easy to end up with Haskell-like stuff -- a ton of libs

16:57 hiredman: disabling read-eval by default may require a change in the compiler, since the compiler sometimes embeds objects in code by calling RT.printString, then RT.readString

16:57 the compiler have to emit byte code to binding *read-eval* to true, which is not a huge deal breaker

16:58 jweiss_: si14: i think i've already been dissuaded from making it a contrib lib

16:58 si14: jweiss_I'm persuading you to push this theme further in maillist

16:58 :)

17:03 dnolen: this all seem so easy when reading code, and so non obvious writing :)

17:04 TimMc: jweiss_: One thing I don't know is whether a non-contrib lib can be made into a contrib.

17:04 dnolen: sil4: heh yes - core.logic learning curve is a bit steep. But it has a dramatic fall off once it clicks.

17:05 hiredman: it constant gardening, the care and feeding of search trees

17:05 it is

17:06 jweiss_: TimMc: what do you mean? all the contributors have to have signed the ca before they write code?

17:06 amalloy: TimMc: yes, but you have to find everyone who's ever contributed to it and convince them to sign the CA and agree to it becoming a contrib. if anyone says no, forget it

17:06 jweiss_: amalloy: yeah that's what i would expect - just that all the contributors have to agree.

17:06 amalloy: i think the main reason it didn't happen for ring or compojure is that some people couldn't be tracked down

17:07 technomancy: data point: I was able to change the license for swank-clojure by contacting all the contributors (~60) and getting their approval.

17:07 si14: dnolen: yeah. I hope it will be easier after the reasoned schemer

17:07 amalloy: i remember signing such an agreement for something, but i can't really remember what project it was

17:08 technomancy: though I didn't bother following up with people who contributed patches too small to be copyrightable for obvious reasons. this may or may not be acceptable for contribs.

17:08 dnolen: si14: it'll be a little bit easier and a Prolog book won't hurt either, especially 4th ed of Bratko.

17:08 si14: dnolen: wrote it down, thanks.

17:09 amalloy: might have been core.logic or core.match actually? dnolen, did you have to ask past contributors for agreement when turning those projects into contribs?

17:09 dnolen: amalloy: core.match I think

17:10 amalloy: yeah, looks like i have one commit on core.match and none on core.logic

17:10 Raynes: I considered making clojail a contrib lib once.

17:10 But then I stopped doing drugs.

17:11 (I've never done drugs, that was a joke. Not a very good one since I have to point it out, but a joke nonetheless)

17:11 TimMc: </humor>

17:11 amalloy: nominating you for lamest #clojure joke of 2013, Raynes

17:11 i know it's early, but you should be a strong contender

17:11 Raynes: I'll accept your nomination.

17:12 TimMc: That was a joke, right?

17:12 Raynes: We're having awards this year.

17:12 I nominate TimMc for the most out of the loop person in the Clojure community.

17:12 si14: Raynes: btw

17:13 Raynes: argh, Android keyboard. Do you now that build of clojail is broken?

17:13 *know

17:14 Raynes: What build? We're using the latest version of clojail in 3 different projects.

17:15 technomancy: travis?

17:16 Raynes: Oh.

17:16 Oh yeah, that's supposed to be broken.

17:16 Those are speed tests that amalloy added that we haven't worked out yet.

17:16 si14: Yeah, Travis :)

17:16 Raynes: Well, it isn't *supposed* to be broken. But it is a known-to-be-broken test for now.

17:17 si14: Ah, OK. It's nice that you've mentioned it, I will likely need clojail in a month or two :)

17:18 Raynes: Yeah, it isn't a big deal.

17:18 si14: Nice stuff, btw.

17:18 Your drugs was nice too, it seems.

17:19 ivaraasen: drugs? where?

17:21 si14: Is it a good idea to teach students with Clojure as a first language? I'm really not sure, but somehow I like this.

17:22 *it

17:22 nDuff: si14: Not sure. There are some other LISP-family languages that have more comprehensive student-oriented tools and curriculum around them.

17:23 si14: nDuff: you mean Racket?

17:23 nDuff: si14: ...on the other hand, Clojure is more likely to be usable once they get out into the Real World

17:23 si14: ...Racket, DrScheme, &c.

17:23 technomancy: I would be hesitant to teach Clojure as a first language

17:23 amalloy: probably not. clojure has a lot of complexities introduced by needing to deal with the real world

17:24 si14: The thing is "empowerment". What you can do with this. Clojure clearly wins here, especially combined with cljs. The third obvious option is Python, but I dislike it.

17:25 amalloy: scheme was built with the idea of being a teaching language as a real goal, although perhaps not paramount

17:25 si14: It's full of design fail.

17:25 (Python I mean)

17:25 nDuff: si14: That's quite relative.

17:25 TimMc: Once you know Racket, learning the JVM complexities is probably not hard.

17:26 si14: nDuff: yeah, you can't beat php, but nevertheless

17:26 Or js

17:26 Not sure which is worse

17:26 TimMc: The thing is, PHP is *optional*.

17:27 technomancy: I will probably start with Racket once my kids are a few years older.

17:27 TimMc: I guess JS is slowly becoming viable as purely a compilation target, but at this point you still need to know all the complexities.

17:27 si14: technomancy: Kids are sophomores :)

17:28 TimMc: technomancy: How old are they?

17:28 technomancy: TimMc: 3 and 5

17:28 the 5 year old has a lot of fun with Scratch, but he still needs a fair bit of guidance

17:29 TimMc: The trick is to make a Scheme small enough that a kid could choke on it. Then they'll be all over it.

17:29 technomancy: heh

17:29 mybuddymichael: Hah, true.

17:29 si14: technomancy: the problem is that they was taught CPP, and it's really the worst option as a first language. No one really became a programmer, all of them think programming is shit.

17:30 technomancy: ah, sorry, I've missed the word "my" :)

17:30 technomancy: si14: I gave up on programming for 4 years at age 14 due to C++

17:30 si14: technomancy: what was your next language?

17:31 technomancy: I did a couple years of C++ in university followed by perl/php briefly, then ruby for ~4 years

17:32 TimMc: My first language was TI-89 (graphic calculator) Basic. I wrote a Mandelbrot fractal generator and Minesweeper, then discovered Java and thought it was the best thing ever.

17:32 This was all in high school.

17:32 tomoj: I never remembered to count the TI languages

17:33 mybuddymichael: technomancy: How did you get into Clojure?

17:33 TimMc: My mandelbrot took like 5 hours to render.

17:33 technomancy: mybuddymichael: I lost my job =)

17:33 mybuddymichael: The best reason.

17:33 technomancy: got a month of severance pay, spent it writing https://peepcode.com/products/functional-programming-with-clojure

17:34 tomoj: that's how I got into clojure!

17:34 thanks btw :)

17:34 technomancy: sweet =D

17:34 amalloy: TimMc: TI-83 for life

17:34 technomancy: but I was interested in it mostly due to elisp, which I enjoyed a lot more than ruby

17:34 tomoj: it also meant I stopped buying peepcodes..

17:34 mybuddymichael: "In this 65 minute tutorial, *Clojure expert* Phil Hagelberg..."

17:34 (Emphasis added.)

17:34 si14: So the choice is between Python and Racket.

17:35 amalloy: i made some stuff with the 89 after that. it seemed to be obviously a better language, but the flexibility made it harder for me to do simple stuff

17:35 mybuddymichael: technomancy: Was "expert" true at the time?

17:35 technomancy: mybuddymichael: well I'd been learning it for about 4 months at the time

17:35 si14: technomancy: lol

17:35 mybuddymichael: Hah, close enough.

17:35 technomancy: mybuddymichael: considering it was only a little over a year old when I started... you make the call =)

17:35 amalloy: at the time, yeah

17:35 TimMc: amalloy: The 89 has symbolic manipulation -- you can take expressions apart into parse trees.

17:36 I wrote a symbolic differentiator for a pre-calc algebra class.

17:36 ivaraasen: got lots of signal processing stuff next year. I wonder if I'll be able to use Clojure for this. no language mandated for some of the courses.

17:36 edw: I'm running an app on Heroku, and e.g. (def foo (System/getenv "FOO")) is being evaluated at compile time, which is a Bad Thing. Anyone have a suggestion on how to avoid this while also avoiding having to using the `binding' form?

17:36 TimMc: -algebra

17:36 amalloy: TimMc: the 89 already has a symbolic differentiator though

17:36 TimMc: Yeah, and the teacher wouldn't let me use it. :-P

17:36 So I wrote my own, and she let me use that.

17:37 technomancy: edw: have you seen weavejester's environ?

17:37 highly recommended

17:37 TimMc: edw: alter-var-root in main, perhaps?

17:37 Raynes: Ugh.

17:37 amalloy: *smile* i did that with...polynomial long division

17:37 edw: amalloy: The symbolic differentiator in SICP 1 ed blew my mind when I encountered it.

17:37 Raynes: edw: Make it a function or something.

17:37 And then slap TimMc with it.

17:37 amalloy: a "show your work" button. i blame that program for my complete lack of understanding about how to do polynomial long division now

17:38 edw: I'll check out environ.

17:38 TimMc: pfft

17:38 edw: Also considered the make-it-an-fn idea, Raynes. Trying to minimize the changes to the app.

17:39 Raynes: technomancy: I don't care for environ's keyword mutilating.

17:39 amalloy: edw: yes, make it a function, or a delay

17:39 Raynes: I'd rather do (env "AWS_ACCESS_KEY") or (env :AWS_ACCESS_KEY) at the very least.

17:39 amalloy: (def port (delay (System/getenv "PORT")) ...(start-server @port)

17:40 tomoj: or just put System/getenv in your heroku carica config.clj?

17:40 Raynes: I don't like it changing my keywords to something entirely different under the hood just to make the input more Clojurey.

17:40 ivaraasen: started doing some basic geophysics the other day using Graph and a homegrown Flop library. soooo nice.

17:41 * Raynes forks

17:41 tomoj: "Graph" - that's the name of a library?

17:41 ivaraasen: tomoj: nah, it's prismatic.plumbing if I recall correctly

17:41 si14: ivaraasen: Is it fast enough?

17:42 ivaraasen: si14: anything is fast enough for stuff like RQD etc. of course, if you want to be fancy, you could implement a neural network for joint detection, but we've got geologists for stuff like that

17:43 si14: ivaraasen: RQD?

17:44 ivaraasen: si14: rock quality designation. it's part of the RMR (rock mass rating system)

17:45 tomoj: oh, that reminds me of qplan

17:45 ravster: hello everyone

17:46 si14: In the light of some previous msgs, I suppose it's an appropriate place to ask about how to get published in some decent peer-reviewed journal, if I have like 2 years (which is good), no mentor (which is bad) and if I'm a bachelor :)

17:46 ivaraasen: I figure the array macros will come in handy once I start doing more signal processing or machine learning.

17:46 tomoj: and theano

17:47 si14: ivaraasen: nice, thanks. Always interesting to get a glance at someone's work far from known fields.

17:47 tomoj: oh nice fn-> and fn->>

17:48 ivaraasen: si14: yeah, I'm still doing very simple stuff as I'm an undergraduate. what's your field?

17:51 si14: ivaraasen: formally it's an "applied math". Informally that means "nah, find something math-related and get your graduation". I've also done a lot of Erlang, so got some exposure to all this distributed stuff.

17:51 ivan: love the last paragraph on https://code.google.com/p/cpp-btree/

17:53 si14: ivaraasen: so I'm a little confused, because somehow in Russian college it's a nice mentor if his students can find a job, not if they've got published outside Russia :)

18:08 ravster: how do I use cheshire's 'add-encoder'? I'm trying to get java.net.URI working with its JSON output

18:09 dakrone: ravster: there's an example here: https://github.com/dakrone/cheshire#custom-encoders , should be pretty close to that

18:09 lemme know if you have problems

18:12 tomoj: what is the right practice for custom codecs?

18:12 oh, it's just a protocol, so..

18:13 really we should only use it for our own types?

18:13 hiredman: "you are trying to encode types in to a language that does not have a representation of those types, you are boned"

18:15 ravster: dakrone: we are trying that. but are getting 'add-encoder does not exist' errors

18:15 dakrone: ravster: what version of cheshire are you using?

18:16 ravster: 5.0.1

18:16 dakrone: ravster: and (require '[cheshire.generate :refer [add-encoder]]) says that add-encoder doesn't exist?

18:17 ravster: yup, some illegalaccesserror

18:17 dakrone: ravster: can you paste the exact error you're seeing/

18:18 ppppaul: https://gist.github.com/4687633

18:18 dakrone, ^

18:19 dakrone: ppppaul: ravster: something is messing with your dependencies then, the function is there: https://github.com/dakrone/cheshire/blob/5.0.1/src/cheshire/generate.clj#L201

18:19 ppppaul: i added a file to the gist

18:19 i'll try lein clean

18:20 dakrone: ppppaul: can you do a `lein deps :tree` also

18:20 fakedrake: hello

18:20 in which ns is defalias these days?

18:20 it doesnt seem to be in clojure.contrib.def as the docs say

18:22 ravster: do you want the output of :tree?

18:22 dakrone: ravster: yes please

18:23 ppppaul: dakrone, added it to gish

18:26 fakedrake: actually i want to use defalias, is it available elsewere?

18:26 dakrone: ppppaul: ravster: does (import 'cheshire.generate.JSONable) fail as well?

18:27 ppppaul: that works

18:27 really stumped on why my require isn't working

18:28 dakrone: ppppaul: yea, me too

18:28 ppppaul: is the code open source? can I try to reproduce locally?

18:29 ravster: trying to just delete the whole lein repo and doing a deps again.

18:29 amalloy: dakrone: his code doesn't matter, the refer that's failing is in ring.middleware.json

18:30 dakrone: amalloy: yea, but if he's using it in a project I can check out and do some spelunking in it would be helpful

18:30 amalloy: like it's trying to find add-encoder in a different namespace than the one it's in. perhaps it used to be somewhere else, and the middleware version doesn't match the cheshire version?

18:30 cbp``: in korma is there a macro or something that i can use to wrap queries so that it returns the sql instead of querying the db?

18:30 dakrone: add-encoder used to be in cheshire.custome (and still is for backwards-compatibility purposes)

18:30 cbp``: something like (as-sql (select users)) => "SELECT * FROM users;"

18:31 Raynes: fakedrake: There is a defalias in https://github.com/flatland/useful

18:31 dakrone: ppppaul: `lein classpath | tr ':' '\n' | fgrep cheshire` is that showing 5.0.1 as well?

18:31 Raynes: https://github.com/flatland/useful/blob/develop/src/flatland/useful/ns.clj#L19

18:32 ppppaul: yep, did that to check for that dep

18:32 i just reinstalled all my deps, will check again

18:33 actually, after deleting and reinstalling my deps, i'm running into problems and i don't get cheshire

18:34 dakrone: ppppaul: something is amiss with your project sounds like

18:36 ppppaul: i updated the gist

18:36 i'm getting a weird error that i don't understand from 'lein deps'

18:38 cbp`: oh it's sql-only

18:38 dakrone: ppppaul: weird lein plugin trying to pull guice perhaps? or else the project you're working on is using it and needs to add a repo

18:38 ppppaul: my project doesn't use guice

18:40 dakrone: strange, guice 2.0 isn't in maven central: http://mvnrepository.com/artifact/com.google.code.guice/guice

18:40 talios: guice 3 should be

18:41 dakrone: ppppaul: try `DEBUG=y lein deps` and see if that gives any additional clues

18:41 talios: com.google.inject/guice

18:43 ppppaul: updated gist

18:43 dakrone, ^

18:44 dakrone: ppppaul: can you paste your project.clj also?

18:44 amalloy: i just can't bring myself to pronounce guice as juice. the letters clearly want to be read as gweese

18:45 ppppaul: on it

18:45 ohpauleez: amalloy: haha

18:47 ppppaul: updated dakrone

18:47 technomancy: goose, come on

18:47 hyPiRion: I read it as "gaise"->"guys"

18:47 technomancy: it's a Top Gun reference

18:49 Hendekagon: amalloy "juice" - good word, "guice" - disgusting word

18:49 ravster: technomancy: oh lol.

18:49 xeqi: ppppaul: upgrade to friend 0.1.3

18:50 ppppaul: :)

18:50 dakrone: ppppaul: and clj-http 0.6.4 :)

18:50 xeqi: 0.1.2 pulled in somethign (jopenid?) that pulled in guice on repo that doesn't work anymore

18:50 headshot: amalloy: yep

18:50 ppppaul: oh wow

18:50 oh man... my project works now

18:51 dakrone: ppppaul: that sounds like the problem

18:51 ppppaul: thanks xeqi

18:51 solved my json problem too

18:51 dakrone: ppppaul: glad to hear it

18:51 more evidence that maven causes all java problems

18:52 even though it wasn't exactly a maven problem

18:52 ravster: phew. thanks dakrone, xeqi

19:00 hyPiRion: Hmm, seems like Clojure 1.5 is around the corner.

19:40 TimMc: Well, CLJ-1153 had better be *before* the corner, then.

19:46 hyPiRion: TimMc: Many things should be before the corner

19:46 konr`: is there a clojure directory of things, like cliki?

19:46 hyPiRion: konr`: Like a list of clojure packages?

19:46 dnolen: any explanation of core.logic should probably begin w/ list comprehensions

19:46 http://gist.github.com/4686830

19:47 nDuff: konr`: It's not safe to assume we know what "cliki" is. Clojuresphere is a very good package directory, though, if that's what you're talking about.

19:48 konr`: hyPiRion: and other things, like a list of clojure blogs, books, tools etc

19:48 ohpauleez: konr`: There's ClojureSphere ( http://www.clojuresphere.com/ ) and Clojure Toolbox ( http://www.clojure-toolbox.com/ )

19:49 News is at: http://planet.clojure.in/

19:49 Books are: http://clojure.org/books

19:50 konr`: Amazing! Thank you

19:50 ohpauleez: tutorials and language guides: http://clojure-doc.org/

19:50 konr`: No problem

19:50 konr`: Interactive problems are at: http://www.4clojure.com/

19:50 if you're exploring and learning the language

19:54 georgek: hi, I'm writing a single-threaded multiplexing chat server for fun, but I'm just a beginner so I'm not sure how to handle the state in my socket selecting object (the NIO Selector); it has some mutable state such as its key sets

19:55 is an atom appropriate, or an agent, or...?

19:56 TimMc: konr`: cliki is a Common Lisp wiki?

19:57 Oh huh, clojars still has a korma dep?

19:58 konr`: TimMc: yup! And a pretty neatly organized one

19:58 technomancy: TimMc: working on it, trust me =)

20:00 xeqi: TimMc, technomancy: we'll prolly keep it there for awhile until we know event streams are working well

20:00 technomancy: indeed

20:06 maio: what's wrong with korma?

20:06 technomancy: maio: there are some issues with korma, but in this case SQL (and sqlite in particular) was simply not a good fit for the problem

20:07 amalloy: georgek: why single-threaded? one thread per client may not be sustainable for facebook, but it's certainly a lot easier

20:07 firefux: maio: its unmaintained?

20:07 xeqi: connection pooling and an incomplete sql dsl in the same library ?

20:07 technomancy: the jdbc driver for sqlite is very bad

20:07 for concurrency

20:07 tomoj: interesting that cheshire's encoding of Date drops ms precision

20:07 bug, I wonder?

20:07 technomancy: tomoj: that's java.util.Date

20:08 rearing its hideous visage

20:08 xeqi: firefux: alex_baranosky took over it recently

20:08 tomoj: hmm

20:08 firefux: technomancy: well, sqlite is not that good for concurrency :)

20:08 maio: ah ok. just curious because soon I'll have to choose something to talk to SQL server :)

20:08 what's better?

20:08 technomancy: heh

20:08 tomoj: or it's just cheshire's default-date-format

20:09 technomancy: maio: well that's kind of the problem

20:09 tomoj: didn't notice you could change it

20:09 technomancy: maio: it's more or less the best we've got for SQL

20:09 firefux: maio: jdbc :/

20:11 xeqi: maio: I haven't had any problems with it so far. The incompleteness I can work around by dropping to raw sql. Its just an easy target to rail against

20:11 technomancy: once the connection pooling gets ripped out (or you monkeypatch it out) it shouldn't be that difficult to limit yourself to "korma the good parts"

20:12 xeqi: I also haven't tried to do any of the foreign key stuff with it either though, so ymmv

20:13 georgek: amalloy: I agree, just to learn how to do it

20:17 maio: ok thanks. my model would be simple so I could experiment a little :) btw it seems that there is some activity going on in korma repo for last few days. one-man-show by Alex

20:24 mikera: anyone here tried out core.matrix?

20:30 TimMc: No, but that sounds like a good reason not to pull in all of incanter. :-P

20:31 mikera: yeah the idea is to have a matrix layer that can be used anywhere, including Incanter

20:31 I'm just looking around for feedback on the design at the moment

20:32 TimMc: Oh, it's yours? Yeah, I have a project I could try it out in.

20:32 mikera: cool please do

20:32 ominen1: what i meant by that i didn't wanna leave my parents was that i didn't wanna commit suicide because of all your stalking during this time and i believe in the future to come. what i meant by "you and me" was that we human beings in this world can change and love instead of killing each other. what i meant by me reading books to get closer to you is that i read books to get closer to all people without AS. what i meant by that i

20:32 have done and said things i wasn't proud of is me as a human being in life believing that i was so smart before but have been misled and followed by people lile a retard during the past weeks and that i feel like a loser not much worth in my own eyes. what i meant by you taking away everything from me and i still wouldn't have regrets is that even when you are stalking and harassing me to make my life a living hell i have

20:32 said what is on my mind and showed willingness to communication to solve problems instead of you and others are acting there is something between us. what i meant by we can't give up on our soul for short term gain is that we human beings have to get rid off our selfishness in our DNA and look at long term gain like love and communication.

20:32 mikera: not just me, other collaborators too :-)

20:32 ominen1: please leave me alone and don't harass me more

20:33 TimMc: mikera: I have a stupid little ray-tracer I made for school.

20:33 mikera: cool that should work well as a test

20:33 I'm writing a raytracer too in my spare time

20:34 TimMc: You've seen cray?

20:34 mikera: (which is mostly non-existent... but still)

20:34 yup

20:34 mine is Enlight

20:34 https://github.com/mikera/enlight

20:35 yours is cray?

20:35 TimMc: Nope!

20:37 mikera: cray is nice but I think it is never going to perform well.... pure Clojure data structures just aren't well suited for this type of code

20:37 TimMc: mikera: https://github.com/timmc/CS4300-hw6

20:38 http://i.imgur.com/ZYPHD.png

20:38 mikera: cool thanks for the link I will check it out!

20:38 nice image :-)

20:38 TimMc: The spec for that is in the repo.

20:38 I fucked up the shadows somehow. Not gonna fix it.

20:39 mikera: that is a lot of reflective spheres, right?

20:41 mattmoss: I see Sierpinski

20:51 TimMc: mikera: 4 reflective spheres.

20:51 mikera: wow it looks like a lot more than that!

20:51 some kind of additive light?

20:52 TimMc: Just mirror reflection and a red point source.

20:52 mikera: hmmm clever

20:52 will have to try the same when I get point lights implemented in enlight :-)

20:53 I've focused mostly on textures so far

20:53 http://clojurefun.wordpress.com/2012/12/17/planes-and-patterns/

20:56 TimMc: Textures were an extra credit that I did not attempt.

20:57 mikera: they are tougher to be sure. but not if you use Clisk as a library :-)

20:58 that gets you 3D / 4D textures effectively for free

20:59 tomoj: the inverse of clojure.instant/read-instant-date is... #(let [s (pr-str %)] (subs s 7 (dec (count s)))) ?

21:00 #(binding [*data-readers* {'inst identity}] (read-string (pr-str %)))

21:00 :(

21:11 cbp: ERC> /msg NickServ register ayelchicapan cesarbol90@gmail.com

21:11 er

21:11 frozenlock: lol

21:11 cbp: well isn't that annoying

21:12 frozenlock: and #clojure is logged for google :)

21:12 cbp: never trusting emacs again

21:13 ChongLi: hopefully you don't use that password for anything else

21:13 a nickserv password really ought to be considered throwaway

21:13 frozenlock: In a perfect world every password should be throwaway

21:14 amalloy: in a perfect world every password would be an ssl client cert

21:14 ChongLi: committed to memory, of course

21:15 and different for every site

21:15 changing on every login!

21:16 TimMc: With perfect forward secrecy, mind you.

21:16 ioexception: cbp: Now that you're famous, you'll get more emails everyday :-)

21:16 ChongLi: yes and paired with a hardware authenticator

21:16 which is resistant to keystroke logging

21:16 cbp`: damn it :(

21:18 guilherme_: what's the way to use clojure on android? clojure? clojurescript? any particular way to do it?

21:18 ChongLi: clojurescript would be easiest

21:18 since it's just javascript

21:20 mikera: Clojure works there is a cool REPL app

21:20 https://play.google.com/store/apps/details?id=com.sattvik.clojure_repl&hl=en

21:33 julddd: Hi all, question concerning (do .. )

21:33 mikera: sure shoot

21:33 julddd: Consider this: (defn tr-fn [x y] (do (alter refx + x) (alter refy + y) ))

21:33 Why is (do) necessary here?

21:33 couldn't it be

21:34 mikera: hmmm dont think it makes any difference in this case

21:34 julddd: (defn tr-fn [x y] (alter refx + x) (alter refy + y))

21:34 ChongLi: do is implicit in function bodies

21:34 mikera: that would be fine, because defn allows multiple expressions

21:34 and combines them in an implicit (do....)

21:34 julddd: ok

21:34 mikera: However you probably want (dosync ....)

21:35 ChongLi: yeah

21:35 mikera: since you probably want a transaction?

21:35 julddd: but something like if() does need it, correct ?

21:35 oops (if)

21:35 old habits creeping back

21:35 mikera: yes, because if takes one form for each clause

21:35 julddd: ok, thanks for the clarification

21:35 ChongLi: if you don't care about the else branch

21:35 you can use when

21:35 mikera: you need do when you want to combine multiple (presumably side-effectful...) expressions into one form

21:35 ChongLi: which wraps an implicit do

21:36 julddd: also, is possible to have an explicit else ?

21:36 mikera: (cond ... ) has an explicit else

21:36 julddd: as in (if cond (something) :else (something2))

21:36 ChongLi: (cond ... :else)

21:36 mikera: just use cond if you want that

21:37 julddd: ok

21:37 mikera: (cond condition true-expr :else false-expr) works

21:38 amalloy: although it seems a bit asymmetric to me to want explicit else but not explicit then

21:38 ChongLi: some languages are like that

21:38 some even use fi to end the block

21:38 which I think is ridiculous

21:38 amalloy: (if test (-> :then do (...)) (-> :else do (...))) ;; lol

21:40 i guess that doesn't work. some variation on it ought to, just for entertainment

21:42 mikera: you can always defmacro and demad an explicit "fi" :-)

21:43 ChongLi: haha

21:44 yeah I wonder how far you could really go

21:45 define some really weird language and use a big macro as the compiler

21:45 mikera: you can go as far as you like I guess - ther are really no limits on what you can compile within a macro

21:46 on the numeric clojure list some people were talking about compiling Clojure expressions down to LLVM native code for example

21:46 for accelerated matrix operations etc.

21:46 ChongLi: yeah that's really interesting

21:46 mikera: thats my pet project for the moment :-)

21:47 anyone feels like giving core.matrix a spin, I'm looking for feedback ATM

21:47 ChongLi: is it meant for making native clojure binaries or supplemental stuff through the JNI?

21:47 mikera: https://github.com/mikera/matrix-api

21:47 it can do that.... and more

21:47 the idea is a generic API for matrix maths

21:48 that can support different implementations, e.g. JBLAS

21:48 ChongLi: this is really interesting

21:49 mikera: Clojure ecosystem really needs it, if were are going to be serious about data science

21:49 ChongLi: so is this able to take advantage of SIMD?

21:49 mikera: It will be like NumPY++

21:49 yep, in theory

21:49 ChongLi: nice

21:49 amalloy: ChongLi: you really can go as far as you want. on lisp contains a prolog compiler written as a lisp macro

21:49 mikera: in fact, as soon as someone finishes the JBLAS <-> core.matrix bridge it will do so

21:50 ChongLi: now to figure out how to do the same thing in javascript for CLJS

21:50 how would javascript's typed arrays compare performance-wise?

21:50 mikera: core.matrix API is all protocol based, so I think would bort to ClojureScript just fine

21:52 ChongLi: javascript typed arrays are an order of magnitude faster than cljs transient vectors

21:52 mikera: hmmm I guess they would probably about match Clojure's vectors, but that depends on quality of JS compiler

21:53 ChongLi: they are intended for providing fast, low-level arrays for webgl data

21:53 mikera: hmmmm may be even faster then

21:53 if they can match Java primitive arrays, they would be very good

21:54 ChongLi: the trick is to build a nice functional interface on top

21:54 mikera: we have a Java primitive double array implementation for core.matrix, it is blazing fast

21:54 ChongLi: so you don't have to deal with mutation

21:54 one of the limitations of javascript typed arrays is that they are much slower to create than regular objects

21:54 but they are really fast to mutate/index

21:54 mikera: see this discussion: https://github.com/mikera/matrix-api

21:55 Sorry I mean this one: https://groups.google.com/d/msg/numerical-clojure/s91Yp9mxr3E/oz6ZOwmPWocJ

21:55 ChongLi: so the idea is to create once and mutate

21:55 plan-based workflow

21:56 I was thinking the exact same thing for javascript typed arrays

21:56 you functionally build up a big computation lazily

21:56 mikera: yep - should work

21:56 ChongLi: and then evaluate it all at once

21:56 returning a single, frozen collection backed by a typed array

21:56 mikera: hey if you fancy porting core.matrix to JavaScript we can try it out :-)

21:57 ChongLi: haha, I've never done anything like that before

21:58 mikera: well... now you have a chance to learn

21:59 I'd like to have core.matrix work equally well for ClojureScript

21:59 ChongLi: I would too

22:00 I'd like to learn more about what the plans are for this sort of thing

22:00 mikera: well feel free to join in the group

22:00 ChongLi: ideally we'd want a codebase built on the intersection of the two languages

22:00 mikera: plans are driven by what people feel motivated to contribute, mostly

22:01 ChongLi: I mean in general for clojurescript and clojure

22:01 mikera: Hmmm I think there is a big common intersection

22:01 ChongLi: one example is feature expressions

22:01 mikera: yeah, you need those for rhe conditional-compilation type stuff

22:02 with that, I think implementing a common Clojure/ClojureScript code base is reasonable

22:03 ChongLi: yeah

22:05 I'm taking a look at the code here

22:30 pppaul: when is clojure west

22:30 jeremyheiler: march

22:30 clojurewest.org

22:30 ChongLi: march 18

22:30 pppaul: oh wow, they have a website

22:32 i don't see prices

22:32 it looks cool, though

22:34 xeqi: http://www.regonline.com/Register/Checkin.aspx?EventID=1172220

22:34 pppaul: ^

22:49 pppaul: cheap

22:49 oh wait… west is far away from me

22:49 ug

22:49 i'm east

22:50 tomoj: +$250 for the conf hotel, +$??? for flight

23:07 pppaul: not an issue of money

Logging service provided by n01se.net