Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
library(shiny) | |
library(PerformanceAnalytics) | |
data(managers) | |
# Define server logic required to plot relative performance | |
shinyServer(function(input, output) { | |
# Use charts.PerformanceSummary from Performance Analytics package | |
# to generate a performance summary plot |
; See http://stackoverflow.com/questions/15595540/datomic-insert-blocks | |
(require '[datomic.api :as d]) | |
(def uri "datomic:mem://test") | |
(d/create-database uri) | |
(def conn (d/connect uri)) | |
(d/transact conn [{:db.install/_attribute :db.part/db | |
:db/id #db/id[:db.part/db] | |
:db/ident :car/model |
(ns artscentre.orm.scratch | |
(:use [datomic.api :only [db q] :as d] | |
[datomico.core :only [build-schema]] | |
[artscentre.datomic-util])) | |
(def Skill (build-schema :Skill [[:name :string :unique] | |
[:description :string]])) | |
;; see http://stackoverflow.com/questions/14724991/modelling-multiple-many-to-many-relationships-in-datomic | |
(require '[datomic.api :as d]) | |
(def uri "datomic:mem://test") | |
(d/create-database uri) | |
(def conn (d/connect uri)) | |
(d/transact conn [ ;; User | |
{:db/id #db/id [:db.part/db] | |
:db/ident :user/username |
(require '[datomic.api :as d]) | |
(def uri "datomic:mem://test") | |
(d/create-database uri) | |
(def conn (d/connect uri)) | |
(d/transact conn [{:db/id #db/id [:db.part/db] | |
:db/ident :enum/ns | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one | |
:db/doc "Enum's namespace. Help enforce fk constraints on :db.type/ref enum references" |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
(ns myupsert.core | |
(require [datomic.api :as d])) | |
(def schema | |
[ | |
{:db/id #db/id [:db.part/db] | |
:db/ident :product/name | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one | |
:db.install/_attribute :db.part/db} |
;; 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 |
/** | |
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes | |
* all items from all source arrays in an efficient way. | |
* | |
* Usage: | |
* | |
* ```javascript | |
* var obj = Ember.Object.create({ | |
* people: [ | |
* { |
# So, this is pretty horrible. If we just encode using btoa, any UTF-8 chars cause an error. | |
# If we use either of the workarounds on MDN[1], the £ sign is encoded wrong. I suspect | |
# Excel totally sucking at encodings is the reason why. So, the workaround is, to use | |
# the MDN workaround on chars with values > 255, and allow chars 0-255 to be encoded | |
# as is with btoa. Note that if you use either of the workarounds on MDN, chars | |
# 128-255 will be encoded as UTF-8, which includeds the £ sign. This will cause excel | |
# to choke on these chars. Excel will still choke on chars > 255, but at least the £ | |
# sign works now... | |
# [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding |