Dragons in the Algorithm
Adventures in Programming
by Michael Chermside

Category: Programming

When to Wrap a Library

I find that this comes up fairly frequently. You find some useful library: perhaps it does logging, or enforces design-by-contract, or it provides an API for calling web services. But someone on the team suggests that instead of using the library directly, we should create a wrapper: "that way, if …

Read more

Posted Sun 03 July 2011 by mcherm in Programming

Wrong SAAJ Version - a Spring bug

A few notes on a bug I had so next time I won't make the same mistake.

In spring-ws, in the class org.springframework.ws.soap.saaj.SaajSoapMessage, in the method getImplementation(), it uses SaajUtils.getSaajVersion(SOAPMessage) to determine the SAAJ version of this message. Unfortunately, that has a bug …

Read more

Posted Sun 08 May 2011 by mcherm in Programming

Eric Lippert Tree Challenge

In his blog, Eric Lippert issued an interesting programming challenge. (Follow the link for details of the requirements.) Here is my solution.

# Programming challenge from
#  http://blogs.msdn.com/b/ericlippert/archive/2010/09/09/old-school-tree-display.aspx
# Done in Python, by Michael Chermside

import unittest
import itertools

# ============== Provided Problem ==============
class …

Read more

Posted Thu 09 September 2010 by mcherm in Programming

Error message was '3'.

Just a brief entry so the NEXT time this happens I can search and find the solution.Once before I had this problem, but I couldn't remember the solution so this time I am writing it down. We (a Profile developer and I) were adding a new MRPC. When I …

Read more

Posted Fri 20 August 2010 by mcherm in Programming