Browsing 7239 questions and answers with Jon Skeet
There are two difficulties with this: You'd need to work out how the formatting is performed in both of these cases, and see how you can customize it, e.g. by specifying a different culture or a formatting delegate The Persian calendar... more 11/6/2014 7:41:07 AM
You need to use the return value of add, because BigDecimal is immutable. So you want: total = total.add(refund.getAmountPayable()); (Personally I think this would have been more obvious if the method had been called plus rather than... more 11/6/2014 7:06:15 AM
TCP is a stream protocol. You don't send "packages" - you send a stream of data, and receive a stream of data. The fact that the data is broken up into packets behind the scenes is a low-level implementation detail of the NetworkStream... more 11/5/2014 5:51:53 PM
It's specified in ECMA 335 (CLI), partition II, section II.10.1.2: explicit: The layout of the fields is explicitly provided (§II.10.7). However, a generic type shall not have explicit layout. You can imagine how it could be awkward... more 11/4/2014 10:29:22 PM
Same way as for any other array - you use the length field: int length = arr.length; // 5 From the JLS section 10.7: The members of an array type are all of the following: The public final field length, which contains the... more 11/4/2014 7:13:15 PM
Usually when you use 'using SpaceA;' you can access all elements without typing SpaceA. Only the direct types which are members of SpaceA. A namespace-or-type-name is never resolved using a namespace in a normal using directive and... more 11/4/2014 6:59:07 PM
Sounds like you want Delegate.CreateDelegate. Specify the method name and the type, find the method with reflection (once) and then create a delegate from it. You could potentially do that within the attribute constructor, although I... more 11/4/2014 6:15:57 PM
You're only going to get a deadlock if one of your threads obtains one monitor and the other thread obtains the other monitor before the first thread obtains the second monitor. The more threads you have obtaining the monitors on the two... more 11/4/2014 5:32:54 PM
It sounds like all you need is a call to First() or Single() or whatever - to say that you only want one result (the first or only result - other options are available): Ping ping =... more 11/4/2014 5:05:18 PM
The difference is that you're changing the value of the input variable, rather than the contents of the object that the variable refers to... so digits still refers to the original collection. Compare that with this... more 11/4/2014 3:48:38 PM