Beispiel #1
0
 public void OfCloudArray()
 {
     FSharpFunc <int[], bool> .FromConverter(xs =>
     {
         var ca = this.Run(CloudVector.New(xs, 100));
         var x  = ca.AsCloudFlow().Select(i => i + 1).ToArray();
         var y  = xs.Select(i => i + 1).ToArray();
         return(this.Run(x).SequenceEqual(y));
     }).QuickThrowOnFail(this.MaxNumberOfTests);
 }
Beispiel #2
0
        public static IEnumerable <Tuple <string, long> > RunWithCloudVector(MBraceRuntime runtime)
        {
            var lines = files.SelectMany(path => File.ReadLines(path));
            // Temporary : No C# API for Standalone runtime and StoreClient.
            var vector = runtime.RunLocally(CloudVector.New(lines, 100L), null);

            var count = 20;

            var query = vector
                        .AsCloudFlow()
                        .SelectMany(line => line.SplitWords().Select(WordTransform))
                        .Where(WordFilter)
                        .CountBy(w => w)
                        .OrderBy(t => - t.Item2, count)
                        .ToArray();

            var result = runtime.Run(query, null, null);

            return(result);
        }