14 questions
1
vote
1
answer
94
views
Has ContinueWith()'s body a chance of being invoked before ContinueWith() returns the related Task?
I have a synchronized Task list populated, for monitoring purposes.
I want to progressively remove the completed tasks from the list. To do so I resolved to use Continuation tasks like so:
//remove ...
2
votes
1
answer
327
views
Where is stored captured variable in Java?
I'm trying to understand concept of captured variable in Java.
I found quite detailed article about it: http://www.devcodenote.com/2015/04/variable-capture-in-java.html
and I'm not sure about ...
0
votes
0
answers
61
views
Why can't I see captured variable behavior here? [duplicate]
I encountered this strange behavior with captured variables. Below are two loops. I would expect both to behave the same. Why it behaves differently?
private static void Loop1()
{
...
5
votes
1
answer
113
views
Captured variables in ParameterizedThreadStart
I have the following code that creates 10 threads which in turn write out messages to the console:
for (int i = 0; i < 10; i++)
{
{
Thread thread = new Thread((threadNumber) =>
...
0
votes
3
answers
526
views
How to compute rank of IEnumerable<T> and store it in type T
I want to compute rank of element in an IEnumerable list and assign it to the member. But below code works only when called 1st time. 2nd time call starts from last rank value. So instead of output ...
2
votes
1
answer
1k
views
Combine two regex groups into a key/value pair object?
Let's say that I have the following string
Type="Category" Position="Top" Child="3" ABC="XYZ"....
And 2 regex groups: Key and Value
Key: "Type", "Position", "Child",...
Value: "Category", "Top", "3",...
1
vote
3
answers
437
views
Captured variable instantiating problem
I'm currently musing about some idea I can't get right.
The problem is that I want to use one lambda function to instantiate a captured variable and another lambda to access a property of that ...