Browsing 7239 questions and answers with Jon Skeet
You can use ChronoUnit.DAYS for this. Compare the LocalTime values to see whether or not the start should be consider to be in "the next day": import java.time.*; import java.time.temporal.*; class Test { public static void... more 9/25/2014 11:32:52 AM
Firstly, you're overriding GetHashCode but not overriding Equals. Don't do that. They should always be overridden at the same time, in a consistent manner. Next, you're right that changing an objects hash code will affect finding it in... more 9/25/2014 7:31:21 AM
(Only giving hints - assuming this is homework, you should definitely work out the details for yourself.) Currently your loop structure is: do { ... } while (e != w); So you're going to loop until the player has guessed the... more 9/25/2014 6:03:19 AM
It sounds like you really want an ILookup<string, Employee> which is precisely a dictionary where each key maps to potentially multiple values. Yes, you can create a Dictionary<string, List<Employee>> but I would strongly... more 9/24/2014 10:19:23 PM
You're just printing out the result of calling Date.toString() which happens not to include the milliseconds. If you print out the result of calling getTime() on the date, you'll see that it ends in "456", showing that it has parsed the... more 9/24/2014 9:00:21 PM
int is convertible to double in all of these languages, so if only one of them were available, it would be easy: convert whichever value needs to be converted to a double, and call the method. But in this case, both methods are "valid" in... more 9/24/2014 8:15:21 PM
No, the argument for the ArgumentOutOfRangeException constructor should always be one of the parameter names. You can pick either of them - I usually assume that the earlier parameter is correct, so the later parameter is incorrect in... more 9/24/2014 8:09:01 PM
You're using YYYY instead of yyyy. That means "week year", to be used in conjunction with "week of year". Just change YYYY to yyyy in both of your SimpleDateFormat constructors and you'll get output of: calString Sat Sep 27 00:00:00 EDT... more 9/24/2014 8:05:37 PM
You're missing the fact that every time the length changes, the entries are redistributed - they're put in the new buckets appropriately. That's why it takes a bit of time (O(N)) when the map expands - everything needs to be copied from... more 9/24/2014 7:50:36 PM
As ever, the C# specification is the best place to go for this sort of thing. From section 7.13 of the C# 5 specification (emphasis mine): A null coalescing expression of the form a ?? b requires a to be of a nullable type or... more 9/24/2014 7:01:30 PM