Browsing 7239 questions and answers with Jon Skeet
Well this is the problem: ShotScript shot = collider.gameObject.GetComponents<ShotScript>(); It sounds like GetComponents<ShotScript> is returning an array of ShotScript references, i.e. its return type is ShotScript. Do... more 1/18/2014 6:28:20 PM
Your query is over CURRENCIES elements, and you're only looking at the first CURRENCY child. Then you're looking for a RATE child within CURRENCIES rather than CURRENCY. Additionally, you're getting a sequence of integers - and that isn't... more 1/18/2014 3:31:23 PM
No, they're not the same - at least not with C#, using the version I have on my machine (just standard .NET 4.5.1) on my processor - there are enough subtleties involved that I wouldn't like to claim it'll do the same on all machines, or... more 1/18/2014 12:04:55 PM
Well yes - look at the declaration of the method you're implementing: void actionPerformed(ActionEvent e) It isn't declared to throw any checked exceptions. So you can't add a checked exception such as IOException with a throws clause.... more 1/18/2014 11:25:52 AM
Your query expression is declaring a range variable called gaugeElement, but you're then using tpxElement within your code. I'd also use the conversions supplied by XElement to make your code simpler to read - and I wouldn't personally... more 1/18/2014 10:02:38 AM
There's no difference. In both cases: If loadFactor is null, trialExists(loadFactor) won't be evaluated, and the condition will be false, so it won't enter into the if body Otherwise, trialExists(loadFactor) will be evaluated, and the... more 1/18/2014 8:34:48 AM
I suspect you just want to take a copy of the list, then sort that: List<Song> sortedSongs = new ArrayList<Song>(song); Collections.sort(sortedSongs); // Will not affect song Note that this should be done before your loop,... more 1/17/2014 6:34:59 PM
It seems to me that you're just missing the fact that you can divide the user's input by 100 after parsing it: using System; class Program { static void Main(string[] args) { string input = "2500"; decimal cents =... more 1/17/2014 4:35:52 PM
I suspect you're looking for Type.IsAssignableFrom: if (typeof(ICustomItem).IsAssignableFrom(typeof(T))) more 1/17/2014 3:35:02 PM
(Assuming you actually declare Example1Exception using a class declaration..., and that the method declaration is fixed too...) Example1Exception is an inner class - it needs a reference to an enclosing instance of the outer... more 1/17/2014 1:55:19 PM