Browsing 7239 questions and answers with Jon Skeet
Just parse marksxml as an XElement and add that: XDocument doc = new XDocument( new XElement("Student", new XElement("Name", "John"), new XElement("Age", "17"), XElement.Parse(marksxml) ); ) more 6/19/2015 6:20:41 AM
My question is how do i change & into & ? I wouldn't, if I were you. & is just the HTML-encoded (and XML-encoded) form of &. The browser will display it as &. I don't know offhand whether an & followed... more 6/19/2015 6:15:38 AM
Why is '0' subtracted from n1.charAt(i) and n2.charAt(j) ? Because the number of the Unicode character representing the digit 0 is 48, not 0. Imagine you wanted to label 'A' = 0, 'B' = 1 etc... then you'd use n1.charAt(i) -... more 6/19/2015 5:11:49 AM
Sounds like you're just missing the ability to specify both a class and interfaces as a comma-separated list in the constraints: static void INeedToDoBoth<T>(T dependency) where T : Dependency, IOptionalDependency Note that... more 6/18/2015 5:20:43 PM
Generally speaking, since this refers to the current instance, how is it possible that Fireball.onChat(PlayerChatEvent) is registered too? Because when you're constructing an instance of Fireball, this refers to the Fireball being... more 6/18/2015 2:44:08 PM
Sounds like you want something like: var integers = Enum.GetValues(typeof(Status)) .Cast<Status>() .Where(status => status.ToString().Contains("InStock")) .Select(status... more 6/18/2015 2:36:17 PM
It looks like you're trying to use image APIs from non-UI threads. That's a bad idea. I suggest you copy the image to a byte array on the UI thread, then run your parallel for loop which would mutate the array, then recreate the image... more 6/18/2015 2:09:33 PM
LINQ doesn't have a "set difference" operator itself... but you can use Except twice: var list1Text = list1Source.Select(x => x.Text); var list2Text = list2Source.Select(x => x.Text); var difference = list1Text.Except(list2Text) ... more 6/18/2015 11:10:34 AM
First, let's separate this into pointer vs ref - they're handled slightly differently. It's not clear what pointer value you expected the method to receive - particularly as the value you passed to Invoke was a type, not an instance of... more 6/18/2015 10:53:41 AM
The RAW datatype is documented as: The RAW and LONG RAW datatypes are used for data that is not to be interpreted (not converted when moving data between different systems) by Oracle Database. These datatypes are intended for binary... more 6/18/2015 9:22:18 AM