fix default-value-callback

fix default-value-callback

--- src/er_cassandra/model/callbacks/default_value_callback.clj
+++ src/er_cassandra/model/callbacks/default_value_callback.clj
@@ -6,4 +6,6 @@
   [col default-val]
   (fn [r]
     (let [v (get r col)]
-      (assoc r col (or v default-val)))))
+      (if-not (contains? r col)
+        (assoc r col (or v default-val))
+        r))))


resolve warnings; use isLetter for readability

The warnings were on Leiningen 2.5.1 on Java 1.8.0_45 OpenJDK 64-Bit Server VM:
call to static method isUpperCase on java.lang.Character can't be resolved (argument types: unknown).
call to static method isLowerCase on java.lang.Character can't be resolved (argument types: unknown).

--- bob/example.clj
+++ bob/example.clj
@@ -5,8 +5,7 @@

 (defn- question?   [msg] (= \? (last msg)))

-(defn- has-letter? [msg] (some #(or (Character/isUpperCase %)
-                                    (Character/isLowerCase %)) msg))
+(defn- has-letter? [msg] (some #(Character/isLetter (int %)) msg))

 (defn- shouting?   [msg] (and (= msg (str/upper-case msg))
                               (has-letter? msg)))


whitespace

whitespace

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -171,7 +171,6 @@
                   {:synsem {:subcat {:1 {:cat :noun}
                                      :2 '()}
                             :sem {:pred :be}}})
-

            ;; be + propernoun, e.g. "My name is John"
            (let [gender (atom :top)
@@ -238,26 +237,27 @@
                           :sem {:pred :be-able-to}}}

    "be born" {:synsem {:cat :verb
-                         :sem {:pred :be-born}}
-                :english {:future "be born"
-                          :participle "being born"
-                          :conditional "be born"
-                          :imperfect {:1sing "was being born"
-                                      :2sing "were being born"
-                                      :3sing "was being born"
-                                      :1plur "were being born"
-                                      :2plur "were being born"
-                                      :3plur "were being born"}
-                          :past {:english "was born"
-                                 :2sing "were born"
-                                 :2plur "were born"
-                                 :3plur "were born"}
-                          :present {:1sing "am born"
-                                    :2sing "are born"
-                                    :3sing "is born"
-                                    :1plur "are born"
-                                    :2plur "are born"
-                                    :3plur "are born"}}}
+                       :sem {:pred :be-born}}
+              :english {:future "be born"
+                        :participle "being born"
+                        :conditional "be born"
+                        :imperfect {:1sing "was being born"
+                                    :2sing "were being born"
+                                    :3sing "was being born"
+                                    :1plur "were being born"
+                                    :2plur "were being born"
+                                    :3plur "were being born"}
+                        :past {:english "was born"
+                               :2sing "were born"
+                               :2plur "were born"
+                               :3plur "were born"}
+                        :present {:1sing "am born"
+                                  :2sing "are born"
+                                  :3sing "is born"
+                                  :1plur "are born"
+                                  :2plur "are born"
+                                  :3plur "are born"}}}
+
    "be missed" {:synsem {:cat :verb
                          :sem {:pred :mancare}}
                 :english {:future "be missed"
@@ -327,14 +327,12 @@
                [(unify common
                        {:synsem {:sem {:pred :believe}
                                  :subcat {:2 '()}}}) ;; intransitive
-
                 (unify common
                        {:synsem {:sem {:pred :believe}
                                  :subcat {:2 {:cat :comp
                                               :comp-type :that
                                               :subcat '()}
                                           :3 '()}}})])
-
    "bicycle" {:synsem {:cat :noun
                        :sem {:pred :bicycle
                              :artifact true
@@ -387,8 +385,7 @@
                     :present {:3sing "buys"}}}

    "call" {:synsem {:cat :verb
-                     :sem {:pred :call}}}
-
+                    :sem {:pred :call}}}
    "can"
     (let [modal-subject (atom {:cat :noun
                                :sem {:animate true}})
@@ -560,6 +557,7 @@
    "earn"  {:synsem {:cat :verb
                      :sem {:pred :earn
                            :subj {:human true}}}}
+
    "eat" {:english {:past "ate"}
           :synsem {:cat :verb
                    :sem {:pred :mangiare
@@ -737,7 +735,6 @@
       :english {:participle "getting up"
                 :present {:3sing "gets up"}
                 :past "got up"}})
-
    "Gianluca"
    {:synsem {:agr {:number :sing
                    :person :3rd
@@ -773,11 +770,10 @@
                     :pred :giovanni-and-i}
               :subcat '()}}]

-      ;; TODO: account for "give" being ditransitive.
+   ;; TODO: account for "give" being ditransitive.
    "give" {:synsem {:cat :verb
                     :sem {:pred :give}}
            :english {:past "gave"}}
-
    "go"
    {:synsem {:cat :verb
               :sem {:activity true
@@ -886,7 +882,6 @@
              :subcat {:1 {:cat :noun}
                       :2 {:cat :noun
                           :sem {:human true}}}}}
-
    "her"
    [{:synsem {:cat :det
               :agr {:number :sing}
@@ -1148,7 +1143,6 @@
                     :number :sing}
               :sem {:human false}
               :subcat '()}}]
-
    "keep"
    [{:synsem {:cat :verb
               :sem {:pred :tenere}}


+TODO

+TODO

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2638,7 +2638,9 @@
        {:synsem {:cat :verb
                  :subcat {:2 {:cat :top}}}})

-      ;; prevent :modal-with :infinitive matching unless it's already set
+      ;; this key: :modal-with determines inflection of argument of a modal verb
+      ;; values can be :infinitive,:root, or false
+      ;; TODO: should be possible to do with a modal verb's subcat instead of a whole new key.
       (default
        {:modal-with false
         :synsem {:cat :verb}})


remove babel.english.workbook/parse:  use babel.english/parse instead

--- src/babel/english/workbook.clj
+++ src/babel/english/workbook.clj
@@ -3,8 +3,9 @@
   (:require
    [babel.engine :as engine]
    [babel.generate :refer [lightning-bolt]]
+   [babel.english :refer [parse]]
    [babel.english.grammar :refer [small small-plus-plus-np medium np-grammar]]
-   [babel.english.lexicon :refer :all]
+   [babel.english.lexicon :refer [lexicon]]
    [babel.english.morphology :as morph :refer [fo]]
    [babel.english.writer :refer [expression]]
    [babel.html :as html]
@@ -50,12 +51,6 @@

 (defn lookup [lexeme]
   ((:lookup medium) lexeme))
-
-(defn parse
-  ([string]
-   (parse/parse string medium))
-  ([string model]
-   (parse/parse string model)))

 (defn expr [id]
   (reader/id2expression (Integer. id)))


+vp-32

--- src/babel/francais/grammar.clj
+++ src/babel/francais/grammar.clj
@@ -384,6 +384,17 @@
                             :synsem {:aux false
                                      :infl :present
                                      :sem {:tense :present}
+                                     :cat :verb}})
+
+
+                   ;; e.g. used as: "je m'appelle Jean" -
+                   ;; [s-present-phrasal 'je' [vp-pronoun-phrasal 'm'' [vp32 'se appeler' 'Jean']]]
+                   (unifyc h32
+                           root-is-head
+                           {:rule "vp-32"
+                            :head {:phrasal false}
+                            :synsem {:aux false
+                                     :infl {:not :past}
                                      :cat :verb}})

                    ;; [s-present "je" [vp-pronoun "m'" "amuse"]]
@@ -496,7 +507,8 @@
                                         (= (:rule %) "s-conditional-phrasal")
                                         (= (:rule %) "s-present-phrasal")
                                         (= (:rule %) "s-future-phrasal")
-                                        (= (:rule %) "vp-aux-22"))
+                                        (= (:rule %) "vp-aux-22")
+                                        (= (:rule %) "vp-32"))
                                    grammar))))]
       {:name "medium"
        :enrich enrich


+s-conditional-phrasal,s-future-phrasal

+s-conditional-phrasal,s-future-phrasal

--- src/babel/francais/grammar.clj
+++ src/babel/francais/grammar.clj
@@ -492,7 +492,9 @@
           (seq (union (set (:grammar @small))
                       (set (filter #(or (= (:rule %) "vp-pronoun-nonphrasal")
                                         (= (:rule %) "vp-pronoun-phrasal")
+                                        (= (:rule %) "s-conditional-phrasal")
                                         (= (:rule %) "s-present-phrasal")
+                                        (= (:rule %) "s-future-phrasal")
                                         (= (:rule %) "vp-aux-22"))
                                    grammar))))]
       {:name "medium"


Add a datatype-uri implementation for clojure.lang.BigInt

--- src/rdf-common/grafter/rdf/protocols.clj
+++ src/rdf-common/grafter/rdf/protocols.clj
@@ -189,6 +189,10 @@
   (datatype-uri [t]
     (->java-uri xsd:integer))

+  clojure.lang.BigInt
+  (datatype-uri [t]
+    (->java-uri xsd:integer))
+
   java.math.BigDecimal
   (datatype-uri [t]
     (->java-uri xsd:decimal))


don't override mappings

don't override mappings

--- src/sikhsiyasat/font_converter/core.cljs
+++ src/sikhsiyasat/font_converter/core.cljs
@@ -50,7 +50,7 @@
         mapper                  (get-mapper name->source-char name->target-char)

         group-mapper            (get-group-mapper p-mappings/all-groups name->source-char name->target-char)
-        merged-mapper           (merge mapper group-mapper)
+        merged-mapper           (merge-with (fn [a b] a) mapper group-mapper)

         target-move-right-chars (set (map #(name->target-char %1) (target-font "moveRightCharacters")))
         source-move-right-chars (set (map #(name->target-char %1) (source-font "moveRightCharacters")))


Fill in manga fox's page link scraping

Fill in manga fox's page link scraping

--- src/clj/comic_reader/sites.clj
+++ src/clj/comic_reader/sites.clj
@@ -28,8 +28,15 @@
       :page-list-data-for-comic-chapter
       (fn [chapter-url]
         {:url chapter-url
-         :selector [:div]
-         :normalize link->map})})
+         :selector [:div#top_center_bar :form#top_bar
+                    :select.m :option]
+         :normalize (let [base-url (s/replace chapter-url
+                                              #"/\d+\.html"
+                                              "")]
+                      (fn [{{name :value} :attrs}]
+                        {:name name
+                         :url (format "%s/%s.html"
+                                      base-url name)}))})})

    (let [canonical-url "http://www.mangareader.net"
          link->map (gen-link->map s/trim


signal small fix (lowpass)

signal small fix (lowpass)

--- src/clojure2d/extra/signal.clj
+++ src/clojure2d/extra/signal.clj
@@ -394,18 +394,15 @@

 ;; SIMPLE LOWPASS/HIGHPASS

-(deftype StateSimpleLowpass [^double prev])
-
 (defn simple-lowpass
   ""
-  ([alpha ^StateSimpleLowpass state sample]
-   (let [prev (.prev state)
-         s1 (* sample alpha)
+  ([alpha prev sample]
+   (let [s1 (* sample alpha)
          s2 (- prev (* prev alpha))
          nprev (+ s1 s2)]
-     (StateWithS. nprev (StateSimpleLowpass. nprev))))
+     (StateWithS. nprev nprev)))
   ([_]
-   (StateSimpleLowpass. 0.0)))
+   0.0))

 (defn simple-highpass
   ""


added note

added note

--- src/corpus_utils/wikipedia.clj
+++ src/corpus_utils/wikipedia.clj
@@ -83,7 +83,7 @@
                                    #{})
                            :sentences sentences})
                         paragraphs)
-                  [0 :tags] conj :title)}))
+                  [0 :tags] conj :title)})) ; NOTE: the first sentence is always a title.

 (s/defn document-seq :- [DocumentSchema]
   "Given a suitable (quasi)XML file generated from a Wikipedia dump, returns a lazy sequence of maps containing sources meta-information and parsed paragraphs."


typical-monitor-pressure uses pressure-as

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -2,7 +2,7 @@
   #?(:cljs (:require [test-utils.core :as tuc])
      :clj (:require (test-utils [core :as tuc]))))

-(def physical-quantities [:densty
+(def physical-quantities [:density
                           :energy
                           :force
                           :length
@@ -78,6 +78,16 @@
                    [:m3 :bbl]                 #(* % (factors [:m3 :bbl]))}]
     (converter [from to])))

+;; I model a measurement as a 2- or 3-item vector. These functions make the intent of some code clearer when
+;; manipulating measurements.
+(defn make-measurement
+  ([magnitude unit] [magnitude unit])
+  ([magnitude unit other] [magnitude unit other]))
+
+(def magnitude first)
+(def unit second)
+(def other last)
+
 (defn as-f [from-unit to-unit factor]
   (fn [[magnitude from] to]
     (condp = [from to]
@@ -90,6 +100,7 @@
 (def energy-as (as-f :ft-lb :J 1.35582))
 (def force-as (as-f :lbf :N 4.44822))
 (def power-as (as-f :hp :W 745.69987158227022))
+(def pressure-as (as-f :psi :kPa 6.894757293168361))
 (def proppant-concentration-as (as-f :lb-per-gal :kg-per-m3 119.826))
 (def slurry-rate-as (as-f :bpm :m3-per-min 6.28981077))

@@ -407,15 +418,12 @@
     (tuc/draw-normal mean sigma)))

 (defn typical-monitor-pressure
-  ([units]
-   (cond (= units :psi)
-         (first (p-mon-seq))
-         (= units :kPa)
-         ((convert-units-f :psi :kPa) (typical-monitor-pressure :psi))
-         (= units :MPa)
-         ((convert-units-f :kPa :MPa) (typical-monitor-pressure :kPa))))
-  ([] (let [unit (rand-pressure-unit)]
-        [unit (typical-monitor-pressure unit)])))
+  ([] (typical-monitor-pressure (rand-pressure-unit)))
+  ([pressure-unit]
+   (let [pressure-magnitude (cond (= pressure-unit :psi) (first (p-mon-seq))
+                                  (= pressure-unit :kPa)
+                                  (magnitude (pressure-as (typical-monitor-pressure :psi) :kPa)))]
+     [pressure-magnitude pressure-unit])))

 (defn typical-monitor-temperature
   ([] (let [units (rand-nth [:C :F])]
@@ -433,9 +441,7 @@
    (cond (= units :psi)
          (value-from-typical-range 5000 9000)
          (= units :kPa)
-         ((convert-units-f :psi :kPa) (typical-monitor-pressure :psi))
-         (= units :MPa)
-         ((convert-units-f :kPa :MPa) (/ (typical-monitor-pressure :kPa) 1000)))))
+         ((convert-units-f :psi :kPa) (typical-monitor-pressure :psi)))))

 (defn surface-treating-pressure-seq [arg]
   (cond (int? arg)


typical-power uses power-as

typical-power uses power-as

--- src/test_utils/fracture_diagnostics.cljc
+++ src/test_utils/fracture_diagnostics.cljc
@@ -47,7 +47,6 @@
                    [:ft-lb :J]                1.35582
                    [:m :ft]                   3.28084
                    [:kg :lb]                  2.20462262185
-                   [:hp :W]                   745.69987158227022
                    [:lb-per-gal :kg-per-m3]   119.826
                    ;; slurry rate conversion not needed (use [:bbl :m3])
                    [:m3 :bbl]                 6.28981077}
@@ -59,8 +58,6 @@
                    [:m :ft]                   #(* % (factors [:m :ft]))
                    [:kg :lb]                  #(* % (factors [:kg :lb]))
                    [:lb :kg]                  #(/ % (factors [:kg :lb]))
-                   [:hp :W]                   #(* % (factors [:hp :W]))
-                   [:W :hp]                   #(/ % (factors [:hp :W]))
                    [:lb-per-gal :kg-per-m3]   #(* % (factors [:lb-per-gal :kg-per-m3]))
                    [:kg-per-m3 :lb-per-gal]   #(/ % (factors [:lb-per-gal :kg-per-m3]))
                    [:m3-per-min :bpm]         #(* % (factors [:m3 :bbl]))
@@ -614,12 +611,10 @@
 (defn typical-power
   ([] (typical-power (rand-power-unit)))
   ([power-unit]
-   (let [typical-energy (first (typical-total-pump-energy :J))
-         typical-power  (condp = power-unit
-                          :W  typical-energy ;; Assume energy expended for 1 s
-                          :hp ((convert-units-f :W :hp) (first (typical-power :W))))]
-     [typical-power power-unit])))
-
+   (let [typical-energy (first (typical-total-pump-energy :J))]
+     (condp = power-unit
+       :W (make-measurement typical-energy power-unit) ;; assume energy expended for 1 s
+       :hp (power-as (typical-power :W) :hp)))))

 (def measured-at-location [:downhole :surface])

@@ -659,4 +654,4 @@
         measurement (generate-measurement-f unit)]
     [measurement (measurement-as-f measurement (first (remove (partial = unit) units)))]))

-(generate-pair #{:lbf :N} rand-force-unit typical-force force-as)
+(generate-pair #{:hp :W} rand-power-unit typical-power power-as)


Add tests for alter optiosn

Add tests for alter optiosn

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -488,4 +488,24 @@
          (normalize-string
           (alter-table :foo
                        (alter-column :foo :int)))))
+
+  (is (= "
+  ALTER TABLE foo ADD bar varchar"
+         (normalize-string
+          (alter-table :foo
+                       (add-column :bar :varchar)))))
+
+  (is (= "
+  ALTER TABLE foo DROP bar"
+         (normalize-string
+          (alter-table :foo
+                       (drop-column :bar)))))
+
+  (is (= "
+  ALTER TABLE foo ALTER foo TYPE int"
+         (normalize-string
+          (alter-table :foo
+                       (alter-column :foo :int)
+                       (with-options {:default-ttl 100})
+                       ))))
   )


Added additional testing of range validation.

--- test/cmr/system_int_test/search/granule_psa_search_test.clj
+++ test/cmr/system_int_test/search/granule_psa_search_test.clj
@@ -7,7 +7,7 @@
             [cmr.system-int-test.data2.collection :as dc]
             [cmr.system-int-test.data2.granule :as dg]
             [cmr.system-int-test.data2.core :as d]
-            [cmr.search.services.parameter-converters.attribute :as am]))
+            [cmr.search.services.messages.attribute-messages :as am]))

 (use-fixtures :each (ingest/reset-fixture "PROV1"))

@@ -26,9 +26,9 @@
        "string,,a,b" (am/invalid-name-msg "")
        "string,alpha," (am/invalid-value-msg :string "")
        "string,alpha" (am/invalid-num-parts-msg)
-       "string,alpha,," (am/one-of-min-max-msg))
-  ;; comment out this failing test temporarily to make build pass
-  ;"string,alpha,b,a" "")
+       "string,alpha,," (am/one-of-min-max-msg)
+       "string,alpha,b,a" (am/max-must-be-greater-than-min-msg "b" "a")
+       "string,alpha,b,b" (am/max-must-be-greater-than-min-msg "b" "b"))

   (is (= {:status 422 :errors [(am/attributes-must-be-sequence-msg)]}


change score_threshold

change score_threshold

--- bot/dl.clj
+++ bot/dl.clj
@@ -44,11 +44,11 @@
                                                        "Authorization" (str "Bearer " access-token)}
                                              :body    (json/encode
                                                         {:payload {:image {:imageBytes img-bytes}}
-                                                         :params  {:score_threshold "0.3"}})})
+                                                         :params  {:score_threshold "0.01"}})})
           payload (:payload (json/decode body true))]
       (cond
         (pos? (count payload))
-        [status (parse-result (first payload))]
+        [status (parse-result (->> payload (sort-by #(get-in % [:classification :score]) >) first))]

         (and (= 200 status)
              (zero? (count payload)))


require midje.sweet rather than use

require midje.sweet rather than use

--- test/ephemeris/points_test.clj
+++ test/ephemeris/points_test.clj
@@ -1,6 +1,6 @@
 (ns ephemeris.points-test
-  (:use [midje.sweet])
-  (:require [ephemeris.points :as ps]))
+  (:require [midje.sweet :refer :all]
+            [ephemeris.points :as ps]))

 (facts "points"
   (ps/lookup :Sun) => 0


Test-get-formatted-time-1

--- test/emender_jenkins/time_utils_test.clj
+++ test/emender_jenkins/time_utils_test.clj
@@ -77,3 +77,15 @@
            60000 (compute-sleep-amount 1)
           120000 (compute-sleep-amount 2))))

+(deftest test-get-formatted-time-1
+    "Check the function emender-jenkins.time-utils/get-formatted-time."
+    (testing "the function emender-jenkins.time-utils/get-formatted-time."
+        (are [x y] (= x (get-formatted-time y))
+            "1970-01-01 01:00:00"   0  ; Britain remaining on GMT+1 throughout the year 1970!
+            "1970-01-01 01:00:00"   1
+            "1970-01-01 01:00:01"   1000
+            "1970-01-01 01:00:02"   2000
+            "1970-01-01 01:01:00"   (* 60 1000)
+            "1970-01-01 01:02:00"   (* 2 60 1000)
+            "1970-01-01 02:00:00"   (* 60 60 1000))))
+


Test-get-formatted-time-negative-ms-value


Update project.clj

Update project.clj

--- src/jarkeeper/views/project.clj
+++ src/jarkeeper/views/project.clj
@@ -96,8 +96,7 @@
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
-                "/status.png\">"))]
-        ]
+                "/status.png\">"))]]
        [:section.installation-instructions.row
         [:h2 "Markdown with SVG image"]
         [:code


update repl specials parser for 1.7.145

update repl specials parser for 1.7.145

--- src/main/cljs_api_gen/parse.clj
+++ src/main/cljs_api_gen/parse.clj
@@ -534,7 +534,11 @@
     ;; everything >= r993
     (when (and (list? form)
                (= (take 2 form) '(def default-special-fns)))
-      (let [[_let _bindings form-map] (nth form 2)]
+      (let [[_let _bindings value] (nth form 2)
+            form-map (if (cljs-cmp >= "1.7.145")
+                       (let [[_wrap-special-fns _wrap-self form-map] value]
+                         form-map)
+                       value)]
         (->> (keys form-map)
              (map second) ;; (quote x) => x
              (remove namespace)) ;; we'll ignore namespace-qualified special forms


evaluate-model-file takes options too.

evaluate-model-file takes options too.

--- project/analyze-data/src/analyze_data/evaluate_model.clj
+++ project/analyze-data/src/analyze_data/evaluate_model.clj
@@ -63,9 +63,10 @@
   data.

   model-file: path to a file containing serialized model
-  test-file: path to a csv with 'document-label' and 'document-text' headers"
-  [model-file test-file]
+  test-file: path to a csv with 'document-label' and 'document-text' headers
+  options: as for evaluate-model"
+  [model-file test-file & options]
   (with-open [in (io/reader test-file)]
     (let [model (read-object model-file)
           test-corpus (csv-to-map in)]
-      (evaluate-model model test-corpus))))
+      (apply evaluate-model model test-corpus options))))


Specify index when connecting nodes

Specify index when connecting nodes

--- src/alder/node-graph.cljs
+++ src/alder/node-graph.cljs
@@ -26,23 +26,24 @@
         to-audio-node (:audio-node to-node)

         output-data (-> from-node :node-type :outputs output-id)
+        output-index (:index output-data)
+
         input-data (-> to-node :node-type :inputs input-id)
         input-name (:name input-data)]
     (case (:type input-data)
-      :param (f from-audio-node (aget to-audio-node input-name))
-      :node (f from-audio-node to-audio-node))
-
-    ))
+      :param (f from-audio-node (aget to-audio-node input-name) output-index)
+      :node (f from-audio-node to-audio-node output-index)
+      :gate (f from-audio-node to-audio-node output-index))))

 (defn connect-nodes [node-graph from to]
   (println "connect" from to)
-  (set-connection node-graph from to #(.call (aget %1 "connect") %1 %2))
+  (set-connection node-graph from to #(.call (aget %1 "connect") %1 %2 %3))
   (update-in node-graph [:connections]
                (fn [conns] (conj conns [from to]))))

 (defn disconnect-nodes [node-graph from to]
   (println "disconnect" from to)
-  (set-connection node-graph from to #(.call (aget %1 "disconnect") %1 %2))
+  (set-connection node-graph from to #(.call (aget %1 "disconnect") %1 %2 %3))
   (update-in node-graph [:connections]
              (fn [conns] (vec (remove #(= % [from to]) conns)))))


Delete fn wrap-line.

Delete fn wrap-line.

--- src/beebster_clj/core.clj
+++ src/beebster_clj/core.clj
@@ -113,12 +113,5 @@

-(defn wrap-line
-  "wrap text to given size."
-  [size text]
-  (re-pattern (str ".{0," size "}\\s"))
-  (clojure.string/replace text #" " "\n"))

-
-


Changed one local camelCase var to kebab-case

--- src/chessground/show.cljs
+++ src/chessground/show.cljs
@@ -10,8 +10,8 @@
   (common/$ (str ".square[data-key=" key "]") root))

 (defn selected [root selected]
-  (doseq [anySelected (common/$$ ".square.selected" root)]
-    (-> anySelected .-classList (.remove "selected")))
+  (doseq [any-selected (common/$$ ".square.selected" root)]
+    (-> any-selected .-classList (.remove "selected")))
   (when selected (-> (square-of root selected) .-classList (.add "selected"))))

 (defn moved [root orig dest]


CLJS-574: No warnings when calling functions from unrequired namespaces

Change resolve-ns-alias to special case cljs.core, goog, and Math
namespaces. Special case convention around cljs.core data structures,
but don't support elsewhere. Emit a "no such namespace" warning if we
don't find ns in (-> env :ns :requires).

--- src/clj/cljs/analyzer.clj
+++ src/clj/cljs/analyzer.clj
@@ -167,6 +167,19 @@
 (defn resolve-ns-alias [env name]
   (let [sym (symbol name)]
     (get (:requires (:ns env)) sym sym)))
+
+(defn confirm-ns [env ns-sym]
+  (condp get ns-sym
+    '#{cljs.core goog Math} :>> identity
+    (-> env :ns :requires) :>> identity
+    ;; our internal conventions around data structures
+    ;; should not be allowed elsewhere
+    (if-not (== (.indexOf (str ns-sym) "cljs.core") -1)
+      ns-sym
+      (do (when (:undeclared *cljs-warnings*)
+            (warning env
+              (str "WARNING: No such namespace: " ns-sym)))
+        ns-sym))))

 (defn core-name?
   "Is sym visible from core in the current compilation namespace?"
@@ -191,6 +204,7 @@
                  ns (if (= "clojure.core" ns) "cljs.core" ns)
                  full-ns (resolve-ns-alias env ns)]
              (when confirm
+               (confirm-ns env full-ns)
                (confirm env full-ns (symbol (name sym))))
              (merge (get-in @namespaces [full-ns :defs (symbol (name sym))])
                     {:name (symbol (str full-ns) (str (name sym)))
@@ -730,8 +744,10 @@
                                          (error-msg spec ":refer must be followed by a sequence of symbols in :require / :require-macros"))
                                  (when-not macros?
                                    (swap! deps conj lib))
-                                 (merge (when alias {rk {alias lib}})
-                                        (when referred {uk (apply hash-map (interleave referred (repeat lib)))})))))
+                                 (merge
+                                   (when alias
+                                     {rk (merge {alias lib} {lib lib})})
+                                   (when referred {uk (apply hash-map (interleave referred (repeat lib)))})))))
         use->require (fn use->require [[lib kw referred :as spec]]
                        (assert (and (symbol? lib) (= :only kw) (sequential? referred) (every? symbol? referred))
                                (error-msg spec "Only [lib.ns :only (names)] specs supported in :use / :use-macros"))


move to *recur-frames* list

move to *recur-frames* list

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -515,10 +515,10 @@

 (def specials '#{if def fn* do let* loop* throw try* recur new set! ns deftype* . js* & quote})

-(def ^:dynamic *recur-frame* nil)
+(def ^:dynamic *recur-frames* nil)

 (defmacro disallowing-recur [& body]
-  `(binding [*recur-frame* nil] ~@body))
+  `(binding [*recur-frames* (cons nil *recur-frames*)] ~@body))

 (defn analyze-block
   "returns {:statements .. :ret .. :children ..}"
@@ -614,7 +614,7 @@
         locals (reduce (fn [m fld] (assoc m fld {:name (symbol (str gthis "." (munge fld)))})) locals fields)
         locals (reduce (fn [m name] (assoc m name {:name (munge name)})) locals params)
         recur-frame {:names (vec (map munge params)) :flag (atom nil)}
-        block (binding [*recur-frame* recur-frame]
+        block (binding [*recur-frames* (cons recur-frame *recur-frames*)]
                 (analyze-block (assoc env :context :return :locals locals) body))]

     (merge {:env env :variadic variadic :params (map munge params) :max-fixed-arity fixed-arity :gthis gthis :recurs @(:flag recur-frame)} block)))
@@ -663,7 +663,7 @@
              [bes env])))
         recur-frame (when is-loop {:names (vec (map :name bes)) :flag (atom nil)})
         {:keys [statements ret children]}
-        (binding [*recur-frame* (or recur-frame *recur-frame*)]
+        (binding [*recur-frames* (if recur-frame (cons recur-frame *recur-frames*) *recur-frames*)]
           (analyze-block (assoc env :context (if (= :expr context) :return context)) exprs))]
     {:env encl-env :op :let :loop is-loop
      :bindings bes :statements statements :ret ret :form form :children (into [children] (map :init bes))}))
@@ -678,12 +678,13 @@

 (defmethod parse 'recur
   [op env [_ & exprs] _]
-  (let [context (:context env)]
-    (assert *recur-frame* "Can't recur here")
-    (assert (= (count exprs) (count (:names *recur-frame*))) "recur argument count mismatch")
-    (reset! (:flag *recur-frame*) true)
+  (let [context (:context env)
+        frame (first *recur-frames*)]
+    (assert frame "Can't recur here")
+    (assert (= (count exprs) (count (:names frame))) "recur argument count mismatch")
+    (reset! (:flag frame) true)
     (assoc {:env env :op :recur}
-      :frame *recur-frame*
+      :frame frame
       :exprs (disallowing-recur (vec (map #(analyze (assoc env :context :expr) %) exprs))))))

 (defmethod parse 'quote


refactor some model's API

refactor some model's API

--- src/cljc/cyrats/game.cljc
+++ src/cljc/cyrats/game.cljc
@@ -6,11 +6,11 @@

 ;; utils
 (defn log-message [game message]
-  (update-in game [:messages] (fn [v] (conj v message))))
+  (update-in game [:messages] conj message))

 (defn clear-messages
   [game]
-  (update-in game [:messages] (fn [v] (vec []))))
+  (assoc game :messages []))

 (defn ->module
   [hp ap dp]
@@ -25,9 +25,15 @@
   (apply (partial merge-with +) modules))

+(def MODULES
+  (for [hp (range 5)
+        ap (range 5)
+        dp (range 5)]
+    (->module hp ap dp)))

-(defn make-modules-for-game []
-  (map #(apply ->module %) (shuffle (selections [0 1 2 3 4] 3))))
+(defn make-modules-for-game
+  []
+  (shuffle MODULES))

 (defn rat-stats
   [{modules :modules}]
@@ -44,7 +50,7 @@

 (defn rat-energy-required
   [rat]
-  (apply + (vals (rat-stats rat))))
+  (reduce + (vals (rat-stats rat))))

 ;; arena rat
 (defn rat-is-alive?
@@ -134,6 +140,5 @@

 ;; (defn give-init-modules [players modules cnt]
-;;   (map #(update % :modules (take cnt
+;;   (map #(update % :modules (take cnt
 (give-init-modules [:1 :2])
-


Add ability to specify custom CSS for specific automata.

--- src/cljs/beatha/core.cljs
+++ src/cljs/beatha/core.cljs
@@ -156,6 +156,9 @@

 (defprotocol CellularAutomatonAppCustomization
+  (automaton-specific-css [this]
+    "Return additional CSS rules for given automaton that should be added
+    to the page.")
   (automaton-command-view [this]
     "Generates Om component that renders block for sending commands to
     automaton. Please ensure the same component is returned on each call and
@@ -181,6 +184,7 @@
      (gen-app-view automaton-spec
                    (reify
                      CellularAutomatonAppCustomization
+                     (automaton-specific-css [_] "")
                      (automaton-command-view [_] empty-view)
                      (automaton-command-initial-state [_] {})
                      (automaton-command-reset [_ _])
@@ -267,6 +271,8 @@
          (render-state [_ state]
            (dom/div
             #js {:className "container-liquid"}
+            (dom/style #js {:media "screen" :type "text/css"}
+                       (automaton-specific-css customization))
             (dom/div
              #js {:className "row"}
              (navigation-button "Menu" render-menu-view)
@@ -411,6 +417,7 @@
 (def unrestricted-language-parser-customization
   (reify
     CellularAutomatonAppCustomization
+    (automaton-specific-css [_] "")
     (automaton-command-view [this] unrestricted-language-parser-command-view)
     (automaton-command-initial-state [_] {})
     (automaton-command-reset [_ input-channel] (put! input-channel {}))
@@ -627,6 +634,7 @@
 (def market-model-customization
   (reify
     CellularAutomatonAppCustomization
+    (automaton-specific-css [_] "")
     (automaton-command-view [_] market-command-view)
     (automaton-command-initial-state [_]
       (let [params (a/market-model-default-params


Implement ordering short circuit

Implement ordering short circuit

A graph ordering is deterministic with respect to the initial ordered
layer that we feed in. Therefore, if we've seen the initial layer
before, there's no point in continuing.

--- src/cljs/fatlip/core.cljs
+++ src/cljs/fatlip/core.cljs
@@ -586,9 +586,12 @@
                         (-> first-sparse-layer
                             (dissoc :nodes)
                             (assoc :items (:nodes first-sparse-layer))))
-           first-layers #{first-layer}]
+           first-layers #{}]
       (let [c (count orderings)]
-        (if (= c 20)
+        ;; Graph orderings are determined by the first layer. If we've seen this
+        ;; first layer before, then we can be sure that we're about to enter
+        ;; a cycle, and can thus short circuit
+        (if (or (= c 20) (contains? first-layers first-layer))
           orderings
           (let [reverse? (odd? c)
                 ordered-graph (-> (if reverse?
@@ -601,7 +604,7 @@
                 layers (:layers ordered-graph)
                 last-layer (layers (dec (count layers)))]
             ;; The last layer of the current ordering is the first layer of the next
-            (recur ords last-layer (conj first-layers last-layer))))))))
+            (recur ords last-layer (conj first-layers first-layer))))))))

 (defn neighborify


Keep IDs in key order

Keep IDs in key order

--- src/cljs/geoforms/db.cljs
+++ src/cljs/geoforms/db.cljs
@@ -93,7 +93,7 @@

 (def email (atom nil))

-(def ideas (mr/sync-r ideas-ref ->id-vec))
+(def ideas (mr/sync-r ideas-ref (comp ->id-vec sort)))

 (def categories (mr/sync-list categories-ref))


Fixed accordian toggle problem on departments/employees page

--- src/cljs/metime/core.cljs
+++ src/cljs/metime/core.cljs
@@ -79,10 +79,10 @@
                ]
                [:h2 department]
                [:button {:class "btn glyphicon glyphicon-sort col-md-offset-11 col-md-1 col-xs-offset-11 col-xs-1"
-                         :data-toggle "collapse" :data-parent "accordian" :data-target (str "#" department)}]
+                         :data-toggle "collapse" :data-parent "accordian" :data-target (str "#" (clojure.string/replace department #"[\s]" "-"))}]
               ]

-              [:div.panel-body.panel-collapse.collapse {:id department :style {:height "auto"}}
+              [:div.panel-body.panel-collapse.collapse {:id (clojure.string/replace department #"[\s]" "-") :style {:height "auto"}}
                  (for [employee-row rows-of-employees]
                    [:div {:class "row accordian-inner" }
                     (for [employee-info-component (om/build-all employee-info employee-row)]


Skybox methods

Skybox methods

--- src/clojure/yaw/world.clj
+++ src/clojure/yaw/world.clj
@@ -137,6 +137,23 @@
   [world item1 item2]
   (.isInCollision world item1 item2))

+;;SKYBOX MANAGEMENT---------------------------------------------------
+(defn skybox "Retrieve the skybox of the world" [world] (.getSkybox world))
+
+(defn set-skybox!
+  "Create a flat-colored skybox for the `world` with the
+  specified scale and color"
+  [world & {[w,l,h] :scale,
+            [r,g,b] :color,
+            :or {[w,l,h] [1000 1000 1000]
+                 [r,g,b] [0 0 0]}}]
+  (.setSkybox world w l h r g b))
+
+(defn clear-skybox!
+  "Remove the current skybox from the `world`"
+  [world]
+  (.removeSkybox world))
+
 ;; Item/camera Manipulation ------------------------------------------------
 (defn rotate! [item & {:keys [x y z]
                        :or   {x 0


day18 cleanup

day18 cleanup

--- src/adventofcode2017/day18.clj
+++ src/adventofcode2017/day18.clj
@@ -3,6 +3,9 @@
             [clojure.java.io :as io]))

 (def input (slurp (io/resource "2017/day18")))
+
+(def instructions (->> (str/split-lines input)
+                       (map #(str/split % #"\s"))))

 (defn get-val [m k]
   (if (number? (read-string k))
@@ -10,135 +13,85 @@
     (get m k 0)))

 ;; part 1
-(def instructions
-  (->> (str/split-lines input)
-       (map #(condp re-matches %
-               #"snd .+"
-               (let [[_ x] (re-matches #"snd (.+)" %)]
-                 (fn [state i]
-                   [(assoc state :snd (get-val state x))
-                    (inc i)]))
+(defmulti command first)

-               #"set .+ .+"
-               (let [[_ x y] (re-matches #"set (.+) (.+)" %)]
-                 (fn [state i]
-                   [(assoc state x (get-val state y))
-                    (inc i)]))
+(defmethod command "snd" [[_ x]]
+  (fn [state i]
+    [(assoc state :snd (get-val state x))
+     (inc i)]))

-               #"add .+ .+"
-               (let [[_ x y] (re-matches #"add (.+) (.+)" %)]
-                 (fn [state i]
-                   [(assoc state x (+ (get state x 0)
-                                      (get-val state y)))
-                    (inc i)]))
+(defmethod command "set" [[_ x y]]
+  (fn [state i]
+    [(assoc state x (get-val state y))
+     (inc i)]))

-               #"mul .+ .+"
-               (let [[_ x y] (re-matches #"mul (.+) (.+)" %)]
-                 (fn [state i]
-                   [(assoc state x (* (get state x 0)
-                                      (get-val state y)))
-                    (inc i)]))
+(defmethod command "add" [[_ x y]]
+  (fn [state i]
+    [(update state x (fnil + 0) (get-val state y))
+     (inc i)]))

-               #"mod .+ .+"
-               (let [[_ x y] (re-matches #"mod (.+) (.+)" %)]
-                 (fn [state i]
-                   [(assoc state x (mod (get state x 0)
-                                        (get-val state y)))
-                    (inc i)]))
+(defmethod command "mul" [[_ x y]]
+  (fn [state i]
+    [(update state x (fnil * 0) (get-val state y))
+     (inc i)]))

-               #"rcv .+"
-               (let [[_ x] (re-matches #"rcv (.+)" %)]
-                 (fn [state i]
-                   (if (zero? (get-val state x))
-                     [state (inc i)]
-                     [(assoc state :rcv true) i])))
+(defmethod command "mod" [[_ x y]]
+  (fn [state i]
+    [(update state x (fnil rem 0) (get-val state y))
+     (inc i)]))

-               #"jgz .+ .+"
-               (let [[_ x y] (re-matches #"jgz (.+) (.+)" %)]
-                 (fn [state i]
-                   (if (pos? (get-val state x))
-                     [state (+ i (get-val state y))]
-                     [state (inc i)])))))))
+(defmethod command "rcv" [[_ x]]
+  (fn [state i]
+    (if (zero? (get-val state x))
+      [state (inc i)]
+      [(assoc state :rcv true) i])))
+
+(defmethod command "jgz" [[_ x y]]
+  (fn [state i]
+    (if (pos? (get-val state x))
+      [state (+ i (get-val state y))]
+      [state (inc i)])))

 (loop [state {}
        i 0]
-  (let [[new-state j] ((nth instructions i) state i)]
+  (let [[new-state j] ((command (nth instructions i)) state i)]
     (if (:rcv new-state)
       (:snd new-state)
       (recur new-state j))))
 ; 3423

 ;; part 2
-(def instructions2
-  (->> (str/split-lines input)
-       (map #(condp re-matches %
-               #"snd .+"
-               (let [[_ x] (re-matches #"snd (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   [(update state :snd inc)
-                    (conj queue (get-val state x))
-                    rcv-queue
-                    (inc i)]))
+(comment
+  (defmethod command "snd" [[_ x]]
+    (fn [state i]
+      [(-> state
+           (update :snd inc)
+           (update :snd-queue #(conj % (get-val state x))))
+       (inc i)]))

-               #"set .+ .+"
-               (let [[_ x y] (re-matches #"set (.+) (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   [(assoc state x (get-val state y))
-                    queue rcv-queue
-                    (inc i)]))
+  (defmethod command "rcv" [[_ x]]
+    (fn [state i]
+      (if-some [val (first (:rcv-queue state))]
+        [(-> state
+             (assoc x val)
+             (assoc :rcv false)
+             (update :rcv-queue #(vec (rest %))))
+         (inc i)]
+        [(assoc state :rcv true) i])))

-               #"add .+ .+"
-               (let [[_ x y] (re-matches #"add (.+) (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   [(assoc state x (+ (get state x 0)
-                                      (get-val state y)))
-                    queue rcv-queue
-                    (inc i)]))
+  (defn transfer [state-a state-b]
+    (-> state-b
+        (assoc :snd-queue (:rcv-queue state-a))
+        (assoc :rcv-queue (:snd-queue state-a))))

-               #"mul .+ .+"
-               (let [[_ x y] (re-matches #"mul (.+) (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   [(assoc state x (* (get state x 0)
-                                      (get-val state y)))
-                    queue rcv-queue
-                    (inc i)]))
-
-               #"mod .+ .+"
-               (let [[_ x y] (re-matches #"mod (.+) (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   [(assoc state x (mod (get state x 0)
-                                        (get-val state y)))
-                    queue rcv-queue
-                    (inc i)]))
-
-               #"rcv .+"
-               (let [[_ x] (re-matches #"rcv (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   (if-some [val (first rcv-queue)]
-                     [(-> state
-                          (assoc x val)
-                          (assoc :rcv false))
-                      queue
-                      (vec (rest rcv-queue))
-                      (inc i)]
-                     [(assoc state :rcv true) queue rcv-queue i])))
-
-               #"jgz .+ .+"
-               (let [[_ x y] (re-matches #"jgz (.+) (.+)" %)]
-                 (fn [state queue rcv-queue i]
-                   (if (pos? (get-val state x))
-                     [state queue rcv-queue (+ i (get-val state y))]
-                     [state queue rcv-queue (inc i)])))))))
-
-(loop [p0 {"p" 0 :snd 0}
-       p1 {"p" 1 :snd 0}
-       q0 []
-       q1 []
-       i 0
-       j 0]
-  (let [[new-p0 q00 q10 a] ((nth instructions2 i) p0 q0 q1 i)
-        [new-p1 q11 q01 b] ((nth instructions2 j) p1 q10 q00 j)]
-    (if (and (:rcv new-p0) (:rcv new-p1))
-      (:snd new-p1)
-      (recur new-p0 new-p1 q01 q11 a b))))
-; 7493
+  (loop [p0 {"p" 0 :snd 0 :rcv false :snd-queue [] :rcv-queue []}
+         p1 {"p" 1 :snd 0 :rcv false :snd-queue [] :rcv-queue []}
+         i 0
+         j 0]
+    (let [[new-p0 a] ((command (nth instructions i)) p0 i)
+          [new-p1 b] ((command (nth instructions j)) (transfer new-p0 p1) j)]
+      (if (every? :rcv [new-p0 new-p1])
+        (:snd new-p1)
+        (recur (transfer new-p1 new-p0) new-p1 a b))))
+  ; 7493
+  )


Make sure function names are unique.

Make sure function names are unique.

--- src/afterglow/fixtures/qxf.clj
+++ src/afterglow/fixtures/qxf.clj
@@ -72,10 +72,12 @@

 (defn- check-capabilities
   "Makes sure a capability list is sorted in increasing order and has
-  no gaps, adding nil sections for any unused ranges."
+  no gaps, adding nil sections for any unused ranges, and adding
+  trailing numbers to make all labels unique if needed."
   [caps]
   (loop [remaining (sort-by :min caps)
          last-end -1
+         labels {}
          result []]
     (if (empty? remaining)
       (if (< last-end 255)  ; Fill in final gap
@@ -84,8 +86,14 @@
       (let [current (first remaining)
             adjusted (if (< (inc last-end) (:min current))  ; Fill in a gap in capabilities
                        (conj result {:min (inc last-end) :max (dec (:min current))})
-                       result)]
-        (recur (rest remaining) (:max current) (conj adjusted current))))))
+                       result)
+            label (:label current)
+            label-count (when label (inc (get labels (:label current) 0)))
+            unique (if (and label (> label-count 1))
+                     (assoc current :label (str label " " label-count))
+                     current)
+            updated-labels (if label (assoc labels label label-count) labels)]
+        (recur (rest remaining) (:max current) updated-labels (conj adjusted unique))))))

 (defn expand-capability
   "Returns an Afterglow function specification corresponding to a


Returning always an int for total pop

Returning always an int for total pop

--- src/amindblowingworld/civs.clj
+++ src/amindblowingworld/civs.clj
@@ -299,7 +299,7 @@
 ; --------------------------------------

 (defn total-pop []
-  (reduce + (map :pop (vals (.settlements @game)))))
+  (int (reduce + (map :pop (vals (.settlements @game))))))

 (defn pop-balancer []
   (let [pop (total-pop)]


another fix 4 chat-message

another fix 4 chat-message

--- src/clj/funstructor/commands.clj
+++ src/clj/funstructor/commands.clj
@@ -160,11 +160,11 @@
   (let [game-id (u/uuid-from-string (get-in command [:data :game-id]))
         message (get-in command [:data :message])
         player-id (gs/player-for-channel (gs/current-global-state) channel)]
-    (send-command-by-channels {:type :chat-message-response
-                               :data {:player-id (gs/get-player-name (gs/current-global-state) player-id)
-                                      :message message}}
-                              (map #(gs/channel-for-player (gs/current-global-state) %)
-                                   (f/get-game-players (gs/get-game (gs/current-global-state) game-id))))))
+    (apply send-command-by-channels {:type :chat-message-response
+                                     :data {:player-id (gs/get-player-name (gs/current-global-state) player-id)
+                                            :message message}}
+           (map #(gs/channel-for-player (gs/current-global-state) %)
+                (f/get-game-players (gs/get-game (gs/current-global-state) game-id))))))

 (defmethod handle-command :default [command channel]
   (u/printerr "Unrecognized command: " command))


switch to html5 history, since old one appears broken now

--- src/cljs/apollo/client/core.cljs
+++ src/cljs/apollo/client/core.cljs
@@ -17,8 +17,9 @@
             [apollo.client.events :as e]
             [apollo.client.state :as state]
             [cljs.core.async :refer [<! sub chan dropping-buffer timeout]])
+  (:import goog.history.Html5History))

-  (:import goog.History))
+(defonce history (Html5History.))

 (def nav-map {:nav-browse "#/"
               :nav-recent "#/recent"
@@ -137,8 +138,7 @@

 (defn main []
   (secretary/set-config! :prefix "#")
-  (let [history (History.)]
-    (events/listen history "navigate"
+  (events/listen history "navigate"
                    (fn [event]
                      (secretary/dispatch! (.-token event))
                      (swap! app-state assoc :current-token (.-token event))
@@ -146,6 +146,6 @@
                        (<! (timeout 100))
                        (reset-post-filter))
                      true))
-    (.setEnabled history true)))
+  (doto history (.setEnabled true)))

 (main)


Use `forall' instead of `doseq' in some test-case

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/tests/base.clj
+++ src/conexp/tests/base.clj
@@ -457,8 +457,8 @@
                             (map #(disj mht %)
                                  mht)))
                   mhts))))
-  (forall [selection (map (partial take 20)
-                          (take 100 (iterate shuffle (subsets (set-of-range 10)))))]
+  (doseq [selection (map (partial take 20)
+                         (take 100 (iterate shuffle (subsets (set-of-range 10)))))]
     (let [base-set (reduce union selection),
           mscs     (minimum-set-covers base-set selection),
           mhts     (minimal-hypergraph-transversals


Simplify views

Simplify views

--- src/discuss/references/main.cljs
+++ src/discuss/references/main.cljs
@@ -108,17 +108,34 @@
   (reify om/IRender
     (render [_]
       (let [issue (:issue data)
+            reference (:reference data)
             statement (:statement data)
             author (:author data)]
-        (dom/div nil
-                 (dom/div #js {:className "bs-callout bs-callout-info"}
-                          (dom/div #js {:className "pull-right"}
-                                   (bs/button-default-sm #(save-statement-change-view data) (vlib/fa-icon "fa-check") " Auswählen"))
-                          (dom/a #js {:href    "javascript:void(0)"
-                                      :onClick #(save-statement-change-view data)}
-                                 (dom/strong nil (:text statement)))
-                          (dom/div nil "Issue: " (:title issue))
-                          (dom/div nil "Autor: " (:nickname author))))))))
+        (bs/callout-info
+          (dom/strong nil (:text statement))
+          (dom/div nil
+                   "Reference:"
+                   (dom/br nil)
+                   (dom/i nil "\"" (:title reference) "\""))
+          (dom/div nil "Issue: " (:title issue))
+          (dom/div nil "Autor: " (:nickname author)))))))
+
+(defn usage-list-view
+  "List single usages of reference."
+  [data _owner]
+  (reify om/IRender
+    (render [_]
+      (let [issue (:issue data)
+            statement (:statement data)
+            author (:author data)]
+        (bs/callout-info
+          (dom/div #js {:className "pull-right"}
+                   (bs/button-default-sm #(save-statement-change-view data) (vlib/fa-icon "fa-check") " Auswählen"))
+          (dom/a #js {:href    "javascript:void(0)"
+                      :onClick #(save-statement-change-view data)}
+                 (dom/strong nil (:text statement)))
+          (dom/div nil "Issue: " (:title issue))
+          (dom/div nil "Autor: " (:nickname author)))))))

 (defn usages-view
   "List with details showing the usages of the given reference."
@@ -129,9 +146,8 @@
         (dom/div nil
                  (dom/h5 nil "Wo wird diese Referenz verwendet?")
                  (rlib/current-reference-component)
-                 (dom/div nil
-                          (apply dom/div nil
-                                 (map #(om/build usage-view (lib/merge-react-key %)) usages))))))))
+                 (apply dom/div nil
+                        (map #(om/build usage-list-view (lib/merge-react-key %)) usages)))))))

 (defn agree-disagree-view
   "Agree or disagree with the selected reference."


Use cond instead of nesting if's. Also fixed some formatting.

--- src/asid/json_doc_exchange.clj
+++ src/asid/json_doc_exchange.clj
@@ -7,11 +7,10 @@

 (defn- ct [req-or-resp]
   (let [hdrs (:headers req-or-resp)]
-    (if (contains? hdrs "Content-Type")
-      (get hdrs "Content-Type")
-      (if (contains? hdrs "content-type")
-        (get hdrs "content-type")
-        ""))))
+    (cond
+     (contains? hdrs "Content-Type") (get hdrs "Content-Type")
+     (contains? hdrs "content-type") (get hdrs "content-type")
+     :else "")))

 (fact
   (ct (mr/request :get "/")) => ""
@@ -33,12 +32,12 @@
 (defn json-documents [handler]
   (fn [req]
     (let [json-doc (if (content-type-json? req)
-                          (try
-                            (json/read-str (slurp (:body req)))
-                            (catch Exception _
-                              (-> (rr/response "JSON could not be parsed.")
-                                  (rr/status 400))))
-                          nil)
+                     (try
+                       (json/read-str (slurp (:body req)))
+                       (catch Exception _
+                         (-> (rr/response "JSON could not be parsed.")
+                             (rr/status 400))))
+                     nil)
           response (handler (conj req [:json-doc json-doc]))]
       (if (content-type-json? response)
         (conj response [:body (json/write-str (:body response))])


+refer lexiconfn/defaults

+refer lexiconfn/defaults

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2,9 +2,10 @@
   (:refer-clojure :exclude [get-in])
   (:require
    [babel.encyclopedia :as encyc]
-   [babel.lexiconfn :refer (compile-lex if-then
-                                        map-function-on-map-vals unify
-                                        verb-pred-defaults)]
+   [babel.lexiconfn :refer [compile-lex default
+                            if-then
+                            map-function-on-map-vals unify
+                            verb-pred-defaults]]
    [babel.english.morphology :as morph]
    [babel.english.pos :refer [adjective
                               intransitivize


changed pred from mangiare to eat

changed pred from mangiare to eat

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -595,7 +595,7 @@

    "eat" {:english {:past "ate"}
           :synsem {:cat :verb
-                   :sem {:pred :mangiare}}}
+                   :sem {:pred :eat}}}

    "eat dinner" {:synsem {:cat :verb
                           :sem {:pred :have-dinner}
@@ -1303,13 +1303,13 @@

    ;; TODO: combine all "look X" into "look" with different subcategorizations
    "look for" {:synsem {:cat :verb
-                        :sem {:pred :cercare}}
+                        :sem {:pred :look-for}}
                :english {:participle "looking for"
                          :past "looked for"
                          :present {:3sing "looks for"}}}

    "look up" {:synsem {:cat :verb
-                       :sem {:pred :cercare}}
+                       :sem {:pred :look-up}}
               :english {:participle "looking up"
                         :past "looked up"
                         :present {:3sing "looks up"}}}


billing accounts require user, not  admin (#1298)

--- src/cljs/main/broadfcui/page/billing/create_project.cljs
+++ src/cljs/main/broadfcui/page/billing/create_project.cljs
@@ -56,7 +56,7 @@
                 "Lowercase letters, numbers, and hypens only, 6-30 characters, must start with a letter."]
                [:div {:style {:fontSize "120%"}}
                 "2. Select a billing account:"]
-               [:div {:style {:fontSize "80%" :fontStyle "italic"}} "To grant FireCloud access to an account, enter its console and add billing@firecloud.org as a Billing Administrator."]
+               [:div {:style {:fontSize "80%" :fontStyle "italic"}} "To grant FireCloud access to an account, enter its console and add billing@firecloud.org as a Billing Account User."]
                (let [simple-th (fn [text]
                                  [:th {:style {:textAlign "left" :padding "0 0.5rem"}} text])
                      simple-td (fn [for text]


CMR-4772: Updated JSON filed name to collection_concept_id.

--- search-app/src/cmr/search/results_handlers/atom_json_results_handler.clj
+++ search-app/src/cmr/search/results_handlers/atom_json_results_handler.clj
@@ -101,7 +101,7 @@
                        :title title
                        :updated updated
                        :dataset_id dataset-id
-                       :collection-concept-id collection-concept-id
+                       :collection_concept_id collection-concept-id
                        :producer_granule_id producer-gran-id
                        :granule_size size
                        :original_format original-format


rename Submissions to Analysis Submissions

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary/tab.cljs
@@ -92,7 +92,7 @@
       (style/create-paragraph
         [:div {} (get-in ws ["workspace" "createdBy"])]
         [:div {} (common/format-date (get-in ws ["workspace" "createdDate"]))])
-      (style/create-section-header "Submissions")
+      (style/create-section-header "Analysis Submissions")
       (style/create-paragraph
         (let [fail-count (->> submissions
                            (filter (complement all-success?))


add a small banner telling the viewer exactly which workspace they're editing permissions for

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary_tab.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/summary_tab.cljs
@@ -44,6 +44,11 @@
              (when (:saving? @state)
                [comps/Blocker {:banner "Updating..."}])
              [:div {:style {:paddingBottom "0.5em" :fontSize "90%"}}
+              [:h4 {} (let [workspace-id (:workspace-id props)
+                            ws-name (:name workspace-id)
+                            ws-ns (:namespace workspace-id)]
+                        (str "Permisssions for "
+                          (clojure.string/join ":" [ws-ns ws-name])))]
               [:div {:style {:float "left" :width column-width}} "User or Group ID"]
               [:div {:style {:float "right" :width column-width}} "Access Level"]
               (common/clear-both)]


allow protocol buffer source files to be specified in the project's :proto-path

--- src/clj/leiningen/protobuf.clj
+++ src/clj/leiningen/protobuf.clj
@@ -121,20 +121,21 @@
      (protoc project protos (io/file (:target-dir project) "protosrc")))
   ([project protos dest]
      (let [target (:target-dir project)
-           dest-path (.getPath dest)]
-       (when (or (> (modtime "proto") (modtime dest))
-                 (> (modtime "proto") (modtime "classes")))
+           dest-path (.getPath dest)
+           proto-path (or (:proto-path project) "proto")]
+       (when (or (> (modtime proto-path) (modtime dest))
+                 (> (modtime proto-path) (modtime "classes")))
          (.mkdirs dest)
          (.mkdir (io/file target "proto"))
          (doseq [proto protos]
            (println "Compiling" proto "to" dest-path)
-           (extract-dependencies (io/file "proto" proto) target)
+           (extract-dependencies (io/file proto-path proto) target)
            (sh "protoc"
                proto
                (str "--java_out=" dest-path)
                "-I."
                (str "-I" target "/proto")
-               :dir "proto"))
+               :dir proto-path))
          (javac (assoc project :java-source-path dest-path))))))

 (defn compile-google-protobuf
@@ -151,7 +152,8 @@

 (defn compile
   "Compile protocol buffer files located in proto dir."
-  ([project] (compile project (proto-files (io/file "proto"))))
+  ([project]
+     (compile project (proto-files (io/file (or (:proto-path project) "proto")))))
   ([project files]
      (install project)
      (when (= "protobuf" (:name project))


wrapped internet and file access in futures with invoke-soon for widget updates - much more responsive that way - thanks Dave for suggestion.

--- src/clj_ns_browser/browser.clj
+++ src/clj_ns_browser/browser.clj
@@ -267,9 +267,11 @@
     (ss/funnel [(ss/select :doc-tf) (ss/select :doc-cbx)])
     (b/filter (fn [o] (not (or (nil? (first o)) (= "" (first o))
                                (nil? (second o))(= "" (second o))))))
-    (b/transform #(render-doc-text (first %) (second %)))
-    (b/notify-soon)
-    (b/property (ss/select :doc-ta) :text))
+    (b/transform
+      (fn [o]
+        (future
+          (let [s (render-doc-text (first o) (second o))]
+            (invoke-soon (ss/config! :doc-ta :text s)))))))
   ;;
   ;; new text in doc-ta => scroll to top
   (b/bind
@@ -283,13 +285,14 @@
     (b/transform (fn [o] (ss/selection :doc-cbx)))
     (b/transform (fn [o]
       (if (= "Doc" o)
-        true
-        (if (or (= "Examples" o)(= "Comments" o))
-          (if-let [fqn (ss/config :doc-tf :text)]
-            (if-let [url (clojuredocs-url fqn)]
-              true))))))
-    (b/notify-soon)
-    (b/property (ss/select :browse-btn) :enabled?))
+        (invoke-soon (ss/config! :browse-btn :enabled? true))
+          (if (or (= "Examples" o)(= "Comments" o))
+            (if-let [fqn (ss/config :doc-tf :text)]
+              (future
+                (let [url (clojuredocs-url fqn)
+                      r (if url true false)]
+                  (invoke-soon
+                    (ss/config! :browse-btn :enabled? r))))))))))
   ;
   (b/bind
     (ss/funnel [(ss/select :doc-tf) (ss/select :doc-cbx)])
@@ -302,28 +305,30 @@
     (b/notify-soon)
     (b/property (ss/select :edit-btn) :enabled?))
   ;
-    ;; require-btn pressed =>
-  ;; (require ns), update (un-)loaded atoms, select loaded, select ns.
+    ;; browser-btn pressed =>
+  ;; bring up browser with url
   (b/bind
     browse-btn-atom
     (b/notify-soon)
     (b/transform (fn [& oo]
       (let [o (ss/selection :doc-cbx)]
         (when-let [fqn (ss/config :doc-tf :text)]
-          (cond
-            (= "Doc" o) (bdoc* fqn)
-            (or (= "Examples" o)(= "Comments" o))
-              (when-let [url (clojuredocs-url fqn)]
-                (clojure.java.browse/browse-url url))))))))
+          (future
+            (cond
+              (= "Doc" o) (bdoc* fqn)
+              (or (= "Examples" o)(= "Comments" o))
+                (when-let [url (clojuredocs-url fqn)]
+                  (clojure.java.browse/browse-url url)))))))))
   ;;
   ;; edit-btn pressed =>
   ;; if we find a local file (not inside jar), then send to $EDITOR.
   (b/bind
     edit-btn-atom
     (b/transform (fn [& o]
-      (when-let [m (meta-when-file (ss/config :doc-tf :text))]
-        (when-let [e (:out (clojure.java.shell/sh "bash" "-c" (str "echo -n $EDITOR")))]
-          (:exit (clojure.java.shell/sh "bash" "-c" (str e " +" (:line m) " " (:file m)))))))))
+      (future
+        (when-let [m (meta-when-file (ss/config :doc-tf :text))]
+          (when-let [e (:out (clojure.java.shell/sh "bash" "-c" (str "echo -n $EDITOR")))]
+            (:exit (clojure.java.shell/sh "bash" "-c" (str e " +" (:line m) " " (:file m))))))))))
   ;;
   ) ; end of bind-all


Make `write-index` concurrent, but it is slower because of the reduce cost

--- src/cljam/bam_index/writer.clj
+++ src/cljam/bam_index/writer.clj
@@ -212,6 +212,7 @@
   [bin-map1 bin-map2]
   (merge-with merge-chunks bin-map1 bin-map2))

+;;; slow ...
 (defn- merge-lidx
   [lidx1 lidx2]
   {:index (vec (map min (:index lidx1) (:index lidx2))) ; OPTIMIZE
@@ -243,8 +244,8 @@
  ; TODO: Parallelize
 (defn make-index1
   [refs alns]
-  (->> (partition-all 40 alns)
-       (map (partial make-index* refs))
+  (->> (partition-all 1000 alns)
+       (pmap (partial make-index* refs))
        (reduce merge-index)
        (finish-index refs)))


Removed unnecessary error-component

Removed unnecessary error-component

--- src/cljs/file_upload/core.cljs
+++ src/cljs/file_upload/core.cljs
@@ -16,16 +16,8 @@
 (defn status-component []
   (if-let [status (session/get :upload-status)]
     [:div
-     [:h3 "Upload Status"]
-     [:p "The file was uploaded and the server returned the following"]
+     [:h3 "Status"]
      [:p status]]))
-
-(defn error-component []
-  (if-let [err (session/get :upload-error)]
-    [:div
-     [:h3 "Upload Error"]
-     [:p "The file upload has failed. The following error was detected"]
-     [:p err]]))

 (defn upload-component []
   [:div
@@ -41,16 +33,18 @@
 (defn handle-response-ok [resp]
   (let [rsp (js->clj resp)]
     (.log js/console (str "Response OK: " rsp))
-    (session/put! :upload-status [:ul
-                                  [:li "Filename: " (get rsp "filename")]
-                                  [:li "Size: " (str (get rsp "size") " bytes")]
-                                  [:li "Tempfile: " (get rsp "tempfile")]])
-    (session/put! :upload-error nil)))
+    (session/put! :upload-status [:div
+                                  [:h4 "Upload Successful"]
+                                  [:ul
+                                   [:li "Filename: " (get rsp "filename")]
+                                   [:li "Size: " (str (get rsp "size") " bytes")]
+                                   [:li "Tempfile: " (get rsp "tempfile")]]])))

 (defn handle-response-error [ctx]
   (.log js/console (str "Response ERROR: " ctx))
-  (session/put! :upload-error (str ctx))
-  (session/put! :upload-status nil))
+  (session/put! :upload-status [:div
+                                [:h4 "Upload Failure"]
+                                [:p (str ctx)]]))

 (defn cljs-ajax-upload-file [element-id]
   (let [el (.getElementById js/document element-id)
@@ -75,25 +69,25 @@
 ;;; goog.net.IFrameIO routines
 (defn iframe-response-ok [json-msg]
   (let [msg (js->clj json-msg)]
-    (.log js/console (str "iframe-response-ok: " msg))
-    (session/put! :upload-status [:ul
-                                  [:li "Filename: " (get msg "filename")]
-                                  [:li "Size: " (str (get msg "size") " bytes")]
-                                  [:li "Tempfile: " (get msg "tempfile")]])
-    (session/put! :upload-error nil)))
+    (session/put! :upload-status [:div
+                                  [:h4 "Upload Success"]
+                                  [:ul
+                                   [:li "Filename: " (get msg "filename")]
+                                   [:li "Size: " (str (get msg "size") " bytes")]
+                                   [:li "Tempfile: " (get msg "tempfile")]]])))

 (defn iframe-response-error [json-msg]
   (let [msg (js->clj json-msg)]
     (.log js/console (str "iframe-response-error: " msg))
-    (session/put! :upload-error msg)
-    (session/put! :upload-status nil)))
+    (session/put! :upload-status [:div
+                                  [:h4 "Upload Failure"]
+                                  [:p (str msg)]])))

 ;;; Stole this from Dmitri Sotnikov - thanks.
 ;;; Original code is at https://github.com/yogthos
 (defn iframeio-upload-file [form-id]
   (let [el (.getElementById js/document form-id)
         iframe (IframeIo.)]
-    (.log js/console (str "El: " el))
     (events/listen iframe goog.net.EventType.SUCCESS
                    (fn [event]
                      (.log js/console "Success event fired")
@@ -105,24 +99,21 @@
     (events/listen iframe goog.net.EventType.COMPLETE
                    (fn [event]
                      (.log js/console "Complete event fired")))
-    (.log js/console (str "About to send file"))
-    (.sendFromForm iframe el "/upload")
-    (.log js/console (str "File sent?"))))
+    (.sendFromForm iframe el "/upload")))

 (defn iframeio-upload-button []
   [:div
    [:hr]
    [:button {:type "button"
              :on-click #(iframeio-upload-file "upload-form")}
-    "IframeIo Upload File"]])
+    "Upload Using IFrameIO"]])

 (defn home-page []
   (fn []
     [:div [:h2 "Welcome to file-upload"]
      [:p "This provides an example of different methods to upload a "
-      "file to the server fro a reagent based SPA."]
+      "file to the server fro a Reagent based client."]
      [status-component]
-     [error-component]
      [upload-component]
      [cljs-ajax-upload-button]
      [iframeio-upload-button]


corrected some algorithms

corrected some algorithms

--- src/cljs/russyll/translit.cljs
+++ src/cljs/russyll/translit.cljs
@@ -8,7 +8,7 @@
 (def palat-pat
   (re-pattern (globals/sformat "[%s](?=\\**[%s])" (++ (clojure.set/difference globals/rus-cons (set "жцшчщ"))) (++ globals/pals-vows))))

-(def j-extract-pat (re-pattern (globals/sformat "([%s])([ъь])([%s])?" (++ globals/rus-cons) (++ globals/all-vows))))
+(def j-extract-pat (re-pattern (globals/sformat "[%s][ъь][%s]?" (++ globals/rus-cons) (++ globals/all-vows))))
 (def j-test ["объявить" "нью" "объем"])

 (defn j-extract-fn [m]
@@ -26,8 +26,11 @@
 (defn palat-extract [word]
   (-- word palat-pat #(.toUpperCase %)))

+(defn last-palat [word]
+  (-- word (re-pattern "[лмнрцкгзвпджчшстбфщ][ъь]$") #(.toUpperCase (first %))))
+
 (defn ^:export translit [word]
-  (reduce #(%2 %1) word [j-extract palat-extract]))
+  (reduce #(%2 %1) word [last-palat j-extract palat-extract]))

 ;;;;;;;;;;;; This file autogenerated from src/cljx/translit.cljx


Bring back lein droid build support

Bring back lein droid build support

--- src/clojure/nightcode/lein.clj
+++ src/clojure/nightcode/lein.clj
@@ -8,6 +8,7 @@
             [leiningen.core.project]
             [leiningen.clean]
             [leiningen.cljsbuild]
+            [leiningen.droid]
             [leiningen.gwt]
             [leiningen.javac]
             [leiningen.new]
@@ -48,12 +49,12 @@
   [path]
   (.getCanonicalPath (io/file path "project.clj")))

-(defn add-robovm-path
+(defn add-sdk-path
   [project]
   (assoc-in project
-            [:ios :robovm-path]
-            (or (utils/read-pref :robovm)
-                (get-in project [:ios :robovm-path]))))
+            [:android :sdk-path]
+            (or (utils/read-pref :android-sdk)
+                (get-in project [:android :sdk-path]))))

 (defn read-project-clj
   [path]
@@ -61,9 +62,17 @@
     (let [project-clj-path (get-project-clj-path path)]
       (if-not (.exists (io/file project-clj-path))
         (println (utils/get-string :no-project-clj))
-        (try
-          (leiningen.core.project/read-raw project-clj-path)
-          (catch Exception e {}))))))
+        (-> (leiningen.core.project/read-raw project-clj-path)
+            add-sdk-path
+            (try (catch Exception e {})))))))
+
+(defn read-android-project
+  [project]
+  (leiningen.droid.classpath/init-hooks)
+  (some-> project
+          (leiningen.core.project/unmerge-profiles [:base])
+          leiningen.droid.utils/android-parameters
+          add-sdk-path))

 (defn create-file-from-template!
   [dir file-name template-namespace data]
@@ -190,7 +199,8 @@
   [path project]
   (cond
     (android-project? path)
-    nil
+    (some-> (read-android-project project)
+            (leiningen.droid/doall []))
     (ios-project? path)
     nil
     (clr-project? path)
@@ -204,7 +214,10 @@
   [path project]
   (cond
     (android-project? path)
-    nil
+    (when-let [project (read-android-project project)]
+      (doseq [cmd ["deploy" "repl"]]
+        (leiningen.droid/execute-subtask project cmd [])
+        (Thread/sleep 10000)))
     (clr-project? path)
     (leiningen.clr/clr project "repl")
     :else
@@ -214,7 +227,10 @@
   [path project]
   (cond
     (android-project? path)
-    nil
+    (some-> project
+            read-android-project
+            (assoc-in [:android :build-type] :release)
+            leiningen.droid/doall)
     (ios-project? path)
     nil
     (clr-project? path)


slitscan reorganized

slitscan reorganized

--- src/clojure2d/extra/glitch.clj
+++ src/clojure2d/extra/glitch.clj
@@ -10,13 +10,25 @@
 (def freqs (vec (map #(bit-shift-left 1 %) (range 16))))
 (def amps (vec (map #(/ 1.0 %) freqs)))

-(defn make-random-waves
+(defn slitscan-random-setup
   ""
-  []
-  (s/make-sum-wave (->> (m/irand 2 6)
-                        (range)
-                        (map #(s/make-wave (rand-nth s/waves) (freqs %) (amps %) (m/drand 1)))
-                        (filterv (fn [_] (m/brand 0.8))))))
+  ([n]
+   (let [f (fn []
+             (let [r (m/irand 4)]
+               {:wave (rand-nth s/waves)
+                :freq (freqs r)
+                :amp (amps r)
+                :phase (m/drand)}))]
+     (filter (fn [_] (m/brand 0.8)) (repeatedly n f))))
+  ([]
+   (slitscan-random-setup (m/irand 2 6))))
+
+(defn make-slitscan-waves
+  ""
+  ([waves]
+   (s/make-sum-wave (map #(s/make-wave (:wave %) (:freq %) (:amp %) (:phase %)) waves)))
+  ([]
+   (make-slitscan-waves (slitscan-random-setup))))

 (defn slitscan
   ""
@@ -32,7 +44,7 @@
 (defn make-slitscan-filter
   ""
   ([]
-   (partial p/filter-channel-xy (partial slitscan (make-random-waves) (make-random-waves))))
+   (partial p/filter-channel-xy (partial slitscan (make-slitscan-waves) (make-slitscan-waves))))
   ([fx fy]
    (partial p/filter-channel-xy (partial slitscan fx fy))))


print out the URL served

print out the URL served

--- src/crawler/rich_extractor.clj
+++ src/crawler/rich_extractor.clj
@@ -129,7 +129,7 @@
         :action-score (xpaths-scored decision)})))

 (defn extract-above-average-richest
-  "Extract XPaths with above average # of tokens"
+  "Extract above-average richness XPaths"
   ([page-src url]
      (extract-above-average-richest page-src url (set [])))

@@ -139,11 +139,17 @@
            xpaths-scored        (score-actions xpaths-tokenized)
            mean-richness        (/ (apply + (map second xpaths-scored))
                                    (count xpaths-scored))
+
+           ; return xpaths and scores of items who clocked above the
+           ; mean richness of the webpage
+
            decision             (filter
                                  (fn [[xpath score]]
                                    (>= score mean-richness))
                                  (reverse
                                   (sort-by second xpaths-scored)))
+
+           ; links at the chosen XPaths
            decision-links       (flatten
                                  (map
                                   (fn [[a-decision score]]
@@ -152,15 +158,19 @@
                                      (in-host-xpaths-hrefs a-decision)))
                                   decision))

+           ; this guy is computing the score products of the decisions alone
            decision-scores      (/ (reduce
                                     (fn [acc [a-decision score]]
                                       (+ acc score))
                                     0
                                     decision)
                                    (count decision))]
-       {:links decision-links
-        :action-score decision-scores
-        :xpaths (map first decision)})))
+       (do
+         (println :url url)
+         (println :decision decision)
+         {:links decision-links
+          :action-score decision-scores
+          :xpaths (map first decision)}))))

 (defn pagination?
   "Args:


Start making a proper prod config (#14)

Start making a proper prod config (#14)

--- build.boot
+++ build.boot
@@ -65,7 +65,7 @@
          '[reloaded.repl :refer [init start stop go reset]]
          '[environ.boot :refer [environ]]
          '[system.boot :refer [system run]]
-         '[herder.systems :refer [dev-system]]
+         '[herder.systems :refer [dev-system prod-system]]
          '[boot-figwheel]
          '[deraen.boot-sass :refer [sass]])
 (refer 'boot-figwheel :rename '{cljs-repl fw-cljs-repl})
@@ -181,6 +181,21 @@
    (test)
    (kill-pods)))

+(deftask prod []
+	(comp
+     (build)
+     (cljs)
+     (sift
+      :add-jar {'cljsjs/jquery-daterange-picker #"^cljsjs/common/jquery-daterange-picker.inc.css$"
+                'cljsjs/jquery-timepicker #"^cljsjs/common/jquery-timepicker.inc.css$"}
+      :move {#"cljsjs/common/(jquery-daterange-picker.inc.css)" "resources/public/css/$1"
+             #"cljsjs/common/(jquery-timepicker.inc.css)" "resources/public/css/$1"})
+     (sass)
+     (sift :move {#"herder/sass/(.*)" "resources/public/css/$1"})
+     (target :no-clean true)
+     (system :sys #'prod-system :auto)))
+
+
 (deftask watch-tests []
   (comp
    (watch)


cleanups

cleanups

--- build.boot
+++ build.boot
@@ -4,7 +4,6 @@
   :dependencies '[[perun "0.2.1-SNAPSHOT"]
                   [hiccup "1.0.5"]
                   [pygdown "0.1.5"]
-                  ;[hashobject/boot-s3 "0.1.2-SNAPSHOT"]
                   [clj-time "0.11.0"]
                   [confetti "0.1.0-SNAPSHOT"]
                   [pandeiro/boot-http "0.7.0"]
@@ -14,7 +13,6 @@
          '[code.hashobject.views.lib :as lib-view]
          '[code.hashobject.views.index :as index-view]
          '[pandeiro.boot-http :refer [serve]]
-        ;  '[hashobject.boot-s3 :refer :all]
          '[org.martinklepsch.boot-gzip :refer [gzip]]
          '[confetti.boot-confetti :refer [create-site sync-bucket]]
          '[io.perun.core :as perun]
@@ -41,14 +39,7 @@
     :creds {
       :access-key (System/getenv "AWS_ACCESS_KEY")
       :secret-key (System/getenv "AWS_SECRET_KEY")}
-  }
-  ; s3-sync {
-  ;   :bucket "code.hashobject.com"
-  ;   :source "resources/public/"
-  ;   :access-key (System/getenv "AWS_ACCESS_KEY")
-  ;   :secret-key (System/getenv "AWS_SECRET_KEY")
-  ;   :options {"Cache-Control" "max-age=315360000, no-transform, public"}}
-    )
+  })

 (defn parse-project-file [file]


Create dev-cljs and test-cljs tasks

Create dev-cljs and test-cljs tasks

--- build.boot
+++ build.boot
@@ -1,5 +1,5 @@
 (set-env!
- :source-paths   #{"src" "test"}
+ :source-paths   #{"src"}
  :resource-paths #{"html"}
  :dependencies '[[adzerk/boot-cljs      "0.0-3308-0" ]
                  [adzerk/boot-cljs-repl "0.1.10-SNAPSHOT" ]
@@ -16,7 +16,7 @@
  '[adzerk.boot-reload    :refer [reload]]
  '[pandeiro.http         :refer [serve]])

-(deftask dev []
+(deftask dev-cljs []
   (set-env! :source-paths #{"src" "test"})
   (comp #_(serve :dir "target/")
         (watch)
@@ -27,6 +27,13 @@
         (cljs :source-map true :optimizations :none)
         (run-cljs-test)))

-(deftask build []
+(deftask test-cljs []
+  (set-env! :source-paths #{"src" "test"})
+  (comp (speak)
+        (cljs-test-node-runner :namespaces '[obb-rules.unit-test])
+        (cljs :source-map true :optimizations :none)
+        (run-cljs-test)))
+
+(deftask build-cljs []
   (set-env! :source-paths #{"src"})
   (comp (cljs :optimizations :advanced)))


onto hazelcast 3.8

onto hazelcast 3.8

--- build.boot
+++ build.boot
@@ -4,9 +4,9 @@
   :source-paths #{"src"}
   :dependencies '[[org.clojure/clojure "1.8.0"]
                   [org.clojure/tools.logging "0.3.1"]
-                  [com.hazelcast/hazelcast "3.7.4"]
-                  [com.hazelcast/hazelcast-client "3.7.4"]
-                  [org.hface/hface-client "0.1.3"]
+                  [com.hazelcast/hazelcast "3.8"]
+                  [com.hazelcast/hazelcast-client "3.8"]
+                  [org.hface/hface-client "0.1.4"]
                   [cheshire "5.6.3"]
                   [com.cognitect/transit-clj "0.8.275"]
                   [clj-wallhack "1.0.1"]


#4: to 0.1.17-SNAPSHOT

#4: to 0.1.17-SNAPSHOT

--- build.boot
+++ build.boot
@@ -1,4 +1,4 @@
-(def +version+ "0.1.16")
+(def +version+ "0.1.17-SNAPSHOT")

 (set-env!
   :source-paths #{"src"}


Bump Clojure version

Bump Clojure version

--- build.boot
+++ build.boot
@@ -1,6 +1,6 @@
 (set-env!
   :source-paths #{"src"}
-  :dependencies '[[org.clojure/clojure "1.7.0" :scope "provided"]
+  :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
                   [ring/ring-core "1.4.0"]
                   [adzerk/bootlaces "0.1.12" :scope "test"]])


Add boot-test and timbre

Add boot-test and timbre

--- build.boot
+++ build.boot
@@ -11,6 +11,7 @@
    [kioo "0.4.2"]
    [com.taoensso/timbre "4.7.0"]
    [alandipert/storage-atom "1.2.4"]
+   [com.taoensso/timbre "4.7.0"]

    [adzerk/boot-cljs "1.7.228-1" :scope "test"]
    [adzerk/boot-reload "0.4.12" :scope "test"]
@@ -20,6 +21,7 @@
 (require
  '[adzerk.boot-cljs :refer [cljs]]
  '[adzerk.boot-reload :refer [reload]]
+ '[adzerk.boot-test :refer [test]]
  '[pandeiro.boot-http :refer [serve]])

 (deftask dev []


Placeholders for all predicates on clojure.spec.gen/gen-builtins

--- src/spec_tools/json_schema.cljc
+++ src/spec_tools/json_schema.cljc
@@ -21,21 +21,85 @@
 (defn- spec-dispatch [dispatch spec children] dispatch)
 (defmulti accept-spec spec-dispatch :default ::default)

-(defmethod accept-spec 'clojure.core/int? [_ _ _] {:type "integer"})
+;; predicate list taken from https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec/gen.clj
+
+; any? (one-of [(return nil) (any-printable)])
+; some? (such-that some? (any-printable))
+; number? (one-of [(large-integer) (double)])
+
+; integer? (large-integer)
 (defmethod accept-spec 'clojure.core/integer? [_ _ _] {:type "integer"})

+; int? (large-integer)
+(defmethod accept-spec 'clojure.core/int? [_ _ _] {:type "integer"})
+
+; pos-int? (large-integer* {:min 1})
+; neg-int? (large-integer* {:max -1})
+; nat-int? (large-integer* {:min 0})
+
+; float? (double)
 (defmethod accept-spec 'clojure.core/float? [_ _ _] {:type "number"})
+
+; double? (double)
 (defmethod accept-spec 'clojure.core/double? [_ _ _] {:type "number"})
+
+; boolean? (boolean)
+(defmethod accept-spec 'clojure.core/boolean? [_ _ _] {:type "boolean"})
+
+; string? (string-alphanumeric)
+(defmethod accept-spec 'clojure.core/string? [_ _ _] {:type "string"})
+
+; ident? (one-of [(keyword-ns) (symbol-ns)])
+; simple-ident? (one-of [(keyword) (symbol)])
+; qualified-ident? (such-that qualified? (one-of [(keyword-ns) (symbol-ns)]))
+
+; keyword? (keyword-ns)
+(defmethod accept-spec 'clojure.core/keyword? [_ _ _] {:type "string"})
+
+; simple-keyword? (keyword)
+; qualified-keyword? (such-that qualified? (keyword-ns))
+; symbol? (symbol-ns)
+; simple-symbol? (symbol)
+; qualified-symbol? (such-that qualified? (symbol-ns))
+; uuid? (uuid)
+; uri? (fmap #(java.net.URI/create (str "http://" % ".com")) (uuid))
+; bigdec? (fmap #(BigDecimal/valueOf %)
+;               (double* {:infinite? false :NaN? false}))
+; inst? (fmap #(java.util.Date. %)
+;             (large-integer))
+; seqable? (one-of [(return nil)
+;                   (list simple)
+;                   (vector simple)
+;                   (map simple simple)
+;                   (set simple)
+;                   (string-alphanumeric)])
+; indexed? (vector simple)
+; map? (map simple simple)
+; vector? (vector simple)
+; list? (list simple)
+; seq? (list simple)
+; char? (char)
+; set? (set simple)
+
+; nil? (return nil)
+(defmethod accept-spec 'clojure.core/nil? [_ _ _] {:type "null"})
+
+; false? (return false)
+; true? (return true)
+; zero? (return 0)
+; rational? (one-of [(large-integer) (ratio)])
+; coll? (one-of [(map simple simple)
+;                (list simple)
+;                (vector simple)
+;                (set simple)])
+; empty? (elements [nil '() [] {} #{}])
+; associative? (one-of [(map simple simple) (vector simple)])
+; sequential? (one-of [(list simple) (vector simple)])
+; ratio? (such-that ratio? (ratio))
+; bytes? (bytes)

 (defmethod accept-spec 'clojure.core/pos? [_ _ _] {:minimum 0 :exclusiveMinimum true})
 (defmethod accept-spec 'clojure.core/neg? [_ _ _] {:maximum 0 :exclusiveMaximum true})
-
-(defmethod accept-spec 'clojure.core/string? [_ _ _] {:type "string"})
-(defmethod accept-spec 'clojure.core/keyword? [_ _ _] {:type "string"})
-
-(defmethod accept-spec 'clojure.core/boolean? [_ _ _] {:type "boolean"})
-
-(defmethod accept-spec 'clojure.core/nil? [_ _ _] {:type "null"})

 (defmethod accept-spec ::visitor/set [dispatch spec children]
   {:enum children})


Comment not used code at this moment.

Comment not used code at this moment.

--- src/uxbox/ui/shapes/circle.cljs
+++ src/uxbox/ui/shapes/circle.cljs
@@ -39,52 +39,52 @@
 ;; Circle Handlers
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn- handlers-render
-  [own shape]
-  (letfn [(on-mouse-down [vid event]
-            (dom/stop-propagation event)
-            (uuc/acquire-action! "ui.shape.resize"
-                                 {:vid vid :shape (:id shape)}))
+;; (defn- handlers-render
+;;   [own shape]
+;;   (letfn [(on-mouse-down [vid event]
+;;             (dom/stop-propagation event)
+;;             (uuc/acquire-action! "ui.shape.resize"
+;;                                  {:vid vid :shape (:id shape)}))

-          (on-mouse-up [vid event]
-            (dom/stop-propagation event)
-            (uuc/release-action! "ui.shape.resize"))]
-    (let [{:keys [x y width height]} (geom/outer-rect shape)]
-      (html
-       [:g.controls
-        [:rect {:x x :y y :width width :height height :stroke-dasharray "5,5"
-                :style {:stroke "#333" :fill "transparent"
-                        :stroke-opacity "1"}}]
-        [:circle.top-left
-         (merge uusc/+circle-props+
-                {:on-mouse-up #(on-mouse-up 1 %)
-                 :on-mouse-down #(on-mouse-down 1 %)
-                 :cx x
-                 :cy y})]
-        [:circle.top-right
-         (merge uusc/+circle-props+
-                {:on-mouse-up #(on-mouse-up 2 %)
-                 :on-mouse-down #(on-mouse-down 2 %)
-                 :cx (+ x width)
-                 :cy y})]
-        [:circle.bottom-left
-         (merge uusc/+circle-props+
-                {:on-mouse-up #(on-mouse-up 3 %)
-                 :on-mouse-down #(on-mouse-down 3 %)
-                 :cx x
-                 :cy (+ y height)})]
-        [:circle.bottom-right
-         (merge uusc/+circle-props+
-                {:on-mouse-up #(on-mouse-up 4 %)
-                 :on-mouse-down #(on-mouse-down 4 %)
-                 :cx (+ x width)
-                 :cy (+ y height)})]]))))
+;;           (on-mouse-up [vid event]
+;;             (dom/stop-propagation event)
+;;             (uuc/release-action! "ui.shape.resize"))]
+;;     (let [{:keys [x y width height]} (geom/outer-rect shape)]
+;;       (html
+;;        [:g.controls
+;;         [:rect {:x x :y y :width width :height height :stroke-dasharray "5,5"
+;;                 :style {:stroke "#333" :fill "transparent"
+;;                         :stroke-opacity "1"}}]
+;;         [:circle.top-left
+;;          (merge uusc/+circle-props+
+;;                 {:on-mouse-up #(on-mouse-up 1 %)
+;;                  :on-mouse-down #(on-mouse-down 1 %)
+;;                  :cx x
+;;                  :cy y})]
+;;         [:circle.top-right
+;;          (merge uusc/+circle-props+
+;;                 {:on-mouse-up #(on-mouse-up 2 %)
+;;                  :on-mouse-down #(on-mouse-down 2 %)
+;;                  :cx (+ x width)
+;;                  :cy y})]
+;;         [:circle.bottom-left
+;;          (merge uusc/+circle-props+
+;;                 {:on-mouse-up #(on-mouse-up 3 %)
+;;                  :on-mouse-down #(on-mouse-down 3 %)
+;;                  :cx x
+;;                  :cy (+ y height)})]
+;;         [:circle.bottom-right
+;;          (merge uusc/+circle-props+
+;;                 {:on-mouse-up #(on-mouse-up 4 %)
+;;                  :on-mouse-down #(on-mouse-down 4 %)
+;;                  :cx (+ x width)
+;;                  :cy (+ y height)})]]))))

-(def ^:const handlers
-  (mx/component
-   {:render handlers-render
-    :name "handlers"
-    :mixins [mx/static]}))
+;; (def ^:const handlers
+;;   (mx/component
+;;    {:render handlers-render
+;;     :name "handlers"
+;;     :mixins [mx/static]}))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Shape


when exchanging foods for an ingredient with n > 1 foods, keep the number of foods constant

--- src/whatsoup/meal_generator.clj
+++ src/whatsoup/meal_generator.clj
@@ -174,5 +174,6 @@
         (assoc-in recipe [:recipe/ingredients idx] ingredient)))

 (defn exchange-ingredient-foods [mg recipe idx]
-  (let [removed (update-in recipe [:recipe/ingredients idx] deselect-all-foods)]
-    (add-food-to-ingredient mg removed idx)))
+  (let [food-count (count (get-in recipe [:recipe/ingredients idx :selected-foods]))
+        removed (update-in recipe [:recipe/ingredients idx] deselect-all-foods)]
+    (nth (iterate #(add-food-to-ingredient mg % idx) removed) food-count)))


fixup spec

fixup spec

--- src/elfeed_cljsrn/db.cljs
+++ src/elfeed_cljsrn/db.cljs
@@ -21,7 +21,7 @@
 (s/def :server/url string?)
 (s/def :server/valid? boolean?)
 (s/def :server/checking? boolean?)
-(s/def :server/error-message string)
+(s/def :server/error-message string?)
 (s/def ::server (s/keys :req-un [:server/url :server/valid? :server/checking?]
                         :opt-un [:server/error-message]))


Make some test cases represent the reality a bit more

Some mazes were such that they can never be generated. No use testing
those.

--- test/clj/codejam_practice_solutions/practice/b_always_turn_left_test.clj
+++ test/clj/codejam_practice_solutions/practice/b_always_turn_left_test.clj
@@ -307,20 +307,37 @@
         "⎕ ⎕"
         "⎕ ⎕"]
        (maze/render-compressed-labyrinth
-        (maze/move-route-and-back (maze/parse-input "WW WW"))))))
+        (maze/move-route-and-back (maze/parse-input "WW WW")))))
+
+  (is (= ["⎕⎕⎕⎕⎕ ⎕"
+          "⎕     ⎕"
+          "⎕ ⎕⎕⎕⎕⎕"
+          "⎕ ⎕   ⎕"
+          "⎕ ⎕⎕⎕ ⎕"
+          "⎕     ⎕"
+          "⎕⎕⎕⎕⎕ ⎕"
+          "    ⎕ ⎕"
+          "⎕ ⎕⎕⎕ ⎕"
+          "⎕     ⎕"
+          "⎕⎕⎕⎕⎕⎕⎕"]
+         (maze/render-compressed-labyrinth
+          (maze/move-route-and-back
+           (maze/parse-input "WRWWLWWLWWLWLWRRWRWWWRWWRWLW WWRRWLWLWWLWWLWWRWWRWWLW"))))))

 (deftest longest
   (is (= "abc" (maze/longest "abc" "ab"))))

 (deftest non-unknown-row
   (is (= (count (:maze (maze/non-unknown-rows
-                        (parse-maze ["░░⎕ ⎕░░"
-                                     "░░⎕ ⎕░░"
-                                     "░░⎕ ⎕░░"
-                                     "░░⎕⎕⎕░░"
-                                     "░░░░░░░"
+                        (parse-maze ["░░   ░░"
+                                     "░░⎕ ⎕░░"
+                                     "░░⎕ ⎕░░"
+                                     "░░⎕ ⎕░░"
+                                     "░░⎕ ⎕░░"
+                                     "░░⎕ ⎕░░"
+                                     "░░   ░░"
                                      "░░░░░░░"]))))
-         4)))
+         5)))

 (deftest get-cells-with-coordinates
   (is (= [[0 0 \░] [0 1 \░] [0 2 \░]
@@ -334,7 +351,8 @@
 (deftest first-non-unknown-index
   (is (= 2
          (maze/first-non-unknown-index
-          (:maze (parse-maze ["░░⎕A⎕░░"
+          (:maze (parse-maze ["░░ A ░░"
+                              "░░⎕ ⎕░░"
                               "░░⎕ ⎕░░"
                               "░░⎕ ⎕░░"
                               "░░   ░░"
@@ -344,14 +362,14 @@
 (deftest only-non-unknown-columns
   (is (= ["⎕ ⎕"
           "⎕ ⎕"
-          "⎕ ⎕"
-          "⎕⎕⎕"]
+          "⎕ ⎕"]
          (maze/render-compressed-labyrinth
           (maze/only-non-unknown-columns
-           (parse-maze ["░░⎕A⎕░░"
-                        "░░⎕ ⎕░░"
-                        "░░⎕ ⎕░░"
-                        "░░⎕⎕⎕░░"]))))))
+           (parse-maze ["░░ A ░░"
+                        "░░⎕ ⎕░░"
+                        "░░⎕ ⎕░░"
+                        "░░⎕ ⎕░░"
+                        "░░   ░░"]))))))

 (deftest non-unknown-rows
   (is (= ["⎕ ⎕"
@@ -368,10 +386,12 @@

 (deftest compress-maze
   (is (= ["⎕ ⎕"
+          "⎕ ⎕"
           "⎕ ⎕"]
          (maze/render-compressed-labyrinth
           (maze/compress-labyrinth
            (parse-maze ["░░ A ░░"
+                        "░░⎕ ⎕░░"
                         "░░⎕ ⎕░░"
                         "░░⎕ ⎕░░"
                         "░░   ░░"


compile/compile cleanup

compile/compile cleanup

--- src/leiningen/compile.clj
+++ src/leiningen/compile.clj
@@ -159,6 +159,19 @@
      "NUL"
      "/dev/null")))

+(defn- compile-status [status msg]
+  (do
+    (binding [*out* (if status *out* *err*)]
+      (when-not *silently*
+        (println msg)))
+    status))
+
+(def ^{:private true}
+     success (partial compile-status true))
+
+(def ^{:private true}
+     failure (partial compile-status false))
+
 (defn compile
   "Ahead-of-time compile the namespaces given under :aot in project.clj or
 those given as command-line arguments."
@@ -166,28 +179,19 @@
      (.mkdir (file (:compile-path project)))
      (if (seq (compilable-namespaces project))
        (if-let [namespaces (seq (stale-namespaces project))]
-         (let [exit-status (eval-in-project project
-                                            `(doseq [namespace# '~namespaces]
-                                               (when-not ~*silently*
-                                                 (println "Compiling" namespace#))
-                                               (clojure.core/compile namespace#))
-                                            (when *testing*
-                                              (fn [java]
-                                                (.setError java (platform-nullsink))))
-                                            :skip-auto-compile)]
-           (if (= 1 exit-status)
-             (do (binding [*out* *err*]
-                   (println "Compilation failed."))
-                 false)
-             true))
-         (do
-           (when-not *silently*
-             (println "All namespaces already :aot compiled."))
-           true))
-       (do
-         (when-not *silently*
-           (println "No namespaces to :aot compile listed in project.clj."))
-         true)))
+         (if (= 1 (eval-in-project project
+                                   `(doseq [namespace# '~namespaces]
+                                      (when-not ~*silently*
+                                        (println "Compiling" namespace#))
+                                      (clojure.core/compile namespace#))
+                                   (when *testing*
+                                     (fn [java]
+                                       (.setError java (platform-nullsink))))
+                                   :skip-auto-compile))
+           (failure "Compilation failed.")
+           (success "Compilated succeeded."))
+         (success "All namespaces already :aot compiled."))
+       (success "No namespaces to :aot compile listed in project.clj.")))
   ([project & namespaces]
      (compile (assoc project
                 :aot (if (= namespaces [":all"])


Improving subtle bug

Improving subtle bug

--- apoya-app/src/clj/apoya/app.clj
+++ apoya-app/src/clj/apoya/app.clj
@@ -36,7 +36,7 @@
           body (-> res-blob
                    (.getPayload)
                    (.getInput))]
-      (if-not (= etag if-none-match)
+      (if (or (nil? etag) (not= etag if-none-match))
         (response/content-type {:body body
                                 :headers {"etag" etag}
                                 :status 200}


Add fn to initialize scrape state

Add fn to initialize scrape state

--- src/mars_ogler/scrape.clj
+++ src/mars_ogler/scrape.clj
@@ -230,12 +230,18 @@
             three orderings, then deref this atom."}
   sorted-images (atom nil))

+(defn setup-state!
+  []
+  (->> (get-cached-images)
+    sort-images
+    (reset! sorted-images)))
+
 (defn update-states!
   [imgs]
   (cache-images! imgs)
   (reset! sorted-images (sort-images imgs)))

-(defn scrape-loop
+(defn scrape-loop!
   []
   (loop [imgs (get-cached-images)]
     (let [{:keys [new old all]} (fetch-tick imgs)]


[#2212] Move feature flag to family_name

--- backend/src/akvo/lumen/auth.clj
+++ backend/src/akvo/lumen/auth.clj
@@ -55,10 +55,10 @@
 (defn api-authz?
   "Feature flag predicate function. Add trailing $auth to given_name to enable
   API authz"
-  [{:strs [given_name]}]
-  (if (nil? given_name)
+  [{:strs [family_name] :as jwt-claims}]
+  (if (nil? family_name)
     false
-    (string/ends-with? given_name "$auth")))
+    (string/ends-with? family_name "$auth")))

 (defn wrap-auth
   "Wrap authentication for API. Allow GET to root / and share urls at /s/<id>.


Move transitive deps down to ./build/deps

Signed-off-by: Gregory Haskins <640d9fe47775e6723f0355b7315e38f7d98d3539@gmail.com>

--- src/obcc/build/golang.clj
+++ src/obcc/build/golang.clj
@@ -62,7 +62,7 @@
 (defn go [path & args]
   (let [cwd (System/getProperty "user.dir")
         fqpath (str cwd "/" path)
-        gopath (str fqpath "/build" ":" fqpath ":" (System/getenv "GOPATH"))
+        gopath (str fqpath "/build/deps" ":" fqpath "/build" ":" fqpath ":" (System/getenv "GOPATH"))
         _args (into [] (concat ["go"] args [:env {"GOPATH" gopath}]))]
     (apply println _args)
     (let [result (apply sh/proc _args)]


Provide an error message when trying to resume from old checkpoint path

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -65,9 +65,11 @@
        (inc (:offset (read-commit log k)))
        (catch org.apache.zookeeper.KeeperException$NoNodeException nne
          (try
-          ;; Try again using 0.9.9.0/0.9.10.0 checkpoint method
-          ;; This allows users to transition to new checkpoint from old method
-          (inc (:offset (extensions/read-chunk log :chunk k)))
+          (when-let [offset (:offset (extensions/read-chunk log :chunk k))]
+            (throw (ex-info "Offset was found at the old checkpoint path.
+                             Please set :kafka/force-reset? or resume manually with :kafka/start-offsets"
+                            {:partition kpartition
+                             :offset offset})))
           (catch org.apache.zookeeper.KeeperException$NoNodeException nne
             (if-let [start-offsets (:kafka/start-offsets task-map)]
               (let [offset (get start-offsets kpartition)]