(ns discuss.config)

(def project "discuss")

(def user "Q2hyaXN0aWFu")

(def api {:host "http://dbas/"
          :init "api/elektroautos"
          :base "api/"
          :add  {:add-start-statement "add/start_statement"
                 :add-start-premise   "add/start_premise"
                 :add-justify-premise "add/justify_premise"}
          :get  {:references       "get/references"
                 :reference-usages "get/reference/usages"
                 :statements       "get/statements"
                 :statement-url    "api/get/statement/url"}})

(ns discuss.config)

(def project "discuss")

(def user "Q2hyaXN0aWFu")

(def api {:host "http://localhost:4284/"
          :init "api/elektroautos"
          :base "api/"
          :add  {:add-start-statement "add/start_statement"
                 :add-start-premise   "add/start_premise"
                 :add-justify-premise "add/justify_premise"}
          :get  {:references       "get/references"
                 :reference-usages "get/reference/usages"
                 :statements       "get/statements"
                 :statement-url    "api/get/statement/url"}})

Use local address of dabas-

Use local address of dabas-


(ns rill.cli
  (:require [rill.event-store.atom-store :refer [atom-event-store]]
            [rill.event-channel :refer [event-channel]]
            [rill.event-stream :refer [all-events-stream-id]]
            [rill.event-store.atom-store.event :refer [unprocessable?]]
            [clojure.core.async :refer [<!!]])
  (:gen-class))

(defn -main [url user password]
  {:pre [url user password]}
  (let [ch (event-channel (atom-event-store url {:user user :password password})
                          all-events-stream-id -1 0)]
    (println "Printing all events...")
    (loop []
      (if-let [e (<!! ch)]
        (do (if (unprocessable? e)
              (println "Skipped message.")
              (prn e))
            (recur))))))

(ns rill.cli
  (:require [rill.event-store.psql :refer [psql-event-store]]
            [rill.event-channel :refer [event-channel]]
            [rill.event-stream :refer [all-events-stream-id]]
            [rill.event-store.atom-store.event :refer [unprocessable?]]
            [clojure.core.async :refer [<!!]])
  (:gen-class))

(defn -main [url]
  {:pre [url]}
  (let [ch (event-channel (psql-event-store url)
                          all-events-stream-id -1 0)]
    (println "Printing all events...")
    (loop []
      (if-let [e (<!! ch)]
        (do (if (unprocessable? e)
              (println "Skipped message.")
              (prn e))
            (recur))))))

Make it possible to use the psql event store


(ns yadnd5ecs.core
  (:require [om.core :as om :include-macros true]
            [om-tools.dom :as dom :include-macros true]
            [om-tools.core :refer-macros [defcomponent]]))

(enable-console-print!)

(def app-state (atom {:text "Hello Chestnut!"}))

(defn main []
  (om/root
    (fn [app owner]
      (reify
        om/IRender
        (render [_]
          (dom/h1 (:text app)))))
    app-state
    {:target (. js/document (getElementById "app"))}))

(ns yadnd5ecs.core
  (:require [om.core :as om :include-macros true]
            [om-tools.dom :as dom :include-macros true]
            [om-tools.core :refer-macros [defcomponent]]))

(enable-console-print!)

(def app-state (atom {:text "Hello Chestnut!"}))

(defcomponent app-view
  [app owner]
  (render [_]
          (dom/h1 (:text app))))

(defn main []
  (om/root
    app-view
    app-state
    {:target (. js/document (getElementById "app"))}))

Refactor initial view into defcomponent.


(ns
  ^{:doc

  "A patched JTextField implementation."

    :author "Frank Mosebach"}
  fm.simrunner.gui.text-field
  (:gen-class
    :name fm.simrunner.gui.TextField
    :extends javax.swing.JTextField
    :exposes-methods {setText superSetText}))

(defn -setText [this text]
  (when (not= (.getText this) text)
    (.superSetText this text)))

(ns
  ^{:doc

  "A patched JTextField implementation."

    :author "Frank Mosebach"}
  fm.simrunner.gui.text-field
  (:gen-class
    :name fm.simrunner.gui.TextField
    :extends javax.swing.JTextField
    :exposes-methods {setText superSetText}))

(defn -setText [this text]
  (when (not= (.getText this) text)
    (doto this
      (.superSetText text)
      (.setCaretPosition 0))))

Reset the caret to position 0 when setting the text.


(ns armstrong-numbers-test
  (:require [clojure.test :refer [deftest is testing]]
            [armstrong-numbers :refer [armstrong?]]))

(deftest armstrong-number-5
  (testing "Single digit numbers are Armstrong numbers"
    (is (armstrong? 5))))

(deftest not-armstrong-number-10
  (testing "There are no 2 digit Armstrong numbers"
    (is (not (armstrong? 10)))))

(deftest armstrong-number-153
  (testing "Three digit number that is an Armstrong number"
    (is (armstrong? 153))))

(deftest not-armstrong-number-100
  (testing "Three digit number that is an Armstrong number"
    (is (not (armstrong? 100)))))

(deftest armstrong-number-9474
  (testing "Four digit number that is an Armstrong number"
    (is (armstrong? 9474))))

(deftest not-armstrong-number-9475
  (testing "Four digit number that is not an Armstrong number"
    (is (not (armstrong? 9476)))))

(deftest armstrong-number-9926315
  (testing "Seven digit number that is an Armstrong number"
    (is (armstrong? 9926315))))

(deftest not-armstrong-number-9926314
  (testing "Seven digit number that is not an Armstrong number"
    (is (not (armstrong? 9926314)))))

(ns armstrong-numbers-test
  (:require [clojure.test :refer [deftest is testing]]
            [armstrong-numbers :refer [armstrong?]]))

(deftest armstrong-number-5
  (testing "Single digit numbers are Armstrong numbers"
    (is (armstrong? 5))))

(deftest not-armstrong-number-10
  (testing "There are no 2 digit Armstrong numbers"
    (is (not (armstrong? 10)))))

(deftest armstrong-number-153
  (testing "Three digit number that is an Armstrong number"
    (is (armstrong? 153))))

(deftest not-armstrong-number-100
  (testing "Three digit number that is not an Armstrong number"
    (is (not (armstrong? 100)))))

(deftest armstrong-number-9474
  (testing "Four digit number that is an Armstrong number"
    (is (armstrong? 9474))))

(deftest not-armstrong-number-9475
  (testing "Four digit number that is not an Armstrong number"
    (is (not (armstrong? 9476)))))

(deftest armstrong-number-9926315
  (testing "Seven digit number that is an Armstrong number"
    (is (armstrong? 9926315))))

(deftest not-armstrong-number-9926314
  (testing "Seven digit number that is not an Armstrong number"
    (is (not (armstrong? 9926314)))))

Fix 3-digit armstrong test description

Fix 3-digit armstrong test description

The description contradicts what is being tested and needs to be in
the negative.


(ns discuss.components.sidebar
  "Controlling the sidebar."
  (:require [om.core :as om]
            [om.dom :as dom]
            [discuss.utils.common :as lib]
            [discuss.utils.views :as vlib]))

(def id (lib/prefix-name "sidebar"))

(defn toggle
  "Toggle visibility of sidebar."
  ([]
   (let [sidebar-dom (.getElementById js/document id)
         main-wrapper (.getElementById js/document "main-wrapper")]
     (lib/toggle-class sidebar-dom "active")
     (lib/toggle-class main-wrapper "active")))
  ([bool]
   (let [sidebar-dom (.getElementById js/document id)
         main-wrapper (.getElementById js/document "main-wrapper")]
     (lib/toggle-class sidebar-dom "active" bool)
     (lib/toggle-class main-wrapper "active" bool))))

(defn show
  "Show sidebar."
  []
  (toggle true))

(defn hide
  "Hide sidebar."
  []
  (toggle false))

;;;; Sidebar
(defn view [data]
  (reify om/IRender
    (render [_]
      (dom/div nil
               (vlib/fa-icon "fa-bars" hide)
               (om/build discuss.views/main-view data)))))

(ns discuss.components.sidebar
  "Controlling the sidebar."
  (:require [om.core :as om]
            [om.dom :as dom]
            [goog.dom :as gdom]
            [discuss.utils.common :as lib]
            [discuss.utils.views :as vlib]))

(def id (lib/prefix-name "sidebar"))

(defn toggle
  "Toggle visibility of sidebar."
  ([]
   (let [sidebar-dom (gdom/getElement id)
         main-wrapper (gdom/getElement "main-wrapper")]
     (lib/toggle-class sidebar-dom "active")
     (lib/toggle-class main-wrapper "active")))
  ([bool]
   (let [sidebar-dom (gdom/getElement id)
         main-wrapper (gdom/getElement "main-wrapper")]
     (lib/toggle-class sidebar-dom "active" bool)
     (lib/toggle-class main-wrapper "active" bool))))

(defn show
  "Show sidebar."
  []
  (toggle true))

(defn hide
  "Hide sidebar."
  []
  (toggle false))

;;;; Sidebar
(defn view [data]
  (reify om/IRender
    (render [_]
      (dom/div nil
               (vlib/fa-icon "fa-bars" hide)
               (om/build discuss.views/main-view data)))))

Use Google Closure to find dom element

Use Google Closure to find dom element


;; All about higher order functions =)
(ns mlpractice.lesson1)

(defn generate-data-set
  "Generates a map of :x y values for linear regression"
  [constant slope num]
  (nth (iterate
        #(let [x (Math/random)]
           (assoc %1 x (+ constant (* slope x)))) {}) num))

(defn hypothesis-fn
  "Builds the hypothesis function h(x) using th0 and th1"
  [theta0 theta1]
  (fn h
    [x]
    (+ theta0 (* theta1 x))))

(defn cost-summation
  "The function that gets applied to every entry in every data set"
  [hypothesis agg data]
  (let [x (first data)
        y (second data)]
    (+ agg (- (hypothesis x) y))))

;;Difference between inside and outside let?
(defn cost-fn
  "Builds the cost function J(th0, th1) for some amount of data"
  [data]
  (let [coefficient (->> data (count) (* 2) (/ 1))]
    (fn cost
      [th0 th1]
      (let [hypothesis (hypothesis-fn th0 th1)]
        (* coefficient
           (reduce (partial cost-summation hypothesis) 0 data))))))

;; All about higher order functions =)
;; Linear Regression with multiple variables

(ns mlpractice.lesson1)

;innefficient because iterate holds onto old maps, should use a different function?
(defn generate-data-set
  "Generates a map of a vector x of feature values
   to its y value for linear regression"
  [data-point-num & coefficients]
  (nth (iterate
        #(let [n (count coefficients)
               x-vec (repeatedly n (fn [] (Math/random)))]
           (assoc %1 x-vec (apply + (map * x-vec coefficients))))
        {})
       data-point-num))

(defn hypothesis-fn
  "Builds the hypothesis function h(x) using a vector theta of coefficients"
  [param-vec]
  (fn h
    [feature-vec]
    (apply + (map * param-vec feature-vec))))

(defn cost-summation
  "The function that finds the error between our hypothesis function
   and our actual y value, and adds it to an aggregate"
  [hypothesis agg data]
  (let [x (first data)
        y (second data)]
    (+ agg (- (hypothesis x) y))))

;;Difference between inside and outside let?
(defn cost-fn
  "Builds the cost function J(th0, th1) for some amount of data"
  [data]
  (let [coefficient (->> data (count) (* 2) (/ 1))]
    (fn cost
      [param-vec]
      (let [hypothesis (hypothesis-fn param-vec)]
        (-> (partial cost-summation hypothesis)
            (reduce 0 data)
            (Math/pow 2)
            (* coefficient))))))

Update lesson 1 to work for linear regression with multiple variables


;; See: https://github.com/kumarshantanu/lein-localrepo
{:user {:plugins [;; Try new api quickly using the repl
                  [lein-try "0.4.3"]

                  ;;[lein-localrepo "0.5.4"]

                  ;; Convert pom.xml to project.clj
                  ;; Note: from https://github.com/thickey/lein-nevam
                  [lein-nevam "0.1.2"]

                  ;; A Leiningen plugin for a superior development environment
                  ;; See: [Introduction Blog Post](https://blog.venanti.us/ultra/)
                  ;; https://github.com/venantius/ultra
                  ;;[venantius/ultra "0.5.2"]

                  ;; Pretty-print a representation of the project map
                  [lein-pprint "1.2.0"]
                  ;; Keep adding more stuff here
                  ]
        ;; Experimental
        :dependencies [[pjstadig/humane-test-output "0.8.3"]]
        :injections [(require 'pjstadig.humane-test-output)
                     (pjstadig.humane-test-output/activate!)]}}

;; See: https://github.com/kumarshantanu/lein-localrepo
{:user {:plugins [;; Try new api quickly using the repl
                  [lein-try "0.4.3"]

                  ;;[lein-localrepo "0.5.4"]

                  ;; Convert pom.xml to project.clj
                  ;; Note: from https://github.com/thickey/lein-nevam
                  [lein-nevam "0.1.2"]

                  ;; A Leiningen plugin for a superior development environment
                  ;; See: [Introduction Blog Post](https://blog.venanti.us/ultra/)
                  ;; https://github.com/venantius/ultra
                  ;;[venantius/ultra "0.5.2"]

                  ;; Pretty-print a representation of the project map
                  [lein-pprint "1.2.0"]
                  ;; Keep adding more stuff here
                  ]
        ;; Experimental
        :dependencies [[pjstadig/humane-test-output "0.8.3"]
                       ;; See: https://github.com/pallet/alembic
                       [alembic "0.3.2"]]
        :injections [(require 'pjstadig.humane-test-output)
                     (pjstadig.humane-test-output/activate!)]}}

Add pallet/alembic to Clojure profile

Add pallet/alembic to Clojure profile


(ns avalon.rules.people
  (:require [bouncer.core :as b]
            [bouncer.validators :as v]
            [avalon.models.crud :as crud]
            [avalon.models.games :as games]))

(defn person-rules [method game]
  (let [taken? (fn [name]
                 (if (= method :post)
                   (= (count (games/people-named game name)) 0)
                   true))]
    {:name [v/required
            [taken? :message "There is already a player with that name"]]}))

(def add-person-rules
  {:status [[#{:waiting} :message "Game already started"]]})

(defn valid-person? [id kw key]
  (fn [ctx]
    (let [game (crud/get games/games id)
          rules (person-rules (get-in ctx [:request :request-method]) game)
          valid (and (b/valid? (kw ctx) rules)
                     (b/valid? game add-person-rules))
          errors (concat (first (b/validate (kw ctx) rules))
                         (first (b/validate game add-person-rules)))]
      [valid {key errors}])))

(def info-rules
  {:status [[#{:playing} :message "Game not started"]]})

(defn valid-info? [game]
  (let [valid (b/valid? game info-rules)
        errors (first (b/validate game info-rules))]
    [valid errors]))

(ns avalon.rules.people
  (:require [bouncer.core :as b]
            [bouncer.validators :as v]
            [avalon.models.crud :as crud]
            [avalon.models.games :as games]))

(defn person-rules [method game]
  (let [taken? (fn [name]
                 (if (= method :post)
                   (= (count (games/people-named game name)) 0)
                   true))]
    {:id [[(fn [_] (some? game)) :message "Game with that code does not exist"]]
     :name [v/required
            [taken? :message "There is already a player with that name"]]}))

(def add-person-rules
  {:status [[#{:waiting} :message "Game already started"]]})

(defn valid-person? [id kw key]
  (fn [ctx]
    (let [game (crud/get games/games id)
          rules (person-rules (get-in ctx [:request :request-method]) game)
          valid (and (b/valid? (kw ctx) rules)
                     (b/valid? game add-person-rules))
          errors (concat (first (b/validate (kw ctx) rules))
                         (first (b/validate game add-person-rules)))]
      [valid {key errors}])))

(def info-rules
  {:status [[#{:playing} :message "Game not started"]]})

(defn valid-info? [game]
  (let [valid (b/valid? game info-rules)
        errors (first (b/validate game info-rules))]
    [valid errors]))

Fix when code doesn't exist

Fix when code doesn't exist


(ns braid.core.client.pages
  (:require
    [spec-tools.data-spec :as ds]
    [braid.core.hooks :as hooks]))

(def page-dataspec
  {:key keyword?
   :on-load fn?
   :view fn?
   (ds/opt :styles) vector?})

(defonce pages
  (hooks/register! (atom {}) {keyword? page-dataspec}))

(defn on-load! [page-id page]
  (when-let [f (get-in @pages [page-id :on-load])]
    (f page)))

(defn get-view [page-id]
  (get-in @pages [page-id :view]))

(ns braid.core.client.pages
  (:require
    [spec-tools.data-spec :as ds]
    [braid.core.hooks :as hooks]))

(def page-dataspec
  {:key keyword?
   :view fn?
   (ds/opt :on-load) fn?
   (ds/opt :styles) vector?})

(defonce pages
  (hooks/register! (atom {}) {keyword? page-dataspec}))

(defn on-load! [page-id page]
  (when-let [f (get-in @pages [page-id :on-load])]
    (f page)))

(defn get-view [page-id]
  (get-in @pages [page-id :view]))

Make on-load key optional as per documentation


(defproject play-clj/lein-template "0.1.0-SNAPSHOT"
  :description "A template for making play-clj projects"
  :url "https://github.com/oakes/play-clj"
  :license {:name "Public Domain"
            :url "http://unlicense.org/UNLICENSE"}
  :dependencies [[lein-droid "0.2.0"]]
  :resource-paths ["resources"]
  :eval-in-leiningen true)

(defproject play-clj/lein-template "0.1.0"
  :description "A template for making play-clj projects"
  :url "https://github.com/oakes/play-clj"
  :license {:name "Public Domain"
            :url "http://unlicense.org/UNLICENSE"}
  :dependencies [[lein-droid "0.2.0"]]
  :resource-paths ["resources"]
  :eval-in-leiningen true)

Update template itself to stable release


(ns cadence.model
  (:refer-clojure :exclude [identity])
  (:require [monger.core :as mg]
            [monger.collection :as mc]
            [cadence.model.validators :as is-valid]
            [cemerick.friend :as friend])
  (:use clojure.walk
        [cemerick.friend.credentials :only [hash-bcrypt]]))

(defn- ensure-indexes []
  (mc/ensure-index "users" {:username 1}))

(defn connect [connection-info]
  (if (:uri connection-info)
    (mg/connect-via-uri! (:uri connection-info))
    (mg/connect!))
  (let [db-name (:db-name connection-info)]
    (mg/authenticate db-name
                     (:username connection-info)
                     (into-array Character/TYPE (:password connection-info)))
    (mg/set-db! (mg/get-db db-name))
    (ensure-indexes)))

(defn get-user [username]
  (mc/find-one-as-map "users" {:username username}))

(defn add-user [user]
  (if (is-valid/user? user)
    (mc/save "users" (assoc user :password (hash-bcrypt (:password user))))))

(def identity #(get friend/*identity* :current))

(defn get-phrase []
  "passwords are so completely last decade")

(ns cadence.model
  (:refer-clojure :exclude [identity])
  (:require [monger.core :as mg]
            [monger.collection :as mc]
            [cadence.model.validators :as is-valid]
            [cemerick.friend :as friend])
  (:use clojure.walk
        [cemerick.friend.credentials :only [hash-bcrypt]]))

(defn- ensure-indexes []
  (mc/ensure-index "users" {:username 1}))

(defn connect [connection-info]
  (if (:uri connection-info)
    (mg/connect-via-uri! (:uri connection-info))
    (mg/connect!))
  (let [db-name (:db-name connection-info)]
    (mg/authenticate db-name
                     (:username connection-info)
                     (into-array Character/TYPE (:password connection-info)))
    (mg/set-db! (mg/get-db db-name))
    (ensure-indexes)))

(defn get-user [username]
  (mc/find-one-as-map "users" {:username username}))

(defn add-user [user]
  (if (is-valid/user? user)
    (mc/save "users" (assoc user :password (hash-bcrypt (:password user))))))

(def identity #(get friend/*identity* :current))

(defn get-phrase []
  "completing this phrase is fun")

Change default phrase to a shorter one.

Change default phrase to a shorter one.


(ns bmihw.submit
  (:require [bmihw.common :refer [auth fb]]
            [reagent-forms.core :refer [bind-fields]]))

(defn update-state! [state key e]
  (let [new-state (swap! state assoc key (-> e .-target .-value))
        {:keys [username keyword content]} new-state
        submit (.querySelector js/document "#submit")]
    (set! (.-disabled submit) (not (and (or (seq username) (seq keyword))
                                        (seq content))))))

(defn submit-to-fb! [state]
  (.push fb
    (clj->js @state)
    (fn [error]
      (when error
        (js/alert (str "An error occurred: " error))))))

(defn submit-page []
  (let [state (atom {})]
    [:div [:h2 "Submit your insult."]
     [:div [:div
            [:input {:type :text :name :username :placeholder "Username"
                     :on-change #(update-state! state :username %)}]
            [:br]
            [:input {:type :text :name :keyword :placeholder "Keyword"
                     :on-change #(update-state! state :keyword %)}]
            [:br]
            [:input {:type :text :name :content :placeholder "Content"
                     :on-change #(update-state! state :content %)}]
            [:br]
            [:input {:type :submit :value "Submit" :id "submit" :disabled true
                     :on-click #(submit-to-fb! state)}]]]]))

(ns bmihw.submit
  (:require [bmihw.common :refer [auth fb]]
            [reagent-forms.core :refer [bind-fields]]))

(defn update-state! [state key e]
  (let [new-state (swap! state assoc key (-> e .-target .-value))
        {:keys [username keyword content]} new-state
        submit (.querySelector js/document "#submit")]
    (set! (.-disabled submit) (not (and (or (seq username) (seq keyword))
                                        (seq content))))))

(defn submit-to-fb! [state]
  (.push fb
    (clj->js (merge @state
                    (select-keys @auth ["uid" "provider"])
                    (select-keys (get @auth "twitter") ["accessToken" "accessTokenSecret" "username"])))
    (fn [error]
      (when error
        (js/alert (str "An error occurred: " error))))))

(defn submit-page []
  (let [state (atom {})]
    [:div [:h2 "Submit your insult."]
     [:div [:div
            [:input {:type :text :name :target-username :placeholder "Username"
                     :on-change #(update-state! state :target-username %)}]
            [:br]
            [:input {:type :text :name :keyword :placeholder "Keyword"
                     :on-change #(update-state! state :keyword %)}]
            [:br]
            [:input {:type :text :name :content :placeholder "Content"
                     :on-change #(update-state! state :content %)}]
            [:br]
            [:input {:type :submit :value "Submit" :id "submit" :disabled true
                     :on-click #(submit-to-fb! state)}]]]]))

SEND MORE STUFF TO FIREBASE

SEND MORE STUFF TO FIREBASE


(ns app.players
  (:require [app.representation :as reps]
            [app.player :as player]
            [app.multiplexer :as mux]
            [app.screen :as screen]))

(defonce index (atom 0))

(defn single [data layout]
  (reify
    player/Player
    (step-fwd [_]
      (reset! layout {:text ((:items (@data 0)) (mod @index (count @data)))
                      :opacity 1.0})
      (swap! index inc))
    (step-rnd [_]
      (reset! layout  {:text (mux/get-item data)
                       :opacity 1.0}))
    (animation [_])
    (render [_]
      [:div {:class "single"
             :key (rand-int 1000000)
             :style {:position "absolute"
                     :opacity 1.0
                     :left "40%"
                     :top "30%"}}
       (:text @layout)])))

(ns app.players
  (:require [app.representation :as reps]
            [app.player :as player]
            [app.multiplexer :as mux]
            [app.screen :as screen]))

(defonce index (atom 0))

(defn single [data layout]
  (reify
    player/Player
    (step-fwd [_]
      (reset! layout [{:text ((:items (@data 0)) (mod @index (count @data)))
                       :key (str (rand-int 100000000))
                       :opacity 1.0}])
      (swap! index inc))
    (step-rnd [_]
      (reset! layout [{:text (mux/get-item data)
                       :key (str (rand-int 100000000))
                       :opacity 1.0}]))
    (animation [_])
    (render [_]
      [:div {:class "single"
             :key (rand-int 1000000)
             :style {:position "absolute"
                     :opacity 1.0
                     :left "40%"
                     :top "30%"}}
       (:text (first @layout) )])))

Fix single mode and switching back to drizzle


(defproject com.howardlewisship.cascade/cascade-core "1.0.0-SNAPSHOT"
  :description "Simple, fast, easy web applications in idiomatic Clojure"
  :url "http://github.com/hlship/cascade/"
  :dependencies
    [[org.clojure/clojure "1.1.0"]
     [org.clojure/clojure-contrib "1.1.0"]
     [org.slf4j/slf4j-api "1.5.2"]

     [org.slf4j/slf4j-log4j12 "1.5.2"]
     [log4j/log4j "1.2.14"]]
  :dev-dependencies
    [[org.eclipse.jetty/jetty-server "7.0.0.RC4"]
     [org.eclipse.jetty/jetty-servlet "7.0.0.RC4"]
     [org.easymock/easymock "2.5.1"]
     [org.seleniumhq.selenium.client-drivers/selenium-java-client-driver "1.0.3"]
     ; oops, need the right classification of this, not yet supported
     [org.seleniumhq.selenium.server/selenium-server "1.0.3"]
     [org.seleniumhq.selenium.server/selenium-server-coreless "1.0.3"]]
  :aot :all
  :warn-on-reflection true
  :source-path "src/main/clojure"
  :test-path "src/test/clojure"
  :resources-path "src/main/resources"
  :jar-dir "target")

(defproject com.howardlewisship.cascade/cascade-core "1.0.0-SNAPSHOT"
  :description "Simple, fast, easy web applications in idiomatic Clojure"
  :url "http://github.com/hlship/cascade/"
  :dependencies
    [[org.clojure/clojure "1.1.0"]
     [org.clojure/clojure-contrib "1.1.0"]
     [org.slf4j/slf4j-api "1.5.2"]

     [org.slf4j/slf4j-log4j12 "1.5.2"]
     [log4j/log4j "1.2.14"]]
  :dev-dependencies
    [[org.eclipse.jetty/jetty-server "7.0.0.RC4"]
     [org.eclipse.jetty/jetty-servlet "7.0.0.RC4"]
     [org.easymock/easymock "2.5.1"]
     [org.seleniumhq.selenium.server/selenium-server "1.0.3" :classifier "standalone"]]
  :aot :all
  :warn-on-reflection true
  :source-path "src/main/clojure"
  :test-path "src/test/clojure"
  :resources-path "src/main/resources"
  :test-resources-path "src/test/resources"
  :jar-dir "target")

Update dependencies to pull Selenium with "standalone" classifier, identify test resources path


(defproject onyx-app/lein-template "0.9.0.8"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.9.0.9-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(defproject etcd-clojure "0.1.5-SNAPSHOT"
  :description "etcd client library in clojure"
  :url "https://github.com/aterreno/etcd-clojure"
  :lein-release {:deploy-via :clojars}
  :license {:name "Apache license version 2"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :scm {:url "git@github.com:aterreno/etcd-clojure.git"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [cheshire "5.2.0"]
                 [clj-http "0.7.7"]])

(defproject etcd-clojure "0.1.5-SNAPSHOT"
  :description "etcd client library in clojure"
  :url "https://github.com/aterreno/etcd-clojure"
  :lein-release {:deploy-via :clojars}
  :license {:name "Apache license version 2"
            :url "http://www.apache.org/licenses/LICENSE-2.0"}
  :scm {:url "git@github.com:aterreno/etcd-clojure.git"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [cheshire "5.3.1"]
                 [clj-http "0.9.1"]])

Bump dependencies for clj-http and cheshire


(defproject org.onyxplatform/onyx-sql "0.7.3-SNAPSHOT"
  :description "Onyx plugin for JDBC-backed SQL databases"
  :url "https://github.com/MichaelDrogalis/onyx-sql"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/java.jdbc "0.3.3"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.7.3-20150827_160450-g706d154"]
                 [java-jdbc/dsl "0.1.3"]
                 [com.mchange/c3p0 "0.9.2.1"]
                 [honeysql "0.5.1"]]
  :profiles {:dev {:dependencies [[midje "1.7.0"]
                                  [environ "1.0.0"]
                                  [mysql/mysql-connector-java "5.1.25"]]
                   :plugins [[lein-midje "3.1.3"]]}
             :circle-ci {:jvm-opts ["-Xmx4g"]}})

(defproject org.onyxplatform/onyx-sql "0.7.3-SNAPSHOT"
  :description "Onyx plugin for JDBC-backed SQL databases"
  :url "https://github.com/MichaelDrogalis/onyx-sql"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/java.jdbc "0.3.3"]
                 ^{:voom {:repo "git@github.com:onyx-platform/onyx.git" :branch "master"}}
                 [org.onyxplatform/onyx "0.7.3-20150827_202930-g49ef67c"]
                 [java-jdbc/dsl "0.1.3"]
                 [com.mchange/c3p0 "0.9.2.1"]
                 [honeysql "0.5.1"]]
  :profiles {:dev {:dependencies [[midje "1.7.0"]
                                  [environ "1.0.0"]
                                  [mysql/mysql-connector-java "5.1.25"]]
                   :plugins [[lein-midje "3.1.3"]]}
             :circle-ci {:jvm-opts ["-Xmx4g"]}})

Update dependency org.onyxplatform/onyx to version 0.7.3-20150827_202930-g49ef67c.

Automatic commit by lein-traffic-control.


(defproject onyx-app/lein-template "0.9.7.0-alpha17"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.9.7.0-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(defproject me.arrdem/oxcart "0.1.0-SNAPSHOT"
  :description "An experimental optimizing compiler for Clojure code"
  :url "http://github.com/arrdem/oxcart"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [
                 [org.clojure/clojure            "1.5.1"]
                 [org.clojure/tools.analyzer.jvm "0.1.0"]
                 [org.clojure/tools.emitter.jvm  "0.1.0"]
                 ])

(defproject me.arrdem/oxcart "0.1.0-SNAPSHOT"
  :description "An experimental optimizing compiler for Clojure code"
  :url "http://github.com/arrdem/oxcart"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [
                 [org.clojure/clojure            "1.5.1"]
                 [org.clojure/tools.analyzer.jvm "0.1.0"]
                 [org.clojure/tools.emitter.jvm  "0.1.0"]
                 [org.clojure/tools.reader       "0.8.4"]
                 ])

Add tools.reader as a dep

Add tools.reader as a dep


(ns desdemona.query-test
  (:require
   [desdemona.query :as q]
   [clojure.test :refer [deftest is]]))

(def dsl->logic
  @#'desdemona.query/dsl->logic)

(deftest dsl->logic-tests
  (is (= '(clojure.core.logic/featurec x {:ip "10.0.0.1"})
         (dsl->logic '(= (:ip x) "10.0.0.1")))))

(deftest dsl-query-tests
  (is (= [[{:ip "10.0.0.1"}]]
         (q/run-dsl-query '(= (:ip x) "10.0.0.1")
                          [{:ip "10.0.0.1"}]))))

(deftest logic-query-tests
  (is (= []
         (q/run-logic-query 'l/fail
                            [{:ip "10.0.0.1"}])))
  (is (= [[{:ip "10.0.0.1"}]]
         (q/run-logic-query '(l/featurec x {:ip "10.0.0.1"})
                            [{:ip "10.0.0.1"}]))))

(ns desdemona.query-test
  (:require
   [desdemona.query :as q]
   [clojure.test :refer [deftest is are]]))

(def dsl->logic
  @#'desdemona.query/dsl->logic)

(deftest dsl->logic-tests
  (is (= '(clojure.core.logic/featurec x {:ip "10.0.0.1"})
         (dsl->logic '(= (:ip x) "10.0.0.1")))))

(deftest dsl-query-tests
  (is (= [[{:ip "10.0.0.1"}]]
         (q/run-dsl-query '(= (:ip x) "10.0.0.1")
                          [{:ip "10.0.0.1"}]))))

(deftest logic-query-tests
  (are [events query results] (= results (q/run-logic-query query events))
    [{:ip "10.0.0.1"}]
    'l/fail
    []

    [{:ip "10.0.0.1"}]
    '(l/featurec x {:ip "10.0.0.1"})
    [[{:ip "10.0.0.1"}]]))

Refactor logic-query-tests to use `are`

Refactor logic-query-tests to use `are`


(ns balance.cmn.pages.task-details-page
  (:require [balance.libs.react-native :as rn]
            [reagent.core :as r]
            [re-frame.core :refer [subscribe dispatch]]
            [balance.libs.rnrf :refer [scene-keys]]))

(def page-key (:task-details-page scene-keys))
(def page-title "Task Details")

(def styles {:page        {:margin-top 64
                           :padding 10}
             :title       {:min-height 40
                           :font-size 20
                           :color "gray"}
             :description {:min-height 40
                           :font-size 14}})

(defn- update-task [id path value]
  (dispatch [:update-task id path value]))

(defn page []
  (fn []
    (let [task (subscribe [:get-current-task])
          {:keys [id title description]} @task]
      [rn/view {:style (:page styles)}
       [rn/text-input {:style                  (:title styles)
                       :value                  title
                       :placeholder            "Title"
                       :multiline              true
                       :placeholder-text-color "gray"
                       :on-change-text         #(update-task id [:title] %)}]
       [rn/text-input {:style                  (:description styles)
                       :value                  description
                       :placeholder            "Task Description"
                       :multiline              true
                       :placeholder-text-color "gray"
                       :on-change-text         #(update-task id [:description] %)}]])))

(ns balance.cmn.pages.task-details-page
  (:require [balance.libs.react-native :as rn]
            [reagent.core :as r]
            [re-frame.core :refer [subscribe dispatch]]
            [balance.libs.rnrf :refer [scene-keys]]))

(def page-key (:task-details-page scene-keys))
(def page-title "Task Details")

(def styles {:page        {:margin-top 64
                           :padding 10}
             :title       {:min-height 40
                           :font-size 20
                           :color "gray"}
             :description {:min-height 40
                           :font-size 14}})

(defn- update-task [id path value]
  (dispatch [:update-task id path value]))

(defn page []
  (fn []
    (let [task (subscribe [:get-current-task])
          {:keys [id title description]} @task]
      [rn/view {:style (:page styles)}
       [rn/text-input {:style                  (:title styles)
                       :default-value          title
                       :placeholder            "Title"
                       :multiline              true
                       :auto-correct           false
                       :placeholder-text-color "gray"
                       :on-change-text         #(update-task id [:title] %)}]
       [rn/text-input {:style                  (:description styles)
                       :default-value          description
                       :placeholder            "Task Description"
                       :multiline              true
                       :auto-correct           false
                       :placeholder-text-color "gray"
                       :on-change-text         #(update-task id [:description] %)}]])))

Remove the debounce from text input

Remove the debounce from text input


(ns comic-reader.api
  (:require [re-frame.core :refer [dispatch]]
            [ajax.core :refer [GET POST]]))

(defn error-handler [{:keys [status status-text]}]
  (.log js/console (str "something bad happened: " status " " status-text)))

(defn get-sites []
  (GET "/api/v1/sites" {:handler #(dispatch [:site-list %])
                        :error-handler error-handler
                        :response-format :edn}))

(defn get-comics [site]
  (GET (format "/api/v1/comics/%s" (pr-str site))
      {:handler #(dispatch [:comic-list %])
       :error-handler error-handler
       :response-format :edn}))

(defn get-comic-urls [comic-name]
  (GET (format "/api/v1/comic/%s" (pr-str comic-name))
      {:handler #(dispatch [:comic-urls %])
       :error-handler error-handler
       :response-format :edn}))

Add API functions for other server calls


(ns lens.reducers
  (:require [clojure.core.reducers :as r])
  (:refer-clojure :exclude [empty? partition-by count]))

(defn partition-by
  "Applies f to each value in coll, splitting it each time f returns
  a new value."
  [f coll]
  (reify
    clojure.core.protocols/CollReduce
    (coll-reduce [this f1]
      (clojure.core.protocols/coll-reduce this f1 (f1)))
    (coll-reduce [_ f1 init]
      (let [result (clojure.core.protocols/coll-reduce
                     coll
                     (fn [accum v]
                       (let [r (f v)
                             vs (:vs accum)]
                         (cond
                           (= r (:last accum))
                           (assoc! accum :vs (conj! vs v))

                           (nil? vs)
                           (-> accum
                               (assoc! :vs (transient [v]))
                               (assoc! :last r))

                           :else
                           (let [ret (f1 (:ret accum) (persistent! vs))]
                             (if (reduced? ret)
                               (reduced {:ret @ret})
                               (assoc! accum :ret ret
                                       :vs (transient [v])
                                       :last r))))))
                     (transient {:ret init}))]
        (if (:vs result)
          (f1 (:ret result) (persistent! (:vs result)))
          (:ret result))))))

(defn empty? [coll]
  (zero? (reduce + (r/take 1 (r/map (constantly 1) coll)))))

(defn count [coll]
  (reduce + (r/map (constantly 1) coll)))

(ns lens.reducers
  (:require [clojure.core.reducers :as r])
  (:refer-clojure :exclude [empty? partition-by count]))

(defn partition-by
  "Applies f to each value in coll, splitting it each time f returns
  a new value."
  [f coll]
  (reify
    clojure.core.protocols/CollReduce
    (coll-reduce [this f1]
      (clojure.core.protocols/coll-reduce this f1 (f1)))
    (coll-reduce [_ f1 init]
      (let [result (clojure.core.protocols/coll-reduce
                     coll
                     (fn [accum v]
                       (let [r (f v)
                             vs (:vs accum)]
                         (cond
                           (= r (:last accum))
                           (assoc! accum :vs (conj! vs v))

                           (nil? vs)
                           (-> accum
                               (assoc! :vs (transient [v]))
                               (assoc! :last r))

                           :else
                           (let [ret (f1 (:ret accum) (persistent! vs))]
                             (if (reduced? ret)
                               (reduced {:ret @ret})
                               (assoc! accum :ret ret
                                       :vs (transient [v])
                                       :last r))))))
                     (transient {:ret init}))]
        (if (:vs result)
          (f1 (:ret result) (persistent! (:vs result)))
          (:ret result))))))

(defn empty? [coll]
  (clojure.core/empty? (into [] (r/take 1 coll))))

(defn count [coll]
  (reduce + (r/map (constantly 1) coll)))

Improve Readability of empty? Implementation


(ns subman.const)

(def db-host "http://127.0.0.1:9200")

(def index-name "subman7")

(def type-addicted 0)

(def type-podnapisi 1)

(def type-opensubtitles 2)

(def type-names {type-addicted "Addicted"
                 type-podnapisi "Podnapisi"
                 type-opensubtitles "OpenSubtitles"})

(def update-deep 10)

(def update-period (* 5 60 60))

(def result-size 100)

(ns subman.const)

(def db-host "http://127.0.0.1:9200")

(def index-name "subman7")

(def type-addicted 0)

(def type-podnapisi 1)

(def type-opensubtitles 2)

(def type-names {type-addicted "Addicted"
                 type-podnapisi "Podnapisi"
                 type-opensubtitles "OpenSubtitles"})

(def update-deep 10)

(def update-period (* 5 60 1000))

(def result-size 100)

Change update period to 5 minutes

Change update period to 5 minutes


{:user
 {:plugins [[lein-vanity "0.2.0"]
            [lein-ancient "0.5.5"]
            [jonase/eastwood "0.1.4"]
            [cider/cider-nrepl "0.8.0-SNAPSHOT"]]
  :dependencies [[slamhound "1.5.5"]]
  :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}

{:user
 {:plugins [[lein-vanity "0.2.0"]
            [lein-ancient "0.5.5"]
            [jonase/eastwood "0.2.0"]
            [cider/cider-nrepl "0.8.1"]]
  :dependencies [[slamhound "1.5.5"]]
  :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}

Bump basic clojure profile dependencies

Bump basic clojure profile dependencies


(ns circle.backend.build.inference
  "fns for creating a build from a source tree"
  (:use circle.util.fs)
  (:require [circle.backend.build.template :as template])
  (:require [circle.backend.action :as action])
  (:require circle.backend.build.inference.rails
            circle.backend.build.inference.php))

(def inference-fns {:rails circle.backend.build.inference.rails/spec
                    :php circle.backend.build.inference.php/spec})

(defn set-inferred [actions]
  (map #(action/set-source % :inferred) actions))

(def action-order [:pre-setup :setup :post-setup :pre-test :test :post-test])

(defn merge-actions [specs]
  (->> specs
       (group-by :type)
       ((apply juxt action-order))
       (apply concat)))

(defn infer-actions
  "Dispatches on repo type returned from (infer-repo-type). Returns a
 seq of build actions."
  [repo]
  (let [actions (->> inference-fns
                     (vals)
                     (mapcat #(% repo))
                     (merge-actions)
                     (set-inferred))]
    ;; if we do an inference, and come up with nothing useful, don't
    ;; add the template, because that would start nodes. Just return []
    (if (seq actions)
      (template/apply-template :build actions)
      [])))

(ns circle.backend.build.inference
  "fns for creating a build from a source tree"
  (:use circle.util.fs)
  (:require [circle.backend.build.template :as template])
  (:require [circle.backend.action :as action])
  (:require circle.backend.build.inference.rails
            circle.backend.build.inference.php))

(def inference-fns {:rails (var circle.backend.build.inference.rails/spec)
                    :php (var circle.backend.build.inference.php/spec)})

(defn set-inferred [actions]
  (map #(action/set-source % :inferred) actions))

(def action-order [:pre-setup :setup :post-setup :pre-test :test :post-test])

(defn merge-actions [specs]
  (->> specs
       (group-by :type)
       ((apply juxt action-order))
       (apply concat)))

(defn infer-actions
  "Dispatches on repo type returned from (infer-repo-type). Returns a
 seq of build actions."
  [repo]
  (let [actions (->> inference-fns
                     (vals)
                     (mapcat #(% repo))
                     (merge-actions)
                     (set-inferred))]
    ;; if we do an inference, and come up with nothing useful, don't
    ;; add the template, because that would start nodes. Just return []
    (if (seq actions)
      (template/apply-template :build actions)
      [])))

Use vars so the fns reload

Use vars so the fns reload


(defproject onyx-app/lein-template "0.11.0.0-alpha2"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.11.0.0-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "MIT License"
            :url "http://choosealicense.com/licenses/mit/#"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(defproject re-frame/lein-template "0.3.20"
  :description "Leiningen template for a Reagent web app that implements the re-frame pattern."
  :url "https://github.com/Day8/re-frame-template"
  :license {:name "MIT"}
  :deploy-repositories [["releases" :clojars]
                        ["snapshots" :clojars]]
  :scm {:name "git"
        :url "https://github.com/Day8/re-frame-template"}
  :eval-in-leiningen true)

(defproject re-frame/lein-template "0.3.21-SNAPSHOT"
  :description "Leiningen template for a Reagent web app that implements the re-frame pattern."
  :url "https://github.com/Day8/re-frame-template"
  :license {:name "MIT"}
  :deploy-repositories [["releases" :clojars]
                        ["snapshots" :clojars]]
  :scm {:name "git"
        :url "https://github.com/Day8/re-frame-template"}
  :eval-in-leiningen true)

Bump template version to SNAPSHOT

Bump template version to SNAPSHOT


(defproject com.draines/postal "3.0.0-SNAPSHOT"
  :description "JavaMail on Clojure"
  :url "https://github.com/drewr/postal"
  :license {:name "MIT"
            :url "http://en.wikipedia.org/wiki/MIT_License"
            :distribution :repo
            :comments "Use at your own risk"}
  :deploy-repositories [["releases" :clojars]]
  :dependencies [[commons-codec "1.9"]
                 [com.sun.mail/javax.mail "1.6.2"]
                 [javax.mail/javax.mail-api "1.6.2"]]
  :global-vars {*warn-on-reflection* true}
  :profiles {:dev {:dependencies []}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
             :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
             :1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}}
  :aliases {"test-all" ["with-profile" "dev,1.7:dev,1.8:dev,1.9" "test"]})

(defproject com.draines/postal "3.0.0-SNAPSHOT"
  :description "JavaMail on Clojure"
  :url "https://github.com/drewr/postal"
  :license {:name "MIT"
            :url "http://en.wikipedia.org/wiki/MIT_License"
            :distribution :repo
            :comments "Use at your own risk"}
  :deploy-repositories [["releases" :clojars]]
  :dependencies [[commons-codec "1.9"]
                 [com.sun.mail/jakarta.mail "1.6.5"]]
  :global-vars {*warn-on-reflection* true}
  :profiles {:dev {:dependencies []}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
             :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
             :1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}}
  :aliases {"test-all" ["with-profile" "dev,1.7:dev,1.8:dev,1.9" "test"]})

Update JavaMail (now Jakarta Mail) to 1.6.5


(defproject cats "0.5.0-SNAPSHOT"
  :description "Category Theory abstractions for Clojure"
  :url "https://github.com/funcool/cats"
  :license {:name "BSD (2 Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies []
  :deploy-repositories {"releases" :clojars
                        "snapshots" :clojars}

  :source-paths ["src"]
  :test-paths ["test"]

  :cljsbuild {:test-commands {"test" ["node" "output/tests.js"]}
              :builds [{:id "test"
                        :source-paths ["src" "test"]
                        :notify-command ["node" "output/tests.js"]
                        :compiler {:output-to "output/tests.js"
                                   :output-dir "output"
                                   :source-map true
                                   :static-fns true
                                   :cache-analysis false
                                   :main cats.runner
                                   :optimizations :none
                                   :target :nodejs
                                   :pretty-print true}}]}

  :jar-exclusions [#"\.swp|\.swo"]

  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]
                                  [org.clojure/clojure "1.7.0-RC2"]
                                  [org.clojure/clojurescript "0.0-3308"]]
                   :codeina {:sources ["src"]
                             :output-dir "doc/codeina"}
                   :plugins [[funcool/codeina "0.1.0-SNAPSHOT"
                              :exclusions [org.clojure/clojure]]
                             [lein-cljsbuild "1.0.6"]]}})

(defproject cats "0.5.0-SNAPSHOT"
  :description "Category Theory abstractions for Clojure"
  :url "https://github.com/funcool/cats"
  :license {:name "BSD (2 Clause)"
            :url "http://opensource.org/licenses/BSD-2-Clause"}
  :dependencies []
  :deploy-repositories {"releases" :clojars
                        "snapshots" :clojars}

  :source-paths ["src"]
  :test-paths ["test"]

  :cljsbuild {:test-commands {"test" ["node" "output/tests.js"]}
              :builds [{:id "test"
                        :source-paths ["src" "test"]
                        :notify-command ["node" "output/tests.js"]
                        :compiler {:output-to "output/tests.js"
                                   :output-dir "output"
                                   :source-map true
                                   :static-fns true
                                   :cache-analysis false
                                   :main cats.runner
                                   :optimizations :none
                                   :target :nodejs
                                   :pretty-print true}}]}

  :jar-exclusions [#"\.swp|\.swo"]
  :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.11"]
                                  [org.clojure/clojure "1.7.0"]
                                  [org.clojure/clojurescript "0.0-3297"]]
                   :codeina {:sources ["src"]
                             :output-dir "doc/codeina"}
                   :plugins [[funcool/codeina "0.1.0-SNAPSHOT"
                              :exclusions [org.clojure/clojure]]
                             [lein-cljsbuild "1.0.6"]]}})

Update clojure version to 1.7.0 and tools.namespace to 0.2.11.


;; The Climate Corporation licenses this file to you under under the Apache
;; License, Version 2.0 (the "License"); you may not use this file except in
;; compliance with the License.  You may obtain a copy of the License at
;;
;;   http://www.apache.org/licenses/LICENSE-2.0
;;
;; See the NOTICE file distributed with this work for additional information
;; regarding copyright ownership.  Unless required by applicable law or agreed
;; to in writing, software distributed under the License is distributed on an
;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
;; or implied.  See the License for the specific language governing permissions
;; and limitations under the License.

(defproject com.climate/claypoole
  "0.4.0"
  :description "Claypoole: Threadpool tools for Clojure."
  :url "http://github.com/TheClimateCorporation/claypoole/"
  :license {:name "Apache License Version 2.0"
            :url http://www.apache.org/licenses/LICENSE-2.0
            :distribution :repo}
  :min-lein-version "2.0.0"
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :pedantic? :warn
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :plugins [[jonase/eastwood "0.2.1"]])

;; The Climate Corporation licenses this file to you under under the Apache
;; License, Version 2.0 (the "License"); you may not use this file except in
;; compliance with the License.  You may obtain a copy of the License at
;;
;;   http://www.apache.org/licenses/LICENSE-2.0
;;
;; See the NOTICE file distributed with this work for additional information
;; regarding copyright ownership.  Unless required by applicable law or agreed
;; to in writing, software distributed under the License is distributed on an
;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
;; or implied.  See the License for the specific language governing permissions
;; and limitations under the License.

(defproject com.climate/claypoole
  "0.4.0-SNAPSHOT"
  :description "Claypoole: Threadpool tools for Clojure."
  :url "http://github.com/TheClimateCorporation/claypoole/"
  :license {:name "Apache License Version 2.0"
            :url http://www.apache.org/licenses/LICENSE-2.0
            :distribution :repo}
  :min-lein-version "2.0.0"
  :source-paths ["src/clj"]
  :java-source-paths ["src/java"]
  :pedantic? :warn
  :dependencies [[org.clojure/clojure "1.6.0"]]
  :plugins [[jonase/eastwood "0.2.1"]])

Change version back to snapshot

Change version back to snapshot


(defproject onyx-app/lein-template "0.8.8.2"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

(defproject onyx-app/lein-template "0.8.8.3-SNAPSHOT"
  :description "Onyx Leiningen application template"
  :url "https://github.com/onyx-platform/onyx-template"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :repositories {"snapshots" {:url "https://clojars.org/repo"
                              :username :env
                              :password :env
                              :sign-releases false}
                 "releases" {:url "https://clojars.org/repo"
                             :username :env
                             :password :env
                             :sign-releases false}}
  :plugins [[lein-set-version "0.4.1"]]
  :profiles {:dev {:plugins [[lein-set-version "0.4.1"]
                             [lein-update-dependency "0.1.2"]
                             [lein-pprint "1.1.1"]]}}
  :eval-in-leiningen true)

Prepare for next release cycle.

Prepare for next release cycle.


(ns web.components.node-link
  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]))

(defui Badge
  Object
  (render [this]
    (let [{:keys [kind]} (om/props this)]
      (dom/span #js {:className "badge"}
        (case kind
          "requirement" "r"
          "component" "c"
          "work-item" "w"
          "tag" "t"
          "?")))))

(def badge (om/factory Badge))

(defui NodeLink
  static om/Ident
  (ident [this props]
    [:node (:name props)])
  static om/IQuery
  (query [this]
    [:name :title :kind])
  Object
  (render [this]
    (let [{:keys [name title kind]} (om/props this)]
      (dom/div #js {:className "node-link"}
        (badge {:kind kind})
        (dom/span #js {:className "node-link-title"} title)
        (dom/span #js {:className "node-link-name"} name)))))

(def node-link (om/factory NodeLink {:key-fn :name}))

(ns web.components.node-link
  (:require [om.next :as om :refer-macros [defui]]
            [om.dom :as dom]
            [web.routing :as routing]))

(defui Badge
  Object
  (render [this]
    (let [{:keys [kind]} (om/props this)]
      (dom/span #js {:className "badge"}
        (case kind
          "requirement" "r"
          "component" "c"
          "work-item" "w"
          "tag" "t"
          "?")))))

(def badge (om/factory Badge))

(def kind->view
  {"requirement" :requirements
   "component" :components
   "work-item" :work-items
   "tag" :tags})

(defn node->route [{:keys [kind name]}]
  {:handler (kind->view kind)
   :route-params {:state '?state
                  :node name}})

(defui NodeLink
  static om/Ident
  (ident [this props]
    [:node (:name props)])
  static om/IQuery
  (query [this]
    [:name :title :kind])
  Object
  (render [this]
    (let [{:keys [name title kind]} (om/props this)
          route (node->route (om/props this))]
      (dom/a #js {:onClick #(routing/activate-route! route)
                  :className "node-link"}
        (badge {:kind kind})
        (dom/span #js {:className "node-link-title"} title)
        (dom/span #js {:className "node-link-name"} name)))))

(def node-link (om/factory NodeLink {:key-fn :name}))

Make node links clickable, redirect to the right view for now


(set-env!
 :source-paths #{"src/main/java" "src/test/java"}
 :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]])

(def +version+ "0.1.0")

(require '[radicalzephyr.boot-junit :refer [junit]])

(task-options!
 pom {:project 'http-server
      :version +version+
      :description "A Java HTTP server."
      :url "https://github.com/RadicalZephyr/http-server"
      :scm {:url "https://github.com/RadicalZephyr/http-server.git"}
      :licens {"MIT" "http://opensource.org/licenses/MIT"}}
 junit {:packages '#{net.zephyrizing.http_server}})

(deftask test
  "Compile and run my jUnit tests."
  []
  (comp (javac)
        (junit)))

(deftask build
  "Build my http server."
  []
  (comp (javac)
        (pom)
        (jar)))

(set-env!
 :source-paths #{"src/main/java" "src/test/java"}
 :dependencies '[[radicalzephyr/boot-junit "0.1.0-SNAPSHOT" :scope "test"]])

(def +version+ "0.1.0")

(require '[radicalzephyr.boot-junit :refer [junit]])

(task-options!
 pom {:project 'http-server
      :version +version+
      :description "A Java HTTP server."
      :url "https://github.com/RadicalZephyr/http-server"
      :scm {:url "https://github.com/RadicalZephyr/http-server.git"}
      :licens {"MIT" "http://opensource.org/licenses/MIT"}}
 junit {:packages '#{net.zephyrizing.http_server}})

(deftask test
  "Compile and run my jUnit tests."
  []
  (comp (javac)
        (junit)))

(deftask build
  "Build my http server."
  []
  (comp (javac)
        (pom)
        (jar)))

Use the clojars version of boot-junit

Use the clojars version of boot-junit


(ns my-noir-lab.views.welcome
  (:require [my-noir-lab.views.common :as common]
            [noir.content.getting-started])
  (:use [noir.core :only [defpage]]
        [hiccup.core :only [html]]))

(defpage "/welcome" []
         (common/layout
           [:p "Welcome to my-noir-lab"]))

(defpage "/my-page" []
  (common/site-layout
   [:h1 "Welcome to my site!"]
   [:p#wrapper "Hope you like it!"]))

(defpage "/range" []
  (common/site-layout
   [:h1 "range 1 100"]
   [:p#wrapper (map #(str "<i>" % "</i> ") (range 1 100))]))

Add a page to display the range method.

Add a page to display the range method.


(ns auricle.subs
  (:require [re-frame.core :refer [reg-sub]]))

(reg-sub
  :current-speaker
  (fn [db _]
    (:current-speaker db)))

(reg-sub
 :db
 (fn [db _]
   db))

(reg-sub
 :loading
 (fn [db _]
   (:loading db)))

(defn format-speaker [speaker]
  (-> speaker
      (update :love count)
      (update :smile count)
      (update :neutral count)
      (update :sleep count)))

(defn format-speakers [speakers]
  (map format-speaker speakers))

(reg-sub
 :speakers
 (fn [db _]
   (-> db
       :speakers
       vals
       (or {})
       (format-speakers))))

(ns auricle.subs
  (:require [re-frame.core :refer [reg-sub]]))

(reg-sub
  :current-speaker
  (fn [db _]
    (:current-speaker db)))

(reg-sub
 :db
 (fn [db _]
   db))

(reg-sub
 :loading
 (fn [db _]
   (:loading db)))

(defn format-speaker [speaker]
  (-> speaker
      (update :love count)
      (update :smile count)
      (update :neutral count)
      (update :sleep count)))

(defn format-speakers [speakers]
  (->> speakers
       (map format-speaker)
       (sort-by :created >)))

(reg-sub
 :speakers
 (fn [db _]
   (-> db
       :speakers
       vals
       (or {})
       (format-speakers))))

Sort speakers by creation date

Sort speakers by creation date


(ns icecap.schema
  (:require [schema.core :as s])
  (:import [java.net URI]))

(def supported-schemes
  "The currently supported schemes."
  #{"http" "https"})

(defn get-scheme
  "Gets the scheme of a (String) URL."
  [url]
  (.getScheme (URI. url)))

(def supported-scheme?
  "Does the given URL have a supported scheme?"
  (comp supported-schemes get-scheme))

(def SimpleRequest
  "A simple request."
  {:target (s/both s/Str
                   (s/pred supported-scheme? "supported-scheme?"))})

(def RequestSpec
  (s/either
   SimpleRequest
   [(s/recursive #'RequestSpec)]
   #{(s/recursive #'RequestSpec)}))

(ns icecap.schema
  (:require [schema.core :as s])
  (:import [java.net URI]))

(def supported-schemes
  "The currently supported schemes."
  #{"http" "https"})

(defn get-scheme
  "Gets the scheme of a (String) URL."
  [url]
  (.getScheme (URI. url)))

(def supported-scheme?
  "Does the given URL have a supported scheme?"
  (comp supported-schemes get-scheme))

(def SimpleRequest
  "A simple request."
  {:target (s/both s/Str
                   (s/pred supported-scheme? "supported-scheme?"))})

(def RequestSpec
  "A request specification.

  Please note that this uses prismatic/schema's `conditional` with
  type dispatch, rather than the (perhaps more obvious) `either`. The
  problem with `either` is that it didn't know which of the schemas
  *probably* should have validated: if you give it a bogus
  `SimpleRequest`, it can only tell you that it:

  - wasn't a valid `SimpleRequest`
  - wasn't an unordered collection of valid `SimpleRequests`
  - wasn't an ordered collection of valid `SimpleRequests`

  ... but it fails to tell you that it *was* something that looked
  like a SimpleRequest but didn't validate because, for example, its
  target was `ftp`, which is an unsupported URL scheme. That would've
  been far more useful. Using `conditional` allows us to return
  this (useful) error message.
  "
  (s/conditional
   map? SimpleRequest
   vector? [(s/recursive #'RequestSpec)]
   set? #{(s/recursive #'RequestSpec)}))

Use s/conditional instead of s/either

Use s/conditional instead of s/either

This gives better error reporting.

Closes #1.


;; Copyright © 2014 JUXT LTD.

(ns modular.aleph
  (:require
   [com.stuartsierra.component :refer (Lifecycle)]
   [schema.core :as s]
   [modular.ring :refer (request-handler WebRequestHandler)]
   [aleph.http :as http]))

(defrecord Webserver []
  Lifecycle
  (start [component]
    (if-let [provider (first (filter #(satisfies? WebRequestHandler %) (vals component)))]
      (let [h (request-handler provider)]
        (assert h)
        (let [server (http/start-server h component)]
          (assoc component :server server)))
      (throw (ex-info (format "aleph http server requires the existence of a component that satisfies %s" WebRequestHandler)
                      {:component component})))

    )
  (stop [component]
    (when-let [server (:server component)]
      (.close server)
      (dissoc component :server))))

(def new-webserver-schema {:port s/Int
                           s/Keyword s/Any})

(defn new-webserver [& {:as opts}]
  (->> opts
    (merge {:port 0})
    (s/validate new-webserver-schema)
    map->Webserver))

;; Copyright © 2014 JUXT LTD.

(ns modular.aleph
  (:require
   [com.stuartsierra.component :refer (Lifecycle)]
   [schema.core :as s]
   [modular.ring :refer (request-handler WebRequestHandler)]
   [aleph.http :as http]
   ))

(defn get-handler
  "Extract the Ring handler from the component"
  [component]
  (or
   ;; Handlers can be specified as a constructor arg
   (:handler component)

   ;; Or as a dependency (which satisfies WebRequestHandler)
   (when-let [provider (first (filter #(satisfies? WebRequestHandler %) (vals component)))]
     (request-handler provider))

   ;; Or an exception is thrown
   (throw (ex-info (format "aleph http server requires a handler, or a dependency that satisfies %s" WebRequestHandler)))))

(defrecord Webserver [handler]
  Lifecycle
  (start [component]
    (let [server (http/start-server (get-handler component) component)]
      (assoc component :server server)))
  (stop [component]
    (when-let [server (:server component)]
      (.close server)
      (dissoc component :server))))

(def new-webserver-schema
  {:port s/Int
   s/Keyword s/Any})

(defn new-webserver [& {:as opts}]
  (->> opts
    (merge {:port 0})
    (s/validate new-webserver-schema)
    map->Webserver))

Support for handler in constructor

Support for handler in constructor


(ns salava.core.i18n
  #?(:cljs (:require-macros [taoensso.tower :as tower-macros]))
     (:require
       #?@(:cljs [[reagent.session :as session]
                  [taoensso.tower :as tower :refer-macros (with-tscope)]])
       #?(:clj  [taoensso.tower :as tower :refer (with-tscope)])))

(def tconfig
  #?(:clj {:fallback-locale :en
           :dev-mode? true
           :dictionary "i18n/dict.clj"}
     :cljs {:fallback-locale :en
            :compiled-dictionary (tower-macros/dict-compile* "i18n/dict.clj")}))

(def translation (tower/make-t tconfig)) ; create translation fn

(defn t [key]
  (let [lang #?(:clj "en"
                :cljs (session/get :lang))]
    (translation lang key)))

(ns salava.core.i18n
  #?(:cljs (:require-macros [taoensso.tower :as tower-macros]))
     (:require
       #?@(:cljs [[reagent.session :as session]
                  [taoensso.tower :as tower :refer-macros (with-tscope)]])
       #?(:clj  [taoensso.tower :as tower :refer (with-tscope)])))

(def tconfig
  #?(:clj {:fallback-locale :en
           :dev-mode? true
           :dictionary "i18n/dict.clj"}
     :cljs {:fallback-locale :en
            :compiled-dictionary (tower-macros/dict-compile* "i18n/dict.clj")}))

(def translation (tower/make-t tconfig)) ; create translation fn

(defn t [key]
  (let [lang #?(:clj "en" :cljs (session/get :lang))
        out-str (translation lang key)]
    (if-not (= out-str "")
      out-str
      (str "[" key "]"))))

Replace missing translations with keys

Replace missing translations with keys

Signed-off-by: Antti Koskinen <7180a8b2eda8ec34b3486f8aa865046413c11ed3@discendum.com>


;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>

(ns uxbox.services.core
  (:require [clojure.walk :as walk]
            [cuerdas.core :as str]
            [uxbox.util.exceptions :as ex]))

(defmulti novelty :type)

(defmulti query :type)

(defmethod novelty :default
  [{:keys [type] :as data}]
  (ex/raise :code ::not-implemented
            :message-category :novelty
            :message-type type))

(defmethod query :default
  [data]
  (ex/raise :code ::not-implemented
            :message-category :query
            :message-type type))

;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>

(ns uxbox.services.core
  (:require [clojure.walk :as walk]
            [cuerdas.core :as str]
            [uxbox.util.exceptions :as ex]))

(defmulti novelty :type)

(defmulti query :type)

(defmethod novelty :default
  [{:keys [type] :as data}]
  (ex/raise :code ::not-implemented
            :message-category :novelty
            :message-type type))

(defmethod query :default
  [{:keys [type] :as data}]
  (ex/raise :code ::not-implemented
            :message-category :query
            :message-type type))

Fix unexpected exception on default service handler.


(ns tutorial.moan.lib
  (:require
    [tutorial.moan.db :as db]))

(defn favorites
  []
  [{:id 1
    :text "This is a fantastic tweet"
    :author {:name "Elon Musk"
             :username "fakeelonmusk"}}
   {:id 2
    :text "Lord but I dislike poetry. How can anyone remember words that aren't put to music?"
    :author {:name "Arliden"
             :username "arl_the_bard"}}])

(ns tutorial.moan.lib
  (:require
    [tutorial.moan.db :as db]))

(defn favorites
  []
  [{:id 1
    :text "This is a fantastic tweet"
    :author {:name "Elon Musk"
             :username "fakeelonmusk"}
    :favorite? true}
   {:id 2
    :text "Lord but I dislike poetry. How can anyone remember words that aren't put to music?"
    :author {:name "Arliden"
             :username "arl_the_bard"}
    :favorite? true}])

Mark mock tweets as favorites

Mark mock tweets as favorites


(ns db-quiz.state
  (:require [reagent.core :as reagent :refer [atom]]))

(defonce app-state
  (atom {:answer nil
         :answers {:correct 0
                   :incorrect 0}
         :board {}
         :current-field nil
         :hint nil
         :language :cs
         :loading? false
         :on-turn (rand-nth [:player-1 :player-2])
         :options {:data-source :dbpedia
                   :despoilerify? true
                   :difficulty :normal
                   :doc ""
                   :labels :numeric
                   :selectors #{:persons
                                :places
                                :works}
                   :share-url ""}
         :players {:player-1 "Dmitrij"
                   :player-2 "Paní M."}
         :timer {:completion 0
                 :start 0}
         :verdict nil
         :winner nil}))

(ns db-quiz.state
  (:require [reagent.core :as reagent :refer [atom]]))

(defonce app-state
  (atom {:answer nil
         :answers {:correct 0
                   :incorrect 0}
         :board {}
         :current-field nil
         :hint nil
         :language :cs
         :loading? false
         :on-turn (rand-nth [:player-1 :player-2])
         :options {:data-source :dbpedia
                   :despoilerify? true
                   :difficulty :easy
                   :doc ""
                   :labels :numeric
                   :selectors #{:persons
                                :places
                                :films}
                   :share-url ""}
         :players {:player-1 "Dmitrij"
                   :player-2 "Paní M."}
         :timer {:completion 0
                 :start 0}
         :verdict nil
         :winner nil}))

Change the default to easy

Change the default to easy


(ns asid.trust-pool
  (:use midje.sweet)
  (:use asid.wallet))

(defrecord Origin [identity url])
(defrecord Trustee [signed-values origin])

(defrecord TrustPool [challenge trustees])

(defn new-trust-pool [req-keys]
  (TrustPool. req-keys []))

(defn add-to-pool [pool owner-wallet joiner challenge-response]
  (let [joiner-origin (Origin. (:identity joiner) (:url joiner))
        trustee (Trustee. (map #(sign owner-wallet (:identity joiner) %1 %2)
                               (:challenge pool)
                               challenge-response) joiner-origin)]
    (TrustPool. (:challenge pool)
                (conj (:trustees pool) trustee))))

(facts "about adding to a trust pool"
  (fact "should add with complete challenge"
    (-> (add-to-pool (TrustPool. [:name] [])
                     (new-wallet)
                     {:identity "id" :url "url"}
                     ["blah"]) :trustees count) => 1))

(ns asid.trust-pool
  (:use midje.sweet)
  (:use asid.wallet))

(defrecord Origin [identity url])
(defrecord Trustee [signed-values origin])

(defrecord TrustPool [challenge trustees])

(defn new-trust-pool [req-keys]
  (TrustPool. req-keys []))

(defn add-to-pool [pool owner-wallet joiner challenge-response]
  (let [joiner-origin (Origin. (:identity joiner) (:url joiner))
        trustee (Trustee. (map #(sign owner-wallet (:identity joiner) %1 %2)
                               (:challenge pool)
                               challenge-response) joiner-origin)]
    (TrustPool. (:challenge pool)
                (conj (:trustees pool) trustee))))

(facts "about adding to a trust pool"
  (fact "should add with complete challenge"
    (-> (add-to-pool (TrustPool. [:name] [])
                     (new-wallet "id seed")
                     {:identity "id" :url "url"}
                     ["blah"]) :trustees count) => 1))

Fix failing test as a result of changing interface.


(ns discuss.debug
  "Show information for debugging."
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]
            [discuss.lib :as lib]))

(defn debug-view [data _owner]
  (reify om/IRender
    (render [_]
      (dom/div nil
               (dom/h4 nil "Last API call")
               (dom/pre nil (get-in data [:debug :last-api]))

               (dom/h4 nil "Last response")
               (dom/pre nil
                        (apply dom/ul nil
                               (map (fn [[k v]] (dom/li nil (str k "\t\t" v))) (get-in data [:debug :response]))))

               (dom/h4 nil "Token")
               (dom/pre nil (get-in data [:user :token]))
               ))))

(defn update
  "Update displayed debug information."
  [key val]
  (lib/update-state-item! :debug key (fn [_] val)))

(ns discuss.debug
  "Show information for debugging."
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]
            [discuss.lib :as lib]))

(defn debug-view [data _owner]
  (reify om/IRender
    (render [_]
      (dom/div nil
               (dom/h4 nil "Last API call")
               (dom/pre nil (get-in data [:debug :last-api]))
               (dom/button #js {:className "btn btn-default"
                                :onClick #(discuss.communication/ajax-get (get-in data [:debug :last-api]))}
                           "Resend API Call")

               (dom/h4 nil "Last response")
               (dom/pre nil
                        (apply dom/ul nil
                               (map (fn [[k v]] (dom/li nil (str k "\t\t" v))) (get-in data [:debug :response]))))

               (dom/h4 nil "Token")
               (dom/pre nil (get-in data [:user :token]))
               ))))

(defn update
  "Update displayed debug information."
  [key val]
  (lib/update-state-item! :debug key (fn [_] val)))

Add button to resend API call

Add button to resend API call


`{:name "link-bio-with-nil"
  :description "This link-bio-with-properties rule requires both
  things being linked to be 'bioentities' and thus this rule excludes
  links within RDF lists that connect to rdf:nil. This rule fills in
  those missing links."
  :head ((?/bio ?/p rdf/nil))
  :body ((?/c obo/IAO_0000219 ?/bio)
         (?/c ?/p rdf/nil))}

`{:name "transfer-rdf-list-links-with-nil"
  :description "This rule transfers links to rdf:nil from list members to bio world. These links are
  predominantly '?x rdf:rest rdf/nil'."
  :head ((?/bio_list_member ?/p rdf/nil))
  :sparql-string "select ?bio_list_member ?p {
  ?list_record rdf:type ccp:IAO_EXT_0000317 .
  ?list_record obo:IAO_0000219 ?list_member .
  ?list_member ?p rdf:nil .
  ?list_record obo:IAO_0000219 ?bio_list_member .
  filter (?list_member != ?bio_list_member)
  }"}

Add transfer-rdf-list-links-with-nil to connect rdf:List members to nil where appropriate


(defproject tailrecursion/boot-classloader "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure             "1.5.1"]
                 [org.springframework/spring-core "1.2.2"]
                 [com.cemerick/pomegranate        "0.2.0" :exclusions [org.clojure/clojure]]]
  :main ^:skip-aot tailrecursion.boot-classloader
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})

(defproject tailrecursion/boot-classloader "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure             "1.5.1"]
                 [org.springframework/spring-core "1.2.2"]
                 [com.cemerick/pomegranate        "0.2.0" :exclusions [org.clojure/clojure]]]
  :main ^:skip-aot tailrecursion.boot-classloader
  :target-path "target" ; force target-path to maintain 2.3 compatibility
  :profiles {:uberjar {:aot :all}})

Set target-path to maintain compatibility with lein 2.3


(defproject mvxcvi/multihash "1.1.0-SNAPSHOT"
  :description "Native Clojure implementation of the multihash standard."
  :url "https://github.com/greglook/clj-multihash"
  :license {:name "Public Domain"
            :url "http://unlicense.org/"}

  :deploy-branches ["master"]

  :plugins
  [[lein-cloverage "1.0.6"]]

  :dependencies
  [[org.clojure/clojure "1.7.0"]]

  :codox {:metadata {:doc/format :markdown}
          :source-uri "https://github.com/greglook/clj-multihash/blob/master/{filepath}#L{line}"
          :doc-paths ["doc/extra"]
          :output-path "doc/api"})

(defproject mvxcvi/multihash "1.1.0-SNAPSHOT"
  :description "Native Clojure implementation of the multihash standard."
  :url "https://github.com/greglook/clj-multihash"
  :license {:name "Public Domain"
            :url "http://unlicense.org/"}

  :deploy-branches ["master"]

  :plugins
  [[lein-cloverage "1.0.6"]]

  :dependencies
  [[org.clojure/clojure "1.7.0"]]

  :codox {:metadata {:doc/format :markdown}
          :source-uri "https://github.com/greglook/clj-multihash/blob/master/{filepath}#L{line}"
          :doc-paths ["doc/extra"]
          :output-path "doc/api"}

  :whidbey {:tag-types {'multihash.core.Multihash {'data/hash 'multihash.core/base58}}})

Add tag type for whidbey.

Add tag type for whidbey.


(defproject test-utils "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [kixi/stats "0.5.2"]]
  :repl-options {:init-ns test-utils.core}
  :source-paths ["src", "test"])

(defproject test-utils "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [kixi/stats "0.5.2"]]
  :repl-options {:init (require '[test-utils
                                  [core :as tuc]
                                  [address :as addr]
                                  [fracture-diagnostics :as fd]
                                  [retail :as tur]
                                  [sandbox :as sb]
                                  [word-source :as ws]])
                 }
  :source-paths ["src", "test"])

Initialize the REPL with typical modules


(defproject lapmachine "0.1.0"
  :description "A Language/Action Perspective-based engine for pragmatic interaction on the Web"
  :url "http://github.com/bpdp/lapmachine"
  :license {:name "Eclipse Public License v 1.0"
            :url "https://www.eclipse.org/org/documents/epl-v10.php"}
  :main lapmachine.repl
  :ring {:handler lapmachine.interact/handler}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [instaparse "1.3.4"]
                 [liberator "0.12.2"]
                 [compojure "1.2.2"]
                 [ring/ring-core "1.3.2"]]
  :dev-dependencies
                [[ring/ring-devel "1.3.2"]])

(defproject lapmachine "0.1.0"
  :description "A Language/Action Perspective-based engine for pragmatic interaction on the Web"
  :url "http://github.com/bpdp/lapmachine"
  :license {:name "Eclipse Public License v 1.0"
            :url "https://www.eclipse.org/org/documents/epl-v10.php"}
  :main lapmachine.repl
  :ring {:handler lapmachine.interact/handler}
  :repositories [["bigdata" "http://systap.com/maven/releases"]
                 ["nxparser" "http://nxparser.googlecode.com/svn/repository"]
                 ["sonatype" "https://oss.sonatype.org/content/repositories/releases"]
                 ["apache" "http://repository.apache.org/content/repositories/releases"]]
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [instaparse "1.3.5"]
                 [liberator "0.12.2"]
                 [compojure "1.3.0"]
                 [ring/ring-core "1.3.2"]
                 [com.bigdata/bigdata "1.4.0"]]
  :dev-dependencies
                [[ring/ring-devel "1.3.2"]])

Add bigdata 1.4.0 and its dependencies

Add bigdata 1.4.0 and its dependencies


(defproject degasolv/degasolv "1.4.0"
  :description "Dependency tracker with an eye toward building and shipping software."
  :url "http://github.com/djhaskin987/degasolv"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main degasolv.cli
  :dependencies [
                 [org.clojure/clojure "1.9.0-alpha14"]
                 [serovers "1.1.0"]
                 [org.clojure/tools.cli "0.3.5"]
                 [me.raynes/fs "1.4.6"]
                 [com.velisco/tagged "0.5.0"]
                 [tupelo "0.9.31"]
                 ]
  :plugins [[lein-print "0.1.0"]]
  :test-selectors
  {
   :resolve-basic :resolve-basic
   :resolve-harden :resolve-harden
   :string-to-requirement :string-to-requirement
   :repo-aggregation :repo-aggregation
   :resolve-conflict-strat :resolve-conflict-strat
   }
  :profiles {
             :dev {:dependencies [
                                  [tupelo "0.9.31"]
                                  [serovers "1.1.0"
                                   :exclusions [org.clojure/clojure]]
                                  ]}
             :uberjar {:aot [
                             degasolv.pkgsys.core
                             degasolv.pkgsys.apt
                             degasolv.util
                             degasolv.resolver
                             degasolv.cli
                             ]}
             }
  :target-path "target/%s")

(defproject degasolv/degasolv "1.4.1-SNAPSHOT"
  :description "Dependency tracker with an eye toward building and shipping software."
  :url "http://github.com/djhaskin987/degasolv"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main degasolv.cli
  :dependencies [
                 [org.clojure/clojure "1.9.0-alpha14"]
                 [serovers "1.1.0"]
                 [org.clojure/tools.cli "0.3.5"]
                 [me.raynes/fs "1.4.6"]
                 [com.velisco/tagged "0.5.0"]
                 [tupelo "0.9.31"]
                 ]
  :plugins [[lein-print "0.1.0"]]
  :test-selectors
  {
   :resolve-basic :resolve-basic
   :resolve-harden :resolve-harden
   :string-to-requirement :string-to-requirement
   :repo-aggregation :repo-aggregation
   :resolve-conflict-strat :resolve-conflict-strat
   }
  :profiles {
             :dev {:dependencies [
                                  [tupelo "0.9.31"]
                                  [serovers "1.1.0"
                                   :exclusions [org.clojure/clojure]]
                                  ]}
             :uberjar {:aot [
                             degasolv.pkgsys.core
                             degasolv.pkgsys.apt
                             degasolv.util
                             degasolv.resolver
                             degasolv.cli
                             ]}
             }
  :target-path "target/%s")

Bump version number to 1.4.1-SNAPSHOT

Bump version number to 1.4.1-SNAPSHOT


(defproject riverford/compound "0.5.0-alpha4"
  :description "A micro structure for reagent data"
  :url "https://github.com/riverford/compound"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0-RC2"]
                 [org.clojure/spec.alpha "0.1.143"]]
  :publish {:site "compound"
            :theme "bolton"
            :output "docs"
            :template {:author "Daniel Neal"
                       :logo-white "img/compound_small.png"
                       :email "danielneal@riverford.co.uk"}
            :files {"index" {:input "test/compound/docs.cljc"
                             :site "compound"
                             :title "core"
                             :subtitle "api docs"}}}
  :profiles {:dev {:dependencies [[im.chit/lucid.publish "1.3.13"]
                                  [orchestra "2017.11.12-1"]]}})

(defproject riverford/compound "2017.12.20-1"
  :description "A micro structure for reagent data"
  :url "https://github.com/riverford/compound"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0-RC2"]
                 [org.clojure/spec.alpha "0.1.143"]]
  :publish {:site "compound"
            :theme "bolton"
            :output "docs"
            :template {:author "Daniel Neal"
                       :logo-white "img/compound_small.png"
                       :email "danielneal@riverford.co.uk"}
            :files {"index" {:input "test/compound/docs.cljc"
                             :site "compound"
                             :title "core"
                             :subtitle "api docs"}}}
  :profiles {:dev {:dependencies [[im.chit/lucid.publish "1.3.13"]
                                  [orchestra "2017.11.12-1"]]}})

Change numbering system for releases

Change numbering system for releases


(defproject jungerer "0.1.2-SNAPSHOT"
  :description "Clojure network/graph library wrapping JUNG"
  :url "https://github.com/totakke/jungerer"
  :license {:name "The BSD 3-Clause License"
            :url "https://opensource.org/licenses/BSD-3-Clause"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [net.sf.jung/jung-algorithms "2.1"]
                 [net.sf.jung/jung-api "2.1"]
                 [net.sf.jung/jung-graph-impl "2.1"]
                 [net.sf.jung/jung-visualization "2.1"]]
  :profiles {:dev {:global-vars {*warn-on-reflection* true}}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}}
  :codox {:source-uri "https://github.com/totakke/jungerer/blob/{version}/{filepath}#L{line}"})

(defproject jungerer "0.1.2-SNAPSHOT"
  :description "Clojure network/graph library wrapping JUNG"
  :url "https://github.com/totakke/jungerer"
  :license {:name "The BSD 3-Clause License"
            :url "https://opensource.org/licenses/BSD-3-Clause"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [net.sf.jung/jung-algorithms "2.1"]
                 [net.sf.jung/jung-api "2.1"]
                 [net.sf.jung/jung-graph-impl "2.1"]
                 [net.sf.jung/jung-visualization "2.1"]]
  :profiles {:dev {:global-vars {*warn-on-reflection* true}
                   :resource-paths ["dev-resources"]}
             :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]
                   :resource-paths ["dev-resources"]}}
  :codox {:source-uri "https://github.com/totakke/jungerer/blob/{version}/{filepath}#L{line}"})

Add `dev-resources` to `resource-paths` of profile dev and 1.7


(defproject madouc "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [ring/ring-core "1.5.1"]
                 [ring/ring-devel "1.5.1"]
                 [ring-logger "0.7.7"]
                 [ring-logger-timbre "0.7.5"]
                 [com.taoensso/timbre "4.8.0"]
                 [com.fzakaria/slf4j-timbre "0.3.4"]
                 [compojure "1.5.2"]
                 [metosin/compojure-api "1.1.10"]
                 [yogthos/config "0.8"]
                 [org.immutant/web "2.1.6"
                  :exclusions [ch.qos.logback/logback-classic]]
                 [selmer "1.10.6"]
                 [mount "0.1.11"]]
  :main madouc.core
  :profiles {:dev {:resource-paths ["config/dev"]}
             :prod {:resource-paths ["config/prod"]}
             :uberjar {:aot :all}})

(defproject madouc "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [ring/ring-core "1.5.1"]
                 [ring/ring-devel "1.5.1"]
                 [ring-logger "0.7.7"]
                 [ring-logger-timbre "0.7.5"]
                 [com.taoensso/timbre "4.8.0"]
                 [com.fzakaria/slf4j-timbre "0.3.4"]
                 [compojure "1.5.2"]
                 [metosin/compojure-api "1.1.10"]
                 [yogthos/config "0.8"]
                 [org.immutant/web "2.1.6"
                  :exclusions [ch.qos.logback/logback-classic]]
                 [selmer "1.10.6"]
                 [mount "0.1.11"]
                 [conman "0.6.3"]
                 [mysql/mysql-connector-java "5.1.40"]]
  :main madouc.core
  :profiles {:dev {:resource-paths ["config/dev"]}
             :prod {:resource-paths ["config/prod"]}
             :uberjar {:aot :all}})

Add conman and mysql deps

Add conman and mysql deps


(defproject com.howardlewisship/bgg-graphql-proxy "0.12.0"
  :description "GraphQL interface to BoardGameGeek"
  :dependencies [[org.clojure/clojure "1.9.0-alpha14"]
                 [io.aviso/logging "0.2.0"]
                 [com.walmartlabs/lacinia "NEXT"]
                 [clj-http "2.3.0"]
                 [org.clojure/data.json "0.2.6"]
                 [org.clojure/data.xml "0.0.8"]
                 [io.pedestal/pedestal.service "0.5.2"]
                 [io.pedestal/pedestal.jetty "0.5.2"]]
  :repositories [["ereceipts-releases"
                  "http://dfw-receipts-jenkins.mobile.walmart.com:8081/nexus/content/repositories/releases/"]]
  :codox {:source-uri ""
          :metadata {:doc/format :markdown}})

(defproject com.howardlewisship/bgg-graphql-proxy "0.12.0"
  :description "GraphQL interface to BoardGameGeek"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [io.aviso/logging "0.2.0"]
                 [com.walmartlabs/lacinia "NEXT"]
                 [clj-http "2.3.0"]
                 [org.clojure/data.json "0.2.6"]
                 [org.clojure/data.xml "0.0.8"]
                 [io.pedestal/pedestal.service "0.5.2"]
                 [io.pedestal/pedestal.jetty "0.5.2"]]
  :repositories [["ereceipts-releases"
                  "http://dfw-receipts-jenkins.mobile.walmart.com:8081/nexus/content/repositories/releases/"]]
  :codox {:source-uri ""
          :metadata {:doc/format :markdown}})

Switch over to latest Lacinia, based on Clojure 1.8


(defproject pjstadig/assertions "0.2.0-SNAPSHOT"
  :description "Zero penalty runtime assertions for Clojure."
  :url "http://github.com/pjstadig/assert"
  :license {:name "Mozilla Public License, v. 2.0"
            :url "http://mozilla.org/MPL/2.0/"}
  :dependencies [[org.clojure/clojure "1.5.1"]]
  :java-source-paths ["src"])

(defproject pjstadig/assertions "0.2.0-SNAPSHOT"
  :description "Zero penalty runtime assertions for Clojure."
  :url "http://github.com/pjstadig/assert"
  :license {:name "Mozilla Public License, v. 2.0"
            :url "http://mozilla.org/MPL/2.0/"}
  :deploy-repositories [["releases" :clojars]]
  :dependencies [[org.clojure/clojure "1.5.1"]]
  :java-source-paths ["src"])

Add clojars as release repository.

Add clojars as release repository.


(defproject io.aviso/twixt "0.1.4"
  :description "An extensible asset pipeline for Clojure web applications"
  :url "https://github.com/AvisoNovate/twixt"
  :license {:name "Apache Sofware Licencse 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [ring/ring-core "1.2.0"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.1.2"]
                 [de.neuland/jade4j "0.3.15"]
                 [io.aviso/pretty "0.1.4"]
                 [hiccup "1.0.4"]]
  :repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
  :codox {:src-dir-uri               "https://github.com/AvisoNovate/twixt/blob/master/"
          :src-linenum-anchor-prefix "L"}
  :profiles {:dev {:dependencies [[log4j "1.2.17"]
                                  [ring/ring-jetty-adapter "1.2.0"]]}})

(defproject io.aviso/twixt "0.1.4"
  :description "An extensible asset pipeline for Clojure web applications"
  :url "https://github.com/AvisoNovate/twixt"
  :license {:name "Apache Sofware Licencse 2.0"
            :url  "http://www.apache.org/licenses/LICENSE-2.0.html"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [org.clojure/tools.logging "0.2.6"]
                 [ring/ring-core "1.2.0"]
                 [org.mozilla/rhino "1.7R4"]
                 [com.github.sommeri/less4j "1.1.2"]
                 [de.neuland/jade4j "0.3.15"]
                 [io.aviso/pretty "0.1.5"]
                 [hiccup "1.0.4"]]
  :repositories [["jade4j" "https://raw.github.com/neuland/jade4j/master/releases"]]
  :codox {:src-dir-uri               "https://github.com/AvisoNovate/twixt/blob/master/"
          :src-linenum-anchor-prefix "L"}
  :profiles {:dev {:dependencies [[log4j "1.2.17"]
                                  [ring/ring-jetty-adapter "1.2.0"]]}})

Update dependency for pretty to 0.1.5

Update dependency for pretty to 0.1.5