Browsing 7239 questions and answers with Jon Skeet
Yes, it's entirely valid. This uses the pattern matching feature of C# 7, which is available with is expressions and switch/case statements. (The fact that it requires C# 7 is why it isn't working for you in VS2015.) For example: // Type... more 4/8/2017 2:19:42 PM
The value this returns is -1 while it should be returning 59. No, it's behaving exactly as documented by IDbCommand.ExecuteNonQuery: For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by... more 4/8/2017 8:59:57 AM
I would start by converting everything into a more useful object model: Get rid of all the strings (i.e. convert from strings to something more useful early on) Instead of having two collections, create a new type indicating "a date/time... more 4/8/2017 7:37:10 AM
Where to look for source of truth? The IANA time zone database is the best source I'm aware of, and that's what Noda Time uses. If you want to see what the results of that are and have been over time, the tzvalidate page has a list... more 4/7/2017 12:46:22 PM
XmlNodeType is an enum. XmlNodeType.Text is a value, not a type, but you're trying to use it as the type of the aa variable. Furthermore ReaderInnerXml() returns a string, so it's not clear how you expect to iterate over it. Do you have... more 4/7/2017 8:52:37 AM
That's like asking for 2017-04-28T19:54:44 to be parsed as a LocalDate - there's extra information that we'd silently be dropping. Fundamentally, your conversion from Instant to String in Java is "adding" information which isn't really... more 4/7/2017 8:48:24 AM
There's a big difference between the character for "the decimal digit 0" which is U+0030... and U+0000, the null character, which is a control character and so has no printed output. You're printing out the latter, so I wouldn't expect to... more 4/6/2017 10:08:27 PM
Here's how I'd do it, setting both the scopes and the new user at the same time via the ServiceAccountCredential.Initializer: ServiceAccountCredential original = (ServiceAccountCredential) ... more 4/6/2017 1:18:18 PM
This has only become feasible in C# 7, using ref locals: public class Program { public static void Main(string[] args) { int[] t = {1, 2, 3}; ref int a = ref t[0]; a += 10; ... more 4/6/2017 12:59:35 PM
How can i solve this problem? Well you could avoid creating mutable structs and exposing public fields, to start with. That's where the problem is coming from. Your code is effectively: Color tmp = mySurface[x, y]; // Take a copy... more 4/6/2017 12:10:38 PM