Browsing 7239 questions and answers with Jon Skeet
If all the elements are actually of type SelectVacancyDetails_Result (not SelectVacancyDetails_ResultExtend) then you can't just cast. The simplest approach would be to create a constructor in SelectVacancyDetails_ResultExtend which copied... more 10/2/2015 8:44:39 AM
This has nothing to do with async/await, really. You're calling BeginInvoke here: Prime1.Dispatcher.BeginInvoke( (Action)(()=>{ Prime1.Text += i.ToString() + ", "; })); ... and your lambda expression uses i, which means it will... more 10/1/2015 8:50:42 PM
No, there's nothing standardized around this. You might want to consider just not exposing code like that though - or only exposing it in beta builds etc. more 10/1/2015 5:46:33 PM
Your code looks like it's trying to declare n[i] as a variable. You don't need to do that, because n is already declared. You just need an assignment to the array element: n[i] = new SomeClass(1, 5, 6); ... but you'll also need to... more 10/1/2015 1:01:20 PM
Stephen has provided an explanation in the comment. Basically, java.util.Date uses a calendar system which cuts over between the Julian calendar system and the Gregorian calendar system in 1582, skipping 10 days. So dates in 1582 or before... more 10/1/2015 8:16:08 AM
Rather than flushing the writer, I suggest you close it completely. That way the GZipStream knows there's no more data to write and can add any appropriate checksums or whatever it needs to do. You could either call Close explicitly, or... more 9/30/2015 4:19:40 PM
Well, if the old application has been loaded using an older version of .NET that doesn't support the newer assembly, then no. It's a bit like trying to run a 64-bit binary on a 32-bit operating system. The simplest solution would probably... more 9/30/2015 2:54:10 PM
The problem is that the type of ViewBag.ExamReviews is dynamic, so the compiler doesn't know what to do with your lambda expression. Just cast that part so you can use LINQ on it as normal: var requests =... more 9/30/2015 2:36:01 PM
Assuming you only know the element type at execution time, I think you're looking for Array.newInstance. Object intArray = Array.newInstance(int.class, 10); Object stringArray = Array.newInstance(String.class, 10); (That will create an... more 9/30/2015 6:27:29 AM
Let's get rid of some of the local variables to make it clearer why this is happening: for (j = 1; j <= u.length; j++) { for (i = 1; i <= v.length; i++) { if (u[i - 1] == v[j - 1]) { tracker = 0; }... more 9/30/2015 6:13:35 AM