Browsing 7239 questions and answers with Jon Skeet
It sounds like you probably just want to use LINQ: int target = 10; // Or whatever int count = myList.Count(x => x == target); more 4/22/2016 3:45:48 PM
This code is returning: 02:00. But it should return 14:00. No, it's right. You're converting from 8pm in New York (currently UTC-4 due to DST) into the Europe/Bratislava time zone (currently UTC+2 due to DST). So: New York: ... more 4/22/2016 12:20:17 PM
Basically, the problem is how you're passing parameters into the database. You shouldn't need to create a MySqlDateTime yourself - just use parameterized SQL and it should be fine: // TODO: Use a date/time control instead of parsing text... more 4/22/2016 5:42:21 AM
It really depends on the implementation of PreparedStatement.setDate() and addBatch(). If those methods clone all the relevant data appropriately, you could create a single instance of java.sql.Date outside the loop, then call setTime on... more 4/21/2016 1:13:41 PM
Given the documentation of DateUtils, I'm not sure I'd trust it with this. Assuming you're only interested in a UTC day, you can take advantage of the fact that the Unix epoch is on a date boundary: public static Date roundUpUtcDate(Date... more 4/21/2016 10:55:42 AM
That's simply invalid C#, and the compiler should be telling you about it - the class that you're deriving from should appear first in the list. As an example of the compiler error message you should be getting: public interface IFoo... more 4/21/2016 5:39:01 AM
If the other team has any required fields and you send messages to them without specifying those fields (or even explicitly specifying the default value, for primitives) then the other end will fail to receive the messages - they won't... more 4/20/2016 11:54:22 AM
You can do this... but you really, really shouldn't: // DO NOT USE THIS CODE using System; public class Evil { public void Method() { Console.WriteLine($"Is this null? {this == null}"); } } class Test { ... more 4/20/2016 9:44:18 AM
It sounds like you want: var pattern = OffsetPattern.CreateWithInvariantCulture("'UTC'+H:mm"); var offset = pattern.Parse(text).Value; more 4/19/2016 7:10:28 PM
I'm getting an error saying that file cannot be found in the IIS Express directory. Yes, because you're loading it with a relative path name, which means "relative to the current working directory"... which in this case is IIS. You... more 4/19/2016 7:07:56 PM