Browsing 7239 questions and answers with Jon Skeet
Does anybody know what could cause this error? I suspect total (or rather, total + 1000) has gone outside the range of the array - you'll get this error if you try to read more than 200K of data. Personally I'd approach it... more 11/28/2013 5:43:28 PM
My question here is why does the FileWriter variable need to be wrapped in a BufferedWriter. It doesn't have to be - but you may well get better performance if you do, so that you avoid going to disk as often. Also, you're using... more 11/28/2013 5:35:19 PM
You need to use Task<T> in order to use the Result property. Given the comments, it looks like you want: Task<List<SYSTEM>> t1 = ...; Task<List<ACTION>> t2 = ...; Task[] tasks = { t1, t2... more 11/28/2013 2:45:52 PM
The getter should be exposed to the base class and all its child classes. No, not quite. This isn't a matter of automatically implemented properties - it's a matter of what protected means. Access to a protected member within a... more 11/28/2013 1:32:12 PM
Is this allowed to work or just a bug? The code after you've edited the question (to call s0.TestNull() instead of null.TestNull() is meant to work, yes. Extension methods are just syntactic sugar for calling static methods as if... more 11/28/2013 12:53:50 PM
I would strongly suggest using Joda Time wherever possible, rather than Calendar and Date - it's a much cleaner date/time API. Beyond that, definitely make your object model match your domain as closely as possible. You're dealing with... more 11/28/2013 11:03:45 AM
You could try setting HttpClientHandler.PreAuthenticate as per Tobberoth's answer, although the documentation for that suggests it will only help after the very first request: With the exception of the first request, the... more 11/28/2013 7:22:55 AM
Why the three text nodes are coming over here ? They're the whitespace between the child elements. If you only want the child elements, you should just ignore nodes of other types: for (int i = 0;i < nList.getLength(); i++) { ... more 11/28/2013 7:08:16 AM
Under Window, Preferences, Java, Code Style, Organize Imports there's an option called "Number of static imports needed for .*" - set that to 1. (Another way to find it quickly is just to type "static" into the search box in... more 11/28/2013 7:02:32 AM
You can either use GroupBy as suggested by others, or you can just create a Lookup: var lookup = payments.ToLookup(payment => payment.PaymentDate.Date); You can iterate over that (using each group's key as the date) or fetch all the... more 11/27/2013 10:17:58 PM