2014-08-15
| 00:17 | zkanfer | I 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:25 | TEttinger | zkanfer: http://stackoverflow.com/a/23440306/786740 |
| 00:25 | TEttinger | it isn't supported but can be done |
| 00:29 | zkanfer | TEttinger: Thanks. So I need to somehow include proxy.js in my clojurescript code, then call (js/proxy (str "Math/" "E"))? |
| 00:32 | zkanfer_ | TEttinger: Ugh, Firefox just crashed. If you responded to my last question (how to use the StackOverflow answer), I didn't see it. |
| 00:35 | TEttinger | zkanfer_, good ol' firefox crashes |
| 00:35 | TEttinger | I'm amazed at how often it crashes now |
| 00:36 | zkanfer_ | Yeah, not even sure why -- I wasn't doing anything bad, I swear! |
| 02:23 | andyf | I 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:24 | pyrtsa | andyf: At least you could use (map-indexed vector) there. |
| 02:25 | pyrtsa | I mean (map-indexed vector some-sequence), of course. |
| 02:25 | andyf | pyrtsa: Yes, that is quite a bit better |
| 02:25 | pyrtsa | Defining (def enumerate (map-indexed vector)) could be useful. |
| 02:26 | andyf | You mean with partial before map-indexed? |
| 02:26 | pyrtsa | Bah, partial yes. |
| 02:27 | pyrtsa | Should probably have another cup of coffee this morning. :) |
| 02:27 | andyf | np. You didn't have my senior moment of writing (fn [idx x] [idx x]) at least :) |
| 02:27 | pyrtsa | :) |
| 02:28 | andyf | ,(inc pyrtsa) |
| 02:28 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pyrtsa in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 02:28 | andyf | shoot, I don't use this stuff often enough to remember the right syntax |
| 02:28 | pyrtsa | :| |
| 02:29 | pyrtsa | Without a leading comma, I guess. |
| 02:29 | andyf | (inc pyrtsa) |
| 02:29 | lazybot | ⇒ 7 |
| 02:29 | pyrtsa | Gee, thanks! |
| 02:32 | andyf | Wow, we are up to 1332 accounts on Clojure JIRA (noticed only because of adding a count to my program that calculates weighted votes) |
| 04:42 | H4ns | s |
| 05:04 | michaelr525 | hello |
| 05:05 | hyPiRion | hi |
| 05:09 | michaelr525 | what's up in clojureland? |
| 05:13 | hyPiRion | not much |
| 05:13 | michaelr525 | good |
| 05:13 | hyPiRion | silence this early, as all 'muricans are sleeping |
| 05:13 | michaelr525 | usually there is too much so i just can't keep up with everything ;) |
| 05:14 | hyPiRion | hah |
| 05:23 | michaelr525 | yogthos: hi |
| 05:23 | michaelr525 | yogthos: your blog, does it also render on the server? |
| 05:23 | michaelr525 | yogthos: for google and such.. |
| 05:47 | Killombre | Hello max |
| 06:36 | ponpal | How can I evaluate (use 'clojure.repl) automatically everytime I use cider-jack-in in emacs? |
| 06:39 | milos_co1agen | perhaps check out http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded section 'Dev profile and user.clj'? |
| 06:40 | luxbock | ponpal: you can add `:injections [(use 'clojure.repl)]` to your profiles.clj |
| 06:40 | luxbock | this only makes it be present in the user namespace though |
| 06:40 | thesaskwatch | Hi, anyone has a good way to manage unbalanced parentheses when in paredit mode? Or a differerent mode/improvement to easily find/match brackets? |
| 06:41 | luxbock | if you'd like to have those functions available in all of your namespaces then you should check out vinyasa |
| 06:41 | thesaskwatch | (I mean in emacs) |
| 06:41 | ponpal | Thanks a lot, I'll check that out. |
| 07:00 | TimMc | TEttinger2: Get yourself onto the Firefox ESR (Extended Support Release) track and it's a lot more stable. |
| 07:10 | michaelr525 | is there a log of the channel somewhere? |
| 07:22 | TimMc | ~log |
| 07:22 | clojurebot | see logs |
| 07:22 | TimMc | *sigh* |
| 07:22 | TimMc | ~logs |
| 07:22 | clojurebot | logs is http://clojure-log.n01se.net/ |
| 07:22 | hyPiRion | hah |
| 07:22 | TimMc | $log |
| 07:22 | TimMc | $logs |
| 07:22 | TimMc | http://lazybot.org/logs/#clojure/2014-08-15 |
| 07:25 | Bronsa | michaelr525: http://logs.lazybot.org/irc.freenode.net/#clojure |
| 07:46 | michaelr525 | Bronsa, TimMc: Thanks |
| 07:46 | michaelr525 | I get this: These are not the logs you're looking for. |
| 07:46 | michaelr525 | ah |
| 07:46 | michaelr525 | http://lazybot.org/logs/#clojure/2014-08-15 |
| 07:47 | michaelr525 | ^^^^^^^^ this worked |
| 08:02 | phillord | hmmm -- I am confused by this |
| 08:02 | phillord | (into {} [[:a 1][:b 2]]) |
| 08:02 | phillord | {:a 1, :b 2} |
| 08:02 | phillord | (into {} '([:a 1][:b 2])) |
| 08:02 | phillord | {:a 1, :b 2} |
| 08:03 | phillord | (into {} '((:a 1)(:b 2))) |
| 08:03 | phillord | ClassCastException clojure.lang.Keyword cannot be cast to java.util.Map$Entry clojure.lang.ATransientMap.conj (ATransientMap.java:44) |
| 08:03 | phillord | why does the last except? |
| 08:04 | hyPiRion | phillord: [a b] can be cast to a key entry, whereas '(a b)/(list a b) cannot |
| 08:04 | phillord | so, why not "clojure.lang.PersistantList cannot be cast to ...." |
| 08:05 | phillord | where does "Keyword" come into this? |
| 08:10 | hyPiRion | phillord: because (conj {} {:a :b :c :d}) == (conj {} (seq {:a :b :c :d})), confusingly enough |
| 08:10 | hyPiRion | ,(conj {} (seq {:a :b :c :d})) |
| 08:10 | clojurebot | {:a :b, :c :d} |
| 08:12 | phillord | you are right |
| 08:12 | phillord | I am confused:-) |
| 08:12 | hyPiRion | yeah, it's confusing |
| 08:13 | hyPiRion | ,(into {} [[(clojure.lang.MapEntry. :a :b)]]) |
| 08:13 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Vector arg to map conj must be a pair> |
| 08:13 | hyPiRion | ,(into {} [(list (clojure.lang.MapEntry. :a :b))]) |
| 08:13 | clojurebot | {:a :b} |
| 08:16 | phillord | does this count as a bug I wonder? |
| 08:24 | gfredericks | no, conj with maps is intentionally weird and confusing |
| 08:24 | gfredericks | I don't understand the intention but it's unlikely it was an accident |
| 08:24 | pyrtsa | phillord: Sounds like a question of whether the behaviour of (conj {} x) makes sense when x isn't a MapEntry nor a vector. |
| 08:25 | phillord | I should add it to my list of gotchas I guess |
| 08:26 | pyrtsa | The questionable code is this: https://github.com/clojure/clojure/blob/43cc1854508d655e58e377f84836ba128971f90c/src/jvm/clojure/lang/APersistentMap.java#L39-L45 |
| 08:26 | gfredericks | merge is implemented with the questionable part of conj |
| 08:27 | pyrtsa | As well as: https://github.com/clojure/clojure/blob/43cc1854508d655e58e377f84836ba128971f90c/src/jvm/clojure/lang/ATransientMap.java#L41-L47 |
| 08:27 | pyrtsa | gfredericks: Thanks! Was about to ask next if anyone knew of code paths touching that piece of code. |
| 09:35 | TimMc | Bronsa: 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:35 | TimMc | That would be pretty nasty. |
| 09:36 | Bronsa | TimMc: yeah |
| 09:37 | TimMc | I withdraw my objection on practical grounds. :-P |
| 09:53 | TimMc | I guess set literals and code-as-data just don't mix all that well. |
| 10:06 | bobwilliams | anyone have experience with: clj-http.client? |
| 10:06 | dakrone | bobwilliams: yes a little ;) |
| 10:07 | bobwilliams | dakrone: haha! |
| 10:07 | bobwilliams | i'm using your post to make a call to cleverbot's http://www.cleverbot.com/webservicemin |
| 10:08 | bobwilliams | all is good but getting an error on invalid cookie header. MalformedCookieException Unable to parse expires attribute |
| 10:08 | bobwilliams | is there a way to set this? |
| 10:08 | bobwilliams | i'm a n00b so sure i'm just missing something simple |
| 10:08 | dakrone | bobwilliams: how are you sending the request? what options are you passing? |
| 10:09 | bobwilliams | :body <url encoded param string> :client {"http.useragent" "clj-http"} |
| 10:09 | bobwilliams | i have :debug and :debug-body both set to true |
| 10:10 | bobwilliams | that's all though |
| 10:10 | dakrone | so you're getting that exception when the cookie header is parsed then |
| 10:10 | bobwilliams | using requestmaker.com and/or httpclient.app it works for me |
| 10:10 | bobwilliams | believe so |
| 10:11 | dakrone | bobwilliams: do you have a stacktrace with a line-number in clj-http? |
| 10:11 | bobwilliams | MalformedCookieException Unable to parse expires attribute: "Fri, 15 Aug 2014 15:07:08 GMT" org.apache.http.impl.cookie.BasicExpiresHandler.parse (BasicExpiresHandler.java:60) |
| 10:43 | MaxDH | Hi, 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:43 | MaxDH | Thanks |
| 10:47 | stompyj | does anyone here use clojure for “big data” purposes? |
| 10:50 | TimMc | stompyj: Define "big data". :-) |
| 10:50 | stompyj | I know |
| 10:50 | stompyj | I hate even saying the word |
| 10:51 | stompyj | but what I mean is, using clojure for working with spark, kafka, cassandra, etc |
| 10:51 | stompyj | I’m about to build an event-based system |
| 10:51 | llasram | stompyj: Yes. We use Clojure on Hadoop MapReduce and HBase |
| 10:51 | llasram | I wrote https://github.com/damballa/parkour/ and use it daily on multi-TB datasets |
| 10:51 | stompyj | and I really want to use clojure, but scala seems to have a lot of momentum in the space |
| 10:51 | stompyj | llasram: thanks, I’ll check this out |
| 10:52 | stompyj | I know clojure is well supported w/r/t storm and hadoop |
| 10:58 | TimMc | stompyj: But seriously, what are your needs? |
| 10:59 | stompyj | TimMc: just kafka, storm and spark, to start |
| 10:59 | stompyj | I guess I’m just asking a broader question, data transformation seems like a slam dunk for clojure |
| 11:00 | stompyj | but there seems to be less emphasis on it, atm (which is fine) |
| 11:30 | llasram | stompyj: What do you mean by "less emphasis on it"? |
| 11:32 | ToxicFrog | "Wrong number of args (-1) passed to: core/filter" |
| 11:32 | ToxicFrog | um |
| 11:32 | stompyj | the amount of perceived activity and energy around that space seems less enthusiastic then in the core.async / clojurescript / web programming / other topics |
| 11:32 | llasram | ToxicFrog: Now that is a sweet error |
| 11:33 | llasram | stompyj: 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:33 | ToxicFrog | llasram: I know! |
| 11:33 | stompyj | llasram: 100% agreed |
| 11:34 | stompyj | thats why I came here to see if people are doing it, but not talking about it |
| 11:34 | stompyj | because clojure actually seems a better language fit for this stuff then scala |
| 11:34 | stompyj | and as I take this new gig, I’m going to have to think very hard about whether i should use scala or clojure |
| 11:34 | stompyj | if* |
| 11:34 | ToxicFrog | The actual error is that I typed (filter (fn [[k v]] (keyword? k) xs)) rather than (filter (fn [[k v]] (keyword? k)) xs) |
| 11:35 | ToxicFrog | But what an error message |
| 11:35 | llasram | stompyj: 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:36 | stompyj | llasram: yeah, exactly |
| 11:36 | Bronsa | ToxicFrog: there's already a ticket in JIRA for that |
| 11:36 | stompyj | we’re on the same page |
| 11:36 | stompyj | most of the shops here in NYC are using Scala to do this kind of stuff atm |
| 11:36 | stompyj | at least the ones I’ve talked to |
| 11:37 | llasram | stompyj: Well, give Parkour a try vs e.g. Scalding or SCrunch. |
| 11:37 | stompyj | llasram: I absolutely will! thanks! |
| 11:37 | llasram | Although if you wait a few days, I should have a new release out w/ some nice new features |
| 11:38 | llasram | Cool beans |
| 11:38 | stompyj | yeah, I don’t have th gig yet |
| 11:38 | stompyj | haha |
| 11:38 | stompyj | so I have time |
| 11:43 | lvh | is there a println that for some value that can be described as a literal, gives me the literal? |
| 11:43 | lvh | i.e. it will quote lists etc |
| 11:43 | llasram | lvh: prn? |
| 11:44 | llasram | ,(prn [1 #{2} [3]]) |
| 11:44 | clojurebot | [1 #{2} [3]]\n |
| 11:44 | lvh | maybe :) |
| 11:44 | lvh | thanks! |
| 11:44 | mdrogalis | Hey stompyj. I specialize in building batch and stream processing systems with Clojure. Can answer questions if you need. :) |
| 11:44 | stompyj | mdrogalis: hey! I’ve read a bunch of your blog posts |
| 11:44 | stompyj | great stuff |
| 11:45 | mdrogalis | stompyj: D'aw. Thanks. :) |
| 11:45 | stompyj | mdrogalis: there’s nothing specific, it’s more about hiring, and defending the usage of clojure over scala, from a business perspective |
| 11:46 | mdrogalis | stompyj: I've found that these problems end up being less about language and more about mechanism to be honest. |
| 11:46 | stompyj | mdrogalis: what do you mean? |
| 11:47 | mdrogalis | stompyj: 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:48 | stompyj | ohhh |
| 11:48 | stompyj | yeah, I agree |
| 11:48 | mdrogalis | There's a lot of bindings to each of those, but once you've lock into one, you're kind of there, you know? |
| 11:48 | stompyj | yeah |
| 11:49 | stompyj | but 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:49 | stompyj | which is why I was looking to find more people working on these kinds of problems |
| 11:49 | mdrogalis | stompyj: Got it. Sounds like you're a consulting engineer, or battling upwards in your own company? |
| 11:49 | stompyj | as positive signaling that I won’tbe writing custom libs for everything |
| 11:49 | lvh | Is there any diference between (hash-map k0 v0 k1 v1) and {k0 v0 k1 v1}? |
| 11:50 | stompyj | mdrogalis: consulting engineer to start, with the idea of running data operations for them long term, building a team, etc |
| 11:50 | mdrogalis | stompyj: Cool :) |
| 11:51 | stompyj | mdrogalis: 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:52 | mdrogalis | stompyj: 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:52 | mdrogalis | There's no boiler plate object transformation code to custom interfaces or something like that |
| 11:52 | boxed | man, the clojure reddit is so damn poisonous :( |
| 11:53 | stompyj | mdrogalis: exactly! |
| 11:53 | boxed | “I disagre with his point, DOWNVOTE” |
| 11:53 | stompyj | thats why I’d have thought lots of data aggregation / event streaming enthusiasts would be using clojure for these problems |
| 11:54 | stompyj | between transducers, core.async, immutable collections, you have everything you need |
| 11:55 | mdrogalis | stompyj: Most people I meet who sell themselves as engineers for bigger data sets are Java enterprisey people. : |
| 11:55 | mdrogalis | :/* |
| 11:55 | stompyj | mdrogalis: yeah, its deeply frustrating hahaahha |
| 11:56 | stompyj | at 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:56 | stompyj | I’d* |
| 11:57 | mdrogalis | Understandable. |
| 11:58 | whodidthis | what happened to all the cool presentation vidyas from euroclj/strangeloop |
| 11:58 | whodidthis | or did they happen (2014) |
| 12:00 | mdrogalis | stompyj: Is the client looking at a batch or event stream processing problem? |
| 12:00 | stompyj | mdrogalis: they don’t know, I’m pitching starting with an event stream |
| 12:00 | stompyj | then as we collect data, and understand our needs better |
| 12:01 | stompyj | bringing in something like spark for the batch piece |
| 12:01 | mdrogalis | stompyj: Pretty cool. |
| 12:02 | stompyj | mdrogalis: yeah! we’ll see if it happens, would be super exciting |
| 12:02 | mdrogalis | I'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:04 | llasram | mdrogalis: Stand-alone, or built on top of existing tech? |
| 12:05 | mdrogalis | llasram: Its a standalone. |
| 12:06 | stompyj | mdrogalis: nice! I think this is a space that clojure could really dominate |
| 12:07 | stompyj | if we can get some more wind behind the sails, |
| 12:07 | stompyj | sounds like llasram and you are doing some great work on this already tho |
| 12:07 | stompyj | I’m curious what nathan marz is up to as well |
| 12:07 | mdrogalis | He's been pretty quiet for a while. |
| 12:08 | stompyj | yeah |
| 12:11 | Major_Crixus | !rules |
| 12:12 | gf3 | yogthos: hey cool secretary article 😏 |
| 12:14 | arohner | I have an Om single-page app. Is goog.events/listen the preferred way to catch navigation events? |
| 12:16 | arohner | listen on an goog.history.Html5History |
| 12:16 | bbloom_ | 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:17 | arohner | I'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:18 | arohner | which is obviously unlikely |
| 12:18 | gf3 | arohner: you actually might be interested in https://github.com/gf3/secretary |
| 12:18 | gf3 | arohner: which works with both history and html5history (or anything else really) |
| 12:19 | arohner | gf3: I'm using secretary, but this code catches events through google.history.Html5History and then dispatches to secretary |
| 12:20 | arohner | but the event google passes in to the event listener appears to be missing the critical field under advanced compilation, but not in whitespace |
| 12:20 | gf3 | arohner: ohhh i think we ran into that once |
| 12:21 | gf3 | arohner: this might be related → https://github.com/gf3/secretary/issues/14 |
| 12:22 | arohner | gf3: I don't understand how? |
| 12:23 | gf3 | arohner: what info is missing? |
| 12:23 | arohner | gf3: the 'token' field on the event |
| 12:24 | michaelr525 | arohner: how Html5History is beter than History? |
| 12:24 | gf3 | arohner: and how're you grabbing it? |
| 12:24 | arohner | michaelr525: I don't know, this is inherited |
| 12:24 | gf3 | michaelr525: it doesn't use `document.location.hash` |
| 12:24 | arohner | gf3: aget. also missing when logged via console.log |
| 12:24 | gf3 | michaelr525: it uses the HTML5 push/popstate api |
| 12:25 | michaelr525 | oh |
| 12:25 | michaelr525 | gf3: thank |
| 12:25 | michaelr525 | gf3: btw, i'm using secretary too in a small om app :) |
| 12:25 | gf3 | michaelr525: yayyyy :) |
| 12:26 | gf3 | arohner: are you able to provide me with a paste via refheap.com ? |
| 12:26 | arohner | yeah, one sec |
| 12:27 | arohner | the app is based on omchaya, and looks like there's been a fix to omchaya. testing that first |
| 12:27 | arohner | yeah, ok |
| 12:27 | arohner | using (.-token e) rather than (aget e "token") fixed it |
| 12:28 | arohner | which is kind of obvious now |
| 12:28 | arohner | I'm kind of impressed closure strips fields out of events |
| 12:28 | gf3 | arohner: :) excellent |
| 12:28 | arohner | gf3: thanks for your help |
| 12:29 | gf3 | arohner: np—glad it worked out |
| 12:30 | ToxicFrog | So, 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:30 | ToxicFrog | Is there an equivalent for when the keys are symbols rather than keywords? |
| 12:30 | arohner | :syms |
| 12:30 | michaelr525 | gf3: i wonder, why didn't they just add the pop/push state capabilities to History instead of creating another class? |
| 12:31 | gf3 | michaelr525: because it's not applicable in all situations |
| 12:31 | arohner | ,(let [{:syms [a b c]} '{a 1 b 2 c 3}] b) |
| 12:31 | clojurebot | 2 |
| 12:31 | arohner | ToxicFrog: ^^ |
| 12:31 | gf3 | michaelr525: for instance older browsers don't support it, or there might be cases where you need to use the hash |
| 12:31 | arohner | there's also :strs |
| 12:32 | michaelr525 | gf3: so they wanted to keep the interface for backward compatibility, or something |
| 12:32 | abaker | there a clojure version available in maven/clojars that has transducers, like 1.7.0-alpha1 or whatever? |
| 12:32 | michaelr525 | gf3: i'd rather have one class which uses the html5 features when available and falls back to hash otherwise.. |
| 12:33 | _alejandro | abaker: yes |
| 12:33 | _alejandro | [org.clojure/clojure "1.7.0-alpha1"] |
| 12:33 | abaker | cool, thanks |
| 12:37 | gsdfvu | warning |
| 12:37 | gsdfvu | you may be watched |
| 12:37 | gsdfvu | do usa&israel use the internet(facebook,youtube,twitter, chat rooms ..ect)to spy?? |
| 12:37 | gsdfvu | do usa&israel use the internet 2 collect informations,,can we call that spying?? |
| 12:37 | gsdfvu | do they record&analyse everything we do on the internet,,can they harm you using these informations?? |
| 12:37 | gsdfvu | تحذير |
| 12:37 | lazybot | gsdfvu: What are you, crazy? Of course not! |
| 12:37 | lazybot | gsdfvu: Definitely not. |
| 12:37 | lazybot | gsdfvu: Definitely not. |
| 12:52 | mdeboard | dnolen_: 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:53 | mdeboard | or I guess if anyone can point me to such a thing |
| 12:53 | mdeboard | all 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:54 | dnolen_ | mdeboard: not planning on adding any REPL support to mies in the near future |
| 12:55 | mdeboard | ok. thanks |
| 12:57 | mdeboard | dnolen_: 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:57 | dnolen_ | mdeboard: inferior-lisp in Emacs |
| 12:58 | mdeboard | cemerick's "austin" lib works perfectly with command line, but I'm not sure where hte line is between austin & piggyback |
| 12:58 | mdeboard | oic |
| 12:58 | dnolen_ | mdeboard: been thinking about improving REPL support but don't know when I'll get around to it |
| 12:59 | mdeboard | I understand |
| 12:59 | bbloom_ | i've found weasel to be much more reliable |
| 12:59 | mdeboard | weasel? |
| 12:59 | clojurebot | weasel is https://github.com/tomjakubowski/weasel/ |
| 12:59 | mdeboard | thanks clojurebot |
| 13:00 | mdeboard | bbloom_: oh interesting |
| 13:00 | mdeboard | I guess I need to understand how nrepl works |
| 13:00 | mdeboard | I think that's my prob |
| 13:00 | mdeboard | nrepl? |
| 13:00 | clojurebot | nrepl is a network REPL implementation: http://github.com/clojure/tools.nrepl |
| 13:00 | bbloom_ | ~botsnack |
| 13:00 | clojurebot | Thanks! Can I have chocolate next time |
| 13:01 | mdeboard | You'll have botsnacks and you'll like it. |
| 13:02 | mdeboard | Maybe I should sign up to do an nrepl talk or something |
| 13:16 | TimMc | $botsnack |
| 13:16 | lazybot | TimMc: 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:21 | hiredman | {blake}: yes, you have to load code for it to do anything |
| 13:21 | llasram | {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:23 | llasram | {blake}: Can you produce a minimal reproducing example? |
| 13:24 | llasram | Because 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:24 | ToBeReplaced | justin_smith: i reworked register! and added some other goodies... getting close to a 0.1.0 release |
| 13:27 | justin_smith | ToBeReplaced: oh, nice, I'll check it out |
| 13:27 | justin_smith | I 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:29 | lazybot | ⇒ 33 |
| 13:29 | {blake} | (inc hiredman) |
| 13:29 | lazybot | ⇒ 52 |
| 13:56 | martinklepsch | I use lein-garden which requires an old version of garden — is there any way to override a dependency's version of dependencies. (huh!) |
| 13:56 | martinklepsch | I tried :exclusions but then it seems to be completely gone and can't be found anymore |
| 14:05 | martinklepsch | somehow 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:05 | martinklepsch | (instead of 1.1.5 |
| 14:12 | SegFaultAX | martinklepsch: Whatever you did, it didn't work. |
| 14:12 | SegFaultAX | Just thought I'd clear that up for you. :) |
| 14:13 | llasram | martinklepsch: The project :dependencies are the dependencies for any project JVMs, which are different from the dependencies for the JVM for Leiningen itself |
| 14:13 | llasram | If `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:14 | llasram | If 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:14 | grache28 | "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:14 | grache28 | Sorry if syntax is off and for very basic question |
| 14:15 | llasram | grache28: Wrong channel? |
| 14:16 | TEttinger | grache28, I'm guessing that's a haskell question? |
| 14:18 | grache28 | TEttinger: ok, sorry for the mix up, the language wasn't stated in the example |
| 14:18 | TEttinger | where'd you get it I wonder? |
| 14:19 | SegFaultAX | Looks like iterate |
| 14:19 | mdeboard | huh. TIL about inferior-lisp |
| 14:19 | grache28 | TEttinger: university material - can ask prof. after weekend |
| 14:19 | TEttinger | as in "lisp that was not invented here" mdeboard? |
| 14:20 | mdeboard | TEttinger: hehe no the emacs command |
| 14:20 | TEttinger | that's exactly what I mean, mdeboard |
| 14:20 | TEttinger | doesn't it only consider emacs lisp full lisp? |
| 14:20 | clojurebot | excusez-moi |
| 14:20 | amalloy | yeah, looks like iterate in haskell |
| 14:21 | SegFaultAX | A strange way to write iterate. |
| 14:21 | mdeboard | TEttinger: idk, it's what dnolen_ said he uses for cljs repl |
| 14:21 | amalloy | well, a little weird. it's like !! and iterate glued together |
| 14:21 | SegFaultAX | Yea |
| 14:21 | TEttinger | and apply is a pretty overused name to be declared in user code like that |
| 14:21 | SegFaultAX | Usually `iterate f x = x : iterate f (f x)` will do ya |
| 14:22 | amalloy | maybe they should call it `data` instead, TEttinger |
| 14:22 | SegFaultAX | TEttinger: No kidding. |
| 14:22 | TEttinger | it doesn't appear to be creating a seq, does it? |
| 14:22 | mdeboard | TEttinger: 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:22 | amalloy | no. like i said, it's iterate and !! (which is nth) |
| 14:22 | SegFaultAX | TEttinger: That's why it's iterate + !! |
| 14:22 | SegFaultAX | Jinx |
| 14:22 | TEttinger | I didn't recognize !! , not being a type nerd :) |
| 14:23 | SegFaultAX | ? |
| 14:23 | SegFaultAX | It's just a function |
| 14:23 | TEttinger | I don't use haskell |
| 14:23 | TEttinger | I tried to learn it once |
| 14:23 | SegFaultAX | But then you took an arrow... I'm so sorry. |
| 14:24 | TEttinger | this was when people insisted on callin monads "warm fuzzy things" to avoid having to think about them |
| 14:25 | SegFaultAX | Was this like 15 years ago? |
| 14:25 | TEttinger | closer to 8 |
| 14:25 | TEttinger | I'm sure haskell |
| 14:26 | TEttinger | I'm sure haskell's a fine language if you think in typesystems |
| 14:26 | TEttinger | http://tpolecat.github.io/assets/list.png |
| 14:26 | SegFaultAX | Haskell 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:26 | TEttinger | that's Scala's List class superclass diagram |
| 14:26 | bbloom_ | TEttinger: that graph makes me laugh every time |
| 14:26 | SegFaultAX | Depending on the fanboyism of whom you're talking to, that range will grow and shrink accordingly |
| 14:27 | bbloom_ | i mean, clojure's seq/coll stuff is pretty complex too |
| 14:27 | bbloom_ | but that's just fun |
| 14:27 | TEttinger | bbloom_, yeah I guess |
| 14:27 | SegFaultAX | bbloom_: If by laugh, you mean weep tears of blood, yea me too. |
| 14:27 | TEttinger | Scala seems to have a phobia of nil |
| 14:27 | mdrogalis | Does anyone know when the Conj talks get announced? Can't remember if it was today or next week. |
| 14:27 | SegFaultAX | TEttinger: It's a good phobia to have. |
| 14:27 | TEttinger | clojure just handles nil... |
| 14:28 | TEttinger | ,(seq nil) |
| 14:28 | clojurebot | nil |
| 14:28 | SegFaultAX | Because Clojure tries to make nil act like nil in some other lisps (which is the same as ()) |
| 14:28 | SegFaultAX | Unless it doesn't, then NPE wheeee |
| 14:29 | TEttinger | SegFaultAX, I can't even remember the last NPE I got in clojure |
| 14:29 | bbloom_ | the NPE issue is b/c nil isn't an object, like in smalltalk or ruby or whatever |
| 14:29 | bbloom_ | 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:29 | SegFaultAX | Correct |
| 14:30 | TEttinger | I do recall some fun bugs to track down in C# |
| 14:30 | bbloom_ | but we can extend protocols to nil :-) |
| 14:30 | SegFaultAX | TEttinger: Again, because many times you're working with things that expect sequences, and nil is just an empty sequence in that context. |
| 14:30 | SegFaultAX | This is not an unusual property of lisps. |
| 14:30 | TEttinger | if 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:31 | TEttinger | this was hard to track down |
| 14:31 | SegFaultAX | Maybe they meant "out of the memory region of this image!" |
| 14:31 | SegFaultAX | And thought OOM sounded nicer. |
| 14:31 | TEttinger | which would have been nice to know! |
| 14:31 | stompyj | but type systems! |
| 14:31 | TEttinger | stompyj, heh |
| 14:32 | stompyj | sorry, I saw Haskell in the convo, and thought it would be appropriate :D |
| 14:32 | stompyj | I have equal love for clojure and haskell |
| 14:32 | martinklepsch | can I somehow list out :plugin dependencies? |
| 14:32 | arrdem | stuck in IO monad pls send help |
| 14:32 | SegFaultAX | TEttinger: The thing about advanced type systems is... it's truly shocking just how much stuff can be decided statically (eg at compile time) |
| 14:33 | TEttinger | and 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:33 | SegFaultAX | Haskell certainly tries to push that to the logical extreme in some cases. |
| 14:33 | SegFaultAX | And dependent types allow you to take it further still. |
| 14:33 | SegFaultAX | But being able to identify a huge category of bugs without ever having to /run your program/ is a pretty nice property. |
| 14:34 | TEttinger | oddly 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:35 | SegFaultAX | And that property extends over most statically typed languages to a certain degree. Even relatively crappy ones like C, C++, and Java. |
| 14:36 | TEttinger | the 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:36 | TEttinger | but it ended up generating https://dl.dropboxusercontent.com/u/11914692/Artillery_S_Large_face0_0_nogreen.png |
| 14:37 | TEttinger | the issue had to do with ARGB beingstored as BGRA in memory (big endian vs. little endian) |
| 15:37 | akhudek | I 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:47 | bbloom_ | akhudek: you can use set state in a callback |
| 15:47 | bbloom_ | akhudek: http://facebook.github.io/react/docs/forms.html |
| 15:48 | akhudek | bbloom_: 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:48 | akhudek | s/do/dig/ |
| 16:09 | martinklepsch | is there something like lein deps :tree for plugins in my project? |
| 16:10 | xeqi | martinklepsch: lein deps :plugin-tree |
| 16:13 | supersym | cool..didnt know that one |
| 16:14 | martinklepsch | xeqi: thanks! |
| 16:16 | martinklepsch | I 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:16 | martinklepsch | (WARNING!!! version ranges found for:) |
| 16:16 | martinklepsch | ([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:16 | martinklepsch | Consider using [garden "1.1.5" :exclusions [org.clojure/clojure]].) |
| 16:21 | martinklepsch | Any ideas what could cause that? Here is my project.clj: https://gist.github.com/1fbb4961f902daf4e851 |
| 16:23 | hyPiRion | martinklepsch: could you provide the output of `lein deps :tree`? |
| 16:24 | hyPiRion | martinklepsch: oh wait, https://github.com/noprompt/lein-garden/blob/master/src/leiningen/garden.clj#L112-L114 seems to be injected |
| 16:25 | hyPiRion | I guess you should add an issue to the plugin, because that's not good style |
| 16:27 | martinklepsch | hyPiRion: ohhh! |
| 16:27 | martinklepsch | that makes sense! |
| 16:27 | akhudek | hmm, strange, I can clearly see that it’s calling the set-sate, yet om/react doesn’t always trigger a render from it |
| 16:28 | hyPiRion | I think a short article on how to write proper lein plugins would be worth looking into. |
| 16:28 | martinklepsch | hyPiRion: is there a reason why that injection there could make sense? |
| 16:31 | martinklepsch | hyPiRion: 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:34 | hyPiRion | martinklepsch: 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:35 | hyPiRion | that is, it should be {:dependencies '[^:displace [garden "1.1.5"] ^:displace [ns-tracker "0.2.1"]]} |
| 16:42 | wei | what’s the recommended way to do interprocess communication between clojure programs? |
| 16:51 | justin_smith | wei: you could use a java IPC like RMI |
| 16:51 | justin_smith | or whatever is easiest to use on a platform specific basis I guess |
| 16:54 | wei | something like netflix’s ribbon? i was originally thinking of using redis queues, but that doesn’t have easy two-way communication |
| 16:55 | akhudek | wei: we use rabbitmq |
| 16:58 | wei | akhudek: and Langohr, i presume? |
| 16:58 | akhudek | wei: yep |
| 16:58 | wei | why did you choose rabbitmq over the alternatives? e.g. redis |
| 16:59 | wei | guaranteed delivery? |
| 16:59 | akhudek | that, plus durability, high availability and a message passing abstraction just worked better for us |
| 17:00 | akhudek | processes pass larger pieces of data around via postgresql |
| 17:01 | akhudek | but that doesn’t help indicating that something has changed and work needs to be done |
| 17:01 | akhudek | that’s where rmq comes in |
| 17:01 | bbloom_ | guarenteed deliverability is a lie... |
| 17:01 | bbloom_ | http://aphyr.com/posts/315-call-me-maybe-rabbitmq |
| 17:01 | bbloom_ | better to plan for dropped messages than to cross your fingers and hope |
| 17:03 | technomancy | bbloom_: sure, but compared to redis? |
| 17:03 | bbloom_ | technomancy: i wasn't comparing to redis |
| 17:03 | bbloom_ | im just saying: in general, queues drop messages |
| 17:05 | mdrogalis | bbloom_: I think that's a pretty sharp statement to make. |
| 17:06 | mdrogalis | There're a lot of queues that have transactions, and do durable writes. |
| 17:06 | wei | bbloom_: so, how do you generally plan for dropped messages, if you require guaranteed deliverability? e.g. payment notifications |
| 17:07 | bbloom_ | wei: retries, idempotency, associativity, commutativity, etc |
| 17:09 | wei | bbloom_: is there an article discussing it in more depth? |
| 17:10 | wei | e.g. how do you make payments commutative? |
| 17:11 | bbloom_ | wei: the same way banks do it: with a line of credit :-) |
| 17:11 | mthvedt | wei: a surprising amount of payments in the financial system are assumed in the short run to be commutative |
| 17:11 | technomancy | bank accounts are the worst examples for consistent distributed systems documentation |
| 17:11 | bbloom_ | technomancy: yeah seriously |
| 17:12 | bbloom_ | everybody is like "so you want to do an atomic account decrement" but then nobody actually ever does that |
| 17:12 | bbloom_ | they do double entry accounting, etc |
| 17:12 | mthvedt | technomancy: they have the best consistency implementation in existence. if you cause an inconsistency you pay a $35 overdraft fee |
| 17:12 | mthvedt | who needs fancy computer science theory |
| 17:12 | mdeboard | lol |
| 17:12 | mdeboard | social engineering uber alles |
| 17:12 | bbloom_ | mthvedt: consistency by fiat |
| 17:12 | technomancy | mthvedt: oh man I would love to see that proposed at a startup |
| 17:12 | wei | this is bitcoin related so credit doesn’t quite work. if someone withdraws their “credit”, it’s gone |
| 17:12 | mdeboard | pavlov-driven development |
| 17:13 | bbloom_ | wei: when you deal with external systems that don't support sensible distributed semantics, you need to be more cautious.... |
| 17:13 | bbloom_ | bitcoin itself is robust(ish?) to this sort of thing |
| 17:13 | bbloom_ | but random REST APIs for it aren't going to be |
| 17:14 | wei | for one, it’s idempotent thanks to payment hashes |
| 17:14 | bbloom_ | organizations like coinbase operate like banks, they have extra money/bitcoin to cover discrepencies, and they work it out later |
| 17:15 | technomancy | eventual consistency is a thing |
| 17:15 | wei | although with that systme, if your missed / doubled transaction is for a huge amount relative to your reserves, you’re screwed |
| 17:16 | bbloom_ | technomancy: unless your hewitt, in which case you don't think any consistency is a thing |
| 17:16 | bbloom_ | wei: you ever have to wait for a check to clear? |
| 17:16 | wei | and for a toy project like mine that’s entirely possible |
| 17:16 | bbloom_ | banks do things to mitigate problems like that |
| 17:17 | bbloom_ | when you start talking about larger amounts of money, consistency becomes even more strange |
| 17:17 | bbloom_ | like if you have more money than the FDIC insurance limit (250k?) then suddenly all sorts of stuff is slower and weirder |
| 17:17 | wei | i guess that’s why coinbase much longer than the blockchain to confirm a transaction |
| 17:17 | technomancy | bbloom_: I'm no platonist, but I'm inclined to agree when it comes to the physical realm. |
| 17:18 | mthvedt | bbloom_: when finance companies deal with each other, there basically aren’t any rules |
| 17:18 | mthvedt | when i worked at an exchange every so often we’d get a call |
| 17:18 | mthvedt | “hey you misplaced some trades/a few million dollars" |
| 17:18 | bbloom_ | 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:19 | technomancy | brb staring at flickering shadows |
| 17:21 | wei | anyways, 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:23 | mdrogalis | wei: 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:24 | mdrogalis | I think ActiveMQ can do the same. |
| 17:24 | akhudek | mdrogalis: bbloom was pointing out that it’s still possible in weird conditions to lose messages or get duplicates |
| 17:25 | technomancy | dilemma: 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:25 | mdrogalis | akhudek: Got it. |
| 17:25 | bbloom_ | mdrogalis: it's worth reading the entire call-me-maybe series |
| 17:26 | akhudek | technomancy: better the problems that you know about? |
| 17:26 | akhudek | technomancy: it’s unlikely that others have any better solutions since these problems are genuinely difficult |
| 17:26 | mdrogalis | bbloom_: 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:28 | akhudek | ack, ok, om is 100% not always triggering a rerender on state change |
| 17:28 | bbloom_ | 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:28 | akhudek | very sodd |
| 17:28 | akhudek | odd even |
| 17:29 | mdrogalis | bbloom_: No disagreement there, for sure. |
| 18:07 | akhudek | any om wizards around? |
| 18:08 | akhudek | I have a case where I call set-state! in a callback yet even should-update isn’t triggered |
| 18:33 | danielcompton | Is clojars.org unavailable for others or just me? |
| 18:34 | Bronsa | it's working for me |
| 18:38 | johnwalker | i'm familiar with lein do {task}, {task}, {task} |
| 18:39 | johnwalker | is there a way to change the project context for successive tasks ? |
| 18:39 | johnwalker | for example - lein do new mies-om, {change-ctx}, ancient upgrade |
| 19:03 | xnull | hei |
| 19:03 | xnull | oops |
| 19:06 | technomancy | johnwalker: sure: lein do thingy, with-profile +p1 other-thingy |
| 19:07 | technomancy | johnwalker: 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:35 | TimMc | technomancy: What's the associativity of ,? :-P |
| 21:32 | ben_vulpes | i've got an enlive question - this refheap ((html/clone-for [[ad] [advertisements]] |
| 21:32 | ben_vulpes | [:tr.ad-data] |
| 21:32 | ben_vulpes | (html/clone-for [[copy url bid] [ad]] |
| 21:32 | ben_vulpes | [:td.copy] (html/content (str copy)) |
| 21:32 | ben_vulpes | [:td.url] (html/content (str url)) |
| 21:32 | ben_vulpes | ah nuts. |
| 21:33 | ben_vulpes | https://www.refheap.com/89215 <- that refheap is only returning the td.copy node, and not the url or bid nodes. |
| 21:33 | ben_vulpes | i'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:08 | ToBeReplaced | [ANN] https://github.com/ToBeReplaced/nio.file 0.1.0 , for those interested in using java.nio.file.* classes and methods from clojure |
| 22:25 | ben_vulpes | ToBeReplaced: neat stuff. looking forward to it. |
| 22:26 | ToBeReplaced | thanks |
| 23:45 | arrdem | ToBeReplaced: so at what point is your name just never going to be replaced :P |
| 23:47 | ToBeReplaced | arrdem: idk, it seems like a nice UUID, and keeps in-person separate from not-in-person |