10 2016 档案
摘要:1 int整数相乘溢出 2 3 我们计算一天中的微秒数: 4 5 long microsPerDay = 24 * 60 * 60 * 1000 * 1000;// 正确结果应为:86400000000 6 System.out.println(microsPerDay);// 实际上为:500654080 7 8 9 问题在于计算过程中溢出了。这个计算式完全是...
阅读全文
摘要:1 小数精确计算 2 3 System.out.println(2.00 -1.10);//0.8999999999999999 4 5 6 7 上面的计算出的结果不是 0.9,而是一连串的小数。问题在于1.1这个数字不能被精确表示为一个double,因此它被表 8 9 示为最接近它的double值,该程序从2中减去的就是这个值,但这个计算的结果并不是最接近0.9...
阅读全文
摘要:1 TypeError: must be str, not bytes错误: 2 3 解答: 4 写文件处 f=open(filename, 'w')应该写为 open(filename, 'wb') 5 读文件时 f=open(filename,'rb') UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in posit...
阅读全文
摘要:import sys import time import os poem='''\ 测试读写文件 ''' print(os.getcwd()) f=file(os.getcwd()+'/python.txt','w') f.write(poem) f.close() C:\Users\Administrator\Desktop Traceback (most recent call la...
阅读全文
摘要:1 下一步 2 $("#alink").click(); // 触发了a标签的点击事件,但是没有触发页面跳转 3 document.getElementById("alink").click(); //既触发了a标签的点击事件,又触发了页面跳转 4 5 把 “下一步” 改为 “下一步” 即给A标签中的文字添加一个能被jQuery捕获的元素,然后$("#spanId").click();,...
阅读全文
摘要:1 js ajax传值中 2 "id":$('#id').val(), 3 如果#id不存在,使用$('#id').val()||‘’,可避免向后台传入undefined
阅读全文
摘要:1 //初始化编辑器 2 var editorMini = KindEditor.create('.editor-mini',{ 3 width : '70%', 4 height : '250px', 5 resizeType : 1, 6 uploadJson : '${basePath}/editorFile.do', 7 items : [''], 8...
阅读全文

浙公网安备 33010602011771号