clj-me.blogspot.com
Clojure and me: February 2009
http://clj-me.blogspot.com/2009_02_01_archive.html
When the pupil is ready to learn, a teacher will appear. Monday, February 23, 2009. This post has moved, go to its new location. Now that fully lazy sequences are in the trunk,. User= (def s (map #(do (println %) %) (range 10) ). User= (def d (drop 1 s). User= (def r (rest s). As one can see. Needs to realize the first element of s while. Doesn't. The corollary is that. Holds on the whole seq (including the nth first elements) while. Computes the first element and then discards it. Follow me on Twitter!
clj-me.blogspot.com
Clojure and me: June 2009
http://clj-me.blogspot.com/2009_06_01_archive.html
When the pupil is ready to learn, a teacher will appear. Monday, June 8, 2009. Linear Interpolation and sorted-map. This post has moved, go to its new location. Can help when working with a partition of disjoint intervals, eg when you need to interpolate. Takes a coll of 2D points (vectors) and returns. Their linear interpolation function.". Let [m (into (sorted-map) points)]. Let [ [x1 y1] (rsubseq m. X2 y2] (subseq m x)]. Y1 (* (- x x1) (/ (- y2 y1) (- x2 x1) ). 0 1/2 1 5/4 3/2 7/4 2 5/2 3).
clj-me.cgrand.net
Clojure and me » Tarjan’s strongly connected components algorithm
http://clj-me.cgrand.net/2013/03/18/tarjans-strongly-connected-components-algorithm
Raquo;When the pupil is ready to learn, a teacher will appear. Tarjan’s strongly connected components algorithm. 8212; cgrand, 18 March 2013 @ 19 h 48 min. I dislike algorithms that are full of indices and mutations. Not because they are bad but because I always have the feeling that the core idea is buried. As such, Tarjan’s SCC algorithm. So I took the traditional algorithm, implemented it in Clojure with explicit environment passing. Then I replaced indices by explicit stacks. And after some tweaks.
clj-me.blogspot.com
Clojure and me: May 2009
http://clj-me.blogspot.com/2009_05_01_archive.html
When the pupil is ready to learn, a teacher will appear. Sunday, May 17, 2009. The Need for More Lack of Understanding. This post has moved, go to its new location. By Gilad Bracha echoed with my experience designing two small internal DSL in Clojure ( Moustache. It's not the same kind of non-understanding which I have in mind. I'm talking about a macro/DSL being able to not understand what is passed to it. 8212; thanks to MB's comment. That's why in Enlive you can easily add your own selectors step.
clj-me.blogspot.com
Clojure and me: January 2009
http://clj-me.blogspot.com/2009_01_01_archive.html
When the pupil is ready to learn, a teacher will appear. Saturday, January 31, 2009. This post has moved, go to its new location. A nice article on Clojure. That gives one wrong tip: to use. To access a shadowed global. There are several reasons not to use. It doesn't work if the value of your var is not invokable,. It evaluates to something different: it returns the var an not its value. It happens that vars proxy function calls to their values but a var can be rebound:. Def a (map str (range 10) ).
clj-me.blogspot.com
Clojure and me: July 2009
http://clj-me.blogspot.com/2009_07_01_archive.html
When the pupil is ready to learn, a teacher will appear. Thursday, July 30, 2009. Everybody loves the Sieve of Eratosthenes. This post has moved, go to its new location. If I judge by traffic logs for this blog, many newcomers want to compute prime numbers in Clojure. A recent thread on the mailing list. Prompted me to test an idea I had for a while: to use a map to implement the Sieve of Eratosthenes. The first implementation was this one:. Let [enqueue (fn [sieve n factor]. Let [m ( n factor)]. N p (wh...
clj-me.blogspot.com
Clojure and me: August 2008
http://clj-me.blogspot.com/2008_08_01_archive.html
When the pupil is ready to learn, a teacher will appear. Wednesday, August 20, 2008. This post has moved, go to its new location. Six weeks since last post. Relocating to my hometown. And a trip to Corsica caused me to stay offline for too long. I'll be back online soon (as soon as I get a working DSL link and a nearly empty inbox). BTW, I'm available for contract work from September on. Posted by Christophe Grand. Subscribe to: Posts (Atom). Fr) (contact info at the bottom). View my complete profile.
clj-me.blogspot.com
Clojure and me: October 2008
http://clj-me.blogspot.com/2008_10_01_archive.html
When the pupil is ready to learn, a teacher will appear. Wednesday, October 29, 2008. This post has moved, go to its new location. Lazy-cat [0 1] (map fib-seq (rest fib-seq) ). Posted by Christophe Grand. Wednesday, October 22, 2008. Clojure Golf: subsets-by-card (2). This post has moved, go to its new location. I wasn't happy with the last one. At least this one is lazier and in increasing cardinality order. Reduce (fn [ssbc x]. Map (fn [a b] (concat a (map #(conj % x) b) ). Reduce (fn [ssbc x]. Follow ...
clj-me.blogspot.com
Clojure and me: July 2008
http://clj-me.blogspot.com/2008_07_01_archive.html
When the pupil is ready to learn, a teacher will appear. Tuesday, July 8, 2008. This post has moved, go to its new location. I thought that there was some kind of. To force evaluation of the arguments seq but it's not the case when the applied function is variadic. Posted by Christophe Grand. Tuesday, July 1, 2008. This post has moved, go to its new location. To avoid name clash with. Which is a low-level function (it is used in the definition of. Coll] (but-last coll 1). Fn this [s os].
clj-me.blogspot.com
Clojure and me: June 2008
http://clj-me.blogspot.com/2008_06_01_archive.html
When the pupil is ready to learn, a teacher will appear. Monday, June 23, 2008. This post has moved, go to its new location. If you can't put off what you have to do, ask someone else to do it for you. Computes a lazy-seq in another (dedicated) thread.". Let [ex (. java.util.concurrent.Executors newSingleThreadExecutor)]. Let [future-rest (java.util.concurrent.FutureTask. #(rest s) ]. Lazy-cons (first s) (this (.get future-rest) ). Shutdown ex) ) s) ). Posted by Christophe Grand. User 4m11.942s # use...
SOCIAL ENGAGEMENT