This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-15
Channels
- # aws (25)
- # babashka (11)
- # beginners (24)
- # calva (18)
- # clj-kondo (6)
- # cljdoc (1)
- # clojure (48)
- # clojure-europe (3)
- # clojure-houston (1)
- # clojure-uk (22)
- # clojuredesign-podcast (8)
- # clojurescript (9)
- # cursive (8)
- # dirac (6)
- # duct (19)
- # fulcro (17)
- # hoplon (29)
- # mount (3)
- # off-topic (24)
- # pathom (6)
- # re-frame (6)
- # shadow-cljs (5)
- # spacemacs (5)
- # sql (10)
- # tools-deps (7)
- # vim (2)
I am looking for an implementation of a reversable hash function that allows for the seed to be set. Any suggestions? It would be ideal if it could hash any Clojure collection, but if not I can work with byte arrays.
Thanks everyone, and sorry for the ignorance on my end. I am an ML practitioner so I used all the wrong terms. Here are some corrections
• I am looking for a cryptographic hash function.
• By seed, I now know I meant secret key, which all crypto libraries should let you provide. :)
After you all pointed me towards encryption, I think I found what I needed via interop to javax.crypto
.
For cryptographic hash functions that is an important property they designed for, for non-cryptographic hash functions they throw away information, so you can't go backwards
"Hash functions" is not the same as "cryptographic hash function", @hiredman . It's unclear though what "hash seed" and "reversible" mean in the original question, though.
If we want a reversible hash, the length of hash will grow proportional to the amount of data we are hashing. Maybe an encoding like base64 is useful?
What is the canonical way to run Clojure on AWS Lambda in 2020? All the resources I've found online are a couple of years old.
Nothing has changed that much in last couple of years. There is nowdays GraalVM which may be usable in some cases to decrease startup time.
If you’re using Lambda with Clojure you should probably be writing it in ClojureScript not Clojure. The Firecracker VM’s (what lambda runs on) entire value proposition is to not have anything warmed up so startup time for short work (typical for Lambda) is a big waste.
(utils/submap? {:shops [#:shop{:uuid #uuid"00000000-0000-0000-0000-000000000000"
:name "redshop"
:engine "atomstore"
:config {:foo "bar"}}]}
{:shops [#:shop{:uuid #uuid"00000000-0000-0000-0000-000000000000"
:name "redshop"
:engine "atomstore"
:config {:foo "bar"}
:updated_at #inst"2020-03-15T10:05:07.926-00:00"
:created_at #inst"2020-03-15T10:05:07.926-00:00"}]})
Has someone fn
like this?
I use this one:
(defn submap?
"Is subset of m?"
[subset m]
(if (and (map? subset) (map? m))
(every? (fn [[k v]] (and (contains? m k)
(submap? v (get m k))))
subset)
(= subset m)))
But this doesn’t work with []
correctly.When I've needed something like this I found https://clojure.github.io/clojure/clojure.data-api.html#clojure.data/diff to work well
diff-similar
doc says "Implementation detail. Subject to change." so it is not meant to be used directly.
I'm trying to get an absolute minimal prompt thing working. If I have
(defn -main []
(loop []
(print "user> ")
(println (read-line))
(recur)))
Why does "user>" not print until I enter input when I call clojure -m myns
? There will be a blank prompt until I type "x" and then user> x
will printI am not 100% sure but I think sending a \n
in the string auto-flushes the buffer, hence printing immediately. So you can try println
. If you don't want a newline, try flushing manually.
Thanks everyone, and sorry for the ignorance on my end. I am an ML practitioner so I used all the wrong terms. Here are some corrections
• I am looking for a cryptographic hash function.
• By seed, I now know I meant secret key, which all crypto libraries should let you provide. :)
After you all pointed me towards encryption, I think I found what I needed via interop to javax.crypto
.
I've installed io.aviso/pretty
in leiningen (following the instructions) but my shell doesn't seem to be interpretting the output correctly. As an example, I get something like:
Caused by:
clojure.lang.ExceptionInfo: ?[38:5;32m-- ?[0m?[38;5;45mRouter creation failed
This is not quite the improvement I was hoping for. I'm pretty sure the garbage prefixed with ?[
is shell formatting markup, so I think the plugin is at least running. Has anyone else had this issue? I'm running Bash within XFCE Terminal 0.8.7.4yeah those outputs are ANSI escape codes, which are used to produce the colors in your terminal
Does anyone know of any startups that use Clojure? I know there is http://roamresearch.com and https://whimsical.com/blog/how-we-built-whimsical
Afraid not. Did you see https://clojure.org/community/success_stories and https://clojure.org/community/companies already?
I believe Reify Health is a Clojure shop. They are at least 3 years old, so they may be further along than what you are looking for. https://www.reifyhealth.com/
There is http://amperity.com. They started in 2015, so well beyond the first stages, but with clojure from the beginning, afaik
@U7PBP4UVA Is the reasoning for the move documented somewhere? Maybe a talk? I am always interested to hear such stories.
Not yet - I’m pondering submitting a talk to ClojuTRE later this year - but perhaps the move has failed so the title has to be “Schrodinger”-like.
Other people have also expressed interest (we are also migrating our frontend from jQuery/handlebars to ClojureScript) so perhaps I should just submit a proposal.
I am curious about the "move has failed" bit. But perhaps I should wait for your talk. I do hope you get time to submit a proposal.
I was checking the string doc of defonce
and I am not 100% sure there is a typo in it
“defs name to have the root value of the expr iff the named var has no root value, else expr is unevaluated”
shouldn’t the iff
be if
?
iff
is not so common outside academics so it might make sense to update the doc string.