Hello World Emailer

I thought that this would be worth posting, I’ve been in need of some Jython code that would help me send out emails with 1 to n files attached to the message. I puttered around my books and a few websites but couldn’t find exactly what I needed. A few failed attempts later I pieced together some working code. Several times I swear some of the Python examples just didn’t work with Jython, the key was figuring out which libraries to import. ...

March 25, 2010 · 2 min · Matt Brandt

Object Reflection

Last week I was working on understanding a problem and spent a few minutes exploring reflection. My intention was to populate an array of objects and using reflection dynamically find and call the methods that interested me. After digging around Python’s internals for a bit I came up with this. class InspectorGadget(object): def __init__(self, quarrel_with): self.__evil_antagonist = quarrel_with def go_go_gadget_hat(self): ... deploy hat def go_go_gadget_arms(self): ... do that crazy arm thing def meet_penny_and_brain_for_icecream(self): ... magic happens here if __name__ == '__main__': # a list for inspector objects ready to save the world inspector_list = list() inspector_list.append(InspectorGadget("Dr. Claw")) inspector_list.append(InspectorGadget("The Cuckoo Clockmaker")) for inspector in inspector_list: # get a list of the object's public methods methods = inspector.__class__.__dic__.keys() # iterate over the method list & call those that start with 'go_go_gadget' for method in methods: if method.startswith('go_go_gadget'): getattr(obj, method)() Ultimately I discarded this solution in favor of one that fits my problem better but it was definitely a fun digression. ...

March 22, 2010 · 1 min · Matt Brandt

Technical Interview

I’ve recently had the discomfort of being on the other end of the interview table, the side asking the questions. A couple of warm up questions that I’ve posed to would be candidates left me a bit surprised and underwhelmed. I should note that I personally hate interviews that the interviewer bases success solely on your ability to write the solution that they’re looking for. That said we’d recently gone through a very frustrating bout with a few contractors who claimed they loved to test but also have the handy ability of writing code. There resumes clearly stating that they were very qualified. The last bit we learned quite painfully was an over-exaggeration on their part. ...

November 11, 2009 · 3 min · Matt Brandt

Sort Stability

Sort Testing I’m futzing with an algorithm to test if a specific sort on a table of n columns and m rows occurs correctly. The problem domain is one where a table can have an infinite number of column headers (n) and an infinite number of sort criteria (n). The first sort criteria specifies the primary sort that the data will be ordered by, each additional sort criteria on the table data only takes effect if two adjacent row items share the same value. ...

September 16, 2009 · 4 min · Matt Brandt

Autobot - Test Harness

If we think of a working system as layers of abstractions, at what depth within that system should a test engineer consider exposing when targeting functional testing? Or more concisely are the trade-offs of touching a system at the lower places within the architecture valid arguments for lowering risk to an acceptable level? Is this creating too much overhead? Would an existing framework such as WebDriver be a sufficient wrapper for driving functional testing? ...

August 22, 2009 · 2 min · Matt Brandt