Posts in April, 2009

Django like templates in Javascript

Here's a quick ‘n’ dirty Javascript function I hacked together that provides Django-like template substitution.

Used something like this:

Which returns the following string:

Alas, it doesn't support anything other than substitution. If you need anything more advanced (loops etc), you should investigate Javascript template engines.

There's always a way

Where there is a Will, there is always a way.

Spotted in a deli in Oxford. It says ‘Where there is a Will, there is always a way’.

Thats right – always a way!

Just saying.

Fuzzy Thinking

I have an idea germinating that involves using fuzzy logic, something I only had a passing knowledge of. After reading the Wikipedia articles and Googling for it I'm more informed but still haven't found a perfect resource.

The only Python code I have found was informative, but it was from way back in 1990. If there are any Pythonistas who know of a more up-to-date fuzzy logic module, or fuzzy logic resource in general, please let me know!