Browsing 7239 questions and answers with Jon Skeet
Can the variable below (called b) be called an expression, if it is the only thing located to right of the equals sign? Yes, absolutely. I understand that Java promotes all bytes to ints. Well, in some cases. Not in all... more 11/1/2013 9:05:10 AM
I can think of two simple reasons this might be happening: You have something else which is already listening on port 80 (such as IIS) You don't have permission to listen on port 80 The exception should indicate which of these is the... more 11/1/2013 6:57:28 AM
You're calling Replace but not doing anything with the result - strings are immutable in C#, so the Replace method doesn't change the contents of the existing string. As the documentation states: This method does not modify the value... more 11/1/2013 6:52:53 AM
This is the problem: ReCaptchaImpl reCaptcha = new ReCaptchaImpl(); That's just creating a new instance - your mock isn't being used at all. Note how you're not passing your mock into anything - how did you expect the production code to... more 10/31/2013 9:45:41 PM
You just need to call the ToList extension method to create a list. Also, you need to create Credentials objects rather than instances of an anonymous type. For example: var xmlResults = from element in Root.Elements().Elements() ... more 10/31/2013 8:04:23 PM
Could I re-use the inner objects that turn out to be useful in the next round of GPS Data collection, and let any remaining inner objects be garbage collected? Yes, potentially. But do you have any indication that it's actually a good... more 10/31/2013 7:20:35 PM
LINQ to SQL doesn't know how to translate ToString() into SQL in this case. The simplest solution is to use AsEnumerable to "transfer control" to LINQ to Objects. You can use an initial Select to make sure you only pull the relevant... more 10/31/2013 7:15:04 PM
what would be missing from my join? Presumably there are no entries in fact which have the corresponding Cod_articulo values (e.g. 60155 for posicion 3). Join in LINQ represents an inner join, where there has to be an entry in both... more 10/31/2013 3:12:14 PM
If you convert each character to a string first, then use int.Parse (or still Convert.ToInt32) that will work. Personally I'd use LINQ for this, e.g. int[] sequence = array.Select(x => int.Parse(x.ToString())).ToArray(); ... or use... more 10/31/2013 1:45:27 PM
You'd need a helper method, basically. For example: public static DateTime? TryParseDateTime(string text) { DateTime validDate; return DateTime.TryParse(text, out validDate) ? validDate : (DateTime?) null; } Then you can just... more 10/31/2013 9:54:36 AM