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
Benchmarks at: https://github.com/cognitect-labs/transducers-python/blob/master/tests/benchmark.py | |
transducers-python git/master | |
❯ python tests/benchmark.py | |
Avg. time for transducers.transducers with T.replace({0:1, 100:200, 1000:500}) is: 68.4194946289 | |
Avg. time for tests.genducers with G.replace({0:1, 100:200, 1000:500}) is: 37.8649584961 | |
Avg. time for transducers.transducers with T.take(10000) is: 8.898671875 | |
Avg. time for tests.genducers with G.take(10000) is: 3.86192871094 | |
Avg. time for transducers.transducers with T.dedupe is: 0.779968261719 | |
Avg. time for tests.genducers with G.dedupe is: 0.304665527344 |
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
sudo yum install zsh tmux htop git -y | |
sudo yum install util-linux-user -y | |
sudo chsh -s /bin/zsh ec2-user | |
wget --no-check-certificate http://install.ohmyz.sh -O - | sh | |
mkdir ~/src | |
mkdir ~/datomic | |
# from https://gist.github.com/sebsto/19b99f1fa1f32cae5d00 | |
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo |
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer