Skip to content
Browse files

Added ordering. Added min, max window functions based on order. Fixed…

… reversible min/max compensate function with min/max window functions
  • Loading branch information...
1 parent cac9373 commit e4bdd9f555ef32b5231207058e221ca5229b7d5f monkey committed Oct 3, 2013
Showing with 708 additions and 140 deletions.
  1. 0 .gitignore
  2. 0 AUTHORS
  3. +1 −1 LICENSE
  4. 0 README.md
  5. 0 docs/docco.css
  6. +15 −9 docs/eep.aggregate_function.html
  7. +1 −1 docs/eep.clock.html
  8. +1 −1 docs/eep.clock_counting.html
  9. +1 −1 docs/eep.clock_wall.html
  10. +1 −2 docs/eep.core.html
  11. +1 −1 docs/eep.eventworld.html
  12. +5 −4 docs/eep.fn.noop.html
  13. +33 −22 docs/eep.fn.stats.html
  14. +32 −0 docs/eep.fn.window.html
  15. +3 −2 docs/eep.html
  16. +8 −6 docs/eep.window_monotonic.html
  17. +86 −0 docs/eep.window_ordered.html
  18. +7 −6 docs/eep.window_periodic.html
  19. +14 −8 docs/eep.window_sliding.html
  20. +18 −7 docs/eep.window_tumbling.html
  21. +7 −4 docs/eep.windowfactory.html
  22. +17 −5 lib/eep.aggregate_function.js
  23. 0 lib/eep.clock.js
  24. 0 lib/eep.clock_counting.js
  25. 0 lib/eep.clock_wall.js
  26. +0 −1 lib/eep.core.js
  27. 0 lib/eep.eventworld.js
  28. +4 −3 lib/eep.fn.noop.js
  29. +31 −20 lib/eep.fn.stats.js
  30. +38 −0 lib/eep.fn.window.js
  31. +1 −0 lib/eep.js
  32. +10 −6 lib/eep.window_monotonic.js
  33. +110 −0 lib/eep.window_ordered.js
  34. +7 −6 lib/eep.window_periodic.js
  35. +12 −5 lib/eep.window_sliding.js
  36. +18 −5 lib/eep.window_tumbling.js
  37. +6 −0 lib/eep.windowfactory.js
  38. +2 −2 package.json
  39. +12 −10 samples/analytics.js
  40. +1 −1 samples/composite.js
  41. 0 samples/custom.js
  42. +5 −1 samples/microbench-nontemporal.js
  43. 0 samples/microbench-temporal.js
  44. 0 test/test-aggregate-function.js
  45. 0 test/test-clocks.js
  46. 0 test/test-eventworld.js
  47. +136 −0 test/test-ordering.js
  48. +64 −0 test/test-window-function.js
  49. 0 test/test-windows.js
View
0 .gitignore 100644 → 100755
File mode changed.
View
0 AUTHORS 100644 → 100755
File mode changed.
View
2 LICENSE 100644 → 100755
@@ -1,4 +1,4 @@
-Copyright (c) 2012. Darach Ennis < darach at gmail dot com >.
+Copyright (c) 2012-2013. Darach Ennis < darach at gmail dot com >.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
View
0 README.md 100644 → 100755
File mode changed.
View
0 docs/docco.css 100644 → 100755
File mode changed.
View
24 docs/eep.aggregate_function.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.aggregate_function.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.aggregate_function.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.aggregate_function.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.aggregate_function.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -18,18 +18,24 @@
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Constraints computations on event streams to a simple functional contract</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">AggregateFunction</span><span class="p">()</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>invoked when a window opens - should 'reset' or 'zero' a windows internal state</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>invoked when an event is enqueued into a window</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>invoked to compensate sliding window overwrite</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>invoked when a window closes</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>used by window implementations variously to preallocate function instances - makes things 'fast', basically</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span>
-<span class="p">}</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Conveniance. Computations on a set of (independant) aggregate functions. Use wisely.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">CompositeFunction</span><span class="p">(</span><span class="nx">fxs</span><span class="p">)</span> <span class="p">{</span>
- <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">fx</span> <span class="o">=</span> <span class="nx">fxs</span><span class="p">;</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">fxs</span><span class="p">)</span> <span class="p">{</span> <span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">fxs</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">make</span><span class="p">();</span> <span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">init</span><span class="p">();</span> <span class="p">}</span> <span class="p">};</span>
+ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>function type can be one of
+- simple (default)
+- ordered - will require window to store elements in arrival and sorted order</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>invoked when a window opens - should 'reset' or 'zero' a windows internal state</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>invoked when an event is enqueued into a window</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>invoked to compensate sliding window overwrite</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>invoked when a window closes</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>used by window implementations variously to preallocate function instances - makes things 'fast', basically</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span>
+<span class="p">}</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Conveniance. Computations on a set of (independant) aggregate functions. Use wisely.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">CompositeFunction</span><span class="p">(</span><span class="nx">fxs</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">fx</span> <span class="o">=</span> <span class="nx">fxs</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>if any fn has ordered property, force all to be (not ideal w.r.t. perf, find a better way)</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">type</span><span class="o">=</span><span class="s2">&quot;simple&quot;</span><span class="p">;</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">f</span> <span class="k">in</span> <span class="nx">fxs</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">type</span> <span class="o">===</span> <span class="s2">&quot;ordered&quot;</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;ordered&quot;</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+
+ <span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">fxs</span><span class="p">)</span> <span class="p">{</span> <span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">fxs</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">make</span><span class="p">(</span><span class="nx">fxs</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">win</span><span class="p">);</span> <span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">init</span><span class="p">();</span> <span class="p">}</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">fx</span><span class="p">)</span> <span class="p">{</span> <span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">accumulate</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span> <span class="p">}</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">fx</span><span class="p">)</span> <span class="p">{</span> <span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">compensate</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span> <span class="p">}</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="p">[];</span> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">fx</span><span class="p">)</span> <span class="p">{</span> <span class="nx">a</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">fx</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">emit</span><span class="p">());</span> <span class="p">};</span> <span class="k">return</span> <span class="nx">a</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
- <span class="k">return</span> <span class="k">new</span> <span class="nx">CompositeFunction</span><span class="p">(</span><span class="nx">fx</span><span class="p">);</span>
- <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">CompositeFunction</span><span class="p">(</span><span class="nx">fx</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">CompositeFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Exports</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">AggregateFunction</span> <span class="o">=</span> <span class="nx">AggregateFunction</span><span class="p">;</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">CompositeFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Exports</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">AggregateFunction</span> <span class="o">=</span> <span class="nx">AggregateFunction</span><span class="p">;</span>
<span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">CompositeFunction</span> <span class="o">=</span> <span class="nx">CompositeFunction</span><span class="p">;</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
2 docs/eep.clock.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.clock.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.clock.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.clock.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.clock.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
View
2 docs/eep.clock_counting.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.clock_counting.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.clock_counting.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.clock_counting.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.clock_counting.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
View
2 docs/eep.clock_wall.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.clock_wall.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.clock_wall.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.clock_wall.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.clock_wall.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
View
3 docs/eep.core.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.core.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.core.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.core.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.core.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -35,7 +35,6 @@
<span class="nx">self</span><span class="p">.</span><span class="nx">v</span> <span class="o">=</span> <span class="nx">newValue</span><span class="p">;</span>
<span class="k">return</span> <span class="nx">self</span><span class="p">;</span>
<span class="p">};</span>
-
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Factory function turns regular data into temporal data</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">Temporal</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">initialValue</span><span class="p">,</span> <span class="nx">instant</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">new</span> <span class="nx">Temporal</span><span class="p">(</span><span class="nx">initialValue</span><span class="p">,</span> <span class="nx">instant</span><span class="p">);</span>
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>A (degenerated) temporal aggregate function. Useful for temporal stream operators</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">TemporalFunction</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span><span class="nx">instant</span><span class="p">)</span> <span class="p">{</span>
View
2 docs/eep.eventworld.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.eventworld.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.eventworld.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.eventworld.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.eventworld.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
View
9 docs/eep.fn.noop.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.fn.noop.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.fn.noop.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.fn.noop.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.fn.noop.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -21,15 +21,16 @@
<span class="kd">var</span> <span class="nx">AggregateFunction</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.aggregate_function&#39;</span><span class="p">).</span><span class="nx">AggregateFunction</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Do nothing with all the things.</p>
<p>Useful when you simply want to exploit window 'emit' events
-to perform some action</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">NoopFunction</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+to perform some action</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">NoopFunction</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s1">&#39;noop&#39;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="kc">null</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">NoopFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">NoopFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">};</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">NoopFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>eep.js Noop package</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Noop</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Register Noop package aggregate functions</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">Noop</span><span class="p">.</span><span class="nx">noop</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">NoopFunction</span><span class="p">();</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Export the Noop package</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">Noop</span> <span class="o">=</span> <span class="nx">Noop</span><span class="p">;</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">NoopFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>eep.js Noop package</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Noop</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Register Noop package aggregate functions</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">Noop</span><span class="p">.</span><span class="nx">noop</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">NoopFunction</span><span class="p">(</span><span class="kc">undefined</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Export the Noop package</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">Noop</span> <span class="o">=</span> <span class="nx">Noop</span><span class="p">;</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
55 docs/eep.fn.stats.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.fn.stats.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.fn.stats.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.fn.stats.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.fn.stats.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -18,63 +18,72 @@
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span>
-<span class="kd">var</span> <span class="nx">AggregateFunction</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.aggregate_function&#39;</span><span class="p">).</span><span class="nx">AggregateFunction</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Count all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">CountFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="kd">var</span> <span class="nx">AggregateFunction</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.aggregate_function&#39;</span><span class="p">).</span><span class="nx">AggregateFunction</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Count all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">CountFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">n</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;count&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ignored</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span> <span class="o">+=</span> <span class="mi">1</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ignored</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span> <span class="o">-=</span> <span class="mi">1</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">n</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">CountFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">CountFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">CountFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Sum all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">SumFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">CountFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Sum all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">SumFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">s</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;sum&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">s</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">s</span> <span class="o">+=</span> <span class="nx">v</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">s</span> <span class="o">-=</span> <span class="nx">v</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">s</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">SumFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">SumFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">SumFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Get the smallest of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">MinFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">SumFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Get the smallest of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">MinFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">r</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">win</span> <span class="o">=</span> <span class="nx">win</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;min&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;ordered_reverse&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">r</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">r</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="nx">r</span> <span class="o">=</span> <span class="nx">v</span><span class="p">;</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="nx">r</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">&lt;</span> <span class="nx">r</span><span class="p">)</span> <span class="o">?</span> <span class="nx">v</span> <span class="o">:</span> <span class="nx">r</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">!=</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="nx">r</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">&lt;</span> <span class="nx">r</span><span class="p">)</span> <span class="o">?</span> <span class="nx">r</span> <span class="o">:</span> <span class="nx">v</span><span class="p">;</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">r</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">win</span><span class="p">.</span><span class="nx">min</span><span class="p">();</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">r</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">MinFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">MinFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">MinFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Get the biggest of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">MaxFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">MinFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Get the biggest of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">MaxFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">r</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">win</span> <span class="o">=</span> <span class="nx">win</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;max&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;ordered_reverse&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">r</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">r</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="nx">r</span> <span class="o">=</span> <span class="nx">v</span><span class="p">;</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="nx">r</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">&gt;</span> <span class="nx">r</span><span class="p">)</span> <span class="o">?</span> <span class="nx">v</span> <span class="o">:</span> <span class="nx">r</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">!=</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="nx">r</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">&gt;</span> <span class="nx">r</span><span class="p">)</span> <span class="o">?</span> <span class="nx">r</span> <span class="o">:</span> <span class="nx">v</span><span class="p">;</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">r</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">win</span><span class="p">.</span><span class="nx">max</span><span class="p">();</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">r</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">MaxFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">MaxFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">MaxFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Get the average of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">MeanFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">MaxFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Get the average of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">MeanFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">n</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;mean&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">m</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span><span class="o">+=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">v</span> <span class="o">-</span> <span class="nx">m</span><span class="p">;</span> <span class="nx">m</span> <span class="o">=</span> <span class="p">(</span><span class="nx">d</span><span class="p">)</span><span class="o">/</span><span class="nx">n</span> <span class="o">+</span> <span class="nx">m</span><span class="p">;</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span><span class="o">+=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">v</span> <span class="o">-</span> <span class="nx">m</span><span class="p">;</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">d</span><span class="o">/</span><span class="nx">n</span> <span class="o">+</span> <span class="nx">m</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span><span class="o">-=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">-</span> <span class="nx">v</span><span class="p">;</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">+</span> <span class="nx">d</span><span class="o">/</span><span class="nx">n</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">m</span><span class="p">;</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">MeanFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">MeanFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">MeanFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Get the sample variance of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">VarianceFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">MeanFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Get the sample variance of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">VarianceFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">m2</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">n</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;vars&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">m</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">m2</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span><span class="o">+=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">v</span> <span class="o">-</span> <span class="nx">m</span><span class="p">;</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">d</span><span class="o">/</span><span class="nx">n</span> <span class="o">+</span> <span class="nx">m</span><span class="p">;</span> <span class="nx">m2</span> <span class="o">=</span> <span class="nx">m2</span> <span class="o">+</span> <span class="nx">d</span><span class="o">*</span><span class="p">(</span><span class="nx">v</span> <span class="o">-</span> <span class="nx">m</span><span class="p">);</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">compensate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span> <span class="nx">n</span><span class="o">-=</span><span class="mi">1</span><span class="p">;</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">-</span> <span class="nx">v</span><span class="p">;</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">+</span> <span class="nx">d</span><span class="o">/</span><span class="nx">n</span><span class="p">;</span> <span class="nx">m2</span> <span class="o">=</span> <span class="nx">d</span><span class="o">*</span><span class="p">(</span><span class="nx">v</span> <span class="o">-</span> <span class="nx">m</span><span class="p">)</span> <span class="o">+</span> <span class="nx">m2</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">m2</span><span class="o">/</span><span class="p">(</span><span class="nx">n</span><span class="o">-</span><span class="mi">1</span><span class="p">);</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">VarianceFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">VarianceFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
-<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">VarianceFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Get the standard deviation of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">StdevFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">VarianceFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Get the standard deviation of all the things</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">StdevFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">m2</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">n</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;stdevs&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;simple&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">m</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">m2</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">accumulate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">n</span><span class="o">+=</span><span class="mi">1</span><span class="p">;</span>
@@ -89,13 +98,15 @@
<span class="nx">m2</span> <span class="o">=</span> <span class="nx">d</span><span class="o">*</span><span class="p">(</span><span class="nx">v</span><span class="o">-</span><span class="nx">m</span><span class="p">)</span> <span class="o">+</span> <span class="nx">m2</span><span class="p">;</span>
<span class="p">};</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">emit</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span><span class="nx">m2</span><span class="o">/</span><span class="p">(</span><span class="nx">n</span><span class="o">-</span><span class="mi">1</span><span class="p">));</span> <span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">StdevFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">StdevFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">StdevFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span>
-<span class="kd">function</span> <span class="nx">AllStatsFunction</span><span class="p">()</span> <span class="p">{</span>
+<span class="kd">function</span> <span class="nx">AllStatsFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">m4</span><span class="p">,</span> <span class="nx">m3</span><span class="p">,</span> <span class="nx">m3</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">n</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">min</span><span class="p">,</span> <span class="nx">max</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="s2">&quot;all&quot;</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">win</span> <span class="o">=</span> <span class="nx">win</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;ordered&quot;</span><span class="p">;</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">init</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="nx">m</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">m2</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">s</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">min</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">max</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">};</span>
@@ -115,8 +126,8 @@
<span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">o</span> <span class="o">=</span> <span class="nx">n</span><span class="p">;</span>
<span class="nx">s</span><span class="o">-=</span><span class="nx">v</span><span class="p">;</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">!=</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="nx">min</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">&lt;</span> <span class="nx">min</span><span class="p">)</span> <span class="o">?</span> <span class="nx">min</span> <span class="o">:</span> <span class="nx">v</span><span class="p">;</span>
- <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">v</span> <span class="o">!=</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span> <span class="k">else</span> <span class="nx">max</span> <span class="o">=</span> <span class="p">(</span><span class="nx">v</span> <span class="o">&lt;</span> <span class="nx">max</span><span class="p">)</span> <span class="o">?</span> <span class="nx">max</span> <span class="o">:</span> <span class="nx">v</span><span class="p">;</span>
+ <span class="nx">min</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">win</span><span class="p">.</span><span class="nx">min</span><span class="p">();</span>
+ <span class="nx">max</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">win</span><span class="p">.</span><span class="nx">max</span><span class="p">();</span>
<span class="nx">n</span><span class="o">-=</span><span class="mi">1</span><span class="p">;</span>
<span class="nx">d</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">-</span> <span class="nx">v</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">dn</span> <span class="o">=</span> <span class="nx">d</span> <span class="o">/</span> <span class="nx">n</span><span class="p">,</span> <span class="nx">t1</span> <span class="o">=</span> <span class="nx">d</span> <span class="o">*</span> <span class="nx">dn</span> <span class="o">*</span> <span class="nx">o</span><span class="p">;</span>
@@ -135,7 +146,7 @@
<span class="nx">stdevs</span><span class="o">:</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span><span class="nx">variance</span><span class="p">)</span>
<span class="p">};</span>
<span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">AllStatsFunction</span><span class="p">();</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">make</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="k">new</span> <span class="nx">AllStatsFunction</span><span class="p">(</span><span class="nx">win</span><span class="p">);</span> <span class="p">};</span>
<span class="p">}</span>
<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">AllStatsFunction</span><span class="p">,</span> <span class="nx">AggregateFunction</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>eep.js Statistics package</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">Stats</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Register statistics aggregate functions</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">Stats</span><span class="p">.</span><span class="nx">count</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">CountFunction</span><span class="p">();</span>
<span class="nx">Stats</span><span class="p">.</span><span class="nx">sum</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">SumFunction</span><span class="p">();</span>
View
32 docs/eep.fn.window.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html> <html> <head> <title>eep.fn.window.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.fn.window.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:</p>
+
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span>
+<span class="kd">var</span> <span class="nx">events</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;events&#39;</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Base class of all window types</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">WindowBase</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">type</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
+
+ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">min</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">max</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">size</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">throw</span> <span class="s2">&quot;Must subclass&quot;</span><span class="p">;</span> <span class="p">};</span>
+<span class="p">};</span>
+
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">WindowBase</span><span class="p">,</span> <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Exports</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">WindowBase</span> <span class="o">=</span> <span class="nx">WindowBase</span><span class="p">;</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
5 docs/eep.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -27,7 +27,8 @@
<span class="nx">eep</span><span class="p">.</span><span class="nx">TumblingWindow</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.window_tumbling&#39;</span><span class="p">).</span><span class="nx">TumblingWindow</span><span class="p">;</span>
<span class="nx">eep</span><span class="p">.</span><span class="nx">SlidingWindow</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.window_sliding&#39;</span><span class="p">).</span><span class="nx">SlidingWindow</span><span class="p">;</span>
<span class="nx">eep</span><span class="p">.</span><span class="nx">Periodicwindow</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.window_periodic&#39;</span><span class="p">).</span><span class="nx">PeriodicWindow</span><span class="p">;</span>
-<span class="nx">eep</span><span class="p">.</span><span class="nx">MonotonicWindow</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.window_monotonic&#39;</span><span class="p">).</span><span class="nx">MonotonicWindow</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Register optional packages</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">eep</span><span class="p">.</span><span class="nx">Noop</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.fn.noop&#39;</span><span class="p">).</span><span class="nx">Noop</span><span class="p">;</span>
+<span class="nx">eep</span><span class="p">.</span><span class="nx">MonotonicWindow</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.window_monotonic&#39;</span><span class="p">).</span><span class="nx">MonotonicWindow</span><span class="p">;</span>
+<span class="nx">eep</span><span class="p">.</span><span class="nx">OrderedWindow</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.window_ordered&#39;</span><span class="p">).</span><span class="nx">OrderedWindow</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Register optional packages</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">eep</span><span class="p">.</span><span class="nx">Noop</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.fn.noop&#39;</span><span class="p">).</span><span class="nx">Noop</span><span class="p">;</span>
<span class="nx">eep</span><span class="p">.</span><span class="nx">Stats</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.fn.stats&#39;</span><span class="p">).</span><span class="nx">Stats</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Export the eep package</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span> <span class="o">=</span> <span class="nx">eep</span><span class="p">;</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
14 docs/eep.window_monotonic.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.window_monotonic.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.window_monotonic.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.window_monotonic.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.window_monotonic.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -22,16 +22,18 @@
<span class="kd">var</span> <span class="nx">Temporal</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.core&#39;</span><span class="p">).</span><span class="nx">Temporal</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">TemporalFunction</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./eep.core&#39;</span><span class="p">).</span><span class="nx">TemporalFunction</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>A monotonic window. Client should call tick monotonically and use with a monotonic clock implementation.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">MonotonicWindow</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span> <span class="nx">clock</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
- <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">fn</span> <span class="o">=</span> <span class="nx">TemporalFunction</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span><span class="nx">clock</span><span class="p">.</span><span class="nx">init</span><span class="p">()),</span> <span class="nx">idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span> <span class="o">=</span> <span class="nx">TemporalFunction</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span><span class="nx">clock</span><span class="p">.</span><span class="nx">init</span><span class="p">());</span>
+ <span class="kd">var</span> <span class="nx">idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
- <span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">enqueue</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">fn</span><span class="p">.</span><span class="nx">accumulate</span><span class="p">(</span><span class="nx">Temporal</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">v</span><span class="p">,</span> <span class="nx">clock</span><span class="p">.</span><span class="nx">inc</span><span class="p">()));</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">accumulate</span><span class="p">(</span><span class="nx">Temporal</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">v</span><span class="p">,</span> <span class="nx">clock</span><span class="p">.</span><span class="nx">inc</span><span class="p">()));</span>
<span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">tick</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>If time hasn't passed, we're done</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tick</span><span class="p">())</span> <span class="k">return</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Otherwise, emit</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tock</span><span class="p">(</span><span class="nx">fn</span><span class="p">.</span><span class="nx">at</span><span class="p">()))</span> <span class="p">{</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;emit&#39;</span><span class="p">,</span> <span class="nx">fn</span><span class="p">.</span><span class="nx">emit</span><span class="p">().</span><span class="nx">value</span><span class="p">());</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>'close' current window and 'open' a new one</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">tick</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>If time hasn't passed, we're done</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tick</span><span class="p">())</span> <span class="k">return</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Otherwise, emit</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tock</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">at</span><span class="p">()))</span> <span class="p">{</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;emit&#39;</span><span class="p">,</span> <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">emit</span><span class="p">().</span><span class="nx">value</span><span class="p">());</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>'close' current window and 'open' a new one</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="p">};</span>
View
86 docs/eep.window_ordered.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html> <html> <head> <title>eep.window_ordered.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.window_ordered.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+
+<p>Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:</p>
+
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+
+<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span>
+<span class="kd">var</span> <span class="nx">events</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;events&#39;</span><span class="p">);</span>
+
+<span class="kd">var</span> <span class="nx">indexOf</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span><span class="nx">candidate</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">min</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">max</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">pivot</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">value</span><span class="p">;</span>
+
+ <span class="k">while</span> <span class="p">(</span><span class="nx">min</span> <span class="o">&lt;=</span> <span class="nx">max</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">pivot</span> <span class="o">=</span> <span class="p">(</span><span class="nx">min</span> <span class="o">+</span> <span class="nx">max</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span> <span class="o">|</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="nx">value</span> <span class="o">=</span> <span class="nx">data</span><span class="p">[</span><span class="nx">pivot</span><span class="p">];</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">&lt;</span> <span class="nx">candidate</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">min</span> <span class="o">=</span> <span class="nx">pivot</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">&gt;</span> <span class="nx">candidate</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">max</span> <span class="o">=</span> <span class="nx">pivot</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">pivot</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+
+ <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="kd">var</span> <span class="nx">remove</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">idx</span> <span class="o">=</span> <span class="nx">indexOf</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span><span class="nx">value</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">idx</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">data</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">idx</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
+ <span class="p">}</span>
+<span class="p">};</span>
+
+<span class="kd">var</span> <span class="nx">insert</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">data</span><span class="p">,</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">hi</span> <span class="o">=</span> <span class="nx">n</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">lo</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="kd">var</span> <span class="nx">pivot</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nx">n</span><span class="o">/</span><span class="mi">2</span><span class="p">);</span>
+
+ <span class="k">do</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">&gt;</span> <span class="nx">data</span><span class="p">[</span><span class="nx">pivot</span><span class="p">])</span> <span class="p">{</span>
+ <span class="nx">lo</span> <span class="o">=</span> <span class="nx">pivot</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">value</span> <span class="o">&lt;</span> <span class="nx">data</span><span class="p">[</span><span class="nx">pivot</span><span class="p">])</span> <span class="p">{</span>
+ <span class="nx">hi</span> <span class="o">=</span> <span class="nx">pivot</span><span class="p">;</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="k">break</span><span class="p">;</span>
+
+ <span class="nx">pivot</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">floor</span><span class="p">(</span><span class="nx">lo</span> <span class="o">+</span> <span class="p">((</span><span class="nx">hi</span> <span class="o">-</span> <span class="nx">lo</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">));</span>
+ <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="nx">lo</span> <span class="o">&lt;</span> <span class="nx">hi</span><span class="p">);</span>
+
+ <span class="nx">data</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">pivot</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span> <span class="nx">value</span><span class="p">);</span>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>A window decorator that supports ordering. Leverages an insertion sort.
+Use wisely. Order is not a requirement for most algorithms and has a
+significant performance cost associated with it.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">OrderedWindow</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">win</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
+ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Array</span><span class="p">();</span>
+
+ <span class="nx">self</span><span class="p">.</span><span class="nx">min</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">s</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">max</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">s</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span> <span class="p">};</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">size</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>override</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">win</span><span class="p">.</span><span class="nx">min</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">min</span><span class="p">;</span>
+ <span class="nx">win</span><span class="p">.</span><span class="nx">max</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">max</span><span class="p">;</span>
+ <span class="nx">win</span><span class="p">.</span><span class="nx">size</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">size</span><span class="p">;</span>
+
+ <span class="nx">win</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;drop&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span> <span class="nx">remove</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">x</span><span class="p">);</span> <span class="p">});</span>
+ <span class="nx">win</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">&#39;emit&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span> <span class="nx">self</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;emit&#39;</span><span class="p">,</span><span class="nx">x</span><span class="p">);</span> <span class="p">});</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">enqueue</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span> <span class="nx">insert</span><span class="p">(</span><span class="nx">s</span><span class="p">,</span> <span class="nx">x</span><span class="p">);</span> <span class="nx">win</span><span class="p">.</span><span class="nx">enqueue</span><span class="p">(</span><span class="nx">x</span><span class="p">);</span> <span class="p">};</span>
+<span class="p">};</span>
+<span class="nx">util</span><span class="p">.</span><span class="nx">inherits</span><span class="p">(</span><span class="nx">OrderedWindow</span><span class="p">,</span> <span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Exports</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">OrderedWindow</span> <span class="o">=</span> <span class="nx">OrderedWindow</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>For testing</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">OrderedWindow</span><span class="p">.</span><span class="nx">indexOf</span> <span class="o">=</span> <span class="nx">indexOf</span><span class="p">;</span>
+<span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">OrderedWindow</span><span class="p">.</span><span class="nx">remove</span> <span class="o">=</span> <span class="nx">remove</span><span class="p">;</span>
+<span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="p">.</span><span class="nx">OrderedWindow</span><span class="p">.</span><span class="nx">insert</span> <span class="o">=</span> <span class="nx">insert</span><span class="p">;</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
13 docs/eep.window_periodic.html 100644 → 100755
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <html> <head> <title>eep.window_periodic.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.window_periodic.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
+<!DOCTYPE html> <html> <head> <title>eep.window_periodic.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="eep.aggregate_function.html"> eep.aggregate_function.js </a> <a class="source" href="eep.clock.html"> eep.clock.js </a> <a class="source" href="eep.clock_counting.html"> eep.clock_counting.js </a> <a class="source" href="eep.clock_wall.html"> eep.clock_wall.js </a> <a class="source" href="eep.core.html"> eep.core.js </a> <a class="source" href="eep.eventworld.html"> eep.eventworld.js </a> <a class="source" href="eep.fn.noop.html"> eep.fn.noop.js </a> <a class="source" href="eep.fn.stats.html"> eep.fn.stats.js </a> <a class="source" href="eep.fn.window.html"> eep.fn.window.js </a> <a class="source" href="eep.html"> eep.js </a> <a class="source" href="eep.window_monotonic.html"> eep.window_monotonic.js </a> <a class="source" href="eep.window_ordered.html"> eep.window_ordered.js </a> <a class="source" href="eep.window_periodic.html"> eep.window_periodic.js </a> <a class="source" href="eep.window_sliding.html"> eep.window_sliding.js </a> <a class="source" href="eep.window_tumbling.html"> eep.window_tumbling.js </a> <a class="source" href="eep.windowfactory.html"> eep.windowfactory.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> eep.window_periodic.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) Darach Ennis &lt; darach at gmail dot com >.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -25,18 +25,19 @@
As wall clock time is used, this window is not monotonic.
Here be dragons like NTP, PTP, basically.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">PeriodicWindow</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span> <span class="nx">intervalMillis</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">events</span><span class="p">.</span><span class="nx">EventEmitter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
- <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">clock</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">WallClock</span><span class="p">(</span><span class="nx">intervalMillis</span><span class="p">),</span> <span class="nx">fn</span> <span class="o">=</span> <span class="nx">TemporalFunction</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span><span class="nx">intervalMillis</span><span class="p">);</span>
+ <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span> <span class="nx">clock</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">WallClock</span><span class="p">(</span><span class="nx">intervalMillis</span><span class="p">);</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span> <span class="o">=</span> <span class="nx">TemporalFunction</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">aggFn</span><span class="p">,</span><span class="nx">intervalMillis</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">idx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="nx">clock</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
- <span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
<span class="nx">self</span><span class="p">.</span><span class="nx">enqueue</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
- <span class="nx">fn</span><span class="p">.</span><span class="nx">accumulate</span><span class="p">(</span><span class="nx">Temporal</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">v</span><span class="p">,</span> <span class="nx">clock</span><span class="p">.</span><span class="nx">inc</span><span class="p">()));</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">accumulate</span><span class="p">(</span><span class="nx">Temporal</span><span class="p">.</span><span class="nx">make</span><span class="p">(</span><span class="nx">v</span><span class="p">,</span> <span class="nx">clock</span><span class="p">.</span><span class="nx">inc</span><span class="p">()));</span>
<span class="p">};</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">tick</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>If time hasn't passed, we're done</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tick</span><span class="p">())</span> <span class="k">return</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Otherwise, emit</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tock</span><span class="p">(</span><span class="nx">fn</span><span class="p">.</span><span class="nx">at</span><span class="p">()))</span> <span class="p">{</span>
- <span class="nx">self</span><span class="p">.</span><span class="nx">emit</span><span class="p">(</span><span class="s1">&#39;emit&#39;</span><span class="p">,</span> <span class="nx">fn</span><span class="p">.</span><span class="nx">emit</span><span class="p">().</span><span class="nx">value</span><span class="p">());</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>'close' current time window and 'open' a fresh one</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">fn</span><span class="p">.</span><span class="nx">init</span><span class="p">();</span>
+ <span class="nx">self</span><span class="p">.</span><span class="nx">tick</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>If time hasn't passed, we're done</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tick</span><span class="p">())</span> <span class="k">return</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Otherwise, emit</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">clock</span><span class="p">.</span><span class="nx">tock</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">at</span><span class="p">()))</span> <span class="p">{</span>
+ <span class="