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
(defnav take-nth [n] | |
(select* [this structure next-fn] | |
(next-fn (take-nth n structure))) | |
(transform* [this structure next-fn] | |
(if (vector? structure) | |
(let [c (count structure) | |
is (into [] | |
(take-while #(< % c)) | |
(iterate #(+ % n) 0))] |
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- get-fspec-attr | |
[sym attr] | |
(->> (s/form sym) | |
(rest) | |
(partition 2) | |
(keep (fn [[a b]] (when (= a attr) b))) | |
(first))) | |
(s/fdef conform-fn-call | |
:args (s/cat :fn-call (s/spec (s/cat :f symbol? :rs (s/* any?)))) |
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.core | |
(:require [clojure.spec :as s] | |
[clojure.spec.test :as stest] | |
[clojure.test.check.generators :as gen])) | |
(s/def ::file-count nat-int?) | |
(s/def ::operations (s/map-of keyword? pos-int?)) | |
(s/def ::time-total (s/and double? (complement neg?))) | |
(s/def ::summary-res |
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
(transform | |
[MAP-VALS | |
(view frequencies) | |
(collect-one (view #(apply max (vals %))))] | |
(fn [mx fs] (transform MAP-VALS #(/ % mx) fs)) | |
{:a [1 1 3 4] :b [1 1 2 2 2 3]}) | |
;; => {:a {1 1, 3 1/2, 4 1/2}, :b {1 2/3, 2 1, 3 1/3}} |
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 freactive-datascript.core | |
(:require [datascript :as d] | |
[datascript.core :as dc] | |
[clojure.data :as data] | |
[freactive.core :as f :refer [IReactive | |
*invalidate-rx* | |
*trace-capture*]])) | |
;;; Playground ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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
06:18 *** luxbock JOIN | |
06:18 *** TOPIC Clojure, the language http://clojure.org | | |
Currently at 1.5.1; top analysts expect this to be | |
followed by newer versions with still higher | |
numbers: | |
https://github.com/clojure/clojure/blob/master/changes.md | |
| discussion: | |
http://groups.google.com/group/clojure | Trying to | |
convince others to use Haskell is permitted between | |
0200 and 0500 UTC. (technomancy on Tue Jan 14 |
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 project-euler.problem-3) | |
;; The prime factors of 13195 are 5, 7, 13 and 29. | |
;; What is the largest prime factor of the number 600851475143 ? | |
(def n 600851475143) | |
(defn factors [n] | |
(let [half (long (/ n 2))] | |
(filter #(= (rem half %) 0) (range 1 (inc half))))) |
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
user> (require '[cljs.repl :as repl]) | |
FileNotFoundException Could not locate cljs/repl__init.class or cljs/repl.clj on classpath: clojure.lang.RT.load (RT.java:443) |
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
(defproject letusgogo "0.1.0-SNAPSHOT" | |
:description "Project for testing and fetching new libraries" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[com.cemerick/pomegranate "0.0.13"] | |
[lein-kibit "0.0.8"] | |
[clj-http "0.7.2"] | |
[tailrecursion/boot.core "1.2.3"] |