OLD | NEW |
---|---|
1 (function(){ | 1 (function(){ |
2 | 2 |
3 // Populated from: http://www.medcalc.be/manual/t-distribution.php | 3 // Populated from: http://www.medcalc.be/manual/t-distribution.php |
4 // 95% confidence for N - 1 = 4 | 4 // 95% confidence for N - 1 = 4 |
5 var tDistribution = 2.776; | 5 var tDistribution = 2.776; |
6 | 6 |
7 // The number of individual test iterations to do | 7 // The number of individual test iterations to do |
8 var numTests = 5; | 8 var numTests = 5; |
9 | 9 |
10 // The type of run that we're doing (options are "runs/s" or "ms") | 10 // The type of run that we're doing (options are "runs/s" or "ms") |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 var testNames = {}; | 224 var testNames = {}; |
225 var testVersions = {}; | 225 var testVersions = {}; |
226 var dataStore = []; | 226 var dataStore = []; |
227 var names = []; | 227 var names = []; |
228 var interval; | 228 var interval; |
229 var totalTime = 0; | 229 var totalTime = 0; |
230 var time = 0; | 230 var time = 0; |
231 var title, testName, testID, testSummary = {} , testSummaryNum = {}, max Total = 0, maxTotalNum = 0; | 231 var title, testName, testID, testSummary = {} , testSummaryNum = {}, max Total = 0, maxTotalNum = 0; |
232 var nameDone = {}; | 232 var nameDone = {}; |
233 var automated = false; | 233 var automated = false; |
234 var post_json = false; | |
234 | 235 |
235 // Query String Parsing | 236 // Query String Parsing |
236 var search = (window.location.search || "?").substr(1); | 237 var search = (window.location.search || "?").substr(1); |
237 | 238 |
238 search = search.replace(/&runStyle=([^&]+)/, function(all, type){ | 239 search = search.replace(/&runStyle=([^&]+)/, function(all, type){ |
239 runStyle = type; | 240 runStyle = type; |
240 return ""; | 241 return ""; |
241 }); | 242 }); |
242 | 243 |
243 var parts = search.split("&"); | 244 var parts = search.split("&"); |
(...skipping 20 matching lines...) Expand all Loading... | |
264 doShark = function(name) { | 265 doShark = function(name) { |
265 return sharkMatch.test(name); | 266 return sharkMatch.test(name); |
266 }; | 267 }; |
267 } | 268 } |
268 } | 269 } |
269 | 270 |
270 m = /^numTests=(\d+)$/.exec(parts[i]); | 271 m = /^numTests=(\d+)$/.exec(parts[i]); |
271 if (m) | 272 if (m) |
272 numTests = Number(m[1]); | 273 numTests = Number(m[1]); |
273 | 274 |
274 » » automated = /^automated$/.exec(parts[i]); | 275 » » if (/^automated$/.exec(parts[i])) |
276 » » » automated = true; | |
antonm
2009/12/22 17:07:53
why not as before---automated = /^automated/...?
pavel.podivilov
2009/12/22 17:19:29
In fact automated = /^automated/... will not work
| |
277 » » if (/^post_json$/.exec(parts[i])) | |
278 » » » post_json = true; | |
275 } | 279 } |
276 | 280 |
277 jQuery(function(){ | 281 jQuery(function(){ |
278 var id = search.match(/id=([\d,]+)/); | 282 var id = search.match(/id=([\d,]+)/); |
279 | 283 |
280 if ( none && !id ) { | 284 if ( none && !id ) { |
281 $("#overview").hide(); | 285 $("#overview").hide(); |
282 return; | 286 return; |
283 } | 287 } |
284 | 288 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 queue.shift()(); | 360 queue.shift()(); |
357 | 361 |
358 } else if ( queue.length == 0 ) { | 362 } else if ( queue.length == 0 ) { |
359 interval = false; | 363 interval = false; |
360 time = 0; | 364 time = 0; |
361 | 365 |
362 $("#overview input").remove(); | 366 $("#overview input").remove(); |
363 updateTimebar(); | 367 updateTimebar(); |
364 | 368 |
365 if ( dataStore && dataStore.length ) { | 369 if ( dataStore && dataStore.length ) { |
366 » » » » if (!automated) { | 370 » » » » if (!automated || post_json) { |
367 $("body").addClass("alldone"); | 371 $("body").addClass("alldone"); |
368 var div = jQuery("<div class='results'>S aving...</div>").insertBefore("#overview"); | 372 var div = jQuery("<div class='results'>S aving...</div>").insertBefore("#overview"); |
369 jQuery.ajax({ | 373 jQuery.ajax({ |
370 type: "POST", | 374 type: "POST", |
371 url: "store.php", | 375 url: "store.php", |
372 data: "data=" + encodeURICompone nt(JSON.stringify(dataStore)) + "&style=" + runStyle, | 376 data: "data=" + encodeURICompone nt(JSON.stringify(dataStore)) + "&style=" + runStyle, |
373 success: function(id){ | 377 success: function(id){ |
374 var url = window.locatio n.href.replace(/\?.*$/, "") + "?id=" + id; | 378 var url = window.locatio n.href.replace(/\?.*$/, "") + "?id=" + id; |
375 div.html("Results saved. You can access them at a later time at the following URL:<br/><strong><a href=' " + url + "'>" + url + "</a></strong></div>"); | 379 div.html("Results saved. You can access them at a later time at the following URL:<br/><strong><a href=' " + url + "'>" + url + "</a></strong></div>"); |
376 } | 380 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
806 var means = aggregated[name]; | 810 var means = aggregated[name]; |
807 var sum = 0; | 811 var sum = 0; |
808 for (var i = 0; i < means.length; i++) sum += me ans[i]; | 812 for (var i = 0; i < means.length; i++) sum += me ans[i]; |
809 results[name] = Math.pow(Math.E, sum/means.lengt h).toString(); | 813 results[name] = Math.pow(Math.E, sum/means.lengt h).toString(); |
810 } | 814 } |
811 | 815 |
812 return results; | 816 return results; |
813 } | 817 } |
814 } | 818 } |
815 })(); | 819 })(); |
OLD | NEW |