Browsing 7239 questions and answers with Jon Skeet
When you use the erasure of a type, it removes all trace of generics - not just the uses of the type parameter T. So your generic variable acts as if it's referring to this type: // After type erasure public class Generic { private... more 10/24/2014 4:17:09 PM
To represent a date, you should use LocalDate rather than DateTime, ideally. So you want: var localNow = clock.Now.InZone(serverZone); var today = localNow.Date; If you must use DateTime, then your current code is fine. In Noda Time... more 10/24/2014 3:05:01 PM
Well, you're only populating fixedValues with as many values as are in inputStr: for(int j=0;j<inputStr.length;j++) { fixedvalues[j]=inputStr[j]; System.out.println("jii"+fixedvalues[j]); } You're then running over all 10... more 10/24/2014 2:59:05 PM
You've declared a local variable in the button_enter method. That variable is only available within the method. If you want that variable to be part of the start of the instance, you need to make it an instance variable, declared outside... more 10/24/2014 1:54:26 PM
To do something periodically, you should use a timer. If you want a timer which fires on the WPF UI thread, use DispatcherTimer - although the fact that you're downloading data suggests that you should either be doing that asynchronously,... more 10/24/2014 7:50:36 AM
You're using YYYY, which doesn't mean what you think it means. From the TR35-31 documentation, Y is the symbol for "year in week-of-year calendars". You want dd MMMM yyyy instead as your format string. Mixing week-of-year-based fields and... more 10/24/2014 7:22:24 AM
Your loop is just a tight loop - you're executing all the iterations in one go, basically, calling setRotation lots of times. I strongly suspect that all the calls to setRotation are being made... but you're not seeing anything but the... more 10/24/2014 6:20:38 AM
You're not trying to convert int to double; you're trying to convert int to Double, which is a combination of boxing and the implicit conversion from int to double. That doesn't work, even in a simple assignment: // Error: incompatible... more 10/23/2014 8:25:52 PM
The problem is that \a is being seen as an escape sequence (for "alert", U+007). The simplest approach is to use a verbatim string literal instead: @"Server=ABOODPC\aboodsrvr; Database=testDB1;Integrated Security=SSPI;" Alternatively,... more 10/23/2014 6:48:06 PM
This should print an exception with message "1" and with an inner exception, that has the message "3" No, it shouldn't - because you're not modifying the object that the exception variable refers to at all. Instead, you're declaring a... more 10/23/2014 2:49:49 PM