Click here to Skip to main content
15,915,873 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Apache configuration files parser Pin
Dave Kreskowiak4-Jun-10 8:53
mveDave Kreskowiak4-Jun-10 8:53 
GeneralRe: Apache configuration files parser Pin
Murr@y4-Jun-10 18:38
Murr@y4-Jun-10 18:38 
GeneralRe: Apache configuration files parser Pin
Dave Kreskowiak4-Jun-10 19:16
mveDave Kreskowiak4-Jun-10 19:16 
QuestionVB.Net syntax. Pin
priyamtheone4-Jun-10 6:27
priyamtheone4-Jun-10 6:27 
AnswerRe: VB.Net syntax. Pin
Smithers-Jones4-Jun-10 7:42
Smithers-Jones4-Jun-10 7:42 
GeneralRe: VB.Net syntax. Pin
priyamtheone6-Jun-10 4:23
priyamtheone6-Jun-10 4:23 
AnswerRe: VB.Net syntax. Pin
mvdcorput11-Jun-10 23:02
mvdcorput11-Jun-10 23:02 
QuestionSingle Value Aggregation with PLINQ Pin
Agarwaen594-Jun-10 1:38
Agarwaen594-Jun-10 1:38 
Greetings everyone,

I'm going through Stephen Toub's book "Patterns of Parallel programming" to try and figure out the different tips and tricks of parallel programming.
Besides having found few minor errors in the book already, I'm stuck on the example described on page 71:

Public Const NUM_STEPS As Integer = 1000000
Shared Function ParallelLinqPi() As Double
Dim [step] = 1.0 / CDbl(NUM_STEPS)
Return ParallelEnumerable.Range(0, NUM_STEPS).Select(
Function(i)
Dim x = (i + 0.5) * [step]
Return 4.0 / (1.0 + x * x)
End Function).Sum() * [step]
End Function

The VS underlines this whole chunk of code and explains the following:
"Overload resolution failed because no accessible 'Sum' accepts this number of arguments."
Apparently, the Sum() function at the end needs to have a selector (selector As System.Func(of Object,Double)). There is no mention of this in the book =(

What should I write inside the Sum, to make this example work, any ideas?
Thanks...

Agarwaen
AnswerRe: Single Value Aggregation with PLINQ Pin
Dave Kreskowiak4-Jun-10 8:38
mveDave Kreskowiak4-Jun-10 8:38 
GeneralRe: Single Value Aggregation with PLINQ Pin
Agarwaen596-Jun-10 5:40
Agarwaen596-Jun-10 5:40 
GeneralRe: Single Value Aggregation with PLINQ Pin
Dave Kreskowiak6-Jun-10 7:00
mveDave Kreskowiak6-Jun-10 7:00 
GeneralRe: Single Value Aggregation with PLINQ Pin
Agarwaen596-Jun-10 7:06
Agarwaen596-Jun-10 7:06 
GeneralRe: Single Value Aggregation with PLINQ Pin
Dave Kreskowiak6-Jun-10 8:27
mveDave Kreskowiak6-Jun-10 8:27 
QuestionParameter passing from a combo to Stored procedure Pin
Sabui4-Jun-10 1:10
Sabui4-Jun-10 1:10 
AnswerRe: Parameter passing from a combo to Stored procedure Pin
Johnny J.4-Jun-10 1:19
professionalJohnny J.4-Jun-10 1:19 
QuestionHow to Set different forecolor to numbers between 0-9. Pin
mdrizwan_14-Jun-10 0:31
mdrizwan_14-Jun-10 0:31 
AnswerRe: How to Set different forecolor to numbers between 0-9. Pin
Dave Kreskowiak4-Jun-10 2:07
mveDave Kreskowiak4-Jun-10 2:07 
GeneralRe: How to Set different forecolor to numbers between 0-9. Pin
mdrizwan_14-Jun-10 2:43
mdrizwan_14-Jun-10 2:43 
GeneralRe: How to Set different forecolor to numbers between 0-9. Pin
Dave Kreskowiak4-Jun-10 4:34
mveDave Kreskowiak4-Jun-10 4:34 
GeneralRe: How to Set different forecolor to numbers between 0-9. Pin
mdrizwan_14-Jun-10 21:13
mdrizwan_14-Jun-10 21:13 
GeneralRe: How to Set different forecolor to numbers between 0-9. Pin
Dave Kreskowiak5-Jun-10 2:10
mveDave Kreskowiak5-Jun-10 2:10 
GeneralRe: How to Set different forecolor to numbers between 0-9. Pin
mdrizwan_15-Jun-10 2:20
mdrizwan_15-Jun-10 2:20 
QuestionHow To Sort DataGridView Pin
Thaer Hamael2-Jun-10 19:55
Thaer Hamael2-Jun-10 19:55 
AnswerRe: How To Sort DataGridView Pin
Chris C-B2-Jun-10 20:13
Chris C-B2-Jun-10 20:13 
AnswerRe: How To Sort DataGridView Pin
Abhinav S2-Jun-10 20:19
Abhinav S2-Jun-10 20:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.