Python Rocks! and other rants 2004/6
Weblog of Kent S Johnson

2004-06-29

StranglerApplication

Martin Fowler has written an interesting note about how to replace a legacy application with something new. He suggests adding new functionality around the old application until you finally take over all the old functions. He calls this a StranglerApplication.

The most interesting part of the note is the pointer to a paper describing a specific project. Parts of this project are similar to what I did with Meccano:

  • Work closely with the users
  • Find ways to build confidence in the agile approach
  • Deliver real value as early as possible
  • Let the customers try out the new product and get them hooked on it
posted at 08:18:08    #    comment []    trackback []
 
2004-06-24

Eclipse Preannouncement

You have probably seen the announcement that Eclipse 3.0 Final has been released. What you may have missed is the last line of the announcement: "Distributions of Eclipse 3.0 will be available by June 30 for download from http://www.eclipse.org."

In other words, they pre-announced the release! I don't think I've seen anything like this from an open-source project before - usually the release announcement accompanies the actual release.

posted at 07:35:28    #    comment []    trackback []
 
2004-06-16

Python fashion statement

Did you know that you can buy a genuine python-skin bracelet? Here is one with a gold snake as well. According to the web site it is "sure to leave friends whispering!" I don't doubt that!

posted at 12:02:08    #    comment []    trackback []
 

Fun with difflib

I recently needed to show changes in the ordering of two lists in a way that makes sense to a person. Python's difflib makes this ridiculously easy. This little snippet does the trick:

import difflib

def showDiffs(old, new):
  
''' Show differences between two lists '''

  
# Get the diffs
  
diffs = difflib.SequenceMatcher(None, old, new).get_matching_blocks()

  
rowFormat = '%-10s  %s'
  
oldCurrent = newCurrent = 0

  
for oldIx, newIx, count in diffs:
      
# Catch up the output to the current diff position
      
while oldCurrent < oldIx:
          
print rowFormat % (old[oldCurrent], '')
          
oldCurrent += 1

      
while newCurrent < newIx:
          
print rowFormat % ('', new[newCurrent])
          
newCurrent += 1

      
# Write the common sequence
      
for i in range(count):
          
print rowFormat % (old[oldIx+i], new[newIx+i])

      
# Update current locations
      
oldCurrent = oldIx + count
      
newCurrent = newIx + count

Now showDiffs( [1,3,2,4], [1,2,3,4] ) prints out

1           1
            2
3           3
2           
4           4

Sweet!

This post references topics: python
posted at 11:40:48    #    comment []    trackback []
June 2004
MoTuWeThFrSaSu
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
282930    
Apr
2004
 Jul
2004

Comments about life, the universe and Python, from the imagination of Kent S Johnson.

XML-Image Letterimage

BlogRoll

© 2004, Kent Johnson