When unsing docker compose you can have a problem with the order of dependent linked containers
The solution is to start a script which tries to access a service and waits until it gets ready before loading your program
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
When unsing docker compose you can have a problem with the order of dependent linked containers
The solution is to start a script which tries to access a service and waits until it gets ready before loading your program
(def regex-char-esc-smap | |
(let [esc-chars "()&^%$#!?*."] | |
(zipmap esc-chars | |
(map #(str "\\" %) esc-chars)))) | |
(defn str-to-pattern | |
[string] | |
(->> string | |
(replace regex-char-esc-smap) | |
(reduce str) |
(def tx-fns | |
[{:db/ident :db.fn/reset-attribute-values | |
:db/doc "Transaction function which accepts an entity identifier, attribute identifier | |
and set of values and expands to any additions and retractions necessary to | |
make the final post-transaction value of the attribute match the provided | |
values. Attribute values must be scalars. | |
If multiple values are provided on a cardinality-one attribute you will get a | |
datom conflict exception at transaction time." | |
:db/fn (d/function |
*.clj diff=clojure | |
*.cljs diff=clojure | |
*.cljx diff=clojure |
When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.
filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&id=${fileid}"
(require '[datomic.api :as d]) | |
(d/create-database "datomic:mem://counter-example") | |
;=> true | |
(def c (d/connect "datomic:mem://counter-example")) | |
;=> #'user/c | |
;; The essential features of creating and using an auto-increment counter in datomic: | |
;; | |
;; 1. A counter entity must store the current value and a nonce. |
I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.
This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea
A beginner-friendly REPL that combines
If you are curious about the types inferred by ClojureScript, it is easy to get some insight using a macro:
(defmacro inferred-type [form]
`'~(cljs.analyzer/infer-tag &env
(cljs.analyzer/no-warn (cljs.analyzer/analyze &env form))))
This is the kind of dev-time macro you could refer using the new user.cljs
feature.