Browsing 7239 questions and answers with Jon Skeet
Dictionary<,> instances don't have "indexes" - you shouldn't treat them as ordered at all. Any order you may happen to notice when iterating over entries should be seen as an implementation detail. If you want a specific order,... more 10/3/2013 12:04:57 PM
The problem has nothing to do with try/catch, and everything to do with this loop: for (int i = 0; i < list.size(); i++) { System.out.println("deleted item: " + list.get(oldsize)); list.remove(i); } That will only remove... more 10/3/2013 8:22:01 AM
Calendar.HOUR, Calendar.HOUR_OF_DAY etc are just constants used to identify aspects of a date/time. They're typically used like this: Calendar calendar = Calendar.getInstance(); int hour = calendar.get(Calendar.HOUR_OF_DAY); I can't... more 10/3/2013 7:49:17 AM
I think you can just derive from the ExpressionVisitor class in a simple way. Here's a proof of concept - it may be overly simplistic, but I think it's what you're after: using System; using System.Linq.Expressions; class Test { ... more 10/3/2013 6:11:54 AM
You're trying to call the delegate's Invoke method, but on a Tester.Main instance. That's just wrong - because the Tester.Main instance isn't an instance of the appropriate delegate. If you're trying to actually raise the gameVideoLoader... more 10/3/2013 5:49:30 AM
The problem is that the VTEST_FSUB<V> constructor body is executing before the VTEST_RUN constructor body. So when do_virtual is called, localSMT is still null. Then do_virtual tries to call a method on localSMT, hence the... more 10/2/2013 8:04:02 PM
In that I have 3 thread which should be run sequentially. Well you're not running sequentially - you're running the three concurrently, which is the nature of what happens when you start three separate threads. Those threads aren't... more 10/2/2013 7:46:24 PM
It's because that's invalid syntax - you want to call string.IsNullOrWhiteSpace and invert the result: .Where(txt => !string.IsNullOrWhiteSpace(txt.Text)) Currently you've got the ! in the middle of the method invocation, which is... more 10/2/2013 6:57:12 PM
Personally I'd use LINQ: var files = mySFI.Select(x => x.Filename) .ToArray(); Alternatively, there's Array.ConvertAll: var files = Array.ConvertAll(mySFI, x => x.Filename); As an aside, I would strongly advise... more 10/2/2013 6:54:48 PM
Will this make all the values in obj_list have the property 55? Yes - assuming MyClass really is a class. Imagine that the list is really an addressbook - there's the address of a house on every page (element). The list doesn't... more 10/2/2013 5:47:42 PM