WIP for symbol guarding, totally untested

--- src/seathree/data.clj
+++ src/seathree/data.clj
@@ -99,7 +99,61 @@
   (let [data (json/parse-string (:body response) true)]
     (:translatedText (first (:translations (:data data))))))

-
+(defn mk-sigil
+    "
+    Create a sigil used to replace Twitter symbols like
+    @replies. Necessary to preserve symbols across trips to
+    google. Also cuts down on google character usage. Got to save
+    dollars.
+
+    Takes an int, returns a string like `xz0`.
+    "
+    [c]
+    (format "XZ%d" c))
+
+(defn mark-sigils
+    "Replace special forms within a tweet with ordered sigils so
+    they can be restored later. For example,
+
+    Este cerveza esta sabrosa #cerveza http://bit.ly/foo @friend
+
+    will be transformed into
+
+    Este cerveza esta sabrosa XZ1 XZ2 XZ3
+
+    (these will be later reconstructed).
+
+    Returns a tuple of a marked string and a listing of symbols that
+    were replaced with sigils."
+    [raw-text]
+    (let [symbol-re #"(\@\w+|http:\/\/[^ ]+|\#\w+)"
+          symbols   (re-seq symbol-re raw-text)]
+      (loop [c           0
+             marked-text raw-text
+             ss          symbols]
+        (if (empty? ss)
+          marked-text
+          (recur (inc c)
+                 (str/replace marked-text (first ss) (mk-sigl c))
+                 (rest ss))))))
+
+(defn restore-sigils
+    "
+    Restore a list of symbols to their placeholders. Accepts the
+    output of `mark-sigils`.
+    "
+    [marked-text symbols]
+    (loop [c             0
+           restored-text marked-text
+           ss            symbols]
+      (if (empty? ss)
+        restored-text
+        (recur (inc c)
+               (str/replace restored-text (mk-sigil c) (first ss))
+               (rest ss)))))
+
+;; TODO TEST SIGILS, USE SIGILS
+
 (defn translate
   "Given a user-data map and a single tweet's text, make a GET request
    to the google translate API."


use toRatio to convert to ratios

use toRatio to convert to ratios

--- src/semitone/core.clj
+++ src/semitone/core.clj
@@ -23,6 +23,7 @@

 (ns semitone.core
   (:require [clojure.pprint :refer [pprint]]
+            [clojure.lang.Numbers :refer [toRatio]]
             [clojure.stacktrace :refer [print-stack-trace]]
             [incanter.interpolation :refer [interpolate-parametric]])
   (:import [javax.sound.midi
@@ -35,7 +36,7 @@
   (let [args (if (empty? args) '(:cubic) args)
         interp (apply interpolate-parametric values args)
         fix-type (cond
-                   (every? ratio? values) rationalize
+                   (every? ratio? values) toRatio
                    (every? integer? values) int
                    :else double)]
     (map #(fix-type (interp %)) (range 0 1 (/ 1.0 num-points)))))
@@ -260,6 +261,9 @@
            {:notes (vec-rest notes)})
           state)))))

+(defn get-channel [state]
+  (:ch state))
+
 (def ^:dynamic *seq* (Sequence. Sequence/PPQ 256))
 (def ^:dynamic *synth* (MidiSystem/getSynthesizer))

@@ -371,7 +375,7 @@
                               (.add track
                                     (MidiEvent. (ShortMessage.
                                                  (:message-type state)
-                                                 (:ch state)
+                                                 (get-channel state)
                                                  key
                                                  value)
                                                 (+ (:position state)
@@ -379,7 +383,7 @@
                             (when (and (= (:message-type state) ShortMessage/NOTE_ON) (not (= (:tie state) :begin)))
                               (.add track (MidiEvent. (ShortMessage.
                                                        ShortMessage/NOTE_OFF
-                                                       (:ch state)
+                                                       (get-channel state)
                                                        key
                                                        (:release state))
                                                       (max


removed some unused functions

removed some unused functions

--- src/server/rooms.cljs
+++ src/server/rooms.cljs
@@ -383,28 +383,6 @@
         (callback true)
         (callback false)))))

-(defn is-track-changing? [room callback]
-  (.get redis-client (str "room:" room ":changing-track?")
-    (fn [err reply]
-      (if (= reply "true")
-        (callback true)
-        (callback false)))))
-
-(defn start-changing-track [room callback]
-  (.eval redis-client "local room_id = ARGV[1] local track = redis.call('lrange', 'room:' .. room_id .. ':change-track-list', -1, -1)[1] if track ~= nil then redis.call('del', 'room:' .. room_id .. ':change-track-list') end return track"
-        0 "room"
-    (fn [err reply]
-      (if (= "true" reply)
-        (callback true)
-        (callback false)))))
-
-(defn stop-changing-track [room]
-  (.set redis-client (str "room:" room ":changing-track?") "false"))
-
-(defn delete-room [room]
-  (let [lua-command "local keys = redis.call('keys', ARGV[1]) \n for i=1,#keys,5000 do \n redis.call('del', unpack(keys, i, math.min(i+4999, #keys))) \n end \n return keys"]
-    (.eval redis-client lua-command 0 (str "room:" room ":*"))))
-
 (defn handle-disconnect [room callback]
   (let [lua-fn (.scriptWrap redis-lua "handleDisconnect")]
     (lua-fn 0 room


Unbreak tests.

Unbreak tests.

--- test/active/clojure/monad_test.cljc
+++ test/active/clojure/monad_test.cljc
@@ -19,7 +19,8 @@
                                                    run-monadic-swiss-army execute-monadic-swiss-army
                                                    monad-command-config-run-command
                                                    reify-command reify-as
-                                                   put-state-component!)])
+                                                   put-state-component!
+                                                   update-state-component!)])
             [active.clojure.condition :as c]
             #?(:clj [clojure.test :refer :all])
             #?(:cljs [cljs.test])))


oh, hey, we can serve react.js from local jar

which means losing the dependency on facebook/cloudflare

yay

--- src/sledge/server.clj
+++ src/sledge/server.clj
@@ -110,8 +110,7 @@

 (def scripts
-  {:dev [#_"http://fb.me/react-0.11.1.js",
-         "//cdnjs.cloudflare.com/ajax/libs/react/0.11.1/react.min.js"
+  {:dev ["/react/react.js"
          "out/goog/base.js"
          "out/main.js"]
    :production ["production-out/main.js"]


clearing empty filters

clearing empty filters

--- test/celestial/test/validations.clj
+++ test/celestial/test/validations.clj
@@ -36,7 +36,7 @@
      (validate-quota user-quota) => truthy
      (provided (user-exists? "foo") => true :times 1))

-(fact "non int limit quota" filters
+(fact "non int limit quota"
    (validate-quota (assoc-in user-quota [:quotas :dev :aws :limits :count] "1")) =>
       (throws ExceptionInfo (with-m? {:quotas {:dev {:aws {:limits {:count  "must be a integer"}}}}}))
    (provided (user-exists? "foo") => true :times 1))


Update core.clj

Update core.clj

--- src/tiny_clj/core.clj
+++ src/tiny_clj/core.clj
@@ -33,6 +33,9 @@
   (ANY "*" []
     (route/not-found (slurp (io/resource "404.html")))))

+(-> 1
+  (= 2))
+
 (defn -main [& [port]]
   (let [port (Integer. (or port (env :port) 5000))]
     (jetty/run-jetty (site #'app) {:port port :join? false})))


Actually set the right option for host key checking and disable checking


When creating an application, the repos are populated with default properties files.

--- src/tyranitar/git.clj
+++ src/tyranitar/git.clj
@@ -95,6 +95,8 @@
   [application env]
   (str application "-" env))

+(repo-name "test4" "dev")
+
 (defn- repo-url
   [repo-name]
   (str base-git-url repo-name))
@@ -263,29 +265,53 @@
     (when (not= status 200)
       (throw+ {:status status :message (:message (parse-string (:body response) true))}))))

-(defn copy-file
+(defn- copy-file
   [resource-name dest-path]
   (let [source (as-file (resource resource-name))
         dest (as-file dest-path)]
     (copy source dest)))

+(defn- copy-properties-file
+  [name repo-path]
+  (copy-file name (str repo-path "/" name)))
+
 (defn- write-default-properties
   [repo-name]
   (let [repo-path (repo-path repo-name)]
-    (copy-file "application-properties.json" "/tmp/wibble.json")))
+    (copy-properties-file "application-properties.json" repo-path)
+    (copy-properties-file "deployment-params.json" repo-path)
+    (copy-properties-file "launch-data.json" repo-path)))

 (defn- commit-and-push
-  [repo-name])
+  [repo-name]
+  (let [git (Git/open (as-file (repo-path repo-name)))
+        add (.add git)
+        commit (.commit git)
+        push (.push git)]
+    (->
+     add
+     (.addFilepattern ".")
+     (.call))
+    (->
+     commit
+     (.setAuthor "tyranitar" "noreply@nokia.com")
+     (.setMessage "Initial properties files.")
+     (.call))
+    (->
+     push
+     (.call))
+    ))
+
+(defn- create-application-env
+  [name env]
+  (let [repo-name (repo-name name env)]
+    (create-repository name env)
+    (clone-repo repo-name)
+    (write-default-properties repo-name)
+    (commit-and-push repo-name)
+    {:name repo-name :path (repo-url repo-name)}))

 (defn create-application
   [name]
-  (create-repository name "dev")
-  (create-repository name "prod")
-  (clone-repo (repo-name name "dev"))
-  (clone-repo (repo-name name "prod"))
-  (write-default-properties (repo-name name "dev"))
-  (write-default-properties (repo-name name "prod"))
-  (commit-and-push (repo-name name "dev"))
-  (commit-and-push (repo-name name "prod"))
-  {:repositories [(repo-name name "dev")
-                  (repo-name name "prod")]})
+  {:repositories [(create-application-env name "dev")
+                  (create-application-env name "prod")]})


Copy my improved versions of dasherize and camelize from cake

--- src/useful/string.clj
+++ src/useful/string.clj
@@ -1,17 +1,16 @@
 (ns useful.string
   (:use [clojure.string :only [join split capitalize]]))

-(defn camelize [s & [lower]]
-  (let [parts (split (str s) #"-|_")]
-    (apply str
-           (if lower
-             (cons (first parts) (map capitalize (rest parts)))
-             (map capitalize parts)))))
+(defn camelize [str]
+  (s/replace str
+             #"-(\w)"
+             (comp s/upper-case second))[s & [lower]])

-(defn dasherize [s]
-  (.. (re-matcher #"\B([A-Z])" (str s))
-      (replaceAll "-$1")
-      toLowerCase))
+(defn dasherize [name]
+  (s/replace name
+             #"(?<![A-Z])[A-Z]+"
+             (comp (partial str "-")
+                   s/lower-case)))

 (defn underscore [s]
   (.. (re-matcher #"\B([A-Z])" (str s))


earmuffed *fxn_defBlock_symbol* but shouldn't need to use binding to set it

--- src/util/funxions.clj
+++ src/util/funxions.clj
@@ -17,20 +17,37 @@
 (def exceptionThrownWhenRequiredParamsNotSpecified
   java.lang.RuntimeException)

-(def fxn_defBlock_symbol 'fxn_defBlock3)
-
-
-(defmacro get_fxn [sym namee]
+;you need not bind this though, unless you really want to name it something
+;but it won't clash with others, supposedly - there may be some case when it could clash let within a let
+(def ^:dynamic *fxn_defBlock_symbol* (gensym 'fxn_defBlock))
+
+
+(defmacro get_fxn
+"
+returns a macro that when called, evaluates the value of <the symbol returned by the symbol that you passed>
+=> (get_fxn *fxn_defBlock_symbol* defBlock)
+
+=> *fxn_defBlock_symbol*
+fxn_defBlock
+
+=> (macroexpand-1 '(get_fxn_defBlock))
+fxn_defBlock
+
+=> (get_fxn_defBlock)
+CompilerException java.lang.RuntimeException: Unable to resolve symbol: fxn_defBlock in this context, compiling:(NO_SOURCE_PATH:1:1)
+;so evaluates fxn_defBlock in current context, ie. not like (eval fxn_defBlock) which wouldn't see those inside the let
+"
+  [sym namee]
   `(defmacro ~(symbol (str "get_fxn_" namee)) []
-     ~sym ;actually this is good here, i don't need the `~fxn_defBlock_symbol variant which seems to be the same thing O_o
+     ~sym ;actually this is good here, i don't need the `~*fxn_defBlock_symbol* variant which seems to be the same thing O_o
      )
   )

-(get_fxn fxn_defBlock_symbol defBlock)
+(get_fxn *fxn_defBlock_symbol* defBlock) ;(defmacro get_fxn_defBlock ...)
 ;(defmacro get_fxn_defBlock2
 ;  []
-;  ;like get the value of the symbol returned by fxn_defBlock_symbol
-;  `~fxn_defBlock_symbol
+;  ;like get the value of <the symbol returned by *fxn_defBlock_symbol*>
+;  `~*fxn_defBlock_symbol*
 ;  )
 ;=> (macroexpand-1 '(get_fxn_defBlock))
 ;fxn_defBlock3
@@ -38,12 +55,12 @@
 ;fxn_defBlock3
 ;=> (clojure.tools.macro/mexpand-all '(defmacro get_fxn_defBlock2
 ;     []
-;     ;like get the value of the symbol returned by fxn_defBlock_symbol
-;     `~fxn_defBlock_symbol
+;     ;like get the value of the symbol returned by *fxn_defBlock_symbol*
+;     `~*fxn_defBlock_symbol*
 ;     ))
-;(do (def get_fxn_defBlock2 (fn* ([&form &env] fxn_defBlock_symbol))) (. (var get_fxn_defBlock2) (setMacro)) (var get_fxn_defBlock2))
-;=> (clojure.tools.macro/mexpand-all '(get_fxn fxn_defBlock_symbol defBlock))
-;(do (def get_fxn_defBlock (fn* ([&form &env] fxn_defBlock_symbol))) (. (var get_fxn_defBlock) (setMacro)) (var get_fxn_defBlock))
+;(do (def get_fxn_defBlock2 (fn* ([&form &env] *fxn_defBlock_symbol*))) (. (var get_fxn_defBlock2) (setMacro)) (var get_fxn_defBlock2))
+;=> (clojure.tools.macro/mexpand-all '(get_fxn *fxn_defBlock_symbol* defBlock))
+;(do (def get_fxn_defBlock (fn* ([&form &env] *fxn_defBlock_symbol*))) (. (var get_fxn_defBlock) (setMacro)) (var get_fxn_defBlock))

@@ -62,12 +79,12 @@
     ;(println x); x == `'~x
     ;(println e)
     `(defn ~fname [& all#]
-       (let [~fxn_defBlock_symbol '~x
+       (let [~*fxn_defBlock_symbol* '~x
              ~'fxn_rawDefBlock '~passedDefBlock
              ;~'fxn_evalled ~e
              ]
          ;(clojure.pprint/pprint (list "fxn_rawDefBlock" ~'fxn_rawDefBlock))
-         (clojure.pprint/pprint (list ~'fxn_defBlock_symbol ~fxn_defBlock_symbol));symbol and its value
+         (clojure.pprint/pprint (list ~'*fxn_defBlock_symbol* ~*fxn_defBlock_symbol*));symbol and its value
          ;(println ~e)
          ~@codeblocks
          (= (~(:c x) ~(:d x))
@@ -211,10 +228,13 @@
              :d a ;"a" has to be resolvable in current ns where defxn is called and it will point to the same a, thus not be relative to *ns* once defxn executed
              :e ~(list partial > 1)
              }
-  (println "!!!" (eval fxn_defBlock2))
+  (println "!!!" (get_fxn_defBlock))
 ;  (:b fxn_defBlock)
 ;  (:c fxn_defBlock)
   )
 (println (noes))
 (def a 1)
 (println (noes))
+(binding [*fxn_defBlock_symbol* 'abc]
+  (println *fxn_defBlock_symbol*)
+  (noes))


sync directories before returning from set-env!

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -104,7 +104,8 @@
     (map get-env)
     (apply set/union)
     (watch-dirs (fn [_] (sync-user-dirs!)))
-    (reset! src-watcher)))
+    (reset! src-watcher))
+  (sync-user-dirs!))

 (defn- do-cleanup!
   []


Minor renames on rstore impl.

Minor renames on rstore impl.

--- src/uxbox/rstore.cljs
+++ src/uxbox/rstore.cljs
@@ -66,7 +66,7 @@
   ([event & events]
    (run! #(rx/push! bus %) (into [event] events))))

-(defn swap-state
+(defn swap
   "A helper for just apply some function to state
   without a need to declare additional event."
   [f]
@@ -75,7 +75,7 @@
     (-apply-update [_ state]
       (f state))))

-(defn reset-state
+(defn reset
   "A event that resets the internal state with
   the provided value."
   [state]
@@ -83,6 +83,8 @@
     UpdateEvent
     (-apply-update [_ _]
       state)))
+
+(enable-console-print!)

 (defn init
   "Initializes the stream event loop and
@@ -108,5 +110,5 @@
       (rx/subscribe $ (fn [[event model]] (-apply-effect event model))))

     ;; Initialize the stream machinary with initial state.
-    (emit! (swap-state (fn [s] (merge s state))))
+    (emit! (swap #(merge % state)))
     state-s))


Enable security headers

Enable security headers

--- src/yada/resource.clj
+++ src/yada/resource.clj
@@ -76,7 +76,7 @@
    i/get-new-properties
    i/compute-etag
    sec/access-control-headers
-   #_sec/security-headers
+   sec/security-headers
    i/create-response
    i/logging
    i/return


Nice function names for collection checkers won't work in 1.3

--- test/midje/checkers/t_collection.clj
+++ test/midje/checkers/t_collection.clj
@@ -377,8 +377,10 @@
   => (contains {:actual {:a 1} :notes (just #"Expected two elements.*one")})
   (chatty-falsehood-to-map ( (contains {:a {:b 1}}) {:a 1}) )
   => (contains {:actual {:a 1} :notes (just "Best match found: {}.")})
+
+  ;; Won't work in Clojure 1.3 without some major rework.
   (chatty-falsehood-to-map ( (contains {:a odd?, :f odd? :g odd?}) {:f 3, :g 6, :a 1}) )
-  => (contains {:actual {:f 3, :g 6, :a 1}
+  =future=> (contains {:actual {:f 3, :g 6, :a 1}
                 :notes (just [#"Best match found: \{:a 1, :f 3\}\."
                               #"It matched: \{:a odd\?, :f odd\?\}\."])})
   (chatty-falsehood-to-map ( (contains :a)        {:a 1}))


WIP: Fixing tests: Renamed to right keyword name

--- test/freecoin/journey/sign_in.clj
+++ test/freecoin/journey/sign_in.clj
@@ -74,7 +74,7 @@
                  (kc/check-page-is :sign-in [ks/auth-form-problems])))

        (fact "Activate account using link"
-             (let [activation-url (-> @emails (first) :activation-url)
+             (let [activation-url (-> @emails (first) :activation-link)
                    activation-id (-> activation-url (clojure.string/split #"/") (last))]
                (-> (k/session test-app)
                    (k/visit (routes/absolute-path :activate-account


minor scratch changes

minor scratch changes

--- dev/user.clj
+++ dev/user.clj
@@ -4,7 +4,7 @@
             [reloaded.repl :refer [system init start stop go reset]]
             [com.stuartsierra.component :as component]
             [tictag.config :refer [config]]
-            [tictag.server :as server]
+            [tictag.server :as server :refer [evaluate]]
             [tictag.db :as db]
             [tictag.beeminder :as bm]
             [tictag.system]
@@ -15,13 +15,15 @@
             [ragtime.repl :refer [migrate rollback]]
             [clojure.repl :refer [doc]]
             [honeysql.core :as sql]
-            [honeysql.helpers :refer :all]
+            [honeysql.helpers :refer [insert-into values limit where from select join]]
             [honeysql-postgres.format :refer :all]
-            [honeysql-postgres.helpers :refer :all]
+            [honeysql-postgres.helpers :refer [upsert do-nothing on-conflict do-update-set]]
             [clojure.java.jdbc :as j]
             [tictag.crypto :as crypto]
             [environ.core :refer [env]]
-            [figwheel-sidecar.repl-api]))
+            [figwheel-sidecar.repl-api]
+            [instaparse.core :as insta]))
+

 (defn cljs-repl []
   (do (figwheel-sidecar.repl-api/stop-figwheel!)
@@ -38,11 +40,11 @@

 (reloaded.repl/set-init! #(tictag.system/system config))

-(defn dev-user [] (db/get-user (:db system) "TEST_USER"))
+(defn dev-user [] (db/get-user (:db system) "test"))

 (def my-user-id (-> (select :id)
                     (from :users)
-                    (where [:= :username "TEST_USER"])
+                    (where [:= :username "test"])
                     (limit 1)))

 (def my-beeminder-id (-> (select :beeminder.id)
@@ -53,9 +55,9 @@
   (j/with-db-transaction [tx (-> system :db :db)]
     (j/execute! tx
                 (-> (insert-into :users)
-                    (values [{:username "TEST_USER"
+                    (values [{:username "test"
                               :email    "tictag-test@agh.io"
-                              :pass     (db/hashp "foobar")
+                              :pass     (db/hashp "test")
                               :tz       "America/Los_Angeles"}])
                     (upsert (-> (on-conflict :username)
                                 (do-nothing)))
@@ -95,3 +97,7 @@
                     (upsert (-> (on-conflict :beeminder_id :goal)
                                 (do-nothing)))
                     sql/format))))
+
+(def p (insta/parser (clojure.java.io/resource "parser.bnf")))
+(defn e [v] (evaluate {:db (:db system) :user (dev-user)} v))
+


Cleans up user ns.

Cleans up user ns.

--- dev/user.clj
+++ dev/user.clj
@@ -5,13 +5,11 @@
             [tumblr-identity-manager.camel-kebab :as ck]
             [tumblr-identity-manager.data :as data]
             [tumblr-identity-manager.utility :as util]
-            [tumblr-identity-manager.camel-kebab :as ck]
             [clojure.core.memoize :as memo]
             [clojure.pprint :refer [pp pprint]]
             [clojure.repl :refer [doc]]
             [clojure.tools.namespace.repl :as repl]
-            [ring.adapter.jetty :as jetty])
-  (:import [org.eclipse.jetty.servlet ServletHolder ServletContextHandler FilterHolder]))
+            [ring.adapter.jetty :as jetty]))

 ;; Global Var that holds the server.
 (def server nil)
@@ -19,22 +17,19 @@
 (defn boot
   "Run this to start the server from the REPL."
   ([join?]
-     (alter-var-root
-      #'server
-      (constantly
-       (jetty/run-jetty
-        #'handler/app
-        {:join? join?
-         :port  3000
-         :ssl?  false}))))
+   (alter-var-root
+    #'server (constantly
+              (jetty/run-jetty #'handler/app
+                               {:join? join?
+                                :port  3000
+                                :ssl?  false}))))
   ([] (boot false)))

 (defn restart
   "Restart the Jetty server." []
   (if (nil? server) (boot)
-      (do
-        (when (= (org.eclipse.jetty.server.Server/getState server) "STARTED")
-          (.stop server))
+      (do (when (= (org.eclipse.jetty.server.Server/getState server) "STARTED")
+            (.stop server))
         (.start server))))

 (defn refresh
@@ -51,7 +46,7 @@
 ;; production system for the average large data returning REST call.
 (defn data
   "Create n fake records and give them unique :_id values." [n]
-  (map #(assoc %1 :a %2)
+  (map #(assoc %1 :_id %2)
        (flatten (repeatedly (inc (/ n (count data/identities)))
                             (fn [] data/identities)))
        (range 1 (inc n))))


Remove stencil from dev/user.clj

Remove stencil from dev/user.clj

--- dev/user.clj
+++ dev/user.clj
@@ -7,11 +7,9 @@
             [environ.core :refer [env]]
             [cfpb.qu.main :as main]
             [cfpb.qu.data :as data :refer [ensure-mongo-connection]]
-            [cfpb.qu.loader :as loader :refer [load-dataset]]
-            stencil.loader))
+            [cfpb.qu.loader :as loader :refer [load-dataset]]))

 (set-refresh-dirs "src/" "dev/")
-(stencil.loader/set-cache (clojure.core.cache/ttl-cache-factory {} :ttl 0))

 (def server (atom nil))


solved problem 8

solved problem 8


Bumping version inorder to sign and publish to clojars

--- clients/clojure/project.clj
+++ clients/clojure/project.clj
@@ -1,4 +1,4 @@
-(defproject samsara/samsara-client "0.1.2"
+(defproject samsara/samsara-client "0.1.3"
   :description "Clojure SDK for Samsara"
   :url "http://samsara.github.io"
   :license {:name "Apache License 2.0"
@@ -14,7 +14,7 @@
   :plugins [[lein-pprint "1.1.1"]
             [lein-midje "3.1.3"]]
   :deploy-repositories[["clojars" {:url "https://clojars.org/repo/"
-                                   :sign-releases false}]]
+                                   :sign-releases true}]]
   :profiles {:uberjar {:aot :all}
              :dev {
                    :dependencies [[http-kit.fake "0.2.1"]


Add generator helper to dev mode

Add generator helper to dev mode

During development the execution of the site generator should be
easy.

--- dev/src/dev.clj
+++ dev/src/dev.clj
@@ -8,7 +8,8 @@
             [eftest.runner :as eftest]
             [integrant.core :as ig]
             [integrant.repl :refer [clear halt go init prep reset]]
-            [integrant.repl.state :refer [config system]]))
+            [integrant.repl.state :refer [config system]]
+            [schuleinzugsgebiete.component.site-generator :as gen]))

 (defn read-config []
   (duct/read-config
@@ -19,6 +20,11 @@
 (defn test []
   (eftest/run-tests (eftest/find-tests "test")))

+(defn generate-site
+  []
+  (let [gen (::gen/generator system)]
+    (gen)))
+
 (when (io/resource "local.clj")
   (load "local"))


Fixed namespace in test_html_renderer module

--- test/clouseau/test_html_renderer.clj
+++ test/clouseau/test_html_renderer.clj
@@ -36,7 +36,7 @@
 ;;; exception statement from your version.
 ;;;

-(ns clouseau.test-core
+(ns clouseau.test-html-renderer
   (:require [clojure.test :refer :all]
             [clouseau.html-renderer :refer :all]))


Tests for function get-started-on-str

Tests for function get-started-on-str

--- test/emender_jenkins/config_test.clj
+++ test/emender_jenkins/config_test.clj
@@ -461,6 +461,23 @@
             (get-prod-test-jobs-suffix {:configuration nil}) nil
             (get-prod-test-jobs-suffix nil) nil)))

+(deftest test-get-started-on-str-1
+    "Check the behaviour of function emender-jenkins.config/get-started-on-str."
+    (testing "the behaviour of function emender-jenkins.config/get-started-on-str."
+        (are [x y] (= x y)
+            (get-started-on-str {:configuration {:started-on nil}})   nil
+            (get-started-on-str {:configuration {:started-on false}}) false
+            (get-started-on-str {:configuration {:started-on true}})  true
+            (get-started-on-str {:configuration {:started-on "10:20:30"}}) "10:20:30")))
+
+(deftest test-get-started-on-str-2
+    "Check the behaviour of function emender-jenkins.config/get-started-on-str."
+    (testing "the behaviour of function emender-jenkins.config/get-started-on-str."
+        (are [x y] (= x y)
+            (get-started-on-str {:configuration {:started-on nil}}) nil
+            (get-started-on-str {:configuration nil})               nil
+            (get-started-on-str {:configuration nil})               nil)))
+
 (deftest test-override-options-by-cli-1
     "Check the behaviour of function emender-jenkins.config/override-options-by-cli."
     (testing "the behaviour of function emender-jenkins.config/override-options-by-cli."


Add docstrings for low level APIs

Add docstrings for low level APIs


Allow for interactive smoothing during gameplay


Lazy load Clojure shorthands

Lazy load Clojure shorthands

--- roles/clojure/files/profiles.clj
+++ roles/clojure/files/profiles.clj
@@ -30,20 +30,20 @@

         :shorthand {. [^:lazy alembic.still/distill
                        ^:lazy ^:macro alembic.still/lein
-                       clojure.java.shell/sh
-                       clojure.pprint/pprint
+                       ^:lazy clojure.java.shell/sh
+                       ^:lazy clojure.pprint/pprint
                        clojure.repl/apropos
                        clojure.repl/dir
                        clojure.repl/doc
                        clojure.repl/find-doc
                        clojure.repl/pst
                        clojure.repl/source
-                       clojure.test/run-all-tests
-                       clojure.test/run-tests
-                       clojure.tools.namespace.repl/refresh
-                       clojure.tools.namespace.repl/refresh-all
-                       criterium.core/bench
-                       criterium.core/quick-bench]}
+                       ^:lazy clojure.test/run-all-tests
+                       ^:lazy clojure.test/run-tests
+                       ^:lazy clojure.tools.namespace.repl/refresh
+                       ^:lazy clojure.tools.namespace.repl/refresh-all
+                       ^:lazy ^:macro criterium.core/bench
+                       ^:lazy ^:macro criterium.core/quick-bench]}

         :aliases {"slamhound" ["run" "-m" "slam.hound"]}
         :search-page-size 50}}


Add clojure.math.numeric-tower import into test ns

--- test/luaclj/core_test.clj
+++ test/luaclj/core_test.clj
@@ -1,6 +1,7 @@
 (ns luaclj.core-test
   (:require [clojure.test :refer :all]
-            [luaclj.util :refer [slurp-lua]]
+            [clojure.math.numeric-tower :as math]
+                       [luaclj.util :refer [slurp-lua]]
             [luaclj.library :refer :all]
             [luaclj.core :refer :all]))
 (comment


Fix description typo for mobile landing page

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -127,7 +127,7 @@
   (defroute v1-ios (FragmentRoute.  "/mobile/ios") {:as params}
     (open-to-outer! nav-ch :ios (assoc params
                                   :_title "Apple iOS App Testing"
-                                  :_description "Build 5-star iOS apps by automating your development workgflow with Mobile Continuous Integration and Delivery.")))
+                                  :_description "Build 5-star iOS apps by automating your development workflow with Mobile Continuous Integration and Delivery.")))

   (defroute v1-pricing (FragmentRoute. "/pricing") {:as params}
     (if authenticated?


Changed 'The Feed' back to 'Feed'

Changed 'The Feed' back to 'Feed'

--- src-cljs/rmfu_ui/welcome.cljs
+++ src-cljs/rmfu_ui/welcome.cljs
@@ -8,7 +8,7 @@
    [:div.row
     [:div.col-lg-12
      [:h1.text-center
-      [:a.feed-welcome-title {:on-click #(secretary/dispatch! "/")} "The Feed"]]
+      [:a.feed-welcome-title {:on-click #(secretary/dispatch! "/")} "Feed"]]
       [:p.text-center "Growing conversation and community with"]
      [:img.welcome-logo {:href "/#/feed" :src "/images/rmfu-logo.png"}]
      [:hr]


Clean up dependencies.

Clean up dependencies.

--- src/cavm/query/expression.clj
+++ src/cavm/query/expression.clj
@@ -1,8 +1,6 @@
 (ns cavm.query.expression
   (:require [clojure.edn :as edn])
-  (:require [clojure.walk :as walk])
-  (:refer-clojure :exclude  [eval])
-  (:gen-class))
+  (:refer-clojure :exclude  [eval]))

 (def eval)

@@ -24,11 +22,6 @@

 (def specialfns (set (vals specials)))

-(defn snoop [x]
-  (binding [*out* *err*]
-    (println x))
-  x)
-
 (defn fn-node [node scope]
   (let [func (eval (first node) scope)]
     (cond


cursive indent

cursive indent


changes order of failed response test (#1331)

--- waiter/integration/waiter/streaming_test.clj
+++ waiter/integration/waiter/streaming_test.clj
@@ -38,17 +38,6 @@
       (with-service-cleanup
         service-id

-        (testing "error response from waiter"
-          (let [request-cid (str service-name "-error")
-                headers (assoc headers
-                          :content-length body-size
-                          :content-type "application/octet-stream"
-                          :x-cid request-cid
-                          :x-waiter-cpus "bad-cpus")
-                response (make-kitchen-request waiter-url headers :body post-body :path "/streaming")]
-            (assert-response-status response http-400-bad-request)
-            (assert-waiter-response response)))
-
         (testing "successful proxying"
           (dotimes [n num-streaming-requests]
             (let [request-cid (str service-name "-iter" n)
@@ -86,7 +75,18 @@
               (str "response-size-histogram: " response-size-histogram))
           ;; all (canary and streaming) response sizes are logged
           (is (->> (get-in response-size-histogram [:value :1.0] 0.0) (- body-size) Math/abs (>= epsilon))
-              (str "response-size-histogram: " response-size-histogram)))))))
+              (str "response-size-histogram: " response-size-histogram)))
+
+        (testing "error response from waiter"
+          (let [request-cid (str service-name "-error")
+                headers (assoc headers
+                          :content-length body-size
+                          :content-type "application/octet-stream"
+                          :x-cid request-cid
+                          :x-waiter-cpus "bad-cpus")
+                response (make-kitchen-request waiter-url headers :body post-body :path "/streaming")]
+            (assert-response-status response http-400-bad-request)
+            (assert-waiter-response response)))))))

 (deftest ^:parallel ^:integration-fast test-large-request
   (testing-using-waiter-url


adds tolerance for delay in status updates for service status (#521)

--- waiter/integration/waiter/basic_test.clj
+++ waiter/integration/waiter/basic_test.clj
@@ -45,9 +45,7 @@
           (is (get-in service-settings [:instances :killed-instances])))

         (testing "status is reported"
-          (is (= "Running" (get service-settings :status)))))
-
-
+          (is (wait-for #(= "Running" (get service-settings :status)) :interval 2 :timeout 30))))

       (testing "explicitly specifying default parameter resolves to different service"
         (let [{:keys [service-description-defaults]} (waiter-settings waiter-url)
@@ -377,7 +375,7 @@
         (testing "without parameters"
           (let [service (service waiter-url service-id {})] ;; see my app as myself
             (is service)
-            (is (= "Running" (get service "status")))
+            (is (contains? #{"Running" "Starting"} (get service "status")))
             (is (-> (get service "last-request-time") du/str-to-date .getMillis pos?))
             (is (pos? (get-in service ["service-description" "cpus"])) service)))

@@ -385,21 +383,21 @@
           (let [run-as-user-param (->> current-user reverse (drop 2) (cons "*") reverse (str/join ""))
                 service (service waiter-url service-id {"run-as-user" run-as-user-param})] ;; see my app as myself
             (is service)
-            (is (= "Running" (get service "status")))
+            (is (contains? #{"Running" "Starting"} (get service "status")))
             (is (-> (get service "last-request-time") du/str-to-date .getMillis pos?))
             (is (pos? (get-in service ["service-description" "cpus"])) service)))

         (testing "waiter user disabled" ;; see my app as myself
           (let [service (service waiter-url service-id {"force" "false"})]
             (is service)
-            (is (= "Running" (get service "status")))
+            (is (contains? #{"Running" "Starting"} (get service "status")))
             (is (-> (get service "last-request-time") du/str-to-date .getMillis pos?))
             (is (pos? (get-in service ["service-description" "cpus"])) service)))

         (testing "waiter user disabled and same user" ;; see my app as myself
           (let [service (service waiter-url service-id {"force" "false", "run-as-user" current-user})]
             (is service)
-            (is (= "Running" (get service "status")))
+            (is (contains? #{"Running" "Starting"} (get service "status")))
             (is (-> (get service "last-request-time") du/str-to-date .getMillis pos?))
             (is (pos? (get-in service ["service-description" "cpus"])) service)))

@@ -430,7 +428,7 @@
         (testing "list-apps-with-waiter-user-disabled-and-see-another-app" ;; can see another user's app
           (let [service (service waiter-url service-id {"force" "false", "run-as-user" current-user})]
             (is service)
-            (is (= "Running" (get service "status")))
+            (is (contains? #{"Running" "Starting"} (get service "status")))
             (is (-> (get service "last-request-time") du/str-to-date .getMillis pos?))
             (is (pos? (get-in service ["service-description" "cpus"])) service)))
         (delete-service waiter-url service-id)))))


Make `new-fileset` public

Make `new-fileset` public

--- boot/core/src/boot/core.clj
+++ boot/core/src/boot/core.clj
@@ -70,7 +70,7 @@
   [key]
   (tmp/mkdir! @tmpregistry key))

-(def ^:private new-fileset
+(def new-fileset
   (memoize
     (fn []
       (boot.tmpdir.TmpFileSet. @tempdirs {} (tmp-dir* ::blob)))))


allow to premove both sides when movable = both

--- src/chessground/data.cljs
+++ src/chessground/data.cljs
@@ -48,10 +48,11 @@

 (defn premovable? [state orig]
   (when-let [piece (chess/get-piece (:chess state) orig)]
-    (and (-> state :premovable :enabled?)
-         (= (-> state :movable :color)
-            (-> state :turn-color common/opposite-color)
-            (:color piece)))))
+    (let [movable-color (-> state :movable :color)]
+      (and (-> state :premovable :enabled?)
+           (= (if (= movable-color "both") (:color piece) movable-color)
+              (-> state :turn-color common/opposite-color)
+              (:color piece))))))

 (defn can-move? [state orig dest]
   "The piece on orig can definitely be moved to dest"


extracting the project names and printing a mock-up of the code that would re-create the configuration that it has just read

--- src/cion_clojure/core.clj
+++ src/cion_clojure/core.clj
@@ -9,10 +9,21 @@
    :content-type "text/plain"
    :accept :xml}))

+(defn create-projects [project-names]
+	(map create-project project-names))
+
+(defn extract-name [node]
+	(:name (:attrs node)))
+
+(defn project-names-xml []
+	(parse-str (:body (client/get "http://ivan:password@localhost:8080/httpAuth/app/rest/projects/"))))
+
 (defn get-project-names []
-	(parse-str (:body (client/get "http://ivan:password@localhost:8080/httpAuth/app/rest/projects/"))))
-
+	(map extract-name (:content (project-names-xml))))
+
+(defn quoted [s]
+	(str "\"" s "\""))
+
 (defn -main [& args]
   (alter-var-root #'*read-eval* (constantly false))
-  (println "Hello, World!")
-  (get-project-names))
+  (println (str "(create-projects (list " (clojure.string/join " " (map quoted (get-project-names))) "))")))


CLJS-397 var reads in a :statement context get omitted

This is done so that google closure can optimize away unused deftypes.

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -213,7 +213,8 @@
         n (if (= (namespace n) "js")
             (name n)
             info)]
-    (emit-wrap env (emits (munge n)))))
+    (when-not (= :statement (:context env))
+      (emit-wrap env (emits (munge n))))))

 (defmethod emit :meta
   [{:keys [expr meta env]}]


* src/clj/cljs/compiler.clj: *cljs-file* -> ana/*cljs-file*

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -96,7 +96,7 @@
              (swap! *cljs-mappings*
                     (fn [lines]
                       (let [last (conj (peek lines)
-                                       (merge {:file *cljs-file*
+                                       (merge {:file ana/*cljs-file*
                                                :gcol @*cljs-gen-col*}
                                               (when m {:line (:line m)
                                                        :col (or (:col m) 0)


Cleaning up the emmission of max-fixed-arity and variadic. Refs #11

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -297,7 +297,7 @@
       (println (str "goog.exportSymbol('" export "', " name ");")))))

 (defn emit-fn-method
-  [{:keys [gthis name variadic params statements ret env recurs]}]
+  [{:keys [gthis name variadic params statements ret env recurs max-fixed-arity]}]
   (emit-wrap env
              (print (str "(function " name "(" (comma-sep
                                                 (if variadic
@@ -368,7 +368,7 @@
         (println "throw('Invalid arity: ' + arguments.length);")
         (println "};")
         (when variadic
-          (println (str name ".cljs$lang$maxFixedArity = " max-fixed-arity))
+          (println (str name ".cljs$lang$maxFixedArity = " max-fixed-arity ";"))
           (println (str name ".cljs$lang$applyTo = "
                         (with-out-str
                           (emit-apply-to
@@ -591,7 +591,7 @@
 (defn- analyze-fn-method [env locals meth]
   (let [params (first meth)
         fields (-> params meta ::fields)
-        variadic (some '#{&} params)
+        variadic (boolean (some '#{&} params))
         params (remove '#{&} params)
         fixed-arity (count (if variadic (butlast params) params))
         body (next meth)
@@ -601,7 +601,8 @@
         recur-frame {:names (vec (map munge params)) :flag (atom nil)}
         block (binding [*recur-frame* recur-frame]
                 (analyze-block (assoc env :context :return :locals locals) body))]
-    (merge {:env env :variadic variadic :params (map munge params) :fixed-arity fixed-arity :gthis gthis :recurs @(:flag recur-frame)} block)))
+
+    (merge {:env env :variadic variadic :params (map munge params) :max-fixed-arity fixed-arity :gthis gthis :recurs @(:flag recur-frame)} block)))

 (defmethod parse 'fn*
   [op env [_ & args] name]
@@ -615,8 +616,8 @@
         locals (if name (assoc locals name {:name mname}) locals)
         menv (if (> (count meths) 1) (assoc env :context :expr) env)
         methods (map #(analyze-fn-method menv locals %) meths)
-        max-fixed-arity (apply max (map :fixed-arity methods))
-        variadic (some :variadic methods)]
+        max-fixed-arity (apply max (map :max-fixed-arity methods))
+        variadic (boolean (some :variadic methods))]
     ;;(assert (= 1 (count methods)) "Arity overloading not yet supported")
     ;;todo - validate unique arities, at most one variadic, variadic takes max required args
     {:env env :op :fn :name mname :methods methods :variadic variadic


Do not escape forward slashes

Do not escape forward slashes

--- src/clj/cljs/compiler.clj
+++ src/clj/cljs/compiler.clj
@@ -161,7 +161,6 @@
       ; Handle printable escapes before ASCII
       34 "\\\""
       92 "\\\\"
-      47 "\\/"
       ; Handle non-printable escapes
       8 "\\b"
       12 "\\f"


Minor fix to movement transaction code

Minor fix to movement transaction code

--- src/clj/movement/util.clj
+++ src/clj/movement/util.clj
@@ -20,42 +20,41 @@
 (let [templates-tx (first (Util/readAll (io/reader (io/resource "data/templates.edn"))))]
   (d/transact conn templates-tx))

-(let [
+(let [acrobatics-tx (first (Util/readAll (io/reader (io/resource "data/movements/acrobatics.edn"))))
+      balancing-tx (first (Util/readAll (io/reader (io/resource "data/movements/balancing.edn"))))
       climbing-tx (first (Util/readAll (io/reader (io/resource "data/movements/climbing.edn"))))
+      core-tx (first (Util/readAll (io/reader (io/resource "data/movements/core.edn"))))
       crawling-tx (first (Util/readAll (io/reader (io/resource "data/movements/crawling.edn"))))
+      e-tx (first (Util/readAll (io/reader (io/resource "data/movements/e.edn"))))
+      endurance-tx (first (Util/readAll (io/reader (io/resource "data/movements/endurance.edn"))))
       jumping-tx (first (Util/readAll (io/reader (io/resource "data/movements/jumping.edn"))))
       lifting-tx (first (Util/readAll (io/reader (io/resource "data/movements/lifting.edn"))))
-      rolling-tx (first (Util/readAll (io/reader (io/resource "data/movements/rolling.edn"))))
-      walking-tx (first (Util/readAll (io/reader (io/resource "data/movements/walking.edn"))))
-
-      acrobatics-tx (first (Util/readAll (io/reader (io/resource "data/movements/acrobatics.edn"))))
+      lowerbody-tx (first (Util/readAll (io/reader (io/resource "data/movements/lowerbody.edn"))))
+      mobility-tx (first (Util/readAll (io/reader (io/resource "data/movements/mobility.edn"))))
       pulling-tx (first (Util/readAll (io/reader (io/resource "data/movements/pulling.edn"))))
       pushing-tx (first (Util/readAll (io/reader (io/resource "data/movements/pushing.edn"))))
-      conditioning-tx (first (Util/readAll (io/reader (io/resource "data/movements/endurance.edn"))))
-      core-tx (first (Util/readAll (io/reader (io/resource "data/movements/core.edn"))))
-      lowerbody-tx (first (Util/readAll (io/reader (io/resource "data/movements/lowerbody.edn"))))
-      mobility-tx (first (Util/readAll (io/reader (io/resource "data/movements/mobility.edn"))))
-
+      rolling-tx (first (Util/readAll (io/reader (io/resource "data/movements/rolling.edn"))))
       sass-tx (first (Util/readAll (io/reader (io/resource "data/movements/sass.edn"))))
-
-      ]
+      throwing-catching-tx (first (Util/readAll (io/reader (io/resource "data/movements/throwing-catching.edn"))))
+      walking-tx (first (Util/readAll (io/reader (io/resource "data/movements/walking.edn"))))]
   (do
+    (d/transact conn acrobatics-tx)
+    (d/transact conn balancing-tx)
     (d/transact conn climbing-tx)
-    (d/transact conn acrobatics-tx)
+    (d/transact conn core-tx)
+    (d/transact conn crawling-tx)
+    (d/transact conn e-tx)
+    (d/transact conn endurance-tx)
+    (d/transact conn jumping-tx)
+    (d/transact conn lifting-tx)
+    (d/transact conn lowerbody-tx)
+    (d/transact conn mobility-tx)
     (d/transact conn pulling-tx)
     (d/transact conn pushing-tx)
-    (d/transact conn conditioning-tx)
-    (d/transact conn core-tx)
-    (d/transact conn lowerbody-tx)
-    (d/transact conn mobility-tx)
+    (d/transact conn rolling-tx)
     (d/transact conn sass-tx)
-
-    (d/transact conn crawling-tx)
-    (d/transact conn jumping-tx)
-    (d/transact conn lifting-tx)
-    (d/transact conn rolling-tx)
-    (d/transact conn walking-tx)
-    ))
+    (d/transact conn throwing-catching-tx)
+    (d/transact conn walking-tx)))

 ;; Get the database value.
 (def db (d/db conn))


improve serving files to enable using a jar and not just lein ring

--- src/clj/ontheway/core.clj
+++ src/clj/ontheway/core.clj
@@ -1,6 +1,6 @@
 (ns ontheway.core
   (:use [compojure.core]
-        [ring.util.response :only [header file-response]])
+        [ring.util.response :only [header resource-response]])
   (:require [clojure.data.json :as json]
             [clj-http.client :as http]
             [compojure.handler :as handler]
@@ -38,7 +38,7 @@
 (defroutes app-routes

   ;; serves html
-  (GET "/" [] (file-response "index.html" {:root "resources/public"}))
+  (GET "/" [] (resource-response "index.html" {:root "public"}))

   ;; API endpoints
   (GET "/yelp-bounds" {params :params}


Don't add a nil fact

Don't add a nil fact

--- src/clj/runbld/system.clj
+++ src/clj/runbld/system.clj
@@ -39,36 +39,37 @@
     (throw+ {:warning ::no-facter
              :msg "facter cannot be found in PATH"})))

+(defmacro non-nil-fact-map [ns facter ks]
+  `(apply merge
+          (for [k# ~ks]
+            (if-let [v# ((ns-resolve ~ns (symbol (name k#))) ~facter)]
+              {k# v#}))))
+
 (s/defn inspect-system :- BuildSystem
   ([facter]
-   (let [ip6 (facts/ip6 facter)
-         ram-bytes (facts/ram-bytes facter)]
-     (merge
-      {:arch            (facts/arch            facter)
-       :cpu-type        (facts/cpu-type        facter)
-       :cpus            (facts/cpus            facter)
-       :cpus-physical   (facts/cpus-physical   facter)
-       :facter-provider (facts/facter-provider facter)
-       :facter-version  (facts/facter-version  facter)
-       :hostname        (facts/hostname        facter)
-       :ip4             (facts/ip4             facter)
-       :kernel-name     (facts/kernel-name     facter)
-       :kernel-release  (facts/kernel-release  facter)
-       :kernel-version  (facts/kernel-version  facter)
-       :model           (facts/model           facter)
-       :os              (facts/os              facter)
-       :os-version      (facts/os-version      facter)
-       :ram-mb          (facts/ram-mb          facter)
-       :ram-gb          (facts/ram-gb          facter)
-       :timezone        (facts/timezone        facter)
-       :uptime-days     (facts/uptime-days     facter)
-       :uptime-secs     (facts/uptime-secs     facter)
-       :uptime          (facts/uptime          facter)
-       :virtual         (facts/virtual         facter)}
-      (when ip6
-        {:ip6 ip6})
-      (when ram-bytes
-        {:ram-bytes ram-bytes})))))
+   (non-nil-fact-map
+    'runbld.facts facter
+    [:arch
+     :cpu-type
+     :cpus
+     :cpus-physical
+     :facter-provider
+     :facter-version
+     :hostname
+     :ip4
+     :kernel-name
+     :kernel-release
+     :kernel-version
+     :model
+     :os
+     :os-version
+     :ram-mb
+     :ram-gb
+     :timezone
+     :uptime-days
+     :uptime-secs
+     :uptime
+     :virtual])))

 (defn make-facter []
   (if-let [{:keys [major]} (facter-version)]
@@ -81,4 +82,3 @@
   [proc :- clojure.lang.IFn]
   (fn [opts]
     (proc (assoc opts :sys (inspect-system (make-facter))))))
-


base64 private/public keys for env vars

base64 private/public keys for env vars

--- src/clj/tictag/config.clj
+++ src/clj/tictag/config.clj
@@ -2,6 +2,7 @@
   (:require [environ.core :refer [env]]
             [clojure.string :as str]
             [buddy.core.codecs :as codecs]
+            [buddy.core.codecs.base64 :as b64]
             [buddy.core.keys :as keys]
             [buddy.core.hash :as hash]))

@@ -14,8 +15,8 @@
                    :user     (env :pg-user)
                    :password (env :pg-password)}
    :crypto-key    (some-> env :tictag-crypto-key hash/sha256)
-   :jwt           {:private-key (some-> env :ec-priv-key keys/str->private-key)
-                   :public-key  (some-> env :ec-pub-key keys/str->public-key)}
+   :jwt           {:private-key (some-> env :ec-priv-key b64/decode String. keys/str->private-key)
+                   :public-key  (some-> env :ec-pub-key b64/decode String. keys/str->public-key)}
    :slack         {:verification-token (env :slack-verification-token)}
    :tagtime       {:seed (or (some-> env :tagtime-seed Integer.) 666)
                    :gap  (or (some-> env :tagtime-gap Integer.) (* 60 45))}


Unchunk pileup result to make it easier to consume and deallocate quickly

--- src/cljam/algo/pileup.clj
+++ src/cljam/algo/pileup.clj
@@ -237,26 +237,25 @@
    (when-let [^long len (:len (refs/ref-by-name (sam/read-refs sam-reader) chr))]
      (let [s (max 1 start)
            e (min len end)
-           region {:chr chr :start s :end e}]
+           region {:chr chr :start s :end e}
+           filter-fn (if (pos? min-base-quality)
+                       (partial map (filter-by-base-quality min-base-quality))
+                       identity)]
        (->> (sam/read-alignments sam-reader region)
             (sequence
              (comp
               (filter (basic-mpileup-pred min-map-quality))
               (map index-cigar)))
             (seq-step start end chunk-size)
-            (sequence
-             (comp
-              (mapcat (fn [[^long pos alns]]
-                        (->> (if ignore-overlaps?
-                               alns
-                               (keep (partial correct-quals-at-ref
-                                              (make-corrected-quals-map alns)) alns))
-                             (pileup-seq pos (min end (+ pos chunk-size))))))
-              (map resolve-bases)
-              (if (pos? min-base-quality)
-                (map (filter-by-base-quality min-base-quality))
-                identity)
-              (keep (partial ->locus-pile chr)))))))))
+            (mapcat (fn [[^long pos alns]]
+                      (->> (if ignore-overlaps?
+                             alns
+                             (keep (partial correct-quals-at-ref
+                                            (make-corrected-quals-map alns)) alns))
+                           (pileup-seq pos (min end (+ pos chunk-size))))))
+            (map resolve-bases)
+            filter-fn
+            (keep (partial ->locus-pile chr)))))))

 (defn align-pileup-seqs
   "Align multiple piled-up seqs."


Add menu to select between the available automata.

--- src/cljs/beatha/core.cljs
+++ src/cljs/beatha/core.cljs
@@ -7,9 +7,9 @@

 (enable-console-print!)

-(def app-state (atom {:grid {:width 10 :height 10 :cells {}}
-                      :display {:width 600 :height 600}
-                      :started false}))
+(def app-state {:grid {:width 10 :height 10 :cells {}}
+                :display {:width 600 :height 600}
+                :started false})

 (defn cell-view
@@ -120,6 +120,13 @@
                :onClick #(put! change-display-dimensions [width height])}
           "Reset display"))))))

+(defn navigation-button
+  [text f]
+  (dom/button #js {:type "button"
+                   :className "btn btn-success btn-lg btn-block"
+                   :onClick f}
+    text))
+

 (defprotocol CellularAutomatonAppCustomization
   (automaton-input-view [this]
@@ -137,6 +144,8 @@

 (def ^:private empty-view
   (fn [data owner] (reify om/IRender (render [_] (dom/span nil "")))))
+
+(declare render-menu-view)

 (defn gen-app-view
   ([automaton-spec]
@@ -225,6 +234,9 @@
          (render-state [_ state]
            (dom/div
             #js {:className "container-liquid"}
+            (dom/div #js {:className "row"}
+                     (navigation-button "Menu" render-menu-view)
+                     (dom/hr nil))
             (dom/div
              #js {:className "row"}
              (dom/div
@@ -357,8 +369,42 @@
       (om/transact! data (fn [d] (assoc d :result :none))))))

-(om/root
- (gen-app-view a/labour-market-model)
- app-state
- {:target (. js/document (getElementById "app"))
-  :init-state {:animation-step 500}})
+(defn render-cellular-automaton
+  [view]
+  (om/root
+   view
+   app-state
+   {:target (. js/document (getElementById "app"))
+    :init-state {:animation-step 500}}))
+
+(defn menu-view
+  [data owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/div #js {:className "app-menu"}
+        (dom/div #js {:className "page-header"}
+          (dom/h1 nil "Cellular automata experiments"))
+        (navigation-button
+         "Game of Life"
+         (partial render-cellular-automaton (gen-app-view a/game-of-life)))
+        (navigation-button
+         "Unrestricted language parser"
+         (partial render-cellular-automaton
+                  (gen-app-view
+                   a/unrestricted-language-parser
+                   unrestricted-language-parser-customization)))
+        (navigation-button
+         "Economic model parser"
+         (partial render-cellular-automaton
+                  (gen-app-view a/labour-market-model)))))))
+
+(defn render-menu-view
+  []
+  (om/root
+   menu-view
+   app-state
+   {:target (. js/document (getElementById "app"))}))
+
+
+(render-menu-view)


Flesh out utils

Flesh out utils

--- src/cljs/gampg/utils.cljs
+++ src/cljs/gampg/utils.cljs
@@ -1,7 +1,8 @@
 (ns gampg.utils
   (:require [goog.webgl :as ggl]
             [thi.ng.geom.core :as geom]
-            [thi.ng.geom.core.matrix :as mat :refer [M44]]))
+            [thi.ng.geom.core.matrix :as mat :refer [M44]])
+  (:import [goog.net XhrIo]))

 ;; Note this is bad form in production, it can't be optimized away
 ;; https://groups.google.com/d/msg/clojurescript/3QmukS-q9kw/v9dnXfWhGm8J
@@ -298,6 +299,18 @@
    0x0ba2     :viewport
    0          :zero})

+(defn http-get [url cb]
+  (XhrIo.send (str url)
+              (fn [e]
+                (let [xhr (.-target e)]
+                  (cb (.getResponseText xhr))))))
+
+(defn load-texture! [src cb]
+  (let [image (js/Image.)]
+    (aset image "onload"
+          (cb image))
+    (aset image "src" src)))
+
 (defn load-cube-map [gl base cb]
   (let [loader  (atom [[0 (str base "/" "posx.jpg") false]
                        [1 (str base "/" "negx.jpg") false]


move to dev local

move to dev local

--- tutorial/entity_specs.clj
+++ tutorial/entity_specs.clj
@@ -12,13 +12,10 @@
 (require
   '[datomic.client.api :as d]
   '[datomic.samples.repl :as repl])
-(import '(java.util UUID))

-(def client-cfg (read-string (slurp "config.edn")))
-(def client (d/client client-cfg))
-(def db-name (str "scratch-" (UUID/randomUUID)))
-(d/create-database client {:db-name db-name})
-(def conn (d/connect client {:db-name db-name}))
+(def client (d/client {:server-type :dev-local :system "day-of-datomic-cloud"}))
+(d/create-database client {:db-name "entity-specs"})
+(def conn (d/connect client {:db-name "entity-specs"}))

 (def schema [{:db/ident :score/low
               :db/valueType :db.type/long,
@@ -31,24 +28,20 @@
               :db.entity/preds 'datomic.samples.entity-preds/scores-are-ordered?}])
 (d/transact conn {:tx-data schema})

-(def db (d/db conn))
-
 ;; valid scores
-(d/with (d/with-db conn) {:tx-data [{:score/low 10
-                                     :score/high 75
-                                     :db/ensure :team/score}]})
+(d/transact conn {:tx-data [{:score/low 10
+                             :score/high 75
+                             :db/ensure :team/score}]})

 ;; not valid - must have low and high score
-(-> (d/with (d/with-db conn) {:tx-data [{:db/id "my-score"
-                                         :score/low 10
-                                         :db/ensure :team/score}]})
+(-> (d/transact conn {:tx-data [{:db/id "my-score"
+                                 :score/low 10
+                                 :db/ensure :team/score}]})
     repl/thrown-data)

 ;; not valid - scores must match predicate
-(-> (d/with (d/with-db conn) {:tx-data [{:db/id "my-score"
-                                         :score/low 100
-                                         :score/high 20
-                                         :db/ensure :team/score}]})
-    repl/thrown-data)
-
-(d/delete-database client {:db-name db-name})
+(-> (d/transact conn {:tx-data [{:db/id "my-score"
+                                 :score/low 100
+                                 :score/high 20
+                                 :db/ensure :team/score}]})
+    repl/thrown-data)


Updated dependencies

Updated dependencies

--- web-app/project.clj
+++ web-app/project.clj
@@ -1,28 +1,27 @@
-(defproject
-  potato              "0.1.3-SNAPSHOT"
+(defproject potato "0.1.3-SNAPSHOT"
   :description        "A Potato front-end implemented with OM"
   :url                "http://potato.network"
   :license            {:name "Apache"}
   :min-lein-version   "2.5.3"

-  :dependencies [[org.clojure/clojure       "1.7.0"]
-                 [http-kit "2.1.8"]
-                 [org.clojure/clojurescript "1.7.170" :scope "provided"]
+  :dependencies [[org.clojure/clojure       "1.8.0"]
+                 [http-kit "2.1.19"]
+                 [org.clojure/clojurescript "1.8.51" :scope "provided"]
                  [org.omcljs/om             "0.9.0"]
                  [org.clojure/core.async    "0.2.374"]
                  ;; If cljs-http is upgraded to 0.1.39, the code will fail when compiled with optimisations enabled
                  [cljs-http                 "0.1.30" :exclusions [org.clojure/core.async]]
                  [cljsjs/moment             "2.9.0-0"]]

-  :plugins      [[lein-cljsbuild            "1.1.2"] ; Leiningen plugin to make ClojureScript development easy
+  :plugins      [[lein-cljsbuild            "1.1.3"] ; Leiningen plugin to make ClojureScript development easy
                  ]

   :clean-targets ^{:protect false} ["resources/public/js"]

   :profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
-                                  [figwheel-sidecar "0.5.0-1"]]
+                                  [figwheel-sidecar "0.5.3-2"]]
                    :source-paths ["cljs_src"]
-                   :plugins [[lein-figwheel "0.5.0-1" :exclusions [org.clojure/clojure
+                   :plugins [[lein-figwheel "0.5.3-2" :exclusions [org.clojure/clojure
                                                                    org.clojure/tools.reader
                                                                    ring/ring-core
                                                                    commons-fileupload


redef now preserves original line numbers

--- src/compojure/control.clj
+++ src/compojure/control.clj
@@ -35,7 +35,7 @@
   [name value]
   `(let [m# (meta #'~name)
          v# (def ~name ~value)]
-     (.setMeta v# (merge m# (meta #'~name)))
+     (.setMeta v# (merge (meta #'~name) m#))
      v#))

 (defmacro decorate-with


added comments to config.clj

added comments to config.clj

--- src/distillery/config.clj
+++ src/distillery/config.clj
@@ -1,15 +1,18 @@
 (ns distillery.config
   (:require [clojure.java.io :refer (resource)]))

-
-(def best-phrases-only true)
+;; ## Preprocessing

 (def blacklist-resource (resource "top10000de.txt"))
 (def blacklist-max-size 3000)
+
+(def best-phrases-only true)

 (def min-confidence 0.400)
 (def good-confidence 0.700)

 (def min-relative-appearance (/ 1.0 4.0))

-(def skip-wordclouds false)+;; ## Output Generation
+
+(def skip-wordclouds false)


Added average-shortest-path

Added average-shortest-path

Added the functionality to compute the average-shortest-path between the verticies of some graphs that can be computed from a formal context.

--- src/main/clojure/conexp/fca/applications/socialanalytics.clj
+++ src/main/clojure/conexp/fca/applications/socialanalytics.clj
@@ -94,5 +94,90 @@
          (drop % attribute-derivations-of-context))
       (range 0 n))))

+;;; Average-shortest-path
+
+(defn- floyd-step
+  "This is a helper-function for average-shortest-path:
+  Do one overwriting in the floyd-algorithm, see
+  https://de.wikipedia.org/wiki/Algorithmus_von_Floyd_und_Warshall or
+  https://en.wikipedia.org/wiki/Floyd-Warshall_algorithm for Details."
+  [matrix k i j]
+  (assert (<= i j) "No computation under the diagonalelements possible!")
+  (let [A_ij (nth (nth matrix i) (- j i))
+        A_ik (if (<= i k)
+               (nth (nth matrix i) (- k i))
+               (nth (nth matrix k) (- i k)))
+        A_kj (if (<= k j)
+               (nth (nth matrix k) (- j k))
+               (nth (nth matrix j) (- k j)))
+        newvalue (cond
+                   (and (= A_ij 0) (or (= A_ik 0) (=  A_kj 0))) 0
+                   (= A_ij 0) (+ A_ik A_kj)
+                   (or (= A_ik 0) (=  A_kj 0)) A_ij
+                   :else (min A_ij (+ A_ik A_kj)))]
+    (assoc matrix
+           i
+           (assoc (nth matrix i) (- j i) newvalue))))
+
+(defn average-shortest-path
+  "Computes the average-shortest path for a given `context' and a `projection'.
+  The projection f should map a context to the upper half of the adjacency-matrix
+  of the corresponding undirected graph.
+  To compute the path-lenghts, the floyd-algorithm:
+  https://de.wikipedia.org/wiki/Algorithmus_von_Floyd_und_Warshall,
+  https://en.wikipedia.org/wiki/Floyd-Warshall_algorithm is used
+  with one modification: Because the graph is undirected, just the upper triangle
+  (including diagonal-elements) of the adjacency-matrix
+  has to be stored.
+  Paths from a vertice to itself are discarded.
+  If there are no edges and therefore no paths
+  in the graph, nil is returned."
+  [context projection]
+  (assert (context? context) "Argument is not a formal context!")
+  (let [matrix (projection context)
+        n (count matrix)
+        paths (loop [k 0
+                     i 0
+                     j 0
+                     matrix matrix]
+                (if (< k n)
+                  (if (< i n)
+                    (if (< j n)
+                      (recur k i (inc j) (floyd-step matrix k i j))
+                      (recur k (inc i) (inc i) matrix))
+                    (recur (inc k) 0 0 matrix))
+                  ;;If we are finished, we discard all
+                  ;; entrys of length 0 (they stand for verticies
+                  ;; which are not connected!) and all shortest-path-lengths
+                  ;; of a vertice to itself.
+                  (remove zero?
+                          (mapcat
+                            #(drop 1 %)
+                            matrix))))]
+    (if (empty? paths)
+      nil
+      (/ (reduce + paths) (count paths)))))
+
+(defn average-shortest-path-objects-and-attributes
+  "Computes for a `context' the average-shortest-path of the graph,
+   which has as verticies the objects and attributes of the context
+   and in which the edges are defined through the incidence-relation."
+  [context]
+  (average-shortest-path context adjacency-matrix-for-object-and-attribute-projection))
+
+(defn average-shortest-path-objects
+  "Computes fo a `context' the average-shortest-path of the graph,
+   which has as verticies the objects of the context and in which
+   two objects share an edge if they share an attribute."
+  [context]
+  (average-shortest-path context adjacency-matrix-for-object-projection))
+
+(defn average-shortest-path-attributes
+  "Computes for a `context' the average-shortest-path of the graph,
+   which has as verticies the attributes of the context and in which
+   two attributes share an edge if they share an object."
+  [context]
+  (average-shortest-path context adjacency-matrix-for-attribute-projection))
+
 ;;;
 nil


Work in progress 2-3 Finger Trees in Clojure.

--- PersistentDataStructures/finger_trees.clj
+++ PersistentDataStructures/finger_trees.clj
@@ -1,7 +1,7 @@
 ; :mode=clojure:

-(defrecord node-2 [depth a b])
-(defrecord node-3 [depth a b c])
+(defrecord node-2 [a b])
+(defrecord node-3 [a b c])
 (defrecord finger-tree-single [v])
 (defrecord finger-tree-deep [l m r])

@@ -11,14 +11,18 @@
     (finger-tree-single. a))
 (defmethod push-front finger-tree-single [{r :v} a]
     (finger-tree-deep. [a] nil [r]))
-(defn make-node-3 [d a b c] (node-3. d a b c))
+(defn make-node-3 [a b c] (node-3. a b c))
 (defmethod push-front finger-tree-deep [{l :l m :m r :r} a]
     (if (<= (count l) 3)
         (finger-tree-deep. (cons a l) m r)
-        (finger-tree-deep. [a (first l)] (apply make-node-3 0 (rest l)) r))) ; not finished - needs to keep 'm'
+        (finger-tree-deep.
+            [a (first l)]
+            (push-front m (apply make-node-3 (rest l)))
+            r))) ; not finished - needs to keep 'm'

 (defn go [t n]
-    (if (<= n 0) nil (do (println t) (go (push-front t n) (dec n)))))
+    (do (println t)
+        (if (<= n 0) nil (go (push-front t n) (dec n)))))

 (go nil 20)


extract format-issue fn

extract format-issue fn

--- src/hu/ssh/github_changelog/formatters/markdown.clj
+++ src/hu/ssh/github_changelog/formatters/markdown.clj
@@ -1,9 +1,13 @@
 (ns hu.ssh.github-changelog.formatters.markdown
   (:require
     [hu.ssh.github-changelog.util :refer [str-map]]
-    [hu.ssh.github-changelog.schema :refer [Tag Change ChangeType]]
+    [hu.ssh.github-changelog.schema :refer [Tag Change ChangeType Issue]]
     [hu.ssh.github-changelog.markdown :as markdown]
     [schema.core :as s]))
+
+(s/defn format-issue :- s/Str
+  [issue :- Issue]
+  (markdown/link (first issue) (second issue)))

 (s/defn format-change :- s/Str
   [change :- Change]
@@ -11,7 +15,7 @@
        " "
        (:subject change)
        (if-let [issues (:issues change)]
-         (str ", closes " (str-map #(markdown/link (first %) (second %)) issues)))))
+         (str ", closes " (str-map format-issue issues)))))

 (s/defn format-changes :- s/Str
   [[type changes :- [Change]]]


good so far

good so far

--- src/epicea/typed/core.clj
+++ src/epicea/typed/core.clj
@@ -1,5 +1,6 @@
 (ns epicea.typed.core
   (:require [clojure.spec :as spec]
+            [epicea.typed.lang :as lang]
             [epicea.utils.debug :as debug]
             [epicea.utils.core :as core]
             [epicea.utils.defmultiple :refer [defmultiple]]
@@ -273,7 +274,7 @@
          ::spec/invalid
          (spec/conform ::typed-fun [nil [:double 'a :double 'b] :a :b :c])))

-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Compilable
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Compilable: Everything is here!!!

 (defn expr-access [i]
   (access/index-accessor i {:default-base [nil nil]}))
@@ -343,11 +344,18 @@

 (defn try-parse-s-expr [x]
   (try
-    (let [k (eval x)]
-      (if (compilable? k)
-        k))
+    (let [[f & r] x
+          k (apply (eval f)
+                   (map parse r))]
+      (if (compilable? k) k))
     (catch Throwable _ nil)))
-
+
+
+(defn if-statement [& args] {:compilable-type :if})
+
+;(defn dup [x]
+;  (let [p (parse x)]
+;    p))

 (defn parse [x]
   (or (try-parse-type x)
@@ -355,6 +363,7 @@
       (core/common-error "Failed to parse " x)))

 (assert (compilable? (parse 9)))
+(assert (compilable? (parse '(if-statement 9))))

 (defn compile-expr [argmap x cb]
   (cb argmap (access/get x expr)))
@@ -375,5 +384,3 @@
   (:long [x] (long-to-dynamic (access/get x type-body))))

 (assert (= 9 (to-dynamic-expr [:long [:value 9]])))
-
-


Fix sort-by-solved in data-tables.

Fix sort-by-solved in data-tables.

It was only working by coincidence, because they happened to be
sorted that way *anyway* in order to find everyone's ranking.

--- src/foreclojure/users.clj
+++ src/foreclojure/users.clj
@@ -267,7 +267,7 @@
 (defn datatable-paging [start length users]
   (take length (drop start users)))

-(let [column-sorts [:rank :user (comp :solved count)]]
+(let [column-sorts [:rank :user (comp count :solved)]]
   (defn datatable-sort-cols [sort-col users]
     (if-let [sort-fn (get column-sorts sort-col)]
       (sort-by sort-fn users)


fixed cron link

fixed cron link

--- src/org/domaindrivenarchitecture/pallet/crate/backup/app.clj
+++ src/org/domaindrivenarchitecture/pallet/crate/backup/app.clj
@@ -124,6 +124,7 @@
    script-type :- ScriptType]
   (let [cron-name (str (get-in config [:backup-name]) "_" (name script-type))
         script-name (str cron-name ".sh")
+        script-path (str (get-in config [:script-path]) script-name)
         script-lines (case script-type
                        :backup (backup-script-lines config)
                        :restore (restore-script-lines config)
@@ -133,7 +134,7 @@
                      :source-transport "20_"
                      "")]
   (actions/remote-file
-    (str (get-in config [:script-path]) script-name)
+    script-path
     :mode "700"
     :overwrite-changes true
     :literal true
@@ -142,7 +143,7 @@
                script-lines))
   (when (not= script-type :restore)
     (actions/symbolic-link
-      script-name
+      script-path
       (str "/etc/cron.daily/" cron-order cron-name)
       :action :create))
   ))


Removing test checking that provider-id is not supported as a lone search param. It is now supported.

--- test/cmr/metadata_db/test/services/concept_validations.clj
+++ test/cmr/metadata_db/test/services/concept_validations.clj
@@ -34,9 +34,6 @@
            (v/find-params-validation {:concept-type "foo"
                                       :entry-title "e"
                                       :provider-id "p"}))))
-  (testing "missing parameters"
-    (is (= [(msg/find-not-supported :collection [:provider-id])]
-           (v/find-params-validation {:concept-type :collection :provider-id "p"}))))
   (testing "extra parameters"
     (is (= [(msg/find-not-supported :collection [:short-name :provider-id :entry-title])]
            (v/find-params-validation {:concept-type :collection


Do some rearranging

Do some rearranging

--- src/structural_typing/mechanics/compiling_types.clj
+++ src/structural_typing/mechanics/compiling_types.clj
@@ -41,21 +41,24 @@
 (defn run-select [compiled-path object-to-check]
   (e/make-either (specter/compiled-select compiled-path object-to-check)))

+(defn compile-path-check [[path preds]]
+  (vector path
+          (apply specter/comp-paths path)
+          (compile-predicates preds)))
+
+(defn run-path-check [object-to-check [original-path compiled-path run-path-preds]]
+  (e/either [x (run-select compiled-path object-to-check)]
+               (oopsies-for-bad-path object-to-check original-path)
+               (oopsies-for-one-path object-to-check
+                                     x
+                                     original-path
+                                     run-path-preds)))
+
 (defn compile-type [t]
-  (let [processed-triples (map (fn [[path preds]]
-                                 (vector path
-                                         (apply specter/comp-paths path)
-                                         (compile-predicates preds)))
-                               t)]
-
+  ;; Note that the path-checks are compiled once, returning a function to be run often.
+  (let [compiled-path-checks (map compile-path-check t)]
     (fn [object-to-check]
-      (reduce (fn [all-errors [original-path compiled-path run-path-preds]]
-                (into all-errors
-                      (e/either [x (run-select compiled-path object-to-check)]
-                                (oopsies-for-bad-path object-to-check original-path)
-                                (oopsies-for-one-path object-to-check
-                                                      x
-                                                      original-path
-                                                      run-path-preds))))
+      (reduce (fn [all-errors path-check]
+                (into all-errors (run-path-check object-to-check path-check)))
               []
-              processed-triples))))
+              compiled-path-checks))))


Removed inline heartbeats to avoid being killed when under heavy ZK load.

--- storm-core/src/clj/backtype/storm/daemon/worker.clj
+++ storm-core/src/clj/backtype/storm/daemon/worker.clj
@@ -352,13 +352,6 @@
     (touch (worker-pid-path conf worker-id (process-pid))))
   (let [worker (worker-data conf shared-mq-context storm-id assignment-id port worker-id)
         heartbeat-fn #(do-heartbeat worker)
-        ;; do this here so that the worker process dies if this fails
-        ;; it's important that worker heartbeat to supervisor ASAP when launching so that the supervisor knows it's running (and can move on)
-        _ (heartbeat-fn)
-
-        ;; heartbeat immediately to nimbus so that it knows that the worker has been started
-        _ (do-executor-heartbeats worker)
-

         executors (atom nil)
         ;; launch heartbeat threads immediately so that slow-loading tasks don't cause the worker to timeout


fix unittest

fix unittest

--- test/src/dda/pallet/dda_managed_ide/domain_test.clj
+++ test/src/dda/pallet/dda_managed_ide/domain_test.clj
@@ -276,9 +276,9 @@
                                      "https://www.yworks.com/resources/yed/demo/yEd-3.18.2.zip",}}
                              :db {:dbvis {:version "10.0.16"}}
                              :devops {:terraform
-                                        {:version "0.11.7",
+                                        {:version "0.11.11",
                                          :sha256-hash
-                                         "6b8ce67647a59b2a3f70199c304abca0ddec0e49fd060944c26f666298e23418"}
+                                         "94504f4a67bad612b5c8e3a4b7ce6ca2772b3c1559630dfd71e9c519e3d6149c"}
                                       :packer
                                         {:version "1.2.5"
                                          :sha256-hash


default config

default config

--- dev/user.clj
+++ dev/user.clj
@@ -9,9 +9,11 @@

 (set-refresh-dirs "./src" "./dev")

-(defn restart []
+(def base-config {:video-sim true})
+
+(defn restart [& [config]]
   (stop!)
-  (start!))
+  (start! (merge base-config config)))

 (defn reset []
   (stop!)


Add more user ns aliases.

Add more user ns aliases.

--- dev/user.clj
+++ dev/user.clj
@@ -4,7 +4,8 @@
     [byte-streams :as bytes :refer [bytes=]]
     (blocks
       [core :as block]
-      [data :as data])
+      [data :as data]
+      [store :as store])
     (blocks.store
       [memory :refer [memory-block-store]]
       [file :refer [file-block-store]]
@@ -15,7 +16,8 @@
     [clojure.test.check :as check]
     [clojure.test.check.generators :as gen]
     [clojure.test.check.properties :as prop]
-    [multihash.core :as multihash])
+    [multihash.core :as multihash]
+    [multihash.digest :as digest])
   (:import
     blocks.data.Block
     multihash.core.Multihash))


Revert "Fixed user namespace not loading if backend fails to load"

This reverts commit e8dd28bd89d71c04377105ded120241224df6f7b.

--- dev/user.clj
+++ dev/user.clj
@@ -2,7 +2,9 @@
   (:use midje.repl)
   (:require [clojure.repl :refer :all]
             [clojure.pprint :refer [pprint]]
-            [clojure.tools.namespace.repl :refer [refresh]]))
+            [clojure.tools.namespace.repl :refer [refresh]]
+            [varjocafe.backend :as backend]
+            [varjocafe.settings :as settings]))

 (defonce ^:private system (atom nil))

@@ -36,10 +38,10 @@
 ; Test Data

 (defn local-backend []
-  ((ns-resolve 'varjocafe.backend 'init-local) (:testdata-dir (ns-resolve 'varjocafe.settings 'dev-settings))))
+  (backend/init-local (:testdata-dir settings/dev-settings)))

 (defn remote-backend []
-  ((ns-resolve 'varjocafe.backend 'init-remote) (:backend-url (ns-resolve 'varjocafe.settings 'dev-settings))))
+  (backend/init-remote (:backend-url settings/dev-settings)))

 (defn update-testdata! []
-  ((ns-resolve 'varjocafe.backend 'refresh) (local-backend) (remote-backend)))
+  (backend/refresh (local-backend) (remote-backend)))


[clojure] Add helpers for working with dev systems

--- etc/repl.clj
+++ etc/repl.clj
@@ -26,6 +26,7 @@
 (R/list-ns) - find all namespaces in SRC
 (R/start-system! 'some.user-ns) - refresh and start a system in some.user-ns
 (R/stop-system! 'some.user-ns) - stop a system in some.user-ns
+(R/c :component-name) - pull out compoentn from a running system
 (R/add-dependency ['cheshire \"5.8.1\"]) - add a library to current repl process"))

 (defn init! []
@@ -85,10 +86,18 @@

 (defn stop-system!
   "Given a namespace, usually some-service.user, stop the system"
-  [an-ns]
+  ([]
+   (stop-system! (first (key @system-status))))
+  ([an-ns]
   (let [f (ns-resolve an-ns 'stop)]
     (f)
-    (swap! system-status (fn [s] (assoc s an-ns false)))))
+    (swap! system-status (fn [s] (assoc s an-ns false))))))
+
+(defn c
+  "Pul out a compont from a system"
+  [component-name]
+  (let [sys (var-get (ns-resolve (first (keys @system-status)) 'SYS))]
+    (get sys component-name)))

 (defn add-dependency
   "Adds dependencies within a running REPL


fix bug when no default z drive is specified

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -503,9 +503,10 @@

 (defn store-z-reference [current-position]
   (let [z-drive (@state :default-z-drive)]
-    (when (z-stage-needs-adjustment z-drive)
-      (let [z (get-z-stage-position z-drive)]
-        (state-assoc! :reference-z z)))))
+    (when-not (empty? z-drive)
+      (when (z-stage-needs-adjustment z-drive)
+        (let [z (get-z-stage-position z-drive)]
+          (state-assoc! :reference-z z))))))

 ;; startup and shutdown


only log from clojure AcqEngine during debug

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

--- acqEngine/src/org/micromanager/mm.clj
+++ acqEngine/src/org/micromanager/mm.clj
@@ -28,7 +28,7 @@
       (load-mm gui)))

 (defn log [& x]
-  (org.micromanager.utils.ReportingUtils/logMessage (apply str x)))
+  (.logMessage mmc (apply str x) true))

 (defmacro log-cmd [expr]
   `(do (log '~expr)


Move clojure test out of ruby section

Move clojure test out of ruby section

--- assignments/ruby/kindergarden-garden/test.clj
+++ assignments/ruby/kindergarden-garden/test.clj
@@ -1,31 +0,0 @@
-(load-file "garden.clj")
-
-(assert (= [:radishes :clover :grass :grass] (:alice (garden "RC\nGG"))))
-(assert (= [:violets :clover :radishes :clover] (:alice (garden "VC\nRC"))))
-
-(def small-garden (garden "VVCG\nVVRC"))
-(assert (= [:clover :grass :radishes :clover] (:bob small-garden)))
-
-(def medium-garden (garden "VVCCGG\nVVCCGG"))
-(assert (= [:clover :clover :clover :clover] (:bob medium-garden)))
-(assert (= [:grass :grass :grass :grass] (:charlie medium-garden)))
-
-(def full-garden (garden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"))
-(assert (= [:violets  :radishes :violets  :radishes] (:alice   full-garden)))
-(assert (= [:clover   :grass    :clover   :clover]   (:bob     full-garden)))
-(assert (= [:violets  :violets  :clover   :grass]    (:charlie full-garden)))
-(assert (= [:radishes :violets  :clover   :radishes] (:david   full-garden)))
-(assert (= [:clover   :grass    :radishes :grass]    (:eve     full-garden)))
-(assert (= [:grass    :clover   :violets  :clover]   (:fred    full-garden)))
-(assert (= [:clover   :grass    :grass    :clover]   (:ginny   full-garden)))
-(assert (= [:violets  :radishes :radishes :violets]  (:harriet full-garden)))
-(assert (= [:grass    :clover   :violets  :clover]   (:ileana  full-garden)))
-(assert (= [:violets  :clover   :violets  :grass]    (:joseph  full-garden)))
-(assert (= [:grass    :clover   :clover   :grass]    (:kincaid full-garden)))
-(assert (= [:grass    :violets  :clover   :violets]  (:larry   full-garden)))
-
-(def surprise-garden (garden "VCRRGVRG\nRVGCCGCV" ["Samantha" "Patricia" "Xander" "Roger"]))
-(assert (= [:violets  :clover   :radishes :violets] (:patricia surprise-garden)))
-(assert (= [:radishes :radishes :grass    :clover]  (:roger    surprise-garden)))
-(assert (= [:grass    :violets  :clover   :grass]   (:samantha surprise-garden)))
-(assert (= [:radishes :grass    :clover   :violets] (:xander   surprise-garden)))


Show exceptions reading test namespaces. Fixes #127.

--- src/leiningen/util/ns.clj
+++ src/leiningen/util/ns.clj
@@ -22,17 +22,19 @@
 (defn jar? [f]
   (and (.isFile f) (.endsWith (.getName f) ".jar")))

-(defn read-ns-form [r]
-  (let [form (try (read r)
-                  (catch Exception _ ::done))]
+(defn read-ns-form [r f]
+  (let [form (try (read r false ::done)
+                  (catch Exception e
+                    (println (format "Couldn't parse %s: %s" f (.getMessage e)))
+                    ::done))]
     (if (and (list? form) (= 'ns (first form)))
       form
       (when-not (= ::done form)
-        (recur r)))))
+        (recur r f)))))

 (defn find-ns-form [f]
   (when (and (.isFile (file f)) (clj? f))
-    (read-ns-form (PushbackReader. (reader f)))))
+    (read-ns-form (PushbackReader. (reader f)) f)))

 (defn namespaces-in-dir [dir]
   (sort (for [f (file-seq (file dir))
@@ -46,7 +48,7 @@
                       InputStreamReader.
                       BufferedReader.
                       PushbackReader.)]
-    (read-ns-form rdr)))
+    (read-ns-form rdr jarfile)))

 (defn namespaces-in-jar [jar]
   (let [jarfile (JarFile. jar)]


:bug: Temporary disable memoization on layers.

--- frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/layers.cljs
@@ -93,7 +93,7 @@
 (declare layer-item)

 (mf/defc layer-item
-  {::mf/wrap [#(mf/memo' % layer-item-memo-equals?)]}
+  ;; {::mf/wrap [#(mf/memo' % layer-item-memo-equals?)]}
   [{:keys [index item selected objects] :as props}]
   (let [selected? (contains? selected (:id item))
         collapsed? (mf/use-state false)
@@ -238,4 +238,4 @@
       [:span (:name page)]
       #_[:div.tool-window-close {:on-click on-click} i/close]]
      [:div.tool-window-content
-      [:& layers-tree]]]))
+      [:& layers-tree {:key (:id page)}]]]))


Fix header reference in bin-codec constructor.

--- src/multicodec/codecs.clj
+++ src/multicodec/codecs.clj
@@ -125,8 +125,8 @@
   (when-not (every? (comp string? :header) codecs)
     (throw (IllegalArgumentException.
              (str "Every codec must specify a header path: "
-                  (pr-str (first (filter (comp complement string? :header)
-                                         codecs)))))))
+                  (pr-str (filter (comp complement string? :header)
+                                  codecs))))))
   (MuxCodec.
     "/multicodec"
     (into {} (map (juxt :header identity) codecs))
@@ -166,7 +166,7 @@
 (defn bin-codec
   "Creates a new binary codec."
   []
-  (BinaryCodec. (mc/headers :bin)))
+  (BinaryCodec. (mc/headers :binary)))

 ;; Remove automatic constructor functions.


Remove vestigial zk-utils use

Remove vestigial zk-utils use

--- src/onyx/plugin/kafka.clj
+++ src/onyx/plugin/kafka.clj
@@ -147,7 +147,6 @@
                          :group.id group-id}
         commit-interval (or (:kafka/commit-interval task-map) (:kafka/commit-interval defaults))
         client-id "onyx"
-        zk-utils (k-admin/make-zk-utils {:servers (:kafka/zookeeper task-map)} false)
         retry-ch (:retry-ch pipeline)
         pending-messages (:pending-messages pipeline)
         pending-commits (:pending-commits pipeline)


Mention #'run in #'demo docstring

Mention #'run in #'demo docstring

--- src/overtone/sc/synth.clj
+++ src/overtone/sc/synth.clj
@@ -718,7 +718,7 @@
   Useful for experimentation.  If the root node is not an out ugen,
   then it will add one automatically.  You can specify a timeout in
   seconds as the first argument otherwise it defaults to *demo-time*
-  ms.
+  ms. See #'run for a version of demo that does not add an out ugen.

   (demo (sin-osc 440))      ;=> plays a sine wave for *demo-time* ms
   (demo 0.5 (sin-osc 440))  ;=> plays a sine wave for half a second"


Allow to-string function to be supplied to callable-map. Please review.

--- src/overtone/util/lib.clj
+++ src/overtone/util/lib.clj
@@ -104,7 +104,9 @@
          ([k d] (get m k d)))
        (invoke      [& args] (apply fun args))
        (applyTo    ([args] (apply fun args)))
-       (toString   [] "Callable Map")
+       (toString   [] (if-let [ts (::to-string metadata)]
+                        (ts this)
+                        "Callable Map"))
        (withMeta   [new-metadata] (callable-map m fun new-metadata))
        (meta       [] metadata))))


Fixed bug with variable registration.

Fixed bug with variable registration.

--- internal.clj
+++ internal.clj
@@ -354,8 +354,9 @@
             (.Invoke meth m
                      (into-array Object
                                  [(make-variable attrs)
-                                 get-func
-                                 set-action]))))))
+                                  get-func
+                                  set-action
+                                  nil]))))))

 (defn register-command-fn
   "Register a Minibuffer command."


Change from display to visibility

Change from display to visibility

--- src/re_complete/core.cljs
+++ src/re_complete/core.cljs
@@ -17,7 +17,7 @@
        (let [selected @selected-item]
          (when (zero? (count @items-to-re-complete))
            (dispatch [:clear-selected-item linked-component-keyword]))
-         [:ul.re-completion-list {:style {:display (if (empty? @items-to-re-complete) "none" "block")}}
+         [:ul.re-completion-list {:style {:visibility (if (empty? @items-to-re-complete) "hidden" "visible")}}
           (when-not (string/blank? @current-word)
             (map (fn [item]
                    (if (= (str (second selected))


Fixed some formatting and such

Fixed some formatting and such

--- src/semantic_csv/core.clj
+++ src/semantic_csv/core.clj
@@ -301,7 +301,6 @@
    (let [header     (or header (-> data first keys))
          ;; This will be the formatted version we prepend if desired
          out-header (if format-header (mapv format-header header) header)]
-     (println out-header)
      (->> data
           (map
             (fn [row] (mapv (partial get row) header)))
@@ -310,20 +309,21 @@

 ;; Let's see this in action:
 ;;
-;;    => (let [data [{:this "a" :that "b"}
-;;                   {:this "x" :that "y"}]]
-;;         (vectorify data))
-;;    (["this" "that"]
-;;     ["a" "b"]
-;;     ["x" "y"])
+;;     => (let [data [{:this "a" :that "b"}
+;;                    {:this "x" :that "y"}]]
+;;          (vectorify data))
+;;     (["this" "that"]
+;;      ["a" "b"]
+;;      ["x" "y"])
 ;;
 ;; With some options:
 ;;
-;;    => (let [data [{:this "a" :that "b"}
-;;                   {:this "x" :that "y"}]]
-;;         (vectorify {:header [:that :this]
-;;                     :preprend-header false}
-;;                    data))
-;;    (["b" "a"]
-;;     ["y" "x"])
-
+;;     => (let [data [{:this "a" :that "b"}
+;;                    {:this "x" :that "y"}]]
+;;          (vectorify {:header [:that :this]
+;;                      :preprend-header false}
+;;                     data))
+;;     (["b" "a"]
+;;      ["y" "x"])
+
+


added user authorization

added user authorization

--- src/amindblowingworld/routes.clj
+++ src/amindblowingworld/routes.clj
@@ -1,19 +1,123 @@
 (ns amindblowingworld.routes
   (:use compojure.core
         amindblowingworld.views
-        amindblowingworld.view_index
+        ;; amindblowingworld.view_index
         [hiccup.middleware :only (wrap-base-url)])
   (:require [compojure.route :as route]
             [compojure.handler :as handler]
-            [compojure.response :as response]))
+            [compojure.response :as response]
+            [cemerick.friend :as friend]
+            (cemerick.friend [workflows :as workflows]
+                             [credentials :as creds])
+            [friend-oauth2.workflow :as oauth2wf]
+            [friend-oauth2.util :as oauth2u]
+            [ring.util.response :as resp]
+            [ring.util.codec :as codec]
+            [cheshire.core :as json]
+            [clj-http.client :as http]
+            [hiccup.page :as h]
+            [hiccup.element :as e]))
+
+(defn call-github
+  [endpoint access-token]
+  (-> (format "https://api.github.com%s%s&access_token=%s"
+              endpoint
+              (when-not (.contains endpoint "?") "?")
+              access-token)
+      http/get
+      :body
+      (json/parse-string (fn [^String s] (keyword (.replace s \_ \-))))))
+
+;; This sort of blind memoization is *bad*. Please don't do this in your real apps.
+;; Go use an appropriate cache from https://github.com/clojure/core.cache
+(def get-github-handle (memoize (comp :login (partial call-github "/user"))))
+
+(def client-config
+  {:client-id "60b87c4b4a6e4428e50d"
+   :client-secret "096e27ebcf5c127f857b655bc136b050b6244edc"
+   ;;:callback {:domain "localhost:8000" :path "/"}
+   :callback {:domain "http://amindblowingworld.clojurecup.com" :path "/"}
+   })
+
+(def uri-config
+  {:authentication-uri {:url "https://github.com/login/oauth/authorize"
+                        :query {:client_id (:client-id client-config)
+                                :response_type "code"
+                                :redirect_uri (oauth2u/format-config-uri client-config)
+                                :scope ""}}
+   :access-token-uri {:url "https://github.com/login/oauth/access_token"
+                      :query {:client_id (:client-id client-config)
+                              :client_secret (:client-secret client-config)
+                              :grant_type "authorization_code"
+                              :redirect_uri (oauth2u/format-config-uri client-config)}}})
+
+(def config-auth {:roles #{::user}})

 (defroutes main-routes
-  (GET "/" [] (index-page))
+  (GET "/" [req] (h/html5
+                  [:head
+                   [:title "AMindBlowingWorld"]
+                   (h/include-js "/js/main.js")
+                   (h/include-js "/js/app.js")]
+                  [:body (if (friend/identity req)
+                           {:onload "initApp();"}
+                           {})
+                   [:h1 "AMindBlowingWorld"]
+                   [:h3 "Authenticating via GitHub using OAuth2"]
+                   [:h3 "Current Status " [:small "(this will change when you log in/out)"]]
+                   (if-let [identity (friend/identity req)]
+                     [:p "Logged in as GitHub user "
+                      [:strong (get-github-handle (:current identity))]
+                      " with GitHub OAuth2 access token " (:current identity)]
+                     [:p [:a {:href "github.callback"} "Login with GitHub"]])
+                   [:h3 "App"]
+                   (if (friend/identity req)
+                     [:div#appDiv
+                      [:div#world [:img#worldView {:src "/img/world.png"}]]
+                      [:div#menu "Menu"]
+                      [:div#news "News"]]
+                     [:div#appDiv
+                      [:div#world [:img#worldView {:src "/img/world.png"}]]
+                      [:div#menu "Menu"]
+                      [:div#news "News"]])
+                   [:h3 "Logging out"]
+                   [:p (e/link-to "/logout" "Click here to log out") "."]
+                   ]))
+
+         ;; [:ul [:li (e/link-to (misc/context-uri req "role-user") "Requires the `user` role")]
+        ;;  ;[:li (e/link-to (misc/context-uri req "role-admin") "Requires the `admin` role")]
+        ;;  [:li (e/link-to (misc/context-uri req "requires-authentication")
+        ;;         "Requires any authentication, no specific role requirement")]]
+        ;; [:h3 "Logging out"]
+        ;; [:p (e/link-to (misc/context-uri req "logout") "Click here to log out") "."])))
+  (GET "/logout" req
+    (friend/logout* (resp/redirect (str (:context req) "/"))))
+  ;; (GET "/requires-authentication" req
+  ;;   (friend/authenticated "Thanks for authenticating!"))
+  ;; (GET "/role-user" req
+  ;;   (friend/authorize #{::users/user} "You're a user!"))
+  ;; #_(GET "/role-admin" req
+  ;;   (friend/authorize #{::users/admin} "You're an admin!"))
   (GET "/map.png" [] (response-biome-map))
   (GET ["/history/since/:event-id", :event-id #"[0-9]+"] [event-id] (history-since (read-string event-id)))
   (route/resources "/")
   (route/not-found "Page not found"))

 (def app
-  (-> (handler/site main-routes)
-      (wrap-base-url)))
+  (-> main-routes
+      (friend/authenticate
+       {:allow-anon? true
+        :default-landing-uri "/"
+        :login-uri "/github.callback"
+        :unauthorized-handler #(-> (h/html5 [:h2 "You do not have sufficient privileges to access " (:uri %)])
+                                   resp/response
+                                   (resp/status 401))
+        :workflows [(oauth2wf/workflow
+                     {:client-config client-config
+                      :uri-config uri-config
+                      :config-auth config-auth
+                      ;;:access-token-parsefn oauth2u/get-access-token-from-params
+                      :access-token-parsefn #(-> % :body codec/form-decode (get "access_token"))
+                      })]})
+      handler/site
+      wrap-base-url))


correct doc string

correct doc string

--- src/clj/cljspazzer/db/schema.clj
+++ src/clj/cljspazzer/db/schema.clj
@@ -104,7 +104,7 @@
   (some (partial starts-with? (.getAbsolutePath f)) mounts))

 (defn prune-tracks!
-  "get rid of rows where the files no longer exist"
+  "get rid of rows where the files no longer exist or are no longer managed"
   [db]
   (let [fkeys (keys (last-modified-index db))
         mounts (mount-points db)


add :msg to Hunting Grounds

add :msg to Hunting Grounds

fixes #1065

--- src/clj/game/cards-resources.clj
+++ src/clj/game/cards-resources.clj
@@ -252,7 +252,8 @@
    {:abilities [{:label "Prevent a \"when encountered\" ability on a piece of ICE"
                  :msg "prevent a \"when encountered\" ability on a piece of ICE"
                  :once :per-turn}
-                 {:label "Install the top 3 cards of your Stack facedown"
+                 {:label "[Trash]: Install the top 3 cards of your Stack facedown"
+                  :msg "install the top 3 cards of their Stack facedown"
                   :effect (req (trash state side card {:cause :ability-cost})
                                (doseq [c (take 3 (:deck runner))]
                                   (runner-install state side c {:facedown true})))}]}


course website v1

course website v1

--- src/cljs/cs95/views/landing.cljs
+++ src/cljs/cs95/views/landing.cljs
@@ -45,5 +45,5 @@
    [course-description]
    [:hr]
    [administrivia]
-   [:h3 "Grading Policy"]])
+   #_[:h3 "Grading Policy"]])


New board functions empty-square?, occupied_square?

--- src/clojure/clj_chess/board.cljc
+++ src/clojure/clj_chess/board.cljc
@@ -25,6 +25,7 @@
 (def black-rook 12)
 (def black-queen 13)
 (def black-king 14)
+(def empty-square 16)
 (def blocker 23)

@@ -147,6 +148,16 @@
   "The piece on a given square."
   [board square]
   (.pieceOn board square))
+
+(defn empty-square?
+  "Tests whether the given square is empty."
+  [board square]
+  (= empty-square (piece-on board square)))
+
+(defn occupied-square?
+  "Tests whether the given square is occupied."
+  [board square]
+  (not (empty-square? board square)))

 (defn can-castle-kingside?
   "Tests whether the given side still has the right to castle kingside."


Added integer_untag_instruction.

Added integer_untag_instruction.

--- src/clojush/instructions/tag.clj
+++ src/clojush/instructions/tag.clj
@@ -168,6 +168,17 @@
       state)))

 (define-registered
+  integer_untag_instruction
+  ^{:stack-types [:integer :tag :exec]}
+  (fn [state]
+    (if (not (empty? (:integer state)))
+      (push-item (symbol (str "untag_" (mod (#(if (neg? %) (= %) %) (stack-ref :integer 0 state))
+                                            @global-tag-limit)))
+                 :exec
+                 (pop-item :integer state))
+      state)))
+
+(define-registered
   integer_tag_exec_instruction
   ^{:stack-types [:integer :tag :exec]}
   (fn [state]


Add docstring to ensure-attrs

Add docstring to ensure-attrs

--- src/com/wsscode/pathom/core.cljc
+++ src/com/wsscode/pathom/core.cljc
@@ -84,7 +84,9 @@
   (ast-key-id ast))

 (defn ensure-attrs [{:keys [parser] :as env} attributes]
-  "Loads "
+  "Runs the parser against current element to garantee that some fields are loaded.
+  This is useful when you need to ensure some values are loaded in order to fetch some
+  more complex data."
   (let [e (entity env)]
     (merge e (parser env (filterv (-> e keys set complement) attributes)))))