code: function run(spark) {
  
     var sc=spark.sparkContext();
      var slices = 50;
  
      var n = 10000 * slices;
      var l = [];
      for (var i = 0; i < n; i++) {
          l.push(i);
      }
  
  
      var dataSet = sc.parallelize(l, slices);
  
  
      var count = dataSet.map(function (i) {
          var x = Math.random() * 2 - 1;
          var y = Math.random() * 2 - 1;
          return (x * x + y * y < 1) ? 1 : 0;
      }).reduce(function (int1, int2) {
          return int1 + int2;
      });
  
      return (4.0 * count / n)
  
  }
docs: /*
  Usage:
  bin/eclairjs.sh examples/spark_pi.js"
   
  Computes an approximation to pi