Browsing 7239 questions and answers with Jon Skeet
The problem is that the second parameter to invoke is meant to be an array of arguments - you're only specifying a single argument. In most cases that would be okay as the second parameter of Method.invoke is a varargs parameter, but as... more 9/3/2015 9:03:10 PM
Look at this loop: while (in.read(bytes,0,4096) != -1) { out.write(bytes,0,4096); } However much data is read by read, you're always writing out 4096 bytes. You only want to copy the same amount of data you've read, e.g. int... more 9/3/2015 8:25:07 PM
I believe the problem is due to Accord.Math.ComplexMatrix - a static class with a bunch of extension methods, including: public static double[,] ToArray(this Complex[] c); I get the error with: using static... more 9/3/2015 4:45:07 PM
Now if i dont implement the interface and leave : IEquatable out of the code, it seems the application operates exactly the same. Well, that depends on what "the application" does. For example: List<Address> addresses = new... more 9/3/2015 2:49:23 PM
It sounds like you just need: receipt.Root.Add(enternode); In other words, adding the new element to the root element of the document. There are likely to be rather simpler ways of doing all of this using LINQ, btw. I suspect you want... more 9/3/2015 11:49:37 AM
You're not asking for the HOUR_OF_DAY value - you're asking for the HOUR_OF_DAY - 1 value, which actually corresponds to Calendar.HOUR - the 12-hour version: Field number for get and set indicating the hour of the morning or afternoon.... more 9/3/2015 11:08:41 AM
Just parse the JSON, e.g. using Json.NET: JsonResult result = testController.GetStatuses(); string json = (string) result.Data; List<Status> statuses = JsonConvert.DeserializeObject<List<Status>>(json); // Check... more 9/3/2015 11:05:47 AM
I have a little bit of Javascript embedded within my explanation of Unicode which allows you to see the Unicode characters you copy/paste into a textbox. (I've created a tinyurl for it of http://tinyurl.com/unicode-explorer). Your example... more 9/3/2015 9:15:38 AM
I would suggest using Element instead of Elements, and casting the XElement to string instead of using Value. Combine that with using Title instead of title and it should be fine: xmlDoc.Descendants("books") .Elements("book") ... more 9/3/2015 8:59:38 AM
You're creating an XmlSerializer which expects to deserialize just Base objects. It doesn't expect to see a <Derived> element. If you use XmlSerializer deserializer = new XmlSerializer(typeof(Derived)); you don't get the... more 9/3/2015 6:22:47 AM