This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-01
Channels
- # announcements (7)
- # beginners (30)
- # boot (6)
- # calva (24)
- # cider (8)
- # clj-kondo (8)
- # cljs-dev (16)
- # cljsrn (8)
- # clojure (60)
- # clojure-italy (19)
- # clojure-mexico (6)
- # clojure-nlp (2)
- # clojure-uk (11)
- # clojurescript (36)
- # datomic (11)
- # hoplon (1)
- # juxt (2)
- # kaocha (1)
- # keechma (13)
- # nrepl (1)
- # off-topic (51)
- # reagent (7)
- # rewrite-clj (17)
- # robots (7)
- # shadow-cljs (2)
- # sql (4)
- # testing (1)
- # tools-deps (11)
- # vim (12)
Using the build in clojure
cli is there a way to make it download all the deps? The equivalent of lein deps
?
Thank you
@U050ECB92 what does -Spath do?
with the clojure/deps.edn ecosystem, is there a good reason to stuff a project with multiple components (let's say server/client binary) that don't make sense separately but are developed mostly in tandem in 1 deps.edn file or multiple?
I ask because i've currently done that with leiningen and hit a whole bunch of long-standing profile-related bugs
@lvh in JUXT/edge we use separate deps.edn files, and then use :local/root to pull them together.
On client projects (this hasn't been demo'd too much) we have designed extensive setups where the configs are factored out to make it easier to pull applications together this way.
i’m using http-kit to write a simple API server. does anyone know how to add SSL support to it directly with Clojure? by directly I mean without using an external reverse proxy (like nginx) or SSL terminator. Internal ones (i.e. inside the JVM where I could control with Clojure) are perfect
the reason i’d like to have control over the SSL part is because the API server is a test server for a custom SSL client on MCU, and we want to be able to generate new SSL certificate and have multiple SSL sockets listening with different certificates (for testing successful cases and unsuccessful cases)
This still sounds like a perfectly doable thing with nginx or other proxy: https://stackoverflow.com/a/38054382/1184752
yeah sure i’m using a configuration like that for the production server but this is for the testing server and would like direct control over ssl configuration (including certificate generation) directly from the Clojure codebase
The pedestal codebase might have some ready-made code you can either use directly or copy-paste
that’s a great note. this file has many interesting snippet: https://github.com/pedestal/pedestal/blob/09dd88c4ce7f89c7fbb7a398077eb970b3785d2d/jetty/src/io/pedestal/http/jetty.clj
for anyone who’s curious, i finished the exploring and got a working piece so far by using - Bouncy Castle to generate a keypair and a self-signed certificate - a KeyStore instance of type “pkcs12” to hold the certificate + private key - Jetty with a ServerConnection configured with a SslConnectionFactory and a HttpConnectionFactory to finally get a running server
not sure who else is interested but i may post a gist after cleaning the code a little bit another day
for anyone who’s curious, i finished the exploring and got a working piece so far by using - Bouncy Castle to generate a keypair and a self-signed certificate - a KeyStore instance of type “pkcs12” to hold the certificate + private key - Jetty with a ServerConnection configured with a SslConnectionFactory and a HttpConnectionFactory to finally get a running server
where do you host your stuff ?
if on amazon i would recommend using alb or elb instead of doing the ssl stuff yourself ... yes it costs a little extra but is well worth the money
yeah, for another project i’m doing exactly the same--using elb for ssl termination--yet this stuff is for developing and testing the “hardware” part of a solution (an MCU controlled gateway-ish thing that connects an input device to the application server running in the cloud)
so finally the production server will be hosted behind elb as planned now, but i was trying to make the local server and want more flexibility on certificates for testing purpose
Could you have a look, is this solution good enough, or am I misusing protocols this way?
The problem: I have a code that reads/writes things to a serial port. There are places in program where a number of reads/writes is expected to be finished by a specific deadline (protocol description contains phrases like "if the whole data frame was not received within 1500ms, application should stop receiving it and return to idle state.") I have tried to weave the operation deadline through reading/parsing routines (the data frame cannot be read in one operation, as it contains embedded lengths), but it was awkward. At the end I bound a deadline
to a port object. (edited: moved read-byte
out of interface)
Hello guys
how can i embed values into xml files in clojure?
something like erb in ruby for example
i guess i found https://freemarker.apache.org/
if someone interested too 🙂
Are #
, %
and &
valid characters in a Clojure(script) symbol? I couldn't find an official language spec, and the rules given in https://clojure.org/reference/reader seem overly restrictive
Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, ', ?, <, > and = (other characters may be allowed eventually).
The rules given at http://clojure.org are what is explicitly supported. The implementation does not prevent you from using other characters, but using some of those other characters can cause some use cases to break
If you are looking for an implementation of (symbol "some string") or (keyword "some string") that throws an exception if you give it a character that is outside of a particular set of characters, you will have to write it yourself or find it in some third party library.
Does that mean that using e.g. a#b$c
as a variable name could potentially be broken in a future release of Clojure?
I am not the decision maker on what changes in future releases of Clojure, so can't authoritatively answer such a question, but I can say that the Clojure maintainers do a great job at maintaining backwards compatibility, and rarely make changes that break such things. They know that because the implementation allows other characters, that many people take advantage of htat.
But for example if you find that using such a variable name causes, say, printing your code or data to a file, then reading it back, to break, then if you are using characters outside of the allowed set, and that is the reason it is breaking, you will likely not get a lot of people rushing to change Clojure to make that work.
For example, if you use a space in a symbol or keyword, that will break the ability to print code/data and read it back and be equal to the original.
There is a Clojure JIRA issue that suggests some kinds of actions in this area -- I am forgetting whether it was only adding more documentation for Clojure, or adding a function that would check whether a proposed string was a supported symbol/keyword
Semicolons would be another thing that might be a bit grey in terms of print-read round-tripping. Probably many others.
commas
You can easily extend printing and reading though. I've added support for spaced namespaces and symbols in some use cases where it was convenient
I was wondering because clojure-mode in Emacs highlighted a variable name foo#bar
wrongly, and I couldn't find out if it was an actual bug or according to spec
Here is the JIRA issue I was thinking of: https://clojure.atlassian.net/browse/CLJ-1527
I don't think I've ever seen a breakage related to what are valid symbols and namespaces. Like no version of Clojure ever broke that.
But if you go to significant lengths, e.g. days and days of work, trying to get color highlighting "working" (whatever that means to you) for arbitrary sequences of characters, you may go mad. 🙂
Is it possible to use tools.reader to read a form as a string? Preserving whitespace. I'm guessing there might be some trick with the pushback reader, but not sure.
See http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/read+string
I'm running: clj -A:cli:client -m aot some-args
the client
alias has both an :extra-deps
and a :main-opts
. I was expecting the main-opts on the command line to override those from the alias, but instead the main-opts from :client
are used. Is there an order to specify them in that fixes that, or is this why -R/-C exist?
This is a known issue, but using R and C should be a workaround
A will always be applied last right now