Browsing 7239 questions and answers with Jon Skeet
But if I try to use switch-case statement like the following, it warns the value getResources().getString(R.string.sunday) assigned to curStrDayOfWeek is never used. And it's absolutely right - because you'd immediately fall through... more 4/26/2015 12:20:02 PM
However, in my program both the threads are executing simultaneously. Thread1 is not waiting for Thread2 to finish its execution. No, and it wouldn't - because thread 1 isn't calling join. Look at the docs you quoted again: A call... more 4/26/2015 7:36:38 AM
You're using lines[i + 3] in the loop, but your check only ensures that i + 2 is in range - and the fact that you're using 4 values in the loop rather than 4 makes it look like this should probably be: for (var i = 12; i + 3 <... more 4/26/2015 6:45:33 AM
Well presumably you've got two keys: one for the outer dictionary and one for the nested one. So assuming you know that the entry is present, you can use dict[outerKey].Remove(innerKey); If you don't know whether the entry exists, you... more 4/25/2015 7:49:08 PM
The error you're getting has nothing to do with JSON. It is because you're trying to create an instance of an interface. You could just fix that by giving it the concrete List<T> class: IList<News> content = new... more 4/25/2015 6:59:38 PM
Just group by the Day property of the DateTime value, after adjusting the date/time accordingly by 7 hours. Of course, if you actually have multiple months/years involved, that will give you somewhat odd results, but... .GroupBy(row =>... more 4/25/2015 9:49:11 AM
They're entirely different. A using directive of that form only tells the compiler to make members of the given namespace available as simple names. It has no effect at execution time - if you didn't have any using directives and just... more 4/25/2015 9:43:20 AM
That code is unfortunately written - KeyPressEventArgs.KeyChar basically returns the character pressed (so shift-a will return 'A' for example). 13 is just the Unicode character for "carriage return" which is returned when the user hits... more 4/25/2015 9:41:08 AM
Your method returns an appropriate expression tree already - you just need to call it, not call it in a lambda expression: var filteredInvoices = invoices.Where(Invoice.IsAllocated()); more 4/24/2015 8:00:29 PM
You're calling retrieveMessages() multiple times. It doesn't help that you haven't shown us what that does, but I suspect you want to call it once and store the result in a local variable. At the moment, I suspect you're calling next() on... more 4/24/2015 7:12:36 PM