Browsing 7239 questions and answers with Jon Skeet
You're calling hashCode() on an array. Arrays don't override hashCode(), equals() or toString() - so you're getting a result which doesn't depend on the content of the array at all, and probably depends on where it happens to be in memory.... more 3/10/2016 6:53:47 AM
Why Unicode escapes doesn't behave as normal escape sequences? Basically, they're processed at a different point in reading the input - in lexing rather than parsing, if I've got my terminology right. They're not escape sequences in... more 3/9/2016 7:52:15 PM
It seems to me that you shouldn't be using a regular expression at all. Instead, construct a valid XML document be wrapping it all in a root element, then parse it and extract the elements you want. You also want to replace all CDATA... more 3/9/2016 4:41:31 PM
Just reverse the order of "specify date, specify time zone" to "specify time zone, specify date": Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC")); calendar.set(2014, 0, 1, 0, 0,... more 3/9/2016 12:39:43 PM
Note that there can be multiple dogs associated with the one Kennel. There are also many kennels. Currently there is nothing associated with an individual Kennel. The fact that all your variables are static means that they are... more 3/9/2016 10:40:21 AM
Well, to get from one XElement to its parent, you can just use the Parent property - but in this case you want all the ancestors, so you can use the AncestorsAndSelf() method. That returns the ancestors in reverse document order, but you... more 3/9/2016 6:51:13 AM
Well you need to decide whether these numbers are meant to be part of the state of your object or not. If they are, make them fields. If they're not, don't. In this case, I'd probably keep them as local variables and change your NumSelect... more 3/8/2016 7:08:35 AM
I think that both methods do the same. No, they don't. Because at execution time, the first code doesn't know the type of T due to type erasure. That means the cast basically does nothing within the method. The calling code might... more 3/8/2016 6:53:41 AM
If you want to use the index within your predicate instead of the value, use the overload of Where which accepts a predicate which checks a value/index pair: int[] a = b.Where((value, index) => index % 4 == (int) Cards.CardSuits.Club) ... more 3/7/2016 10:12:21 PM
But since my copy of source code is the same as my colleages as well as that of dev server, all controlled by SVN, how could it differ? Because the default system culture isn't defined in the source code. I very much doubt that you... more 3/7/2016 3:32:45 PM