- @fergbyrne
- HTM = Hierarchical Temporal Memory
- Slides
- big data is like teenage sex
- noone knows how to do it
- everyone thinks everyone else is doing it
const std = @import("std"); | |
pub fn main() !void { | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
defer std.debug.assert(gpa.deinit()); | |
const allocator = &gpa.allocator; | |
const num_threads = std.math.max(1, (std.Thread.getCpuCount() catch 1) / 2); | |
const epolls = try allocator.alloc(std.os.fd_t, num_threads); | |
defer allocator.free(epolls); |
(comment ; Fun with transducers, v2 | |
;; Still haven't found a brief + approachable overview of Clojure 1.7's new | |
;; transducers in the particular way I would have preferred myself - so here goes: | |
;;;; Definitions | |
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as: | |
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation | |
;; (The `[]` arity is actually optional; it's only used when calling | |
;; `reduce` w/o an init-accumulator). |
(ns challenge | |
" via http://www.infoq.com/presentations/rx-async | |
Two input streams with the following values: | |
stream1: 7, 1, 0, 2, 3, 1, ... | |
stream2: 0, 7, 0, 4, 6, 5, ... | |
Task: | |
Create a new output stream that | |
• yields, for each value of stream1, the sum of the previous 3 | |
• values of stream1,except if the sum is greater than some threshold in | |
which case the next value of stream2 should be subtracted. |
;;;; Super top secret talk stuff nobody should ever see. Shhh. | |
(in-ns 'user) | |
(defmacro bench [& body] | |
`((re-find #"\"(.*)\"" (with-out-str (time (do ~@body)))) 1)) | |
*ns* | |
(require 'clojure.walk) |