February 8, 2010 – 3:28 am
These days I have to write some sort of reference card for basic sorting algorithms. Of course I wanted some sort of visualization of those algorithms on that card. The
coolest sorting algorithm visualization I’ve seen so far has been created by
Aldo Cortesi. He used
Cairo to draw his stuff (according to his post learning
Cairo was the whole point of this excercise).
Personally I still found those diagrams pretty hard to read if you really wanted to follow the algorithm. And of course I wanted to do something with Cairo, too. So I decided to rewrite the whole thing in C. My version shows distinct sections for each loop iteration (as most of those algorithms can be followed by thinking in that iterative loop way). In the diagrams below each number denotes the loop nesting level while B stands for being and E for end.
January 27, 2010 – 7:56 pm
I’ve had this board for about a 1.5 years. All that time I was disliked the fact that the ethernet was not working. No matter what I tried, what example I flashed nothing helped. Today I learned why: the hardware’s simply broken.
That’s no guess too far away, but being a software guy that’s just an unreachable world to me.
Thankfully that’s not the case for a friend of mine. He’s a talented hacker (from today on I know how talented

) and he got this fixed. All the time I was like: “hey, if that’s so easy someone else would have done it already instead of buying that super-expensive Pulse Jack Ethernet Transformer hardware”. None the less he pushed forward and got it to work. As usually pictures say more than a thousand words, so here we go:
December 11, 2009 – 12:52 pm
This is just a quick post to share this thing with the world: the Y-combinator in Scala (yipee, anonymous recursion). Unfortunately this can’t be written purely as Scala does not employ lazy evaluation (like Haskell does).
1 2 3 4 5 6 7 8 9
| object YCombinator {
def Y [A ](f : (A => A ) => (A => A )): (A => A ) = f (Y (f ))(_:A )
def main (args : Array [String ]) = {
println (Y ( (fact :(Int => Int )) => (x :Int ) => if(x == 0 ) 1 else x * fact (x - 1) )(5))
}
} |