Browsing 7239 questions and answers with Jon Skeet
It turns out that await can throw AggregateException, though, which is not documented behavior. No, that's the behaviour when the first nested exception is an AggregateException. Basically, when you call... more 2/15/2016 4:03:55 PM
It seems to me that you need to separate the base64 part, which is only needed in your HTML, from fetching the data from the response. Just fetch the data from the URL as binary data and convert that to base64. Using HttpClient makes this... more 2/15/2016 10:17:23 AM
It means you can easily chain calls together: sb.Append("Foo=").Append(foo).Append("&Bar=").Append(bar); ... instead of using several separate... more 2/15/2016 10:03:50 AM
is this the scenario where I HAVE TO use Selector and ServerSocketChannel? Nope. A more common solution is to have one thread per client - when you accept a call, create a new thread (or use an existing one from a thread-pool) and use... more 2/14/2016 2:12:25 PM
As List<T> implements the non-generic ICollection interface, you can cast to that: var results = users.Select(x => x.GetPropertyValue(prop)) .Cast<ICollection>() .Where(list =>... more 2/13/2016 4:14:27 PM
I would suggest making your method accept a CancellationToken that you can then pass onto the GetAsync and ReadAsStringAsync methods. You can easily create a cancellation token which will expire after a certain time: var cts = new... more 2/12/2016 2:53:00 PM
In C# 5 and beyond, the foreach loop declares a separate i variable for each iteration of the loop. So each closure captures a separate variable, and you see the expected results. In the for loop, you only have a single i variable, which... more 2/12/2016 2:46:13 PM
Rather than using it as an Object[] (which it isn't), use the System.Array API: var dictionary = new Dictionary<string, string>(); // For example Array array = (Array) data; for (int i = 0; i < array.GetLength(0); i++) { ... more 2/12/2016 11:34:13 AM
You retain the IDisposable that was returned by Subscribe, and call Dispose on it. There may well be a way of integrating the Rx IDisposable-based unsubscription with CancellationToken out of the box, but just calling Dispose would be a... more 2/12/2016 11:24:07 AM
The problem is what you've done with the library, basically. You don't need to make it a library - you just download it as a jar file and put that in your classpath. It looks like you've included the source, but you haven't included the... more 2/11/2016 9:51:01 PM