Browsing 7239 questions and answers with Jon Skeet
I believe the problem is here: GameActivity game = new GameActivity(); public void updatePlayer(Button buttonID){ game.setPlayer(buttonID); } You're creating the GameActivity by calling the constructor directly, rather than it being... more 1/7/2015 9:01:11 PM
Firstly, I don't know much about MVC but it sounds like you shouldn't need to do this. If you have code which depends on FileStreamResult, see if you could make it depend on FileResult instead, which is the base class of both... more 1/7/2015 8:53:31 PM
You need to accept an A as well: @Inject B(A a, D d) { super(a); this.d = d; } Then Guice should inject both the A and the D, and you just pass the A up to the superclass constructor. Just because a constructor is marked with... more 1/6/2015 9:23:29 PM
The problem is that your element isn't in the DAV: namespace - it's in the d namespace. You need to differentiate between the namespace URI and the namespace alias. You want: XNamespace ns = "DAV:"; var content = new XElement(ns +... more 1/6/2015 6:59:52 PM
If the files are always of the form Client_<number>.txt then you basically want to sort them according to the parsed number. So write a method to take the original filename, take off the prefix/suffix (or extract the digits with a... more 1/6/2015 6:28:55 PM
You're getting the value of the whole Match - you only want a single group (group 1) which you can access via the Groups property and the GroupCollection indexer: Console.WriteLine(match.Groups[1]); more 1/6/2015 4:06:10 PM
It sounds like you probably want: return Float.compare(offer1.getAmount(), offer2.getAmount()); That's if getAmount() returns a float - that means you won't be able to call methods on it directly, but Float.compare is a handy... more 1/6/2015 2:23:02 PM
You can use a TextReader to read a line at a time - and StreamReader is a TextReader which reads from a stream. So: var assm = Assembly.GetExecutingAssembly(); using (var stream =... more 1/6/2015 2:06:50 PM
Look at the type of mLastLocation: protected String mLastLocation; String doesn't have getLatitude and getLongitude methods. Your variable should be of type Location, and initialized without the String.valueOf call: protected Location... more 1/6/2015 1:28:38 PM
How to access the methods in C from D? You have to use a reference with a compile-time of the relevant interface. For example: class D { public void FooA() { A a = this; Console.WriteLine(a.mul(...)); } ... more 1/6/2015 10:53:18 AM