Monday, July 23, 2007

YouTube role grows as U.S. election nears

Candidate Forum on You Tube


Democratic U.S. presidential candidates (L-R) Hillary Clinton, John Edwards, Dennis Kucinich, Maurice Gravel, William Richardson, Barack Obama, Christopher Dodd and Joseph Biden take part in a candidates forum at the NAACP annual convention in Detroit, Michigan July 12, 2007. YouTube members are uploading video questions for upcoming CNN/YouTube debates.By yesterday evening, more than 1,700 videos had been put on YouTube's site for tnights debate among Democratic candidates. Now thats what i call Technology influencing Mankind.......or lets say influencing politics

Monday, July 02, 2007

IObjectReference interface.

Recently during my project i came across IObjectReference interface. We had a situation where we were serializing and deserializing an object. During this process, the object returned is the one which the serialized stream specifies. Here comes in the IObjectReference to save us!!!!It returns the real object that should be deserialized, rather than the object that the serialized stream specifies.

Here's an example showing how it can be used:

[Serializable]
class S : IObjectReference
{
int i;
static S S5 = new S(5);
S(int i) { this.i = i; }
public static S Get(int i) { return (i == 5) ? S5 : new S(i); }


#region IObjectReference Members
public object GetRealObject(StreamingContext context)
{
return Get(i);
}
#endregion
}