| Servergeek |
| Mickey Williams' weblog |
|
My C# BookMicrosoft Press PageOn Amazon Racing LinksSlalomSkateboarder.comNCDSA slalom page 3dm Ick Sticks Pocket Pistols .NETScott GuthrieRob Howard .NET Notes BradA LonghornScobleChris Sells ServicesDon BoxChristian Weyer All Things Distributed Ingo Rammer Tim Ewald BlawgsBag and BaggageSCOTUS Blog EconArg MaxCapital Spectator OtherWilliam Gibson |
Thursday, May 20, 2004
SpeC#Posted 12:58 PMComing up on May 31st is the .NET Technologies conference in Pilsen. Earlier in the year I was hoping to get over to attend the conference but the work schedule has since exploded to the point that I hardly have time to think about places I had intended to visit. The conference features keynotes from both Rustan Leino (from MS Research) and Bertrand Meyer, and there are a number of exciting talks, including Rustan's presentation of SpeC#, a version of C# that includes support for Design by Contract. I met Rustan the last time I was in Redmond - he may be part of the vast underground Eiffel conspiracy. Okay, maybe not so vast. BTW, Rustan has a great page of math and logic-oriented puzzles, if you're into that sort of thing.
Several (1.0 and 1.1) Ways to Serialize a Thing With XMLPosted 12:53 PMLately, it seems like I get asked once a day, "How do I XML serialize an object into a {string|stream|XmlTextReader|etc.}". So I came up with several different ways to serialize an arbitrary object, and I'm putting them up here so that I'll be able to find them later. Arbitrary object to string
static string SerializeThingToXmlString(object thing)
{
StringWriter stringWriter = new StringWriter();
XmlSerializer serializer = new XmlSerializer(thing.GetType());
serializer.Serialize(stringWriter, thing);
return stringWriter.ToString();
}
Arbitrary object to XmlTextReader
static XmlTextReader SerializeThingToXmlTextReader(object thing)
{
MemoryStream ms = new MemoryStream();
XmlSerializer serializer = new XmlSerializer(thing.GetType());
serializer.Serialize(ms, thing);
ms.Seek(0, SeekOrigin.Begin);
return new XmlTextReader(ms);
}
Arbitrary object to XmlDocument
static XmlDocument SerializeThingToXmlDocument(object thing)
{
XmlTextReader reader = SerializeThingToXmlTextReader(thing);
XmlDocument doc = new XmlDocument();
doc.Load(reader);
return doc;
}
Tuesday, May 18, 2004
Extracting Roman's BrainPosted 1:10 PMI'm consulting with Roman Kiss on some plumbing and service layerwork for a company on the financial end of the real-estate business. One of the things that Roman's working on in his spare time is spelunking the Indigo stack. This week, I was looking at some of the work that Roman had done, and instead of trying to copy the different source and project files, I just
WS-I Releases Basic Security Profile WDPosted 1:05 PMWS-I has just released the basic security security profile working draft, and it's full of interesting sharp edges in the security/interop space. Go there now...
|