Browsing 7239 questions and answers with Jon Skeet
Problems: You're declaring lines with the public modifier, which is only for instance/static variables, not local variables. You're never initializing lines You're trying to use lines outside its scope (which is currently the while... more 10/6/2013 3:34:25 PM
Basically, the value of Exception.Data isn't a Dictionary<string, string> - so when you cast it to Dictionary<string, string>, you get this exception. The property itself is only declared to be of type IDictionary. You... more 10/6/2013 11:30:21 AM
The problem is with the end of your do loop: do { input = br.readLine(); if (input.endsWith("\n")) { input = input.substring(0, input.indexOf("\n")); } System.out.println(input); } while (br.read() != -1); You're... more 10/6/2013 8:32:58 AM
Presumably the client is using HTTP 1.1 with connection keep-alive - so it's not closing the stream. You're waiting for the client to send more data, but the client has no intention of sending any more data because it's "done" for that... more 10/6/2013 8:20:28 AM
No, there's no way of doing this - and it sounds like a design smell, to be honest. Half the point of having MustInherit members is that you can then access them from the code in the base class. That wouldn't be appropriate for Shared... more 10/6/2013 8:07:56 AM
You can use Zip and Skip together to create the "difference between adjacent numbers" part, and then the normal average: var differenceAverage = input.Zip(input.Skip(1), (x, y) => y - x).Average(); This relies upon the ability to... more 10/6/2013 7:04:12 AM
Aside from anything else, this could be the problem: _stocks.Add(new StockItem(StockEntry("ABC", PeriodType.Minute, 5))); (and the similar lines). StockItem is a generic class, so you need to specify the type... more 10/5/2013 7:23:44 PM
The List part is a complete red herring here. You'd get exactly the same problem if your constructor had a Cat parameter instead of a List<Cat> parameter. Your Cat type is probably internal, because you haven't declared it as... more 10/5/2013 7:15:13 PM
You're creating a new instance of BankAccount each time the button is clicked - so accountBalance will be 0.0 (the default value for a field of type double). How did you expect it to "know" about the previous balance? It's entirely... more 10/5/2013 7:09:23 PM
No, you're not always returning a string. What if the input is entirely lower case? Basically, you need a return statement (or throw an exception) after the for loop, to handle the situation where you get to the end of it. Even in cases... more 10/5/2013 6:39:43 PM