Browsing 7239 questions and answers with Jon Skeet
Just mask and shift. You've already got a comment describing the format: // Message identifiers are constructed: // Unit Type Bit 8-10 // Board ID Bit 5-7 // Unit Specific Message Ids Bit... more 3/11/2015 6:59:53 AM
Two obvious ways: Take a normal shuffle method, and change it to modify both lists at the same time Transform the two lists into a single joint list, shuffle that, then split them again The second sounds cleaner to me. You'd use... more 3/10/2015 8:55:21 PM
Just create a new named class extending or implementing Filter (depending on whether it's an interface or a class). Make it a nested class if you don't need it elsewhere. For single-method interfaces, normally a delegate is the simplest... more 3/10/2015 6:43:54 PM
Yes, because you're projecting to an anonymous type: .Select(x => new { x.Id, x.Product, x.Term }) It sounds like you want to use an object initializer for the BrokerOutright type: .Select(x => new BrokerOutright { ... more 3/10/2015 5:54:43 PM
Personally, I'd use InternalsVisibleTo in order to make the method visible to your test code, but if you do want to use PrivateType, I'd expect you to be able to just create an object[] which you keep a reference to, pass it into... more 3/10/2015 5:35:17 PM
I'm not sure there is any format that can handle this. The problem is that "H" can be either one digit or two, so if there are two digits available, it will grab both - in this case parsing it as hour 91, which is clearly... more 3/10/2015 2:21:30 PM
If you mean in terms of IsTempTooHigh, that's fine (although the condition is the wrong way round for the name). It's entirely valid to refer to one property within another, although you need to be careful that you don't make it recursive.... more 3/10/2015 2:07:15 PM
What's the encoding method used by the razor? Well that just looks like Base64 to me: byte[] x = {0, 0, 0, 0, 0, 1, 159, 44}; Console.WriteLine(Convert.ToBase64String(x)); Output: AAAAAAABnyw= You can go the other way with... more 3/10/2015 12:29:55 PM
An empty array can never have any content. Once an array has been created, its size is fixed - you can change the content of the elements, but you can't change how many elements it has. See the Java arrays tutorial for more... more 3/10/2015 12:13:34 PM
Duration can only handle fixed-length periods, such as "hours", "minutes", "seconds", "days" (where it assumes exactly 24 hours per day). You can't use "months" with Duration, because a month varies in length. Period - the other common... more 3/10/2015 12:05:11 PM