Browsing 7239 questions and answers with Jon Skeet
If you're happy to take a dependency on a 3rd party library, I'd suggest using the date/time library I maintain: Noda Time. Unlike the .NET framework, it has a type specifically for a "time without a date" - LocalTime. You can use a... more 10/29/2013 4:50:47 PM
When I run that code, I see an exception: Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'c:\Test.txt' is denied. It's not clear how you're running this, but if it's configured as a console app and you run... more 10/29/2013 4:21:35 PM
The second is much better in my view: It's obvious from the signature that it's expecting 3 values Failures are flagged at compile time instead of execution time more 10/29/2013 2:04:06 PM
Question 1: Why error? You've got two members both called B within the same class. (A type is a member too.) You can't do that, aside from method overloading. From section 10.3 of the C# spec: The names of constants, fields,... more 10/29/2013 10:23:30 AM
It sounds like you just want: var value = list.First(x => x.Key == input).Value; That's if you're sure the key will be present. It's slightly trickier otherwise, partly because KeyValuePair is a struct. You'd probably want: var pair... more 10/29/2013 10:14:41 AM
In NDoc at least, it means that the XML documentation for this member should be excluded. From the documentation: The <exclude/> tag directs NDoc to exclude the current item from documentation. It's not clear to me whether this... more 10/29/2013 8:46:41 AM
If this is meant to be Java, you want: json.put("set_boot", true); json.put("synchronous", true); (There are similar problems later on.) Note: String literals are in double-quotes, not single-quotes in Java You're calling a method... more 10/29/2013 7:28:11 AM
Firstly, it's important to note that the null value is convertible to both Object and Object[], so both methods are applicable. Then it's just a matter of overload resolution. That's described in section 15.12 of the JLS, and section... more 10/29/2013 7:22:15 AM
But what if it doesn't? Then you're in a really bad situation, and you should probably get out of it as quickly as possible. When a JRE is violating its own promises, what would you want to depend on? I'd feel happy using... more 10/29/2013 7:04:56 AM
If your set is small enough (so you don't mind fetching all the values from the database), the simplest thing would be to force the distinct part to be performed locally: var area = de.City_Area_View .Select(m => new {... more 10/29/2013 7:01:24 AM