Browsing 7239 questions and answers with Jon Skeet
You're never populating your list. I suspect you should actually have: for (File file : files) { XMLMessage message = new XMLMessage(); xmlMessageList.add(message); if (file.isDirectory()) { String fileName =... more 10/14/2015 4:25:54 PM
For repeated events, you definitely need to store the time zone, yes, and I'd store the local date/time. You might also want to store the UTC value of the first occurrence, if that would be useful for comparison purposes. In theory you... more 10/13/2015 8:33:41 PM
I suspect you actually want a time zone for Eastern Time, e.g. America/New_York. After all, Eastern Time wasn't observing EST on September 15 - it was observing EDT (at least, anywhere that observes daylight savings, which most of Eastern... more 10/13/2015 11:46:14 AM
However the csc command is not found I believe because the .NET framework is not properly installed. It's far more likely that you just haven't got it in your path. If you've installed Visual Studio, one of the tool shortcuts... more 10/13/2015 2:14:39 AM
Often enumerables themselves are effectively stateless - the state comes in the enumerator which is returned by GetEnumerator(). However, if you want to avoid calling GetEnumerator() twice (which could easily give different results each... more 10/12/2015 11:53:52 PM
Sure - it's a matter of understanding what happens to the lambda expression. For LINQ to SQL, EF etc, it's converted into an expression tree - basically data that represents the code in the lambda expression. The LINQ provider then has to... more 10/12/2015 7:43:02 AM
Well, it looks like you're doing this in the UI thread. You should basically avoid doing I/O in the UI thread, as it means that while the I/O is waiting, your UI will be unresponsive. Instead, you should either use asynchronous I/O, or... more 10/12/2015 7:29:07 AM
It's very unlikely that "~\\father\\chocolate.png" is a valid filename on its own - I suspect you want to map that from an ASP.NET somewhat-relative filename to a real local filename first. For example: var bitmap = new... more 10/11/2015 1:44:52 PM
Java doesn't have an addition operator for short values. If you look at JLS 15.18.2 (Additive Operators (+ and -) for Numeric Types) you'll see that one of the first things that happens is: Binary numeric promotion is performed on the... more 10/11/2015 6:49:51 AM
cast can't really work well for primitives, given that it can't return a value of the actual primitive type, due to generics in Java... so it would end up boxing again anyway. And if you're not assigning straight to an int value, it would... more 10/10/2015 9:41:10 AM