From 3f1f6630525f75e17d87441470e71e8cd9e0c5d6 Mon Sep 17 00:00:00 2001 From: Andy Konwinski Date: Tue, 20 May 2014 21:02:48 +0000 Subject: fix bug in pi example replacing ()'s with {}'s --- examples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples.md') diff --git a/examples.md b/examples.md index ec381c124..92253c184 100644 --- a/examples.md +++ b/examples.md @@ -167,11 +167,11 @@ In this example, we search through the error messages in a log file:
- val count = spark.parallelize(1 to NUM_SAMPLES).map(i =>
+ val count = spark.parallelize(1 to NUM_SAMPLES).map{i =>
  val x = Math.random()
  val y = Math.random()
  if (x*x + y*y < 1) 1 else 0
-
).reduce(_ + _)
+
}.reduce(_ + _)
println("Pi is roughly " + 4.0 * count / NUM_SAMPLES)
-- cgit v1.2.3