La til ny Clojure-løsning på Cryptocraphic Cipher

En "non-brute" løsning!

error: pathspec 'cryptocraphic_cipher/larstvei2.clj' did not match any file(s) known to git

--- cryptocraphic_cipher/larstvei2.clj
+++ cryptocraphic_cipher/larstvei2.clj
@@ -0,0 +1,24 @@
+(import 'java.util.Base64)
+
+(def signature [0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A])
+
+(defn decode64 [s]
+  (->> (.decode (Base64/getMimeDecoder) s)
+       (map (comp #(mod % 256) (partial + 256)))))
+
+(defn decode [img key]
+  (map bit-xor key img))
+
+(defn smallest-cycle [s]
+  (let [keys (map #(take % s) (range 1 (count s)))]
+    (-> (comp (partial = s) (partial take 8) cycle)
+        (filter keys) first)))
+
+(defn get-key [img]
+  (smallest-cycle (decode signature img)))
+
+(let [img (decode64 (slurp *in*))
+      key (get-key img)]
+  (println (apply str (map char key)))
+  (with-open [w (clojure.java.io/output-stream "out.png")]
+    (.write w (byte-array (decode img (cycle key))))))


Add initial implementation of transactions management.

The current approach does not manages the concurrency. Is a
absolutly dummy implementation as initial step.

error: pathspec 'src/continuo/postgresql/transaction.clj' did not match any file(s) known to git

--- src/continuo/postgresql/transaction.clj
+++ src/continuo/postgresql/transaction.clj
@@ -0,0 +1,128 @@
+;; Copyright 2015 Andrey Antukh <niwi@niwi.nz>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
+(ns continuo.postgresql.transaction
+  (:require [suricatta.core :as sc]
+            [taoensso.nippy :as nippy]
+            [continuo.postgresql.schema :as schema]
+            [continuo.util.template :as tmpl]
+            [continuo.util.codecs :as codecs]
+            [continuo.executor :as exec]))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Transaction Identifier
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn get-last-txid
+  "Get the last tx identifier it if exists or return nil."
+  [conn]
+  (let [sql "SELECT id FROM txlog ORDER BY created_at DESC LIMIT 1"]
+    (first (sc/fetch-one conn sql))))
+
+(defn get-next-txid
+  "Get a next transaction identifier."
+  [conn]
+  (let [lastid (get-last-txid conn)]
+    (if (nil? lastid) 1 (inc lastid))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Facts processing
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defprotocol IOperation
+  (-execute [_ conn txid] "Execute the operation."))
+
+(deftype AddOperation [partition attr value]
+  IOperation
+  (-execute [_ conn txid]
+    (let [table (attrs/-normalized-name attr partition)
+          tmpl  (str "INSERT INTO {{table}} "
+                     "  (eid, txid, modified_at, content)"
+                     "  VALUES (?,?,now(),?)")
+          sql (tmpl/render-string tmpl {:table table})
+          sqlv  [sql eid txid value]]
+      (sc/execute conn sqlv))))
+
+
+(deftype RetractOperation [partition attr value]
+  IOperation
+  (-execute [_ conn txid]
+    (let [table (attrs/-normalized-name attr partition)
+          tmpl  (str "UPDATE {{table}} SET content = ? modified_at = now() "
+                     " WHERE eid = ?")
+          sql   (tmpl/render-string tmpl {:table table})
+          sqlv  [sql value eid]]
+      (sc/execute conn sqlv))))
+
+(deftype DropOperation [partition attr value]
+  IOperation
+  (-execute [_ conn txid]
+    (let [table (attrs/-normalized-name attr partition)
+          tmpl  "DELTE FROM {{table}} WHERE eid = ?"
+          sql   (tmpl/render-string tmpl {:table table})
+          sqlv  [sql eid]]
+      (sc/execute conn sqlv))))
+
+(deftype TxOperation [partition data]
+  IOperation
+  (-execute [_ conn txid]
+    (let [sql ["INSERT INTO txlog (id, part, facts) VALUES (?,?,?)"
+               txid partition data]]
+      (sc/execute conn sql))))
+
+(defn compile-fact
+  "Given a destructured fact, returns a ready to execute
+  operation instance.
+  The operation consists on correctly insert the data in
+  the appropiate default materialized view."
+  [context partition [op eid attrname value]]
+  ;; resolve-attr :: context -> string -> Attribute
+  (let [attr (resolve-attr context attrname)]
+    (case op
+      :db/add (AddOperation. partition eid attr value)
+      :db/retract (RetractOperation. partition eid attr value)
+      :db/drop (DropOperation. partition eid attr value))))
+
+(defn compile-txop
+  [context [partition facts]]
+  (TxOperation. partition (codecs/data->bytes facts))
+
+(defn compile-ops
+  [context partition facts]
+  (let [txop (compile-txop context [partition facts])
+        inops (mapv (partial compile-fact context partition) facts)]
+    (into [txop] inops)))
+
+(defn run-tx
+  "Given an connection and seq of operation objects,
+  execute them in serie."
+  [conn operations]
+  (run! #(-execute % conn) operations))
+
+(defn run-in-tx
+  [conn func]
+  (sc/atomic conn
+    ;; TODO: exclusive share lock
+    (func conn)))
+
+(defn transact*
+  {:internal true}
+  [context partition facts]
+  (let [ops (compile-ops context partition facts)
+        conn (.-connection context)]
+    (run-in-tx conn #(run-tx % ops))))
+
+(defn transact
+  [context facts]
+  (transact* context "user" facts))


Adding an example of body coercion with camel-snake-kebab example

error: pathspec 'examples/body_coercion.clj' did not match any file(s) known to git

--- examples/body_coercion.clj
+++ examples/body_coercion.clj
@@ -0,0 +1,23 @@
+(ns clj-http.examples.body-coercion
+  (:require [clj-http.client :as http]
+            [camel-snake-kebab.core :refer [->kebab-case-keyword]]))
+
+;; register your own body coercers by participating in the coerce-response-body multimethod
+;; dispatch to it by using {:as :json-kebab-keys} as an argument to http client calls
+
+;; this example uses camel-snake-kebab to turn a camel-cased JSON API into
+;; idiomatic kebab-cased keywords in clojure data structures and is much
+;; faster than applying via postwalk or similar
+
+(defmethod http/coerce-response-body :json-kebab-keys [req resp]
+  (http/coerce-json-body req resp (memoize ->kebab-case-keyword) false))
+
+;; example of use; note that in the response, the first field is called userId
+;;
+;; (:body (http/get "http://jsonplaceholder.typicode.com/posts/1" {:as :json-kebab-keys}))
+;; =>
+;; {:user-id 1,
+;;  :id 1,
+;;  :title "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
+;;  :body "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
+;; }


introduction rule for existential quantification

error: pathspec 'src/latte/quant.clj' did not match any file(s) known to git

--- src/latte/quant.clj
+++ src/latte/quant.clj
@@ -0,0 +1,66 @@
+(ns latte.quant
+  "Basic definitions and theorems about the universal
+  and existential quantifiers.
+
+  Note that for the universal quantifier, it is a primitive of the
+  calculus of constructions, hence Latte.
+
+  The elimination rule for ∀ (for all) is application, and introduction
+  is through lambda-abstraction."
+
+  (:require [latte.core :as latte :refer [defterm defthm proof forall
+                                          assume have]])
+  )
+
+
+(defterm exist
+  "The existential quantifier.
+
+`(exist T P)` is commonly denoted by ∃x:T.(P x)
+
+> there exists an `x` of type `T` such that the predicate
+> `P` holds for `x`.
+
+Remark: this is a second-order, intuitionistic definition that
+ is more general than the definition in classical logic."
+  [[T :type] [P (==> T :type)]]
+  (forall [α :type]
+    (==> (forall [x T] (==> (P x) α))
+         α)))
+
+
+(defthm exist-elim
+  "The (intuitionistic) elimination rule for the existential quantifier."
+  [[T :type] [P (==> T :type)] [A :type]]
+  (==> (exist T P)
+       (forall [x T] (==> (P x) A))
+       A))
+
+(proof exist-elim :script
+  (assume [H1 (exist T P)
+           H2 (forall [x T] (==> (P x) A))]
+    (have (a) (==> (forall [x T] (==> (P x) A))
+                   A) :by (H1 A))
+    (have (b) A :by ((a) H2))
+    (qed (b))))
+
+(defthm exist-intro
+  "The introduction rule for the existential quantifier."
+  [[T :type] [P (==> T :type)] [x T]]
+  (==> (P x)
+       (exist T P)))
+
+(proof exist-intro :script
+  (assume [H (P x)
+           A :type
+           y (forall [z T] (==> (P z) A))]
+    (have (a) (==> (P x) A) :by (y x))
+    (have (b) A :by ((a) H))
+    (have (c) (==> (forall [z T] (==> (P z) A))
+                   A) :discharge [y (b)])
+    (have (d) (forall [A :type]
+                (==> (forall [z T] (==> (P z) A))
+                     A)) :discharge [A (c)])
+    (qed (d))))
+
+


Stub for IRC bot

Stub for IRC bot

error: pathspec 'src/clj_mrazik/irc-bot.clj' did not match any file(s) known to git

--- src/clj_mrazik/irc-bot.clj
+++ src/clj_mrazik/irc-bot.clj
@@ -0,0 +1,14 @@
+;
+;  (C) Copyright 2016  Pavel Tisnovsky
+;
+;  All rights reserved. This program and the accompanying materials
+;  are made available under the terms of the Eclipse Public License v1.0
+;  which accompanies this distribution, and is available at
+;  http://www.eclipse.org/legal/epl-v10.html
+;
+;  Contributors:
+;      Pavel Tisnovsky
+;
+
+(ns clj-mrazik.irc-bot)
+


confidence intervals

confidence intervals

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/clojure-ml/cml.git/'


paying the topo-sort piper

paying the topo-sort piper

--- sidecar/src/figwheel_sidecar/core.clj
+++ sidecar/src/figwheel_sidecar/core.clj
@@ -249,49 +249,45 @@
         :eval-body (slurp %)})
    (dependency-files st)))

-
 ;; inlining this for now so that people can use it now

 (defn get-deps [ns]
-  (set
-   (map first
-        (filter
-         (fn [[_ ns-info]]
-           (contains? (:requires ns-info) ns))
-         (get @cljs.env/*compiler* :cljs.analyzer/namespaces)))))
+  (letfn [(parent? [parent [child {:keys [requires] :as ns-info}]]
+             (when-not (= parent child)
+               (cond
+                 (or (map? requires)
+                     (set? requires)) (contains? requires parent)
+                     (vector? requires) (some #{(munge (name parent))} requires))))]
+    (set
+     (map first
+          (filter
+           #(parent? ns %)
+           (get @cljs.env/*compiler* :cljs.analyzer/namespaces))))))
+
+(def ^:dynamic *memo-get-deps* false)
+
+(declare cljs-topo-sort)
+
+(defn sort-and-expand-ns
+  ([deps]
+   (sort-and-expand-ns deps 0 (atom (sorted-map))))
+  ([deps depth state]
+   (swap! state update-in [depth] (fnil into #{}) deps)
+   (doseq [dep deps]
+     (cljs-topo-sort dep (inc depth) state))
+   (doseq [[<depth _] (subseq @state < depth)]
+     (swap! state update-in [<depth] difference deps))
+   (when (= depth 0)
+     (distinct (apply concat (vals @state))))))

 ;; from cljs.util; will use that one in when it hits mainstream
-(defn cljs-topo-sort
-  ([x get-deps]
-    (cljs-topo-sort x 0 (atom (sorted-map)) (memoize get-deps)))
-  ([x depth state memo-get-deps]
-    (let [deps (memo-get-deps x)]
-      (swap! state update-in [depth] (fnil into #{}) deps)
-      (doseq [dep deps]
-        (cljs-topo-sort dep (inc depth) state memo-get-deps))
-      (doseq [[<depth _] (subseq @state < depth)]
-        (swap! state update-in [<depth] difference deps))
-      (when (= depth 0)
-        (distinct (apply concat (vals @state)))))))
-
-(defn create-ns-dependents-fn []
-  (let [mem-deps (memoize get-deps)]
-    (memoize
-     (fn [ns]
-       (set (cljs-topo-sort ns 0 (atom (sorted-map)) mem-deps))))))
-
-;; creating a new memoized fn each time we get a request
-(def ^:dynamic *transitive-dep-fn* false)
-
-(defn topo-compare [nm nm2]
-  (cond
-    (= nm nm2) 0
-    (get (*transitive-dep-fn* nm) nm2) -1
-    (get (*transitive-dep-fn* nm2) nm) 1
-    :else 0))
+(defn cljs-topo-sort [x depth state]
+  (sort-and-expand-ns (*memo-get-deps* x) depth state))

 (defn topo-sort [ns-syms]
-  (vec (sort topo-compare ns-syms)))
+  (let [all-syms (set (map name ns-syms))]
+    (filter #(all-syms (name %))
+            (sort-and-expand-ns ns-syms))))

 (defn mark-changed-ns [state ns-syms]
   (set
@@ -301,29 +297,20 @@
          ns-syms)))

 (defn find-figwheel-always []
-  (set (filter (fn [n] (-> n meta :figwheel-always)) (ana-api/all-ns))))
+  (filter (fn [n] (-> n meta :figwheel-always)) (ana-api/all-ns)))
+
+(defn all-ns-to-load [changed-ns-syms]
+  (set (concat (keep (fn [n] (:name (ana-api/find-ns n))) changed-ns-syms)
+               (find-figwheel-always))))

 (defn expand-to-all-ns [state changed-ns-syms']
   (cond
     (nil? cljs.env/*compiler*) changed-ns-syms'
     (false? (:recompile-dependents state))
-    (topo-sort
-     (union (set (keep (fn [n] (:name (ana-api/find-ns n))) changed-ns-syms'))
-            (set (find-figwheel-always))))
-
+    (topo-sort (all-ns-to-load changed-ns-syms'))
     :else
-    (let [changed-ns-syms       (set (keep (fn [n] (:name (ana-api/find-ns n))) changed-ns-syms'))
-          dependants            (set (mapcat
-                                      *transitive-dep-fn*
-                                      changed-ns-syms))
-          additional-dependents (difference dependants changed-ns-syms)
-          additional-dependents (mark-changed-ns state additional-dependents)
-          all-ns                (union changed-ns-syms additional-dependents)
-          all-names             (set (map name all-ns))
-          additional-always     (set (filter #(not (all-names (name %)))
-                                             (find-figwheel-always)))
-        all-ns'               (union all-ns additional-always)]
-      (topo-sort all-ns'))))
+    ;;     (mark-changed-ns state ) may not be worth it
+    (sort-and-expand-ns (all-ns-to-load changed-ns-syms'))))

 (defn dependents-info [n]
   (vec (ana/ns-dependents n)))
@@ -375,9 +362,9 @@
   ;; this is the new way where if additional changes are needed they
   ;; are made explicitely
   ([state old-mtimes new-mtimes additional-ns]
-   (binding [*transitive-dep-fn* (create-ns-dependents-fn)]
+   (binding [*memo-get-deps* (memoize get-deps)]
      (notify-cljs-ns-changes state
-       (set (concat additional-ns
+       (set (concat additional-ns
                     (keep get-ns-from-source-file-path
                           (:cljs (get-changed-source-file-paths old-mtimes new-mtimes)))))))))


make sure path starts with /

make sure path starts with /

--- sidecar/src/figwheel_sidecar/core.clj
+++ sidecar/src/figwheel_sidecar/core.clj
@@ -205,8 +205,11 @@
   This is a path that a client can request. A caveat is that only works on
   compiled javascript namespaces."
   [{:keys [output-dir] :as state} ns]
-  (let [path (.getPath (bapi/cljs-target-file-from-ns output-dir ns))]
-    (remove-resource-path state path)))
+  (let [path (.getPath (bapi/cljs-target-file-from-ns output-dir ns))
+        p    (remove-resource-path state path)]
+    (if (not= (first p) \/)
+      (str "/" p)
+      p)))

 (defn make-serve-from-display [{:keys [http-server-root] :as opts}]
   (let [paths (relativize-resource-paths opts)]


Make the string->boolean function a `defn`, add docstring

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-authority-works.git/'


Destructuring

Destructuring

error: pathspec 'src/mark-volkmann-tutorial/destructuring.clj' did not match any file(s) known to git

--- src/mark-volkmann-tutorial/destructuring.clj
+++ src/mark-volkmann-tutorial/destructuring.clj
@@ -0,0 +1,66 @@
+;; Destructuring
+;; http://java.ociweb.com/mark/clojure/article.html#Destructuring
+
+; in parameter list of function, or in let/binding
+
+(defn approach1 [numbers]
+  (let [n1 (first numbers)
+        n3 (nth numbers 2)]
+    (+ n1 n3)))
+
+
+; Note the underscore used to represent the
+; second item in the collection which isn't used.
+(defn approach2 [[n1 _ n3]]
+  (+ n1 n3))
+
+(approach1 [4 5 6 7])
+(approach2 [4 5 6 7])
+
+
+; ampersand to reamaining items collection
+(defn name-summary [[name1 name2 &  others]]
+  (println (str name1 ", " name2) "and" (count others) "others"))
+
+(name-summary ["Moe" "Larry" "Curly" "Shemp"])
+
+
+; :as access to all collection
+(defn first-and-third-percentage [[n1 _ n3 :as coll]]
+  (/ (+ n1 n3) (apply + coll)))
+
+(first-and-third-percentage [4 5 6 7])
+
+
+; destructuring on maps
+; its common to use local binding names same as keys
+(defn summer-sales-percentage
+  ; The keywords below indicate the keys whose values
+  ; should be extracted by destructuring.
+  ; The non-keywords are the local bindings
+  ; into which the values are placed.
+;;   [{june :june
+;;     july :july
+;;     august :august
+;;     :as all}]
+  ;; it could simplified
+  [{:keys [june july august]
+    :as all}]
+  (let [summer-sales (+ june july august)
+        all-sales (apply + (vals all))]
+    (/ summer-sales all-sales)))
+
+(def sales { :january 100
+             :ferbruary 200
+             :march 0
+             :april 300
+             :may 200
+             :june 100
+             :july 400
+             :august 500
+             :september 200
+             :october 300
+             :november 400
+             :december 600})
+
+(summer-sales-percentage sales)


use cheshire for parsing in our String->Dict annotation.

--- src/metabase/api/common.clj
+++ src/metabase/api/common.clj
@@ -1,7 +1,7 @@
 (ns metabase.api.common
   "Dynamic variables and utility functions/macros for writing API functions."
-  (:require [clojure.data.json :as json]
-            [clojure.tools.logging :as log]
+  (:require [clojure.tools.logging :as log]
+            [cheshire.core :as json]
             [compojure.core :refer [defroutes]]
             [korma.core :refer :all :exclude [update]]
             [medley.core :refer :all]
@@ -331,7 +331,7 @@
 (defannotation String->Dict
   "Param is converted from a JSON string to a dictionary."
   [symb value :nillable]
-  (try (clojure.walk/keywordize-keys (json/read-str value))
+  (try (clojure.walk/keywordize-keys (json/parse-string value))
        (catch java.lang.Exception _
          (format "Invalid value '%s' for '%s': cannot parse as json." value symb))))


Adds rember*

Adds rember*

error: pathspec 'src/the_little_clojurian/chapter5.clj' did not match any file(s) known to git

--- src/the_little_clojurian/chapter5.clj
+++ src/the_little_clojurian/chapter5.clj
@@ -0,0 +1,24 @@
+(ns the-little-clojurian.chapter5
+  (:require [clojure.test :refer :all]
+            [the-little-clojurian.chapter1 :refer :all]
+            [the-little-clojurian.chapter2 :refer :all]
+            [the-little-clojurian.chapter3 :refer :all]
+            [the-little-clojurian.chapter4 :refer :all]))
+
+(with-test
+  (def rember*
+    (fn [a l]
+      (cond (null? l) '()
+            (atom? (car l)) (cond (eq? (car l) a) (rember* a (cdr l))
+                                  :else (cons (car l)
+                                              (rember* a (cdr l))))
+            :else (cons (rember* a (car l))
+                        (rember* a (cdr l))))))
+
+  (is (= (rember* 'cup '()) '()))
+  (is (= (rember* 'cup '(coffee)) '(coffee)))
+  (is (= (rember* 'cup '(cup)) '()))
+  (is (= (rember* 'cup '(coffee cup)) '(coffee)))
+  (is (= (rember* 'cup '((cup))) '(())))
+  (is (= (rember* 'cup '(coffee (cup) and (another) cup)) '(coffee () and (another))))
+  (is (= (rember* 'sauce '(((tomato sauce)) ((bean) sauce) (and ((flying)) sauce))) '(((tomato)) ((bean)) (and ((flying)))))))


matric

matric

error: pathspec 'src/codingpuzzle/matrix.clj' did not match any file(s) known to git

--- src/codingpuzzle/matrix.clj
+++ src/codingpuzzle/matrix.clj
@@ -0,0 +1,38 @@
+(ns codingpuzzle.matrix
+  (:import (clojure.lang PersistentQueue)))
+
+;You are given an M by N matrix consisting of booleans that represents a board. Each True boolean represents a wall. Each False boolean represents a tile you can walk on.
+;
+;Given this matrix, a start coordinate, and an end coordinate, return the minimum number of steps required to reach the end coordinate from the start. If there is no possible path, then return null. You can move up, left, down, and right. You cannot move through walls. You cannot wrap around the edges of the board.
+;
+;For example, given the following board:
+;
+;[[f, f, f, f],
+;[t, t, f, t],
+;[f, f, f, f],
+;[f, f, f, f]]
+;and start = (3, 0) (bottom left) and end = (0, 0) (top left), the minimum number of steps required to reach the end is 7, since we would need to go through (1, 2) because there is a wall everywhere else on the second row.
+
+(def t false)
+(def f true)
+
+(def board [[f, f, f, f],
+            [t, t, f, t],
+            [f, f, f, f],
+            [f, f, f, f]])
+
+(def start [3, 0])
+(def end [0, 0])
+
+(loop [paths (conj PersistentQueue/EMPTY [start])]
+  (when-not (empty? paths)
+    (let [path (peek paths)
+          [x y] (last path)
+          next-pos (->> [[(dec x) y] [(inc x) y] [x (dec y)] [x (inc y)]]
+                        (remove (set path))
+                        (filter #(get-in board %)))]
+      (cond
+        (some #{end} next-pos) (count path)
+        (seq next-pos) (recur (apply conj (pop paths) (map #(conj path %) next-pos)))
+        :else (recur (pop paths))))))
+; 7


meadow finder solution

meadow finder solution

error: pathspec 'src/main/cljc/clojure_club/meadow_finder/msmith.cljc' did not match any file(s) known to git

--- src/main/cljc/clojure_club/meadow_finder/msmith.cljc
+++ src/main/cljc/clojure_club/meadow_finder/msmith.cljc
@@ -0,0 +1,68 @@
+(ns clojure-club.meadow-finder.msmith
+  (:require [clojure-club.meadow-finder.core :as c]
+            [clojure.pprint :refer [pprint]]))
+
+(defn neighbors [[x y]]
+  (map vector
+       ((juxt identity inc identity dec) x)
+       ((juxt inc identity dec identity) y)))
+
+(defn neighbor? [c1 c2]
+  (some (partial = (take 2 c2)) (neighbors c1)))
+
+(defn add-coord
+  "Turns a 2d seq into a seq with elements of the form [x y val]"
+  [tdvec]
+  (->> tdvec
+       (map-indexed (fn [x row]
+                      (map-indexed (fn [y char]
+                                     [x y char])
+                                   row)))
+       (reduce concat)))
+
+(defn find-clusters [cfn cells]
+  (reduce (fn [clusters cell]
+            (let [clusters-with-cell (group-by (partial some (partial cfn cell)) clusters)]
+              (if (empty? (clusters-with-cell true))
+                ;start a new cluster with the cell
+                (conj clusters [cell])
+                ; merge all clusters that the cell is a part of
+                (conj
+                  (clusters-with-cell nil)
+                  (reduce concat (conj (clusters-with-cell true)
+                                       [cell]))))))
+          #{}
+          cells))
+
+(defn map->meadows [mmap]
+  (->> mmap
+    (map #(clojure.string/split % #""))
+    (add-coord)
+    (filter (fn [[_ _ char]] (= char " ")))
+    (find-clusters neighbor?)))
+
+
+(map->meadows c/meadow-32x32x4)
+
+;; rendering for testing
+(defn assign-unique-marks [meadows]
+  (map-indexed
+    (fn [i group] (map (fn [c] (assoc c 2 (str i))) group))
+    meadows))
+
+(defn overlay [ogmap overlay]
+  (reduce
+    (fn [new-m [x y mark]]
+      (update new-m x #(str (subs % 0 y) mark (subs % (inc y)))))
+    ogmap
+    (mapcat identity overlay)))
+
+
+(defn print-test [mmap]
+  [(->> (map->meadows mmap)
+        (assign-unique-marks)
+        (overlay mmap))
+   mmap])
+
+(print-test c/meadow-2x2-grid)
+(print-test c/meadow-32x32x4)


[WM] give test server a more likely unique port

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/voting-method-http-api.git/'


:source-dir no longer needed

:source-dir no longer needed

--- sidecar/src/figwheel_sidecar/build_hooks/clj_reloading.clj
+++ sidecar/src/figwheel_sidecar/build_hooks/clj_reloading.clj
@@ -67,12 +67,14 @@
                              (when f
                                (let [f (io/file f)]
                                  (annotate-macro-file
-                                  {:source-file f
-                                   :source-dir (.getParentFile f)}))))
+                                  {:source-file f}))))
                            changed-clj-files)
         files-to-reload (get-files-to-reload build-options changed-clj-files)]
     (when (not-empty changed-clj-files)
       (doseq [clj-file files-to-reload]
+        ;; this could be a problem if the file isn't in the require
+        ;; chain
+        ;; it will be loaded anyway
         (load-file (.getCanonicalPath (:source-file clj-file))))
       (let [rel-files (relevant-macro-files
                        (fn [] (map annotate-macro-file (clj-files-in-dirs source-paths)))


[WM DG] Recipient is now a modified user

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-notification-works.git/'


little if-not refactoring

little if-not refactoring

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/wilkerlucio/youtube-looper.git/'


stub web server

stub web server

error: pathspec 'src/ankusha/web.cljs' did not match any file(s) known to git

--- src/ankusha/web.cljs
+++ src/ankusha/web.cljs
@@ -0,0 +1,47 @@
+(ns ankusha.web
+  (:require [cljs.nodejs :as node]
+            [route-map.core :as route]))
+
+(def http (node/require "http"))
+
+(defn swagger [req resp]
+  (.end resp "Swagger"))
+
+(defn not-found [req resp]
+  (let [method (.-method req)
+        url (.-url req)]
+    (.end resp (str  "Resource " method " " url " not found"))))
+
+(defn nodes [req resp]
+  (.end resp "Nodes list"))
+
+(def routes
+  {:GET #'swagger
+   "nodes" {:GET #'nodes}})
+
+(defn handler [req resp]
+  (let [method (.-method req)
+        url (.-url req)]
+    (if-let [rt (route/match [(keyword method) url] routes)]
+      ((:match rt) req resp)
+      (not-found req resp))))
+
+(defonce server (atom nil))
+
+(defn stop []
+  (when-let [s @server]
+    (.close s (fn [_] (println "HTTP server stopped")))))
+
+(defn start []
+  (let [port 8651
+        srv (.createServer http (fn [req resp] (handler req resp)))]
+    (reset! server srv)
+    (.listen srv port (fn [_])
+             (println "Start server on " port))))
+
+(comment
+  (start)
+  (stop)
+  @server
+  )
+


Pass a db to the example server start.

Pass a db to the example server start.

--- src/clojars/main.clj
+++ src/clojars/main.clj
@@ -36,5 +36,5 @@
     (admin/init db)))

 (comment
-  (def server (start-jetty 8080))
+  (def server (start-jetty (jdbc-url (:db config)) 8080))
   (.stop server))


Only one datasource please.

Only one datasource please.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/couragelabs/coachbot.git/'


proper pos test

proper pos test

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tiagoantao/turtle.git/'


more Minimum Coins

more Minimum Coins

Clojure

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/nikai3d/ce-challenges.git/'


Reorganized Child.clj file so that related functions are gathered near each other

--- src/research_clojure/eChild/Child.clj
+++ src/research_clojure/eChild/Child.clj
@@ -14,34 +14,104 @@
   (= x "DEC"))

-(defn Verb_Never
-  [sen]
-  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Verb") (- (.indexOf sen "Never") 1)) ((= (.indexOf sen "Aux") -1))))
+(defn isQuestion
+  [x]
+  (= x "Q"))
+

-
-(defn hasKa
-  [sen]
-  (inSentence? sen "ka"))
-
-
-(defn Aux_Verb
-  [sen]
-  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Aux") (- (.indexOf sen "Verb") 1))))
-
-
-(defn Verb_Aux
-  [sen]
-  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Verb") (- (.indexOf sen "Aux") 1))))
-
-
-(defn Never_Verb
-  [sen]
-  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Never") (.indexOf sen "Verb")) ((= (.indexOf sen "Aux") -1))))
+(defn Verb_tensed
+  [sentence senType]
+  (and (or (isDeclarative senType) (isQuestion senType)) (not (inSentence? sentence "Aux"))))
+
+
+(defn checkForNV01or01VN
+  "Checks if either 'Never Verb 01' or
+  '01 Verb Never' appear in sentence"
+  [sentence checkForNV01]
+
+  (let [n (.indexOf sentence "Never")
+        v (.indexOf sentence "Verb")
+        o (.indexOf sentence "01")]
+
+        (if (and (not= n -1) (not= v -1) (not= o -1))
+          (if checkForNV01
+            (< n v o)
+            (< o v n))
+          false)))
+
+
+(defn S_Aux
+  [sen]
+  (if (isDeclarative (get sen 1))
+    (do (let [i (.indexOf sen "S")]
+          (and (> i 0) (= (+ i 1) (.indexOf sen "Aux")))))
+    false))
+
+
+(defn setSubjPos
+  [grammar sen]
+  (if (and (inSentence? sen "01") (inSentence? sen "S"))
+    ;Check if 01 and S are in the sentence
+    (do (let [first (.indexOf sen "01")]
+         (if (and (> first 0) (< first (.indexOf sen "S")))
+           (assoc grammar 0 1)
+           grammar)))
+    grammar))
+
+
+(defn parameter1
+  [grammar infoList]
+  (if (= (get grammar 0) 0)
+    (setSubjPos grammar (get infoList 2))
+    grammar))
+
+
+(defn setHead_aux1
+  "Checks if both 03 and P are present in the sentence
+  and if they appear sequentially"
+  [infoList initGrammar]
+  (if (and (not= nil (inSentence? (get infoList 2) "03")) (not= nil (inSentence? (get infoList 2) "P")))
+    (do (let [first (.indexOf (get infoList 2) "03")]
+        ;If 03 followed by P
+        (if (and (> first 0) (= (.indexOf (get infoList 2) "P") (+ first 1)))
+          (assoc initGrammar 1 1)
+          initGrammar)))
+    initGrammar))

 (defn isImperative
   [x]
   (= x "IMP"))
+
+
+(defn setHead_aux2
+  "If imperative, make sure Verb directly follow 01"
+  [infoList initGrammar]
+  (if (and (isImperative (get infoList 1)) (inSentence? (get infoList 2) "01") (inSentence? (get infoList 2) "Verb"))
+     (if (= (.indexOf (get infoList 2) "01") (- (.indexOf (get infoList 2) "Verb") 1))
+       (assoc initGrammar 1 1)
+       initGrammar)
+     initGrammar))
+
+
+(defn setHead
+  [infoList grammar]
+  (let [tempGrammar (setHead_aux1 infoList grammar)]
+    (setHead_aux2 infoList tempGrammar)))
+
+
+(defn parameter2
+  [grammar infoList]
+  (if (= (get grammar 1) 0)
+    (setHead infoList grammar)
+    grammar))
+
+
+(defn parameter3
+  [grammar infoList]
+  (if (= (get grammar 2) 0)
+    (setHead infoList grammar)
+    grammar))

 (defn containsTopicalizable
@@ -53,73 +123,6 @@
         m (.indexOf sentence "Adv")]

     (or (= i 0) (= j 0) (= k 0) (= l 0) (= m 0))))
-
-
-(defn isQuestion
-  [x]
-  (= x "Q"))
-
-
-(defn Verb_tensed
-  [sentence senType]
-  (and (or (isDeclarative senType) (isQuestion senType)) (not (inSentence? sentence "Aux"))))
-
-
-(defn checkForNV01or01VN
-  "Checks if either 'Never Verb 01' or
-  '01 Verb Never' appear in sentence"
-  [sentence checkForNV01]
-
-  (let [n (.indexOf sentence "Never")
-        v (.indexOf sentence "Verb")
-        o (.indexOf sentence "01")]
-
-        (if (and (not= n -1) (not= v -1) (not= o -1))
-          (if checkForNV01
-            (< n v o)
-            (< o v n))
-          false)))
-
-
-(defn affixHop_aux1
-  [senType sentence grammar]
-  (if (and (Verb_tensed sentence senType) (checkForNV01or01VN sentence true))
-    (assoc grammar 11 1)
-    grammar))
-
-
-(defn affixHop_aux2
-  [senType sentence grammar]
-  (if (and (Verb_tensed sentence senType) (> (.indexOf sentence "01") 0) (checkForNV01or01VN sentence false))
-    (assoc grammar 11 1)
-    grammar))
-
-
-(defn affixHop
-  "12th parameter"
-  [infoList initGrammar]
-
-  (let [[senType sentence] (subvec infoList 1)]
-
-    (->> initGrammar
-         (affixHop_aux1 senType sentence)
-         (affixHop_aux2 senType sentence))))
-
-
-(defn S_Aux
-  [sen]
-  (if (isDeclarative (get sen 1))
-    (do (let [i (.indexOf sen "S")]
-          (and (> i 0) (= (+ i 1) (.indexOf sen "Aux")))))
-    false))
-
-
-(defn Aux_S
-  [sen]
-  (if (isDeclarative (get sen 1))
-    (do (let [i (.indexOf sen "Aux")]
-          (and (> i 0) (= (+ i 1) (.indexOf sen "S")))))
-    false))

 (defn setObligTopic
@@ -138,6 +141,46 @@
     grammar))

+(defn parameter4
+  [grammar infoList]
+  (if (and (= (get grammar 3) 1) (= (get grammar 5) 1))
+    (setObligTopic infoList grammar)
+    grammar))
+
+
+(defn outOblique
+  "Out of obliqueness order"
+  [sentence]
+  (let [i (.indexOf sentence "01")
+        j (.indexOf sentence "02")
+        k (.indexOf sentence "P")
+        l (.indexOf sentence "03")]
+
+      (cond
+        (and (not= i -1) (not= j -1) (not= k -1) (and (< i j k) (= l (+ k 1)))) false
+        (and (not= i -1) (not= j -1) (not= k -1) (and (< l j i) (= k (+ l 1)))) false
+        (and (not= i -1) (not= j -1) (not= k -1) (not= l -1)) true
+        ;Should never reach this point
+        :else true)))
+
+
+(defn setNullSubj
+  "5th parameter,
+  Only works for full, not
+  necessarily with CHILDES distribution"
+  [infoList grammar]
+  (if (and (isDeclarative (get infoList 1)) (not (inSentence? (get infoList 2) "S")) (outOblique (get infoList 2)))
+    (assoc grammar 4 1)
+    grammar))
+
+
+(defn parameter5
+  [grammar infoList]
+  (if (= (get grammar 4) 0)
+    (setNullSubj infoList grammar)
+    grammar))
+
+
 (defn setNullTopic
   "6th parameter"
   [sentence grammar]
@@ -146,12 +189,26 @@
     grammar))

+(defn parameter6
+  [grammar infoList]
+  (if (= (get grammar 5) 0)
+    (setNullTopic (get infoList 2) grammar)
+    grammar))
+
+
 (defn setWHMovement
   "7th parameter"
   [sentence grammar]
   (if (and (> (.indexOf sentence "+WH") 0) (not (inSentence? sentence "03[+WH]")))
     (assoc grammar 6 0)
     grammar))
+
+
+(defn parameter7
+  [initGrammar infoList]
+  (if (= (get initGrammar 6) 1)
+    (setWHMovement (get infoList 2) initGrammar)
+    initGrammar))

 (defn setPrepStrand
@@ -169,6 +226,12 @@
     grammar))

+(defn parameter8
+  [initGrammar infoList]
+  (if (= (get initGrammar 7) 0)
+    (setPrepStrand (get infoList 2) initGrammar)
+    initGrammar))
+

 (defn setTopicMark
   "9th parameter"
@@ -176,6 +239,13 @@
   (if (inSentence? sentence "WA")
     (assoc grammar 8 1)
     grammar))
+
+
+(defn parameter9
+  [initGrammar infoList]
+  (if (= (get initGrammar 8) 0)
+    (setTopicMark (get infoList 2) initGrammar)
+    initGrammar))

 (defn vToI
@@ -191,6 +261,13 @@
     grammar))

+(defn parameter10
+  [initGrammar infoList]
+  (if (= (get initGrammar 9) 0)
+    (vToI (get infoList 2) initGrammar)
+    initGrammar))
+
+
 (defn iToC_aux1
   "11th parameter auxiliary"
   [g0 g1 g2 sentence grammar]
@@ -199,6 +276,14 @@
     grammar))

+(defn Aux_S
+  [sen]
+  (if (isDeclarative (get sen 1))
+    (do (let [i (.indexOf sen "Aux")]
+          (and (> i 0) (= (+ i 1) (.indexOf sen "S")))))
+    false))
+
+
 (defn iToC_aux2
   "11th parameter auxiliary"
   [g0 g1 g2 sentence grammar]
@@ -207,6 +292,11 @@
     grammar))

+(defn Aux_Verb
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Aux") (- (.indexOf sen "Verb") 1))))
+
+
 (defn iToC_aux3
   [g0 g1 g2 sentence grammar]
   (if (and (= g0 1) (= g1 0) (= g2 1) (Aux_Verb sentence))
@@ -214,6 +304,11 @@
     grammar))

+(defn Verb_Aux
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Verb") (- (.indexOf sen "Aux") 1))))
+
+
 (defn iToC_aux4
   [g0 g1 g2 sentence grammar]
   (if (and (= g0 0) (= g1 1) (= g2 0) (Verb_Aux sentence))
@@ -235,11 +330,26 @@
     grammar))

+(defn hasKa
+  [sen]
+  (inSentence? sen "ka"))
+
+
+(defn Never_Verb
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Never") (.indexOf sen "Verb")) ((= (.indexOf sen "Aux") -1))))
+
+
 (defn iToC_aux7
   [g0 g1 g2 sentence grammar]
   (if (and (= g0 1) (= g1 0) (= g2 0) (or (Never_Verb sentence) (hasKa sentence)))
     (assoc grammar 10 0)
     grammar))
+
+
+(defn Verb_Never
+  [sen]
+  (and (isDeclarative (get sen 1)) (= (.indexOf sen "Verb") (- (.indexOf sen "Never") 1)) ((= (.indexOf sen "Aux") -1))))

 (defn iToC_aux8
@@ -265,163 +375,52 @@
         (iToC_aux7 g0 g1 g2 sentence)
         (iToC_aux8 g0 g1 g2 sentence))))

-
+
+(defn parameter11
+  [initGrammar infoList]
+  (if (= (get initGrammar 10) 1)
+    (iToC (get infoList 2) initGrammar)
+    initGrammar))
+
+
+(defn affixHop_aux1
+  [senType sentence grammar]
+  (if (and (Verb_tensed sentence senType) (checkForNV01or01VN sentence true))
+    (assoc grammar 11 1)
+    grammar))
+
+
+(defn affixHop_aux2
+  [senType sentence grammar]
+  (if (and (Verb_tensed sentence senType) (> (.indexOf sentence "01") 0) (checkForNV01or01VN sentence false))
+    (assoc grammar 11 1)
+    grammar))
+
+
+(defn affixHop
+  "12th parameter"
+  [infoList initGrammar]
+
+  (let [[senType sentence] (subvec infoList 1)]
+
+    (->> initGrammar
+         (affixHop_aux1 senType sentence)
+         (affixHop_aux2 senType sentence))))
+
+
+(defn parameter12
+  [initGrammar infoList]
+  (if (= (get initGrammar 11) 0)
+    (affixHop infoList initGrammar)
+    initGrammar))
+
+
 (defn questionInver
   "13th parameter"
   [sentence grammar]
   (if (inSentence? sentence "ka")
     (assoc grammar 12 0)
     grammar))
-
-
-(defn setSubjPos
-  [grammar sen]
-  (if (and (inSentence? sen "01") (inSentence? sen "S"))
-    ;Check if 01 and S are in the sentence
-    (do (let [first (.indexOf sen "01")]
-         (if (and (> first 0) (< first (.indexOf sen "S")))
-           (assoc grammar 0 1)
-           grammar)))
-    grammar))
-
-
-(defn setHead_aux1
-  "Checks if both 03 and P are present in the sentence
-  and if they appear sequentially"
-  [infoList initGrammar]
-  (if (and (not= nil (inSentence? (get infoList 2) "03")) (not= nil (inSentence? (get infoList 2) "P")))
-    (do (let [first (.indexOf (get infoList 2) "03")]
-        ;If 03 followed by P
-        (if (and (> first 0) (= (.indexOf (get infoList 2) "P") (+ first 1)))
-          (assoc initGrammar 1 1)
-          initGrammar)))
-    initGrammar))
-
-
-(defn setHead_aux2
-  "If imperative, make sure Verb directly follow 01"
-  [infoList initGrammar]
-  (if (and (isImperative (get infoList 1)) (inSentence? (get infoList 2) "01") (inSentence? (get infoList 2) "Verb"))
-     (if (= (.indexOf (get infoList 2) "01") (- (.indexOf (get infoList 2) "Verb") 1))
-       (assoc initGrammar 1 1)
-       initGrammar)
-     initGrammar))
-
-
-(defn setHead
-  [infoList grammar]
-  (let [tempGrammar (setHead_aux1 infoList grammar)]
-    (setHead_aux2 infoList tempGrammar)))
-
-
-(defn parameter1
-  [grammar infoList]
-  (if (= (get grammar 0) 0)
-    (setSubjPos grammar (get infoList 2))
-    grammar))
-
-
-(defn parameter2
-  [grammar infoList]
-  (if (= (get grammar 1) 0)
-    (setHead infoList grammar)
-    grammar))
-
-
-(defn parameter3
-  [grammar infoList]
-  (if (= (get grammar 2) 0)
-    (setHead infoList grammar)
-    grammar))
-
-
-(defn parameter4
-  [grammar infoList]
-  (if (and (= (get grammar 3) 1) (= (get grammar 5) 1))
-    (setObligTopic infoList grammar)
-    grammar))
-
-
-(defn outOblique
-  "Out of obliqueness order"
-  [sentence]
-  (let [i (.indexOf sentence "01")
-        j (.indexOf sentence "02")
-        k (.indexOf sentence "P")
-        l (.indexOf sentence "03")]
-
-      (cond
-        (and (not= i -1) (not= j -1) (not= k -1) (and (< i j k) (= l (+ k 1)))) false
-        (and (not= i -1) (not= j -1) (not= k -1) (and (< l j i) (= k (+ l 1)))) false
-        (and (not= i -1) (not= j -1) (not= k -1) (not= l -1)) true
-        ;Should never reach this point
-        :else true)))
-
-
-(defn setNullSubj
-  "5th parameter,
-  Only works for full, not
-  necessarily with CHILDES distribution"
-  [infoList grammar]
-  (if (and (isDeclarative (get infoList 1)) (not (inSentence? (get infoList 2) "S")) (outOblique (get infoList 2)))
-    (assoc grammar 4 1)
-    grammar))
-
-
-(defn parameter5
-  [grammar infoList]
-  (if (= (get grammar 4) 0)
-    (setNullSubj infoList grammar)
-    grammar))
-
-
-(defn parameter6
-  [grammar infoList]
-  (if (= (get grammar 5) 0)
-    (setNullTopic (get infoList 2) grammar)
-    grammar))
-
-
-(defn parameter7
-  [initGrammar infoList]
-  (if (= (get initGrammar 6) 1)
-    (setWHMovement (get infoList 2) initGrammar)
-    initGrammar))
-
-
-(defn parameter8
-  [initGrammar infoList]
-  (if (= (get initGrammar 7) 0)
-    (setPrepStrand (get infoList 2) initGrammar)
-    initGrammar))
-
-
-(defn parameter9
-  [initGrammar infoList]
-  (if (= (get initGrammar 8) 0)
-    (setTopicMark (get infoList 2) initGrammar)
-    initGrammar))
-
-
-(defn parameter10
-  [initGrammar infoList]
-  (if (= (get initGrammar 9) 0)
-    (vToI (get infoList 2) initGrammar)
-    initGrammar))
-
-
-(defn parameter11
-  [initGrammar infoList]
-  (if (= (get initGrammar 10) 1)
-    (iToC (get infoList 2) initGrammar)
-    initGrammar))
-
-
-(defn parameter12
-  [initGrammar infoList]
-  (if (= (get initGrammar 11) 0)
-    (affixHop infoList initGrammar)
-    initGrammar))

 (defn parameter13


Add fs ns

Add fs ns

error: pathspec 'src/cider_ci/utils/fs.clj' did not match any file(s) known to git

--- src/cider_ci/utils/fs.clj
+++ src/cider_ci/utils/fs.clj
@@ -0,0 +1,20 @@
+; Copyright (C) 2013, 2014 Dr. Thomas Schank  (DrTom@schank.ch, Thomas.Schank@algocon.ch)
+; Licensed under the terms of the GNU Affero General Public License v3.
+; See the "LICENSE.txt" file provided with this software.
+
+(ns cider-ci.utils.fs
+  (:require
+    [cider-ci.utils.debug :as debug]
+    [clj-logging-config.log4j :as logging-config]
+    [clojure.tools.logging :as logging]))
+
+(defn directory? [path]
+  (let [file (clojure.java.io/file path)]
+    (and (.exists file)
+         (.isDirectory file))))
+
+(defn assert-directory [path]
+  (when-not (directory? path)
+    (throw (IllegalStateException. "Directory does not exist."))))
+
+


db-kon hori soberan

db-kon hori soberan

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.zer.git/'


Adding hamming distance

Adding hamming distance

error: pathspec 'src/clj_fuzzy/hamming.clj' did not match any file(s) known to git

--- src/clj_fuzzy/hamming.clj
+++ src/clj_fuzzy/hamming.clj
@@ -0,0 +1,19 @@
+;; -------------------------------------------------------------------
+;; clj-fuzzy Hamming Distance
+;; -------------------------------------------------------------------
+;;
+;;
+;;   Author: PLIQUE Guillaume (Yomguithereal)
+;;   Version: 0.1
+;;
+(ns clj-fuzzy.hamming)
+
+;; Main function
+(defn distance
+  "Compute the Hamming distance between [seq1] and [seq2]."
+  [seq1 seq2]
+  (let [l1 (count seq1)
+        l2 (count seq2)]
+    (when (= l1 l2)
+      (count (remove #(= (first %) (second %))
+                     (partition 2 (interleave seq1 seq2)))))))


Cleanup test

Cleanup test

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tobiasbayer/eureka-client.git/'


Add work exploring the usage of enums

Add work exploring the usage of enums

error: pathspec 'src/beehive/exploration.clj' did not match any file(s) known to git

--- src/beehive/exploration.clj
+++ src/beehive/exploration.clj
@@ -0,0 +1,10 @@
+(ns beehive.exploration
+  (:import (net.uncontended.precipice Failable)))
+
+(def thing
+  (gen-class
+    :name clojure.examples.impl
+    :extends Enum
+    :prefix "test-"
+    :methods []))
+


exclure clojure.core's trampoline in types ns (same as in core ns)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/transwarp.git/'


Adding a failing test

Adding a failing test

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/screen6/bigquery-clj.git/'


Spec out config validation.

Spec out config validation.

error: pathspec 'spec/incise/config_spec.clj' did not match any file(s) known to git

--- spec/incise/config_spec.clj
+++ spec/incise/config_spec.clj
@@ -0,0 +1,32 @@
+(ns incise.config-spec
+  (:require [incise.config :as conf]
+            [speclj.core :refer :all]))
+
+(defn should-contain-bad-manner
+  [message thing]
+  (should-contain message (conf/bad-config-manners thing)))
+
+(describe "config validation"
+  (with base-config (conf/get))
+  (it "the default config is valid" (conf/avow!))
+  (it "requires an in-dir"
+    (should-contain-bad-manner "must have an input directory (in-dir)"
+                               (dissoc @base-config :in-dir)))
+  (it "requires an out-dir"
+    (should-contain-bad-manner "must have an output directory (out-dir)"
+                               (dissoc @base-config :out-dir)))
+  (context "uri-root"
+    (it "is a good when it is a string without a leading or trailing slash"
+      (conf/avow-config! (assoc @base-config :uri-root "jsj")))
+    (it "is a good when it is nil"
+      (conf/avow-config! (assoc @base-config :uri-root nil)))
+    (it "is bad when it is not a string"
+      (should-contain-bad-manner "uri-root must be a string"
+                                 (assoc @base-config :uri-root 1)))
+    (it "is bad when it has a leading or trailing slash"
+      (doseq [bad-path ["/hss" "jsjs/" "/LOL/"]]
+        (should-contain-bad-manner
+          "uri-root must not start or end with a \"/\""
+          (assoc @base-config :uri-root bad-path))))))
+
+(run-specs)


add missing filter on `sel`

add missing filter on `sel`

--- src/metabase/api/card.clj
+++ src/metabase/api/card.clj
@@ -40,7 +40,7 @@
     (checkp (integer? id) "id" (format "id is required parameter when filter mode is '%s'" (name f)))
     (case f
       :database (read-check Database id)
-      :table    (read-check Database (:db_id (sel :one :fields [Table :db_id])))))
+      :table    (read-check Database (:db_id (sel :one :fields [Table :db_id] :id id)))))
   (-> (case (or f :all) ; default value for `f` is `:all`
         :all      (sel :many Card (k/order :name :ASC) (k/where (or {:creator_id *current-user-id*}
                                                                     {:public_perms [> common/perms-none]})))


Convert vote-by-mail-service-test to response-for

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/turbovote-http-api.git/'


Logging for non-problematic send-to-zendesk


Egileak eta etiketak bertan lortu

Egileak eta etiketak bertan lortu


Add api route to upload income verification files

It also updates the application to include the income files

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


Initial commit of a rule for identifying the top-level object properties and creating their corresponding ICE identifiers

error: pathspec 'kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/pre-identifier-merge/step_a-ontology_to_ice/step_a/root_property_identifier_gen.clj' did not match any file(s) known to git

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/pre-identifier-merge/step_a-ontology_to_ice/step_a/root_property_identifier_gen.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/pre-identifier-merge/step_a-ontology_to_ice/step_a/root_property_identifier_gen.clj
@@ -0,0 +1,15 @@
+;; --------------------------------------------------------
+;; --------- Top-Level Object Property Assignment ---------
+;; --------------------------------------------------------
+`{:name "top-level-property-identifier-gen"
+  :description "This rule creates an identifier for each top-level object property and types it as a top-level object property identifier (IAO_EXT_0000308)"
+  :head ((?/id rdf/type ccp/IAO_EXT_0000308) ;; ccp:top-level object property identifer
+         (?/id obo/IAO_0000219 ?/top_level_property)) ;; obo:denotes
+  :reify ([?/id {:ln (:localname ?/top_level_property)
+                 :ns "ccp" :prefix "" :suffix ""}])
+  :sparql-string "select ?top_level_property {
+		  ?top_level_property rdf:type owl:ObjectProperty .
+		  minus{?top_level_property rdfs:subPropertyOf ?class}
+		  minus{?top_level_property owl:deprecated true}
+		}"
+}


updates

updates

error: pathspec 'fonclojure/src/com/matija/atoms_refs_vars.clj' did not match any file(s) known to git

--- fonclojure/src/com/matija/atoms_refs_vars.clj
+++ fonclojure/src/com/matija/atoms_refs_vars.clj
@@ -0,0 +1,98 @@
+(ns com.matija.atoms-refs-vars)
+
+
+; atoms - reference type which associates succession of related values with an identity
+
+(def fred (atom {:cuddle-hunger-level 0
+                 :percent-deteriorated 0}))
+
+(println @fred)
+
+; update fred's value
+
+(swap! fred
+       (fn [current-state]
+         (merge-with + current-state {:cuddle-hunger-level 1})))
+
+(println @fred)
+
+(defn increase-cuddle-hunger-level
+  [current-state new-hunger-level]
+  (update current-state :cuddle-hunger-level + new-hunger-level))
+
+(swap! fred increase-cuddle-hunger-level 15)
+
+(println @fred)
+
+; managing previous states and new states
+
+(let [last-fred-state @fred]
+  (reset! fred {:cuddle-hunger-level 10})
+  (println "Previous fred state = " last-fred-state)
+  (println "Current fred state = " @fred))
+
+; adding WATCHER to atoms
+
+(add-watch fred :cuddle-hunger-level-watcher (fn [key watched old-state new-state]
+                                               (if (> (:cuddle-hunger-level new-state) 10)
+                                                 (do
+                                                   (println "Fred wants to cuddle with you")
+                                                   (println "This message brought to your courtesy of " key))
+                                                 (println "Fred is ok"))))
+
+
+(reset! fred {:cuddle-hunger-level 9})
+(swap! fred increase-cuddle-hunger-level 2)
+
+; vars - associations between symbols and values
+
+; dynamic binding
+(def ^:dynamic *dynamic-var* "matija")
+
+
+(binding [*dynamic-var* "lukkovic"]
+  (println "Dynamic var value = " *dynamic-var*)
+  (binding [*dynamic-var* "ckilama"]
+    (println "Dynamic var value = " *dynamic-var*)))
+
+(println "Dynamic var value = " *dynamic-var*)
+
+
+; convey information out of a function without returning it as argument
+
+(defn rename
+  []
+  (set! *dynamic-var* "matija lukovic"))
+
+(binding [*dynamic-var* nil]
+  (rename)
+  (println *dynamic-var*))
+
+
+; exercises
+
+(def safe-counter (atom 0))
+(doseq [_ (range 5)]
+  (swap! safe-counter inc))
+(println @safe-counter)
+
+(defn quote-word-count
+  [quotes-length]
+  (let [count-map (atom {})
+        tasks (ref [])]
+    (doseq [_ (range quotes-length)]
+      (let [task (future (let [quote (slurp "https://www.braveclojure.com/random-quote")
+                               words (clojure.string/split quote #"\s+")]
+                           (doall (map (fn [key] (swap! count-map (fn [current-state key] (assoc current-state key (inc (get current-state key 0)))) key)) words))))]
+        (dosync
+          (alter tasks conj task)))
+      )
+    (doseq [t @tasks]
+      @t
+      (println (realized? t)))
+    @count-map))
+
+(println (quote-word-count 5))
+
+
+(def )


it-does-not-save-invalid-values, for example -1

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/ben-biddington/solace.git/'


cleanup

cleanup

--- src/metabase/api/common.clj
+++ src/metabase/api/common.clj
@@ -415,21 +415,19 @@
   "Check whether we can read an existing OBJ, or ENTITY with ID."
   ([obj]
    (check-404 obj)
-   (check-403 (if (satisfies? models/ICanReadWrite obj) (models/can-read? obj)
-                  @(:can_read obj)))
+   (check-403 (models/can-read? obj))
    obj)
   ([entity id]
    {:pre [(models/metabase-entity? entity)
           (integer? id)]}
-   (if (satisfies? models/ICanReadWrite entity) (models/can-read? entity id)
+   (if (satisfies? models/ICanReadWrite entity)
        (read-check (entity id)))))

 (defn write-check
   "Check whether we can write an existing OBJ, or ENTITY with ID."
   ([obj]
    (check-404 obj)
-   (check-403 (if (satisfies? models/ICanReadWrite obj) (models/can-write? obj)
-                  @(:can_write obj)))
+   (check-403 (models/can-write? obj))
    obj)
   ([entity id]
    {:pre [(models/metabase-entity? entity)


Begin directory watcher / continuous testing

error: pathspec 'src/main/clojure/com/stuartsierra/lazytest/watch.clj' did not match any file(s) known to git

--- src/main/clojure/com/stuartsierra/lazytest/watch.clj
+++ src/main/clojure/com/stuartsierra/lazytest/watch.clj
@@ -0,0 +1,46 @@
+(ns com.stuartsierra.lazytest.watch
+  (:use [com.stuartsierra.lazytest.attach :only (all-groups)]
+	[com.stuartsierra.lazytest.plan :only (flat-plan)]
+	[com.stuartsierra.lazytest.run :only (run)]
+	[com.stuartsierra.lazytest.report :only (report)]
+	[clojure.contrib.find-namespaces
+	 :only (find-clojure-sources-in-dir
+		read-file-ns-decl)]
+	[clojure.java.io :only (file)])
+  (:import (java.util.concurrent ScheduledThreadPoolExecutor TimeUnit)))
+
+(defn find-sources
+  [dirs]
+  {:pre [(coll? dirs)
+	 (every? (fn [d] (instance? java.io.File d)) dirs)]}
+  (mapcat find-clojure-sources-in-dir dirs))
+
+(defn namespace-for-file [f]
+  (second (read-file-ns-decl f)))
+
+(defn newer-sources [dirs timestamp]
+  (filter #(> (.lastModified %) timestamp) (find-sources dirs)))
+
+(defn newer-namespaces [dirs timestamp]
+  (remove nil? (map namespace-for-file (newer-sources dirs timestamp))))
+
+(defn reload-and-run [dirs timestamp-atom reporter]
+  (try
+    (let [names (newer-namespaces dirs @timestamp-atom)]
+      (when (seq names)
+	(reset! timestamp-atom (System/currentTimeMillis))
+	(println "Reloading" names)
+	(doseq [n names] (remove-ns n))
+	(doseq [n names] (require n))
+	(println "Running examples at" (java.util.Date.))
+	(reporter (run (flat-plan (all-groups))))))
+    (catch Exception e
+      (println "ERROR:" e))))
+
+(defn start [dirs & options]
+  (let [dirs (map file dirs)
+	{:keys [reporter delay], :or {delay 500, reporter report}} options
+	last-run-timestamp (atom 0)
+	runner #(reload-and-run dirs last-run-timestamp reporter)]
+    (doto (ScheduledThreadPoolExecutor. 1)
+      (.scheduleWithFixedDelay runner 0 delay TimeUnit/MILLISECONDS))))


Initial implementation with naive circular-ref resolution

error: pathspec 'src/overcode/introvert.cljs' did not match any file(s) known to git

--- src/overcode/introvert.cljs
+++ src/overcode/introvert.cljs
@@ -0,0 +1,62 @@
+(ns overcode.introvert)
+
+(defn in?
+  "true if seq contains elm"
+  [seq elm]
+  (some #(= elm %) seq)
+  )
+
+(def ->js)
+
+(defn visit [obj visited]
+  "Marks potentially linked objects as visited to handle circular refs."
+  (cond
+   (nil? obj) true
+
+   (vector? obj) true
+   (list?   obj) true
+   (seq?    obj) true
+
+   (in? @visited obj) nil
+   :else (swap! visited conj obj)))
+
+(defn seq->js
+  "Converts a seq-like value into a JS Array."
+  ([obj visited]
+   (if (visit obj visited)
+     (into-array (map #(->js % visited) obj))
+     obj))
+  ([obj] (seq->js obj (atom ()))))
+
+(defn map->js
+  "Converts a mal-like value into a JS Object."
+  ([obj visited]
+   (if (visit obj visited)
+     (let [out (js-obj)]
+       (doall (map (fn [pair]
+                     (let [
+                           key (->js (first pair)  visited)
+                           val (->js (second pair) visited)]
+                       (aset out key val)))
+                   obj))
+       out)
+     obj))
+  ([obj] (map->js obj (atom ()))))
+
+(defn ->js
+  "Converts a cljs data structure into a close JS approximation."
+  ([obj visited]
+   (condp = (type obj)
+     cljs.core/Keyword (name obj)
+     cljs.core/Symbol  (name obj)
+     cljs.core/Atom    (->js @obj visited)
+
+     cljs.core/PersistentVector (seq->js obj visited)
+     cljs.core/IndexedSeq       (seq->js obj visited)
+     cljs.core/LazySeq          (seq->js obj visited)
+
+     cljs.core/PersistentHashSet  (seq->js obj visited)
+     cljs.core/PersistentHashMap  (map->js obj visited)
+     cljs.core/PersistentArrayMap (map->js obj visited)
+     obj))
+  ([obj] (->js obj (atom ()))))


More consistent error messages

More consistent error messages


tighten the binding scope

tighten the binding scope


Fix search for compojure upgrade

Fix search for compojure upgrade

--- src/clojars/web/search.clj
+++ src/clojars/web/search.clj
@@ -52,7 +52,7 @@
            [:td (format-date created)])]])]))

 (defn search [account params]
-  (let [q (params "q")]
-    (if (= (params "format") "json")
+  (let [q (params :q)]
+    (if (= (params :format) "json")
       (json-search q)
       (html-search account q))))


Reorganized specs to be more constitutionally aligned.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/couragelabs/freefrog.git/'


make require objectweb-asm a no-op

make require objectweb-asm a no-op

error: pathspec 'src/insn/objectweb_asm.clj' did not match any file(s) known to git

--- src/insn/objectweb_asm.clj
+++ src/insn/objectweb_asm.clj
@@ -0,0 +1 @@
+(ns ^:no-doc insn.objectweb-asm)


CSV parser function

CSV parser function

error: pathspec 'src/clj/simplection/datasources/csv.clj' did not match any file(s) known to git

--- src/clj/simplection/datasources/csv.clj
+++ src/clj/simplection/datasources/csv.clj
@@ -0,0 +1,14 @@
+(ns simplection.datasources.csv)
+
+(use 'clojure.string)
+
+(defn to-csv [text delimiter]
+  (let [[keys & data] (map #(map trim %)
+                           (map #(split % (re-pattern delimiter))
+                                (split text #"\n|\r|\n\r")))
+        keys (map keyword keys)]
+    (map #(apply sorted-map (interleave keys %)) data)))
+
+(defn from-csv
+  ([text] (to-csv text ","))
+  ([text delimiter] (to-csv text delimiter)))


Add main back.

Add main back.

error: pathspec 'src/postal/main.clj' did not match any file(s) known to git

--- src/postal/main.clj
+++ src/postal/main.clj
@@ -0,0 +1 @@
+(ns postal.main)


Set version to 0.6.0

Set version to 0.6.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject funcool/cats "0.5.0"
+(defproject funcool/cats "0.6.0"
   :description "Category Theory abstractions for Clojure"
   :url "https://github.com/funcool/cats"
   :license {:name "BSD (2 Clause)"
@@ -16,7 +16,7 @@
                              :target "doc/dist/latest/api"
                              :src-uri "http://github.com/funcool/cats/blob/master/"
                              :src-uri-prefix "#L"}
-                   :plugins [[funcool/codeina "0.2.0"]]}
+                   :plugins [[funcool/codeina "0.3.0-SNAPSHOT"]]}
              :bench [:dev {:dependencies [[criterium "0.4.3"]]
                            :main ^:skip-aot benchmarks
                            :jvm-opts ^:replace []


Switch to ClojureScript 1.7.189 to fix compilation warnings

--- project.clj
+++ project.clj
@@ -9,7 +9,7 @@
                  [cljsjs/react-dom "0.14.3-1" :scope "provided"]
                  [cljsjs/react-dom-server "0.14.3-0" :scope "provided"]
                  [org.clojure/clojure "1.7.0" :scope "provided"]
-                 [org.clojure/clojurescript "1.7.170" :scope "provided"]]
+                 [org.clojure/clojurescript "1.7.189" :scope "provided"]]
   :aliases {"ci" ["do"
                   "clean"
                   ["doo" "phantom" "none" "once"]


Upgraded dependencies to fix browser compatibility issues.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/inchingforward/eon.git/'


upgrade korma to 0.3.0-beta5

upgrade korma to 0.3.0-beta5

--- project.clj
+++ project.clj
@@ -24,7 +24,7 @@
    [postgresql/postgresql "8.4-702.jdbc4"]
    [org.apache.tomcat/tomcat-jdbc "7.0.25"]
    [org.clojure/java.jdbc "0.1.1"]
-   [korma "0.3.0-beta3" :exclusions [log4j/log4j] ]
+   [korma "0.3.0-beta5" :exclusions [log4j/log4j] ]
    [lobos "0.8.0"]
    ]
   :dev-dependencies


Version 1.16.1-SNAPSHOT

Version 1.16.1-SNAPSHOT


Exclude org.apache.httpcomponents/httpclient

See: https://github.com/aws/aws-sdk-java/issues/1919

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/voter-registration-works.git/'


Update tools.namespace version.

Update tools.namespace version.

--- project.clj
+++ project.clj
@@ -45,7 +45,7 @@
                                    :target :nodejs
                                    :pretty-print true}}]}

-  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.7"]
+  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]
                                   [org.clojure/clojure "1.6.0"]
                                   [org.clojure/clojurescript "0.0-3058"]
                                   [funcool/cljs-testrunners "0.1.0-SNAPSHOT"]]


Use production API

Use production API

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/physion/ovation-webapi.git/'


bump cljs dep

bump cljs dep

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/transwarp.git/'


rm cljx dep

rm cljx dep

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/ply.git/'


bump version to 2.8.14 (#66)

bump version to 2.8.14 (#66)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/B2W-Digital/pdg-core.git/'


Resolve a very big sum.

Resolve a very big sum.

error: pathspec 'hackerrank/a-very-big-sum.clj' did not match any file(s) known to git

--- hackerrank/a-very-big-sum.clj
+++ hackerrank/a-very-big-sum.clj
@@ -0,0 +1,9 @@
+; https://www.hackerrank.com/challenges/a-very-big-sum
+(use '[clojure.string :only (split triml)])
+
+(let [n_t (read-line)
+      n (Integer/parseInt n_t)
+      arr_temp (read-line)
+      arr_t (split arr_temp #"\s+")
+      arr (map #(Integer/parseInt %) arr_t)]
+  (println(reduce + arr)))


a cljs test

a cljs test

error: pathspec 'test/midje/cljs/t_basic.clj' did not match any file(s) known to git

--- test/midje/cljs/t_basic.clj
+++ test/midje/cljs/t_basic.clj
@@ -0,0 +1,6 @@
+(ns ^{:cljs-ns 'midje.cljs.basic
+      :cljs-file "midje/cljs/basic.cljs"}
+  midje.cljs.t-basic
+  (:use [midje.sweet]))
+
+(fact (doubler 5) => 10)


fix namespace

fix namespace

error: pathspec 'src/babel/repair.clj' did not match any file(s) known to git

--- src/babel/repair.clj
+++ src/babel/repair.clj
@@ -0,0 +1,65 @@
+(ns italianverbs.repair)
+
+(require '[babel.writer :refer [fill-by-spec fill-verb]])
+(require '[babel.english :refer :all])
+(require '[babel.korma :refer :all])
+(require '[clojure.tools.logging :as log])
+(require '[dag-unify.core :refer [unify]])
+(require '[korma.core :refer :all])
+(require '[korma.db :refer :all])
+
+(defn process [ & units]
+  (do
+    (exec-raw "TRUNCATE expression_import")
+    (.size (map (fn [unit]
+           (.size (map (fn [member-of-unit]
+                         (do
+                           (if (:sql member-of-unit)
+                             (do
+                               (println (str "doing sql: " (:sql member-of-unit)))
+                               (exec-raw (:sql member-of-unit))))
+
+                           (if (:fill member-of-unit)
+                             (let [count (or (->> member-of-unit :fill :count) 10)]
+                               (println (str "doing fill-by-spec: " (->> member-of-unit :fill :spec)
+                                             "; count=" count))
+                               (fill-by-spec
+                                (->> member-of-unit :fill :spec)
+                                count
+                                "expression_import"
+                                (->> member-of-unit :fill :source-model)
+                                (->> member-of-unit :fill :target-model))))
+                           (if (:fill-verb member-of-unit)
+                             (do
+                               (println (str "doing fill-verb: " (:fill-verb member-of-unit)))
+                               (let [verb (:fill-verb member-of-unit)]
+                                 (.size (fill-verb
+                                         (:fill-verb member-of-unit)
+                                         (if (:count member-of-unit)
+                                           (:count member-of-unit)
+                                           1)
+                                         (->> member-of-unit :fill-verb :source-model)
+                                         (->> member-of-unit :fill-verb :target-model))))))))
+                       unit)))
+         units))
+    (exec-raw ["SELECT count(*) FROM expression_import"] :results)
+
+    (exec-raw "DROP TABLE IF EXISTS expression_distinct")
+
+    (exec-raw "CREATE TABLE expression_distinct (
+    language text,
+    model text,
+    surface text,
+    structure jsonb,
+    serialized text)")
+
+    (exec-raw "INSERT INTO expression_distinct (language,model,surface,structure,serialized)
+         SELECT DISTINCT language,model,surface,structure,serialized
+                    FROM expression_import")
+
+    (exec-raw "INSERT INTO expression (language,model,surface,structure,serialized)
+                    SELECT language,model,surface,structure,serialized
+                      FROM expression_distinct")
+    ))
+
+;; (process accompany care fornire indossare moltiplicare recuperare riconoscere riscaldare)


some sketches on automated instruction building

error: pathspec 'test/push/design_spikes/auto_instructions.clj' did not match any file(s) known to git

--- test/push/design_spikes/auto_instructions.clj
+++ test/push/design_spikes/auto_instructions.clj
@@ -0,0 +1,41 @@
+(ns push.design-spikes.auto-instructions
+  (:use midje.sweet)
+  (:use push.interpreter))
+
+;; This is a design spike. That means it's NOT TO BE USED.
+;; IT'S A SKETCH.
+
+(def rgba { :typename :rgba
+            :signature {:red :integer
+                        :green :integer
+                        :blue :integer
+                        :alpha :float}})
+
+(defn make-setter
+  [newtype argument argtype]
+  (let [funcname (str (name newtype) "_set_" (name argument) "_from_" (name argtype))]
+    funcname
+  ))
+
+(defn make-getter
+  [newtype argument argtype]
+  (let [funcname (str (name newtype) "_get_" (name argument))]
+    funcname
+  ))
+
+
+(fact "make-setter makes a setter"
+  (make-setter :rgba :red :integer) => "rgba_set_red_from_integer")
+
+(fact "make-getter makes a getter"
+  (make-getter :rgba :red :integer) => "rgba_get_red")
+
+(defn all-setters-n-getters
+  [newtype]
+  (let [n (:typename newtype)]
+    (sort (flatten
+      (map (fn [[k v]] [(make-setter n k v) (make-getter n k v)]) (:signature newtype))))))
+
+
+(fact "all-s-n-gs does the thing"
+  (all-setters-n-getters rgba) => '("rgba_get_alpha" "rgba_get_blue" "rgba_get_green" "rgba_get_red" "rgba_set_alpha_from_float" "rgba_set_blue_from_integer" "rgba_set_green_from_integer" "rgba_set_red_from_integer"))


epub edukia lortu

epub edukia lortu

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.bez.git/'


add filestore cljs  test

add filestore cljs  test

error: pathspec 'test/konserve/filestore_test.cljs' did not match any file(s) known to git

--- test/konserve/filestore_test.cljs
+++ test/konserve/filestore_test.cljs
@@ -0,0 +1,70 @@
+(ns konserve.filestore-test
+  (:require [konserve.core :as k]
+            [cljs.test :refer-macros [deftest is testing run-tests async use-fixtures]]
+            [cljs.core.async :as async :refer (take! <! >! put! take! close! chan poll!)]
+            [konserve.filestore :refer [new-fs-store delete-store list-keys]]
+            [cljs.nodejs :as node])
+  (:require-macros [cljs.core.async.macros :refer [go]]))
+
+(defonce fs (node/require "fs"))
+
+(defonce stream (node/require "stream"))
+
+(enable-console-print!)
+
+(defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m]
+  (if (cljs.test/successful? m)
+    (println "Success!")
+    (println "FAIL")))
+
+(use-fixtures :once
+  {:before
+   (fn []
+     (async done
+            (go (delete-store "/tmp/konserve-fs-nodejs-test")
+                (def store (<! (new-fs-store "/tmp/konserve-fs-nodejs-test")))
+                (done))))
+   :after
+   #(do (prn "DONE"))})
+
+(deftest filestore-test
+  (testing "Test the file store functionality."
+    (async done
+           (go
+             (let [folder "/tmp/konserve-fs-nodejs-test"
+                   _      (<! (k/bassoc store :binbar (js/Buffer.from (clj->js (range 10)))))
+                   binbar (atom nil)
+                   _      (<! (k/bget store :binbar #(let [ch   (chan)
+                                                           rs       (:read-stream %)]
+                                                       (.on rs "data" (fn [chunk]
+                                                                        (let [x chunk]
+                                                                          (reset! binbar x))))
+                                                       (.on rs "close" (fn [_]
+                                                                         (prn "closing")
+                                                                         (put! ch true)
+                                                                         (close! ch)))
+                                                       (.on rs "error" (fn [err] (prn err)))
+                                                       ch)))]
+               ;; TODO on-pipe callback
+               (is (= (<! (k/get-in store [:foo]))
+                      nil))
+               (<! (k/assoc-in store [:foo] :bar))
+               (is (= (<! (k/get-in store [:foo]))
+                      :bar))
+               (is (= (<! (list-keys store))
+                      #{{:key :foo, :format :edn} {:key :binbar, :format :binary}}))
+               (<! (k/dissoc store :foo))
+               (is (= (<! (k/get-in store [:foo]))
+                      nil))
+               (is (= (<! (list-keys store))
+                      #{{:key :binbar, :format :binary}}))
+               (is (= (.toString @binbar) (.toString (js/Buffer.from (clj->js (range 10))))))
+               (delete-store folder)
+               (let [store (<! (new-fs-store folder))]
+                 (is (= (<! (list-keys store))
+                        #{})))
+               (done))))))
+
+(run-tests)
+
+


Re-work handlers, routers and dispatchers. More comments

--- src/re_frame/handlers.cljs
+++ src/re_frame/handlers.cljs
@@ -7,81 +7,88 @@
             [cljs.core.async :refer [chan put! <! timeout]]))

-;; -- special handlers ----------------------------------------------------------------------------
-
-;; if true then pause the dispatch loop, generally to give the GUI a chance to sync
-(def wait-one-annimation-frame (atom false))
-
-(defn flush-reagent-handler
-  "Will force reagent to render any pending changes.
-  Useful when a handler is about to hog the CPU for a while and
-  there are pending GUI changes telling the user about progress.
-  Flushes any GUI changes through into the DOM."
-  [_ _]
-  (flush)
-  (reset! wait-one-annimation-frame true))
-
-(def special-handlers {
-     :flush-reagent flush-reagent-handler})
+(defn warn
+  [& args]
+  (.warn js/console (apply str args)))

 ;; -- register of handlers ------------------------------------------------------------------------

-
-(def ^:private id->fn  (atom special-handlers))
-
+(def ^:private id->fn  (atom {}))

 (defn register
   "register a handler for an event"
   [event-id handler-fn]
-  (if (contains? @id->fn event-id)
-    (println "Warning: overwritting an event-handler" event-id))     ;; TODO: more generic logging
-  (swap! id->fn
-         assoc event-id handler-fn))
+  (when (contains? @id->fn event-id)
+    (warn "Overwriting an event-handler" event-id))   ;; allow it, but warn.
+  (swap! id->fn assoc event-id handler-fn))

-;; -- dispatching and routing ---------------------------------------------------------------------
+;; -- The Event Conveyor Belt  --------------------------------------------------------------------
+;; A channel which moves events from dispatch to handlers.
+;;
+;; 1. "dispatch" puts events onto this chan, and
+;; 2. "router" reads from the chan, and calls associated handlers
+;; This enables async handling of events -- which is a good thing.
+(def ^:private event-chan (chan))

-(def ^:private dispatch-chan  (chan))

-(defn dispatch
-  "components send events by calling this function.
-  Usage example:
-     (dispatch [:delete-item 42])"
-  [event-v]
-  (assert (some? event-v))         ;; nil would close the channel
-  (put! dispatch-chan event-v))
+;; -- router --------------------------------------------------------------------------------------

-(defn dispatch-sync
-  "sync version of above that actually does the dispatch"
+(defn- handle
+  "Look up the handler for the given event, then call it, passing in 2 parameters."
   [event-v]
   (let [event-id    (first-in-vector event-v)
         handler-fn  (get @id->fn event-id)]
-    (assert (some? handler-fn) (str "No event handler registered for event: " event-id ))
-    (handler-fn app-db event-v)))
+    (if (nil? handler-fn)
+      (warn "No event handler registered for event: " event-id )
+      (handler-fn app-db event-v))))

-(defn- router
-  "route an event, arriving on the dispatch channel, to the right handler"
-  []
-  (go-loop []
-      (let [         ;; if a small pause is required   (dispatch [:flush-reagent])
-            _        (if @wait-one-annimation-frame
-                       (do
-                         (reset! wait-one-annimation-frame false)
-                         (<! (timeout 16)))  ;; Wait one annimation frame, which will make sure any pending GUI work is done.
-                       (<! (timeout 0)))   ;; just in case we are handling one dispatch after an other, give the GUI a chance to do its stuff.
-            event-v  (<! dispatch-chan)]
-        (dispatch-sync event-v)
-        (recur))))
-
-;; run the router loop - sending event after event to the handlers
-(router)
+;; In a loop, read events from the dispatch channel, and then call the
+;; right handler.
+;;
+;; Because handlers occupy the CPU, before each event is handled, hand
+;; back control to the GUI render process, via a (<! (timeout 0)) call.
+;;
+;; In odd cases, we need to pause for an entire annimationFrame, to ensure that
+;; the DOM is fully flushed, before calling a handler known to hog the CPU
+;; for an extended period.  In that case the event should have metadata
+;; Example:
+;;   (dispatch ^:flush-dom  [:event-id other params])
+;;
+;; router loop
+(go-loop []
+   (let [event-v  (<! event-chan)                   ;; wait for an event
+         _        (if (:flush-dom (meta event-v))
+                    (do (flush) (<! (timeout 20)))  ;; wait just over one annimation frame (16ms), to rensure all pending GUI work is done.
+                    (<! (timeout 0)))]              ;; just in case we are handling one dispatch after an other, give the GUI a chance to do its stuff.
+     (handle event-v)
+     (recur)))

 ;; -- helper --------------------------------------------------------------------------------------

-;; TODO: this has to go.
+(defn dispatch
+  "reagent components use this function to send events.
+  Usage example:
+     (dispatch [:delete-item 42])"
+  [event-v]
+  (if (nil? event-v)
+    (warn "dispatch is ignoring a nil event.")     ;; nil would close the channel
+    (put! event-chan event-v)))
+
+
+;; TODO: remove sync handling.  I don't like it, even for testing.
+(defn dispatch-sync
+  "sync version of above that actually does the dispatch"
+  [event-v]
+  (handle event-v))
+
+
+;; -- helper --------------------------------------------------------------------------------------
+
+;; TODO: Yuck. this has to go.
 (defn transaction!
   "A helper fucntion to be used when writting event handlers.
   Allows a handler to perform an atomic modification of the atom.


Add missing color style in 'Show completed todos'

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Reefersleep/sleepydo.git/'


Update Cider

Update Cider

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/jamesleonis/dotfiles.git/'


Add language handling for root

Add language handling for root

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/DajanaStiberova/green-recipes.git/'


move create service button to contrls component

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


Add additional check for next button

Add additional check for next button


Clarify test descriptions

Clarify test descriptions

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/scheduled-message-works.git/'


Created new clojure file for compojure routes.

error: pathspec 'src/clj_formal_specifications_app/routes.clj' did not match any file(s) known to git

--- src/clj_formal_specifications_app/routes.clj
+++ src/clj_formal_specifications_app/routes.clj
@@ -0,0 +1 @@
+(ns clj-formal-specifications-app.routes)


add fixture test from clojure core

add fixture test from clojure core

error: pathspec 'test/test_fixtures.clj' did not match any file(s) known to git

--- test/test_fixtures.clj
+++ test/test_fixtures.clj
@@ -0,0 +1,51 @@
+;   NOTE: this test is from http://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/test_fixtures.clj
+;   Copyright (c) Rich Hickey. All rights reserved.
+;   The use and distribution terms for this software are covered by the
+;   Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;   which can be found in the file epl-v10.html at the root of this distribution.
+;   By using this software in any fashion, you are agreeing to be bound by
+;   the terms of this license.
+;   You must not remove this notice, or any other, from this software.
+;
+;;; test_fixtures.clj: unit tests for fixtures in test.clj
+
+;; by Stuart Sierra
+;; March 28, 2009
+
+(ns test-fixtures
+  (:use clojure.test cake))
+
+(declare *a* *b* *c* *d*)
+
+(def *n* 0)
+
+(defn fixture-a [f]
+  (binding [*a* 3] (f)))
+
+(defn fixture-b [f]
+  (binding [*b* 5] (f)))
+
+(defn fixture-c [f]
+  (binding [*c* 7] (f)))
+
+(defn fixture-d [f]
+  (binding [*d* 11] (f)))
+
+(defn inc-n-fixture [f]
+  (binding [*n* (inc *n*)] (f)))
+
+(use-fixtures :once fixture-a fixture-b)
+
+(use-fixtures :each fixture-c fixture-d inc-n-fixture)
+(use-fixtures :each fixture-c fixture-d inc-n-fixture)
+
+(deftest can-use-once-fixtures
+  (is (= 3 *a*))
+  (is (= 5 *b*)))
+
+(deftest can-use-each-fixtures
+  (is (= 7 *c*))
+  (is (= 11 *d*)))
+
+(deftest use-fixtures-replaces
+  (is (= *n* 1)))


kata5: use local functions for calculating position with vector-of-longs

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/schaueho/clojure-codekata.git/'


Removing policies from the Secretary role.

--- spec/freefrog/governance_circles_spec.clj
+++ spec/freefrog/governance_circles_spec.clj
@@ -335,7 +335,17 @@
                                                :text sample-policy-text2})}))
         sample-anchor-with-secretary-policies)))

-  (it "can remove policies")
+  (describe "removing policies"
+    (it "removes Secretary when it is empty"
+      (should= sample-anchor
+        (g/remove-role-policy sample-anchor-with-secretary-policy
+                              g/secretary-name sample-policy-name)))
+
+    (it "doesn't remove Secretary when it isn't empty"
+      (should= sample-anchor-with-secretary-policy
+        (g/remove-role-policy sample-anchor-with-secretary-policies
+                              g/secretary-name sample-policy-name2))))
+
   (it "removes elected roles when they have no additions"))

 (def subcircle-name "Development")


Adds a convinience function to step game

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/govindkrjoshi/minesweeper.git/'


adding new login test for refactoring

adding new login test for refactoring

error: pathspec 'test/cljs/ohds/new-login-test.cljs' did not match any file(s) known to git

--- test/cljs/ohds/new-login-test.cljs
+++ test/cljs/ohds/new-login-test.cljs
@@ -0,0 +1,2 @@
+(ns ohds.new-login-test
+  (:require [ohds.login :as login]))


Handle cancelling the job automatically if GOogle says so.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mtravers/incidents.git/'


fix put membership error

fix put membership error

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/physion/ovation-webapi.git/'


Need to return nil from credentials-fn on failure.

--- src/clojars/web.clj
+++ src/clojars/web.clj
@@ -71,7 +71,7 @@
                  (when (not (empty? password))
                    (swap! attempts dissoc user)
                    {:username user :password password})
-                 (swap! attempts bad-attempt id))))))
+                 (do (swap! attempts bad-attempt id) nil))))))

 (defroutes clojars-app
   (context "/repo" _


Creates main

Creates main

error: pathspec 'src/images/core.clj' did not match any file(s) known to git

--- src/images/core.clj
+++ src/images/core.clj
@@ -0,0 +1,8 @@
+(ns images.core
+  (:require [org.httpkit.server :as s]
+            [images.handler :as h]))
+
+(def port 5123)
+
+(defn -main [args]
+  (s/run-server h/app {:port port}))


Removing logging.

Removing logging.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/inchingforward/eon.git/'


Fixing missing anon function qualifier

Fixing missing anon function qualifier

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/micbie/evemm.git/'


add document/get-by-example method prototype

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/colophon/clarango.git/'


env ns added which contains runtime environment helpers

error: pathspec 'src/clj/hellhound/env.clj' did not match any file(s) known to git

--- src/clj/hellhound/env.clj
+++ src/clj/hellhound/env.clj
@@ -0,0 +1,25 @@
+(ns hellhound.env)
+
+;;;; Runtime Environment helpers ---------------------------
+(defn env
+  "Return the current runtime profile. Possible values
+  `development`, `test`, `production` or any custom
+  envrionment type which provided by `HH_ENV` environment
+  variable. the default value is `:development`."
+  []
+  (keyword (or (System/getenv "HH_ENV") "development")))
+
+(defn development?
+  "Returns `true` if current runtime profile is `:development`."
+  []
+  (= :development (env)))
+
+(defn test?
+  "Returns `true` if current runtime profile is `:test`."
+  []
+  (= :test (env)))
+
+(defn production?
+  "Returns `true` if current runtime profile is `:production`."
+  []
+  (= :production (env)))


lib.koh.xml/parser-client: As we now using browser-parse for RN as well and we rely on xmldom library we have to handle error differently - xmldom returns undefined if undefined/null/"" is passed as a string. In this case we call callback with error

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/artemyarulin/koh.git/'


Find broken geos.

Find broken geos.


Updated snRNA gene type assertion rule to work with ccp ext ontology

error: pathspec 'resources/rules/post_identifier_merge/ice_to_bio/snrna_gene_type_assertions.clj' did not match any file(s) known to git

--- resources/rules/post_identifier_merge/ice_to_bio/snrna_gene_type_assertions.clj
+++ resources/rules/post_identifier_merge/ice_to_bio/snrna_gene_type_assertions.clj
@@ -0,0 +1,21 @@
+;; ---------------------------------------------
+;; --------- snRNA Gene Type Assertion ---------
+;; ---------------------------------------------
+ `{:name "snrna-gene-type-assertion"
+   :description "This rule asserts snRNA gene type"
+   :head ((?/gene rdfs/subClassOf obo/S0_0000274)) ; SO:snRNA
+
+   :body ((?/record rdf/type ccp/IAO_EXT_0000681) ; ccp:NCBI_gene_info_record
+         (?/record obo/BFO_0000051 ?/dna_field_value) ; BFO:has_part
+         (?/gene_field_value rdf/type ccp/IAO_EXT_0000876) ; ccp:NCBI_gene_info_record__gene_identifier_field_value
+         (?/gene_field_value rdf/type ?/gene_ice_id)
+         (?/gene_ice_id obo/IAO_0000219 ?/gene) ; IAO:denotes
+
+         ;; retrieve gene type
+         (?/record obo/BFO_0000051 ?/type_field_value) ; BFO:has_part
+         (?/type_field_value rdf/type ccp/IAO_EXT_0000884) ; ccp:NCBI_gene_info_record__type_of_gene_field_value
+         (?/type_field_value rdf/type ?/type_ice_id)
+         (?/type_ice_id obo/IAO_0000219 ?/type) ; IAO:denotes
+
+         (= ?/type "snRNA"))
+   }


Removed debugging call

Removed debugging call

--- test/cluster_tests.clj
+++ test/cluster_tests.clj
@@ -113,7 +113,7 @@
             (- (:dist (most-distal data clusts)) 1.37436854)
             0.0001)))))

-(use-debuggers)
+
 (deftest uniqify-clusters-test
   (let [last-clusts [{:id 1 :members ["p1"] :center [1 1  1]}
                      {:id 2 :members ["p2"] :center [1 1  1]}


Adds font-icon page.

Adds font-icon page.

error: pathspec 'src/cljs/reagent_toolbox_docs/components/font_icon.cljs' did not match any file(s) known to git

--- src/cljs/reagent_toolbox_docs/components/font_icon.cljs
+++ src/cljs/reagent_toolbox_docs/components/font_icon.cljs
@@ -0,0 +1,59 @@
+;;;; Copyright © 2017 Flexpoint Tech Ltd
+
+(ns reagent-toolbox-docs.components.font-icon
+  (:require [reagent-toolbox-docs.layout :as layout]
+            [reagent-toolbox-docs.ui :as ui]))
+
+(defn view
+  []
+  (fn []
+    [:article
+     [:h1 "Font Icon"]
+     [:p " The font icon component is used to represent an icon from the "
+      [:a {:href "https://material.io/icons/"} "Google Material Design"]
+      " icon font. React Toolbox does not provide the font icon for you. You need to get the "
+      "icons using whatever method you want. We recommend to import the font and the associated "
+      "CSS from Google Fonts as is specified "
+      [:a {:href "http://google.github.io/material-design-icons/#getting-icons"} "here"] "."]
+
+     [ui/display-and-eval-code
+      "(defn font-icon-test
+        []
+        (fn []
+          [:span
+           [reagent-toolbox.core/font-icon {:value \"add\"}]
+           [reagent-toolbox.core/font-icon {:value \"favorite\"}]
+           [reagent-toolbox.core/font-icon {:value \"account_circle\"}]
+           [reagent-toolbox.core/font-icon \"star\"]]))
+
+      [font-icon-test]"]
+
+     [:section
+      [:h2 "Properties"]
+
+      [:table
+       [:thead
+        [:tr
+         [:th "Name"]
+         [:th "Type"]
+         [:th "Default"]
+         [:th "Description"]]]
+       [:tbody
+        [:tr
+         [:td [:code "children"]]
+         [:td [:code "string"]]
+         [:td]
+         [:td "The key string for the icon you want to be displayed."]]
+        [:tr
+         [:td [:code "class-name"]]
+         [:td [:code "string"]]
+         [:td [:code "''"]]
+         [:td "The class name to give custom styles such as sizing."]]
+        [:tr
+         [:td [:code "value"]]
+         [:td [:code "string or element"]]
+         [:td]
+         [:td "The key string for the icon you want be displayed."]]]]]]))
+
+(defmethod layout/pages :font-icon [_]
+  [view])


Clj - nth

Clj - nth

error: pathspec '4Clojure/21.nth_element.clj' did not match any file(s) known to git

--- 4Clojure/21.nth_element.clj
+++ 4Clojure/21.nth_element.clj
@@ -0,0 +1,6 @@
+;;  Write a function which returns the Nth element from a sequence.
+;;  No nth
+(fn [array n]
+  (if (= 0 n)
+    (first array)
+    (recur (rest array) (dec n))))