Browsing 7239 questions and answers with Jon Skeet
The problem is that the comparison is being performed in SQL - I suspect if you execute the same query in SQL Studio, you'll get the same result. One fix would be to change the database collation to be case-sensitive; it's not clear... more 1/27/2014 6:56:03 AM
It sounds like you want to declare a new generic parameter for the method, in which case you could use: <U extends Number> boolean isAverageSame(Stats<U> ob) Note that this will allow you to do something... more 1/26/2014 5:14:48 PM
There's no such concept as "current length". It has 3 elements from the start. All of them have a value of Nothing to start with, but the length is still 3. If you're trying to count how many non-Nothing elements are in the array, you... more 1/26/2014 4:13:59 PM
p is a local variable within the getLower method. You're not "importing" the method - you're just calling it. When the method has returned, the variable no longer even exists. You could consider returning the value of p from the... more 1/26/2014 3:18:02 PM
I suspect the problem is that on each invocation of DirSearch, you're overwriting the file output from previous invocations. If the final invocation has no files (only directories) you'll end up with an empty file. Options: Use... more 1/26/2014 2:56:02 PM
You should be looping over all the lines - and then if the line matches, then print it out (or whatever). For example: while (scanner.hasNextLine()) { String line = scanner.nextLine(); // Now check the line, and do whatever you... more 1/25/2014 8:02:25 PM
This is the problem: pl.add(this); You're adding the same reference (this) again and again. The value of this is just a reference to the "current" object - and you're modifying the contents of that object in the loop. In each iteration... more 1/25/2014 7:30:08 PM
I've tried using File.ReadAllBytes like this That's the first mistake. This is a text file - so you should read it as a text file. To be honest, if it's CSV you should probably look into CSV parsers which would make your life... more 1/25/2014 6:02:46 PM
The normal way to do this is just to explicitly make a call at the end of the try block. For example: try (CustomTransaction transaction = ...) { // Do something which might throw an exception... ... more 1/25/2014 5:14:28 PM
I think this is unfortunately phrased. It's not that the Wait call returns before the task has finished executing; it's that the thread calling Wait may end up executing the task itself, rather than just blocking idly. Sample code: using... more 1/25/2014 11:56:09 AM