Browsing 7239 questions and answers with Jon Skeet
Is it really possible that DecimalFormat is producing a comma version of the decimal on European phones? Yes, absolutely. That's what it's meant to do, after all: Creates a DecimalFormat using the given pattern and the symbols for... more 2/8/2014 1:46:55 PM
You just need to write an uncompressed header, and then create a compression stream after that. Here's an example: using System; using System.IO; using System.IO.Compression; using System.Text; class Program { private static void... more 2/8/2014 1:20:26 PM
Can anyone tell me the cause of this behavior? Well yes - presumably when it's showing 0, 0, onLocationChanged hasn't been called yet - because the location isn't known immediately. You've requested that the location manager calls you... more 2/7/2014 5:15:12 PM
Well you could just use dictionary.Values().Select(x => new SelectedListItem { Text = x }) Just be aware that it may not be in a useful order: Dictionary<,> is inherently unordered (or rather, the order may change and... more 2/7/2014 2:42:33 PM
The above code represents that the constructor abc() is inherited by some class. No it doesn't. It means that the parameterless abc constructor chains to the abc constructor taking a pqr. So you'd actually have: public class Foo { ... more 2/7/2014 11:00:15 AM
For nullable types, I'd just use an extension method: public static object CoalesceNullToDBNull(this object input) { return input == null ? DBNull.Value : input; } Then use it as: cmd.Parameters["Foo"].Value =... more 2/7/2014 8:36:07 AM
Well, that's just not how the language is specified. It's important to understand that default is like typeof - they're operators1, not method calls. It's not like the name of the type is an argument - it's an operand, and the operand is... more 2/7/2014 8:24:59 AM
You only get a string into the constant pool if you call intern or use a string literal, as far as I'm aware. Any time you call new String(...) you just get a regular new String object, regardless of which constructor overload you... more 2/7/2014 7:40:56 AM
Looking at the source, it seems the author doesn't understand LINQ properly: They haven't provided a ThenBy method, but instead they're collecting multiple orderings with multiple OrderBy calls They haven't exposed the table as an... more 2/7/2014 7:08:38 AM
I wouldn't do either of these. You're introducing a method called AddCustomer on a customer class. I wouldn't expect a Customer to know about a database - I'd expect some sort of data access layer or customer repository to know about it... more 2/6/2014 6:46:34 PM