RSS 2.0 Feed
2004-09 Entries
摘要:  A dedicated QA has been testing one of my application during the past few days. The good news is that fortunately, I'm still a qualified developer: the program design is solid, there is no design flaw and there is no data damage under exceptional conditions. The bad part is, I didn't pay enough attention to those details that I should have paid attention to. Here is a list of things, check how many of them are in your program: While using strtol or _strtoi64 to convert a user input string to numeric value, it returns the largest possible value when the number......[阅读全文]

posted @ | Feedback (9) | Filed Under [ 乱谈 ]

摘要:  I have been thinking about the notion of “Weak Delegate” for a long time. For those who don't want to remove (-=) the delegate everytime, here is a thorough description about the potential memory leak problem and the solution and sample code by Greg Schechter.  And here is a generic version by Ian Griffiths.  Be advised: Weak Delegate or not, A Memory Leak is a memory leak. You should ALWAYS remember to remove the eventhandler once the listener is out of scope....[阅读全文]

posted @ | Feedback (11) | Filed Under [ .NET ]

摘要:  A question pops up from the forum regarding the const correctness in C++: “Why don't we have it in C#?”  In C++, if a method is declared like this:                class MyClass {                       void foo() const;               };  It implies that the author claims that the method won't change any internal data of MyClass object. It's a very handy way to allow compiler to check the semantics of your program. In C#, however, we don't have any corresponding constructs. An explanation from Anders Hejlsberg can be found here (Check out the immutable section).   My understanding of the problem is......[阅读全文]

posted @ | Feedback (10) | Filed Under [ .NET ]

摘要:Some pictures I took during the trip to Washington state....[阅读全文]

posted @ | Feedback (9) | Filed Under [ 乱谈 ]