This section describes each of the services compared in the throwdown and the algorithms/models used.
Decision trees.
| /** | |
| * The basic class syntax. | |
| */ | |
| public class BasicClass { | |
| public BasicClass() { | |
| // This is the constructor. | |
| } |
| (ns topoged.model.type | |
| (:import | |
| (javax.persistence Entity Id Column Table GeneratedValue) | |
| )) | |
| (definterface IType (getId [])) | |
| (deftype | |
| ^{Entity {} Table {:name="TYPE"} org.hibernate.annotations.Entity {:mutable false}} | |
| TypeX [^Long id] |
| backend default { | |
| .host = "app.rhcloud.com"; | |
| .port = "80"; | |
| } | |
| sub vcl_recv { | |
| set req.http.host = "app.rhcloud.com"; | |
| if (req.http.cache-control ~ "no-cache") { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (defn handler | |
| [r] ((build-routes) r)) | |
| (web/start handler | |
| :reload true) | |
| (msg/start "/queue/delivery.status") | |
| (msg/respond "/queue/delivery.status" handle-delivery-status) |
| ;; see http://stackoverflow.com/questions/16242750/nesting-structures-with-datomic | |
| (require '[datomic.api :as d]) | |
| (def uri "datomic:mem://test") | |
| (d/create-database uri) | |
| (def conn (d/connect uri)) | |
| ;; sample attributes | |
| (d/transact conn [{:db/id #db/id[:db.part/db] | |
| :db/ident :some/ref-value | |
| :db/valueType :db.type/ref |
| ;; see http://stackoverflow.com/questions/17190334/getting-the-id-of-an-inserted-entity-in-diatomic | |
| (require '[datomic.api :as d]) | |
| (def uri "datomic:mem://test") | |
| (d/create-database uri) | |
| (def conn (d/connect uri)) | |
| ;; create an atribute | |
| (d/transact conn [{:db/id #db/id[:db.part/db] | |
| :db/ident :some/attribute | |
| :db/valueType :db.type/string |
| (require '[datomic.api :as d]) | |
| (def uri "datomic:mem://test") | |
| (d/create-database uri) | |
| (def conn (d/connect uri)) | |
| (d/transact conn [;; Article | |
| {:db/id #db/id [:db.part/db] | |
| :db/ident :article/title | |
| :db/valueType :db.type/string | |
| :db/cardinality :db.cardinality/one |