This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.31090480089187622</real> | |
<key>Green Component</key> | |
<real>0.31097450852394104</real> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fbuzz [x] | |
(let [divides (fn [x y] | |
(= (rem x y) 0))] | |
(cond (divides x (* 5 3)) "FizzBuzz" | |
(divides x 5) "Buzz" | |
(divides x 3) "Fizz" | |
:else x))) | |
(doseq [x (map fbuzz (range 1 101))] (print (str x ", "))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fbuzz(x): | |
str_rep = "" | |
if (x % 3) == 0: | |
str_rep += "Fizz" | |
if (x % 5) == 0: | |
str_rep += "Buzz" | |
if not str_rep: | |
str_rep += str(x) | |
return str_rep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Expected behavior during transactor shutdown and restart. | |
* */ | |
import datomic.Connection; | |
import datomic.Peer; | |
import datomic.Database; | |
import datomic.Util; | |
import java.util.Scanner; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[datomic.api :as d] 'clojure.pprint) | |
;; You can run this with bin/run in the $DATOMIC_DIR | |
(println "Printing database schema...") | |
(def conn (d/connect (first *command-line-args*))) ;; call with db-uri as arg | |
; Find and pretty-print each attribute in schema | |
(let [db (d/db conn)] | |
(clojure.pprint/pprint | |
(map #(->> % first (d/entity db) d/touch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns datomic-manual-tests.or-join | |
(:require [datomic.api :as d])) | |
(def db-uri (apply str ["datomic:mem://test" (d/squuid)])) | |
(d/create-database db-uri) | |
(def conn (d/connect db-uri)) | |
(def schema | |
[{:db/id (d/tempid :db.part/db) | |
:db/ident :person/name |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function metric-grep () { | |
cat *.log | perl -n -e 'print "$1 $2\n" if /^(.*) INFO .* '"$1"' {.*?'"$2"' ([0-9]+).*?}/' | less | |
} | |
# call like: | |
# metric-grep :TransactionBytes :sum | |
# output like | |
# 2015-04-01 00:00:29.995 34818 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns datomic-manual-tests.with-bonanza | |
(:require [datomic.api :as d])) | |
(def db-uri "datomic:mem://people") | |
(d/create-database db-uri) | |
(def conn (d/connect db-uri)) | |
(def schema | |
[{:db/id (d/tempid :db.part/db) | |
:db/ident :person/age |
OlderNewer