Browsing 7239 questions and answers with Jon Skeet
Yes, it's easy to deadlock, without actually accessing any data: private readonly object lock1 = new object(); private readonly object lock2 = new object(); public void Method1() { lock(lock1) { Thread.Sleep(1000); ... more 7/2/2015 7:27:49 PM
The ResultSet documentation states: The docs do say "For maximum portability, result set columns within each row should be read in left-to-right order, and each column should be read only once." So technically, it's somewhat... more 7/2/2015 7:25:25 PM
why output is not giving expected result i.e. 25 Because you have two different objects, each with an independent a field. You're setting the value to 5 in one object, but then calling multi() on the other object, so it's using the... more 7/2/2015 4:25:29 PM
One way would be to mock the result of calling IService1.A and IService2.B, in exactly the same way as if you were calling them directly. You could then check that when you call the returned delegate, you get the expected answer (and that... more 7/2/2015 4:14:22 PM
But there is no range specified in list No, there's an index specified (as an argument), and that's what's out of range. Look at your code: list[0].Add("Hussam"); That's trying to use the first list in list - but is list is empty,... more 7/2/2015 2:41:16 PM
You can use the overload of parse which takes a ParsePosition: public static Date parseDate(final String dateString, final String[] acceptedFormats) { ParsePosition position = new ParsePosition(0); for (String format :... more 7/2/2015 2:39:14 PM
Well yes, "0" isn't a valid value for a Boolean. It sounds like you possibly want something like: List<NavigationData> nds = new List<NavigationData>(); foreach (dynamic cnav in (IEnumerable)c.Navigations) { NavigationData... more 7/2/2015 8:14:46 AM
Your code appears to expect Raster.getPixels to produce a result in columns, like this: 0 3 6 1 4 7 2 5 8 But I believe it actually does it in rows, like this: 0 1 2 3 4 5 6 7 8 So basically, where you currently have... more 7/2/2015 6:07:35 AM
First, let's make it simpler - this has nothing to do with Android directly, and you don't need your A class at all. Here's what you want: class Outer { abstract class Inner { } } class Child extends Outer.Inner { } That... more 7/2/2015 5:53:34 AM
You have three threads running concurrently, all mutating shared state in an unsafe way: The increment isn't atomic, in that it's "read, locally increment, write" - if multiple threads read the same value, then each locally increment,... more 7/1/2015 12:52:24 PM