beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
zackteo 2021-04-03T00:56:48.483400Z

@hindol.adhya Wow yes, this is what I wanted! πŸ˜„ Actually my previous question was me trying to take a immediate step to get this

zackteo 2021-04-03T01:01:23.483600Z

@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!!

πŸ‘ 1
zackteo 2021-04-03T01:04:46.483800Z

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

zackteo 2021-04-03T01:51:59.485200Z

Thanks everyone for your help πŸ˜„ @hindol.adhya @dpsutton @elliot.stern @alexmiller @mitesh @pavlos

πŸ‘ 2
1
4
seancorfield 2021-04-03T04:33:26.486600Z

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

4
hindol 2021-04-03T04:38:54.486700Z

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)

hindol 2021-04-03T04:41:32.487Z

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)

jumar 2021-04-03T04:45:32.489600Z

Great, thanks! I’ve found the example very valuable in the past. Any takeaways from the rewriting it to use Polylith?

seancorfield 2021-04-03T04:47:58.489800Z

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.

πŸ‘ 2
jumar 2021-04-03T04:53:35.490100Z

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"

πŸ™ 1
hindol 2021-04-03T05:06:46.491Z

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?

hindol 2021-04-03T05:09:17.491100Z

Found the workaround here: https://github.com/incanter/incanter/pull/399

zackteo 2021-04-03T05:37:25.491500Z

Wow! Okay okay I'll try to remember that!

zackteo 2021-04-03T06:29:05.494400Z

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

oxalorg (Mitesh) 2021-04-03T06:32:44.494500Z

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?

zackteo 2021-04-03T06:53:20.495400Z

Gotcha πŸ™‚

zackteo 2021-04-03T13:27:42.498300Z

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

raspasov 2021-04-03T13:47:59.498500Z

Check this out, might come in handy: https://github.com/halgari/com.tbaldridge.hermod

raspasov 2021-04-03T13:48:53.498800Z

(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)

raspasov 2021-04-03T13:49:11.499Z

Quite old though, hope it builds on current JVMs…

zackteo 2021-04-03T14:11:11.499300Z

Hmmm, will look at it. But am is okay to just simulate things out all in a single Clojure program

πŸ‘ 1
zackteo 2021-04-03T14:12:29.499500Z

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

hindol 2021-04-03T14:26:32.499700Z

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.)

Bka Codes 2021-04-03T15:04:19.003900Z

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)?

dharrigan 2021-04-03T15:07:17.004600Z

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 πŸ™‚

πŸ™ 2