#clojure logs

2014-08-15

00:17zkanferI have a ClojureScript question. I'm looking to get functions and constants on the Math object if I only have the name of the function or constant as a string. I can check if they exist with, e.g. (.hasOwnProperty js/Math "E"), but how do I get the constant or function that the string corresponds to?
00:25TEttingerzkanfer: http://stackoverflow.com/a/23440306/786740
00:25TEttingerit isn't supported but can be done
00:29zkanferTEttinger: Thanks. So I need to somehow include proxy.js in my clojurescript code, then call (js/proxy (str "Math/" "E"))?
00:32zkanfer_TEttinger: Ugh, Firefox just crashed. If you responded to my last question (how to use the StackOverflow answer), I didn't see it.
00:35TEttingerzkanfer_, good ol' firefox crashes
00:35TEttingerI'm amazed at how often it crashes now
00:36zkanfer_Yeah, not even sure why -- I wasn't doing anything bad, I swear!
02:23andyfI am guessing there is a more elegant way to do this: (for [[idx x] (map-indexed (fn [idx x] [idx x]) some-sequence)] <do stuff with idx and x here>)
02:24pyrtsaandyf: At least you could use (map-indexed vector) there.
02:25pyrtsaI mean (map-indexed vector some-sequence), of course.
02:25andyfpyrtsa: Yes, that is quite a bit better
02:25pyrtsaDefining (def enumerate (map-indexed vector)) could be useful.
02:26andyfYou mean with partial before map-indexed?
02:26pyrtsaBah, partial yes.
02:27pyrtsaShould probably have another cup of coffee this morning. :)
02:27andyfnp. You didn't have my senior moment of writing (fn [idx x] [idx x]) at least :)
02:27pyrtsa:)
02:28andyf,(inc pyrtsa)
02:28clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pyrtsa in this context, compiling:(NO_SOURCE_PATH:0:0)>
02:28andyfshoot, I don't use this stuff often enough to remember the right syntax
02:28pyrtsa:|
02:29pyrtsaWithout a leading comma, I guess.
02:29andyf(inc pyrtsa)
02:29lazybot⇒ 7
02:29pyrtsaGee, thanks!
02:32andyfWow, we are up to 1332 accounts on Clojure JIRA (noticed only because of adding a count to my program that calculates weighted votes)
04:42H4nss
05:04michaelr525hello
05:05hyPiRionhi
05:09michaelr525what's up in clojureland?
05:13hyPiRionnot much
05:13michaelr525good
05:13hyPiRionsilence this early, as all 'muricans are sleeping
05:13michaelr525usually there is too much so i just can't keep up with everything ;)
05:14hyPiRionhah
05:23michaelr525yogthos: hi
05:23michaelr525yogthos: your blog, does it also render on the server?
05:23michaelr525yogthos: for google and such..
05:47KillombreHello max
06:36ponpalHow can I evaluate (use 'clojure.repl) automatically everytime I use cider-jack-in in emacs?
06:39milos_co1agenperhaps check out http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded section 'Dev profile and user.clj'?
06:40luxbockponpal: you can add `:injections [(use 'clojure.repl)]` to your profiles.clj
06:40luxbockthis only makes it be present in the user namespace though
06:40thesaskwatchHi, anyone has a good way to manage unbalanced parentheses when in paredit mode? Or a differerent mode/improvement to easily find/match brackets?
06:41luxbockif you'd like to have those functions available in all of your namespaces then you should check out vinyasa
06:41thesaskwatch(I mean in emacs)
06:41ponpalThanks a lot, I'll check that out.
07:00TimMcTEttinger2: Get yourself onto the Firefox ESR (Extended Support Release) track and it's a lot more stable.
07:10michaelr525is there a log of the channel somewhere?
07:22TimMc~log
07:22clojurebotsee logs
07:22TimMc*sigh*
07:22TimMc~logs
07:22clojurebotlogs is http://clojure-log.n01se.net/
07:22hyPiRionhah
07:22TimMc$log
07:22TimMc$logs
07:22TimMchttp://lazybot.org/logs/#clojure/2014-08-15
07:25Bronsamichaelr525: http://logs.lazybot.org/irc.freenode.net/#clojure
07:46michaelr525Bronsa, TimMc: Thanks
07:46michaelr525I get this: These are not the logs you're looking for.
07:46michaelr525ah
07:46michaelr525http://lazybot.org/logs/#clojure/2014-08-15
07:47michaelr525^^^^^^^^ this worked
08:02phillordhmmm -- I am confused by this
08:02phillord(into {} [[:a 1][:b 2]])
08:02phillord{:a 1, :b 2}
08:02phillord(into {} '([:a 1][:b 2]))
08:02phillord{:a 1, :b 2}
08:03phillord(into {} '((:a 1)(:b 2)))
08:03phillordClassCastException clojure.lang.Keyword cannot be cast to java.util.Map$Entry clojure.lang.ATransientMap.conj (ATransientMap.java:44)
08:03phillordwhy does the last except?
08:04hyPiRionphillord: [a b] can be cast to a key entry, whereas '(a b)/(list a b) cannot
08:04phillordso, why not "clojure.lang.PersistantList cannot be cast to ...."
08:05phillordwhere does "Keyword" come into this?
08:10hyPiRionphillord: because (conj {} {:a :b :c :d}) == (conj {} (seq {:a :b :c :d})), confusingly enough
08:10hyPiRion,(conj {} (seq {:a :b :c :d}))
08:10clojurebot{:a :b, :c :d}
08:12phillordyou are right
08:12phillordI am confused:-)
08:12hyPiRionyeah, it's confusing
08:13hyPiRion,(into {} [[(clojure.lang.MapEntry. :a :b)]])
08:13clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Vector arg to map conj must be a pair>
08:13hyPiRion,(into {} [(list (clojure.lang.MapEntry. :a :b))])
08:13clojurebot{:a :b}
08:16phillorddoes this count as a bug I wonder?
08:24gfredericksno, conj with maps is intentionally weird and confusing
08:24gfredericksI don't understand the intention but it's unlikely it was an accident
08:24pyrtsaphillord: Sounds like a question of whether the behaviour of (conj {} x) makes sense when x isn't a MapEntry nor a vector.
08:25phillordI should add it to my list of gotchas I guess
08:26pyrtsaThe questionable code is this: https://github.com/clojure/clojure/blob/43cc1854508d655e58e377f84836ba128971f90c/src/jvm/clojure/lang/APersistentMap.java#L39-L45
08:26gfredericksmerge is implemented with the questionable part of conj
08:27pyrtsaAs well as: https://github.com/clojure/clojure/blob/43cc1854508d655e58e377f84836ba128971f90c/src/jvm/clojure/lang/ATransientMap.java#L41-L47
08:27pyrtsagfredericks: Thanks! Was about to ask next if anyone knew of code paths touching that piece of code.
09:35TimMcBronsa: I see now that if (let [a 5] #{a 5}) did not fail due to the set constructor's check, then #{(gensym) (gensym)} would silently become a set of one element instead of throwing.
09:35TimMcThat would be pretty nasty.
09:36BronsaTimMc: yeah
09:37TimMcI withdraw my objection on practical grounds. :-P
09:53TimMcI guess set literals and code-as-data just don't mix all that well.
10:06bobwilliamsanyone have experience with: clj-http.client?
10:06dakronebobwilliams: yes a little ;)
10:07bobwilliamsdakrone: haha!
10:07bobwilliamsi'm using your post to make a call to cleverbot's http://www.cleverbot.com/webservicemin
10:08bobwilliamsall is good but getting an error on invalid cookie header. MalformedCookieException Unable to parse expires attribute
10:08bobwilliamsis there a way to set this?
10:08bobwilliamsi'm a n00b so sure i'm just missing something simple
10:08dakronebobwilliams: how are you sending the request? what options are you passing?
10:09bobwilliams:body <url encoded param string> :client {"http.useragent" "clj-http"}
10:09bobwilliamsi have :debug and :debug-body both set to true
10:10bobwilliamsthat's all though
10:10dakroneso you're getting that exception when the cookie header is parsed then
10:10bobwilliamsusing requestmaker.com and/or httpclient.app it works for me
10:10bobwilliamsbelieve so
10:11dakronebobwilliams: do you have a stacktrace with a line-number in clj-http?
10:11bobwilliamsMalformedCookieException Unable to parse expires attribute: "Fri, 15 Aug 2014 15:07:08 GMT" org.apache.http.impl.cookie.BasicExpiresHandler.parse (BasicExpiresHandler.java:60)
10:43MaxDHHi, I'm trying to use 'use-fixtures' in conjunction with test selectors to stop Travis from running certain tests that require database connections. However the build is failing due to these tests within use-fixtures. So I was wondering if there is a way to use test selectors and use-fixtures together?
10:43MaxDHThanks
10:47stompyjdoes anyone here use clojure for “big data” purposes?
10:50TimMcstompyj: Define "big data". :-)
10:50stompyjI know
10:50stompyjI hate even saying the word
10:51stompyjbut what I mean is, using clojure for working with spark, kafka, cassandra, etc
10:51stompyjI’m about to build an event-based system
10:51llasramstompyj: Yes. We use Clojure on Hadoop MapReduce and HBase
10:51llasramI wrote https://github.com/damballa/parkour/ and use it daily on multi-TB datasets
10:51stompyjand I really want to use clojure, but scala seems to have a lot of momentum in the space
10:51stompyjllasram: thanks, I’ll check this out
10:52stompyjI know clojure is well supported w/r/t storm and hadoop
10:58TimMcstompyj: But seriously, what are your needs?
10:59stompyjTimMc: just kafka, storm and spark, to start
10:59stompyjI guess I’m just asking a broader question, data transformation seems like a slam dunk for clojure
11:00stompyjbut there seems to be less emphasis on it, atm (which is fine)
11:30llasramstompyj: What do you mean by "less emphasis on it"?
11:32ToxicFrog"Wrong number of args (-1) passed to: core/filter"
11:32ToxicFrogum
11:32stompyjthe amount of perceived activity and energy around that space seems less enthusiastic then in the core.async / clojurescript / web programming / other topics
11:32llasramToxicFrog: Now that is a sweet error
11:33llasramstompyj: I think there's just fewer people doing distributed data-processing in general, and no big companies using the language for distributed data-processing the way e.g. Twitter is with Scala
11:33ToxicFrogllasram: I know!
11:33stompyjllasram: 100% agreed
11:34stompyjthats why I came here to see if people are doing it, but not talking about it
11:34stompyjbecause clojure actually seems a better language fit for this stuff then scala
11:34stompyjand as I take this new gig, I’m going to have to think very hard about whether i should use scala or clojure
11:34stompyjif*
11:34ToxicFrogThe actual error is that I typed (filter (fn [[k v]] (keyword? k) xs)) rather than (filter (fn [[k v]] (keyword? k)) xs)
11:35ToxicFrogBut what an error message
11:35llasramstompyj: I don't know Scala's collection libraries well enough to compare, but I do find Clojure's reducers abstraction (and probably transducers) to be well-suited to writing programs over distributed data
11:36stompyjllasram: yeah, exactly
11:36BronsaToxicFrog: there's already a ticket in JIRA for that
11:36stompyjwe’re on the same page
11:36stompyjmost of the shops here in NYC are using Scala to do this kind of stuff atm
11:36stompyjat least the ones I’ve talked to
11:37llasramstompyj: Well, give Parkour a try vs e.g. Scalding or SCrunch.
11:37stompyjllasram: I absolutely will! thanks!
11:37llasramAlthough if you wait a few days, I should have a new release out w/ some nice new features
11:38llasramCool beans
11:38stompyjyeah, I don’t have th gig yet
11:38stompyjhaha
11:38stompyjso I have time
11:43lvhis there a println that for some value that can be described as a literal, gives me the literal?
11:43lvhi.e. it will quote lists etc
11:43llasramlvh: prn?
11:44llasram,(prn [1 #{2} [3]])
11:44clojurebot[1 #{2} [3]]\n
11:44lvhmaybe :)
11:44lvhthanks!
11:44mdrogalisHey stompyj. I specialize in building batch and stream processing systems with Clojure. Can answer questions if you need. :)
11:44stompyjmdrogalis: hey! I’ve read a bunch of your blog posts
11:44stompyjgreat stuff
11:45mdrogalisstompyj: D'aw. Thanks. :)
11:45stompyjmdrogalis: there’s nothing specific, it’s more about hiring, and defending the usage of clojure over scala, from a business perspective
11:46mdrogalisstompyj: I've found that these problems end up being less about language and more about mechanism to be honest.
11:46stompyjmdrogalis: what do you mean?
11:47mdrogalisstompyj: It's a little hard for me to articulate, but when I say mechanism I mean something like map-reduce, or a queueing-type system.
11:48stompyjohhh
11:48stompyjyeah, I agree
11:48mdrogalisThere's a lot of bindings to each of those, but once you've lock into one, you're kind of there, you know?
11:48stompyjyeah
11:49stompyjbut this is less about code execution and more me pitching a company on why I’m going to use clojure, and how this is more efficient, not necc. from a code perspective, but from a leaning on open-source, and hiring perspective
11:49stompyjwhich is why I was looking to find more people working on these kinds of problems
11:49mdrogalisstompyj: Got it. Sounds like you're a consulting engineer, or battling upwards in your own company?
11:49stompyjas positive signaling that I won’tbe writing custom libs for everything
11:49lvhIs there any diference between (hash-map k0 v0 k1 v1) and {k0 v0 k1 v1}?
11:50stompyjmdrogalis: consulting engineer to start, with the idea of running data operations for them long term, building a team, etc
11:50mdrogalisstompyj: Cool :)
11:51stompyjmdrogalis: yeah, and we may have the time to allow me to go clojure, and build libs as I need them, but I want to be able to present truthful options to the potential client
11:52mdrogalisstompyj: Yeah, definitely depends on the problem. Aside from that, I can at least say that Clojure's tight number of types makes working with intermediaries extremely easy, since you never get far away from the basic data structures.
11:52mdrogalisThere's no boiler plate object transformation code to custom interfaces or something like that
11:52boxedman, the clojure reddit is so damn poisonous :(
11:53stompyjmdrogalis: exactly!
11:53boxed“I disagre with his point, DOWNVOTE”
11:53stompyjthats why I’d have thought lots of data aggregation / event streaming enthusiasts would be using clojure for these problems
11:54stompyjbetween transducers, core.async, immutable collections, you have everything you need
11:55mdrogalisstompyj: Most people I meet who sell themselves as engineers for bigger data sets are Java enterprisey people. :
11:55mdrogalis:/*
11:55stompyjmdrogalis: yeah, its deeply frustrating hahaahha
11:56stompyjat this stage of my career I just want to solve big problems, I’m less concerned with language, so I’d use scala if I had to, however, I’m MUCH rather use clojure :D
11:56stompyjI’d*
11:57mdrogalisUnderstandable.
11:58whodidthiswhat happened to all the cool presentation vidyas from euroclj/strangeloop
11:58whodidthisor did they happen (2014)
12:00mdrogalisstompyj: Is the client looking at a batch or event stream processing problem?
12:00stompyjmdrogalis: they don’t know, I’m pitching starting with an event stream
12:00stompyjthen as we collect data, and understand our needs better
12:01stompyjbringing in something like spark for the batch piece
12:01mdrogalisstompyj: Pretty cool.
12:02stompyjmdrogalis: yeah! we’ll see if it happens, would be super exciting
12:02mdrogalisI'm going to be open sourcing a batch/streaming hybrid for Clojure in about a month. Hopefully it'll wake up some of the dormant Clojure space, kind of like you mentioned.
12:04llasrammdrogalis: Stand-alone, or built on top of existing tech?
12:05mdrogalisllasram: Its a standalone.
12:06stompyjmdrogalis: nice! I think this is a space that clojure could really dominate
12:07stompyjif we can get some more wind behind the sails,
12:07stompyjsounds like llasram and you are doing some great work on this already tho
12:07stompyjI’m curious what nathan marz is up to as well
12:07mdrogalisHe's been pretty quiet for a while.
12:08stompyjyeah
12:11Major_Crixus!rules
12:12gf3yogthos: hey cool secretary article 😏
12:14arohnerI have an Om single-page app. Is goog.events/listen the preferred way to catch navigation events?
12:16arohnerlisten on an goog.history.Html5History
12:16bbloom_arohner: om/react don't help with html5 history at all, so yeah, you can use goog.events or you can use whatever other js lib you prefer for that task
12:17arohnerI'm seeing what appears to be an advanced compilation bug (on google's side), so I'm not sure if I'm on the right track
12:18arohnerwhich is obviously unlikely
12:18gf3arohner: you actually might be interested in https://github.com/gf3/secretary
12:18gf3arohner: which works with both history and html5history (or anything else really)
12:19arohnergf3: I'm using secretary, but this code catches events through google.history.Html5History and then dispatches to secretary
12:20arohnerbut the event google passes in to the event listener appears to be missing the critical field under advanced compilation, but not in whitespace
12:20gf3arohner: ohhh i think we ran into that once
12:21gf3arohner: this might be related → https://github.com/gf3/secretary/issues/14
12:22arohnergf3: I don't understand how?
12:23gf3arohner: what info is missing?
12:23arohnergf3: the 'token' field on the event
12:24michaelr525arohner: how Html5History is beter than History?
12:24gf3arohner: and how're you grabbing it?
12:24arohnermichaelr525: I don't know, this is inherited
12:24gf3michaelr525: it doesn't use `document.location.hash`
12:24arohnergf3: aget. also missing when logged via console.log
12:24gf3michaelr525: it uses the HTML5 push/popstate api
12:25michaelr525oh
12:25michaelr525gf3: thank
12:25michaelr525gf3: btw, i'm using secretary too in a small om app :)
12:25gf3michaelr525: yayyyy :)
12:26gf3arohner: are you able to provide me with a paste via refheap.com ?
12:26arohner yeah, one sec
12:27arohnerthe app is based on omchaya, and looks like there's been a fix to omchaya. testing that first
12:27arohneryeah, ok
12:27arohnerusing (.-token e) rather than (aget e "token") fixed it
12:28arohnerwhich is kind of obvious now
12:28arohnerI'm kind of impressed closure strips fields out of events
12:28gf3arohner: :) excellent
12:28arohnergf3: thanks for your help
12:29gf3arohner: np—glad it worked out
12:30ToxicFrogSo, I can destructure maps where the keys are keywords with {:keys [x y z]}, which will fish out :x :y :z from the map.
12:30ToxicFrogIs there an equivalent for when the keys are symbols rather than keywords?
12:30arohner:syms
12:30michaelr525gf3: i wonder, why didn't they just add the pop/push state capabilities to History instead of creating another class?
12:31gf3michaelr525: because it's not applicable in all situations
12:31arohner,(let [{:syms [a b c]} '{a 1 b 2 c 3}] b)
12:31clojurebot2
12:31arohnerToxicFrog: ^^
12:31gf3michaelr525: for instance older browsers don't support it, or there might be cases where you need to use the hash
12:31arohnerthere's also :strs
12:32michaelr525gf3: so they wanted to keep the interface for backward compatibility, or something
12:32abakerthere a clojure version available in maven/clojars that has transducers, like 1.7.0-alpha1 or whatever?
12:32michaelr525gf3: i'd rather have one class which uses the html5 features when available and falls back to hash otherwise..
12:33_alejandroabaker: yes
12:33_alejandro[org.clojure/clojure "1.7.0-alpha1"]
12:33abakercool, thanks
12:37gsdfvuwarning
12:37gsdfvu you may be watched
12:37gsdfvudo usa&israel use the internet(facebook,youtube,twitter, chat rooms ..ect)to spy??
12:37gsdfvudo usa&israel use the internet 2 collect informations,,can we call that spying??
12:37gsdfvudo they record&analyse everything we do on the internet,,can they harm you using these informations??
12:37gsdfvuتحذير
12:37lazybotgsdfvu: What are you, crazy? Of course not!
12:37lazybotgsdfvu: Definitely not.
12:37lazybotgsdfvu: Definitely not.
12:52mdeboarddnolen_: Any possibility of adding some repl options to mies? I'm struggling with how to set up a mixed-source (clj+cljs) project such that the repl is useful in both (including connecting browser to repl etc.)
12:53mdeboardor I guess if anyone can point me to such a thing
12:53mdeboardall the repl documentation is confusing since there's like a four-square grid of meanings to "repl": clj vs. cljs, in-emacs vs. command-line repl
12:54dnolen_mdeboard: not planning on adding any REPL support to mies in the near future
12:55mdeboardok. thanks
12:57mdeboarddnolen_: So do you just use the command line repl for cljs work then? That seems the most clear-cut wrt integration with the browser and so forth.
12:57dnolen_mdeboard: inferior-lisp in Emacs
12:58mdeboardcemerick's "austin" lib works perfectly with command line, but I'm not sure where hte line is between austin & piggyback
12:58mdeboardoic
12:58dnolen_mdeboard: been thinking about improving REPL support but don't know when I'll get around to it
12:59mdeboardI understand
12:59bbloom_i've found weasel to be much more reliable
12:59mdeboardweasel?
12:59clojurebotweasel is https://github.com/tomjakubowski/weasel/
12:59mdeboardthanks clojurebot
13:00mdeboardbbloom_: oh interesting
13:00mdeboardI guess I need to understand how nrepl works
13:00mdeboardI think that's my prob
13:00mdeboardnrepl?
13:00clojurebotnrepl is a network REPL implementation: http://github.com/clojure/tools.nrepl
13:00bbloom_~botsnack
13:00clojurebotThanks! Can I have chocolate next time
13:01mdeboardYou'll have botsnacks and you'll like it.
13:02mdeboardMaybe I should sign up to do an nrepl talk or something
13:16TimMc$botsnack
13:16lazybotTimMc: Thanks! Om nom nom!!
13:18{blake}I have a multimethod with a :default but I'm still getting a "No method in multimethod for dispatch value" error. How is this possible?
13:20{blake}Must the namespace that contains the new type use the namespace that contains the :default method?
13:21hiredman{blake}: yes, you have to load code for it to do anything
13:21llasram{blake}: You do need to ensure that an implementing namespace is loaded in order for the implementation to exist
13:22{blake}The code is loaded. I have a system that includes a number of types, :int, :decimal, :float, etc., and I've added a new type in a new file.
13:23{blake}And the default gets called for those other types. And the only difference I can observe is that the new type is in its own file.
13:23llasram{blake}: Can you produce a minimal reproducing example?
13:24llasramBecause my understanding of the behavior you are describing is that it's not what should happen
13:24{blake}llasram, Not easily. OK, if it's not what should happen the problem must lie some place else. I'll continue to investigate.
13:24ToBeReplacedjustin_smith: i reworked register! and added some other goodies... getting close to a 0.1.0 release
13:27justin_smithToBeReplaced: oh, nice, I'll check it out
13:27justin_smithI still plan to work on it more, had some distractions in my personal life recently that got me off track
13:28{blake}llasram, hiredman OK, mystery solved. In the particular test cases the code WASN'T being loaded. Thanks!
13:29{blake}(inc llasram)
13:29lazybot⇒ 33
13:29{blake}(inc hiredman)
13:29lazybot⇒ 52
13:56martinklepschI use lein-garden which requires an old version of garden — is there any way to override a dependency's version of dependencies. (huh!)
13:56martinklepschI tried :exclusions but then it seems to be completely gone and can't be found anymore
14:05martinklepschsomehow I must have messed up things really well... leiningen constantly tries to use garden 1.1.5 although I have garden 1.2.1 in :dependencies & made my own lein-garden that depends on 1.2.1
14:05martinklepsch(instead of 1.1.5
14:12SegFaultAXmartinklepsch: Whatever you did, it didn't work.
14:12SegFaultAXJust thought I'd clear that up for you. :)
14:13llasrammartinklepsch: The project :dependencies are the dependencies for any project JVMs, which are different from the dependencies for the JVM for Leiningen itself
14:13llasramIf `lein-garden` is in your :plugins, then it and its dependencies will be pulled into the Leiningen JVM (which sounds like what you want)
14:14llasramIf you built a new version of lein-garden w/ the new dep, then make sure your :plugins specifies the correct variant version you built
14:14grache28"apply 0 f x = x ; apply n f x = f ( (apply (n-1) f) x)" - What's going on there? It's calling f which returns x, n times?
14:14grache28Sorry if syntax is off and for very basic question
14:15llasramgrache28: Wrong channel?
14:16TEttingergrache28, I'm guessing that's a haskell question?
14:18grache28TEttinger: ok, sorry for the mix up, the language wasn't stated in the example
14:18TEttingerwhere'd you get it I wonder?
14:19SegFaultAXLooks like iterate
14:19mdeboardhuh. TIL about inferior-lisp
14:19grache28TEttinger: university material - can ask prof. after weekend
14:19TEttingeras in "lisp that was not invented here" mdeboard?
14:20mdeboardTEttinger: hehe no the emacs command
14:20TEttingerthat's exactly what I mean, mdeboard
14:20TEttingerdoesn't it only consider emacs lisp full lisp?
14:20clojurebotexcusez-moi
14:20amalloyyeah, looks like iterate in haskell
14:21SegFaultAXA strange way to write iterate.
14:21mdeboardTEttinger: idk, it's what dnolen_ said he uses for cljs repl
14:21amalloywell, a little weird. it's like !! and iterate glued together
14:21SegFaultAXYea
14:21TEttingerand apply is a pretty overused name to be declared in user code like that
14:21SegFaultAXUsually `iterate f x = x : iterate f (f x)` will do ya
14:22amalloymaybe they should call it `data` instead, TEttinger
14:22SegFaultAXTEttinger: No kidding.
14:22TEttingerit doesn't appear to be creating a seq, does it?
14:22mdeboardTEttinger: Doing M-x inferior-lisp in a cljs buffer definitely opens a clojure repl so it (inferior-lisp) may have a hook that clojure-mode hooks into
14:22amalloyno. like i said, it's iterate and !! (which is nth)
14:22SegFaultAXTEttinger: That's why it's iterate + !!
14:22SegFaultAXJinx
14:22TEttingerI didn't recognize !! , not being a type nerd :)
14:23SegFaultAX?
14:23SegFaultAXIt's just a function
14:23TEttingerI don't use haskell
14:23TEttingerI tried to learn it once
14:23SegFaultAXBut then you took an arrow... I'm so sorry.
14:24TEttingerthis was when people insisted on callin monads "warm fuzzy things" to avoid having to think about them
14:25SegFaultAXWas this like 15 years ago?
14:25TEttingercloser to 8
14:25TEttingerI'm sure haskell
14:26TEttingerI'm sure haskell's a fine language if you think in typesystems
14:26TEttingerhttp://tpolecat.github.io/assets/list.png
14:26SegFaultAXHaskell is no different than any other tool. It has a range of problems it's well suited for, and a range of problems it isn't.
14:26TEttingerthat's Scala's List class superclass diagram
14:26bbloom_TEttinger: that graph makes me laugh every time
14:26SegFaultAXDepending on the fanboyism of whom you're talking to, that range will grow and shrink accordingly
14:27bbloom_i mean, clojure's seq/coll stuff is pretty complex too
14:27bbloom_but that's just fun
14:27TEttingerbbloom_, yeah I guess
14:27SegFaultAXbbloom_: If by laugh, you mean weep tears of blood, yea me too.
14:27TEttingerScala seems to have a phobia of nil
14:27mdrogalisDoes anyone know when the Conj talks get announced? Can't remember if it was today or next week.
14:27SegFaultAXTEttinger: It's a good phobia to have.
14:27TEttingerclojure just handles nil...
14:28TEttinger,(seq nil)
14:28clojurebotnil
14:28SegFaultAXBecause Clojure tries to make nil act like nil in some other lisps (which is the same as ())
14:28SegFaultAXUnless it doesn't, then NPE wheeee
14:29TEttingerSegFaultAX, I can't even remember the last NPE I got in clojure
14:29bbloom_the NPE issue is b/c nil isn't an object, like in smalltalk or ruby or whatever
14:29bbloom_it's not a problem with the concept of a universal nil value, it's a problem with the implementation of it as a null pointer
14:29SegFaultAXCorrect
14:30TEttingerI do recall some fun bugs to track down in C#
14:30bbloom_but we can extend protocols to nil :-)
14:30SegFaultAXTEttinger: Again, because many times you're working with things that expect sequences, and nil is just an empty sequence in that context.
14:30SegFaultAXThis is not an unusual property of lisps.
14:30TEttingerif you use GDI+ to try to get a subset of an image that is larger than the image itself, it doesn't give a nice error, it gives an Out of Memory exception
14:31TEttingerthis was hard to track down
14:31SegFaultAXMaybe they meant "out of the memory region of this image!"
14:31SegFaultAXAnd thought OOM sounded nicer.
14:31TEttingerwhich would have been nice to know!
14:31stompyjbut type systems!
14:31TEttingerstompyj, heh
14:32stompyjsorry, I saw Haskell in the convo, and thought it would be appropriate :D
14:32stompyjI have equal love for clojure and haskell
14:32martinklepschcan I somehow list out :plugin dependencies?
14:32arrdemstuck in IO monad pls send help
14:32SegFaultAXTEttinger: The thing about advanced type systems is... it's truly shocking just how much stuff can be decided statically (eg at compile time)
14:33TEttingerand yeah C# has been moderately-decent for what I've been using, which is basically array-heavy code that sometimes needs to break out into functional guitar solos
14:33SegFaultAXHaskell certainly tries to push that to the logical extreme in some cases.
14:33SegFaultAXAnd dependent types allow you to take it further still.
14:33SegFaultAXBut being able to identify a huge category of bugs without ever having to /run your program/ is a pretty nice property.
14:34TEttingeroddly enough, the fastest speedup in my C# code has been a relatively small, relatively challenging function that uses raw memory writes. and that didn't throw memory errors, ever
14:35SegFaultAXAnd that property extends over most statically typed languages to a certain degree. Even relatively crappy ones like C, C++, and Java.
14:36TEttingerthe problem I had was entertaining to look at and possibly informative. https://dl.dropboxusercontent.com/u/11914692/Artillery_S_Large_face0_0.png is how it should look.
14:36TEttingerbut it ended up generating https://dl.dropboxusercontent.com/u/11914692/Artillery_S_Large_face0_0_nogreen.png
14:37TEttingerthe issue had to do with ARGB beingstored as BGRA in memory (big endian vs. little endian)
15:37akhudekI just want to double check that my understanding is regarding om. You generally shouldn’t use set-state outside of one of the om events: will-update, did-updated, etc. E.g. you shouldn’t use set-state in a callback?
15:47bbloom_akhudek: you can use set state in a callback
15:47bbloom_akhudek: http://facebook.github.io/react/docs/forms.html
15:48akhudekbbloom_: hmm. Ok curious. I seem to be encountering a case where state is not triggering a re-render. I’ll do into some more. I’m probably not on the latest om either, so will check that. Thanks.
15:48akhudeks/do/dig/
16:09martinklepschis there something like lein deps :tree for plugins in my project?
16:10xeqimartinklepsch: lein deps :plugin-tree
16:13supersymcool..didnt know that one
16:14martinklepschxeqi: thanks!
16:16martinklepschI have [garden "1.1.5"] nowhere in there but keep getting this error + a stacktrace that (I think) wouldn't come up if the right version is used
16:16martinklepsch(WARNING!!! version ranges found for:)
16:16martinklepsch([garden "1.1.5"] -> [com.keminglabs/cljx "0.3.1"] -> [org.clojars.trptcolin/sjacket "0.1.0.3"] -> [org.clojure/clojure "[1.3.0,)"]
16:16martinklepschConsider using [garden "1.1.5" :exclusions [org.clojure/clojure]].)
16:21martinklepschAny ideas what could cause that? Here is my project.clj: https://gist.github.com/1fbb4961f902daf4e851
16:23hyPiRionmartinklepsch: could you provide the output of `lein deps :tree`?
16:24hyPiRionmartinklepsch: oh wait, https://github.com/noprompt/lein-garden/blob/master/src/leiningen/garden.clj#L112-L114 seems to be injected
16:25hyPiRionI guess you should add an issue to the plugin, because that's not good style
16:27martinklepschhyPiRion: ohhh!
16:27martinklepschthat makes sense!
16:27akhudekhmm, strange, I can clearly see that it’s calling the set-sate, yet om/react doesn’t always trigger a render from it
16:28hyPiRionI think a short article on how to write proper lein plugins would be worth looking into.
16:28martinklepschhyPiRion: is there a reason why that injection there could make sense?
16:31martinklepschhyPiRion: I'd happily write a patch but I'm not sure what's the right way — should I just remove the profile/with-profile stuff?
16:34hyPiRionmartinklepsch: they are running an `eval-in-project` call, so they want to ensure the project depends on garden and that other dependency. If you add ^:displace to both dependency entries, I think it should be fixed
16:35hyPiRionthat is, it should be {:dependencies '[^:displace [garden "1.1.5"] ^:displace [ns-tracker "0.2.1"]]}
16:42weiwhat’s the recommended way to do interprocess communication between clojure programs?
16:51justin_smithwei: you could use a java IPC like RMI
16:51justin_smithor whatever is easiest to use on a platform specific basis I guess
16:54weisomething like netflix’s ribbon? i was originally thinking of using redis queues, but that doesn’t have easy two-way communication
16:55akhudekwei: we use rabbitmq
16:58weiakhudek: and Langohr, i presume?
16:58akhudekwei: yep
16:58weiwhy did you choose rabbitmq over the alternatives? e.g. redis
16:59weiguaranteed delivery?
16:59akhudekthat, plus durability, high availability and a message passing abstraction just worked better for us
17:00akhudekprocesses pass larger pieces of data around via postgresql
17:01akhudekbut that doesn’t help indicating that something has changed and work needs to be done
17:01akhudekthat’s where rmq comes in
17:01bbloom_guarenteed deliverability is a lie...
17:01bbloom_http://aphyr.com/posts/315-call-me-maybe-rabbitmq
17:01bbloom_better to plan for dropped messages than to cross your fingers and hope
17:03technomancybbloom_: sure, but compared to redis?
17:03bbloom_technomancy: i wasn't comparing to redis
17:03bbloom_im just saying: in general, queues drop messages
17:05mdrogalisbbloom_: I think that's a pretty sharp statement to make.
17:06mdrogalisThere're a lot of queues that have transactions, and do durable writes.
17:06weibbloom_: so, how do you generally plan for dropped messages, if you require guaranteed deliverability? e.g. payment notifications
17:07bbloom_wei: retries, idempotency, associativity, commutativity, etc
17:09weibbloom_: is there an article discussing it in more depth?
17:10weie.g. how do you make payments commutative?
17:11bbloom_wei: the same way banks do it: with a line of credit :-)
17:11mthvedtwei: a surprising amount of payments in the financial system are assumed in the short run to be commutative
17:11technomancybank accounts are the worst examples for consistent distributed systems documentation
17:11bbloom_technomancy: yeah seriously
17:12bbloom_everybody is like "so you want to do an atomic account decrement" but then nobody actually ever does that
17:12bbloom_they do double entry accounting, etc
17:12mthvedttechnomancy: they have the best consistency implementation in existence. if you cause an inconsistency you pay a $35 overdraft fee
17:12mthvedtwho needs fancy computer science theory
17:12mdeboardlol
17:12mdeboardsocial engineering uber alles
17:12bbloom_mthvedt: consistency by fiat
17:12technomancymthvedt: oh man I would love to see that proposed at a startup
17:12weithis is bitcoin related so credit doesn’t quite work. if someone withdraws their “credit”, it’s gone
17:12mdeboardpavlov-driven development
17:13bbloom_wei: when you deal with external systems that don't support sensible distributed semantics, you need to be more cautious....
17:13bbloom_bitcoin itself is robust(ish?) to this sort of thing
17:13bbloom_but random REST APIs for it aren't going to be
17:14weifor one, it’s idempotent thanks to payment hashes
17:14bbloom_organizations like coinbase operate like banks, they have extra money/bitcoin to cover discrepencies, and they work it out later
17:15technomancyeventual consistency is a thing
17:15weialthough with that systme, if your missed / doubled transaction is for a huge amount relative to your reserves, you’re screwed
17:16bbloom_technomancy: unless your hewitt, in which case you don't think any consistency is a thing
17:16bbloom_wei: you ever have to wait for a check to clear?
17:16weiand for a toy project like mine that’s entirely possible
17:16bbloom_banks do things to mitigate problems like that
17:17bbloom_when you start talking about larger amounts of money, consistency becomes even more strange
17:17bbloom_like if you have more money than the FDIC insurance limit (250k?) then suddenly all sorts of stuff is slower and weirder
17:17weii guess that’s why coinbase much longer than the blockchain to confirm a transaction
17:17technomancybbloom_: I'm no platonist, but I'm inclined to agree when it comes to the physical realm.
17:18mthvedtbbloom_: when finance companies deal with each other, there basically aren’t any rules
17:18mthvedtwhen i worked at an exchange every so often we’d get a call
17:18mthvedt“hey you misplaced some trades/a few million dollars"
17:18bbloom_technomancy: it's like how all machines are actually finite state machines... sure you've got a finite amount of memory, but you still treat it like a turing machine... same deal w/ eventual consistency. it may not actually exist in practice, but it's a useful concept to reason about
17:19technomancybrb staring at flickering shadows
17:21weianyways, thanks for the thoughts. i’d appreciate any literature you guys have on the subject. i basically want guaranteed deliverability and de-duping, whether it’s guaranteed by the messaging system or by a particular system design
17:23mdrogaliswei: I can share a little from the toolchain that I work with. HornetQ supports transactions across queues with durable writes. That might buy you what you're looking for.
17:24mdrogalisI think ActiveMQ can do the same.
17:24akhudekmdrogalis: bbloom was pointing out that it’s still possible in weird conditions to lose messages or get duplicates
17:25technomancydilemma: do you use the systems that aphyr *has* blogged about even though they are all subject to various failures, or the ones he *hasn't* blogged about, because you know, they could be good. =)
17:25mdrogalisakhudek: Got it.
17:25bbloom_mdrogalis: it's worth reading the entire call-me-maybe series
17:26akhudektechnomancy: better the problems that you know about?
17:26akhudektechnomancy: it’s unlikely that others have any better solutions since these problems are genuinely difficult
17:26mdrogalisbbloom_: I've read a lot of it. But at the end of the day, I actually have to ship stuff without rewriting huge pieces of infrastructure that I woulnt get 100% correct
17:28akhudekack, ok, om is 100% not always triggering a rerender on state change
17:28bbloom_mdrogalis: i'm not suggesting you write custom infrastructure, i'm suggesting you put a little extra data in to your messages and process those messages in a way that is tolerant network truths
17:28akhudekvery sodd
17:28akhudekodd even
17:29mdrogalisbbloom_: No disagreement there, for sure.
18:07akhudekany om wizards around?
18:08akhudekI have a case where I call set-state! in a callback yet even should-update isn’t triggered
18:33danielcomptonIs clojars.org unavailable for others or just me?
18:34Bronsait's working for me
18:38johnwalkeri'm familiar with lein do {task}, {task}, {task}
18:39johnwalkeris there a way to change the project context for successive tasks ?
18:39johnwalkerfor example - lein do new mies-om, {change-ctx}, ancient upgrade
19:03xnullhei
19:03xnulloops
19:06technomancyjohnwalker: sure: lein do thingy, with-profile +p1 other-thingy
19:07technomancyjohnwalker: if your first task returns a project map there is also https://github.com/technomancy/lein-thrush but I'm not as confident of that
20:35TimMctechnomancy: What's the associativity of ,? :-P
21:32ben_vulpesi've got an enlive question - this refheap ((html/clone-for [[ad] [advertisements]]
21:32ben_vulpes [:tr.ad-data]
21:32ben_vulpes (html/clone-for [[copy url bid] [ad]]
21:32ben_vulpes [:td.copy] (html/content (str copy))
21:32ben_vulpes [:td.url] (html/content (str url))
21:32ben_vulpesah nuts.
21:33ben_vulpeshttps://www.refheap.com/89215 <- that refheap is only returning the td.copy node, and not the url or bid nodes.
21:33ben_vulpesi've verified that copy url and bid are all in scope at that time, but can't seem to get the clone-for to make all the nodes i'm looking for
22:08ToBeReplaced[ANN] https://github.com/ToBeReplaced/nio.file 0.1.0 , for those interested in using java.nio.file.* classes and methods from clojure
22:25ben_vulpesToBeReplaced: neat stuff. looking forward to it.
22:26ToBeReplacedthanks
23:45arrdemToBeReplaced: so at what point is your name just never going to be replaced :P
23:47ToBeReplacedarrdem: idk, it seems like a nice UUID, and keeps in-person separate from not-in-person