Browsing 7239 questions and answers with Jon Skeet
When you return output from ZipObject, that stream is at the end - you've just written the data. You need to "rewind" it so that the data can then be read. Imagine you had a video cassette, and had just recorded a program - you'd need to... more 9/26/2013 12:29:20 PM
This is incorrect: Class.forName("Driver").newInstance(); That's trying to find a class called Driver in the default package. You potentially want: Class.forName(driver).newInstance(); ... but even that shouldn't be required: Just... more 9/26/2013 12:14:25 PM
Firstly, please don't use Thread objects like this. Thread uses wait and notify itself, so you can easily end up with confusing signals. The reason you're not seeing "waiting done" until the end is that although ThreadB.run calls... more 9/26/2013 10:41:00 AM
No - at least not sensibly. async is just a source code annotation to tell the C# compiler that you really want an asynchronous function/anonymous function. You could fetch the MethodInfo for the delegate and check whether it has an... more 9/26/2013 9:16:33 AM
I'm assuming that both totrecords and grdPages.PageSize are of type int. Therefore, regardless of the type of dblpagecount, you'll end up with the division being performed in integer arithmetic, which truncates towards 0. However, I... more 9/26/2013 8:16:17 AM
You're sorting it in ascending order, rather than descending... but your test requires that the highest scoring player is first. This should work: // Use the overload taking a Comparer<Player> delegate for... more 9/26/2013 7:45:44 AM
How can I get the two languages? By asking for the LANGUAGE elements instead of LANGUAGES - after all, there is only one LANGUAGES element. So something like this: NodeList nl =... more 9/26/2013 7:43:35 AM
When I try to do that I get a constant value compile-time error. You'd actually be okay if you used the L suffix to force it to be a long literal - but it's still not ideal to have to specify them all manually. (It's not "obviously... more 9/26/2013 7:21:34 AM
My question is in what way the event keyword makes the stock more robust? It's all a matter of what clients outside the class can do. If this were just a public field, then anyone could: Call all existing handlers... more 9/26/2013 6:46:59 AM
Chances are you'tr not reading the file correctly to start with. You haven't shown how you're reading the file, but my guess is that you're just using FileReader, or an InputStreamReader without specifying the encoding. In that case, the... more 9/25/2013 10:51:24 PM