Browsing 7239 questions and answers with Jon Skeet
From the documentation: This format is supported only for integral types. decimal isn't an integral type. The fact that the format type is called "decimal" is unfortunate, basically. It's because it formats integers in base 10, but... more 3/24/2014 10:30:34 AM
You've already got a method parameter called e, so you can't introduce a lambda expression parameter called e. You'll need to rename one of them. As a shorter example, to show this has nothing to do with EF etc: // Invalid: same variable... more 3/24/2014 7:40:34 AM
Well yes, you're calling xml.Add when you actually want to call Add on the object representing the Sheet element. I suggest you use: XElement sheet = new XElement("Sheet", new XAttribute("Name", getExcelSheetName); while... more 3/24/2014 7:02:42 AM
Assuming there's there's always a port and it's always represented by :<port number>, you can just unconditionally remove the part after the last colon: int portStart = ipString.LastIndexOf(':'); ipString = ipString.Substring(0,... more 3/23/2014 8:28:52 AM
It sounds to me like you need to think about your structure differently. The remainder method probably shouldn't interact with the console - you need to loop in the code calling it: // Calling code, e.g. main Console console =... more 3/23/2014 8:22:08 AM
I suspect it's all to do with the character encoding the compiler is using to convert your file into text. You can specify this in the mcs command line with the -codepage parameter. (Or /codepage in csc.) Alternatively, to make it easier... more 3/22/2014 7:06:26 PM
In the code below, why does println(z.x) display the value of zero? Because it's referring to the z field declared in A... that's the only one that z.x can refer to, because the compile-time type of z is A. The instance of B you've... more 3/22/2014 5:36:58 PM
GetBytes() returns negative number (-61, () ) at the char 'ä'. Well getBytes() is going to use the platform default encoding, unless you specify an encoding, which you should. I would recommend UTF-8 normally. For example, in Java... more 3/22/2014 8:39:24 AM
The Date(long) constructor takes the number of milliseconds since the Unix epoch. I strongly suspect that you've been given the number of seconds since the Unix epoch - so just multiply that value by 1000L. Date date = new Date(timestamp... more 3/22/2014 8:36:51 AM
You're calling startsWith when you don't need to - you know it starts with the first two characters, by definition :) You could have: String start = text.substring(0, 2); boolean valid = text.endsWith(start); Or just collapse the... more 3/22/2014 8:24:49 AM