You searched for jon skeet
. We found 71
results in 0.355 seconds.
Look at when you're calling execute - that's before you build the request properly! Just reorder your code so that you fully build the request, then you post it to get a response, then you use the response. (I'd also be personally... more
No, async just doesn't support that. The simplest option to fake it would be: public static async Task<T> Retry<T>(Func<Task<T>> action) { for (var i = 0; ; i++) { try { return... more
The reason is that the iterator block is always lazy. Unless you call GetEnumerator() and then MoveNext(), the code in the method won't get executed. In other words, consider this call to your "equivalent" method: var ignored =... more
Most of those characters simply aren't valid in XML 1.0 at all. Personally I wish that LINQ to XML would fail to produce a document that later it wouldn't be able to parse, but basically you should avoid them. I would also recommend... more
I think that both methods do the same. No, they don't. Because at execution time, the first code doesn't know the type of T due to type erasure. That means the cast basically does nothing within the method. The calling code might... more
If the other team has any required fields and you send messages to them without specifying those fields (or even explicitly specifying the default value, for primitives) then the other end will fail to receive the messages - they won't... more
The idea is that you make AreaComparer generic like this: public class AreaComparer<T> : IComparer<T> where T : IShape { public int Compare(T x, T y) { return x.Area.CompareTo(y.Area); } } Then when you... more
Shouldn't the value of j increase after each iteration? Nope. Your loop body is somewhat equivalent to this: int tmp1 = j; // Evaluate LHS of += int tmp2 = j; // Result of j++ is the value *before* the increment j++; j = tmp1 +... more
The compiler will treat directories on the classpath as source root directories - in other words, when trying to find classes for package com.example, it will look for both class and source files in a com/example subdirectory from each... more
If you're nervous that the compiler will optimize out the operator (although I doubt that it would ever do so) you could just call the Add method directly. Note that you don't need to add and then subtract - you can just add 0.000m. So for... more