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UgYWR2ZXJiIGZvcm1hbCBvciBhcmNoYWlj
IDEgZnJvbSB3aGF0IHBsYWNlIG9yIHNvdXJjZT8gMiBmcm9tCndoaWNoOyBmcm9tIHdoZXJlLiAz
IHRvIHRoZSBwbGFjZSBmcm9tIHdoaWNoLiA0IGFzIGEgY29uc2VxdWVuY2Ugb2YKd2hpY2guCgog
IJcgVVNBR0UgV2hlbmNlIG1lYW5zICdmcm9tIHdoYXQgcGxhY2UnLCBhcyBpbiB3aG8gYXJlIHlv
dSBhbmQgd2hlbmNlCmNvbWUgeW91PyBTdHJpY3RseSBzcGVha2luZywgdGhlIHByZXBvc2l0aW9u
IGZyb20sIGFzIGluIHRoZSBtdXNpYwpzdG9yZSBmcm9tIHdoZW5jZSB0aGUgbGFiZWwgd2FzIGxh
dW5jaGVkLCBpcyByZWR1bmRhbnQsIGJ1dApuZXZlcnRoZWxlc3MgZnJvbSB3aGVuY2UgaXMgdXN1
YWxseSBhY2NlcHRlZCBhcyBnb29kIEVuZ2xpc2guCgpMb29rcyBsaWtlIGJvdGggb2YgeW91IHdl
cmUgcmlnaHQgOikK


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf




More information about the Developers mailing list