May 2005 - Posts
I’ve noticed some very weird behavior when comparing boxed value types, referenced as object. Consider the following code.
object a = "foo";
object b = "foo";
bool matchRefType = (a == b);
object x = 1;
object y = 1;
bool matchValueType = (x == y);
The first Boolean value will return true, as expected. However, the second will return false. What’s more, when running this code in Debug, the following statement returns as expected.
If I unbox the value types in code explicitly, the following statement will return true, which is the desired outcome.
bool matchValueType = ((int)x == (int)y);
The problem here is that the values I am comparing may be of any value type (or reference type for that matter.) I could use Reflection to perform a psuedo unboxing of the value types; however, this would still return a reference. I know it must be doable from code if the Command Window can do it :)
If you have come across this before, please share your much valued insight. Thanks!
I'm at San Jose Int'l Airport, and don't have much time to blog but wanted to provide a VERY brief recap.
Today was chock (sp) full of great content of BizTalk Server 2006, Indigo, WinFX and Avalon. There was also a good demo covering actual use of VSTS in 2005. I can't talk about much, but there are exciting things coming down the pipe. As soon as I get the time, I'll post some reference links provided by the speakers.
After messing up my wakeup call (my fault!) I made it downstairs just in time to catch the bus to the Microsoft Silicon Valley Conference Center in Mountain View, CA. Today's two keynotes, the first by Adam Denning provided, some great insight into the Platform Strategy for 2005 and beyond. Adam is a great speaker, and kept the high-level stuff entertaining for an audience of low-level-lowing Architects. Following some good sessions on Analysis Services in Yukon, a panel comprised of SI & ISV folks provided some insight into technology adoption and the benefits and pitfalls therein.
I'm really looking forward to tomorrow's sessions which cover new products such as BizTalk Server 2006, Indigo and Avalon. I'll post a report of Day 2 in the next day or two (although I think the NDA will bar me from providing the details of BTS 2006, Indigo and Avalon here.)
I can always count on Demain to find the funnies.
http://www.storewars.org/flash/index.html
I'm typing from the terminal at John Wayne Airport, waiting for my flight to the
Microsoft Web Region Partner Architect Formum (whew!) I getting excited about speaking at TechEd 2005 (as well as attending,) and event more excited to get a peek at the next versions of Commerce Server and BizTalk. I'll post more (where applicable, and not blocked by NDA) soon!
Just when you thought Web-based advertisters would go out of business!
http://j-walk.com/other/googlecb/
More Posts