Browsing 7239 questions and answers with Jon Skeet
Since I think same hash value means the same Line. No, it doesn't. This is a common misconception. If two objects have the same hash code, they may be equal - but they don't have to be. You should never treat equal hash codes as proof... more 10/10/2015 8:57:11 AM
Your getNumberOfLines() method will read all the data from the BufferedReader - so unless you start reading the file again, there's nothing to read, and the very first call to readLine() will return null. However, instead of doing this,... more 10/10/2015 8:31:40 AM
You need to set the time zone in the SimpleDateFormat. A Date value doesn't have a time zone, so your initial code is fairly pointless - you could just call new Date(). Note that your format string is incorrect too - you're using minutes... more 10/10/2015 8:05:54 AM
You just need Expression.Property and then wrap it in a lambda. One tricky bit is that you need to convert the result to object, too: var parameter = Expression.Parameter(x); var property = Expression.Property(parameter, propInfo); var... more 10/10/2015 6:56:03 AM
Currently you're reading the same text file twice - ones as individual lines and once as a whole thing. You're then rewriting a file as many times as you have lines. This is all broken. I suspect you simply want: // Note name changes to... more 10/9/2015 10:51:04 AM
It's unclear to me why CheckCharacters = false isn't fixing the problem for you, and as I've mentioned the far, far better fix is to get the data in a clean fashion to start with. However, you can work around this by replacing each... more 10/9/2015 10:23:53 AM
Well, it can't be done directly - a FooBarHolderAbstract<Foo, Bar> isn't a FooBarHolderAbstract<FooBase, BarBase>. It's not clear whether or not you could logically have that, because we don't know what's in the abstract... more 10/9/2015 9:11:09 AM
String.split takes a regular expression pattern. . matches any character in a regex. So you're basically saying "split this string, taking any character as a separator". You want: String arr[] = dob.split("\\."); ... which is... more 10/9/2015 6:56:16 AM
but looking at the table contents there are only 6 objects present Nope, look at size - it's 7. You've just got two values in the same bucket. They don't collide by exact hash value, but they do collide by bucket. That's fine. You... more 10/8/2015 1:15:43 PM
Firstly, be aware that ElementAt is 0-based - if you want the second element, you should be using ElementAt(1), not ElementAt(2). (Think of it like array indexing.) I'm not surprised that it's rejecting ElementAt on an unordered query,... more 10/8/2015 5:58:13 AM