#clojure logs

2013-01-31

00:19ominen1I 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
00:19ominen1really 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
00:19ominen1take 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
00:19ominen1with selffishness and tell mother nature that we won't give up on our soul for short term gains
00:20ominen1sorry for spamming this channel like this. it won't happen again
00:20TimMcominen1: Accidental paste?
00:34hiredmanwin 15
00:35xumingmingva 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?
00:35xumingmingv*after lein repl is loaded
00:42technomancyxumingmingv: you can add :repl-options {:init-ns my.ns} to project.clj
00:42njdwlxum... check out the repl-options here https://github.com/technomancy/leiningen/blob/stable/sample.project.clj, does init-ns do what you want?
00:42njdwljinks
00:45njdwl~OT -- best practice for emacs w/ periodic need for switching between cl+slime and clojure+nrepl?
00:45clojurebotclojurebot has a poetic soul
00:46njdwltwo copies of my init.el seems kinda ugly
00:46technomancynjdwl: 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
00:55njdwlheadscratch... so I fire up either lein repl and it fondly shares the port deets, SBCL, not so much... TIA...
01:01xumingmingvtechnomancy: njdwl: thanks, I will take a look at
01:03xumingmingvtechnomancy: 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
01:05njdwlxum: check out the profiles on the previous link
01:06tomojcould there possibly be a reason to manually give a fn "once semantics" ?
01:06bbloomtomoj: thunks?
01:07tomojwhich aren't just delays?
01:17bbloomtomoj: 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
01:17tomojoh yeah
01:17bbloomalso, you might want a thunk that has no return value, so deref doesn't really mean anything
01:17tomojit means "do it"?
01:18bbloomwell yeah, but then you can't differentiate between nil and void, if you need that
01:18bbloomso there are cases to make custom thunk types
01:18bbloomDelay only offers isRealized, no sense of success/failure
01:18bbloomor if you're doing runtime profiling or optimistic evaluation of thunks, you might need extra info like estimated cost, etc
01:19bbloomthere are plenty of reasons to implement similar semantics if you want/need them
01:19tomojand so in those cases ^:once will give you better locals clearing, iiuc?
01:19bbloomi don't know much about ^:once
01:19amalloydelay 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
01:20amalloyrather than waiting until the function itself can be GCed
01:20bbloomah, that makes sense
01:21bbloomin 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
01:21bbloombasically just (set! element-variable nil) at the end
01:22tomojIE what? :(
01:23bbloomthe older the version of IE, the more memory leaks they have when it comes to js code holding on to element references
01:23bbloomb/c they use COM reference counting, not garbage collection
01:23bbloomand don't do cycle detection
01:24tomojI only have to support IE9 I think
01:24bbloomso you see stuff like `var div = ...; ...; div = null; ....` pretty frequently
01:24bbloomprobably fine in IE9
01:34wei_in crate: is there an idiomatic way to set inline css on a dom element?
01:35frozenlockwei_: [:div {:style "font-size: small;"}]?
01:36wei_gotcha, I was wondering whether crate had a map => css string function
01:37frozenlockyup, same as hiccup
01:38frozenlockHow come you are not asking this on #clojurescript? :P
01:38amalloyi bet counting the number of people in that channel vs this one would give a good guess as to why
01:40wei_frozenlock: I wasn't aware of #clojurescript, thanks. will try to promote :)
01:40frozenlockYeah, it's a thing :)
01:46seangrovels
01:46lazybotbin etc home lib lost+found media mnt opt root selinux src srv swap usr
01:46tagrudevfrozenlock, try octopus
01:46tagrudevrm ~
01:46tagrudev:D
01:46frozenlocktagrudev: octopus?
01:47tagrudevfrozenlock, https://github.com/tchandy/octopus
01:47tagrudevwah sorry wrong chan :D
02:05skyboundgot 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?
02:06skyboundmore like: the only option i can conceive
02:14tomojhttps://github.com/conal/MemoTrie/blob/master/src/Data/MemoTrie.hs#L528-534
02:14tomoj:(
02:16hiredmanskybound: you can just call next until end returns true
02:16hiredmanthe you will have walked the entire tree and will be back at the root
02:18skyboundhiredman: the zipper root? I need the sub-node where the traversal began?
02:21tagrudevI need a good start book for clojure can you recommend me one ?
02:21ChongLihttp://www.clojurebook.com/
02:22tagrudevty
03:00bbloomRaynes: you there?
03:00Raynesbbloom: No.
03:00gf3Awkward
03:01bbloomRaynes: ok, just checking. i guess i'll wait for you to come back
03:01Raynesbbloom: What do you want from me, Brandon?
03:02bbloomRaynes: curious if you through at all about a more declarative version of laser or similar libraries
03:02Raynesbbloom: Don't know what you mean.
03:02bbloomRaynes: so laser is a combinator library. it produces functional closures that are later executed, right?
03:03bbloomi'm interested in a declarative model for which there is an interpreter or compiler
03:03RaynesYeah, I didn't think about that.
03:03bbloomhowever, i'm interested in styling, not templating
03:04bbloomi 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
03:05RaynesSo are there benefits of something like this for laser, or...?
03:05bbloombut 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
03:05bbloomRaynes: it would be a separate library i write, since my documents aren't really XML or HTML
03:06bbloommy primary motivation is that i need composability
03:06RaynesDid you just want somebody to tell this to? :P
03:06bbloomRaynes: nah, i wanted your thoughts
03:06bbloomsince you seem to be opinionated on these sorts of transformation things
03:06RaynesI don't think I have any.
03:06bbloomheh, ok then
03:06RaynesSounds like you're doing something completely different from what I'm doing.
03:07bbloomheh, it's definitely very different
03:07RaynesI also probably don't understand what you're wanting very well either.
03:08bbloombut 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
03:08RaynesSo if you do a proof of concept or something I'd be interested in seeing it.
03:08bbloomok
03:10bbloomthe main goals are 1) just data, not functions 2) cascading behavior like CSS 3) extensible
03:12bbloomRaynes: btw, do you ever sleep?
03:12RaynesYes.
03:13tomojextensible means something like you can write a function and plug it in with a namespaced symbol/keyword?
03:13bbloomcoulda fooled me
03:13RaynesIt's only 12:13PM in LA. I'm not there quite yet, but meh.
03:13bbloomtomoj: yeah, just like css allows vendor prefixes, this would allow namespaced keywords to mean things
03:13RaynesEr, AM.
03:15tomojis this for fipp?
03:16bbloomtomoj: among other things
03:17bbloomtomoj: fipp was a test bed for several ideas, but i got mega side tracked by making it use the fanciest algorithm available :-)
03:18bbloomright 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
03:19tomojboth of the tutorial links for dsssl are 404s :(
03:20bbloomyeah.... it's early web days lol
03:20bbloomeasily google-able tho
03:21bbloomwhat a strange and different world it would have been if scheme and DSSSL beat javascript and css
03:22bbloomi'm on a mission to reinvent the full rich client stack on top of the good ideas in clojure :-)
03:25tomojif you write a binary adder in core.logic, can you do css positioning/sizing constraints?
03:26tomojor can you do that in core.logic without writing a binary adder? :)
03:27bbloomtomoj: i'd prefer to enforce particular complexity bounds on selectors, layouts, etc
03:28bbloomwould have to use finite domain constraints to do that and it would just be too complex
03:28bbloomi'd like to ensure that extensions can't willy-nilly add features that would kill your performance
03:28bbloomi'm not sure if that's possible, but i am sure that core.logic would make inefficient selectors, layouts, etc, trivial :-P
03:29tomojhmm
03:30tomojI 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
03:30tomojso some overhead on whatever math you need
03:30tomojbut why should using core.logic make layout slow otherwise?
03:32nightflySomeone mentioned that it does operations on items and not sets
03:35ejacksontomoj: you don't need the binary adder, as bbloom say the fd stuff allows arithmetic
03:35ejacksonprovided you keep to a finite grid
03:35tomojright..
03:35tomojso grid size, what, 5px?
03:35tomoj1px?
03:36ejacksonyeah, that would be fine
03:36tomojthat does sound slow to me :)
03:36tomojthough I have no clue about the fd stuff
03:36ejacksoncould be 100px if you like
03:36ejacksonwhatever, all you need to get the fd going is to be using integers, not reals
03:38tomojit doesn't do stupid stuff like (pluso 70 ?x 100) checking 0 through 29 or something?
03:39ejacksoni have no idea, but i'd wager not
03:43bbloomtomoj: we need an immutable web too... sooo many broken links when reading about DSSSL
03:43tomojsweet, I finally tried the arithmetic
03:44tomojit apparently doesn't cope with negative integers?
03:45tomojoh, hmm
03:48bbloomtomoj: not sure why it wouldn't... although i know a lot of linear algebra solvers use slack variables to avoid negative numbers
03:48bbloombut it seems like a finite domain solver wouldn't need such tricks
03:48bbloomthose linear solvers are floating point
03:50tomoj(interval Integer/MIN_VALUE Integer/MAX_VALUE) :D
03:50tomojI must not be exercising it properly, I expect it to blow up but it seems to work
05:05ominen1TimMc: 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
05:12ominen1i have always tried to be nice to people .. why are you playing me like this
05:21bawrominen1: What happened?
05:32ominen1bawr: 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
05:32ominen1"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
05:33bawrominen1: It would probaby help you more if you mentioned the project name. Or your own name, I guess.
05:35hyPiRionHuh, thos sounds serious. Though as bawr said, some more information would help.
05:55ominen1they stole from me and tried to set me up that i was there for business
05:57bawrHow 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.
05:59Raynesominen1: 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.
05:59RaynesWhat you're saying is pretty vague, so I'm not sure how this pertains to Clojure or the community at all.
06:00bawrYeah, 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.
06:01RaynesDon'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.
06:03bawrIf you want to diassociate yourself from someone in here, that would sort of work, except that we only know your IRC handle.
06:03RaynesAnd we have no idea who the other person is.
06:53Raynesweavejester: https://github.com/http-kit/http-kit
06:54weavejesterRaynes: ?
06:54Raynesweavejester: Another library for the toolbox.
06:54weavejesterRaynes: Ohh, right :)
07:09dignatiHi guys
07:11dignatiIm basically looking for some kind of advanced (map). I want to call a function on every combination of elements from 2 seqs
07:11dignatiIs some sort of thing done yet?
07:11dignati*this
07:23clgvdignati: you can use (for [a seq1 b seq2] (f a b))
07:25dignaticlgv: 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?
07:26clgvdignati: no
07:26clgv,(for [i (range 3) j (range 3)] [i j])
07:26clojurebot([0 0] [0 1] [0 2] [1 0] [1 1] ...)
07:26clgv&(for [i (range 3) j (range 3)] [i j])
07:26lazybot⇒ ([0 0] [0 1] [0 2] [1 0] [1 1] [1 2] [2 0] [2 1] [2 2])
07:26clgv&(for [i (range 3) j (range 3) :when (< i j)] [i j])
07:26lazybot⇒ ([0 1] [0 2] [1 2])
07:27dignaticlgv: Oh then I completely misunderstood that. Thanks!
07:28dignaticlgv: I was planning on mapping map on each element
07:28clgvif you need the other behavior map is right. ##(map vector (range 3) (range 3))
07:28lazybot⇒ ([0 0] [1 1] [2 2])
07:30dignaticlgv: like how the contrib.combinatorics implemented permutations https://github.com/richhickey/clojure-contrib/blob/2ede388a9267d175bfaa7781ee9d57532eb4f20f/src/main/clojure/clojure/contrib/combinatorics.clj#L160
07:30dignaticlgv: I will try both and compare performance
07:31clgvdignati: use `for` since it is simple when you know the number of seqs at coding time
07:32dignaticlgv: Yes, seems more reasonable. Thanks ;)
08:55TimMcRaynes: Unless ominen1 is simply horrible at communication, I'm going to guess it's a persecutory delusion. :-/
09:10tickingI 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?
09:12hyPiRionHmm
09:12hyPiRion,(group-by odd? #{1 2 3 4 5})
09:12clojurebot{true [1 3 5], false [2 4]}
09:13hyPiRion,(map set ((juxt filter remove) odd? #{1 2 3 4 5}))
09:13clojurebot(#{1 3 5} #{2 4})
09:14foodoo,(map set (vals (group-by odd? #{1 2 3 4 5})))
09:14clojurebot(#{1 3 5} #{2 4})
09:15tickinghyPiRion: that use of juxt ist pretty cool :D
09:17clgvticking: though not pretty efficient for larger sets since it's parsing the set two times ;)
09:17tickingyeah
09:18tickingI've never seen it in action though :D
09:19clgv,((juxt (comp set filter) (comp set remove)) odd? #{1 2 3 4 5})
09:19clojurebot[#{1 3 5} #{2 4}]
09:19clgvto put it to its limits ^^
09:19tickinghrhr
09:19tickingyeah
09:20TimMc&((apply juxt (map (partial comp set) [filter remove])) odd? #{1 2 3 4 5})
09:20lazybot⇒ [#{1 3 5} #{2 4}]
09:21clgvTimMc: that's gotten uglier now ;)
09:22TimMcIndeed!
09:22tickinguse all the functions!
09:22TimMcI couldn't figure out how to work fnil or reductions into it.
09:23hyPiRionHmm.
09:24clgv,((apply juxt (map #(comp set %) [filter remove])) odd? #{1 2 3 4 5})
09:24clojurebot[#{1 3 5} #{2 4}]
09:24clgvless redundancy ;)
09:26clgvoh lol^^
09:26clgvhumm is having partial in there an avantage or not ;)
09:27hyPiRion,(map #([`#{~%}](+)) ((juxt filter remove) odd? #{1 2 3 4 5}))
09:27clojurebot(#{(1 3 5)} #{(2 4)})
09:27hyPiRion,(map #([`#{~@%}](+)) ((juxt filter remove) odd? #{1 2 3 4 5}))
09:27clojurebot(#{1 3 5} #{2 4})
09:27amphtroxhi, im trying to write a small try-clause macro and im getting some problems, http://pastebin.com/NbApYJeH anyone care to take a look?
09:28jcromartie"the true zero of a monoid" … can someone help me learn enough math to keep up with fold and/or reducers
09:29clgvamphtrox: you need some `let` there for your bindings
09:29hyPiRion,(let [bit-and &] (map #([`#{~@%}](+)) ((juxt filter remove) #(= (+) (& % (*))) #{1 2 3 4 5}))
09:29clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
09:35clgvjcromartie: you probably just need group theory
09:38amphtroxclgv could you show how it would look like? im new to this and really unfamiliar with this syntax
09:39TimMcThe zero of a monoid, like 0 for + and 1 for *?
09:39clgvTimMc: usually it should be called neutral element
09:40hyPiRionTimMc: and {} for hash-map, #{} for set, etc.
09:40hyPiRionhash-set, rather.
09:41jcromartieso, what *is* a monoid in clojure
09:41clgvamphtrox: you want with-open I guess
09:42jcromartiethe wikipedia page is rather opaque to me
09:42jcromartie"… they can be regarded as categories with a single object. Thus, they capture the idea of function composition within a set"
09:43jcromartieso a monoid is a set
09:43jcromartieand a binary operation
09:45jcromartieand such helpful illustrative examples such as "Every bounded semilattice is an idempotent commutative monoid"
09:45TimMcThat's wikipedia for you.
09:45TimMcmath explanations : Wikipedia :: programming : point-free
09:46jcromartieI think MathWorld is better for this stuff
09:47jcromartieWikipedia just seems like where mathemeticians go to mathsturbate
09:47TimMcding ding ding
09:47jcromartieyou can quote me on that
09:47jcromartieOh look, three sentences with all the links you need: http://mathworld.wolfram.com/Monoid.html
09:47arcatanwikipedia occasionally has good stuff on math, but usually it won't very helpful if you don't know the math beforehand
09:47jcromartieor four
09:49TimMc"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
09:50jcromartiehah hah hah
09:50jcromartieactually laughing here
09:50TimMcThat used to be the second sentence of [[Instanton]], although they've toned it down since.
09:52PudgePacketwhoa, that's pretty terrible
09:54jcromartieI suppose I need Java 7 to use reducers in Clojure 1.5?
09:56lpetitjcromartie: only if you want to leverage the multicore "fold" feature. You can leverage the "no object creation" reduce without Java 7, I think.
09:57lpetit(because fold requires Fork/Join, either the jdk 6 back port, either java 7)
09:57jcromartieunder Java 6, (require 'clojure.core.reducers) yields a java.lang.ClassNotFoundException: jsr166y.ForkJoinPool
09:57lpetit:(
09:58alexnixonjcromartie: try adding [org.codehaus.jsr166-mirror/jsr166y "1.7.0"] to your deps
09:59alexnixonjcromartie: I was playing with reducers a while back and someone told me to add that. Seemed to make things work.
10:00jcromartiealexnixon: that does the trick
10:01alexnixonjcromartie: cool, have fun ^_^
10:13jcromartiealright well I've had enough mind bending for the morning
10:29borkdudeI'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:29borkdudeso thank you
10:30ChongLiOO has some good ideas but it complects them
10:37lpetitis twitter dead for you too, or is it just us in France?
10:38Bronsahere in Italy too
10:38ejacksonme too
10:38ejacksonin UK
10:38kognatetwitter ok in the states, but real slow
10:39lpetitmaybe … 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:39kognatewhoops, I just got some kind of broken robot telling me something is technically wrong
10:44TimMclpetit: Twitter has been dead to me since the beginning.
10:44TimMcOh, *for* me. nvm
10:44lpetitTimMc: just since, says 20 minutes for me
11:06Anderkentwhy is reevaluating (defmulti) a noop? Seems like changing the dispatch function should be possible, but isnt.
11:07ejacksonAnderkent, yeah, you have ns-unmap the dispatch
11:08Anderkentyea, 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:08ChongLiit does some hairy things behind the scenes, perhaps?
11:09AnderkentI'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:09amalloyAnderkent: no, what would happen otherwise is the old defmethods no longer exist until you reevaluate them
11:10amalloymethods don't point to multis; it's the other way around. so if you delete the multimethod, all implementations go with it
11:10Anderkentstill fine for the most common case, I suppose
11:10amalloymost 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:10S11001001Anderkent: that really would hurt in the case of defmethods being in other files
11:11S11001001Anderkent: otoh, making the dispatch fn fixable is as easy as #'
11:12AnderkentS11001001: not sure what you mean? I just went with (def my-multi nil) (defmulti my-multi ...) for now
11:13S11001001Anderkent: put your dispatch fn in a separate defn
11:13Anderkentit already is
11:13S11001001Anderkent: then refer to it from your defmulti form by saying #'my-fn instead of my-fn
11:13S11001001Anderkent: now simply updating my-fn's definition will affect the dispatch
11:13Anderkentuh, I suppose that works
11:14S11001001and, 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:14tmarshI'm trying to reify a webbit websockethandler but it overloads onMessage, how do I add type hints?
11:34no7hing@tmarsh in general ^Type argument-name
11:35tmarsh@no7hing thanks! I'd forgotten to add the ^void return type
11:35no7hingnp
11:37amalloyyou shouldn't need to hint the return type. clojure can infer it from the arguments
11:37amalloy(and the interface)
11:46ChongLihttp://stopwritingramblingcommitmessages.com/
11:46ChongLiahhh, fantastic!
12:14hyPiRionChongLi: I thought 72 was common for short messages as well. Shows how much I know about idiomatic git use.
12:16nDuff What? Someone who wants _fewer_ informative or useful commit logs?
12:16nDuff*aghast*
12:17nDuff...oh, favoring paragraph formatting; that's fine.
12:20hyPiRionnDuff: It's more about being concise, I suppose.
12:20hyPiRionAnd not breaking the 80-terminal line.
12:21clgvI had in mind 80 instead of 72^^
12:22technomancymaslow's hierarchy of formatting
12:22nDuffhyPiRion: Concision isn't the primary issue I see when going through revision control logs.
12:22technomancylet's get people to stop committing 120-column lines in source before we go after the git messages =)
12:22nDuffhyPiRion: (err, a lack of)
12:22Anderkentfeels 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:22nDuff...an excess of concision is a much bigger concern.
12:23hyPiRiontechnomancy: I think I did that once, and in hindsight I feel terrible for doing it.
12:24frozenlockAnderkent: My thoughts exaclty: shouldn't whatever interface you are using to read the logs be able to format them?
12:24technomancyfrozenlock: once we have AI capable of taking a paragraph and distilling a single coherent summary out of it we can start doing that =)
12:24hyPiRionHere we are, in 2012, bound to the limits of the IBM card format designed in 1928.
12:26clgvlets dont commit lines at all buts-expressions ;)
12:26clgv*s-expressions
12:26frozenlocktechnomancy: Sure; I was mainly taking about the scrolling. Just automatically warp the lines.
12:27frozenlockwrap even
12:28TimMchyPiRion: I thought it only went back to TTYs.
12:28TimMc...which were probably designed for an optimal line length for reading.
12:29technomancyhyPiRion: could be worse: http://www.naciente.com/essay94.htm
12:29jasonbrayanyone using core.cache in production?
12:38frozenlockI 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:39TimMcmerge-with is close...
12:39hyPiRion,(reduce #(update-in conj %1 %2) {} [[:a 1] [:a 2]])
12:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol:   in this context, compiling:(NO_SOURCE_PATH:0)>
12:40hyPiRion,(reduce #(update-in conj %1 %2) {} [[:a 1] [:a 2]])
12:40clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>
12:40hyPiRionoh yeah. Hmm.
12:40frozenlockmerge-with is really close indeed.
12:41clgv&(reduce-kv #(update-in %1 [%2] conj %3) {} [[:a 1] [:a 2]])
12:41lazybot⇒ {1 ([:a 2]), 0 ([:a 1])}
12:41clgvups^^
12:41clgv&(reduce #(update-in %1 [(first %2)] conj (second %3)) {} [[:a 1] [:a 2]])
12:41lazybotclojure.lang.ArityException: Wrong number of args (2) passed to: sandbox8276$eval86428$fn
12:41clgv&(reduce #(update-in %1 [(first %2)] conj (second %2)) {} [[:a 1] [:a 2]])
12:41lazybot⇒ {:a (2 1)}
12:42clgv&(reduce #(update-in %1 [(first %2)] (fnil conj []) (second %2)) {} [[:a 1] [:a 2]])
12:42lazybot⇒ {:a [1 2]}
12:43TimMc&(let [data [[:a 1] [:a 2] [:b 3]]] (->> (for [[k v] data] {k [v]}) (apply merge-with concat)))
12:43lazybot⇒ {:b [3], :a (1 2)}
12:43hyPiRion,(reduce #(apply update-in %1 (take 1 %2) conj (rest %2)) {} [[:a 1] [:a 2]])
12:43clojurebot{:a (2 1)}
12:43hyPiRionOh well.
12:43TimMcThen a post-processing step to unwrap the singletons?
12:43frozenlockWow thank you very much :)
12:44TimMc&(reduce #(update-in %1 [(first %2)] (fnil conj []) (second %2)) {} [[:a 1] [:a 2] [:b 3]])
12:44lazybot⇒ {:b [3], :a [1 2]}
12:47frozenlockI just learned about fnil today. Achievement unlocked.
12:49arrdemfrozenlock: thanks for sharing that's an interesting one.
12:50jweiss_is there a lib or blog post about how to represent and work with a graph structure in clojure?
12:50jweiss_i saw clojure.contrib.graph has no replacement
12:51jweiss_i have signed the CA so i could see if i could get it working but thought there may be something else.
12:54loganlinnJDBC 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:54loganlinnwhere underscore->dash is something like {:keyword #(.replace % "_" "-")}
12:54arrdemjweiss_: check out zippers....
12:54arrdemclosest thing I know of but it's really aimed at directed trees
12:54jweiss_arrdem: i've used zippers but only for trees.
12:55jweiss_graphs wouldn't work would it? nodes can have more than one 'parent'
12:55arrdemyeah...
12:56arrdem(up) wouldn't work with multiple parents
13:07SegFaultAXloganlinn: You want to replace all underscores with dashes, but your table doesn't have any underscores in its name?
13:08SegFaultAXOr your column in this case.
13:09SegFaultAXloganlinn: And furthermore, I think it should be something like #(.replace (name %) "_" "-")
13:09amalloyTimMc, frozenlock: ##(apply merge-with into (for [[k v] [[:a 1] [:a 2] [:b 3]]] {k [v]}))
13:09lazybot⇒ {:b [3], :a [1 2]}
13:11TimMcinto, much better
13:11loganlinnSegFaultAX: my column has underscores, but the maps i'd like to pass to insert-record(s) have dashes
13:11SegFaultAXloganlinn: Then shouldn't you be replacing dashes with underscores?
13:11hyPiRionI was under the impression that the result should've been {:b 3, :a [1 2]}.
13:11hyPiRionoh well.
13:12SegFaultAX&(#(.replace (name %) "-" "_") :my-awesome-keyword)
13:12lazybot⇒ "my_awesome_keyword"
13:12amalloyhyPiRion: that seems to have been what he asked for, but that's such a useless result i'm not going to help :P
13:12amalloyi'll instead pretend he wanted something good instead of bad
13:13loganlinnSegFaultAX: hmm, true. i was using the same strategy for selecting values (underscores->dashes), let met try a reverse naming strategy
13:19SegFaultAXloganlinn: 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:20frozenlockamalloy: 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:21amalloywhat you've pasted is not bad: you get out a map of keys to lists of values
13:21amalloyi 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:22frozenlockThat's the case, I would still prefer that: it would reflect the initial query
13:25loganlinnSegFaultAX: looks like naming strategies just aren't used on inserts.
13:25loganlinnthe source seems to imply this too
13:26SegFaultAXloganlinn: Lame. Sorry about that.
13:36jweiss_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:41seangroveI don't understand how this can be a good idea: Backbone.on('got_weather', function...)
13:41seangroveIf you're going to assign a callback/listener, it has to have a handle/name/something to list and retrieve it by
13:41seangroveOtherwise you've assigned it, and it's gone
13:42seangroveAnd 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:43TimMcfrozenlock: Oh, this is for URLs?
13:43frozenlockIt is.
13:44TimMcTHen you'll want vectors, not a mix of vectors and strings.
13:44TimMcProvide two accessors: get-last, and get-all
13:45TimMcOtherwise the data types are controlled by user input, leading to surprise bugs.
13:49frozenlockTimMc: You mean like giving an undefined symbol?
13:49Ember-hmm, having a problem with lein-ring, it's not updating sources on fly
13:49Ember-known issue?
13:49Ember-or should I know something
13:50frozenlockFor example "?b=hello" instead of "?b=\"hello\""?
13:50Ember-I've set :auto-reload? to true
13:50frozenlock(decoded for clarity)
13:57Ember-this sucks, makes my development process slow
13:57Ember-:(
13:57Ember-btw, I noticed that the reload does work but inconsistently
13:57TimMcfrozenlock: 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:57TimMcExcept it could be a much worse error.
13:57Ember-got to check if I find the reason
13:59Ember-for some reason if I edit the source file where I've defined the ring handler it updates perfectly
13:59technomancyEmber-: I recommend starting jetty from a repl session
13:59Ember-but if I edit any other file it doesn't work like it should
14:01Ember-technomancy: doesn't help
14:01Ember-same issue
14:01amalloyalso don't forget the danger of calling read-string on arbitrary user input, due to undocumented but intentional security holes
14:02Ember-or actually it works even worse
14:02Ember-hmph
14:03frozenlock:(
14:03Ember-decided to build my new app with lib-noir + compojure but so far this experience is really bad :(
14:03Ember-compared to noirs "it just works" considering auto update of sources
14:04amalloymaybe we should start describing *read-eval* as a backdoor rhickey left for himself in every clojure app
14:04amalloyso he can fix your bugs for you
14:09frozenlockEh.. and I thought that getting a hold of the URL query would be a 15 min job... -_-
14:09frozenlockWouldn't a safe-read fn also work in cljs? https://www.refheap.com/paste/9134
14:11Ember-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:11Ember-not exactly the way I want to work
14:12Ember-and when launching server from REPL nothing get updated, not even after forcing file reload into REPL
14:12Ember-get+s
14:13Ember-I'm like this close abandoning lib-noir+compojure
14:15amalloyEmber-: so use ring's wrap-reload middleware
14:15amalloyi don't know what lein-ring does, but apparently it's not working for you; wrap-reload should
14:15Ember-amalloy: tried that too
14:15Ember-no go
14:17Ember-only thing that triggers reload is editing the handler file
14:19Ember-like, I edit another file, refresh and nothing changes
14:19Ember-then I *remove* wrap-reload from handler and refresh, now the changes appear
14:19Ember-after that, I edit the other file again and refresh, nothing
14:20Ember-reapply the wrap-reload, *poof* changes appear
14:20Ember-apparently only the handler file changes are detected and applied
14:23amalloyare you telling wrap-reload what namespace to reload? it probably default to just the current namespace
14:23epitronEmber-: what OS are you using?
14:24Ember-epitron: win 7
14:25epitronah
14:25epitron(i don't have an answer, i'm just curious if that might be related to file notification stuff)
14:25Ember-and noir's auto reload works like charm
14:25technomancyEmber-: if you launch jetty from a repl that's connected to your editor you can easily pick up recompiles
14:25epitronmaking file notifications cross-platform is always tricky
14:25Ember-technomancy: like I said, I've tried that
14:25Ember-this is related to compojure
14:26amalloyepitron: most reload middleware just blindly reloads, not relying on tricky notifications
14:26Ember-even in REPL changes don't get registered
14:26technomancyEmber-: oh, because you're not going through a var?
14:26epitronamalloy: nice simple solution :)
14:26technomancyEmber-: (run-jetty #'app {...})
14:26technomancyvs (run-jetty app {...})
14:26Ember-that I am not doing, will try
14:26epitronEmber-: is your editor changing the timestamp on the file when you save it?
14:26epitronoh snap
14:26technomancyyeah, 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:27epitrontehcnomancy got it
14:27Ember-no, didn't work
14:27epitronoh snap he didn't
14:28Ember-(defn start-server [] (run-jetty #'my-handler {:port 8080 :join? false}))
14:28Ember-and
14:28epitronis it time to take remote control of Ember-'s desktop and figure out what he's doing wrong? :)
14:28nDuff(actively using code much like what Ember- is describing here)
14:28Ember-(def my-handler (-> (handler/site root-view/views (resources "") (not-found (not-found-page)))
14:29TimMcEmber-: Just put a read-string in your code and epitron will be in shortly. :-P
14:29Ember-stuff gets updated when I update something in that file
14:29Ember-but if I edit anything in root-view/views it doesn't
14:29Ember-in there:
14:30Ember-(defroutes views (GET "/" [] "<h1>woot</h1>"))
14:30seangroveDamnit
14:30Ember-that's pretty much everything I have
14:30seangroveCompiling cljs in debug mode and suddenly: "Uncaught Error: Namespace "goog.string" already declared. "
14:30Ember-in project.clj:
14:31seangroveAh nevermind, chrome is pulling it from a cache or something
14:31Ember-:ring {:handler myns/my-handler :open-browser? false :auto-reload? true}
14:32Ember-ah, screw it. I'm going back to noir
14:34Ember-or not
14:34Ember-lol
14:34Ember-found it
14:34Ember-what technomancy said
14:34Ember-except I also (of course...) had to pass the route mappings as vars too
14:34Ember-bah
14:34Ember-I feel so stupid now
14:44amalloythat's what computers are for, Ember-
14:44amalloyit would be a tragedy if we had to make ourselves feel stupid
14:46TimMcThe automation of obnoxiousness.
14:51frozenlockIs there a thing to make ourselves feel smart?
14:52mattmossBeer.
14:52technomancyI 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:53technomancy^ yogthos|away
14:53frozenlocktechnomancy: I was sure *read-eval* was defaulted to false for a while now.
14:53frozenlockSeems I dreamed that.
14:54TimMcHopefully it's a premonition.
14:54technomancyfrozenlock: it's a dream I share
14:54frozenlockfor 1.5?
14:54technomancywe can hope, but it seems unlikely
14:54TimMcD-:
14:54technomancyhttp://dev.clojure.org/jira/browse/CLJ-1153 <- vote here, not that it will make a difference
14:56frozenlockIs .core really that hard to contribute too?
14:57frozenlocks/too/to
14:57technomancyyes
14:58TimMcTom voted for it!
14:59TimMcMaybe he will pressure his brother.
14:59technomancyfamily ties are the strongest
14:59loganlinnwhat's an idiomatic way to check if a regex matches anything?
14:59TimMcre-match I think?
15:00loganlinnthere's re-matcher and re-matches
15:00hiredmanre-find
15:00ChongLiand re-find
15:00dakronere-find
15:00ChongLiyeah
15:00loganlinnok
15:00loganlinnthx
15:01pjstadigisn't the point with reader literals to basically run arbitrary code at read time?
15:01TimMc&(apropos #"^re-")
15:01lazybot⇒ (re-attr re-id re-class re-pattern re-matches re-matcher re-groups re-find re-seq re-groups*)
15:01technomancypjstadig: sure, where "arbitrary" is defined by data_readers.clj
15:01TimMcpjstadig: Not user-supplied.
15:01ChongLire-matches is more strict than re-find
15:02ChongLire-matches tries to match the whole string
15:09loganlinnChongLi: good point… re-matches is actually what I needed
15:10dabdDouble/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:10TimMcNope, sorry.
15:13TimMcI believe the compiler needs to know (statically) what the arity is for any Java method call.
15:26michaelr525hello
15:30S11001001dabd: also Double/valueOf might be more efficient
15:30amalloyS11001001: s/more/less?
15:30S11001001amalloy: more, or less, depending on who's calling #(Double/?? %)
15:32amalloyi doube if #(Double/valueOf %) will ever be faster than #(Double/parseDouble %)
15:33amalloyi 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:33S11001001depends on who's better at boxing doubles
15:34amalloythat'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:36S11001001definitely reflection would kill it
15:36S11001001but without that...
15:37amalloy*nod* reflection is the only reason, but it's a big one
15:37amalloyand now you've made me curious what kind of boxing the compiler emits for #(Double/parseDouble %). gonna go find that out
15:39S11001001it'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:39S11001001so as to diagnose things
15:41S11001001I 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:42amalloyS11001001: yes, it is a problem you can have in clojure too
15:42amalloyboxing 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:42S11001001yeah
15:43amalloyanyway, 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:43amalloyie, as efficient as possible
15:43S11001001heh
15:44S11001001,(-> #(Double/parseDouble %) class superclasses)
15:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: superclasses in this context, compiling:(NO_SOURCE_PATH:0)>
15:44S11001001,(-> #(Double/parseDouble %) class supers)
15:44clojurebot#{java.lang.Runnable clojure.lang.IFn java.io.Serializable java.util.concurrent.Callable java.util.Comparator ...}
15:44S11001001,(->> #(Double/parseDouble %) class supers (drop 5))
15:44clojurebot(clojure.lang.IObj clojure.lang.AFunction clojure.lang.IMeta clojure.lang.Fn clojure.lang.AFn ...)
15:44S11001001,(->> #(Double/parseDouble %) class supers (drop 10))
15:44clojurebot(java.lang.Object)
15:44S11001001Hm.
15:44amalloyyou won't find clojure.lang.IFn.DO there, or whatever primitive interface
15:45S11001001amalloy: Yeah, that's what I was looking for. Why not?
15:46amalloyno fundamental reason, i suppose
15:46amalloyat 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:47S11001001Does it unconditionally choose the invokePrim path?
15:47S11001001if it chooses it at all
15:47amalloyif it has locals of the right types, yes (as far as i know)
15:48S11001001Interesting; then it probably has enough information to warn about boxing.
15:49amalloyor, are you asking what happens when you have like (let [x (Double. 10)] (foo x)) where foo implements IFn.DO?
15:49amalloyie, does it prefer to unbox x and invokePrim, or leave it boxed and use IFn? i don't know the answer to that
15:50S11001001rather, (let [x 10] (foo x)) where foo implements IFn.(whatever takes Long)
15:50amalloyin that case it definitely uses invokePrim
15:50S11001001maybe not that, but rather (let [^Long x 10] (foo x)) because doing it for inferred cases could get annoying fast
15:51S11001001warning about boxing, that is
16:11amalloy$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:11lazybotMessage saved.
16:14jweiss_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:16deg(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:19ohpauleezjweiss_: Do you have a signed CA?
16:19jweiss_ohpauleez: yeah i signed it a while back, that's all taken care of
16:20hyPiRionjweiss_: Ask on the clojure-dev list.
16:20ohpauleezjweiss_: Make the proposal on the clojure-dev mailing list for the migration
16:20ohpauleezthen we'll all say, "sounds good, let's adjust the namespace"
16:20ohpauleezthen you stuart sierra will setup some build stuff for you and you can setup the repo
16:21ohpauleezjcrossley3: Are you making it to Clojure/West?
16:21jweiss_cool. i'm kind of surprised, no one else is using graphs?
16:21jcrossley3ohpauleez: yeppers
16:21ohpauleezexcellent!
16:22amalloywell, 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:22amalloyand most of it isn't that hard to roll by hand, so nobody's been interested in resurrecting contrib.graph
16:23amalloy(btw, i recommend clojure.algo.graph at the name)
16:23jweiss_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:25jweiss_seems like anything that needs to calculate dependencies (not as part of compilation but data dependencies), would need graphs.
16:28TimMc$latest jkkramer/loom
16:28lazybot[jkkramer/loom "0.2.0"] -- https://clojars.org/jkkramer/loom
16:28TimMcjweiss_: ^ check this out as well
16:29jweiss_TimMc: i did, but the very first sentence on the readme is "Caveat coder: this lib is alpha-stage."
16:30jweiss_so it didn't seem like a good thing to build on top of
16:30amalloyevery clojure lib is secretly in alpha-stage, because everyone refuses to release 1.0 of anything
16:30amalloyjkkramer is just willing to admit it
16:30technomancysecretly?
16:31amalloymmm, perhaps secretly is the wrong word
16:33amalloyimplicitly?
16:34Raynesamalloy: Hey, I plan to do a 1.0.0 of laser as soon as I've got refheap running on it.
16:34Raynes:>
16:34hiredmanit is a a grand game of chicken
16:34RaynesI'm being a good boy.
16:36ohpauleezjweiss_: You might want to subsume loom as a move into contrib
16:37jweiss_ohpauleez: good point.
16:37technomancyjweiss_: have you thought about the pros and cons of a contrib lib?
16:37jweiss_technomancy: to be honest, no :)
16:38technomancyjweiss_: something you should consider before signing up as maintainer
16:38technomancyjust because something was part of monolithic contrib doesn't mean it has to become a new-style contrib to continue its existence
16:39jweiss_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:40jweiss_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:40technomancyjweiss_: it's not a question of "good enough"
16:41technomancycontrib libraries are not "better" in any way than libraries that aren't in contrib
16:41technomancyjust more hassle to maintain and contribute to
16:41jweiss_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:41technomancy(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:41clojurebotmax people is 317
16:42jweiss_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:43jweiss_but i guess that is not really the case.
16:43amalloyjweiss_: 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:44jweiss_true day
16:44jweiss_dat
16:44technomancyit's your call; I'd just caution you to think about the tradeoffs rather than assuming it's a net gain.
16:45jcromartiehttps://gist.github.com/4686797
16:45jweiss_technomancy: sure, i appreciate the warning :)
16:47TimMcjweiss_: Perhaps you could make it non-contrib but still add a note to the contribs page. :-P
16:48jweiss_ok
16:48TimMcamalloy: I'm proud to say that I recently went through all my releases and bumped everything to 1.0 where appropriate.
16:48jweiss_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:48amalloy(inc TimMc)
16:48lazybot⇒ 32
16:49frozenlock(identity Frozenlock)
16:50technomancywow, the issue for changing read-eval to false has the highest number of votes of any in jira after 1 day
16:50TimMcALl that's left to do is get signing set up, but that's blocked by lein not having a key selection mechanism.
16:50si14jweiss_: not sure if graph contrib is easy or even doable.
16:50technomancyand TimMc's patch to document said is #5
16:51TimMcWhy nervous?
16:51technomancyvague feeling like I might get sucked into doing something =)
16:52si14jweiss_: 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:53jweiss_si14: yeah maybe but that is also true of trees. yet zippers are official.
16:53amalloyyeah, 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:53RaynesIt's about time.
16:54technomancyamalloy: I'm just wondering given StuH's "Clojure 1.5.0-RC4 wants to become 1.5.0" post
16:55si14jweiss_: a list of edges? Matrix of edges? Matrix of nodes? Facts like in core.logic? A lazy infinite structure?
16:55amalloywell, every RC wants to be the final release. that's the point
16:55si14jweiss_: there are way less options with trees.
16:55RaynesPoor abandoned RCs.
16:55jweiss_si14: that is true
16:55technomancyamalloy: 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:56jweiss_i suppose i am thinking of a DAG but that is not the general case of a graph
16:56amalloyyou could call it algo.stuff.jweiss.needs
16:56amalloythen there's room for all kinds of stuff
16:56dnolena fun FD core.logic snippet
16:56dnolenhttp://gist.github.com/4686830
16:57dnolenevery list of size M of natural numbers that adds up to N
16:57si14jweiss_: 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:57hiredmandisabling 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:57hiredmanthe compiler have to emit byte code to binding *read-eval* to true, which is not a huge deal breaker
16:58jweiss_si14: i think i've already been dissuaded from making it a contrib lib
16:58si14 jweiss_I'm persuading you to push this theme further in maillist
16:58si14 :)
17:03si14dnolen: this all seem so easy when reading code, and so non obvious writing :)
17:04TimMcjweiss_: One thing I don't know is whether a non-contrib lib can be made into a contrib.
17:04dnolensil4: heh yes - core.logic learning curve is a bit steep. But it has a dramatic fall off once it clicks.
17:05hiredmanit constant gardening, the care and feeding of search trees
17:05hiredmanit is
17:06jweiss_TimMc: what do you mean? all the contributors have to have signed the ca before they write code?
17:06amalloyTimMc: 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:06jweiss_amalloy: yeah that's what i would expect - just that all the contributors have to agree.
17:06amalloyi think the main reason it didn't happen for ring or compojure is that some people couldn't be tracked down
17:07technomancydata point: I was able to change the license for swank-clojure by contacting all the contributors (~60) and getting their approval.
17:07si14dnolen: yeah. I hope it will be easier after the reasoned schemer
17:07amalloyi remember signing such an agreement for something, but i can't really remember what project it was
17:08technomancythough 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:08dnolensi14: it'll be a little bit easier and a Prolog book won't hurt either, especially 4th ed of Bratko.
17:08si14dnolen: wrote it down, thanks.
17:09amalloymight 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:09dnolenamalloy: core.match I think
17:10amalloyyeah, looks like i have one commit on core.match and none on core.logic
17:10RaynesI considered making clojail a contrib lib once.
17:10RaynesBut then I stopped doing drugs.
17:11Raynes(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:11TimMc</humor>
17:11amalloynominating you for lamest #clojure joke of 2013, Raynes
17:11amalloyi know it's early, but you should be a strong contender
17:11RaynesI'll accept your nomination.
17:12TimMcThat was a joke, right?
17:12RaynesWe're having awards this year.
17:12RaynesI nominate TimMc for the most out of the loop person in the Clojure community.
17:12si14Raynes: btw
17:13si14Raynes: argh, Android keyboard. Do you now that build of clojail is broken?
17:13si14*know
17:14RaynesWhat build? We're using the latest version of clojail in 3 different projects.
17:15technomancytravis?
17:16RaynesOh.
17:16RaynesOh yeah, that's supposed to be broken.
17:16RaynesThose are speed tests that amalloy added that we haven't worked out yet.
17:16si14Yeah, Travis :)
17:16RaynesWell, it isn't *supposed* to be broken. But it is a known-to-be-broken test for now.
17:17si14Ah, OK. It's nice that you've mentioned it, I will likely need clojail in a month or two :)
17:18RaynesYeah, it isn't a big deal.
17:18si14Nice stuff, btw.
17:18si14Your drugs was nice too, it seems.
17:19ivaraasendrugs? where?
17:21si14Is it a good idea to teach students with Clojure as a first language? I'm really not sure, but somehow I like this.
17:22si14*it
17:22nDuffsi14: Not sure. There are some other LISP-family languages that have more comprehensive student-oriented tools and curriculum around them.
17:23si14nDuff: you mean Racket?
17:23nDuffsi14: ...on the other hand, Clojure is more likely to be usable once they get out into the Real World
17:23nDuffsi14: ...Racket, DrScheme, &c.
17:23technomancyI would be hesitant to teach Clojure as a first language
17:23amalloyprobably not. clojure has a lot of complexities introduced by needing to deal with the real world
17:24si14The 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:25amalloyscheme was built with the idea of being a teaching language as a real goal, although perhaps not paramount
17:25si14It's full of design fail.
17:25si14(Python I mean)
17:25nDuffsi14: That's quite relative.
17:25TimMcOnce you know Racket, learning the JVM complexities is probably not hard.
17:26si14nDuff: yeah, you can't beat php, but nevertheless
17:26si14Or js
17:26si14Not sure which is worse
17:26TimMcThe thing is, PHP is *optional*.
17:27technomancyI will probably start with Racket once my kids are a few years older.
17:27TimMcI guess JS is slowly becoming viable as purely a compilation target, but at this point you still need to know all the complexities.
17:27si14technomancy: Kids are sophomores :)
17:28TimMctechnomancy: How old are they?
17:28technomancyTimMc: 3 and 5
17:28technomancythe 5 year old has a lot of fun with Scratch, but he still needs a fair bit of guidance
17:29TimMcThe trick is to make a Scheme small enough that a kid could choke on it. Then they'll be all over it.
17:29technomancyheh
17:29mybuddymichaelHah, true.
17:29si14technomancy: 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:30si14technomancy: ah, sorry, I've missed the word "my" :)
17:30technomancysi14: I gave up on programming for 4 years at age 14 due to C++
17:30si14technomancy: what was your next language?
17:31technomancyI did a couple years of C++ in university followed by perl/php briefly, then ruby for ~4 years
17:32TimMcMy 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:32TimMcThis was all in high school.
17:32tomojI never remembered to count the TI languages
17:33mybuddymichaeltechnomancy: How did you get into Clojure?
17:33TimMcMy mandelbrot took like 5 hours to render.
17:33technomancymybuddymichael: I lost my job =)
17:33mybuddymichaelThe best reason.
17:33technomancygot a month of severance pay, spent it writing https://peepcode.com/products/functional-programming-with-clojure
17:34tomojthat's how I got into clojure!
17:34tomojthanks btw :)
17:34technomancysweet =D
17:34amalloyTimMc: TI-83 for life
17:34technomancybut I was interested in it mostly due to elisp, which I enjoyed a lot more than ruby
17:34tomojit also meant I stopped buying peepcodes..
17:34mybuddymichael"In this 65 minute tutorial, *Clojure expert* Phil Hagelberg..."
17:34mybuddymichael(Emphasis added.)
17:34si14So the choice is between Python and Racket.
17:35amalloyi 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:35mybuddymichaeltechnomancy: Was "expert" true at the time?
17:35technomancymybuddymichael: well I'd been learning it for about 4 months at the time
17:35si14technomancy: lol
17:35mybuddymichaelHah, close enough.
17:35technomancymybuddymichael: considering it was only a little over a year old when I started... you make the call =)
17:35amalloyat the time, yeah
17:35TimMcamalloy: The 89 has symbolic manipulation -- you can take expressions apart into parse trees.
17:36TimMcI wrote a symbolic differentiator for a pre-calc algebra class.
17:36ivaraasengot 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:36edwI'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:36TimMc-algebra
17:36amalloyTimMc: the 89 already has a symbolic differentiator though
17:36TimMcYeah, and the teacher wouldn't let me use it. :-P
17:36TimMcSo I wrote my own, and she let me use that.
17:37technomancyedw: have you seen weavejester's environ?
17:37technomancyhighly recommended
17:37TimMcedw: alter-var-root in main, perhaps?
17:37RaynesUgh.
17:37amalloy*smile* i did that with...polynomial long division
17:37edwamalloy: The symbolic differentiator in SICP 1 ed blew my mind when I encountered it.
17:37Raynesedw: Make it a function or something.
17:37RaynesAnd then slap TimMc with it.
17:37amalloya "show your work" button. i blame that program for my complete lack of understanding about how to do polynomial long division now
17:38edwI'll check out environ.
17:38TimMcpfft
17:38edwAlso considered the make-it-an-fn idea, Raynes. Trying to minimize the changes to the app.
17:39Raynestechnomancy: I don't care for environ's keyword mutilating.
17:39amalloyedw: yes, make it a function, or a delay
17:39RaynesI'd rather do (env "AWS_ACCESS_KEY") or (env :AWS_ACCESS_KEY) at the very least.
17:39amalloy(def port (delay (System/getenv "PORT")) ...(start-server @port)
17:40tomojor just put System/getenv in your heroku carica config.clj?
17:40RaynesI don't like it changing my keywords to something entirely different under the hood just to make the input more Clojurey.
17:40ivaraasenstarted doing some basic geophysics the other day using Graph and a homegrown Flop library. soooo nice.
17:41tomoj"Graph" - that's the name of a library?
17:41ivaraasentomoj: nah, it's prismatic.plumbing if I recall correctly
17:41si14ivaraasen: Is it fast enough?
17:42ivaraasensi14: 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:43si14ivaraasen: RQD?
17:44ivaraasensi14: rock quality designation. it's part of the RMR (rock mass rating system)
17:45tomojoh, that reminds me of qplan
17:45ravsterhello everyone
17:46si14In 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:46ivaraasenI figure the array macros will come in handy once I start doing more signal processing or machine learning.
17:46tomojand theano
17:47si14ivaraasen: nice, thanks. Always interesting to get a glance at someone's work far from known fields.
17:47tomojoh nice fn-> and fn->>
17:48ivaraasensi14: yeah, I'm still doing very simple stuff as I'm an undergraduate. what's your field?
17:51si14ivaraasen: 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:51ivanlove the last paragraph on https://code.google.com/p/cpp-btree/
17:53si14ivaraasen: 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:08ravsterhow do I use cheshire's 'add-encoder'? I'm trying to get java.net.URI working with its JSON output
18:09dakroneravster: there's an example here: https://github.com/dakrone/cheshire#custom-encoders , should be pretty close to that
18:09dakronelemme know if you have problems
18:12tomojwhat is the right practice for custom codecs?
18:12tomojoh, it's just a protocol, so..
18:13tomojreally we should only use it for our own types?
18:13hiredman"you are trying to encode types in to a language that does not have a representation of those types, you are boned"
18:15ravsterdakrone: we are trying that. but are getting 'add-encoder does not exist' errors
18:15dakroneravster: what version of cheshire are you using?
18:16ravster5.0.1
18:16dakroneravster: and (require '[cheshire.generate :refer [add-encoder]]) says that add-encoder doesn't exist?
18:17ravsteryup, some illegalaccesserror
18:17dakroneravster: can you paste the exact error you're seeing/
18:18ppppaulhttps://gist.github.com/4687633
18:18ppppauldakrone, ^
18:19dakroneppppaul: 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:19ppppauli added a file to the gist
18:19ppppauli'll try lein clean
18:20dakroneppppaul: can you do a `lein deps :tree` also
18:20fakedrakehello
18:20fakedrakein which ns is defalias these days?
18:20fakedrakeit doesnt seem to be in clojure.contrib.def as the docs say
18:22ravsterdo you want the output of :tree?
18:22dakroneravster: yes please
18:23ppppauldakrone, added it to gish
18:26fakedrakeactually i want to use defalias, is it available elsewere?
18:26dakroneppppaul: ravster: does (import 'cheshire.generate.JSONable) fail as well?
18:27ppppaulthat works
18:27ppppaulreally stumped on why my require isn't working
18:28dakroneppppaul: yea, me too
18:28dakroneppppaul: is the code open source? can I try to reproduce locally?
18:29ravstertrying to just delete the whole lein repo and doing a deps again.
18:29amalloydakrone: his code doesn't matter, the refer that's failing is in ring.middleware.json
18:30dakroneamalloy: yea, but if he's using it in a project I can check out and do some spelunking in it would be helpful
18:30amalloylike 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:30cbp``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:30dakroneadd-encoder used to be in cheshire.custome (and still is for backwards-compatibility purposes)
18:30cbp``something like (as-sql (select users)) => "SELECT * FROM users;"
18:31Raynesfakedrake: There is a defalias in https://github.com/flatland/useful
18:31dakroneppppaul: `lein classpath | tr ':' '\n' | fgrep cheshire` is that showing 5.0.1 as well?
18:31Rayneshttps://github.com/flatland/useful/blob/develop/src/flatland/useful/ns.clj#L19
18:32ppppaulyep, did that to check for that dep
18:32ppppauli just reinstalled all my deps, will check again
18:33ppppaulactually, after deleting and reinstalling my deps, i'm running into problems and i don't get cheshire
18:34dakroneppppaul: something is amiss with your project sounds like
18:36ppppauli updated the gist
18:36ppppauli'm getting a weird error that i don't understand from 'lein deps'
18:38cbp`oh it's sql-only
18:38dakroneppppaul: 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:38ppppaulmy project doesn't use guice
18:40dakronestrange, guice 2.0 isn't in maven central: http://mvnrepository.com/artifact/com.google.code.guice/guice
18:40taliosguice 3 should be
18:41dakroneppppaul: try `DEBUG=y lein deps` and see if that gives any additional clues
18:41talioscom.google.inject/guice
18:43ppppaulupdated gist
18:43ppppauldakrone, ^
18:44dakroneppppaul: can you paste your project.clj also?
18:44amalloyi just can't bring myself to pronounce guice as juice. the letters clearly want to be read as gweese
18:45ppppaulon it
18:45ohpauleezamalloy: haha
18:47ppppaulupdated dakrone
18:47technomancygoose, come on
18:47hyPiRionI read it as "gaise"->"guys"
18:47technomancyit's a Top Gun reference
18:49Hendekagonamalloy "juice" - good word, "guice" - disgusting word
18:49ravstertechnomancy: oh lol.
18:49xeqippppaul: upgrade to friend 0.1.3
18:50ppppaul:)
18:50dakroneppppaul: and clj-http 0.6.4 :)
18:50xeqi0.1.2 pulled in somethign (jopenid?) that pulled in guice on repo that doesn't work anymore
18:50headshotamalloy: yep
18:50ppppauloh wow
18:50ppppauloh man... my project works now
18:51dakroneppppaul: that sounds like the problem
18:51ppppaulthanks xeqi
18:51ppppaulsolved my json problem too
18:51dakroneppppaul: glad to hear it
18:51dakronemore evidence that maven causes all java problems
18:52dakroneeven though it wasn't exactly a maven problem
18:52ravsterphew. thanks dakrone, xeqi
19:00hyPiRionHmm, seems like Clojure 1.5 is around the corner.
19:40TimMcWell, CLJ-1153 had better be *before* the corner, then.
19:46hyPiRionTimMc: Many things should be before the corner
19:46konr`is there a clojure directory of things, like cliki?
19:46hyPiRionkonr`: Like a list of clojure packages?
19:46dnolenany explanation of core.logic should probably begin w/ list comprehensions
19:46dnolenhttp://gist.github.com/4686830
19:47nDuffkonr`: 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:48konr`hyPiRion: and other things, like a list of clojure blogs, books, tools etc
19:48ohpauleezkonr`: There's ClojureSphere ( http://www.clojuresphere.com/ ) and Clojure Toolbox ( http://www.clojure-toolbox.com/ )
19:49ohpauleezNews is at: http://planet.clojure.in/
19:49ohpauleezBooks are: http://clojure.org/books
19:50konr`Amazing! Thank you
19:50ohpauleeztutorials and language guides: http://clojure-doc.org/
19:50ohpauleezkonr`: No problem
19:50ohpauleezkonr`: Interactive problems are at: http://www.4clojure.com/
19:50ohpauleezif you're exploring and learning the language
19:54georgekhi, 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:55georgekis an atom appropriate, or an agent, or...?
19:56TimMckonr`: cliki is a Common Lisp wiki?
19:57TimMcOh huh, clojars still has a korma dep?
19:58konr`TimMc: yup! And a pretty neatly organized one
19:58technomancyTimMc: working on it, trust me =)
20:00xeqiTimMc, technomancy: we'll prolly keep it there for awhile until we know event streams are working well
20:00technomancyindeed
20:06maiowhat's wrong with korma?
20:06technomancymaio: 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:07amalloygeorgek: why single-threaded? one thread per client may not be sustainable for facebook, but it's certainly a lot easier
20:07firefuxmaio: its unmaintained?
20:07xeqiconnection pooling and an incomplete sql dsl in the same library ?
20:07technomancythe jdbc driver for sqlite is very bad
20:07technomancyfor concurrency
20:07tomojinteresting that cheshire's encoding of Date drops ms precision
20:07tomojbug, I wonder?
20:07technomancytomoj: that's java.util.Date
20:08technomancyrearing its hideous visage
20:08xeqifirefux: alex_baranosky took over it recently
20:08tomojhmm
20:08firefuxtechnomancy: well, sqlite is not that good for concurrency :)
20:08maioah ok. just curious because soon I'll have to choose something to talk to SQL server :)
20:08maiowhat's better?
20:08technomancyheh
20:08tomojor it's just cheshire's default-date-format
20:09technomancymaio: well that's kind of the problem
20:09tomojdidn't notice you could change it
20:09technomancymaio: it's more or less the best we've got for SQL
20:09firefuxmaio: jdbc :/
20:11xeqimaio: 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:11technomancyonce 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:12xeqiI also haven't tried to do any of the foreign key stuff with it either though, so ymmv
20:13georgekamalloy: I agree, just to learn how to do it
20:17maiook 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:24mikeraanyone here tried out core.matrix?
20:30TimMcNo, but that sounds like a good reason not to pull in all of incanter. :-P
20:31mikerayeah the idea is to have a matrix layer that can be used anywhere, including Incanter
20:31mikeraI'm just looking around for feedback on the design at the moment
20:32TimMcOh, it's yours? Yeah, I have a project I could try it out in.
20:32mikeracool please do
20:32ominen1what 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:32ominen1have 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:32ominen1said 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:32mikeranot just me, other collaborators too :-)
20:32ominen1please leave me alone and don't harass me more
20:33TimMcmikera: I have a stupid little ray-tracer I made for school.
20:33mikeracool that should work well as a test
20:33mikeraI'm writing a raytracer too in my spare time
20:34TimMcYou've seen cray?
20:34mikera(which is mostly non-existent... but still)
20:34mikerayup
20:34mikeramine is Enlight
20:34mikerahttps://github.com/mikera/enlight
20:35mikerayours is cray?
20:35TimMcNope!
20:37mikeracray 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:37TimMcmikera: https://github.com/timmc/CS4300-hw6
20:38TimMchttp://i.imgur.com/ZYPHD.png
20:38mikeracool thanks for the link I will check it out!
20:38mikeranice image :-)
20:38TimMcThe spec for that is in the repo.
20:38TimMcI fucked up the shadows somehow. Not gonna fix it.
20:39mikerathat is a lot of reflective spheres, right?
20:41mattmossI see Sierpinski
20:51TimMcmikera: 4 reflective spheres.
20:51mikerawow it looks like a lot more than that!
20:51mikerasome kind of additive light?
20:52TimMcJust mirror reflection and a red point source.
20:52mikerahmmm clever
20:52mikerawill have to try the same when I get point lights implemented in enlight :-)
20:53mikeraI've focused mostly on textures so far
20:53mikerahttp://clojurefun.wordpress.com/2012/12/17/planes-and-patterns/
20:56TimMcTextures were an extra credit that I did not attempt.
20:57mikerathey are tougher to be sure. but not if you use Clisk as a library :-)
20:58mikerathat gets you 3D / 4D textures effectively for free
20:59tomojthe inverse of clojure.instant/read-instant-date is... #(let [s (pr-str %)] (subs s 7 (dec (count s)))) ?
21:00tomoj#(binding [*data-readers* {'inst identity}] (read-string (pr-str %)))
21:00tomoj:(
21:11cbpERC> /msg NickServ register ayelchicapan cesarbol90@gmail.com
21:11cbper
21:11frozenlocklol
21:11cbpwell isn't that annoying
21:12frozenlockand #clojure is logged for google :)
21:12cbpnever trusting emacs again
21:13ChongLihopefully you don't use that password for anything else
21:13ChongLia nickserv password really ought to be considered throwaway
21:13frozenlockIn a perfect world every password should be throwaway
21:14amalloyin a perfect world every password would be an ssl client cert
21:14ChongLicommitted to memory, of course
21:15ChongLiand different for every site
21:15ChongLichanging on every login!
21:16TimMcWith perfect forward secrecy, mind you.
21:16ioexceptioncbp: Now that you're famous, you'll get more emails everyday :-)
21:16ChongLiyes and paired with a hardware authenticator
21:16ChongLiwhich is resistant to keystroke logging
21:16cbp`damn it :(
21:18guilherme_what's the way to use clojure on android? clojure? clojurescript? any particular way to do it?
21:18ChongLiclojurescript would be easiest
21:18ChongLisince it's just javascript
21:20mikeraClojure works there is a cool REPL app
21:20mikerahttps://play.google.com/store/apps/details?id=com.sattvik.clojure_repl&amp;hl=en
21:33juldddHi all, question concerning (do .. )
21:33mikerasure shoot
21:33juldddConsider this: (defn tr-fn [x y] (do (alter refx + x) (alter refy + y) ))
21:33juldddWhy is (do) necessary here?
21:33juldddcouldn't it be
21:34mikerahmmm dont think it makes any difference in this case
21:34julddd(defn tr-fn [x y] (alter refx + x) (alter refy + y))
21:34ChongLido is implicit in function bodies
21:34mikerathat would be fine, because defn allows multiple expressions
21:34mikeraand combines them in an implicit (do....)
21:34juldddok
21:34mikeraHowever you probably want (dosync ....)
21:35ChongLiyeah
21:35mikerasince you probably want a transaction?
21:35juldddbut something like if() does need it, correct ?
21:35juldddoops (if)
21:35juldddold habits creeping back
21:35mikerayes, because if takes one form for each clause
21:35juldddok, thanks for the clarification
21:35ChongLiif you don't care about the else branch
21:35ChongLiyou can use when
21:35mikerayou need do when you want to combine multiple (presumably side-effectful...) expressions into one form
21:35ChongLiwhich wraps an implicit do
21:36juldddalso, is possible to have an explicit else ?
21:36mikera(cond ... ) has an explicit else
21:36juldddas in (if cond (something) :else (something2))
21:36ChongLi(cond ... :else)
21:36mikerajust use cond if you want that
21:37juldddok
21:37mikera(cond condition true-expr :else false-expr) works
21:38amalloyalthough it seems a bit asymmetric to me to want explicit else but not explicit then
21:38ChongLisome languages are like that
21:38ChongLisome even use fi to end the block
21:38ChongLiwhich I think is ridiculous
21:38amalloy(if test (-> :then do (...)) (-> :else do (...))) ;; lol
21:40amalloyi guess that doesn't work. some variation on it ought to, just for entertainment
21:42mikerayou can always defmacro and demad an explicit "fi" :-)
21:43ChongLihaha
21:44ChongLiyeah I wonder how far you could really go
21:45ChongLidefine some really weird language and use a big macro as the compiler
21:45mikerayou can go as far as you like I guess - ther are really no limits on what you can compile within a macro
21:46mikeraon the numeric clojure list some people were talking about compiling Clojure expressions down to LLVM native code for example
21:46mikerafor accelerated matrix operations etc.
21:46ChongLiyeah that's really interesting
21:46mikerathats my pet project for the moment :-)
21:47mikeraanyone feels like giving core.matrix a spin, I'm looking for feedback ATM
21:47ChongLiis it meant for making native clojure binaries or supplemental stuff through the JNI?
21:47mikerahttps://github.com/mikera/matrix-api
21:47mikerait can do that.... and more
21:47mikerathe idea is a generic API for matrix maths
21:48mikerathat can support different implementations, e.g. JBLAS
21:48ChongLithis is really interesting
21:49mikeraClojure ecosystem really needs it, if were are going to be serious about data science
21:49ChongLiso is this able to take advantage of SIMD?
21:49mikeraIt will be like NumPY++
21:49mikerayep, in theory
21:49ChongLinice
21:49amalloyChongLi: you really can go as far as you want. on lisp contains a prolog compiler written as a lisp macro
21:49mikerain fact, as soon as someone finishes the JBLAS <-> core.matrix bridge it will do so
21:50ChongLinow to figure out how to do the same thing in javascript for CLJS
21:50ChongLihow would javascript's typed arrays compare performance-wise?
21:50mikeracore.matrix API is all protocol based, so I think would bort to ClojureScript just fine
21:52ChongLijavascript typed arrays are an order of magnitude faster than cljs transient vectors
21:52mikerahmmm I guess they would probably about match Clojure's vectors, but that depends on quality of JS compiler
21:53ChongLithey are intended for providing fast, low-level arrays for webgl data
21:53mikerahmmmm may be even faster then
21:53mikeraif they can match Java primitive arrays, they would be very good
21:54ChongLithe trick is to build a nice functional interface on top
21:54mikerawe have a Java primitive double array implementation for core.matrix, it is blazing fast
21:54ChongLiso you don't have to deal with mutation
21:54ChongLione of the limitations of javascript typed arrays is that they are much slower to create than regular objects
21:54ChongLibut they are really fast to mutate/index
21:54mikerasee this discussion: https://github.com/mikera/matrix-api
21:55mikeraSorry I mean this one: https://groups.google.com/d/msg/numerical-clojure/s91Yp9mxr3E/oz6ZOwmPWocJ
21:55ChongLiso the idea is to create once and mutate
21:55ChongLiplan-based workflow
21:56ChongLiI was thinking the exact same thing for javascript typed arrays
21:56ChongLiyou functionally build up a big computation lazily
21:56mikerayep - should work
21:56ChongLiand then evaluate it all at once
21:56ChongLireturning a single, frozen collection backed by a typed array
21:56mikerahey if you fancy porting core.matrix to JavaScript we can try it out :-)
21:57ChongLihaha, I've never done anything like that before
21:58mikerawell... now you have a chance to learn
21:59mikeraI'd like to have core.matrix work equally well for ClojureScript
21:59ChongLiI would too
22:00ChongLiI'd like to learn more about what the plans are for this sort of thing
22:00mikerawell feel free to join in the group
22:00ChongLiideally we'd want a codebase built on the intersection of the two languages
22:00mikeraplans are driven by what people feel motivated to contribute, mostly
22:01ChongLiI mean in general for clojurescript and clojure
22:01mikeraHmmm I think there is a big common intersection
22:01ChongLione example is feature expressions
22:01mikerayeah, you need those for rhe conditional-compilation type stuff
22:02mikerawith that, I think implementing a common Clojure/ClojureScript code base is reasonable
22:03ChongLiyeah
22:05ChongLiI'm taking a look at the code here
22:30pppaulwhen is clojure west
22:30jeremyheilermarch
22:30jeremyheilerclojurewest.org
22:30ChongLimarch 18
22:30pppauloh wow, they have a website
22:32pppauli don't see prices
22:32pppaulit looks cool, though
22:34xeqihttp://www.regonline.com/Register/Checkin.aspx?EventID=1172220
22:34xeqipppaul: ^
22:49pppaulcheap
22:49pppauloh wait… west is far away from me
22:49pppaulug
22:49pppauli'm east
22:50tomoj+$250 for the conf hotel, +$??? for flight
23:07pppaulnot an issue of money