Browsing 7239 questions and answers with Jon Skeet
The value of query will just be the query - until you try to evaluate the results, nothing knows whether or not there are any. After that, I suspect that LINQ to SQL will cache the results - but it's still conceptually just a query. If... more 4/11/2014 1:56:36 AM
await is basically a shorthand for the continuation, by default using the same synchronization context for the continuation. For very simple examples like yours, there's not much benefit in using await - although the wrapping and... more 4/10/2014 7:46:08 PM
I'm pretty certain this is showing the effects of memory locality (various levels of caching) and alos object allocation. To verify this, I took three steps: Improve the benchmarking to avoid unnecessary parts and to garbage collect... more 4/10/2014 4:47:30 PM
You've got two different Node<T> classes - one as an inner class of BinarySearchTree and one as an inner class of HashTreeSet. They're completely different classes, so your override is trying to return an unrelated type to the return... more 4/10/2014 2:24:16 PM
As soon as this executes, the sr.str value becomes null and same with is.characterInputStream.str. This seems odd to me, is this expected? Yes, I'd say so. DocumentBuilder.parse is closing the reader. StringReader.close() sets str to... more 4/10/2014 2:13:59 PM
There are eight interesting values involved here (four for each type). Their exact values are: Double values 1.03d: 1.0300000000000000266453525910037569701671600341796875 0.42d: ... more 4/10/2014 1:08:31 PM
As per the documentation for Convert.ToString(double, IFormatProvider): This implementation is identical to Double.ToString(IFormatProvider) ... which is then documented as: The ToString(IFormatProvider) method formats a Double... more 4/10/2014 12:58:05 PM
i want to read for the 44th character of each line to the end of the line Then just call String.substring(int): String temp = line.substring(44); I strongly suspect the issue with your current code is that it's expecting to get 2... more 4/10/2014 12:20:42 PM
You don't, basically. If you want to use enums in a switch, you should parse the string value to an enum value, and then switch on that. If the value may not be in the enum, consider creating a Map<String, EnumType> so that you can... more 4/10/2014 6:23:35 AM
You can't. An optional parameter's default value is stored in IL as a constant. "The current directory" is not a constant, so it can't be used as a default value. The closest you can easily come is to make the optional value null, and use... more 4/9/2014 7:26:20 PM