Fix Tri-maf Contact

Fix Tri-maf Contact

Use :trash-effect instead of :leave-play

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -269,7 +269,7 @@
                        {:prompt "Choose a card to rez, ignoring the rez cost"
                         :choices {:req #(not (:rezzed %))}
                         :effect (req (gain state :corp :credit (rez-cost state side target))
-                                     (rez state side target)
+                                     (rez state side target)
                                      (system-msg state side (str "rezzes " (:title target) " at no cost")))}
                       card nil))
     :abilities [{:msg "draw 1 card"
@@ -314,8 +314,8 @@
     :leave-play (req (remove-watch state :order-of-sol))}

    "Paige Piper"
-   (let [pphelper (fn [card cards]
-                    (let [num (count cards)]
+   (let [pphelper (fn [card cards]
+                    (let [num (count cards)]
                       {:optional {:req (req (> num 0))
                        :prompt (str "Use Paige Piper to trash copies of " (:title card) "?")
                        :choices {:number (req num)}
@@ -324,16 +324,16 @@
                                       (trash state side c))
                                     (shuffle! state :runner :deck)
                                     (when (> (int target) 0)
-                                      (system-msg state side (str "trashes " (int target)
-                                                                  " cop" (if (> (int target) 1) "ies" "y")
+                                      (system-msg state side (str "trashes " (int target)
+                                                                  " cop" (if (> (int target) 1) "ies" "y")
                                                                   " of " (:title card)))))}}))]
     {:events {:runner-install {:req (req (first-event state side :runner-install))
-                               :effect (effect (resolve-ability
-                                                (pphelper target (->> (:deck runner)
+                               :effect (effect (resolve-ability
+                                                (pphelper target (->> (:deck runner)
                                                                       (filter #(has? % :title (:title target)))
-                                                                      (vec)))
+                                                                      (vec)))
                                                 card nil))}}})
-
+
    "Paparazzi"
    {:effect (req (swap! state update-in [:runner :tagged] inc))
     :events {:pre-damage {:req (req (= target :meat)) :msg "prevent all meat damage"
@@ -540,7 +540,7 @@
    "Tri-maf Contact"
    {:abilities [{:cost [:click 1] :msg "gain 2 [Credits]" :once :per-turn
                  :effect (effect (gain :credit 2))}]
-    :leave-play (effect (damage :meat 3 {:unboostable true :card card}))}
+    :trash-effect {:effect (effect (damage :meat 3 {:unboostable true :card card}))}}

    "Tyson Observatory"
    {:abilities [{:prompt "Choose a piece of Hardware" :msg (msg "adds " (:title target) " to their Grip")


Check for facter with io/which

Check for facter with io/which

--- src/clj/runbld/facts/factory.clj
+++ src/clj/runbld/facts/factory.clj
@@ -12,8 +12,7 @@
   "facter")

 (defn facter-installed? []
-  (let [{:keys [exit]} (io/run "which" facter-program)]
-    (zero? exit)))
+  (io/which facter-program))

 (defn facter-version []
   (when (facter-installed?)
@@ -29,14 +28,12 @@
                               version-string)})))))

 (defn facter []
-  (if (facter-installed?)
+  (when (facter-installed?)
     (let [{:keys [out err exit]} (io/run facter-program "--yaml")]
       (if out
         (yaml/parse-string out)
         (throw+ {:error ::empty-facter
-                 :msg (format "facter returned empty (%d): %s" exit err)})))
-    (throw+ {:warning ::no-facter
-             :msg "facter cannot be found in PATH"})))
+                 :msg (format "facter returned empty (%d): %s" exit err)})))))

 (defn make-facter []
   (if-let [{:keys [major]} (facter-version)]
@@ -44,4 +41,3 @@
       3 (runbld.facts.facter3.Facter3. (facter))
       2 (runbld.facts.facter2.Facter2. (facter))
       1 (runbld.facts.facter1.Facter1. (facter)))))
-


event: supply more args to callbacks

event: supply more args to callbacks

--- src/cljs/cljs_morphic/event.cljs
+++ src/cljs/cljs_morphic/event.cljs
@@ -7,26 +7,32 @@
 (defn get-cursor-pos [e]
   {:x (.-pageX e) :y (.-pageY e)})

+(defn get-client-pos [e]
+  {:x (.-clientX e) :y (.-clientY e)})
+
 (defn extract-mouse-down-handler [props]
   (fn [e]
     (.preventDefault e)
-    (let [pos (get-cursor-pos e)
-          morph-id (props :id)
-          right? (.-altKey e)]
+    (let [morph-id (props :id)
+          right? (.-altKey e)
+          args {:pos (get-cursor-pos e)
+                :client-pos (get-client-pos e)}]
       (go
        (if right?
-        (>! signals {:type :mouse-down-right :target-props props :args {:pos pos}})
-        (>! signals {:type :mouse-down-left :target-props props :args {:pos pos}}))))))
+        (>! signals {:type :mouse-down-right :target-props props :args args})
+        (>! signals {:type :mouse-down-left :target-props props :args args}))))))

 (defn extract-mouse-up-handler [props]
   (fn [e]
     (.preventDefault e)
     (let [pos (get-cursor-pos e)
-          right? (.-altKey e)]
+          right? (.-altKey e)
+          args {:pos (get-cursor-pos e)
+                :client-pos (get-client-pos e)}]
       (go
        (if right?
-        (>! signals {:type :mouse-up-right :target-props props :args {:pos pos}})
-        (>! signals {:type :mouse-up-left :target-props props :args {:pos pos}}))))))
+        (>! signals {:type :mouse-up-right :target-props props :args args})
+        (>! signals {:type :mouse-up-left :target-props props :args args}))))))

 (defn extract-double-click-handler [props]
   (fn [e]
@@ -38,12 +44,13 @@
 (defn extract-click-handler [props]
   (fn [e]
     (.preventDefault e)
-    (let [pos (get-cursor-pos e)
-          right-click? (.-altKey e)]
+    (let [right-click? (.-altKey e)
+          args {:pos (get-cursor-pos e)
+                :client-pos (get-client-pos e)}]
       (go
        (if right-click?
-        (>! signals {:type :click-right :target-props props :args {:pos pos}})
-        (>! signals {:type :click-left :target-props props :args {:pos pos}}))))))
+         (>! signals {:type :click-right :target-props props :args args})
+         (>! signals {:type :click-left :target-props props :args args}))))))

 (defn extract-mouse-enter-handler [props]
   (fn [e]
@@ -72,9 +79,12 @@
 (defn extract-mouse-move-handler [props]
   (fn [e]
     (.preventDefault e)
-    (let [pos (get-cursor-pos e)]
+    (let [pos (get-cursor-pos e)
+          client-pos (get-client-pos e)]
       (go
-       (>! signals {:type :mouse-move :target-props props :args {:pos pos}})))))
+       (>! signals {:type :mouse-move :target-props props
+                    :args {:pos pos
+                           :client-pos client-pos}})))))

 (defn extract-mouse-scroll-handler [morph]
   ; mouseScroll


Correct localhost detection

Correct localhost detection

--- src/cljs/db_quiz/components.cljs
+++ src/cljs/db_quiz/components.cljs
@@ -574,8 +574,8 @@
 (defn facebook-button
   "Button to send a Facebook status about your game victories."
   [url]
-  (let [app-id (if (zero? (.indexOf url "http://localhost")) "873059332790811" "873050382791706")]
-     [:a.btn-hex {:href (str "https://www.facebook.com/dialog/feed/?"
+  (let [app-id (if (.startsWith url "http://localhost") "873059332790811" "873050382791706")]
+     [:a.btn-hex {:href (str "https://www.facebook.com/dialog/feed?"
                              (generate-query-string {:app_id app-id
                                                      :display "page"
                                                      :name "DB-quiz"


Add function to blacklist

Add function to blacklist

--- src/clojure/nightmod/sandbox.clj
+++ src/clojure/nightmod/sandbox.clj
@@ -24,7 +24,7 @@
      System/out System/in System/err
      defscreen* defgame* defgame set-screen! setScreen set-screen-wrapper!
      app! app on-gl pref! screenshot!
-     asset-manager* asset-manager set-asset-manager!})
+     asset-manager* asset-manager asset-manager! set-asset-manager!})

 (def tester
   [(jail-test/blacklist-objects


Catch throwables so stack overflow errors are caught

--- src/clojure/nightmod/sandbox.clj
+++ src/clojure/nightmod/sandbox.clj
@@ -108,7 +108,7 @@
         safe-read
         (sb {#'*out* writer})
         (try
-          (catch Exception e
+          (catch Throwable e
             (when-not @u/error
               (reset! u/error
                       {:message (nc-utils/get-string :error-load)
@@ -121,7 +121,7 @@
   (binding [*out* (StringWriter.)]
     (try
       (jvm/jvm-sandbox func (context @u/project-dir))
-      (catch Exception e
+      (catch Throwable e
         (when-not @u/error
           (reset! u/error
                   {:message (some->> (:name (meta func))


added documentation and simple formatting change

--- src/dj/codeloading/namespace.clj
+++ src/dj/codeloading/namespace.clj
@@ -1,3 +1,8 @@
+;;; Concept
+;; - Add metadata to ns with dependency information
+;;   - See ns form in this file
+;; - Use (accommodate-ns 'foo-namespace) to grab dependencies
+
 (require 'dj.codeloading.maven)
 (try
   (clojure.core/require 'clojure.tools.namespace.file)
@@ -7,7 +12,7 @@

 (ns
     ^{:dj.codeloading/dependencies '[[org.clojure/tools.namespace "0.2.11"
-                                     :exclusions [[org.clojure/clojure]]]]}
+                                      :exclusions [[org.clojure/clojure]]]]}
     dj.codeloading.namespace
   (:require [dj]
             [dj.classloader :as dc]


* benchmark/cljs/benchmark_runner.cljs: benchmark many updates on small maps

--- benchmark/cljs/benchmark_runner.cljs
+++ benchmark/cljs/benchmark_runner.cljs
@@ -73,6 +73,12 @@
 (simple-benchmark [coll (Foo. 1 2)] (:bar coll) 1000000)
 (simple-benchmark [coll {:foo 1 :bar 2}] (assoc coll :baz 3) 100000)
 (simple-benchmark [coll {:foo 1 :bar 2}] (assoc coll :foo 2) 100000)
+(simple-benchmark [coll {:foo 1 :bar 2}]
+                  (loop [i 0 m coll]
+                    (if (< i 100000)
+                      (recur (inc i) (assoc m :foo 2))
+                      m))
+                  1)
 (println)

 (println ";;; seq ops")


Add squiggly to my global lein deps

Add squiggly to my global lein deps

--- leiningen/.lein/profiles.clj
+++ leiningen/.lein/profiles.clj
@@ -1 +1,2 @@
-{:user {:plugins []}}
+{:user {:plugins []
+        :dependencies [[acyclic/squiggly-clojure "0.1.6"]]}}


updated module.clj

updated module.clj

--- module.clj
+++ module.clj
@@ -7,9 +7,7 @@
  :version "1.0.1"
  :description "Model repository of the MDA Generator Framework."
  :license ["Eclipse Public License 1.0" "http://www.eclipse.org/legal/epl-v10.html"]
- :plugins ["global" "sdeps" "java" "junit" "package"]
- :dependencies [[["org.soulspace.mda" "MDAXmiRepository" "1.0.0"]]
-                [["org.exolab" "castor" "0.9.5.3" "castor-xml"]]
-                [["xerces" "xercesImpl" "2.9.1"]]
+ :plugins ["global" "sdeps" "depsdot" "java" "junit" "package"]
+ :dependencies [[["org.soulspace.mda" "MDAXmiRepository" "1.0.1"]]
                 [["junit" "junit" "3.8.1"] :dev]]
  ]


add prepl-server task

add prepl-server task

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -530,6 +530,18 @@
   (let [repl-soc (delay (repl/launch-socket-server *opts*))]
     (core/with-pass-thru [fs]
       @repl-soc)))
+
+(core/deftask prepl-server
+  "Start a prepl server.
+
+   This task is a thin wrapper around the `socket-server` task. See the
+   docstring for `socket-server` for details."
+  [b bind ADDR str "The address server listens on."
+   p port PORT int "The port to listen to."]
+  (socket-server
+    :bind   bind
+    :accept 'clojure.core.server/io-prepl
+    :port   port))

 (core/deftask pom
   "Create project pom.xml file.


use standard sync fn instead of crazy custom thing

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -217,9 +217,8 @@
   []
   (let [tgt (core/mktgtdir! ::add-srcs-tgt)]
     (core/with-pre-wrap
-      (doseq [in (remove core/tmpfile? (core/src-files))]
-        (let [out (io/file tgt (core/relative-path in))]
-          (when-not (.exists out) (io/copy in (doto out io/make-parents))))))))
+      (when-let [dirs (seq (remove core/tmpfile? (core/get-env :src-paths)))]
+        (apply file/sync :time tgt dirs)))))

 (core/deftask uber
   "Add files from dependency jars to fileset.


remove a possible race

remove a possible race

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -582,9 +582,9 @@
 (defmethod control-event :text-layer-re-edited
   [browser-state message layer state]
   (-> state
-      (assoc-in [:drawing :layers 0] (assoc layer
+      (assoc-in [:drawing :layers] [(assoc layer
                                       :layer/current-x (:layer/start-x layer)
-                                      :layer/current-y (:layer/start-y layer)))
+                                      :layer/current-y (:layer/start-y layer))])
       (assoc-in [:drawing :in-progress?] true)
       (assoc-in state/current-tool-path :text)))


CL + CW | #0 Fix null pointer when there is no draft

--- src/objective8/templates/draft.clj
+++ src/objective8/templates/draft.clj
@@ -78,9 +78,9 @@
                                    (html/set-attr :href
                                                   (utils/local-path-for :fe/import-draft-get
                                                                         :id objective-id)))
-             [:.clj-draft-version-writer-author] (html/content (:username draft))
+             [:.clj-draft-version-writer-author] (when draft (html/content (:username draft)))

-             [:.clj-draft-version-time] (html/content (utils/iso-time-string->pretty-time (:_created_at draft)))
+             [:.clj-draft-version-time] (when draft (html/content (utils/iso-time-string->pretty-time (:_created_at draft))))

              [:.clj-draft-preview-document] (when-let [draft-content (:draft-content data)]
                                               (html/content (add-section-links draft-content context)))


Fix promote-method to create defs

Fix promote-method to create defs

Simply analyzing a def form does not re-evaluate it, and consequently
Oxcart was producing lots of unbound vars with no metadata. The unbound
part isn't such a problem but the latter is when I'm trying to look for
^:single and ^:static in the emitter.

--- src/oxcart/passes/fn_reduction.clj
+++ src/oxcart/passes/fn_reduction.clj
@@ -71,14 +71,16 @@
   Builds and yields a new AST representing a fn with a munged name
   having the provided method body for its only arity."
   [wrapping-def raw-method env]
-  (let [new-name (munge-symbol
-                  (pattern/def->symbol wrapping-def)
-                  (count (first raw-method))
-                  (some (partial = '&)
-                        (first raw-method)))]
-    (ast `(def ^:single ^:static ~new-name
-            (fn* ~raw-method))
-         env)))
+  (let [new-name (with-meta
+                   (munge-symbol
+                    (pattern/def->symbol wrapping-def)
+                    (count (first raw-method))
+                    (some (partial = '&)
+                          (first raw-method)))
+                   {:single true :static true})
+        new-def `(def ~new-name (fn* ~raw-method))]
+    (eval-in new-def env)
+    (ast new-def env)))

 (defn write-body


Update the commit hook after turning circle-build into a function

--- src/circle/web/views/github_commit_hook.clj
+++ src/circle/web/views/github_commit_hook.clj
@@ -56,7 +56,7 @@
   (def last-json github-json)
   (when (= "CircleCI" (-> github-json :repository :name))
     (let [build (extend-group-with-revision
-                  (merge circle/circle-build
+                  (merge (circle/circle-build)
                          {:notify-email (-> github-json :repository :owner :email)
                           :vcs-type :git
                           :vcs-url (-> github-json :repository :url)


ideas

ideas

--- src/clj/algorithms_clj/macro_initiation.clj
+++ src/clj/algorithms_clj/macro_initiation.clj
@@ -351,6 +351,7 @@
            r#)))))

 (defn test-inline-reduce
+  ;; TODO - We could do better and accept a form, not a lambda
   []
   (let [coll (into [] (range 10))]
     (println (reduce + 0 (map #(* 2 %) (filter odd? coll))))


as async lets catch ex if stackfile already deleted

--- src/clj/swarmpit/event/rules/processing.clj
+++ src/clj/swarmpit/event/rules/processing.clj
@@ -15,8 +15,9 @@
            (= "remove" (:Action event))))
     (process [_ event]
       (doseq [{:keys [name]} (api/stackfiles)]
-        (when (and (nil? (api/stack name))
-                   (some? (api/stackfile name)))
-          (api/delete-stackfile name))))))
+        (when (nil? (api/stack name))
+          (try
+            (api/delete-stackfile name)
+            (catch Exception _)))))))

 (def list [cleanup-stackfiles])


list table filter based on map values #115

--- src/cljs/material/component/list_table.cljs
+++ src/cljs/material/component/list_table.cljs
@@ -1,7 +1,8 @@
 (ns material.component.list-table
+  (:refer-clojure :exclude [filter])
   (:require [material.component :as cmp]
             [material.icon :as icon]
-            [swarmpit.utils :refer [select-keys*]]
+            [swarmpit.utils :refer [select-keys* map-values]]
             [swarmpit.url :refer [dispatch!]]))

 (defn table-header
@@ -100,3 +101,15 @@
                       items
                       render-item-fn
                       render-items-key)))])))
+
+(defn filter
+  [items query]
+  (if (or (empty? query)
+          (< (count query) 2))
+    items
+    (clojure.core/filter
+      (fn [item]
+        (->> (map-values item)
+             (clojure.core/filter #(clojure.string/includes? % query))
+             (empty?)
+             (not))) items)))


onenter submit

onenter submit

--- src/cljs/swarmpit/component/page_login.cljs
+++ src/cljs/swarmpit/component/page_login.cljs
@@ -15,31 +15,12 @@
 (def login-button-style
   {:marginTop "30px"})

+
+
 (defn- update-item
   "Update form item configuration"
   [k v]
   (swap! state assoc k v))
-
-(defn- form-username [value]
-  (comp/vtext-field
-    {:id                "loginUsername"
-     :key               "username"
-     :name              "username"
-     :required          true
-     :floatingLabelText "Username"
-     :value             value
-     :onChange          (fn [_ v] (update-item :username v))}))
-
-(defn- form-password [value]
-  (comp/vtext-field
-    {:id                "loginPassword"
-     :key               "password"
-     :name              "password"
-     :required          true
-     :floatingLabelText "Password"
-     :type              "password"
-     :value             value
-     :onChange          (fn [_ v] (update-item :password v))}))

 (defn- login-headers
   []
@@ -60,6 +41,34 @@
               :error-handler (fn [{:keys [response]}]
                                (let [error (get response "error")]
                                  (update-item :message error)))}))
+
+(defn- on-enter
+  [event]
+  (if (= 13 (.-charCode event))
+    (login-handler)))
+
+(defn- form-username [value]
+  (comp/vtext-field
+    {:id                "loginUsername"
+     :key               "username"
+     :name              "username"
+     :required          true
+     :floatingLabelText "Username"
+     :value             value
+     :onKeyPress        on-enter
+     :onChange          (fn [_ v] (update-item :username v))}))
+
+(defn- form-password [value]
+  (comp/vtext-field
+    {:id                "loginPassword"
+     :key               "password"
+     :name              "password"
+     :required          true
+     :floatingLabelText "Password"
+     :type              "password"
+     :value             value
+     :onKeyPress        on-enter
+     :onChange          (fn [_ v] (update-item :password v))}))

 (rum/defc form < rum/reactive []
   (let [{:keys [username


Make both batches and "normal" queries work

--- src/clojure/clojurewerkz/cassaforte/cql.clj
+++ src/clojure/clojurewerkz/cassaforte/cql.clj
@@ -23,20 +23,9 @@

 (defn ^:private compile-query-
   "Compiles query from given `builder` and `query-params`"
-  [query-params builder]
+  [builder query-params]
+  ;; TODO: mapcat identity here?
   (apply builder (flatten query-params)))
-
-(defn ^:private execute-
-  [^Session session query-params builder]
-  (let [compiled-query (compile-query- query-params builder)]
-    (cc/execute session compiled-query)
-    ))
-
-(defn ^:private execute-async-
-  [^Session session query-params builder]
-  (comment ;;; doesnt work yet
-    (let [rendered-query (render-query- (compile-query- query-params builder))]
-      (cc/execute-async rendered-query session))))

 ;;
 ;; Schema operations
@@ -46,7 +35,8 @@
   "Drops a keyspace: results in immediate, irreversible removal of an existing keyspace,
    including all column families in it, and all data contained in those column families."
   [^Session session ks & query-params]
-  (execute- session (cons ks query-params) q/drop-keyspace-query))
+  (cc/execute session
+              (compile-query- q/drop-keyspace-query (cons ks query-params))))

 (defn create-keyspace
   "Creates a new top-level keyspace. A keyspace is a namespace that
@@ -60,7 +50,8 @@
                           {:class \"SimpleStrategy\"
                            :replication_factor 1}}))"
   [^Session session & query-params]
-  (execute- session query-params q/create-keyspace-query))
+  (cc/execute session
+              (compile-query- q/create-keyspace-query query-params)))

 (defn create-index
   "Creates a new (automatic) secondary index for a given (existing)
@@ -74,7 +65,8 @@
                     (index-name :users_city)
                     (if-not-exists))"
   [^Session session & query-params]
-  (execute- session query-params q/create-index-query))
+  (cc/execute session
+              (compile-query- q/create-index-query query-params )))

 (defn drop-index
   "Drop an existing secondary index. The argument of the statement
@@ -84,7 +76,8 @@

        (drop-index th/session :users_city)"
   [^Session session & query-params]
-  (execute- session query-params q/drop-index-query))
+  (cc/execute session
+              (compile-query- q/drop-index-query query-params) ))

 (defn create-table
   "Creates a new table. A table is a set of rows (usually
@@ -101,7 +94,8 @@
                                      :city :varchar
                                      :primary-key [:name]}))"
   [^Session session & query-params]
-  (execute- session query-params q/create-table-query))
+  (cc/execute session
+              (compile-query- q/create-table-query query-params)))

 (def create-column-family create-table)

@@ -109,26 +103,30 @@
   "Drops a table: this results in the immediate, irreversible removal of a table, including
    all data in it."
   [^Session session ks]
-  (execute- session [ks] q/drop-table-query))
+  (cc/execute session
+              (q/drop-table-query ks)))

 (defn use-keyspace
   "Takes an existing keyspace name as argument and set it as the per-session current working keyspace.
    All subsequent keyspace-specific actions will be performed in the context of the selected keyspace,
    unless otherwise specified, until another USE statement is issued or the connection terminates."
   [^Session session ks]
-  (execute- session [ks] q/use-keyspace-query))
+  (cc/execute session
+              (q/use-keyspace-query ks)))

 (defn alter-table
   "Alters a table definition. Use it to add new
    columns, drop existing ones, change the type of existing columns, or update the table options."
   [^Session session & query-params]
-  (execute- session query-params q/alter-table-query))
+  (cc/execute session
+              (compile-query- q/alter-table-query query-params)))

 (defn alter-keyspace
   "Alters properties of an existing keyspace. The
    supported properties are the same that for `create-keyspace`"
   [^Session session & query-params]
-  (execute- session query-params q/alter-keyspace-query))
+  (cc/execute session
+              (compile-query- q/alter-keyspace-query query-params)))

 ;;
 ;; DB Operations
@@ -141,51 +139,56 @@
    specified. Also, since a row only exists when it contains one value for a column not part of
    the primary key, one such value must be specified too."
   [^Session session & query-params]
-  (execute- session query-params q/insert-query))
+  (cc/execute session
+              (compile-query- q/insert-query query-params)))

 (defn insert-async
   "Same as insert but returns a future"
   [^Session session & query-params]
-  (execute-async- session query-params q/insert-query))
-
-(defn ^{:private true} batch-query-from
+  (comment
+    (cc/executeasync- session query-params q/insert-query)))
+
+(defn ^:private batch-query-from-
   [table records]
   (->> records
        (map (comp (partial apply (partial q/insert-query table)) flatten vector))
        (apply q/queries)
-       q/batch-query))
+       ))

 (defn insert-batch
   "Performs a batch insert (inserts multiple records into a table at the same time).
   To specify additional clauses for a record (such as where or using), wrap that record
   and the clauses in a vector"
   [^Session session table records]
-  (let [query (batch-query-from table records)]
-    (execute- session query)))
+  (let [query-params (batch-query-from- table records)]
+    (cc/execute session (q/batch-query query-params))))

 (defn insert-batch-async
   "Same as insert-batch but returns a future"
   [^Session session table records]
-  (let [query (batch-query-from table records)]
-    (execute-async- session query)))
+  (let [query (batch-query-from- table records)]
+    (comment
+      (cc/executeasync- session query))))

 (defn atomic-batch
   "Executes a group of operations as an atomic batch (BEGIN BATCH ... APPLY BATCH)"
   [^Session session & clauses]
-  (let [q (compile-query- clauses q/batch-query)]
-    (execute- session q)))
+  (cc/execute session
+              (compile-query- q/batch-query clauses)))

 (defn update
   "Updates one or more columns for a given row in a table. The `where` clause
    is used to select the row to update and must include all columns composing the PRIMARY KEY.
    Other columns values are specified through assignment within the `set` clause."
   [^Session session & query-params]
-  (execute- session query-params q/update-query))
+  (cc/execute session
+              (compile-query- q/update-query query-params)))

 (defn update-async
   "Same as update but returns a future"
   [^Session session & query-params]
-  (execute-async- session query-params q/update-query))
+  (comment
+    (cc/executeasync- session query-params q/update-query)))

 (defn delete
   "Deletes columns and rows. If the `columns` clause is provided,
@@ -194,57 +197,69 @@
    are removed. The `where` allows to specify the key for the row(s) to delete. First argument
    for this function should always be table name."
   [^Session session table & query-params]
-  (execute- session (cons table query-params) q/delete-query))
+  (cc/execute session
+              (compile-query- q/delete-query (cons table query-params))))

 (defn delete-async
   "Same as delete but returns a future"
   [^Session session table & query-params]
-  (execute-async- session (cons table query-params) q/delete-query))
+  (comment
+    (cc/executeasync- session (cons table query-params) q/delete-query)))

 (defn select
   "Retrieves one or more columns for one or more rows in a table.
    It returns a result set, where every row is a collection of columns returned by the query."
   [^Session session & query-params]
-  (execute- session query-params q/select-query))
+  (cc/execute session
+              (compile-query- q/select-query query-params)))

 (defn select-async
   "Same as select but returns a future"
   [^Session session & query-params]
-  (execute-async- session query-params q/select-query))
+  (comment
+    (cc/executeasync- session query-params q/select-query)))

 (defn truncate
   "Truncates a table: permanently and irreversably removes all rows from the table,
    not removing the table itself."
   [^Session session table]
-  (execute- session [table] q/truncate-query))
+  (cc/execute session
+              (q/truncate-query table)))

 (defn create-user
   [^Session session & query-params]
-  (execute- session query-params q/create-user-query))
+  (cc/execute session
+              (compile-query- q/create-user-query query-params)))

 (defn alter-user
   [^Session session & query-params]
-  (execute- session query-params q/alter-user-query))
+  (cc/execute session
+              (compile-query- q/alter-user-query query-params)))

 (defn drop-user
   [^Session session & query-params]
-  (execute- session query-params q/drop-user-query))
+  (cc/execute session
+              (compile-query- q/drop-user-query query-params)))

 (defn grant
   [^Session session & query-params]
-  (execute- session query-params q/grant-query))
+  (cc/execute session
+              (compile-query- q/grant-query query-params)))

 (defn revoke
   [^Session session & query-params]
-  (execute- session query-params q/revoke-query))
+  (cc/execute session
+              (compile-query- q/revoke-query query-params)))

 (defn list-users
   [^Session session & query-params]
-  (execute- session query-params q/list-users-query))
+  (cc/execute session
+              (compile-query- q/list-users-query query-params)))

 (defn list-permissions
   [^Session session & query-params]
-  (execute- session query-params q/list-perm-query))
+  (cc/execute session
+              (compile-query- q/list-perm-query query-params)))

 ;;
 ;; Higher level DB functions


Doubled max points

Doubled max points

--- src/clojush/problems/software/number_io.clj
+++ src/clojush/problems/software/number_io.clj
@@ -130,7 +130,7 @@
 (def argmap
   {:error-function (num-io-error-function num-io-data-domains)
    :atom-generators num-io-atom-generators
-   :max-points 400
+   :max-points 800
    :max-genome-size-in-initial-program 100
    :evalpush-limit 200
    :population-size 1000


Renamed hook name

Renamed hook name

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

--- src/status_im/extensions/core.cljs
+++ src/status_im/extensions/core.cljs
@@ -289,7 +289,7 @@
                                :params?    :vector
                                :outputs?   :vector
                                :on-result  :event}}}
-   :hooks      {:command         commands/command-hook
+   :hooks      {:chat.command    commands/command-hook
                 :wallet.settings settings/hook}})

 (defn parse [{:keys [data]} id]


well, that was kind of silly of me

well, that was kind of silly of me

--- src/leiningen/new/yawt/src/root_ns/core.clj
+++ src/leiningen/new/yawt/src/root_ns/core.clj
@@ -75,8 +75,6 @@

 (defonce server (atom nil))

-(defonce server (atom nil))
-
 (defn start-server [& [port]]
   (let [port (if port (Integer/parseInt port) 8080)]
     (reset! server


adding - to path-prefix regex /cc @drsnyder

--- src/vignette/api/legacy/routes.clj
+++ src/vignette/api/legacy/routes.clj
@@ -143,7 +143,7 @@
 (defn route->options
   [map]
   (let [[_ format] (re-find #"(?i)\.([a-z]+)$" (get map :thumbname ""))
-        [_ path-prefix] (re-find #"^/([/a-z0-9]+)$" (get map :path-prefix ""))
+        [_ path-prefix] (re-find #"^/([/a-z0-9-]+)$" (get map :path-prefix ""))
         zone (zone map)
         options (cond-> {}
                      format (assoc :format (.toLowerCase format))


recognize Bitbucket (lowercase) languages for OSX

--- src-cljs/frontend/models/repo.cljs
+++ src-cljs/frontend/models/repo.cljs
@@ -22,7 +22,9 @@
            (building-on-circle? repo))))

 (defn likely-osx-repo? [repo]
-  (let [osx-languages #{"Swift" "Objective-C"}]
+  (let [osx-languages #{"Swift" "Objective-C" ; GH
+                        "swift" "objective-c" ; BB
+                        }]
     (contains? osx-languages (:language repo))))

 (defn id [repo]


Template release 0.6.0

Template release 0.6.0

--- modules/template/project.clj
+++ modules/template/project.clj
@@ -1,9 +1,8 @@
 ;; Copyright © 2014 JUXT LTD.

-(defproject juxt.modular/template "0.6.0-SNAPSHOT"
+(defproject juxt.modular/template "0.6.0"
   :description "A modular extension that provides support for templates (Mustache, etc.)"
   :url "https://github.com/juxt/modular/tree/master/modules/template"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
-  :dependencies [[com.stuartsierra/component "0.2.2"]
-                 ])
+  :dependencies [[com.stuartsierra/component "0.2.2"]])


Add Kinta X.

Add Kinta X.

--- src/afterglow/fixtures/chauvet.clj
+++ src/afterglow/fixtures/chauvet.clj
@@ -158,6 +158,22 @@
                              (chan/dimmer 5)
                              (build-gobo-wheel 6)]})))))

+(defn kinta-x
+  "[Kinta X](http://www.chauvetlighting.com/kinta-x.html) derby effect."
+  {:doc/format :markdown
+   :author "James Elliott"}
+  []
+  {:channels [(chan/functions :control 1
+                              0 "LEDs off"
+                              15 "LEDs on"
+                              101 "Auto")
+              (chan/functions :rotation 2
+                              0 nil
+                              1 :counter-clockwise
+                              86 :clockwise
+                              171 :back-and-forth)]
+   :name "Kinta X"})
+
 (defn led-techno-strobe
   "[LED Techno Strobe](http://www.chauvetlighting.com/led-techno-strobe.html)
   strobe light."


fix closure dep issues & use threads-view in user page

--- src/braid/ui/views/pages/user.cljs
+++ src/braid/ui/views/pages/user.cljs
@@ -2,55 +2,41 @@
   (:require [reagent.ratom :include-macros true :refer-macros [reaction]]
             [braid.ui.views.pills :refer [user-pill-view]]
             [braid.ui.views.new-thread :refer [new-thread-view]]
-            [braid.ui.views.thread :refer [thread-view]]
+            [braid.ui.views.threads :refer [threads-view]]
             [chat.client.reagent-adapter :refer [subscribe]]))

 (defn user-page-view
   []
-  (fn []
-    (let [user-id (subscribe [:page-id])
-          user (subscribe [:user @user-id])
-          current-user-id (subscribe [:user-id])
-          user-avatar-url (subscribe [:user-avatar-url])
-          threads (subscribe [:threads])
-          open-threads-ids (subscribe [:open-thread-ids])
-          open-threads (reaction (select-keys @threads @open-threads-ids))
-          sorted-threads (reaction (->> @open-threads
-                                   ; sort by last message sent by logged-in user, most recent first
-                                    vals
-                                    (filter
-                                      (fn [thread]
-                                        (contains?
-                                          (set (thread :mentioned-ids)) @user-id)))
-                                    (sort-by
-                                      (comp (partial apply max)
-                                            (partial map :created-at)
-                                            (partial filter
-                                              (fn [m] (= (m :user-id) @current-user-id)))
-                                            :messages))
+  (let [user-id (subscribe [:page-id])
+        user (subscribe [:user] [user-id])
+        current-user-id (subscribe [:user-id])
+        user-avatar-url (subscribe [:user-avatar-url])
+        threads (subscribe [:threads])
+        open-threads-ids (subscribe [:open-thread-ids])
+        open-threads (reaction (select-keys @threads @open-threads-ids))
+        sorted-threads (reaction (->> @open-threads
+                                      ; sort by last message sent by logged-in user, most recent first
+                                      vals
+                                      (filter
+                                        (fn [thread]
+                                          (contains?
+                                            (set (thread :mentioned-ids)) @user-id)))
+                                      (sort-by
+                                        (comp (partial apply max)
+                                              (partial map :created-at)
+                                              (partial filter
+                                                       (fn [m] (= (m :user-id) @current-user-id)))
+                                              :messages))
                                       reverse))]
+
+    (fn []
       [:div.page.channel
-        [:div.title
-          [user-pill-view (@user :id)]]
-        [:div.content
-          [:div.description
-            [:img.avatar {:src @user-avatar-url}]
-            [:p "One day, a profile will be here."]
-            [:p "Currently only showing your open threads that mention this user."]
-            [:p "Soon, you will see all recent threads this user has participated in."]]]
-        [:div.threads {:ref "threads-div"
-                       :on-wheel
-                       (fn [e]
-                         (let [target-classes (.. e -target -classList)
-                               this-elt (.. e -target)]
-                           ; TODO: check if threads-div needs to scroll?
-                           (when (and (or (.contains target-classes "thread")
-                                          (.contains target-classes "threads"))
-                                   (= 0 (.-deltaX e) (.-deltaZ e)))
-                             (set! (.-scrollLeft this-elt)
-                                   (- (.-scrollLeft this-elt) (.-deltaY e))))))}
-              [new-thread-view {:mentioned-ids [(@user :id)]}]
-              (doall
-                (for [thread @sorted-threads]
-                 ^{:key [thread :id]}
-                 [thread-view thread]))]])))
+       [:div.title
+        [user-pill-view (@user :id)]]
+       [:div.content
+        [:div.description
+         [:img.avatar {:src @user-avatar-url}]
+         [:p "One day, a profile will be here."]
+         [:p "Currently only showing your open threads that mention this user."]
+         [:p "Soon, you will see all recent threads this user has participated in."]]]
+       [threads-view {:mentioned-ids [(@user :id)]} @sorted-threads]])))


show error if trying to upload too large file

--- src/chat/client/views/threads.cljs
+++ src/chat/client/views/threads.cljs
@@ -71,10 +71,12 @@
                                   (om/set-state! owner :dragging? false)
                                   (let [file-list (.. e -dataTransfer -files)]
                                     (when (< 0 (.-length file-list))
-                                      (s3/upload (aget file-list 0)
-                                              (fn [url] (dispatch! :new-message
-                                                                   {:content url
-                                                                    :thread-id (thread :id)}))))))}
+                                      (let [file (aget file-list 0)]
+                                        (if (> (.-size file) (* 10 1024 1024))
+                                          (store/display-error! "File to big to upload, sorry")
+                                          (s3/upload file (fn [url] (dispatch! :new-message
+                                                                               {:content url
+                                                                                :thread-id (thread :id)}))))))))}

             (when limbo?
               (dom/div #js {:className "notice"}


minor

minor

--- examples/src/worksheets/gaussian.clj
+++ examples/src/worksheets/gaussian.clj
@@ -11,7 +11,7 @@
 ;; @@
 (ns worksheets.gaussian
   (:require [anglican.runtime :refer :all]
-            [anglican.emit :refer [defquery query]]
+            [anglican.emit :refer [defquery]]
             [anglican.stat :refer [empirical-distribution collect-results]]
             anglican.infcomp.csis
             anglican.importance


Reformat todomvc.db ns

Reformat todomvc.db ns

--- examples/todomvc/src/todomvc/db.cljs
+++ examples/todomvc/src/todomvc/db.cljs
@@ -25,13 +25,13 @@
 (s/def ::todo (s/keys :req-un [::id ::title ::done]))
 (s/def ::todos (s/and                                       ;; should use the :kind kw to s/map-of (not supported yet)
                  (s/map-of ::id ::todo)                     ;; in this map, each todo is keyed by its :id
-                 #(instance? PersistentTreeMap %)           ;; is a sorted-map (not just a map)
-                 ))
+                 #(instance? PersistentTreeMap %)))         ;; is a sorted-map (not just a map)
+
 (s/def ::showing                                            ;; what todos are shown to the user?
   #{:all                                                    ;; all todos are shown
     :active                                                 ;; only todos whose :done is false
-    :done                                                   ;; only todos whose :done is true
-    })
+    :done})                                                 ;; only todos whose :done is true
+
 (s/def ::db (s/keys :req-un [::todos ::showing]))

 ;; -- Default app-db Value  ---------------------------------------------------
@@ -43,9 +43,9 @@
 ;;   2.  `events.cljs` for the registration of :initialise-db handler
 ;;

-(def default-db           ;; what gets put into app-db by default.
-  {:todos   (sorted-map)  ;; an empty list of todos. Use the (int) :id as the key
-   :showing :all})        ;; show all todos
+(def default-db                                             ;; what gets put into app-db by default.
+  {:todos   (sorted-map)                                    ;; an empty list of todos. Use the (int) :id as the key
+   :showing :all})                                          ;; show all todos

 ;; -- Local Storage  ----------------------------------------------------------
@@ -56,12 +56,12 @@
 ;; filter. Just the todos.
 ;;

-(def ls-key "todos-reframe")                         ;; localstore key
+(def ls-key "todos-reframe")                                ;; localstore key

 (defn todos->local-store
   "Puts todos into localStorage"
   [todos]
-  (.setItem js/localStorage ls-key (str todos)))     ;; sorted-map written as an EDN map
+  (.setItem js/localStorage ls-key (str todos)))            ;; sorted-map written as an EDN map

 ;; -- cofx Registrations  -----------------------------------------------------
@@ -78,10 +78,10 @@
 (re-frame/reg-cofx
   :local-store-todos
   (fn [cofx _]
-      ;; put the localstore todos into the coeffect under :local-store-todos
-      (assoc cofx :local-store-todos
-             ;; read in todos from localstore, and process into a sorted map
-             (into (sorted-map)
-                   (some->> (.getItem js/localStorage ls-key)
-                            (cljs.reader/read-string)    ;; EDN map -> map
-                            )))))
+    ;; put the localstore todos into the coeffect under :local-store-todos
+    (assoc cofx :local-store-todos
+              ;; read in todos from localstore, and process into a sorted map
+              (into (sorted-map
+                      (some->> (.getItem js/localStorage ls-key)
+                               (cljs.reader/read-string))))))) ;; EDN map -> map
+


improve comment date, make comment counter operational

--- src/cljs/link_collective/view.cljs
+++ src/cljs/link_collective/view.cljs
@@ -14,7 +14,7 @@

 (println "Resistance is futile!")

-(fw/watch-and-reload
+#_(fw/watch-and-reload
   ;; :websocket-url "ws://localhost:3449/figwheel-ws" default
  :jsload-callback (fn [] (print "reloaded"))) ;; optional callback

@@ -61,7 +61,7 @@
   [comment]
   {[:.link-detail-comment-text] (content (:content comment))
    [:.link-detail-comment-user] (content (:user comment))
-   [:.link-detail-comment-timestamp] (content (:ts comment))})
+   [:.link-detail-comment-timestamp] (content (str (:ts comment)))})

 (defsnippet link-header-hashtag "main.html" [:.link-header-hashtag-item]
@@ -121,7 +121,7 @@
 (defsnippet link-item "main.html" [:.link-item]
   [record app owner]
   {[:.link-item] (set-attr "id" (str "link-item-" (:id record)))
-   [:.link-comment-counter] (content (-> record :comments count))
+   [:.link-comment-counter] (content (-> (get-comments (:id record) app) count))
    [:.link-header] (substitute (link-header record owner))
    [:.link-detail] (substitute (link-detail record app))})


make whole badge clickable

make whole badge clickable

--- src/cljs/salava/user/ui/modal.cljs
+++ src/cljs/salava/user/ui/modal.cljs
@@ -20,11 +20,11 @@

 (defn toggle-visibility [visibility-atom]
   (ajax/POST
-     (path-for "/obpv1/user/profile/set_visibility")
-     {:params  {:visibility (if (= "internal" @visibility-atom) "public" "internal")}
-      :handler (fn [new-value]
-                 (reset! visibility-atom new-value)
-                 )}))
+    (path-for "/obpv1/user/profile/set_visibility")
+    {:params  {:visibility (if (= "internal" @visibility-atom) "public" "internal")}
+     :handler (fn [new-value]
+                (reset! visibility-atom new-value)
+                )}))

 (defn profile-visibility-input [visibility-atom]
   [:div.col-xs-12
@@ -36,28 +36,41 @@
               :checked   (= "public" @visibility-atom)}]
      (t :user/Publishandshare)]]])

+#_(defn badge-grid-element [element-data]
+    (let [{:keys [id image_file name description issuer_content_name issuer_content_url user_endorsements_count]} element-data]
+      ;[:div {:class "col-xs-12 col-sm-6 col-md-4" :key id}
+      [:div {:class "media grid-container"}
+       [:div.media-content
+        (if image_file
+          [:div.media-left
+           [:a {:href "#";(path-for (str "/badge/info/" id))
+                :on-click #(set-new-view [:badge :info] {:badge-id id})}
+            [:img {:src (str "/" image_file)
+                   :alt name}]]])
+        [:div.media-body
+         [:div.media-heading
+          [:a.heading-link {:href "#"
+                            :on-click #(set-new-view [:badge :info] {:badge-id id})}
+           name]]
+         [:div.media-issuer
+          [:p issuer_content_name]]
+         (when (pos? user_endorsements_count)
+           [:div.text-center [:i.fa.fa-handshake-o {:style {:font-size "18px"}}]])]]]
+      ;]
+      ))
+
 (defn badge-grid-element [element-data]
   (let [{:keys [id image_file name description issuer_content_name issuer_content_url user_endorsements_count]} element-data]
-    ;[:div {:class "col-xs-12 col-sm-6 col-md-4" :key id}
-     [:div {:class "media grid-container"}
-      [:div.media-content
-       (if image_file
-         [:div.media-left
-          [:a {:href "#";(path-for (str "/badge/info/" id))
-               :on-click #(set-new-view [:badge :info] {:badge-id id})}
-            [:img {:src (str "/" image_file)
-                 :alt name}]]])
-       [:div.media-body
-        [:div.media-heading
-         [:a.heading-link {:href "#"
-                           :on-click #(set-new-view [:badge :info] {:badge-id id})}
-          name]]
-        [:div.media-issuer
-         [:p issuer_content_name]]
-        (when (pos? user_endorsements_count)
-        [:div.text-center [:i.fa.fa-handshake-o]])]]]
-              ;]
-              ))
+    [:div {:class "media grid-container"}
+     [:div.media-content
+     [:a {:href "#" :on-click #(set-new-view [:badge :info] {:badge-id id})}
+
+      (when image_file [:div.media-left [:img {:src (str "/" image_file)}]])
+      [:div.media-body
+       [:div.media-heading name]
+       [:div.media-issuer [:p issuer_content_name]]
+       (when (pos? user_endorsements_count) [:div.badge-view.text-center [:i.fa.fa-handshake-o]])]
+      ]]]))

 (defn page-grid-element [element-data profile_picture]
   (let [{:keys [id name first_name last_name badges mtime]} element-data
@@ -111,8 +124,8 @@
     [:div
      (if-not owner?
        [:div.col-xs-12[:div.pull-right
-         (connect-user user-id)]]
-        )
+                       (connect-user user-id)]]
+       )

      [:div {:id "profile"}
       [:div.col-xs-12
@@ -169,13 +182,13 @@

 (defn init-data [user-id state]
   (ajax/GET
-     (path-for (str "/obpv1/user/profile/" user-id) true)
-     {:handler (fn [data]
-                 (reset! state (assoc data :user-id user-id
-                                      :show-link-or-embed-code nil
-                                      :permission "success"
-                                      :badge-small-view false)))}
-     (fn [] (swap! state assoc :permission "error"))))
+    (path-for (str "/obpv1/user/profile/" user-id) true)
+    {:handler (fn [data]
+                (reset! state (assoc data :user-id user-id
+                                :show-link-or-embed-code nil
+                                :permission "success"
+                                :badge-small-view false)))}
+    (fn [] (swap! state assoc :permission "error"))))

 (defn handler [params]


Replace update with update-in to work with older Lein

--- plugin/src/leiningen/doo.clj
+++ plugin/src/leiningen/doo.clj
@@ -96,16 +96,16 @@

 (defn correct-main [compiler-opts]
   (cond-> compiler-opts
-    (some? (:main compiler-opts)) (update :main main->str)))
+    (some? (:main compiler-opts)) (update-in [:main] main->str)))

 (defn correct-builds [project]
   (update-in project [:cljsbuild :builds]
     (fn [builds]
       (cond
         (map? builds) (->> builds
-                        (map (fn [[k v]] [k (update v :compiler correct-main)]))
+                        (map (fn [[k v]] [k (update-in v [:compiler] correct-main)]))
                         (into {}))
-        (vector? builds) (mapv #(update % :compiler correct-main) builds)
+        (vector? builds) (mapv #(update-in % [:compiler] correct-main) builds)
         :else (throw (Exception. ":cljsbuild :builds needs to be either a vector or a map"))))))

 (defn find-by-id


handle cases when heartbeats lack stats metrics

--- storm-core/src/clj/backtype/storm/stats.clj
+++ storm-core/src/clj/backtype/storm/stats.clj
@@ -1179,7 +1179,7 @@
       (reduce init-val data)))

 (defmulti aggregate-comp-stats
-  (fn dispatch-fn [& args] (-> args last first :stats :type)))
+  (fn dispatch-fn [& args] (-> args last first :type)))

 (defmethod aggregate-comp-stats :bolt
   [& args]
@@ -1290,7 +1290,7 @@
                                          comp-id
                                          host
                                          port
-                                         uptime))
+                                         (or uptime 0)))
     (.set_stats ((condp = comp-type
                    :bolt thriftify-bolt-agg-stats
                    :spout thriftify-spout-agg-stats) stats))))


[FLINK-15057][tests] Set JM and TM memory config in flink-conf.yaml

This closes #10422.

--- flink-jepsen/src/jepsen/flink/db.clj
+++ flink-jepsen/src/jepsen/flink/db.clj
@@ -38,19 +38,21 @@

 (defn- default-flink-configuration
   [test node]
-  {:high-availability                  "zookeeper"
-   :high-availability.zookeeper.quorum (zookeeper-quorum test)
-   :high-availability.storageDir       "hdfs:///flink/ha"
-   :jobmanager.rpc.address             node
-   :state.savepoints.dir               "hdfs:///flink/savepoints"
-   :rest.address                       node
-   :rest.port                          8081
-   :rest.bind-address                  "0.0.0.0"
-   :taskmanager.numberOfTaskSlots      taskmanager-slots
-   :yarn.application-attempts          99999
-   :slotmanager.taskmanager-timeout    10000
-   :state.backend.local-recovery       "true"
-   :taskmanager.registration.timeout   "30 s"})
+  {:high-availability                     "zookeeper"
+   :high-availability.zookeeper.quorum    (zookeeper-quorum test)
+   :high-availability.storageDir          "hdfs:///flink/ha"
+   :jobmanager.heap.size                  "2048m"
+   :jobmanager.rpc.address                node
+   :state.savepoints.dir                  "hdfs:///flink/savepoints"
+   :rest.address                          node
+   :rest.port                             8081
+   :rest.bind-address                     "0.0.0.0"
+   :taskmanager.numberOfTaskSlots         taskmanager-slots
+   :yarn.application-attempts             99999
+   :slotmanager.taskmanager-timeout       10000
+   :state.backend.local-recovery          "true"
+   :taskmanager.memory.total-process.size "2048m"
+   :taskmanager.registration.timeout      "30 s"})

 (defn flink-configuration
   [test node]
@@ -254,9 +256,7 @@
   []
   (fu/join-space (hadoop-env-vars)
                  (str install-dir "/bin/yarn-session.sh")
-                 "-d"
-                 "-jm 2048m"
-                 "-tm 2048m"))
+                 "-d"))

 (defn- start-yarn-session!
   []
@@ -281,7 +281,7 @@
 (defn- start-yarn-job!
   [test]
   (c/su
-    (submit-job-with-retry! test ["-m yarn-cluster" "-yjm 2048m" "-ytm 2048m"])))
+    (submit-job-with-retry! test ["-m yarn-cluster"])))

 (defn yarn-job-db
   []
@@ -301,11 +301,9 @@
     (str install-dir "/bin/mesos-appmaster.sh")
     (str "-Dmesos.master=" (zookeeper-uri test mesos/zk-namespace))
     "-Djobmanager.rpc.address=$(hostname -f)"
-    "-Djobmanager.heap.size=2048m"
     "-Djobmanager.rpc.port=6123"
-    "-Dmesos.resourcemanager.tasks.mem=2048"
-    "-Dtaskmanager.memory.total-process.size=2048m"
     "-Dmesos.resourcemanager.tasks.cpus=1"
+    "-Dmesos.resourcemanager.tasks.mem=2048" ;; FLINK-15082: this option must be set instead of taskmanager.memory.total-process.size
     "-Drest.bind-address=$(hostname -f)"))

 (defn- start-mesos-session!


cleanup sample.btree namespace

cleanup sample.btree namespace

--- sample/src/sample/btree.clj
+++ sample/src/sample/btree.clj
@@ -11,169 +11,6 @@
   (if-not (nil? k)
     (assoc m k v)
     m))
-
-
-#_(defrecord BinaryTreeNode [k* v* l r]
-
-  TreeModify
-
-  (add [this k v]
-    (let [[l r] (if (<= (compare k k*) 0)
-                  [(if-not (nil? l)
-                     (add l k v)
-                     (BinaryTreeNode. k v nil nil))
-                   r]
-                  [l
-                   (if-not (nil? r)
-                     (add r k v)
-                     (BinaryTreeNode. k v nil nil))])]
-      (BinaryTreeNode. k* v* l r)))
-
-  TreeSearch
-
-  (search [this k]
-    (let [cres (compare k k*)]
-      (cond
-        (< cres 0) (when-not (nil? l)
-                     (search l k))
-        (> cres 0) (when-not (nil? r)
-                     (search r k))
-        true v*))))
-
-
-
-#_(declare insert*)
-
-#_(defn- internal-node [b ks vs size]
-  {:pre [(= (count vs)
-            (inc (count ks)))]}
-  {:b b
-   :type :internal
-   :ks ks
-   :vs vs
-   :size size})
-
-#_(defn- inode-lookup [{:keys [ks vs] :as n} k]
-  ;;; TODO: implement binary search
-  (loop [[k* & ks*] ks
-         [v* & vs*] vs]
-    (cond
-      (nil? k*)             [::inf v*]
-      (<= (compare k k*) 0) [k* v*]
-      true                  (recur ks* vs*))))
-
-#_(defn- inode-split [{:keys [b ks vs size] :as n}]
-  (let [partition-size  (-> size (/ 2) Math/ceil int)
-        [ks1 ks2]       (partition-all partition-size ks)
-        [ks1 nk]        [(butlast ks1) (last ks1)]
-        [vs1 vs2a vs2b] (partition-all partition-size vs)
-        vs2             (concat vs2a vs2b)]
-    #_(println "ISPLIT")
-    [(internal-node b ks1 vs1 (dec partition-size))
-     nk
-     (internal-node b ks2 vs2 (- partition-size (rem size 2)))]))
-
-#_(defn- inode-ins [{:keys [b ks vs size] :as n} k v]
-  (if-not (= k ::inf)
-    (let [[ks1 ks2] (split-with #(< (compare % k) 0) ks)
-          [vs1 vs2] (split-at (count ks1) vs)
-          replace?  (= (compare (first ks2) k) 0)
-          ks2       (if replace? (rest ks2) ks2)
-          vs2       (if replace? (rest vs2) vs2)
-          nsize     (if replace? size (inc size))
-          nks       (concat ks1 [k] ks2)
-          nvs       (concat vs1 [v] vs2)]
-      #_(println "IINS" nks nvs)
-      (internal-node b nks nvs nsize))
-    (let [nvs (-> vs butlast (concat [v]))]
-      #_(println "IINS (INF)" ks nvs)
-      (internal-node b ks nvs size))))
-
-#_(defn- inode-insert [{:keys [b ks vs] :as n} k v]
-  (let [[childk childv] (inode-lookup n k)
-        [n1 nk n2]      (insert* childv k v)
-        nn              (if (nil? n2)
-                          (inode-ins n childk n1)
-                          (-> (inode-ins n nk n1)
-                              (inode-ins childk n2)))]
-    (if (>= (-> nn :ks count) b)
-      (inode-split nn)
-      [nn])))
-
-
-#_(defn- leaf-node
-  ([b ks vs size]
-   {:pre [(= (count vs)
-             (count ks))]}
-   {:b b
-    :type :leaf
-    :m (->> (interleave ks vs)
-            (apply sorted-map))
-    :size size})
-
-  ([b]
-   (leaf-node b nil nil 0))
-
-  ([b m size]
-   {:b b
-    :type :leaf
-    :m m
-    :size size}))
-
-#_(defn- lnode-lookup [{:keys [m] :as n} k]
-  [nil (get m k)])
-
-#_(defn- lnode-split [{:keys [b m size] :as n}]
-  (let [partition-size (-> size (/ 2) Math/ceil int)
-        [ks1 ks2] (partition-all partition-size (keys m))
-        m1 (apply dissoc m ks2)
-        m2 (apply dissoc m ks1)]
-    #_(println "LSPLIT" m1 m2)
-    [(leaf-node b m1 partition-size)
-     (last ks1)
-     (leaf-node b m2 (- partition-size (rem size 2)))]))
-
-#_(defn- lnode-ins [{:keys [b m size] :as n} k v]
-  (let [nm (assoc m k v)]
-    #_(println "LINS" nm)
-    (leaf-node b nm (inc size))))
-
-#_(defn- lnode-insert [{:keys [b m] :as n} k v]
-  (let [nn (lnode-ins n k v)]
-    (if (>= (-> nn :m count) b)
-      (lnode-split nn)
-      [nn])))
-
-
-#_(defn- node? [{:keys [type] :as n}]
-  (or (= type :internal)
-      (= type :leaf)))
-
-
-#_(defn- insert* [{:keys [type] :as n} k v]
-  (case type
-    :internal (inode-insert n k v)
-    :leaf     (lnode-insert n k v)))
-
-#_(defn- lookup* [{:keys [type] :as n} k]
-  #_(print "L")
-  (case type
-    :internal (inode-lookup n k)
-    :leaf     (lnode-lookup n k)))
-
-#_(defn insert [{:keys [b] :as n} k v]
-  #_(println "=== INSERT ===")
-  (let [[n1 k n2] (insert* n k v)]
-    (if (nil? n2)
-      n1
-      (internal-node b [k] [n1 n2] 1))))
-
-#_(defn lookup [n k]
-  #_(println "=== LOOKUP ===")
-  (loop [[_ v] (lookup* n k)]
-    (if (node? v)
-      (recur (lookup* v k))
-      v)))

 (defprotocol B+TreeModifyable
@@ -371,6 +208,11 @@
 (defn b+tree [b]
   (->B+Tree b (->B+TreeLeafNode b 0 (sorted-map)) {}))

+
+
+;;;
+;;; a few sample invocations
+;;;

 #_(-> (b+tree 3)
     (t/insert [:a 5] 55)
@@ -409,104 +251,6 @@
              time)
       t2 (-> (t/insert t1 [:b "y" 3] "____")
              time)]
-  #_(clojure.pprint/pprint t)
+  #_(clojure.pprint/pprint t2)
   [(time (t/lookup-range t1 [:b "y"]))
    (time (t/lookup-range t2 [:b "y"]))])
-
-
-
-#_(defrecord B+TreeNode [b size children leaf?]
-
-  TreeModify
-
-  (insert [this k v]
-    (letfn [(split [children size]
-              (println "SPLIT1" (keys children) (type children))
-              (let [partition-size (-> size (/ 2) Math/ceil int)
-                    [ks1 ks2] (partition-all partition-size (keys children))
-                    cs1 (apply dissoc children ks2)  ;; cannot use select-keys here, as that removes sorted-map properties
-                    cs2 (apply dissoc children ks1)]
-                (println "SPLIT2" ks1 ks2 (type cs1) (type cs2))
-                (let [res [{:c cs1
-                            :s partition-size
-                            :k (last ks1)}
-                           {:c cs2
-                            :s (- partition-size (rem size 2))
-                            :k (last ks2)}]]
-                  (println "SPLIT3" res)
-                  res)))
-
-            (ins [children size k v]
-              (println "INS" size k v children)
-              (let [children (assoc children k v)
-                    size (inc size)]
-                (if (< size b)
-                  [{:c children :s size :k k}]
-                  (split children size))))
-
-            (add* [{:keys [b children size leaf?] :as this} k v root? i]
-              #_(println "ADD*" k v root? leaf?)
-              (if (<= i 5)
-                (cond
-                  leaf? (let [_ (println "LEAF1" k v)
-                              [m1 m2] (ins children size k v)]
-                          (println "LEAF2" m1 m2)
-                          [{:n (->B+TreeNode b (:s m1) (:c m1) true)
-                            :k (:k m1)}
-                           (when-not (nil? m2)
-                             {:n (->B+TreeNode b (:s m2) (:c m2) true)
-                              :k (:k m2)})])
-                  #_root? #_(let [_ (println "ROOT1" k v)
-                              child (get children k)
-                              [b1 sk b2] (add* child k v false (inc i))]
-                          (println "ROOT2" b1 sk b2)
-                          [(if (nil? b2)
-                             b1
-                             (->B+TreeNode b 1 (rm/range-map :find-ceiling b2 sk b1) false))])
-                  true (let [_ (println "TRUE1" k v)
-                             child (get children k)
-                             orig-k (-> child meta :sample.rangemap/key)
-                             [b1 b2] (add* child k v false (inc i))]
-                         (println "TRUE2" b1 b2 orig-k)
-                         (if (nil? b2)
-                           [{:n (->B+TreeNode b size (assoc children orig-k (:n b1)) leaf?)
-                             :k orig-k}]
-                           (let [children   (-> (dissoc children k)
-                                                (assoc (:k b1) (:n b1)))
-                                 [m1 m2] (ins children size (:k b2) (:n b2))]
-                             (println "TRUE3" m1 m2)
-                             [{:n (->B+TreeNode b (:s m1) (:c m1) false)
-                               :k (:k m1)}
-                              (when-not (nil? m2)
-                                {:n (->B+TreeNode b (:s m2) (:c m2) false)
-                                 :k (:k m2)})]))))
-                (do (println "ABORT")
-                    [this])))]
-
-      (println "=== ADD* ===" k v)
-      (let [[b1 b2] (add* this k v true 0)]
-        (println "ADD*2" b1 b2)
-        (let [res (if (nil? b2)
-                    (:n b1)
-                    (->B+TreeNode b 1
-                                  (-> (rm/range-map :find-ceiling)
-                                      (assoc (:k b1) (:n b1) :sample.rangemap/fallback (:n b2)))
-                                  false))]
-          (println "ADD*3" res)
-          res))
-
-      (split (-> (rm/range-map :find-ceiling)
-                 (assoc 1 11 2 22 3 33 4 44 :sample.rangemap/fallback 55))
-             5)))
-
-  TreeSearch
-
-  (lookup [this k]
-    (when-let [child (get children k)]
-      (if (satisfies? TreeSearch child)
-        (lookup child k)
-        child))))
-
-
-#_(defn b+tree [b]
-  (->B+TreeNode b 0 (sorted-map) true))


Bring back 100 rubbish code points

Bring back 100 rubbish code points

--- test/asciinema/player/vt_test.cljc
+++ test/asciinema/player/vt_test.cljc
@@ -1799,7 +1799,7 @@
     (is (= (get-params vt) [0 0 12 0 23 1]))))

 (def gen-ascii-rubbish (gen/vector (gen/choose 0 0x9f) 1 100))
-(def gen-unicode-rubbish (gen/vector (gen/choose 0 0x10ffff) 1 5))
+(def gen-unicode-rubbish (gen/vector (gen/choose 0 0x10ffff) 1 100))

 (defspec test-parser-state-for-random-input
   {:num-tests (* 100 (property-tests-multiplier))}


Doc on snapshot-next-sq.

Doc on snapshot-next-sq.

--- src/cbfg/npr.cljs
+++ src/cbfg/npr.cljs
@@ -1,6 +1,12 @@
 (ns cbfg.npr ; NPR stands for aNother Protocol for Replication, pronounced like UPR.
   (:require-macros [cbfg.ago :refer [achan-buf ago ago-loop aclose
                                      aput aput-close atake]]))
+
+(defprotocol NPRSnapshot
+  (snapshot-rollback? [this])
+  (snapshot-items [this])
+  (snapshot-next-sq [this]
+    "The next snapshot after this one should start at next-sq"))

 (defprotocol NPRStreamRequest
   "Methods to help form NPR protocol messages"
@@ -9,11 +15,6 @@
   (stream-request-snapshot-item-msg [this snapshot item])
   (stream-request-rollback-msg [this rollback-info])
   (stream-request-start-sq [this]))
-
-(defprotocol NPRSnapshot
-  (snapshot-rollback? [this])
-  (snapshot-items [this])
-  (snapshot-next-sq [this]))

 (defprotocol NPRServer
   "Methods than an NPR protocol server must implement"


Move world-init closer to world var for clarity.

--- src/cbfg/vis.cljs
+++ src/cbfg/vis.cljs
@@ -301,10 +301,11 @@
         (when (> @event-delay 0) (<! (timeout @event-delay)))
         (when (< @event-delay 0) (<! step-ch)))
         (recur (inc num-events)))
-    (let [el-event (str el-prefix "-event") ; Process U/I related events.
+    (let [el-event (str el-prefix "-event")
           el-html (str el-prefix "-html")
           el-svg (str el-prefix "-svg")
           world (conj w 'world-1)]    ; No ago for world actx init to avoid recursion.
+      (world-init-cb world)
       (go-loop [vis-last nil          ; Process render-ch, updating U/I.
                 vis-last-positions nil
                 vis-last-html nil
@@ -334,7 +335,6 @@
               (when (not= vis-next-svg vis-last-svg)
                 (set-el-innerHTML el-svg vis-next-svg))
               (recur vis-last vis-last-positions vis-last-html vis-next-svg next-deltas)))))
-      (world-init-cb world)
       (let [toggle-ch (listen-el (gdom/getElement el-html) "click")] ; Process toggle U/I events.
         (go-loop []
           (let [actx-id (no-prefix (.-id (.-target (<! toggle-ch))))]


don't render filler actions

don't render filler actions

--- frontend/components/build_steps.cljs
+++ frontend/components/build_steps.cljs
@@ -132,7 +132,7 @@
             controls-ch (get-in opts [:comms :controls])
             actions (map (fn [action]
                            (get non-parallel-actions (:step action) action))
-                         (:actions container))]
+                         (remove :filler-action (:actions container)))]
         (html
          [:div.container-view {:style {:left (str (* 100 (:index container)) "%")}
                                :id (str "container_" (:index container))}


make the horizonal scroll prevention use body

--- frontend/components/build_steps.cljs
+++ frontend/components/build_steps.cljs
@@ -208,8 +208,8 @@
           [:div#container_parent {:on-wheel (fn [e]
                                               (when (not= 0 (aget e "deltaX"))
                                                 (.preventDefault e)
-                                                (let [main (sel1 "main.app-main")]
-                                                  (set! (.-scrollTop main) (+ (.-scrollTop main) (aget e "deltaY"))))))
+                                                (let [body (sel1 "body")]
+                                                  (set! (.-scrollTop body) (+ (.-scrollTop body) (aget e "deltaY"))))))
                                   :on-scroll (fn [e]
                                                ;; prevent handling scrolling if we're animating the
                                                ;; transition to a new selected container


fix typo

fix typo

--- frontend/controllers/navigation.cljs
+++ frontend/controllers/navigation.cljs
@@ -331,7 +331,7 @@
   (mlog "Navigated to account subpage:" subpage)
   (-> state
       (assoc :navigation-point navigation-point)
-      (assoc :nagivation-data args)
+      (assoc :navigation-data args)
       (assoc :account-settings-subpage subpage)))

 (defmethod post-navigated-to! :account


CMR-4700 - update gem version to leverage browse image markup for schema.org

--- collection-renderer-lib/project.clj
+++ collection-renderer-lib/project.clj
@@ -14,7 +14,7 @@
    the hardcoded commit id during dev integration with cmr_metadata_preview project.
    The hardcoded commit id should be updated when MMT releases a new version of the gem."
   (or (System/getenv "CMR_METADATA_PREVIEW_COMMIT")
-      "a931085"))
+      "59dd7e0"))

 (def gem-install-path
   "The directory within this library where Ruby gems are installed."


Add TODO

Add TODO

--- src/main/clojure/pigpen/script.clj
+++ src/main/clojure/pigpen/script.clj
@@ -86,6 +86,7 @@

      :else (throw (IllegalArgumentException. (str "Unknown expression:" (type expr) " " expr))))))

+;; TODO add descriptive comment before each command
 (defmulti command->script
   "Converts an individual command into the equivalent Pig script"
   :type)


Add arg doc

Add arg doc

--- services/tnseq-phase0-c.clj
+++ services/tnseq-phase0-c.clj
@@ -4,7 +4,7 @@

  :graph {:bcstats {:type "func"
                :name "collect-barcode-stats"
-               :args ["#1"]}
+               :args ["#1"]}      ; EID
          :wrtstats {:type "func"
                     :name "write-bcmaps"}
          :setexp {:type "func"


Print some usage information if no arguments are provided.

--- src/frmr/dstt.clj
+++ src/frmr/dstt.clj
@@ -134,8 +134,11 @@
   [& args]
   (let [parsed-options (parse-opts args cli-options)]
     (cond
-      (some-> parsed-options :options :help)
-      (do (println (:summary parsed-options))
+      (or (some-> parsed-options :options :help)
+          (zero? (count (:arguments parsed-options))))
+      (do (println "DSTT – The Damn Simple Test Tool\n(c)2015 Matt Farmer - Licensed under the Apache2 License\n")
+          (println "Usage: dstt URL -r #REQUESTS -t SECONDS [other options]\n\nOption summary:")
+          (println (:summary parsed-options))
           (System/exit 0))

       (:errors parsed-options)


simplify malformed check for POST reqs

simplify malformed check for POST reqs

--- src/open_company/api/companies.clj
+++ src/open_company/api/companies.clj
@@ -106,24 +106,28 @@
   :patch! (fn [ctx] (patch-company slug (add-slug slug (:data ctx)) (:user ctx)))
   :handle-created (fn [ctx] (company-location-response (:updated-company ctx))))

-(defn invalid-post-req?
+(defn malformed-post-req?
   "If the request contains valid JSON POST data to create
    companies retun the parsed JSON, otherwise nil."
   [ctx]
   (let [[invalid-json? parsed] (common/malformed-json? ctx)
-        report {:invalid-json invalid-json?
-                ;; Ensure all required keys are present and valid
-                :required-keys (->> (keys common-res/CompanyMinimum)
-                                     (select-keys (:data parsed))
-                                     (s/check common-res/CompanyMinimum))
-                ;; Ensure all extra fields match with our sections
-                :sections (->> (into (set (keys common-res/CompanyMinimum))
-                                     (set (keys common-res/CompanyOptional)))
-                               (cset/difference (-> parsed :data keys set))
-                               (cset/superset? common-res/section-names))}]
-    ;; TODO think about this
-    [(or invalid-json? (:required-keys report) (not (:sections report)))
-     (assoc parsed :malformed-report report)]))
+        with-reason (fn [r] (assoc parsed :malformed-reason r))]
+    (cond invalid-json?
+          [true (with-reason  :malformed-json)]
+          ;; Ensure all required keys are present and valid
+          ;; s/check returns nil if data complies
+          (not (->> (keys common-res/CompanyMinimum)
+                    (select-keys (:data parsed))
+                    (s/check common-res/CompanyMinimum)))
+          [true (with-reason :missing-fields)]
+          ;; Ensure all extra fields match with our sections
+          ;; if superset? at the end is true no extra fields are found
+          (not (->> (into (set (keys common-res/CompanyMinimum))
+                          (set (keys common-res/CompanyOptional)))
+                    (cset/difference (-> parsed :data keys set))
+                    (cset/superset? common-res/section-names)))
+          [true (with-reason :unexpected-fields)]
+          :else [false parsed])))

 (defn slug-processable [slug]
   (cond
@@ -150,7 +154,7 @@
   :malformed? (by-method {
     :options false
     :get false
-    :post (fn [ctx] (invalid-post-req? ctx))})
+    :post (fn [ctx] (malformed-post-req? ctx))})

   ;; Get a list of companies
   :exists? (fn [_] {:companies (company/list-companies)})


add post to company api options

add post to company api options

--- src/open_company/api/companies.clj
+++ src/open_company/api/companies.clj
@@ -34,9 +34,8 @@
 (defn- options-for-company [slug ctx]
   (if-let [company (company/get-company slug)]
     (if (common/authorized-to-company? (assoc ctx :company company))
-      (common/options-response [:options :get :put :patch :delete])
-      (common/options-response [:options :get]))
-    (common/missing-response)))
+      (common/options-response [:options :get :put :patch :post :delete])
+      (common/options-response [:options :post :get])) (common/missing-response)))

 ;; ----- Actions -----


lock store reads as well as writes

lock store reads as well as writes

--- src/overtone/config/file_store.clj
+++ src/overtone/config/file_store.clj
@@ -23,8 +23,9 @@

 (defmethod read-file-store :file
   [path]
-  (with-open [file (FileInputStream. path)]
-    (read-string (slurp file))))
+  (locking F-LOCK
+    (with-open [file (FileInputStream. path)]
+      (read-string (slurp file)))))

 (defn live-file-store
   "Returns an atom representing a file-store map located at the given


fix bug in location of freesound paths

fix bug in location of freesound paths

--- src/overtone/samples/freesound.clj
+++ src/overtone/samples/freesound.clj
@@ -2,8 +2,8 @@
             freesound.org"
       :author "Sam Aaron, Kevin Neaton"}
   overtone.samples.freesound
-  (:use [overtone.libs.freesound.url]
-        [overtone.libs.freesound.search-results]
+  (:use [overtone.samples.freesound.url]
+        [overtone.samples.freesound.search-results]
         [overtone.sc.node]
         [overtone.helpers.lib :only [defrecord-ifn]])
   (:require [clojure.data.json :as json]


Fixed field item_new

Fixed field item_new

--- src/priceous/provider/goodwine.clj
+++ src/priceous/provider/goodwine.clj
@@ -61,9 +61,9 @@
                                                 (html/text)))
                                       (clojure.string/join "_")))
             (assoc :available (empty? (q? [:.notAvailableBlock])))
-            (assoc :item_new  (boolean (some-> (q? [:.medalIcon :img])
+            (assoc :item_new  (boolean (some-> (q? [:.medalIcon :.stamp])
                                                (get-in [:attrs :src])
-                                               (.contains "New_"))))
+                                               (.contains "/New_"))))

             ;; volume and price blocks are present if product is available
             ((fn [p] (assoc p :volume


Added function to rename an Environment resource. Fixes #39

--- src/prop_shop/data/environment.clj
+++ src/prop_shop/data/environment.clj
@@ -18,3 +18,17 @@
   {:added "0.1"}
   []
   (b/get-entities-by-type :environment))
+
+
+(defn get-environment
+  "Retrieves an Environment by its UUID."
+  {:added "0.1"}
+  [uuid]
+  (b/get-entity-by-uuid uuid))
+
+
+(defn rename-environment
+	"Renames the Environment specified by the UUID with the provided name."
+	{:added "0.1"}
+	[uuid name]
+	(b/update-entity-by-uuid uuid {:name name}))


refactor: use cond-> instead of merge and when (#746)

--- scheduler/src/cook/mesos.clj
+++ scheduler/src/cook/mesos.clj
@@ -107,20 +107,14 @@
     scheduler framework-id]
    (apply mesomatic.scheduler/scheduler-driver
           scheduler
-          (merge
-            {:user ""
-             :name (str mesos-framework-name "-" @cook.util/version "-" @cook.util/commit)
-             :checkpoint true}
-            (when mesos-role
-              {:role mesos-role})
-            (when mesos-principal
-              {:principal mesos-principal})
-            (when gpu-enabled?
-              {:capabilities [{:type :framework-capability-gpu-resources}]})
-            (when mesos-failover-timeout
-              {:failover-timeout mesos-failover-timeout})
-            (when framework-id
-              {:id {:value framework-id}}))
+          (cond-> {:checkpoint true
+                   :name (str mesos-framework-name "-" @cook.util/version "-" @cook.util/commit)
+                   :user ""}
+                  framework-id (assoc :id {:value framework-id})
+                  gpu-enabled? (assoc :capabilities [{:type :framework-capability-gpu-resources}])
+                  mesos-failover-timeout (assoc :failover-timeout mesos-failover-timeout)
+                  mesos-principal (assoc :principal mesos-principal)
+                  mesos-role (assoc :role mesos-role))
           mesos-master
           (when mesos-principal
             [{:principal mesos-principal}]))))


Update function cnf (for transform to cnf)

* the result begins every time with an AND
* every clause begins every time with an OR

--- src/logic/cnf.clj
+++ src/logic/cnf.clj
@@ -101,7 +101,7 @@
   (cond
     ;formula is literal -> return formula
     (literal? formula)
-    formula
+    (list 'and (list 'or formula))

     ;formula has the form 'f1 and f2' -> (and (cnf f1) (cnf f2))
     (= 'and (first formula))
@@ -150,8 +150,6 @@
     ; a form that I not saw ;)
     :else
     (throw (IllegalArgumentException. "This form is not supported (jet)"))))
-
-

 (defn transform-cnf
   "Takes a formula in clojure code and produces the conjunctive normal form of it."


redefine how reflexive ditransitive verbs (e.g. chiamarsi) work

--- src/babel/italiano/pos.cljc
+++ src/babel/italiano/pos.cljc
@@ -157,11 +157,16 @@
                            :reflexive true
                            :sem subject-semantics}}}}))

-(def reflexive-obj-is-subcat3
-  (let [subject-semantics (atom :top)]
+(def reflexive-indirect-obj-is-subcat3
+  (let [subject (atom :top)
+        indirect-object (atom :top)]
     (unifyc reflexive
-            {:synsem {:sem {:subj subject-semantics}
-                      :subcat {:3 {:sem {:obj subject-semantics}}}}})))
+            {:synsem {:sem {:subj subject
+                            :obj subject
+                            :iobj indirect-object}
+                      :subcat {:1 {:sem subject}
+                               :2 {:sem subject}
+                               :3 {:sem indirect-object}}}})))

 (def subj-obj-humanness
   (let [human (atom :top)]


Fix memory-store returning a Block in stat.

--- src/blocks/store/memory.clj
+++ src/blocks/store/memory.clj
@@ -28,7 +28,7 @@
   (stat
     [this id]
     (when-let [block (get @memory id)]
-      (dissoc block :content)))
+      (assoc block :content nil)))

   (get*


Rhino REPL needs to monkey-patch goog.isProvided_ as well

--- src/clj/cljs/repl/rhino.clj
+++ src/clj/cljs/repl/rhino.clj
@@ -139,7 +139,9 @@
         "out" (Context/javaToJS *out* scope))
       (binding [ana/*cljs-ns* 'cljs.core]
         (repl/evaluate-form repl-env env "<cljs repl>"
-          '(set! *print-fn* (fn [x] (.write js/out x))))))))
+          '(do
+             (set! (.-isProvided_ js/goog) (fn [_] false))
+             (set! *print-fn* (fn [x] (.write js/out x)))))))))

 (defrecord RhinoEnv [loaded-libs]
   repl/IJavaScriptEnv


removed january 1st ref date, and updated documentation.

--- src/clj/forma/date_time.clj
+++ src/clj/forma/date_time.clj
@@ -9,16 +9,18 @@
         [clojure.string :only (split)]
         [clojure.contrib.math :only (ceil)]))

+;; ### Reference Time
+;;
 ;; In developing the time period conversion functions, we noticed that
 ;; as long as the time period remained consistent from dataset to
 ;; dataset, the ability to 0-index each dataset became irrelevant.
-;; Our choice of January 1st, 2000 as a common reference date ensures
-;; that, regardless of the date on which the specific MODIS product
-;; became active, datasets at the same temporal resolution will match
-;; up.
+;; Our choice of the [Unix epoch](http://goo.gl/KyuLr) as a common
+;; reference date ensures that, regardless of the date on which the
+;; specific MODIS product became active, datasets at the same temporal
+;; resolution will match up.

-(def ref-date (date-time 2000))
-
+;; ## Date -> Time Period Conversion
+;;
 ;; For NASA's composite products, MODIS data is composited into either
 ;; monthly, 16-day, or 8-day intervals. Each of these scales begins
 ;; counting on January 1st. Monthly datasets begin counting on the
@@ -127,7 +129,9 @@
          res
          (map #(Integer. %) (split date #"-"))))

-;; TODO -- find a place in the docs!
+;; ### Jobtag
+;;
+;; TODO -- more information on what's going on here.

 (defn jobtag
   "Generates a unique tag for a job, based on the current time."


remove no-ice? function (replaced by macro)

--- src/clj/game/core-flags.clj
+++ src/clj/game/core-flags.clj
@@ -148,12 +148,6 @@
 (defn release-zone [state side cid tside tzone]
   (swap! state update-in [tside :locked tzone] #(remove #{cid} %)))

-;;; Small utilities for server properties.
-(defn no-ice?
-  "Checks if the specified server is unprotected by ICE.
-  For the Political assets in Democracy and Dogma."
-  [state server]
-  (empty? (get-in @state [:corp :servers server :ices])))

 ;;; Small utilities for card properties.
 (defn in-server?


Add :t function

Add :t function

--- src/clj/introspect/core.clj
+++ src/clj/introspect/core.clj
@@ -55,6 +55,12 @@
   (defn get-method-calls
     []
     @method-calls)
+
+  (defn t
+    [f]
+    (doseq [call (get @method-calls f)]
+      (println (format-signature call)))
+    )
   )

 (defn introspect-namespace


datascript.btset/BTSetIter -> datascript.btset/Iter

--- src/cljs/dato/lib/core.cljs
+++ src/cljs/dato/lib/core.cljs
@@ -39,7 +39,7 @@
                   {:handlers
                    {goog.Uri                   (dato-transit/URIHandler.)
                     datascript.core/Datom      (dato-transit/DatomHandler.)
-                    datascript.btset/BTSetIter (transit/VectorHandler.) }}))
+                    datascript.btset/Iter (transit/VectorHandler.) }}))

 (defn tx-report->transaction [report]
   (mapv dsu/datom->transaction (:tx-data report)))


Removed test code. Addition of Scales more important

--- src/cljs/omnibar/notes.cljs
+++ src/cljs/omnibar/notes.cljs
@@ -25,8 +25,6 @@

 (defn midi->note [midi-value]
    (nth piano-notes (- midi-value lowest-piano-midi)))
-
-(pprint (midi->note 69))

 (defn midi->freq [note-num]
   (let [expt-numerator (- note-num 49)


Fixed new_index/ -> so/ move after indexing

--- src/cljs/zest/settings.cljs
+++ src/cljs/zest/settings.cljs
@@ -129,7 +129,7 @@
   (reset! so-index-progress 0)
   (let [levelup (.require js/window "levelup")
         path (.require js/window "path")
-        fs (.require js/window "fs")
+        fs (.require js/window "fs-extra")
         rimraf (.require js/window "rimraf")
         db (levelup.
              (.join path (zest.docs.registry/get-so-root) "new_index" "leveldb"))
@@ -153,12 +153,16 @@
               (.endWriting idx)
               (.sync rimraf (.join path (zest.docs.registry/get-so-root) "lucene"))
               (.sync rimraf (.join path (zest.docs.registry/get-so-root) "leveldb"))
-              (.renameSync
+              (.move
+                fs
                 (.join path (zest.docs.registry/get-so-root) "new_index" "lucene")
-                (.join path (zest.docs.registry/get-so-root) "lucene"))
-              (.renameSync
+                (.join path (zest.docs.registry/get-so-root) "lucene")
+                (fn []))
+              (.move
+                fs
                 (.join path (zest.docs.registry/get-so-root) "new_index" "leveldb")
-                (.join path (zest.docs.registry/get-so-root) "leveldb")))))
+                (.join path (zest.docs.registry/get-so-root) "leveldb")
+                (fn [])))))

         auf
         (fn [answer]


Pretty-print HTTP JSON responses

Pretty-print HTTP JSON responses

It's the little things, yo.

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/http.clj
+++ src/com/puppetlabs/http.clj
@@ -101,7 +101,7 @@
      (json-response body status-ok))
   ([body code]
      (-> body
-         (json/generate-string {:date-format "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"})
+         (json/generate-string {:date-format "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" :pretty true})
          (rr/response)
          (rr/header "Content-Type" "application/json")
          (rr/status code))))


Made order arguments of context-to-string optional

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -39,32 +39,34 @@

 (defn ^String context-to-string
   "Prints contexts in a human readable form."
-  [ctx order-on-objects order-on-attributes]
-  (let [str #(if (= % nil) "nil" (str %))
-
-        attributes (vec (sort order-on-objects (attributes ctx)))
-        objects    (vec (sort order-on-attributes (objects ctx)))
-        incidence  (incidence ctx)
-
-        max-att (reduce #(max %1 (count (str %2))) 0 attributes)
-        max-obj (reduce #(max %1 (count (str %2))) 0 objects)]
-    (with-str-out
-      (ensure-length "" max-obj " ") " |" (for [att attributes]
-                                            [(print-str att) " "]) "\n"
-      (ensure-length "" max-obj "-") "-+" (for [att attributes]
-                                            (ensure-length "" (inc (count (print-str att))) "-")) "\n"
-      (for [obj objects]
-        [(ensure-length (print-str obj) max-obj)
-         " |"
-         (for [att attributes]
-           [(ensure-length (if (incidence [obj att]) "x" ".")
-                           (count (print-str att)))
-            " "])
-         "\n"]))))
+  ([ctx]
+     (context-to-string ctx sort-by-second sort-by-second))
+  ([ctx order-on-objects order-on-attributes]
+     (let [str #(if (= % nil) "nil" (str %))
+
+           attributes (vec (sort order-on-objects (attributes ctx)))
+           objects    (vec (sort order-on-attributes (objects ctx)))
+           incidence  (incidence ctx)
+
+           max-att (reduce #(max %1 (count (str %2))) 0 attributes)
+           max-obj (reduce #(max %1 (count (str %2))) 0 objects)]
+       (with-str-out
+         (ensure-length "" max-obj " ") " |" (for [att attributes]
+                                               [(print-str att) " "]) "\n"
+         (ensure-length "" max-obj "-") "-+" (for [att attributes]
+                                               (ensure-length "" (inc (count (print-str att))) "-")) "\n"
+         (for [obj objects]
+           [(ensure-length (print-str obj) max-obj)
+            " |"
+            (for [att attributes]
+              [(ensure-length (if (incidence [obj att]) "x" ".")
+                              (count (print-str att)))
+               " "])
+            "\n"])))))

 (defmethod print-method Formal-Context [ctx out]
   (.write ^java.io.Writer out
-          ^String (context-to-string ctx sort-by-second sort-by-second)))
+          ^String (context-to-string ctx)))

 ;;;


azulenoids.clj: added canonisation and duplicate removal.

--- clojure/org/gavrog/clojure/azulenoids.clj
+++ clojure/org/gavrog/clojure/azulenoids.clj
@@ -81,3 +81,13 @@
 (defn azul-syms-raw []
   (lazy-mapcat (fn [ds] (map (partial apply-to-template ds) boundary-mappings))
                octa-syms))
+
+(defn azul-syms []
+  (letfn [(step [acc ds]
+                (let [[seen _] acc
+                      ds* (-> ds .dual .minimal)
+                      key (.invariant ds*)]
+                  (if (seen key)
+                    [seen false]
+                    [(conj seen key) (.canonical ds*)])))]
+         (reductions step [#{} false] (azul-syms-raw))))


Update parser test to include :display-name additions

--- test/clj/testing/pamela/parser.clj
+++ test/clj/testing/pamela/parser.clj
@@ -36,6 +36,7 @@
                          :reward 0,
                          :controllable false,
                          :primitive true,
+                         :display-name "Bounded",
                          :betweens [],
                          :post {:type :literal, :value true},
                          :cost 0,
@@ -50,6 +51,7 @@
                          :controllable false,
                          :primitive true,
                          :betweens [],
+                         :display-name "Unbounded",
                          :post {:type :literal, :value true},
                          :cost 0,
                          :body nil,
@@ -68,6 +70,7 @@
                          :controllable false,
                          :primitive false,
                          :betweens [],
+                         :display-name "Simple Choice Tpn",
                          :post {:type :literal, :value true},
                          :cost 0,
                          :body


Enhance cast extraction by taking order into account

--- src/datascript_dom/core.clj
+++ src/datascript_dom/core.clj
@@ -109,14 +109,16 @@

 (comment
   (def dom (parse-html-file "resources/tron.html"))
-  (def cc (d/create-conn schema))
-  (def conn cc)
+  (def conn (d/create-conn schema))
   (def _ (d/transact cc (dom->transaction dom)))
-  (def dom2 (html/parse-string "
hehehe

hohoho
"))
+  ;; (def dom2 (html/parse-string "
hehehe

hohoho
"))
   ;; [:html {} [:body {} [:p {} "hehe" [:b {} "he"]] [:p {} "hohoho"]]]
-  (def conn (d/create-conn schema))
-  (d/transact conn (dom->transaction dom2))
-
+  ;; (def conn (d/create-conn schema))
+  ;; (d/transact conn (dom->transaction dom2))
+
+
+  ;; THE FOLLOWING QUERIES ARE BEST APPLIED TO THE SMALL DOM (see parse-string above)
+
   ;;find all the tags that have a previous sibling
   (def r
    (map
@@ -189,6 +191,12 @@
            (siblings ?node ?sib)]
          @conn rules))

+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  ;;                                                         ;;
+  ;;   THE FOLLOWING QUERIES ARE DESIGNED FOR THE IMDB DOM   ;;
+  ;;                                                         ;;
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
   ;;failed attempt to find the title
   (def r
     (d/q '[:find ?text
@@ -248,52 +256,64 @@
          [?review-node :itemprop "reviewCount"]
          (text ?review-node ?reviews)]
        @conn rules)
-
-  ;;the important guys follow this pattern
-  ;;(actors whose names have links)
+
+  ;;Extract Cast - part 1
+  ;;The important guys follow this pattern (actors whose names have
+  ;;links). Note that you get one entry per character, the same actor
+  ;;can depict more than one character.
   (clojure.pprint/pprint
    (let [cast
-         (d/q '[:find ?actor-name ?link ?character-name ?character-link
+         (d/q '[:find ?index ?actor-name ?link ?character-name ?character-link
                 :in $ %
                 :where
+
+                ;;extract the index of the row so that we know the order
+                [?actor-n :parent ?tr]
+                [?tr :dom/index ?index]
+
+                ;;extract the name of the actor and the link to their profile
                 [?actor-n :itemprop "actor"]
                 (path3 ?actor-n ?actor-link-n ?actor-name-n)
                 (text ?actor-name-n ?actor-name)
                 (?actor-link-n :href ?link)

+                ;;extract the name of the character(s) played by the actor and link(s)
                 (siblings ?character-n ?actor-n)
                 [?character-n :class "character"]
                 (path3 ?character-n ?div ?character-link-n)
                 (?character-link-n :href ?character-link)
                 (text ?character-link-n ?character-name)]
               @conn rules)]
-     (map (partial zipmap [:actor :link :character :character-link]) cast)))
-
+     (->> (map (partial zipmap [:index :actor :link :character :character-link]) cast)
+          (sort-by :index))))
+
+  ;;Extract Cast - part 2
   ;;the unimportant guys follow this pattern
   ;;(actors whose names don't have links)
   (def r
-    (d/q '[:find ?actor-name ?link ?character-name
-           :in $ % ?trim
-           :where
-           [?actor-n :itemprop "actor"]
-           (path3 ?actor-n ?actor-link-n ?actor-name-n)
-           (text ?actor-name-n ?actor-name)
-           (?actor-link-n :href ?link)
-
-           (siblings ?character-n ?actor-n)
-           [?character-n :class "character"]
-           (path2 ?character-n ?div)
-
-           ;;the above matches the important characters as well, so we
-           ;;clean the name and if we matched the "/" between the
-           ;;character links, we filter those entries out
-           (text ?div ?character-name-dirty)
-           [(?trim ?character-name-dirty) ?character-name]
-           [(!= "/" ?character-name)]]
-         @conn rules (fn [x] (.trim (string/replace x #"\s+" " ")))))
+    (sort-by first
+     (d/q '[:find ?index ?actor-name ?link ?character-name
+            :in $ % ?trim
+            :where
+            [?actor-n :parent ?tr]
+            [?tr :dom/index ?index]
+
+            [?actor-n :itemprop "actor"]
+            (path3 ?actor-n ?actor-link-n ?actor-name-n)
+            (text ?actor-name-n ?actor-name)
+            (?actor-link-n :href ?link)
+
+            (siblings ?character-n ?actor-n)
+            [?character-n :class "character"]
+            (path2 ?character-n ?div)
+
+            ;;the above matches the important characters as well, so we
+            ;;clean the name and if we matched the "/" between the
+            ;;character links, we filter those entries out
+            (text ?div ?character-name-dirty)
+            [(?trim ?character-name-dirty) ?character-name]
+            [(!= "/" ?character-name)]]
+          @conn rules (fn [x] (.trim (string/replace x #"\s+" " "))))))

   )

-(comment
-  (dom->transaction
-   (html/parse-string "
hehehe

hohoho
")))


Test fixes for Oracle [ci drivers]

Test fixes for Oracle [ci drivers]

--- test/metabase/test/data/oracle.clj
+++ test/metabase/test/data/oracle.clj
@@ -86,11 +86,13 @@

   i/IDatasetLoader
   (merge generic/IDatasetLoaderMixin
-         {:database->connection-details (fn [& _] @db-connection-details)
-          :default-schema               (constantly session-schema)
-          :engine                       (constantly :oracle)
-          :expected-base-type->actual   (u/drop-first-arg expected-base-type->actual)
-          :id-field-type                (constantly :type/Decimal)}))
+         {:database->connection-details       (fn [& _] @db-connection-details)
+          :default-schema                     (constantly session-schema)
+          :engine                             (constantly :oracle)
+          :expected-base-type->actual         (u/drop-first-arg expected-base-type->actual)
+          :id-field-type                      (constantly :type/Decimal)
+          ;; TODO - Not sure why we need to do this
+          :has-questionable-timezone-support? (constantly true)}))

 (defn- dbspec [& _]
   (sql/connection-details->spec (OracleDriver.) @db-connection-details))


CMR-4247 - Added cascade support for in-memoery db.

--- metadata-db-app/src/cmr/metadata_db/data/memory_db.clj
+++ metadata-db-app/src/cmr/metadata_db/data/memory_db.clj
@@ -10,6 +10,7 @@
    [cmr.metadata-db.data.concepts :as concepts]
    [cmr.metadata-db.data.ingest-events :as ingest-events]
    [cmr.metadata-db.data.oracle.concepts.tag :as tag]
+   [cmr.metadata-db.data.oracle.concepts.variable :as variable]
    [cmr.metadata-db.data.oracle.concepts]
    [cmr.metadata-db.data.providers :as providers]
    [cmr.metadata-db.services.provider-validation :as pv]))
@@ -32,6 +33,22 @@
                                            (update :revision-id inc)))
                               tag-associations)]
           ;; publish tag-association delete events
+          (doseq [tombstone tombstones]
+            (ingest-events/publish-event
+              (:context db)
+              (ingest-events/concept-delete-event tombstone)))
+          (concat concepts tombstones))
+
+        ;; CMR-2520 Remove this case when asynchronous cascaded deletes are implemented.
+        (and (= :variable (:concept-type concept))
+             (:deleted concept))
+        (let [variable-associations (variable/get-associations-for-variable-tombstone
+                                     db concept)
+              tombstones (map (fn [ta] (-> ta
+                                           (assoc :metadata "" :deleted true)
+                                           (update :revision-id inc)))
+                              variable-associations)]
+          ;; publish variable-association delete events
           (doseq [tombstone tombstones]
             (ingest-events/publish-event
               (:context db)


test description

test description

--- test/structural_typing/f_preds.clj
+++ test/structural_typing/f_preds.clj
@@ -58,7 +58,7 @@
   (:type-descriptions (subject/force-all-of (subject/all-of odd? even?))) => [odd? even?])

-(fact "implies - starts out lifted"
+(fact "implies"
   (fact "nothing is OK"
     ( (subject/implies) (exval 5)) => empty?)


lein-release plugin: preparing 0.4.3 release

--- re_view/project.clj
+++ re_view/project.clj
@@ -1,4 +1,4 @@
-(defproject re-view "0.4.3-SNAPSHOT"
+(defproject re-view "0.4.3"
   :description "ClojureScript React Library"
   :url "https://www.github.com/braintripping/re-view/tree/master/re_view"
   :license {:name "Eclipse Public License"