Browsing 7239 questions and answers with Jon Skeet
+ is one of the regular base64 characters, used when the 6 bits being encoded have a value of 62. My guess is that you're putting this in the query parameter of a URL, where + is the escaped value of space. For that use case, you should... more 1/6/2016 3:03:26 PM
I don't even see how what I have written is a nested type You've declared your delegate type (PacketReceivedEventHandler) within your class. That's one type nested inside another. Just move the declaration outside your existing class... more 1/6/2016 2:17:35 PM
You're trying to mix query expression syntax with regular method calls, and you've ended up with something that isn't a complete query expression. You could use: listValues = from x in Enumerable.Range(0, 96) let ts = new... more 1/6/2016 1:51:02 PM
I suspect you just need to create an instance of the type and cast it to the interface that you're confident it implements: return (ILevel2) Activator.CreateInstance(myType); That will use the parameterless constructor, however - if you... more 1/6/2016 1:49:21 PM
Sure, with a small change: var option = widget.Options .Where(o => o.ExternalCode == widget.Selected) .Select(o => o.InternalCode) .FirstOrDefault() ?? ""; In other words,... more 1/6/2016 10:38:04 AM
Your value doesn't have a milliseconds component, so you want ISODateTimeFormat.dateTimeNoMillis(): Returns a formatter that combines a full date and time without millis, separated by a 'T' (yyyy-MM-dd'T'HH:mm:ssZZ). The dateTime()... more 1/6/2016 9:49:50 AM
Sounds entirely sensible to me. You're passing a negative number of milliseconds into the constructor - why would you expect that to become positive? A negative duration is simply a negative amount of time - the time from "now" to "some... more 1/6/2016 9:14:23 AM
Math.sqrt returns a double, even if the input is float. You can't convert double to Float (the wrapper type) other than explicitly going via float (the primitive type)... but that's okay, because you don't actually want Float. The return... more 1/6/2016 7:01:49 AM
This is the problem: string line = sr.ReadToEnd(); That isn't reading a line of data - it's reading the whole file in one go. Your clearPath method expects its parameter to be a single path, not a bunch of lines glued together. The... more 1/5/2016 8:19:53 PM
XML simply isn't designed for this sort of operation. Your options are probably: Live with the file being big Use multiple files instead Use some other persistence (non-XML files, or a database) instead Without knowing how big you mean... more 1/5/2016 7:11:14 PM