Browsing 7239 questions and answers with Jon Skeet
decimal is implemented as a significand, sign and exponent, basically - a floating point number, where the "point" is a decimal point instead of a binary point (as per float and double). See my article on the topic for more details. (Note... more 11/8/2013 3:37:04 PM
There's a huge difference between a reference to an empty set, and a null reference. (Just like there's a huge different between a reference to the empty string, and a null reference.) It sounds like you should probably change your Site... more 11/8/2013 3:23:21 PM
Simply put, an integer doesn't have a number of leading zeroes. It doesn't even have information about whether it's decimal, hex, or anything like that. It's just an integer. If you really need to follow your existing design, I suggest... more 11/8/2013 2:57:14 PM
For a start both of these look wrong: for (int column = 0; column < array[row].length; column++); if (arrayelement%2 == 0) || (arrayelement%5 == 0); Here you're using a ; as the entire body of both the if statement and the for loop.... more 11/8/2013 2:48:45 PM
Why is it necessary to allocate an array that can hold the values of a collection and pass it to the toArray(T []) method of this collection? It isn't. You can do so if you want to, but equally you can just pass in an empty array.... more 11/8/2013 1:47:30 PM
You're never closing the input stream from the connection - that may mean that the connection isn't eligible for pooling, and on the next attempt it's waiting for up to a second to see if the previous request's connection will become... more 11/8/2013 1:45:08 PM
There's no good way of doing this - and it's fundamentally a bad design, IMO. If ClassA and ClassB want different things to happen, they should call different methods. The only time this is reasonable in my experience is when trying to... more 11/8/2013 1:29:06 PM
It depends on what you mean by "safe". If you're running with a security manager that allows this sort of thing, then yes, you can do all kinds of nasty things with reflection. But then in that kind of environment the library can probably... more 11/8/2013 10:25:23 AM
The simplest way to get the indentation level of a specific element is to see how many parent levels it has: int GetDepth(XElement element) { int depth = 0; while (element != null) { depth++; element =... more 11/8/2013 10:19:39 AM
Triangle is currently an inner class - which means you can only create it by also having an instance of the enclosing class. Simple options: Make Triangle a top-level (non-nested) class. Make it a static nested class Provide an instance... more 11/8/2013 10:12:38 AM