Functional Math With Closures

2015 Jun23
E

ven though javascript is the most widely used programming language in the world, people still bash it. *Closures are confusing and prone to errors*, people will often say. Which is a true statement. However, higher order functions and closures are one of the things javascript does best. It allows us bend the language to do some pretty interesting things.

In one situation, I pointed out one could create a function based math library and just dynamically create equations on the fly rather than having to hard code math logic all over the place, where all numbers and operations are functions that accept functions as arguments. Of course I was challenged on the fact - So, of course I had

Read More

Dynamic Django ModelForms

2012 May05
T

he forms module in Django is pretty amazing and it allows you to do some rather complex things with not a lot of code. Django forms ships with a class called, ModelForm. ModelForm, if you are not familiar, when given a model class, on an instance of a model, will generate a form instance for you complete with validation. You can, of course, specify which fields to exclude from the form and which widgets to use for each field.

Django forms ships with a class called, ModelForm. ModelForms, if you are not familiar, when given a model class, or an instance of a model, will generate a form instance for you complete with validation. You can, of course, specify

Read More
filed under:  python django closure modelform