@hindol.adhya Wow yes, this is what I wanted! π Actually my previous question was me trying to take a immediate step to get this
@raspasov wow thanks! I'm not sure what I was seeing to think the value of rand-nth
wasn't changing. But it actually was. Thanks for your help!!
I think I was mistakenly still thinking about
(take-while #(>= number-of-weeks %)
(iterate
(partial + (rand-nth days-store1)) (rand-nth days-store1)))
which had issues cause of iterate
Thanks everyone for your help π @hindol.adhya @dpsutton @elliot.stern @alexmiller @mitesh @pavlos
For folks who have seen my usermanager example web app before, there is now a version that follows the Polylith architecture: https://github.com/seancorfield/usermanager-example/tree/polylith
The issue was not iterate
, it was partial
. partial
will only evaluate its arguments once.
(take 10 (repeatedly (partial + (rand-nth (range 10))))) => (8 8 8 8 8 8 8 8 8 8)
If you had an anonymous function instead, it would have worked.
(take 10 (repeatedly #(+ (rand-nth (range 10))))) => (9 9 6 7 3 2 7 4 8 6)
Great, thanks! Iβve found the example very valuable in the past. Any takeaways from the rewriting it to use Polylith?
For a small app like this, it looks like a lot of extra complexity but the components are all very simple and it becomes very easy to extend and also to build new apps within the workspace that reuse those components.
There's also an utility function in ring for parsing HTTP-header style dates:
(ring.util.time/parse-date "Fri, 02 Apr 2021 18:00:17 GMT")
;;=> #inst "2021-04-02T18:00:17.000-00:00"
I am currently hit by this: https://clojure.atlassian.net/browse/TDEPS-8 (tools.deps does not handle maven relocations). How to proceed? I am guessing I need to use :replace-deps
somehow?
Found the workaround here: https://github.com/incanter/incanter/pull/399
Wow! Okay okay I'll try to remember that!
Hi everyone, how do I get the confidence interval in Clojure. Like with a list of data of orders each week [40 0 60 30 ...]
which corresponds to each week based on index. I understand for mean, I can just reduce the data to get the sum and divide by number of weeks
Thanks Blake π To be honest I haven't really used figwheel-* in any serious capacity, and I feel like shadow solves all my problems especially with it's easier npm integration. I've gone through the figwheel-main docs but I wasn't convinced to give it a try. Do you have any reasons when would one prefer figwheel over shadow or what problems it solves better?
Gotcha π
Hi, am trying to evaluate if I should I try to do a golang distributed systems assignment with core.async
instead π Any recommendations on links to get myself up to speed? Am looking at https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj and https://clojure.org/news/2013/06/28/clojure-clore-async-channels at the moment. Am familiar with basic channels in golang
Check this out, might come in handy: https://github.com/halgari/com.tbaldridge.hermod
(I havenβt used it, but it looks sufficiently small and simple lib so you have a lower chance of drowning in complexity if something is not going according to plan)
Quite old though, hope it builds on current JVMsβ¦
Hmmm, will look at it. But am is okay to just simulate things out all in a single Clojure program
Specifically I need to implement Lamport's shared priority queue. If I did it in golang, am just expected to work with golang channels as they are. So think if I attempt this is Clojure will do that too
You may find this useful: https://github.com/siclait/6.824-cljlabs-2020 (Since you mentioned distributed systems assignments and Golang - it reminded me of this.)
Hi all! I'm doing a weekend cram session on clojure (first time user!) and I'm really enjoying it :lambdalove: Would anyone have any recommendations for high level style-guides or best practices (testing etc)?
This is a pretty good one <https://guide.clojure.style/>
. As with all styles, use what you want and makes sense to you, it's all subjective π