This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-12
Channels
- # aleph (3)
- # announcements (7)
- # babashka (22)
- # beginners (44)
- # calva (19)
- # chlorine-clover (1)
- # cider (20)
- # clj-kondo (55)
- # clojure (100)
- # clojure-austin (9)
- # clojure-europe (19)
- # clojure-italy (19)
- # clojure-nl (13)
- # clojure-portugal (2)
- # clojure-uk (7)
- # clojurescript (38)
- # community-development (3)
- # conjure (2)
- # cryogen (57)
- # cursive (6)
- # datalog (3)
- # datomic (24)
- # emacs (17)
- # exercism (8)
- # fulcro (3)
- # holy-lambda (8)
- # jobs (6)
- # jobs-discuss (9)
- # joker (3)
- # lambdaisland (5)
- # leiningen (5)
- # music (9)
- # nextjournal (1)
- # nrepl (2)
- # off-topic (9)
- # other-languages (4)
- # pathom (6)
- # polylith (23)
- # re-frame (5)
- # reagent (5)
- # remote-jobs (1)
- # reveal (1)
- # shadow-cljs (3)
- # tools-build (1)
- # tools-deps (3)
- # xtdb (2)
You might also want to look at java.util.Scanner
i'm running into an error trying to start a repl for a project via the clj command line tool
Error building classpath. Could not acquire write lock for 'artifact:tractsoft:beekeeper:0.1.1'
java.lang.IllegalStateException: Could not acquire write lock for 'artifact:tractsoft:beekeeper:0.1.1'
i'm not seeing much discussion of this on forums. has anyone run into this?here's the full trace
Error building classpath. Could not acquire write lock for 'artifact:tractsoft:beekeeper:0.1.1'
java.lang.IllegalStateException: Could not acquire write lock for 'artifact:tractsoft:beekeeper:0.1.1'
at org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapter$AdaptedLockSyncContext.acquire(NamedLockFactoryAdapter.java:146)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:209)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:240)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:257)
at clojure.tools.deps.alpha.extensions.maven$fn__1053.invokeStatic(maven.clj:132)
at clojure.tools.deps.alpha.extensions.maven$fn__1053.invoke(maven.clj:122)
at clojure.lang.MultiFn.invoke(MultiFn.java:244)
at clojure.tools.deps.alpha$expand_deps$children_task__746$fn__748$fn__749.invoke(alpha.clj:406)
at clojure.tools.deps.alpha.util.concurrent$submit_task$task__479.invoke(concurrent.clj:34)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
what version of the CLI are you on?
and can you share your deps.edn with me?
~/projects/one-deps-repl(main *%) $ clj -version
Clojure CLI version 1.10.3.967
latest is 1.10.3.986 and you might want to try updating to that, but in the case it's still happening, you can add -Sthreads 1
and that may also help
I have an open issue for this, would appreciate any repro info before you update if you are able to share deps.edn
ok, i updated the CLI
got a whole new error
i will now try -Sthreads 1
well that's not going to help you with that error - it's just not finding the artifact in the s3 bucket, which could be permissions or something else
ah, ok. that gives me a direction to go in. thank you!
:bucket "mt2-maven", :path "tractsoft/beekeeper/0.1.1/beekeeper-0.1.1.pom"
I would hold off on the threads thing until you see something that looks like a concurrency error
this is probably well beyond "beginners", feel free to follow up in #tools-deps
Hi. I'm getting this error No value supplied for key: true
while using :require to load two namespaces. If I require just one, the code works.
My code:
(ns manjaro.main
(:require [manjaro.pacman :as pacman
manjaro.yay :as yay]))
Does anyone have some idea?it needs to be two vectors like this:
(ns manjaro.main
(:require [manjaro.pacman :as pacman]
[manjaro.yay :as yay]))
Hi, I have the following function where I have to iterate over a map inside an and
:
(let [attrs {:type "synonym"}
entry {:tag :name :attrs {:type "primary"}}]
(when (and true (for [attr-key (keys attrs)]
(= (attr-key attrs) (attr-key (:attrs entry)))))
(prn "test")))
I think it essentially boils down to (when (and '(false)) (prn "test))
, but I'm not sure how to get the values out of the list.Instead of looping over each attribute, you can pull out all attributes and compare them to the desired ones
(let [attrs {:type "synonym"}
entry {:tag :name :attrs {:type "synonym"}}
entry-attrs (:attrs entry)]
(= attrs (select-keys entry-attrs (keys attrs))))
A direct answer to your original question is to use (every? true? ...)
, but for this particular problem I'd do it this way instead š
Hi! Newbie here running into issues when trying to run migrations from this project https://github.com/dking1286/joyful_clojure/tree/master/03_clojure_application_development in lein. this works:
(load "db/migration")
(in-ns 'db.migration)
(migrate-up!)
but this doesn't:
(in-ns 'db.migration)
#object[clojure.lang.Namespace 0x298f9e91 "db.migration"]
db.migration=> (migrate-up!)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: migrate-up! in this context, compiling:(/private/var/folders/qx/b7z7n0r10612_85l9btz2x5w0000gn/T/form-init7653181204673703865.clj:1:1)
is this expected? do I need to load every file in order to be able to run it?yes, without some kind of load or require, the vars are not available in the Clojure runtime
Anyone would know how to make an http request with Kerberos authentication?
Python has this example: https://github.com/requests/requests-kerberos
I think I could find a way to wrap Java code to make it work, but I wondered if there was any solution that was compatible with the main http client like in clj-http or org.httpkit.client?
I think a good example to copy would be the aws-api lib from cognitect https://github.com/cognitect-labs/aws-api - they use their own http client which oddly I can't find the repo for, but the general idea should translate regardless of the client lib.
Maybe could you je more precise? I have absolutely zero knowledge in authentication
"authentication" is a very broad concept. I don't think you can really generalize it. Usually the way I break this down for a specific API is to figure out the API calls I need (usually a series of http calls that create a context with the server then acquire a token), then how to use the result (eg. attaching the the token I acquired as a payload to another http request).
oh! I think I misunderstood your question - if what you want to know is specifically about how to interact with kerberos I didn't offer anything useful
you mention wrapping the java code - that's what I'd do actually, just use a java lib for kerberos auth via interop
Thanks!
(def a [{:a "a", :price 200} {:b "b", :price 200}])
I have a vector above and I wanted to sum up the price and output is 400
Initially I thought (apply + (:price a))
should work, what am I doing wrong ?
Let's break it down into two steps. First we want to extract all the prices, then sum them together. First step: How do you go from [{:a "a", :price 200} {:b "b", :price 200}]
to a list of prices?
I think I ask earlier but I cannot find the answer back. are there any good free tutorials to learn how to make a website
iām long out of the game, but i remember https://figwheel.org/tutorial getting me going easily.