Browsing 7239 questions and answers with Jon Skeet
You're assuming the assertions are enabled. If this is using Debug.Assert, the method will only actually be called if the DEBUG conditional compilation symbol is defined. Assuming result is used later on (beyond the assertion) then... more 10/9/2013 3:14:31 PM
Well as it says, you can't apply a Pattern to a BufferedReader - you have to read data from the reader, and then apply the pattern to that. In this case, you're already reading the data - but then you're ignoring it! You want: Matcher m... more 10/9/2013 2:40:55 PM
You haven't imported the Earth class, so the compiler doesn't know what Earth refers to. You should have this line at the start of your GreeingsUniverse.java file: import com.scjaexam.tutorial.planets.Earth; more 10/9/2013 2:02:09 PM
You have a race condition, basically. On my machine, this does print 42 most of the time - but fundamentally you have two independent tasks: one adding, and one printing. There is no guarantee which task will execute its first statement... more 10/9/2013 1:49:49 PM
To solve the compile-time issue, put the initialization in the constructor. You're simply not allowed to refer to one instance variable from the initializer of another. This is laid down in the C# specification in section 10.5.5.2: A... more 10/9/2013 1:21:12 PM
Where am I wrong? You're calling the Add method, but expecting it to return something. It doesn't. If you're trying to create a new dictionary with the same entries and one new one, you probably want: var headerParameters = new... more 10/9/2013 10:23:12 AM
AsSequential is just meant to stop any further parallel execution - hence the name. I'm not sure where you got the idea that it's "supposed to make the resulting array sorted". The documentation is pretty clear: Converts a... more 10/9/2013 7:30:31 AM
The problem isn't on the output side at all - it's just that you don't know how big the input is. It's not clear where the InputStream is coming from - if the input is being received over the network for example, you may not have any... more 10/9/2013 6:18:14 AM
Won't changes in the callee function be reflected in the caller function? Changes to the contents of the array would be reflected in the caller method - but changes to the parameter itself wouldn't be. So for example: public void... more 10/8/2013 7:58:22 PM
I receive InvalidOperationException - cross.thread operation. Where my error? Presumably T3OpenStockReader raises events on its own thread - but you're trying to modify the UI in your event handler... which means you're doing it in... more 10/8/2013 7:21:59 PM