├── 1.Simple-Producer-Consumer └── simple-core-async │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── doc │ └── intro.md │ ├── project.clj │ ├── src │ └── simple_core_async │ │ └── core.clj │ └── test │ └── simple_core_async │ └── core_test.clj ├── 2.Multi-Chan-Producer-Consumer └── multi-chan-core-async │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── doc │ └── intro.md │ ├── project.clj │ ├── src │ └── multi_chan_core_async │ │ └── core.clj │ └── test │ └── multi_chan_core_async │ └── core_test.clj ├── 3.Tim-Baldridge-10k-Processes └── baldridge-10000 │ ├── index.html │ ├── project.clj │ ├── resources │ └── public │ │ ├── css │ │ └── page.css │ │ ├── help.html │ │ └── js │ │ ├── cljs.js │ │ ├── cljs │ │ ├── core.cljs │ │ ├── core.js │ │ └── core │ │ │ ├── async.cljs │ │ │ ├── async.js │ │ │ └── async │ │ │ └── impl │ │ │ ├── buffers.cljs │ │ │ ├── buffers.js │ │ │ ├── channels.cljs │ │ │ ├── channels.js │ │ │ ├── dispatch.cljs │ │ │ ├── dispatch.js │ │ │ ├── ioc_helpers.cljs │ │ │ ├── ioc_helpers.js │ │ │ ├── protocols.cljs │ │ │ ├── protocols.js │ │ │ ├── timers.cljs │ │ │ └── timers.js │ │ ├── goog │ │ ├── array │ │ │ └── array.js │ │ ├── asserts │ │ │ └── asserts.js │ │ ├── base.js │ │ ├── debug │ │ │ └── error.js │ │ ├── deps.js │ │ ├── object │ │ │ └── object.js │ │ └── string │ │ │ ├── string.js │ │ │ └── stringbuffer.js │ │ ├── hello_clojurescript.js │ │ └── hello_clojurescript │ │ └── client.js │ ├── src │ └── cljs │ │ └── baldridge_10000 │ │ └── client.cljs │ └── target │ ├── cljsbuild-compiler-0 │ ├── cljs │ │ ├── core.cljs │ │ └── core.js │ ├── goog │ │ ├── array │ │ │ └── array.js │ │ ├── asserts │ │ │ └── asserts.js │ │ ├── base.js │ │ ├── debug │ │ │ └── error.js │ │ ├── deps.js │ │ ├── object │ │ │ └── object.js │ │ └── string │ │ │ ├── string.js │ │ │ └── stringbuffer.js │ └── hello_clojurescript.js │ ├── cljsbuild-main.js │ └── stale │ └── extract-native.dependencies ├── 4.Not-10K-Processes └── 10K-no-async │ ├── index.html │ └── js │ └── 10K.js ├── 5.David-Nolen-Display-Pipeline ├── 10,000 Processes.html └── assets │ ├── images │ ├── bb.jpg │ ├── lt.jpg │ ├── om.jpg │ └── sourcemap.png │ ├── js │ ├── blog │ │ ├── processes │ │ │ ├── core.cljs │ │ │ ├── core.js │ │ │ └── core.js.map │ │ └── utils │ │ │ ├── dom.cljs │ │ │ ├── dom.js │ │ │ ├── dom.js.map │ │ │ ├── helpers.cljs │ │ │ ├── helpers.js │ │ │ ├── helpers.js.map │ │ │ ├── node.cljs │ │ │ ├── node.js │ │ │ ├── node.js.map │ │ │ ├── reactive.cljs │ │ │ ├── reactive.js │ │ │ └── reactive.js.map │ ├── cljs │ │ ├── core.cljs │ │ ├── core.js │ │ ├── core.js.map │ │ └── core │ │ │ ├── async.cljs │ │ │ ├── async.js │ │ │ ├── async.js.map │ │ │ └── async │ │ │ └── impl │ │ │ ├── buffers.cljs │ │ │ ├── buffers.js │ │ │ ├── buffers.js.map │ │ │ ├── channels.cljs │ │ │ ├── channels.js │ │ │ ├── channels.js.map │ │ │ ├── dispatch.cljs │ │ │ ├── dispatch.js │ │ │ ├── dispatch.js.map │ │ │ ├── ioc_helpers.cljs │ │ │ ├── ioc_helpers.js │ │ │ ├── ioc_helpers.js.map │ │ │ ├── protocols.cljs │ │ │ ├── protocols.js │ │ │ ├── protocols.js.map │ │ │ ├── timers.cljs │ │ │ ├── timers.js │ │ │ └── timers.js.map │ ├── goog │ │ ├── array │ │ │ └── array.js │ │ ├── asserts │ │ │ └── asserts.js │ │ ├── base.js │ │ ├── debug │ │ │ ├── entrypointregistry.js │ │ │ ├── error.js │ │ │ └── errorhandlerweakdep.js │ │ ├── deps.js │ │ ├── disposable │ │ │ ├── disposable.js │ │ │ └── idisposable.js │ │ ├── dom │ │ │ ├── browserfeature.js │ │ │ ├── classes.js │ │ │ ├── dom.js │ │ │ ├── tagname.js │ │ │ └── vendor.js │ │ ├── events │ │ │ ├── browserevent.js │ │ │ ├── browserfeature.js │ │ │ ├── event.js │ │ │ ├── events.js │ │ │ ├── eventtype.js │ │ │ ├── eventwrapper.js │ │ │ ├── listenable.js │ │ │ └── listener.js │ │ ├── iter │ │ │ └── iter.js │ │ ├── math │ │ │ ├── box.js │ │ │ ├── coordinate.js │ │ │ ├── math.js │ │ │ ├── rect.js │ │ │ └── size.js │ │ ├── mochikit │ │ │ └── async │ │ │ │ └── deferred.js │ │ ├── net │ │ │ ├── jsloader.js │ │ │ └── jsonp.js │ │ ├── object │ │ │ └── object.js │ │ ├── reflect │ │ │ └── reflect.js │ │ ├── string │ │ │ ├── string.js │ │ │ └── stringbuffer.js │ │ ├── structs │ │ │ ├── map.js │ │ │ └── structs.js │ │ ├── style │ │ │ └── style.js │ │ ├── uri │ │ │ ├── uri.js │ │ │ └── utils.js │ │ └── useragent │ │ │ └── useragent.js │ ├── proc.js │ └── proc_.js │ └── themes │ └── tom │ ├── css │ ├── lmroman10-regular-demo.html │ ├── lmroman10-regular-webfont.eot │ ├── lmroman10-regular-webfont.svg │ ├── lmroman10-regular-webfont.ttf │ ├── lmroman10-regular-webfont.woff │ ├── screen.css │ └── syntax.css │ └── images │ └── rss.png ├── 6.Rich-Hickey-Original-Ants └── ants-demo │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── doc │ └── intro.md │ ├── project.clj │ ├── src │ └── ants_demo │ │ └── core.clj │ └── test │ └── ants_demo │ └── core_test.clj ├── 7.Ants-CLJS-Single-Threaded └── ants-cljs │ ├── .lein-repl-history │ ├── ants_cljs.js │ ├── cljs workflow.rtf │ ├── css │ ├── main.css │ └── normalize.css │ ├── index.html │ ├── out │ ├── ants_cljs │ │ ├── core.cljs │ │ ├── core.js │ │ └── core.js.map │ ├── cljs │ │ ├── core.cljs │ │ ├── core.js │ │ ├── core.js.map │ │ └── core │ │ │ ├── async.cljs │ │ │ ├── async.js │ │ │ ├── async.js.map │ │ │ └── async │ │ │ └── impl │ │ │ ├── buffers.cljs │ │ │ ├── buffers.js │ │ │ ├── buffers.js.map │ │ │ ├── channels.cljs │ │ │ ├── channels.js │ │ │ ├── channels.js.map │ │ │ ├── dispatch.cljs │ │ │ ├── dispatch.js │ │ │ ├── dispatch.js.map │ │ │ ├── ioc_helpers.cljs │ │ │ ├── ioc_helpers.js │ │ │ ├── ioc_helpers.js.map │ │ │ ├── protocols.cljs │ │ │ ├── protocols.js │ │ │ ├── protocols.js.map │ │ │ ├── timers.cljs │ │ │ ├── timers.js │ │ │ └── timers.js.map │ └── goog │ │ ├── array │ │ └── array.js │ │ ├── asserts │ │ └── asserts.js │ │ ├── base.js │ │ ├── debug │ │ ├── entrypointregistry.js │ │ ├── error.js │ │ └── errorhandlerweakdep.js │ │ ├── deps.js │ │ ├── disposable │ │ ├── disposable.js │ │ └── idisposable.js │ │ ├── dom │ │ ├── browserfeature.js │ │ ├── classes.js │ │ ├── dom.js │ │ ├── nodetype.js │ │ └── tagname.js │ │ ├── events │ │ ├── browserevent.js │ │ ├── browserfeature.js │ │ ├── event.js │ │ ├── eventid.js │ │ ├── events.js │ │ ├── eventtype.js │ │ ├── eventwrapper.js │ │ ├── listenable.js │ │ ├── listener.js │ │ └── listenermap.js │ │ ├── functions │ │ └── functions.js │ │ ├── math │ │ ├── coordinate.js │ │ ├── math.js │ │ └── size.js │ │ ├── object │ │ └── object.js │ │ ├── reflect │ │ └── reflect.js │ │ ├── string │ │ ├── string.js │ │ └── stringbuffer.js │ │ └── useragent │ │ └── useragent.js │ ├── project.clj │ ├── src │ └── ants_cljs │ │ └── core.cljs │ └── target │ └── stale │ └── extract-native.dependencies ├── 8.Ants-CLJS-Core-Async └── ants-cljs │ ├── .lein-repl-history │ ├── ants_cljs.js │ ├── css │ ├── main.css │ └── normalize.css │ ├── index.html │ ├── out │ ├── ants_cljs │ │ ├── core.cljs │ │ ├── core.js │ │ └── core.js.map │ ├── cljs │ │ ├── core.cljs │ │ ├── core.js │ │ ├── core.js.map │ │ └── core │ │ │ ├── async.cljs │ │ │ ├── async.js │ │ │ ├── async.js.map │ │ │ └── async │ │ │ └── impl │ │ │ ├── buffers.cljs │ │ │ ├── buffers.js │ │ │ ├── buffers.js.map │ │ │ ├── channels.cljs │ │ │ ├── channels.js │ │ │ ├── channels.js.map │ │ │ ├── dispatch.cljs │ │ │ ├── dispatch.js │ │ │ ├── dispatch.js.map │ │ │ ├── ioc_helpers.cljs │ │ │ ├── ioc_helpers.js │ │ │ ├── ioc_helpers.js.map │ │ │ ├── protocols.cljs │ │ │ ├── protocols.js │ │ │ ├── protocols.js.map │ │ │ ├── timers.cljs │ │ │ ├── timers.js │ │ │ └── timers.js.map │ └── goog │ │ ├── array │ │ └── array.js │ │ ├── asserts │ │ └── asserts.js │ │ ├── base.js │ │ ├── debug │ │ ├── entrypointregistry.js │ │ ├── error.js │ │ └── errorhandlerweakdep.js │ │ ├── deps.js │ │ ├── disposable │ │ ├── disposable.js │ │ └── idisposable.js │ │ ├── dom │ │ ├── browserfeature.js │ │ ├── classes.js │ │ ├── dom.js │ │ ├── nodetype.js │ │ └── tagname.js │ │ ├── events │ │ ├── browserevent.js │ │ ├── browserfeature.js │ │ ├── event.js │ │ ├── eventid.js │ │ ├── events.js │ │ ├── eventtype.js │ │ ├── eventwrapper.js │ │ ├── listenable.js │ │ ├── listener.js │ │ └── listenermap.js │ │ ├── functions │ │ └── functions.js │ │ ├── math │ │ ├── coordinate.js │ │ ├── math.js │ │ └── size.js │ │ ├── object │ │ └── object.js │ │ ├── reflect │ │ └── reflect.js │ │ ├── string │ │ ├── string.js │ │ └── stringbuffer.js │ │ └── useragent │ │ └── useragent.js │ ├── project.clj │ ├── src │ └── ants_cljs │ │ └── core.cljs │ └── target │ └── stale │ └── extract-native.dependencies ├── 9.Ants-CLJS-Array-Optimised └── ants-cljs │ ├── .lein-repl-history │ ├── ants_cljs.js │ ├── css │ ├── main.css │ └── normalize.css │ ├── index.html │ ├── out │ ├── ants_cljs │ │ ├── core.cljs │ │ ├── core.js │ │ └── core.js.map │ ├── cljs │ │ ├── core.cljs │ │ ├── core.js │ │ ├── core.js.map │ │ └── core │ │ │ ├── async.cljs │ │ │ ├── async.js │ │ │ ├── async.js.map │ │ │ └── async │ │ │ └── impl │ │ │ ├── buffers.cljs │ │ │ ├── buffers.js │ │ │ ├── buffers.js.map │ │ │ ├── channels.cljs │ │ │ ├── channels.js │ │ │ ├── channels.js.map │ │ │ ├── dispatch.cljs │ │ │ ├── dispatch.js │ │ │ ├── dispatch.js.map │ │ │ ├── ioc_helpers.cljs │ │ │ ├── ioc_helpers.js │ │ │ ├── ioc_helpers.js.map │ │ │ ├── protocols.cljs │ │ │ ├── protocols.js │ │ │ ├── protocols.js.map │ │ │ ├── timers.cljs │ │ │ ├── timers.js │ │ │ └── timers.js.map │ └── goog │ │ ├── array │ │ └── array.js │ │ ├── asserts │ │ └── asserts.js │ │ ├── base.js │ │ ├── debug │ │ ├── entrypointregistry.js │ │ ├── error.js │ │ └── errorhandlerweakdep.js │ │ ├── deps.js │ │ ├── disposable │ │ ├── disposable.js │ │ └── idisposable.js │ │ ├── dom │ │ ├── browserfeature.js │ │ ├── classes.js │ │ ├── dom.js │ │ └── tagname.js │ │ ├── events │ │ ├── browserevent.js │ │ ├── browserfeature.js │ │ ├── event.js │ │ ├── events.js │ │ ├── eventtype.js │ │ ├── eventwrapper.js │ │ ├── listenable.js │ │ └── listener.js │ │ ├── math │ │ ├── coordinate.js │ │ ├── math.js │ │ └── size.js │ │ ├── object │ │ └── object.js │ │ ├── reflect │ │ └── reflect.js │ │ ├── string │ │ ├── string.js │ │ └── stringbuffer.js │ │ └── useragent │ │ └── useragent.js │ ├── project.clj │ ├── src │ ├── ants_cljs │ │ └── core.cljs │ └── chambered │ │ └── macros.clj │ └── target │ └── stale │ └── extract-native.dependencies └── README.md /1.Simple-Producer-Consumer/simple-core-async/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /classes 3 | /checkouts 4 | pom.xml 5 | pom.xml.asc 6 | *.jar 7 | *.class 8 | /.lein-* 9 | /.nrepl-port 10 | -------------------------------------------------------------------------------- /1.Simple-Producer-Consumer/simple-core-async/README.md: -------------------------------------------------------------------------------- 1 | # simple-core-async 2 | 3 | FIXME: description 4 | 5 | ## Installation 6 | 7 | Download from http://example.com/FIXME. 8 | 9 | ## Usage 10 | 11 | FIXME: explanation 12 | 13 | $ java -jar simple-core-async-0.1.0-standalone.jar [args] 14 | 15 | ## Options 16 | 17 | FIXME: listing of options this app accepts. 18 | 19 | ## Examples 20 | 21 | ... 22 | 23 | ### Bugs 24 | 25 | ... 26 | 27 | ### Any Other Sections 28 | ### That You Think 29 | ### Might be Useful 30 | 31 | ## License 32 | 33 | Copyright © 2014 FIXME 34 | 35 | Distributed under the Eclipse Public License either version 1.0 or (at 36 | your option) any later version. 37 | -------------------------------------------------------------------------------- /1.Simple-Producer-Consumer/simple-core-async/doc/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction to simple-core-async 2 | 3 | TODO: write [great documentation](http://jacobian.org/writing/great-documentation/what-to-write/) 4 | -------------------------------------------------------------------------------- /1.Simple-Producer-Consumer/simple-core-async/project.clj: -------------------------------------------------------------------------------- 1 | (defproject simple-core-async "0.1.0-SNAPSHOT" 2 | :description "FIXME: write description" 3 | :url "http://example.com/FIXME" 4 | :license {:name "Eclipse Public License" 5 | :url "http://www.eclipse.org/legal/epl-v10.html"} 6 | :dependencies [[org.clojure/clojure "1.5.1"] 7 | [org.clojure/core.async "0.1.301.0-deb34a-alpha"]] 8 | :main ^:skip-aot simple-core-async.core 9 | :target-path "target/%s" 10 | :profiles {:uberjar {:aot :all}}) 11 | -------------------------------------------------------------------------------- /1.Simple-Producer-Consumer/simple-core-async/src/simple_core_async/core.clj: -------------------------------------------------------------------------------- 1 | (ns simple-core-async.core 2 | (:gen-class) 3 | (:require [clojure.core.async :as async :refer [! !! timeout chan alt! go close!]])) 4 | 5 | (defn -main 6 | [& args] 7 | (println "Starting!") 8 | 9 | (let [my-q (chan 5) 10 | my-seq (seq "Hello World")] 11 | (go 12 | (doseq [item my-seq] 13 | (>! my-q item) 14 | (! !! timeout chan alt! go close! alts!]])) 4 | 5 | (defn -main 6 | [& args] 7 | (println "Starting!") 8 | 9 | (let [my-q1 (chan 5) 10 | my-q2 (chan 5) 11 | my-seq1 (seq "Hello World") 12 | my-seq2 (range 10)] 13 | (go 14 | (doseq [item my-seq1] 15 | (>! my-q1 item) 16 | (! my-q2 item) 21 | ( 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/project.clj: -------------------------------------------------------------------------------- 1 | (defproject baldridge-10000 "0.1.0-SNAPSHOT" 2 | :description "FIXME: write this!" 3 | :url "http://example.com/FIXME" 4 | :dependencies [;[org.clojure/clojure "1.5.1"] 5 | [org.clojure/clojurescript "0.0-2156"] 6 | [org.clojure/core.async "0.1.301.0-deb34a-alpha"] 7 | ;[ring "1.2.1"] 8 | ] 9 | :plugins [[lein-cljsbuild "1.0.2"] 10 | ;[lein-ring "0.8.10"] 11 | ] 12 | :hooks [leiningen.cljsbuild] 13 | ;:source-paths ["src/clj"] 14 | :cljsbuild { 15 | :builds { 16 | :main { 17 | :source-paths ["src/cljs"] 18 | :compiler {:output-to "resources/public/js/cljs.js" 19 | :output-dir "resources/public/js/" 20 | :optimizations :none 21 | :source-maps :true 22 | :pretty-print true} 23 | ;:jar true 24 | }}} 25 | ;:main baldridge-10000.server 26 | ;:ring {:handler baldridge-10000.server/app} 27 | ) 28 | 29 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/css/page.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 900px; 3 | margin: 0 auto; 4 | background-color: #8eba8e; 5 | } 6 | 7 | div { 8 | background: green; 9 | margin: 3em; 10 | padding: 1em; 11 | border: 1px solid gray; 12 | background-color: #baf0ba; 13 | } 14 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |

Congratulations on your new cljs-kickoff template!

9 |

This is a static page, served from plain files in resoures/public. You 10 | can place other static resources here. Your ClojureScript files will be 11 | compiled to the same folder.

12 |

The project has two files:

13 |

19 |

Click here to access the application.

20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/cljs.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("base.js", ['goog'], []); 2 | goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.StringBuffer']); 3 | goog.addDependency("../cljs/core/async/impl/protocols.js", ['cljs.core.async.impl.protocols'], ['cljs.core']); 4 | goog.addDependency("../cljs/core/async/impl/ioc_helpers.js", ['cljs.core.async.impl.ioc_helpers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 5 | goog.addDependency("../cljs/core/async/impl/buffers.js", ['cljs.core.async.impl.buffers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 6 | goog.addDependency("../cljs/core/async/impl/dispatch.js", ['cljs.core.async.impl.dispatch'], ['cljs.core.async.impl.buffers', 'cljs.core']); 7 | goog.addDependency("../cljs/core/async/impl/channels.js", ['cljs.core.async.impl.channels'], ['cljs.core.async.impl.buffers', 'cljs.core', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols']); 8 | goog.addDependency("../cljs/core/async/impl/timers.js", ['cljs.core.async.impl.timers'], ['cljs.core', 'cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols']); 9 | goog.addDependency("../cljs/core/async.js", ['cljs.core.async'], ['cljs.core.async.impl.ioc_helpers', 'cljs.core.async.impl.buffers', 'cljs.core', 'cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols', 'cljs.core.async.impl.timers']); 10 | goog.addDependency("../hello_clojurescript/client.js", ['hello_clojurescript.client'], ['cljs.core', 'cljs.core.async']); -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/cljs/core/async/impl/dispatch.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.dispatch 2 | (:require [cljs.core.async.impl.buffers :as buffers])) 3 | 4 | (def message-channel nil) 5 | (def tasks (buffers/ring-buffer 32)) 6 | (def ^:boolean running? false) 7 | (def ^:boolean queued? false) 8 | 9 | (def TASK_BATCH_SIZE 1024) 10 | 11 | (declare queue-dispatcher) 12 | 13 | (defn process-messages [] 14 | (set! running? true) 15 | (set! queued? false) 16 | (loop [count 0] 17 | (let [m (.pop tasks)] 18 | (when-not (nil? m) 19 | (m) 20 | (when (< count TASK_BATCH_SIZE) 21 | (recur (inc count)))))) 22 | (set! running? false) 23 | (when (> (.-length tasks) 0) 24 | (queue-dispatcher))) 25 | 26 | (when (exists? js/MessageChannel) 27 | (set! message-channel (js/MessageChannel.)) 28 | (set! (.. message-channel -port1 -onmessage) 29 | (fn [msg] 30 | (process-messages)))) 31 | 32 | (defn queue-dispatcher [] 33 | (when-not ^boolean (and ^boolean queued? 34 | running?) 35 | (set! queued? true) 36 | (cond 37 | (exists? js/MessageChannel) (.postMessage (.-port2 message-channel) 0) 38 | (exists? js/setImmediate) (js/setImmediate process-messages) 39 | :else (js/setTimeout process-messages 0)))) 40 | 41 | (defn run [f] 42 | (.unbounded-unshift tasks f) 43 | (queue-dispatcher)) 44 | 45 | (defn queue-delay [f delay] 46 | (js/setTimeout f delay)) 47 | 48 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/cljs/core/async/impl/dispatch.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2156 2 | goog.provide('cljs.core.async.impl.dispatch'); 3 | goog.require('cljs.core'); 4 | goog.require('cljs.core.async.impl.buffers'); 5 | goog.require('cljs.core.async.impl.buffers'); 6 | cljs.core.async.impl.dispatch.message_channel = null; 7 | cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,32); 8 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 9 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 10 | cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = 1024; 11 | cljs.core.async.impl.dispatch.process_messages = (function process_messages(){cljs.core.async.impl.dispatch.running_QMARK_ = true; 12 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 13 | var count_11176 = 0;while(true){ 14 | var m_11177 = cljs.core.async.impl.dispatch.tasks.pop();if((m_11177 == null)) 15 | {} else 16 | {m_11177.call(null); 17 | if((count_11176 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)) 18 | {{ 19 | var G__11178 = (count_11176 + 1); 20 | count_11176 = G__11178; 21 | continue; 22 | } 23 | } else 24 | {} 25 | } 26 | break; 27 | } 28 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 29 | if((cljs.core.async.impl.dispatch.tasks.length > 0)) 30 | {return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 31 | } else 32 | {return null; 33 | } 34 | }); 35 | if(typeof MessageChannel !== 'undefined') 36 | {cljs.core.async.impl.dispatch.message_channel = (new MessageChannel()); 37 | cljs.core.async.impl.dispatch.message_channel.port1.onmessage = (function (msg){return cljs.core.async.impl.dispatch.process_messages.call(null); 38 | }); 39 | } else 40 | {} 41 | cljs.core.async.impl.dispatch.queue_dispatcher = (function queue_dispatcher(){if(cljs.core.truth_((function (){var and__3391__auto__ = cljs.core.async.impl.dispatch.queued_QMARK_;if(and__3391__auto__) 42 | {return cljs.core.async.impl.dispatch.running_QMARK_; 43 | } else 44 | {return and__3391__auto__; 45 | } 46 | })())) 47 | {return null; 48 | } else 49 | {cljs.core.async.impl.dispatch.queued_QMARK_ = true; 50 | if(typeof MessageChannel !== 'undefined') 51 | {return cljs.core.async.impl.dispatch.message_channel.port2.postMessage(0); 52 | } else 53 | {if(typeof setImmediate !== 'undefined') 54 | {return setImmediate(cljs.core.async.impl.dispatch.process_messages); 55 | } else 56 | {if(new cljs.core.Keyword(null,"else","else",1017020587)) 57 | {return setTimeout(cljs.core.async.impl.dispatch.process_messages,0); 58 | } else 59 | {return null; 60 | } 61 | } 62 | } 63 | } 64 | }); 65 | cljs.core.async.impl.dispatch.run = (function run(f){cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f); 66 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 67 | }); 68 | cljs.core.async.impl.dispatch.queue_delay = (function queue_delay(f,delay){return setTimeout(f,delay); 69 | }); 70 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/cljs/core/async/impl/protocols.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.protocols) 10 | 11 | (def ^:const MAX-QUEUE-SIZE 1024) 12 | 13 | (defprotocol ReadPort 14 | (take! [port fn1-handler] "derefable val if taken, nil if take was enqueued")) 15 | 16 | (defprotocol WritePort 17 | (put! [port val fn1-handler] "derefable boolean (false if already closed) if handled, nil if put was enqueued. 18 | Must throw on nil val.")) 19 | 20 | (defprotocol Channel 21 | (close! [chan]) 22 | (closed? [chan])) 23 | 24 | (defprotocol Handler 25 | (active? [h] "returns true if has callback. Must work w/o lock") 26 | #_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock") 27 | (commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock")) 28 | 29 | (defprotocol Buffer 30 | (full? [b]) 31 | (remove! [b]) 32 | (add! [b itm])) 33 | 34 | ;; Defines a buffer that will never block (return true to full?) 35 | (defprotocol UnblockingBuffer) 36 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/goog/debug/error.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Provides a base class for custom Error objects such that the 17 | * stack is correctly maintained. 18 | * 19 | * You should never need to throw goog.debug.Error(msg) directly, Error(msg) is 20 | * sufficient. 21 | * 22 | */ 23 | 24 | goog.provide('goog.debug.Error'); 25 | 26 | 27 | 28 | /** 29 | * Base class for custom error objects. 30 | * @param {*=} opt_msg The message associated with the error. 31 | * @constructor 32 | * @extends {Error} 33 | */ 34 | goog.debug.Error = function(opt_msg) { 35 | 36 | // Ensure there is a stack trace. 37 | if (Error.captureStackTrace) { 38 | Error.captureStackTrace(this, goog.debug.Error); 39 | } else { 40 | this.stack = new Error().stack || ''; 41 | } 42 | 43 | if (opt_msg) { 44 | this.message = String(opt_msg); 45 | } 46 | }; 47 | goog.inherits(goog.debug.Error, Error); 48 | 49 | 50 | /** @override */ 51 | goog.debug.Error.prototype.name = 'CustomError'; 52 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/goog/deps.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("string/string.js", ['goog.string', 'goog.string.Unicode'], []); 2 | goog.addDependency("debug/error.js", ['goog.debug.Error'], []); 3 | goog.addDependency("asserts/asserts.js", ['goog.asserts', 'goog.asserts.AssertionError'], ['goog.debug.Error', 'goog.string']); 4 | goog.addDependency("array/array.js", ['goog.array', 'goog.array.ArrayLike'], ['goog.asserts']); 5 | goog.addDependency("object/object.js", ['goog.object'], []); 6 | goog.addDependency("string/stringbuffer.js", ['goog.string.StringBuffer'], []); -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/resources/public/js/goog/string/stringbuffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utility for fast string concatenation. 17 | */ 18 | 19 | goog.provide('goog.string.StringBuffer'); 20 | 21 | 22 | 23 | /** 24 | * Utility class to facilitate string concatenation. 25 | * 26 | * @param {*=} opt_a1 Optional first initial item to append. 27 | * @param {...*} var_args Other initial items to 28 | * append, e.g., new goog.string.StringBuffer('foo', 'bar'). 29 | * @constructor 30 | */ 31 | goog.string.StringBuffer = function(opt_a1, var_args) { 32 | if (opt_a1 != null) { 33 | this.append.apply(this, arguments); 34 | } 35 | }; 36 | 37 | 38 | /** 39 | * Internal buffer for the string to be concatenated. 40 | * @type {string} 41 | * @private 42 | */ 43 | goog.string.StringBuffer.prototype.buffer_ = ''; 44 | 45 | 46 | /** 47 | * Sets the contents of the string buffer object, replacing what's currently 48 | * there. 49 | * 50 | * @param {*} s String to set. 51 | */ 52 | goog.string.StringBuffer.prototype.set = function(s) { 53 | this.buffer_ = '' + s; 54 | }; 55 | 56 | 57 | /** 58 | * Appends one or more items to the buffer. 59 | * 60 | * Calling this with null, undefined, or empty arguments is an error. 61 | * 62 | * @param {*} a1 Required first string. 63 | * @param {*=} opt_a2 Optional second string. 64 | * @param {...*} var_args Other items to append, 65 | * e.g., sb.append('foo', 'bar', 'baz'). 66 | * @return {goog.string.StringBuffer} This same StringBuffer object. 67 | * @suppress {duplicate} 68 | */ 69 | goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { 70 | // Use a1 directly to avoid arguments instantiation for single-arg case. 71 | this.buffer_ += a1; 72 | if (opt_a2 != null) { // second argument is undefined (null == undefined) 73 | for (var i = 1; i < arguments.length; i++) { 74 | this.buffer_ += arguments[i]; 75 | } 76 | } 77 | return this; 78 | }; 79 | 80 | 81 | /** 82 | * Clears the internal buffer. 83 | */ 84 | goog.string.StringBuffer.prototype.clear = function() { 85 | this.buffer_ = ''; 86 | }; 87 | 88 | 89 | /** 90 | * @return {number} the length of the current contents of the buffer. 91 | */ 92 | goog.string.StringBuffer.prototype.getLength = function() { 93 | return this.buffer_.length; 94 | }; 95 | 96 | 97 | /** 98 | * @return {string} The concatenated string. 99 | * @override 100 | */ 101 | goog.string.StringBuffer.prototype.toString = function() { 102 | return this.buffer_; 103 | }; 104 | -------------------------------------------------------------------------------- /3.Tim-Baldridge-10k-Processes/baldridge-10000/src/cljs/baldridge_10000/client.cljs: -------------------------------------------------------------------------------- 1 | (ns hello-clojurescript.client 2 | (:require [cljs.core.async :refer [chan put! take! timeout] :as async] 3 | ;[clojure.walk :refer [prewalk]] 4 | ;[goog.net.XhrIo] 5 | ) 6 | (:require-macros [cljs.core.async.macros :refer [go]])) 7 | 8 | 9 | ;(defn handle-click [] 10 | ; (js/alert "Hello!")) 11 | 12 | ;(def clickable (.getElementById js/document "clickable")) 13 | ;(.addEventListener clickable "click" handle-click) 14 | 15 | ;https://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj 16 | (def canvas (.getElementById js/document "canvas")) 17 | 18 | (def colors ["#FF0000" 19 | "#00FF00" 20 | "#0000FF" 21 | "#00FFFF" 22 | "#FFFF00" 23 | "#FF00FF"]) 24 | 25 | (defn make-cell [canvas x y] 26 | (let [ctx (-> js/document 27 | (.getElementById canvas) 28 | (.getContext "2d"))] 29 | (go (while true 30 | (set! (.-fillStyle ctx) (rand-nth colors)) 31 | (.fillRect ctx x y 10 10) 32 | ( 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /4.Not-10K-Processes/10K-no-async/js/10K.js: -------------------------------------------------------------------------------- 1 | 2 | var canvas = document.getElementById("canvas"); 3 | 4 | var colours = ['#FF0000', 5 | '#00FF00', 6 | '#0000FF', 7 | '#00FFFF', 8 | '#FFFF00', 9 | '#FF00FF']; 10 | 11 | var ctx = document.getElementById("canvas").getContext("2d"); 12 | 13 | /** 14 | * Creates a square of random colour ont he canvas at a particular coordinate location (x, y) 15 | */ 16 | function makeCell(x, y) { 17 | ctx.fillStyle = colours[Math.floor(Math.random() * colours.length)]; 18 | ctx.fillRect(x, y, 10, 10); 19 | } 20 | 21 | /** 22 | * run a complete scan through the grid for one pass and generate all the colours 23 | * (given a grid length and breadth) 24 | */ 25 | function makeScene(rows, cols) { 26 | for (var x = 0; x < cols; x++) { 27 | for (var y = 0; y < rows; y++) { 28 | makeCell( (10 * x), (10 *y)); 29 | }; 30 | }; 31 | } 32 | 33 | var i = 100; 34 | 35 | /** 36 | * Loop through 100 times generating the grid, and pausing for 125 ms each loop 37 | */ 38 | function mainLoop() { 39 | if (i > 0) { 40 | i--; 41 | makeScene( 100, 100); 42 | console.log("running main loop for: " + i); 43 | window.setTimeout(mainLoop, 125 ); 44 | } 45 | } 46 | 47 | mainLoop(); 48 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/images/bb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/images/bb.jpg -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/images/lt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/images/lt.jpg -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/images/om.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/images/om.jpg -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/images/sourcemap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/images/sourcemap.png -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/processes/core.cljs: -------------------------------------------------------------------------------- 1 | (ns blog.processes.core 2 | (:require [cljs.core.async :as async 3 | :refer [! chan put! timeout]] 4 | [blog.utils.dom :refer [by-id set-html! set-class!]]) 5 | (:require-macros [cljs.core.async.macros :refer [go]])) 6 | 7 | (def width 100) 8 | (def height 100) 9 | 10 | (defn gen-ui [] 11 | (let [arr (array)] 12 | (loop [y 0] 13 | (when (< y height) 14 | (.push arr "") 15 | (loop [x 0] 16 | (when (< x width) 17 | (.push arr (str "0") 18 | (recur (inc x)))) 19 | (.push arr "") 20 | (recur (inc y)))) 21 | (set-html! (by-id "big-table") (.join arr "")))) 22 | 23 | (gen-ui) 24 | 25 | (def group (atom 0)) 26 | 27 | (defn render! [queue] 28 | (let [g (str "group" @group)] 29 | (doseq [[idx v] queue] 30 | (let [cell (by-id (str "cell-" idx))] 31 | (set-html! cell v) 32 | (set-class! cell g))) 33 | (swap! group (fn [g] (mod (inc g) 5))))) 34 | 35 | (defn render-loop [rate] 36 | (let [in (chan 1000)] 37 | (go (loop [refresh (timeout rate) queue []] 38 | (let [[v c] (alts! [refresh in])] 39 | (condp = c 40 | refresh (do (render! queue) 41 | (! render [(rand-int 10000) (rand-int 10)]))) 53 | (recur (inc i))))) 54 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/dom.cljs: -------------------------------------------------------------------------------- 1 | (ns blog.utils.dom 2 | (:require [goog.style :as style] 3 | [goog.dom :as dom] 4 | [goog.dom.classes :as classes])) 5 | 6 | (defn by-id [id] 7 | (.getElementById js/document id)) 8 | 9 | (defn set-html! [el s] 10 | (set! (.-innerHTML el) s)) 11 | 12 | (defn set-text! [el s] 13 | (dom/setTextContent el s)) 14 | 15 | (defn set-class! [el name] 16 | (classes/set el name)) 17 | 18 | (defn add-class! [el name] 19 | (classes/add el name)) 20 | 21 | (defn remove-class! [el name] 22 | (classes/remove el name)) 23 | 24 | (defn tag-match [tag] 25 | (fn [el] 26 | (when-let [tag-name (.-tagName el)] 27 | (= tag (.toLowerCase tag-name))))) 28 | 29 | (defn parent [el tag] 30 | (let [matcher (tag-match tag)] 31 | (if (matcher el) 32 | el 33 | (dom/getAncestor el (tag-match tag))))) 34 | 35 | (defn el-matcher [el] 36 | (fn [other] (identical? other el))) 37 | 38 | (defn by-tag-name [el tag] 39 | (prim-seq (dom/getElementsByTagNameAndClass tag nil el))) 40 | 41 | (defn offset [el] 42 | [(style/getPageOffsetLeft el) (style/getPageOffsetTop el)]) 43 | 44 | (defn in? [e el] 45 | (let [target (.-target e)] 46 | (or (identical? target el) 47 | (not (nil? (dom/getAncestor target (el-matcher el))))))) 48 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/dom.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('blog.utils.dom'); 3 | goog.require('cljs.core'); 4 | goog.require('goog.dom.classes'); 5 | goog.require('goog.dom.classes'); 6 | goog.require('goog.dom'); 7 | goog.require('goog.dom'); 8 | goog.require('goog.style'); 9 | goog.require('goog.style'); 10 | blog.utils.dom.by_id = (function by_id(id){return document.getElementById(id); 11 | }); 12 | blog.utils.dom.set_html_BANG_ = (function set_html_BANG_(el,s){return el.innerHTML = s; 13 | }); 14 | blog.utils.dom.set_text_BANG_ = (function set_text_BANG_(el,s){return goog.dom.setTextContent(el,s); 15 | }); 16 | blog.utils.dom.set_class_BANG_ = (function set_class_BANG_(el,name){return goog.dom.classes.set(el,name); 17 | }); 18 | blog.utils.dom.add_class_BANG_ = (function add_class_BANG_(el,name){return goog.dom.classes.add(el,name); 19 | }); 20 | blog.utils.dom.remove_class_BANG_ = (function remove_class_BANG_(el,name){return goog.dom.classes.remove(el,name); 21 | }); 22 | blog.utils.dom.tag_match = (function tag_match(tag){return (function (el){var temp__4092__auto__ = el.tagName;if(cljs.core.truth_(temp__4092__auto__)) 23 | {var tag_name = temp__4092__auto__;return cljs.core._EQ_.call(null,tag,tag_name.toLowerCase()); 24 | } else 25 | {return null; 26 | } 27 | }); 28 | }); 29 | blog.utils.dom.parent = (function parent(el,tag){var matcher = blog.utils.dom.tag_match.call(null,tag);if(cljs.core.truth_(matcher.call(null,el))) 30 | {return el; 31 | } else 32 | {return goog.dom.getAncestor(el,blog.utils.dom.tag_match.call(null,tag)); 33 | } 34 | }); 35 | blog.utils.dom.el_matcher = (function el_matcher(el){return (function (other){return (other === el); 36 | }); 37 | }); 38 | blog.utils.dom.by_tag_name = (function by_tag_name(el,tag){return cljs.core.prim_seq.call(null,goog.dom.getElementsByTagNameAndClass(tag,null,el)); 39 | }); 40 | blog.utils.dom.offset = (function offset(el){return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [goog.style.getPageOffsetLeft(el),goog.style.getPageOffsetTop(el)], null); 41 | }); 42 | blog.utils.dom.in_QMARK_ = (function in_QMARK_(e,el){var target = e.target;return ((target === el)) || (!((goog.dom.getAncestor(target,blog.utils.dom.el_matcher.call(null,el)) == null))); 43 | }); 44 | 45 | //# sourceMappingURL=dom.js.map -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/dom.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Documents/workspace_nonbook/swannodette.github.com/code/blog/../../assets/js/blog/utils/dom.js", 4 | "sources":["dom.cljs"], 5 | "lineCount":45, 6 | "mappings": 7 | ";AAAA;;;;;;;;AAKA,uBAAA,oBAAA,3CAAMA,uCAAOC,IACX,OAAiBC,wBAAYD;;AAE/B,gCAAA,+BAAA,/DAAME,yDAAWC,GAAGC,GAClB,OAAM,AAAaD,eAAIC;;AAEzB,gCAAA,+BAAA,/DAAMC,yDAAWF,GAAGC,GAClB,OAACE,wBAAmBH,GAAGC;;AAEzB,iCAAA,mCAAA,pEAAMG,2DAAYJ,GAAGK,MACnB,OAACC,qBAAYN,GAAGK;;AAElB,iCAAA,mCAAA,pEAAME,2DAAYP,GAAGK,MACnB,OAACG,qBAAYR,GAAGK;;AAElB,oCAAA,sCAAA,1EAAMI,iEAAeT,GAAGK,MACtB,OAACK,wBAAeV,GAAGK;;AAErB,2BAAA,yBAAA,pDAAMM,+CAAWC,KACf,sBAAA,JAAKZ,IACH,IAAAa,gCAAA,AAAA,oBAAAA,/BAAoB,AAAWb;CAA/B,AAAA,eAAAa,mBAAA,9BAAWC,8BACT,OAACC,yBAAEH,IAAI,AAAcE;;CADvB;;;;AAGJ,wBAAA,yBAAA,jDAAME,yCAAQhB,GAAGY,KACf,sDAAA,lDAAMK,UAAQ,AAACN,mCAAUC,KACvB,oBAAI,AAACK,kBAAQjB;CACXA;;CACA,OAACkB,qBAAgBlB,GAAG,AAACW,mCAAUC;;;AAErC,4BAAA,yBAAA,rDAAMO,iDAAYnB,IAChB,yBAAA,PAAKoB,OAAO,QAAYA,UAAMpB;;;AAEhC,6BAAA,8BAAA,3DAAMqB,mDAAarB,GAAGY,KACpB,OAACU,6BAAS,0CAAA,1CAACC,sCAAiCX,SAAQZ;;AAEtD,wBAAA,qBAAA,AAAA,7CAAMwB,yCAAQxB,8FACX,AAACyB,6BAAwBzB,IAAI,AAAC0B,4BAAuB1B;;AAExD,2BAAA,0BAAA,rDAAM2B,+CAAKC,EAAE5B,IACX,sBAAA,lBAAM6B,SAAO,AAAUD,SACrB,QAAI,CAAYC,WAAO7B,SACnB,EAAK,yEAAA,xEAAM,AAACkB,qBAAgBW,OAAO,AAACV,oCAAWnB", 8 | "names": 9 | ["blog.utils.dom/by-id", "id", "js/document", 10 | "blog.utils.dom/set-html!", "el", "s", "blog.utils.dom/set-text!", 11 | "goog.dom/setTextContent", "blog.utils.dom/set-class!", "name", 12 | "goog.dom.classes/set", "blog.utils.dom/add-class!", 13 | "goog.dom.classes/add", "blog.utils.dom/remove-class!", 14 | "goog.dom.classes/remove", "blog.utils.dom/tag-match", "tag", 15 | "temp__4092__auto__", "tag-name", "cljs.core/=", 16 | "blog.utils.dom/parent", "matcher", "goog.dom/getAncestor", 17 | "blog.utils.dom/el-matcher", "other", "blog.utils.dom/by-tag-name", 18 | "cljs.core/prim-seq", "goog.dom/getElementsByTagNameAndClass", 19 | "blog.utils.dom/offset", "goog.style/getPageOffsetLeft", 20 | "goog.style/getPageOffsetTop", "blog.utils.dom/in?", "e", "target"]} -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/helpers.cljs: -------------------------------------------------------------------------------- 1 | (ns blog.utils.helpers) 2 | 3 | (defn now [] (js/Date.)) 4 | 5 | (defn index-of [xs x] 6 | (let [len (count xs)] 7 | (loop [i 0] 8 | (if (< i len) 9 | (if (= (nth xs i) x) 10 | i 11 | (recur (inc i))) 12 | -1)))) 13 | 14 | (defn error? [x] 15 | (instance? js/Error x)) 16 | 17 | (defn throw-err [x] 18 | (if (error? x) 19 | (throw x) 20 | x)) 21 | 22 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/helpers.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('blog.utils.helpers'); 3 | goog.require('cljs.core'); 4 | blog.utils.helpers.now = (function now(){return (new Date()); 5 | }); 6 | blog.utils.helpers.index_of = (function index_of(xs,x){var len = cljs.core.count.call(null,xs);var i = 0;while(true){ 7 | if((i < len)) 8 | {if(cljs.core._EQ_.call(null,cljs.core.nth.call(null,xs,i),x)) 9 | {return i; 10 | } else 11 | {{ 12 | var G__8618 = (i + 1); 13 | i = G__8618; 14 | continue; 15 | } 16 | } 17 | } else 18 | {return -1; 19 | } 20 | break; 21 | } 22 | }); 23 | blog.utils.helpers.error_QMARK_ = (function error_QMARK_(x){return (x instanceof Error); 24 | }); 25 | blog.utils.helpers.throw_err = (function throw_err(x){if(blog.utils.helpers.error_QMARK_.call(null,x)) 26 | {throw x; 27 | } else 28 | {return x; 29 | } 30 | }); 31 | 32 | //# sourceMappingURL=helpers.js.map -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/helpers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Documents/workspace_nonbook/swannodette.github.com/code/blog/../../assets/js/blog/utils/helpers.js", 4 | "sources":["helpers.cljs"], 5 | "lineCount":32, 6 | "mappings": 7 | ";AAAA;;AAEA,yBAAA,gBAAA,zCAAMA,yCAAO,YAAAC;;AAEb,8BAAA,yBAAA,vDAAMC,iDAAUC,GAAGC,GACjB,wCAAA,pCAAMC,MAAI,AAACC,0BAAMH,IACf,QAAA,JAAOI;AAAP,AACE,GAAI,CAAGA,IAAEF;CACP,GAAI,AAACG,yBAAE,AAACC,wBAAIN,GAAGI,GAAGH;CAChBG;;CACA;cAAO,KAAA,JAAKA;;;;;;CAHhB;;;;;AAMN,kCAAA,0BAAA,5DAAMG,yDAAQN,GACZ,qBAAWO,bAASP;;AAEtB,+BAAA,uBAAA,tDAAMQ,mDAAWR,GACf,GAAI,AAACM,0CAAON;CACV,MAAOA;;CACPA", 8 | "names": 9 | ["blog.utils.helpers/now", "js/Date", "blog.utils.helpers/index-of", 10 | "xs", "x", "len", "cljs.core/count", "i", "cljs.core/=", 11 | "cljs.core/nth", "blog.utils.helpers/error?", "js/Error", 12 | "blog.utils.helpers/throw-err"]} -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/node.cljs: -------------------------------------------------------------------------------- 1 | (ns blog.utils.node 2 | (:require [blog.utils.reactive :as r])) 3 | 4 | (def fs (js/require "fs")) 5 | 6 | (defn read-file [fname encoding] 7 | (r/run-task (.-readFile fs) fname encoding)) 8 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/node.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('blog.utils.node'); 3 | goog.require('cljs.core'); 4 | goog.require('blog.utils.reactive'); 5 | goog.require('blog.utils.reactive'); 6 | blog.utils.node.fs = require("fs"); 7 | blog.utils.node.read_file = (function read_file(fname,encoding){return blog.utils.reactive.run_task.call(null,blog.utils.node.fs.readFile,fname,encoding); 8 | }); 9 | 10 | //# sourceMappingURL=node.js.map -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/blog/utils/node.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Documents/workspace_nonbook/swannodette.github.com/code/blog/../../assets/js/blog/utils/node.js", 4 | "sources":["node.cljs"], 5 | "lineCount":10, 6 | "mappings": 7 | ";AAAA;;;;AAGA,AAAKA,qBAAG,QAAA,RAACC;AAET,4BAAA,oCAAA,hEAAMC,gDAAWC,MAAMC,UACrB,OAACC,uCAAW,AAAYL,4BAAIG,MAAMC", 8 | "names": 9 | ["blog.utils.node/fs", "js/require", "blog.utils.node/read-file", 10 | "fname", "encoding", "blog.utils.reactive/run-task"]} -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/cljs/core/async/impl/buffers.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.buffers 10 | (:require [cljs.core.async.impl.protocols :as impl])) 11 | 12 | ;; ----------------------------------------------------------------------------- 13 | ;; DO NOT USE, this is internal buffer representation 14 | 15 | (defn acopy [src src-start dest dest-start len] 16 | (loop [cnt 0] 17 | (when (< cnt len) 18 | (aset dest 19 | (+ dest-start cnt) 20 | (aget src (+ src-start cnt))) 21 | (recur (inc cnt))))) 22 | 23 | (deftype RingBuffer [^:mutable head ^:mutable tail ^:mutable length ^:mutable arr] 24 | Object 25 | (pop [_] 26 | (when-not (zero? length) 27 | (let [x (aget arr tail)] 28 | (aset arr tail nil) 29 | (set! tail (js-mod (inc tail) (alength arr))) 30 | (set! length (dec length)) 31 | x))) 32 | 33 | (unshift [_ x] 34 | (aset arr head x) 35 | (set! head (js-mod (inc head) (alength arr))) 36 | (set! length (inc length)) 37 | nil) 38 | 39 | (unbounded-unshift [this x] 40 | (if (== (inc length) (alength arr)) 41 | (.resize this)) 42 | (.unshift this x)) 43 | 44 | ;; Doubles the size of the buffer while retaining all the existing values 45 | (resize 46 | [_] 47 | (let [new-arr-size (* (alength arr) 2) 48 | new-arr (make-array new-arr-size)] 49 | (cond 50 | (< tail head) 51 | (do (acopy arr tail new-arr 0 length) 52 | (set! tail 0) 53 | (set! head length) 54 | (set! arr new-arr)) 55 | 56 | (> tail head) 57 | (do (acopy arr tail new-arr 0 (- (alength arr) tail)) 58 | (acopy arr 0 new-arr (- (alength arr) tail) head) 59 | (set! tail 0) 60 | (set! head length) 61 | (set! arr new-arr)) 62 | 63 | (== tail head) 64 | (do (set! tail 0) 65 | (set! head 0) 66 | (set! arr new-arr))))) 67 | 68 | (cleanup [this keep?] 69 | (dotimes [x length] 70 | (let [v (.pop this)] 71 | (when ^boolean (keep? v) 72 | (.unshift this v)))))) 73 | 74 | (defn ring-buffer [n] 75 | (assert (> n 0) "Can't create a ring buffer of size 0") 76 | (RingBuffer. 0 0 0 (make-array n))) 77 | 78 | ;; ----------------------------------------------------------------------------- 79 | 80 | (deftype FixedBuffer [buf n] 81 | impl/Buffer 82 | (full? [this] 83 | (== (.-length buf) n)) 84 | (remove! [this] 85 | (.pop buf)) 86 | (add! [this itm] 87 | (assert (not (impl/full? this)) "Can't add to a full buffer") 88 | (.unshift buf itm)) 89 | cljs.core/ICounted 90 | (-count [this] 91 | (.-length buf))) 92 | 93 | (defn fixed-buffer [n] 94 | (FixedBuffer. (ring-buffer n) n)) 95 | 96 | (deftype DroppingBuffer [buf n] 97 | impl/UnblockingBuffer 98 | impl/Buffer 99 | (full? [this] 100 | false) 101 | (remove! [this] 102 | (.pop buf)) 103 | (add! [this itm] 104 | (when-not (== (.-length buf) n) 105 | (.unshift buf itm))) 106 | cljs.core/ICounted 107 | (-count [this] 108 | (.-length buf))) 109 | 110 | (defn dropping-buffer [n] 111 | (DroppingBuffer. (ring-buffer n) n)) 112 | 113 | (deftype SlidingBuffer [buf n] 114 | impl/UnblockingBuffer 115 | impl/Buffer 116 | (full? [this] 117 | false) 118 | (remove! [this] 119 | (.pop buf)) 120 | (add! [this itm] 121 | (when (== (.-length buf) n) 122 | (impl/remove! this)) 123 | (.unshift buf itm)) 124 | cljs.core/ICounted 125 | (-count [this] 126 | (.-length buf))) 127 | 128 | (defn sliding-buffer [n] 129 | (SlidingBuffer. (ring-buffer n) n)) 130 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/cljs/core/async/impl/dispatch.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.dispatch 2 | (:require [cljs.core.async.impl.buffers :as buffers])) 3 | 4 | (def message-channel nil) 5 | (def tasks (buffers/ring-buffer 32)) 6 | (def ^:boolean running? false) 7 | (def ^:boolean queued? false) 8 | 9 | (def TASK_BATCH_SIZE 1024) 10 | 11 | (declare queue-dispatcher) 12 | 13 | (defn process-messages [] 14 | (set! running? true) 15 | (set! queued? false) 16 | (loop [count 0] 17 | (let [m (.pop tasks)] 18 | (when-not (nil? m) 19 | (m) 20 | (when (< count TASK_BATCH_SIZE) 21 | (recur (inc count)))))) 22 | (set! running? false) 23 | (when (> (.-length tasks) 0) 24 | (queue-dispatcher))) 25 | 26 | (when (exists? js/MessageChannel) 27 | (set! message-channel (js/MessageChannel.)) 28 | (set! (.. message-channel -port1 -onmessage) 29 | (fn [msg] 30 | (process-messages)))) 31 | 32 | (defn queue-dispatcher [] 33 | (when-not ^boolean (and ^boolean queued? 34 | running?) 35 | (set! queued? true) 36 | (cond 37 | (exists? js/MessageChannel) (.postMessage (.-port2 message-channel) 0) 38 | (exists? js/setImmediate) (js/setImmediate process-messages) 39 | :else (js/setTimeout process-messages 0)))) 40 | 41 | (defn run [f] 42 | (.unbounded-unshift tasks f) 43 | (queue-dispatcher)) 44 | 45 | (defn queue-delay [f delay] 46 | (js/setTimeout f delay)) 47 | 48 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/cljs/core/async/impl/dispatch.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('cljs.core.async.impl.dispatch'); 3 | goog.require('cljs.core'); 4 | goog.require('cljs.core.async.impl.buffers'); 5 | goog.require('cljs.core.async.impl.buffers'); 6 | cljs.core.async.impl.dispatch.message_channel = null; 7 | cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,32); 8 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 9 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 10 | cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = 1024; 11 | cljs.core.async.impl.dispatch.process_messages = (function process_messages(){cljs.core.async.impl.dispatch.running_QMARK_ = true; 12 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 13 | var count_15934 = 0;while(true){ 14 | var m_15935 = cljs.core.async.impl.dispatch.tasks.pop();if((m_15935 == null)) 15 | {} else 16 | {m_15935.call(null); 17 | if((count_15934 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)) 18 | {{ 19 | var G__15936 = (count_15934 + 1); 20 | count_15934 = G__15936; 21 | continue; 22 | } 23 | } else 24 | {} 25 | } 26 | break; 27 | } 28 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 29 | if((cljs.core.async.impl.dispatch.tasks.length > 0)) 30 | {return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 31 | } else 32 | {return null; 33 | } 34 | }); 35 | if(typeof MessageChannel !== 'undefined') 36 | {cljs.core.async.impl.dispatch.message_channel = (new MessageChannel()); 37 | cljs.core.async.impl.dispatch.message_channel.port1.onmessage = (function (msg){return cljs.core.async.impl.dispatch.process_messages.call(null); 38 | }); 39 | } else 40 | {} 41 | cljs.core.async.impl.dispatch.queue_dispatcher = (function queue_dispatcher(){if(cljs.core.truth_((function (){var and__3454__auto__ = cljs.core.async.impl.dispatch.queued_QMARK_;if(and__3454__auto__) 42 | {return cljs.core.async.impl.dispatch.running_QMARK_; 43 | } else 44 | {return and__3454__auto__; 45 | } 46 | })())) 47 | {return null; 48 | } else 49 | {cljs.core.async.impl.dispatch.queued_QMARK_ = true; 50 | if(typeof MessageChannel !== 'undefined') 51 | {return cljs.core.async.impl.dispatch.message_channel.port2.postMessage(0); 52 | } else 53 | {if(typeof setImmediate !== 'undefined') 54 | {return setImmediate(cljs.core.async.impl.dispatch.process_messages); 55 | } else 56 | {if(new cljs.core.Keyword(null,"else","else",1017020587)) 57 | {return setTimeout(cljs.core.async.impl.dispatch.process_messages,0); 58 | } else 59 | {return null; 60 | } 61 | } 62 | } 63 | } 64 | }); 65 | cljs.core.async.impl.dispatch.run = (function run(f){cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f); 66 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 67 | }); 68 | cljs.core.async.impl.dispatch.queue_delay = (function queue_delay(f,delay){return setTimeout(f,delay); 69 | }); 70 | 71 | //# sourceMappingURL=dispatch.js.map -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/cljs/core/async/impl/dispatch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Documents/workspace_nonbook/swannodette.github.com/code/blog/../../assets/js/cljs/core/async/impl/dispatch.js", 4 | "sources":["dispatch.cljs"], 5 | "lineCount":71, 6 | "mappings": 7 | ";AAAA;;;;AAGA,gDAAA,hDAAKA;AACL,AAAKC,sCAAM,mDAAA,nDAACC;AACZ,+CAAA,/CAAeC;AACf,8CAAA,9CAAeC;AAEf,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,6BAAA,9EAAMC,8EACJ,+CAAA,/CAAMH;AACN,8CAAA,9CAAMC;AACN,kBAAA,dAAOG;AAAP,AACE,wDAAA,pDAAMC,UAAE,AAAMP,0CACZ,GAAU,YAAA,XAAMO;CAAhB;CAAA,AACE,AAACA;AACD,GAAM,CAAGD,cAAMF;CAAf,AACE;eAAO,eAAA,dAAKE;;;;;CADd;;;;AAEN,+CAAA,/CAAMJ;AACN,GAAM,8CAAA,7CAAG,AAAUF;CAAnB,AACE,OAACQ;;CADH;;;AAGF,GAAM,OAASC;CAAf,AACE,AAAMV,gDAAgB,KAAAU;AACtB,AAAM,AAAA,AAAIV,gEACJ,gBAAA,LAAKW,KACH,OAACL;;;CAJX;AAMA,iDAAA,6BAAA,9EAAMG,8EACJ,oBAAU,iBAAAG,gEAAA,AAAA,GAAAA,/CAAuBR;CACTD;;CADdS;;;CAAV;;CAAA,AAEE,8CAAA,9CAAMR;AACN,GACC,OAASM;CAAmB,uEAAA,hEAAc,AAASV;;CADpD,GAEC,OAASa;CAAiB,OAACA,aAAgBP;;CAF5C,GAAA;CAGO,iEAAA,1DAACQ,WAAcR;;CAHtB;;;;;;AAKJ,oCAAA,iBAAA,rDAAMS,kDAAKC,GACT,AAAoBf,sDAAMe;AAC1B,OAACP;;AAEH,4CAAA,+BAAA,3EAAMQ,kEAAaD,EAAEE,OACnB,OAACJ,WAAcE,EAAEE", 8 | "names": 9 | ["cljs.core.async.impl.dispatch/message-channel", 10 | "cljs.core.async.impl.dispatch/tasks", 11 | "cljs.core.async.impl.buffers/ring-buffer", 12 | "cljs.core.async.impl.dispatch/running?", 13 | "cljs.core.async.impl.dispatch/queued?", 14 | "cljs.core.async.impl.dispatch/TASK_BATCH_SIZE", 15 | "cljs.core.async.impl.dispatch/process-messages", "count", "m", 16 | "cljs.core.async.impl.dispatch/queue-dispatcher", 17 | "js/MessageChannel", "msg", "and__3454__auto__", "js/setImmediate", 18 | "js/setTimeout", "cljs.core.async.impl.dispatch/run", "f", 19 | "cljs.core.async.impl.dispatch/queue-delay", "delay"]} -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/cljs/core/async/impl/protocols.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.protocols) 10 | 11 | (def ^:const MAX-QUEUE-SIZE 1024) 12 | 13 | (defprotocol ReadPort 14 | (take! [port fn1-handler] "derefable val if taken, nil if take was enqueued")) 15 | 16 | (defprotocol WritePort 17 | (put! [port val fn0-handler] "derefable nil if put, nil if put was enqueued. Must throw on nil val.")) 18 | 19 | (defprotocol Channel 20 | (close! [chan])) 21 | 22 | (defprotocol Handler 23 | (active? [h] "returns true if has callback. Must work w/o lock") 24 | #_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock") 25 | (commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock")) 26 | 27 | (defprotocol Buffer 28 | (full? [b]) 29 | (remove! [b]) 30 | (add! [b itm])) 31 | 32 | ;; Defines a buffer that will never block (return true to full?) 33 | (defprotocol UnblockingBuffer) 34 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/debug/error.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Provides a base class for custom Error objects such that the 17 | * stack is correctly maintained. 18 | * 19 | * You should never need to throw goog.debug.Error(msg) directly, Error(msg) is 20 | * sufficient. 21 | * 22 | */ 23 | 24 | goog.provide('goog.debug.Error'); 25 | 26 | 27 | 28 | /** 29 | * Base class for custom error objects. 30 | * @param {*=} opt_msg The message associated with the error. 31 | * @constructor 32 | * @extends {Error} 33 | */ 34 | goog.debug.Error = function(opt_msg) { 35 | 36 | // Ensure there is a stack trace. 37 | if (Error.captureStackTrace) { 38 | Error.captureStackTrace(this, goog.debug.Error); 39 | } else { 40 | this.stack = new Error().stack || ''; 41 | } 42 | 43 | if (opt_msg) { 44 | this.message = String(opt_msg); 45 | } 46 | }; 47 | goog.inherits(goog.debug.Error, Error); 48 | 49 | 50 | /** @override */ 51 | goog.debug.Error.prototype.name = 'CustomError'; 52 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/debug/errorhandlerweakdep.js: -------------------------------------------------------------------------------- 1 | // Copyright 2008 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview File which defines dummy object to work around undefined 17 | * properties compiler warning for weak dependencies on 18 | * {@link goog.debug.ErrorHandler#protectEntryPoint}. 19 | * 20 | */ 21 | 22 | goog.provide('goog.debug.errorHandlerWeakDep'); 23 | 24 | 25 | /** 26 | * Dummy object to work around undefined properties compiler warning. 27 | * @type {Object} 28 | */ 29 | goog.debug.errorHandlerWeakDep = { 30 | /** 31 | * @param {Function} fn An entry point function to be protected. 32 | * @param {boolean=} opt_tracers Whether to install tracers around the 33 | * fn. 34 | * @return {Function} A protected wrapper function that calls the 35 | * entry point function. 36 | */ 37 | protectEntryPoint: function(fn, opt_tracers) { return fn; } 38 | }; 39 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/disposable/idisposable.js: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the disposable interface. A disposable object 17 | * has a dispose method to to clean up references and resources. 18 | * @author nnaze@google.com (Nathan Naze) 19 | */ 20 | 21 | 22 | goog.provide('goog.disposable.IDisposable'); 23 | 24 | 25 | 26 | /** 27 | * Interface for a disposable object. If a instance requires cleanup 28 | * (references COM objects, DOM notes, or other disposable objects), it should 29 | * implement this interface (it may subclass goog.Disposable). 30 | * @interface 31 | */ 32 | goog.disposable.IDisposable = function() {}; 33 | 34 | 35 | /** 36 | * Disposes of the object and its resources. 37 | * @return {void} Nothing. 38 | */ 39 | goog.disposable.IDisposable.prototype.dispose; 40 | 41 | 42 | /** 43 | * @return {boolean} Whether the object has been disposed of. 44 | */ 45 | goog.disposable.IDisposable.prototype.isDisposed; 46 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/dom/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the dom package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.dom.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.dom.BrowserFeature = { 31 | /** 32 | * Whether attributes 'name' and 'type' can be added to an element after it's 33 | * created. False in Internet Explorer prior to version 9. 34 | */ 35 | CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: !goog.userAgent.IE || 36 | goog.userAgent.isDocumentMode(9), 37 | 38 | /** 39 | * Whether we can use element.children to access an element's Element 40 | * children. Available since Gecko 1.9.1, IE 9. (IE<9 also includes comment 41 | * nodes in the collection.) 42 | */ 43 | CAN_USE_CHILDREN_ATTRIBUTE: !goog.userAgent.GECKO && !goog.userAgent.IE || 44 | goog.userAgent.IE && goog.userAgent.isDocumentMode(9) || 45 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9.1'), 46 | 47 | /** 48 | * Opera, Safari 3, and Internet Explorer 9 all support innerText but they 49 | * include text nodes in script and style tags. Not document-mode-dependent. 50 | */ 51 | CAN_USE_INNER_TEXT: goog.userAgent.IE && !goog.userAgent.isVersion('9'), 52 | 53 | /** 54 | * MSIE, Opera, and Safari>=4 support element.parentElement to access an 55 | * element's parent if it is an Element. 56 | */ 57 | CAN_USE_PARENT_ELEMENT_PROPERTY: goog.userAgent.IE || goog.userAgent.OPERA || 58 | goog.userAgent.WEBKIT, 59 | 60 | /** 61 | * Whether NoScope elements need a scoped element written before them in 62 | * innerHTML. 63 | * MSDN: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx#1 64 | */ 65 | INNER_HTML_NEEDS_SCOPED_ELEMENT: goog.userAgent.IE 66 | }; 67 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/dom/tagname.js: -------------------------------------------------------------------------------- 1 | // Copyright 2007 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Defines the goog.dom.TagName enum. This enumerates 17 | * all HTML tag names specified in either the the W3C HTML 4.01 index of 18 | * elements or the HTML5 draft specification. 19 | * 20 | * References: 21 | * http://www.w3.org/TR/html401/index/elements.html 22 | * http://dev.w3.org/html5/spec/section-index.html 23 | * 24 | */ 25 | goog.provide('goog.dom.TagName'); 26 | 27 | 28 | /** 29 | * Enum of all html tag names specified by the W3C HTML4.01 and HTML5 30 | * specifications. 31 | * @enum {string} 32 | */ 33 | goog.dom.TagName = { 34 | A: 'A', 35 | ABBR: 'ABBR', 36 | ACRONYM: 'ACRONYM', 37 | ADDRESS: 'ADDRESS', 38 | APPLET: 'APPLET', 39 | AREA: 'AREA', 40 | ARTICLE: 'ARTICLE', 41 | ASIDE: 'ASIDE', 42 | AUDIO: 'AUDIO', 43 | B: 'B', 44 | BASE: 'BASE', 45 | BASEFONT: 'BASEFONT', 46 | BDI: 'BDI', 47 | BDO: 'BDO', 48 | BIG: 'BIG', 49 | BLOCKQUOTE: 'BLOCKQUOTE', 50 | BODY: 'BODY', 51 | BR: 'BR', 52 | BUTTON: 'BUTTON', 53 | CANVAS: 'CANVAS', 54 | CAPTION: 'CAPTION', 55 | CENTER: 'CENTER', 56 | CITE: 'CITE', 57 | CODE: 'CODE', 58 | COL: 'COL', 59 | COLGROUP: 'COLGROUP', 60 | COMMAND: 'COMMAND', 61 | DATA: 'DATA', 62 | DATALIST: 'DATALIST', 63 | DD: 'DD', 64 | DEL: 'DEL', 65 | DETAILS: 'DETAILS', 66 | DFN: 'DFN', 67 | DIALOG: 'DIALOG', 68 | DIR: 'DIR', 69 | DIV: 'DIV', 70 | DL: 'DL', 71 | DT: 'DT', 72 | EM: 'EM', 73 | EMBED: 'EMBED', 74 | FIELDSET: 'FIELDSET', 75 | FIGCAPTION: 'FIGCAPTION', 76 | FIGURE: 'FIGURE', 77 | FONT: 'FONT', 78 | FOOTER: 'FOOTER', 79 | FORM: 'FORM', 80 | FRAME: 'FRAME', 81 | FRAMESET: 'FRAMESET', 82 | H1: 'H1', 83 | H2: 'H2', 84 | H3: 'H3', 85 | H4: 'H4', 86 | H5: 'H5', 87 | H6: 'H6', 88 | HEAD: 'HEAD', 89 | HEADER: 'HEADER', 90 | HGROUP: 'HGROUP', 91 | HR: 'HR', 92 | HTML: 'HTML', 93 | I: 'I', 94 | IFRAME: 'IFRAME', 95 | IMG: 'IMG', 96 | INPUT: 'INPUT', 97 | INS: 'INS', 98 | ISINDEX: 'ISINDEX', 99 | KBD: 'KBD', 100 | KEYGEN: 'KEYGEN', 101 | LABEL: 'LABEL', 102 | LEGEND: 'LEGEND', 103 | LI: 'LI', 104 | LINK: 'LINK', 105 | MAP: 'MAP', 106 | MARK: 'MARK', 107 | MATH: 'MATH', 108 | MENU: 'MENU', 109 | META: 'META', 110 | METER: 'METER', 111 | NAV: 'NAV', 112 | NOFRAMES: 'NOFRAMES', 113 | NOSCRIPT: 'NOSCRIPT', 114 | OBJECT: 'OBJECT', 115 | OL: 'OL', 116 | OPTGROUP: 'OPTGROUP', 117 | OPTION: 'OPTION', 118 | OUTPUT: 'OUTPUT', 119 | P: 'P', 120 | PARAM: 'PARAM', 121 | PRE: 'PRE', 122 | PROGRESS: 'PROGRESS', 123 | Q: 'Q', 124 | RP: 'RP', 125 | RT: 'RT', 126 | RUBY: 'RUBY', 127 | S: 'S', 128 | SAMP: 'SAMP', 129 | SCRIPT: 'SCRIPT', 130 | SECTION: 'SECTION', 131 | SELECT: 'SELECT', 132 | SMALL: 'SMALL', 133 | SOURCE: 'SOURCE', 134 | SPAN: 'SPAN', 135 | STRIKE: 'STRIKE', 136 | STRONG: 'STRONG', 137 | STYLE: 'STYLE', 138 | SUB: 'SUB', 139 | SUMMARY: 'SUMMARY', 140 | SUP: 'SUP', 141 | SVG: 'SVG', 142 | TABLE: 'TABLE', 143 | TBODY: 'TBODY', 144 | TD: 'TD', 145 | TEXTAREA: 'TEXTAREA', 146 | TFOOT: 'TFOOT', 147 | TH: 'TH', 148 | THEAD: 'THEAD', 149 | TIME: 'TIME', 150 | TITLE: 'TITLE', 151 | TR: 'TR', 152 | TRACK: 'TRACK', 153 | TT: 'TT', 154 | U: 'U', 155 | UL: 'UL', 156 | VAR: 'VAR', 157 | VIDEO: 'VIDEO', 158 | WBR: 'WBR' 159 | }; 160 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/dom/vendor.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Vendor prefix getters. 17 | */ 18 | 19 | goog.provide('goog.dom.vendor'); 20 | 21 | goog.require('goog.userAgent'); 22 | 23 | 24 | /** 25 | * Returns the JS vendor prefix used in CSS properties. Different vendors 26 | * use different methods of changing the case of the property names. 27 | * 28 | * @return {?string} The JS vendor prefix or null if there is none. 29 | */ 30 | goog.dom.vendor.getVendorJsPrefix = function() { 31 | if (goog.userAgent.WEBKIT) { 32 | return 'Webkit'; 33 | } else if (goog.userAgent.GECKO) { 34 | return 'Moz'; 35 | } else if (goog.userAgent.IE) { 36 | return 'ms'; 37 | } else if (goog.userAgent.OPERA) { 38 | return 'O'; 39 | } 40 | 41 | return null; 42 | }; 43 | 44 | 45 | /** 46 | * Returns the vendor prefix used in CSS properties. 47 | * 48 | * @return {?string} The vendor prefix or null if there is none. 49 | */ 50 | goog.dom.vendor.getVendorPrefix = function() { 51 | if (goog.userAgent.WEBKIT) { 52 | return '-webkit'; 53 | } else if (goog.userAgent.GECKO) { 54 | return '-moz'; 55 | } else if (goog.userAgent.IE) { 56 | return '-ms'; 57 | } else if (goog.userAgent.OPERA) { 58 | return '-o'; 59 | } 60 | 61 | return null; 62 | }; 63 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/events/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the events package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.events.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.events.BrowserFeature = { 31 | /** 32 | * Whether the button attribute of the event is W3C compliant. False in 33 | * Internet Explorer prior to version 9; document-version dependent. 34 | */ 35 | HAS_W3C_BUTTON: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 36 | 37 | /** 38 | * Whether the browser supports full W3C event model. 39 | */ 40 | HAS_W3C_EVENT_SUPPORT: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 41 | 42 | /** 43 | * To prevent default in IE7-8 for certain keydown events we need set the 44 | * keyCode to -1. 45 | */ 46 | SET_KEY_CODE_TO_PREVENT_DEFAULT: goog.userAgent.IE && 47 | !goog.userAgent.isVersion('9'), 48 | 49 | /** 50 | * Whether the {@code navigator.onLine} property is supported. 51 | */ 52 | HAS_NAVIGATOR_ONLINE_PROPERTY: !goog.userAgent.WEBKIT || 53 | goog.userAgent.isVersion('528'), 54 | 55 | /** 56 | * Whether HTML5 network online/offline events are supported. 57 | */ 58 | HAS_HTML5_NETWORK_EVENT_SUPPORT: 59 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9b') || 60 | goog.userAgent.IE && goog.userAgent.isVersion('8') || 61 | goog.userAgent.OPERA && goog.userAgent.isVersion('9.5') || 62 | goog.userAgent.WEBKIT && goog.userAgent.isVersion('528'), 63 | 64 | /** 65 | * Whether HTML5 network events fire on document.body, or otherwise the 66 | * window. 67 | */ 68 | HTML5_NETWORK_EVENTS_FIRE_ON_BODY: 69 | goog.userAgent.GECKO && !goog.userAgent.isVersion('8') || 70 | goog.userAgent.IE && !goog.userAgent.isVersion('9'), 71 | 72 | /** 73 | * Whether touch is enabled in the browser. 74 | */ 75 | TOUCH_ENABLED: 76 | ('ontouchstart' in goog.global || 77 | !!(goog.global['document'] && 78 | document.documentElement && 79 | 'ontouchstart' in document.documentElement) || 80 | // IE10 uses non-standard touch events, so it has a different check. 81 | !!(goog.global['navigator'] && 82 | goog.global['navigator']['msMaxTouchPoints'])) 83 | }; 84 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/events/eventwrapper.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the goog.events.EventWrapper interface. 17 | * 18 | * @author eae@google.com (Emil A Eklund) 19 | */ 20 | 21 | goog.provide('goog.events.EventWrapper'); 22 | 23 | 24 | 25 | /** 26 | * Interface for event wrappers. 27 | * @interface 28 | */ 29 | goog.events.EventWrapper = function() { 30 | }; 31 | 32 | 33 | /** 34 | * Adds an event listener using the wrapper on a DOM Node or an object that has 35 | * implemented {@link goog.events.EventTarget}. A listener can only be added 36 | * once to an object. 37 | * 38 | * @param {EventTarget|goog.events.EventTarget} src The node to listen to 39 | * events on. 40 | * @param {Function|Object} listener Callback method, or an object with a 41 | * handleEvent function. 42 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 43 | * false). 44 | * @param {Object=} opt_scope Element in whose scope to call the listener. 45 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to add 46 | * listener to. 47 | */ 48 | goog.events.EventWrapper.prototype.listen = function(src, listener, opt_capt, 49 | opt_scope, opt_eventHandler) { 50 | }; 51 | 52 | 53 | /** 54 | * Removes an event listener added using goog.events.EventWrapper.listen. 55 | * 56 | * @param {EventTarget|goog.events.EventTarget} src The node to remove listener 57 | * from. 58 | * @param {Function|Object} listener Callback method, or an object with a 59 | * handleEvent function. 60 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 61 | * false). 62 | * @param {Object=} opt_scope Element in whose scope to call the listener. 63 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to remove 64 | * listener from. 65 | */ 66 | goog.events.EventWrapper.prototype.unlisten = function(src, listener, opt_capt, 67 | opt_scope, opt_eventHandler) { 68 | }; 69 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/reflect/reflect.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Useful compiler idioms. 17 | * 18 | */ 19 | 20 | goog.provide('goog.reflect'); 21 | 22 | 23 | /** 24 | * Syntax for object literal casts. 25 | * @see http://go/jscompiler-renaming 26 | * @see http://code.google.com/p/closure-compiler/wiki/ 27 | * ExperimentalTypeBasedPropertyRenaming 28 | * 29 | * Use this if you have an object literal whose keys need to have the same names 30 | * as the properties of some class even after they are renamed by the compiler. 31 | * 32 | * @param {!Function} type Type to cast to. 33 | * @param {Object} object Object literal to cast. 34 | * @return {Object} The object literal. 35 | */ 36 | goog.reflect.object = function(type, object) { 37 | return object; 38 | }; 39 | 40 | 41 | /** 42 | * To assert to the compiler that an operation is needed when it would 43 | * otherwise be stripped. For example: 44 | * 45 | * // Force a layout 46 | * goog.reflect.sinkValue(dialog.offsetHeight); 47 | * 48 | * @type {!Function} 49 | */ 50 | goog.reflect.sinkValue = function(x) { 51 | goog.reflect.sinkValue[' '](x); 52 | return x; 53 | }; 54 | 55 | 56 | /** 57 | * The compiler should optimize this function away iff no one ever uses 58 | * goog.reflect.sinkValue. 59 | */ 60 | goog.reflect.sinkValue[' '] = goog.nullFunction; 61 | 62 | 63 | /** 64 | * Check if a property can be accessed without throwing an exception. 65 | * @param {Object} obj The owner of the property. 66 | * @param {string} prop The property name. 67 | * @return {boolean} Whether the property is accessible. Will also return true 68 | * if obj is null. 69 | */ 70 | goog.reflect.canAccessProperty = function(obj, prop) { 71 | /** @preserveTry */ 72 | try { 73 | goog.reflect.sinkValue(obj[prop]); 74 | return true; 75 | } catch (e) {} 76 | return false; 77 | }; 78 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/goog/string/stringbuffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utility for fast string concatenation. 17 | */ 18 | 19 | goog.provide('goog.string.StringBuffer'); 20 | 21 | 22 | 23 | /** 24 | * Utility class to facilitate string concatenation. 25 | * 26 | * @param {*=} opt_a1 Optional first initial item to append. 27 | * @param {...*} var_args Other initial items to 28 | * append, e.g., new goog.string.StringBuffer('foo', 'bar'). 29 | * @constructor 30 | */ 31 | goog.string.StringBuffer = function(opt_a1, var_args) { 32 | if (opt_a1 != null) { 33 | this.append.apply(this, arguments); 34 | } 35 | }; 36 | 37 | 38 | /** 39 | * Internal buffer for the string to be concatenated. 40 | * @type {string} 41 | * @private 42 | */ 43 | goog.string.StringBuffer.prototype.buffer_ = ''; 44 | 45 | 46 | /** 47 | * Sets the contents of the string buffer object, replacing what's currently 48 | * there. 49 | * 50 | * @param {*} s String to set. 51 | */ 52 | goog.string.StringBuffer.prototype.set = function(s) { 53 | this.buffer_ = '' + s; 54 | }; 55 | 56 | 57 | /** 58 | * Appends one or more items to the buffer. 59 | * 60 | * Calling this with null, undefined, or empty arguments is an error. 61 | * 62 | * @param {*} a1 Required first string. 63 | * @param {*=} opt_a2 Optional second string. 64 | * @param {...*} var_args Other items to append, 65 | * e.g., sb.append('foo', 'bar', 'baz'). 66 | * @return {goog.string.StringBuffer} This same StringBuffer object. 67 | * @suppress {duplicate} 68 | */ 69 | goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { 70 | // Use a1 directly to avoid arguments instantiation for single-arg case. 71 | this.buffer_ += a1; 72 | if (opt_a2 != null) { // second argument is undefined (null == undefined) 73 | for (var i = 1; i < arguments.length; i++) { 74 | this.buffer_ += arguments[i]; 75 | } 76 | } 77 | return this; 78 | }; 79 | 80 | 81 | /** 82 | * Clears the internal buffer. 83 | */ 84 | goog.string.StringBuffer.prototype.clear = function() { 85 | this.buffer_ = ''; 86 | }; 87 | 88 | 89 | /** 90 | * @return {number} the length of the current contents of the buffer. 91 | */ 92 | goog.string.StringBuffer.prototype.getLength = function() { 93 | return this.buffer_.length; 94 | }; 95 | 96 | 97 | /** 98 | * @return {string} The concatenated string. 99 | * @override 100 | */ 101 | goog.string.StringBuffer.prototype.toString = function() { 102 | return this.buffer_; 103 | }; 104 | -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/js/proc_.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("base.js", ['goog'], []); 2 | goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.StringBuffer']); 3 | goog.addDependency("../blog/utils/helpers.js", ['blog.utils.helpers'], ['cljs.core']); 4 | goog.addDependency("../cljs/core/async/impl/protocols.js", ['cljs.core.async.impl.protocols'], ['cljs.core']); 5 | goog.addDependency("../cljs/core/async/impl/ioc_helpers.js", ['cljs.core.async.impl.ioc_helpers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 6 | goog.addDependency("../cljs/core/async/impl/buffers.js", ['cljs.core.async.impl.buffers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 7 | goog.addDependency("../cljs/core/async/impl/dispatch.js", ['cljs.core.async.impl.dispatch'], ['cljs.core.async.impl.buffers', 'cljs.core']); 8 | goog.addDependency("../cljs/core/async/impl/channels.js", ['cljs.core.async.impl.channels'], ['cljs.core.async.impl.buffers', 'cljs.core', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols']); 9 | goog.addDependency("../cljs/core/async/impl/timers.js", ['cljs.core.async.impl.timers'], ['cljs.core', 'cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols']); 10 | goog.addDependency("../cljs/core/async.js", ['cljs.core.async'], ['cljs.core.async.impl.ioc_helpers', 'cljs.core.async.impl.buffers', 'cljs.core', 'cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols', 'cljs.core.async.impl.timers']); 11 | goog.addDependency("../blog/utils/dom.js", ['blog.utils.dom'], ['goog.dom.classes', 'cljs.core', 'goog.dom', 'goog.style']); 12 | goog.addDependency("../blog/utils/reactive.js", ['blog.utils.reactive'], ['blog.utils.helpers', 'cljs.core', 'goog.events.EventType', 'goog.net.Jsonp', 'goog.dom', 'cljs.core.async', 'goog.events', 'goog.Uri', 'blog.utils.dom']); 13 | goog.addDependency("../blog/utils/node.js", ['blog.utils.node'], ['cljs.core', 'blog.utils.reactive']); 14 | goog.addDependency("../blog/processes/core.js", ['blog.processes.core'], ['cljs.core', 'cljs.core.async', 'blog.utils.dom']); -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/themes/tom/css/lmroman10-regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/themes/tom/css/lmroman10-regular-webfont.eot -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/themes/tom/css/lmroman10-regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/themes/tom/css/lmroman10-regular-webfont.ttf -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/themes/tom/css/lmroman10-regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/themes/tom/css/lmroman10-regular-webfont.woff -------------------------------------------------------------------------------- /5.David-Nolen-Display-Pipeline/assets/themes/tom/images/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliangamble/clojure-conj-2014-paradigms-of-core-async/950964320bbff17cdd3da7bbcae00ac85dbcd388/5.David-Nolen-Display-Pipeline/assets/themes/tom/images/rss.png -------------------------------------------------------------------------------- /6.Rich-Hickey-Original-Ants/ants-demo/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /classes 3 | /checkouts 4 | pom.xml 5 | pom.xml.asc 6 | *.jar 7 | *.class 8 | /.lein-* 9 | /.nrepl-port 10 | -------------------------------------------------------------------------------- /6.Rich-Hickey-Original-Ants/ants-demo/README.md: -------------------------------------------------------------------------------- 1 | # ants-demo 2 | 3 | FIXME: description 4 | 5 | ## Installation 6 | 7 | Download from http://example.com/FIXME. 8 | 9 | ## Usage 10 | 11 | FIXME: explanation 12 | 13 | $ java -jar ants-demo-0.1.0-standalone.jar [args] 14 | 15 | ## Options 16 | 17 | FIXME: listing of options this app accepts. 18 | 19 | ## Examples 20 | 21 | ... 22 | 23 | ### Bugs 24 | 25 | ... 26 | 27 | ### Any Other Sections 28 | ### That You Think 29 | ### Might be Useful 30 | 31 | ## License 32 | 33 | Copyright © 2014 FIXME 34 | 35 | Distributed under the Eclipse Public License either version 1.0 or (at 36 | your option) any later version. 37 | -------------------------------------------------------------------------------- /6.Rich-Hickey-Original-Ants/ants-demo/doc/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction to ants-demo 2 | 3 | TODO: write [great documentation](http://jacobian.org/writing/great-documentation/what-to-write/) 4 | -------------------------------------------------------------------------------- /6.Rich-Hickey-Original-Ants/ants-demo/project.clj: -------------------------------------------------------------------------------- 1 | (defproject ants-demo "0.1.0-SNAPSHOT" 2 | :description "FIXME: write description" 3 | :url "http://example.com/FIXME" 4 | :license {:name "Eclipse Public License" 5 | :url "http://www.eclipse.org/legal/epl-v10.html"} 6 | :dependencies [[org.clojure/clojure "1.5.1"]] 7 | :main ^:skip-aot ants-demo.core 8 | :target-path "target/%s" 9 | :profiles {:uberjar {:aot :all}}) 10 | -------------------------------------------------------------------------------- /6.Rich-Hickey-Original-Ants/ants-demo/test/ants_demo/core_test.clj: -------------------------------------------------------------------------------- 1 | (ns ants-demo.core-test 2 | (:require [clojure.test :refer :all] 3 | [ants-demo.core :refer :all])) 4 | 5 | (deftest a-test 6 | (testing "FIXME, I fail." 7 | (is (= 0 1)))) 8 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/ants_cljs.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("base.js", ['goog'], []); 2 | goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.StringBuffer']); 3 | goog.addDependency("../ants_cljs/core.js", ['ants_cljs.core'], ['cljs.core', 'goog.dom', 'goog.events']); -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/cljs workflow.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1265 2 | {\fonttbl\f0\fnil\fcharset0 Menlo-Regular;} 3 | {\colortbl;\red255\green255\blue255;\red34\green79\blue188;} 4 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 5 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural 6 | 7 | \f0\fs22 \cf1 \cb2 \CocoaLigature0 lein cljsbuild auto ants-cljs\ 8 | \ 9 | \ 10 | \ 11 | } -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/cljs/core/async/impl/buffers.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.buffers 10 | (:require [cljs.core.async.impl.protocols :as impl])) 11 | 12 | ;; ----------------------------------------------------------------------------- 13 | ;; DO NOT USE, this is internal buffer representation 14 | 15 | (defn acopy [src src-start dest dest-start len] 16 | (loop [cnt 0] 17 | (when (< cnt len) 18 | (aset dest 19 | (+ dest-start cnt) 20 | (aget src (+ src-start cnt))) 21 | (recur (inc cnt))))) 22 | 23 | (deftype RingBuffer [^:mutable head ^:mutable tail ^:mutable length ^:mutable arr] 24 | Object 25 | (pop [_] 26 | (when-not (zero? length) 27 | (let [x (aget arr tail)] 28 | (aset arr tail nil) 29 | (set! tail (js-mod (inc tail) (alength arr))) 30 | (set! length (dec length)) 31 | x))) 32 | 33 | (unshift [_ x] 34 | (aset arr head x) 35 | (set! head (js-mod (inc head) (alength arr))) 36 | (set! length (inc length)) 37 | nil) 38 | 39 | (unbounded-unshift [this x] 40 | (if (== (inc length) (alength arr)) 41 | (.resize this)) 42 | (.unshift this x)) 43 | 44 | ;; Doubles the size of the buffer while retaining all the existing values 45 | (resize 46 | [_] 47 | (let [new-arr-size (* (alength arr) 2) 48 | new-arr (make-array new-arr-size)] 49 | (cond 50 | (< tail head) 51 | (do (acopy arr tail new-arr 0 length) 52 | (set! tail 0) 53 | (set! head length) 54 | (set! arr new-arr)) 55 | 56 | (> tail head) 57 | (do (acopy arr tail new-arr 0 (- (alength arr) tail)) 58 | (acopy arr 0 new-arr (- (alength arr) tail) head) 59 | (set! tail 0) 60 | (set! head length) 61 | (set! arr new-arr)) 62 | 63 | (== tail head) 64 | (do (set! tail 0) 65 | (set! head 0) 66 | (set! arr new-arr))))) 67 | 68 | (cleanup [this keep?] 69 | (dotimes [x length] 70 | (let [v (.pop this)] 71 | (when ^boolean (keep? v) 72 | (.unshift this v)))))) 73 | 74 | (defn ring-buffer [n] 75 | (assert (> n 0) "Can't create a ring buffer of size 0") 76 | (RingBuffer. 0 0 0 (make-array n))) 77 | 78 | ;; ----------------------------------------------------------------------------- 79 | 80 | (deftype FixedBuffer [buf n] 81 | impl/Buffer 82 | (full? [this] 83 | (== (.-length buf) n)) 84 | (remove! [this] 85 | (.pop buf)) 86 | (add! [this itm] 87 | (assert (not (impl/full? this)) "Can't add to a full buffer") 88 | (.unshift buf itm)) 89 | cljs.core/ICounted 90 | (-count [this] 91 | (.-length buf))) 92 | 93 | (defn fixed-buffer [n] 94 | (FixedBuffer. (ring-buffer n) n)) 95 | 96 | (deftype DroppingBuffer [buf n] 97 | impl/UnblockingBuffer 98 | impl/Buffer 99 | (full? [this] 100 | false) 101 | (remove! [this] 102 | (.pop buf)) 103 | (add! [this itm] 104 | (when-not (== (.-length buf) n) 105 | (.unshift buf itm))) 106 | cljs.core/ICounted 107 | (-count [this] 108 | (.-length buf))) 109 | 110 | (defn dropping-buffer [n] 111 | (DroppingBuffer. (ring-buffer n) n)) 112 | 113 | (deftype SlidingBuffer [buf n] 114 | impl/UnblockingBuffer 115 | impl/Buffer 116 | (full? [this] 117 | false) 118 | (remove! [this] 119 | (.pop buf)) 120 | (add! [this itm] 121 | (when (== (.-length buf) n) 122 | (impl/remove! this)) 123 | (.unshift buf itm)) 124 | cljs.core/ICounted 125 | (-count [this] 126 | (.-length buf))) 127 | 128 | (defn sliding-buffer [n] 129 | (SlidingBuffer. (ring-buffer n) n)) 130 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/cljs/core/async/impl/dispatch.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.dispatch 2 | (:require [cljs.core.async.impl.buffers :as buffers])) 3 | 4 | (def message-channel nil) 5 | (def tasks (buffers/ring-buffer 32)) 6 | (def ^:boolean running? false) 7 | (def ^:boolean queued? false) 8 | 9 | (def TASK_BATCH_SIZE 1024) 10 | 11 | (declare queue-dispatcher) 12 | 13 | (defn process-messages [] 14 | (set! running? true) 15 | (set! queued? false) 16 | (loop [count 0] 17 | (let [m (.pop tasks)] 18 | (when-not (nil? m) 19 | (m) 20 | (when (< count TASK_BATCH_SIZE) 21 | (recur (inc count)))))) 22 | (set! running? false) 23 | (when (> (.-length tasks) 0) 24 | (queue-dispatcher))) 25 | 26 | (when (exists? js/MessageChannel) 27 | (set! message-channel (js/MessageChannel.)) 28 | (set! (.. message-channel -port1 -onmessage) 29 | (fn [msg] 30 | (process-messages)))) 31 | 32 | (defn queue-dispatcher [] 33 | (when-not ^boolean (and ^boolean queued? 34 | running?) 35 | (set! queued? true) 36 | (cond 37 | (exists? js/MessageChannel) (.postMessage (.-port2 message-channel) 0) 38 | (exists? js/setImmediate) (js/setImmediate process-messages) 39 | :else (js/setTimeout process-messages 0)))) 40 | 41 | (defn run [f] 42 | (.unbounded-unshift tasks f) 43 | (queue-dispatcher)) 44 | 45 | (defn queue-delay [f delay] 46 | (js/setTimeout f delay)) 47 | 48 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/cljs/core/async/impl/dispatch.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('cljs.core.async.impl.dispatch'); 3 | goog.require('cljs.core'); 4 | goog.require('cljs.core.async.impl.buffers'); 5 | goog.require('cljs.core.async.impl.buffers'); 6 | cljs.core.async.impl.dispatch.message_channel = null; 7 | cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,32); 8 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 9 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 10 | cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = 1024; 11 | cljs.core.async.impl.dispatch.process_messages = (function process_messages(){cljs.core.async.impl.dispatch.running_QMARK_ = true; 12 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 13 | var count_11432 = 0;while(true){ 14 | var m_11433 = cljs.core.async.impl.dispatch.tasks.pop();if((m_11433 == null)) 15 | {} else 16 | {m_11433.call(null); 17 | if((count_11432 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)) 18 | {{ 19 | var G__11434 = (count_11432 + 1); 20 | count_11432 = G__11434; 21 | continue; 22 | } 23 | } else 24 | {} 25 | } 26 | break; 27 | } 28 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 29 | if((cljs.core.async.impl.dispatch.tasks.length > 0)) 30 | {return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 31 | } else 32 | {return null; 33 | } 34 | }); 35 | if(typeof MessageChannel !== 'undefined') 36 | {cljs.core.async.impl.dispatch.message_channel = (new MessageChannel()); 37 | cljs.core.async.impl.dispatch.message_channel.port1.onmessage = (function (msg){return cljs.core.async.impl.dispatch.process_messages.call(null); 38 | }); 39 | } else 40 | {} 41 | cljs.core.async.impl.dispatch.queue_dispatcher = (function queue_dispatcher(){if(cljs.core.truth_((function (){var and__3431__auto__ = cljs.core.async.impl.dispatch.queued_QMARK_;if(and__3431__auto__) 42 | {return cljs.core.async.impl.dispatch.running_QMARK_; 43 | } else 44 | {return and__3431__auto__; 45 | } 46 | })())) 47 | {return null; 48 | } else 49 | {cljs.core.async.impl.dispatch.queued_QMARK_ = true; 50 | if(typeof MessageChannel !== 'undefined') 51 | {return cljs.core.async.impl.dispatch.message_channel.port2.postMessage(0); 52 | } else 53 | {if(typeof setImmediate !== 'undefined') 54 | {return setImmediate(cljs.core.async.impl.dispatch.process_messages); 55 | } else 56 | {if(new cljs.core.Keyword(null,"else","else",1017020587)) 57 | {return setTimeout(cljs.core.async.impl.dispatch.process_messages,0); 58 | } else 59 | {return null; 60 | } 61 | } 62 | } 63 | } 64 | }); 65 | cljs.core.async.impl.dispatch.run = (function run(f){cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f); 66 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 67 | }); 68 | cljs.core.async.impl.dispatch.queue_delay = (function queue_delay(f,delay){return setTimeout(f,delay); 69 | }); 70 | 71 | //# sourceMappingURL=dispatch.js.map -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/cljs/core/async/impl/dispatch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Documents/workspace_nonbook/ants-cljs/out/cljs/core/async/impl/dispatch.js", 4 | "sources":["dispatch.cljs"], 5 | "lineCount":71, 6 | "mappings": 7 | ";AAAA;;;;AAGA,gDAAA,hDAAKA;AACL,AAAKC,sCAAM,mDAAA,nDAACC;AACZ,+CAAA,/CAAeC;AACf,8CAAA,9CAAeC;AAEf,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,6BAAA,9EAAMC,8EACJ,+CAAA,/CAAMH;AACN,8CAAA,9CAAMC;AACN,kBAAA,dAAOG;AAAP,AACE,wDAAA,pDAAMC,UAAE,AAAMP,0CACZ,GAAU,YAAA,XAAMO;CAAhB;CAAA,AACE,AAACA;AACD,GAAM,CAAGD,cAAMF;CAAf,AACE;eAAO,eAAA,dAAKE;;;;;CADd;;;;AAEN,+CAAA,/CAAMJ;AACN,GAAM,8CAAA,7CAAG,AAAUF;CAAnB,AACE,OAACQ;;CADH;;;AAGF,GAAM,OAASC;CAAf,AACE,AAAMV,gDAAgB,KAAAU;AACtB,AAAM,AAAA,AAAIV,gEACJ,gBAAA,LAAKW,KACH,OAACL;;;CAJX;AAMA,iDAAA,6BAAA,9EAAMG,8EACJ,oBAAU,iBAAAG,gEAAA,AAAA,GAAAA,/CAAuBR;CACTD;;CADdS;;;CAAV;;CAAA,AAEE,8CAAA,9CAAMR;AACN,GACC,OAASM;CAAmB,uEAAA,hEAAc,AAASV;;CADpD,GAEC,OAASa;CAAiB,OAACA,aAAgBP;;CAF5C,GAAA;CAGO,iEAAA,1DAACQ,WAAcR;;CAHtB;;;;;;AAKJ,oCAAA,iBAAA,rDAAMS,kDAAKC,GACT,AAAoBf,sDAAMe;AAC1B,OAACP;;AAEH,4CAAA,+BAAA,3EAAMQ,kEAAaD,EAAEE,OACnB,OAACJ,WAAcE,EAAEE", 8 | "names": 9 | ["cljs.core.async.impl.dispatch/message-channel", 10 | "cljs.core.async.impl.dispatch/tasks", 11 | "cljs.core.async.impl.buffers/ring-buffer", 12 | "cljs.core.async.impl.dispatch/running?", 13 | "cljs.core.async.impl.dispatch/queued?", 14 | "cljs.core.async.impl.dispatch/TASK_BATCH_SIZE", 15 | "cljs.core.async.impl.dispatch/process-messages", "count", "m", 16 | "cljs.core.async.impl.dispatch/queue-dispatcher", 17 | "js/MessageChannel", "msg", "and__3431__auto__", "js/setImmediate", 18 | "js/setTimeout", "cljs.core.async.impl.dispatch/run", "f", 19 | "cljs.core.async.impl.dispatch/queue-delay", "delay"]} -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/cljs/core/async/impl/protocols.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.protocols) 10 | 11 | (def ^:const MAX-QUEUE-SIZE 1024) 12 | 13 | (defprotocol ReadPort 14 | (take! [port fn1-handler] "derefable val if taken, nil if take was enqueued")) 15 | 16 | (defprotocol WritePort 17 | (put! [port val fn1-handler] "derefable boolean (false if already closed) if handled, nil if put was enqueued. 18 | Must throw on nil val.")) 19 | 20 | (defprotocol Channel 21 | (close! [chan]) 22 | (closed? [chan])) 23 | 24 | (defprotocol Handler 25 | (active? [h] "returns true if has callback. Must work w/o lock") 26 | #_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock") 27 | (commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock")) 28 | 29 | (defprotocol Buffer 30 | (full? [b]) 31 | (remove! [b]) 32 | (add! [b itm])) 33 | 34 | ;; Defines a buffer that will never block (return true to full?) 35 | (defprotocol UnblockingBuffer) 36 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/debug/error.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Provides a base class for custom Error objects such that the 17 | * stack is correctly maintained. 18 | * 19 | * You should never need to throw goog.debug.Error(msg) directly, Error(msg) is 20 | * sufficient. 21 | * 22 | */ 23 | 24 | goog.provide('goog.debug.Error'); 25 | 26 | 27 | 28 | /** 29 | * Base class for custom error objects. 30 | * @param {*=} opt_msg The message associated with the error. 31 | * @constructor 32 | * @extends {Error} 33 | */ 34 | goog.debug.Error = function(opt_msg) { 35 | 36 | // Ensure there is a stack trace. 37 | if (Error.captureStackTrace) { 38 | Error.captureStackTrace(this, goog.debug.Error); 39 | } else { 40 | this.stack = new Error().stack || ''; 41 | } 42 | 43 | if (opt_msg) { 44 | this.message = String(opt_msg); 45 | } 46 | }; 47 | goog.inherits(goog.debug.Error, Error); 48 | 49 | 50 | /** @override */ 51 | goog.debug.Error.prototype.name = 'CustomError'; 52 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/debug/errorhandlerweakdep.js: -------------------------------------------------------------------------------- 1 | // Copyright 2008 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview File which defines dummy object to work around undefined 17 | * properties compiler warning for weak dependencies on 18 | * {@link goog.debug.ErrorHandler#protectEntryPoint}. 19 | * 20 | */ 21 | 22 | goog.provide('goog.debug.errorHandlerWeakDep'); 23 | 24 | 25 | /** 26 | * Dummy object to work around undefined properties compiler warning. 27 | * @type {Object} 28 | */ 29 | goog.debug.errorHandlerWeakDep = { 30 | /** 31 | * @param {Function} fn An entry point function to be protected. 32 | * @param {boolean=} opt_tracers Whether to install tracers around the 33 | * fn. 34 | * @return {Function} A protected wrapper function that calls the 35 | * entry point function. 36 | */ 37 | protectEntryPoint: function(fn, opt_tracers) { return fn; } 38 | }; 39 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/deps.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("string/string.js", ['goog.string', 'goog.string.Unicode'], []); 2 | goog.addDependency("debug/error.js", ['goog.debug.Error'], []); 3 | goog.addDependency("asserts/asserts.js", ['goog.asserts', 'goog.asserts.AssertionError'], ['goog.debug.Error', 'goog.string']); 4 | goog.addDependency("array/array.js", ['goog.array', 'goog.array.ArrayLike'], ['goog.asserts']); 5 | goog.addDependency("object/object.js", ['goog.object'], []); 6 | goog.addDependency("string/stringbuffer.js", ['goog.string.StringBuffer'], []); 7 | goog.addDependency("useragent/useragent.js", ['goog.userAgent'], ['goog.string']); 8 | goog.addDependency("dom/browserfeature.js", ['goog.dom.BrowserFeature'], ['goog.userAgent']); 9 | goog.addDependency("dom/tagname.js", ['goog.dom.TagName'], []); 10 | goog.addDependency("dom/classes.js", ['goog.dom.classes'], ['goog.array']); 11 | goog.addDependency("math/math.js", ['goog.math'], ['goog.array', 'goog.asserts']); 12 | goog.addDependency("math/coordinate.js", ['goog.math.Coordinate'], ['goog.math']); 13 | goog.addDependency("math/size.js", ['goog.math.Size'], []); 14 | goog.addDependency("dom/dom.js", ['goog.dom', 'goog.dom.DomHelper', 'goog.dom.NodeType'], ['goog.array', 'goog.dom.BrowserFeature', 'goog.dom.TagName', 'goog.dom.classes', 'goog.math.Coordinate', 'goog.math.Size', 'goog.object', 'goog.string', 'goog.userAgent']); 15 | goog.addDependency("debug/entrypointregistry.js", ['goog.debug.EntryPointMonitor', 'goog.debug.entryPointRegistry'], ['goog.asserts']); 16 | goog.addDependency("debug/errorhandlerweakdep.js", ['goog.debug.errorHandlerWeakDep'], []); 17 | goog.addDependency("events/browserfeature.js", ['goog.events.BrowserFeature'], ['goog.userAgent']); 18 | goog.addDependency("disposable/idisposable.js", ['goog.disposable.IDisposable'], []); 19 | goog.addDependency("disposable/disposable.js", ['goog.Disposable', 'goog.dispose'], ['goog.disposable.IDisposable']); 20 | goog.addDependency("events/event.js", ['goog.events.Event', 'goog.events.EventLike'], ['goog.Disposable']); 21 | goog.addDependency("events/eventtype.js", ['goog.events.EventType'], ['goog.userAgent']); 22 | goog.addDependency("reflect/reflect.js", ['goog.reflect'], []); 23 | goog.addDependency("events/browserevent.js", ['goog.events.BrowserEvent', 'goog.events.BrowserEvent.MouseButton'], ['goog.events.BrowserFeature', 'goog.events.Event', 'goog.events.EventType', 'goog.reflect', 'goog.userAgent']); 24 | goog.addDependency("events/eventwrapper.js", ['goog.events.EventWrapper'], []); 25 | goog.addDependency("events/listenable.js", ['goog.events.Listenable', 'goog.events.ListenableKey'], ['goog.events.EventLike']); 26 | goog.addDependency("events/listener.js", ['goog.events.Listener'], ['goog.events.ListenableKey']); 27 | goog.addDependency("events/events.js", ['goog.events', 'goog.events.Key'], ['goog.array', 'goog.debug.entryPointRegistry', 'goog.debug.errorHandlerWeakDep', 'goog.events.BrowserEvent', 'goog.events.BrowserFeature', 'goog.events.Event', 'goog.events.EventWrapper', 'goog.events.Listenable', 'goog.events.Listener', 'goog.object', 'goog.userAgent']); -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/disposable/idisposable.js: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the disposable interface. A disposable object 17 | * has a dispose method to to clean up references and resources. 18 | * @author nnaze@google.com (Nathan Naze) 19 | */ 20 | 21 | 22 | goog.provide('goog.disposable.IDisposable'); 23 | 24 | 25 | 26 | /** 27 | * Interface for a disposable object. If a instance requires cleanup 28 | * (references COM objects, DOM notes, or other disposable objects), it should 29 | * implement this interface (it may subclass goog.Disposable). 30 | * @interface 31 | */ 32 | goog.disposable.IDisposable = function() {}; 33 | 34 | 35 | /** 36 | * Disposes of the object and its resources. 37 | * @return {void} Nothing. 38 | */ 39 | goog.disposable.IDisposable.prototype.dispose; 40 | 41 | 42 | /** 43 | * @return {boolean} Whether the object has been disposed of. 44 | */ 45 | goog.disposable.IDisposable.prototype.isDisposed; 46 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/dom/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the dom package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.dom.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.dom.BrowserFeature = { 31 | /** 32 | * Whether attributes 'name' and 'type' can be added to an element after it's 33 | * created. False in Internet Explorer prior to version 9. 34 | */ 35 | CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: !goog.userAgent.IE || 36 | goog.userAgent.isDocumentMode(9), 37 | 38 | /** 39 | * Whether we can use element.children to access an element's Element 40 | * children. Available since Gecko 1.9.1, IE 9. (IE<9 also includes comment 41 | * nodes in the collection.) 42 | */ 43 | CAN_USE_CHILDREN_ATTRIBUTE: !goog.userAgent.GECKO && !goog.userAgent.IE || 44 | goog.userAgent.IE && goog.userAgent.isDocumentMode(9) || 45 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9.1'), 46 | 47 | /** 48 | * Opera, Safari 3, and Internet Explorer 9 all support innerText but they 49 | * include text nodes in script and style tags. Not document-mode-dependent. 50 | */ 51 | CAN_USE_INNER_TEXT: goog.userAgent.IE && !goog.userAgent.isVersion('9'), 52 | 53 | /** 54 | * MSIE, Opera, and Safari>=4 support element.parentElement to access an 55 | * element's parent if it is an Element. 56 | */ 57 | CAN_USE_PARENT_ELEMENT_PROPERTY: goog.userAgent.IE || goog.userAgent.OPERA || 58 | goog.userAgent.WEBKIT, 59 | 60 | /** 61 | * Whether NoScope elements need a scoped element written before them in 62 | * innerHTML. 63 | * MSDN: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx#1 64 | */ 65 | INNER_HTML_NEEDS_SCOPED_ELEMENT: goog.userAgent.IE 66 | }; 67 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/dom/nodetype.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of goog.dom.NodeType. 17 | */ 18 | 19 | goog.provide('goog.dom.NodeType'); 20 | 21 | 22 | /** 23 | * Constants for the nodeType attribute in the Node interface. 24 | * 25 | * These constants match those specified in the Node interface. These are 26 | * usually present on the Node object in recent browsers, but not in older 27 | * browsers (specifically, early IEs) and thus are given here. 28 | * 29 | * In some browsers (early IEs), these are not defined on the Node object, 30 | * so they are provided here. 31 | * 32 | * See http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247 33 | * @enum {number} 34 | */ 35 | goog.dom.NodeType = { 36 | ELEMENT: 1, 37 | ATTRIBUTE: 2, 38 | TEXT: 3, 39 | CDATA_SECTION: 4, 40 | ENTITY_REFERENCE: 5, 41 | ENTITY: 6, 42 | PROCESSING_INSTRUCTION: 7, 43 | COMMENT: 8, 44 | DOCUMENT: 9, 45 | DOCUMENT_TYPE: 10, 46 | DOCUMENT_FRAGMENT: 11, 47 | NOTATION: 12 48 | }; 49 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/dom/tagname.js: -------------------------------------------------------------------------------- 1 | // Copyright 2007 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Defines the goog.dom.TagName enum. This enumerates 17 | * all HTML tag names specified in either the the W3C HTML 4.01 index of 18 | * elements or the HTML5 draft specification. 19 | * 20 | * References: 21 | * http://www.w3.org/TR/html401/index/elements.html 22 | * http://dev.w3.org/html5/spec/section-index.html 23 | * 24 | */ 25 | goog.provide('goog.dom.TagName'); 26 | 27 | 28 | /** 29 | * Enum of all html tag names specified by the W3C HTML4.01 and HTML5 30 | * specifications. 31 | * @enum {string} 32 | */ 33 | goog.dom.TagName = { 34 | A: 'A', 35 | ABBR: 'ABBR', 36 | ACRONYM: 'ACRONYM', 37 | ADDRESS: 'ADDRESS', 38 | APPLET: 'APPLET', 39 | AREA: 'AREA', 40 | ARTICLE: 'ARTICLE', 41 | ASIDE: 'ASIDE', 42 | AUDIO: 'AUDIO', 43 | B: 'B', 44 | BASE: 'BASE', 45 | BASEFONT: 'BASEFONT', 46 | BDI: 'BDI', 47 | BDO: 'BDO', 48 | BIG: 'BIG', 49 | BLOCKQUOTE: 'BLOCKQUOTE', 50 | BODY: 'BODY', 51 | BR: 'BR', 52 | BUTTON: 'BUTTON', 53 | CANVAS: 'CANVAS', 54 | CAPTION: 'CAPTION', 55 | CENTER: 'CENTER', 56 | CITE: 'CITE', 57 | CODE: 'CODE', 58 | COL: 'COL', 59 | COLGROUP: 'COLGROUP', 60 | COMMAND: 'COMMAND', 61 | DATA: 'DATA', 62 | DATALIST: 'DATALIST', 63 | DD: 'DD', 64 | DEL: 'DEL', 65 | DETAILS: 'DETAILS', 66 | DFN: 'DFN', 67 | DIALOG: 'DIALOG', 68 | DIR: 'DIR', 69 | DIV: 'DIV', 70 | DL: 'DL', 71 | DT: 'DT', 72 | EM: 'EM', 73 | EMBED: 'EMBED', 74 | FIELDSET: 'FIELDSET', 75 | FIGCAPTION: 'FIGCAPTION', 76 | FIGURE: 'FIGURE', 77 | FONT: 'FONT', 78 | FOOTER: 'FOOTER', 79 | FORM: 'FORM', 80 | FRAME: 'FRAME', 81 | FRAMESET: 'FRAMESET', 82 | H1: 'H1', 83 | H2: 'H2', 84 | H3: 'H3', 85 | H4: 'H4', 86 | H5: 'H5', 87 | H6: 'H6', 88 | HEAD: 'HEAD', 89 | HEADER: 'HEADER', 90 | HGROUP: 'HGROUP', 91 | HR: 'HR', 92 | HTML: 'HTML', 93 | I: 'I', 94 | IFRAME: 'IFRAME', 95 | IMG: 'IMG', 96 | INPUT: 'INPUT', 97 | INS: 'INS', 98 | ISINDEX: 'ISINDEX', 99 | KBD: 'KBD', 100 | KEYGEN: 'KEYGEN', 101 | LABEL: 'LABEL', 102 | LEGEND: 'LEGEND', 103 | LI: 'LI', 104 | LINK: 'LINK', 105 | MAP: 'MAP', 106 | MARK: 'MARK', 107 | MATH: 'MATH', 108 | MENU: 'MENU', 109 | META: 'META', 110 | METER: 'METER', 111 | NAV: 'NAV', 112 | NOFRAMES: 'NOFRAMES', 113 | NOSCRIPT: 'NOSCRIPT', 114 | OBJECT: 'OBJECT', 115 | OL: 'OL', 116 | OPTGROUP: 'OPTGROUP', 117 | OPTION: 'OPTION', 118 | OUTPUT: 'OUTPUT', 119 | P: 'P', 120 | PARAM: 'PARAM', 121 | PRE: 'PRE', 122 | PROGRESS: 'PROGRESS', 123 | Q: 'Q', 124 | RP: 'RP', 125 | RT: 'RT', 126 | RUBY: 'RUBY', 127 | S: 'S', 128 | SAMP: 'SAMP', 129 | SCRIPT: 'SCRIPT', 130 | SECTION: 'SECTION', 131 | SELECT: 'SELECT', 132 | SMALL: 'SMALL', 133 | SOURCE: 'SOURCE', 134 | SPAN: 'SPAN', 135 | STRIKE: 'STRIKE', 136 | STRONG: 'STRONG', 137 | STYLE: 'STYLE', 138 | SUB: 'SUB', 139 | SUMMARY: 'SUMMARY', 140 | SUP: 'SUP', 141 | SVG: 'SVG', 142 | TABLE: 'TABLE', 143 | TBODY: 'TBODY', 144 | TD: 'TD', 145 | TEXTAREA: 'TEXTAREA', 146 | TFOOT: 'TFOOT', 147 | TH: 'TH', 148 | THEAD: 'THEAD', 149 | TIME: 'TIME', 150 | TITLE: 'TITLE', 151 | TR: 'TR', 152 | TRACK: 'TRACK', 153 | TT: 'TT', 154 | U: 'U', 155 | UL: 'UL', 156 | VAR: 'VAR', 157 | VIDEO: 'VIDEO', 158 | WBR: 'WBR' 159 | }; 160 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/events/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the events package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.events.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.events.BrowserFeature = { 31 | /** 32 | * Whether the button attribute of the event is W3C compliant. False in 33 | * Internet Explorer prior to version 9; document-version dependent. 34 | */ 35 | HAS_W3C_BUTTON: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 36 | 37 | /** 38 | * Whether the browser supports full W3C event model. 39 | */ 40 | HAS_W3C_EVENT_SUPPORT: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 41 | 42 | /** 43 | * To prevent default in IE7-8 for certain keydown events we need set the 44 | * keyCode to -1. 45 | */ 46 | SET_KEY_CODE_TO_PREVENT_DEFAULT: goog.userAgent.IE && 47 | !goog.userAgent.isVersion('9'), 48 | 49 | /** 50 | * Whether the {@code navigator.onLine} property is supported. 51 | */ 52 | HAS_NAVIGATOR_ONLINE_PROPERTY: !goog.userAgent.WEBKIT || 53 | goog.userAgent.isVersion('528'), 54 | 55 | /** 56 | * Whether HTML5 network online/offline events are supported. 57 | */ 58 | HAS_HTML5_NETWORK_EVENT_SUPPORT: 59 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9b') || 60 | goog.userAgent.IE && goog.userAgent.isVersion('8') || 61 | goog.userAgent.OPERA && goog.userAgent.isVersion('9.5') || 62 | goog.userAgent.WEBKIT && goog.userAgent.isVersion('528'), 63 | 64 | /** 65 | * Whether HTML5 network events fire on document.body, or otherwise the 66 | * window. 67 | */ 68 | HTML5_NETWORK_EVENTS_FIRE_ON_BODY: 69 | goog.userAgent.GECKO && !goog.userAgent.isVersion('8') || 70 | goog.userAgent.IE && !goog.userAgent.isVersion('9'), 71 | 72 | /** 73 | * Whether touch is enabled in the browser. 74 | */ 75 | TOUCH_ENABLED: 76 | ('ontouchstart' in goog.global || 77 | !!(goog.global['document'] && 78 | document.documentElement && 79 | 'ontouchstart' in document.documentElement) || 80 | // IE10 uses non-standard touch events, so it has a different check. 81 | !!(goog.global['navigator'] && 82 | goog.global['navigator']['msMaxTouchPoints'])) 83 | }; 84 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/events/eventid.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | goog.provide('goog.events.EventId'); 16 | 17 | 18 | 19 | /** 20 | * A templated class that is used when registering for events. Typical usage: 21 | * 22 | * /** @type {goog.events.EventId.} 23 | * var myEventId = new goog.events.EventId( 24 | * goog.events.getUniqueId(('someEvent')); 25 | * 26 | * // No need to cast or declare here since the compiler knows the correct 27 | * // type of 'evt' (MyEventObj). 28 | * something.listen(myEventId, function(evt) {}); 29 | * 30 | * 31 | * @param {string} eventId 32 | * @template T 33 | * @constructor 34 | * @struct 35 | * @final 36 | */ 37 | goog.events.EventId = function(eventId) { 38 | /** @const */ this.id = eventId; 39 | }; 40 | 41 | 42 | /** 43 | * @override 44 | */ 45 | goog.events.EventId.prototype.toString = function() { 46 | return this.id; 47 | }; 48 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/events/eventwrapper.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the goog.events.EventWrapper interface. 17 | * 18 | * @author eae@google.com (Emil A Eklund) 19 | */ 20 | 21 | goog.provide('goog.events.EventWrapper'); 22 | 23 | 24 | 25 | /** 26 | * Interface for event wrappers. 27 | * @interface 28 | */ 29 | goog.events.EventWrapper = function() { 30 | }; 31 | 32 | 33 | /** 34 | * Adds an event listener using the wrapper on a DOM Node or an object that has 35 | * implemented {@link goog.events.EventTarget}. A listener can only be added 36 | * once to an object. 37 | * 38 | * @param {EventTarget|goog.events.EventTarget} src The node to listen to 39 | * events on. 40 | * @param {Function|Object} listener Callback method, or an object with a 41 | * handleEvent function. 42 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 43 | * false). 44 | * @param {Object=} opt_scope Element in whose scope to call the listener. 45 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to add 46 | * listener to. 47 | */ 48 | goog.events.EventWrapper.prototype.listen = function(src, listener, opt_capt, 49 | opt_scope, opt_eventHandler) { 50 | }; 51 | 52 | 53 | /** 54 | * Removes an event listener added using goog.events.EventWrapper.listen. 55 | * 56 | * @param {EventTarget|goog.events.EventTarget} src The node to remove listener 57 | * from. 58 | * @param {Function|Object} listener Callback method, or an object with a 59 | * handleEvent function. 60 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 61 | * false). 62 | * @param {Object=} opt_scope Element in whose scope to call the listener. 63 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to remove 64 | * listener from. 65 | */ 66 | goog.events.EventWrapper.prototype.unlisten = function(src, listener, opt_capt, 67 | opt_scope, opt_eventHandler) { 68 | }; 69 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/reflect/reflect.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Useful compiler idioms. 17 | * 18 | */ 19 | 20 | goog.provide('goog.reflect'); 21 | 22 | 23 | /** 24 | * Syntax for object literal casts. 25 | * @see http://go/jscompiler-renaming 26 | * @see http://code.google.com/p/closure-compiler/wiki/ 27 | * ExperimentalTypeBasedPropertyRenaming 28 | * 29 | * Use this if you have an object literal whose keys need to have the same names 30 | * as the properties of some class even after they are renamed by the compiler. 31 | * 32 | * @param {!Function} type Type to cast to. 33 | * @param {Object} object Object literal to cast. 34 | * @return {Object} The object literal. 35 | */ 36 | goog.reflect.object = function(type, object) { 37 | return object; 38 | }; 39 | 40 | 41 | /** 42 | * To assert to the compiler that an operation is needed when it would 43 | * otherwise be stripped. For example: 44 | * 45 | * // Force a layout 46 | * goog.reflect.sinkValue(dialog.offsetHeight); 47 | * 48 | * @type {!Function} 49 | */ 50 | goog.reflect.sinkValue = function(x) { 51 | goog.reflect.sinkValue[' '](x); 52 | return x; 53 | }; 54 | 55 | 56 | /** 57 | * The compiler should optimize this function away iff no one ever uses 58 | * goog.reflect.sinkValue. 59 | */ 60 | goog.reflect.sinkValue[' '] = goog.nullFunction; 61 | 62 | 63 | /** 64 | * Check if a property can be accessed without throwing an exception. 65 | * @param {Object} obj The owner of the property. 66 | * @param {string} prop The property name. 67 | * @return {boolean} Whether the property is accessible. Will also return true 68 | * if obj is null. 69 | */ 70 | goog.reflect.canAccessProperty = function(obj, prop) { 71 | /** @preserveTry */ 72 | try { 73 | goog.reflect.sinkValue(obj[prop]); 74 | return true; 75 | } catch (e) {} 76 | return false; 77 | }; 78 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/out/goog/string/stringbuffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utility for fast string concatenation. 17 | */ 18 | 19 | goog.provide('goog.string.StringBuffer'); 20 | 21 | 22 | 23 | /** 24 | * Utility class to facilitate string concatenation. 25 | * 26 | * @param {*=} opt_a1 Optional first initial item to append. 27 | * @param {...*} var_args Other initial items to 28 | * append, e.g., new goog.string.StringBuffer('foo', 'bar'). 29 | * @constructor 30 | */ 31 | goog.string.StringBuffer = function(opt_a1, var_args) { 32 | if (opt_a1 != null) { 33 | this.append.apply(this, arguments); 34 | } 35 | }; 36 | 37 | 38 | /** 39 | * Internal buffer for the string to be concatenated. 40 | * @type {string} 41 | * @private 42 | */ 43 | goog.string.StringBuffer.prototype.buffer_ = ''; 44 | 45 | 46 | /** 47 | * Sets the contents of the string buffer object, replacing what's currently 48 | * there. 49 | * 50 | * @param {*} s String to set. 51 | */ 52 | goog.string.StringBuffer.prototype.set = function(s) { 53 | this.buffer_ = '' + s; 54 | }; 55 | 56 | 57 | /** 58 | * Appends one or more items to the buffer. 59 | * 60 | * Calling this with null, undefined, or empty arguments is an error. 61 | * 62 | * @param {*} a1 Required first string. 63 | * @param {*=} opt_a2 Optional second string. 64 | * @param {...*} var_args Other items to append, 65 | * e.g., sb.append('foo', 'bar', 'baz'). 66 | * @return {goog.string.StringBuffer} This same StringBuffer object. 67 | * @suppress {duplicate} 68 | */ 69 | goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { 70 | // Use a1 directly to avoid arguments instantiation for single-arg case. 71 | this.buffer_ += a1; 72 | if (opt_a2 != null) { // second argument is undefined (null == undefined) 73 | for (var i = 1; i < arguments.length; i++) { 74 | this.buffer_ += arguments[i]; 75 | } 76 | } 77 | return this; 78 | }; 79 | 80 | 81 | /** 82 | * Clears the internal buffer. 83 | */ 84 | goog.string.StringBuffer.prototype.clear = function() { 85 | this.buffer_ = ''; 86 | }; 87 | 88 | 89 | /** 90 | * @return {number} the length of the current contents of the buffer. 91 | */ 92 | goog.string.StringBuffer.prototype.getLength = function() { 93 | return this.buffer_.length; 94 | }; 95 | 96 | 97 | /** 98 | * @return {string} The concatenated string. 99 | * @override 100 | */ 101 | goog.string.StringBuffer.prototype.toString = function() { 102 | return this.buffer_; 103 | }; 104 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/project.clj: -------------------------------------------------------------------------------- 1 | (defproject ants-cljs "0.1.0-SNAPSHOT" 2 | :description "FIXME: write this!" 3 | :url "http://example.com/FIXME" 4 | 5 | :dependencies [[org.clojure/clojure "1.5.1"] 6 | ;[org.clojure/clojurescript "0.0-2127"] 7 | [org.clojure/clojurescript "0.0-2173"] 8 | ;[org.clojure/clojurescript "0.0-2202"] 9 | [org.clojure/core.async "0.1.301.0-deb34a-alpha"] 10 | ] 11 | 12 | ;:plugins [[lein-cljsbuild "1.0.1"]] 13 | :plugins [[lein-cljsbuild "1.0.2"]] 14 | ;:plugins [[lein-cljsbuild "1.0.3"]] 15 | 16 | :source-paths ["src"] 17 | 18 | :cljsbuild { 19 | :builds [{:id "ants-cljs" 20 | :source-paths ["src"] 21 | :compiler { 22 | :output-to "ants_cljs.js" 23 | :output-dir "out" 24 | :optimizations :none 25 | :source-map true 26 | }}]}) 27 | -------------------------------------------------------------------------------- /7.Ants-CLJS-Single-Threaded/ants-cljs/target/stale/extract-native.dependencies: -------------------------------------------------------------------------------- 1 | ([:dependencies ([org.clojure/clojure "1.5.1"] [org.clojure/clojurescript "0.0-2173"] [org.clojure/core.async "0.1.301.0-deb34a-alpha"] [org.clojure/tools.nrepl "0.2.3" :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete "0.2.3" :exclusions ([org.clojure/clojure])])]) -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/ants_cljs.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("base.js", ['goog'], []); 2 | goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.StringBuffer']); 3 | goog.addDependency("../ants_cljs/core.js", ['ants_cljs.core'], ['cljs.core', 'goog.dom', 'goog.events']); -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/cljs/core/async/impl/buffers.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.buffers 10 | (:require [cljs.core.async.impl.protocols :as impl])) 11 | 12 | ;; ----------------------------------------------------------------------------- 13 | ;; DO NOT USE, this is internal buffer representation 14 | 15 | (defn acopy [src src-start dest dest-start len] 16 | (loop [cnt 0] 17 | (when (< cnt len) 18 | (aset dest 19 | (+ dest-start cnt) 20 | (aget src (+ src-start cnt))) 21 | (recur (inc cnt))))) 22 | 23 | (deftype RingBuffer [^:mutable head ^:mutable tail ^:mutable length ^:mutable arr] 24 | Object 25 | (pop [_] 26 | (when-not (zero? length) 27 | (let [x (aget arr tail)] 28 | (aset arr tail nil) 29 | (set! tail (js-mod (inc tail) (alength arr))) 30 | (set! length (dec length)) 31 | x))) 32 | 33 | (unshift [_ x] 34 | (aset arr head x) 35 | (set! head (js-mod (inc head) (alength arr))) 36 | (set! length (inc length)) 37 | nil) 38 | 39 | (unbounded-unshift [this x] 40 | (if (== (inc length) (alength arr)) 41 | (.resize this)) 42 | (.unshift this x)) 43 | 44 | ;; Doubles the size of the buffer while retaining all the existing values 45 | (resize 46 | [_] 47 | (let [new-arr-size (* (alength arr) 2) 48 | new-arr (make-array new-arr-size)] 49 | (cond 50 | (< tail head) 51 | (do (acopy arr tail new-arr 0 length) 52 | (set! tail 0) 53 | (set! head length) 54 | (set! arr new-arr)) 55 | 56 | (> tail head) 57 | (do (acopy arr tail new-arr 0 (- (alength arr) tail)) 58 | (acopy arr 0 new-arr (- (alength arr) tail) head) 59 | (set! tail 0) 60 | (set! head length) 61 | (set! arr new-arr)) 62 | 63 | (== tail head) 64 | (do (set! tail 0) 65 | (set! head 0) 66 | (set! arr new-arr))))) 67 | 68 | (cleanup [this keep?] 69 | (dotimes [x length] 70 | (let [v (.pop this)] 71 | (when ^boolean (keep? v) 72 | (.unshift this v)))))) 73 | 74 | (defn ring-buffer [n] 75 | (assert (> n 0) "Can't create a ring buffer of size 0") 76 | (RingBuffer. 0 0 0 (make-array n))) 77 | 78 | ;; ----------------------------------------------------------------------------- 79 | 80 | (deftype FixedBuffer [buf n] 81 | impl/Buffer 82 | (full? [this] 83 | (== (.-length buf) n)) 84 | (remove! [this] 85 | (.pop buf)) 86 | (add! [this itm] 87 | (assert (not (impl/full? this)) "Can't add to a full buffer") 88 | (.unshift buf itm)) 89 | cljs.core/ICounted 90 | (-count [this] 91 | (.-length buf))) 92 | 93 | (defn fixed-buffer [n] 94 | (FixedBuffer. (ring-buffer n) n)) 95 | 96 | (deftype DroppingBuffer [buf n] 97 | impl/UnblockingBuffer 98 | impl/Buffer 99 | (full? [this] 100 | false) 101 | (remove! [this] 102 | (.pop buf)) 103 | (add! [this itm] 104 | (when-not (== (.-length buf) n) 105 | (.unshift buf itm))) 106 | cljs.core/ICounted 107 | (-count [this] 108 | (.-length buf))) 109 | 110 | (defn dropping-buffer [n] 111 | (DroppingBuffer. (ring-buffer n) n)) 112 | 113 | (deftype SlidingBuffer [buf n] 114 | impl/UnblockingBuffer 115 | impl/Buffer 116 | (full? [this] 117 | false) 118 | (remove! [this] 119 | (.pop buf)) 120 | (add! [this itm] 121 | (when (== (.-length buf) n) 122 | (impl/remove! this)) 123 | (.unshift buf itm)) 124 | cljs.core/ICounted 125 | (-count [this] 126 | (.-length buf))) 127 | 128 | (defn sliding-buffer [n] 129 | (SlidingBuffer. (ring-buffer n) n)) 130 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/cljs/core/async/impl/dispatch.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.dispatch 2 | (:require [cljs.core.async.impl.buffers :as buffers])) 3 | 4 | (def message-channel nil) 5 | (def tasks (buffers/ring-buffer 32)) 6 | (def ^:boolean running? false) 7 | (def ^:boolean queued? false) 8 | 9 | (def TASK_BATCH_SIZE 1024) 10 | 11 | (declare queue-dispatcher) 12 | 13 | (defn process-messages [] 14 | (set! running? true) 15 | (set! queued? false) 16 | (loop [count 0] 17 | (let [m (.pop tasks)] 18 | (when-not (nil? m) 19 | (m) 20 | (when (< count TASK_BATCH_SIZE) 21 | (recur (inc count)))))) 22 | (set! running? false) 23 | (when (> (.-length tasks) 0) 24 | (queue-dispatcher))) 25 | 26 | (when (exists? js/MessageChannel) 27 | (set! message-channel (js/MessageChannel.)) 28 | (set! (.. message-channel -port1 -onmessage) 29 | (fn [msg] 30 | (process-messages)))) 31 | 32 | (defn queue-dispatcher [] 33 | (when-not ^boolean (and ^boolean queued? 34 | running?) 35 | (set! queued? true) 36 | (cond 37 | (exists? js/MessageChannel) (.postMessage (.-port2 message-channel) 0) 38 | (exists? js/setImmediate) (js/setImmediate process-messages) 39 | :else (js/setTimeout process-messages 0)))) 40 | 41 | (defn run [f] 42 | (.unbounded-unshift tasks f) 43 | (queue-dispatcher)) 44 | 45 | (defn queue-delay [f delay] 46 | (js/setTimeout f delay)) 47 | 48 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/cljs/core/async/impl/dispatch.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('cljs.core.async.impl.dispatch'); 3 | goog.require('cljs.core'); 4 | goog.require('cljs.core.async.impl.buffers'); 5 | goog.require('cljs.core.async.impl.buffers'); 6 | cljs.core.async.impl.dispatch.message_channel = null; 7 | cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,32); 8 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 9 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 10 | cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = 1024; 11 | cljs.core.async.impl.dispatch.process_messages = (function process_messages(){cljs.core.async.impl.dispatch.running_QMARK_ = true; 12 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 13 | var count_11432 = 0;while(true){ 14 | var m_11433 = cljs.core.async.impl.dispatch.tasks.pop();if((m_11433 == null)) 15 | {} else 16 | {m_11433.call(null); 17 | if((count_11432 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)) 18 | {{ 19 | var G__11434 = (count_11432 + 1); 20 | count_11432 = G__11434; 21 | continue; 22 | } 23 | } else 24 | {} 25 | } 26 | break; 27 | } 28 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 29 | if((cljs.core.async.impl.dispatch.tasks.length > 0)) 30 | {return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 31 | } else 32 | {return null; 33 | } 34 | }); 35 | if(typeof MessageChannel !== 'undefined') 36 | {cljs.core.async.impl.dispatch.message_channel = (new MessageChannel()); 37 | cljs.core.async.impl.dispatch.message_channel.port1.onmessage = (function (msg){return cljs.core.async.impl.dispatch.process_messages.call(null); 38 | }); 39 | } else 40 | {} 41 | cljs.core.async.impl.dispatch.queue_dispatcher = (function queue_dispatcher(){if(cljs.core.truth_((function (){var and__3431__auto__ = cljs.core.async.impl.dispatch.queued_QMARK_;if(and__3431__auto__) 42 | {return cljs.core.async.impl.dispatch.running_QMARK_; 43 | } else 44 | {return and__3431__auto__; 45 | } 46 | })())) 47 | {return null; 48 | } else 49 | {cljs.core.async.impl.dispatch.queued_QMARK_ = true; 50 | if(typeof MessageChannel !== 'undefined') 51 | {return cljs.core.async.impl.dispatch.message_channel.port2.postMessage(0); 52 | } else 53 | {if(typeof setImmediate !== 'undefined') 54 | {return setImmediate(cljs.core.async.impl.dispatch.process_messages); 55 | } else 56 | {if(new cljs.core.Keyword(null,"else","else",1017020587)) 57 | {return setTimeout(cljs.core.async.impl.dispatch.process_messages,0); 58 | } else 59 | {return null; 60 | } 61 | } 62 | } 63 | } 64 | }); 65 | cljs.core.async.impl.dispatch.run = (function run(f){cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f); 66 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 67 | }); 68 | cljs.core.async.impl.dispatch.queue_delay = (function queue_delay(f,delay){return setTimeout(f,delay); 69 | }); 70 | 71 | //# sourceMappingURL=dispatch.js.map -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/cljs/core/async/impl/dispatch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Documents/workspace_nonbook/ants-cljs/out/cljs/core/async/impl/dispatch.js", 4 | "sources":["dispatch.cljs"], 5 | "lineCount":71, 6 | "mappings": 7 | ";AAAA;;;;AAGA,gDAAA,hDAAKA;AACL,AAAKC,sCAAM,mDAAA,nDAACC;AACZ,+CAAA,/CAAeC;AACf,8CAAA,9CAAeC;AAEf,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,6BAAA,9EAAMC,8EACJ,+CAAA,/CAAMH;AACN,8CAAA,9CAAMC;AACN,kBAAA,dAAOG;AAAP,AACE,wDAAA,pDAAMC,UAAE,AAAMP,0CACZ,GAAU,YAAA,XAAMO;CAAhB;CAAA,AACE,AAACA;AACD,GAAM,CAAGD,cAAMF;CAAf,AACE;eAAO,eAAA,dAAKE;;;;;CADd;;;;AAEN,+CAAA,/CAAMJ;AACN,GAAM,8CAAA,7CAAG,AAAUF;CAAnB,AACE,OAACQ;;CADH;;;AAGF,GAAM,OAASC;CAAf,AACE,AAAMV,gDAAgB,KAAAU;AACtB,AAAM,AAAA,AAAIV,gEACJ,gBAAA,LAAKW,KACH,OAACL;;;CAJX;AAMA,iDAAA,6BAAA,9EAAMG,8EACJ,oBAAU,iBAAAG,gEAAA,AAAA,GAAAA,/CAAuBR;CACTD;;CADdS;;;CAAV;;CAAA,AAEE,8CAAA,9CAAMR;AACN,GACC,OAASM;CAAmB,uEAAA,hEAAc,AAASV;;CADpD,GAEC,OAASa;CAAiB,OAACA,aAAgBP;;CAF5C,GAAA;CAGO,iEAAA,1DAACQ,WAAcR;;CAHtB;;;;;;AAKJ,oCAAA,iBAAA,rDAAMS,kDAAKC,GACT,AAAoBf,sDAAMe;AAC1B,OAACP;;AAEH,4CAAA,+BAAA,3EAAMQ,kEAAaD,EAAEE,OACnB,OAACJ,WAAcE,EAAEE", 8 | "names": 9 | ["cljs.core.async.impl.dispatch/message-channel", 10 | "cljs.core.async.impl.dispatch/tasks", 11 | "cljs.core.async.impl.buffers/ring-buffer", 12 | "cljs.core.async.impl.dispatch/running?", 13 | "cljs.core.async.impl.dispatch/queued?", 14 | "cljs.core.async.impl.dispatch/TASK_BATCH_SIZE", 15 | "cljs.core.async.impl.dispatch/process-messages", "count", "m", 16 | "cljs.core.async.impl.dispatch/queue-dispatcher", 17 | "js/MessageChannel", "msg", "and__3431__auto__", "js/setImmediate", 18 | "js/setTimeout", "cljs.core.async.impl.dispatch/run", "f", 19 | "cljs.core.async.impl.dispatch/queue-delay", "delay"]} -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/cljs/core/async/impl/protocols.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.protocols) 10 | 11 | (def ^:const MAX-QUEUE-SIZE 1024) 12 | 13 | (defprotocol ReadPort 14 | (take! [port fn1-handler] "derefable val if taken, nil if take was enqueued")) 15 | 16 | (defprotocol WritePort 17 | (put! [port val fn1-handler] "derefable boolean (false if already closed) if handled, nil if put was enqueued. 18 | Must throw on nil val.")) 19 | 20 | (defprotocol Channel 21 | (close! [chan]) 22 | (closed? [chan])) 23 | 24 | (defprotocol Handler 25 | (active? [h] "returns true if has callback. Must work w/o lock") 26 | #_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock") 27 | (commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock")) 28 | 29 | (defprotocol Buffer 30 | (full? [b]) 31 | (remove! [b]) 32 | (add! [b itm])) 33 | 34 | ;; Defines a buffer that will never block (return true to full?) 35 | (defprotocol UnblockingBuffer) 36 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/debug/error.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Provides a base class for custom Error objects such that the 17 | * stack is correctly maintained. 18 | * 19 | * You should never need to throw goog.debug.Error(msg) directly, Error(msg) is 20 | * sufficient. 21 | * 22 | */ 23 | 24 | goog.provide('goog.debug.Error'); 25 | 26 | 27 | 28 | /** 29 | * Base class for custom error objects. 30 | * @param {*=} opt_msg The message associated with the error. 31 | * @constructor 32 | * @extends {Error} 33 | */ 34 | goog.debug.Error = function(opt_msg) { 35 | 36 | // Ensure there is a stack trace. 37 | if (Error.captureStackTrace) { 38 | Error.captureStackTrace(this, goog.debug.Error); 39 | } else { 40 | this.stack = new Error().stack || ''; 41 | } 42 | 43 | if (opt_msg) { 44 | this.message = String(opt_msg); 45 | } 46 | }; 47 | goog.inherits(goog.debug.Error, Error); 48 | 49 | 50 | /** @override */ 51 | goog.debug.Error.prototype.name = 'CustomError'; 52 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/debug/errorhandlerweakdep.js: -------------------------------------------------------------------------------- 1 | // Copyright 2008 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview File which defines dummy object to work around undefined 17 | * properties compiler warning for weak dependencies on 18 | * {@link goog.debug.ErrorHandler#protectEntryPoint}. 19 | * 20 | */ 21 | 22 | goog.provide('goog.debug.errorHandlerWeakDep'); 23 | 24 | 25 | /** 26 | * Dummy object to work around undefined properties compiler warning. 27 | * @type {Object} 28 | */ 29 | goog.debug.errorHandlerWeakDep = { 30 | /** 31 | * @param {Function} fn An entry point function to be protected. 32 | * @param {boolean=} opt_tracers Whether to install tracers around the 33 | * fn. 34 | * @return {Function} A protected wrapper function that calls the 35 | * entry point function. 36 | */ 37 | protectEntryPoint: function(fn, opt_tracers) { return fn; } 38 | }; 39 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/deps.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("string/string.js", ['goog.string', 'goog.string.Unicode'], []); 2 | goog.addDependency("debug/error.js", ['goog.debug.Error'], []); 3 | goog.addDependency("asserts/asserts.js", ['goog.asserts', 'goog.asserts.AssertionError'], ['goog.debug.Error', 'goog.string']); 4 | goog.addDependency("array/array.js", ['goog.array', 'goog.array.ArrayLike'], ['goog.asserts']); 5 | goog.addDependency("object/object.js", ['goog.object'], []); 6 | goog.addDependency("string/stringbuffer.js", ['goog.string.StringBuffer'], []); 7 | goog.addDependency("useragent/useragent.js", ['goog.userAgent'], ['goog.string']); 8 | goog.addDependency("dom/browserfeature.js", ['goog.dom.BrowserFeature'], ['goog.userAgent']); 9 | goog.addDependency("dom/tagname.js", ['goog.dom.TagName'], []); 10 | goog.addDependency("dom/classes.js", ['goog.dom.classes'], ['goog.array']); 11 | goog.addDependency("math/math.js", ['goog.math'], ['goog.array', 'goog.asserts']); 12 | goog.addDependency("math/coordinate.js", ['goog.math.Coordinate'], ['goog.math']); 13 | goog.addDependency("math/size.js", ['goog.math.Size'], []); 14 | goog.addDependency("dom/dom.js", ['goog.dom', 'goog.dom.DomHelper', 'goog.dom.NodeType'], ['goog.array', 'goog.dom.BrowserFeature', 'goog.dom.TagName', 'goog.dom.classes', 'goog.math.Coordinate', 'goog.math.Size', 'goog.object', 'goog.string', 'goog.userAgent']); 15 | goog.addDependency("debug/entrypointregistry.js", ['goog.debug.EntryPointMonitor', 'goog.debug.entryPointRegistry'], ['goog.asserts']); 16 | goog.addDependency("debug/errorhandlerweakdep.js", ['goog.debug.errorHandlerWeakDep'], []); 17 | goog.addDependency("events/browserfeature.js", ['goog.events.BrowserFeature'], ['goog.userAgent']); 18 | goog.addDependency("disposable/idisposable.js", ['goog.disposable.IDisposable'], []); 19 | goog.addDependency("disposable/disposable.js", ['goog.Disposable', 'goog.dispose'], ['goog.disposable.IDisposable']); 20 | goog.addDependency("events/event.js", ['goog.events.Event', 'goog.events.EventLike'], ['goog.Disposable']); 21 | goog.addDependency("events/eventtype.js", ['goog.events.EventType'], ['goog.userAgent']); 22 | goog.addDependency("reflect/reflect.js", ['goog.reflect'], []); 23 | goog.addDependency("events/browserevent.js", ['goog.events.BrowserEvent', 'goog.events.BrowserEvent.MouseButton'], ['goog.events.BrowserFeature', 'goog.events.Event', 'goog.events.EventType', 'goog.reflect', 'goog.userAgent']); 24 | goog.addDependency("events/eventwrapper.js", ['goog.events.EventWrapper'], []); 25 | goog.addDependency("events/listenable.js", ['goog.events.Listenable', 'goog.events.ListenableKey'], ['goog.events.EventLike']); 26 | goog.addDependency("events/listener.js", ['goog.events.Listener'], ['goog.events.ListenableKey']); 27 | goog.addDependency("events/events.js", ['goog.events', 'goog.events.Key'], ['goog.array', 'goog.debug.entryPointRegistry', 'goog.debug.errorHandlerWeakDep', 'goog.events.BrowserEvent', 'goog.events.BrowserFeature', 'goog.events.Event', 'goog.events.EventWrapper', 'goog.events.Listenable', 'goog.events.Listener', 'goog.object', 'goog.userAgent']); -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/disposable/idisposable.js: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the disposable interface. A disposable object 17 | * has a dispose method to to clean up references and resources. 18 | * @author nnaze@google.com (Nathan Naze) 19 | */ 20 | 21 | 22 | goog.provide('goog.disposable.IDisposable'); 23 | 24 | 25 | 26 | /** 27 | * Interface for a disposable object. If a instance requires cleanup 28 | * (references COM objects, DOM notes, or other disposable objects), it should 29 | * implement this interface (it may subclass goog.Disposable). 30 | * @interface 31 | */ 32 | goog.disposable.IDisposable = function() {}; 33 | 34 | 35 | /** 36 | * Disposes of the object and its resources. 37 | * @return {void} Nothing. 38 | */ 39 | goog.disposable.IDisposable.prototype.dispose; 40 | 41 | 42 | /** 43 | * @return {boolean} Whether the object has been disposed of. 44 | */ 45 | goog.disposable.IDisposable.prototype.isDisposed; 46 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/dom/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the dom package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.dom.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.dom.BrowserFeature = { 31 | /** 32 | * Whether attributes 'name' and 'type' can be added to an element after it's 33 | * created. False in Internet Explorer prior to version 9. 34 | */ 35 | CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: !goog.userAgent.IE || 36 | goog.userAgent.isDocumentMode(9), 37 | 38 | /** 39 | * Whether we can use element.children to access an element's Element 40 | * children. Available since Gecko 1.9.1, IE 9. (IE<9 also includes comment 41 | * nodes in the collection.) 42 | */ 43 | CAN_USE_CHILDREN_ATTRIBUTE: !goog.userAgent.GECKO && !goog.userAgent.IE || 44 | goog.userAgent.IE && goog.userAgent.isDocumentMode(9) || 45 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9.1'), 46 | 47 | /** 48 | * Opera, Safari 3, and Internet Explorer 9 all support innerText but they 49 | * include text nodes in script and style tags. Not document-mode-dependent. 50 | */ 51 | CAN_USE_INNER_TEXT: goog.userAgent.IE && !goog.userAgent.isVersion('9'), 52 | 53 | /** 54 | * MSIE, Opera, and Safari>=4 support element.parentElement to access an 55 | * element's parent if it is an Element. 56 | */ 57 | CAN_USE_PARENT_ELEMENT_PROPERTY: goog.userAgent.IE || goog.userAgent.OPERA || 58 | goog.userAgent.WEBKIT, 59 | 60 | /** 61 | * Whether NoScope elements need a scoped element written before them in 62 | * innerHTML. 63 | * MSDN: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx#1 64 | */ 65 | INNER_HTML_NEEDS_SCOPED_ELEMENT: goog.userAgent.IE 66 | }; 67 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/dom/nodetype.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of goog.dom.NodeType. 17 | */ 18 | 19 | goog.provide('goog.dom.NodeType'); 20 | 21 | 22 | /** 23 | * Constants for the nodeType attribute in the Node interface. 24 | * 25 | * These constants match those specified in the Node interface. These are 26 | * usually present on the Node object in recent browsers, but not in older 27 | * browsers (specifically, early IEs) and thus are given here. 28 | * 29 | * In some browsers (early IEs), these are not defined on the Node object, 30 | * so they are provided here. 31 | * 32 | * See http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247 33 | * @enum {number} 34 | */ 35 | goog.dom.NodeType = { 36 | ELEMENT: 1, 37 | ATTRIBUTE: 2, 38 | TEXT: 3, 39 | CDATA_SECTION: 4, 40 | ENTITY_REFERENCE: 5, 41 | ENTITY: 6, 42 | PROCESSING_INSTRUCTION: 7, 43 | COMMENT: 8, 44 | DOCUMENT: 9, 45 | DOCUMENT_TYPE: 10, 46 | DOCUMENT_FRAGMENT: 11, 47 | NOTATION: 12 48 | }; 49 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/dom/tagname.js: -------------------------------------------------------------------------------- 1 | // Copyright 2007 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Defines the goog.dom.TagName enum. This enumerates 17 | * all HTML tag names specified in either the the W3C HTML 4.01 index of 18 | * elements or the HTML5 draft specification. 19 | * 20 | * References: 21 | * http://www.w3.org/TR/html401/index/elements.html 22 | * http://dev.w3.org/html5/spec/section-index.html 23 | * 24 | */ 25 | goog.provide('goog.dom.TagName'); 26 | 27 | 28 | /** 29 | * Enum of all html tag names specified by the W3C HTML4.01 and HTML5 30 | * specifications. 31 | * @enum {string} 32 | */ 33 | goog.dom.TagName = { 34 | A: 'A', 35 | ABBR: 'ABBR', 36 | ACRONYM: 'ACRONYM', 37 | ADDRESS: 'ADDRESS', 38 | APPLET: 'APPLET', 39 | AREA: 'AREA', 40 | ARTICLE: 'ARTICLE', 41 | ASIDE: 'ASIDE', 42 | AUDIO: 'AUDIO', 43 | B: 'B', 44 | BASE: 'BASE', 45 | BASEFONT: 'BASEFONT', 46 | BDI: 'BDI', 47 | BDO: 'BDO', 48 | BIG: 'BIG', 49 | BLOCKQUOTE: 'BLOCKQUOTE', 50 | BODY: 'BODY', 51 | BR: 'BR', 52 | BUTTON: 'BUTTON', 53 | CANVAS: 'CANVAS', 54 | CAPTION: 'CAPTION', 55 | CENTER: 'CENTER', 56 | CITE: 'CITE', 57 | CODE: 'CODE', 58 | COL: 'COL', 59 | COLGROUP: 'COLGROUP', 60 | COMMAND: 'COMMAND', 61 | DATA: 'DATA', 62 | DATALIST: 'DATALIST', 63 | DD: 'DD', 64 | DEL: 'DEL', 65 | DETAILS: 'DETAILS', 66 | DFN: 'DFN', 67 | DIALOG: 'DIALOG', 68 | DIR: 'DIR', 69 | DIV: 'DIV', 70 | DL: 'DL', 71 | DT: 'DT', 72 | EM: 'EM', 73 | EMBED: 'EMBED', 74 | FIELDSET: 'FIELDSET', 75 | FIGCAPTION: 'FIGCAPTION', 76 | FIGURE: 'FIGURE', 77 | FONT: 'FONT', 78 | FOOTER: 'FOOTER', 79 | FORM: 'FORM', 80 | FRAME: 'FRAME', 81 | FRAMESET: 'FRAMESET', 82 | H1: 'H1', 83 | H2: 'H2', 84 | H3: 'H3', 85 | H4: 'H4', 86 | H5: 'H5', 87 | H6: 'H6', 88 | HEAD: 'HEAD', 89 | HEADER: 'HEADER', 90 | HGROUP: 'HGROUP', 91 | HR: 'HR', 92 | HTML: 'HTML', 93 | I: 'I', 94 | IFRAME: 'IFRAME', 95 | IMG: 'IMG', 96 | INPUT: 'INPUT', 97 | INS: 'INS', 98 | ISINDEX: 'ISINDEX', 99 | KBD: 'KBD', 100 | KEYGEN: 'KEYGEN', 101 | LABEL: 'LABEL', 102 | LEGEND: 'LEGEND', 103 | LI: 'LI', 104 | LINK: 'LINK', 105 | MAP: 'MAP', 106 | MARK: 'MARK', 107 | MATH: 'MATH', 108 | MENU: 'MENU', 109 | META: 'META', 110 | METER: 'METER', 111 | NAV: 'NAV', 112 | NOFRAMES: 'NOFRAMES', 113 | NOSCRIPT: 'NOSCRIPT', 114 | OBJECT: 'OBJECT', 115 | OL: 'OL', 116 | OPTGROUP: 'OPTGROUP', 117 | OPTION: 'OPTION', 118 | OUTPUT: 'OUTPUT', 119 | P: 'P', 120 | PARAM: 'PARAM', 121 | PRE: 'PRE', 122 | PROGRESS: 'PROGRESS', 123 | Q: 'Q', 124 | RP: 'RP', 125 | RT: 'RT', 126 | RUBY: 'RUBY', 127 | S: 'S', 128 | SAMP: 'SAMP', 129 | SCRIPT: 'SCRIPT', 130 | SECTION: 'SECTION', 131 | SELECT: 'SELECT', 132 | SMALL: 'SMALL', 133 | SOURCE: 'SOURCE', 134 | SPAN: 'SPAN', 135 | STRIKE: 'STRIKE', 136 | STRONG: 'STRONG', 137 | STYLE: 'STYLE', 138 | SUB: 'SUB', 139 | SUMMARY: 'SUMMARY', 140 | SUP: 'SUP', 141 | SVG: 'SVG', 142 | TABLE: 'TABLE', 143 | TBODY: 'TBODY', 144 | TD: 'TD', 145 | TEXTAREA: 'TEXTAREA', 146 | TFOOT: 'TFOOT', 147 | TH: 'TH', 148 | THEAD: 'THEAD', 149 | TIME: 'TIME', 150 | TITLE: 'TITLE', 151 | TR: 'TR', 152 | TRACK: 'TRACK', 153 | TT: 'TT', 154 | U: 'U', 155 | UL: 'UL', 156 | VAR: 'VAR', 157 | VIDEO: 'VIDEO', 158 | WBR: 'WBR' 159 | }; 160 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/events/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the events package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.events.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.events.BrowserFeature = { 31 | /** 32 | * Whether the button attribute of the event is W3C compliant. False in 33 | * Internet Explorer prior to version 9; document-version dependent. 34 | */ 35 | HAS_W3C_BUTTON: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 36 | 37 | /** 38 | * Whether the browser supports full W3C event model. 39 | */ 40 | HAS_W3C_EVENT_SUPPORT: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 41 | 42 | /** 43 | * To prevent default in IE7-8 for certain keydown events we need set the 44 | * keyCode to -1. 45 | */ 46 | SET_KEY_CODE_TO_PREVENT_DEFAULT: goog.userAgent.IE && 47 | !goog.userAgent.isVersion('9'), 48 | 49 | /** 50 | * Whether the {@code navigator.onLine} property is supported. 51 | */ 52 | HAS_NAVIGATOR_ONLINE_PROPERTY: !goog.userAgent.WEBKIT || 53 | goog.userAgent.isVersion('528'), 54 | 55 | /** 56 | * Whether HTML5 network online/offline events are supported. 57 | */ 58 | HAS_HTML5_NETWORK_EVENT_SUPPORT: 59 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9b') || 60 | goog.userAgent.IE && goog.userAgent.isVersion('8') || 61 | goog.userAgent.OPERA && goog.userAgent.isVersion('9.5') || 62 | goog.userAgent.WEBKIT && goog.userAgent.isVersion('528'), 63 | 64 | /** 65 | * Whether HTML5 network events fire on document.body, or otherwise the 66 | * window. 67 | */ 68 | HTML5_NETWORK_EVENTS_FIRE_ON_BODY: 69 | goog.userAgent.GECKO && !goog.userAgent.isVersion('8') || 70 | goog.userAgent.IE && !goog.userAgent.isVersion('9'), 71 | 72 | /** 73 | * Whether touch is enabled in the browser. 74 | */ 75 | TOUCH_ENABLED: 76 | ('ontouchstart' in goog.global || 77 | !!(goog.global['document'] && 78 | document.documentElement && 79 | 'ontouchstart' in document.documentElement) || 80 | // IE10 uses non-standard touch events, so it has a different check. 81 | !!(goog.global['navigator'] && 82 | goog.global['navigator']['msMaxTouchPoints'])) 83 | }; 84 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/events/eventid.js: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | goog.provide('goog.events.EventId'); 16 | 17 | 18 | 19 | /** 20 | * A templated class that is used when registering for events. Typical usage: 21 | * 22 | * /** @type {goog.events.EventId.} 23 | * var myEventId = new goog.events.EventId( 24 | * goog.events.getUniqueId(('someEvent')); 25 | * 26 | * // No need to cast or declare here since the compiler knows the correct 27 | * // type of 'evt' (MyEventObj). 28 | * something.listen(myEventId, function(evt) {}); 29 | * 30 | * 31 | * @param {string} eventId 32 | * @template T 33 | * @constructor 34 | * @struct 35 | * @final 36 | */ 37 | goog.events.EventId = function(eventId) { 38 | /** @const */ this.id = eventId; 39 | }; 40 | 41 | 42 | /** 43 | * @override 44 | */ 45 | goog.events.EventId.prototype.toString = function() { 46 | return this.id; 47 | }; 48 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/events/eventwrapper.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the goog.events.EventWrapper interface. 17 | * 18 | * @author eae@google.com (Emil A Eklund) 19 | */ 20 | 21 | goog.provide('goog.events.EventWrapper'); 22 | 23 | 24 | 25 | /** 26 | * Interface for event wrappers. 27 | * @interface 28 | */ 29 | goog.events.EventWrapper = function() { 30 | }; 31 | 32 | 33 | /** 34 | * Adds an event listener using the wrapper on a DOM Node or an object that has 35 | * implemented {@link goog.events.EventTarget}. A listener can only be added 36 | * once to an object. 37 | * 38 | * @param {EventTarget|goog.events.EventTarget} src The node to listen to 39 | * events on. 40 | * @param {Function|Object} listener Callback method, or an object with a 41 | * handleEvent function. 42 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 43 | * false). 44 | * @param {Object=} opt_scope Element in whose scope to call the listener. 45 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to add 46 | * listener to. 47 | */ 48 | goog.events.EventWrapper.prototype.listen = function(src, listener, opt_capt, 49 | opt_scope, opt_eventHandler) { 50 | }; 51 | 52 | 53 | /** 54 | * Removes an event listener added using goog.events.EventWrapper.listen. 55 | * 56 | * @param {EventTarget|goog.events.EventTarget} src The node to remove listener 57 | * from. 58 | * @param {Function|Object} listener Callback method, or an object with a 59 | * handleEvent function. 60 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 61 | * false). 62 | * @param {Object=} opt_scope Element in whose scope to call the listener. 63 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to remove 64 | * listener from. 65 | */ 66 | goog.events.EventWrapper.prototype.unlisten = function(src, listener, opt_capt, 67 | opt_scope, opt_eventHandler) { 68 | }; 69 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/reflect/reflect.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Useful compiler idioms. 17 | * 18 | */ 19 | 20 | goog.provide('goog.reflect'); 21 | 22 | 23 | /** 24 | * Syntax for object literal casts. 25 | * @see http://go/jscompiler-renaming 26 | * @see http://code.google.com/p/closure-compiler/wiki/ 27 | * ExperimentalTypeBasedPropertyRenaming 28 | * 29 | * Use this if you have an object literal whose keys need to have the same names 30 | * as the properties of some class even after they are renamed by the compiler. 31 | * 32 | * @param {!Function} type Type to cast to. 33 | * @param {Object} object Object literal to cast. 34 | * @return {Object} The object literal. 35 | */ 36 | goog.reflect.object = function(type, object) { 37 | return object; 38 | }; 39 | 40 | 41 | /** 42 | * To assert to the compiler that an operation is needed when it would 43 | * otherwise be stripped. For example: 44 | * 45 | * // Force a layout 46 | * goog.reflect.sinkValue(dialog.offsetHeight); 47 | * 48 | * @type {!Function} 49 | */ 50 | goog.reflect.sinkValue = function(x) { 51 | goog.reflect.sinkValue[' '](x); 52 | return x; 53 | }; 54 | 55 | 56 | /** 57 | * The compiler should optimize this function away iff no one ever uses 58 | * goog.reflect.sinkValue. 59 | */ 60 | goog.reflect.sinkValue[' '] = goog.nullFunction; 61 | 62 | 63 | /** 64 | * Check if a property can be accessed without throwing an exception. 65 | * @param {Object} obj The owner of the property. 66 | * @param {string} prop The property name. 67 | * @return {boolean} Whether the property is accessible. Will also return true 68 | * if obj is null. 69 | */ 70 | goog.reflect.canAccessProperty = function(obj, prop) { 71 | /** @preserveTry */ 72 | try { 73 | goog.reflect.sinkValue(obj[prop]); 74 | return true; 75 | } catch (e) {} 76 | return false; 77 | }; 78 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/out/goog/string/stringbuffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utility for fast string concatenation. 17 | */ 18 | 19 | goog.provide('goog.string.StringBuffer'); 20 | 21 | 22 | 23 | /** 24 | * Utility class to facilitate string concatenation. 25 | * 26 | * @param {*=} opt_a1 Optional first initial item to append. 27 | * @param {...*} var_args Other initial items to 28 | * append, e.g., new goog.string.StringBuffer('foo', 'bar'). 29 | * @constructor 30 | */ 31 | goog.string.StringBuffer = function(opt_a1, var_args) { 32 | if (opt_a1 != null) { 33 | this.append.apply(this, arguments); 34 | } 35 | }; 36 | 37 | 38 | /** 39 | * Internal buffer for the string to be concatenated. 40 | * @type {string} 41 | * @private 42 | */ 43 | goog.string.StringBuffer.prototype.buffer_ = ''; 44 | 45 | 46 | /** 47 | * Sets the contents of the string buffer object, replacing what's currently 48 | * there. 49 | * 50 | * @param {*} s String to set. 51 | */ 52 | goog.string.StringBuffer.prototype.set = function(s) { 53 | this.buffer_ = '' + s; 54 | }; 55 | 56 | 57 | /** 58 | * Appends one or more items to the buffer. 59 | * 60 | * Calling this with null, undefined, or empty arguments is an error. 61 | * 62 | * @param {*} a1 Required first string. 63 | * @param {*=} opt_a2 Optional second string. 64 | * @param {...*} var_args Other items to append, 65 | * e.g., sb.append('foo', 'bar', 'baz'). 66 | * @return {goog.string.StringBuffer} This same StringBuffer object. 67 | * @suppress {duplicate} 68 | */ 69 | goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { 70 | // Use a1 directly to avoid arguments instantiation for single-arg case. 71 | this.buffer_ += a1; 72 | if (opt_a2 != null) { // second argument is undefined (null == undefined) 73 | for (var i = 1; i < arguments.length; i++) { 74 | this.buffer_ += arguments[i]; 75 | } 76 | } 77 | return this; 78 | }; 79 | 80 | 81 | /** 82 | * Clears the internal buffer. 83 | */ 84 | goog.string.StringBuffer.prototype.clear = function() { 85 | this.buffer_ = ''; 86 | }; 87 | 88 | 89 | /** 90 | * @return {number} the length of the current contents of the buffer. 91 | */ 92 | goog.string.StringBuffer.prototype.getLength = function() { 93 | return this.buffer_.length; 94 | }; 95 | 96 | 97 | /** 98 | * @return {string} The concatenated string. 99 | * @override 100 | */ 101 | goog.string.StringBuffer.prototype.toString = function() { 102 | return this.buffer_; 103 | }; 104 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/project.clj: -------------------------------------------------------------------------------- 1 | (defproject ants-cljs "0.1.0-SNAPSHOT" 2 | :description "FIXME: write this!" 3 | :url "http://example.com/FIXME" 4 | 5 | :dependencies [[org.clojure/clojure "1.5.1"] 6 | ;[org.clojure/clojurescript "0.0-2127"] 7 | [org.clojure/clojurescript "0.0-2173"] 8 | ;[org.clojure/clojurescript "0.0-2202"] 9 | [org.clojure/core.async "0.1.301.0-deb34a-alpha"] 10 | ] 11 | 12 | ;:plugins [[lein-cljsbuild "1.0.1"]] 13 | :plugins [[lein-cljsbuild "1.0.2"]] 14 | ;:plugins [[lein-cljsbuild "1.0.3"]] 15 | 16 | :source-paths ["src"] 17 | 18 | :cljsbuild { 19 | :builds [{:id "ants-cljs" 20 | :source-paths ["src"] 21 | :compiler { 22 | :output-to "ants_cljs.js" 23 | :output-dir "out" 24 | :optimizations :none 25 | :source-map true 26 | }}]}) 27 | -------------------------------------------------------------------------------- /8.Ants-CLJS-Core-Async/ants-cljs/target/stale/extract-native.dependencies: -------------------------------------------------------------------------------- 1 | ([:dependencies ([org.clojure/clojure "1.5.1"] [org.clojure/clojurescript "0.0-2173"] [org.clojure/core.async "0.1.301.0-deb34a-alpha"] [org.clojure/tools.nrepl "0.2.3" :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete "0.2.3" :exclusions ([org.clojure/clojure])])]) -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/ants_cljs.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("base.js", ['goog'], []); 2 | goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string', 'goog.array', 'goog.object', 'goog.string.StringBuffer']); 3 | goog.addDependency("../cljs/core/async/impl/protocols.js", ['cljs.core.async.impl.protocols'], ['cljs.core']); 4 | goog.addDependency("../cljs/core/async/impl/ioc_helpers.js", ['cljs.core.async.impl.ioc_helpers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 5 | goog.addDependency("../cljs/core/async/impl/buffers.js", ['cljs.core.async.impl.buffers'], ['cljs.core', 'cljs.core.async.impl.protocols']); 6 | goog.addDependency("../cljs/core/async/impl/dispatch.js", ['cljs.core.async.impl.dispatch'], ['cljs.core.async.impl.buffers', 'cljs.core']); 7 | goog.addDependency("../cljs/core/async/impl/channels.js", ['cljs.core.async.impl.channels'], ['cljs.core.async.impl.buffers', 'cljs.core', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols']); 8 | goog.addDependency("../cljs/core/async/impl/timers.js", ['cljs.core.async.impl.timers'], ['cljs.core', 'cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols']); 9 | goog.addDependency("../cljs/core/async.js", ['cljs.core.async'], ['cljs.core.async.impl.ioc_helpers', 'cljs.core.async.impl.buffers', 'cljs.core', 'cljs.core.async.impl.channels', 'cljs.core.async.impl.dispatch', 'cljs.core.async.impl.protocols', 'cljs.core.async.impl.timers']); 10 | goog.addDependency("../ants_cljs/core.js", ['ants_cljs.core'], ['cljs.core', 'goog.dom', 'cljs.core.async', 'goog.events']); -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/cljs/core/async/impl/buffers.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.buffers 10 | (:require [cljs.core.async.impl.protocols :as impl])) 11 | 12 | ;; ----------------------------------------------------------------------------- 13 | ;; DO NOT USE, this is internal buffer representation 14 | 15 | (defn acopy [src src-start dest dest-start len] 16 | (loop [cnt 0] 17 | (when (< cnt len) 18 | (aset dest 19 | (+ dest-start cnt) 20 | (aget src (+ src-start cnt))) 21 | (recur (inc cnt))))) 22 | 23 | (deftype RingBuffer [^:mutable head ^:mutable tail ^:mutable length ^:mutable arr] 24 | Object 25 | (pop [_] 26 | (when-not (zero? length) 27 | (let [x (aget arr tail)] 28 | (aset arr tail nil) 29 | (set! tail (js-mod (inc tail) (alength arr))) 30 | (set! length (dec length)) 31 | x))) 32 | 33 | (unshift [_ x] 34 | (aset arr head x) 35 | (set! head (js-mod (inc head) (alength arr))) 36 | (set! length (inc length)) 37 | nil) 38 | 39 | (unbounded-unshift [this x] 40 | (if (== (inc length) (alength arr)) 41 | (.resize this)) 42 | (.unshift this x)) 43 | 44 | ;; Doubles the size of the buffer while retaining all the existing values 45 | (resize 46 | [_] 47 | (let [new-arr-size (* (alength arr) 2) 48 | new-arr (make-array new-arr-size)] 49 | (cond 50 | (< tail head) 51 | (do (acopy arr tail new-arr 0 length) 52 | (set! tail 0) 53 | (set! head length) 54 | (set! arr new-arr)) 55 | 56 | (> tail head) 57 | (do (acopy arr tail new-arr 0 (- (alength arr) tail)) 58 | (acopy arr 0 new-arr (- (alength arr) tail) head) 59 | (set! tail 0) 60 | (set! head length) 61 | (set! arr new-arr)) 62 | 63 | (== tail head) 64 | (do (set! tail 0) 65 | (set! head 0) 66 | (set! arr new-arr))))) 67 | 68 | (cleanup [this keep?] 69 | (dotimes [x length] 70 | (let [v (.pop this)] 71 | (when ^boolean (keep? v) 72 | (.unshift this v)))))) 73 | 74 | (defn ring-buffer [n] 75 | (assert (> n 0) "Can't create a ring buffer of size 0") 76 | (RingBuffer. 0 0 0 (make-array n))) 77 | 78 | ;; ----------------------------------------------------------------------------- 79 | 80 | (deftype FixedBuffer [buf n] 81 | impl/Buffer 82 | (full? [this] 83 | (== (.-length buf) n)) 84 | (remove! [this] 85 | (.pop buf)) 86 | (add! [this itm] 87 | (assert (not (impl/full? this)) "Can't add to a full buffer") 88 | (.unshift buf itm)) 89 | cljs.core/ICounted 90 | (-count [this] 91 | (.-length buf))) 92 | 93 | (defn fixed-buffer [n] 94 | (FixedBuffer. (ring-buffer n) n)) 95 | 96 | (deftype DroppingBuffer [buf n] 97 | impl/UnblockingBuffer 98 | impl/Buffer 99 | (full? [this] 100 | false) 101 | (remove! [this] 102 | (.pop buf)) 103 | (add! [this itm] 104 | (when-not (== (.-length buf) n) 105 | (.unshift buf itm))) 106 | cljs.core/ICounted 107 | (-count [this] 108 | (.-length buf))) 109 | 110 | (defn dropping-buffer [n] 111 | (DroppingBuffer. (ring-buffer n) n)) 112 | 113 | (deftype SlidingBuffer [buf n] 114 | impl/UnblockingBuffer 115 | impl/Buffer 116 | (full? [this] 117 | false) 118 | (remove! [this] 119 | (.pop buf)) 120 | (add! [this itm] 121 | (when (== (.-length buf) n) 122 | (impl/remove! this)) 123 | (.unshift buf itm)) 124 | cljs.core/ICounted 125 | (-count [this] 126 | (.-length buf))) 127 | 128 | (defn sliding-buffer [n] 129 | (SlidingBuffer. (ring-buffer n) n)) 130 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/cljs/core/async/impl/dispatch.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs.core.async.impl.dispatch 2 | (:require [cljs.core.async.impl.buffers :as buffers])) 3 | 4 | (def message-channel nil) 5 | (def tasks (buffers/ring-buffer 32)) 6 | (def ^:boolean running? false) 7 | (def ^:boolean queued? false) 8 | 9 | (def TASK_BATCH_SIZE 1024) 10 | 11 | (declare queue-dispatcher) 12 | 13 | (defn process-messages [] 14 | (set! running? true) 15 | (set! queued? false) 16 | (loop [count 0] 17 | (let [m (.pop tasks)] 18 | (when-not (nil? m) 19 | (m) 20 | (when (< count TASK_BATCH_SIZE) 21 | (recur (inc count)))))) 22 | (set! running? false) 23 | (when (> (.-length tasks) 0) 24 | (queue-dispatcher))) 25 | 26 | (when (exists? js/MessageChannel) 27 | (set! message-channel (js/MessageChannel.)) 28 | (set! (.. message-channel -port1 -onmessage) 29 | (fn [msg] 30 | (process-messages)))) 31 | 32 | (defn queue-dispatcher [] 33 | (when-not ^boolean (and ^boolean queued? 34 | running?) 35 | (set! queued? true) 36 | (cond 37 | (exists? js/MessageChannel) (.postMessage (.-port2 message-channel) 0) 38 | (exists? js/setImmediate) (js/setImmediate process-messages) 39 | :else (js/setTimeout process-messages 0)))) 40 | 41 | (defn run [f] 42 | (.unbounded-unshift tasks f) 43 | (queue-dispatcher)) 44 | 45 | (defn queue-delay [f delay] 46 | (js/setTimeout f delay)) 47 | 48 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/cljs/core/async/impl/dispatch.js: -------------------------------------------------------------------------------- 1 | // Compiled by ClojureScript 0.0-2173 2 | goog.provide('cljs.core.async.impl.dispatch'); 3 | goog.require('cljs.core'); 4 | goog.require('cljs.core.async.impl.buffers'); 5 | goog.require('cljs.core.async.impl.buffers'); 6 | cljs.core.async.impl.dispatch.message_channel = null; 7 | cljs.core.async.impl.dispatch.tasks = cljs.core.async.impl.buffers.ring_buffer.call(null,32); 8 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 9 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 10 | cljs.core.async.impl.dispatch.TASK_BATCH_SIZE = 1024; 11 | cljs.core.async.impl.dispatch.process_messages = (function process_messages(){cljs.core.async.impl.dispatch.running_QMARK_ = true; 12 | cljs.core.async.impl.dispatch.queued_QMARK_ = false; 13 | var count_13852 = 0;while(true){ 14 | var m_13853 = cljs.core.async.impl.dispatch.tasks.pop();if((m_13853 == null)) 15 | {} else 16 | {m_13853.call(null); 17 | if((count_13852 < cljs.core.async.impl.dispatch.TASK_BATCH_SIZE)) 18 | {{ 19 | var G__13854 = (count_13852 + 1); 20 | count_13852 = G__13854; 21 | continue; 22 | } 23 | } else 24 | {} 25 | } 26 | break; 27 | } 28 | cljs.core.async.impl.dispatch.running_QMARK_ = false; 29 | if((cljs.core.async.impl.dispatch.tasks.length > 0)) 30 | {return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 31 | } else 32 | {return null; 33 | } 34 | }); 35 | if(typeof MessageChannel !== 'undefined') 36 | {cljs.core.async.impl.dispatch.message_channel = (new MessageChannel()); 37 | cljs.core.async.impl.dispatch.message_channel.port1.onmessage = (function (msg){return cljs.core.async.impl.dispatch.process_messages.call(null); 38 | }); 39 | } else 40 | {} 41 | cljs.core.async.impl.dispatch.queue_dispatcher = (function queue_dispatcher(){if(cljs.core.truth_((function (){var and__3463__auto__ = cljs.core.async.impl.dispatch.queued_QMARK_;if(and__3463__auto__) 42 | {return cljs.core.async.impl.dispatch.running_QMARK_; 43 | } else 44 | {return and__3463__auto__; 45 | } 46 | })())) 47 | {return null; 48 | } else 49 | {cljs.core.async.impl.dispatch.queued_QMARK_ = true; 50 | if(typeof MessageChannel !== 'undefined') 51 | {return cljs.core.async.impl.dispatch.message_channel.port2.postMessage(0); 52 | } else 53 | {if(typeof setImmediate !== 'undefined') 54 | {return setImmediate(cljs.core.async.impl.dispatch.process_messages); 55 | } else 56 | {if(new cljs.core.Keyword(null,"else","else",1017020587)) 57 | {return setTimeout(cljs.core.async.impl.dispatch.process_messages,0); 58 | } else 59 | {return null; 60 | } 61 | } 62 | } 63 | } 64 | }); 65 | cljs.core.async.impl.dispatch.run = (function run(f){cljs.core.async.impl.dispatch.tasks.unbounded_unshift(f); 66 | return cljs.core.async.impl.dispatch.queue_dispatcher.call(null); 67 | }); 68 | cljs.core.async.impl.dispatch.queue_delay = (function queue_delay(f,delay){return setTimeout(f,delay); 69 | }); 70 | 71 | //# sourceMappingURL=dispatch.js.map -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/cljs/core/async/impl/dispatch.js.map: -------------------------------------------------------------------------------- 1 | {"version":3, 2 | "file": 3 | "/Users/Julian/Desktop/clojure-conj-2014-paradigms-of-core-async/9.Ants-CLJS-Array-Optimised/ants-cljs/out/cljs/core/async/impl/dispatch.js", 4 | "sources":["dispatch.cljs"], 5 | "lineCount":71, 6 | "mappings": 7 | ";AAAA;;;;AAGA,gDAAA,hDAAKA;AACL,AAAKC,sCAAM,mDAAA,nDAACC;AACZ,+CAAA,/CAAeC;AACf,8CAAA,9CAAeC;AAEf,gDAAA,hDAAKC;AAEL,AAAA,AAEA,iDAAA,6BAAA,9EAAMC,8EACJ,+CAAA,/CAAMH;AACN,8CAAA,9CAAMC;AACN,kBAAA,dAAOG;AAAP,AACE,wDAAA,pDAAMC,UAAE,AAAMP,0CACZ,GAAU,YAAA,XAAMO;CAAhB;CAAA,AACE,AAACA;AACD,GAAM,CAAGD,cAAMF;CAAf,AACE;eAAO,eAAA,dAAKE;;;;;CADd;;;;AAEN,+CAAA,/CAAMJ;AACN,GAAM,8CAAA,7CAAG,AAAUF;CAAnB,AACE,OAACQ;;CADH;;;AAGF,GAAM,OAASC;CAAf,AACE,AAAMV,gDAAgB,KAAAU;AACtB,AAAM,AAAA,AAAIV,gEACJ,gBAAA,LAAKW,KACH,OAACL;;;CAJX;AAMA,iDAAA,6BAAA,9EAAMG,8EACJ,oBAAU,iBAAAG,gEAAA,AAAA,GAAAA,/CAAuBR;CACTD;;CADdS;;;CAAV;;CAAA,AAEE,8CAAA,9CAAMR;AACN,GACC,OAASM;CAAmB,uEAAA,hEAAc,AAASV;;CADpD,GAEC,OAASa;CAAiB,OAACA,aAAgBP;;CAF5C,GAAA;CAGO,iEAAA,1DAACQ,WAAcR;;CAHtB;;;;;;AAKJ,oCAAA,iBAAA,rDAAMS,kDAAKC,GACT,AAAoBf,sDAAMe;AAC1B,OAACP;;AAEH,4CAAA,+BAAA,3EAAMQ,kEAAaD,EAAEE,OACnB,OAACJ,WAAcE,EAAEE", 8 | "names": 9 | ["cljs.core.async.impl.dispatch/message-channel", 10 | "cljs.core.async.impl.dispatch/tasks", 11 | "cljs.core.async.impl.buffers/ring-buffer", 12 | "cljs.core.async.impl.dispatch/running?", 13 | "cljs.core.async.impl.dispatch/queued?", 14 | "cljs.core.async.impl.dispatch/TASK_BATCH_SIZE", 15 | "cljs.core.async.impl.dispatch/process-messages", "count", "m", 16 | "cljs.core.async.impl.dispatch/queue-dispatcher", 17 | "js/MessageChannel", "msg", "and__3463__auto__", "js/setImmediate", 18 | "js/setTimeout", "cljs.core.async.impl.dispatch/run", "f", 19 | "cljs.core.async.impl.dispatch/queue-delay", "delay"]} -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/cljs/core/async/impl/protocols.cljs: -------------------------------------------------------------------------------- 1 | ;; Copyright (c) Rich Hickey and contributors. All rights reserved. 2 | ;; The use and distribution terms for this software are covered by the 3 | ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) 4 | ;; which can be found in the file epl-v10.html at the root of this distribution. 5 | ;; By using this software in any fashion, you are agreeing to be bound by 6 | ;; the terms of this license. 7 | ;; You must not remove this notice, or any other, from this software. 8 | 9 | (ns cljs.core.async.impl.protocols) 10 | 11 | (def ^:const MAX-QUEUE-SIZE 1024) 12 | 13 | (defprotocol ReadPort 14 | (take! [port fn1-handler] "derefable val if taken, nil if take was enqueued")) 15 | 16 | (defprotocol WritePort 17 | (put! [port val fn1-handler] "derefable boolean (false if already closed) if handled, nil if put was enqueued. 18 | Must throw on nil val.")) 19 | 20 | (defprotocol Channel 21 | (close! [chan]) 22 | (closed? [chan])) 23 | 24 | (defprotocol Handler 25 | (active? [h] "returns true if has callback. Must work w/o lock") 26 | #_(lock-id [h] "a unique id for lock acquisition order, 0 if no lock") 27 | (commit [h] "commit to fulfilling its end of the transfer, returns cb. Must be called within lock")) 28 | 29 | (defprotocol Buffer 30 | (full? [b]) 31 | (remove! [b]) 32 | (add! [b itm])) 33 | 34 | ;; Defines a buffer that will never block (return true to full?) 35 | (defprotocol UnblockingBuffer) 36 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/debug/error.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Provides a base class for custom Error objects such that the 17 | * stack is correctly maintained. 18 | * 19 | * You should never need to throw goog.debug.Error(msg) directly, Error(msg) is 20 | * sufficient. 21 | * 22 | */ 23 | 24 | goog.provide('goog.debug.Error'); 25 | 26 | 27 | 28 | /** 29 | * Base class for custom error objects. 30 | * @param {*=} opt_msg The message associated with the error. 31 | * @constructor 32 | * @extends {Error} 33 | */ 34 | goog.debug.Error = function(opt_msg) { 35 | 36 | // Ensure there is a stack trace. 37 | if (Error.captureStackTrace) { 38 | Error.captureStackTrace(this, goog.debug.Error); 39 | } else { 40 | this.stack = new Error().stack || ''; 41 | } 42 | 43 | if (opt_msg) { 44 | this.message = String(opt_msg); 45 | } 46 | }; 47 | goog.inherits(goog.debug.Error, Error); 48 | 49 | 50 | /** @override */ 51 | goog.debug.Error.prototype.name = 'CustomError'; 52 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/debug/errorhandlerweakdep.js: -------------------------------------------------------------------------------- 1 | // Copyright 2008 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview File which defines dummy object to work around undefined 17 | * properties compiler warning for weak dependencies on 18 | * {@link goog.debug.ErrorHandler#protectEntryPoint}. 19 | * 20 | */ 21 | 22 | goog.provide('goog.debug.errorHandlerWeakDep'); 23 | 24 | 25 | /** 26 | * Dummy object to work around undefined properties compiler warning. 27 | * @type {Object} 28 | */ 29 | goog.debug.errorHandlerWeakDep = { 30 | /** 31 | * @param {Function} fn An entry point function to be protected. 32 | * @param {boolean=} opt_tracers Whether to install tracers around the 33 | * fn. 34 | * @return {Function} A protected wrapper function that calls the 35 | * entry point function. 36 | */ 37 | protectEntryPoint: function(fn, opt_tracers) { return fn; } 38 | }; 39 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/deps.js: -------------------------------------------------------------------------------- 1 | goog.addDependency("string/string.js", ['goog.string', 'goog.string.Unicode'], []); 2 | goog.addDependency("debug/error.js", ['goog.debug.Error'], []); 3 | goog.addDependency("asserts/asserts.js", ['goog.asserts', 'goog.asserts.AssertionError'], ['goog.debug.Error', 'goog.string']); 4 | goog.addDependency("array/array.js", ['goog.array', 'goog.array.ArrayLike'], ['goog.asserts']); 5 | goog.addDependency("object/object.js", ['goog.object'], []); 6 | goog.addDependency("string/stringbuffer.js", ['goog.string.StringBuffer'], []); 7 | goog.addDependency("useragent/useragent.js", ['goog.userAgent'], ['goog.string']); 8 | goog.addDependency("dom/browserfeature.js", ['goog.dom.BrowserFeature'], ['goog.userAgent']); 9 | goog.addDependency("dom/tagname.js", ['goog.dom.TagName'], []); 10 | goog.addDependency("dom/classes.js", ['goog.dom.classes'], ['goog.array']); 11 | goog.addDependency("math/math.js", ['goog.math'], ['goog.array', 'goog.asserts']); 12 | goog.addDependency("math/coordinate.js", ['goog.math.Coordinate'], ['goog.math']); 13 | goog.addDependency("math/size.js", ['goog.math.Size'], []); 14 | goog.addDependency("dom/dom.js", ['goog.dom', 'goog.dom.DomHelper', 'goog.dom.NodeType'], ['goog.array', 'goog.dom.BrowserFeature', 'goog.dom.TagName', 'goog.dom.classes', 'goog.math.Coordinate', 'goog.math.Size', 'goog.object', 'goog.string', 'goog.userAgent']); 15 | goog.addDependency("debug/entrypointregistry.js", ['goog.debug.EntryPointMonitor', 'goog.debug.entryPointRegistry'], ['goog.asserts']); 16 | goog.addDependency("debug/errorhandlerweakdep.js", ['goog.debug.errorHandlerWeakDep'], []); 17 | goog.addDependency("events/browserfeature.js", ['goog.events.BrowserFeature'], ['goog.userAgent']); 18 | goog.addDependency("disposable/idisposable.js", ['goog.disposable.IDisposable'], []); 19 | goog.addDependency("disposable/disposable.js", ['goog.Disposable', 'goog.dispose'], ['goog.disposable.IDisposable']); 20 | goog.addDependency("events/event.js", ['goog.events.Event', 'goog.events.EventLike'], ['goog.Disposable']); 21 | goog.addDependency("events/eventtype.js", ['goog.events.EventType'], ['goog.userAgent']); 22 | goog.addDependency("reflect/reflect.js", ['goog.reflect'], []); 23 | goog.addDependency("events/browserevent.js", ['goog.events.BrowserEvent', 'goog.events.BrowserEvent.MouseButton'], ['goog.events.BrowserFeature', 'goog.events.Event', 'goog.events.EventType', 'goog.reflect', 'goog.userAgent']); 24 | goog.addDependency("events/eventwrapper.js", ['goog.events.EventWrapper'], []); 25 | goog.addDependency("events/listenable.js", ['goog.events.Listenable', 'goog.events.ListenableKey'], ['goog.events.EventLike']); 26 | goog.addDependency("events/listener.js", ['goog.events.Listener'], ['goog.events.ListenableKey']); 27 | goog.addDependency("events/events.js", ['goog.events', 'goog.events.Key'], ['goog.array', 'goog.debug.entryPointRegistry', 'goog.debug.errorHandlerWeakDep', 'goog.events.BrowserEvent', 'goog.events.BrowserFeature', 'goog.events.Event', 'goog.events.EventWrapper', 'goog.events.Listenable', 'goog.events.Listener', 'goog.object', 'goog.userAgent']); -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/disposable/idisposable.js: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the disposable interface. A disposable object 17 | * has a dispose method to to clean up references and resources. 18 | * @author nnaze@google.com (Nathan Naze) 19 | */ 20 | 21 | 22 | goog.provide('goog.disposable.IDisposable'); 23 | 24 | 25 | 26 | /** 27 | * Interface for a disposable object. If a instance requires cleanup 28 | * (references COM objects, DOM notes, or other disposable objects), it should 29 | * implement this interface (it may subclass goog.Disposable). 30 | * @interface 31 | */ 32 | goog.disposable.IDisposable = function() {}; 33 | 34 | 35 | /** 36 | * Disposes of the object and its resources. 37 | * @return {void} Nothing. 38 | */ 39 | goog.disposable.IDisposable.prototype.dispose; 40 | 41 | 42 | /** 43 | * @return {boolean} Whether the object has been disposed of. 44 | */ 45 | goog.disposable.IDisposable.prototype.isDisposed; 46 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/dom/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the dom package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.dom.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.dom.BrowserFeature = { 31 | /** 32 | * Whether attributes 'name' and 'type' can be added to an element after it's 33 | * created. False in Internet Explorer prior to version 9. 34 | */ 35 | CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: !goog.userAgent.IE || 36 | goog.userAgent.isDocumentMode(9), 37 | 38 | /** 39 | * Whether we can use element.children to access an element's Element 40 | * children. Available since Gecko 1.9.1, IE 9. (IE<9 also includes comment 41 | * nodes in the collection.) 42 | */ 43 | CAN_USE_CHILDREN_ATTRIBUTE: !goog.userAgent.GECKO && !goog.userAgent.IE || 44 | goog.userAgent.IE && goog.userAgent.isDocumentMode(9) || 45 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9.1'), 46 | 47 | /** 48 | * Opera, Safari 3, and Internet Explorer 9 all support innerText but they 49 | * include text nodes in script and style tags. Not document-mode-dependent. 50 | */ 51 | CAN_USE_INNER_TEXT: goog.userAgent.IE && !goog.userAgent.isVersion('9'), 52 | 53 | /** 54 | * MSIE, Opera, and Safari>=4 support element.parentElement to access an 55 | * element's parent if it is an Element. 56 | */ 57 | CAN_USE_PARENT_ELEMENT_PROPERTY: goog.userAgent.IE || goog.userAgent.OPERA || 58 | goog.userAgent.WEBKIT, 59 | 60 | /** 61 | * Whether NoScope elements need a scoped element written before them in 62 | * innerHTML. 63 | * MSDN: http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx#1 64 | */ 65 | INNER_HTML_NEEDS_SCOPED_ELEMENT: goog.userAgent.IE 66 | }; 67 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/dom/tagname.js: -------------------------------------------------------------------------------- 1 | // Copyright 2007 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Defines the goog.dom.TagName enum. This enumerates 17 | * all HTML tag names specified in either the the W3C HTML 4.01 index of 18 | * elements or the HTML5 draft specification. 19 | * 20 | * References: 21 | * http://www.w3.org/TR/html401/index/elements.html 22 | * http://dev.w3.org/html5/spec/section-index.html 23 | * 24 | */ 25 | goog.provide('goog.dom.TagName'); 26 | 27 | 28 | /** 29 | * Enum of all html tag names specified by the W3C HTML4.01 and HTML5 30 | * specifications. 31 | * @enum {string} 32 | */ 33 | goog.dom.TagName = { 34 | A: 'A', 35 | ABBR: 'ABBR', 36 | ACRONYM: 'ACRONYM', 37 | ADDRESS: 'ADDRESS', 38 | APPLET: 'APPLET', 39 | AREA: 'AREA', 40 | ARTICLE: 'ARTICLE', 41 | ASIDE: 'ASIDE', 42 | AUDIO: 'AUDIO', 43 | B: 'B', 44 | BASE: 'BASE', 45 | BASEFONT: 'BASEFONT', 46 | BDI: 'BDI', 47 | BDO: 'BDO', 48 | BIG: 'BIG', 49 | BLOCKQUOTE: 'BLOCKQUOTE', 50 | BODY: 'BODY', 51 | BR: 'BR', 52 | BUTTON: 'BUTTON', 53 | CANVAS: 'CANVAS', 54 | CAPTION: 'CAPTION', 55 | CENTER: 'CENTER', 56 | CITE: 'CITE', 57 | CODE: 'CODE', 58 | COL: 'COL', 59 | COLGROUP: 'COLGROUP', 60 | COMMAND: 'COMMAND', 61 | DATA: 'DATA', 62 | DATALIST: 'DATALIST', 63 | DD: 'DD', 64 | DEL: 'DEL', 65 | DETAILS: 'DETAILS', 66 | DFN: 'DFN', 67 | DIALOG: 'DIALOG', 68 | DIR: 'DIR', 69 | DIV: 'DIV', 70 | DL: 'DL', 71 | DT: 'DT', 72 | EM: 'EM', 73 | EMBED: 'EMBED', 74 | FIELDSET: 'FIELDSET', 75 | FIGCAPTION: 'FIGCAPTION', 76 | FIGURE: 'FIGURE', 77 | FONT: 'FONT', 78 | FOOTER: 'FOOTER', 79 | FORM: 'FORM', 80 | FRAME: 'FRAME', 81 | FRAMESET: 'FRAMESET', 82 | H1: 'H1', 83 | H2: 'H2', 84 | H3: 'H3', 85 | H4: 'H4', 86 | H5: 'H5', 87 | H6: 'H6', 88 | HEAD: 'HEAD', 89 | HEADER: 'HEADER', 90 | HGROUP: 'HGROUP', 91 | HR: 'HR', 92 | HTML: 'HTML', 93 | I: 'I', 94 | IFRAME: 'IFRAME', 95 | IMG: 'IMG', 96 | INPUT: 'INPUT', 97 | INS: 'INS', 98 | ISINDEX: 'ISINDEX', 99 | KBD: 'KBD', 100 | KEYGEN: 'KEYGEN', 101 | LABEL: 'LABEL', 102 | LEGEND: 'LEGEND', 103 | LI: 'LI', 104 | LINK: 'LINK', 105 | MAP: 'MAP', 106 | MARK: 'MARK', 107 | MATH: 'MATH', 108 | MENU: 'MENU', 109 | META: 'META', 110 | METER: 'METER', 111 | NAV: 'NAV', 112 | NOFRAMES: 'NOFRAMES', 113 | NOSCRIPT: 'NOSCRIPT', 114 | OBJECT: 'OBJECT', 115 | OL: 'OL', 116 | OPTGROUP: 'OPTGROUP', 117 | OPTION: 'OPTION', 118 | OUTPUT: 'OUTPUT', 119 | P: 'P', 120 | PARAM: 'PARAM', 121 | PRE: 'PRE', 122 | PROGRESS: 'PROGRESS', 123 | Q: 'Q', 124 | RP: 'RP', 125 | RT: 'RT', 126 | RUBY: 'RUBY', 127 | S: 'S', 128 | SAMP: 'SAMP', 129 | SCRIPT: 'SCRIPT', 130 | SECTION: 'SECTION', 131 | SELECT: 'SELECT', 132 | SMALL: 'SMALL', 133 | SOURCE: 'SOURCE', 134 | SPAN: 'SPAN', 135 | STRIKE: 'STRIKE', 136 | STRONG: 'STRONG', 137 | STYLE: 'STYLE', 138 | SUB: 'SUB', 139 | SUMMARY: 'SUMMARY', 140 | SUP: 'SUP', 141 | SVG: 'SVG', 142 | TABLE: 'TABLE', 143 | TBODY: 'TBODY', 144 | TD: 'TD', 145 | TEXTAREA: 'TEXTAREA', 146 | TFOOT: 'TFOOT', 147 | TH: 'TH', 148 | THEAD: 'THEAD', 149 | TIME: 'TIME', 150 | TITLE: 'TITLE', 151 | TR: 'TR', 152 | TRACK: 'TRACK', 153 | TT: 'TT', 154 | U: 'U', 155 | UL: 'UL', 156 | VAR: 'VAR', 157 | VIDEO: 'VIDEO', 158 | WBR: 'WBR' 159 | }; 160 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/events/browserfeature.js: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Browser capability checks for the events package. 17 | * 18 | */ 19 | 20 | 21 | goog.provide('goog.events.BrowserFeature'); 22 | 23 | goog.require('goog.userAgent'); 24 | 25 | 26 | /** 27 | * Enum of browser capabilities. 28 | * @enum {boolean} 29 | */ 30 | goog.events.BrowserFeature = { 31 | /** 32 | * Whether the button attribute of the event is W3C compliant. False in 33 | * Internet Explorer prior to version 9; document-version dependent. 34 | */ 35 | HAS_W3C_BUTTON: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 36 | 37 | /** 38 | * Whether the browser supports full W3C event model. 39 | */ 40 | HAS_W3C_EVENT_SUPPORT: !goog.userAgent.IE || goog.userAgent.isDocumentMode(9), 41 | 42 | /** 43 | * To prevent default in IE7-8 for certain keydown events we need set the 44 | * keyCode to -1. 45 | */ 46 | SET_KEY_CODE_TO_PREVENT_DEFAULT: goog.userAgent.IE && 47 | !goog.userAgent.isVersion('9'), 48 | 49 | /** 50 | * Whether the {@code navigator.onLine} property is supported. 51 | */ 52 | HAS_NAVIGATOR_ONLINE_PROPERTY: !goog.userAgent.WEBKIT || 53 | goog.userAgent.isVersion('528'), 54 | 55 | /** 56 | * Whether HTML5 network online/offline events are supported. 57 | */ 58 | HAS_HTML5_NETWORK_EVENT_SUPPORT: 59 | goog.userAgent.GECKO && goog.userAgent.isVersion('1.9b') || 60 | goog.userAgent.IE && goog.userAgent.isVersion('8') || 61 | goog.userAgent.OPERA && goog.userAgent.isVersion('9.5') || 62 | goog.userAgent.WEBKIT && goog.userAgent.isVersion('528'), 63 | 64 | /** 65 | * Whether HTML5 network events fire on document.body, or otherwise the 66 | * window. 67 | */ 68 | HTML5_NETWORK_EVENTS_FIRE_ON_BODY: 69 | goog.userAgent.GECKO && !goog.userAgent.isVersion('8') || 70 | goog.userAgent.IE && !goog.userAgent.isVersion('9'), 71 | 72 | /** 73 | * Whether touch is enabled in the browser. 74 | */ 75 | TOUCH_ENABLED: 76 | ('ontouchstart' in goog.global || 77 | !!(goog.global['document'] && 78 | document.documentElement && 79 | 'ontouchstart' in document.documentElement) || 80 | // IE10 uses non-standard touch events, so it has a different check. 81 | !!(goog.global['navigator'] && 82 | goog.global['navigator']['msMaxTouchPoints'])) 83 | }; 84 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/events/eventwrapper.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Definition of the goog.events.EventWrapper interface. 17 | * 18 | * @author eae@google.com (Emil A Eklund) 19 | */ 20 | 21 | goog.provide('goog.events.EventWrapper'); 22 | 23 | 24 | 25 | /** 26 | * Interface for event wrappers. 27 | * @interface 28 | */ 29 | goog.events.EventWrapper = function() { 30 | }; 31 | 32 | 33 | /** 34 | * Adds an event listener using the wrapper on a DOM Node or an object that has 35 | * implemented {@link goog.events.EventTarget}. A listener can only be added 36 | * once to an object. 37 | * 38 | * @param {EventTarget|goog.events.EventTarget} src The node to listen to 39 | * events on. 40 | * @param {Function|Object} listener Callback method, or an object with a 41 | * handleEvent function. 42 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 43 | * false). 44 | * @param {Object=} opt_scope Element in whose scope to call the listener. 45 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to add 46 | * listener to. 47 | */ 48 | goog.events.EventWrapper.prototype.listen = function(src, listener, opt_capt, 49 | opt_scope, opt_eventHandler) { 50 | }; 51 | 52 | 53 | /** 54 | * Removes an event listener added using goog.events.EventWrapper.listen. 55 | * 56 | * @param {EventTarget|goog.events.EventTarget} src The node to remove listener 57 | * from. 58 | * @param {Function|Object} listener Callback method, or an object with a 59 | * handleEvent function. 60 | * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to 61 | * false). 62 | * @param {Object=} opt_scope Element in whose scope to call the listener. 63 | * @param {goog.events.EventHandler=} opt_eventHandler Event handler to remove 64 | * listener from. 65 | */ 66 | goog.events.EventWrapper.prototype.unlisten = function(src, listener, opt_capt, 67 | opt_scope, opt_eventHandler) { 68 | }; 69 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/reflect/reflect.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Useful compiler idioms. 17 | * 18 | */ 19 | 20 | goog.provide('goog.reflect'); 21 | 22 | 23 | /** 24 | * Syntax for object literal casts. 25 | * @see http://go/jscompiler-renaming 26 | * @see http://code.google.com/p/closure-compiler/wiki/ 27 | * ExperimentalTypeBasedPropertyRenaming 28 | * 29 | * Use this if you have an object literal whose keys need to have the same names 30 | * as the properties of some class even after they are renamed by the compiler. 31 | * 32 | * @param {!Function} type Type to cast to. 33 | * @param {Object} object Object literal to cast. 34 | * @return {Object} The object literal. 35 | */ 36 | goog.reflect.object = function(type, object) { 37 | return object; 38 | }; 39 | 40 | 41 | /** 42 | * To assert to the compiler that an operation is needed when it would 43 | * otherwise be stripped. For example: 44 | * 45 | * // Force a layout 46 | * goog.reflect.sinkValue(dialog.offsetHeight); 47 | * 48 | * @type {!Function} 49 | */ 50 | goog.reflect.sinkValue = function(x) { 51 | goog.reflect.sinkValue[' '](x); 52 | return x; 53 | }; 54 | 55 | 56 | /** 57 | * The compiler should optimize this function away iff no one ever uses 58 | * goog.reflect.sinkValue. 59 | */ 60 | goog.reflect.sinkValue[' '] = goog.nullFunction; 61 | 62 | 63 | /** 64 | * Check if a property can be accessed without throwing an exception. 65 | * @param {Object} obj The owner of the property. 66 | * @param {string} prop The property name. 67 | * @return {boolean} Whether the property is accessible. Will also return true 68 | * if obj is null. 69 | */ 70 | goog.reflect.canAccessProperty = function(obj, prop) { 71 | /** @preserveTry */ 72 | try { 73 | goog.reflect.sinkValue(obj[prop]); 74 | return true; 75 | } catch (e) {} 76 | return false; 77 | }; 78 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/out/goog/string/stringbuffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2006 The Closure Library Authors. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS-IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * @fileoverview Utility for fast string concatenation. 17 | */ 18 | 19 | goog.provide('goog.string.StringBuffer'); 20 | 21 | 22 | 23 | /** 24 | * Utility class to facilitate string concatenation. 25 | * 26 | * @param {*=} opt_a1 Optional first initial item to append. 27 | * @param {...*} var_args Other initial items to 28 | * append, e.g., new goog.string.StringBuffer('foo', 'bar'). 29 | * @constructor 30 | */ 31 | goog.string.StringBuffer = function(opt_a1, var_args) { 32 | if (opt_a1 != null) { 33 | this.append.apply(this, arguments); 34 | } 35 | }; 36 | 37 | 38 | /** 39 | * Internal buffer for the string to be concatenated. 40 | * @type {string} 41 | * @private 42 | */ 43 | goog.string.StringBuffer.prototype.buffer_ = ''; 44 | 45 | 46 | /** 47 | * Sets the contents of the string buffer object, replacing what's currently 48 | * there. 49 | * 50 | * @param {*} s String to set. 51 | */ 52 | goog.string.StringBuffer.prototype.set = function(s) { 53 | this.buffer_ = '' + s; 54 | }; 55 | 56 | 57 | /** 58 | * Appends one or more items to the buffer. 59 | * 60 | * Calling this with null, undefined, or empty arguments is an error. 61 | * 62 | * @param {*} a1 Required first string. 63 | * @param {*=} opt_a2 Optional second string. 64 | * @param {...*} var_args Other items to append, 65 | * e.g., sb.append('foo', 'bar', 'baz'). 66 | * @return {goog.string.StringBuffer} This same StringBuffer object. 67 | * @suppress {duplicate} 68 | */ 69 | goog.string.StringBuffer.prototype.append = function(a1, opt_a2, var_args) { 70 | // Use a1 directly to avoid arguments instantiation for single-arg case. 71 | this.buffer_ += a1; 72 | if (opt_a2 != null) { // second argument is undefined (null == undefined) 73 | for (var i = 1; i < arguments.length; i++) { 74 | this.buffer_ += arguments[i]; 75 | } 76 | } 77 | return this; 78 | }; 79 | 80 | 81 | /** 82 | * Clears the internal buffer. 83 | */ 84 | goog.string.StringBuffer.prototype.clear = function() { 85 | this.buffer_ = ''; 86 | }; 87 | 88 | 89 | /** 90 | * @return {number} the length of the current contents of the buffer. 91 | */ 92 | goog.string.StringBuffer.prototype.getLength = function() { 93 | return this.buffer_.length; 94 | }; 95 | 96 | 97 | /** 98 | * @return {string} The concatenated string. 99 | * @override 100 | */ 101 | goog.string.StringBuffer.prototype.toString = function() { 102 | return this.buffer_; 103 | }; 104 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/project.clj: -------------------------------------------------------------------------------- 1 | (defproject ants-cljs "0.1.0-SNAPSHOT" 2 | :description "FIXME: write this!" 3 | :url "http://example.com/FIXME" 4 | 5 | :dependencies [[org.clojure/clojure "1.5.1"] 6 | ;[org.clojure/clojurescript "0.0-2127"] 7 | [org.clojure/clojurescript "0.0-2173"] 8 | ;[org.clojure/clojurescript "0.0-2202"] 9 | [org.clojure/core.async "0.1.301.0-deb34a-alpha"] 10 | ] 11 | 12 | ;:plugins [[lein-cljsbuild "1.0.1"]] 13 | :plugins [[lein-cljsbuild "1.0.2"]] 14 | ;:plugins [[lein-cljsbuild "1.0.3"]] 15 | 16 | :source-paths ["src"] 17 | 18 | :cljsbuild { 19 | :builds [{:id "ants-cljs" 20 | :source-paths ["src"] 21 | :compiler { 22 | :output-to "ants_cljs.js" 23 | :output-dir "out" 24 | :optimizations :none 25 | :source-map true 26 | }}]}) 27 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/src/chambered/macros.clj: -------------------------------------------------------------------------------- 1 | (ns chambered.macros) 2 | 3 | (defmacro forloop [[init test step] & body] 4 | `(loop [~@init] 5 | (when ~test 6 | ~@body 7 | (recur ~step)))) 8 | 9 | (defmacro local 10 | ([] 11 | `(make-array 1)) 12 | ([x] 13 | `(cljs.core/array ~x))) 14 | 15 | (defmacro >> [x v] 16 | `(aset ~x 0 ~v)) 17 | 18 | (defmacro << [x] 19 | `(aget ~x 0)) 20 | -------------------------------------------------------------------------------- /9.Ants-CLJS-Array-Optimised/ants-cljs/target/stale/extract-native.dependencies: -------------------------------------------------------------------------------- 1 | ([:dependencies ([org.clojure/clojure "1.5.1"] [org.clojure/clojurescript "0.0-2173"] [org.clojure/core.async "0.1.301.0-deb34a-alpha"] [org.clojure/tools.nrepl "0.2.3" :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete "0.2.3" :exclusions ([org.clojure/clojure])])]) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | clojure-conj-2014-paradigms-of-core-async 2 | ========================================= 3 | 4 | Clojure Conj 2014 Talk - Paradigms of Core Async 5 | --------------------------------------------------------------------------------