1define(function (require, exports, module) { 2 /* 3 * å ¬å ±å·¥å · Tool 4 */ 5 exports.Tool = { 6 TimeFunction: function (dateTime) { 7 if (dateTime == null || dateTime == '' || typeof (dateTime) == undefined) { 8 return { 9 'date': 'null', 10 'time': 'null', 11 'dateTime': 'null' 12 } 13 } 14 var $this = this; 15 var dateTime = new Date(dateTime); 16 var year1 = dateTime.getFullYear(); 17 var month1 = dateTime.getMonth() + 1; 18 var date1 = dateTime.getDate(); 19 var hour1 = dateTime.getHours(); 20 var minute1 = dateTime.getMinutes(); 21 var second1 = dateTime.getSeconds(); 22 var month2, date2, hour2, minute2, second2; 23 month2 = $this.appendZero(month1); 24 date2 = $this.appendZero(date1); 25 hour2 = $this.appendZero(hour1); 26 minute2 = $this.appendZero(minute1); 27 second2 = $this.appendZero(second1); 28 var finalDate = [year1, month2, date2].join('-'); 29 var fileDate = [year1, month2, date2].join(''); 30 var finalTime = [hour2, minute2, second2].join(':'); 31 var fileTime = [hour2, minute2].join('-'); 32 return { 33 'date': finalDate, 34 'time': finalTime, 35 'dateTime': finalDate + ' ' + finalTime, 36 'fileTime': fileDate + ' ' + fileTime, 37 'year': year1, 38 'month': [year1, month2].join('-'), 39 } 40 }, 41 appendZero: function (numbers) { 42 if (numbers < 10) { 43 return "0" + numbers; 44 } else { 45 return numbers; 46 } 47 }, 48 substringResult: function (stringResult) { 49 var stringResult = stringResult; 50 var indexNumber = stringResult.indexOf('_') + 1; 51 var leftResult = stringResult.substring(0, indexNumber - 1); 52 var rightResult = stringResult.substring(indexNumber); 53 return { 54 leftResult: leftResult, 55 rightResult: rightResult 56 }; 57 }, 58 bindScroll: function (_this) { //è·åæ»å¨äºä»¶ï¼æ ¹æ®æ»å¨æ¡ä½ç½®æ¥å³å®æé®æ¾ç¤ºä¸å¦ 59 _this.scroll(function () { 60 var len = $(this).scrollTop(); //è·åæ»å¨æ¡é«åº¦ 61 if (len >= 100) { 62 //æ¾ç¤ºåå°é¡¶é¨æé® 63 $('.backTop').fadeIn('1000'); 64 } else { 65 //éèåå°é¡¶é¨æé® 66 $('.backTop').fadeOut('1000'); 67 } 68 }); 69 }, 70 myBrowser: function () { 71 var userAgent = navigator.userAgent; //å徿µè§å¨çuserAgentå符串 72 var isOpera = userAgent.indexOf("Opera") > -1; 73 var isChrome = userAgent.indexOf("Chrome") > -1; 74 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; 75 if (isOpera) { 76 return "Opera" 77 }; //夿æ¯å¦Operaæµè§å¨ 78 if (userAgent.indexOf("Edge") > -1) { 79 return "Edge"; 80 } //夿æ¯å¦Edgeæµè§å¨ 81 if (userAgent.indexOf("Firefox") > -1) { 82 return "FF"; 83 } //夿æ¯å¦Firefoxæµè§å¨ 84 if (userAgent.indexOf("Chrome") > -1) { 85 return "Chrome"; 86 } 87 if (userAgent.indexOf("Safari") > -1) { 88 return "Safari"; 89 } //夿æ¯å¦Safariæµè§å¨ 90 if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) { 91 return "IE"; 92 }; //夿æ¯å¦IEæµè§å¨ 93 if (isIE == undefined) { 94 return "IE"; 95 }; 96 }, 97 tableScroll: function (widths) { 98 var boxWidth = widths - ($('.troublesome')[0].offsetWidth - $('.troublesome')[0].scrollWidth);
99 // $('.tableAhpBox').width(boxWidth); 100 // $('.tableAhpBox table').width(boxWidth - 1); 101 // $('.WordAnalysis').width(boxWidth); 102 // $('.GraphDraw').width(boxWidth); 103 }, 104 Sizejquery: function () { //é«åº¦å½æ°è¢«è°ç¨ 105 exports.Tool.bindScroll($('.troublesome')); 106 exports.Tool.getCopyAnalysis(); 107 // console.log('é«åº¦å½æ°è¢«è°ç¨'); 108 var rightTop = $("#right").offset().top; 109 var dealwith = $("#height").offset().top; 110 var winhei = window.innerHeight; 111 var dealheigth = winhei - dealwith - 15; 112 var leftlisttdlenght = $('#dealwith').find(".leftlisttd"); 113 $("#right").height(winhei - rightTop - 15); 114 $(".dealwith").height(dealheigth); 115 if ($(".tablerow .lefts .leftsoverflowhidden").hasClass('changeHeight')) { 116 $(".tablerow .lefts .leftsoverflowhidden").height(winhei - rightTop - 70); 117 } else { 118 $(".tablerow .lefts .leftsoverflowhidden").height(winhei - rightTop - 15); 119 } 120 if ("FF" == exports.Tool.myBrowser() || "IE" == exports.Tool.myBrowser() || "Edge" == exports.Tool.myBrowser() || "Safari" == exports.Tool.myBrowser()) { 121 $("#Label_processing").children().css({ 122 "display": "table-header-group", 123 "width": "100%", 124 "height": "100%" 125 }).children('.Label_processing_right').css({ 126 "vertical-align": "top", 127 "padding": "0 15px 55px" 128 }); 129 130 $("#coding").children().css({ 131 "display": "table-header-group", 132 "width": "100%", 133 "height": "100%" 134 }).children('.Label_processing_right').css({ 135 "vertical-align": "top", 136 "padding": "0 15px 55px" 137 }); 138 139 $("#variable").children().css({ 140 "display": "table-header-group", 141 "width": "100%", 142 "height": "100%" 143 }).children('.Label_processing_left').css({ 144 "padding": "0 15px" 145 }).children('.helpless').css({ 146 "padding": "45px 0 0" 147 }).children('.statisticsp').css({ 148 'margin-top': '-40px', 149 'margin-bottom': '5px' 150 }); 151 $("#variable").find('.Label_processing_right').css({ 152 "vertical-align": "top", 153 "padding": "0 15px 55px" 154 }); 155 $("#exceptonValue").children().css({ 156 "display": "table-header-group", 157 "width": "100%", 158 "height": "100%" 159 }).children('.Label_processing_right').css({ 160 "vertical-align": "top", 161 "padding": "0 15px 55px" 162 }); 163 $("#invalid").children().css({ 164 "display": "table-header-group", 165 "width": "100%", 166 "height": "100%" 167 }).children('.Label_processing_right').css({ 168 "vertical-align": "top", 169 "padding": "0 15px 55px" 170 }); 171 var heightArr = []; 172 // console.log(leftlisttdlenght); 173 $.each(leftlisttdlenght, function (index, listdiv) { 174 var listdivpheight = $(listdiv).parent().height(); 175 heightArr.push(listdivpheight); 176 // console.log(listdivpheight); 177 // console.log($(listdiv).height()); 178 if ("Edge" == exports.Tool.myBrowser() || "Safari" == exports.Tool.myBrowser()) { 179 if ($(listdiv).height() > 60) { 180 // $(listdiv).parent().css({ 181 // "height": "auto" 182 // });//夿³¨æè¿ä¸ª2020å¹´03æ10æ¥ï¼ç°ç¶å¾xæ¾ä¸¤é¡¹æ¶bug æå¯è½å½±åEdgeåSafariå ¨ä½æå¨æ¾å ¥è¡¨æ ¼çå¸å± 183 } 184 $(listdiv).css({ 185 "height": "0" 186 }); 187 188 $(listdiv).css({ 189 // "display": "block", 190 "display": "table-cell", 191 "height": "auto", 192 }); 193 } else { 194 if ($(listdiv).height() > 40) { 195 // $(listdiv).parent().css({ 196 // "height": "auto" 197 // });//夿³¨æè¿ä¸ª2020å¹´03æ10æ¥ï¼ç°ç¶å¾xæ¾ä¸¤é¡¹æ¶bug æå¯è½å½±åFFåIeå ¨ä½æå¨æ¾å ¥è¡¨æ ¼çå¸å± 198 $(listdiv).css({ 199 "height": $(listdiv).height() 200 }); 201 } else { 202 $(listdiv).css({ 203 "height": listdivpheight 204 }); 205 $(listdiv).addClass('firefoxjr'); 206 } 207 // $(listdiv).css({ 208 // "height": "0" 209 // }); 210 211 } 212 213 }); 214 const HARR = heightArr; 215 setTimeout(function () { 216 $.each(leftlisttdlenght, function (index, listdiv) { 217 // console.log(listdiv); 218 var listdivpheight = $(listdiv).parent().height(); 219 if (leftlisttdlenght.length < 2) { 220 $(listdiv).css({ 221 "height": listdivpheight, 222 "overflow-x": "hidden" 223 }).find('ul').css("display", "block"); 224 } else { 225 if ("Safari" == exports.Tool.myBrowser()) { 226 // $(listdiv).parent().css({ 227 // "height": listdivpheight, 228 // "overflow-x": "hidden" 229 // });
230 // $(listdiv).css({ 231 // // "height": "100%" 232 // "height": "auto", 233 // "display": "table-cell" 234 // }); 235 if ($(listdiv).height() < 50) { } else { 236 $(listdiv).css({ 237 "height": listdivpheight, 238 "overflow-x": "hidden" 239 }).find('ul').css("display", "block"); 240 } 241 } 242 if ("Edge" == exports.Tool.myBrowser()) { 243 // $(listdiv).parent().css({ 244 // "height": listdivpheight, 245 // "overflow-x": "hidden" 246 // }); 247 // $(listdiv).css({ 248 // "height": "100%" 249 // }); 250 if ($(listdiv).height() < 50) { } else { 251 $(listdiv).css({ 252 "height": listdivpheight, 253 "overflow-x": "hidden" 254 }).find('ul').css("display", "block"); 255 } 256 } 257 if ("FF" == exports.Tool.myBrowser()) { 258 // if ($(listdiv).height() < 70) { 259 // $(listdiv).css({ 260 // "height": "40px", 261 // "overflow-x": "hidden" 262 // }); 263 // // $(listdiv).parent().next().find(); 264 // } else { 265 // $(listdiv).css({ 266 // "height": listdivpheight, 267 // "overflow-x": "hidden" 268 // }).find('ul').css("display", "block"); 269 // } 270 $(listdiv).css({ 271 "height": HARR[index], 272 "overflow-x": "hidden" 273 }); 274 275 } 276 // if ($(listdiv).height() < 50) { 277 // //$(listdiv).css({"height":"40px","overflow-x":"hidden"}).find('ul').css("display","block"); 278 // } else { 279 // // console.log($(listdiv).height()); 280 // // console.log(listdivpheight); 281 // $(listdiv).css({ 282 // "height": listdivpheight, 283 // "overflow-x": "hidden" 284 // }).find('ul').css("display", "block"); 285 // } 286 } 287 }); 288 }, 250); 289 } 290 setTimeout(function () { 291 var dealwiths = $("#height").offset().top; 292 var winheis = $(window).height(); 293 var dealheigths = winheis - dealwiths - 15; 294 $(".dealwith").height(dealheigths); 295 // $(".dealwith").find('.Label_processing_right').find('.helpless').height(dealheigths - 125); 296 $(".dealwith").find('.Label_processing_left').find('.helpless ul').height(dealheigths - 60); 297 $(".dealwith").find('.Label_processing_right').find('.helpless ul').height(dealheigths - 120); 298 $(".dealwith").find('.Label_processing_right').find('.helplesss').height(dealheigths - 135); 299 // $("#title_treatment").css("height", dealheigths); 300 }, 200); //360éåå貨 å»¶é² å·è¡js 301 setTimeout(function () { 302 if ("FF" == exports.Tool.myBrowser() && leftlisttdlenght.length > 1 && leftlisttdlenght.length < 15) { 303 $(".firefoxjr").css({ 304 "height": '40px' 305 }); 306 $('.firefoxjr').parent().css({ 307 "height": '40px', 308 }); 309 } 310 // $("#title_treatment").css("height", (dealheigth - 10)); 311 // $("#title_treatment").css("height", dealheigth); 312 }, 300); 313 $("#loadshow").hide(); 314 }, 315 ResultsBinding: function (right) { 316 // rocæåä¸ä¸ªè¡¨æ ¼ 317 $(right).on("focus blur propertychange", ".rocTableInput1,.rocTableInput2,.rocTableInput3,.rocTableInput4", function (event) { 318 event.stopPropagation(); 319 if (event.type == "focusin") { 320 $(this).removeClass("rocTableInputRed"); 321 $(this).addClass("rocTableInputBlue"); 322 } else if (event.type == "focusout") { 323 if ($(this).val() != null && $(this).val() != '') { 324 $(this).removeClass("rocTableInputRed"); 325 $(this).removeClass("rocTableInputBlue"); 326 if ($('.rocTableInput1').val() != '' && $('.rocTableInput3').val() != '') { 327 var rocTableResult = $('.rocTableInput1').val() - $('.rocTableInput3').val(); 328 $('#rocTableDifference').text(rocTableResult.toFixed(4)); 329 if ($('.rocTableInput2').val() != '' && $('.rocTableInput4').val() != '') { 330 var rocTableResultZ = ($('.rocTableInput1').val() - $('.rocTableInput3').val()) / Math.pow((Math.pow($('.rocTableInput2').val(), 2) + Math.pow($('.rocTableInput4').val(), 2)), 0.5); 331 $('#rocTableZ').text(rocTableResultZ.toFixed(4));
332 var rocTableResultP = (1 - exports.Tool.normal(Math.abs(rocTableResultZ), 0, 1)) * 2; 333 $('#rocTableP').text(rocTableResultP.toFixed(4)); 334 } else { 335 $('#rocTableZ').text(""); 336 $('#rocTableP').text(""); 337 } 338 } else { 339 $('#rocTableDifference').text(""); 340 $('#rocTableZ').text(""); 341 $('#rocTableP').text(""); 342 } 343 } else if ($(this).val() == '') { 344 $(this).removeClass("rocTableInputBlue"); 345 $(this).addClass("rocTableInputRed"); 346 if ($('.rocTableInput1').val() != '' && $('.rocTableInput3').val() != '') { 347 var rocTableResult = $('.rocTableInput1').val() - $('.rocTableInput3').val(); 348 $('#rocTableDifference').text(rocTableResult.toFixed(4)); 349 if ($('.rocTableInput2').val() == '' || $('.rocTableInput4').val() == '') { 350 var rocTableResultZ = ($('.rocTableInput1').val() - $('.rocTableInput3').val()) / Math.pow((Math.pow($('.rocTableInput2').val(), 2) + Math.pow($('.rocTableInput4').val(), 2)), 0.5); 351 $('#rocTableZ').text(""); 352 $('#rocTableP').text(""); 353 } 354 } else if ($('.rocTableInput1').val() == '' || $('.rocTableInput3').val() == '') { 355 $('#rocTableDifference').text(""); 356 $('#rocTableZ').text(""); 357 $('#rocTableP').text(""); 358 } 359 } 360 } 361 }); 362 // fuzzy5æåä¸ä¸ªè¡¨æ ¼ 363 $(right).on("focus blur propertychange", ".scoreTdInput", function (event) { 364 event.stopPropagation(); 365 if (event.type == "focusin") { 366 $(this).removeClass("rocTableInputRed"); 367 $(this).addClass("rocTableInputBlue"); 368 } else if (event.type == "focusout") { 369 var scoreTdSum = 0; 370 if ($(this).val() != null && $(this).val() != '') { 371 $(this).removeClass("rocTableInputRed"); 372 $(this).removeClass("rocTableInputBlue"); 373 for (var i = 0; i < $(this).parents("tr").find("input").length; i++) { 374 scoreTdSum += $($(this).parents("tr").find("input")[i]).val() * $("#resultVectorId" + i).attr('data-value'); 375 } 376 $("#compositeScore").html(scoreTdSum.toFixed(3)); 377 } else if ($(this).val() == '') { 378 $(this).removeClass("rocTableInputBlue"); 379 $(this).addClass("rocTableInputRed"); 380 } 381 } 382 }); 383 $(right).on("change", ".subtotalChange,.subtotalcolChange,.entropyChange,.entropyChange1,.npsoneChange,.npstwoChange,.rfmChange,.rfmTypeChange,.varSelect,.varVdSelect, .fisherChiSelect, .singleMulRegChange", function (event) { 384 event.stopPropagation(); 385 var this_val = $(this); 386 if (this_val[0].className == 'subtotalChange') { 387 if (this_val.val() == 2) { 388 this_val.parents("#t1").html($("#t2").html()); 389 } else if (this_val.val() == 3) { 390 this_val.parents("#t1").html($("#t3").html()); 391 } else if (this_val.val() == 4) { 392 this_val.parents("#t1").html($("#t4").html()); 393 } else if (this_val.val() == 5) { 394 this_val.parents("#t1").html($("#t5").html()); 395 } else if (this_val.val() == 6) { 396 this_val.parents("#t1").html($("#t6").html()); 397 } else if (this_val.val() == 7) { 398 this_val.parents("#t1").html($("#t7").html()); 399 } else if (this_val.val() == 8) { 400 this_val.parents("#t1").html($("#t8").html()); 401 } else if (this_val.val() == 9) { 402 this_val.parents("#t1").html($("#t9").html()); 403 } else if (this_val.val() == 10) { 404 this_val.parents("#t1").html($("#t10").html()); 405 } 406 } else if (this_val[0].className == 'subtotalcolChange') { 407 if (this_val.val() == 2) { 408 this_val.parents("#t1").html($("#t2").html()); 409 } else if (this_val.val() == 3) { 410 this_val.parents("#t1").html($("#t3").html()); 411 } else if (this_val.val() == 4) { 412 this_val.parents("#t1").html($("#t4").html()); 413 } else if (this_val.val() == 5) { 414 this_val.parents("#t1").html($("#t5").html()); 415 } 416 } else if (this_val[0].className == 'entropyChange') { 417 if (this_val.val() == 2) { 418 this_val.parents("#t1").html($("#t2").html()); 419 } else if (this_val.val() == 3) { 420 this_val.parents("#t1").html($("#t3").html()); 421 } else if (this_val.val() == 4) { 422 this_val.parents("#t1").html($("#t4").html()); 423 } 424 } else if (this_val[0].className == 'entropyChange1') { 425 var index = this_val.parents("table")[0].id.replace(/t/ig, ''); 426 if (this_val.val() == 2) { 427 this_val.parents("#t" + index).html($("#tt" + index).html()); 428 } else if (this_val.val() == 3) { 429 this_val.parents("#t" + index).html($("#ttt" + index).html()); 430 } else if (this_val.val() == 4) { 431 this_val.parents("#t" + index).html($("#tttt" + index).html()); 432 } 433 } else if (this_val[0].className == 'npsoneChange') { 434 if (this_val.val() == 2) { 435 this_val.parents("#t1").html($("#t2").html()); 436 } else if (this_val.val() == 3) { 437 this_val.parents("#t1").html($("#t3").html()); 438 } 439 } else if (this_val[0].className == 'npstwoChange') { 440 if (this_val.val() == 2) { 441 this_val.parents("#t4").html($("#t5").html()); 442 } else if (this_val.val() == 3) { 443 this_val.parents("#t4").html($("#t6").html()); 444 } 445 } else if (this_val[0].className == 'rfmChange') { 446 if (this_val.val() == 2) { 447 this_val.parents("#t1").html($("#t2").html()); 448 } else if (this_val.val() == 3) { 449 this_val.parents("#t1").html($("#t3").html()); 450 } 451 } else if (this_val[0].className == 'rfmTypeChange') { 452 if (this_val.val() == 2) { 453 this_val.parents("#t5").html($("#t6").html()); 454 } else if (this_val.val() == 3) { 455 this_val.parents("#t5").html($("#t7").html()); 456 } 457 } else if (this_val[0].className == 'varSelect' || this_val[0].className == 'varVdSelect') { 458 $(`.${this_val.parents('.tableAhpBox').attr('class').split(' ')[1]}`).hide(); 459 $(`.${this_val.val()}`).show(); 460 this_val.val(this_val.parents('.tableAhpBox').attr('class').split(' ')[1]); 461 } else if (this_val[0].className == 'fisherChiSelect') { 462 $(this_val.parents(".tableAhpBox").children("table")).hide(); 463 $(`#${this_val.val()}`).show(); 464 this_val.val(this_val.parents('table').attr('id')); 465 } else if (this_val[0].className == 'singleMulRegChange') { 466 this_val.parents("#t2").html($("#t" + this_val.val() + "").html()); 467 } 468 });
469 $(right).on('input propertychange', '.dependentvariablevalue1,.dependentvariablevalue2,.dependentvariablevalue3,.dependentvariablevalue4,.dependentvariablevalue5,.dependentvariablevalue6,.dependentvariablevalue7,.dependentvariablevalue8,.content .tablerow .right .dealwith .WordAnalysis .dependentvariable1', function (event) { 470 event.stopPropagation(); 471 if ($(this)[0].className == 'dependentvariablevalue1') { 472 var indexsun = 0; 473 var variables = Public.senStrg("variables"); 474 var variablesarray = variables.split(","); 475 //indexsun += parseFloat(parseFloat(variablesarray[0])); 476 for (var i = 0; i < variablesarray.length; i++) { 477 if (i == 0) { 478 indexsun += parseFloat(variablesarray[0]); 479 } else { 480 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + (i - 1)).val()); 481 } 482 } 483 $('.dependentvariablevalue').html(indexsun.toFixed(10)); 484 } else if ($(this)[0].className == 'dependentvariablevalue2') { 485 var indexsun = parseFloat(Public.senStrg("indexsun")); 486 var variables = Public.senStrg("variables"); 487 var variablesarray = variables.split(","); 488 for (var i = 0; i < variablesarray.length; i++) { 489 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()); 490 } 491 $('.dependentvariablevalue').html(indexsun.toFixed(10)); 492 } else if ($(this)[0].className == 'dependentvariablevalue3') { 493 var indexsun = 0; 494 var variables = Public.senStrg("variables"); 495 var variablesarray = variables.split(","); 496 // indexsun += parseFloat(parseFloat(variablesarray[variablesarray.length - 1])); 497 for (var i = 0; i < variablesarray.length; i++) { 498 if (i == variablesarray.length - 1) { 499 indexsun += parseFloat(variablesarray[variablesarray.length - 1]); 500 } else { 501 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()); 502 } 503 } 504 $('.dependentvariablevalue').html(indexsun.toFixed(10)); 505 } else if ($(this)[0].className == 'dependentvariablevalue4') { 506 var indexsun = parseFloat(Public.senStrg("indexsun")); 507 var variables = Public.senStrg("variables"); 508 var variablesarray = variables.split(","); 509 for (var i = 0; i < variablesarray.length; i++) { 510 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()); 511 } 512 $('.dependentvariablevalue').html(indexsun.toFixed(10)); 513 } else if ($(this)[0].className == 'dependentvariablevalue5') { 514 var indexsun = parseFloat(Public.senStrg("indexsun")); 515 var variables = Public.senStrg("variables"); 516 var variablesarray = variables.split(","); 517 var itemchecked = Public.senStrg("itemchecked"); 518 // let finalinputVal = 1; 519 var finalinputVal = 1; 520 for (var i = 0; i < variablesarray.length - 1; i++) { 521 if (itemchecked == "Poisson" || itemchecked == "negBiRegression") { 522 if (Public.senStrg("cardinal")) { 523 if (i == variablesarray.length - 2) { 524 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()) + Math.log($('#inputindex' + (i + 1)).val()); 525 } else { 526 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()); 527 } 528 if ($('#inputindex' + i).val() != '' && $('#inputindex' + (variablesarray.length - 2)).val() != '') { 529 finalinputVal = 2; 530 } 531 } else { 532 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()); 533 if ($('#inputindex' + i).val() != '') { 534 finalinputVal = 2; 535 } 536 } 537 } else { 538 indexsun += (parseFloat(variablesarray[i]) * $('#inputindex' + i).val()); 539 if ($('#inputindex' + i).val() != '') { 540 finalinputVal = 2; 541 } 542 } 543 } 544 545 if (itemchecked == "Logit") { 546 if (finalinputVal == 1) { 547 indexsun = ""; 548 } else if (finalinputVal == 2) { 549 indexsun = Math.exp(indexsun) / (1 + Math.exp(indexsun)); 550 } 551 } else if (itemchecked == "Poisson") { 552 if (finalinputVal == 1) { 553 indexsun = ""; 554 } else if (finalinputVal == 2) { 555 indexsun = Math.exp(indexsun); 556 } 557 } else if (itemchecked == "negBiRegression") { 558 if (finalinputVal == 1) { 559 indexsun = ""; 560 } else if (finalinputVal == 2) { 561 indexsun = Math.exp(indexsun); 562 } 563 } else if (itemchecked == "Probit") { 564 if (finalinputVal == 1) { 565 indexsun = ""; 566 } else if (finalinputVal == 2) { 567 indexsun = exports.Tool.normalcdf(0, 1, indexsun); 568 } 569 } 570 if (indexsun == "") { 571 $('.dependentvariablevalue').html(indexsun); 572 } else { 573 $('.dependentvariablevalue').html(indexsun.toFixed(10)); 574 } 575 } else if ($(this)[0].className == 'dependentvariablevalue6') { 576 var variables = Public.senStrg("variables"); 577 var urlsQuadratic = Public.senStrg("urlsQuadratic"); 578 var variablesarray = variables.split(","); 579 if (urlsQuadratic == 0) { 580 var indexsun = 0; 581 indexsun += parseFloat(variablesarray[0]) + (parseFloat(variablesarray[1]) * $('#inputindex0').val()) + (parseFloat(variablesarray[2]) * Math.pow($('#inputindex0').val(), 2));
582 } else if (urlsQuadratic == 1) { 583 var indexsun = 0; 584 indexsun += parseFloat(variablesarray[0]) + (parseFloat(variablesarray[1]) * $('#inputindex0').val()) + (parseFloat(variablesarray[2]) * Math.pow($('#inputindex0').val(), 2) + (parseFloat(variablesarray[3]) * Math.pow($('#inputindex0').val(), 3))); 585 } else if (urlsQuadratic == 2) { 586 var indexsun = 0; 587 indexsun += parseFloat(variablesarray[0]) + (parseFloat(variablesarray[1]) * Math.log($('#inputindex0').val())); 588 } else if (urlsQuadratic == 3) { 589 var indexsun = 0; 590 indexsun += Math.exp(parseFloat(variablesarray[0]) + (parseFloat(variablesarray[1]) * $('#inputindex0').val())); 591 } else if (urlsQuadratic == 4) { 592 var indexsun = 0; 593 indexsun += Math.exp(parseFloat(variablesarray[0]) + (parseFloat(variablesarray[1]) * $('#inputindex0').val())); 594 } else if (urlsQuadratic == 5) { 595 var indexsun = 0; 596 indexsun += Math.exp(parseFloat(variablesarray[0]) + (parseFloat(variablesarray[1]) * $('#inputindex0').val())); 597 } else if (urlsQuadratic == 6) { 598 var indexsun = 0; 599 indexsun += Math.exp(parseFloat(variablesarray[0]) + parseFloat(variablesarray[1]) * (1 / $('#inputindex0').val())); 600 } 601 $('.dependentvariablevalue').html(indexsun.toFixed(10)); 602 } else if ($(this)[0].className == 'dependentvariablevalue7') { 603 var nonlinearcoefs = Public.senStrg("nonlinearcoefs"); 604 var nonlinearselect = Public.senStrg("nonlinearselect"); 605 var nonlinearcoefsArray = nonlinearcoefs.split(","); 606 var x; 607 var arr = []; 608 for (var i = 0; i < $('.dependentvariablevalue7').parents('ul').find('.dependentvariablevalue7').length; i++) { 609 arr.push($($('.dependentvariablevalue7')[i]).val()); 610 } 611 if (arr.length > 1) { 612 x = arr; 613 } else { 614 [x] = [...arr] 615 } 616 var yPredicts = exports.Tool.getYPredicts(Number(nonlinearselect), nonlinearcoefsArray, x).yPredicts; 617 $('.dependentvariablevalue').html(yPredicts.toFixed(10)); 618 } 619 }); 620 621 $(right).on('click', '.ascending_img,.ascending_img1', function (event) { 622 event.stopPropagation(); 623 var as = $(this), limit = $(this).next('.hide_load_factor').val(); 624 if (as.hasClass('ascending_img')) { 625 if (as.parents("#t3").html() == $("#t5").html()) { 626 as.parents("#t3").html($("#t6").html()); 627 } else { 628 as.parents("#t3").html($("#t5").html()); 629 } 630 } else if (as.hasClass('ascending_img1')) { 631 var markTable = Public.senStrg('marktable'); 632 if (!markTable) { 633 markTable = 0; 634 } 635 if (markTable == 0) { 636 as.parents("#t3").html($("#t5").html()); 637 markTable = 1; 638 } else if (markTable == 1) { 639 as.parents("#t3").html($("#t6").html()); 640 markTable = 2; 641 } else if (markTable == 2) { 642 as.parents("#t3").html($("#t7").html()); 643 markTable = 0; 644 } 645 Public.senStrg('marktable', markTable); 646 } 647 $('#t3 .hide_load_factor').val(limit); 648 }); 649 650 $(right).on('change', '.hide_load_factor', function (event) { 651 event.stopPropagation(); 652 var limit = $(this).val(), num = $(this).attr('data-num'); 653 if (limit > 0) { 654 $("#t3 tbody tr:lt(" + num + ")").find("td:not(:first-child):not(:last-child)").each(function () { 655 if (Math.abs(parseFloat($(this).text())) < limit) { 656 $(this).css('opacity', 0); 657 } else { 658 $(this).removeAttr('style'); 659 } 660 }); 661 $("#t5 tbody tr:lt(" + num + ")").find("td:not(:first-child):not(:last-child)").each(function () { 662 if (Math.abs(parseFloat($(this).text())) < limit) { 663 $(this).css('opacity', 0); 664 } else { 665 $(this).removeAttr('style'); 666 } 667 }); 668 $("#t6 tbody tr:lt(" + num + ")").find("td:not(:first-child):not(:last-child)").each(function () { 669 if (Math.abs(parseFloat($(this).text())) < limit) { 670 $(this).css('opacity', 0); 671 } else { 672 $(this).removeAttr('style'); 673 } 674 }); 675 } else { 676 $('#t3 tr td').css('opacity', ''); 677 $('#t5 tr td').css('opacity', ''); 678 $('#t6 tr td').css('opacity', ''); 679 } 680 }); 681 }, 682 normalcdf: function (mean, sigma, to) { 683 var z = (to - mean) / Math.sqrt(2 * sigma * sigma); 684 var t = 1 / (1 + 0.3275911 * Math.abs(z)); 685 var a1 = 0.254829592; 686 var a2 = -0.284496736; 687 var a3 = 1.421413741; 688 var a4 = -1.453152027; 689 var a5 = 1.061405429; 690 var erf = 1 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * Math.exp(-z * z); 691 var sign = 1; 692 if (z < 0) { 693 sign = -1; 694 } 695 return (1 / 2) * (1 + sign * erf); 696 }, 697 normal: function (x, mu, sigma) { 698 return exports.Tool.stdNormal((x - mu) / sigma); 699 }, 700 701 stdNormal: function (z) { 702 var j, k, kMax, m, values, total, subtotal, item, z2, z4, a, b; 703 704 // Power series is not stable at these extreme tail scenarios 705 if (z < -6) { 706 return 0; 707 } 708 if (z > 6) { 709 return 1; 710 } 711 712 m = 1; // m(k) == (2**k)/factorial(k) 713 b = z; // b(k) == z ** (2*k + 1) 714 z2 = z * z; // cache of z squared 715 z4 = z2 * z2; // cache of z to the 4th 716 values = []; 717 718 // Compute the power series in groups of two terms. 719 // This reduces floating point errors because the series 720 // alternates between positive and negative. 721 for (k = 0; k < 100; k += 2) { 722 a = 2 * k + 1; 723 item = b / (a * m); 724 item *= (1 - (a * z2) / ((a + 1) * (a + 2))); 725 values.push(item); 726 m *= (4 * (k + 1) * (k + 2)); 727 b *= z4; 728 } 729 730 // Add the smallest terms to the total first that 731 // way we minimize the floating point errors. 732 total = 0; 733 for (k = 49; k >= 0; k--) { 734 total += values[k]; 735 } 736 737 // Multiply total by 1/sqrt(2*PI) 738 // Then add 0.5 so that stdNormal(0) === 0.5 739 return 0.5 + 0.3989422804014327 * total; 740 }, 741 getYPredicts: function (methodId, coefs, x) { 742 var yPredicts, leftTitle; 743 var [coefs1, coefs2, coefs3, coefs4, coefs5] = [...coefs]; 744 if ($.isArray(x) == true && x.length > 1) { 745 var [x1, x2, x3] = [...x]; 746 } 747 coefs1 = Number(coefs1); 748 coefs2 = Number(coefs2); 749 coefs3 = Number(coefs3); 750 coefs4 = Number(coefs4); 751 coefs5 = Number(coefs5); 752 x1 = Number(x1); 753 x2 = Number(x2); 754 x3 = Number(x3); 755 switch (methodId) { 756 // switch (data.data.methodId) { 757 case 1: 758 yPredicts = coefs1 * Math.pow(coefs2, x); 759 leftTitle = "å¤åæ²çº¿"; 760 break; 761 case 2: 762 yPredicts = coefs1 + coefs2 * x + coefs3 * Math.pow(x, 2) + coefs4 * Math.pow(x, 3); 763 leftTitle = "䏿¬¡æ²çº¿"; 764 break; 765 case 3: 766 yPredicts = Math.exp(coefs1 + coefs2 * x);
767 leftTitle = "å¢é¿æ²çº¿"; 768 break; 769 case 4: 770 yPredicts = coefs1 + coefs2 / x; 771 leftTitle = "åæ²çº¿"; 772 break; 773 case 5: 774 yPredicts = coefs1 + coefs2 * Math.log(x); 775 leftTitle = "å¯¹æ°æ²çº¿"; 776 break; 777 case 6: 778 yPredicts = coefs1 * Math.pow(x, coefs2); 779 leftTitle = "å¹å½æ°"; 780 break; 781 case 7: 782 yPredicts = coefs1 * Math.exp(coefs2 * x); 783 leftTitle = "ææ°å½æ°"; 784 break; 785 case 8: 786 yPredicts = coefs1 + coefs2 * x + coefs3 * Math.pow(x, 2); 787 leftTitle = "äºæ¬¡æ²çº¿"; 788 break; 789 case 9: 790 yPredicts = Math.exp(coefs1 + coefs2 / x); 791 leftTitle = "Sæ²çº¿"; 792 break; 793 case 10: 794 yPredicts = 1 / (coefs1 + coefs2 * Math.exp(-x)); 795 leftTitle = "Sæ²çº¿"; 796 break; 797 case 11: 798 yPredicts = 1 - Math.exp(-coefs1 * Math.pow(x, coefs2)); 799 leftTitle = "ååæ°Så½¢æ²çº¿"; 800 break; 801 case 12: 802 yPredicts = 1 - Math.exp(-Math.exp(coefs1 - coefs2 * x)); 803 leftTitle = "ååæ°Så½¢æ²çº¿"; 804 break; 805 case 13: 806 yPredicts = coefs1 - coefs2 * Math.exp(-coefs3 * x); 807 leftTitle = "æ¸è¿åå½ï¼å¹å ¥ï¼"; 808 break; 809 case 14: 810 yPredicts = coefs1 - coefs2 * Math.exp(-coefs3 * x); 811 leftTitle = "æ¸è¿åå½ï¼å¸èµ·ï¼"; 812 break; 813 case 15: 814 yPredicts = coefs1 + coefs2 * Math.exp(coefs3 * x); 815 leftTitle = "æ¸è¿"; 816 break; 817 case 16: 818 yPredicts = coefs1 - coefs2 * Math.pow(coefs3, x); 819 leftTitle = "æ¸è¿"; 820 break; 821 case 17: 822 yPredicts = coefs1 + (coefs2 - coefs1) * Math.exp(-coefs3 * Math.pow(x - coefs4, 2)); 823 leftTitle = "Braggæ¹ç¨"; 824 break; 825 case 18: 826 yPredicts = coefs1 * Math.log(x - coefs2); 827 leftTitle = "å¹å ¥"; 828 break; 829 case 19: 830 yPredicts = 1 - 1 / Math.pow(x, coefs1); 831 leftTitle = "å¹å ¥"; 832 break; 833 case 20: 834 yPredicts = 1 / (1 + coefs1 * x); 835 leftTitle = "å¸èµ·"; 836 break; 837 case 21: 838 yPredicts = Math.pow(coefs1, x); 839 leftTitle = "å¸èµ·"; 840 break; 841 case 22: 842 yPredicts = 1 - 1 / Math.pow(x, coefs1); 843 leftTitle = "å¸èµ·"; 844 break; 845 case 23: 846 yPredicts = coefs1 / (x - coefs2); 847 leftTitle = "ææç§¯æ¸©"; 848 break; 849 case 24: 850 yPredicts = Math.pow(coefs1 + coefs2 * x, -1 / coefs3); 851 leftTitle = "å¯åº¦"; 852 break; 853 case 25: 854 yPredicts = x1 * x2 / (coefs1 + coefs2 * x1 + coefs3 * x1 * x2 + coefs4 * x1 * x3); 855 leftTitle = "é ¶ååº"; 856 break; 857 case 26: 858 yPredicts = coefs1 + coefs2 * Math.pow(coefs3, x); 859 leftTitle = "ä¿®æ£ææ°å½æ°"; 860 break; 861 case 27: 862 yPredicts = coefs1 * Math.cos(x + coefs2) + coefs3 * Math.cos(2 * x + coefs2) + coefs4; 863 leftTitle = "Fourier"; 864 break; 865 case 28: 866 yPredicts = coefs1 * Math.cos(x + coefs4) + coefs2 * Math.cos(2 * x + coefs4) + coefs3 * Math.cos(3 * x + coefs4); 867 leftTitle = "Fourier"; 868 break; 869 case 29: 870 yPredicts = coefs1 * (1 - coefs2 * Math.exp(-coefs3 * Math.pow(x, 2))); 871 leftTitle = "髿¯"; 872 break; 873 case 30: 874 yPredicts = coefs1 * Math.exp(-coefs2 * Math.exp(-coefs3 * x)); 875 leftTitle = "Gompertz"; 876 break; 877 case 31: 878 yPredicts = 1 / (coefs1 + coefs2 * Math.pow(x - coefs3, 2)); 879 leftTitle = "Holiday"; 880 break; 881 case 32: 882 yPredicts = coefs1 * Math.exp(-coefs2 / (x + coefs3)); 883 leftTitle = "Johnson-Schumacher"; 884 break; 885 case 33: 886 yPredicts = coefs1 / (1 + Math.exp(coefs2 + coefs3 * x)); 887 leftTitle = "é»è¾æ¯è"; 888 break; 889 case 34: 890 yPredicts = coefs1 + (coefs2 - coefs1) / (1 + Math.exp((x - coefs3) / coefs4)); 891 leftTitle = "Logisticå¢é¿"; 892 break; 893 case 35: 894 yPredicts = coefs1 - Math.log(1 + coefs2 * Math.exp(-coefs3 * x)); 895 leftTitle = "对æ°Logit"; 896 break; 897 case 36: 898 yPredicts = coefs1 + (coefs2 - coefs1) / (1 + Math.exp(coefs4 * Math.log(x / coefs3))); 899 leftTitle = "Loglogisticå¢é¿"; 900 break; 901 case 37: 902 yPredicts = Math.pow(coefs1 + coefs2 * x, coefs3); 903 leftTitle = "对æ°ä¿®æ¹"; 904 break; 905 case 38: 906 yPredicts = coefs1 + coefs2 * Math.exp(-coefs3 * x); 907 leftTitle = "Metcherlich Law of Diminishing Returns"; 908 break; 909 case 39: 910 yPredicts = coefs1 * x / (x + coefs2); 911 leftTitle = "Michaelis Menten"; 912 break; 913 case 40: 914 yPredicts = (coefs1 * coefs2 + coefs3 * Math.pow(x, coefs4)) / (coefs2 + Math.pow(x, coefs4)); 915 leftTitle = "Morgan-Mercer-Florin"; 916 break; 917 case 41: 918 yPredicts = coefs1 * Math.exp(coefs2 / x); 919 leftTitle = "è´ææ°å½æ°"; 920 break; 921 case 42: 922 yPredicts = coefs1 - coefs2 * (Math.log(x1 + coefs3) - Math.log(x2)); 923 leftTitle = "Nernstæ¹ç¨"; 924 break; 925 case 43: 926 yPredicts = coefs1 / (1 + coefs2 * Math.exp(-(coefs3 * x + coefs4 * Math.pow(x, 2) + coefs5 * Math.pow(x, 3)))); 927 leftTitle = "Peal-Reed"; 928 break; 929 case 44: 930 yPredicts = (coefs1 + coefs2 * x + coefs3 * Math.pow(x, 2) + coefs4 * Math.pow(x, 3)) / (coefs5 * Math.pow(x, 3)); 931 leftTitle = "䏿¬¡æ¯"; 932 break; 933 case 45: 934 yPredicts = (coefs1 + coefs2 * x + coefs3 * Math.pow(x, 2)) / (coefs4 * Math.pow(x, 2));
935 leftTitle = "忬¡æ¯"; 936 break; 937 case 46: 938 yPredicts = (coefs1 + coefs2 * x) / (1 + coefs3 * x + coefs4 * Math.pow(x, 2)); 939 leftTitle = "æçå¤é¡¹å¼å½æ°"; 940 break; 941 case 47: 942 yPredicts = (coefs1 + coefs2 * x + coefs3 * Math.pow(x, 2)) / (1 + coefs4 * x + coefs5 * Math.pow(x, 2)); 943 leftTitle = "æçå¤é¡¹å¼å½æ°"; 944 break; 945 case 48: 946 yPredicts = coefs1 / Math.pow((1 + coefs2 * Math.exp(-coefs3 * x)), 1 / coefs4); 947 leftTitle = "Richards"; 948 break; 949 case 49: 950 yPredicts = coefs1 / (1 + coefs2 * Math.exp(-coefs3 * x)); 951 leftTitle = "Verhulst"; 952 break; 953 case 50: 954 yPredicts = Math.pow(Math.pow(coefs1, 1 - coefs2) - coefs3 * Math.exp(-coefs4 * x), 1 / (1 - coefs2)); 955 leftTitle = "Von Bertalanffy"; 956 break; 957 case 51: 958 yPredicts = coefs1 - (coefs2 - coefs1) * Math.exp(-coefs3 * Math.pow(x, coefs4)); 959 leftTitle = "Weibull"; 960 break; 961 case 52: 962 yPredicts = Math.pow(coefs1 + coefs2 * x + coefs3 * Math.pow(x, 2), -1); 963 leftTitle = "产éå¯åº¦"; 964 break; 965 default: 966 } 967 return { 968 "yPredicts": yPredicts, 969 "leftTitle": leftTitle 970 } 971 }, 972 functionFormulaType: function (val) { 973 val = Number(val); 974 var Formula; 975 var FormulaShow; 976 switch (val) { 977 case 1: 978 FormulaShow = "b1 * b2 ** x"; 979 Formula = "b1 * b2 ** x1"; 980 break; 981 case 2: 982 FormulaShow = "b1 + b2 * x + b3 * x ** 2 + b4 * x ** 3"; 983 Formula = "b1 + b2 * x1 + b3 * x1 ** 2 + b4 * x1 ** 3"; 984 break; 985 case 3: 986 FormulaShow = "exp(b1 + b2 * x)"; 987 Formula = "exp(b1 + b2 * x1)"; 988 break; 989 case 4: 990 FormulaShow = "b1 + b2 / x"; 991 Formula = "b1 + b2 / x1"; 992 break; 993 case 5: 994 FormulaShow = "b1 + b2 * ln(x)"; 995 Formula = "b1 + b2 * ln(x1)"; 996 break; 997 case 6: 998 FormulaShow = "b1 * x ** b2"; 999 Formula = "b1 * x1 ** b2"; 1000 break; 1001 case 7: 1002 FormulaShow = "b1 * exp(b2 * x)"; 1003 Formula = "b1 * exp(b2 * x1)"; 1004 break; 1005 case 8: 1006 FormulaShow = "b1 + b2 * x + b3 * x ** 2"; 1007 Formula = "b1 + b2 * x1 + b3 * x1 ** 2"; 1008 break; 1009 case 9: 1010 FormulaShow = "exp(b1 + b2 / x1)"; 1011 Formula = "exp(b1 + b2 / x1)"; 1012 break; 1013 case 10: 1014 FormulaShow = "1 / (b1 + b2 * exp(-x))"; 1015 Formula = "1 / (b1 + b2 * exp(-x1))"; 1016 break; 1017 case 11: 1018 FormulaShow = "1 - exp(-b1 * x ** b2)"; 1019 Formula = "1 - exp(-b1 * x1 ** b2)"; 1020 break; 1021 case 12: 1022 FormulaShow = "1 â exp(-exp(b1 â b2 * x))"; 1023 Formula = "1 â exp(-exp(b1 â b2 * x1))"; 1024 break; 1025 case 13: 1026 FormulaShow = "b1 â b2 * exp(-b3 * x)"; 1027 Formula = "b1 â b2 * exp(-b3 * x1)"; 1028 break; 1029 case 14: 1030 FormulaShow = "b1 â b2 * exp(-b3 * x)"; 1031 Formula = "b1 â b2 * exp(-b3 * x1)"; 1032 break; 1033 case 15: 1034 FormulaShow = "b1 + b2 * exp(b3 * x)"; 1035 Formula = "b1 + b2 * exp(b3 * x1)"; 1036 break; 1037 case 16: 1038 FormulaShow = "b1 - b2 * b3 ** x"; 1039 Formula = "b1 - b2 * b3 ** x1"; 1040 break; 1041 case 17: 1042 FormulaShow = "b1 + (b2 â b1) * exp(-b3 * (x â b4) ** 2)"; 1043 Formula = "b1 + (b2 â b1) * exp(-b3 * (x1 â b4) ** 2)"; 1044 break; 1045 case 18: 1046 FormulaShow = "b1 * ln(x â b2)"; 1047 Formula = "b1 * ln(x1 â b2)"; 1048 break; 1049 case 19: 1050 FormulaShow = "1 â 1 / x ** b1"; 1051 Formula = "1 â 1 / x1 ** b1"; 1052 break; 1053 case 20: 1054 FormulaShow = "1 / (1 + b1 * x)"; 1055 Formula = "1 / (1 + b1 * x1)"; 1056 break; 1057 case 21: 1058 FormulaShow = "b1 ** x"; 1059 Formula = "b1 ** x1"; 1060 break; 1061 case 22: 1062 FormulaShow = "1 â 1 / x ** b1"; 1063 Formula = "1 â 1 / x1 ** b1"; 1064 break; 1065 case 23: 1066 FormulaShow = "b1 / (x - b2)"; 1067 Formula = "b1 / (x1 - b2)"; 1068 break; 1069 case 24: 1070 FormulaShow = "(b1 + b2 * x) ** (-1 / b3)"; 1071 Formula = "(b1 + b2 * x1) ** (-1 / b3)"; 1072 break; 1073 case 25: 1074 FormulaShow = "x1 * x2 / (b1 + b2 * x1 + b3 * x1 * x2 + b4 * x1 *x3)"; 1075 Formula = "x1 * x2 / (b1 + b2 * x1 + b3 * x1 * x2 + b4 * x1 *x3)"; 1076 break; 1077 case 26: 1078 FormulaShow = "b1 + b2 * b3 ** x"; 1079 Formula = "b1 + b2 * b3 ** x1"; 1080 break; 1081 case 27: 1082 FormulaShow = "b1 * cos(x + b2) + b3 * cos(2 * x + b2) + b4"; 1083 Formula = "b1 * cos(x1 + b2) + b3 * cos(2 * x1 + b2) + b4"; 1084 break; 1085 case 28: 1086 FormulaShow = "b1 * cos(x + b4) + b2 * cos(2 * x + b4) + b3 * cos(3 * x + b4)"; 1087 Formula = "b1 * cos(x1 + b4) + b2 * cos(2 * x1 + b4) + b3 * cos(3 * x1 + b4)"; 1088 break; 1089 case 29: 1090 FormulaShow = "b1 * (1 â b2 * exp(-b3 * x ** 2))"; 1091 Formula = "b1 * (1 â b2 * exp(-b3 * x1 ** 2))"; 1092 break; 1093 case 30: 1094 FormulaShow = "b1 * exp(-b2 * exp(-b3 * x))"; 1095 Formula = "b1 * exp(-b2 * exp(-b3 * x1))"; 1096 break; 1097 case 31: 1098 FormulaShow = "1 / (b1 + b2 * (x â b3) ** 2)"; 1099 Formula = "1 / (b1 + b2 * (x1 â b3) ** 2)"; 1100 break; 1101 case 32: 1102 FormulaShow = "b1 * exp(-b2 / (x + b3))"; 1103 Formula = "b1 * exp(-b2 / (x1 + b3))"; 1104 break; 1105 case 33: 1106 FormulaShow = "b1 / (1 + exp(b2 + b3 * x))"; 1107 Formula = "b1 / (1 + exp(b2 + b3 * x1))"; 1108 break; 1109 case 34: 1110 FormulaShow = "b1 + (b2 â b1) / (1 + exp((x â b3) / b4))"; 1111 Formula = "b1 + (b2 â b1) / (1 + exp((x1 â b3) / b4))"; 1112 break; 1113 case 35: 1114 FormulaShow = "b1 - ln(1 + b2 * exp(-b3 * x))"; 1115 Formula = "b1 - ln(1 + b2 * exp(-b3 * x1))"; 1116 break; 1117 case 36: 1118 FormulaShow = "b1 + (b2 â b1) / (1 + exp(b4 * ln(x / b3)))"; 1119 Formula = "b1 + (b2 â b1) / (1 + exp(b4 * ln(x1 / b3)))"; 1120 break; 1121 case 37: 1122 FormulaShow = "(b1 + b2 * x) ** b3"; 1123 Formula = "(b1 + b2 * x1) ** b3"; 1124 break; 1125 case 38: 1126 FormulaShow = "b1 + b2 * exp(-b3 * x)"; 1127 Formula = "b1 + b2 * exp(-b3 * x1)"; 1128 break; 1129 case 39: 1130 FormulaShow = "b1 * x / (x + b2)"; 1131 Formula = "b1 * x1 / (x1 + b2)"; 1132 break; 1133 case 40: 1134 FormulaShow = "(b1 * b2 + b3 * x ** b4) / (b2 + x ** b4)"; 1135 Formula = "(b1 * b2 + b3 * x1 ** b4) / (b2 + x1** b4)"; 1136 break; 1137 case 41: 1138 FormulaShow = "b1 * exp(b2 / x)"; 1139 Formula = "b1 * exp(b2 / x1)"; 1140 break; 1141 case 42: 1142 FormulaShow = "b1 â b2 * (ln(x1 + b3) â ln(x2))"; 1143 Formula = "b1 â b2 * (ln(x1 + b3) â ln(x2))"; 1144 break; 1145 case 43: 1146 FormulaShow = "b1 / (1 + b2 * exp(-(b3 * x + b4 * x **2 + b5 * x ** 3)))"; 1147 Formula = "b1 / (1 + b2 * exp(-(b3 * x1 + b4 * x1 **2 + b5 * x1 ** 3)))"; 1148 break; 1149 case 44: 1150 FormulaShow = "(b1 + b2 * x + b3 * x ** 2 + b4 * x ** 3) / (b5 * x ** 3)"; 1151 Formula = "(b1 + b2 * x1 + b3 * x1 ** 2 + b4 * x1 ** 3) / (b5 * x1 ** 3)"; 1152 break; 1153 case 45: 1154 FormulaShow = "(b1 + b2 * x + b3 * x ** 2) / (b4 * x ** 2)"; 1155 Formula = "(b1 + b2 * x1 + b3 * x1 ** 2) / (b4 * x1 ** 2)"; 1156 break; 1157 case 46: 1158 FormulaShow = "(b1 + b2 * x) / (1 + b3 * x + b4 * x ** 2)"; 1159 Formula = "(b1 + b2 * x1) / (1 + b3 * x1 + b4 * x1 ** 2)"; 1160 break; 1161 case 47: 1162 FormulaShow = "(b1 + b2 * x + b3 * x ** 2) / (1 + b4 * x + b5 * x ** 2)"; 1163 Formula = "(b1 + b2 * x1 + b3 * x1** 2) / (1 + b4 * x1 + b5 * x1 ** 2)"; 1164 break; 1165 case 48: 1166 FormulaShow = "b1 / ((1 + b2 * exp(-b3 * x)) ** (1 / b4))"; 1167 Formula = "b1 / ((1 + b2 * exp(-b3 * x1)) ** (1 / b4))"; 1168 break; 1169 case 49: 1170 FormulaShow = "b1 / (1 + b2 * exp(-b3 * x))"; 1171 Formula = "b1 / (1 + b2 * exp(-b3 * x1))"; 1172 break; 1173 case 50: 1174 FormulaShow = "(b1 ** (1 â b2) â b3 * exp(-b4 * x)) ** (1 / (1 â b2))"; 1175 Formula = "(b1 ** (1 â b2) â b3 * exp(-b4 * x1)) ** (1 / (1 â b2))"; 1176 break; 1177 case 51: 1178 FormulaShow = "b1 â (b2 - b1) * exp(-b3 * x ** b4)"; 1179 Formula = "b1 â (b2 - b1) * exp(-b3 * x1 ** b4)"; 1180 break; 1181 case 52: 1182 FormulaShow = "(b1 + b2 * x + b3 * x ** 2) ** (-1)"; 1183 Formula = "(b1 + b2 * x1 + b3 * x1 ** 2) ** (-1)"; 1184 break; 1185 default: 1186 } 1187 return { 1188 "FormulaShow": FormulaShow, 1189 "Formula": Formula 1190 }; 1191 }, 1192 // æ¹åç©éµè¡¨æ ¼çåæ° 1193 nonlinearSelectChange: function (weightSelectVal) { 1194 var formulaShow = exports.Tool.functionFormulaType(weightSelectVal).FormulaShow; 1195 var formula = exports.Tool.functionFormulaType(weightSelectVal).Formula; 1196 var arr = []; 1197 for (var i = 0; i < formula.length; i++) { 1198 var str = 'b' + (i + 1); 1199 if (formula.indexOf(str) > -1 && $.inArray(str, arr) == -1) { 1200 arr.push(str) 1201 } 1202 } 1203 var weightcs = ''; 1204 arr.forEach(function (item, index) { 1205 weightcs += '<tr>'; 1206 weightcs += '<td data-weightNum="' + i + '" style="width:108px;box-sizing:border-box;position:relative;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">b'; 1207 weightcs += (index + 1); 1208 weightcs += '</td>'; 1209 weightcs += '<td class="functionFormulaParam initialValue" style="width:108px;box-sizing:border-box;position:relative;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">é»è®¤1'; 1210 weightcs += '</td>'; 1211 weightcs += '<td class="functionFormulaParam lowerBound" style="width:108px;box-sizing:border-box;position:relative;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">'; 1212 weightcs += '</td>'; 1213 weightcs += '<td class="functionFormulaParam upperBound" style="width:108px;box-sizing:border-box;position:relative;white-space:nowrap;overflow: hidden;text-overflow: ellipsis;">'; 1214 weightcs += '</td>'; 1215 weightcs += '</tr>'; 1216 }); 1217 $('.nonlinearRegressions_tbody').html(weightcs); 1218 formulaShow.indexOf("x1"); 1219 if (formulaShow.indexOf("x1") > -1) { 1220 $('.zibianliang').text('èªåéX1').addClass('zibianliang1').next().addClass('zibianliangselect'); 1221 } else { 1222 $('.zibianliang').text('èªåéX').removeClass('zibianliang1').next().addClass('zibianliangselect'); 1223 } 1224 if (formulaShow.indexOf("x2") > -1) { 1225 $('.zibianliang2Box').show(); 1226 $('.zibianliang2').next().addClass('functionFormula zibianliangselect'); 1227 } else { 1228 $('.zibianliang2Box').hide(); 1229 $('.zibianliang2').next().removeClass('functionFormula zibianliangselect'); 1230 } 1231 if (formulaShow.indexOf("x3") > -1) { 1232 $('.zibianliang3Box').show(); 1233 $('.zibianliang3').next().addClass('functionFormula zibianliangselect'); 1234 } else { 1235 $('.zibianliang3Box').hide(); 1236 $('.zibianliang3').next().removeClass('functionFormula zibianliangselect'); 1237 } 1238 $('.functionFormulaVal').text(formulaShow).attr("data-title", formula); 1239 }, 1240 gzhLogin: function (isSojump) { //å ¬ä¼å·ç»é 1241 $("#loadshow").show(); 1242 var channel = $.cookie('channelId') || 100000000; 1243 Public.PostNo(SpssauAddress.getGzhLoginUrl, { 1244 "channel": channel 1245 }, function (data) { 1246 if (data.code == 0) { 1247 // $("#loadshow").hide(); 1248 var htmlStr = '<div class="weiXinLoginDialog">' 1249 if (isSojump) { 1250 htmlStr += `<div class="warning-banner"> 1251 <div class="warning-title">ç»å½æ¹å¼ç¡®è®¤</div> 1252 <div class="warning-content"> 1253 æ£æµå°ä½ æ¾éè¿<strong>ãé®å·æã</strong>ææè¿å ¥ SPSSAUã 1254 </div> 1255 <div class="warning-highlight"> 1256 å½åæ¯å¾®ä¿¡æ«ç ç»å½SPSSAUï¼å ¶ä¼çææ°çè´¦å·ï¼å¯¼è´è´¦å·åæ°æ®ä¸ä¸è´ã请确认ç»å½æ¹å¼ã 1257 </div> 1258 <div class="action-buttons"> 1259 <a href="https://www.wjx.cn" class="blue_button" target="_blank">å»é®å·æææç»å½</a> 1260 </div> 1261 </div>` 1262 } 1263 htmlStr += `<div class="weiXinLoginBox"> 1264 <div>微信ç»å½</div> 1265 <div style="margin-top: 15px;"> 1266 <img class="weiXinCode" src="${data.data.url}" alt=""> 1267 </div> 1268 <div style="margin-top: 15px;"> 1269 <p>请使ç¨å¾®ä¿¡æ«æå ³æ³¨å ¬ä¼å·åç»å½</p> 1270 <p>âSPSSAUâ</p> 1271 </div> 1272 <div style="margin-top: 50px;"> 1273
1273 <p id="noLoginResult" style="color: red;font-size: 20px;"></p> 1274 </div> 1275 </div> 1276 </div>`; 1277 $('body').prepend(htmlStr); 1278 // $('.weiXinCode').attr("src", data.data.url); 1279 $('.weiXinLoginDialog').show(); 1280 var identity = data.data.identity; 1281 getFlushgzh(); 1282 1283 function getFlushgzh() { 1284 Public.Ajax(SpssauAddress.flushgzh, 'POST', { 1285 "identity": identity 1286 }, 'json', function (data) { //'https://www.spssau.com' 1287 if (data.code == 0) { 1288 $("#loadshow").hide(); 1289 var obj = eval(data.data); 1290 var stringjson = JSON.stringify(data); 1291 $.cookie('user', stringjson, { 1292 expires: 1, 1293 path: '/' 1294 }); 1295 if ($.cookie('lodinguser')) { 1296 var lodinguserData = JSON.parse($.cookie('lodinguser')); 1297 var index = lodinguserData.indexOf(obj.username); 1298 if (index > -1) { 1299 1300 } else { 1301 lodinguserData.push(obj.username); 1302 } 1303 $.cookie('lodinguser', JSON.stringify(lodinguserData), { 1304 path: '/' 1305 }); 1306 } else { 1307 var arr = []; 1308 arr.push(obj.username); 1309 $.cookie('lodinguser', JSON.stringify(arr), { 1310 path: '/' 1311 }); 1312 } 1313 Public.senStrg("Just_enter_the", 1); 1314 window.location.href = 'indexs.html'; 1315 // $.ajax({ //请æ±å岿°æ®å¹¶ä¿å 1316 // type: 'POST', 1317 // url: SpssauAddress.historyList, 1318 // data: 0, 1319 // timeout: 60000, 1320 // dataType: 'json', 1321 // success: function (historyListdata) { 1322 // Public.senlStorage("historylistdata", JSON.stringify(historyListdata)); 1323 // window.location.href = 'indexs.html'; 1324 // }, 1325 // error: function (xhr) { 1326 // $("#loadshow").hide(); 1327 // } 1328 // }); 1329 } else if (data.code == 100101) { 1330 // window.location.href = 'login.html'; 1331 new jBox('Notice', { 1332 height: 48, 1333 content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + data.message, 1334 color: 'red' 1335 }); 1336 } else if (data.code == 100102) { 1337 setTimeout(function () { 1338 getFlushgzh() 1339 }, 1000); 1340 } else if (data.code == 100117 || data.code == 100118) { 1341 $('#noLoginResult').text(data.message) 1342 } else { 1343 // new jBox('Notice', { 1344 // height: 48, 1345 // content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + data.message, 1346 // color: 'red' 1347 // }); 1348 } 1349 }, function (e) { 1350 console.log('error æ¥é!'); 1351 }); 1352 }; 1353 } 1354 }, function (e) { 1355 console.log('error æ¥é!'); 1356 }); 1357 }, 1358 getCopyAnalysis: function () { //å¤å¶åæå»ºè®® 1359 if (window.location.pathname == '/indexs.html') { 1360 // å¨ææ·»å AI徿 1361 $('.copyTable.has-ai-icon').each(function () { 1362 if (!$(this).next('.table_ai').length) { 1363 $(this).after('<img src="./images/icon/AI-interpret.svg" class="table_ai" style="width: 25px; margin-left: 5px; cursor: pointer;">'); 1364 } 1365 }); 1366 } 1367 var CopyAnalysis = '<i class="iconfont"><input class="copyTable copyAnalysis" id="copyAnalysisId" type="button"></i>'; 1368 if ($('.WordAnalysis').find('.copyAnalysis').length == 0) { 1369 $('.WordAnalysis>.icon').append(CopyAnalysis); 1370 } 1371 1372 $('.copyAnalysis').on('click', function (e) { 1373 $(this).parents('.WordAnalysis').attr('id', 'copyAnalysis').siblings('#copyAnalysis').removeAttr('id'); 1374 selectText('copyAnalysis'); 1375 }) 1376 1377 function selectText(thisId) { 1378 var doc = document; 1379 var element = doc.getElementById(thisId); 1380 if (doc.body.createTextRange) { 1381 var range = document.body.createTextRange(); 1382 range.moveToElementText(element); 1383 range.setStartAfter(element.firstChild); 1384 range.select(); 1385 } else if (window.getSelection) { 1386 var selection = window.getSelection(); 1387 var range = document.createRange(); 1388 range.selectNodeContents(element); 1389 range.setStartAfter(element.firstChild); 1390 selection.removeAllRanges(); 1391 selection.addRange(range); 1392 } 1393 document.execCommand("Copy"); // æ§è¡æµè§å¨å¤å¶å½ä»¤ 1394 }; 1395 }, 1396 jspreadsheet: function (Id, data, tableWidth, columns, change, minDimensions) { //åå§åtable 1397 var obj = { 1398 data: data, 1399 minDimensions: [100, 100], 1400 tableOverflow: true, 1401 tableWidth: '600px', 1402 freezeColumns: 1, 1403 allowRenameColumn: false, 1404 columnSorting: false, // 1405 about: false 1406 // columnDrag: true, //ç¦ç¨åæå¨ 1407 } 1408 if (tableWidth) { 1409 obj.tableWidth = tableWidth; 1410 } 1411 if (columns) { 1412 obj.columns = columns; 1413 } 1414 if (change) { 1415 obj.onchange = change; 1416 obj.ondeletecolumn = change; 1417 } 1418 if (minDimensions) { 1419 obj.minDimensions = minDimensions; 1420 } 1421 var mySpreadsheet = jspreadsheet(document.getElementById(Id
1421), obj); 1422 return mySpreadsheet; 1423 }, 1424 getMousePos: function (event) { //é¼ æ 宿¶åæ 1425 //var e = event || window.event; 1426 var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; 1427 var scrollY = document.documentElement.scrollTop || document.body.scrollTop; 1428 var x = event.pageX || event.clientX + scrollX; 1429 var y = event.pageY || event.clientY + scrollY; 1430 return { 1431 'x': x, 1432 'y': y - 75 1433 }; 1434 }, 1435 // å¨ tool.js ç exports.Tool å¯¹è±¡ä¸æ·»å 以䏿¹æ³ 1436 aliyunCaptchaHandler: function (options) { 1437 var defaultOptions = { 1438 sceneId: '1eqxz4is', 1439 element: '#yzm_wrap', 1440 usernameSelector: '#username', 1441 sendCodeType: 2, 1442 changewordsSelector: '.changewords', 1443 // onVerifySuccess: function () { }, // éªè¯æååè° 1444 // onVerifyError: function () { } // éªè¯å¤±è´¥åè° 1445 }; 1446 1447 var opts = $.extend({}, defaultOptions, options); 1448 1449 var captcha; 1450 1451 // åå§åé¿éäºéªè¯ç 1452 window.initAliyunCaptcha({ 1453 SceneId: opts.sceneId, 1454 mode: 'popup', 1455 element: opts.element, 1456 captchaVerifyCallback: async function (captchaVerifyParam) { 1457 // 1.åå端åèµ·ä¸å¡è¯·æ±ï¼è·åéªè¯ç éªè¯ç»æåä¸å¡ç»æ 1458 const result = await exports.Tool.sendVerifyCode($(opts.usernameSelector).val(), opts.sendCodeType, captchaVerifyParam); 1459 // 2.æé æ åè¿ååæ° 1460 const verifyResult = { 1461 // éªè¯ç éªè¯æ¯å¦éè¿ï¼booleanç±»åï¼å¿ éã 1462 captchaResult: result.code == 0, 1463 // ä¸å¡éªè¯æ¯å¦éè¿ï¼booleanç±»åï¼å¯éï¼è¥ä¸ºæ ä¸å¡éªè¯ç»æçåºæ¯ï¼bizResultå¯ä»¥ä¸ºç©ºã 1464 bizResult: result.code == 0, 1465 }; 1466 return verifyResult; 1467 }, 1468 onBizResultCallback: function (bizResult) { 1469 if (bizResult === true) { 1470 // éªè¯æåï¼å¯ç¨åè®¡æ¶ 1471 new jBox('Notice', { 1472 height: 48, 1473 content: "<img style='display:inline-block;margin:-3px 6px 0 0;' src='./images/icon/check-circle-blue.svg'>" + "éªè¯ç å·²åé", 1474 color: 'green' 1475 }); 1476 if (opts.onVerifySuccess) { 1477 opts.onVerifySuccess(); 1478 } else { 1479 exports.Tool.time($(opts.changewordsSelector)); 1480 } 1481 } 1482 }, 1483 getInstance: function (instance) { 1484 captcha = instance; 1485 1486 // é»è®¤è¡ä¸º 1487 $(opts.changewordsSelector).click(function () { 1488 // 妿æä¾äºèªå®ä¹ç getInstance 彿°ï¼å使ç¨å® 1489 if (opts.customGetInstance) { 1490 opts.customGetInstance(captcha, opts); 1491 } else { 1492 var username = $(opts.usernameSelector).val(); 1493 if (exports.Tool.checkPhoneFormat(username)) { 1494 captcha.show(); 1495 } 1496 } 1497 }); 1498 }, 1499 slideStyle: { 1500 width: 360, 1501 height: 40, 1502 }, 1503 language: 'cn', 1504 }); 1505 }, 1506 1507 sendVerifyCode: function (phoneNumber, codeType, captchaVerifyCode) { 1508 // è¿åä¸ä¸ª Promiseï¼ä»¥ä¾¿è°ç¨è å¯ä»¥è·åç»æ 1509 return new Promise(function (resolve, reject) { 1510 Public.Ajax(SpssauAddress.getRegisterCode, 'POST', { 1511 'username': '+86' + phoneNumber, 1512 'businessType': codeType, 1513 'scene': '1eqxz4is', 1514 captchaVerifyCode 1515 }, 'json', function (data) { 1516 resolve(data); 1517 $("#loadshow").hide(); 1518 }, function (e) { 1519 // ç½ç»éè¯¯æ¶æç» Promise 1520 reject(e); 1521 }); 1522 }); 1523 }, 1524 1525 time: function (o) { 1526 var time = 60; 1527 var tid = setInterval(function () { 1528 o.text((time - 1) + '(S)').attr("disabled", true).removeClass("DoNotUseVerification"); 1529 time--; 1530 if (time == 0) { 1531 clearInterval(tid); 1532 o.text("éåéªè¯ç ").attr("disabled", false).addClass("DoNotUseVerification"); 1533 } 1534 }, 1000) 1535 }, 1536 1537 checkPhoneFormat: function (b) { 1538 // telReg = !!b.match(/^(0|86|17951)?(13[0-9]|14[5-9]|15[012356789]|16[67]|17[0-8]|18[0-9]|19[1589])[0-9]{8}$/) 1539 // telReg = !!b.match(/^(0|86|17951)?[0-9]{11}$/) 1540 telReg = !!b.match(/^(0|86|17951)?(13[0-9]|14[0-9]|15[0-9]|16[0134689]|17[2-9]|18[0-9]|19[0-9])[0-9]{8}$/) 1541 // emailreg = !!b.match(/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/); 1542 if (b.length < 1) { 1543 rts = false; 1544 new jBox('Notice', { 1545 height: 48, 1546 content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + "ææºå·ä¸è½ä¸ºç©º", 1547 color: 'red' 1548 }); 1549 // $("#loadshow").hide(); 1550 } else { 1551 if (telReg) { 1552 rts = true; 1553 } else { 1554 rts = false 1555 new jBox('Notice', { 1556 height: 48, 1557 content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + "ææºå·æ ¼å¼ä¸æ£ç¡®", 1558 color: 'red' 1559 }); 1560 } 1561 } 1562 return rts; 1563 }, 1564 1565 checkVerifyCodeFormat: function (b) { 1566 var rt = false; 1567 if (b.length < 1) { 1568 rt = false; 1569 new jBox('Notice', { 1570 height: 48, 1571 content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + "éªè¯ç ä¸è½ä¸ºç©º", 1572 color: 'red' 1573 }); 1574 // $("#loadshow").hide(); 1575 } else { 1576 rt = true; 1577 } 1578 return rt; 1579 }, 1580 1581 checkoutPasswordFormat: function (b) { 1582 var rt = false; 1583 if (b.length < 1) { 1584 rt = false; 1585 new jBox('Notice', { 1586 height: 48, 1587 content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + "å¯ç ä¸è½ä¸ºç©º", 1588 color: 'red' 1589 }); 1590 // $("#loadshow").hide(); 1591 } else { 1592 if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z._]{6,18}$/.test(b)) { 1593 rt = false 1594 new jBox('Notice', { 1595 height: 48, 1596 content: "<img style='display: inline-block;margin:-3px 6px 0 0;' src='./images/icon/warning-circle-red.svg'>" + "å¯ç æ ¼å¼ä¸æ£ç¡®ï¼è¯·è¾å ¥6-18ä½åæ¯å æ°åç»å", 1597 color: 'red' 1598 }); 1599 // $("#loadshow").hide(); 1600 } else { 1601 rt = true; 1602 } 1603 } 1604 return rt; 1605 }, 1606 1607 saveFlag: false 1608 }; 1609 1610});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.