Browsing 7239 questions and answers with Jon Skeet
But could a synchronized object's reference also be changed by another thread B while thread A holds the lock for the same object? If you mean "could another thread change the value of the myTable variable, the answer is... more 1/30/2014 2:08:01 PM
New answer with edited question The problem is that your lambda expression isn't valid - you're trying to use collection initializer syntax, but your type isn't a collection. So instead of this: () => new t_user_audit {... more 1/30/2014 1:16:14 PM
From the C# 5 spec, section 3.5.3: When a protected instance member is accessed outside the program text of the class in which it is declared, and when a protected internal instance member is accessed outside the program text of the... more 1/30/2014 1:07:23 PM
Just use the overload of decimal.TryParse which takes an IFormatProvider, and specify the invariant culture. Then use that for formatting, too. (I'm assuming you want it to be treated consistently as "dot for the decimal separator" on both... more 1/30/2014 1:01:25 PM
The tutorial is just badly (horribly!) formatted - too many levels of HTML escaping. Someone didn't take nearly enough care over their post... It should look like this: private ArrayList<HashMap<String, String>> data; private... more 1/30/2014 12:31:54 PM
Yes, you can. At least, you may be able to. For example - having changed the method names to be more conventional, and using generic type inference for the method calls: private static Series GetBuysSeries(List<Order> buys) { ... more 1/30/2014 5:58:57 AM
Yes, TimeZoneInfo.ConvertTime handles daylight saving time, as best it can. However, note that if you're using a DateTime with a kind of "unspecified" (e.g. having parsed it from a string) that may be ambiguous in your source time zone.... more 1/30/2014 5:53:44 AM
I suspect you're looking for List.indexOf: int index = fib.indexOf(45); // index is now 3 indexOf returns -1 if the value isn't found in the list. Note that temp isn't a member of ArrayList, and if you use fib.get(4) it will return 50,... more 1/30/2014 5:41:42 AM
According to MSDN, the range of float is approximately -3.4 * 10^38 to +3.4 * 10^38 with 7 digits of precision. The above number, unless I'm completely missing something, is well within that range, and only has 6 digits after the... more 1/30/2014 3:44:17 AM
You're not using expected anywhere - not even making it part of the state of the class. Your assertion here: assertTrue(value == o.add(value, num)); ... is not asserting what you want it to. It's only going to work when num is 0. Look... more 1/29/2014 11:26:23 PM