Notes from PyCon 2009

Posted by Mike on Mar 29th, 2009

Just wrapping up a fantastic few days at PyCon Chicago 2009. I went with a group of about 10 guys from AGI, and we managed to have a little bit of fun in between some great mind-enriching talks.
Here are some notes I jotted down while at the conference. It’s a bit overwhelming, but [...]


Including external data with your unit tests

Posted by Mike on Jan 13th, 2009

We generally preach that you should not use real data in your unit tests. You should instead mock said data out in an effort to lesson potential side-effects, including degrading test performance and adversely affecting live data.
Sometimes, you’d like to test actual file handling in a unit test. If you do, you should [...]


Decorate a method with Dojo

Posted by Mike on Oct 2nd, 2008

Here’s a quick example of how to incorporate the Decorator Pattern into your javascript code using the Dojo framework. Rather than decorating an entire class, this example merely decorates a single function, extending the original function with some extra logic.

// Instantiate widget class
var w = new core.widget.MyWidget();
 
// Decorate the original "method1" function
var _old_method1 = [...]