Revert "~(defn np-grammar): remove lexicon-filtering"

This reverts commit 7da9d6c12aa2d17ad860b0fd955ec12ae4d90b4c.

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -793,6 +793,34 @@
                      (= (:rule %) "nbar2"))
                 grammar)
         rules (map #(keyword (get-in % [:rule])) grammar)
+        lexicon
+        (into {}
+              (for [[k v] lexicon]
+                (let [filtered-v
+                      (filter #(and (not (= true (get-in % [:top])))
+                                    (or (= (get-in % [:synsem :cat] :adjective) :adjective)
+                                        (= (get-in % [:synsem :cat] :det) :det)
+                                        (and (= (get-in % [:synsem :cat] :noun) :noun)
+                                             (not (= (get-in % [:synsem :propernoun] false) true))
+                                             (not (= (get-in % [:synsem :pronoun] false) true)))))
+                              v)
+                      ;; TODO: remove this removal:
+                      ;; don't remove this semantic info. It's an interesting example of how to
+                      ;; process a lexicon, though, so perhaps find a reason to use it in some way.
+                      remove-semantic-features
+                      (map (fn [lexeme]
+                             (remove-matching-keys lexeme
+                                                     #(or
+                                                       (= % :activity)        (= % :animate)  (= % :artifact)
+                                                       (= % :buyable)         (= % :child)    (= % :clothing)
+                                                       (= % :consumable)
+                                                       (= % :drinkable)       (= % :edible)   (= % :furniture)
+                                                       (= % :human)           (= % :legible)  (= % :part-of-human-body)
+                                                       (= % :pet)
+                                                       (= % :physical-object) (= % :place)    (= % :speakable))))
+                           filtered-v)]
+                  (if (not (empty? remove-semantic-features))
+                    [k remove-semantic-features]))))
         lexicon-for-generation (lexicon-for-generation lexicon)
         ;; indices from paths to subsets of the lexicon
         indices (create-indices lexicon-for-generation index-lexicon-on-paths)]


cleanup

cleanup

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -15,7 +15,7 @@
     :refer [phonize2]]

    [clojure.edn :as edn]
-   [clojure.java.io :refer [reader resource]]
+   [clojure.java.io :refer [resource]]
    [clojure.repl :refer [doc]]
    [dag_unify.core :refer [dissoc-paths fail? get-in strip-refs unify]]))


:pred s/città/city/

:pred s/città/city/

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -688,11 +688,8 @@
    "città"
    {:synsem {:agr {:gender :fem}
              :cat :noun
-             :sem {:artifact true
-                   :buyable false  ;; can't buy a city (unless you're a billionaire like Mike Bloomberg)
-                   :city true
-                   :place true
-                   :pred :città}
+             :sem {:city true
+                   :pred :city}
              :subcat {:1 {:cat :det
                           :def :def}}}} ;; TODO: why must :def be specifically :def here?


+un [e.g in "un'alta donna"]

+un [e.g in "un'alta donna"]

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -2038,12 +2038,18 @@
               :sem {:pred :tu
                     :human true}
               :subcat '()}}]
-   "un"
-       {:synsem {:cat :det
-                 :def :indef
-                 :mass false
-                 :agr {:gender :masc
-                       :number :sing}}}
+   "un" [{:synsem {:cat :det
+                   :def :indef
+                   :mass false
+                   :agr {:gender :masc
+                         :number :sing}}}
+         {:synsem {:cat :det
+                   :def :indef
+                   :mass false
+                   :agr {:gender :fem ;; 'un' can be feminine in the case where next word is an adjective (e.g. "alta")
+                         ;; and we tokenize "un'alta donna" as [un] [alta] [donna].
+                         :number :sing}}}]
+
    "una"
     {:synsem {:cat :det
               :def :indef


Updated atom generators for Cut Vector. Not done with sanity check; need to update data domains.

--- src/clojush/problems/software/benchmarks_v2/cut_vector.clj
+++ src/clojush/problems/software/benchmarks_v2/cut_vector.clj
@@ -35,17 +35,15 @@

 ; Atom generators
 (def cut-vector-atom-generators
-  (concat (list
-            ;;; end constants
-            (fn [] (cut-vector-input (inc (lrand-int 20)))) ;Vector ERC
-            ;;; end ERCs
-            (tag-instruction-erc [:vector_integer :integer :boolean :exec] 1000)
-            (tagged-instruction-erc 1000)
-            ;;; end tag ERCs
-            'in1
-            ;;; end input instructions
-            )
-          (registered-for-stacks [:vector_integer :integer :boolean :exec])))
+  (make-proportional-atom-generators
+   (concat
+    (registered-for-stacks [:vector_integer :integer :boolean :exec])
+    (list (tag-instruction-erc [:vector_integer :integer :boolean :exec] 1000) ; tags
+          (tagged-instruction-erc 1000)))
+   (list 'in1) ; inputs
+   (list 0 []) ; constants
+   {:proportion-inputs 0.15
+    :proportion-constants 0.05}))

 ;; A list of data domains for the problem. Each domain is a vector containing
 ;; a "set" of inputs and two integers representing how many cases from the set


manually trigger the :rez event to allow The Foundry to work with ABT

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -5,6 +5,7 @@
    (let [abthelper (fn abt [n i] {:prompt "Select a piece of ICE to install"
                                   :choices {:req #(and (:side % "Corp") (= (:type %) "ICE") (= (:zone %) [:play-area]))}
                                   :effect (req (corp-install state side target nil {:no-install-cost true :install-state :rezzed})
+                                               (trigger-event state side :rez target)
                                                  (when (< n i)
                                                    (resolve-ability state side (abt (inc n) i) card nil)))})]
      {:optional {:prompt "Look at the top 3 cards of R&D?"


Better header parsing for ajax requests. Debugging #183

--- src/cljs/clojuredocs/ajax.cljs
+++ src/cljs/clojuredocs/ajax.cljs
@@ -43,9 +43,9 @@

 (defn parse-headers [s]
   (when s
-    (->> (str/split s #"\r\n")
+    (->> (str/split s #"\n")
          (mapcat (fn [header]
-                   (->> (str/split header ":")
+                   (->> (str/split header #":" 2)
                         (map str/trim))))
          (apply hash-map))))


fix sorting

fix sorting

--- src/bracketolojy/tournament.clj
+++ src/bracketolojy/tournament.clj
@@ -206,7 +206,7 @@
        zip/root))

 (defn- expected-value-desc-comparator [left right]
-  (- (:expected-value right)
+  (compare (:expected-value right)
      (:expected-value left)))

 (defn predict-bracket


Remove profiles.clj file.

Remove profiles.clj file.

--- profiles.clj
+++ profiles.clj
@@ -1 +0,0 @@
-{:dev {:dependencies [[funcool/promesa "0.6.0"]]}}


CMR-4524: Do not clear out the caches when updating indexes (#293)

* CMR-4524: Do not clear out the caches (including deleting all data in Elasticsearch from cubby) when updating indexes

* CMR-4524: Reset the index-set mappings cache before updating indexes

--- indexer-app/src/cmr/indexer/services/index_service.clj
+++ indexer-app/src/cmr/indexer/services/index_service.clj
@@ -576,12 +576,19 @@
   (es/reset-es-store context)
   (cache/reset-caches context))

+(defn- reset-index-set-mappings-cache
+  "Resets the index set mappings cache. It is important that the latest mappings are used whenever
+  we try to update the indexes in Elasticsearch."
+  [context]
+  (let [index-set-mappings-cache (get-in context [:system :caches idx-set/index-set-cache-key])]
+    (cache/reset index-set-mappings-cache)))
+
 (defn update-indexes
   "Updates the index mappings and settings."
   [context params]
-  (cache/reset-caches context)
+  (reset-index-set-mappings-cache context)
   (es/update-indexes context params)
-  (cache/reset-caches context))
+  (reset-index-set-mappings-cache context))

 (def health-check-fns
   "A map of keywords to functions to be called for health checks"


CMR-6685 passing context to partial

CMR-6685 passing context to partial

--- indexer-app/src/cmr/indexer/services/index_service.clj
+++ indexer-app/src/cmr/indexer/services/index_service.clj
@@ -282,9 +282,10 @@
   "Convert collection concept metadata to UMM-C and pull facet fields
   to be indexed as autocomplete suggestion doc"
   [context collections provider-id]
-  (let [parsed-concepts (->> collections
+  (let [parse-coll (partial parse-collection context)
+        parsed-concepts (->> collections
                              (remove :deleted)
-                             (map parse-collection)
+                             (map parse-coll)
                              (remove nil?))
         collection-permissions (map (fn [collection]
                                       (let [permissions (collection-util/get-coll-permitted-group-ids context provider-id collection)]


CMR-6287: remove .lowercase items and update :_id field

--- indexer-app/src/cmr/indexer/services/index_service.clj
+++ indexer-app/src/cmr/indexer/services/index_service.clj
@@ -204,7 +204,7 @@
                             (s/join ":"))
         keyword-value (get science-keywords terminal-key)]
      {:type "science_keywords"
-      :_id (str keyword-string "_science_keywords")
+      :_id (str (s/lower-case keyword-string) "_science_keywords")
        :value keyword-value
        :field keyword-string
        :_index "1_autocomplete"
@@ -213,18 +213,21 @@
 (defn- suggestion-doc
   "Creates elasticsearch docs from a given humanized map"
   [key-name value-map]
-  (if (= key-name "science-keywords")
-   (science-keywords->elastic-docs value-map)
-   (map (fn [value]
-          (let [v (val value)
-                type (csk/->snake_case_keyword key-name)]
-           {:type type
-            :_id (str v "_" type)
-            :value v
-            :field (csk/->snake_case_keyword (name (key value)))
-            :_index "1_autocomplete"
-            :_type "suggestion"}))
-       (seq value-map))))
+  (let [values (->> value-map
+                    seq
+                    (remove #(s/includes? (name (key %)) ".lowercase")))]
+    (if (= key-name "science-keywords")
+     (science-keywords->elastic-docs value-map)
+     (map (fn [value]
+            (let [v (val value)
+                  type (csk/->snake_case_keyword key-name)]
+             {:type type
+              :_id (str (s/lower-case v) "_" type)
+              :value v
+              :field (csk/->snake_case_keyword (name (key value)))
+              :_index "1_autocomplete"
+              :_type "suggestion"}))
+         values))))

 (defn- get-suggestion-docs
   "Given the humanized fields from a collection, assemble elastic doc for each


continued to work on filtering techniques

--- src/clj/forma/trends/filter.clj
+++ src/clj/forma/trends/filter.clj
@@ -107,19 +107,26 @@

 (defn bad-ends
-  "collect a set of the indices of bad ends."
-  [bad-val coll]
+  "collect a set of the indices of bad ends. if the bad value is, say, 2, then the
+  predicate would be #{2}"
+  [pred coll]
   (let [m-coll (map-indexed vector coll)
         r-coll (reverse m-coll)]
     (set
      (apply concat
-            (map #(for [[m n] % :while (= n bad-val) m])
+            (map #(for [[m n] % :while (pred n)] m)
                  [m-coll r-coll])))))

+(defn act-on-good
+  [func bad-set coll]
+  (func
+   (filter #(not (contains? bad-set %))
+           coll)))

-(defn deal-w-bad-ends
-  [coll bad-set avg]
-  (map #((if (contains? bad-set %1) avg %2)) coll))
+(defn neutralize-ends
+  [bad-set reli-coll val-coll]
+  (let [avg (act-on-good average bad-set val-coll)
+        ends (bad-ends bad-set reli-coll)]))

 ;; (map #(if (#{8049} %) 54 %) (mask #{2} reli-test ndvi-test))


Make the filter search bar work again

Make the filter search bar work again

Fixes #12.  Was a stupid thing.  Closed over the initial value of the
input, rather than checking it in the event handler.

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -62,15 +62,15 @@
    {:display-name "search-box"
     :component-did-mount
     (fn [this]
-      (let [node (reagent/dom-node this)
-            value (.-value node)]
+      (let [node (reagent/dom-node this)]
         (.addEventListener node "change"
-                           #(r/go-to
-                             (r/comics-path
-                              {:site site
-                               :query-params
-                               (when value
-                                 {:filter value})})))))
+                           #(let [value (.-value node)]
+                              (r/go-to
+                               (r/comics-path
+                                {:site site
+                                 :query-params
+                                 (when value
+                                   {:filter value})}))))))
     :reagent-render
     (fn [site cl-filter]
       [:input {:type "search"


Clean surface forms client-side

Clean surface forms client-side

--- src/cljs/db_quiz/normalize.cljs
+++ src/cljs/db_quiz/normalize.cljs
@@ -296,7 +296,12 @@
         ; Sort surface forms from the longest to the shortest, so that we first replace
         ; the longer matches.
         surface-forms (sort-by (comp - count)
-                               (conj (split surfaceForms "|") clean-label label))]
+                               ; Filter empty and < 2 characters long surface forms
+                               (distinct (conj (filter (every-pred (complement (partial re-matches #"^\s+$"))
+                                                                   (comp (partial < 2) count))
+                                                       (split surfaceForms "|"))
+                                              clean-label
+                                              label)))]
     (assoc item
            :abbreviation abbreviation
            :description (-> description
@@ -304,7 +309,8 @@
                             clear-description
                             (replace-surface-forms abbreviation surface-forms)
                             truncate-description)
-           :label (join " " tokens))))
+           :label (join " " tokens)
+           :surface-forms surface-forms)))

 (defn generate-hint
   [answer & {:keys [percent-revealed]


Add top story to global state

Add top story to global state

--- src/cljs/hacker_agent/core.cljs
+++ src/cljs/hacker_agent/core.cljs
@@ -70,6 +70,7 @@
     (.on (.child fb "topstories") "value"
          (fn [snapshot]
            (let [db (js->clj (.val snapshot))]
+             (global-put! :top-story (first db))
              (global-put! :stories db))))
     (.on (.child fb "maxitem") "value"
          (fn [snapshot]


Remove unused statement

Remove unused statement

--- src/cljs/learn_specter/app.cljs
+++ src/cljs/learn_specter/app.cljs
@@ -9,8 +9,6 @@
             [learn-specter.result :refer [result]]
             [learn-specter.routes :as routes]
             [learn-specter.excercises :refer [page-excercises]]))
-
-(enable-console-print!)

 (defpages pages "./src/md")

@@ -38,6 +36,7 @@
     (-> db
         (assoc :current-page page-id)
         (dissoc :current-input :eval-input))))
+

 (register-handler
   :input-changed


Cleaned up code by removing let form.

Cleaned up code by removing let form.

--- src/clojure/staircase/tools.clj
+++ src/clojure/staircase/tools.clj
@@ -56,8 +56,7 @@
 (defn get-tools
   [config capability]
   (debug "Getting tools with the" capability "capability")
-  (let [tools (config :tools)]
-    (->> tools
-         (map get-tool-conf)
-         (filter (partial has-capability capability)))))
+  (->> (:tools config)
+        (map get-tool-conf)
+        (filter (partial has-capability capability))))


Update for request log changes

Update for request log changes

--- src/leiningen/new/cljskel/project.clj
+++ src/leiningen/new/cljskel/project.clj
@@ -8,7 +8,7 @@
                  [compojure "1.2.0"]
                  [environ "1.0.0"]
                  [mixradio/graphite-filter "1.0.0"]
-                 [mixradio/instrumented-ring-jetty-adapter "1.0.0"]
+                 [mixradio/instrumented-ring-jetty-adapter "1.0.1"]
                  [mixradio/radix "1.0.3"]
                  [net.logstash.logback/logstash-logback-encoder "3.2"]
                  [org.clojure/clojure "1.6.0"]
@@ -45,6 +45,8 @@
         :logging-path "/tmp"
         :logging-stashthreshold "off"
         :production false
+        :requestlog-enabled false
+        :requestlog-retainhours 24
         :service-name "{{name}}"
         :service-port 8080
         :service-url "http://localhost:%s"


Make the referrers listed in admin tool working links.

--- src/coming_soon/views/admin.clj
+++ src/coming_soon/views/admin.clj
@@ -21,5 +21,5 @@
   [:table.contacts :tbody :tr] (clone-for [contact contacts]
     [:tr first-child] (content (str (:id contact)))
     [:tr (nth-child 2)] (content (:email contact))
-    [:tr (nth-child 3)] (content (:referrer contact))
-    [:tr last-child] (content (unparse output-format (to-time-zone (parse timestamp-format (:updated-at contact)) (default-time-zone))))))+    [:tr (nth-child 3)] (content (html [:a {:href (:referrer contact) :target "_new"} (:referrer contact)]))
+    [:tr (nth-child 4)] (content (unparse output-format (to-time-zone (parse timestamp-format (:updated-at contact)) (default-time-zone))))))


implement client-side voting

implement client-side voting

--- cljs/puzzle/src/puzzle.cljs
+++ cljs/puzzle/src/puzzle.cljs
@@ -118,14 +118,13 @@
                   (win! retries)
                   (recur (conj new-progress aim) (.fen chess) retries failed))))))))))

-; (defn vote! [value]
-;   (let [url (dommy/attr ($ [$vote :form]) :action)]
-;     (xhr/ajax-request url :post
-;                       {:params {:vote value}
-;                        :format (xhr/raw-format)
-;                        :handler (fn [[ok res]]
-;                                   (dommy/set-html! (sel1 :.vote_wrap) res)
-;                                   (bind-vote-form!))})))
+(jq/on $vote :click :button (fn [e]
+                              (jq/prevent e)
+                              (jq/attr ($ :button $vote) :disabled)
+                              (jq/xhr [:post (jq/attr ($ :form $vote) :action)]
+                                      {:vote (jq/attr ($ (.-target e)) :value)}
+                                      #(jq/html $vote %))))
+

 ; (defn voting! []
 ;   (let [click-chan (chan)]


one swap! instead of two

one swap! instead of two

--- informing/src/app/core.cljs
+++ informing/src/app/core.cljs
@@ -66,8 +66,8 @@
   (get-in @omni-state [:ech k :listener-key]))

 (defn swap-event-channel! [k [channel listener-key]]
-  (swap! omni-state assoc-in [:ech k :channel] channel)
-  (swap! omni-state assoc-in [:ech k :listener-key] listener-key))
+  (swap! omni-state assoc-in [:ech k]
+         {:channel channel :listener-key listener-key}))

 (defonce setup-event-channels!
   (do


replace new (put! controls-ch ...) with (raise! owner ...)

--- frontend/components/landing.cljs
+++ frontend/components/landing.cljs
@@ -2,7 +2,7 @@
   (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer close!]]
             [clojure.string :as str]
             [dommy.core :as dommy]
-            [frontend.async :refer [put!]]
+            [frontend.async :refer [raise!]]
             [frontend.components.common :as common]
             [frontend.components.crumbs :as crumbs]
             [frontend.components.drawings :as drawings]
@@ -166,35 +166,34 @@
     om/IDisplayName (display-name [_] "Home Nav")
     om/IRender
     (render [_]
-      (let [controls-ch (om/get-shared owner [:comms :controls])]
-        (html
-         [:nav.home-nav {:style (if (> 70 (:header-bkg-scroller data))
-                                  {:background-size (str "100% " (:header-bkg-scroller data) "px")}
-                                  {})
-                         :class (concat
-                                 (when (:header-logo-visible data) ["logo-visible"])
-                                 (when (:header-cta-visible data) ["cta-visible"])
-                                 (when (:header-bkg-visible data) ["bkg-visible"])
-                                 (when (:header-bkg-invisible data) ["bkg-invisible"])
-                                 (when (:header-cta-invisible data) ["cta-invisible"]))}
-          [:a.promo {:href "integrations/docker"}
+      (html
+       [:nav.home-nav {:style (if (> 70 (:header-bkg-scroller data))
+                                {:background-size (str "100% " (:header-bkg-scroller data) "px")}
+                                {})
+                       :class (concat
+                               (when (:header-logo-visible data) ["logo-visible"])
+                               (when (:header-cta-visible data) ["cta-visible"])
+                               (when (:header-bkg-visible data) ["bkg-visible"])
+                               (when (:header-bkg-invisible data) ["bkg-invisible"])
+                               (when (:header-cta-invisible data) ["cta-invisible"]))}
+        [:a.promo {:href "integrations/docker"}
                                         ; "What is Continuous Integration?"
-           "Learn how we support Docker."]
-          [:a.login {:href (auth-url)
-                     :on-click #(put! controls-ch [:track-external-link-clicked
-                                                   {:event "Auth GitHub"
-                                                    :properties {:source "header-log-in"}
-                                                    :path (auth-url)}])}
-           "Log In"]
-          [:a.logo-circleci {:on-click #(put! controls-ch [:home-scroll-logo-clicked])}
-           [:figure circle-logo]]
-          [:a.action {:href (auth-url)
-                      :role "button"
-                      :on-click #(put! controls-ch [:track-external-link-clicked
-                                                    {:event "Auth GitHub"
-                                                     :properties {:source "header-cta"}
-                                                     :path (auth-url)}])}
-           "Sign Up Free"]])))))
+         "Learn how we support Docker."]
+        [:a.login {:href (auth-url)
+                   :on-click #(raise! owner [:track-external-link-clicked
+                                             {:event "Auth GitHub"
+                                              :properties {:source "header-log-in"}
+                                              :path (auth-url)}])}
+         "Log In"]
+        [:a.logo-circleci {:on-click #(raise! owner [:home-scroll-logo-clicked])}
+         [:figure circle-logo]]
+        [:a.action {:href (auth-url)
+                    :role "button"
+                    :on-click #(raise! owner [:track-external-link-clicked
+                                              {:event "Auth GitHub"
+                                               :properties {:source "header-cta"}
+                                               :path (auth-url)}])}
+         "Sign Up Free"]]))))

 (defn prolog [data owner {:keys [logo-visibility-callback
                                  cta-visibility-callback
@@ -236,38 +235,37 @@
     om/IWillUnmount (will-unmount [_] (scroll/deregister-fn (om/get-state owner :scroll-id)))
     om/IRender
     (render [_]
-      (let [controls-ch (om/get-shared owner [:comms :controls])]
-        (html
-         [:section.home-prolog {:ref "home-prolog"}
-          [:a.home-action {:href (auth-url)
-                           :role "button"
-                           :ref "prolog-cta"
-                           :on-click #(put! controls-ch [:track-external-link-clicked {:event "Auth GitHub"
-                                                                                :properties {:source "prolog-cta"}
-                                                                                :path (auth-url)}])}
-           "Sign Up Free"]
-          [:div.home-cover]
-          [:div.home-top-shelf]
-          [:div.home-slogans
-           [:h1.slogan.proverb {:item-prop "Ship better code, faster."
-                                :alt       "Let's just authorize first."}
-            "Ship better code, faster."]
-           [:h3.slogan.context {:item-prop "You have a product to focus on, let CircleCI handle your"
-                                :alt       "Signing up using your GitHub login lets us start really fast."}
-            "You have a product to focus on, let CircleCI handle your"]
-           [:h3.slogan.context {:item-prop "Continuous Integration & Deployment."
-                                :alt       "Currently, we must request permissions in bulk."}
-            "Continuous Integration & Deployment."]]
-          [:div.home-avatars
-           [:div.avatars
-            [:div.avatar-github
-             (common/ico :github)]
-            [:div.avatar-circle {:ref "center-logo"}
-             (common/ico :logo)]]]
-          [:div.home-bottom-shelf
-           [:a {:on-click #(put! controls-ch [:home-scroll-1st-clicked])}
-            "Learn more"
-            (common/ico :chevron-down)]]])))))
+      (html
+       [:section.home-prolog {:ref "home-prolog"}
+        [:a.home-action {:href (auth-url)
+                         :role "button"
+                         :ref "prolog-cta"
+                         :on-click #(raise! owner [:track-external-link-clicked {:event "Auth GitHub"
+                                                                                :properties {:source "prolog-cta"}
+                                                                                :path (auth-url)}])}
+         "Sign Up Free"]
+        [:div.home-cover]
+        [:div.home-top-shelf]
+        [:div.home-slogans
+         [:h1.slogan.proverb {:item-prop "Ship better code, faster."
+                              :alt       "Let's just authorize first."}
+          "Ship better code, faster."]
+         [:h3.slogan.context {:item-prop "You have a product to focus on, let CircleCI handle your"
+                              :alt       "Signing up using your GitHub login lets us start really fast."}
+          "You have a product to focus on, let CircleCI handle your"]
+         [:h3.slogan.context {:item-prop "Continuous Integration & Deployment."
+                              :alt       "Currently, we must request permissions in bulk."}
+          "Continuous Integration & Deployment."]]
+        [:div.home-avatars
+         [:div.avatars
+          [:div.avatar-github
+           (common/ico :github)]
+          [:div.avatar-circle {:ref "center-logo"}
+           (common/ico :logo)]]]
+        [:div.home-bottom-shelf
+         [:a {:on-click #(raise! owner [:home-scroll-1st-clicked])}
+          "Learn more"
+          (common/ico :chevron-down)]]]))))

 (defn purpose [data owner]
   (reify
@@ -284,38 +282,36 @@
     om/IWillUnmount (will-unmount [_] (scroll/deregister-fn (om/get-state owner :scroll-id)))
     om/IRender
     (render [_]
-      (let [controls-ch (om/get-shared owner [:comms :controls])]
-        (html
-         [:section.home-purpose {:class (when (om/get-state owner [:first-fig-animate]) "animate")}
-          [:div.home-top-shelf]
-          [:div.home-purpose-content
-           [:div.home-drawings
-            [:figure]
-            [:figure]
-            [:figure drawings/drawing-dashboard]]
-           [:div.home-articles
-            [:article {:ref "purpose-article"}
-             [:h1 "Launches are dead, long live iteration."]
-             [:p "We believe that rapid iteration, tight feedback loops, and team communication are the keys to a great product workflow.
+      (html
+       [:section.home-purpose {:class (when (om/get-state owner [:first-fig-animate]) "animate")}
+        [:div.home-top-shelf]
+        [:div.home-purpose-content
+         [:div.home-drawings
+          [:figure]
+          [:figure]
+          [:figure drawings/drawing-dashboard]]
+         [:div.home-articles
+          [:article {:ref "purpose-article"}
+           [:h1 "Launches are dead, long live iteration."]
+           [:p "We believe that rapid iteration, tight feedback loops, and team communication are the keys to a great product workflow.
                        That's why we designed the world's leading continuous integration and delivery solution.
                        Continuous integration and delivery is revolutionizing the way development teams operate by reducing barriers between your ideas and your production code.
                        Remember, it doesn't count until it ships."]
-             [:p
-              [:a.shopify-link {:href "/stories/shopify"}
-               "See how Shopify does it"
-               (common/ico :slim-arrow-right)]]]]]
-          [:div.home-bottom-shelf
-           [:a {:on-click #(put! controls-ch [:home-scroll-2nd-clicked])}
-            ;; "Continue" ; hold off on this line of copy, it's cleanr w/o
-            (common/ico :chevron-down)]]])))))
+           [:p
+            [:a.shopify-link {:href "/stories/shopify"}
+             "See how Shopify does it"
+             (common/ico :slim-arrow-right)]]]]]
+        [:div.home-bottom-shelf
+         [:a {:on-click #(raise! owner [:home-scroll-2nd-clicked])}
+          ;; "Continue" ; hold off on this line of copy, it's cleanr w/o
+          (common/ico :chevron-down)]]]))))

 (defn practice [app owner]
   (reify
     om/IDisplayName (display-name [_] "Home Practice")
     om/IRender
     (render [_]
-      (let [controls-ch (om/get-shared owner [:comms :controls])
-            selected-customer (get-in app state/customer-logo-customer-path :shopify)
+      (let [selected-customer (get-in app state/customer-logo-customer-path :shopify)
             selected-toolset (get-in app state/selected-toolset-path :languages)]
         (html
          [:section.home-practice
@@ -351,7 +347,7 @@
             [:p
              (for [toolset ["Languages" "databases" "queues" "browsers" "deployment"]]
                (html
-                [:a {:on-mouse-enter #(put! controls-ch [:toolset-clicked {:toolset (keyword (str/lower-case toolset))}])} toolset] ", "))
+                [:a {:on-mouse-enter #(raise! owner [:toolset-clicked {:toolset (keyword (str/lower-case toolset))}])} toolset] ", "))
              "we support all of your tools.
               If it runs on Linux, then it will work on CircleCI.
               We'll even be around to help you install your own tools.
@@ -362,7 +358,7 @@
             [:div.customers-brands {:class (str "selected-" (get-in customer-brands [selected-customer :position]))}
              (for [[customer template] customer-brands]
                (html
-                [:a.customers-brand {:on-mouse-enter #(do (put! controls-ch [:customer-logo-clicked {:customer customer}])
+                [:a.customers-brand {:on-mouse-enter #(do (raise! owner [:customer-logo-clicked {:customer customer}])
                                                           (om/set-state! owner [:hovered-customer] customer))
                                      :on-mouse-leave #(om/set-state! owner [:hovered-customer] nil)}
                  (get customer-logos customer)]))]
@@ -377,7 +373,7 @@
                " at "
                (get-in customer-brands [selected-customer :name])]]]]]
           [:div.home-bottom-shelf
-           [:a {:on-click #(put! controls-ch [:home-scroll-3rd-clicked])}
+           [:a {:on-click #(raise! owner [:home-scroll-3rd-clicked])}
             ;; "Continue" ; hold off on this line of copy, it's cleanr w/o
             (common/ico :chevron-down)]]])))))

@@ -396,38 +392,37 @@
     om/IWillUnmount (will-unmount [_] (scroll/deregister-fn (om/get-state owner :scroll-id)))
     om/IRender
     (render [_]
-      (let [controls-ch (om/get-shared owner [:comms :controls])]
-        (html
-         [:section.home-potential {:class (when (om/get-state owner [:second-fig-animate]) "animate")}
-          [:div.home-top-shelf]
-          [:div.home-potential-content
-           [:div.home-articles
-            [:article {:ref "potential-article"}
-             [:h1 "Look under the hood & check the bullet points."]
-             [:div.home-potential-bullets
-              [:ul
-               [:li "Quick & easy setup"]
-               [:li "Lightning fast builds"]
-               [:li "Deep Customization"]
-               [:li "Easy debugging"]]
-              [:ul
-               [:li "Smart notifications"]
-               [:li "Loving support"]
-               [:li "Automatic parallelization"]
-               [:li "Continuous Deployment"]]
-              [:ul
-               [:li "Build artifacts"]
-               [:li "Clean build environments"]
-               [:li "GitHub Integration"]
-               [:li "Free Open Source Support"]]]]]
-           [:div.home-drawings
-            [:figure]
-            [:figure]
-            [:figure drawings/draw-build-large]]]
-          [:div.home-bottom-shelf
-           [:a {:on-click #(put! controls-ch [:home-scroll-4th-clicked])}
-            ;; "Continue" ; hold off on this line of copy, it's cleanr w/o
-            (common/ico :chevron-down)]]])))))
+      (html
+       [:section.home-potential {:class (when (om/get-state owner [:second-fig-animate]) "animate")}
+        [:div.home-top-shelf]
+        [:div.home-potential-content
+         [:div.home-articles
+          [:article {:ref "potential-article"}
+           [:h1 "Look under the hood & check the bullet points."]
+           [:div.home-potential-bullets
+            [:ul
+             [:li "Quick & easy setup"]
+             [:li "Lightning fast builds"]
+             [:li "Deep Customization"]
+             [:li "Easy debugging"]]
+            [:ul
+             [:li "Smart notifications"]
+             [:li "Loving support"]
+             [:li "Automatic parallelization"]
+             [:li "Continuous Deployment"]]
+            [:ul
+             [:li "Build artifacts"]
+             [:li "Clean build environments"]
+             [:li "GitHub Integration"]
+             [:li "Free Open Source Support"]]]]]
+         [:div.home-drawings
+          [:figure]
+          [:figure]
+          [:figure drawings/draw-build-large]]]
+        [:div.home-bottom-shelf
+         [:a {:on-click #(raise! owner [:home-scroll-4th-clicked])}
+          ;; "Continue" ; hold off on this line of copy, it's cleanr w/o
+          (common/ico :chevron-down)]]]))))

 (defn epilog [data owner {:keys [cta-visibility-callback
                                  epilog-visibility-callback
@@ -462,39 +457,38 @@
     om/IWillUnmount (will-unmount [_] (scroll/deregister-fn (om/get-state owner :scroll-id)))
     om/IRender
     (render [_]
-      (let [controls-ch (om/get-shared owner [:comms :controls])]
-        (html
-         [:section.home-epilog {:ref "home-epilog"}
-          [:a.home-action {:href (auth-url)
-                           :ref "epilog-cta"
-                           :role "button"
-                           :on-click #(put! controls-ch [:track-external-link-clicked {:event "Auth GitHub"
-                                                                                :properties {:source "epilog-cta"}
-                                                                                :path (auth-url)}])}
-           "Sign Up Free"]
-          [:div.home-cover]
-          [:div.home-top-shelf]
-          [:div.home-slogans
-           [:h1.slogan.proverb {:item-prop "So, ready to ship faster?"
-                                :alt       "Let's just authorize first."}
-            "So, ready to ship faster?"]
-           [:h3.slogan.context {:item-prop "Next you'll just need to sign in using your GitHub account."
-                                :alt       "Signing up using your GitHub login lets us start really fast."}
-            "Next you'll just need to sign in using your GitHub account."]
-           [:h3.slogan.context {:item-prop "Still not convinced yet? Check out our pricing."
-                                :alt       "Currently, we must request permissions in bulk."}
-            "Still not convinced yet? Check out our "
-            [:a {:href "pricing"} "pricing"]
-            "."]]
-          [:div.home-avatars
-           [:div.avatars
-            [:div.avatar-github
-             (common/ico :github)]
-            [:div.avatar-circle
-             (common/ico :logo)]]]
-          [:div.home-bottom-shelf
-           [:a {:on-click #(put! controls-ch [:home-scroll-5th-clicked])}
-            (common/ico :chevron-down)]]])))))
+      (html
+       [:section.home-epilog {:ref "home-epilog"}
+        [:a.home-action {:href (auth-url)
+                         :ref "epilog-cta"
+                         :role "button"
+                         :on-click #(raise! owner [:track-external-link-clicked {:event "Auth GitHub"
+                                                                                :properties {:source "epilog-cta"}
+                                                                                :path (auth-url)}])}
+         "Sign Up Free"]
+        [:div.home-cover]
+        [:div.home-top-shelf]
+        [:div.home-slogans
+         [:h1.slogan.proverb {:item-prop "So, ready to ship faster?"
+                              :alt       "Let's just authorize first."}
+          "So, ready to ship faster?"]
+         [:h3.slogan.context {:item-prop "Next you'll just need to sign in using your GitHub account."
+                              :alt       "Signing up using your GitHub login lets us start really fast."}
+          "Next you'll just need to sign in using your GitHub account."]
+         [:h3.slogan.context {:item-prop "Still not convinced yet? Check out our pricing."
+                              :alt       "Currently, we must request permissions in bulk."}
+          "Still not convinced yet? Check out our "
+          [:a {:href "pricing"} "pricing"]
+          "."]]
+        [:div.home-avatars
+         [:div.avatars
+          [:div.avatar-github
+           (common/ico :github)]
+          [:div.avatar-circle
+           (common/ico :logo)]]]
+        [:div.home-bottom-shelf
+         [:a {:on-click #(raise! owner [:home-scroll-5th-clicked])}
+          (common/ico :chevron-down)]]]))))

 (def footer


Move loading icon

Move loading icon

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -13,6 +13,7 @@
   Object
   (render [this]
     (dom/div nil
+             (dom/span #js {:className "pull-right"} (vlib/loader (om/props this)))
              (vlib/button-primary #(com/route :get-all-pokemon) "Get all Pokemon"))))
 (def controls (om/factory Controls))

@@ -39,7 +40,7 @@
   Object
   (render [this]
     (dom/div nil
-             (dom/div nil (controls))
+             (dom/div nil (controls (om/props this)))
              (dom/br nil)
              (dom/table #js {:className "table table-hover"}
                         (dom/thead nil
@@ -163,7 +164,6 @@
              (dom/div nil (error-message (om/props this)))
              (view-dispatcher this)
              #_(dom/div nil (poketable (om/props this)))
-             #_(dom/div nil (login))
-             (dom/div nil (vlib/loader (om/props this))))))
+             #_(dom/div nil (login)))))


smaller sample size for elevation

smaller sample size for elevation

--- src-cljs/flatride/core.cljs
+++ src-cljs/flatride/core.cljs
@@ -58,7 +58,7 @@

 (defn start-compute-elevation-data [route idx display-elev-fn]
   (let [es (window/google.maps.ElevationService.)
-        path-req (js-obj "path" (.-overview_path route) "samples" 300)]
+        path-req (js-obj "path" (.-overview_path route) "samples" 100)]
     (.getElevationAlongPath es
                             path-req
                             (partial process-elevation-data display-elev-fn idx))))


case-insensitive check for input or textarea

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -69,7 +69,7 @@
                        (js/String.fromCharCode (.-which event)))
         tokens     [shift? meta? ctrl? alt? char]
         key-string (string/join "+" (filter identity tokens))]
-    (when-not (contains? #{"INPUT" "TEXTAREA"} (.. event -target -tagName))
+    (when-not (contains? #{"input" "textarea"} (string/lower-case (.. event -target -tagName)))
       (when (get suppressed-key-combos key-string)
         (.preventDefault event))
       (when-not (.-repeat event)


Document component macro bug/workaround

Document component macro bug/workaround

--- src-cljs/frontend/utils.clj
+++ src-cljs/frontend/utils.clj
@@ -104,12 +104,26 @@
   `component` also sets the component name that `element` will use to build an
   element name.

+  BUG/WORKAROUND: Functional components with multiple arities or a variable
+  arity need to be treated slightly differently. `component` relies on the
+  `:fn-scope` that the analyzer sets, and during the complier's processing of
+  multiple and variable arity funcitons, the function bodies end up outside the
+  actual function, and so the `:fn-scope` is no longer available to the macro.
+  As a workaround, use an explicit `def` and `fn` rather than `defn`. When the
+  compiler expands the `fn`, the function bodies remain inside the `def`, which
+  makes the name still available. See examples below.
+
   Examples:

   ;; Functional stateless component
   (defn fancy-button [on-click title]
     (component
       (html [:button {:on-click on-click} title])))
+
+  ;; Functional stateless component with varargs workaround
+  (def card
+    (fn [& children]
+      (component (html [:div children]))))

   ;; Om Previous component
   (defn person [person-data owner]


Fix cache miss return value.

Fix cache miss return value.

--- src/oc/storage/resources/reaction.clj
+++ src/oc/storage/resources/reaction.clj
@@ -19,10 +19,11 @@
       cached-response)
     (do
       (timbre/trace "Favorites cache miss for" (str field ":") uuid)
-      (reset! FavoriteReactionCache (cache/miss @FavoriteReactionCache uuid
-        (vec (map first
-          (db-common/grouped-resources-by-most-common conn "interactions" field
-                                                      uuid "reaction" config/max-favorite-reaction-count))))))))
+      (let [favs (vec (map first
+                  (db-common/grouped-resources-by-most-common conn "interactions" field
+                                                              uuid "reaction" config/max-favorite-reaction-count)))]
+        (reset! FavoriteReactionCache (cache/miss @FavoriteReactionCache uuid favs))
+        favs))))

 (defn- org-favorites
   "


cleanup core.clj

cleanup core.clj

--- src/websync/core.clj
+++ src/websync/core.clj
@@ -32,28 +32,12 @@
 (def zdfDay (str zdfMediathek
                "hauptnavigation/sendung-verpasst/day%d?flash=off"))

-(defn zdf-old [file]
-  (let [postlinks (flatten (map #(html/select (html/html-resource (html/html-resource (io/as-url (format zdfDay %)))) [:div.beitragListe :div.image :a]) (range 1)))
-        posturls (map #(java.net.URL. (io/as-url zdfHost ) (get-in % [:attrs :href])) postlinks)
-        posttrees (map #(html/html-resource %) posturls)
-        videonames (map #(first (:content (first (html/select % [:h1.beitragHeadline])))) posttrees)
-        videolinks (map #(last (html/select % [:ul.dslChoice :a])) posttrees)
-        videourls (map #(java.net.URL. (io/as-url zdfHost) (get-in % [:attrs :href])) videolinks)]
-   (map #(hash-map :name (str %1 ".mov") :url %2) videonames videourls)))
-
 (defn url [&[url relative]]
   (java.net.URL. (io/as-url url) (or relative "")))

 (url "http://w.com/holla" "haha") ; TODO: fix this bug

 (defn zdf-url [href] (url zdfHost href))
-
-(defn zdf [file]
-  (map zdf-post (flatten (map zdf-post-links (range 1)))))
-
-(defn zdf-post-links [url]
-  (html/select (html/html-resource (io/as-url (format zdfDay url)))
-               [:div.beitragListe :div.image :a]))

 (defn get-href [a] (get-in a [:attrs :href]))

@@ -65,3 +49,10 @@
         videolink (last (html/select posttree [:ul.dslChoice :a]))
         videourl (zdf-url (get-href videolink))]
    {:name (str videoname ".mov") :url videourl}))
+
+(defn zdf-post-links [url]
+  (html/select (html/html-resource (io/as-url (format zdfDay url)))
+               [:div.beitragListe :div.image :a]))
+
+(defn zdf [file]
+  (map zdf-post (flatten (map zdf-post-links (range 1)))))


Fix phonebook swagger

Fix phonebook swagger

--- src/yada/swagger.clj
+++ src/yada/swagger.clj
@@ -26,7 +26,9 @@
    [yada.resource :refer [resource]]
    [yada.schema :as ys]
    [yada.util :refer [md5-hash] :as util])
-  (:import [clojure.lang PersistentVector Keyword]))
+  (:import [clojure.lang PersistentVector Keyword]
+           [yada.handler Handler]
+           [yada.resource Resource]))

 (defprotocol SwaggerPath
   (encode [_] "Format route as a swagger path"))
@@ -40,9 +42,20 @@
   (comp (map (comp :name :media-type))
         (distinct)))

+;; We can use resources as handlers directly, or wrap in handlers. We
+;; must be careful to be able to work with both.
+(defprotocol HandlerToResource
+  (handler->resource [_] "Return a resource from a handler"))
+
+(extend-protocol HandlerToResource
+  Handler
+  (handler->resource [h] (:resource h))
+  Resource
+  (handler->resource [r] r))
+
 (defn to-path [route]
   (let [path (->> route :path (map encode) (apply str))
-        {:keys [methods parameters produces consumes]} (get-in route [:handler :resource])]
+        {:keys [methods parameters produces consumes]} (handler->resource (:handler route))]
     [path
      (into {}
            (for [m (keys methods)


Add a NOTE about resetting the scroll position.

--- src-cljs/pepa/workflows/dashboard.cljs
+++ src-cljs/pepa/workflows/dashboard.cljs
@@ -133,9 +133,17 @@
         scroll-height (.-scrollHeight el)
         [num scroll] (parse-count-scroll state)
         elements (page-ids state)]
-    (when (= 0 (.-scrollTop el))
+
+    (cond
+      (= 0 (.-scrollTop el))
       (set! (.-scrollTop el) (* scroll-height
-                                (/ scroll (count elements)))))))
+                                (/ scroll (count elements))))
+
+      ;; TODO: :count isn't always nil (the query-params won't get
+      ;; updated). Need another way to change the url without changing
+      ;; history
+      (every? nil? ((juxt :count :scroll) (get-in state [:navigation :query-params])))
+      (set! (.-scrollTop el) 0))))

 (defn dashboard [state owner]
   (reify


Fix error in lifecycles information model.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -350,11 +350,11 @@
    :lifecycle-entry
    {:summary "Lifecycles are a feature that allow you to control code that executes at particular points during task execution on each peer. Lifecycles are data driven and composable."
     :link nil
-    :model {:lifecycle/name
-            {:doc "A unique name identifying this lifecycle."
-             :type :keyword
-             :optional? false
-             :restrictions ["Must be unique across all lifecycle entries."]}
+    :model {:lifecycle/task
+            {:doc "The task that this lifecycle applies to."
+             :type :keyword
+             :optional? false
+             :restrictions ["Must be a task defined in the workflow."]}

             :lifecycle/calls
             {:doc "A fully qualified, namespaced keyword pointing to a symbol on the classpath at runtime. This symbol must be a map with keys further specified by the information model. The keys in this map denote the concrete functions to invoke at execution time."


Increase default idle time.

Increase default idle time.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -926,7 +926,7 @@
             {:doc "Number of nanoseconds an idle peer should sleep for when blocked in a particular lifecycle stage. Defaults to 0.5 milliseconds, or 500000 nanoseconds."
              :type :integer
              :unit :nanosecond
-             :default 500000
+             :default 1000000
              :optional? true
              :added "0.10.0"}


Minor code cleanup.

Minor code cleanup.

--- src/onyx/peer/window_state.cljc
+++ src/onyx/peer/window_state.cljc
@@ -202,7 +202,6 @@
            state-store (ts/get-state-store state)
            grouped? (not (nil? grouping-fn))
            state-event* (assoc state-event :grouped? grouped?)
-           windows-state (ts/get-windows-state state)
            updated-states (reduce
                            (fn [windows-state* segment]
                              (if (u/exception? segment)
@@ -215,10 +214,10 @@
                                                            (assoc :group-key group-key)))
                                                      (assoc state-event* :segment segment))]
                                  (fire-state-event windows-state* state-event**))))
-                           windows-state
+                           (ts/get-windows-state state)
                            (mapcat :leaves (:tree results)))
            emitted (doall (mapcat (comp deref :emitted) updated-states))]
-       (run! (fn [w] (reset! (:emitted w) [])) windows-state)
+       (run! (fn [w] (reset! (:emitted w) [])) updated-states)
        (-> state
            (ts/set-windows-state! updated-states)
            (ts/update-event! (fn [e] (update e :onyx.core/triggered into emitted)))))))


util/context.clj: separated get-property-function from get-property

--- src/org/altlaw/util/context.clj
+++ src/org/altlaw/util/context.clj
@@ -1,7 +1,10 @@
 (ns org.altlaw.util.context)

+(defn get-property-function [name]
+  (System/getProperty name))
+
 (defn get-property [name]
-  (or (System/getProperty name)
+  (or (get-property-function name)
       (throw (Exception. (str "Missing property " name)))))


Stopped binding the shader.

Stopped binding the shader.

--- src/petulant_life/rendering.clj
+++ src/petulant_life/rendering.clj
@@ -95,13 +95,8 @@
   (GL30/glBindVertexArray vao)
   (GL20/glEnableVertexAttribArray 0)

-  ;; Setting up the shader.
-  (GL20/glUseProgram shader)
-
+  ;; Actually drawing the square.
   (GL11/glDrawArrays GL11/GL_TRIANGLES 0 (* 2 vct))
-
-  ;; Cleaning up the shader.
-  (GL20/glUseProgram 0)

   ;; Cleaning up the VAO.
   (GL20/glDisableVertexAttribArray 0)


Formatting

Formatting

--- src/braid/core/client/core/events.cljs
+++ src/braid/core/client/core/events.cljs
@@ -593,7 +593,9 @@
              (assoc :temp-threads (->> (data :user-groups)
                                       (map :id)
                                       (reduce (fn [memo group-id]
-                                                (assoc memo group-id (schema/make-temp-thread group-id))) {})))
+                                                (->> (schema/make-temp-thread group-id)
+                                                    (assoc memo group-id)))
+                                              {})))
              (helpers/add-tags (data :tags))
              (helpers/set-preferences (data :user-preferences))
              (as-> <>


multiple col focus trial

multiple col focus trial

--- src/clj/webapp/routes/multipdgmmod.clj
+++ src/clj/webapp/routes/multipdgmmod.clj
@@ -393,11 +393,10 @@
   (update-in m [(key map-entry)] (fnil conj []) (val map-entry)))
 (defn merge-matches [property-map-list]
   (reduce conj-in {} (apply clojure.core/concat property-map-list)))
-
 (defn vec2map
   "join all elements of vector but last with ','; last with ' '"
   [row]
-  (let [prow (join "," row)]
+  (let [prow (clojure.string/join "," row)]
    (clojure.string/replace prow #"(.*),(.*?$)" "$1 $2")))
 ;;(clojure.string/replace (join "," row) #"(.*),(.*?$)" "$1 $2"))

@@ -407,23 +406,39 @@
   (let [hmap1 (split prmp #" ")
         hmap2 (apply hash-map hmap1)]
     (clojure.walk/keywordize-keys hmap2)))
+
+(defn make-pivot-map
+  [prow pivots]
+  ;; build up pkey and pval, then hash-map
+  (for [pivot pivots]
+    (let [pkey (nth prow pivot)])))
+

 (defn handle-multimodplldisplay4
   "In this version pivot/keyset can be generalized beyond png any col (eventually any sequence of cols) between col-1 and token column. (Need to find out how to 'presort' cols before initial display?)"
-  [pdgms headerset2 pdgmstr2 pivotname]
+  [pdgms headerset2 pdgmstr2 pivotlist]
   (let [pnamestr (clojure.string/replace pdgms #"[\[\]\"]" "")
         pnames (split pnamestr #" ")
-        pivot (read-string pivotname)
+        ;;pivot (read-string pivotname)
         ;; get rid of spurious line-feeds
         ;;pdgmstr2a (str pdgmstr2)
         pdgmstr3 (cleanpdgms pdgmstr2)
         ;; map each 'val-string-w/o-pivot-val token' to token
         prows (split pdgmstr3 #"\\r\\n")
         pcells (for [prow prows] (split prow #","))
-        pivot-map (for [prow pcells] (hash-map (nth prow pivot) (vec-remove prow pivot)))
+        ;; build up pkey by joining pivot-vals and pval by removing pivot-vals
+        pklist (make-pklist pcells pivotlist)
+        pvlist (make-pvlist pcells pivotlist)
+        pivots (split pivotlist #",")
+        pivot-map (for [prow pcells] (hash-map pkey pval))
+        ;; pivot-map (for [prow pcells] (hash-map (nth prow pivot) (vec-remove prow pivot)))
+        pivot-map (for [prow pcells] (make-pivot-map prow pivots))
         ;; group the val-tokens associated with each pivot val
         newpdgms (merge-matches pivot-map)
+        pdgmnums (into [] (take (clojure.core/count pnames) (iterate inc 1)))
         ;; make a vector of pivot vals
+        ;;pvalvec (vec (for [pdgmnum pdgmnums] (str "P-" pdgmnum)))
+        ;;pnames2 (vec (for [npdgm newpdgms] (str (key npdgm))))
         pvalvec (vec (for [npdgm newpdgms] (str (key npdgm))))
         ;; e.g., ["Plural" "Singular"]
         ;; make a vector of pdgm rows for each pivot
@@ -435,8 +450,7 @@
         pmaps (for [prmap prmaps] (apply conj prmap))
         headerset3 (clojure.string/replace headerset2 #"[\[\]\"]" "")
         heads (split (str headerset3) #" ")
-        headvec (vec-remove heads pivot)
-        ;; pdgmnums (into [] (take (clojure.core/count pnames) (iterate inc 1)))
+        headvec (vec-remove heads pivotlist)
         ;; set of lists of vaue-combination-terms
         keylists (set (for [pmap pmaps] (keys pmap)))
         ;;keylists (set (keys pmap))
@@ -451,23 +465,6 @@
       [:h3 "Parallel Display of Paradigms:" ]
       [:p "Click on column to sort (multiple sort by holding down shift key). Columns can be dragged by clicking and holding on 'drag-bar' at top of column."]
      [:p "Paradigms:"
-      [:div [:h4 "======= Debug Info: ======="]
-       [:p "pnames: " (str pnames)]
-       [:p "headerset2: " [:pre headerset2]]
-       [:p "pivot: " [:pre pivot]]
-       [:p "heads: " (str heads)]
-       [:p "headvec: " (str headvec)]
-       [:p "pvalvec: " [:pre pvalvec]]
-       [:p "pdgmstr2: " [:pre pdgmstr2]]
-       ;;[:p "vvec: " [:pre vvec]]
-       [:p "vvec: " (str vvec)]
-       [:p "pmapvec: " [:pre pmapvec]]
-       [:p "prmaps: " [:pre prmaps]]
-       [:p "pmaps: " [:pre pmaps]]
-       [:p "keylists: " [:pre keylists]]
-       [:p "keystring: " [:pre keystring]]
-       [:p "keyset: " [:pre keyset]]
-       [:p "==========================="]]
       [:ol
       (for [pname pnames]
         [:li pname])]]
@@ -488,11 +485,32 @@
                 (for [npg npgs]
                   [:td npg])
                 (for [pmap pmaps]
-               [:td (kstrkey pmap)])])]) ]
+               [:td (kstrkey pmap)])])]) ]]
+       [:div [:h4 "======= Debug Info: ======="]
+        [:p "pnames: " (str pnames)]
+        [:p "headerset2: " [:pre headerset2]]
+        ;; [:p "pivot: " [:pre pivot]]
+        [:p "heads: " (str heads)]
+        [:p "headvec: " (str headvec)]
+        [:p "prows: "  (str prows) [:pre prows]]
+        [:p "pcells: " (println (str pcells)) [:pre pcells]]
+        [:p "pivot-map: " [:pre pivot-map]]
+        [:p "newpdgms: " [:pre newpdgms]]
+        [:p "pvalvec: " (str pvalvec) [:pre pvalvec]]
+        [:p "pdgmstr2: " [:pre pdgmstr2]]
+        ;;[:p "vvec: " [:pre vvec]]
+        [:p "vvec: " (str vvec)]
+        [:p "pmapvec: " [:pre pmapvec]]
+        [:p "prmaps: " [:pre prmaps]]
+        [:p "pmaps: " [:pre pmaps]]
+        [:p "keylists: " [:pre keylists]]
+        [:p "keystring: " [:pre keystring]]
+        [:p "keyset: " [:pre keyset]]
+        [:p "==========================="]]
       [:script {:src "js/goog/base.js" :type "text/javascript"}]
       [:script {:src "js/webapp.js" :type "text/javascript"}]
       [:script {:type "text/javascript"}
-       "goog.require('webapp.core');"]]])))
+       "goog.require('webapp.core');"]])))

 (defroutes multipdgmmod-routes


pursue

pursue

--- src/cljs/infinitelives/utils/boid.cljs
+++ src/cljs/infinitelives/utils/boid.cljs
@@ -45,3 +45,11 @@
     (assoc boid
            :pos new-pos
            :vel new-vel)))
+
+(defn pursue [{:keys [pos] :as boid} target target-vel]
+  (seek boid (->> pos
+                 (vec2/direction target)
+                 vec2/magnitude
+                 (* 4)                  ; 4 = c (T=Dc)
+                 (vec2/scale target-vel)
+                 (vec2/add target))))


change url input placeholder

change url input placeholder

--- src/cljs/salava/badge/ui/settings.cljs
+++ src/cljs/salava/badge/ui/settings.cljs
@@ -277,7 +277,7 @@
            [:div.panel.panel-default
             [:div.panel-heading
              [:div.panel-title
-              [:div.url [:i.fa.fa-link]] [evidence/input {:name "evidence-url" :atom evidence-url-atom :type "url" :placeholder "http://"}]]]
+              [:div.url [:i.fa.fa-link]] [evidence/input {:name "evidence-url" :atom evidence-url-atom :type "url" :placeholder (t :badge/EnterevidenceURLstartingwith)}]]]
             [:div.panel-body.evidence-panel-body
              [:div [:div.form-group
                     [:label.col-md-3 "Name"]


notes are neither drinkable nor edible

notes are neither drinkable nor edible

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -237,6 +237,8 @@

    {:pred :note}     {:animate false
                       :clothing false
+                      :drinkable false
+                      :edible false
                       :legible true}

    {:pred :party}    {:clothing false


admire: subj is human

admire: subj is human

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -221,6 +221,9 @@
          :discrete false
          :obj {:animate true}
          :subj {:human true}}
+
+        {:subj {:human true}
+         :pred :admire}

         {:activity true
          :obj {:human true}


stop only when have to

stop only when have to

--- src/celestial/workflows.clj
+++ src/celestial/workflows.clj
@@ -113,7 +113,7 @@
   [{:keys [system-id machine] :as spec}]
   (let [vm (vconstruct spec)]
     (when (.status vm)
-      (.stop vm)
+      (when (= (.status vm) "running") (.stop vm))
       (.delete vm))
     (s/delete-system system-id)
     (info "system destruction done")))


allow 0-index

allow 0-index

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@8956 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- acqEngine/src/org/micromanager/config_editor.clj
+++ acqEngine/src/org/micromanager/config_editor.clj
@@ -14,7 +14,7 @@

 (defn get-selected-group []
   (let [row (.getSelectedRow (@widgets :groups-table))]
-    (when (pos? row)
+    (when (<= 0 row)
       (nth @groups row))))


remove unused function

remove unused function

--- src/chessground/common.cljs
+++ src/chessground/common.cljs
@@ -53,9 +53,3 @@
   (if (map? (get-in hashmap path))
     (update-in hashmap path keywordize-keys)
     hashmap))
-
-(defn nodelist-to-seq
-  "Converts nodelist to (not lazy) seq."
-  [nl]
-  (let [result-seq (map #(.item nl %) (range (.length nl)))]
-    (doall result-seq)))


Changed one nested if-statement to use cond which is more idiomatic.

--- src/chessground/common.cljs
+++ src/chessground/common.cljs
@@ -44,11 +44,12 @@
    Because the <body> element must exist at the time this code runs."
   (do
     (or (.-body js/document) (throw "chessground must be included in the <body> tag!"))
-    (if (js* "'transform' in document.body.style") "transform"
-      (if (js* "'webkitTransform' in document.body.style") "webkitTransform"
-        (if (js* "'mozTransform' in document.body.style") "mozTransform"
-          (if (js* "'oTransform' in document.body.style") "oTransform"
-            "transform"))))))
+    (cond
+      (js* "'transform' in document.body.style") "transform"
+      (js* "'webkitTransform' in document.body.style") "webkitTransform"
+      (js* "'mozTransform' in document.body.style") "mozTransform"
+      (js* "'oTransform' in document.body.style") "oTransform"
+      :else "transform")))

 (defn square-element [dom-element]
   "If element is a square, return it. If it's a piece, return its parent"


Add transformation core/combine spec [skip ci]

--- backend/specs/akvo/lumen/specs/transformation.clj
+++ backend/specs/akvo/lumen/specs/transformation.clj
@@ -126,6 +126,27 @@
 	    ::transformation.engine/onError
             ::transformation.engine/op]))

+
+
+(create-ns  'akvo.lumen.specs.transformation.combine)
+(alias 'transformation.combine 'akvo.lumen.specs.transformation.combine)
+
+(s/def ::transformation.combine/newColumnTitle string?)
+
+(s/def ::transformation.combine/separator string?)
+
+(s/def ::transformation.combine/columnNames (s/coll-of ::db.dsv.column/columnName :kind vector? :distinct true))
+(s/def ::transformation.combine/args
+  (s/keys :req-un [::transformation.combine/columnNames
+                   ::transformation.combine/newColumnTitle
+                   ::transformation.combine/separator]))
+
+(defmethod op-spec :core/combine  [_]
+  (s/keys
+   :req-un [::transformation.combine/args
+	    ::transformation.engine/onError
+            ::transformation.engine/op]))
+
 (lumen.s/sample ::transformation.engine/op-spec 10)

 (create-ns  'akvo.lumen.specs.dataset-version.transformation)


implement Record Reconstructor

implement Record Reconstructor

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -189,7 +189,7 @@
              {:optional
               {:req (req (:dopp-active card))
                :prompt "Use Doppelgänger to run again?" :player :runner
-               :yes-ability {:prompt "Choose a server"
+               :yes-ability {:prompt "Choose a server"
                              :choices (req servers)
                              :msg (msg "make a run on " target)
                              :effect (effect (update! (dissoc card :dopp-active)) (run target))}}}}}
@@ -378,6 +378,19 @@
                                                      (runner-install state side c)
                                                      (shuffle! state :runner :deck)))}}} card nil))
     :leave-play (effect (lose :link 1))}
+
+   "Record Reconstructor"
+   {:events
+    {:successful-run
+     {:req (req (= (get-in @state [:run :server]) [:archives]))
+      :effect (req (let [rr card]
+                     (swap! state assoc-in [:run :run-effect :replace-access]
+                       {:effect (effect (resolve-ability
+                                          {:prompt "Choose one faceup card to add to the top of R&D"
+                                           :choices (req (filter #(:seen %) (:discard corp)))
+                                           :msg (msg "add " (:title target) " to the top of R&D")
+                                           :effect (req (move state :corp target :deck {:front true}))}
+                                         rr nil))})))}}}

    "Replicator"
    {:events {:runner-install


Fix the stupidest typo bug

Fix the stupidest typo bug

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -51,7 +51,7 @@
                   site-list)]))))

 (defn comic-list []
-  (let [comics-list (rf/subscribe [:comic-list])]
+  (let [comic-list (rf/subscribe [:comic-list])]
     (fn []
       (when-let [comic-list @comic-list]
         [:ul (map (id-btn-for-callback


Fix unique :key warning on add pubchat screen

--- src/status_im/ui/screens/add_new/new_public_chat/view.cljs
+++ src/status_im/ui/screens/add_new/new_public_chat/view.cljs
@@ -103,4 +103,5 @@
                              (conj chats lang-topic)
                              chats)]
             (for [chat chats]
-              (render-topic chat)))]])]]))
+              ^{:key chat}
+              [render-topic chat]))]])]]))


(maint) puppetdb.pql: remove unused require and import

--- src/puppetlabs/puppetdb/pql.clj
+++ src/puppetlabs/puppetdb/pql.clj
@@ -1,12 +1,10 @@
 (ns puppetlabs.puppetdb.pql
-  (:import com.fasterxml.jackson.core.JsonParseException)
   (:require [clojure.java.io]
             [clojure.string :refer [join]]
             [instaparse.core :as insta]
             [instaparse.failure :as failure]
             [instaparse.print :as print]
             [puppetlabs.i18n.core :refer [tru]]
-            [puppetlabs.puppetdb.cheshire :as json]
             [puppetlabs.puppetdb.pql.transform :as transform]
             [puppetlabs.puppetdb.utils.string-formatter :refer [pprint-json-parse-exception]]))


Trying out say route

Trying out say route

--- src/clj/lauranne/server.clj
+++ src/clj/lauranne/server.clj
@@ -8,21 +8,32 @@
             [ring.middleware.reload :as reload]
             [environ.core :refer [env]]
             [org.httpkit.server :refer [run-server]]
-            [ring.middleware.json :refer [wrap-json-response]]
-            [ring.util.response :refer [response]]))
+            [ring.middleware.json :refer [wrap-json-response wrap-json-body]]
+            [ring.util.response :refer [response]]
+            [clj-http.client :as client]))

 (deftemplate page
   (io/resource "index.html") [] [:body] (if is-dev? inject-devmode-html identity))

-(defn register [visitor]
+(defn register [visitor]
   (print "register:\n" visitor)
    {:status 200})
+
+(defn say [body]
+  (println body)
+  (client/post "http://192.168.103.34:3000/say" {:content-type :json :body {:message "moi"}})
+  {:status 200})

 (defroutes routes
   (resources "/")
   (resources "/react" {:root "react"})
   (GET "/*" req (page))
-  (POST "/register" [visitor] (register visitor)))
+  (POST "/register" [visitor] (register visitor))
+  (-> (POST "/say" {body :body}
+        (say body))
+      wrap-json-response
+      wrap-json-body)
+  (GET "/*" req (page)))

 (def http-handler
   (if is-dev?


Actions are inactive when verdict is shown

--- src/cljs/db_quiz/logic.cljs
+++ src/cljs/db_quiz/logic.cljs
@@ -132,25 +132,26 @@

 (defn make-a-guess
   []
-  (let [{:keys [answer board current-field on-turn]} @app-state
+  (let [{:keys [answer board current-field on-turn verdict]} @app-state
         correct-answer (get-in board [current-field :label])
         answer-matched? (answer-matches? answer correct-answer)
         new-ownership (if answer-matched? on-turn :missed)]
-    ; Test if the game is over:
-    (if-let [winner (find-winner (:board (swap! app-state
-                                                (partial change-ownership new-ownership current-field))))]
-      (do (swap! app-state #(assoc % :winner winner))
-          (set! (.-location js/window) "/#end"))
-      (turn :answer answer
-            :answer-matched? answer-matched?
-            :correct-answer correct-answer))))
+    (when (nil? verdict)
+      ; Test if the game is over:
+      (if-let [winner (find-winner (:board (swap! app-state
+                                                  (partial change-ownership new-ownership current-field))))]
+        (do (swap! app-state #(assoc % :winner winner))
+            (set! (.-location js/window) "/#end"))
+        (turn :answer answer
+              :answer-matched? answer-matched?
+              :correct-answer correct-answer)))))

 (defn pick-field
   "A player picks a field with id on board."
   [id]
-  (let [{:keys [board current-field loading? on-turn]} @app-state
+  (let [{:keys [board current-field loading? on-turn verdict]} @app-state
         ownership (get-in board [id :ownership])]
-    (when (and (= ownership :default) (nil? current-field) (not loading?))
+    (when (and (= ownership :default) (nil? current-field) (not loading?) (nil? verdict))
       (swap! app-state (comp (partial make-active id)
                              restart-timer
                              (fn [app-state] (assoc app-state :current-field id)))))))


Optimizations: 10 times faster

Optimizations: 10 times faster

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -62,25 +62,23 @@
   [cell]
   (or (= cell :empty) (= cell :wall)))

-(defn range-coord
+(defn range-cells
   "Give all the pairs [cell coordinate] in the provided direction"
   [board [xi yi] [dx dy]]
-  (loop [x xi, y yi, res []]
+  (loop [x xi, y yi,
+         taken nil,
+         res []]
     (if-let [c (get-in board [x y])]
-      (if (is-cell-empty? c) res
-        (recur
-          (+ x dx) (+ y dy)
-          (conj res [c [x y]])))
+      (cond
+        (is-cell-empty? c) nil ;; No move: reached end and only 1 type of cell
+        (and taken (not= taken c)) {:winner c     ;; Who wins the cells
+                                    :looser taken ;; Who looses the cells
+                                    :taken res}
+        :else (recur
+                (+ x dx) (+ y dy)
+                (or taken c)
+                (conj res [x y])))
       res)))
-
-(defn range-cells ;; TODO - Use the concept of sentinel for the walls?
-  "Give all the cells in the provided direction - until you reach an empty / blocked / wall cell"
-  [board pos dir]
-  (eduction
-    (comp
-      (partition-by first)
-      (map (juxt #(-> % first first) #(mapv second %))))
-    (range-coord board pos dir)))

 (defn available-cells-by-dir
   "Indicates the convertible cells for the provided player - when clicking at [x y]
@@ -90,13 +88,9 @@
 		 :looser :red,
 		 :taken [[8 5] [9 5]]}"
   [board [x y :as pos] [dx dy :as dir]]
-  (let [[head tail :as cells] (take 2 (range-cells board [(+ x dx) (+ y dy)] dir))]
-    (when (= 2 (count cells))
-      {:move pos             ;; Where the move took place
-       :winner (first tail)  ;; Who wins the cells
-       :looser (first head)  ;; Who looses the cells
-       :taken (second head)} ;; Which cells are taken
-      )))
+  (when-let [m (range-cells board [(+ x dx) (+ y dy)] dir)]
+    (conj m [:move pos])
+    ))

 (defn available-moves-at
   "Provides the list of moves that can be done from a cell"
@@ -138,6 +132,12 @@
         all-positions)) ;; TODO - To optimize, just consider the move of the current player?
     ))

+(defn bench-test
+  [app-state]
+  (dotimes [n 10]
+    (do (with-available-moves app-state) nil)
+    ))
+

 ;; -----------------------------------------
 ;; ON PLAYER MOVE


Refactor config to enable variable width.

--- src/cljs/vinculum/core.cljs
+++ src/cljs/vinculum/core.cljs
@@ -16,27 +16,17 @@
    (js/google.visualization.arrayToDataTable
      (clj->js (cons ["Date" "Weight"] (get-in @app-state [:weight :data])))))

-(defn chart-options []
-  (clj->js {:title  "Weight"
-            :width 1000
-            :height 600
+(defn chart-options [width height]
+  (clj->js {:title  ""
+            :width width
+            :height height
             :trendlines { :0 {:visibleInLegend false
                               :opacity 0.3}}}))
-
-;; FIXME: ALL OF THIS IS WRONG
-(defn get-chart []
-  (js/google.visualization.LineChart. (.getElementById js/document "content" )))
-
-(defn- draw-chart []
-  (let [data (add-rows)
-        options (chart-options)
-        chart (get-chart)]
-    (.draw chart data options)))

 (defn- draw-line-chart [data div {:keys [id]}]
   (let [{:keys [width height]}    div
         chart (js/google.visualization.LineChart. (.getElementById js/document id))
-        options (chart-options) ;; fixme: use width/height!
+        options (chart-options width height)
         draw-stats (js/google.visualization.arrayToDataTable
                     (clj->js (cons ["Date" "Weight"] data)))]
     (.draw chart draw-stats options)))


Include each scenario's "notes" in new-game modal if available

--- src/cljs/zetawar/views.cljs
+++ src/cljs/zetawar/views.cljs
@@ -500,9 +500,12 @@
         (into [:select.form-control {:id "scenario-id"
                                      :selected (some-> @selected-scenario-id name)
                                      :on-change select-scenario}]
-              (for [[scenario-id {:keys [description]}] data/scenarios]
+              (for [[scenario-id {:keys [description notes]}] data/scenarios]
                 [:option {:value (name scenario-id)}
-                 description]))
+                 (if notes
+                   (str description ": " notes)
+                   description)]))
+        (:description (@selected-scenario-id data/scenarios))
         [:> js/ReactBootstrap.Modal.Footer
          [:button.btn.btn-primary {:on-click start-new-game}
           (translate :start-button)]


use tools.reader to read the env back

use tools.reader to read the env back

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -534,7 +534,7 @@

 (defn restore-env []
   (reset! core-env
-          (read-string (slurp (io/resource "cljs-env.res"))))
+          (reader/read-string (slurp (io/resource "cljs-env.res"))))
   nil)

 (defn setup-rt []


CmR-3603: Fixed problem with calls made to acl lib.

--- search-app/src/cmr/search/services/acls/acl_helper.clj
+++ search-app/src/cmr/search/services/acls/acl_helper.clj
@@ -16,7 +16,7 @@
     (let [sids (cache/get-value (cache/context->cache context token-sid-cache-name)
                                 token
                                 #(or (sids-retriever/get-sids context (:token context))
-                                     (acl/context->sids context)))
+                                     {:sids (acl/context->sids context)}))
           token-guid (:guid sids)
           sids (:sids sids)]
       (when token-guid (info (format "Client token GUID: [%s]" token-guid)))


Overrode Lattice's hashCode

Overrode Lattice's hashCode

to constantly return 0.

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

--- src/conexp/fca/lattices.clj
+++ src/conexp/fca/lattices.clj
@@ -25,7 +25,10 @@
 	   (forall [x (:base-set this)
 		    y (:base-set this)]
 	     (<=> (order-this [x y])
-		  (order-other [x y])))))))
+		  (order-other [x y]))))))
+  (hashCode []
+    ;; can't think of a better way ...
+    0))

 (defn base-set
   "Returns the base set of lattice."


redis env variable not picked up on heroku

--- src/setlista/search_history.clj
+++ src/setlista/search_history.clj
@@ -2,9 +2,20 @@
   (:require [taoensso.carmine :as car :refer (wcar)]
             [clojure.data.json :as json]))

+(defn heroku-conn []
+  (let
+      [redisurl (System/getenv "REDISCLOUD_URL")
+       uri (new java.net.URI redisurl)
+       userpass
+       (and (.getUserInfo uri)
+            (clojure.string/split (.getUserInfo uri) #":"))]
+    (car/make-conn-spec :host (.getHost uri)
+                        :port (.getPort uri)
+                        :password (first (rest userpass)))))
+
 (defn server-conn []
-  (when-let [redis-cloud (get (System/getenv) "REDISCLOUD_URL")]
-    {:pool {} :spec {:host redis-cloud :port 6379}}))
+  (when-let [config (System/getenv "REDISCLOUD_URL")]
+    (heroku-conn)))

 (def last-searches "last-searches")


Minor fix on profiles.clj

Minor fix on profiles.clj

--- profiles.clj
+++ profiles.clj
@@ -1,5 +1,5 @@
 {:dev
- {:aliases {"test-all" ["with-profile" "dev,1.8:dev,1.6:dev,1.5:dev:dev" "test"]}
+ {:aliases {"test-all" ["with-profile" "dev,1.8:dev,1.6:dev,1.5:dev" "test"]}
   :codeina {:sources ["src"]
             :reader :clojure
             :target "doc/dist/latest/api"


remove commented functions

remove commented functions

--- src/synthesis_crawlers/core.clj
+++ src/synthesis_crawlers/core.clj
@@ -73,7 +73,6 @@
 (s/fdef empty-extractor?
         :args (s/cat :extractor (s/map-of ::container-extractor
                                           (s/map-of keyword? #(or (string? %) (nil? %))))))
-
 (s/def ::empty-extractor (s/map-of #(= "" %) (s/map-of keyword? nil?)))
 (defn empty-extractor?
   "returns a non nil value iff the specifiled extractor is empty"
@@ -81,12 +80,3 @@
   (s/valid? ::empty-extractor extractor))

 ;; split-with
-
-;; todo filter nil filter
-#_(defn extract-knowledge
-    [attrs pages extractors knowledge]
-    (for [page pages]
-      (Jsoup/parse (get-page page))))
-
-#_(doseq [elem (.select (.get (Jsoup/connect url)) "#html")](println (.html elem) ))
-#_(println (.html (.select (.get (Jsoup/connect url)) "html > body > div[id=content]")))


Tundra: housekeeping (use keywords for keynames)

--- src/taoensso/carmine/tundra.clj
+++ src/taoensso/carmine/tundra.clj
@@ -20,7 +20,7 @@

 ;;;; Private Redis commands

-(def ^:private tkey (memoize (partial car/key "carmine" "tundra")))
+(def ^:private tkey (memoize (partial car/key :carmine :tundra)))

 (defn- extend-exists
   "Returns 0/1 for each key that doesn't/exist, extending any preexisting TTLs."


Add kibana-nginx to the logstash machine

--- src/terraboot/elasticsearch.clj
+++ src/terraboot/elasticsearch.clj
@@ -56,12 +56,18 @@
                           }}))

 (defn logstash-user-data-coreos [es-host]
-  (let [run-logstash (docker-systemd-unit "mastodonc" "logstash-ng"
-                                          {:options [(str "--env " "ES_HOST=" es-host)
-                                                     "--net=host"]
-                                           :entry-point "-f /etc/logstash/logstash.conf"}
-                                          )]
-    (cloud-config-coreos [run-logstash])))
+  (let [logstash (docker-systemd-unit "mastodonc" "logstash-ng"
+                                      {:options [(str "--env " "ES_HOST=" es-host)
+                                                 "--net=host"]
+                                       :entry-point "-f /etc/logstash/logstash.conf"}
+                                      )
+        nginx (docker-systemd-unit "mastodonc" "kibana-nginx"
+                                      {:options [(str "--env " "ES_HOST=" es-host)
+                                                 "--net=host"]
+                                       :entry-point "/bin/bash -c \"envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'\""}
+                                      )]
+    (cloud-config-coreos [logstash
+                          nginx])))

 (defn elasticsearch-policy
   []


[FIX #148] Disable back button on QR code reader page until camera is available.

--- src/status_im/ui/screens/qr_scanner/views.cljs
+++ src/status_im/ui/screens/qr_scanner/views.cljs
@@ -12,26 +12,30 @@
             [status-im.components.toolbar.styles :refer [toolbar-background1]]
             [status-im.ui.screens.qr-scanner.styles :as st]
             [status-im.utils.types :refer [json->clj]]
-            [clojure.string :as str]))
+            [clojure.string :as str]
+            [reagent.core :as r]))

-(defview qr-scanner-toolbar [title]
+(defview qr-scanner-toolbar [title hide-nav?]
   (letsubs [modal [:get :modal]]
     [view
      [status-bar]
      [toolbar {:title            title
                :background-color toolbar-background1
+               :hide-nav?        hide-nav?
                :nav-action       (when modal
                                    (act/back #(dispatch [:navigate-back])))}]]))

 (defview qr-scanner []
-  (letsubs [identifier [:get :current-qr-context]]
+  (letsubs [identifier [:get :current-qr-context]
+            camera-initialized? (r/atom false)]
     [view st/barcode-scanner-container
-     [qr-scanner-toolbar (:toolbar-title identifier)]
+     [qr-scanner-toolbar (:toolbar-title identifier) (not @camera-initialized?)]
      [camera {:onBarCodeRead (fn [code]
                                (let [data (-> (.-data code)
                                               (str/replace #"ethereum:" ""))]
                                  (dispatch [:set-qr-code identifier data])))
               ;:barCodeTypes  [:qr]
+              :ref           #(reset! camera-initialized? true)
               :captureAudio  false
               :style         st/barcode-scanner}]
      [view st/rectangle-container


Refactor tests

Refactor tests

--- test/servisne_info/test/scrape/worker_test.clj
+++ test/servisne_info/test/scrape/worker_test.clj
@@ -12,9 +12,13 @@
   (let [power-outage {:title "Power outage"
                       :url "http://example.com/power_outage"}]
     (with-redefs [ns-scraper/links (constantly [power-outage])]
-      (let [links-count (save-links)
-            news (mc/find-maps "news")
-            latest (first news)]
-        (is (= 1 links-count))
+
+      (testing "it returns links count"
+        (let [links-count (save-links)]
+          (is (= 1 links-count))))
+
+      (testing "it saves links to the database"
+        (let [news (mc/find-maps "news")
+              latest (first news)]
         (is (= (:title latest) (:title power-outage)))
-        (is (= (:url latest) (:url power-outage)))))))
+        (is (= (:url latest) (:url power-outage))))))))


Add second taxi hierarchy.

Add second taxi hierarchy.

--- src/exp/taxi.clj
+++ src/exp/taxi.clj
@@ -151,4 +151,78 @@
    env
    [(hierarchy/NSAHLA (make-taxi-tla env) (keys (dissoc (env/initial-state env) :const)))]))

-; (uniform-cost-search (ShopHTNEnv (simple-taxi-hierarchy (TaxiEnv 5 5 [ ['bob [1 1] [3 3] ] ['mary [1 1] [3 3] ] ['lisa [1 1] [3 3] ]]))))+; (uniform-cost-search (ShopHTNEnv (simple-taxi-hierarchy (TaxiEnv 5 5 [ ['bob [1 1] [3 3] ] ['mary [1 1] [3 3] ] ['lisa [1 1] [3 3] ]]))))
+
+
+
+;; Slightly fancier hierarchy that splits navigation.
+(deftype NavHHLA [env dx] :as this
+  env/Action                (action-name [] ['navh dx])
+                            (primitive? [] false)
+  env/ContextualAction      (precondition-context [s] [['atx]])
+  hierarchy/HighLevelAction (immediate-refinements- [s]
+                              (if (= dx (env/get-var s ['atx]))                                                                    [[]]
+                                (for [af [make-left make-right]
+                                     :let [a (af s)]
+                                     :when a]
+                                 [a this])))
+                            (cycle-level- [s] 1))
+
+(deftype NavVHLA [env dy] :as this
+  env/Action                (action-name [] ['navv dy])
+                            (primitive? [] false)
+  env/ContextualAction      (precondition-context [s] [['aty]])
+  hierarchy/HighLevelAction (immediate-refinements- [s]
+                              (if (= dy (env/get-var s ['aty]))                                                                    [[]]
+                                (for [af [make-up make-down]
+                                     :let [a (af s)]
+                                     :when a]
+                                 [a this])))
+                            (cycle-level- [s] 1))
+
+(deftype Nav2HLA [env dx dy] :as this
+  env/Action                (action-name [] ['nav dx dy])
+                            (primitive? [] false)
+  env/ContextualAction      (precondition-context [s] [['atx] ['aty]])
+  hierarchy/HighLevelAction (immediate-refinements- [s]
+                             [[(NavHHLA env dx) (NavVHLA env dy)]])
+                            (cycle-level- [s] nil))
+
+(deftype Serve2HLA [env pass]
+  env/Action                (action-name [] ['serve pass])
+                            (primitive? [] false)
+  env/ContextualAction      (precondition-context [s] [['atx] ['aty] ['in-taxi]
+                                                      ['pass-served? pass]])
+  hierarchy/HighLevelAction (immediate-refinements- [s]
+                             (let [const (env/get-var s :const)
+                                   [sx sy dx dy]
+                                     (map #(get const [% pass]) '[srcx srcy dstx dsty])
+                                   pu (make-pickup  s pass)
+                                   pd (make-dropoff s pass)]
+                               (util/assert-is (and pu pd))
+                               [[(Nav2HLA env sx sy) pu (Nav2HLA env dx dy) pd]]))
+                            (cycle-level- [s] nil))
+
+(deftype Taxi2TLA [env context]      :as this
+  env/Action                (action-name [] ['top])
+                            (primitive? [] false)
+  env/ContextualAction      (precondition-context [s] context)
+  hierarchy/HighLevelAction (immediate-refinements- [s]
+                              (let [remaining-passengers
+                                    (for [[pass] (:passengers env)
+                                          :when (not (env/get-var s ['pass-served? pass]))]
+                                      pass)]
+                                (if (empty? remaining-passengers)
+                                    [[(env/make-finish-action env)]]
+                                  (for [pass remaining-passengers]
+                                    [(Serve2HLA env pass) this]))))
+                            (cycle-level- [s] nil))
+
+(defn make-taxi-tla2 [env]
+  (Taxi2TLA env (keys (dissoc (env/initial-state env) :const))))
+
+(defn simple-taxi-hierarchy2 [#^TaxiEnv env]
+  (hierarchy/SimpleHierarchicalEnv
+   env
+   [(make-taxi-tla2 env)]))
+


Revert "Add notes on how to program the category dependency assumption"

This reverts commit 482a6c42cb1a0068583d1b28588f06bfaee1547c.

--- src/dependable/core_resolve.clj
+++ src/dependable/core_resolve.clj
@@ -150,17 +150,6 @@
    conflicts
    specs)))

-;; some notes on how to program in the category dependency assumption
-;; where 'a spec' is the function which examines candidates
-;; this works well because candidates are first examined for hoisted terms
-#_(letfn [(a [spec] ...)]
-    (loop [spec spec]
-      (let [rs (a spec)]
-        (match rs
-               [:incompatible my_id s]
-               (recur #(and (s %) (spec %)))
-               :else
-               rs))))
 #_(defn -main
     "I don't do a whole lot ... yet."
     [& args]


updated forms spec to reflect form inclusion in args to validator

--- src/test/untangled/ui/forms_spec.cljs
+++ src/test/untangled/ui/forms_spec.cljs
@@ -564,8 +564,10 @@
       (f/valid? invalid-person :person/name) => false
       "Can find the validation trigger symbol for a field"
       (f/validator invalid-person :person/name) => 'is-named?
+      "Includes the current complete form in the arguments to the validator"
+      (::f/this-form (f/validator-args invalid-person :person/name)) => invalid-person
       "Can find the validation trigger args for a field"
-      (f/validator-args invalid-person :person/name) => {:name "C"})
+      (:name (f/validator-args invalid-person :person/name)) => "C")
     (component "dirty checking"
       (let [clean-person (om/db->tree (om/get-query Person) c-person app-state)]
         (assertions


Add nrepl.

Add nrepl.

--- src/example_webapp/core.clj
+++ src/example_webapp/core.clj
@@ -1,5 +1,6 @@
 (ns example-webapp.core
-  (:require [ring.adapter.jetty :as jetty]
+  (:require [clojure.tools.nrepl.server :as nrepl]
+            [ring.adapter.jetty :as jetty]
             [ring.middleware.stacktrace :refer [wrap-stacktrace]]
             [compojure.handler :as handler]
             [compojure.core :refer :all]
@@ -25,5 +26,9 @@
       (wrap-stacktrace)))

 (defn -main [& args]
-  (info "start jetty")
-  (jetty/run-jetty #'app {:port 3000 :join? false}))
+  (let [nrepl-port 4000
+        jetty-port 3000]
+    (info (format "start nrepl at port %s" nrepl-port))
+    (nrepl/start-server :port nrepl-port)
+    (info (format "start jetty at port %s" jetty-port))
+    (jetty/run-jetty #'app {:port jetty-port :join? false})))


minor: better regex for merging connector definitions.

--- ssclj/tools/src/com/sixsq/slipstream/tools/cli/ssconfig.clj
+++ ssclj/tools/src/com/sixsq/slipstream/tools/cli/ssconfig.clj
@@ -40,7 +40,7 @@

 (defn resp-error?
   [resp]
-  (complement (resp-success? resp)))
+  (not (resp-success? resp)))

 (defn exit-on-resp-error
   [resp]
@@ -186,12 +186,16 @@
   []
   (:cloudConnectorClass (sci/load-cfg)))

+(defn merge-ccc-and-new-conn
+  [ccc new-conn]
+  (s/replace (s/join "," [ccc new-conn]) #"(^[ \t]*,*|,*[ \t]*$)" ""))
+
 (defn update-ccc
   [ccc cin cn]
   (let [new-conn (s/join ":" [cin cn])]
     (println "Updating :cloudConnectorClass parameter with -" new-conn)
     (store-cfg {:id                  (str cfg/resource-url "/" cfg-s/service)
-                :cloudConnectorClass (s/join "," [ccc new-conn])})))
+                :cloudConnectorClass (merge-ccc-and-new-conn ccc new-conn)})))

 (defn add-conn-to-ccc
   "Adds connector to :cloudConnectorClass attribute."
@@ -200,8 +204,8 @@
         cin->cn (sci/connector-names-map ccc)]
     (if-not (and (contains? cin->cn cin) (= (get cin->cn cin) cn))
       (update-ccc ccc cin cn)
-      {:status 200
-       :mesage "Connector was already in :cloudConnectorClass."})))
+      {:status  200
+       :message "Connector was already in :cloudConnectorClass."})))

 (defn conn-add
   "Connector `conn` as request. The resource is in :body."


remove blobstore dependency on datastore

--- migae-blobstore/src/migae/migae_blobstore.clj
+++ migae-blobstore/src/migae/migae_blobstore.clj
@@ -1,6 +1,6 @@
-(ns migae.service.migae-blobstore
-  (:require [migae.service.migae-datastore :as ds]
-            [migae.service.migae-urlfetch :as url])
+(ns migae.migae-blobstore
+  (:require ; [migae.migae-datastore :as ds]
+            [migae.migae-urlfetch :as url])
   (:import [com.google.appengine.api.blobstore ByteRange BlobKey
             BlobstoreService BlobstoreServiceFactory]
            [javax.servlet.http HttpServletRequest HttpServletResponse]))
@@ -19,9 +19,14 @@
 (defn upload-url [success-path]
   (.createUploadUrl (get-blobstore-service) success-path))

+;; from aem datastore impl
+(defn as-blob-key [x]
+  (if (instance? BlobKey x)
+      x
+      (BlobKey. x)))

 (defn delete! [& blobs]
-  (let [blobs (map ds/as-blob-key blobs)]
+  (let [blobs (map as-blob-key blobs)]
     (.delete (get-blobstore-service) (into-array blobs))))

@@ -35,9 +40,9 @@

 (defn- serve-helper
   ([blob-key, ^:HttpServletResponse response]
-     (.serve (get-blobstore-service) (ds/as-blob-key blob-key) response))
+     (.serve (get-blobstore-service) (as-blob-key blob-key) response))
   ([blob-key, start, end, ^:HttpServletResponse response]
-     (.serve (get-blobstore-service) (ds/as-blob-key blob-key) (ByteRange. start end) response)))
+     (.serve (get-blobstore-service) (as-blob-key blob-key) (ByteRange. start end) response)))

 (defn serve [request blob-key]


[#4394] Use zIndex to move inactive tabs back.

That ensures that no view from an inactive tab will interfere with the
active one.

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- components/src/status_im/ui/components/react.cljs
+++ components/src/status_im/ui/components/react.cljs
@@ -192,9 +192,11 @@
                         (= views current-view))

         style (if current-view?
-                {:flex 1}
+                {:flex   1
+                 :zIndex 0}
                 {:opacity 0
-                 :flex    0})
+                 :flex    0
+                 :zIndex -1})

         component' (if (fn? component) [component] component)]


Ref #10, reduce min-hold time to 100ms

Ref #10, reduce min-hold time to 100ms

--- daemon-doorlock/src/com/oursky/doorlock/core.clj
+++ daemon-doorlock/src/com/oursky/doorlock/core.clj
@@ -35,7 +35,7 @@
            (if (= 1 (read-string (:out (sh "gpio" "read" "0"))))
              (sh "gpio" "wfi" "0" "falling")
              (<! (timeout 2500)))
-           (<! (timeout 200))
+           (<! (timeout 100))
            (when (= 0 (read-string (:out (sh "gpio" "read" "0"))))
              (>! unlock-chan {:source :button}))
            (recur))


Ignoring flaky test for now

Ignoring flaky test for now

--- test/lambdacd_git/core_test.clj
+++ test/lambdacd_git/core_test.clj
@@ -15,6 +15,11 @@
             [lambdacd-git.test-utils :as test-utils])
   (:import (java.util.concurrent TimeoutException)))

+(defmacro flaky-testing [title & body]
+  (println "*** SKIPPING FLAKY TEST:" title "***")
+  ; do nothing with flaky tests right now
+)
+
 (defn- status-updates-channel [ctx]
   (let [step-result-updates-ch (event-bus/only-payload
                                  (event-bus/subscribe ctx :step-result-updated))
@@ -270,7 +275,7 @@
                     (get-step-result))]
       (is (str-containing (commit-hash-by-msg state "initial commit") (:out (step-result state))))
       (is (str-containing (commit-hash-by-msg state "other commit") (:out (step-result state))))))
-  (testing "that waiting returns immediately when a commit happened while it was not waiting"
+  (flaky-testing "that waiting returns immediately when a commit happened while it was not waiting"
     (let [state (-> (init-state)
                     (git-init)
                     (git-commit "initial commit")


Code cleanup committed in the process of bug hunting

--- src/io/perun/contrib/images_resize.clj
+++ src/io/perun/contrib/images_resize.clj
@@ -29,12 +29,11 @@
         filepath-with-resolution (new-image-filepath filepath filename new-filename)
         image-filepath (perun/create-filepath (:out-dir options) filepath-with-resolution)
         new-file (io/file tmp image-filepath)]
-    (do
-      (io/make-parents new-file)
-      (ImageIO/write buffered-file (:extension file) new-file)
-      {:short-name (perun/filename new-filename)
-       :filename new-filename
-       :path image-filepath})))
+    (io/make-parents new-file)
+    (ImageIO/write buffered-file (:extension file) new-file)
+    {:short-name (perun/filename new-filename)
+     :filename new-filename
+     :path image-filepath}))

 (defn resize-to [tgt-path file options resolution]
   (let [io-file (-> file :full-path io/file)
@@ -43,18 +42,13 @@
         new-dimensions (iu/dimensions resized-buffered-image)
         new-meta (write-file options tgt-path file resized-buffered-image resolution)
         dimensions {:width (first new-dimensions) :height (second new-dimensions)}]
-      (merge file new-meta dimensions)))
+    (merge file new-meta dimensions)))

 (defn process-image [tgt-path file options]
   (perun/report-debug "image-resize" "resizing" (:path file))
-  (let [resolutions (:resolutions options)]
-    (doall
-      (clojure.core/pmap
-        (fn [resolution]
-          (resize-to tgt-path file options resolution))
-        resolutions))))
+  (pmap #(resize-to tgt-path file options %) (:resolutions options)))

 (defn images-resize [tgt-path files options]
-  (let [updated-files (flatten (doall (map #(process-image tgt-path % options) files)))]
+  (let [updated-files (doall (mapcat #(process-image tgt-path % options) files))]
     (perun/report-info "image-resize" "processed %s image files" (count files))
     updated-files))


Update builtins.clj

Update builtins.clj

--- src/iyye/subcon/knowledge/builtins.clj
+++ src/iyye/subcon/knowledge/builtins.clj
@@ -83,9 +83,10 @@
 ;(defmacro getsrc [func] `(:source (meta (var ~func))))

 (defn- create-iyye-builtin-relation [name types func pred-func]
-  (words/create-iyye-relation name
-                              (words/->Iyye_ModalPredicate :IYE :AXIOM (persistence/current-time-to-string) :ALWAYS)
-                              types func pred-func true))
+  (words/create-iyye-relation
+    name
+    (words/->Iyye_ModalPredicate :IYE :AXIOM (persistence/current-time-to-string) :ALWAYS)
+    types func pred-func true))

 (defn- create-entry [entry] {(:Uname (:atom entry)) entry})

@@ -135,16 +136,18 @@
 ; (apply str (rest (str (:When {:When :ALWAYS}))))

 (defn- init-db-kb []
-  (let []
+  (let [
+        types-loaded (persistence/read-knowledge-from-db "types" {})
+        types (map words/create-iyye-type-from-db types-loaded)
+        a-f (fn [col el] (conj col (create-entry el)))]
     (dosync (alter words/action-words #(apply conj %1 %2) (persistence/read-knowledge-from-db "relations" {}))) ; {:When :ALWAYS}
-    (dosync (alter words/noun-words #(apply conj %1 %2) (persistence/read-knowledge-from-db "types" {} ; {:When :ALWAYS}
-    )))
-      ; others
+    (dosync (alter words/noun-words #(apply a-f %1  %2) types)) ; {:When :ALWAYS}
+    ; others
     ))

 (defn load-init-kb []
   (init-builtins-kb)
-  (init-db-kb))
+  (init-db-kb))      ; DB only for persistence

 (defn init-kb []
   (init-builtins-kb))


skips test-kubernetes-pod-expiry-grace-period when container-running-grace-secs is 0 (#1044)

--- waiter/integration/waiter/kubernetes_scheduler_integration_test.clj
+++ waiter/integration/waiter/kubernetes_scheduler_integration_test.clj
@@ -297,10 +297,16 @@
                                :x-waiter-timeout 30000)
               service-id (retrieve-service-id waiter-url waiter-headers)
               timeout-secs 150]
-          (if (> container-running-grace-secs timeout-secs)
+          (cond
+            (zero? container-running-grace-secs)
+            (log/info "skipping test as container-running-grace-secs is disabled"
+                      {:container-running-grace-secs container-running-grace-secs
+                       :waiter-url waiter-url})
+            (> container-running-grace-secs timeout-secs)
             (log/warn "skipping test as the configuration will cause the test to run for too long"
                       {:container-running-grace-secs container-running-grace-secs
                        :waiter-url waiter-url})
+            :else
             (with-service-cleanup
               service-id
               ;; make request to launch service instance(s), we do not care about the response


Tidy using statements in unit tests

Tidy using statements in unit tests

Rather than (:use [a]) (:use [b]) use (:use [a] [b])

--- src/leiningen/new/cljskel/web_unit.clj
+++ src/leiningen/new/cljskel/web_unit.clj
@@ -1,8 +1,7 @@
 (ns {{name}}.web_unit
-  (:use [{{name}}.web])
-  (:use [clojure.test])
-  (:use midje.sweet))
-
+  (:use [{{name}}.web]
+        [clojure.test]
+        [midje.sweet]))

 (defn request [method resource]
   (routes {:request-method method