Monthly Archives: December 2007

Top 13 challenge sites

Statusreport in his new blog Ingeration has compiled a list of top challenge sites. I must admit, I already knew some of them in the past and he also told me about some of them earlier. Still, this time around … Continue reading

Posted in Challenges | Tagged , , | 1 Comment

Small Python Challenge No. 2 – LRU Cache

Caching is easy. Consider the cache I used to optimize the recursive spring: class _NotInDict(object): pass _NotInDict = _NotInDict() def cached(func): cache = {} def wrapper_func(*args): prev_result = cache.get(args, _NotInDict) if prev_result is _NotInDict: result = func(*args) cache[args] = result … Continue reading

Posted in Algorithms, Challenges, computer science, Programming, Python, Utility Functions | Tagged , , | 2 Comments

Optimizing the recursive spring

Remember the recursive spring? Well, when I worked on it, it was quite slow. I mean very slow. Especially at the higher levels. The original reason was the recursion. Consider this – to ‘springify’ a track, you had to sample … Continue reading

Posted in Algorithms, Fractals, Programming, Python | Tagged , | Leave a comment

A classic programming challenge, in Python

It has become a tradition for computer scientists to create various self referential ‘strange loops’. Traditions such as writing a compiler in the language it compiles are actually quite useful – and also very interesting. This tradition also branched to … Continue reading

Posted in Challenges, computer science, Programming Philosophy, Python | Tagged , , | 6 Comments

Fractals in 10 minutes No. 2 – Recursive Spring

Imagine a straight wire. Bend this wire until its ends meet. You get a ring. Next stage. Take another straight wire, bend it as before, but this time, don’t let the ends meet, instead continue bending the wire more and … Continue reading

Posted in Fractals, Graphics, Programming, Python | Tagged , | 2 Comments