Browsing 7239 questions and answers with Jon Skeet
Any numeric literal with a decimal point but no suffix is of type double. From the C# 5 specification, section 2.4.4.3: If no real-type-suffix is specified, the type of the real literal is double. Otherwise, the real type suffix... more 7/22/2015 7:09:14 PM
I suspect the problem isn't with File.WriteAllLines, but with Attachment - that implements IDisposable, but you're not disposing of it... so if that's got an open file handle on it, that would explain what you're seeing. You can just... more 7/22/2015 7:07:00 PM
Yes, absolutely. Just use it as an IDictionary<string, object> to populate: IDictionary<string, object> expando = new ExpandoObject(); expando["foo"] = "bar"; dynamic d = expando; Console.WriteLine(d.foo); // bar In your... more 7/22/2015 2:52:59 PM
You're requesting the TCPHandler bean here: context.getBean("TCPHandler") That isn't a ThreadPoolTaskExecutor, so I don't know why you expect it to be. If you want to retrieve the executor, you should be fetching that bean instead,... more 7/22/2015 10:52:38 AM
I'm using a couple of Strings in my code that are going to be reused within a loop No, you're not. You're using a few string variables that are going to be reused within the loop. The actual strings aren't. Here's the body of the loop... more 7/21/2015 7:25:02 PM
Use the -cp command line argument to add the jar file to your compile-time classpath. You'll need to specify the classpath when you run the code too. $ javac -cp /home/apps/cplex/12.6.1/cplex/lib/cplex.jar file.java $ java -cp... more 7/21/2015 3:18:23 PM
Sign extension is happening, but possibly not for the obvious reason, and not in a worrying way, IMO. This code: a |= (short) b; is equivalent to: // No warning here... (surprisingly, given that `a` is being sign-extended...) a =... more 7/21/2015 2:47:27 PM
If all you want to do is enumerate the values, you could test for the non-generic IEnumerable instead: object value = pi.GetValue(myc, null); IEnumerable enumerable = value as IEnumerable; if (enumerable != null) { foreach (object obj... more 7/21/2015 2:32:39 PM
Well it sounds like you should first find those files, then check whether or not there are any: var invalidFiles = directory.EnumerateFiles() .Where(file => !allowedCLEOFiles.Contains(file.Name)); ... more 7/21/2015 2:10:21 PM
No, not a variable as such - not with a regular CLR. (It would be possible to write a VM which did share variables across the network, but it would be quite unusual.) Instead, you'll need to establish some sort of protocol between the two... more 7/21/2015 6:13:17 AM