Browsing 7239 questions and answers with Jon Skeet
With that said, it appears that StatusCode() doesn't actually return a "status code," and on successful requests, it only returns an OK instead of a 200. No, it returns an HttpStatusCode enum value. If you call ToString on an enum... more 2/6/2014 3:59:01 PM
Semantically I find this a little weird, since the extension method is called cast.. Shouldn't it be casting? It's casting each element if it needs to, within CastIterator... although using a generic cast, which won't use explicit... more 2/6/2014 3:47:56 PM
I suspect it's more likely that it's to do with what you do with the response. The using statement will close the StreamWriter, and you don't even need the explicit Close call. However, you also need a using statement for the... more 2/6/2014 2:22:46 PM
You always need to original key, to cope with hash collisions. The point of the hash code (or hash value as you're calling it) is to be able to very quickly find possible matches for the keys. The hash code is solely based on the key - the... more 2/6/2014 1:56:39 PM
Well the purpose of the methods is to create an unmodifiable view on an existing collection. That's the documented behaviour, and in many cases it's exactly what you want - it's much more efficient than copying all the data, for example...... more 2/6/2014 1:30:00 PM
This is a namespace problem. You're looking for nav elements without specifying a namespace, but the default namespace is "http://www.w3.org/1999/xhtml". Additionally, you're looking for your epub attributes in the wrong way. I suggest... more 2/6/2014 12:33:25 PM
You don't need to override ContainsKey - you need to either override Equals and GetHashCode in someObj (which should be renamed to conform to .NET naming conventions, btw) or you need to pass an IEqualityComparer<someObj> to the... more 2/6/2014 12:23:42 PM
You can use regular expressions to only perform substitutions in certain cases. In this case, you want to perform a substitution if either side of the dash is a non-digit. That's not quite as simple as it might be, but you can use: string... more 2/6/2014 8:39:48 AM
You're currently blocking the UI thread - don't do that. Instead, I suggest you use a timer. For example: class Foo : Form { private int nextButtonToShow = 0; private Timer timer; private Button[] buttons; internal... more 2/6/2014 7:30:54 AM
A DateTime value doesn't have a culture, inherently. It's just a value. I suspect that you should change this though: DataFormatString="{0:g}" For example, change it to: DataFormatString="{0:yyyy/MM/dd HH:mm:ss}" (Note the HH rather... more 2/6/2014 7:19:17 AM