Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
(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. |
A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.
How to use:
(ns logical-db.core | |
(:require [clojure.core.logic :as l] | |
[clojure.core.logic.protocols :refer [walk]] | |
[clojure.core.logic.pldb :as db])) | |
; [org.clojure/clojure "1.8.0"] | |
; [org.clojure/core.logic "0.8.10"] | |
(def db { :city->zip {"City1" [1 2 3 4] "City2" [5 6]} |
(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 |
This talk was given by Gregor Kiczales of Xerox PARC at OOPSLA ’94, 10/26/94. © 1994, University Video Communications. A transcript, with point- and-click retrieval of the slides, is available at http:/www.xerox.com/PARC/spl/eca/oi/gregor-invite/gregor- transcript.html
I think our field will go through a revolution. We will fundamentally change the way we think about and use abstraction in the engineering of software.
The goal of this talk is to summarize the need for and the basic nature of this abstraction framework.
The change is not new problems or new systems, but a new way of thinking about existing problems and existing systems.
(ns my-transducers.core | |
(:require [clojure.core.async :as async])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Understanding Transducers | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; | |
;; This is the source code for the blog post Understanding Transducers, found | |
;; here: http://elbenshira.com/blog/understanding-transducers | |
;; |
This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.
Highly recommended things!
This is my five-star list. These are my favorite things in all the world.
A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★
App configuration in environment variables: for and against | |
For (some of these as per the 12 factor principles) | |
1) they are are easy to change between deploys without changing any code | |
2) unlike config files, there is little chance of them being checked | |
into the code repo accidentally | |
3) unlike custom config files, or other config mechanisms such as Java |
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) | |
(defn init [vars hints] | |
(if (seq vars) | |
(let [hint (first hints)] | |
(all | |
(if-not (zero? hint) |