Browsing 7239 questions and answers with Jon Skeet
Yes - you're reading them in little-endian format (the first value is the least important) but you're writing them in big-endian format (the first value is the most important), assuming you're writing a then b. Just reverse the order when... more 2/14/2017 10:13:16 AM
Someone knows why? Yes, because that's what the language specification says to do. The query expression translation is all in section 7.16.2 of the C# 5 specification. Section 7.16.2.5 explains why your initial example is incorrect... more 2/13/2017 12:48:00 PM
Well not with quite that syntax, but you can just use: theSum += aFunction(aList[i]); I suppose you could write an extension method for this, but the above is more idiomatic. In fact, using LINQ to start with would be more idiomatic -... more 2/12/2017 7:34:36 PM
with some of its properties encrypted in byte array format I suspect you don't actually mean "encrypted" here. You're just representing the bytes as text - I don't see any encryption. If they really are encrypted as well, that's a... more 2/11/2017 8:46:04 AM
Your list of characters to preserve includes #-', which is a range from Unicode U+0023 (the # symbol) to U+0027 (the ' symbol), including $ (U+0024). If you meant #-' to be interpreted as a list of three characters, just escape it: test... more 2/10/2017 8:17:18 PM
Looking at the ParseTests source code, it looks like it's so that you can have JSON like this: { "date": new Date(2017, 2, 10) } ... which isn't actually valid JSON, but may be common in the wild. more 2/10/2017 11:36:55 AM
Well presumably OnTestInitialize is currently being called once per test, but you want UriParser.Register to be called once in total. That's the sort of thing that makes sense to do in a static initializer, which is guaranteed to be run... more 2/10/2017 7:11:49 AM
If you want to make sure CsvHelper always uses one particular culture, you can set it explicitly: csv.Configuration.CultureInfo = auCulture; You should bear in mind, however, that a DateTime doesn't "store" a format - so once you've... more 2/9/2017 2:47:34 PM
It seems to me that Type.IsAssignableFrom is your friend here. You want types that aren't assignable from any of the other types in the set: using System; using System.Collections.Generic; using System.Linq; class Program { static... more 2/9/2017 12:17:47 PM
Given that an inner class has a field with reference to an instance of the enclosing class, I don't see how it could be loaded without loading the enclosing class. A static nested class may well be different, as that's genuinely... more 2/8/2017 12:01:47 PM