Fork me on GitHub
Thomas Tay02:03:20

I'm looking for a sample repo to setup a pretty straightforward static file web server using Graal as a learning exercise I found this, which seems good, but is httpkit still the way to go for a http server? I saw the project says it's unmaintained by the owner but maintained by community users.

Scott Starkey13:03:26

Hi there, folks. I’ve been working on Code Academy “katas” like a good beginner, and I came across this bit of irritation: > Let us consider this example (array written in general format): > ls = [0, 1, 3, 6, 10] > Its following parts: > ls = [0, 1, 3, 6, 10] > ls = [1, 3, 6, 10] > ls = [3, 6, 10] > ls = [6, 10] > ls = [10] > ls = [] > The corresponding sums are (put together in a list): `[20, 20, 19, 16, 10, 0]` So, I whipped up the following bit of code, which I was rather proud of!

(defn parts-sums [ls]
  (if (empty? ls) '(0)
      (cons (reduce + ls) (parts-sums (rest ls)))))
Cue the sad trombone sounds. At the bottom of the exercise it mentions: “Take a look at performance: some lists have thousands of elements.” My solution works for smaller sets and all the test datasets, but does not work on the longer “Attempt” datasets. Grr. Thoughts on optimization?


What if you reverse the list first?


Trying to just give vague hints here so as not to give away spoilers. 🙂

Scott Starkey13:03:53

thanks. I will look into it. 🙂


I'd also look at the function reductions


Or another question: what’s the most time-consuming part of the problem, and how can you minimize the time you spend doing that?


That’s a better approach to figuring out optimizations in general.



(reductions + 0 [1 2 3 4 5])
=> (0 1 3 6 10 15)
Think that will help you here.

Scott Starkey13:03:55

Hmmm… I’d never seen or tried to use the function reductions before. One of my attempts was trying to use reduce but that didn’t work.


It's like reduce, but returns you the intermediate values


Note that the correct solution to the problem given is The corresponding sums are (put together in a list): [20, 20, 19, 16, 10, 0]

Scott Starkey13:03:03

YESSSSS, reductions! I just looked up that up. That’s exactly what I need here!

Scott Starkey13:03:12

I’d never heard of it before!


Clojure has a bunch of useful things like that. See also frequencies, which isn’t relevant to this, but it’s also a cool function.

Scott Starkey13:03:01

[heads off and fires up emacs]

❤️ 3

Team, I have service endpoint which has authentication, I am able to get the result in postman, I wanted to integrate same in my application using clojure, Which are the api I can use? I started with composure, But I did not get how to access endpoint via clojure


As a client, there are several, for example and are two that immediately come to mind.


So we need to use ring in this?


No. If I read you correctly, you want to invoke an external 3rd party API that is secured by some type of authentication, in order to retrieve data (most likely JSON)?


Execution error (SunCertPathBuilderException) at ( unable to find valid certification path to requested target


What kind of authentication are you using?


My guess from the error is that you are using a self-signed certificate?


@U01J3DB39R6 If you are using clj-http, you should look at the :insecure? or :keystore options. http-kit has the :insecure? option but I'm not sure how it handles :keystore


@UG00LE5TN yeah I used :insecure? to false and it worked for me,


set to false? I would have expected it to be set to true to allow insecure certs


ya sorry, I rechecked it ..i set it to true


Groovy. Glad that got you off the ground. Just be wary of that :insecure? setting - it does what it says on the tin, and makes things less secure. Fine for development but if you are putting things into production I'd recommend either getting a properly signed cert, or looking into the :keystore options


So in order to set a custom read timeout in a google analytics api request, I had to write in clojure with java interop. I ended up using reify:

(defn set-http-timeout [request-initializer]
  (reify HttpRequestInitializer
    (initialize [_ http-request]
      (.initialize request-initializer http-request)
      (.setReadTimeout http-request (* 3 60000)))))
However, according to the well-known "" flowchart, when you want to extend an existing class, you need to use proxy. Is the flowchart outdated or could proxy really have some edge over reify in this particular case?


That's an interface not a class

picard-facepalm 3

(Yup, it's official, I'm an idiot 😅) Thanks!

Old account16:03:55

Hi, can I ask for some support? I have a Leiningen project that does not work for some reason but I don't know why. I run lein gorilla` as shown in this example I just need to find out if this is problem with my setup or I am doing something stupid. The exception is here:

Old account16:03:59

The project was created with lein new app name and just added :plugins [[lein-gorilla "0.4.0"]] to project.clj


change reps in plugins section as mentioned in the comment to [org.clojars.benfb/lein-gorilla "0.6.0"]

✔️ 3
Old account17:03:24

thank you so mutch


When I publish a Clojure library to Clojars, I see allow just for “org.clojars.baader/*” to submit something, but how could I create eg [baader/library-name “0.1.0"], without org.clojars? Just I don’t understand others.. how could setup this.


Clojars policies have changed over time


There were some recent changes to prevent people from using group I'd names that they don't "own" in some sense


@sb Both clj-new and depstar will be getting updates this week to "strongly encourage" folks to use group IDs that comply with the new security policy that Clojars is rolling out.


If you own (or .net or .org) you should probably use com.baader as your group name (or net.baader or org.baader) so that ownership can be verified. Or com.github.baader if your library lives on GitHub.

👍 6

I use Hungarian domain (my company domain), in this case hu.baader ok, btw during this time somebody approved to use baader name (thanks!)


hu.baader/library-name would be nice for you to use (and make sure you don't conflict with any other baader out there 🙂 )

👍 3
🍻 3

ok 🙂 I can do it. Np for me 🙂


works fine, thanks!!


Good afternoon everybody, I'm back at it with more livestreaming today. We're starting in about 10 minutes if you'd like to join. Stream link here: Per usual, I'm mostly going to be live-coding the development of this app: But first I'm starting with a coding exercise warmup, so if you're new to the language, are trying to learn new techniques, or just curious, then feel free to join for the exercise portion! We're doing this coding challenge from the Eric Normand newsletter today, averaging RGB colors: Hope to see you there :man-bowing:

😮 3

If anybody would like to check out my solution, here it is: You should be able to copy/paste this into any old REPL and just run it. Enjoy!


is there a way to change the ring anti forgery token error page?


much appreciated thank you


Watching REPL Driven Development on to learn different programming flow with Clojure. Any other suggestions? I’m currently using Cursive since I’m most comfortable there. Any good resources for RDD in Cursive would be awesome!


@twcrone I don't know of any that use Cursive (maybe ask in #cursive?). I have a couple of videos on my YouTube channel that show my RDD workflow (with Atom/Chlorine and Cognitect's REBL) and I did a couple of meetup talks/live coding recently with VS Code/Clover and Reveal (London: an hour and fifteen) and;t=837s (Provo: the talk starts 14 minutes in and runs 2 1/2 hours).


I love Eric Normand's RDD course on but that's a subscription service ($49/month).


can’t subscribe anymore…need to pay per video although they are downloadable for free it appears


yes, saw that too


I've pinged Eric about the subscription stuff -- he still links to it in his weekly newsletter, saying subscriptions are available. I know he closed them down for a while, then opened them back up.


ok, I seem to remember seeing subscriptions were available recently, then last couple days could not get one.