Browsing 7239 questions and answers with Jon Skeet
The documentation for A1 notation (which is what the range is expressed in) includes: Sheet1 refers to all the cells in Sheet1. So if you really want all the cells, just use that, without a trailing !. If you want to find out the... more 11/21/2017 7:32:03 AM
Assuming we're talking about a C# compiler which targets the Common Language Infrastructure (CLI), as almost everything does, it basically uses the primitive types exposed by the CLI. There are effectively three levels of support to... more 11/20/2017 8:12:56 AM
They've always been in C# and .NET, right from version 1.0. more 11/18/2017 8:52:02 AM
If you hadn't cast to byte, all would be well. There are no shift operators defined for byte, so the value is first promoted to int - which is fine, and still 0000[...]1111. You then shift left 4 bits, giving 0000[...]111000. You then... more 11/17/2017 6:29:05 PM
Convert.ToDecimal will use the currently executing thread's culture - and my guess is that in your case, that's a culture that uses , as the decimal separator rather than .. You just need to specify the right culture - which is often the... more 11/17/2017 3:35:19 PM
Modifying a lazily-evaluated query while iterating over it is basically dangerous. Two options: Use the Remove extension method. Less code, and it'll work! Replace your whole loop with: assessment.Remove(); Evaluate the query before... more 11/17/2017 3:27:11 PM
It looks like Decoder has your back here, in particular with the somewhat huge Convert method. I think you'd want: var decoder = Encoding.UTF8.GetDecoder(); var chars = new char[4]; decoder.Convert(bytes, 0, bytes.Length, chars, 0,... more 11/17/2017 2:19:02 PM
In this case, you can use the fact that LINQ to XML ignores null values on construction. Create a small local method that takes an element name and the value, and returns either an element or null: private XElement CreateWhereElement() { ... more 11/17/2017 1:57:41 PM
Currently, you're creating a specific ZonedDateTime pattern - but you're not actually telling Json.NET about that pattern anywhere. If this is the only Noda Time type that you need to use, I'd advise that you don't call... more 11/17/2017 8:46:01 AM
It sounds like you're nearly there. You presumably want the OffsetDateTime or LocalDateTime, which you'd get like this: var now = SystemClock.Instance.GetCurrentInstant(); var zoneInterval = zone.GetZoneInterval(now); var offset =... more 11/16/2017 8:29:56 PM