user> (time (reduce + (take 1000000 (filter odd? (map inc (range)))))) "Elapsed time: 852.480731 msecs" 1000000000000 user> (time (transduce (comp (map inc) (filter odd?) (take 1000000)) + (range))) "Elapsed time: 196.148631 msecs" 1000000000000
Helped me to understand transducers.
When debugging Reagent components, I printed data structures to the browser's console. I formatted them with my mind.
My colleague Marten did too. We have both stopped. The reason? Marten gave birth to this beauty:
(defn debug-panel "Debug panel, pretty prints any data you pass in on the screen." [d] [:pre (with-out-str (cljs.pprint/pprint d))])
debug-panel component can be included within a HTML-tag on the page like this:
The HelloData platform aims to connect smart meters, apps and consumers with one another, while still ensuring consumers retain ownership and control of their data. Technically speaking, this creates challenges when it comes to data streams (scalability), security (access rights; protection against malicious users), and the interface between the source (e.g. the smart meter) and services (the apps that use the data).
Because the first version of HelloData, written in Ruby on Rails, had performance issues, we decided to (re)build the platform in Clojure.
But why Clojure? In this blog post I explain four reasons behind this decision:
Two quotes one video:
Joy of Clojure 2nd edition (p. 73):
The problem [with floating point numbers] can be summarized simply: given a finite representation of an infinitely large set, a determination must be made which finite subset is represented.
Gerald Jay Sussmann in We Really Don't Know how to Compute:
I'll first provide one way to do it, and then a better way: