Browsing 7239 questions and answers with Jon Skeet
You can't convert your lambda expression into a Comparison<char> (which is what you want) because it returns a float - you've effectively got a Func<char, char, float> there, whereas Comparison<char> is closer to... more 1/22/2015 2:44:43 PM
If you're using Java 1.8, it's as simple as: Instant instant = Instant.now().minus(24, ChronoUnit.HOURS); Timestamp timestamp = Timestamp.from(instant); You can use the overload of now() accepting a Clock to be more test-friendly (so... more 1/22/2015 1:41:50 PM
You don't. Variable names in C# are never dynamic - it sounds like you want a map from ID to "dictionary of timestamp to item". In fact, I would probably create a separate type of ItemEvents or something similar, which contained all the... more 1/22/2015 11:27:15 AM
It's a reference to the same object. The compile-time type of the expression which has a value of that reference is irrelevant. It's important to understand that there really is only one object - it's not like there's a base class object... more 1/22/2015 10:21:57 AM
I suspect you'll find the problem is that with .NET 1.1 you're running the x86 CLR in both cases, whereas with .NET 2.0 you're probably running with x86 on your desktop an x64 on your server. IntPtr.ToInt32 is documented to throw... more 1/21/2015 9:17:07 PM
There's no need to explicitly loop or change how you're parsing - you can just use LINQ with the JSON: using System; using System.IO; using System.Linq; using Newtonsoft.Json.Linq; class Test { static void Main(string[] args) { ... more 1/21/2015 7:12:26 PM
From the documentation of DateTime.AddSeconds: The value parameter is rounded to the nearest millisecond. An alternative would be to multiply by TimeSpan.TicksPerSecond and then add that to the ticks of UnixEpoch: return new... more 1/21/2015 4:14:56 PM
If you mean you need to be able to handle multiple values with different IDs but the same DateTime, you could include that in your CompareTo implementation: // TODO: Implement IComparable<DatedID> as well :) int... more 1/21/2015 4:09:49 PM
but when i am running below code by swapping the object in println method i am getting same result. You shouldn't compare the results of a hashCode in one run with the results in a different run. For example, what you may have... more 1/21/2015 1:51:22 PM
It doesn't make sense to add two DateTime values together. If you want to represent "11 years, 2 months, 5 days, 10 hours, 10 minutes and 11 seconds" then you should represent that. That's not the same as 0011-02-05T10:10:11. In... more 1/21/2015 12:30:39 PM