Pages

Thursday, March 27, 2008

.NET serializing object to XML and then converting to String

Code snippet:

What I wanted: I have a collection (dictionary) of custom objects and I wanted all of them to be logged using my logging method.

XmlSerializer xs = new XmlSerializer(typeof(CustomObject));

//enumerate through each key value pair and log them.
foreach(CustomObject csObj in this._CustomCollection)
{
//XML output to memory stream
MemoryStream ms = new MemoryStream();

//Serialize each node of the paragraph test
xs.Serialize(ms, csObj );

//Get the string from the memory stream buffer
UTF8Encoding encoding = new UTF8Encoding();
String myString = encoding.GetString(ms.GetBuffer());
myString .TrimStart();

//Call your logging mechanism
MyLog.WriteXml(myString);
}

Thursday, March 20, 2008

IE8 Beta with Google tool bar, a deadly combo

IE8 and Google tool bar simply doesn't gel well. Back to back there were crashes, IE tries to recover the page and Google fires it down again and again. If you are an extensive Google tool bar user, wait for updates on IE8.

Given that IE8 is in beta, these kind off stuff is expected esp. the interop with Google.

Friday, March 07, 2008

USB major versions = .NET major versions.

USB and .NET totally different domains, yet their release versions are similar so far.

Parallelism in versioning:
USB (versions) came out earlier than .NET (versions) and it's major versions are 1.0, 1.1, 2.0 and the proposed 3.0 standard. .NET on the other hand has the same major versions 1.0, 1.1, 2.0, 3.0.

Thursday, March 06, 2008

IT engineer

It is often happier to be in information technology(IT) than not to.

In any profession one needs to accumulate and assimilate (the two A's) things quicker, so that they can be demanding. IT demands much more to be demanding, you need to really know a lot of things in simple words.

'IT' is a pattern of several cohesive and non-cohesive ecosystems.
for example: Open source is a big ecosystem and Microsoft is another. Cohesiveness and Non-cohesiveness amongst the ecosystems are enforced based on the business/business model of the 'IT' companies. An year ago companies may be rivals, but the next year they could have diverged in to other areas by which they could have become partners. This is again a business game, it is not only technology that drives the business, but the other way is very true.

What is important for an 'IT' engineer is to understand where the business model would take each of the ecosystem, and decide where/when and where not/when not to be.
If one continues to embrace new technologies it might not help, if one continues to embrace the legacy it might not help either.

Watch out!!! for the next big wave. All I'm telling is, to be successful in 'IT' you must essentially understand the business and act accordingly

You need to be prepared, for a merger/acquisition/closure/opening heading you.

Be in 'IT' and be successful.