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
;; moved to https://github.com/leifp/spec-play | |
;; src/spec/clojure/fns.clj |
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
import itertools as it | |
# alpha step 1 | |
def activities(traces): | |
a = set() | |
for trace in traces: | |
a |= set(trace) | |
return a | |
# alpha step 2 |
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
From 82dab3592fcc4f51fa2ce25133617502b1671429 Mon Sep 17 00:00:00 2001 | |
From: Leif Poorman <leif.poorman@gmail.com> | |
Date: Sun, 17 May 2015 20:30:12 -0400 | |
Subject: [PATCH 1/3] index papers by canvas region | |
--- | |
src/rdp/214_intermediate.clj | 87 +++++++++++++++++++++++++++++++++----------- | |
1 file changed, 66 insertions(+), 21 deletions(-) | |
diff --git a/src/rdp/214_intermediate.clj b/src/rdp/214_intermediate.clj |
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 test.multiple.implementations | |
(:require [clojure.test :refer [deftest is]])) | |
;;; Protocol and records that implement it | |
(defprotocol P (value [this])) | |
(defrecord One [] P (value [_] 1)) | |
(defrecord Three [] P (value [_] 3)) | |
;; potentially several more... |
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 diamond | |
(:require [clojure.string :as s] | |
[clojure.test :refer [deftest is]])) | |
(defn palindrome | |
[coll] | |
(concat coll (reverse (butlast coll)))) | |
(defn char-range | |
[start-c end-c] |
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 '[clojure.core.logic :refer :all]) | |
(require '[clojure.core.logic.fd :as fd]) | |
(defn more-than-one-apart [x y] | |
(conde | |
[(fd/eq (> (- x y) 1))] | |
[(fd/eq (> (- y x) 1))])) | |
(defn billiards [] | |
(let [dom (fd/interval 1 10) |