include fonts in clips if we need them

include fonts in clips if we need them

--- src-cljs/frontend/clipboard.cljs
+++ src-cljs/frontend/clipboard.cljs
@@ -175,7 +175,7 @@
   [:path (layer->svg-path layer opts)])

 ;; TODO: take path width/height into account
-(defn render-layers [{:keys [layers] :as layer-data} & {:keys [invert-colors?]}]
+(defn render-layers [{:keys [layers] :as layer-data} & {:keys [invert-colors? defs]}]
   (let [layers (filter #(not= :layer.type/group (:layer/type %)) layers)
         start-xs (remove #(js/isNaN %) (map :layer/start-x layers))
         start-ys (remove #(js/isNaN %) (map :layer/start-y layers))
@@ -204,6 +204,8 @@
       ;; hack to make pngs work
       (when invert-colors?
         [:rect {:width "100%" :height "100%" :fill "#333"}])
+      (when defs
+        [:defs defs])
       [:metadata (pr-str (assoc layer-data
                            :width width
                            :height height
@@ -212,15 +214,41 @@
       [:g {:transform (gstring/format "translate(%s, %s)" offset-left offset-top)}
        (map #(svg-element % {:invert-colors? invert-colors?}) layers)]])))

-(defn upload-clipboard-to-s3 [sente-state rendered-layers]
-  (sente/send-msg sente-state [:cust/fetch-clipboard-s3-url]
-                  5000
-                  (fn [reply]
-                    (when (taoensso.sente/cb-success? reply)
-                      (go (let [res (async/<! (http/put (:url reply)
-                                                        {:body rendered-layers
-                                                         :headers {"Content-Type" "image/svg+xml"}}))]
-                            (sente/send-msg sente-state [:cust/store-clipboard {:key (:key reply)}])))))))
+(defn inline-font [font-name font-str]
+  [:style {:type "text/css"}
+   (gstring/format "@font-face { font-family: '%s'; src: url('data:application/x-font-ttf;base64, %s') format('truetype');}"
+                   font-name font-str)])
+
+(defn used-fonts
+  "Determines fonts used in the collection of layers. Could be more efficient"
+  [layers]
+  (let [text (reduce (fn [acc layer]
+                       (str acc (:layer/text layer)))
+                     "" layers)]
+    (concat (when (seq text) ["Roboto"])
+            (when (re-find #":fa-[^:]+:" text) ["FontAwesome"]))))
+
+(defn upload-clipboard-to-s3 [sente-state layers]
+  (let [s3-url-ch (sente/ch-send-msg sente-state [:cust/fetch-clipboard-s3-url] 5000 (async/promise-chan))]
+    (go
+      (let [font-names (used-fonts layers)]
+        (doseq [font-name font-names]
+          (fonts/fetch-font font-name))
+        (let [defs (loop [font-names font-names ;; loop's the only way to get <! to work
+                          acc '()]
+                     (if (seq font-names)
+                       (let [{:keys [font-name font-str]} (async/<! (fonts/font-ch (first font-names)))]
+                         (recur (rest font-names)
+                                (conj acc
+                                      (inline-font font-name font-str))))
+                       acc))
+              rendered-layers (render-layers {:layers layers} :defs defs)
+              s3-url-reply (async/<! s3-url-ch)]
+          (when (taoensso.sente/cb-success? s3-url-reply)
+            (let [res (async/<! (http/put (:url s3-url-reply)
+                                          {:body rendered-layers
+                                           :headers {"Content-Type" "image/svg+xml"}}))]
+              (sente/send-msg sente-state [:cust/store-clipboard {:key (:key s3-url-reply)}]))))))))

 (defn handle-copy! [app-state e]
   (when (let [target js/document.activeElement
@@ -240,7 +268,7 @@
                                  (get-in app-state [:selected-eids :selected-eids]))))]
       (let [rendered-layers (render-layers {:layers layers})]
         (.setData (.-clipboardData e) "text" rendered-layers)
-        (upload-clipboard-to-s3 (:sente app-state) rendered-layers)))))
+        (upload-clipboard-to-s3 (:sente app-state) layers)))))

 (defn parse-pasted [pasted-data]
   (some->> pasted-data


Use :optional...

Use :optional...

...so you can use Paige Piper to trash 0 cards to shuffle your Stack.

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -297,16 +297,17 @@
    "Paige Piper"
    (let [pphelper (fn [card cards]
                     (let [num (count cards)]
-                      {:req (req (> num 0))
-                       :prompt (str "Trash how many copies of " (:title card) "?")
+                      {:optional {:req (req (> num 0))
+                       :prompt (str "Use Paige Piper to trash copies of " (:title card) "?")
                        :choices {:number (req num)}
+                       :msg "to shuffle their Stack"
                        :effect (req (doseq [c (take (int target) cards)]
                                       (trash state side c))
+                                    (shuffle! state :runner :deck)
                                     (when (> (int target) 0)
-                                      (shuffle! state :runner :deck)
                                       (system-msg state side (str "trashes " (int target)
                                                                   " cop" (if (> (int target) 1) "ies" "y")
-                                                                  " of " (:title card)))))}))]
+                                                                  " of " (:title card)))))}}))]
     {:events {:runner-install {:req (req (first-event state side :runner-install))
                                :effect (effect (resolve-ability
                                                 (pphelper target (->> (:deck runner)


add missing arities

add missing arities

--- src/clj_money/import/gnucash.clj
+++ src/clj_money/import/gnucash.clj
@@ -297,12 +297,6 @@
           (update-in [:output-paths] #(conj % output-path))))
     context))

-(defn- advance-context
-  [{:keys [records max-record-count] :as context}]
-  (if (>= (count records) max-record-count)
-    (process-output context)
-    context))
-
 (def ^:private chunk-file-options
   [["-v" "--verbose" "Print a lot of details about what's going on"]
    ["-m" "--maximum MAXIMUM" "The maximum number of records to include in each output file"
@@ -345,20 +339,30 @@
       true)))

 (defn- filter-record
-  [xf]
-  (let [filter-state (atom {})]
-    (fn [result record]
-      (if (keep-record? record filter-state)
-        (xf result record)
-        result))))
+  ([xf]
+   (let [filter-state (atom {})]
+     (fn
+       ([] (xf))
+       ([result] (xf result))
+       ([result record]
+        (if (keep-record? record filter-state)
+          (xf result record)
+          result))))))
+
+(defn- advance-context
+  [{:keys [records max-record-count] :as context}]
+  (if (>= (count records) max-record-count)
+    (process-output context)
+    context))

 (defn- process-chunk-record
   "Processes a single record for the file chunking process"
-  [{:keys [progress-chan] :as context} record]
-  (>!! progress-chan [:record record])
-  (-> context
-      (update-in [:records] #(conj % record))
-      advance-context))
+  ([result] result)
+  ([{:keys [progress-chan] :as context} record]
+   (>!! progress-chan [:record record])
+   (-> context
+       (update-in [:records] #(conj % record))
+       advance-context)))

 (defn chunk-file
   "Accepts a path to a gnucash file and creates multiple, smaller files


Add make-envelope

Add make-envelope

--- src/clojure_fabric/chaincode.clj
+++ src/clojure_fabric/chaincode.clj
@@ -47,20 +47,15 @@
 ;;      Support only CSCC, QSCC, and LSCC (from Node.js)
 (ns clojure-fabric.chaincode
   (:require [clojure-fabric.core :as core]
+            [clojure-fabric.crypto-suite :as crypto-suite]
             [clojure-fabric.proto :as proto]
-            [clojure-fabric.crypto-suite :as crypto-suite]
-            [clojure-fabric.utils :as utils]
             [clojure.core.async :as async])
-
-  (:import [clojure_fabric.core Channel Peer Orderer]
-           [org.hyperledger.fabric.protos.common Common$Block Ledger$BlockchainInfo]
+  (:import [clojure_fabric.core Channel Orderer Peer]
+           com.google.protobuf.ByteString
+           org.bouncycastle.util.encoders.Hex
+           [org.hyperledger.fabric.protos.common Common$Block Common$Payload Ledger$BlockchainInfo]
            org.hyperledger.fabric.protos.msp.Identities$SerializedIdentity
-           [com.google.protobuf ByteString Timestamp GeneratedMessageV3]
-           org.bouncycastle.util.encoders.Hex
-
-           [org.hyperledger.fabric.protos.peer Query$ChaincodeQueryResponse Query$ChannelQueryResponse
-            TransactionPackage$ProcessedTransaction ProposalPackage$SignedProposal
-            ProposalResponsePackage$ProposalResponse ProposalResponsePackage$Response]))
+           [org.hyperledger.fabric.protos.peer ProposalPackage$SignedProposal ProposalResponsePackage$ProposalResponse ProposalResponsePackage$Response Query$ChaincodeQueryResponse Query$ChannelQueryResponse TransactionPackage$ProcessedTransaction]))

 ;;;
 ;;; System Chaincode Definitions
@@ -191,10 +186,14 @@
                                                  :extension extension)
                       :signature-header (proto/make-signature-header :creator identity :nonce nonce))))

-(defn make-payload
+(defn make-envelope
   [channel-name user channel-header-type payload-data]
-  (proto/make-payload :header (make-header channel-name user {:channel-header-type channel-header-type})
-                      :data payload-data))
+  (let [payload (proto/make-payload :header (make-header channel-name user {:channel-header-type channel-header-type})
+                                    :data payload-data)]
+   (proto/make-envelope :payload payload
+                        :signature (crypto-suite/sign (.toByteArray ^Common$Payload (proto/clj->proto payload))
+                                                      (:private-key user)
+                                                      {:algorithm (:key-algorithm (:crypto-suite user))}))))

 (defn make-chaincode-proposal
   [chaincode-key channel-name user {:keys [args] :as opts}]


CMR-1227: Fixed typo

CMR-1227: Fixed typo

--- indexer-app/src/cmr/indexer/data/concepts/platform.clj
+++ indexer-app/src/cmr/indexer/data/concepts/platform.clj
@@ -10,7 +10,7 @@
           (repeat kf/FIELD_NOT_PRESENT)))

 (defn- normalize-ps-value
-  "Trim leading and trailing whitespace Convert a platform short-name value."
+  "Trim leading and trailing whitespace from a platform short-name value."
   [value]
   (when value (str/trim value)))


CMR-4485: Fixed typo.

CMR-4485: Fixed typo.

--- indexer-app/src/cmr/indexer/services/index_service.clj
+++ indexer-app/src/cmr/indexer/services/index_service.clj
@@ -511,13 +511,13 @@
 (defmethod delete-concept :tag-association
   [context concept-id revision-id options]
   ;; When tag association is deleted, we want to re-index the associated collection.
-  ;; This is the same thing we do when a tag association is update. So we call the same function.
+  ;; This is the same thing we do when a tag association is updated. So we call the same function.
   (index-association-concept context concept-id revision-id options))

 (defmethod delete-concept :variable-association
   [context concept-id revision-id options]
   ;; When variable association is deleted, we want to re-index the associated collection.
-  ;; This is the same thing we do when a variable association is update. So we call the same function.
+  ;; This is the same thing we do when a variable association is updated. So we call the same function.
   (index-association-concept context concept-id revision-id options))

 (defmethod delete-concept :service


Fix spec for key-ex-value

Fix spec for key-ex-value

--- src/com/wsscode/pathom/test.cljc
+++ src/com/wsscode/pathom/test.cljc
@@ -123,5 +123,5 @@
     :ret nat-int?)

   (s/fdef key-ex-value
-    :args (s/cat :key ::eql/key :env (s/keys :opt [::throw-errors?
-                                                   ::include-nils?]))))
+    :args (s/cat :key ::eql/join-key :env (s/keys :opt [::throw-errors?
+                                                        ::include-nils?]))))


finish clojure version

finish clojure version

--- Restore-IP-Addresses/RIA.clj
+++ Restore-IP-Addresses/RIA.clj
@@ -1,30 +1,48 @@
 (def testStr1 "25525511135")
-(def testStr1 "0000")
-(def testStr1 "010010")
-(def testStr1 "101023")
+(def testStr2 "0000")
+(def testStr3 "010010")
+(def testStr4 "101023")

 (defn filter-ip [ip]
-  (cond (> (Integer. ip) 255) false
+  "return if ip (string) input is legal ip address"
+  (cond (= ip "") false
+        (> (Integer. ip) 255) false
         (and (> (count ip) 1) (= \0 (nth ip 0))) false
         :else
-        true)))
+        true))

 (defn find-next [ipstr doneip]
-  "give total ip string and ip done, return next possible ip"
-  (let [allpossible (for [i (range 1 4)
-                          :let [len (count doneip)]]
-                      (subs ipstr len (+ len i)))]
-    (for [ip allpossible
-          :when (filter-ip ip)]
-      ip)))
+  "give total ip string and ip done, return list of next possible ip"
+  (let [allpossible (for [i (range 1 4) ;index of next 3 digits
+                          :let [len (count doneip)
+                                end (if (>= (+ len i) (count ipstr)) ;if out of range
+                                      (count ipstr)
+                                      (+ len i))]]
+                      (subs ipstr len end))] ;cut ip string
+    ;(println allpossible)
+    (distinct (for [ip allpossible
+                    :when (filter-ip ip)]
+                ip))))
+
+(defn restore-Ip-Addresses [ipstr]
+  (let [pool (atom [[]])]
+    (doseq [_ (range 4)] ;4 parts of ip
+      (reset! pool
+              (for [onegroupip @pool
+                    nextIp (find-next ipstr (reduce str onegroupip))]
+                (conj onegroupip nextIp)))
+      ;(println @pool)
+      )
+    ;filter results which length is match of ip string
+    (reset! pool
+            (for [ip @pool
+                  :when (= (count ipstr) (reduce + (map count ip)))]
+              ip))
+    (println "result: ")
+    (distinct @pool)))

-(defn restore-Ip-Addresses [ipstr]
-  (let [ippool (atom [])]))
-
-
-
-
-
-
-
+(println (restore-Ip-Addresses testStr1))
+(println (restore-Ip-Addresses testStr2))
+(println (restore-Ip-Addresses testStr3))
+(println (restore-Ip-Addresses testStr4))


add optional :add-subcat (defaults to true)

--- src/babel/engine.clj
+++ src/babel/engine.clj
@@ -25,10 +25,13 @@
        (generate-from-request request))))

 ;; TODO: use a option map/destructuring thing.
-(defn generate [spec language-model & [{do-enrich :do-enrich}]]
+(defn generate [spec language-model & [{add-subcat :add-subcat
+                                        do-enrich :do-enrich}]]
   (let [do-enrich (if do-enrich do-enrich true)
-        spec (unify spec
-                    {:synsem {:subcat '()}})
+        spec (if (= false add-subcat)
+               spec
+               (unify spec
+                      {:synsem {:subcat '()}}))
         language-model (if (future? language-model)
                          @language-model
                          language-model)


cleanup

cleanup

--- src/babel/index.cljc
+++ src/babel/index.cljc
@@ -169,15 +169,6 @@
     (do
       (lazy-cat (over/overc parent (first lex))
                 (overc-with-index-1 parent (rest lex))))))
-
-(defn get-subset-from-index [index use-spec]
-  (let [debug (log/debug (str "looking for use-spec 1: " use-spec))
-        use-spec (get-in use-spec '(:synsem :cat))
-        debug (log/debug (str "looking for use-spec 2: " use-spec))
-        ls-part (get index :lexical-subsets :notfound)]
-    (if (= :notfound ls-part)
-      :notfound
-      (get ls-part (show-spec use-spec) :notfound))))

 ;; TODO: document how this works and especially what 'phrase-constraint' means.
 (defn create-index [grammar lexicon phrase-constraint]


Update example

Update example

--- examples/nightpad/src/nightpad/core.clj
+++ examples/nightpad/src/nightpad/core.clj
@@ -1,6 +1,7 @@
 (ns nightpad.core
   (:require [nightcode.editors :as editors]
             [nightcode.shortcuts :as shortcuts]
+            [nightcode.utils :as utils]
             [nightcode.ui :as ui]
             [nightcode.window :as window]
             [seesaw.core :as s])
@@ -14,7 +15,7 @@
 (defn create-window-content
   [extension]
   (doto (editors/create-text-area)
-    (.setSyntaxEditingStyle (get editors/styles extension))
+    (.setSyntaxEditingStyle (get utils/styles extension))
     (.setTabSize 2)
     (init-completer! extension)
     (editors/init-paredit! true true)


schema by id in core

schema by id in core

--- src/clj/neb/core.clj
+++ src/clj/neb/core.clj
@@ -226,4 +226,7 @@
   (.getSchemaIdMap s/schema-store))

 (defn get-schema-by-name [sname]
-  (s/schema-by-sname sname))+  (s/schema-by-sname sname))
+
+(defn get-schema-by-name [^Integer id]
+  (s/schema-by-id id))


skip require

skip require

--- src/cljs/server.cljs
+++ src/cljs/server.cljs
@@ -7,7 +7,7 @@
 (enable-console-print!)

 (def http (nodejs/require "http"))
-(def express (nodejs/require "express"))
+; (def express (nodejs/require "express"))

 (defn fetch-some-joke
   "Fetch joke from The Internet Chuck Norris Database"


Added printing of command line args. Also fixed -main docstring

--- src/clojush/core.clj
+++ src/clojush/core.clj
@@ -23,11 +23,14 @@
 ;; main function

 (defn -main
-  "A main function for clojush, which assumes that the first/only argument is the name
-   of a problem file that contains a top level call. Exits after completion of the call.
+  "A main function for Clojush, which assumes that the first argument is the name
+   of a problem file that contains an argmap of arguments to PushGP.
+   Exits after completion of the call.
+   Any arguments after the first are treated as arguments to PushGP as key-value pairs.
    This allows one to run an example with a call from the OS shell prompt like:
-       lein run examples.simple-regression"
+       lein run examples.simple-regression :population-size 3000"
   [& args]
+  (println "Command line args:" (apply str (interpose \space args)))
   (let [param-list (map #(if (.endsWith % ".ser")
                            (str %)
                            (read-string %))


log errors from extract-content

log errors from extract-content

--- src/brainbot/nozzle/extract2.clj
+++ src/brainbot/nozzle/extract2.clj
@@ -27,6 +27,7 @@
         extract (try
                   (vfs/extract-content fs path)
                   (catch Throwable err
+                    (logging/error "error in extract-content" {:error err :path path})
                     nil))
         new-body (if extract
                    (assoc body :extract extract)


adding get-logic-db function

adding get-logic-db function

--- src/clj/eventsourcing/custom.clj
+++ src/clj/eventsourcing/custom.clj
@@ -100,6 +100,40 @@

 ;;;
+;;; LOGIC STUFF
+;;;
+
+(lp/db-rel fact e a v t)
+
+(extend-type Fact
+  clojure.core.logic.protocols/IUnifyTerms
+  (unify-terms [u v s]
+    ;;;(println "U:" u ", V:" v ", S:" s)
+    (when (and (instance? clojure.lang.PersistentVector v)
+               (> (count v) 1))
+      (loop [i 0 v v s s]
+        ;;;(println "I:" i ", V:" v ", S:" s)
+        (if (empty? v)
+          s
+          (when-let [s (l/unify s (first v) (get u (nth [:e :a :v :t] i)))]
+            (recur (inc i) (next v) s)))))))
+
+(defn fact-rel [q]
+  (fn [a]
+    (l/to-stream
+     (map #(l/unify a % q)
+          #_(sort-by :t > db)
+          (get-facts)
+          ))))
+
+(defn get-logic-db []
+  (->> (get-facts)
+       (into [] (map (fn [{:keys [e a v t]}]
+                       [fact e a v t])))
+       (apply lp/db)))
+
+
+;;;
 ;;; APPLICATION SPECIFIC STUFF
 ;;;

@@ -123,32 +157,6 @@
   (map->Booking (get-entity eid)))

-;;;
-;;; LOGIC STUFF
-;;;
-
-(extend-type Fact
-  clojure.core.logic.protocols/IUnifyTerms
-  (unify-terms [u v s]
-    ;;;(println "U:" u ", V:" v ", S:" s)
-    (when (and (instance? clojure.lang.PersistentVector v)
-               (> (count v) 1))
-      (loop [i 0 v v s s]
-        ;;;(println "I:" i ", V:" v ", S:" s)
-        (if (empty? v)
-          s
-          (when-let [s (l/unify s (first v) (get u (nth [:e :a :v :t] i)))]
-            (recur (inc i) (next v) s)))))))
-
-(defn fact-rel [q]
-  (fn [a]
-    (l/to-stream
-     (map #(l/unify a % q)
-          #_(sort-by :t > db)
-          (get-facts)
-          ))))
-
-
 #_(evdb/open)
 #_(get-events)
 #_(l/run* [q]
@@ -167,7 +175,6 @@
       (l/== q [e2 a2 v2 t2])))
 #_(get-entity 1)

-#_(lp/db-rel fact e a v t)
 #_(def facts
     (lp/db
      [fact 10 :user/name "walter" 1]
@@ -179,13 +186,13 @@
      [fact 21 :comment/text "comment walter 2" 3]
      [fact 21 :comment/date #inst"2017-01-02" 3]
      [fact 21 :comment/author 10 3]))
-#_(lp/with-db facts
+#_(lp/with-db (get-logic-db)
     (l/run* [q]
-      (l/fresh [eu au vu tu
-                ec ac vc tc]
-        (fact eu au vu tu)
-        (l/== eu 10)
-        (fact ec :comment/author eu tc)
+      (l/fresh [eu vu
+                ec ac vc]
+        (l/== vu "foo1")
+        (fact eu :user/name vu (l/lvar))
+        (fact ec :comment/author eu (l/lvar))
         (l/== ac :comment/text)
-        (fact ec ac vc tc)
-        (l/== q [ec ac vc tc]))))
+        (fact ec ac vc (l/lvar))
+        (l/== q [ec ac vc (l/lvar)]))))


Docstring of route-handler function under http.route added

--- src/clj/hellhound/http/route.clj
+++ src/clj/hellhound/http/route.clj
@@ -15,6 +15,8 @@
    [hellhound.component :as hcomp]
    [hellhound.core     :as hellhound]))

+
+(def expand-routes pedestal-route/expand-routes)

 (defrecord MapRouter [routes tree-map]
   router/Router
@@ -71,6 +73,12 @@

 (defn route-handler
+  "The default ring handler to be used with a ring webserver (webserver
+  component) which is responsible for resolving routes.
+
+  This handler is responsible for resolving routes with the incomming
+  request and executing the chain of interceptors. It creates a context map
+  and pass it to each interceptor."
   [hellhound-context routes]
   (fn [req]
     (let [matched      (io.pedestal.http.route.router/find-route routes req)
@@ -79,8 +87,3 @@
       (if matched
         (execute-interceptors hellhound-context interceptors req)
         (not-found req)))))
-
-
-
-(defn create-routes
-  [routes input-stream output-stream])


[#2537] Remove unused changes

[#2537] Remove unused changes

--- backend/src/akvo/lumen/lib/aggregation.clj
+++ backend/src/akvo/lumen/lib/aggregation.clj
@@ -166,11 +166,11 @@
   (bar/query tenant-conn dataset query))

 (defmethod query* "scatter"
-  [tenant-conn dataset v-type query]
+  [tenant-conn dataset _ query]
   (scatter/query tenant-conn dataset query))

 (defmethod query* "bubble"
-  [tenant-conn dataset v-type query]
+  [tenant-conn dataset _ query]
   (bubble/query tenant-conn dataset query))


fix(pprint): pprint values in the same color as classical values

--- ccw.core/src/clj/ccw/repl/view_helpers.clj
+++ ccw.core/src/clj/ccw/repl/view_helpers.clj
@@ -49,6 +49,7 @@
     {:err [(partial set-style-range #(colored-style error-rgb-key)) nil]
      :out [default-log-style nil]
      :value [(partial set-style-range #(colored-style value-rgb-key)) nil]
+     :pprint-out [(partial set-style-range #(colored-style value-rgb-key)) nil]
      :in-expr [default-log-style :highlight-background]}))

 (defn- cursor-at-end
@@ -58,26 +59,23 @@

 (defn log
   [^ccw.repl.REPLView repl-view ^StyledText log ^String s type]
-  ;; We don't log values if it has already been pprinted by the back-end
-  (when-not (and (= :value type)
-                 (.usePPrint repl-view) (.isPPrintAvailable repl-view))
-    (ui-sync
-      (let [charcnt (.getCharCount log)
-            [log-style highlight-background] (get log-styles type [default-log-style nil])
-            linecnt (.getLineCount log)]
-        (.append log s)
-        (when-not (re-find #"(\n|\r)$" s) (.append log "\n"))
-        (doto log
-          cursor-at-end
-          .showSelection
-          (.setStyleRange (log-style charcnt (- (.getCharCount log) charcnt))))
-        (when highlight-background
-          (.setLineBackground log (dec linecnt) (- (.getLineCount log) linecnt)
-            (ccw.CCWPlugin/getColor
-              ;; We use RGB color because we cannot take the Color directly since
-              ;; we do not "own" it (it would be disposed when colors are changed
-              ;; from the preferences, not good)
-              (-> repl-view .logPanelEditorColors .fCurrentLineBackgroundColor .getRGB))))))))
+  (ui-sync
+    (let [charcnt (.getCharCount log)
+          [log-style highlight-background] (get log-styles type [default-log-style nil])
+          linecnt (.getLineCount log)]
+      (.append log s)
+      (when-not (re-find #"(\n|\r)$" s) (.append log "\n"))
+      (doto log
+        cursor-at-end
+        .showSelection
+        (.setStyleRange (log-style charcnt (- (.getCharCount log) charcnt))))
+      (when highlight-background
+        (.setLineBackground log (dec linecnt) (- (.getLineCount log) linecnt)
+          (ccw.CCWPlugin/getColor
+            ;; We use RGB color because we cannot take the Color directly since
+            ;; we do not "own" it (it would be disposed when colors are changed
+            ;; from the preferences, not good)
+            (-> repl-view .logPanelEditorColors .fCurrentLineBackgroundColor .getRGB)))))))

 (defn eval-failure-msg
   [status s]


Additional useful authorizer

Additional useful authorizer

--- src/cylon/impl/authorization.clj
+++ src/cylon/impl/authorization.clj
@@ -15,14 +15,22 @@
   [m authorizer rejectfn]
   (reduce-kv (fn [acc k v] (assoc acc k (restrict-handler v authorizer rejectfn))) {} m))

-(defrecord UserBasedAuthorizer []
+(defrecord LoggedInAuthorizer []
+  Authorizer
+  (authorized? [this request _]
+    (:cylon/user request)))
+
+(defn new-logged-in-authorizer []
+  (->LoggedInAuthorizer))
+
+(defrecord StaticUserAuthorizer []
   Authorizer
   (authorized? [this request user]
     (= user (:cylon/user request))))

-(defn new-user-based-authorizer [& {:as opts}]
+(defn new-static-user-authorizer [& {:as opts}]
   (->> opts
-       map->UserBasedAuthorizer))
+       map->StaticUserAuthorizer))

 (defrecord RoleBasedAuthorizer [user-role-mappings]
   Authorizer


include compiletime info in gotry macro

include compiletime info in gotry macro

--- src/district0x/server/macros.clj
+++ src/district0x/server/macros.clj
@@ -1,8 +1,17 @@
 (ns district0x.server.macros)
+
+(defn- compiletime-info
+  [and-form ns]
+  (let [meta-info (meta and-form)]
+    {:ns (str (ns-name ns))
+     :line (:line meta-info)
+     :file (:file meta-info)}))

 (defmacro gotry [& body]
   `(cljs.core.async.macros/go
      (try
-       ~@body
+       ~@body
        (catch js/Object e#
-         (taoensso.timbre/error "Unexpected error occured" {:raw-error e# :error (district0x.shared.utils/jsobj->clj e#)})))))
+         (taoensso.timbre/error "Unexpected error occured"
+                                (merge {:raw-error e# :error (district0x.shared.utils/jsobj->clj e#)}
+                                       ~(compiletime-info &form *ns*)))))))


Handle %20 and + characters in URI

Handle %20 and + characters in URI

--- src/emender_jenkins/rest_api.clj
+++ src/emender_jenkins/rest_api.clj
@@ -583,7 +583,10 @@
 (defn waives-resources
     "Retrieve names of resources from the URI."
     [uri]
-    (-> (clojure.string/split uri #"/")
+    (-> uri
+        (.replaceAll "%20" " ")
+        (.replaceAll "\\+" " ")
+        (clojure.string/split #"/")
         rest))

 (defn get-waives


Fix hash node creation check

Fix hash node creation check

Only create a hash node when more than 32 bits of hash are going to be used

--- src/main/cljs/lean_map/core.cljs
+++ src/main/cljs/lean_map/core.cljs
@@ -78,7 +78,7 @@

   (merge-two-kv-pairs [inode medit shift key1 val1 key2hash key2 val2]
     (let [key1hash (hash key1)]
-      (if (and (< shift 32) (== key1hash key2hash))
+      (if (and (< 32 shift) (== key1hash key2hash))
         (HashCollisionNode. medit key1hash 2 (array key1 val1 key2 val2))
         (let [mask1 (mask key1hash shift)
               mask2 (mask key2hash shift)]


fix typo

fix typo

--- src/main/cljs_api_gen/result.clj
+++ src/main/cljs_api_gen/result.clj
@@ -50,7 +50,7 @@
         encoded (encode-fullname fullname)]
     (assoc item
       :full-name fullname
-      :full-name-encode encode)))
+      :full-name-encode encoded)))

 (defn transform-item
   [x]


[#1926] Fix flow update column mismatch problem

Relates #2094

--- backend/src/akvo/lumen/lib/import/flow_common.clj
+++ backend/src/akvo/lumen/lib/import/flow_common.clj
@@ -75,13 +75,13 @@
        (apply merge)))

 (defn commons-columns [form]
-  [(cond-> {:title "Identifier" :type "text" :id :identifier}
+  [(cond-> {:title "Identifier" :type "text" :id "identifier"}
      (:registration-form? form) (assoc :key true))
-   {:title "Instance id" :type "text" :id :instance_id :key true}
-   {:title "Display name" :type "text" :id :display_name}
-   {:title "Submitter" :type "text" :id :submitter}
-   {:title "Submitted at" :type "date" :id :submitted_at}
-   {:title "Surveyal time" :type "number" :id :surveyal_time}])
+   {:title "Instance id" :type "text" :id "instance_id" :key true}
+   {:title "Display name" :type "text" :id "display_name"}
+   {:title "Submitter" :type "text" :id "submitter"}
+   {:title "Submitted at" :type "date" :id "submitted_at"}
+   {:title "Surveyal time" :type "number" :id "surveyal_time"}])

 (defn common-records [form-instance data-point]
   {:instance_id   (get form-instance "id")


[#1077] Small steps on WIP code

[#1077] Small steps on WIP code

--- backend/src/akvo/lumen/lib/visualisation/maps.clj
+++ backend/src/akvo/lumen/lib/visualisation/maps.clj
@@ -2,20 +2,46 @@
   (:require [akvo.lumen.lib :as lib]
             [cheshire.core :as json]
             [clj-http.client :as client]
-            [clojure.pprint :refer [pprint]]))
+            [clojure.pprint :refer [pprint]]
+            [clojure.string :as s]))

-;; Localhost to keep within pod?
-(def url "http://windshaft:4000/lumen_tenant_1/layergroup")

-(defn headers []
+
+(defn- url
+  "WIP, should talk over localhost within the pod"
+  [tenant-db]
+  (format "http://windshaft:4000/%s/layergroup" tenant-db))
+
+(defn headers
+  "WIP, should get this from tenant-manger"
+  []
   {"x-db-host" "postgres"
    "x-db-last-update" (quot (System/currentTimeMillis) 1000)
    "x-db-password" "password"
    "x-db-port" 5432
    "x-db-user" "lumen"})

-(def sql-statement
-  "SELECT 'Batman cave' as label, ST_SetSRID(ST_MakePoint(12.069034,57.74119), 4326) AS geom;")
+(def locations
+  '({:label "HQ"
+     :longitude 4.908075
+     :latitude 52.372189}
+    {:label "Bat cave"
+     :longitude 12.069034
+     :latitude 57.74119}))
+
+
+(defn sql-values [locations]
+  (s/join ", "
+          (map (fn [{:keys [label longitude latitude]}]
+                 (format "('%s', ST_SetSRID(ST_MakePoint(%s,%s), 4326))"
+                         label longitude latitude))
+               locations)))
+
+(defn sql-statement
+  [locations]
+  (format "SELECT * FROM (VALUES %s ) AS t (label, geom);"
+          (sql-values locations)))
+

 (def cartocss
   "#s { marker-width: 10; marker-fill: #e00050;}")
@@ -32,12 +58,14 @@

 (defn create [tenant-db visualisation-spec]
   (prn tenant-db)
-  (pprint visualisation-spec)
+  #_(pprint visualisation-spec)
   ;; Handle if available
   ;; dataset -> yank out relevant ds_<...>,
   ;; geom
   ;; interactivity
-  (let [resp (client/post url
+  (let [sql-statement (sql-statement locations)
+        _ (prn sql-statement)
+        resp (client/post (url tenant-db)
                           {:body (json/encode (map-config cartocss
                                                           "geom"
                                                           "label"
@@ -51,6 +79,7 @@

 (comment
+
   ;; Example map spec
   {"type" "visualisation",
    "name" "Untitled visualisation",


Adapt `org/get-org` call so it can handle a slug that looks like a UUID.

--- src/oc/storage/resources/org.clj
+++ src/oc/storage/resources/org.clj
@@ -116,8 +116,11 @@
   {:pre [(db-common/conn? conn)
          (or (lib-schema/unique-id? identifier)
              (slug/valid-slug? identifier))]}
-  (if (lib-schema/unique-id? identifier)
-    (first (db-common/read-resources conn table-name :uuid identifier))
+  ;; if it looks like a UUID try retrieval by UUID, but also fallback to retrieval by slug
+  ;; since we can have slugs that look like UUIDs
+  (if-let [org (and (lib-schema/unique-id? identifier)
+                    (first (db-common/read-resources conn table-name :uuid identifier)))]
+    org
     (db-common/read-resource conn table-name identifier)))

 (schema/defn ^:always-validate uuid-for :- (schema/maybe lib-schema/UniqueID)


Rearrange monitoring calls to be together for readability.

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -168,12 +168,12 @@
         start (System/nanoTime)
         checkpoint-bytes (checkpoint-compress checkpoint)]
     (update-timer-ns! (:checkpoint-serialization-latency monitoring) (- (System/nanoTime) start))
+    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
     (when (and (not (nil? checkpoint))
                (not (fixed-npeers? (get-event state))))
       (throw (ex-info "Task is not checkpointable, as the task onyx/n-peers is not set and :onyx/min-peers is not equal to :onyx/max-peers."
                       {:job-id job-id
                        :task task-id})))
-    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
     (checkpoint/write-checkpoint storage tenancy-id job-id rv e task-id
                                  slot-id :input checkpoint-bytes)
     (debug "Checkpointed input" job-id rv e task-id slot-id :input)
@@ -190,11 +190,11 @@
         start (System/nanoTime)
         checkpoint-bytes (checkpoint-compress exported-state)]
     (update-timer-ns! (:checkpoint-serialization-latency monitoring) (- (System/nanoTime) start))
+    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
     (when-not (fixed-npeers? (get-event state))
       (throw (ex-info "Task is not checkpointable, as the task onyx/n-peers is not set and :onyx/min-peers is not equal to :onyx/max-peers."
                       {:job-id job-id
                        :task task-id})))
-    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
     (checkpoint/write-checkpoint storage tenancy-id job-id rv e task-id
                                  slot-id :windows checkpoint-bytes)
     (debug "Checkpointed state" job-id rv e task-id slot-id :windows)
@@ -210,12 +210,12 @@
         start (System/nanoTime)
         checkpoint-bytes (checkpoint-compress checkpoint)]
     (update-timer-ns! (:checkpoint-serialization-latency monitoring) (- (System/nanoTime) start))
+    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
     (when (and (not (nil? checkpoint))
                (not (fixed-npeers? (get-event state))))
       (throw (ex-info "Task is not checkpointable, as the task onyx/n-peers is not set and :onyx/min-peers is not equal to :onyx/max-peers."
                       {:job-id job-id
                        :task task-id})))
-    (.set ^AtomicLong (:checkpoint-size monitoring) (alength checkpoint-bytes))
     (checkpoint/write-checkpoint storage tenancy-id job-id rv e
                                  task-id slot-id :output checkpoint-bytes)
     (debug "Checkpointed output" job-id rv e task-id slot-id :output)


Fix RethinkDB cursor in export results.

Fix RethinkDB cursor in export results.

--- src/open_company/util/export.clj
+++ src/open_company/util/export.clj
@@ -53,7 +53,7 @@
             edn-file (second arguments)]
         (if-let [company (company/get-company conn slug)]
           (let [sections (common/read-resources conn common/section-table-name "company-slug" slug)
-                updates (common/read-resources conn common/stakeholder-update-table-name "company-slug" slug)]
+                updates (vec (sort-by :created-at (common/read-resources conn common/stakeholder-update-table-name "company-slug" slug)))]
             (spit edn-file (zp/zprint-str
               {:company company
                :sections sections


Fixed the latest stations query to not include stations that are not present in current_stations. This fixes some weirdnesss when a station has come briefly online, only to drop out of later API updates.

--- src/org/gensym/viddy/storage.clj
+++ src/org/gensym/viddy/storage.clj
@@ -90,9 +90,8 @@
                     "       a.addition_time AS addition_time, "
                     "       s.station_name AS station_name, "
                     "       s.status AS station_status "
-                    "FROM station_additions a "
-                    "LEFT JOIN current_stations s "
-                    "ON s.station_id = a.station_id "
+                    "FROM station_additions a, current_stations s "
+                    "WHERE s.station_id = a.station_id "
                     "ORDER BY a.addition_time DESC LIMIT 10")])
    (map
     #(replace-keys {:station_id :station-id


[Fix #284]  Don't truncate the artifacts cache (#285)

--- src/refactor_nrepl/artifacts.clj
+++ src/refactor_nrepl/artifacts.clj
@@ -120,7 +120,10 @@
   (let [clojars-artifacts (future (get-artifacts-from-clojars!))
         maven-artifacts (future (get-artifacts-from-mvn-central!))]
     (reset! artifacts (into @clojars-artifacts @maven-artifacts))
-    (spit artifacts-file @artifacts)
+    (spit artifacts-file
+          (binding [*print-length* nil
+                    *print-level*  nil]
+            (prn-str @artifacts)))
     (alter-meta! artifacts update-in [:last-modified]
                  (constantly (get-last-modified-from-file artifacts-file)))))


finish core layer captioning/highlighting

--- src/solar_system_of_js/core.cljs
+++ src/solar_system_of_js/core.cljs
@@ -30,6 +30,11 @@
              :y 0
              :r 200
              :alpha 0}
+   :es-captions {:es3 {:alpha 0}
+                 :es5 {:alpha 0}
+                 :es6 {:alpha 0}
+                 :es7 {:alpha 0}
+                 :es8 {:alpha 0}}
    })

 ;; Current state of the application.
@@ -79,6 +84,9 @@
 (defn fill! [] (.fill ctx))
 (defn stroke! [] (.stroke ctx))
 (defn circle! [x y r] (begin-path!) (arc! x y r 0 (* 2 PI) false))
+(defn move-to! [x y] (.moveTo ctx x y))
+(defn line-to! [x y] (.lineTo ctx x y))
+(defn stroke-line! [x0 y0 x1 y1] (begin-path!) (move-to! x0 y0) (line-to! x1 y1) (stroke!))
 (defn get-global-alpha [] (aget ctx "globalAlpha"))
 (defn set-global-alpha [x] (aset ctx "globalAlpha" x))
 (defn global-alpha! [x] (set-global-alpha (* x (get-global-alpha))))
@@ -88,6 +96,7 @@
 (defn text-align! [x] (aset ctx "textAlign" x))
 (defn text-baseline! [x] (aset ctx "textBaseline" x))
 (defn line-width! [x] (aset ctx "lineWidth" x))
+(defn line-cap! [x] (aset ctx "lineCap" x))

 ;;--------------------------------------------------------------------------------
 ;; Slide Drawings
@@ -127,21 +136,36 @@
 (def core-layers
   "colors of js-core layers"
   [{:name "ES3"
+    :desc "core features"
     :color "#DDD"
     }
    {:name "ES5"
+    :desc "new functions and strict mode"
     :color "#BBB"
     }
    {:name "ES6"
+    :desc "new syntax, concepts, etc."
     :color "#999"
     }
    {:name "ES7"
+    :desc "observe, async, comprehensions"
     :color "#777"
     }
    {:name "ES8"
+    :desc "macros?"
     :color "#555"
     }
    ])
+
+(defn get-core-dr
+  "Get core layer delta radius."
+  [r]
+  (/ r (count core-layers)))
+
+(defn get-core-radius
+  "Get radius of the given core layer index and outer radius."
+  [i r]
+  (* (inc i) (get-core-dr r)))

 (defn draw-js-core!
   [{:keys [x y r alpha]}]
@@ -149,7 +173,7 @@
   (global-alpha! alpha)
   (stroke-style! "#EEE")
   (doseq [[i layer] (reverse (map-indexed vector core-layers))]
-    (let [cr (* (inc i) (/ r (count core-layers)))]
+    (let [cr (get-core-radius i r)]
       (circle! x y cr)
       (fill-style! (:color layer))
       (fill!)))
@@ -160,6 +184,54 @@
   (restore!)
   )

+(defn draw-es-captions!
+  [{:keys [es3 es5 es6 es7 es8]}]
+  (save!)
+  (doseq [[i es] (map-indexed vector [es3 es5 es6 es7 es8])]
+    (when-not (zero? (:alpha es))
+      (save!)
+      (global-alpha! (:alpha es))
+      (let [angle (/ PI 4)
+            dx (cos angle)
+            dy (sin angle)
+            r (-> @state :js-face :r)
+            dr (get-core-dr r)
+            cr (- (get-core-radius i r) (/ dr 2))
+            y (- (* dy cr))
+            x0 (* dx cr)
+            x1 250
+            a 10
+            at (/ a 3)]
+
+        ;; highlight the layer
+        (line-width! dr)
+        (circle! 0 0 cr)
+        (stroke-style! "#1EA")
+        (stroke!)
+
+        ;; point at layer
+        (line-width! 5)
+        (line-cap! "round")
+        (stroke-line! x0 y x1 y)
+        (stroke!)
+
+        ;; draw caption
+        (let [layer (get core-layers i)]
+          (text-baseline! "middle")
+          (text-align! "left")
+          (fill-style! "#EEE")
+          (font! "100 40px Roboto")
+          (fill-text! (:name layer) (+ 10 x1) y)
+          (fill-style! "#AAA")
+          (font! "100 14px Roboto")
+          (fill-text! (:desc layer) (+ 15 x1) (+ 30 y)))
+
+        )
+      (restore!)
+      ))
+  (restore!)
+  )
+

 ;;--------------------------------------------------------------------------------
 ;; Drawing
@@ -184,6 +256,7 @@
   (draw-title! (:title @state))
   (draw-js-core! (:js-core @state))
   (draw-js-face! (:js-face @state))
+  (draw-es-captions! (:es-captions @state))

   (restore!))

@@ -278,23 +351,45 @@

 (def slide-actions
   "Actions to take for each slide."
-  [nil ;; no action for first slide
-   #(go
-      (<! (multi-animate!
-            {:a 900 :b 0 :duration 1} [:js-face :x]
-            {:a 1 :b 0 :duration 0.4} [:title :alpha]
-            )))
-   #(go
-      (<! (multi-animate!
-            {:a 0 :b 400 :duration 2} [:cam :x]
-            {:a 0 :b -600 :duration 2} [:js-face :y]
-            {:a 0 :b 600 :duration 2} [:js-face :x]
-            {:a 0 :b (* 2 PI) :duration 2} [:js-face :angle]
-            {:a 1 :b 0 :duration 2} [:js-face :alpha]
-            {:a 0 :b 1 :duration 1} [:js-core :alpha]
-            {:a 1 :b 2 :duration 2} [:cam :zoom]
-            )))
-   ])
+  (vec (flatten
+    [nil ;; no action for first slide
+     #(go
+        (<! (multi-animate!
+              {:a 900 :b 0 :duration 1} [:js-face :x]
+              {:a 1 :b 0 :duration 0.4} [:title :alpha])))
+     #(go
+        (<! (multi-animate!
+              {:a 0 :b 400 :duration 2} [:cam :x]
+              {:a 0 :b -600 :duration 2} [:js-face :y]
+              {:a 0 :b 600 :duration 2} [:js-face :x]
+              {:a 0 :b (* 2 PI) :duration 2} [:js-face :angle]
+              {:a 1 :b 0 :duration 2} [:js-face :alpha]
+              {:a 0 :b 1 :duration 1} [:js-core :alpha]
+              {:a 1 :b 2 :duration 2} [:cam :zoom])))
+     (let [t 0.01
+           low 0]
+       [
+        #(go
+           (<! (animate!
+                 {:a 0 :b 1 :duration t} [:es-captions :es3 :alpha])))
+        #(go
+           (<! (multi-animate!
+                 {:a 1 :b low :duration t} [:es-captions :es3 :alpha]
+                 {:a 0 :b 1 :duration t} [:es-captions :es5 :alpha])))
+        #(go
+           (<! (multi-animate!
+                 {:a 1 :b low :duration t} [:es-captions :es5 :alpha]
+                 {:a 0 :b 1 :duration t} [:es-captions :es6 :alpha])))
+        #(go
+           (<! (multi-animate!
+                 {:a 1 :b low :duration t} [:es-captions :es6 :alpha]
+                 {:a 0 :b 1 :duration t} [:es-captions :es7 :alpha])))
+        #(go
+           (<! (multi-animate!
+                 {:a 1 :b low :duration t} [:es-captions :es7 :alpha]
+                 {:a 0 :b 1 :duration t} [:es-captions :es8 :alpha])))
+        ])
+     ])))

 (def num-slides
   (count slide-actions))


fix #1432 (related to re-frame migration)

--- src/status_im/chat/handlers.cljs
+++ src/status_im/chat/handlers.cljs
@@ -244,8 +244,8 @@
   [(after #(dispatch [:load-unviewed-messages!]))
    (after #(dispatch [:load-default-contacts!]))]
   (u/handlers->
-    initialize-chats
-    load-chats!))
+    load-chats!
+    initialize-chats))

 (register-handler :reload-chats
   (fn [{:keys [chats] :as db} _]


chat: fix broken chat delete logic (#1343)

* chat: fix broken chat delete logic

Previously, persisting the chat delete functionality was working
only for group chats, where the `debug?` flag decided if delete was
a real "hard" delete (deleting data from the realm database) or just
marking with the `inactive` flag.

However non-group chats were not deleted at all, which I believe is a
bug fixed by this commit.

* chat: fix broken chat delete logic

Fix the branching logic with `if` instead of `when`

--- src/status_im/chat/handlers.cljs
+++ src/status_im/chat/handlers.cljs
@@ -392,10 +392,9 @@
 (defn delete-chat!
   [_ [_ chat-id]]
   (let [{:keys [debug? group-chat]} (chats/get-by-id chat-id)]
-    (when group-chat
-      (if debug?
-        (chats/delete chat-id)
-        (chats/set-inactive chat-id)))))
+    (if (and (not debug?) group-chat)
+      (chats/set-inactive chat-id)
+      (chats/delete chat-id))))

 (defn remove-pending-messages!
   [_ [_ chat-id]]


Comment away screens

Comment away screens

Signed-off-by: yenda <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@status.im>

--- src/status_im/android/core.cljs
+++ src/status_im/android/core.cljs
@@ -43,7 +43,8 @@
                         (when-not (zero? @keyboard-height)
                           (dispatch [:set :keyboard-height 0]))))
         (.hide react/splash-screen)
-        (.useScreens rn-dependencies/react-native-screens)
+        ;; TODO Temporarily comment away due to current bug https://github.com/kmagiera/react-native-screens/issues/54
+        ;(.useScreens rn-dependencies/react-native-screens)
         (.addEventListener react/app-state "change" app-state-change-handler)
         (.addEventListener rn-dependencies/react-native-languages "change" on-languages-change)
         (.addEventListener rn-dependencies/react-native-shake


Create json-field component

Create json-field component

--- src/storemi/views/component.clj
+++ src/storemi/views/component.clj
@@ -1,6 +1,7 @@
 (ns storemi.views.component
   (:require
     [hiccup.page :refer [html5 include-css]]
+    [storemi.models.db :refer [json-string]]
     [storemi.settings :as settings]
     [storemi.urlfor :as urlfor]))

@@ -11,6 +12,13 @@
                :id id
                :class class}]
     [:input props]))
+
+(defn json-field [data & {:keys [id name class]}]
+  (hidden-field
+    (json-string data)
+    :id id
+    :name name
+    :class class))

 (defn story-list
   [stories & [hide-author]]


Better docs/comments for `munge-event-values` function

--- test/com/puppetlabs/puppetdb/test/http/experimental/event.clj
+++ test/com/puppetlabs/puppetdb/test/http/experimental/event.clj
@@ -38,8 +38,15 @@

 (defn munge-event-values
   "Munge the event values that we get back from the web to a format suitable
-  for comparison with test data"
+  for comparison with test data.  This generally involves things like converting
+  map keys from keywords to strings, etc."
   [events]
+  ;; It is possible for the `old-value` and `new-value` field of an event
+  ;; to contain values that are complex data types (arrays, maps).  In
+  ;; the case where one of these values is a map, we will get it back
+  ;; with keywords as keys, but real world-data has strings as keys.  Here
+  ;; we simply convert the keys to strings so that we can compare them for
+  ;; tests.
   (map #(utils/maptrans {[:old-value :new-value] stringify-keys} %) events))

 (defn expected-resource-event-response


Added a basic main that (for now) just prints the dependencies

--- src/descent/core.clj
+++ src/descent/core.clj
@@ -1,7 +1,14 @@
 (ns descent.core
+  (:require [descent.pom-parser :as parser])
+  (:use [clojure.pprint :only (pprint)])
   (:gen-class))

 (defn -main
-  "I don't do a whole lot ... yet."
-  [& args]
-  (println "Hello, World!"))
+  "Given a pom.xml path, this will extract the project's dependencies, load
+  them into Datomic (so they're viewable over time), generate a graph
+  visualization and then print the graph to a file.
+
+  Usage: descent.core: <path-to-pom> [optional arguments]"
+  [path-to-pom & args]
+  (let [deps-map (parser/process-pom path-to-pom)]
+    (pprint deps-map)))


make 'as-str' fn faster by avoiding collection processing

--- src/asphalt/internal.clj
+++ src/asphalt/internal.clj
@@ -128,11 +128,12 @@

 (defn as-str
+  "Turn anything into string."
   ^String [x]
   (if (named? x)
-    (->> [(namespace x) (name x)]
-      (remove nil?)
-      (str/join "/"))
+    (if-let [nss (namespace x)]
+      (str nss \/ (name x))
+      (name x))
     (str x)))


rseq doesn't work on lazy seqs

rseq doesn't work on lazy seqs

--- src/fatlip/plot.cljs
+++ src/fatlip/plot.cljs
@@ -27,7 +27,7 @@
   Reversible
   (rev [this]
     (assoc this
-           :classes (vec (rseq (mapv #(vec (rseq %)) classes)))
+           :classes (vec (rseq (mapv #(vec (reverse %)) classes)))
            :succs preds
            :preds succs
            :block-succs block-preds


Fix FragmentHistory -stop method

Fix FragmentHistory -stop method

--- modules/reitit-frontend/src/reitit/frontend/history.cljs
+++ modules/reitit-frontend/src/reitit/frontend/history.cljs
@@ -16,7 +16,7 @@

 ;; This version listens for both pop-state and hash-change for
 ;; compatibility for old browsers not supporting History API.
-(defrecord FragmentHistory [on-navigate router listen-key last-fragment]
+(defrecord FragmentHistory [on-navigate router popstate-listener hashchange-listener last-fragment]
   History
   (-init [this]
     ;; Link clicks and e.g. back button trigger both events, if fragment is same as previous ignore second event.
@@ -30,12 +30,11 @@
                         (-on-navigate this path))))]
       (-on-navigate this (-get-path this))
       (assoc this
-             :listen-key (gevents/listen js/window
-                                         #js [goog.events.EventType.POPSTATE goog.events.EventType.HASHCHANGE]
-                                         handler
-                                         false))))
+             :popstate-listener (gevents/listen js/window goog.events.EventType.POPSTATE handler false)
+             :hashchange-listener (gevents/listen js/window goog.events.EventType.HASHCHANGE handler false))))
   (-stop [this]
-    (gevents/unlistenByKey listen-key))
+    (gevents/unlistenByKey popstate-listener)
+    (gevents/unlistenByKey hashchange-listener))
   (-on-navigate [this path]
     (reset! last-fragment path)
     (on-navigate (rf/match-by-path router path) this))


use dat `when-let`

use dat `when-let`

--- src/metabase/models/database.clj
+++ src/metabase/models/database.clj
@@ -15,10 +15,9 @@
 (defn databases-for-org
   "Selects the ID and NAME for all databases available to the given org-id."
   [org-id]
-  (let [org (sel :one Org :id org-id)]
-    (when org
-      (if (:inherits org)
-        ;; inheriting orgs see ALL databases
-        (sel :many [Database :id :name] (order :name :ASC))
-        ;; otherwise filter by org-id
-        (sel :many [Database :id :name] :organization_id org-id (order :name :ASC))))))+  (when-let [org (sel :one Org :id org-id)]
+    (if (:inherits org)
+      ;; inheriting orgs see ALL databases
+      (sel :many [Database :id :name] (order :name :ASC))
+      ;; otherwise filter by org-id
+      (sel :many [Database :id :name] :organization_id org-id (order :name :ASC)))))


whitespace fix

whitespace fix

--- frontend/components/project/common.cljs
+++ frontend/components/project/common.cljs
@@ -44,7 +44,7 @@
                       " to keep running your builds.")

                 :else
-                (list (gstring/format "%s's trial expires in %s!" org-name (plan-model/pretty-trial-time plan))
+                (list (gstring/format "%s's trial expires in %s! " org-name (plan-model/pretty-trial-time plan))
                       [:a {:href plan-path} "Add a plan"]
                       " to keep running your builds."))])))))


Resolve faster

Resolve faster

--- src/aurora/language.cljs
+++ src/aurora/language.cljs
@@ -3,57 +3,7 @@
   (:require-macros [aurora.macros :refer [console-time set!! conj!! disj!! assoc!! apush apush* avec]]
                    [aurora.language :refer [deffact]]))

-;; CLJS UTILS
-
-(def munge-map
-  {"-" "_"
-   " " "_SPACE_"
-   "." "_DOT_"
-   ":" "_COLON_"
-   "+" "_PLUS_"
-   ">" "_GT_"
-   "<" "_LT_"
-   "=" "_EQ_"
-   "~" "_TILDE_"
-   "!" "_BANG_"
-   "@" "_CIRCA_"
-   "#" "_SHARP_"
-   "'" "_SINGLEQUOTE_"
-   "\"" "_DOUBLEQUOTE_"
-   "%" "_PERCENT_"
-   "^" "_CARET_"
-   "&" "_AMPERSAND_"
-   "*" "_STAR_"
-   "|" "_BAR_"
-   "{" "_LBRACE_"
-   "}" "_RBRACE_"
-   "[" "_LBRACK_"
-   "]" "_RBRACK_"
-   "/" "_SLASH_"
-   "\\" "_BSLASH_"
-   "?" "_QMARK_"})
-
-(def munge-regexes
-  (into-array
-   (for [find (keys munge-map)]
-     (js/RegExp. (str "\\" find) "gi"))))
-
-(def munge-replaces
-  (into-array (vals munge-map)))
-
-;; TODO doesn't handle reserved names or namespaced symbols
-(defn munge-part [part]
-  (areduce munge-regexes i part part
-           (.replace part (aget munge-regexes i) (aget munge-replaces i))))
-
-(defn munge [sym]
-  (let [parts (.split (name sym) ".")
-        last-part (.pop parts)]
-    (.push parts (munge-part last-part))
-    (.join parts ".")))
-
-(defn resolve [namespaced]
-  (js/eval (str (namespace namespaced) "." (munge (name namespaced)))))
+(declare resolve)

 ;; TODO facts and plans need to be serializable

@@ -768,3 +718,16 @@
              (get-facts :remembered)))
     )
   )
+
+;; RESOLVE
+
+(def symbol->fun
+  #js {"let->fun" let->fun
+       "when->fun" when->fun
+       "when-let->fun" when-let->fun
+       "pattern->filter*" pattern->filter*
+       "pattern->constructor*" pattern->constructor*
+       "pattern->deconstructor*" pattern->deconstructor*})
+
+(defn resolve [namespaced]
+  (aget symbol->fun (name namespaced)))


ensure that watched paths exist

ensure that watched paths exist

fixes #469

--- sidecar/src/figwheel_sidecar/components/file_system_watcher.clj
+++ sidecar/src/figwheel_sidecar/components/file_system_watcher.clj
@@ -6,12 +6,22 @@
    [com.stuartsierra.component :as component]
    [clojure.java.io :as io]))

+;; watch-paths are created if they don't exist
+;; This could easily cause problems if people put file names in the
+;; list of watch paths
+;; But file names are not supposed to be in the watch paths
+(defn ensure-watch-paths [watch-paths]
+  (doseq [watch-path watch-paths]
+    (when-not (.exists (io/file watch-path))
+      (.mkdirs (io/file watch-path)))))
+
 (defrecord FileSystemWatcher [watcher-name watch-paths notification-handler figwheel-server log-writer]
   component/Lifecycle
   (start [this]
     (let [figwheel-server-options (config-options figwheel-server)]
       (if (not (:file-system-watcher-quit this))
         (do
+          (ensure-watch-paths watch-paths)
           (if (not-empty watch-paths)
             (let [log-writer (or log-writer
                                  (:log-writer figwheel-server-options)


Change in results: right parameters passed into jenkins-api/read-list-of-test-jobs

--- src/emender_jenkins/results.clj
+++ src/emender_jenkins/results.clj
@@ -107,7 +107,9 @@
     [configuration]
     (let [job-list (jenkins-api/read-list-of-test-jobs (-> configuration :jenkins :jenkins-url)
                                                        (-> configuration :jenkins :jenkins-job-list-url)
-                                                       (-> configuration :jobs    :test-jobs-suffix))
+                                                       (-> configuration :jobs    :preview-test-jobs-suffix)
+                                                       (-> configuration :jobs    :stage-test-jobs-suffix)
+                                                       (-> configuration :jobs    :prod-test-jobs-suffix))
           job-results (read-update-job-info job-list)]
           (clojure.pprint/pprint job-results)
           ;job-results (read-all-test-results configuration job-list)]


spacing

spacing

--- src/celestial/api/ui.clj
+++ src/celestial/api/ui.clj
@@ -1,4 +1,4 @@
-(ns celestial.ui-api
+(ns celestial.api.ui
   (:require
     [compojure.core :refer (defroutes GET ANY)]
     [compojure.route :as route]
@@ -21,6 +21,5 @@
 (defroutes public
   (GET "/login" [] (ring.util.response/file-response "assets/login.html" {:root (static-path)}))
   (friend/logout (ANY "/logout" request  (ring.util.response/redirect "/")))
-  (route/files "/" {:root (static-path)})
-  )
+  (route/files "/" {:root (static-path)}))


Directly publish the generated posts via the generate script.

--- src/oc/storage/util/generate.clj
+++ src/oc/storage/util/generate.clj
@@ -131,8 +131,13 @@
         video? (<= (rand) (:chance-of-video config-data))
         body (if video? (str part3 (video-tag)) part3)
         entry-props {:headline headline :body body}
-        entry (if topic? (assoc entry-props :topic-name topic) entry-props)]
-    (entry-res/create-entry! conn (entry-res/->entry conn board entry author) timestamp)))
+        entry (if topic? (assoc entry-props :topic-name topic) entry-props)
+        with-published (merge entry {:status :published
+                                     :published-at timestamp
+                                     :publisher author
+                                     :secure-uuid (db-common/unique-id)
+                                     :author (conj (:author entry) (assoc author :updated-at timestamp))})]
+    (entry-res/create-entry! conn (entry-res/->entry conn board with-published author) timestamp)))

 (defn- generate-updates [conn org config-data authors this-date]
   (let [update-count (int (inc (Math/floor (rand (:max-entries config-data)))))


Update for bumped deps

Update for bumped deps

--- src/grimoire/doc.clj
+++ src/grimoire/doc.clj
@@ -6,12 +6,10 @@
             [clojure.tools.namespace.find :as tns.f]
             [clojure.java.classpath :as cp]
             [grimoire.api :as api]
-            [grimoire.api.fs]
             [grimoire.api.fs.write]
             [grimoire.things :as t]
             [grimoire.util :as util]
-            [detritus.var :refer [var->ns var->sym macro?]]
-            [detritus.update :refer [update]]))
+            [detritus.var :refer [var->ns var->sym macro?]]))

 (defn var->type


only consider urls that end in .jar

only consider urls that end in .jar

--- src/clj/cljs/js_deps.clj
+++ src/clj/cljs/js_deps.clj
@@ -53,9 +53,14 @@
     (reduce
       (fn [files jar-or-dir]
         (->> (when (.exists jar-or-dir)
-              (if (.isDirectory jar-or-dir)
-                (find-js-fs (str (.getAbsolutePath jar-or-dir) "/" path))
-                (find-js-jar jar-or-dir path)))
+               (cond
+                 (.isDirectory jar-or-dir)
+                 (find-js-fs (str (.getAbsolutePath jar-or-dir) "/" path))
+
+                 (.endsWith (.getName jar-or-dir) ".jar")
+                 (find-js-jar jar-or-dir path)
+
+                 :else nil))
           (remove nil?)
           (into files)))
       [])))


Fix typo.

Fix typo.

--- src/clj_ravendb/rest.clj
+++ src/clj_ravendb/rest.clj
@@ -207,7 +207,7 @@
 (defn- user-info
   "Queries the debug/user-info RavenDB endpoint
   in order to provide debug information about
-  the current authentication (or not) user.
+  the current authenticated (or not) user.

   Optionally takes a map of options.
   :request-builder is a custom request builder fn.


Removes failing code when parsing http headers.

--- src/clj_spotify/core.clj
+++ src/clj_spotify/core.clj
@@ -33,7 +33,7 @@
                  :message (.getMessage e)
                  :response response}}))
     {:status (:status response)
-     :header (json-string-to-map (:header response))}))
+     :headers (:headers response)}))

 (defn- build-new-url
   "Do the building necessary in replace-url-values here. url-parts is the split up url which values works as keys in param-map."


Clearer game page

Clearer game page

--- src/cljs/darts/core.cljs
+++ src/cljs/darts/core.cljs
@@ -111,16 +111,22 @@
                          (clear-message))} "Clear"]
    [:button {:on-click submit-score} "Enter"]])

+(defn player-name [player-id]
+  (:name (get @game player-id)))
+
+(defn print-player [player-id]
+  [:span  (player-name player-id) ": " (points player-id) " " (print-rounds player-id) " avg: " (average player-id)])
+
 (defn play-page []
   [:div
    @message
    [:div
-    [:span "Player 1: " (points 0) " " (print-rounds 0) " avg: " (average 0)]
-    [:br]
-    [:span "Player 2: " (points 1) " " (print-rounds 1) " avg: " (average 1)]]
+    (print-player 0)
+    [:br]
+    (print-player 1)]
    [:div
     [:br]
-    (str "Player " (+ 1 @current-player) " turn")
+    (str (player-name @current-player) " to shoot")
     [:br]
     [:input {:type :text
              :value @score
@@ -133,6 +139,8 @@
                                   (reset! score value)))}]
     [:br]
     [numpad]
+    [:br]
+    [:a {:href "/"} "Quit, let's have a pint!"]
     (println @game)]])

 (defn select-game-pane []


Show potoos for each user separately

Show potoos for each user separately

--- src/cljs/potoo/core.cljs
+++ src/cljs/potoo/core.cljs
@@ -50,6 +50,7 @@
 (defn potoo-form [text]
   (if (:user @app-state)
     [:div
+     [:h3 "Potoo it!"]
      [:input {:type      "text" :value @text
               :on-change #(reset! text (-> % .-target .-value))}]
      [:input {:type     "button"
@@ -58,11 +59,17 @@
               :on-click #(create-potoo @text)}]]
     [:p "Please login to post a potoo"]))

+(defn potoos-for-user [user potoos]
+  [:div
+   [:h3 user]
+   [:ul
+    (for [p (sort-by :date potoos)]
+      ^{:key p} [potoo p])]])
+
 (defn potoo-list []
   [:div
-   [:ul
-    (for [p (sort-by :date (:potoos @app-state))]
-      ^{:key p} [potoo p])]])
+   (for [[name potoos] (seq (group-by :name (:potoos @app-state)))]
+     [potoos-for-user name potoos])])

 (def potoo-list-initial
   (with-meta potoo-list


Remove meta-errors that are now components of :autoconstruction-blindness

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -212,22 +212,6 @@
                                    (sequence-similarity g child2-genome)
                                    (sequence-similarity child1-genome child2-genome)))
                             1.0)
-                          ;
-                          (= cat :checks-autoconstructing)
-                          (if (some (fn [instruction-map]
-                                      (and (= (:instruction instruction-map) 'genome_autoconstructing)
-                                           (not (:silent instruction-map))))
-                                    (:genome ind))
-                            0
-                            1)
-                          ;
-                          (= cat :checks-if-autoconstructing)
-                          (if (some (fn [instruction-map]
-                                      (and (= (:instruction instruction-map) 'genome_if_autoconstructing)
-                                           (not (:silent instruction-map))))
-                                    (:genome ind))
-                            0
-                            1)
                           ;
                           (= cat :autoconstruction-blindness)
                           (if (some (fn [instruction-map]


got rid of juxt for something simpler

got rid of juxt for something simpler

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -95,7 +95,7 @@
   (let [t (find-task-fast catalog task)]
     (if-let [k (:onyx/group-by-key t)]
       (if (sequential? k)
-        (hash (sort ((apply juxt k) segment)))
+        (hash (select-keys segment k))
         (hash (get segment k)))
       (when-let [f (:onyx/group-by-fn t)]
         (hash ((operation/resolve-fn {:onyx/fn f}) segment))))))


Pipeline setup via ->. Add resolve log to pipeline setup

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -542,6 +542,9 @@
                [id (atom [])])
              (range 20))))

+(defn resolve-log [pipeline]
+  (assoc pipeline :onyx.core/state-log (state-extensions/initialise-log :atom pipeline)))
+
 (defrecord TaskLifeCycle
     [id log messenger-buffer messenger job-id task-id replica peer-replica-view restart-ch
      kill-ch outbox-ch seal-resp-ch completion-ch opts task-kill-ch monitoring]
@@ -616,9 +619,12 @@
                           (not (munge-start-lifecycle pipeline-data)))
                 (Thread/sleep (or (:onyx.peer/peer-not-ready-back-off opts) 2000)))

-            pipeline-data ((:onyx.core/compiled-before-task-start-fn pipeline-data) pipeline-data)
-            pipeline-data (setup-triggers pipeline-data)
-            pipeline-data (replay-windows-from-log pipeline-data)]
+            before-task-start-fn (:onyx.core/compiled-before-task-start-fn pipeline-data)
+            pipeline-data (-> pipeline-data
+                              before-task-start-fn
+                              setup-triggers
+                              resolve-log
+                              replay-windows-from-log)]

         (clear-messenger-buffer! messenger-buffer)
         (>!! outbox-ch (entry/create-log-entry :signal-ready {:id id}))


Fix build

Fix build

--- src/forces_assemble/handler.clj
+++ src/forces_assemble/handler.clj
@@ -33,6 +33,10 @@
 (def debug-client-token "dHfG35KW8yA:APA91bGFFLRyvqzK6mUYK8DBQloGit9Uq3SZ0VeLq0lP80cCiPYtk1huM1Ls12zbU8nJK9Ag0NJS-3FEJ3pkbX0gMHzHvnbvEXyvIUUkg4aLYBE4rwSuJZiZC6_M-25Ozw119C2N7UE0")
 (def papertrail-events-uri "https://papertrailapp.com/api/v1/events/search.json")

+(defn api
+  [uri]
+  (str api-uri-prefix uri))
+
 (defn build-notification
   [event client]
   {:to client
@@ -207,10 +211,6 @@
                    application-json :>> (fn [_] (identity events))
                    nil))))

-(defn api
-  [uri]
-  (str api-uri-prefix uri))
-
 (defroutes assemble-routes
   (GET "/" [] (io/resource "index.html"))
   (GET "/api.js" [] (io/resource "api.js"))


Ability to add events.

Ability to add events.

--- src/forces_assemble/handler.clj
+++ src/forces_assemble/handler.clj
@@ -21,6 +21,7 @@

 (def coll-users "users")
 (def coll-channels "channels")
+(def coll-events "events")

 (defn is-subscribed-to-channel
   [channel-id user-id]
@@ -75,39 +76,64 @@
   [channel-id]
   (map get-user-token (get-channel-subscribers channel-id)))

+(defn add-event-to-channel-db
+  [channel-id event]
+  (mc/insert-and-return mongodb
+                        coll-events
+                        (assoc event :channel-id channel-id)))
+
 ;; HTTP
 (def firebase-send-uri "https://fcm.googleapis.com/fcm/send")
+(def application-json "application/json")

 (defn build-notification
-  [title body client]
+  [event client]
   {:to client
    :priority "high"
-   :notification {:title title
-                  :body body
+   :notification {:title (:title event)
+                  :body (:body event)
                   :sound "default"}})

 (def client-key "cpNE0uW_5sk:APA91bHmkiSpbq1s2zOKs_2hctUn7N_o_80Jt3diomlq5xClfk3XWImAkG5drS2pTA0oSLOnn4b14bUybiIL1e2uX_r6XOYm-dzIt86Y9qUw_rCowE9DfKMMyqHQa906_xNu2xInjbjh")

+(defn debug-send-push-notification [client event]
+  (println (str "to: " client "\n" event)))
+
 (defn send-push-notification
-  [client]
+  [client event]
   (http/post firebase-send-uri
              {:content-type :json
               :headers {"Authorization" (str "key=" (or (env :firebase-api-key) ""))}
-              :form-params (build-notification "Hi" "You are notified" client)}))
+              :form-params (build-notification event client)}))
+
+;; Event logic
+(defn add-event-to-channel
+  [channel-id event]
+  (let [added-event (add-event-to-channel-db channel-id event)]
+    (map #(send-push-notification % added-event) (get-user-tokens-on-channel channel-id))))

 ;; Server

 (defresource user-tokens [user-id]
   :allowed-methods [:put]
-  :available-media-types ["application/json"]
-  :known-content-type? #(check-content-type % ["application/json"])
+  :available-media-types [application-json]
+  :known-content-type? #(check-content-type % [application-json])
   :malformed? #(parse-json % ::data)
   :put! (fn [context]
           (refresh-user-token user-id (:token (::data context)))))

+(defresource channel-events [channel-id]
+  :allowed-methods [:post]
+  :available-media-types [application-json]
+  :known-content-type? #(check-content-type % [application-json])
+  :malformed? #(parse-json % ::data)
+  :post! (fn [context]
+           (add-event-to-channel channel-id (::data context))))
+
 (defroutes app-routes
   (GET "/" [] "Hello World2")
   (ANY "/users/:id/token" [id] (user-tokens id))
+  (ANY "/channels/:id/events" [id] (channel-events id))
   (route/not-found "Not Found"))

 (def app


remove warning about overloaded symbol

remove warning about overloaded symbol

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/util/namespace_utils.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/util/namespace_utils.clj
@@ -1,5 +1,6 @@
 (ns com.sixsq.slipstream.ssclj.util.namespace-utils
   "Utilities for dynamic loading of namespaces and vars."
+  (:refer-clojure :exclude [resolve])
   (:require
     [clojure.tools.logging :as log]
     [clojure.java.classpath :as cp]


Shows price on investments tab

Shows price on investments tab

--- src/hphelper/frontend/play.cljs
+++ src/hphelper/frontend/play.cljs
@@ -642,7 +642,7 @@
   [[k invest-map] sgs]
   (log/info "investment row. k:" k "invest-map:" invest-map "sgs:" sgs)
   ^{:key k}
-  [:tr
+  [:tr {:class (if (= (get-in @game-atom [:character :name]) (name k)) "text-success" "")}
    [:td k]
    (doall
      (map
@@ -665,7 +665,7 @@
 (defn- create-trade-button
   "Creates a single button for buying or selling"
   ([zone group amount]
-   [:span {:class "btn-default btn-xs"
+   [:div {:class "btn-default btn-xs"
            :onClick
            #(do (ajax/GET (wrap-context "/api/player/trade-investments/")
                           {:response-format (ajax/json-response-format {:keywords? true})
@@ -693,8 +693,7 @@
                ^{:key sg}
                [:td
                 ;; Buy button
-                (create-trade-button sg 1)
-                (create-trade-button sg -1)
+                (doall (map create-trade-button (repeat sg) [10 5 1 -1 -5 -10]))
                 ]
                )
              )
@@ -717,9 +716,23 @@
           (let [sgs (sort ["AF" "CP" "IS" "PL" "TS" "TD" "PS" "RD" "HP"])]
             (log/info "sgs:" sgs "vestments:" (:investments @game-atom))
             [:table {:class "table-hover table-striped col-lg-12"}
-             [:thead>tr
-              [:td ] ;; For name
-              (map (fn [k] ^{:key k} [:th k]) sgs)
+             [:thead
+              ;; SG abbreviations
+              [:tr
+               [:td ] ;; For name
+               (map (fn [k] ^{:key k} [:th k]) sgs)
+               ]
+              ;; Prices
+              [:tr
+               [:th "Price"]
+               (map (fn [sg] ^{:key sg} [:th (-> @game-atom :indicies first (get (keyword sg))
+                                                 ;; We have the index, now to convert to price
+                                                 (+ 100) (/ 100) (max 0.1)
+                                                 ;; We have price, now to reduce to 2 decimal places
+                                                 (* 100) int (/ 100))])
+                    sgs
+                    )
+               ]
               ]
              [:tbody
               (investment-trade-row sgs)


conversion: allow idempotent conversion!

--- src/java_time/defconversion.clj
+++ src/java_time/defconversion.clj
@@ -34,6 +34,8 @@
                 ;; currently we just incur a 0.5*number of types dropped penalty
                 (+ cost (* 0.5 (- (count xs) (count combo)))))))))

+(def ^:dynamic *fail-on-duplicate-conversion?* true)
+
 (defn conversion!
   ([from to f] (conversion! from to f 1))
   ([from-type-vec to-type-vec f cost]
@@ -43,8 +45,9 @@
        (swap! graph
               (fn [g]
                 (if-let [existing (g/get-conversion g from to)]
-                  (throw (ex-info (format "Conversion %s -> %s already exists: %s!" from to existing)
-                                  {:from from, :to to, :existing existing}))
+                  (when *fail-on-duplicate-conversion?*
+                    (throw (ex-info (format "Conversion %s -> %s already exists: %s!" from to existing)
+                                    {:from from, :to to, :existing existing})))
                   (let [f (wrap-validation from to f)]
                     (g/assoc-conversion g from to f cost)))))))))


RR|ME: bump to 0.3.25-SNAPSHOT

RR|ME: bump to 0.3.25-SNAPSHOT


Bump MarkLogic dependency to 9.0-6

Bump MarkLogic dependency to 9.0-6


Update Ring dependency to 1.6.0-beta6

Update Ring dependency to 1.6.0-beta6

--- project.clj
+++ project.clj
@@ -7,7 +7,7 @@
                  [org.clojure/tools.macro "0.1.5"]
                  [clout "2.1.2"]
                  [medley "0.8.2"]
-                 [ring/ring-core "1.6.0-beta4"]
+                 [ring/ring-core "1.6.0-beta6"]
                  [ring/ring-codec "1.0.1"]]
   :plugins [[lein-codox "0.9.5"]]
   :codox


Version 1.5.2-SNAPSHOT

Version 1.5.2-SNAPSHOT

--- project.clj
+++ project.clj
@@ -2,7 +2,7 @@
 (def ks-version "1.3.0")
 (def jetty-version "9.2.10.v20150310")

-(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.5.1"
+(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.5.2-SNAPSHOT"
   :description "A jetty9-based webserver implementation for use with the puppetlabs/trapperkeeper service framework."
   :url "https://github.com/puppetlabs/trapperkeeper-webserver-jetty9"
   :license {:name "Apache License, Version 2.0"


Prepare for next release cycle.

Prepare for next release cycle.

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.onyxplatform/onyx-dashboard "0.9.2.0"
+(defproject org.onyxplatform/onyx-dashboard "0.9.2.1-SNAPSHOT"
   :description "Dashboard for the Onyx distributed computation system"
   :url "http://github.com/lbradstreet/onyx-dashboard"
   :license {:name "Eclipse Public License"


Version 1.6.1-SNAPSHOT

Version 1.6.1-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,6 +1,6 @@
 (def http-async-client-version "1.3.0")

-(defproject puppetlabs/pcp-broker "1.6.0"
+(defproject puppetlabs/pcp-broker "1.6.1-SNAPSHOT"
   :description "PCP fabric messaging broker"
   :url "https://github.com/puppetlabs/pcp-broker"
   :license {:name "Apache License, Version 2.0"


Fixed the build issue

Fixed the build issue


add clj-http dep

add clj-http dep


Bump CLJS to 1.7.170

Bump CLJS to 1.7.170

--- project.clj
+++ project.clj
@@ -9,6 +9,6 @@
   :jvm-opts ^:replace ["-Xms512m" "-Xmx512m" "-server"]

   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "1.7.145"]
+                 [org.clojure/clojurescript "1.7.170"]
                  [org.clojure/test.check "0.8.2"]
-                 [com.gfredericks/test.chuck "0.2.0"]])+                 [com.gfredericks/test.chuck "0.2.0"]])


(SERVER-1494) Add temporary workaround for IntelliJ lein-parent issue

This commit temporarily switches us from `lein-parent` to
`lein-step-parent`, to unblock us on moving forward with the parent
project stuff, while working around a bug in Cursive.

This should be removed once Cursive finishes
adding support for the lein 2.7.1/lein-parent functionality.


use previous version of cljsbuild

use previous version of cljsbuild


Atom for tracking latest generation from REPL.

--- src/algebolic/evolution/core.clj
+++ src/algebolic/evolution/core.clj
@@ -24,6 +24,9 @@
   (:require [algebolic.evolution.reproduction :as reproduction]
             [algebolic.evolution.scoring :as scoring]
             [algebolic.evolution.metrics :as metrics]))
+
+;; An atom to store the lastest generation which is useful for debugging etc
+(def latest (atom {}))

 (defn evolve
   "Runs one generation of the evolutionary algorithm. Takes a zeitgeist and a generation-config
@@ -58,6 +61,7 @@
         scored-transformed-rabble (scoring/update-scores transformed-rabble score-functions)
         scored-new-elite (scoring/update-scores new-elite score-functions)
         evolved-zg (assoc (assoc zeitgeist :rabble scored-transformed-rabble) :elite scored-new-elite)
+        _ (reset! latest evolved-zg)
         end-time (System/currentTimeMillis)
         ;; track generation number
         final-zg (update-in evolved-zg [:age] (fn [x] (if (nil? x) 0 (inc x))))


support multiple database types

support multiple database types

--- src/lib_onyx/migrations/sql.clj
+++ src/lib_onyx/migrations/sql.clj
@@ -30,13 +30,30 @@
 (def joplin-migrations
   {:lifecycle/start-task? no-pending-migrations?})

+                                        ;((comp #{:f} :type) {:type})
+(def supported-plugins
+  (s/enum :jdbc :sql :es :zk :dt :cass))
+
 (def JoplinDatabaseDescriptor
-  {:type (s/enum :jdbc :sql :es :zk :dt :cass :dynamo)
-   (s/optional-key :url) s/Str
-   (s/optional-key :host) s/Str
-   (s/optional-key :port) s/Str
-   (s/optional-key :cluster) s/Str
-   (s/optional-key :migrations-table) s/Str})
+  (s/conditional
+   (comp #{:sql}    :type) {:type supported-plugins
+                            :url s/Str
+                            (s/optional-key :migrations-table) s/Str}
+   (comp #{:jdbc}   :type) {:type supported-plugins
+                            :url s/Str
+                            (s/optional-key :migrations-table) s/Str}
+   (comp #{:es}     :type) {:type supported-plugins
+                            :host s/Str :port s/Num
+                            (s/optional-key :migrations-index) s/Str}
+   (comp #{:zk}     :type) {:type supported-plugins
+                            :host s/Str
+                            :port s/Num
+                            :client (s/enum :curator :exhibitor)}
+   (comp #{:dt}     :type) {:type supported-plugins
+                            :host s/Str}
+   (comp #{:cass}   :type) {:type supported-plugins
+                            :hosts s/Str
+                            :keyspace s/Str}))

 (def JoplinConfigSchema
   {(s/optional-key :databases) {s/Any JoplinDatabaseDescriptor}


add indices to "medium" grammar

add indices to "medium" grammar

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -32,6 +32,25 @@
         (map (fn [path]
                [path (map-subset-by-path lexicon path)])
              index-lexicon-on-paths)))
+
+(defn lookup-spec [spec indices]
+  (log/debug (str "index-fn called with spec: "
+                  (strip-refs
+                   (dissoc (strip-refs spec)
+                           :dag_unify.core/serialized))))
+  (let [result
+        (reduce intersection-with-identity
+                (filter #(not (empty? %))
+                        (map (fn [path]
+                               (let [result
+                                     (get (get indices path)
+                                          (get-in spec path ::undefined))]
+                                 (log/trace (str "subset for path:" path " => " (get-in spec path ::undefined)
+                                                 " = " (count result)))
+                                 result))
+                             index-lexicon-on-paths)))]
+    (log/debug (str "indexed size returned: " (count result)))
+    result))

 (defn fo-ps [expr]
   (parse/fo-ps expr fo))
@@ -652,7 +671,8 @@
                      (= (:rule %) "s-imperfect-nonphrasal")
                      (= (:rule %) "s-aux")
                      (= (:rule %) "vp-32")
-                     (= (:rule %) "vp-aux")
+                     (= (:rule %) "vp-aux-nonphrasal-complement")
+                     (= (:rule %) "vp-aux-phrasal-complement")
                      (= (:rule %) "vp-aux-22")
                      (= (:rule %) "vp-present")
                      (= (:rule %) "vp-pronoun-nonphrasal")
@@ -700,8 +720,13 @@
                                 v)]
                   (if (not (empty? filtered-v))
                     [k filtered-v]))))
-        lexicon-for-generation (lexicon-for-generation lexicon)]
-    {:name "small"
+        lexicon-for-generation (lexicon-for-generation lexicon)
+
+        indices (create-indices lexicon-for-generation)]
+
+    {:index-fn (fn [spec] (lookup-spec spec indices))
+
+     :name "small"
      :morph-walk-tree (fn [tree]
                         (do
                           (merge tree
@@ -760,25 +785,6 @@
     (log/debug (str "micro lexicon size:" (count (keys micro-lexicon))))
     (clojure.core/merge small
                         {:lexicon micro-lexicon})))
-
-(defn lookup-spec [spec indices]
-  (log/debug (str "index-fn called with spec: "
-                  (strip-refs
-                   (dissoc (strip-refs spec)
-                           :dag_unify.core/serialized))))
-  (let [result
-        (reduce intersection-with-identity
-                (filter #(not (empty? %))
-                        (map (fn [path]
-                               (let [result
-                                     (get (get indices path)
-                                          (get-in spec path ::undefined))]
-                                 (log/trace (str "subset for path:" path " => " (get-in spec path ::undefined)
-                                                 " = " (count result)))
-                                 result))
-                             index-lexicon-on-paths)))]
-    (log/debug (str "indexed size returned: " (count result)))
-    result))

 (defn medium []
   (deliver-lexicon)
@@ -808,10 +814,10 @@
         ;; indices from paths to subsets of the lexicon
         indices (create-indices lexicon-for-generation)]

-    {:name "medium"
+    {:index-fn (fn [spec] (lookup-spec spec indices))
+     :name "medium"
      :generate {:lexicon lexicon-for-generation}
      :grammar grammar
-     :index-fn (fn [spec] (lookup-spec spec indices))
      :language "it"
      :language-keyword :italiano
      :lexical-cache (atom (cache/fifo-cache-factory {} :threshold 1024))


making [:path :value] => subset(lexicon) more maintainable

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -799,7 +799,13 @@
         aux2lex (map-subset-by-path lexicon-for-generation [:synsem :aux])
         pred2lex (map-subset-by-path lexicon-for-generation [:synsem :sem :pred])
         cat2lex (map-subset-by-path lexicon-for-generation [:synsem :cat])
-        it2lex (map-subset-by-path lexicon-for-generation [:italiano :italiano])]
+
+        indices
+        (into {}
+              (map (fn [path]
+                     [path (map-subset-by-path lexicon-for-generation path)])
+                   [[:italiano :italiano]]))]
+
     {:name "medium"
      :generate {:lexicon lexicon-for-generation}
      :grammar grammar
@@ -814,9 +820,6 @@
                      (log/debug (str "cat2lex: " (count
                                                   (get cat2lex (get-in spec [:synsem :cat]
                                                                        ::undefined)))))
-                     (log/debug (str "it2lex: " (count
-                                                 (get it2lex (get-in spec [:italiano :italiano]
-                                                                     ::undefined)))))
                      (log/debug (str "pred2lex: " (count
                                                    (get pred2lex (get-in spec [:synsem :sem :pred]
                                                                          ::undefined)))))
@@ -838,11 +841,15 @@
                      (let [result
                            (reduce intersection-with-identity
                                    (filter #(not (empty? %))
-                                           [(get it2lex (get-in spec [:italiano :italiano] ::undefined))
-                                            (get pred2lex (get-in spec [:synsem :sem :pred] ::undefined))
-                                            (get aux2lex (get-in spec [:synsem :aux] ::undefined))
-                                            (get cat2lex (get-in spec [:synsem :cat] ::undefined))
-                                            ]))]
+                                           (concat
+                                            (map (fn [path]
+                                                   (get (get indices path)
+                                                        (get-in spec path ::undefined)))
+                                                 [[:italiano :italiano]])
+                                            [(get pred2lex (get-in spec [:synsem :sem :pred] ::undefined))
+                                             (get aux2lex (get-in spec [:synsem :aux] ::undefined))
+                                             (get cat2lex (get-in spec [:synsem :cat] ::undefined))
+                                             ])))]
                        (log/debug (str "indexed size returned: " (count result)))
                        result)))


whitespace

whitespace

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -168,7 +168,6 @@
       ;; </noun default rules>

       ;; <verb default rules>
-
       (default (let [cat (atom :verb)
                      agr (atom :top)
                      essere (atom :top)


remove last use of (atom )s within italian lexicon

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -48,7 +48,12 @@
         intransitive-unspecified-obj it-pos/intransitive-unspecified-obj
         masculine-noun it-pos/masculine-noun
         non-comparative-adjective it-pos/non-comparative-adjective
-
+        pred-is-obj-pred (let [obj (atom :top)
+                               pred (atom :top)]
+                           {:synsem {:sem {:obj obj
+                                           :pred pred}
+                                     :subcat {:2 {:sem {:obj obj
+                                                        :pred pred}}}}})
         preposition (let [shared (atom :top)]
                       {:synsem {:cat :prep
                                 :sem {:obj shared}
@@ -76,6 +81,10 @@
                            :subcat {:3 {:sem {:obj subject-semantics}}}}}))

         sentential-adverb it-pos/sentential-adverb
+        subj-obj-humanness
+        (let [human (atom :top)]
+          {:synsem {:sem {:subj {:human human}
+                          :obj {:human human}}}})
         transitive it-pos/transitive
         verb-aux it-pos/verb-aux
         verb-subjective it-pos/verb-subjective]
@@ -997,23 +1006,16 @@
                                       :2 '()}}}}}

       ;; essere: prepositional phrase
-      (let [obj (atom {:pred :top
-                       :place true})
-            pred (atom :top)]
-        {:unify [essere-common]
-         :notes "essere-prepositional-phrase"
-         :synsem {:cat :verb
-                  :aux false
-                  :sem {:pred pred
-                        :obj obj}
-                  ;; TODO: should not need agreement: should be covered by
-                  ;; essere-common.
-                  :subcat {:1 {:cat :noun}
-                           :2 {:cat :prep
-                               :subcat '()
-                               :sem {:pred pred
-                                     :obj obj}}
-                           :3 '()}}})
+      {:unify [essere-common pred-is-obj-pred]
+       :notes "essere-prepositional-phrase"
+       :synsem {:cat :verb
+                :aux false
+                :sem {:obj {:place true}}
+                ;; TODO: should not need agreement: should be covered by
+                ;; essere-common.
+                :subcat {:1 {:cat :noun}
+                         :2 {:cat :prep}
+                         :3 '()}}}

       ;; TODO: do we need this? maybe remove?
       {:unify [essere-common]
@@ -1021,25 +1023,16 @@
        :synsem {:sem {:pred :be}}}

       ;; essere: copula ;; note that we don't enforce agreement the same here as we do in essere-adjective: TODO: try to make more consistent.
-      (let [gender (atom :top)
-            number (atom :top)
-            human (atom :top)]
-        {:unify [transitive essere-common]
-         :notes "copula" ;; significant only for debugging.
-         :synsem {:cat :verb
-                  :subcat {:1 {:cat :noun
-                               :agr {:gender gender
-                                     :number number}}
-                           :2 {:cat :noun
-                               :pronoun {:not true} ;; accusative pronouns cause unbounded depth-first searches on the subject side. (TODO: not sure if this problem is still present)
-                               :def {:not :demonstrativo}
-                               :agr {:gender gender
-                                     :number number}}}
-                  :sem {:pred :be
-                        :activity false
-                        :discrete false
-                        :subj {:human human}
-                        :obj {:human human}}}})
+      {:unify [transitive essere-common gender-and-number-agreement-1 subj-obj-humanness]
+       :notes "copula" ;; significant only for debugging.
+       :synsem {:cat :verb
+                :subcat {:1 {:cat :noun}
+                         :2 {:cat :noun
+                             :pronoun {:not true} ;; accusative pronouns cause unbounded depth-first searches on the subject side. (TODO: not sure if this problem is still present)
+                             :def {:not :demonstrativo}}}
+                :sem {:pred :be
+                      :activity false
+                      :discrete false}}}

       ;; essere: intensifier
       ;; this is for e.g "essere più alto di quelle donne belle (to be taller than those beautiful women)"


a verb's second argument case is accusative

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -132,6 +132,11 @@
                  :subcat {:1 {:cat :noun
                               :case :nom}}}})

+      (default ;; a verb's second argument's case is accusative.
+       {:synsem {:cat :verb
+                 :subcat {:2 {:cat :noun
+                              :case :acc}}}})
+
       (default ;;  a verb's first argument is the semantic subject of the verb.
        (let [subject-semantics (atom :top)]
          {:synsem {:cat :verb


Make sure title and publisher are never empty when creating an iso

otherwise mkisofs will fail

--- src/mdr2/archive.clj
+++ src/mdr2/archive.clj
@@ -99,7 +99,9 @@
 (defn create-iso
   "Pack a production in an iso file.
 Return a map with an additional key `iso-path` where the iso is located"
-  [{:keys [encoded-path title publisher] :as production}]
+  [{:keys [encoded-path title publisher]
+    :or {title "FIXME:" publisher "FIXME:"} ; title and publisher shouldn't be empty
+    :as production}]
   (let [iso-path (.getPath (file (fs/tmpdir) (fs/temp-name "mdr2" ".iso")))]
     (sh "genisoimage"
         "-quiet"


Added support for serving up a byte array. Useful for dealing with mail attachments.

--- src/appengine_magic/servlet.clj
+++ src/appengine_magic/servlet.clj
@@ -10,7 +10,7 @@

 (ns appengine-magic.servlet
   (:use [appengine-magic.utils :only [copy-stream]])
-  (:import [java.io File FileInputStream InputStream OutputStream]
+  (:import [java.io File FileInputStream InputStream ByteArrayInputStream OutputStream]
            [javax.servlet.http HttpServlet HttpServletRequest HttpServletResponse]))

@@ -74,26 +74,37 @@

 (defn- set-response-body [^HttpServletResponse response, body]
-  (cond (string? body)
-          (with-open [writer (.getWriter response)]
-            (.println writer body))
-        (seq? body)
-          (with-open [writer (.getWriter response)]
-            (doseq [chunk body]
-              (.print writer (str chunk))
-              (.flush writer)))
-        (instance? InputStream body)
-          (let [^InputStream b body]
-            (with-open [out (.getOutputStream response)]
-              (copy-stream b out)
-              (.close b)
-              (.flush out)))
-        (instance? File body)
-          (let [^File f body]
-            (with-open [stream (FileInputStream. f)]
-              (set-response-body response stream)))
-        (nil? body) nil
-        :else (throw (RuntimeException. (str "handler response body unknown" body)))))
+  (cond
+   ;; just a string
+   (string? body)
+   (with-open [writer (.getWriter response)]
+     (.println writer body))
+   ;; any Clojure seq
+   (seq? body)
+   (with-open [writer (.getWriter response)]
+     (doseq [chunk body]
+       (.print writer (str chunk))
+       (.flush writer)))
+   ;; a Java InputStream
+   (instance? InputStream body)
+   (let [^InputStream b body]
+     (with-open [out (.getOutputStream response)]
+       (copy-stream b out)
+       (.close b)
+       (.flush out)))
+   ;; serve up a File
+   (instance? File body)
+   (let [^File f body]
+     (with-open [stream (FileInputStream. f)]
+       (set-response-body response stream)))
+   ;; serve up a byte array
+   (instance? (class (.getBytes "")) body)
+   (with-open [in (ByteArrayInputStream. body)]
+     (set-response-body response in))
+   ;; nothing
+   (nil? body) nil
+   ;; unknown
+   :else (throw (RuntimeException. (str "handler response body unknown" body)))))

 (defn- adapt-servlet-response [^HttpServletResponse response,


Remove unused require

Remove unused require

--- src/asciinema/player/source.cljs
+++ src/asciinema/player/source.cljs
@@ -2,7 +2,6 @@
   (:refer-clojure :exclude [js->clj])
   (:require [cljs.core.async :refer [chan >! <! put! close! timeout poll!]]
             [goog.net.XhrIo :as xhr]
-            [schema.core :as s]
             [asciinema.player.format.asciicast-v0 :as v0]
             [asciinema.player.format.asciicast-v1 :as v1]
             [asciinema.player.frames :as f]


(TK-168) document decision to keep jmx enabled by default

--- src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
@@ -74,13 +74,20 @@
 (def default-protocols ["TLSv1" "TLSv1.1" "TLSv1.2"])
 (def default-client-auth :need)

+;;;
+;;; JMX
+;;;
+;;; The JMX metrics seem valuable enough, and inexpensive enough, to warrant
+;;; leaving them on by default.
+(def default-jmx-enable "true")
+

 ;; TODO: these two need to be addressed in our upcoming work around
 ;; acceptors/selectors.  See TK-148.
 (def default-max-threads 100)
 (def default-queue-max-size (Integer/MAX_VALUE))

-(def default-jmx-enable "true")
+
 (def default-request-header-buffer-size 8192)
 (def default-request-header-size 8192)


Suppress back-up-seed prompt when already done

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/privacy_and_security_settings/views.cljs
+++ src/status_im/ui/screens/privacy_and_security_settings/views.cljs
@@ -19,14 +19,15 @@
    {:type                    :small
     :title                   :t/back-up-seed-phrase
     :accessibility-label     :back-up-recovery-phrase-button
+    :disabled?               (not show-backup-seed?)
     ;; TODO - remove container bottom margin
     ;; when items below are implemented
     :container-margin-bottom 8
     :on-press
     #(re-frame/dispatch [:navigate-to :backup-seed])
     :accessories
-    [(when show-backup-seed? [components.common/counter {:size 22} 1])
-     :chevron]}
+    (when show-backup-seed? [[components.common/counter {:size 22} 1]
+                             :chevron])}
    {:type                    :small
     :title                   (str (i18n/label :t/lock-app-with) " " (biometric/get-label supported-biometric-auth))
     :container-margin-bottom 8


replace {:infl :past} with {:infl :passato}

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -482,7 +482,7 @@
                                            :subcat {:2 {:sem {:top :top}}}}}
                            :synsem {:aux false
                                     :sem {:obj {:top :top}}
-                                    :infl :past
+                                    :infl :passato
                                     :cat :verb}}
                           vp-non-pronoun)

@@ -503,7 +503,7 @@
                                             :pronoun true}}
                             :rule "vp-pronoun-phrasal"
                             :synsem {:cat :verb
-                                     :infl {:not :past}}})
+                                     :infl {:not :passato}}})

                    ;; Note {:reflexive true} below: for now, we are trying to
                    ;; only generate reflexive sentences (e.g. "io mi alzo") and not transitive
@@ -522,7 +522,7 @@
                                             :pronoun true}}
                             :rule "vp-pronoun-nonphrasal"
                             :synsem {:cat :verb
-                                     :infl {:not :past}}})
+                                     :infl {:not :passato}}})

                    ;; e.g. used as: "io mi chiamo Luisa" -
                    ;; [s-present-phrasal 'io' [vp-pronoun-phrasal 'mi' [vp-32 'chiamo' 'Luisa']]]
@@ -532,7 +532,7 @@
                             :head {:phrasal false
                                    :synsem {:aux false}}
                             :synsem {:aux false
-                                     :infl {:not :past}
+                                     :infl {:not :passato}
                                      :cat :verb}})
                    (unify h10
                            root-is-comp


Argument naming consistency

Argument naming consistency

--- src/caesium/crypto/secretbox.clj
+++ src/caesium/crypto/secretbox.clj
@@ -61,8 +61,8 @@
   "Backwards-compatible alias for [[secretbox-easy]].

   Please note that this uses a different argument order."
-  [key nonce plaintext]
-  (secretbox-easy plaintext nonce key))
+  [key nonce msg]
+  (secretbox-easy msg nonce key))

 (defn decrypt
   "Backwards-compatible alias for [[secretbox-open-easy]].