科学网

 找回密码
  注册
postgresql中比较real类型相等的正确方法
孙鹏 2015-12-19 12:48
先说结论,正确的方法类似如下语句: select vat from expenses where round(vat::numeric, 2) = 19.66; 而不能直接用相等: select vat from expenses where vat = 19.66; 参考: http://www.peterbe.com/plog/comparing-real-values 当你遇到诸如0.01的值时直接使用=则得不到你想要的结果。 加我私人微 ...
个人分类: postgresql|3360 次阅读|没有评论
MYSQL异常:General error: 2006 MySQL server has gone away
孙鹏 2015-4-19 19:02
在用php批量插入mysql数据时,如: $pdo-beginTransaction(); // also helps speed up your inserts. $stmt = $pdo-prepare ($sql); try { $stmt-execute($dataToInsert); } catch (PDOException $e){ echo $e-getMessage(); } $pdo-commit(); 会遇到如下异常: MYSQL异常 ...
个人分类: postgresql|8120 次阅读|没有评论
html5手机开发cookie的用法总结
孙鹏 2015-3-13 15:44
首先,如果不跨域,发送Ajax请求,例如: $( #btn_login ).on( click, function( event ) { $.ajax({ type: POST, url: serverURL + '/user',   ...
个人分类: js|18124 次阅读|没有评论
jquery请不要使用location.href方式跳转
孙鹏 2015-3-7 19:57
//location.href = login.html;//请不要使用这种跳转,会出现返回页面不能刷新 $.mobile.changePage(login.html, { transition: fade}); 原因还不知道 加我私人微信,交流技术。
个人分类: js|6584 次阅读|没有评论
如何用jquery获取当前页面url传入的参数
孙鹏 2015-3-3 18:23
参考: http://www.designchemical.com/blog/index.php/jquery/8-useful-jquery-snippets-for-urls-querystrings/ http://stackoverflow.com/questions/406192/get-current-url-in-javascript/4673540#4673540 这里把代码摘录一下: var vars = ; if(q != undefined){ ...
个人分类: js|14305 次阅读|没有评论
使用jquerymobile时,如何让data-rel="back" 返回时不再刷新页面
孙鹏 2015-2-18 16:03
先说结论: $(document).on('ready', function(){ //这里是你的事件 }); 下面我们来分析一下,首先看一下page的事件顺序,可参考: http://www.gajotres.net/page-events-order-in-jquery-mobile-version-1-4-update/ http://www.gajotres.net/page-events-order-in-jquery-mobile/ 这里做个 ...
个人分类: js|15418 次阅读|没有评论
错误解决: Failed to find: play-service-wearable+
孙鹏 2014-12-8 17:18
第一次使用Android Studio(我的是0.8.6Beata)新创建一个带wear的项目时,会报错: failed to find play-service-wearable+,如下图: 那么如何解决呢? 主要参考: http://www.tuicool.com/articles/yUb6be (注意文档中的 4. Update your extras (Google Play Services and Google Repository),只需要安装 ...
个人分类: android|2578 次阅读|没有评论
如何获得Java无符号byte的值
孙鹏 2014-9-16 17:58
如何获得Java无符号byte的值? /** * byte被看作无符号值转换成short * @param x * @return */ public static short getUnsignedByteValue(final byte x) { ByteBuffer tmpBuffer = By ...
个人分类: 杂七杂七加一|6065 次阅读|没有评论

本页有 2 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-28 10:10

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部