Browsing 7239 questions and answers with Jon Skeet
When you fetch the vertex using the IList<T> indexer, that will return a copy of the value. Changing that copy wouldn't change the list - so the compiler stops you from writing incorrect code. Options: Make vertex a class instead... more 10/16/2013 3:54:56 PM
I don't understand is how we know which class the method is extending. Is it the class that has this preceding it? Yes. It's always the first parameter of the method. You can't decorate any other parameter with this. (And it's the... more 10/16/2013 3:21:36 PM
I understand that Static members can cause concurrency issues in ASP.Net or any other .net based system where multiple users will access and use the same threads. Well only if it modifies shared state, or performs some sort of... more 10/16/2013 8:27:39 AM
I'm surprised that the current code is causing a stack overflow, but even if it weren't it couldn't work. Currently you're calling your local method from within your query: that's not going to work, as it can't be converted into... more 10/16/2013 7:19:54 AM
You wouldn't add the key inside the inner loop - it's not part of the data you're looping over. You need to add it before the loop: row.createCell(0).setCellValue(key); // Key is in column 0 int cellNum = 1; // Values now start at column... more 10/16/2013 6:02:17 AM
Well presumably you just need to parse each element. But why not just add them to an ArrayList<Short>? List<Short> shortList = new ArrayList<Short>(stringArray.length); for (int i = 0; i < stringArray.length; i++) { ... more 10/15/2013 10:31:12 PM
Yes, this is the problem: for (int i = 0; i < luvut.Length; i++) { if (luvut[i] - ka < luvut[i + 1] - ka) When i is luvut.Length - 1, then i + 1 will be luvut.Length - and therefore an invalid index. (For an array of length x,... more 10/15/2013 9:21:05 PM
The problem is that nextInt doesn't consume the line - just the integer. So you're actually getting labels of "", "one", "two" and "three" - and then it's trying to read the "four" as the first data element (with nextInt). If you type... more 10/15/2013 7:44:23 PM
string is just the name of the type. You want an expression of type Type - in other words, a reference to an instance of Type for the relevant type. The simplest way to get that is with the typeof... more 10/15/2013 7:33:05 PM
Well I can work out the problem - but not a pleasant solution. Your activity indirectly subclasses ContextWrapper, which overrides getPackageName. The Geocoder creates a GeocoderParams with the given context (this in your case) and that... more 10/15/2013 6:00:17 PM