Browsing 7239 questions and answers with Jon Skeet
x.Reverse() is calling Enumerable.Reverse(), which will return you an IEnumerable<char> - not a string. That's why Equals is never returning true. Here's an alternative: char[] chars = x.ToCharArray(); Array.Reverse(chars); return x... more 7/10/2014 8:35:51 PM
Ok, I am reading a .docx file via a BufferedReader Well that's the first problem. BufferedReader is for plain text files. docx files are binary files in a specific format (assuming you mean the kind of file that Microsoft Word... more 7/10/2014 6:43:44 PM
You should be able to see it in the Developer Console. Click on a project, and at the top it will tell you the project ID. (If you were looking for a way of getting this programmatically, please clarify this in your question - it's not... more 7/10/2014 4:54:32 PM
This is the problem: x.People.Select(y => y.Name == "Jane Doe").Any() You're using Select, which is a projection, when you meant to use Where, for filtering. Given that Select never filters out any items, you're basically returning... more 7/10/2014 4:32:59 PM
You're calling option.appendChild() and passing it the result of doc.createElement(...).appendChild(...) But appendChild() returns the newly-appended child, not the node it was appended to. So you're actually calling... more 7/10/2014 4:25:10 PM
You're creating a SimpleDateFormat without specifying a locale, so it'll use the default locale. By the looks of your variable names, that may not be English - so it'll have a hard time parsing "Thu" and "Jul". Try: String formatType =... more 7/10/2014 12:48:17 PM
You can use the Remove extension method on IEnumerable<T> where T : XNode: xml.Elements() .Where(item => !JustThisProperties.Contains(item.Name.ToString())) .Remove(); (You might want to make JustThisProperties an... more 7/10/2014 11:37:15 AM
Others have suggested changing the type of the variable - I'd recommend removing the variable entirely, along with the pointless catch block. You do need to change the return type as well though: public List<IDListItems>... more 7/10/2014 8:56:50 AM
Right, now we've got your Deserialize method, the problem is obvious: stream = new StreamReader(xml); That's treating xml as a filename, not as XML. Either you should just have: public T Deserialize(string filename) { // There's no... more 7/10/2014 6:53:40 AM
This is the problem - or at least a problem: Encoding.UTF8.GetString(mac3des.ComputeHash(Encoding.UTF8.GetBytes(dataValue))); ... and quite possibly the same for the previous lines. You're calling Encoding.UTF8.GetString with arbitrary... more 7/10/2014 6:49:10 AM