Browsing 7239 questions and answers with Jon Skeet
You should specify the same namespace URI for your nested elements: elemField.setXmlName(new javax.xml.namespace.QName("http://myNamespace", "DestinationIdsInfo")) (Ditto for... more 9/25/2013 12:22:08 PM
Can somebody explain why this happens As you said, it's using your default locale. Print Locale.getDefault() to check what your default locale is. Note that Float.parseFloat is not locale-specific. and how can I make the Scanner... more 9/25/2013 9:47:08 AM
There's no reason why there should be an error. k is documentedin SimpleDateFormat as a field for: Hour in day (1-24) That explains why you get 24 for midnight instead of 00, too. If you don't want values between 01 and 24, don't use... more 9/25/2013 6:25:29 AM
My guess is that your field is of either a primitive type or String, and is initialized with a compile-time constant expression. For static final fields initialized with a constant expression (and only such fields) - any code which refers... more 9/25/2013 6:10:49 AM
If the higher priority thread is waiting for a lock, regardless of which thread owns the lock, it won't be scheduled. If the higher priority thread isn't waiting for anything, then it may preempt a lower priority thread. None of this is... more 9/25/2013 5:53:11 AM
No, it's not thread-safe. Imagine it's called twice at the same time with the same ID, which isn't previously present. Both threads would get as far as RetrieveUser, and they'd both call _users.Add(id, u). The second call would fail... more 9/24/2013 10:00:16 PM
It sounds to me like it's as simple as: DateTime currentDate = DateTime.Now; if (currentDate.DayOfWeek == DayOfWeek.Monday && currentDate.Hour >= 8) { runLoop = false; } more 9/24/2013 9:58:34 PM
This is the problem (I suspect, anyway - it's certainly a problem): numbers.TrimEnd(numbers[numbers.Length - 1]); Strings are immutable in .NET. TrimEnd doesn't change the existing string - it returns a reference to a new one. As... more 9/24/2013 9:42:50 PM
The name of the element isn't folder... that's the value of the key attribute. Also note that as you've used XElement.Load, the element is the configuration element - asking for Elements("configuration") will give you an empty collection.... more 9/24/2013 7:57:06 PM
The condition in a for loop is the condition which has to keep being true in order to go into the loop body. So this: for (int height = bar; height == 0; height--) should be: for (int height = bar; height >= 0;... more 9/24/2013 7:15:01 PM