#clojure logs

2015-09-28

00:12justin_smithkenrestivo: isn't the natural way to control startup order with component to create a dependency? if you prefer a to start before b, make sure a doesn't return from its start method until full initialized, and make b depend on a, right?
01:59kenrestivoi did that. something's amiss. i'll figure it out eventually.
01:59kenrestivonow i'm chasing down how to turn off the colors in the new version of timbre. it's all changed :/
02:01kenrestivojustin_smith: oh by the way i did figure that out! the log component was failing because timbre was exploding
02:01kenrestivoand the other components were just loading as normal. component wasn't broken.
05:35namradoes anyone have some links that compare tuple-spaces and key/value-store (the concepts) or can someone enlighten me on the differences? because so far i can't really see a difference between them when i take an implementation for a key-value store like redis.
05:47justin_smithnamra: aren't key/value more limited and specific than tuples? in a tuple space you can pattern match, in key/value you look up by key right?
05:49TEttingeralso aren't tuple spaces often sorta relational? like the ontology tuple space stuff stores ("dog" "chases" "cat") ("cat" "chases" "mouse")
05:50namrajustin_smith: true, but depends on how you structure the tuples
05:51justin_smithalso, key-value does not provide any sort of mutual exclusion (and has no rules about lifetime at all)
05:51justin_smithnamra: sure, but key-value only allows one structure!
05:52namrajustin_smith: can you elaborate on "rules about lifetime" please? i probably misunderstand you here, because usually a key-value provides ttl for keys
05:53justin_smithalso, key-value stores are often unique by key, tuple spaces allow multiple instances of the same item
05:53namrai see
05:55justin_smithnamra: oh, I hadn't thought that key-value usually provided ttl. For what it's worth the wiki page for key-value database has no mention of time or ttl (not that this proves anything at all of course)
05:56namraah ok so it's an implementation detail. used memcached and looked at redis and both provide the ttl option.
05:57tdammersthose are caching solutions, not really databases
05:57justin_smithtuple spaces could be thought of as a specific variety of key value store I guess (though pattern matching is still more general than looking up by key)
05:57namratdammers: tuplespace isn't supposed to be a database too, one can use it for caching but usually it's used for distributed process communication
05:57justin_smithtdammers: but a tuple space is meant to throw away items as soon as they are read, which isn't much of a db either
05:57justin_smithnor is it a cache...
05:58namrabut some commercial software uses them as an in-memory database
05:58tdammersyeah, uhm...
05:58tdammerssome commercial software also uses MySQL as a communication pipeline
05:58tdammersbut anyway, OK
05:59justin_smithtdammers: maybe I'm thinking too specifically of the "take" usage, and other people are using copy more..
05:59namrana i'm also wondering why is there no open source solution available
05:59tdammersjust wanted to note that the "caching" vs. "database" thing is why memcached has a TTL while the wikipedia page for key/value stores doesn't mention one
05:59namraconsidering space-based architectures and what benefits they can provide. probably because memory is still too expensive
06:00justin_smithtdammers: ahh, OK
06:00namraahh ^^
06:00justin_smithnamra: also because tuple-space kind of breaks when things are mutable, which means it's outside the mainstream still...
06:01tdammerstuple-space feels awfully related to reactive programming
06:01justin_smithseems like a predecessor to things like onyx too in some ways
06:04namrathanks guys, certainly clear things up
06:04namras
06:38dm3does anyone know how to change the emacs+CIDER behaviour to not complete with a single quote when pressing a backtick inside of a string?
07:56nowprovisionusing stuart sierra's component, i have several products in a database that I want to fetch every 5 minutes (yeah its not optimal from integration point of view) so they are locally fresh, I'm thinking of a loop that pulls from a timeout channel or a control channel with alts and assoc the control channel with the component, and then in lifecycle/stop send :stop to the control channel to stop the loop, thoughts
07:56schmirAFAIR there's a function that does the equivalent of (remove nil? (map ....)). what is it's name?
07:59nowprovisioni dont think there is (filter (complement nil?) [1 nil 2])
08:01noidinowprovision, (remove nil? ...)
08:01noidioops, I missed the line before that :)
08:02nowprovisionwhat about (mapcat your-map-fn orig-col)
08:02nowprovisionand then in your-map-fn omit [] for what you previously outputted nil
08:03dstocktonschmir: keep
08:03dstockton(keep (map ...))
08:04nowprovisiondrop the map (keep identity [1 nil 2])
08:05nowprovisionreplace identity with the original map-fn your were enclosing
08:05schmirdstockton: thanks!
08:06dstocktonsorry, nowprovision is right
08:06dstockton(keep fn coll)
08:07nowprovisioni never knew keep existed, just doc'd it though, great thing about #clojure channel :)
08:07ane(doc keep)
08:07clojurebot"([f] [f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects. Returns a transducer when no collection is provided."
08:34justin_smithanother nice specialized replacement for map is run! which is like (comp dorun map)
08:35justin_smithbut it's actually better and reduce based
08:42TEttingerjustin_smith: what are we both doing up in pacific time?
08:42justin_smithhaha
08:43justin_smithTEttinger: I have a big deadline I'd like to hit today
08:43justin_smithso I'm up and at it early
08:43justin_smithin other words, the only motivation I understand is terror of absolute failure, so I must suffer
08:43TEttingerI have a deadline that I need to be somewhere tomorrow, and not being able to sleep is not playing well with said deadline
08:44justin_smithTEttinger: ouch
08:44TEttingerit's odd, I'm barely tired and not at all sleepy
08:44justin_smithI of course don't know what causes your insomnia, but journaling helped a lot with mine
08:44TEttingerI think I'll probably sleep something really weird and make it
08:44justin_smithheh
08:44justin_smithsleep-coding ?
08:45TEttingerI don't think it's insomnia in the normal sense. when I fall asleep I'm extremely hard to wake up
08:45TEttingeryes
08:45TEttingerI do sleep-code
08:45TEttingerI have lots of dreams of whatever code was troubling me
08:47TEttingercurrently it's a C# project but the appearance of the language or Visual Studio never appear in my dream, it's all the abstract thought process of dealing with algorithms repeatedly in different ways. and every time the dream is unrelated to any real problems in the code
08:48TEttingerno ouroboros benzene moments here
08:50sveriWhen I started with clojure I was dreaming of paranthesis for several months night and night again
08:50sveriI have seen them while falling asleep and when waking up again
08:51justin_smithTEttinger: I often sleep-solve code problems, but it's unreliable to say the least
08:52TEttingerI think I have better luck just browsing the weird parts of CS wikipedia articles
08:53TEttinger"oooh, this could be a run-length encoding on a hilbert curve!"
08:53nowprovisionany open thoughts on this, https://www.refheap.com/c4380845111240a385d6c8fbc i need to pull data out of a couchdb server every X minutes, ive just come up with this, I plan the change the job-fn closing over the atom, but it the general direction Im thinking, thoughts because it feel icky
08:53nowprovisionhttps://www.refheap.com/c4380845111240a385d6c8fbc
08:55Hydro-x1v Hello gays
08:55Hydro-x1Oh sorry Hello Guys
08:57TEttingerhello Hydra-x1
09:05sverinowprovision: I am not sure if this method is always on point regarding timing. I you don't need it to be exact using a substraction should be ok. Otherwise you should look for a framework like quartzite or something similar
09:07nowprovisionsveri, schedule will be X minutes in real world, some drift is fine. but http://clojurequartz.info/ looks interesting, this could take care of some other scenarios I have just to plan out, cheers
09:07sverinowprovision: no problem, good luck
09:16dzhusIf I define something in my Leiningen project.clj, how can I access it from other modules of my project?
09:17justin_smithdzhus: project.clj is there to tell leiningen how to build your project, it isn't meant to be part of your code. That said, you can set system properties or environment variables, and get them via System/getenv or System/getProperty
09:17justin_smithdzhus: environ is a nice lib for setting up this sort of thing
09:18dzhusjustin_smith: I want to serve my project version from one of my HTTP handlers
09:18dzhusoh, turns out I can just :require [project]
09:18justin_smithyeah, the project.clj ends up on classpath iirc
09:19dzhusgreat
09:19justin_smithnow, next question is whether you have defproject in scope in your namespace? I guess you do if that works...
09:20justin_smitherr wait you would need defproject in clojure.core for that to work (or somehow implicitly global)
09:20dzhusoh, right. Somewhy it works with lein ring server but not with lein uberjar (Unable to resolve symbol: defproject)
09:21justin_smithdzhus: you could use (read-string (slurp (io/resource "project.clj"))) I guess, then manually navigate the data structure it hands you
09:21dzhusI'll just move shared definitions to a separate file and require it from project and my other source files
09:22justin_smithdzhus: I just tried the read-string / slurp / io-resource in my repl and that gave me a list with the version string at position 2
09:22dzhusDoes it work in compile time?
09:23justin_smithdzhus: checking it from a jar
09:23justin_smithyes! works from inside a jar
09:23justin_smithI even made sure my shell was in a totally unrelated directory just in case it ended up checking for a file too
09:25justin_smithdzhus: relatedly, I have a leiningen plugin that runs some git commands to verify the status of the repo (checks for uncommitted changes, gets commit hash of the current state of the repo) and stores that in the jar so we can tie a specific jar to a specific state of the codebase unambiguously
09:26dzhusjustin_smith: I already have that too
09:26dzhusI think I was given code to do that on this channel, too :)
09:26justin_smithheh, yeah, it's a very simple plugin
09:27bjaam I the only person who really really dislikes environ's require-time caching?
09:27nowprovisionproject.clj is just clojure so you can do (slurp verison.txt) inside project.clj, which makes it easy to pull in your app code too..
09:28bjaI like environ, but I have it defined in my project as `(def env [] (merge (#'environ.core/read-env-file) (#'environ.core/read-system-env) (#'environ.core/read-system-props)))`
09:30bjathat way I can do side-effecty stuff (like read my ~/.boto) and just read my settings at system initialization
09:30justin_smithnowprovision: well, with ~ you can do that, sure, but I prefer to keep my project.clj declarative if possible
09:30nowprovisionbja, given environement variables are not meant to be changed during a process lifetime I think its consistent behavior, the only one you have some argument with is .lein-env but I guess the give away is in the name, if you want to handle live config changes perhaps something like zookeeper client is better etc.
09:31bjaenvironment variables aren't supposed to be changed
09:31bjajava properties might be
09:31bjain fact, that's exactly how I load my ~/.boto, I parse it and then set the properties the amazon java sdk expects to find
09:32justin_smithbja: changing directories is done via environment variable, but I guess we can't really do that easily in the jvm can we :P
09:32justin_smithbja: boto?
09:32bjaboto is the amazon python sdk
09:32bjamy work is mixed python and clojure
09:32justin_smithcool
09:33bjait's just some credentials in an INI file
09:33bjabut there's no reason to spew my dev credentials all over the filesystem
09:33bjamakes it inconvenient when we rotate
09:34nowprovisionjustin_smith, i don't think unquoting is necessary, this is from an old project.clj using an old version of ragtime https://www.refheap.com/110034, things have changed now but it demonstrates the flexibility, it works well with http://12factor.net/config idea
09:36justin_smithnowprovision: wow, at least at one point I remember this requiring using ~ to unquote...
09:37dzhuswhy doesn't clojure use , for unquoting
09:37justin_smithdzhus: for whatever reason, rhickey decided it should be whitespace instead
09:37dstocktondzhus: , is equivalent to whitespace as it can make lists/vectors more readable
09:38dstocktonactually, maps more than anything
09:38dstockton{:a 1, :b 2, :c 3}
09:38justin_smithI guess for people more familiar with using , for a list or hash-map delimiter
09:38justin_smith,,,,,,,,,,:whitespace,,,,,,,,,,
09:38clojurebot:whitespace
09:38justin_smithdon't actually do that in your code, of course
09:38dstocktonit can help when you have a long map and multiple types of keys values
09:39dstocktonyou can lose track of which is the key and which is the value
09:39snowell,(assoc,{:a,1,:b,2},:c,3)
09:39clojurebot{:a 1, :b 2, :c 3}
09:39justin_smithit's also handy as a marker in long cond calls
09:40justin_smith(cond q a,, r b,, s c,, :else d)
09:40dzhushmmm, I can use that
09:41dzhusIf you replace ALL whitespace in Clojure code with `,`, will it still work?
09:41justin_smithsure, it's just whitespace, but it would be hard to read
09:41dzhusthat goes to my pre-commit hook right now!
09:42justin_smith,((fn,f,[x],(*,x,x)),5)
09:42clojurebot25
09:42justin_smithhaha
09:44snowell,(str,(get,(assoc,{\,,\,},\,,\,),\,)) ; justin_smith, am I doing clojure right?
09:44clojurebot","
09:45justin_smithLOL
09:45justin_smiththat's terrible
09:45snowellYou misspelled 'awesome'
09:46oddcullysnowell: no, you misspelled brainfuck
09:47snowellOh sorry, my mistake
09:47TEttinger,((fn f [x] (* x x)) 5)
09:47clojurebot25
09:48justin_smithTEttinger: woah
09:55TEttinger,((fn[]([]))0)
09:55clojurebot#error {\n :cause "Unable to resolve symbol: fn in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: fn in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: fn in this co...
09:55TEttinger,((fn []([]))0)
09:55clojurebot#object[sandbox$eval165$__166 0x67a72e43 "sandbox$eval165$__166@67a72e43"]
09:56TEttinger,((fn []([]))(+))
09:56clojurebot#object[sandbox$eval191$__192 0x6c530d60 "sandbox$eval191$__192@6c530d60"]
10:17TEttingerhmmm... I'm wondering how to go from a 2d integer position where the 2 indices can be from 0-255, and get the length you need to advance on a square spiral (probably outward in) to reach that point
10:18dzhusIs anybody using compojure-api
10:18TEttingerif you start at the upper left as 0, then you end up with some odd numbering as you go down
10:18dzhus?
10:19justin_smithTEttinger: I'd start with the numeric pattern formed by the square spiral going outward, then figure out how to calculate n iterations of that for a given x/y, followed by the "remainder"
10:19justin_smithif you're lucky you'll find a simple way to calculate the sum directly, without having to add up the paths manually
10:20TEttingerhmmmm
10:22justin_smithso 1, 1, 2, 2, 3, 3, 4, 4, 5 ...
10:22akkadlove this channel
10:22justin_smithI think I see a pattern there
10:23justin_smithTEttinger: that's just drawing it with pen on graph paper and counting squares mind you
10:23TEttingerI sketched it in a text editor
10:24TEttingerI didn't see a pattern going outward in
10:25tdammerslet me see
10:25tdammersI guess determining which loop each point is on is simple enough
10:25tdammersalso, we can reduce the problem from "find the spiral distance between two points" to "find the spiral distance from one point to the center"
10:26tdammersso you could take one point
10:26tdammersfind the loop it is on (the larger of the absolutes of the x and y coordinates relative to the center)
10:26tdammersfind the point in the top-left corner of that loop
10:26tdammersand then figure out the distance from there to your point
10:27justin_smithsounds about right
10:27tdammerswhich in turn is a matter of finding which quadrant the point is in
10:27tdammersand adding the appropriate number of pixels
10:27tdammersI think the rest of it amounts to footwork
10:29TEttingertdammers: that sounds much simpler than I thought it would! thank you
10:29tdammersnp
10:29TEttinger(inc tdammers)
10:29TEttinger(inc justin_smith)
10:29TEttinger(dec lazybot_uptime)
10:29ikitommi_tzhus: yes
10:37dzhusikitommi_: Do you know if it should be possible to constrain request body to be an array of integers? I'm trying to do `:body [body [s/Int]]` but it simply doesn't show up in docs and is silently ignored when I actually do the request
10:37dzhusIt works with `:body [body {:articles [s/Int]}]` but that's different because now request body is expected to be an object with one key (that's not what I want)
10:47TEttingertdammers: and now I realize that even though run-length encoding on a spiral is good for a very specific set of possible point arrangements in a square, it is rather wasteful for most that aren't centered. Hilbert curves, which I was originally looking at, might actually do much better when the arrangement is not centered
10:47tdammersheh
10:48TEttingerand there's moore codes too
10:49justin_smithTEttinger: so by RLE here you mean encoding positions as a linear index on a space filling curve?
10:49ikitommi_dzhus: yes, it should work, but currently doesn't render anything for the swagger
10:51ikitommi_dzhus: wait a sec.
10:54ikitommi_dzhus: here's a gist https://gist.github.com/ikitommi/977cc9fcf037770d6687
10:55dzhusikitommi_: a-ha
10:55dzhusthanks
10:55ikitommi_dzhus: so the ring-swagger issue needs to be fixed to get it to rendered for the swagger.
10:56dzhusI see now, thanks for the reference
10:56ikitommi_no probs. hopefully we'll get that one fixed soon.
11:24sdegutisThis is cool: (->> results (map some-key) (filter some-thing) (clojure.pprint/pprint) (with-out-str) (spit "/some/file"))
11:38sdegutisI never thought of chaining pprint, with-out-str, and spit using ->>
12:27zxcHello! I can't use this function, why? (user/clojuredocs min)
12:27justin_smithzxc: who defined clojuredocs?
12:27zxcjustin_smith: Can you specify? I found it in a course and just can't use it, it throws an error
12:28justin_smithzxc: my point is it shouldn't actually exist unless someone defines it
12:28justin_smithmaybe there's some code in the course that does so in a prior lesson?
12:28zxcjustin_smith: Oh, maybe. I will check!
12:28justin_smithzxc: user/clojuredocs is not part of clojure, user is for things you define interactively in a repl
12:29justin_smithso it would likely be part of a repl session example, or maybe a custom user.clj but I find that less likely
12:30zxcjustin_smith: Still throws an error
12:31zxcjustin_smith: Can I give you a link to the course?
12:33zxc"You can also use (user/clojuredocs function) to see some examples for function. This should work for most of the built-in functions." But it doesn't
12:41oddcullyzxc: please post the link here. you miss some step before this code would work
12:43zxchttp://iloveponies.github.io/120-hour-epic-sax-marathon/training-day.html
12:43zxcoddcully: But I've read it all and it says nothing about it
12:49rhg135The repl itself tells you this
12:50zxcIt explodes with java exceptions
12:50rhg135That message should not be there. I don't think it ever works.
12:51oddcullyzxc: sorry no clue. the only things to find are from old clojure version. could be a thing of the past, maybe?
12:51rhg135Sounds like it
12:51justin_smithyeah, could be a deprecated feature of nrepl
12:51oddcullyzxc: if you need code examples you could go to http://conj.io/ for now
12:52zxcthank you, just wanted if I was doing something wrong here
12:52justin_smithzxc: also there is clojure.repl/doc which you should be able to just use as (doc +)
12:52zxcis it a good course, if it's that old?
12:52rhg135Someone should open a ticket
12:52zxcjustin_smith: Yeah, I've used it
12:53rhg135My repl says it on start too
12:53oddcullymaybe a plugin? my `lein repl` into 1.7 does not
12:54rhg135Could just be lein using old nrepl
12:54justin_smithoddcully: same here, I don't see the clojuredocs message either
12:54zxcgoogle says rubbish about that, by the way
12:54rhg135Ah yes, it is.
12:55justin_smithyeah, clojure still moves fast enough that the top google results aren't all that useful
12:55oddcullysearching for it only produces some console prints also with 1.4/1.5 clojure
12:55rhg135Lein needs an update
12:56zxc"is it a good course, if it's that old?" - can someone help me with that?
12:56justin_smithoddcully: yeah, clojure.main has "Clojure 1.7.0" as the only splash message, the rest is all nrepl
12:56rhg135Clojure does not change all that much api-wise
12:57aneehm am i doing anything idiotic by making a ref in a let block and then returning a reified object that messes with the ref
12:57justin_smithyeah, the tooling is all in flux, but the lang itself has good backward compatibility
12:57justin_smithanything post clojure-1.0 will mostly be good I bet
12:57zxco-kay,thanks a lot
12:58rhg135Ane, you are doing oop in clojure
12:59rhg135Stateful objects, prodding some hidden state
13:02rhg135I mean it has uses, but at the fringes of your code
13:11justin_smithrhg135: hidden state inside the fringes?
13:12rhg135Like for interop
13:13justin_smithrhg135: yeah, that's true, it's a funny clash of metaphors
13:13rhg135An iterator over a seq
13:24zxcWhy does (-2) throw an error, and (- 2) give just -2?
13:25oddcullyzxc: look at the error message it hands you down
13:26zxcoddcully: 2 is an integer, not long, iirc
13:26oddcullyyou remember wrong
13:27oddcully,(-1)
13:27clojurebot#error {\n :cause "java.lang.Long cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval25 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval25 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval25 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java" 6943]...
13:28zxcI still don't know why it's related
13:28oddcully-1 is no function, but - is a function you can call with 1 as the argument
13:28oddcully,(- 1)
13:28clojurebot-1
13:28oddcully,-1
13:28clojurebot-1
13:29zxcnow I understand, thank you
13:31oddcully,(+ 1,000)
13:31clojurebot1
13:32zxc,(+ 1 000)
13:32clojurebot1
13:34oddcullythat was intended for you. there was some , abuse going on some hours ago and i wanted to add to it. but well spotted
13:35zxcit could add some confusion for a newcomer, it seemed like you were trying to add 1 to a thousand
13:36oddcullydepending to what locale you are used to
13:49sotojuancompletely unrelated to clojure but
13:49sotojuandoes anyoen know of a good site or blog that goes through project euler
13:49sotojuanbut doesnt tell you the answer, just hints/explanation?
13:49sotojuan~_~
13:49clojurebotIt's greek to me.
13:50BalvedaI'm trying to do a ring/http-response redirect but instead of redirecting the page's HTML is being printed out to console.. any ideas?
13:51sdegutis,(load-string "(+ 2 4)")
13:51clojurebot6
13:51sdegutis,*ns*
13:51clojurebot#object[clojure.lang.Namespace 0x4d288e1c "sandbox"]
13:52sdegutis,(do (def foo 2) (load-string "(alter-var-root #'sandbox/foo (constantly 3))") foo)
13:52clojurebot3
13:52sdegutisHaha.
13:53sdegutisThat is so terrible.
14:02sdegutisI mean, it's a bad practice to actually do that.
14:02sdegutisCool that it works tho :)
14:03rhg135That's a fun way to break things
14:14roelofwhy does this work (apply str (repeat n "*" ))) and not this (str (repeat n "*" )) ?
14:16rhg135,(str (range 1 10))
14:16clojurebot"(1 2 3 4 5 ...)"
14:17rhg135,(apply str (range 1 10))
14:17clojurebot"123456789"
14:18roelofrhg135: so apply is taken care that str is carried out
14:19roelofand that the output is a string and not a list
14:20rhg135,(doc apply)
14:20clojurebot"([f args] [f x args] [f x y args] [f x y z args] [f a b c d ...]); Applies fn f to the argument list formed by prepending intervening arguments to args."
14:20rhg135It passes a seq as arguments
14:21oddcully(apply str '(1 2 3)) basically becomes (str 1 2 3)
14:22roelofoke but here I do a repeat so that is why I need apply
14:22rhg135Yup
14:23rhg135That produces a seq
14:23roelofoke, up-to the next assignment. IM learning now to use apply map and friends
14:24rhg135Fun, fun, fun
14:25roelofhttp://iloveponies.github.io/120-hour-epic-sax-marathon/structured-data.html#exercise-17 and the next problems till the end :)
14:25roelofso for a few days a lot of fun :)
14:26rhg135Soon you will wield the power
14:27rhg135apply is insanely powerful
14:27roelofrhg135: I will see. I do exercise for exercise and see how far I will come
14:28roelofno hurry for a next thing till I have a idea that I understand this well
14:29rhg135Just remember java methods aren't functions
14:30schmirmemfn helps with that
14:31schmir,(doc memfn)
14:31clojurebot"([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn. name may be type-hinted with the method receiver's type in order to avoid reflective calls."
14:37snowelloddcully: We weren't abusing the commas. We were treating them very well! But yeah, I hadn't thought that people might try to put commas in numbers here in 'Murica
14:37snowell,(+ 400 3,000)
14:37clojurebot403
14:37snowellThen again, doing it with ANY separator and you're gonna have a bad time
14:38snowell,(+ 400 3.000)
14:38clojurebot403.0
14:38mungojellylet's write a reader macro o wait
14:38roelofHere in the Netherlands we also use comma's . so you say 3.4 and we says 3.4
14:39snowellWell we use commas to separate thousands, and then a point for the decimals
14:39snowell1,234,567.89
14:39snowellWhich is, I believe, completely backwards from other ways of doing it
14:39snowellBut I haven't put commas in a number since I started programming
14:40snowellUnless it's in a presentation for a high-up manager :)
14:40roelofsnowell: and in the Netherlands we do it exactly the other way around :)
14:40TimMcsnowell: Use scientific notation in that case. ;-)
14:41snowellOh yeah, Americans LOVE that
14:41TimMc1.23456789e6
14:43snowell"Using this new method, we achieved a 1.65e-1% time reduction!"
14:43roelofwhere can I find info how to use apply with checking if a seq is monotonic ?
14:43mungojellyi just wish everything weren't always numbers, i don't want to choose the number of anything, why can't i ever say :wait-time :not-too-long and :box-location (prefer :upper-left), please don't make me always speak in numbers
14:44snowellBecause there would be endless debate on what the threshold is for :too-long
14:44mungojelly(deviations-above :system-average 2)
14:45mungojellyoh no a number
14:45snowellSHAME
14:45mungojelly:enough. :enough deviations.
14:46roelofcan I do something like apply <= seq ?
14:47lumasure
14:47oddcully,(apply < (range 10))
14:47clojurebottrue
14:48mungojellywe have a "memory manager" as in someone who'll take out the garbage, i want a memory manager who'll decide for me whether my things get memory, how can i like control or even monitor the memory footprint of anything??
14:48roelofoddcully: thanks, The exercises are getting harder now
15:18jonathanjliberator and friend don't seem to interact particularly well
15:18jonathanjat least reading <http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/&gt; seems to indicate it's quite involved
15:19jonathanjis there a better option?
15:24schmirbuddy may help - though I didn't use it.
15:26bja jonathanj that page you linked doesn't seem particularly awful
15:31jonathanjbja: i guess i'm not all that keen on using a library with no tests that is, for all intents, abandoned
15:31bjajonathanj: I mean, you would rather write your own tests to verify functionality or write your tests and start from scratch on the code too?
15:32bjaobviously finding a pre-built solution would be best
15:47jonathanjhrm, buddy looks interesting
15:47jonathanji'm wondering if there is a nice way of specifying the auth and unauthed representations of the same route with something like compojure
15:52jonathanjschmir: thanks, i think buddy might be more helpful considering it's less opinionated
16:09mzdravkovis there a way to force evaluation of argument to macro, before passinng it to the macro itself?
16:13justin_smithmzdravkov: by calling the macro in another macro, sure
16:13justin_smithmzdravkov: we call this phenomenon "macro contagion"
16:33mzdravkovcan anyone help me with macro to generate patterns for core.match - I'm spending a second evening trying to write one and I can't make it work
16:35amalloymzdravkov: the one you had last night seemed like it was working fine
16:35amalloyyou were upset about the "30 lines of obfuscated code", but it sounded to me like exactly what you'd want to happen
16:40mzdravkovwell, I thought it was working but it doesn't. The problem is that I have to pass the argument with some form, which has to be evaluated, but because it's a macro it doesn't evaluate it
16:58justin_smithmzdravkov: you can control evaluation before something hits a macro via another macro, but if the data isn't available until runtime a macro simply can't deal with that
16:58justin_smithmzdravkov: I don't even know if this is related to your issue though
18:57aaelonya colleague wants to dashboard using ruby's http://shopify.github.io/dashing/, is there anything in the Clojure world that might be comparable/better/waay-better ?
18:59mzdravkovI decided to post my problem to stackoverflow: If anyone wants to help: http://stackoverflow.com/questions/32832982/clojure-evaluate-argument-of-macro
19:09justin_smithmzdravkov: it's what I said above - the macro can't use the data because the data isn't there at compile time and macros only run at compile time
19:11mzdravkovjustin_smith: ah, that's so unfortunate. I'll have to think for another way, maybe make my own version of match... Anyway, thanks.
19:12justin_smithdoes core.match not have an underlying function you can use?
19:12justin_smithI mean I am sure it wouldn't be as pretty, but it seems like it could exist hypothetically...
19:16amalloyi think the main thing core.match does is compile match patterns down into efficient decision trees. doing it at runtime seems like something that's possible and maybe even useful, but pretty different from core.match
19:16amalloyin particular it couldn't really bind the matches to variables like core.match does
19:16justin_smithamalloy: oh, OK
19:34audaxionis there any way to look at adjacent elements in a collection inside of a function like map?
19:35amalloy,(doc partition)
19:35clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
19:39justin_smith~partition
19:39clojurebotpartition is probably not what you want; see partition-all.
19:39justin_smithamalloy: that's a funny reversal
19:39amalloyreversal?
19:40justin_smithhow many times have I mentioned partition, to have you jump in with "partition-all"
19:40amalloythat's hiredman's factoid
19:40justin_smithn/m
19:40amalloyi usually just use partition and forget that partition-all is better
19:40justin_smiththe partition-all gotcha doesn't even apply with step 1
19:40amalloycertainly (parition n 1 xs) is never a problem
19:40justin_smithhaha
19:40justin_smithright
19:41justin_smith,(map (partial apply -) (partition 2 1 [1 4 8 9 22 3]))
19:41clojurebot(-3 -4 -1 -13 19)
19:44akkaddoes clojure have a (ignore-errors) clone?
20:28sdegutisIs it possible to add a :where clause in a query where the lack of a match doesn't negate the whole rest of the query's where-clauses?