Month: January 2015
-
Optional chaining with dictionaries (in Swift)
Whilst learning Swift and SpriteKit I came across an issue with the documentation for SKNode.userData. In an early XCode beta it was specified as an implicitly unwrapped optional whereas now it is clearly an optional. Therefore the code I origina…
-
Optional chaining with dictionaries (in Swift)
Whilst learning Swift and SpriteKit I came across an issue with the documentation for SKNode.userData. In an early XCode beta it was specified as an implicitly unwrapped optional whereas now it is clearly an optional. Therefore the code I origina…
-
Lazy Transducer Evaluation
In the previous article in this series on transducers we looked at transducers which push more items downstream through the reducer chain than they receive from upstream. We promised that this would make lazy evaluation of transducer chains quite interesting.
When used with our transduce() function, our mapping and filtering …
-
Lazy Transducer Evaluation
In the previous article in this series on transducers we looked at transducers which push more items downstream through the reducer chain than they receive from upstream. We promised that this would make lazy evaluation of transducer chains quite interesting.
When used with our transduce() function, our mapping and filtering …
-
Item Injecting Transducers
In the previous article in our series on understanding transducers through Python we showed how to support early termination of a reduction operation. This time, we’ll demonstrate how transducers can produce more items than they consume. Although this may seem obvious, it leads to some important consequences for implementing lazy …
-
Item Injecting Transducers
In the previous article in our series on understanding transducers through Python we showed how to support early termination of a reduction operation. This time, we’ll demonstrate how transducers can produce more items than they consume. Although this may seem obvious, it leads to some important consequences for implementing lazy …
-
Terminating Transducers
In the previous article in this series on transducers, we showed how to implement stateful transducers, and how to deal with any left-over state or other clean-up operations when the reduction operation is complete. Sometimes, however, there is no need to process a whole series of items in order to …
-
Terminating Transducers
In the previous article in this series on transducers, we showed how to implement stateful transducers, and how to deal with any left-over state or other clean-up operations when the reduction operation is complete. Sometimes, however, there is no need to process a whole series of items in order to …
-
Stateful Transducers
In the previous article in this series on transducers we saw how we can develop the notion of the transducer from a single function which literally transforms reducers to a more capable protocol which supports two further capabilities: First of all, the association of initial ‘seed’ values with a reduction …
-
Stateful Transducers
In the previous article in this series on transducers we saw how we can develop the notion of the transducer from a single function which literally transforms reducers to a more capable protocol which supports two further capabilities: First of all, the association of initial ‘seed’ values with a reduction …
-
Enriching the Transducer Protocol
In the previous article in the series we looked at improving the experience of composing transducers together in Python, by introducing a compose() function. We finished by showing this snippet, which composes a filtering transducer with a mapping transducer to produce a prime-squaring transducer. Recalling that transducers are used to …
-
Enriching the Transducer Protocol
In the previous article in the series we looked at improving the experience of composing transducers together in Python, by introducing a compose() function. We finished by showing this snippet, which composes a filtering transducer with a mapping transducer to produce a prime-squaring transducer. Recalling that transducers are used to …
-
Improving Transducer Composition
In the previous article in this series we derived a Python implementation of transducers from first principles. We finished by showing how transducers can be composed together using regular function call application to give us a single composite reducer which can perform many operations with a single pass of reduce …
-
Improving Transducer Composition
In the previous article in this series we derived a Python implementation of transducers from first principles. We finished by showing how transducers can be composed together using regular function call application to give us a single composite reducer which can perform many operations with a single pass of reduce …
-
Deriving Transducers from First Principles
What is a transducer?
Transducers – a portmanteau of ‘transform reducers’ – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can be challenging. In this series …
-
Understanding Transducers through Python
In this series we take an in-depth look at transducers. Transducers – a portmanteau of “transform reducers” – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can …
-
Deriving Transducers from First Principles
What is a transducer?
Transducers – a portmanteau of ‘transform reducers’ – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can be challenging. In this series …
-
Understanding Transducers through Python
In this series we take an in-depth look at transducers. Transducers – a portmanteau of “transform reducers” – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can …
-
JAX-RS (using Apache CXF) in embedded Tomcat example
I had serious trouble today firing up an embedded Tomcat server that serves up REST resources using JAX-RS via Apache CXF. Here’s minimal example, hopefully saving you the same trouble: src/HelloJaxRs.java: import org.apache.catalina.startup.Tomcat; im…
-
Vim persistent buffer list combined with saved sessions
I like to use several saved Vim sessions to remember what files I was working on in a particular project. I also like to have a list of buffers I have open on the left-hand side of the screen that is always visible and up-to-date. Sometimes, the existe…