#clojure logs

2013-10-02

00:13akurilinYeah, connecting to the same nrepl as my server actually allows me to edit the thing's state without necessarily relying on lein ring's auto-reload
00:14akurilinand now I actually know what the heck people talk about when they say state can get fubarred.
00:14akurilinNext step I guess is to use Stuart Sierra's approach.
00:15logic_progyeah
00:15logic_progI think people should not be allowed to use clojure unless they've read what Rich Hickey / Sauart Sierra have written
00:15logic_progwould have saved me much more time
00:15logic_proginstead of bumbling around
00:16akurilinWell I can tell you that whatever Stuart Sierra wrote made absolutely no sense to me at first.
00:16akurilinTook a bit to be able to relate at least a bit.
00:16logic_progit's like the matrix
00:16logic_progwhat do you mean a function that recreates a full state?
00:16akurilinWhat did Hickey write on the subject btw?
00:16logic_progI was referring mostly to his tech talks
00:17ddellacostaakurilin: I interpreted that as a more general statement on what Rich Hickey has publicly said, in talks and whatnot
00:17ddellacostaright
00:17akurilinokie dokie
00:17logic_progddellacosta: stop reading my mind
00:17ddellacostalogic_prog: heh
00:18akurilinSupposedly tools.trace is also supposed to blow my mind once I grok it
00:18akurilinEvery day is Christmas in Clojure land.
00:18logic_prog(refresh) is awesome
00:19logic_progHickey, Sierra, and Techomancy = 3 wise men? :-D
00:20SegFaultAXI'm unclear on Sierra's approach when it comes to the production system. At some point you still need a couple of globals for the top level system state.
00:21tbaldrid_SegFaultAX: yep, but it's all in one place (an atom perhaps) instead of 20,000 places all in different namespaces
00:21ddellacostaSegFaultAX: I didn't think he was eschewing all use of globals, just minimizing them to manage complexity
00:22Rayneslogic_prog: Well, I've been doing this for like 5 years and I don't even know what " a function that recreates a full state" is without context. :p
00:22ddellacostaer, what tbaldrid_ sez
00:22SegFaultAXWell yea, I guess his focus was also more on the development side of things anyway.
00:26technomancyRaynes: pretty much
00:26akurilinSo "wrap-" is the unwritten convention for middleware naming as per weavejester's libraries?
00:27SegFaultAXWell it describes what is logically occuring.
00:29bitemyappakurilin: c.t.t is a good idea.
00:33akurilinbitemyapp, my understanding is that tracing functions is where most of the bang is for the library?
00:35bitemyappakurilin: da
00:35bjais there some way that lein classpath might not be telling me the whole truth in terms of what I'm actually including?
00:35bjaasking because it seems to claim I only have tools.reader 0.7.8 yet it is obviously finding an earlier version to load up the interface for
00:36technomancybja: someone just reported that earlier; haven't gotten a chance to investigate
00:36technomancylein issue 1337
00:36akurilinbtw totally appreciate you trying to beat loving middleware into my thick skull. Makes stuff so much nicer.
00:37technomancybitemyapp: is http://simonides.clojurecup.com/dashboard/feed supposed to be live?
00:38bjatechnomancy: thanks. short term solution for me is to patch clj-http I guess
00:38technomancyyeah, if you can get it to work with the latest version that's obviously the best
00:38technomancywhy does an HTTP client need a reader though?
00:39bjatechnomancy: uses it for reading/sending EDN
00:40bja(at least that's my guess. it magically knows how to handle EDN)
00:40technomancyhuh; is it really that much work to do your own serialization?
00:41bjatechnomancy: well. not really. it's just built into the library. And as long as the version bump doesn't break clj-http, it seems less effort to decouple tools.reader vs incrementing the dependency version
00:41bjaerr
00:41bjaI said that backwards.
00:41akurilinCan you no longer sign up for Mozilla Persona?
00:42akurilinWanted to log into refheap.
00:45akurilinNvm, their help docs are out of date. Also usability... oh well.
00:45technomancyakurilin: the account confirmation was broken when I tried it yesterday for a clojurecup entry
00:46bitemyapptechnomancy: I'm expert level at avoiding saying "complected" since having to explain things to coworkers often lately.
00:46technomancybitemyapp: teach me your ways
00:46akurilinMy current word to avoid is "conflated"
00:46boccatohello
00:46akurilinYou guys take conflated, I use complected.
00:47technomancyI like conflated, but I think "coupled" does the job for this
00:47clojurebotHuh?
00:47boccatowhat is a good book to learn clojure for someone with some experience in common lisp?
00:47bitemyapptechnomancy: conflated, coupled, complicated/mutual complication, tangled together
00:47bitemyappboccato: Clojure Programming
00:51technomancyI think of conflated as "using one term to mean multiple things"
00:52bitemyapptechnomancy: th
00:52bitemyapptechnomancy: that's more precise, but it can be a conflation or terms of concepts
00:52bitemyappan incorrect "collapsing together" rather than a braiding of things that can be separate.
00:52technomancyI think you accidentally a M-t twice?
00:54boccatobitemyapp: thats the one by Emerick, right? what about "the joy of clojure"?
00:55technomancyhttps://github.com/technomancy/leiningen/pull/1324 <- anyone familiar with pom structure care to chime in on this issue?
00:57muhooavoiding saying complected is easy. avoiding doing it, well...
01:09bitemyappboccato: read Clojure Programming
01:13mullrtechnomancy: As you say, a more general 'add this stuff to the XML' facility would be far more useful (i.e. useful at all)
01:16mullrboccato: watch http://www.youtube.com/watch?v=cPNkH-7PRTk
01:29lgs32aFor the interested: I spent the night writing a microlib to manage state event-driven in small nodes using async channels: https://github.com/lgrapenthin/state-node . Feedback very welcome.
01:48BlankVerse(sel (matrix (range 9) 3) :filter #(> (sum %) 15))
01:48BlankVerseshouldn;t it return the rows whose sum is > 15
01:50lgs32aBlankVerse: what matrix are you using
01:50BlankVerseincanter?
01:51lgs32aah ofc
01:57BlankVerseit looks as if filter function is noop
01:57lgs32aBlankVerse: it does not seem like it invokes the filter-fn at all
01:57BlankVerseya
01:57BlankVerse, what to do?
01:57clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: what in this context, compiling:(NO_SOURCE_PATH:0:0)>
01:58lgs32aBlankVerse: try passing a number as filter-fn, will not complain
01:59lgs32aBlankVerse: cast ur matrix using to-dataset
01:59lgs32aBlankVerse: seems to work in my repl
02:18akurilinNote to self: redact passwords if logging request params, bcypt doesn't save you here..
02:18bitemyappakurilin: good call
02:19bitemyappakurilin: that's sorta why I didn't plan on blackwater being used outside of development...
02:34yedianyone feel like helping me with my problems getting ansible up and running
02:38TEttingeryedi: ansible?
02:38yediyea
02:38TEttingerare you on windows?
02:39TEttingerhttps://github.com/ansible/ansible this?
02:39TEttingerI thought it was an ANSI formatting lib, which wouldn't work on windows. sadly console libs are more my area of expertise
02:42TEttingerhave you tried #ansible ?
02:45akurilinbitemyapp, that's fair. We have some regulations too here, namely COPPA. The prob though is that if you're on our box, you already access to everything but the cleartext passwords.
02:46akurilinSo there's only so much that sanitizing log PII would gain you.
02:48akurilinbut I imagine people out there like to move / store / analyze their prod logs outside of the server box's disk, unlike us starving startup :P
02:48sm0keIs it sane to (swap!) another atom when you are inside the body of one atoms (swap!) argument function?
02:50sm0keis it a common thing to do?
02:51akurilinbbl
02:52yediTEttinger: i've tried #ansible, it's a ghosttown right now
02:53yedii'm trying to get ansible to work with my vagrant vm, but i have no idea what i'm doing
02:53TEttingerI have no idea either
02:53yediansible's ping returns https://gist.github.com/yedi/6789630
02:54TEttingerthe fanciest server admin I have done was on sun netra x1 servers with a 600 MHz SPARC processor
02:55yediugh, it's been really difficult trying to learn sysadmin / devops
02:59ivanyedi: does /Users/yedianyansi/.ssh/id_rsa exist and have permission 0600?
03:00yediivan: yes indeed
03:04ivanoh, I didn't realize that message was not an error
03:05ivanyedi: it looks like an SSH client is timing out, does this happen when you `ssh` into the host yourself?
03:12yediivan: so i'm getting a new error now, https://gist.github.com/yedi/6789630
03:13yedii decided to use private network for the vm instead, and i seem to be able to ssh into it ok, but for some reason ansible has an issue
03:13ivanyedi: it looks like you're trying to connect to a host that isn't accepting your key, so it's asking for a password, and ansible doesn't like that
03:13ivanis your public key in the remote's authorized_keys?
03:15yedii don't believe so, i don;t remember doing anything like that
03:16ivanyou can send it over with ssh-copy-id
03:17ivan(just once, I mean; it'll append to ~/.ssh/authorized_keys)
03:21yediivan: sweeet, it worked
03:21yedithanks so very much
03:21ivancool
03:31BlankVerseI have a misclassify function which filters to either all or emptyhttps://gist.github.com/pankajmore/6789961
03:32BlankVersebut it should somtimes give a proper subset also
04:01muhoosysadmin/ops stuff i find easy, but what makes it hard is all the automation people wrap around it that obfuscates what's really goign on, sometimes
04:03utkarshwhat's the best way to "change" some keys of a map, if they exist? e.g., I have {:a 10, :b 20} and I want to change :a to :x and :c to :z, so I should get {:x 10, :b 20}
04:05noidiutkarsh, clojure.set/rename-keys
04:05ta479how are you supposed to know what types a function takes and outputs without any compiler information?
04:06utkarshnoidi: perfect, thanks!
04:08muhoota479: the doc string usually tells you. but clojure isn't typed and many functions can accept many diffferent types
04:09ta479and if there is no doc string?
04:09muhoothen the source, i guess
04:09ta479or if the doc string is incorrect
04:09muhoota479: what function are you trying to get a docstring for?
04:10ta479I'm speaking hypothetically
04:10ta479does clojure.typed provide documentation generation of types?
04:10muhooi dunno, but if you want strongly-typed clojure, that's the place to get it
04:11muhoohttps://github.com/clojure/core.typed
04:11ta479:( relying on a docstring feels like such a turn off for me
04:11clgvta479:in the namespaces shipped with clojure there are docstrings on the public functions
04:12clgvta479: well, it is dynamically typed.
04:13clgvta479: when you come from typed OOP languages then you have to get used to it.
04:13muhooor from haskell, i bet
04:14clgvmuhoo: hehe, or that. I just chose main stream for higher success probability ;)
04:16ta479I'm trying to decide on whether I should learn scala or clojure. Clojure looks simpler, readable, elegant but scala has a type system
04:16ro_stta479: do you need a type system for the problem domains you'll work in?
04:17ro_stnice thing about clojure is you can go dynamic until you need types, and then use core.typed for the area that needs types. gradually typed ftw :-)
04:17ta479I don't think type systems are necessary to be turing complete
04:18ta479I just think it would be easier for the compiler to catch mistakes of me using the wrong types or generating docs
04:18ta479it's just convenience really
04:18CoconutCrab(and optimization)
04:19clgvta479: what is your background? coming from c++, delphi, java I overrated the type system as well in the beginning
04:19ta479java, C++, some haskell
04:19ro_stis it convenient to declare type information 100% of the time to catch that class of errors some of the time?
04:19clgvta479: and you certainly underestimate the influence of developing on the REPL
04:20ro_styup. interactive dev cuts out a lot of the churn. fast feedback helps tremendously
04:20l3dxI saw a talk recently where the dude had done some research on type errors. On github, of issues listed for projects using dynamicly typed languages, only 1% are type errors.
04:20l3dxquite interesting
04:24clgvta479: you definitely have to shift from coding a big bunch of functionality without trying it out when you use clojure. but with the repl and the functional programming paradigm it is so easy to try out small bits of your implementation
04:25ro_stin fact, it's preferred. you develop bottom-up, building the bits and then composing bigger and bigger bits until you have a working system
05:01kawl3dx: Sounds very interesting, is that online somewhere?
05:12l3dxkaw: https://vimeo.com/74354480
05:25ddellacostata479: there is also a lot of activity lately on the typed clojure front. Some stuff to check out: http://frenchy64.github.io http://adambard.com/blog/core-typed-vs-haskell
05:26turbopapeHi there, I have a pretty "strange" question...
05:27ddellacostaturbopape: definitely, it's 42
05:27turbopapeWhy is the vast majority of Clojure projects, including Clojure Itself
05:27turbopapelicensed under eclipse ?
05:27turbopapeddellacosta, 42 ?
05:28turbopapeI mean, even lein default projects are EPL ...
05:28turbopapewhy is that ?
05:28ddellacostaturbopape: nevermind, joke. https://groups.google.com/forum/#!topic/clojure/fCwLL9EnoI4
05:28ddellacostaturbopape: and, linked from there: https://groups.google.com/forum/#!topic/clojure/TuojEIsu1G4
05:28turbopapeddellacosta, I got it it was a joke dude :) but wanted to understand it :)
05:28turbopapeexcus my n00bness :)
05:29ddellacostaturbopape: ah, sorry--no, that was a Hitchhiker's Guide to the Galaxy joke. :-) http://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker.27s_Guide_to_the_Galaxy
05:29kawl3dx: Thanks, I'll check it out later
05:30ddellacostaturbopape: I was taking advantage of the pause between you stating you had a question, and asking a question to be a smarts.
05:30ddellacosta*smartass
05:31turbopape:) No, actually, If I ask, is to become smarter, actually, not the other way around :)
05:33turbopapeand sorry ddellacosta, it is definitely not 42 :)
05:33ddellacostaturbopape: yes, of course. ;-)
05:34turbopape:)
05:34ddellacostaclgv: that would be awesome.
05:34clgvddellacosta: damn there is no literal 42 there
05:35ddellacostaturbopape: to clarify, I meant, I was being a smartass…I missed a comma in there ("I was taking advantage of the pause between you stating you had a question, and asking a question, to be a smartass")
05:35ddellacostabut, now I've really killed the joke dead.
05:36ddellacostaclgv: yah, well, what are ya gonna do. Clearly we don't know what the question was in the first place
05:36turbopapeActually, I liked it too, and I learned two things in the process. That made my day :)
05:36ddellacostaexcellent. :-)
05:38clgvadding up all digits didnt work either ;)
05:39clgvit didn't even sum up to 23 :(
05:42yedilein uberjar is creating jars without a manifest file, from my research, I found out that -main needs to be defined in order to the uberjar to have the manifest set
05:42yedihow would I go about converting this compojure webapp to using a -main function as it's entry point? https://gist.github.com/yedi/6791051
05:45clgvyedi: you usually need to start an embedded server such as jetty yourself
05:47clgvyedi: with [ring.adapter.jetty :as jetty] you can use (jetty/run-jetty routes option-map)
05:53dobry-denyedi: https://gist.github.com/yedi/6791051#comment-920291
05:54clgvdobry-den: wow, all-round service ;)
05:56dobry-denhaha
05:56dobry-denthat kind of stuff is annoying til you've done it your first time
05:56yedidorby-den && clgv: thanks a lot
05:56yediso it seems lein ring server no longer works when i try that: Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
05:57yedi(dobry-den: been doing sysadmin/ops stuff all night and it really really really sucks for a first timer)
05:57dobry-denyedi: post the problem line. it's just a bad form
05:58dobry-denprob've got a :abc instead of [:abc]
06:00dobry-deni dont know if :aot is necessary there
06:05yedidobry-den: updated: https://gist.github.com/yedi/6791051
06:05yedinot sure how to find the problematic line
06:06dobry-denoh
06:06dobry-den:gen-class to (:gen-class)
06:06dobry-denyeah neither do i
06:07dobry-deni have yet to arrive at a strategy for parsing java stack traces
06:10dobry-dengod forbid you have to read one in a tmux window. painstakingly arrowkey your ass to the top
06:19dobry-denyedi: I think you generally want the handler/site middleware to wrap the other middleware
06:19yediwhat do you mean?
06:20dobry-denhander/site does a lot of helpful things to the request map, so if the request hits it first, your other middleware get the result
06:21dobry-denin other words it would come last in the (def app (-> app-routes ... handler/site)) usually unless you have a middleware that needs the request before it
06:21yediright
06:23yedicurrently dealing with differences in how lein ring server runs my app, and just running the uberjar. The uberjar can't seem to find the db i want to connect to
06:27dobry-denwhat database are you using
06:31yedii think i know what the issue is, I pass in some jvm args by setting jvm-opts in my project.clj, obviously running the server without lein won't leverage those
06:31yedihow do you set jvm arguments when just running normal java -jar
06:31dobry-denwell you can just pass em in. java -Xmx1g -jar _.jar
06:33yedithats what i thought but
06:33dobry-denim no sysadmin guru but i just have a boot script that i commit in my project's repo that Upstart or Capistrano/Mina will read
06:34dobry-denthat has whatever magical java incantation i use for that proj
06:38yedidobry-den: got it to work, i was setting those opts after setting -jar, so it thought they were args to my program. (plus, I forgot to prepend the args with "D" since you need to do that to set systemProperties)
06:38vmarcinkohi, noob question here ... I have a collection of elements on which I have to do some side-effecting function...So, i can most easily do that using doseq: (doseq [x coll] (do-some-side-effecton-x x))
06:38dobry-denahh
06:39vmarcinkobut I have a need that in case this side-effect function raised exception, i need to perform some other side-ffect function on all elements that have pased successfuly before the exception was raised
06:39vmarcinkoin other words
06:40vmarcinko(doseq [x coll] (try (do-some-side-effecton-x x) (catch Throwable th (do-some-other-side-effect successful-elements-coll))
06:40dobry-denvmarcinko: could drop processed items in a collection that will get processed on exception
06:41vmarcinkodobry-den: yeah, that's my question - do you have some idea how to collect these processed items? are we talking about some reduce here, or loop-recurd then?
06:42vmarcinkoin mutable/imperative languages I know how to do it, but im stil lfresh in clojrue so...
06:42dobry-denvmarcinko: yeah, off the top of my head you could do it with loop/recur.
06:43dobry-den(loop [unprocessed things, processed []] ...)
06:44vmarcinkoyeah, i need some construct that allows me to "accumulate" while looping...and i knowin general that reduce is accumulator, and that it should be preferred instead of loop/recur whenever possible, but i guess its not always feasible
06:45dobry-deni dont know about "whenever possible"
06:46dobry-denloop/recur is just clojure's "low level" loop. sometimes it's more clear to break things apart in a loop/recur imo
06:48vmarcinkoi looked at docs, and (take-while pred coll) seemed as a way to go maybe, its just that it says predicate should be side-effect free, so I dunno if I will break something if I put for predicate some fucntion that does side-effect and returns false when exception occured
06:49dobry-denvmarcinko: https://gist.github.com/danneu/6791614
06:50vmarcinkodobry-den: thanx a bunch
06:55Jardaanyone with expeirence of core.async here? I would need feedback regarding https://gist.github.com/nnarhinen/6786086
07:11dobry-denJarda: i think it becomes easier to think about if that (go ...) at the bottom is wrapped with a (defn start-process [...]) and you pass in its starting state as args
07:14dobry-deni dont have much experience but it might be easier to reason about if, for instnace, that hashchange-chan def is instead a channel initializer that you feed into a start-process mechanism instead of a global var
07:19BlankVersehow do i rebind vars in a while loop?
07:20Jardadobry-den: thanks
07:22llasramBlankVerse: In an abstract-loop, or in a `loop`?
07:23BlankVerse(while (> Y 0) .... )
07:23BlankVersewhere Y is being rebound
07:23BlankVerseinside
07:23BlankVersemaking Y constant in while
07:24s4muel,(doc loop)
07:24clojurebot"([bindings & body]); Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein. Acts as a recur target."
07:24llasramBlankVerse: You use `loop`, which "rebinds" via recursion. Although in practice you usually actually structure your problem to use `reduce` instead
08:38ddellacostanot really clojure specific, but how can I get a lquery working with postgres via JDBC (c.j.j)? I have a PGobject with type lquery, but it's just not giving me the same results I get in the console.
08:51ivannever add 'build' to your IDEA -> File Types -> Ignore files and folders, if you ever want to build La Clojure (it's got a build.ClojureBuilder)
09:29borkdudewhy is (seq? [1 2 3]) false?
09:30`cbpborkdude: because seq is another kind of data structure.
09:30`cbpborkdude: you can use sequential? on vectors and other such things
09:36borkdudemaybe coll? is more what I want then
09:37mdrogalisborkdude: Typically, yes.
09:39borkdudemdrogalis btw I still haven't got an answer on my datomic mailing list question
09:40mdrogalisWhich question was that, borkdude?
09:40borkdudemdrogalis about being able to copy the data files of free storage at any time
09:43mdrogalisborkdude: Why don't you get the value of the database you want, then make a back up of that?
09:43mdrogalisYou can use those back ups for testing.
09:43borkdudemdrogalis yes, but the question was, does datomic flush immedially or periodically
09:44borkdudemdrogalis after transacting
09:44mdrogalis*Shrug* I'd just avoid it and try something different. I don't know.
09:54borkdudeI wish I would have some kind of static check to see if some function would always be called with a collection and never with a single thing
09:54borkdudeo no, (coll? {:a 1}) => true
09:55borkdudeehm, I want a function that returns true for only sequences and vectors
09:55rkneufeldborkdude: I'm not sure what context you mean, but couldn't you use seq?
09:55borkduderkneufeld that's what I used, but it returns false for vectors
09:56borkdudeprobably sequential? then
10:17Morgawrmm... I fixed my problem (it seems) at last... a question, how does clojure store objects in sets? Does it call the hashCode() function of the object?
10:18opqdonutMorgawr: there are both hash-sets and tree-sets
10:18hyPiRionMorgawr: it's commonly a hash set, yes
10:18opqdonutwhich correspond roughly to javas HashSet and TreeSet
10:18opqdonut,(class #{:a :b :c})
10:18clojurebotclojure.lang.PersistentHashSet
10:18mdrogalisIs there a way to go from a clj data structure to an iterator?
10:18opqdonut,(class (tree-set #{:a :b :c}))
10:18clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: tree-set in this context, compiling:(NO_SOURCE_PATH:0:0)>
10:19mdrogalisThe reverse of iterator-seq
10:19opqdonutoh, hmm, I wonder what the function was
10:19llasramopqdonut: `sorted-set`
10:19hyPiRionmdrogalis: (.iterator #{:a :b :c}) ?
10:19mdrogalishyPiRion: Bingo. Thank you!
10:19hyPiRionAll the Clojure-collections implement the interfaces, so you can just use them
10:19opqdonutllasram: right
10:20opqdonut,(class (sorted-set #{:a :b :c}))
10:20clojurebotclojure.lang.PersistentTreeSet
10:20Morgawrany reason why doing stuff like (conj myset object) is different from doing (conj myset (.hashCode object)) ?
10:20hyPiRione.g. ##(supers (class #{:a :b :c}))
10:20lazybot⇒ #{clojure.lang.IPersistentCollection clojure.lang.IObj clojure.lang.Seqable clojure.lang.APersistentSet clojure.lang.IPersistentSet clojure.lang.IEditableCollection clojure.lang.AFn java.lang.Object clojure.lang.Counted java.lang.Runnable clojure.lang.IFn java.io.Ser... https://www.refheap.com/19241
10:20opqdonutMorgawr: in the first case you are adding the object, in the second case the hashcode
10:20Morgawryes but
10:20opqdonut,(conj #{"x"} (.hashCode "abc"))
10:20clojurebot#{96354 "x"}
10:20llasramMorgawr: Because one adds teh object and one adds whatever the integer hashcode is...?
10:20MorgawrIn my algorithm I had the bug where I was just testing the hashCode in the set and apparently on very very very large number of hashcodes the set had collisions
10:20opqdonut,(conj #{"x"} "abc")
10:20clojurebot#{"abc" "x"}
10:21Morgawrisn't the "conj" operation in the set storing the actual hashCode of the object as hash?
10:21hyPiRionMorgawr: no
10:21Morgawrit's storing the object + lookup for the hashcode, yes?
10:21Morgawrand hashcodes may collide?
10:22hyPiRionIt uses the hashCode to avoid collisions, and when it finds the object(s), check for equality
10:22Morgawrah okay
10:22Morgawrthis makes sense then
10:22MorgawrI see what my problem was, derp
10:22Morgawrthanks for clarifying this
10:24Morgawrnow, onto the next question... I have something like 5-10 futures spawned and I want to find out the first one that returns, how do I make sure I return as soon as one of them returns instead of having to wait for all of them?
10:25llasramSounds like you want a queue, or maybe a promise, depending on what you intend to do w/ the results of the other futures
10:25Morgawrmmm.. basically I have these futures and want to return as soon as one of them returns true (doesn't matter who) and if none of them returns true then I wait till they all return false
10:26MorgawrI was thinking about a promise... yeah
11:09dublindanHey, I'm starting a new web project and am trying to decide between using enlive or laser for templating - any recommendations?
11:09dublindanAlso, does anyone know if laser has the equivalent of enlive's auto-reload?
11:20MorgawrI can't figure out how to elegantly listen on multiple futures and return as soon as one of them returns
11:20seangrov`Morgawr: core.async and alt! ?
11:20Morgawreven if I make a single promise shared by all futures, if that promise returns false I need to reset it and re-listen on it (I want the first future that returns true)
11:20MorgawrI'm not going to use core.async
11:20seangrov`Well, good luck then
11:20seangrov`Just a tab in the dark
11:20seangrov`stab*
11:22seangrov`Is there some tool to print out all of the compojure routes in an app, a la rails' `rake routes` or django's `show_urls`?
11:23tbaldrid_Morgawr: care to expound? This is exactly that core.async was designed for.
11:26klrranyone know if there are practical use-cases of monads in a non-pure functional language?
11:27Morgawrtbaldridge: I'm just implementing a small clojure test inside a java application and it's very self-contained, don't want to add external dependencies (it's just a personal test, nothing fancy and it's definitely not the best way of doing it, I am aware of that)
11:28Morgawranyhow I found a solution, I just have a shared promise and as soon as some thread returns I check that promise, if it's false I reset until it's true or until all threads have returned
11:28Morgawrand it's working fine atm
11:29mdrogalisMorgawr: I tried to do something like that before core.async came out. I had a race condition where in the window of time when the promise was being reset, the thing I was waiting for happened.
11:29mdrogalisIt was a real B >_>
11:29tbaldridgeMorgawr: what happens if the 2nd future completes before you check the promise?
11:30Morgawrmdrogalis: if you deliver to a promise that has been realized already it throws an exception, I capture that exception and try again until the promise has not been delivered by other threads.. and in the main thread I just deref the promise and wait, as soon as it's deref'd I check and if necessary I reset it (So the next thread can deliver)
11:30mdrogalisI'm dizzy just reading that - but whatever works for you :o
11:31Morgawrtbaldridge: there are N futures and I wait for the first one to realize the promise, all the others that realize the promise at "the same time" will throw the exception and will keep throwing it until the promise is reset so there should be no contention
11:31boodleHi all, I v.new to macros (and awful!), can you tell me how I might go about solving this? https://www.refheap.com/19251
11:31llasramMorgawr: Huh, what version of Clojure are you using? IIRC the current version doesn't actually throw
11:32Morgawrllasram: I'm using 1.5
11:32Morgawrand seriously? It doesn't throw?
11:32llasramAnyway, easy-peasy: just have the futures not deliver non-truthy values. Then have a final future which waits on the others and delivers false
11:32ToxicFrogboodle: I think the question needs more context. How would this be used? What would you want the macro to look like?
11:33Morgawrllasram: mmm.. this might be a nice idea
11:33boodleToxicFrog: well I'm only mentioning macros because I think it may be needed but all I want to actually do is use the ':fieldname' value within the map defn (in the ':val' assignment)
11:34mdrogalisAnyone know of a Websocket client that I can run server-side? Aleph might do it, but I can't find any examples.
11:34Morgawrllasram: looks like the latest version of clojure actually returns "nil" upon delivery of an already realized promise
11:34Morgawrso I can just test on that
11:35Morgawrinstead of the exception
11:35Morgawrno big deal
11:35Morgawr(and much cleaner imo, no need to spawn additional threads)
11:35ToxicFrogLike, (defmacro foo [fieldname] `{ :fieldname ~fieldname :val ~(do-something-with fieldname) }) or thereabouts? (disclaimer: not tested, my macros are rusty)
11:35tbaldridgeMorgawr: yeah, I'm not sure why, but I can't get (deliver p val) to ever throw an exception.
11:35tbaldridgein 1.4 or 1.5.1
11:36Morgawrin repl I did (def a (promise)) (deliver a 4) (deliver a 3)
11:36boodleToxicFrog: probably, will try it out, ty
11:36Morgawr(deliver a 4) returns the promise
11:36Morgawr(deliver a 3) and subsequient calls return nil
11:36Morgawrso it's fine
11:36`cbpboodle: why does a function not work?
11:37Morgawrcan't wait to test this algorithm on a 48-core machine and see how it performs
11:38boodle`cbp: well I'm defining an array of maps and want to simplify my ':val' defns.. happy to use fn's if that's do-able.. not sure how
11:39`cbpboodle: when you say defns you mean definitions or clojure's defn?
11:40`cbpboodle: if you wanna use the same value on multiple places just use a local binding. But I'm still not sure what you really want.
11:40boodle`cbp: definitions.. what I really mean is where I assign a value to ':val'. If I could do something like ':val (get record ~fieldname)'
11:41Morgawrbitemyapp: I forgot tell you the reason why my algorithm wasn't working. Turns out I was erroneously saving the hashCode() of the object in a set instead of the object itself and that created collisions. Now it works properly :)
11:42`cbpboodle: like (defn make-map [fieldname] {:fieldname fieldname :val (get record fieldname)}) ?
11:43boodle`cbp: I can't really use of function I think because some of my map entries have other varying key/val pairs and some don't have ':vals' etc.
11:44boodle`cbp: but maybe with '& otherargs' in the parameter I could... ty
11:46boodle`cbp: I was trying to learn about the reader and if I could refer to a map key's value within the map's definition.. looks like I should just go up with another function like you suggested.. no biggie
11:48`cbpboodle: oh like a `this` variable? Yeah there's no such thing
11:48sm0kehello any library in clojure for maps with expiry values on keys?
11:49TimMcLike a cache?
11:49sm0keTimMc: Yes sort of
11:49`cbpsm0ke: theres a cache library where you can set a time
11:49boodle`cbp: yes.. again just trying to hack the reader a little for convenience but a helper fn's the way to go
11:49sm0ke`cbp: what is it called?
11:49`cbpclojure.tools.cache i think
11:49mpenetsm0ke: core.cache and core.memoize
11:49`cbpno clojure.tools.memoize
11:49`cbper
11:49`cbpcore
11:50`cbphttps://github.com/clojure/core.memoize
11:51sm0kethanks
11:53sm0kehey guys i have this sticky situaition where i want to read of a atom/agent/ref seq ( i dont know whats fits) ..and then set it to []..but i want to avoid the situation that anyone else changes it in between..how do i handle this
11:54tbaldridgesm0ke: compare-and-swap! on an atom
11:55mdrogalissm0ke: Or use a transaction with a ref.
11:55sm0ketbaldridge: ,(doc compare-and-swap!)
11:55mdrogalisI think it's compare-and-set!
11:56logic_progdoes core.async support any type of "sorting"
11:56logic_progi.e. we define a field/parameter to sort on, and the messages are in an order that minimizes that field
11:57nDufflogic_prog: ...so you want a priority queue? Plenty of ways to implement that.
11:57logic_prognDuff: yes, I want a priority queue
11:57logic_prognDuff: what do you have in mind?
11:58nDufflogic_prog: ...well, you can have a JVM-implemented priority queue from the standard library, and connect each end to a channel.
11:58nDuffthat's the easiest approach.
11:58logic_progI need it to work in clojurescript too
11:58logic_progin fact, I need it to work in both clojure and clojurescript
11:58logic_progactualy, let me talk about my real problem
11:58logic_progcljs and clj are talking ove ra websocket
11:58nDuffin that case I'd probably do something with nested channels.
11:58logic_progI need to ensure that the messages arrive "in-order"
11:59logic_progerr, are evaluted "in-order"
11:59tbaldridgelogic_prog: that doesn't make sense, sort is a set operation, channels are streams of data.
12:00logic_progserver (clj) is sending client (cljs) streams of data
12:00logic_progI wnat this stream processed in the order it is sent
12:00logic_progso I need a way to detect out of order packets
12:00logic_progI was thinking of attaching an id to every packet and "sorting"
12:00mdrogalislogic_prog: So artibrary access to the stream ordering, kinda?
12:00llasramlogic_prog: Not just TCP?
12:00logic_progllasram: yeah, I think basically I need to re-implement a TCP-like in cljs/clj
12:01mdrogaliss/stream ordering/stream contents
12:01llasramlogic_prog: Er. What are you doing which could cause things to occur out-of-order?
12:01logic_progjavascript delays
12:01tbaldridgelogic_prog: you could probably hack this via a custom buffer, could be tricky, but it could work.
12:01logic_progbetween the ".-onMessage" and pushing it onto a queue,
12:01llasramI see
12:01llasramInteresting
12:02logic_progllasram: I think JS can fuck me up by switching out a thread after it reserives the msg from websocket, but before it >! it onto a go channel.
12:02logic_progwe love JS.
12:02logic_progalright, TCP it is
12:04tbaldridgelogic_prog: I don't see how that can be the case. onMessage and put! will do what you want. No way they can arrive out of order
12:04tbaldridgelogic_prog: if you use go and >! to put the message into the channel, then yeah, this could happen. Don't do that. :-P
12:47dobry-denFor fun, I've been implementing Clojure functions in Emacs Lisp. How would yall handle the fact that '() is the same as nil in elisp?
12:48technomancydobry-den: it's symptomatic of the lack of laziness in general
12:48technomancyhave you seen dash.el?
12:48dobry-denMy approach was to just make everything return vectors by default
12:48technomancyahahahaah
12:48technomancysorry, no one told you
12:48technomancyvectors in elisp and CL are a joke
12:49dobry-denwhat do you mean? aside from the fact that elisp's main collection fns are on lists
12:49hyPiRionThey are very nice for mutability
12:49technomancythe syntax for vectors implicitly quotes them
12:49hyPiRionThat's essentially it
12:50technomancyso [(+ 1 2 3)] doesn't eval to [6]
12:50technomancyand you have to learn a whole new set of functions that operate on vectors
12:50technomancyusually their names don't even match up with the list equivalents
12:50dobry-denhaha that explains why my (vconcat coll [x]) returned [1 2 x]
12:50bbloom:-/
12:50dobry-dendang
12:51technomancyit is really boggling how bad they are
12:51dobry-denof course i just use (vector _)
12:51bbloomdata structure literals and the evaluation of elements in them is pretty damn brilliant
12:52technomancybbloom: it's difficult for me to see it as anything other than obvious, but you're probably right =)
12:52bbloomtechnomancy: all the best ideas are obvious in hindsight
12:52bbloomjust like symbols vs keywords
12:53dobry-deni learned a lot of elisp last night though. like how much i appreciate clojure vs what seems to be elisp's different binding lookups for functions vs other symbols
12:53bbloomand if you think about why symbols v keywords is so brilliant, than lists vs vectors w/ their differing evaluation rules are precisely the same
12:53bbloomit's an obvious idea:
12:53bbloomanytime you add implicit evaluation, you need to add explicit elimination of that implicit evaluation
12:54bbloomand if you have multiple kinds of evaluation, you need multiple kinds of quoting
12:54rasmustobbloom: are you saying that's what keywords do?
12:54rasmustothe explicit elimination of eval I mean
12:54bbloomkeywords are basically always quoted symbols
12:54technomancyI wouldn't say you ever *add* implicit evaluation
12:54bbloomignoring the differences in data structures, vectors are always quoted lists
12:54technomancyyou remove implicit quoting
12:55technomancybut yeah
12:55bbloombut vectors have special quoting rules. it's a different type of quoting than the general purpose quote primitive
12:56rasmustoI dunno if I've fully understood keywords and their benefit over something like a quoted symbol, is it just that they can't be unquoted?
12:56bbloomrasmusto: a keyword is simply a symbol that always refers to itself
12:56bbloomimportantly: you never need to worry about quoting or unquoting them
12:56gfredericks,''''':foo
12:56clojurebot(quote (quote (quote (quote :foo))))
12:56rasmustookay, right.
12:56dobry-denIf you were implementing Clojure functions in Elisp, do you know of a sensible way to implement a difference between '() and nil?
12:57bbloombut more importantly: they are keyword types when they get through the reader
12:57bbloomtechnomancy: do you (or anybody else) know of a lisp that has a built in "quote the datatype, but not the members" operator of sorts?
12:57bbloomlike all of clojure's data structures?
12:58technomancyquote the data type?
12:59bbloomi mean like: (whatever-quote (vector-ish-thing 5 10 15))
12:59bbloomi mean like: (whatever-quote (vector-ish-thing 5 (+ 10 2) 15))
12:59bbloomwhere you'd get out a vectorish thing with 5 12 15 instead of a literal + in it
13:00arrdemis refheap having heartburn for anyone else today?
13:01technomancybbloom: I don't see how that's a form of quoting
13:01bbloomtechnomancy: for lack of a better word
13:01bbloomi think thatematica would call it HoldHead
13:03bblooms/thatematica/mathematica/
13:03bbloomweird typeo
13:03wedrnice
13:04technomancybut I don't know of any other lisps that get it right; no
13:06llasramOh man -- how are people not using ASM to create macros around custom Java class generation *all the time*?
13:15arrdemRaynes: not sure what's up but I'm generating 500 errors on refheap.com/paste repeatably.
13:16arrdemRaynes: across chrome, firefox and refheap.el :/
13:22pjstadigllasram: do tell
13:27arrdemhum... is (clojure.core.typed/Seq <type>) no longer provided?
13:29llasrampjstadig: I used ASM to write a macro to generate some classes with interfaces (in the abstract sense) not well-supported by existing Clojure mechanisms
13:29gfredericksllasram: not well-supported? meaning impossible?
13:29llasrampjstadig: the ASM library includes a class called ASMifierClassVisitor which you can run over an existing .class file, and it'll spit out the (Java) ASM API calls to generate that class file
13:31llasramgfredericks: I believe so. I needed a custom constructor w/ a particular type signature and implementing a generics-using interface w/ the types right on the final class
13:32llasramOh, and with annotations on everything
13:41Raynesarrdem: Seems to be fine at the moment.
13:42dobry-dentechnomancy: last night i started reading about maven (no java background). i am seeing if i can write a lein plugin that lets me drop 3rd party jars in a local folder, specify "local/<artifactID" in dependencies, and have lein install it for me
13:42arrdemRaynes: yay. okay thanks for looking.
13:42dobry-denis there any obvious hangup with that
13:42Raynesarrdem: Let me know if you have any issues and I'll take a look.
13:43arrdemRaynes: so my desktop 500s on everything as mentioned above, but my laptop works fine so I'm not sure what's up either.
13:43master_op#regex
13:43dobry-denRaynes: does laser 2.0.0-SNAPSHOT on clojars work? I haven't dug into the error that i get when i require it in a file but it says something about hickory.core.
13:44dobry-denbut i probably will soon since i've been using as old version of laser for a while
13:45Raynesdobry-den: Theoretically it should, yes.
13:45Raynesarrdem: Your desktop is silly.
13:46technomancydobry-den: you mean like lein-localrepo?
13:46TimMcWhee, I get to write a macro!
13:46TimMcMacros are like dessert.
13:47gfrederickslol
13:47gfredericksclojurebot: macros are like dessert
13:47clojurebotIt's greek to me.
13:47gfredericksclojurebot: macros is <reply> macros are like dessert
13:47clojurebotIn Ordnung
13:48TimMcgfredericks: You could also put |pipes| around the verb.
13:48gfrederickspipes!
13:48gfredericks~macros
13:48clojurebotBarking spiders!
13:48gfrederickslol whatever know what you want clojurebot
13:48technomancy...
13:48dobry-denmy macro-writing experiences always turns into randomly spackling symbols with ~ and ' until it works
13:49srrubyHow do I control which functions are "exported" by my namespace? defn- ??
13:49lazybotsrruby: Definitely not.
13:49gfredericksdobry-den: once I got good at writing macros that experience got promoted to when I try to write metamacros
13:49technomancyarrdem: I think with clojurebot it's intentional. part of the charm.
13:50TimMcI can confirm this.
13:50dobry-denmacrofactories?
13:50gfredericksI guess so
13:50TimMcsrruby: lazybot is wrong this time -- that is correct
13:50dobry-deni feel like i'm not getting better at writing macros
13:50TimMcsrruby: defn- is just defn + ^:private, which can be put on any def
13:50gfredericks"I feel like I'm not getting better at eating pie."
13:51TimMc?!
13:51srrubyCan I declare in the ns form which functions are "exported" ?
13:51`cbpfatty
13:51`cbpsrruby: no
13:51technomancysrruby: unfortunately not
13:52srrubyThanks everybody. I'm surprised..
13:52TimMcsrruby: vars are public ("exported") by default; putting ^:private on the var's name prevents this (but does not make it truly inaccessible.)
14:08glosoliWhich of Emacs Kits include Clojure Mode ?
14:10technomancyglosoli: just use package.el
14:11glosolitechnomancy: what's package.el umm ?
14:11technomancyit's not worth pulling in a bunch of unrelated stuff just for one file
14:11glosolitechnomancy: aaa that I am doing it already
14:11technomancyhttp://marmalade-repo.org/
14:11glosoliWas just curious to check what else people do :)
14:11glosoliTo learn something from their configs or such
14:11seangrov`arrdem: Same here, refheap seems to be broken on insert
14:11technomancyah cool gotcha
14:12arrdemseangrov`: yay I'm not totally insane!
14:12gf3seangrov`, arrdem: WFM
14:12dobry-denif you have that kind of time it's pretty cool to spend a day setting up your .emacs.d from scratch
14:13seangrov`gf3: You can paste and save?
14:13gf3seangrov`: Yarp
14:13gf3https://www.refheap.com/116dd69edd6daeaed2b68ba20
14:15arrdemdobry-den: eh you only really have to do that twice... once to find the tools you like and one more time to shave the yacc into a modular config file set.
14:19TimMcHeh, "yacc-shaving".
14:19arrdemTimMc: we already shaved yacc, it's called instaparse :D
14:20llasramheh
14:21winkbadumtsh :P
14:22TimMc:-D
14:22arrdem~rimshot
14:22clojurebotBadum, *tish*
14:33dobry-deninstaparse is a definitive tool for the pathological yak-shaver
14:34rasmustodobry-den: instaparse seemed like overkill for the shaving I had to do
14:34dobry-denand its readme does a good job of lulling you into a false sense of this-won't-take-long
14:35winkcome to the dark side, we have grammars
14:36dobry-denhmm, i'm really getting this first instaparse example. i'll just write my own markdown parser for my blog
14:36bitemyappdobry-den: instaparse is awesome.
14:36dobry-deni agree
14:37dobry-denthe top few most popualr clj markdown parsers are all regex i believe
14:38arrdemI mean the original markdown "spec" was really a case of "here's what I regex match and what it transforms to"...
14:38bitemyapparrdem: it's more complicated than that, the perl script he wrote violates a regular grammar IIRC
14:39bitemyappas a result, a fully "compliant with original implementation" markdown parser has to be a parser, not just regex.
14:39arrdembitemyapp: well perl regular expressions aren't regular so...
14:40dobry-deni tried writing my own markdown grammar.
14:40clojurebotGabh mo leithscéal?
14:40bitemyappThere's that too, but I don't just mean Perl regex backtracking.
14:40dobry-deni dont visit that folder anymore
14:40arrdemdobry-den: yep. basically.
14:40utkarshI'm probably missing something small here, but in clojure-mode and nrepl, how do I *send* the current sexp into the nREPL buffer I have opened in a window? C-x C-e evaluates and shows the result in that little line below the mode line.
14:42bitemyapputkarsh: C-h m
14:42dobry-denutkarsh: i usually c-x c-e all day. but if i want to port code to the repl, M-- C-c C-z or whatever will load the file namespace into repl window
14:42hiredmanutkarsh: they may be something to do that, but I don't think most people work like that, so it seems unlikely
14:43dobry-deni think i only use the repl window when i want quick visual feedback on unwieldy/larger datastructures
14:48honzalol at dobry-den :)
14:49bitemyapprkneufeld: do you have a minute to discuss the Korma chapter?
14:49bitemyapprkneufeld: I've been working on it and need to make a decision.
14:53rkneufeldbitemyapp: I do, private message?
15:29logic_progis there a way to tell emacs to indent my-defn with the same rules as defn?
15:31technomancylogic_prog: yes, but your indentation rules won't apply to anyone else editing your code
15:32logic_progtaht's fine
15:32logic_proghow do I do this?
15:32technomancythere's a put-clojure-indent function
15:33logic_proghmm
15:33logic_progI sholud be using clojure-emacs isntead of starter-kit?
15:33bitemyapplogic_prog: you should be using Emacs.
15:33technomancywhat is clojure-emacs?
15:34logic_progthe first thing I find on google for put-clojure-indent
15:34logic_progseems to be an emacs mode
15:34bitemyappgf3: dem carpenter abs.
15:35technomancylogic_prog: don't use the starter kit; do use clojure-mode, nrepl.el, and paredit at least
15:35gf3bitemyapp: Topless roof Jesus
15:35Raynesgf3: Did I ever tell you that my toilet'd iPhone eventually recovered after about 5 days?
15:36RaynesI imagine your phone had less luck, so I thought I'd rub it in.
15:36logic_progis this due to the ios7 water proof update?
15:36RaynesYes.
15:38gf3Raynes: So did mine. Bag of rice, works every time → http://cloud.gf3.ca/Rjh6
15:38clojurebotHuh?
15:38Raynesgf3: dat rice
15:39TimMcRaynes: Mozilla Persona status: Still useless.
15:39RaynesTimMc: Still waiting for your github auth pull request, bro.
15:40TimMcThis has been your scheduled quarterly reminder.
15:40gf3Oh shi—
15:40Raynesgf3: Also, still waiting for your redesigns you slacker.
15:40TimMcI can't believe it's still incompatible with Mozilla Firefox's password manager.
15:40bitemyappRaynes: fuck auth, you should integrate bulwark :)
15:40gf3Raynes: I was thinking about that yesterday ❤
15:40Raynesbitemyapp: Still waiting for your bulwark pull request bro.
15:40bitemyappTimMc: Mozilla people don't know how to implement services.
15:41bitemyappRaynes: I have too much to do. :(
15:41Raynesbitemyapp: So do I!!1!
15:41logic_progso put-clojure-indent seems to work sith (put-clojure-indent 'unify 2), but not (put-clojure-indent 'util/unify 2)
15:41TimMcbulwark, eh?
15:41logic_progwhy does the / break things?
15:41Raynesbitemyapp: A friend said last night: "I remember when Raynes was jobless and worked on random projects constantly."
15:41bitemyappRaynes: you know what my queue looks like. It's horrific.
15:42RaynesIt actually made me sad enough that I'll probably hop back on some projects soon.
15:42RaynesLaser 2.0.0 needs to get finished, some features in refheap master need tweaked and released, some plugins in lazybot need fixed, etc.
15:42bitemyappRaynes: http://i.imgur.com/1zTP0cc.gif
15:42bitemyapp^^ that's how busy I am.
15:43technomancyRaynes: that feeling when you are reluctant to hire someone because you know it will impact their community output =(
15:43scriptordamn, that's dark
15:43bitemyappI'm pretty sure my output increased after I started at the company I'm at now.
15:43Raynestechnomancy: Well, it isn't just work affecting my community output.
15:44RaynesI think I needed a bit of a break anyways.
15:44technomancyit's a thing people do
15:46bitemyappRaynes: not like you gotta be a superhero. Just make things. :)
15:46bitemyappyou don't have to be an ecosystem-unto-yourself.
15:46Raynesbitemyapp: But I am a superhero.
16:37Raynesifesdjeen: Darn you.
16:38Raynesifesdjeen: I had just typed out an answer. :P
16:38ifesdjeenRaynes: :)
16:38ifesdjeenthanks <3
16:38Raynes<3
16:38ifesdjeensorry i bothered you before i read the code ;)
16:38ifesdjeencouldn't figure it out for 2 hours :)
16:38RaynesIt's fine. max-defs isn't even documented apparently.
16:38RaynesIt should be mentioned in the docstring.
16:38ifesdjeen:)
16:39ifesdjeenprobably
16:39ifesdjeenimplemented workshop server on top of clojails, btw
16:39ifesdjeenwe're using it for http://clojureworkshop.com
16:39RaynesCool, cool.
16:39SegFaultAXifesdjeen: I dig the logo.
16:40SegFaultAXOh is that just the clojurewerkz logo?
16:40ifesdjeenSegFaultAX: it's somewhat similar to ClojureWerkz logo ;)
16:40ifesdjeenit's a part of it, let's say ;)
16:40SegFaultAXHeh
16:40ifesdjeenRaynes: do you want a couple of @clojurewerkz stickers?
16:40ifesdjeenactually, does anyone want some? :D
16:41Raynesifesdjeen: I never turn down stickers.
16:41antares_hey Raynes
16:41RaynesGreetings, sir.
16:41ifesdjeenRaynes: where are you located?
16:41RaynesLos Angeles, CA.
16:41ifesdjeenah
16:42RaynesInternational shipping is no fun.
16:42mdrogalisStickers are awesome.
16:42antares_Raynes: how is SoCal treating you?
16:42mdrogalisOh, read up :(
16:42ifesdjeenRaynes: they're currently in USA actually :)
16:42Raynesantares_: Wondrously. I love it here.
16:42ifesdjeenRaynes: although in SF :P
16:42Raynes:p
16:43ifesdjeeni know that Zach Tellman will be @ EuroClojure
16:43RaynesEverything is in SF. Angels are used to this fact.
16:43ifesdjeennot sure if he's anywhere close to you though
16:43ifesdjeenah, SF, too
16:43ifesdjeenshoo
16:44RaynesZach frequently visits LA. We (Geni) frequently have lunch with the Factual crew when Zach is in town.
16:44ifesdjeenRaynes: oh, great! I'll just give him some for you
16:44RaynesCool.
16:45antares_Raynes gets ClojureWerkz stickers before I do :/
16:46Raynes:3
16:46Raynesantares_: Well, I don't actually know when I'll see Zach.
16:46antares_it's OK
16:46ifesdjeenantares_: no worries, Russia is on the list :)
16:47antares_ifesdjeen: Russian customs are ridiculously understaffed
16:47ifesdjeeni think there'll be some people on EuroClojure from MSK
16:47RaynesI seem to recall that he wants to be here when we do a telemetry-related Clojure meetup (we're hosting our first meetup at the Geni office on the 10th, and a future one will feature some telemetry-related shenanigans) so it could be a month or two before I see him again.
16:47antares_ifesdjeen: like you don't know that I'm not really in Moscow any more :P
16:48ifesdjeen:D
16:48bitemyappantares_: elastisch is killing me man.
16:48bitemyapp (doc/search events-index events-type
16:48bitemyapp :query {:match_all {}}
16:49bitemyappantares_: ^^ only ever seems to return 10 documents in an index that contains 31
16:51antares_bitemyapp: 10 is the default page size
16:51bitemyappfFFFFFFFFFFFFFFFFFFFF
16:51antares_use scroll requests or pass a different limit
16:51bitemyappI passed a limit filter.
16:51antares_I don't think it's a filter
16:51bitemyappantares_: value 50 limit filter.
16:51antares_filters are applied to a result set
16:51antares_it has to be a search request option
16:52antares_(that's how ES works)
16:52bitemyappantares_: you might be talking about something else but: http://clojureelasticsearch.info/articles/querying.html#limit_filter
16:54antares_filters are applied after the documents were retrieved from the index
16:54bitemyappantares_: that fixed it. yeesh.
16:54antares_it's like HAVING in SQL, not WHERE
16:54bitemyappantares_: that fucked us hard in ClojureCup :P
16:54bitemyappI've used ES before, but it was awhile ago.
16:54bitemyappForgot about that.
16:54antares_hilariously I cannot find the query option that sets the limit
16:54antares_in ES docs (which are far from perfect)
16:55bitemyappantares_: far far
17:16logic_progin clojurescript, when I get an error, is there anyway to get a stacktrace ?
17:18nDufflogic_prog: if you mean that one refers to your actual Clojure code, you need source maps, which are new and experimental.
17:21Bataihello, how the highly experimental library for proper tco called i've forgot
17:21ambrosebsBatai: ctco IIRC
17:22ambrosebshttps://www.google.com.au/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CC4QFjAA&amp;url=https%3A%2F%2Fgithub.com%2Fcjfrisz%2Fclojure-tco&amp;ei=9oZMUo6sDoqulQWS34DQCA&amp;usg=AFQjCNE1A6-fxzX1R2QZnIYECX5f6FBxyQ&amp;sig2=0fUF9w-p5_dnF81qwSkA3Q&amp;bvm=bv.53537100,d.dGI
17:22ambrosebswhoops!
17:22ambrosebshttps://github.com/cjfrisz/clojure-tco‎
17:23Bataiyeah, thanks.
17:23bitemyappambrosebs: whooooaaaaa. Does that work?
17:23ambrosebsbitemyapp: I don't think it's quite ready
17:24ambrosebsbitemyapp: need to bug cjfrisz more!
17:24bitemyappstill, having safe mutual recursion would be awesome.
17:24bbloomit's a lexical transform, so you might as well just use trampoline
17:25technomancyif you don't mind having wrappers everywhere it shouldn't be a big deal, right
17:25technomancy?
17:25bbloomit doesn't enable you to do anything you couldn't do before, it just makes it a tiny bit more automatic :-)
17:25gfredericksthere's a bug in reduce due to lack of TCO
17:25technomancyright, it's not like it's possible to suddenly get TCO for free
17:25bitemyapptrampoline annoys me.
17:25bitemyappgfredericks: what's the bug?
17:26bbloomeverywhere? you only need it at the mutually recursive call sites, which is probably only a few more places than wrapping the declaration sites
17:26gfredericksbitemyapp: stack overflow when reducing seqs that transition type frequently
17:26gfredericks,(->> (cons 1 [2]) (repeat 10000) (apply concat) (reduce +))
17:26clojurebot#<StackOverflowError java.lang.StackOverflowError>
17:26gfredericks^ TCO would fix that immediately
17:28gfredericksthat sequence is perfectly usable in other contexts, just not with reduce
17:52hyPiRionoh, hah, that fun thingy
18:04rasmustobogdanp needs to be bogdamped
18:04Batairasmusto: Lol.
18:09technomancyhas anyone touched a 32-bit computer in the last 2 years?
18:09technomancyapart from mobile devices, phones, gaming, etc
18:09bbloomis that like a mainframe or something?
18:09_freenodeI've been mostly running 32-bit VMs
18:10rasmustotechnomancy: does an 8-bit computer count?
18:10technomancyrasmusto: only for hipster cred
18:10`cbpI sell software for stores that runs on 32 bits
18:10`cbp32 bit xp
18:10rasmustotechnomancy: yeah, robots w/ micros are pretty hipster
18:10technomancyI'm thinking for machines you do dev on
18:11rasmustoI had a command line on my robot
18:11`cbpoh :P only for testing
18:11_freenodeRealistically, there's no excuse for my laptop to be 64-bit
18:12technomancy_freenode: those VMs aren't for clojure dev though right?
18:12_freenodeDammit.
18:12hyPiRiontechnomancy: I made a 16 bit machine. Does that count?
18:12jimrthytechnomancy: Those VMs are for all *sorts* of dev. Including clojure
18:13`cbpwhen i used ubuntu it was a 32 bit machine if that counts, that was my main de machine
18:13`cbpdev*
18:13`cbp32 bit vm
18:13technomancyhyPiRion: see my response to rasmuto
18:14rasmustoI liked to think my my robot as "prod"
18:14jimrthytechnomancy: I've also done a little dev on my chromebook, which is 32-bits. Pretty much all SSH'd into my 32-bit server VM...but that was really just personal web-site cheap hosting stuff
18:14rasmustos/my/of
18:14hyPiRionoh. Well, we made game of life and video filters on it. Not exactly general purpose.
18:14technomancyman, all the things you don't have to think of when you're on a VM
18:15technomancyI mean, the JVM
18:18hyPiRionI'd guess that counts for many VMs though
18:18bjaso if I'm not supposed to use the format function in clojurescript, is there an alternative?
18:19hyPiRionis cl-format ported over to cljs?
18:19technomancyhyPiRion: but not virtualbox =)
18:19bjareferring to https://github.com/clojure/clojurescript/commit/48c8d0fafc18375876e10caf960a7c7da27ac308
18:20hyPiRiontechnomancy: heh, right
18:22jimrthyIs there an idiomatic way to poll a core.async channel? Right now I'm trying an alts read w/ a 1 ms timeout, but I'd rather skip that ms if possible.
18:23bbloomjimrthy: you can provide a default
18:24bbloomhttps://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L243
18:24jimrthybbloom: Sweet, thanks
18:26dobry-denWhat does an asterisk* at the end of a function name tend to represent?
18:28technomancyit means either "internal implementation detail" or "sorry but I couldn't think of a better name for this function"
18:29bjaI guess "internal implementation detail" is close enough to "function version of a macro named the same minus the *"
18:29danlentzsorry to ask what I'm sure is a du,b question but I'm a little confused as to the use of (.method args) vs (. method args) and how .. fits in. Is there a quick expln or a good webpage anyone that covers this?
18:36technomancydanlentz: (. obj method args) is mostly just for macroexpansion
18:37technomancyuse (.method obj args) for single method calls and generally -> for chains
18:39danlentzwhy for instance is it not corect to say (.digest (java.security.MessageDigest/getInstance "SHA1")) but seems to require (doto (java.security.MessageDigest/getInstance "SHA1") (.digest ……))
18:40technomancydanlentz: doto means "ignore the return value"
18:40technomancyit's a totally different call
18:40akurilinIs there any way of suppressing exceptions being dumped to the terminal when running tests that make them get thrown?
18:40akurilinIn my case they're SQL exceptions that I'm intentionally hitting.
18:41hyPiRionakurilin: (is (thrown? ExceptionName body))
18:41hyPiRionfor clojure.test
18:43danlentzah. so what Im looking for is (-> (make-digest +sha1+)
18:43danlentz (.digest (.getBytes "sss")))
18:44akurilinhyPiRion, just to clarify, I'm not actually to interested in check that they were thrown, I check the result of the API call to see how many concurrent calls failed. I just want to avoid spammin the test log so that when exceptions are thrown, I do end up looking at them
18:44akurilin(real exceptions, not the expected ones)
18:44danlentzsorry (-> (make-digest +sha1+)
18:44danlentz (.digest (.getBytes "sss")))
18:46hyPiRionakurilin: oh, then you could probably bind *err* or *out* to a StringWriter and ignore its content
18:46hyPiRionLook at e.g. how with-out-str and how it handles it: (source with-out-str)
18:47akurilinhyPiRion, ok that's cool, I just to redef it for a few specific tests, so this is probably not too hackish
18:48technomancydanlentz: when in doubt, macroexpand
18:48danlentzalso, is there an equivalent Class or unboxed primateve in clojure/java to the common-lisp bit-vector?
18:49technomancydanlentz: also, don't use +foo+ for constants; everything that isn't a reference type is a constant
18:49danlentzah good point.
18:49danlentz:) +culture-shock+
18:49technomancyheh
18:51Def`1Hi
18:51Def`1said somebody here on the Russian?
18:53Def`1means by which you can write a gui clojure
18:53akurilinhyPiRion, well *err* didn't do it, but *out* did. Either I'm manually logging that exception from somewhere, or it's not beign saved to *err* by default.
18:53danlentzcommon-lisp has just so many facilities for working with bytes, bits, bit-vectors, and ESPECIALLY unsigned numbers which I feel like I've been really grappling with.
18:54akurilinhyPiRion, in any case I learned something new today thanks to you :)
18:54Def`1ty
18:54hyPiRionakurilin: np
18:54akurilinhyPiRion, btw, is foo# some kind of naming convention for overridden dynamic vars?
18:55hyPiRionakurilin: no, it's macro sugar. It's for generating symbols not colliding with other symbol names
18:55danlentzbut a bit vector facility would go a long way toward implementing some, if there is such a thing in java/clojure?
18:55technomancydanlentz: byte arrays are common, but unsigned numbers are not a thing on the JVM
18:55hyPiRion,`(let [val# (some computation)] (do-something-with val#))
18:55clojurebot(clojure.core/let [val__29__auto__ (clojure.core/some sandbox/computation)] (sandbox/do-something-with val__29__auto__))
18:56akurilinhyPiRion, oh I see. Yeah I'm not yet at macro-fu yet, so I won't be able to appreciate it at this point. Soon though.
18:57bitemyappakurilin: don't use macros.
18:57hyPiRionakurilin: heh, just think of it as a way to "hide" names of variables
18:57technomancydanlentz: only other thing I'm aware of is https://github.com/ztellman/immutable-bitset
18:57danlentzy. I'm been using a vector of shorts to represent an "octet-vector" and escape the signed-arithmatic hassles. Its not a huge concern to me space wise as I'm only working with 128 bit UUIDs but I have a nagging doubt about performance vs byte-arrays
18:58akurilinbitemyapp, are there really no situations you can think of where macros would be very useful, even as an advanced clojure user?
18:58akurilin*not useful, "the right choice" is what I meant
18:58danlentzooh. not what I was looking for at the moment but very cool!
18:59akurilinhyPiRion, got it!
18:59akurilinGot to use pmap for the first time today to test a pretty simple race condition I was having, woot.
19:00danlentzactually it implements "bit-seq" which might be exactly what I'm looking for
19:00bitemyappakurilin: I tell people not to use macros until they know when to stop listening to me.
19:00bitemyappakurilin: when they know enough to know they shouldn't use macros, then they're ready for macros.
19:00hyPiRionMacros are nice if you use them properly, but that require experience
19:00danlentztechnomancy: thank you very much. quite helpful!
19:00bitemyappYou won't be ready to decide when to use macros until you've decided not to use macros.
19:00bitemyappThen you can use macros.
19:00technomancydanlentz: good luck
19:00bitemyappOr we can skip the zen koan and you can just take my word for it when I say, "don't use macros"
19:01hyPiRionbitemyapp: Sounds like some lisp zen.
19:01hyPiRionah, right, you got to that point.
19:01AimHerehyPiRion, surely you need to use macros improperly to get that experience!
19:01bitemyappAimHere: yeah but you're better off making those mistakes when you have a stronger foundation.
19:02akurilinThe problem is that you won't learn not to use macros until you've made enough mistakes by using them.
19:02hyPiRionAimHere: As long as you don't include them in your library you open source :)
19:02bitemyappmacros won't really help establish that foundation and you need to get a good nose for how macro expansion works and what it means in terms of the "time" code gets evaluated.
19:02technomancyyou can learn from trying to use other libs that misuse macros too =)
19:02bitemyappakurilin: you learn macros faster the longer you wait to use them.
19:02technomancythough that's not as easy as it once was
19:05akurilinI'll do that.
19:07danlentzztellman/primitive-math has quite a number of usefull arithmetic operations imllemented -- byte->ubyte long->ulong bitwise-ops. This guy is a star! :)
19:11hiredmandanlentz: long->ulong is something of a misnomer, the jvm has no unsigned primitive types, what happens there is transforms the long in to bytes, and creates a heap allocated BigInteger from those bytes
19:14Apage43man
19:15bitemyappApage43: yes?
19:15Apage43the no unsigned thing is a killer
19:15Apage43because I easily forget about it most of the tim
19:15Apage43*time
19:15Apage43but every once in a while it consumes my whole *day*
19:15danlentzi've been wrestling with unsigned all day
19:15SegFaultAXUgh, circleci keeps dying.
19:15Apage43cause i'm fiddling with file formats, protocols, or such
19:15bitemyappSegFaultAX: :(
19:16bitemyappSegFaultAX: going to the Clojure Community Night?
19:16danlentzmy soon is to represent unsigned long as a vector of 8 shorts
19:16hiredmanSegFaultAX: seems unlikely, they have a type system
19:16danlentzunsigned int as 4 shorts
19:16SegFaultAXbitemyapp: As prismatic?
19:16SegFaultAXAt*
19:16danlentzunsigned byte as 1 short
19:16SegFaultAXhiredman: Sweet burn.
19:16Apage43of course, I can always say to my self "hey, it could be Javascript"
19:16hiredmandanlentz: clojure vectors (and almost all jvm collections) will box primitive values
19:17bitemyappSegFaultAX: yes, at Prismatic.
19:17bitemyapphiredman: nice burn.
19:17danlentzso if i say (octets -1) i get [255 255 255 255 255 255 255 255]
19:17SegFaultAXbitemyapp: Yea, Jason Wolfe pinged me about it.
19:17SegFaultAXIs that tonight?
19:18Apage43si
19:18hiredman[], cojure vectors, box primitives, so those numbers are heap allocated
19:18clojurebotTitim gan éirí ort.
19:18danlentz (octets 0x80a0a0a0a) [8 10 10 10 10])
19:19danlentzoh yeah? well that pretty much means I've totally wasted my time … :-/
19:19danlentzgrrrrr
19:19danlentzjesus what are you supposed to do?
19:19technomancywhat are you trying to do?
19:21danlentztrying to augment the java.util.UUID class with a number of additional features which I'm accustomed to having in my CL environment.
19:21technomancyand you're having performance problems?
19:21hiredmangenerally the way you deal with unsigned types on the jvm is you byte the bullet and use the next up size of signed type, but you can't do that with longs
19:22danlentzso there is a need for representation of 128 bit values with extensive bit-twiddling assembly , dissssembly, and general manipulation
19:22hiredmanjava.util.UUID uses two longs
19:23technomancybit-twiddling on the JVM is possible, but it's a terrible place to start learning a new language
19:23danlentzright will Java uuid is 2 longs. so i most importantly need to transform those into a 128 bit or 16 (unsigned) byte representation
19:24danlentzy its been educational but really aggravating.
19:25danlentzi had looked to avoid byte vector b/c of the signedness of the individual elements was driving me crazy, but I am getting the picture it might beg the only way
19:26danlentzi am totally disheartened that my vector of shorts wind up heap allocated
19:26technomancyyou can have primitive vectors iirc
19:26technomancythey just don't work that way by default
19:26danlentzit was working so well
19:27danlentzreally? via metadata?
19:27technomancyI forget the details because I've never needed primitives ever but it was one of the original POCs for deftype
19:27danlentza POCs on all their houses :)
19:27technomancyhttp://clojuredocs.org/clojure_core/1.2.0/clojure.core/vector-of
19:28danlentzhey that might be what i need
19:30mlb-I want to have a test which uses a file's contents. How can I access this file without hardcoding the path to my clojure project/test/namespace/filename ?
19:31rasmustomlb-: clojure.java.io/resource ?
19:32mlb-rasmusto: I'm new to clojure/JVM, is there a simple example somewhere (I don't see on clojuredocs.org)
19:32danlentzthe java UUID stuff seems really meager and simpleminded -- much of what functionality it has works via some really ugly conversions to and form strings. If I can work out the basic issues of how to represent and manipulate the uuid bits as unboxed values it seems to me I should be able to do a whole lot better performance wise as well as augment the protocol with a number of capsbilities that make working with UUIDs a real pleasant experience
19:33bitemyappuuids aren't usually in the middle of performance-centric code.
19:33technomancyheh, I've always worked with uuids as strings; pleasant enough for me.
19:34danlentzthere is a common-lisp library repo: mon-key/unicly that does an incredibly meticulous job of implementing and optimizing rfc4122 down to the most minute detail
19:34rasmustomlb-: make a directory called resources in your project root, then do (slurp (resource "somedir/myfile.txt"))
19:34technomancyhow is it different?
19:34bitemyapptechnomancy: maybe if you needed to generate sequences of them or something? I don't know.
19:35bitemyappdanlentz: does that make a difference?
19:35danlentzorders of magnitude faster than working with strings. One can cheaply generate millions per second. This opens the door to a lot of creative uses for them as they become quite economical
19:36technomancyI guess that's a thing people do?
19:37seangrov`bitemyapp: You going to the prismatic meetup tonight?
19:37bitemyappseangrov`: I'm presenting
19:37danlentzI've used them in a number of ways… for example in a transaction system for graph database, where the "next" transaction is represented as a v5 uuid of the current uuid and a sequence number or some other type of designator
19:38bitemyappseangrov`: in person, not via disembodied hologram - so yes I will be there.
19:38seangrov`bitemyapp: I see, suppose that's a good answer
19:38bitemyappI have many answers, all of them good, not many of them correct.
19:38seangrov`I'll probably be there as well, just a tiny bit late. Have to meet my old CEO at Lava Lounge first
19:39bitemyappseangrov`: cool, look forward to seeing you. Hopefully you get to see my talk.
19:40Apage43I have approximate knowledge of many things
19:40Apage43i have to get my self to the train at some point
19:47danlentzyou can use this technique to implement a linked list ior other structure in a data store where the only way you can follow it is if you have knowedede if the initial namespace, key, or both. This can be a very useful technique that is easy to use but totally invisible if its not the structure you are dealing with. The entries otherwise are basically just background static you'll never wind up seeing.
19:49danlentzuseful for representation of versioned resources, especially in a clojure model where values are (ideally) represented persistently.
19:52danlentzuseful for modeling dynamic context where one might wish to resolve identifiers by working backward through some dynamic chain of environments.
19:53danlentzor "lexical" type context too i guess
19:54coventryWhat sort of problems are these kinds of data structures useful for?
19:54danlentzbut this is another technique that is extremely useful for building on a graph-database  abstraction
19:55danlentzcoventry: me?
19:55coventryyeah
19:55danlentzah. scroll back i've just been ratting them off for about 10 minutes now!
19:56danlentzbut in a less abstract and immediate sense I
19:57coventrydanlentz: I read it. What's a practical problem you can apply this framework to?
19:59danlentz see them as quite a nice means for implementing a diatomic model to support "projection" of specific "contexts" (or graphs i guess you might say) from diatomic as a graph model to an ephemeral OWL model and back again.
19:59danlentzanyway its not a framework its a uuid
20:00coventryConceptual framework.
20:00danlentza mechanism of calculation of (effectively) 128 bit integers
20:02danlentzbut I forget the figure something lile if each atom in the universe calculated continuously these numbers at 1 million per second it wold be 1 trillion years until a repeat
20:02danlentzor something roughly that astounding.
20:03danlentzso by using this mechanism we can do things in a very very very large address space.
20:03danlentzand in a number of useful ways
20:04danlentzcheck out mon-key/unicly repo on github i believe there are some use-cases albeit fairly trivial.
20:04coventryYeah, I was mildly curious about what novel things we can do this way.
20:06danlentzor check out repo lisp/de.setf.resource for an example using them for real as the basis of management of a completely lock-free concurrent distributed tranaction model based on these techniques for a distributed graph database
20:06danlentzpainlessly i might add
20:07coventryThanks.
20:09danlentzalthough de.setf.resource uses a somewhat fierier uuid library to unicly that isn't nearly as fast. the both implement the same interface or protocol or whatever you guys would call it, so it could be trivially updated to resolve that
20:10danlentzit uses dardoria/uuid which is an older lib
20:11danlentznot as meticulous or precise with regards to the minute detail or optimized in any way compatible to monk-key/unicly but otoh somewhat more forgiving and easier to pick up and start using.
20:13danlentzanyway my goal is to get some (hopefully significant) portion of their capability implemented for clojure.
20:17akurilinWhat's the DB record validation philosophy in Clojure? As in, I have the (perhaps bad?) habit of doing pre-emptive checking in the app layer for stuff like record uniqueness, etc as a way of generating helpful error messages. Now, the PG people tell me that it's wrong and I should just do whatever insertion I need to, and then interpret the SQL exception accordingly and use that for error reporting.
20:17akurilinThe latter seems like a neater approach, but I'm wondering if anybody is actually doing it here.
20:17danlentzand after that maybe turn to have a whack at more serious optimization and performance matters. Compiler macro type facilities are not available for java/clojure as far as i can see so that may preclude some measures available in common-lisp
20:29technomancyakurilin: you can go overboard with logic in the DB, but enforcing record uniqueness there is very reasonable
20:29repscaI think david nolen made at post at one point where he implemented a protocol so that a regular expression could be called like a funtion
20:29repscai can't find the post, so anyone know how I would go about doing it?
20:30akurilintechnomancy, so would it be pretty idiomatic to wrap a DB insertion call with a try-catch and return the results "monadically" to the caller?
20:30akurilintechnomancy, for a uniqueness scenario
20:30akurilin[results, error] kind of business
20:31technomancyakurilin: personally I wrap the whole request in a try/catch and turn it into a 4xx/5xx in one place
20:31technomancyhttps://github.com/technomancy/syme/blob/master/src/syme/web.clj#L112
20:31technomancyex-info is your friend here
20:31technomancysome people hate that
20:32akurilintechnomancy, I have that as well for the cases where something slipped through my other checks. However if I want to report a very specific error like "this insertion failed because this field is not unique" then the umbrella catch might be too generic.l
20:32technomancyakurilin: right; in my example I don't make an effort to come up with better messages, but you could certainly add it
20:33geoffegis there a simpler way to write this? '[(last loc) (first loc)]
20:33technomancygeoffeg: without the quoting?
20:33technomancy(juxt last first)
20:33technomancy((juxt last first) loc) ; rather
20:34geoffegah, i had forgotten about juxt
20:34technomancyclojurebot: tell us about juxt
20:34clojurebotExcuse me?
20:34technomancyclojurebot: juxt?
20:34clojurebotif you think 'complement is great, wait till you see 'juxt
20:35geoffegheh
20:35geoffegtechnomancy: thanks
20:35technomancynp; always happy to talk about juxt
20:36akurilintechnomancy, that's great, thanks.
20:36mlb-rasmusto: Is there a way to refer to a different directory than "resources"? I'd like to be able to uberjar my project without packaging unit test fixtures
20:37technomancymlb-: dev-resources or test-resources
20:37rasmustomlb-: this might be a use-case for a profile or somesuch ^
20:39mlb-rasmusto, technomancy: Oh, very cool. That would allow me to change where resources addresses? Does "lein test" automatically choose a :test profile, if defined in the project.clj?
20:40technomancymlb-: yeah basically
20:40technomancydev-resources is available in the repl but not the uberjar; test-resources is only available when running `lein test`
20:40technomancythe latter which can be crappy when running tests in the repl, so I don't advise it
20:41mlb-Is that available due to leiningen magic, or is there a required form to be added to project.clj?
20:41technomancymlb-: it's the default; you can make your own :test profile if you like
20:45llasramI like test-resources for adding a logging configuration which only prints ERROR+
21:35akurilinDo Clojurians favor making a separate little function for each distinct sql query, on the DAL layer, or do they prefer to make something like one single SELECT function that internally uses korma/whatever to account for all possible permutations of parameter
21:35akurilins
21:36akurilinit's kind of a complexity vs duplication tradeoff
21:41danlentzi really like clojur protocols
21:41danlentzit seems like they really outdid themselves with that concept
21:43danlentzmakes java reasonably tolerable which imo is a remarkable achievement :)
21:44oichis enlive what I should look into for parsing xml with namespaces, or is there something else?
21:45ddellacostaakurilin: I have a macro that lets you generate common prepared queries by passing in specific where clauses and whatnot, and then I handle special cases…specially.
21:45danlentzcombines the extensibility and dynamism of CL generic function approach with the structure and cohesion of java interfaces -- just fantastic
21:45ddellacostaakurilin: but I use clojure.java.jdbc so it's a bit different
21:46akurilinddellacosta, so a bit of a hybrid approach, huh?
21:47ddellacostaakurilin: yeah…it works just fine and DRYs stuff up well enough, but honestly I still don't feel like I know The Right Way to do things.
21:49alandipertdanlentz: i know, big fan also! clojurescript has them at the bottom and it's great
22:03akurilinNeed a sanity check. Ring's cookie session store places a URL-encoded string in the cookies under ring-session key. When I call back into the ring app, I pretty much return the cookie as-is, since it decodes it on read.
22:03akurilinHowever ruby's rest-client insists on unescaping cookies before making a HTTP request
22:04akurilinI monkey-patched that behavior out, but it's just odd that it'd be hardcoded in there.
22:05akurilinIsn't the whole point of URL-escaping to make sure characters aren't lost as part of the request? Why decode the string?
22:52ddellacostabitemyapp: ping
22:52bitemyappddellacosta: hai
22:53ddellacostabitemyapp: howdy. question about blackwater. This is super weird, no? CompilerException java.lang.RuntimeException: No such var: time/in-millis, compiling:(black/water/jdbc.clj:18:20)
22:54ddellacostabitemyapp: obviously it's something with my app, but I've added exclusions for clj-time on everything that showed up in lein deps :tree, so I'm a bit stumped
22:54ddellacostabitemyapp: was just wondering if you had any ideas. :-/
22:56ddellacostabitemyapp: I even added a dependency on clj-time explicitly just now. Same annoying exception.
23:16charehi
23:16chareso can i get unmuted on my other account
23:19mtpprobably not
23:22mtpgfredericks is that like sync\nsync\nsync on ye olde unix
23:23gfredericksis it? I don't know what that does
23:25mtpwell
23:26mtpback before they invented /sbin/shutdown
23:26mtpyou had to take the unix to single user and kill it yourself
23:27mtp"sync" would flush the cache to disk, and the other two syncs were there to give the rest of the cache time to flush
23:27mtpor so goes the legend
23:31xeqigfredericks: https://github.com/technomancy/leiningen/pull/688/files
23:31ta479any FRP libraries in clojure?
23:32ddellacostata479: clojurescript, but: https://github.com/tailrecursion/javelin
23:33gfredericksmtp: ah no this was a heisenbug. It would come up about every 5 test runs. So I was saving some typing.
23:33ta479there isn't one for regular clojure yet?
23:34gfredericksxeqi: that'd be cool
23:34mercwithamoutho_O
23:34ddellacostata479: also, https://github.com/weavejester/reagi
23:34mtpgfredericks i was mostly being silly :)
23:35ddellacostata479: I saw another CLJS one too but not finding it in my starred repos at the moment
23:35gfredericksxeqi: oh it got merged in and then removed?
23:35gfredericksalso I don't understand amalloy's PR message
23:37amalloygfredericks: well it's a joke PR, obviously, and i know technomancy hates it when people's blogs contain advice that you should run lein clean a few times just in case
23:38xeqigfredericks: yep, joke
23:38ddellacostata479: one I just found poking around, more a demo than a lib: https://github.com/leonardoborges/frp-code
23:39gfredericksamalloy: oh I didn't think of it wrt clean in particular
23:39gfredericks~repeatability
23:39clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
23:39gfredericks^ taken at face value you'd think he'd be in favor of such a task :)
23:39amalloyhah
23:41gfredericks:aliases {:scrub ["do" "clean" "clean" "clean"]}
23:41ddellacostathe motherlode FRP post, verra nice: http://kevinoncode.blogspot.jp/2013/05/a-short-survey-on-state-of-functional.html
23:51right1does anyone else have a problem with lein repl being much slower to start up on windows versus osx
23:54geoffegtoday i discovered https://github.com/egamble/let-else thanks to a coworker.
23:58Foxboronright1: sadly, you just have to live with it :/
23:58Foxboronright1: the JVM startup time is horrible on windows
23:58right1:(
23:58right1also, you want to see something funny with windows?
23:59right1https://www.youtube.com/watch?v=0okmEqTKiDY
23:59right1title: lein repl and japanese locale not playing nice