Browsing 7239 questions and answers with Jon Skeet
The problem is that you're treating the token Ty as if it were the name of a type. It's not - it's the name of a variable. The type of that variable is Type, but it's still a variable. Variables and type names are entirely different... more 4/1/2016 6:14:07 AM
Firstly, the "1:15 PM" version should work already - it does for me. If you want to allow "P.M" or "p.m". you'll need to create a culture with appropriate AM/PM signifiers. That's easy enough to do: using System; using... more 3/31/2016 8:20:03 PM
why is A print before B? Because the body of the superclass constructor is executed before the body of the subclass constructor, basically. Think of your B() constructor as implicitly: public B() { super(); // This invokes A's... more 3/31/2016 7:36:07 PM
One option is to have a map from the type to a conversion of CustomType to that type. So it would look something like: private static readonly Dictionary<Type, Expression> Mappings = new Dictionary<Type, Expression> ... more 3/31/2016 3:38:23 PM
This doesn't do what you expect it to: hexString.getBytes(StandardCharsets.UTF_8) That's just encoding the hex string as UTF-8 - you want to parse the hex string, so that each pair of hex digits ends up as a single byte. The fact that... more 3/30/2016 9:01:25 PM
It seems to me that you should actually use a join: var dbXMLSoccerTeams = from dbXMLSoccerTeam in data.EFXMLSoccerTeam join dbMatchTeam in data.EFMatchingTeamIDs on dbXMLSoccerTeam.ID... more 3/30/2016 6:02:26 PM
You're calling three methods, providing the same InputStream to all of them - and each of them creates a BufferedReader wrapping that InputStream, and then closes it at the end. Closing the BufferedReader will close the underlying... more 3/30/2016 5:56:48 PM
It sounds like you've got another class called Keys somewhere. Here's an example demonstrating the same problem (although there's a second error around the declaration of key which you haven't mentioned; I suspect you've got that error as... more 3/30/2016 6:21:57 AM
Is there a way that logos can be seen within the IntergrateLogo method by using a delegate? Not when it's a local variable, no. It's not really clear why you'd use delegates for this at all though. I wouldn't even use a method, but... more 3/29/2016 10:35:16 AM
The simplest approach would just be to replace the child nodes of the root element instead: var root = XElement.Load(xmlFile); root.ReplaceNodes(new XElement("tests", root.Elements("test"))); root.Save(FileName + ".xml"); Note that... more 3/29/2016 9:44:04 AM