Browsing 7239 questions and answers with Jon Skeet
You can use Skip/Zip to end up with triples. For example: var triples = list.Zip(list.Skip(1).Zip(list.Skip(2), (b, c) => new { b, c }), (a, bc) => new { a, bc.b, bc.c }); (That may have some errors - I... more 1/28/2014 5:36:09 PM
You don't need PredicateBuilder at all. You just need to understand that the result of a join is effectively a sequence of pairs: DateTime memberCutoff = ...; DateTime orderCutoff = ...; var query = context.Customers ... more 1/28/2014 5:31:43 PM
Invoking the member is done as normal - but you can then cast the result to IList: IList array = (IList) type.InvokeMember(...); object firstElement = array[0]; (All arrays implement IList, which is slightly simper to use in this case... more 1/28/2014 4:53:23 PM
No, the code belongs to the class, and will only be represented once. The array and the objects don't even exist until execution time - given that the size of the array could vary, the executable file couldn't possibly contain the code... more 1/28/2014 4:42:34 PM
This is the problem: String cLine = bf.readLine(); while (cLine != null) { list.add(cLine); } You're not reading the next line in your loop (the value of cLine never changes) - so it's just going to loop forever. You want: String... more 1/28/2014 2:53:04 PM
Well, firstly I'd use Task.Run instead of Task.Factory.StartNew, just for simplicity :) The next thing is to consider holding onto these tasks not to await them immediately, but so that you can know when they've all finished in order to... more 1/28/2014 12:33:55 AM
The problem is that your lambda expression is capturing the variable i, rather than its value for that iteration of the loop. There are two options: Capture a copy for (int i = 0; i < files.Length; i++) { int copy = i; ... more 1/28/2014 12:04:37 AM
why does the output comes 5,5? Because A.display() only knows about the fields A.a and A.b. Those are the only fields that any code in A knows about. It looks like you expect the declarations in B to "override" the existing field... more 1/27/2014 10:08:43 AM
Your code is currently broken - you've got two variables called berichten, one of which is a local variable within the method, and one of which is an instance variable in the class. You're returning the value of the local variable, but... more 1/27/2014 8:16:56 AM
The problem is that the element in fileFormatObj is an Object[], not a BigDecimal. Therefore you can't convert fileFormatObj to a BigDecimal[]. You can't even convert it to a BigDecimal[][] (as an Object[] isn't a BigDecimal[]) but at the... more 1/27/2014 7:35:14 AM