Browsing 7239 questions and answers with Jon Skeet
Why am I encountering this when I built the code in my solution without fail? Because you're rebuilding your BL project as well, presumably. That's fine - the method still exists by name, and the new parameter type is presuambly... more 10/20/2016 3:04:01 PM
You're not flushing the BufferedOutputStream - so it's buffering all your data. You should flush that, not the ServletOutputStream. However, if you're only writing a single byte array, there's no point in using BufferedOutputStream anyway... more 10/20/2016 12:21:27 PM
I'd probably try to stream the whole thing, maintaining a buffer of "current non-negative numbers" and a count of negative numbers. Here's some code which appears to work... I'd expect it to be at least pretty efficient. I'd start with... more 10/20/2016 12:09:30 PM
A slightly alternative approach to the one given by Niyoko: Convert both Instant values into LocalDate Implement a range between them I'm assuming that the interval is exclusive - so if the end point represents exactly midnight in the... more 10/20/2016 9:30:04 AM
The problem is that you're calling Delegate.CreateDelegate with an overload which is expected to work for static methods (or for instance methods where there's an extra delegate parameter which is the target of the method call). All you... more 10/19/2016 9:58:18 PM
Currently you have two loops. One sums the numbers, and the other finds the largest and smallest numbers. Given your output, it sounds like you should be doing it all in one loop - ideally with more useful variable names too. (Your count... more 10/19/2016 4:43:31 PM
Basically, you're accessing the memory in a different pattern - your first approach is much more friendly to the memory cache, because you're accessing a lot of data in the same area, then moving on to the next piece of memory, etc. If... more 10/18/2016 11:39:40 AM
You're assuming that your key was originally text encoded with UTF-8 - but it looks like it wasn't. You should keep logically binary data as binary data - you don't need your Base64Encode and Base64Decode methods at all. Instead, your... more 10/18/2016 6:20:46 AM
That's because of operator precedence. Basically, your code is doing the equivalent of: System.out.println(("Total amount : " + total_amount) + tax_amount); So when total_amount is 100, and tax_amount is 20, that ends up... more 10/17/2016 7:48:54 AM
e.Value isn't a null reference or an empty string - it's the string "null" because that's the value in your element. You want: doc.Descendants().Where(e => (string) e == "null").Remove(); more 10/17/2016 7:31:12 AM