Browsing 7239 questions and answers with Jon Skeet
You can just leave the class files in file system directories - but as normal, that directory hierarchy should match the package structure of the classes. Basically, an Ant classpath is just like a classpath in a normal Java tool - just... more 7/15/2014 4:14:02 PM
You can use Expression.Type to find out the static type of the expression. However, because you've got Expression<Func<T, object>> you've actually got a conversion expression around the property expression, so you need to... more 7/15/2014 12:32:32 PM
No, there's nothing that does that... but what you could do is create your own wrapper stream which maintains a reference to the original stream, and delegates all calls to it... modifying any Seek() or Position calls appropriately. You... more 7/15/2014 8:34:01 AM
How does it know that the variables refer to the same object? Because the values of the variables are the same references. (Your variables are t1 and t2. The values of those variables are references. Those references are used as a way... more 7/15/2014 8:01:31 AM
Well, you can do sidestep the rules using Interlocked.Increment: int i = 0; Expression<Func<bool>> expression = () => Interlocked.Increment(ref i) != 0; ... but I would be very cautious about doing so. I wouldn't expect... more 7/14/2014 6:16:34 PM
DateTime has a resolution down to ticks, even though by default they're only printed to seconds in most cultures. If you print dt1.ToString("o") and the same for dt2, you'll see that even if they're equal to the second, they may well vary... more 7/14/2014 5:45:42 PM
You can declare a field using an anonymous type initializer... you can't use implicit typing (var). So this works: using System; class Test { static object x = new { Name = "jon" }; public static void Main(string[] args) { ... more 7/14/2014 5:44:09 PM
If String were a mutable type, it simply couldn't be interned. There's no point in keeping a pool of objects if they can be mutated... you wouldn't be able to rely on what you got out of the pool being the string you were interested in (at... more 7/14/2014 5:35:08 PM
This has really nothing to do with XML - the fact that the value of the attribute is itself a semi-colon-separated list is irrelevant as far as XML is concerned. You'd have the same problem if you had the connection string on its own. You... more 7/14/2014 3:24:15 PM
You can't tell whether the current iteration is the last one. I suggest you use a StringBuilder instead of repeated string concatenation, then just trim the length at the end: StringBuilder builder = new StringBuilder(); for... more 7/14/2014 12:07:23 PM