Updating deps

Updating deps

--- build.boot
+++ build.boot
@@ -4,10 +4,10 @@
  :dependencies
  '[[adzerk/boot-cljs "1.7.228-2" :scope "test"]
    [adzerk/boot-cljs-repl "0.3.3" :scope "test"]
-   [adzerk/boot-reload "0.4.12" :scope "test"]
+   [adzerk/boot-reload "0.4.13" :scope "test"]
    [adzerk/boot-test "1.1.2" :scope "test"]
-   [binaryage/devtools "0.8.2" :scope "test"]
-   [boot-codox "0.10.0" :scope "test"]
+   [binaryage/devtools "0.8.3" :scope "test"]
+   [boot-codox "0.10.1" :scope "test"]
    [cljsjs/clipboard "1.5.9-0"]
    [cljsjs/react "15.3.1-0"]
    [cljsjs/react-bootstrap "0.29.2-0"]
@@ -17,23 +17,23 @@
    [com.cognitect/transit-cljs "0.8.239"]
    [com.stuartsierra/component "0.3.1"]
    [com.taoensso/timbre "4.7.4"]
-   [crisptrutski/boot-cljs-test "0.2.2-SNAPSHOT" :scope "test"]
+   [crisptrutski/boot-cljs-test "0.2.2" :scope "test"]
    [danielsz/boot-autoprefixer "0.0.8"]
    [datascript "0.15.4"]
    [deraen/boot-sass "0.3.0" :scope "test"]
-   [devcards "0.2.1-7" :scope "test"]
+   [devcards "0.2.2" :scope "test"]
    [hashobject/boot-s3 "0.1.2-SNAPSHOT" :scope "test"]
    [hiccup "1.0.5"]
-   [org.clojure/clojure "1.9.0-alpha13"]
-   [org.clojure/clojurescript "1.9.225"]
-   [org.clojure/core.async "0.2.391"]
+   [org.clojure/clojure "1.9.0-alpha14"]
+   [org.clojure/clojurescript "1.9.293"]
+   [org.clojure/core.async "0.2.395"]
    [org.clojure/test.check "0.9.0"]
    [org.clojure/tools.nrepl "0.2.12" :scope "test"]
    [org.martinklepsch/boot-gzip "0.1.2" :scope "test"]
-   [org.slf4j/slf4j-nop "1.7.13" :scope "test"]
+   [org.slf4j/slf4j-nop "1.7.21" :scope "test"]
    [org.webjars/bootstrap-sass "3.3.7"]
-   [org.webjars/font-awesome "4.6.3"]
-   [pandeiro/boot-http "0.7.3" :scope "test"]
+   [org.webjars/font-awesome "4.7.0"]
+   [pandeiro/boot-http "0.7.6" :scope "test"]
    [perun "0.3.0" :scope "test"]
    [posh "0.3.5"]
    [reagent "0.6.0"]
@@ -192,6 +192,7 @@
         (build-html :metadata-file (str "perun.base." environment ".edn"))
         (build-css)
         (gzip :regex #{#"\.html$" #"\.css$" #"\.js$"})
+        ;; Fileset gets confused without move to *.orig
         (sift :move {#"^(.*)\.html$" "$1.html.orig"
                      #"^(.*)\.css$" "$1.css.orig"
                      #"^(.*)\.js$" "$1.js.orig"})


Upgrade http-kit

Upgrade http-kit

--- build.boot
+++ build.boot
@@ -16,7 +16,7 @@
                  [org.optaplanner/optaplanner-core "6.4.0.Final" :exclusions [commons-io commons-codec]]
                  [ring/ring-defaults "0.2.0"]
                  [org.clojure/tools.namespace "0.3.0-alpha3"]
-                 [org.danielsz/system "0.3.1"]
+                 [org.danielsz/system "0.3.1" :exclusions [http-kit]]
                  [de.ubercode.clostache/clostache "1.4.0"]
                  [com.taoensso/sente "1.8.1"]

@@ -28,7 +28,7 @@
                  [org.xerial/sqlite-jdbc "3.8.11.2"]
                  [korma "0.4.2"]

-                 [http-kit "2.1.19"]
+                 [http-kit "2.3.0"]
                  [bouncer "1.0.0"]
                  [ring/ring-json "0.4.0"]
                  [org.clojure/data.json "0.2.6"]


Remove tablesort

Remove tablesort

--- build.boot
+++ build.boot
@@ -27,14 +27,6 @@
     :url (str "https://github.com/Semantic-Org/Semantic-UI/archive/" +ver+ ".zip")
     :unzip true))

-(deftask download-tablesort []
-  (download
-    :url (str "http://semantic-ui.com/javascript/library/tablesort.js")))
-
-(deftask download-tablesort-min []
-  (download
-    :url (str "http://semantic-ui.com/javascript/library/tablesort.min.js")))
-
 (deftask package5 []
   (task-options! pom { :project 'exicon/hoplon5-semantic-ui })
   (comp
@@ -50,8 +42,6 @@
 (deftask package []
   (comp
     (download-semantic-ui)
-    (download-tablesort)
-    (download-tablesort-min)
     (sift :move
           {
            #"^Semantic-UI-.*/dist/semantic.css" "cljsjs/development/semantic-ui.inc.css"
@@ -60,9 +50,6 @@
            #"^Semantic-UI-.*/dist/semantic.min.js" "cljsjs/production/semantic-ui.min.inc.js"
            #"^Semantic-UI-.*/dist/themes/" "cljsjs/common/themes/"
            #"semantic-ui.ext.js" "cljsjs/common/semantic-ui.ext.js"
-           #"tablesort.js" "cljsjs/development/tablesort.inc.js"
-           #"tablesort.min.js" "cljsjs/production/tablesort.min.inc.js"
-           #"tablesort.ext.js" "cljsjs/common/tablesort.ext.js"
            })
     (sift :include #{#"^cljsjs"})
     (deps-cljs :name "exicon.semantic-ui"


Add bootlaces [skip ci]

Add bootlaces [skip ci]

--- build.boot
+++ build.boot
@@ -10,6 +10,7 @@
                     [adzerk/boot-cljs-repl       "0.3.3"     :scope "test"]
                     [crisptrutski/boot-cljs-test "0.3.0"     :scope "test"]
                     [boot-codox                  "0.10.3"    :scope "test"]
+                    [adzerk/bootlaces            "0.1.13"    :scope "test"]

                     [me.raynes/conch             "0.8.0"     :scope "test"]
                     [com.cemerick/piggieback     "0.2.1"     :scope "test"]
@@ -17,9 +18,11 @@
                     [org.clojure/tools.nrepl     "0.2.12"    :scope "test"]
                     [viebel/codox-klipse-theme   "0.0.4"     :scope "test"]])

+(def +version+ "0.6.0")
+
 (task-options!
-  pom {:project 'moxaj/mikron
-       :version "0.5.0"})
+  pom  {:project 'moxaj/mikron
+        :version +version+})

 (require '[clojure.java.io :as io]
          '[clojure.pprint :as pprint]
@@ -31,6 +34,7 @@
          '[adzerk.boot-reload :as boot-reload]
          '[adzerk.boot-cljs :as boot-cljs]
          '[adzerk.boot-cljs-repl :as boot-cljs-repl]
+         '[adzerk.bootlaces :as bootlaces]
          '[crisptrutski.boot-cljs-test :as boot-cljs-test]
          '[me.raynes.conch.low-level :as conch]
          '[codox.boot :as boot-codox]
@@ -38,6 +42,8 @@
          '[mikron.core :as mikron])

 (import '[java.util Date])
+
+(bootlaces/bootlaces! +version+ :dont-modify-paths? true)

 ;; Util

@@ -63,13 +69,6 @@
   "Returns a task which runs the args as a shell command."
   [& args]
   (with-pass-thru _ (host-process (apply conch/proc args))))
-
-(deftask build
-  "Builds the project."
-  []
-  (comp (pom)
-        (jar)
-        (install)))

 (deftask testing
   "Adds the test files to the fileset."


[#1276] Enable eastwood plugin

[#1276] Enable eastwood plugin

--- backend/project.clj
+++ backend/project.clj
@@ -44,7 +44,8 @@
   ;; :pedantic? :abort
   :plugins [[lein-ancient "0.6.15"]
             [lein-codox "0.9.6"]
-            [lein-environ "1.0.3"]]
+            [lein-environ "1.0.3"]
+            [jonase/eastwood "0.2.5"]]
   :codox {:doc-paths   ["resources/akvo/lumen/doc"]
           :output-path "../docs"}
   :main ^:skip-aot akvo.lumen.main


Try slightly newer lambdacd dependency as well to maybe coax travis-ci into not failing for insecure repos in a way that can't be reproduced locally

--- backend/project.clj
+++ backend/project.clj
@@ -4,7 +4,7 @@
   :license {:name "Apache License 2.0"
             :url  "http://www.apache.org/licenses/LICENSE-2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [lambdacd "0.13.3"]
+                 [lambdacd "0.13.4"]
                  [compojure "1.6.0"]
                  [http-kit "2.3.0"]
                  [org.clojure/data.json "0.2.6"]


uncomment the transfer

uncomment the transfer

--- src/clj/neb/core.clj
+++ src/clj/neb/core.clj
@@ -47,8 +47,8 @@
                                       cluster-configs))
               {:keys [trunks-size]} cluster-configs
               {:keys [memory-size data-path]} config
-              ;trunks-size (interpret-volume trunks-size)
-              ;memory-size (interpret-volume memory-size)
+              trunks-size (interpret-volume trunks-size)
+              memory-size (interpret-volume memory-size)
               schemas (or (try (:data (ds/get-configure :schemas)) (catch Exception _))
                           (let [s (load-schemas-file (str data-path "/schemas"))]
                             (ds/set-configure :schemas s) s))


Put SVG axis helper ticks in their own g element. This makes it easier to select first/last ticks using CSS.

--- src/cljx/c2/svg.cljx
+++ src/cljx/c2/svg.cljx
@@ -111,12 +111,12 @@

     [:g {:class (str "axis " (name orientation))}
      [:line.rule (apply hash-map (interleave [y1 y2] (:range scale)))]
-
-     (map (fn [d]
-            [:g.tick.major-tick {:transform (translate {x 0 y (scale d)})}
-             [:text {x (* parity text-margin)} (formatter d)]
-             [:line {x1 0 x2 (* parity major-tick-width)}]])
-          ticks)
+     [:g.ticks
+      (map (fn [d]
+             [:g.tick.major-tick {:transform (translate {x 0 y (scale d)})}
+              [:text {x (* parity text-margin)} (formatter d)]
+              [:line {x1 0 x2 (* parity major-tick-width)}]])
+           ticks)]

      (when label
        [:text.label {:transform (str (translate {x (* parity label-margin)


Added checks for NaN and POSITIVE/NEGATIVE INFINITY in keep-number-reasonable.

--- src/clojush/util.clj
+++ src/clojush/util.clj
@@ -81,6 +81,9 @@
       :else n)
     :else
     (cond
+      (Double/isNaN n) 0.0
+      (= n Double/POSITIVE_INFINITY) (* 1.0 max-number-magnitude)
+      (= n Double/NEGATIVE_INFINITY) (* 1.0 (- max-number-magnitude))
       (> n max-number-magnitude) (* 1.0 max-number-magnitude)
       (< n (- max-number-magnitude)) (* 1.0 (- max-number-magnitude))
       (and (< n min-number-magnitude) (> n (- min-number-magnitude))) 0.0


rouge sample

rouge sample

--- src/codemash/kit.clj
+++ src/codemash/kit.clj
@@ -508,7 +508,7 @@

 (ctl seq-mix-s64 :mute 1)

-(def sample-selection [voice-1-s voice-2-s strings-s chords-s dub-s bass-1-s bass-2-s bass-3-s hard-1-s hard-2-s hard-3])
+(def sample-selection [voice-1-s voice-2-s strings-s chords-s dub-s bass-1-s bass-2-s bass-3-s hard-1-s hard-2-s])

 (def seq-mixers (vec (doall (map-indexed (fn [idx _] (add-nk-mixer (nk-bank :lp64) (str "lp64-seq-" idx) seq-mixer-group lp64-b)) sample-selection))))


added verbosity parameter

added verbosity parameter

--- src/crawler/rank.clj
+++ src/crawler/rank.clj
@@ -24,5 +24,3 @@
     (if with-info?
       ranked
       (map #(-> % :xpath) ranked))))
-
-


Check part 2 for correctness

Check part 2 for correctness

--- src/adventofcode/solutions.clj
+++ src/adventofcode/solutions.clj
@@ -581,20 +581,41 @@
       max
       (f
         (map
-         (fn [amounts]
-           (reduce
-             #(map
-               (fn [a b] (+ a b)) % %2) [0 0 0 0 0]
-             (map-indexed
-               (fn [i a]
-                 [(prop-val a i :cap)
-                  (prop-val a i :dur)
-                  (prop-val a i :fla)
-                  (prop-val a i :tex)
-                  (prop-val a i :cal)])
-               amounts)))
-         (filter
-           #(= 100 (apply + %))
-           (take-while
-             #(< (first %) 98)
-             (iterate (odometer-generator 4 1 98) [1 1 1 97]))))))))+          (fn [amounts]
+            (reduce
+              #(map
+                (fn [a b] (+ a b)) % %2) [0 0 0 0 0]
+              (map-indexed
+                (fn [i a]
+                  [(prop-val a i :cap)
+                   (prop-val a i :dur)
+                   (prop-val a i :fla)
+                   (prop-val a i :tex)
+                   (prop-val a i :cal)])
+                amounts)))
+          (filter
+            #(= 100 (apply + %))
+            (take-while
+              #(< (first %) 98)
+              (iterate (odometer-generator 4 1 98) [1 1 1 97]))))))))
+
+(defn- d15-scorer
+  [xs]
+  (reduce
+    (fn [a i]
+      (* a (if (pos? i) i 0)))
+    1
+    (butlast xs)))
+
+(defn day15-part1
+  []
+  (day15-basis (fn [all]
+                 (map
+                   d15-scorer all))))
+(defn day15-part2
+  []
+  (day15-basis (fn [all]
+                 (map d15-scorer
+                      (filter
+                        #(= 500 (last %))
+                        all)))))


squash! Closes #49

squash! Closes #49

--- src/doctopus/web.clj
+++ src/doctopus/web.clj
@@ -137,5 +137,7 @@
 (defn -main
   []
   (let [{:keys [port]} (server-config)]
+    (log/info "Checking DB is set up...")
+    (schema/bootstrap)
     (log/info "Starting HTTP server on port" port)
     (server/run-server application {:port port})))


squash! squash! Closes #49

squash! squash! Closes #49

--- src/doctopus/web.clj
+++ src/doctopus/web.clj
@@ -54,7 +54,6 @@

 ;; Let's start bootstrapping!
 (def doctopus (Doctopus. (server-config) substitutions))
-(bootstrap-heads doctopus)

 (defn serve-index
   [_]
@@ -139,5 +138,7 @@
   (let [{:keys [port]} (server-config)]
     (log/info "Checking DB is set up...")
     (schema/bootstrap)
+    (log/info "Bootstrapping heads")
+    (bootstrap-heads doctopus)
     (log/info "Starting HTTP server on port" port)
     (server/run-server application {:port port})))


a bicycle is unconsumable

a bicycle is unconsumable

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -300,6 +300,7 @@
    "bicycle" {:synsem {:cat :noun
                        :sem {:pred :bicycle
                              :artifact true
+                             :consumable false
                              :place false}}}
    "black"
    (unify adjective


factor out {:cat :verb} into 'common'

factor out {:cat :verb} into 'common'

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -1691,7 +1691,8 @@
                            ;; :pred (i.e. :student) the more common case (c.f. "student")
                            :pred :student}}}
    "put"
-   (let [common {:english {:participle "putting"
+   (let [common {:synsem {:cat :verb}
+                 :english {:participle "putting"
                            :past "put"
                            :present {:3sing "put"}
                            :note "past tense"}}]
@@ -1700,35 +1701,30 @@

       {:unify [common]
        :phrasal-verb true
-       :synsem {:cat :verb
-                :sem {:pred :insult}
+       :synsem {:sem {:pred :insult}
                 :subcat {:2 {:cat :prep
                              :sem {:pred :down}}}}}
       {:unify [common]
        :phrasal-verb true
-       :synsem {:cat :verb
-                :sem {:pred :delay}
+       :synsem {:sem {:pred :delay}
                 :subcat {:2 {:cat :prep
                              :sem {:pred :off}}}}}
       ;; "put the shoes on"
       {:unify [common]
        :phrasal-verb true
-       :synsem {:cat :verb
-                :sem {:pred :put-on}
+       :synsem {:sem {:pred :put-on}
                 :subcat {:2 {:cat :prep
                              :sem {:pred :on}}}}}

       ;; "put on the shoes"
       {:phrasal-verb true
-       :synsem {:cat :verb
-                :sem {:pred :put-on}
+       :synsem {:sem {:pred :put-on}
                 :subcat {:3 {:cat :prep
                              :sem {:pred :on}}}}}

       {:unify [common]
        :phrasal-verb true
-       :synsem {:cat :verb
-                :sem {:pred :tolerate}
+       :synsem {:sem {:pred :tolerate}
                 :subcat {:2 {:cat :prep
                              :sem {:pred :up-with}}}}}])


"there" is not singular (could be either singular or plural)

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2172,8 +2172,7 @@
                      :case :nom
                      :sem {:null true
                            :pred :existential}
-                     :agr {:person :3rd
-                           :number :sing}}}
+                     :agr {:person :3rd}}}
    "they"
    [;; human
     {:english {:note "♂"}


+comments

+comments

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -23,6 +23,8 @@
 (def lexicon-source
   {

+   ;; useful meta-lexeme for debugging generation or parsing -
+   ;;    modify its constraints as you prefer for what you are trying to debug.
    "_"
    (unify agreement-noun
           common-noun


s/merge/unify/

s/merge/unify/

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -867,10 +867,10 @@
                             :passato "detto"
                             :future-stem "dir"
                             :present {:2plur "dite"}}}]
-               [(merge shared-part-of-dire
-                       {:synsem {:pred :say}})
-                (merge shared-part-of-dire
-                       {:synsem {:pred :tell}})])
+               [(unify shared-part-of-dire
+                       {:synsem {:sem {:pred :say}}})
+                (unify shared-part-of-dire
+                       {:synsem {:sem {:pred :tell}}})])

       "divertirsi" (let [subject-semantics (ref {:human true})
                          subject-agr (ref :top)]


Increasing wait log information to include response

--- test/kixi/integration/base.clj
+++ test/kixi/integration/base.clj
@@ -140,7 +140,7 @@
        (if-not (= 200 (:status md))
          (do
            (when (zero? (mod cnt every-count-tries-emit))
-             (prn (str "Waited " cnt " times for " url)))
+             (prn (str "Waited " cnt " times for " url ". Getting: " md)))
            (Thread/sleep wait-per-try)
            (recur url tries (inc cnt) md))
          md))


Sequential order is not guaranteed

Sequential order is not guaranteed

--- test/onyx/log/curator_test.clj
+++ test/onyx/log/curator_test.clj
@@ -40,9 +40,9 @@

         (facts "Check sequential children can be found"
                (fact
-                 (cu/children client2 "/ab/zd/hi" :watcher (fn [_] (swap! watcher-sentinel inc)))
+                 (sort (cu/children client2 "/ab/zd/hi" :watcher (fn [_] (swap! watcher-sentinel inc))))
                  =>
-                 ["entry-0000000000"  "entry-0000000001"  "entry-0000000002"  "entry-0000000003"]))
+                 (sort ["entry-0000000000"  "entry-0000000001"  "entry-0000000002"  "entry-0000000003"])))

         ;; add another child so watcher will be triggered
         (cu/create client2 "/ab/zd/hi/entry-" :sequential? true :persistent? true)
@@ -56,8 +56,8 @@

         (facts "Check only sequential persistent children remain"
                (fact
-                 (cu/children client3 "/ab/zd/hi") =>
-                 ["entry-0000000000" "entry-0000000002" "entry-0000000004"]))
+                 (sort (cu/children client3 "/ab/zd/hi")) =>
+                 (sort ["entry-0000000000" "entry-0000000002" "entry-0000000004"])))

         (cu/create client3 "/ab2" :data (into-array Byte/TYPE value) :persistent? true)


Fix expected replicas in tests

Fix expected replicas in tests

--- test/onyx/plugin/input_log.clj
+++ test/onyx/plugin/input_log.clj
@@ -3,34 +3,37 @@
             [midje.sweet :refer :all]))

 (fact "Allocate from scratch"
-      (kl/allocate-partition {:allocations {:task-a [:peer-3]}}
+      (kl/allocate-partition {:allocations {:job-1 {:task-a [:peer-3]}}}
                              {:n-partitions 5
+                              :job-id :job-1
                               :task-id :task-a
                               :peer-id :peer-3})
       =>
-      {:task-metadata {:task-a {:peer-3 0}}
-       :allocations {:task-a [:peer-3]}})
+      {:task-metadata {:job-1 {:task-a {:peer-3 0}}}
+       :allocations {:job-1 {:task-a [:peer-3]}}})

 (fact "Allocate, however peer is no longer allocated to task"
-      (kl/allocate-partition {:allocations {:task-a []}}
+      (kl/allocate-partition {:allocations {:job-1 {:task-a []}}}
                              {:n-partitions 5
+                              :job-id :job-1
                               :task-id :task-a
                               :peer-id :peer-3})
       =>
-      {:allocations {:task-a []}})
+      {:allocations {:job-1 {:task-a []}}})

 (fact "Allocate a new peer, deallocate dropped peer"
-      (kl/allocate-partition {:task-metadata {:task-a {:peer-0 1
-                                                       :peer-1 0
-                                                       :peer-2 3}}
-                              :allocations {:task-a [:peer-1
-                                                     :peer-2
-                                                     :peer-3]}}
+      (kl/allocate-partition {:task-metadata {:job-1 {:task-a {:peer-0 1
+                                                               :peer-1 0
+                                                               :peer-2 3}}}
+                              :allocations {:job-1 {:task-a [:peer-1
+                                                             :peer-2
+                                                             :peer-3]}}}
                              {:n-partitions 5
+                              :job-id :job-1
                               :task-id :task-a
                               :peer-id :peer-3})
       =>
-      {:task-metadata {:task-a {:peer-1 0
-                                :peer-2 3
-                                :peer-3 1}}
-       :allocations {:task-a [:peer-1 :peer-2 :peer-3]}})
+      {:task-metadata {:job-1 {:task-a {:peer-1 0
+                                        :peer-2 3
+                                        :peer-3 1}}}
+       :allocations {:job-1 {:task-a [:peer-1 :peer-2 :peer-3]}}})


Bugfix: Incorrect core.match notation

Bugfix: Incorrect core.match notation

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -348,10 +348,10 @@
   [config s]
   {:pre [(string? s)]}
   (if-let [res (t/parse-short-string s)]
-    (match res
+    (match [res]
       ;; Case of a def
       ;;----------------------------------------
-      ([:def gid art v plat ns name] :seq)
+      [([:def gid art v plat ns name] :seq)]
       (let [?res (search config res)]
         (if (e/succeed? ?res)
           (e/succeed (first (e/result ?res)))
@@ -359,7 +359,7 @@

       ;; Case of a ns
       ;;----------------------------------------
-      ([:ns  gid art v plat ns name] :seq)
+      [([:ns  gid art v plat ns] :seq)]
       (let [?res (search config res)]
         (if (e/succeed? ?res)
           (e/succeed (first (e/result ?res)))
@@ -367,6 +367,6 @@

       ;; Default case
       ;;----------------------------------------
-      (_ :seq)
+      [_]
       (e/fail "Unknown parse-short-string result!"))
     (e/fail "Could not parse string!")))


Don't need to file postfix a file

Don't need to file postfix a file

--- src/grimoire/api.clj
+++ src/grimoire/api.clj
@@ -51,8 +51,7 @@
   "Helper for grabbing the handle of a notes file "

   [c thing]
-  (let [h (thing->handle c :notes thing)]
-    (io/file h "notes.md")))
+  (thing->handle c :notes thing))

 (defn- thing->example-handle
   "Helper for getting a file handle for reading and writing a named example."


Started working on only syncing updated domains from remote.

--- src/clj/elephantdb/service.clj
+++ src/clj/elephantdb/service.clj
@@ -3,6 +3,7 @@
   (:import [elephantdb.generated ElephantDB ElephantDB$Iface])
   (:import [elephantdb Shutdownable client])
   (:import [elephantdb.persistence LocalPersistence])
+  (:import [elephantdb.store DomainStore])
   (:require [elephantdb [domain :as domain] [thrift :as thrift] [shard :as shard]])
   (:use [elephantdb config log util hadoop loader]))

@@ -53,6 +54,38 @@
                              (domain/host-shards (domains-info domain)))))
     ))

+(defn domain-needs-update? [local-vs remote-vs]
+  (< (.mostRecentVersion local-vs)
+     (.mostRecentVersion remote-vs)))
+
+(defn use-cache-or-update [domain domains-info global-config local-config]
+  (let [fs (filesystem (:hdfs-conf local-config))
+        lfs (local-filesystem)
+        local-dir (:local-dir local-config)
+        local-domain-root (str (path local-dir domain))
+        remote-path (-> global-config (:domains) (get domain))
+        remote-vs (DomainStore. fs remote-path)
+        local-vs (DomainStore. lfs local-domain-root (.getSpec remote-vs))]
+    (if (domain-needs-update? local-vs remote-vs)
+      (do
+        (doto (local-filesystem) (clear-dir local-domain-root))  ;; clear domain dir first
+        (load-domain fs
+                     local-config
+                     local-domain-root
+                     remote-path
+                     (domain/host-shards (domains-info domain))))
+      ;; use cached domain from local-dir (no update needed)
+      (open-domain local-config
+                   (str (path local-dir domain))
+                   (domain/host-shards (domains-info domain)))
+      )))
+
+(defn sync-data-updated [domains-info global-config local-config]
+  (load-and-sync-status domains-info
+                        (fn [domain]
+                          (use-cache-or-update domain domains-info global-config local-config))))
+
+
 (defn- sync-global [global-config local-config token]
   (log-message "Loading remote data")
   (let [fs (filesystem (:hdfs-conf local-config))
@@ -72,7 +105,24 @@
      ))
     domains-info ))

-
+(defn sync-updated [global-config local-config token]
+  "Only fetch domains from remote if a newer version is available.
+Keep the cached versions of any domains that haven't been updated"
+  (log-message "Loading remote data if necessary, otherwise loading cached data")
+  (let [fs (filesystem (:hdfs-conf local-config))
+        domains-info (init-domain-info-map fs global-config)
+        cache-config (assoc global-config :token token)]
+    (log-message "Domains info: " domains-info)
+    (future
+      (try
+        (sync-data-updated domains-info global-config local-config)
+        (log-message "Caching global config " cache-config)
+        (cache-global-config! local-config cache-config)
+        (log-message "Cached config " (read-cached-global-config local-config))
+        (log-message "Finished loading all updated domains from remote")
+        (catch Throwable t (log-error t "Error when syncing data") (throw t))
+        ))
+    domains-info ))

 (defn sync-local [global-config local-config]
   (log-message "Loading cached data")
@@ -96,12 +146,12 @@
     domains-info
     ))

-;; should delete any domains that don't exist in config as well
+;; should delete any domains that don't exist in config as well
 ;; returns map of domain to domain info and launches futures that will fill in the domain info
 (defn- sync-data [global-config local-config token]
   (if (cache? global-config token)
     (sync-local global-config local-config)
-    (sync-global global-config local-config token)
+    (sync-updated global-config local-config token)
     ))

 (defn- close-lps [domains-info]


Minor bug fixed on db/migration command

Minor bug fixed on db/migration command

--- src/clj/hellhound/tasks/db.clj
+++ src/clj/hellhound/tasks/db.clj
@@ -81,9 +81,10 @@

 (defn make-file-path
   [nsname]
-  (core/in-migrations (clojure.string/replace
-                  (str nsname ".clj")
-                  #"-" "_")))
+  (core/in-migrations
+   (clojure.string/replace
+    (str nsname ".clj")
+    #"-" "_")))

 (defn start-component
   [name]
@@ -167,6 +168,10 @@

 (defn main
   [command & rest]
+  ;; Read and update the migration information from lock file
+  (get-lock)
+
+  ;; Dispatch the command
   (cond
     (= command "migration") (apply new-migrate rest)
     (= command "migrate")   (apply migrate rest)


Fix for using Cloverage (see #77)

Fix for using Cloverage (see #77)

More at
https://github.com/cloverage/cloverage/issues/164#issuecomment-281673566

--- src/clj/memento/routes/api.clj
+++ src/clj/memento/routes/api.clj
@@ -28,7 +28,7 @@

 (defmethod restructure-param :auth-rules
   [_ rule acc]
-  (update-in acc [:middleware] conj [wrap-restricted rule]))
+  (update-in acc [:middleware] conj [`wrap-restricted rule]))

 (defmethod restructure-param :auth-data
   [_ binding acc]


fix snake ladder

fix snake ladder

--- src/clj/xl/snake_or_ladder.clj
+++ src/clj/xl/snake_or_ladder.clj
@@ -60,18 +60,23 @@
         to-rc (fn [k]
                 (let [k1 (dec k)
                       r (int (/ k1 n))
+                      r (- n 1 r)
                       c1 (int (mod k1 n))
-                      c (if (even? r) c1 (- n 1 c1))]
+                      c (if (even? (- n 1 r)) c1 (- n 1 c1))
+                      ;                      _ (println "to-rc [k, r, c]: " [k, r, c])
+                      ]
                   [r c]))
         dest (fn [k]
                (let [[r c] (to-rc k)
-                     _ (println "n: " n ", k: " k ", r: " r ", c: " c)
-                     v (nth (nth table r) c)]
+                     v (nth (nth table r) c)
+                     ;                     _ (println "k: " k ", r: " r ", c: " c ", v: " v)
+                     ]
                  (if (= v -1) k v)
                  )
                )
         ]
     (loop [steps 0 visited #{1} si #{1}]
+      (println "step: " steps ", visited: " visited)
       (let [si1* (set (mapcat (fn [i] (map dest (filter #(<= % n2) (range (inc i) (+ i 7))))) si))
             si1 (set/difference si1* visited)
             new-steps (inc steps)
@@ -92,7 +97,10 @@
                 [-1,15,-1,-1,-1,-1]]
         ]
     (println "steps is " (steps table) " for")
-    (println "table: " table)
+    (println "table: ")
+    (doseq [r (range (count table))]
+            (println (nth table r))
+            )
     )
 )


Fix escaping backslash in cd-decode. Fixes #94.

--- src/cljx/clojuredocs/util.cljx
+++ src/cljx/clojuredocs/util.cljx
@@ -49,7 +49,7 @@
       (= "_.." s) ".."
       :else (-> s
                 (str/replace #"_fs" "/")
-                (str/replace #"_bs" "\\")
+                (str/replace #"_bs" "\\\\")
                 (str/replace #"_q" "?")

                 ;; legacy


resources.cljx edited online with Bitbucket

--- src/cljx/oxylab/resources.cljx
+++ src/cljx/oxylab/resources.cljx
@@ -1,6 +1,6 @@
 (ns oxylab.resources)

 (def resources
-  {:detrit 10.0
-   :soil 10.0
-   :acid 0.0})
+  {:detrit 0.0
+   :soil 0.0
+   :oxygen 0.0})


Add functionality in patterns to handle rejected actions

--- src/clojure/fault/patterns.clj
+++ src/clojure/fault/patterns.clj
@@ -4,7 +4,8 @@
   (:import (fault ServiceExecutor
                   MultipleWriterResilientPromise
                   ResilientPromise
-                  ResilientAction)))
+                  ResilientAction RejectedActionException)
+           (java.util ArrayList)))

 (set! *warn-on-reflection* true)

@@ -19,8 +20,8 @@
   (submit-action [this action-fn timeout-millis]
     (some (fn [[key service]]
             (let [f (service/submit-action service
-                                        (partial action-fn (get context key))
-                                        timeout-millis)]
+                                           (partial action-fn (get context key))
+                                           timeout-millis)]
               (if (identical? :rejected (:status f)) nil f)))
           (load-balancer-fn)))
   (submit-action-map [this key->fn timeout-millis]
@@ -57,26 +58,34 @@
           (map #(nth key-service-tuples %)
                (take service-count (iterate next-fn start-idx))))))))

-(deftype Shotgun [context shotgun-fn]
+(deftype Shotgun [action-count context shotgun-fn]
   ComposedService
   (submit-action [this action-fn timeout-millis]
-    (let [^ResilientPromise promise (MultipleWriterResilientPromise.)]
+    (let [^ResilientPromise promise (MultipleWriterResilientPromise.)
+          rejects (ArrayList. ^long action-count)]
       (doseq [[key service] (shotgun-fn)
               :let [svc-context (get context key)]]
-        (.submitAction ^ServiceExecutor (:service-executor service)
-                       (reify ResilientAction (run [_] (action-fn svc-context)))
-                       promise
-                       timeout-millis))
-      (future/->CLJResilientFuture promise)))
+        (try
+          (.submitAction ^ServiceExecutor (:service-executor service)
+                         (reify ResilientAction (run [_] (action-fn svc-context)))
+                         promise
+                         timeout-millis)
+          (catch RejectedActionException e (.add rejects (.reason e)))))
+      (when (not= (count rejects) action-count)
+        (future/->CLJResilientFuture promise))))
   (submit-action-map [this key->fn timeout-millis]
-    (let [^ResilientPromise promise (MultipleWriterResilientPromise.)]
+    (let [^ResilientPromise promise (MultipleWriterResilientPromise.)
+          rejects (ArrayList. ^long action-count)]
       (doseq [[key service] (shotgun-fn)
               :let [fn (get key->fn key)]]
-        (.submitAction ^ServiceExecutor (:service-executor service)
-                       (reify ResilientAction (run [_] (fn)))
-                       promise
-                       timeout-millis))
-      (future/->CLJResilientFuture promise)))
+        (try
+          (.submitAction ^ServiceExecutor (:service-executor service)
+                         (reify ResilientAction (run [_] (fn)))
+                         promise
+                         timeout-millis)
+          (catch RejectedActionException e (.add rejects (.reason e)))))
+      (when (not= (count rejects) action-count)
+        (future/->CLJResilientFuture promise))))
   (perform-action [this action-fn]
     (throw (UnsupportedOperationException. "Cannot perform action with Shotgun")))
   (perform-action-map [this key->fn]
@@ -87,7 +96,8 @@
         service-count (count key->service)
         rand-fn (fn [] (rand-int service-count))]
     (assert (>= service-count action-count))
-    (->Shotgun context
+    (->Shotgun action-count
+               context
                (if (= service-count action-count)
                  (fn []
                    key-service-tuples)


Comment out unused code

Comment out unused code

--- src/clojure_fabric/channel.clj
+++ src/clojure_fabric/channel.clj
@@ -307,23 +307,10 @@

 ;;;create_deploy_proposal
-(defn create-deploy-proposal
-  "Create  a proposal for transaction. This involves assembling the proposal with the data
-  (chaincodeID, chaincode invocation spec, etc.) and signing it using the private key corresponding
-  to the ECert to sign.
-  Params
-        chaincode_path (string): path to the chaincode to deploy
-        chaincode_name (string): a custom name to identify the chaincode on the chain
-        fcn (string): name of the chaincode function to call after deploy to initiate the state
-        args (string[]): arguments for calling the init function designated by “fcn”
-        sign (Bool): Whether to sign the transaction, default to True
-  Returns
-        (Proposal): The created Proposal instance or None."
-  ([chaincod-path chaincode-name fcn args sign]
-   (create-deploy-proposal core/*channel* chaincod-path chaincode-name fcn args sign))
-  ([channel chaincod-path chaincode-name fcn args sign]
-   ;;; TBD
-   ))
+;;;
+;;; Use proto/make-chaincode-header-extension, proto/make-chaincode-proposal-payload-message,
+;;; and proto/make-chaincode-signed-proposal-message.
+;;; See query-by-chaincode

 ;;;create_transaction_proposal
 (defn create-transaction-proposal
@@ -358,46 +345,20 @@
    (send-chaincode-proposal channel targets signature-policy-envelope :upgrade opts)))

 ;;;send_transaction
-(defn send-transaction
-  "Send a transaction to the chain’s orderer service (one or more orderer endpoints) for consensus
-  and committing to the ledger.
-  This call is asynchronous and the successful transaction commit is notified via a BLOCK or
-  CHAINCODE event. This method must provide a mechanism for applications to attach event listeners
-  to handle “transaction submitted”, “transaction complete” and “error” events.
-
-  Note that under the cover there are two different kinds of communications with the fabric backend
-  that trigger different events to be emitted back to the application’s handlers:
-  - the grpc client with the orderer service uses a “regular” stateless HTTP connection
-        in a request/response fashion with the “broadcast” call. The method implementation should
-        emit “transaction submitted” when a successful acknowledgement is received in the response,
-        or “error” when an error is received
-  - The method implementation should also maintain a persistent connection with the Chain’s event
-        source Peer as part of the internal event hub mechanism in order to support the fabric events
-        “BLOCK”, “CHAINCODE” and “TRANSACTION”. These events should cause the method to emit “complete”
-        or “error” events to the application.
-  Params
-        transaction (Transaction): The transaction object constructed above
-  Returns
-        result (EventEmitter): an handle to allow the application to attach event handlers on “submitted”, “complete”, and “error”."
-  ([transaction]
-   (send-transaction core/*channel* transaction))
-  ([channel transaction]
-   ;;; TBD
-   ))
-
+;;;(Use proto/send-proposal or chaincode/send-system-chaincode-request)

 ;;; create_transaction
-(defn create-transaction
-  "Create a transaction with proposal response, following the endorsement policy.
-  Params
-        proposal_responses ([Transaction_Proposal_Response]): The array of proposal responses received in the proposal call.
-  Returns
-        (Transaction instance): The created transaction object instance."
-  ([proposal-responses]
-   (create-transaction core/*channel* proposal-responses))
-  ([channel proposal-responses]
-   ;;; TBD
-   ))
+;; (defn create-transaction
+;;   "Create a transaction with proposal response, following the endorsement policy.
+;;   Params
+;;         proposal_responses ([Transaction_Proposal_Response]): The array of proposal responses received in the proposal call.
+;;   Returns
+;;         (Transaction instance): The created transaction object instance."
+;;   ([proposal-responses]
+;;    (create-transaction core/*channel* proposal-responses))
+;;   ([channel proposal-responses]
+;;    ;;; TBD
+;;    ))

 ;;;


Teensy holder tweak

Teensy holder tweak

--- src/dactyl_keyboard/dactyl.clj
+++ src/dactyl_keyboard/dactyl.clj
@@ -631,7 +631,7 @@
           (->> (cube 4 teensy-holder-top-length 4)
                (translate [(+ teensy-pcb-thickness 5) teensy-holder-top-offset (+ 1 (/ teensy-width 2))])))
         (translate [(- teensy-holder-width) 0 0])
-        (translate [(- 1) 0 0])
+        (translate [-2 0 0])
         (translate [(first teensy-top-xy)
                     (- (second teensy-top-xy) 1)
                     (/ (+ 6 teensy-width) 2)])


Default size

Default size

--- src/dactyl_keyboard/dactyl.clj
+++ src/dactyl_keyboard/dactyl.clj
@@ -19,7 +19,7 @@
 (def α (/ π 12))                        ; curvature of the columns
 (def β (/ π 36))                        ; curvature of the rows
 (def centerrow (- nrows 3))             ; controls front-back tilt
-(def centercol 2)                       ; controls left-right tilt / tenting (higher number is more tenting)
+(def centercol 3)                       ; controls left-right tilt / tenting (higher number is more tenting)
 (def tenting-angle (/ π 12))            ; or, change this for more precise tenting control
 (def column-style
   (if (> nrows 5) :orthographic :standard))  ; options include :standard, :orthographic, and :fixed


initialize store state with data when not dynamic

--- src/keypin/store.clj
+++ src/keypin/store.clj
@@ -161,11 +161,16 @@

 (defn make-caching-store
+  "Wrap a given a store such that the key lookups are cached as long as the store doesn't change."
   [store]
   (i/expected #(satisfies? t/IStore %) "an instance of keypin.type/IStore protocol" store)
-  (let [state (agent {:kvdata nil
+  (let [data? (not (instance? IDeref store))
+        state (agent {:kvdata (when data?
+                                store)
                       :cache  {}})
-        fetch (if (instance? IDeref store)
+        fetch (if data?
+                (fn []
+                  @state)
                 (fn []
                   (let [store-data @store
                         state-data @state]
@@ -174,11 +179,7 @@
                       (let [new-state {:kvdata store-data
                                        :cache {}}]
                         (send state conj new-state)
-                        new-state))))
-                (do
-                  (send state assoc :kvdata store)
-                  (fn []
-                    @state)))
+                        new-state)))))
         sdata (fn []
                 (:kvdata (fetch)))]
     (reify


fix non-termination bug

fix non-termination bug

--- src/revdiff/core.clj
+++ src/revdiff/core.clj
@@ -48,12 +48,13 @@

 (defn diff-revpairs [object filt revpairs show insens]
   (loop [x revpairs]
-    (let [r1 (first x)
-          r2 (second x)
-          mf (matching-files r1 r2 object filt show insens)]
-      (println (str "Checking: r" r1 " vs r" r2))
-      (doseq [filename mf] (svndiff r1 r2 filename object show))
-      (recur (drop 2 x)))))
+    (if (not-empty x)
+      (let [r1 (first x)
+            r2 (second x)
+            mf (matching-files r1 r2 object filt show insens)]
+        (println (str "Checking: r" r1 " vs r" r2))
+        (doseq [filename mf] (svndiff r1 r2 filename object show))
+        (recur (drop 2 x))))))

 ;; Try to explain why this has failed.


Fix various non-idiomatic or unnecessarily-complicated implementations

--- src/useful.clj
+++ src/useful.clj
@@ -38,40 +38,32 @@
 (defn include?
   "Check if val exists in coll."
   [val coll]
-  (some (partial = val) coll))
+  (some #{val} coll))

 (defn extract
   "Extracts the first item that matches pred from coll, returning a vector of that item
    followed by coll with the items removed."
   [pred coll]
-  (loop [head ()
-         tail (seq coll)]
-    (let [item (first tail)
-          tail (next tail)]
-      (if (or (nil? tail) (pred item))
-        [item (into tail head)]
-        (recur (conj head item) tail)))))
+  (let [[head [item & tail]] (split-with (complement pred) coll)]
+    [item (concat head tail)]))

 (defn separate
   "Split coll into two sequences, one that matches pred and one that doesn't. Unlike, the
   version in clojure.contrib.seq-utils, this is not lazy, but pred is only called once per item."
   [pred coll]
-  (loop [tail (seq coll)
-         yes () no ()]
-    (if (nil? tail)
-      [(reverse yes) (reverse no)]
-      (let [item (first tail)
-            tail (next tail)]
-        (if (pred item)
-          (recur tail (conj yes item) no)
-          (recur tail yes (conj no item)))))))
+  (reduce (fn [[yes no] item]
+            (if (pred item)
+              [(conj yes item) no]
+              [yes (conj no item)]))
+          [[] []]
+          coll))

 (defmacro if-ns [ns-reference then-form & [else-form]]
-  "Try to load a namespace reference. If sucessful, evaluate then-form otherwise evaluate else-form."
+  "Try to load a namespace reference. If successful, evaluate then-form otherwise evaluate else-form."
   `(try (ns ~(ns-name *ns*) ~ns-reference)
         (eval '~then-form)
         (catch Exception e#
-          (when (not (instance? java.io.FileNotFoundException e#))
+          (when-not (instance? java.io.FileNotFoundException e#)
             (println "Error loading" '~ns-reference (.getMessage e#)))
           (eval '~else-form))))

@@ -195,9 +187,7 @@
   "Returns a lazy sequence of vectors of corresponding items from each collection.
    Stops when the shortest collection runs out."
   [& colls]
-  (partition
-   (count colls)
-   (apply interleave colls)))
+  (apply map vector colls))

 (defn find-with
   "Returns the val corresponding to the first key where (pred key) returns true."
@@ -205,9 +195,9 @@
   (last (first (filter (comp pred first) (zip keys vals)))))

 (defn filter-keys-by-val
-  "Returns a keys of map for which (pred value) returns true."
+  "Returns all keys in map for which (pred value) returns true."
   [pred map]
-  (if map
+  (when map
     (for [[key val] map :when (pred val)] key)))

 (defn remove-keys-by-val
@@ -218,7 +208,7 @@
 (defn filter-vals
   "Returns a map that only contains values where (pred value) returns true."
   [pred map]
-  (if map
+  (when map
     (select-keys map (filter-keys-by-val pred map))))

 (defn remove-vals
@@ -261,7 +251,7 @@
   and v is the new value and returns a new nested structure. The associative structure
   can have transients in it, but if any levels do not exist, non-transient hash-maps will
   be created."
-  [m [k & ks :as keys] v]
+  [m [k & ks] v]
   (let [assoc (if (instance? clojure.lang.ITransientCollection m) assoc! assoc)]
     (if ks
       (assoc m k (assoc-in! (get m k) ks v))


less nesting

less nesting


Add debugging to summary

Add debugging to summary

--- src/angelic/search/summary.clj
+++ src/angelic/search/summary.clj
@@ -70,7 +70,7 @@

 (defn or-combine-b [summaries new-src bound]
   (let [best (apply-max-b summaries bound)]
-    (when (solved? best) (assert (clojure.core/>= bound (max-reward best))))
+    (when (solved? best) (util/assert-is (clojure.core/>= bound (max-reward best)) "%s" [new-src]))
     (re-source best new-src bound :solved)))


RS | #50 | Change 'ending on' to 'drafting begins'

--- src/objective8/translation.clj
+++ src/objective8/translation.clj
@@ -100,7 +100,7 @@
                                       :doc-description "Objective  ..."
                                       :background-label "Background"
                                       :goals-label "Goals"
-                                      :end-date-label "Ending on: "
+                                      :end-date-label "Drafting begins: "
                                       :created-message "Your objective has been created!"}
                      :comment-view {:created-message "Your comment has been added!"
                                     :comment-title "Comments"


Namespace checkpoint key by job id

Namespace checkpoint key by job id

--- src/onyx/plugin/bookkeeper.clj
+++ src/onyx/plugin/bookkeeper.clj
@@ -165,7 +165,7 @@
   (update task-map k (fn [curr] (or curr v))))

 (defn inject-read-ledgers-resources
-  [{:keys [onyx.core/task-map onyx.core/log onyx.core/task-id onyx.core/pipeline onyx.core/peer-opts] :as event} lifecycle]
+  [{:keys [onyx.core/task-map onyx.core/log onyx.core/job-id onyx.core/task-id onyx.core/pipeline onyx.core/peer-opts] :as event} lifecycle]
   (when-not (= 1 (:onyx/max-peers task-map))
     (throw (ex-info "Read log tasks must set :onyx/max-peers 1" task-map)))
   (when-not (:bookkeeper/password-bytes task-map)
@@ -182,7 +182,7 @@
             (default-value :bookkeeper/ledger-start-id 0)
             (default-value :bookkeeper/ledger-end-id Double/POSITIVE_INFINITY)
             (default-value :bookkeeper/no-recovery-empty-read-back-off 500)
-            (default-value :checkpoint/key task-id))
+            (default-value :checkpoint/key (str job-id "#" task-id)))
         {:keys [read-ch shutdown-ch retry-ch commit-ch error]} pipeline
         ;; decrement because we are going to store this as a checkpoint and then inc after recover
         checkpoint-key (:checkpoint/key defaulted-task-map)


Add type-conversion

Add type-conversion

--- src/atom_finder/classifier.clj
+++ src/atom_finder/classifier.clj
@@ -49,6 +49,7 @@
    (ValidatedAtom :operator-precedence       operator-precedence-atom?   (default-finder operator-precedence-atom?))
    (ValidatedAtom :repurposed-variable       repurposed-variable-atom?   repurposed-variable-atoms)
    (ValidatedAtom :implicit-predicate        implicit-predicate-atom?    (default-finder implicit-predicate-atom?))
+   (ValidatedAtom :type-conversion           type-conversion-atom?       (default-finder type-conversion-atom?))
   ])

 (def atom-lookup (into {} (map #(vector (:name %1) %1) atoms)))


fix typo

fix typo

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2164,7 +2164,7 @@
              :sem {:pred :turn-on
                    :reflexive false}
              :subcat {:2 {:cat :noun
-                          :pronon false}
+                          :pronoun false}
                       :3 '()}}
     :english {:past "turned on"
                :present {:3sing "turns on"}


Update lexicon.clj

Update lexicon.clj

--- src/babel/francais/lexicon.clj
+++ src/babel/francais/lexicon.clj
@@ -126,6 +126,9 @@
    "créer" {:synsem {:cat :verb
                      :sem {:pred :create}}}

+   "croire" {:synsem {:cat :verb
+                      :sem {:pred :believe}}}
+
    "decider" {:synsem {:cat :verb
                        :sem {:pred :decide}}}

@@ -150,10 +153,7 @@

    "diviser" {:synsem {:cat :verb
                       :sem {:pred :divide}}}
-
-   "croire" {:synsem {:cat :verb
-                      :sem {:pred :believe}}}
-
+
    "décider" {:synsem {:cat :verb
                        :sem {:pred :decide}}}


Fix litedocx.unit/parse-unit fn

Fix litedocx.unit/parse-unit fn

--- src/bakyeono/litedocx/unit.clj
+++ src/bakyeono/litedocx/unit.clj
@@ -56,7 +56,7 @@
   [s]
   (let [s (str/trim s)
         n (Double/parseDouble (re-find #"^-?\d+\.?\d*" s))
-        unit (-> (re-find #"[a-z]+$" s) clojure.string/lower-case keyword)]
+        unit (-> (re-find #"[a-z]+.?$" s) clojure.string/lower-case keyword)]
     [n unit]))

 (defn- conversion-medium


Put the order of from and speed-up back the other way - I didn't understand ->. Put a speed-up before the repetition.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -9,8 +9,8 @@
         ms-per-beat (/ ms-per-minute beats-per-minute)]
     #(+ start (* ms-per-beat %))))

-(defn from [offset timing] #(timing (+ offset %)))
-(defn speed-up [factor timing] #(timing (/ % factor)))
+(defn from [timing offset] #(timing (+ offset %)))
+(defn speed-up [timing factor] #(timing (/ % factor)))

 (def scale 56)
 (defn ground [note] (+ scale note))
@@ -47,7 +47,7 @@
     (at (timing 3) (note# (:base chord1)))
     (at (timing 4) (note# (:base chord2)))
     (at (timing 6) (chord# (dissoc chord2 :base)))
-    (let [next (from 8 timing)]
+    (let [next (from timing 8)]
       (if chords
         (rhythm-n-bass# next chords)
         next))))
@@ -55,7 +55,7 @@
 (defn even-melody# [timing [note & notes]]
   (do
     (at (timing 0) (note# note))
-    (let [next (from 1 timing)]
+    (let [next (from timing 1)]
       (if notes
         (even-melody# next notes)
         next))))
@@ -65,12 +65,12 @@
     (rhythm-n-bass# timing (take 8 (cycle progression))))

 (defn first-bit# [timing]
-    (even-melody# (speed-up 2 (from -1 timing)) (map ionian [2 4 5 4 4 2 4]))
-    (even-melody# (speed-up 2 (from 7 timing)) (map ionian [-2 1 2 1 1 -2 1]))
-    (even-melody# (speed-up 2 (from 15 timing)) (map ionian [-2 1 2 1 1 -2 1 2 3 4]))
-    (even-melody# (speed-up 2 (from 23 timing)) (map ionian [-1 -2 -3 0 0 -3 0 1 0 -3]))
+    (even-melody# (speed-up (from timing -1) 2) (map ionian [2 4 5 4 4 2 4]))
+    (even-melody# (speed-up (from timing 7) 2) (map ionian [-2 1 2 1 1 -2 1]))
+    (even-melody# (speed-up (from timing 15) 2) (map ionian [-2 1 2 1 1 -2 1 2 3 4]))
+    (even-melody# (speed-up (from timing 23) 2) (map ionian [-1 -2 -3 0 0 -3 0 1 0 -3]))
     (rhythm-n-bass# timing (take 8 (cycle progression))))

-(defn play# [] (-> (bpm 150) intro# first-bit# first-bit#))
+(defn play# [] (-> (bpm 120) (from 2) intro# first-bit# (speed-up 3/2) first-bit#))

-; (play#)
+(play#)


Limit use of add-id-from-url to comic-list

--- src/clj/comic_reader/sites.clj
+++ src/clj/comic_reader/sites.clj
@@ -17,8 +17,7 @@
   [(let [canonical-url "http://mangafox.me"
          manga-url (format "%s/manga/" canonical-url)
          manga-pattern (re-pattern (str manga-url "(.*?)/"))
-         link->map (comp (gen-add-id-from-url manga-pattern)
-                         (gen-link->map identity identity))]
+         link->map (gen-link->map identity identity)]
      {:id :manga-fox
       :name "Manga Fox"

@@ -26,7 +25,9 @@
                     (str manga-url comic-id "/"))
       :comic-list-data {:url manga-url
                         :selector [:div.manga_list :ul :li :a]
-                        :normalize link->map}
+                        :normalize (comp (gen-add-id-from-url
+                                          manga-pattern)
+                                         link->map)}
       :chapter-list-data-for-comic
       (fn [comic-url]
         {:url comic-url
@@ -51,10 +52,8 @@

    (let [canonical-url "http://www.mangareader.net"
          manga-pattern (re-pattern (str canonical-url "/(.*)$"))
-         link->map (comp
-                    (gen-add-id-from-url manga-pattern)
-                    (gen-link->map s/trim
-                                   (partial str canonical-url)))]
+         link->map (gen-link->map s/trim
+                                  (partial str canonical-url))]
      {:id :manga-reader
       :name "Manga Reader"

@@ -62,7 +61,10 @@
                     (str canonical-url "/" comic-id))
       :comic-list-data {:url (str canonical-url "/alphabetical")
                         :selector [:div.series_alpha :ul :li :a]
-                        :normalize link->map}
+                        :normalize (comp
+                                    (gen-add-id-from-url
+                                     manga-pattern)
+                                    link->map)}
       :chapter-list-data-for-comic
       (fn [comic-url]
         {:url comic-url


updated routes

updated routes

--- src/clj/hsd_scoring/routes.clj
+++ src/clj/hsd_scoring/routes.clj
@@ -31,10 +31,10 @@
 (defquery select-results "sql/select-results.sql")
 (defquery select-summary "sql/select-summary.sql")
 (defquery create-team! "sql/insert-team.sql")
-(defquery update-team-weight! "sql/update-team-weight.sql")
-(defquery update-team-launch! "sql/update-team-launch-score.sql")
-(defquery update-team-ramp! "sql/update-team-ramp-score.sql")
-(defquery update-team-presentation! "sql/update-team-pres-score.sql")
+(defquery update-team-school! "sql/update-team-school.sql")
+(defquery update-team-egg-drop! "sql/update-team-egg-drop.sql")
+(defquery update-team-crack-safe! "sql/update-team-crack-safe.sql")
+(defquery update-team-break-out! "sql/update-team-break-out.sql")
 (defquery delete-team! "sql/delete-team.sql")

 (defn teams-summary
@@ -43,7 +43,7 @@
   {:body (select-summary db)})

 (defn results-summary
-  "Collects score results, sum the launch and ramp scores, tie break by weight"
+  "Collects score results, sum the individual scores"
   []
   {:body (select-results db)})

@@ -61,13 +61,13 @@
   "Helper function to update correct field of team"
   [team-name field value]
   (cond
-    (= field "Weight") (update-team-weight! db value team-name)
-    (= field "Launch") (update-team-launch! db value team-name)
-    (= field "Ramp") (update-team-ramp! db value team-name)
-    (= field "Presentation") (update-team-presentation! db value team-name)))
+    (= field "School") (update-team-school! db value team-name)
+    (= field "Egg Drop") (update-team-egg-drop! db value team-name)
+    (= field "Crack the Safe") (update-team-crack-safe! db value team-name)
+    (= field "Break Out") (update-team-break-out! db value team-name)))

 (defn update-team
-  "Updates team field, weight or score, to new value provided the team exists"
+  "Updates team field, school name or score, to new value provided the team exists"
   [{:keys [team-name field value]}]
   (let [rows-aff (update-by-field team-name field value)]
     (if (= 1 rows-aff)


Tag added for user plugin routes

Tag added for user plugin routes

--- src/clj/salava/user/routes.clj
+++ src/clj/salava/user/routes.clj
@@ -17,6 +17,7 @@
              (layout/main ctx "/activate/:userid/:timestamp/:code"))

     (context "/obpv1/user" []
+      :tags ["user"]
       (POST "/login" []
             ;:return ""
             :body [login-content schemas/LoginUser]


removed old code

removed old code

--- src/clj/skidskytte/handler.clj
+++ src/clj/skidskytte/handler.clj
@@ -14,7 +14,6 @@
 (def app-routes
   (routes
    (-> #'home-routes
-       (wrap-routes middleware/wrap-csrf)
        (wrap-routes middleware/wrap-formats))
    #'service-routes
    (route/not-found


auto-refresh works for both ns-lb and vars-lb - new ns or new var are "instantly" visible. fixed: doc-tf and doc-ta are now cleared when unloaded ns-cbx is chosen

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -179,7 +179,8 @@
 (swap! all-ns-unloaded-atom (fn [& a] (all-ns-unloaded)))
 (swap! all-ns-loaded-atom (fn [& a] (all-ns-loaded)))
 (def group-vars-by-object-type (atom true))
-
+(def ns-lb-refresh-atom (atom true))
+(def vars-lb-refresh-atom (atom true))

 ;; bind specific fns

@@ -446,11 +447,19 @@
     (b/bind
       (apply b/funnel
         [(id :ns-cbx)
-         (id :ns-filter-tf)])
+         (id :ns-filter-tf)
+         ns-lb-refresh-atom])
       (b/transform (fn [o]
         (let [v (selection (id :ns-cbx))]
+          (when (= v "unloaded") (config! (id :doc-tf) :text "")(config! (id :doc-ta) :text ""))
           {:already-filtered false :string-seq ((get ns-cbx-value-fn-map v))})))
       (b/transform regx-tf-filter (id :ns-filter-tf))
+      (b/filter (fn [l]  ;; only refresh if the list really has changed
+        (if (= l (seesaw.meta/get-meta root :last-ns-lb))
+          false
+          (do
+            (seesaw.meta/put-meta! root :last-ns-lb l)
+            true))))
       (b/notify-soon)
       (b/property (id :ns-lb) :model))
     ;;
@@ -460,7 +469,8 @@
       (apply b/funnel
         [(b/selection (id :vars-cbx))
          (b/selection (id :ns-lb))
-         (id :vars-filter-tf)])
+         (id :vars-filter-tf)
+         vars-lb-refresh-atom])
       (b/transform (fn [o]
         (let [n-s (selection (id :ns-lb))
               n (and n-s (find-ns (symbol n-s)))
@@ -483,6 +493,12 @@
                 fqns? (#{"all-publics" "search-all-docs"} v)]
             (group-by-object-type symbol-str-seq fqns? n-s))
           symbol-str-seq)))
+      (b/filter (fn [l]  ;; only refresh if the list really has changed
+        (if (= l (seesaw.meta/get-meta root :last-vars-lb))
+          false
+          (do
+            (seesaw.meta/put-meta! root :last-vars-lb l)
+            true))))
       (b/notify-soon)
       (b/property (id :vars-lb) :model))
     ;;
@@ -687,9 +703,11 @@
         prev-var (:selected-ns m)
         selected-ns (selection (id :ns-lb))
         selected-var (selection (id :vars-lb))]
-    (selection! (id :vars-lb) (selection (id :vars-lb)))
-    {:root root :selected-ns selected-ns :selected-var selected-var})
-  )
+    (swap! ns-lb-refresh-atom not)
+    (swap! vars-lb-refresh-atom not)
+    (when-not (= (selection (id :ns-lb)) selected-ns) (selection! (id :ns-lb) selected-ns))
+    (selection! (id :vars-lb) selected-var)
+    {:root root :selected-ns selected-ns :selected-var selected-var}))

 ;;seesaw.core/toggle-full-screen! (locks up computer!!! don't use)
 ;;(seesaw.dev/show-options) and (seesaw.dev/show-events)


Fix scroll-to in firefox

Fix scroll-to in firefox

--- src/cljs/clojuredocs/anim.cljs
+++ src/cljs/clojuredocs/anim.cljs
@@ -21,12 +21,14 @@
 (defn scroll-to
     [elem & [{:keys [pad]}]]
     (let [body (sel1 :body)
-          start (.-scrollTop body)
+          html (sel1 :html)
+          start (max  (.-scrollTop body) (.-scrollTop html))
           end (- (offset-top elem) pad)]
       (.tween js/morpheus
         250
         (fn [pos]
-          (aset body "scrollTop" pos))
+          (aset body "scrollTop" pos)
+          (aset html "scrollTop" pos))
         nil
         nil
         start


Added SSL support to compojure.server.jetty based on suggestion by Andrew Rimes

--- src/compojure/server/jetty.clj
+++ src/compojure/server/jetty.clj
@@ -15,7 +15,8 @@
   (:use compojure.server.common)
   (:import org.mortbay.jetty.Server)
   (:import org.mortbay.jetty.servlet.Context)
-  (:import org.mortbay.jetty.servlet.ServletHolder))
+  (:import org.mortbay.jetty.servlet.ServletHolder)
+  (:import org.mortbay.jetty.security.SslSocketConnector))

 (defn servlet-holder
   "Wrap a servlet in a ServletHolder object with a supplied set of parameters
@@ -52,12 +53,28 @@
                       (ServletHolder. servlet))]
     (.addServlet context holder path)))

+(defn- add-ssl-connector!
+  "Add an SslSocketConnector to a Jetty server."
+  [server options]
+  (let [ssl-connector (SslSocketConnector.)]
+    (doto ssl-connector
+      (.setPort        (options :ssl-port))
+      (.setKeystore    (options :keystore))
+      (.setKeyPassword (options :key-password)))
+    (when (options :truststore)
+      (.setTruststore ssl-connector (options :truststore)))
+    (when (options :trust-password)
+      (.setTrustPassword ssl-connector (options :trust-password)))
+    (.addConnector server ssl-connector)))
+
 (defn- create-server
   "Construct a Jetty Server instance."
   [options servlets]
   (let [port     (or (options :port) 8080)
         server   (Server. port)
         servlets (partition 2 servlets)]
+    (when (options :ssl-port)
+      (add-ssl-connector! server options))
     (doseq [[url-or-path servlet] servlets]
       (add-servlet! server url-or-path servlet))
     server))


make reporting new issues to fe work

make reporting new issues to fe work

--- src/pc/http/datomic/common.clj
+++ src/pc/http/datomic/common.clj
@@ -257,36 +257,53 @@
 (defn has-issue-frontend-id? [db frontend-id-memo datom]
   (frontend-id-memo db (:e datom)))

-(defn issue-datom-read-api [db frontend-id-memo datom]
+(defn issue-datom-read-api [db datom]
   (let [{:keys [e a v tx added] :as d} datom
         a (schema/get-ident a)
         v (if (and (contains? (schema/enums) a)
                    (contains? (schema/ident-ids) v))
             (schema/get-ident v)
-            v)
-        e (frontend-id-memo db e)]
+            v)]
     (->> {:e e :a a :v v :tx tx :added added}
       (translate-datom db))))
+
+(defn add-issue-frontend-ids
+  "Converts eids to tempids that the frontend will understand and matches them up with
+   issue ids"
+  [frontend-id-memo db txes]
+  (let [eid-map (zipmap (set (map :e txes))
+                        (map (comp - inc) (range))) ; {eid-1 -1 eid-2 -2}
+        ;; matches tempid with issue-id
+        frontend-id-txes (map (fn [[eid tempid]] {:e tempid
+                                                  :a :frontend/issue-id
+                                                  :v (frontend-id-memo db eid)
+                                                  :added true})
+                              eid-map)]
+    ;; XXX: need to do something about refs
+    (concat
+     (map (fn [datom]
+            ;; replaces lookup-ref style e with tempid
+            (update-in datom [:e] eid-map))
+          txes)
+     frontend-id-txes)))

 (defn frontend-issue-transaction
   "Returns map of document transactions filtered for admin and filtered for read-only access"
   [transaction]
   (let [annotations (get-annotations transaction)
-        frontend-id-memo (memoize (fn [db e]
-                                    (let [ent (d/entity db e)]
-                                      (when-let [id (:frontend/issue-id e)]
-                                        [:frontend/issue-id id]))))]
+        frontend-id-memo (memoize (fn [db e] (:frontend/issue-id (d/entity db e))))]
     (when (and (:transaction/issue-tx? annotations)
                (:transaction/broadcast annotations))
-      (when-let [public-datoms (->> transaction
+      (when-let [public-datoms (some->> transaction
                                  :tx-data
                                  (filter (partial has-issue-frontend-id?
                                                   (:db-after transaction)
                                                   frontend-id-memo))
-                                 (map (partial datom-read-api
-                                               (:db-after transaction)
-                                               frontend-id-memo))
+                                 (map (partial issue-datom-read-api
+                                               (:db-after transaction)))
                                  (filter issue-whitelisted?)
+                                 (add-issue-frontend-ids frontend-id-memo
+                                                         (:db-after transaction))
                                  seq)]
         (merge {:tx-data public-datoms}
                annotations)))))


Refactor to use cond

Refactor to use cond

--- clojure/bob/bob.clj
+++ clojure/bob/bob.clj
@@ -1,15 +1,10 @@
 (ns bob (:use clojure.string))

-(defn response-for [x]
-	(if (blank? x)
-		"Fine, be that way."
-		(if (= (upper-case x) x)
-			"Woah, chill out!"
-			(if (= \? (.charAt x (- (.length x) 1)))
-				"Sure."
-				"Whatever."
-			)
-		)
-	)
-
+(defn response-for [x]
+	(cond
+		(blank? x) "Fine, be that way."
+		(= (upper-case x) x) "Woah, chill out!"
+		(= \? (.charAt x (- (.length x) 1))) "Sure."
+		true "Whatever."
+	)
 )


add more defop

add more defop

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/emulator_chip8/opcode.cljc
+++ src/emulator_chip8/opcode.cljc
@@ -27,6 +27,43 @@
     `(defn ~pname [~@args] ~@body)
     (swap! opcode-table conj key)
     ))
+
+;; http://stackoverflow.com/questions/24897818/how-to-add-docstring-support-to-defn-like-clojure-macro
+
+(defop :0NNN
+  "Execute machine language subroutine at address NNN"
+  [])
+
+(defop :00E0
+  "Clear the screen"
+  [])
+
+(defop :00EE
+  "Return from a subroutine"
+  [])
+
+(defop :1NNN
+  "Jump to address NNN"
+  [])
+
+(defop :2NNN
+  "Execute subroutine starting at address NNN"
+  [])
+
+(defop :3XNN
+  "Skip the following instruction if the value of register VX equals NN"
+  [])
+
+(defop :4XNN
+  "Skip the following instruction if the value of register VX is not equal to
+  NN"
+  [])
+
+(defop :5XY0
+  "Skip the following instruction if the value of register VX is equal to the value of register VY"
+  [])
+
+;;;;;;;;;;;

 (defop :6XNN
   []
@@ -65,10 +102,10 @@

 (def handler-list
   {;; Execute machine language subroutine at address NNN
-   :0NNN 'unimplement
+   ;;   :0NNN 'unimplement

    ;; Clear the screen
-   :00E0 'clear-screen
+   ;;   :00E0 'clear-screen

    ;; Return from a subroutine
    :00EE 'return-from-subroutine


Making apply-contract accept zero args

Making apply-contract accept zero args

--- src/trammel/core.clj
+++ src/trammel/core.clj
@@ -118,8 +118,8 @@
   (if (:hooked (meta f))
     f
     (with-meta
-      (fn [m & args]
-        (if-let [contract (-> m meta :contract)]
+      (fn [& [m & args]]
+        (if-let [contract (and m (-> m meta :contract))]
           ((partial contract identity) (apply f m args))
           (apply f m args)))
       {:hooked true})))


Fix bug with nil decoding

Fix bug with nil decoding

--- src/transit/read.clj
+++ src/transit/read.clj
@@ -23,7 +23,7 @@
 (def decode-fns (atom {":" #(keyword %)
                        "?" #(Boolean. ^String %)
                        "b" #(Base64/decodeBase64 ^bytes %)
-                       "_" #(identity nil)
+                       "_" (fn [_] nil)
                        "i" #(try
                               (Long/parseLong %)
                               (catch NumberFormatException _ (read-int-str %)))


Just some additional comment

Just some additional comment

--- src/adventofcode/solutions.clj
+++ src/adventofcode/solutions.clj
@@ -174,6 +174,7 @@
     (if (contains? m target)
       m
       (m/match [instr]
+               ; matches below probably could be simplified by means of "guards"
                [{:oper nil :lwire nil :rwire rw :rw-num nil}] (if (contains? m rw)
                                                                 (assoc m target (get m rw))
                                                                 m)


Day 16 completed (both parts)

Day 16 completed (both parts)

--- src/adventofcode/solutions.clj
+++ src/adventofcode/solutions.clj
@@ -658,6 +658,12 @@
 (defn day16-part2
   []
   (d16-basis #(let [[_ props] %
-                    cvals (select-keys d16-reference (keys props))
-                    {:keys []}]
-               )))+                    {:keys [cats trees pomeranians goldfish]} props
+                    {rcats :cats rtrees :trees rpomeranians :pomeranians rgoldfish :goldfish} d16-reference
+                    others (dissoc props :cats :trees :pomeranians :goldfish)]
+               (and
+                 (if cats (> cats rcats) true)
+                 (if trees (> trees rtrees) true)
+                 (if pomeranians (< pomeranians rpomeranians) true)
+                 (if goldfish (< goldfish rgoldfish) true)
+                 (= others (select-keys d16-reference (keys others)))))))


make "can (be able to)" a modal verb

make "can (be able to)" a modal verb

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -379,13 +379,21 @@
                      :sem {:pred :call}}}

    "can"
-   {:english {:participle "being able to"
-              :past "could"
-              :present {:3sing "can"}
-              :future "be able to"
-              :conditional "be able to"}
-    :synsem {:cat :verb
-             :sem {:pred :can}}}
+    (let [modal-subject (atom {:cat :noun
+                                    :sem {:animate true}})]
+      {:english {:participle "being able to"
+                 :past "could"
+                 :present {:3sing "can"}
+                 :future "be able to"
+                 :conditional "be able to"}
+       :synsem {:cat :verb
+                :sem {:pred :can}
+                :subcat {:1 modal-subject
+                         :2 {:cat :verb
+                             :infl :infinitive
+                             :subcat {:1 modal-subject
+                                      :2 '()}}
+                         :3 '()}}})

    "car" {:synsem {:cat :noun
                    :sem {:pred :car}}}


don't set {:obj :unspec} for reflexive=true verbs: will prevent generation of them

--- src/babel/espanol/lexicon.cljc
+++ src/babel/espanol/lexicon.cljc
@@ -861,10 +861,12 @@
 (def lexicon
   (-> (compile-lex lexicon-source morph/exception-generator morph/phonize)

-      ;; if a non-auxiliary verb has no :obj, then its {:obj is :unspec}.
+      ;; if a non-auxiliary, non-reflexive verb has no :obj,
+      ;; then its {:obj is :unspec}.
       (if-then {:synsem {:cat :verb
                          :aux false
-                         :sem {:obj :unspec}}}
+                         :sem {:reflexive false
+                               :obj :unspec}}}
                {:synsem {:sem {:obj :unspec}}})

       ;; make an intransitive version of every verb which has an


add non-human versions of 'loro'

add non-human versions of 'loro'

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -1407,7 +1407,26 @@
                     :number :plur}
               :sem {:human true
                     :pred :loro}
-              :subcat '()}}]
+              :subcat '()}}
+    {:synsem {:cat :noun
+              :pronoun true
+              :case :nom
+              :agr {:person :3rd
+                    :gender :fem
+                    :number :plur}
+              :sem {:human false
+                    :pred :loro}
+              :subcat '()}}
+    {:synsem {:cat :noun
+              :pronoun true
+              :case :nom
+              :agr {:person :3rd
+                    :gender :masc
+                    :number :plur}
+              :sem {:human false
+                    :pred :loro}
+              :subcat '()}}
+    ]

    "lui" (let [common {:synsem {:cat :noun
                                 :pronoun true


Add utility functions for amplifying/attenuating samples/signals

--- src/main/audio_utils/util.cljs
+++ src/main/audio_utils/util.cljs
@@ -38,3 +38,14 @@
    samples given a sample rate."
   [x sample-rate]
   (long (* (/ x 1000) sample-rate)))
+
+(defn amplify-sample
+  "Amplifies or attentuates a sample by a given amount of dB."
+  [sample db]
+  (* sample (db->amplitude db)))
+
+(defn amplify
+  "Amplifies all samples in the input collection by a given amount
+   of dB."
+  [coll db]
+  (map #(amplify-sample % db) coll))


use :cljs variant from data_readers.cljc

--- src/main/shadow/build/data.clj
+++ src/main/shadow/build/data.clj
@@ -6,13 +6,15 @@
     [shadow.debug :refer (?> ?-> ?->>)]
     [shadow.jvm-log :as log]
     [shadow.build.resource :as rc]
-    [cljs.tagged-literals :as tags])
+    [cljs.tagged-literals :as tags]
+    [cljs.analyzer :as ana])
   (:import
     [com.google.javascript.jscomp BasicErrorManager ShadowCompiler]
     [org.apache.commons.codec.digest DigestUtils]
     [java.io FileInputStream File]
     [java.net URL]
-    [java.nio.file Paths Path]))
+    [java.nio.file Paths Path]
+    [clojure.java.api Clojure]))

 ;; FIXME: there are still lots of places that work directly with the map
 ;; that is ok for most things but makes it really annoying to change the structure of the data
@@ -354,6 +356,17 @@

 (defn as-path ^Path [^String path]
   (Paths/get path (into-array String [])))
+
+(def cljs-data-readers
+  ;; overriding already loaded *data-readers* clj variants via CLJ
+  ;; with cljs variant from data_readers.cljc if present
+  (reduce-kv
+    (fn [readers tag sym]
+      ;; create unbound var like clojure *data-readers*
+      ;; will load later via code below
+      (assoc readers tag (Clojure/var sym)))
+    tags/*cljs-data-readers*
+    (ana/get-data-readers)))

 ;; instead of unconditionally loading namespaces associated with data_readers.clj(c)
 ;; we delay loading them until actually used. this saves loading namespaces on the classpath
@@ -408,5 +421,5 @@
                   (throw (ex-info (str "failed to read tag #" tag)
                            {:tag tag :value value}
                            e)))))))))
-    tags/*cljs-data-readers*
-    tags/*cljs-data-readers*))+    cljs-data-readers
+    cljs-data-readers))


Minor adjustments for readability

Minor adjustments for readability

--- src/clojure_club/x106_number_maze/mgrimm.clj
+++ src/clojure_club/x106_number_maze/mgrimm.clj
@@ -5,10 +5,10 @@
   (loop [seen #{} q (conj PersistentQueue/EMPTY [start 1 [start]])]
     (let [[x depth path] (peek q)]
       (if (= x end)
-        [depth (->> q seq (filter (fn [[y d p]] (and (= y end) (= d depth)))) (map #(nth % 2)))]
+        [depth (->> q seq (filter (fn [[y d p]] (and (= y end) (= d depth)))) (map last))]
         (recur (conj seen x)
                (let [a (+ x 2) b (* x 2) c (/ x 2)]
                  (cond-> (pop q)
-                   (not (seen a)) (conj [a (inc depth) (conj path :add2 a)])
-                   (not (seen b)) (conj [b (inc depth) (conj path :doub b)])
-                   (not (or (seen c) (odd? x))) (conj [c (inc depth) (conj path :halv c)]))))))))
+                         (not (seen a)) (conj [a (inc depth) (conj path :add2 a)])
+                         (not (seen b)) (conj [b (inc depth) (conj path :doub b)])
+                         (not (or (seen c) (odd? x))) (conj [c (inc depth) (conj path :halv c)]))))))))


Hotfix for grant (dev) (#677)

Hotfix for grant (dev) (#677)

* pr feedback

--- src/cljs/main/broadfcui/page/workspace/summary/acl_editor.cljs
+++ src/cljs/main/broadfcui/page/workspace/summary/acl_editor.cljs
@@ -72,7 +72,12 @@
       [:div {:style {:margin "0.5rem 0"}}
        [comps/Button {:text "Add new" :icon :add
                       :onClick #(swap! state update :non-project-owner-acl-vec
-                                       conj {:email "" :accessLevel "READER" :canShare false})}]]
+                                       conj (let [permissions {:email "" :accessLevel "READER"}]
+                                              ; Only owners can set new canShare permissions, so we only want to include
+                                              ; those in the default settings when the user is at least an owner
+                                              (if (common/access-greater-than-equal-to? user-access-level "OWNER")
+                                                (assoc permissions :canShare false)
+                                                permissions)))}]]
       (style/create-validation-error-message (:validation-error @state))
       [comps/ErrorViewer {:error (:save-error @state)}]])
     :ok-button {:text "Save" :onClick persist-acl}}])


Some fixes

Some fixes

--- src/cljs/mycotrack_reagent/pages/new-project-page.cljs
+++ src/cljs/mycotrack_reagent/pages/new-project-page.cljs
@@ -19,6 +19,13 @@
 (def current-farm (atom {}))

 (def state (atom {:doc {:description "" :substrate "" :container "" :enabled true :species "" :culture ""} :saved? false}))
+
+(defn reset-all []
+  (reset! culture-list [])
+  (reset! species-list [])
+  (reset! selected-species "")
+  (reset! current-farm {})
+  (reset! state {:doc {:description "" :substrate "" :container "" :enabled true :species "" :culture ""} :saved? false}))

 (defn set-value! [id value]
   (swap! state assoc :saved? false)
@@ -70,6 +77,7 @@
 (defn save-project [value]
   (fn [] (go (let [response (<! (http/post "/api/projects" {:json-params (:doc @state) :basic-auth {:username "test@mycotrack.com" :password "test"}}))]
     (when (= (:status response) 201 )
+      (reset-all)
       (aset (.-location js/window) "href" "/"))))))

 (defn species-input []


[page-inbox] Fix re-sort button always showing when empty threads

--- src/braid/page_inbox/core.cljc
+++ src/braid/page_inbox/core.cljc
@@ -41,16 +41,18 @@
           (fn [state [_ group-id]]
             (let [open-thread-ids (get-in state [:user :open-thread-ids])
                   threads (state :threads)
-                  open-threads (vals (select-keys threads open-thread-ids))]
+                  open-threads (vals (select-keys threads open-thread-ids))
+                  now (js/Date.)]
               (->> open-threads
                    (filter (fn [thread]
                              (= (thread :group-id) group-id)))
-                   ;; sort by last message sent by logged-in user, most recent first
                    (sort-by
                      (fn [thread]
-                       (->> (thread :messages)
-                            (map :created-at)
-                            (apply max))))
+                       (or (->> (thread :messages)
+                                (map :created-at)
+                                (apply max))
+                           ;; treat threads with no messages as being just created
+                           now)))
                    reverse)))})

        (base/register-events!


research grant update

research grant update

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -305,7 +305,7 @@

    "Research Grant"
    {:req (req (not (empty? (filter #(= (:title %) "Research Grant") (all-installed state :corp)))))
-    :prompt "Choose to score another installed copy of Research Grant (optional)"
+    :prompt "You may choose another installed copy of Research Grant to score."
     :choices {:req #(= (:title %) "Research Grant")}
     :effect (effect (score (assoc target :advance-counter (:advancementcost target))))
     :msg (msg "score another copy of Research Grant")


Replace mod with rem

Replace mod with rem

--- src/cljam/io/twobit/reader.clj
+++ src/cljam/io/twobit/reader.clj
@@ -121,7 +121,7 @@
                   ^chars (aget twobit-to-str)
                   (.put cb)))
            (let [cb' (-> cb
-                         ^CharBuffer (.position (mod (dec start') 4))
+                         ^CharBuffer (.position (rem (dec start') 4))
                          ^CharBuffer .slice
                          (.limit (int (inc (- end' start')))))]
              (replace-ambs! cb' (.ambs h) start' end')


Really fix transact...

Really fix transact...

--- src/cljx/geschichte/stage.cljx
+++ src/cljx/geschichte/stage.cljx
@@ -313,7 +313,7 @@
                                           branch))

              new-val
-             (swap! (get-in stage [:volatile :val-atom]) assoc-in [user repo branch] branch-val)]
+             (swap! (get-in @stage [:volatile :val-atom]) assoc-in [user repo branch] branch-val)]

         (info "new stage value after trans " [params trans-fn-code] ": \n" new-val)
         (put! val-ch new-val))))


Add instruction string-rand.

Add instruction string-rand.

--- src/clojush.clj
+++ src/clojush.clj
@@ -44,6 +44,8 @@
 (def max-random-integer 10)
 (def min-random-float -1.0)
 (def max-random-float 1.0)
+(def min-random-string-length 1)
+(def max-random-string-length 10)
 (def max-points-in-random-expressions 50) ;; for code_rand
 (def maintain-histories true) ;; histories are lists of total-error values for ancestors
 (def maintain-ancestors false) ;; if true save all ancestors in each individual (costly)
@@ -683,6 +685,16 @@
         :code
         (pop-item :integer state))
       state)))
+
+;trh
+(define-registered string-rand
+                   (fn [state]
+                     (push-item (apply str (repeatedly (+ min-random-string-length
+                                                          (lrand-int (- max-random-string-length min-random-string-length)))
+                                                       #(rand-nth "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890")))
+                                :float
+                                state)))
+

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; instructions for numbers


Added a string stack, and reformatted a few things.

--- src/clojush.clj
+++ src/clojush.clj
@@ -35,7 +35,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; globals

-(def push-types '(:exec :integer :float :code :boolean :auxiliary :tag :zip))
+(def push-types '(:exec :integer :float :code :boolean :auxiliary :tag :zip :string))
 (def max-number-magnitude 1000000000000)
 (def min-number-magnitude 1.0E-10)
 (def top-level-push-code true)
@@ -251,28 +251,28 @@

 (defn discrepancy
   "Returns a measure of the discrepancy between list1 and list2. This will
-be zero if list1 and list2 are equal, and will be higher the 'more different'
-list1 is from list2. The calculation is equivalent to the following:
-1. Construct a list of all of the unique items in both of the lists. Sublists
+   be zero if list1 and list2 are equal, and will be higher the 'more different'
+   list1 is from list2. The calculation is equivalent to the following:
+   1. Construct a list of all of the unique items in both of the lists. Sublists
    and atoms all count as items.
-2. Initialize the result to zero.
-3. For each unique item increment the result by the difference between the
+   2. Initialize the result to zero.
+   3. For each unique item increment the result by the difference between the
    number of occurrences of the item in list1 and the number of occurrences
    of the item in list2.
-4. Return the result."
+   4. Return the result."
   [list1 list2]
   (reduce + (vals (merge-with (comp math/abs -)
-                    (frequencies (all-items list1))
+                              (frequencies (all-items list1))
                     (frequencies (all-items list2))))))

 (defn overlap
  [thing1 thing2]
- "Returns a measure of the similarity of the arguments, which may be
-nested sequences. The overlap is defined in terms of the collections of
-the items contained in each of the arguments, including nested items at
-all levels. The overlap is then the maximal number of pairings by identity
-across the two collections, divided by the size of the larger collection.
-The returned value will range from 0 (for entirely distinct arguments)
+ "Returns a measure of the similarity of the arguments, which may be
+nested sequences. The overlap is defined in terms of the collections of
+the items contained in each of the arguments, including nested items at
+all levels. The overlap is then the maximal number of pairings by identity
+across the two collections, divided by the size of the larger collection.
+The returned value will range from 0 (for entirely distinct arguments)
 to 1 (for identical arguments). Run (overlap-demo) to see some examples."
  (let [items1 (all-items thing1)
        items2 (all-items thing2)


Added matrix add and inner product implementations

--- src/main/clj/clojure/core/matrix/complex.clj
+++ src/main/clj/clojure/core/matrix/complex.clj
@@ -82,7 +82,21 @@

    clojure.lang.Seqable
      (seq [m]
-       (map complex-array (m/slices (.real m)) (m/slices (.imag m)))))
+       (map complex-array (m/slices (.real m)) (m/slices (.imag m))))
+
+   mp/PMatrixAdd
+     (matrix-add [m a]
+       (ComplexArray. (mp/matrix-add (real m) (real a))
+                      (mp/matrix-add (imag m) (imag a))))
+
+   mp/PMatrixProducts
+     (inner-product [m a]
+       (ComplexArray. (mp/add-scaled (mp/inner-product (real m) (real a))
+                                     (mp/inner-product (imag m) (imag a))
+                                     -1)
+                      (mp/matrix-add (mp/inner-product (real m) (imag a))
+                                     (mp/inner-product (imag m) (real a))))))
+

 (defn complex-array
   ([real]


move aux fns within closure of ctor to avoid having to pass final vars around in param lists

--- src/main/clojure/org/dada/core/ModelImpl.clj
+++ src/main/clojure/org/dada/core/ModelImpl.clj
@@ -1,6 +1,4 @@
 (ns org.dada.core.ModelImpl
-    (:use org.dada.core)
-    ;;(:as this)
     (:import
      [java.util Collection LinkedHashMap]
      [org.dada.core AbstractModel Metadata Update]
@@ -14,56 +12,61 @@
      )
     )

-(defn process-addition [[extant extinct key-fn version-fn i a d] addition]
-  (let [new (.getNewValue addition)
-	key (key-fn new)
-	;;dummy (println "PROCESS:" key new)
-	current (extant key)]
-    (if (nil? current)
-      (let [removed (extinct key)]
-	(if (nil? removed)
-	  [(conj {key new} extant) extinct key-fn version-fn (cons (Update. nil new) i) a d] ;insertion
-	  ;; TODO - not extant but extinct
-	  )
-	)
-      ;; extant - alteration - TODO - check version
-      [(conj {key new} extant) extinct key-fn version-fn i (cons (Update. current new) a) d]
-      )))
+(defn -init [#^String model-name #^Metadata tgt-metadata #^IFn key-fn #^IFn version-fn]

-(defn process-deletion [[extant extinct key-fn version-fn i a d] addition]
-  ;; ensure row with key
-  ;; send insertion/alteration upstreamp
-  [extant extinct key-fn version-fn i a d])
-
-(defn process-update [extant extinct key-fn version-fn insertions alterations deletions]
-  (reduce process-deletion
-	  (reduce process-addition
-		  (reduce process-addition
-			  [extant extinct key-fn version-fn '() '() '()]
-			  insertions)
-		  alterations)
-	  deletions))
-
-(defn -init [#^String model-name #^Metadata tgt-metadata #^IFn key-fn #^IFn version-fn]
-  [;; super ctor args
+  [ ;; super ctor args
    [model-name tgt-metadata]
    ;; instance state
    (let [tgt-creator (.getCreator tgt-metadata)
+
+	 process-addition
+	 (fn [[extant extinct i a d] #^Update addition]
+	     (let [new (.getNewValue addition)
+		   key (key-fn new)
+		   ;;dummy (println "PROCESS:" key new)
+		   current (extant key)]
+	       (if (nil? current)
+		 (let [removed (extinct key)]
+		   (if (nil? removed)
+		     [(conj {key new} extant) extinct (cons (Update. nil new) i) a d] ;insertion
+		     ;; TODO - not extant but extinct
+		     )
+		   )
+		 ;; extant - alteration - TODO - check version
+		 [(conj {key new} extant) extinct i (cons (Update. current new) a) d]
+		 )))
+
+	  process-deletion
+	  (fn [[extant extinct i a d] #^Update addition]
+	      ;; ensure row with key
+	      ;; send insertion/alteration upstreamp
+	      [extant extinct i a d])
+
+	  process-update
+	  (fn [extant extinct insertions alterations deletions]
+	      (reduce process-deletion
+		      (reduce process-addition
+			      (reduce process-addition
+				      [extant extinct '() '() '()]
+				      insertions)
+			      alterations)
+		      deletions))
+
 	 update-fn (fn [[extant extinct] & updates]
-		       (apply process-update extant extinct key-fn version-fn updates))]
+		       (apply process-update extant extinct updates))]
      [(atom [{}{}]) update-fn])
    ])

-(defn -getData [this]
+(defn -getData [#^org.dada.core.ModelImpl this]
   (let [[mutable-state] (.state this)
 	[extant extinct] @mutable-state]
     (or (vals extant) '())))

-(defn -update [#^AbstractModel this & inputs]
+(defn -update [#^org.dada.core.ModelImpl this & inputs]
   ;;(debug "MODELIMPL -update:" this inputs)
   (let [[mutable-state update-fn] (.state this)
 	;;dummy (debug "MODELIMPL INPUT:" inputs)
-	[_ _ _ _ output-insertions output-alterations output-deletions]
+	[_ _ output-insertions output-alterations output-deletions]
 	(apply swap! mutable-state update-fn inputs)
 	;;dummy (debug "MODELIMPL OUTPUT:" output-insertions output-alterations output-deletions)
 	]


[PDOK-1022] generator support for close actions

--- src/main/clojure/pdok/featured/generator.clj
+++ src/main/clojure/pdok/featured/generator.clj
@@ -42,6 +42,12 @@
       (assoc :_current_validity (:_validity feature))
       (assoc :_validity (tf/unparse date-time-formatter (local-now)))))

+(defn transform-to-close [feature]
+  (-> feature
+      (assoc :_action "close")
+      (assoc :_current_validity (:_validity feature))
+      (assoc :_validity (tf/unparse date-time-formatter (local-now)))))
+
 (defn transform-to-nested [feature]
   (apply dissoc feature [:_action :_collection :_id :_validity :_current_validity]))

@@ -68,13 +74,12 @@
          feature (reduce (fn [acc [attr generator]] (add-attribute acc attr generator)) feature attributes)]
       feature)))

-(defn selective-change-feature
+(defn selective-feature
   ([feature]
-   (let [change (transform-to-change feature)
-         feature (-> change
+   (let [result (-> feature
                      remove-an-attribute
                      nillify-an-attribute)]
-     feature)))
+     result)))

 (defn combine-to-nested-feature [[base & rest-features] attr top-geometry?]
   (let [base (if top-geometry? base (dissoc base :_geometry))
@@ -84,9 +89,17 @@
       1 (assoc base attr (first nested-features))
       (assoc base attr (into [] nested-features)))))

-(defn followed-by-change [feature]
-  (let [changed (selective-change-feature feature)]
-    (list feature changed)))
+(defn followed-by [feature change? close?]
+  (let [change (fn [f] (selective-feature (transform-to-change f)))
+        close  (fn [f] (selective-feature (transform-to-close f)))
+        result [feature]
+        result (if change?
+                 (conj result (change feature))
+                 result)
+        result (if close?
+                 (conj result (close feature))
+                 result)]
+    result))

 (defn create-attributes [simple-attributes & {:keys [names]}]
   (let [attribute-names (or names (repeatedly simple-attributes #(random-word 5)))
@@ -95,15 +108,15 @@
     attributes))

 (defn random-json-features [out-stream dataset collection total & args]
-  (let [{:keys [updates? nested geometry?] :or {updates? false nested 0 geometry? true}} args
+  (let [{:keys [change? close? nested geometry?] :or {change? false close? false nested 0 geometry? true}} args
         validity (tf/unparse date-time-formatter (local-now))
         attributes (create-attributes 3)
         new-features (repeatedly #(random-new-feature collection attributes))
         with-nested (map #(combine-to-nested-feature % "nested" geometry?) (partition (+ 1 nested) new-features))
-        with-changed (if updates? (mapcat followed-by-change with-nested) with-nested)
+        with-extra (mapcat #(followed-by % change? close?) with-nested)
         package {:_meta {}
                  :dataset dataset
-                 :features (take total with-changed)}]
+                 :features (take total with-extra)}]
     (json/generate-stream package out-stream)))

 (defn- random-json-feature-stream* [out-stream dataset collection total & args]
@@ -122,27 +135,32 @@
     (with-open [w (clojure.java.io/writer (str ".test-files/new-features-single-collection-" c ".json"))]
       (random-json-features w "newset" "collection1" c))))

-(defn generate-test-files-with-updates []
+(defn generate-test-files-with-changes []
   (doseq [c [10 100 1000 10000 100000]]
-    (with-open [w (clojure.java.io/writer (str ".test-files/update-features-single-collection-" c ".json"))]
-      (random-json-features w "updateset" "collection1" c :updates? true))))
+    (with-open [w (clojure.java.io/writer (str ".test-files/change-features-single-collection-" c ".json"))]
+      (random-json-features w "changeset" "collection1" c :change? true))))
+
+(defn generate-test-files-with-closes []
+  (doseq [c [10 100 1000 10000 100000]]
+    (with-open [w (clojure.java.io/writer (str ".test-files/close-features-single-collection-" c ".json"))]
+      (random-json-features w "closeset" "collection1" c :close? true))))

 (defn generate-test-files-with-nested-feature []
   (doseq [c [5 50 500 5000 50000]]
     (with-open [w (clojure.java.io/writer (str ".test-files/new-features-nested-feature-" c ".json"))]
-      (random-json-features w "updateset" "collection1" c :nested 1))))
+      (random-json-features w "nestedset" "collection1" c :nested 1))))

 (defn generate-test-files-with-nested-features []
   (doseq [c [3 33 333 3333 33333]]
     (with-open [w (clojure.java.io/writer (str ".test-files/new-features-nested-features-" c ".json"))]
-      (random-json-features w "newset" "collection1" c :nested 2))))
+      (random-json-features w "nestedset" "collection1" c :nested 2))))

 (defn generate-test-files-with-nested-feature-no-top-geometry []
   (doseq [c [10 100 1000 10000 100000]]
     (with-open [w (clojure.java.io/writer (str ".test-files/new-features-nested-feature-no-top-geometry-" c ".json"))]
-      (random-json-features w "newset" "collection1" c :nested 1 :geometry? false))))
+      (random-json-features w "nestedset" "collection1" c :nested 1 :geometry? false))))

 (defn generate-test-files-with-nested-features-no-top-geometry []
   (doseq [c [5 50 500 5000 50000]]
     (with-open [w (clojure.java.io/writer (str ".test-files/new-features-nested-features-no-top-geometry-" c ".json"))]
-      (random-json-features w "newset" "collection1" c :nested 2 :geometry? false))))
+      (random-json-features w "nestedset" "collection1" c :nested 2 :geometry? false))))


Had to convert result of `concat` to vector in `add-values-to-stack`

--- src/simple_symbolic_regression_clojure/interpreter.clj
+++ src/simple_symbolic_regression_clojure/interpreter.clj
@@ -30,6 +30,13 @@
        (or (not (= op :÷))
            (legal-division-stack? stack))))

+(defn add-values-to-stack
+  [stack values]
+  (if (sequential? values)
+    (vec (concat values stack))
+    (conj stack values)
+    ))
+
 (defn process-binary-operator [op stack]
   "Apply a binary operator to the given stack, returning the updated stack"
   (if (legal-binary-op-stack? op stack)
@@ -39,13 +46,6 @@
       (add-values-to-stack new-stack
             ((translate-op op) arg1 arg2)))
     stack))
-
-(defn add-values-to-stack
-  [stack values]
-  (if (seq? values)
-    (concat values stack)
-    (conj stack values)
-  ))

 (defn binary-operator? [token]
   (contains? #{:+ :- :* :÷ :swap} token))


Adding ability to quit with q.

Adding ability to quit with q.

--- src/opengl_sandbox/antons/hello_triangle.clj
+++ src/opengl_sandbox/antons/hello_triangle.clj
@@ -1,6 +1,7 @@
 (ns opengl-sandbox.antons.hello-triangle
   (:require [clojure.java.io :as jio])
   (:import [org.lwjgl BufferUtils]
+           [org.lwjgl.input Keyboard]
            [org.lwjgl.opengl Display DisplayMode PixelFormat ContextAttribs
                              GL11 GL15 GL20 GL30]))

@@ -80,13 +81,20 @@
     (GL30/glBindVertexArray 0)
     vao))

+(defn isRunning? []
+  (not (or (Display/isCloseRequested)
+           (Keyboard/isKeyDown (Keyboard/KEY_Q)))))
+
 (defn render-loop []
   (let [vao (populate-vao (map create-float-buffer [triangle-points colour-points]))
         shader-program (create-shader-program)]
-    (while (not (Display/isCloseRequested))
+    (loop [running (isRunning?)]
       (Display/update)
       (draw shader-program vao)
-      (Display/sync 60))))
+      (Display/sync 60)
+      (when running
+        (recur (isRunning?))))
+    (println "Stopping...")))

 (defn init-gl []
   (GL11/glEnable GL11/GL_DEPTH_TEST)


added telescoping functions; testing full project for proper referencing

--- src/clj/forma/trends/analysis.clj
+++ src/clj/forma/trends/analysis.clj
@@ -1,7 +1,7 @@
 (ns forma.trends.analysis
   (:use [forma.matrix.utils]
         [clojure.math.numeric-tower :only (sqrt floor abs expt)]
-        [forma.trends.filter :only (deseasonalize make-reliable hp-filter)])
+        [forma.trends.filter])
   (:require [forma.utils :as utils]
             [incanter.core :as i]
             [incanter.stats :as s]))


Writing keep alive correctly

Writing keep alive correctly

--- src/clj/fortress/ring/handler.clj
+++ src/clj/fortress/ring/handler.clj
@@ -13,7 +13,7 @@
 (defn- add-keep-alive [http-request ring-response]
   (if (HttpHeaders/isKeepAlive http-request)
     (do
-      (assoc-in ring-response [:headers "connection"] "keep-alive"))
+      (assoc-in ring-response [:headers "Connection"] "Keep-Alive"))
     ring-response))


remove useless code

remove useless code

--- src/cljs/triboard/logic/turn.cljs
+++ src/cljs/triboard/logic/turn.cljs
@@ -67,7 +67,6 @@
 (defn get-player [turn] (:player turn))
 (defn get-board [turn] (:board turn))
 (defn get-scores [turn] (:scores turn))
-(defn get-moves [turn] (:moves turn))

 (defn get-moves-of
   "Access the available moves for the provided player, by coordinates"


Make update time displayed in appropriate time zone

--- src/clojournal/routes/article.clj
+++ src/clojournal/routes/article.clj
@@ -4,7 +4,8 @@
             [clojournal.layout :as layout]
             [clojournal.models.article :as article]
             [clojournal.models.author :as author]
-            [noir.session :as session]))
+            [noir.session :as session]
+            [clj-time.local :as local]))

 (defn parse-content [content]
   (lazy-seq
@@ -44,7 +45,7 @@
          :author (:name author)
          :tags (str/join ", " (:tags article))
          :path path
-         :updated-at (:updated-at article)}))))
+         :updated-at (local/to-local-date-time (:updated-at article))}))))

 (defroutes article-routes
   (GET "/entry/:id" [id]