Browsing 7239 questions and answers with Jon Skeet
The problem is that your lambda expression is capturing i - not the value of i, but the variable itself. That means that by the time your task executes, the loop may well be on the next iteration (or even later). So some of your... more 12/31/2013 7:53:39 AM
This is the problem: select new wl{d.Key.cat_id} It's not clear what you actually intended to do here (the meaningless type names really don't help) but you might want something like: select new wl { CategoryId = d.Key.cat_id... more 12/30/2013 7:45:52 PM
This is the problem: import org.apache.commons.math3; That's trying to import a package - you can't do that. You have to either use a wildcard import: import org.apache.commons.math3.*; or import a specific type: import... more 12/30/2013 5:55:20 PM
It sounds like you need to store a DateTimeOffset instead of a DateTime. You could just store the local DateTime to the user creating the value, but that means you can't perform any ordering operations etc. You can't just use... more 12/30/2013 4:55:40 PM
No, File.pathSeparator is ; on Windows. For example, you might have: PATH=c:\Utils;c:\SomethingElse File.pathSeparator is ; on Windows and : on Unix. You're thinking of File.separator which would be \ on Windows and / on Unix. Here's... more 12/30/2013 4:29:46 PM
It's not clear why you're using Cast or Select at all. I suspect you just want: XDocument xdoc = XDocument.Parse(xcData.InnerText); Note that I'm using InnerText rather than OuterXml, as the outer XML of a CDATA node will never be a... more 12/30/2013 3:24:41 PM
You're calling File.Create at the start of the method - which is returning you a stream, which stays open. It's not clear why you're calling that at all, but I'd suggest just removing that line. You should also use a using statement, only... more 12/30/2013 1:07:32 PM
Well: FileReader is just a Reader which reads a file, using the platform-default encoding (urgh) BufferedReader is a wrapper around another Reader, adding buffering and the ability to read a line at a time Scanner reads from a variety of... more 12/30/2013 11:09:49 AM
One reason for using the constructor is that you can make the field final - immutability isn't an option if you the constructed object isn't fully initialized. Personally I prefer to write code so that by the time an object is available,... more 12/30/2013 10:54:18 AM
When you get a WebException, you can use the Response property to access the response from the web server (if there is one). You can then cast that to the appropriate subclass, and check the error code: catch (WebException e) { var... more 12/30/2013 10:14:09 AM