Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: samples/third_party/dromaeo/web/tests/Common.dart

Issue 1576153002: Remove the Dromaeo and TodoMVC samples. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 part of dromaeo;
2
3 class Result {
4 int get runs { return _sorted.length; }
5
6 double get sum {
7 double result = 0.0;
8 _sorted.forEach((double e) { result += e; });
9 return result;
10 }
11
12 double get min { return _sorted[0]; }
13 double get max { return _sorted[runs - 1]; }
14
15 double get mean { return sum / runs; }
16
17 double get median {
18 return (runs % 2 == 0) ?
19 (_sorted[runs ~/ 2] + _sorted[runs ~/ 2 + 1]) / 2 : _sorted[runs ~/ 2];
20 }
21
22 double get variance {
23 double m = mean;
24 double result = 0.0;
25 _sorted.forEach((double e) { result += Math.pow(e - m, 2.0); });
26 return result / (runs - 1);
27 }
28
29 double get deviation { return Math.sqrt(variance); }
30
31 // Compute Standard Errors Mean
32 double get sem { return (deviation / Math.sqrt(runs)) * T_DISTRIBUTION; }
33
34 double get error { return (sem / mean) * 100; }
35
36 // TODO: Implement writeOn.
37 String toString() {
38 return '[Result: mean = ${mean}]';
39 }
40
41 factory Result(List<double> runsPerSecond) {
42 runsPerSecond.sort((a, b) => a.compareTo(b));
43 return new Result._internal(runsPerSecond);
44 }
45
46 Result._internal(this._sorted) {}
47
48 List<double> _sorted;
49
50 // Populated from: http://www.medcalc.be/manual/t-distribution.php
51 // 95% confidence for N - 1 = 4
52 static const double T_DISTRIBUTION = 2.776;
53 }
OLDNEW
« no previous file with comments | « samples/third_party/dromaeo/web/test-tail.html ('k') | samples/third_party/dromaeo/web/tests/RunnerSuite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698