Browsing 7239 questions and answers with Jon Skeet
It looks like your problem is in the checkurl method, which doesn't dispose of the WebResponse that it gets - that means the connection pool associated with that host has effectively "lost" that connection until the WebResponse gets... more 9/22/2015 6:14:45 AM
You need to swap each pair of characters, as you're reversing the order of the bytes, not the nybbles. So something like: public static String reverseHex(String originalHex) { // TODO: Validation that the length is even int... more 9/21/2015 10:57:46 AM
You can use Enum.valueOf(Class, String): import java.util.*; enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } public class Test { public static void main(String[] args) throws Exception { ... more 9/21/2015 5:56:25 AM
Sure - you do exactly as you've described, using TimeSpan. You can get the time of day from a DateTime using the TimeOfDay property, and then just subtract that from 24 hours: // You could use TimeSpan.FromDays(1) as well var remaining =... more 9/20/2015 8:32:04 AM
When you write this (I'm using different class and property names for clarity): public class Test { public string Name { get; set; } } that's asking the compiler to create a private field with a public property. It's equivalent... more 9/19/2015 3:24:18 PM
There isn't the equivalent of a rectangular array as far as I'm aware, but you could: Have an ImmutableList<ImmutableList<Point>> Wrap a single ImmutableList<Point> in your own class to provide access across two... more 9/19/2015 2:09:09 PM
Look at when you're calling execute - that's before you build the request properly! Just reorder your code so that you fully build the request, then you post it to get a response, then you use the response. (I'd also be personally... more 9/18/2015 2:01:13 PM
This is the problem: string Date = ds1.Tables[0].Rows[0]["Date"].ToString(); Your Date variable is already a string, so trying to format that as if it's a DateTime isn't going to work. You want something like: DateTime Date =... more 9/17/2015 2:45:02 PM
No, the only difference between daemon threads and non-daemon threads in Java is that a non-daemon thread prevents the JVM from terminating, whereas a daemon one doesn't: once all non-daemon threads have completed, the JVM will exit. more 9/17/2015 1:30:28 PM
I wonder whether Action<T> prevents an enclosing class instance to be garbage collected when all other references to such class instance are removed during runtime? No. If the delegate instance were still referenced elsewhere,... more 9/17/2015 9:48:54 AM