Browsing 7239 questions and answers with Jon Skeet
This isn't a matter of overload resolution - your method with the short parameter isn't even applicable. Here's an example: public class Test { public static void foo(short x) { } public static void main(String[]... more 9/16/2015 6:09:24 AM
I want the each item in the resulting list to have the Name and as many doubles as there are RawReads. You can't do that using anonymous types. Anonymous types have property names and types specified at compile-time whereas you're... more 9/15/2015 3:08:39 PM
You don't sort a Dictionary<,> at all. However, if you want to iterate over the entries (or keys) in a particular order, you can use LINQ's OrderBy - and to iterate a known set of values in that order, you can just have the ordered... more 9/15/2015 1:20:34 PM
You can't make List<T> covariant - it's invariant, and there's nothing you can do about that. You can't treat a List<Apple> as a List<Fruit> because you can't call list.Add(new Orange()) on it, for example. It seems to... more 9/15/2015 12:52:50 PM
There are a couple of problems here. Firstly, I believe you've got too many calls to Elements/Descendants so you're actually iterating over all the descendants of <CO_App_Table_CO_VERTRETERFTPLOGIN>. Next, you haven't specified the... more 9/15/2015 12:32:14 PM
You're replacing each Note element with a notedate element. The order in which you perform that replacement is irrelevant. It sounds like you actually want something like: var notes =... more 9/14/2015 10:06:26 AM
Okay, it sounds like you probably want a join so that you can identify pairs, then you can copy the regions: var query = from itemA in listA join itemB in listB on itemA.id equals itemB.id select new { itemA, itemB... more 9/14/2015 8:59:16 AM
You can't do that in a field initializer. You'd have to put it in a constructor: public class DeviceManager { private Dictionary<Device, Response> behaviours = new Dictionary<Device, Behaviour>(); public... more 9/14/2015 7:37:09 AM
Your file is in the jar file as resources/quartz.properties, not just quartz.properties - so that's how you need to load it: factory.initialize( ... more 9/14/2015 6:03:58 AM
Currently you're only using D:\ in your classpath: File file = new File("D:\\"); URI uri = file.toURI(); URL[] urls = new URL[] {uri.toURL} ClassLoader classloader = new URLClassLoader (urls); If you want to use a jar file, you should... more 9/14/2015 5:50:13 AM