Browsing 7239 questions and answers with Jon Skeet
You could use IdentityHashMap and just ignore the values (the keys will form a set). There are various implementations of IdentityHashSet available online, too. You could use Guava, for example, with... more 12/31/2013 6:38:46 PM
Given two interfaces, I want to declare a variable that holds a reference to any object of a class that implements both interfaces Unfortunately you can't do that. You can do so for a parameter in a generic method, like this: public... more 12/31/2013 5:19:58 PM
The problem is that the dll is in my debug directory. Don't do that then. I would suggest you create a lib directory or something like that, and add a reference to the library from there. By default, that will copy it when you build... more 12/31/2013 5:14:50 PM
I wonder if I delete App.config file, then copy my application to other pc, is it have any strange behavior? Nope, it should be fine. There are various (somewhat tortuous) rules about exactly what version of the CLR etc gets used in... more 12/31/2013 4:30:22 PM
This part: select s.Book is selecting just the book (title) part of the record. You can't get back from that to the ID... there can easily be multiple IDs for the same title, as per your sample data. It's not clear what you'd want that... more 12/31/2013 4:19:37 PM
Why is there a bunch of 3F ? Why can't I get 80, 81 ... after 7F ? Because your character array contains non-ASCII characters. Charset.encode is encoding those as 3F (ASCII for '?') to represent the fact that they're not in... more 12/31/2013 3:55:36 PM
You're creating a task but never starting it, so it's never completing. However, don't just start the task - instead, change to using Task.FromResult<TResult> which will give you a task which has already... more 12/31/2013 3:47:55 PM
You can create one array with all the options, and then just copy as many as you need: // This declaration could be for a private static readonly variable, given that // you won't change the contents string[] allBoxes = { "Blue box", "Red... more 12/31/2013 10:43:46 AM
You won't get non-XML comments anyway - they're never part of the result of compilation. However, you can generate the XML documentation file using the CompilerOptions property to just pass a command-line parameter to the... more 12/31/2013 9:08:00 AM
You're actually trying to rely on several different things here. Firstly, there's the matter of atomicity. ECMA-335 states: A conforming CLI shall guarantee that read and write access to properly aligned memory locations no larger... more 12/31/2013 8:41:36 AM