09 2013 档案

摘要:int maxCommonDivisor(int m, int n) { if (m % n == 0) { return n; } else { return maxCommonDivisor(n, m % n); } } int minCommonMultiple(int m, int n) { return m * n /(maxCommonDivisor(m, n)); } 阅读全文
posted @ 2013-09-21 11:14 水之原 阅读(310) 评论(1) 推荐(0) 编辑
摘要:boolean matchBracket( String str ) { Stack stack = new Stack(); try { for ( int i = 0; i < str.length(); i++ ) { char curChar = str.charAt( i ); switch ( curChar ) { case '[': ... 阅读全文
posted @ 2013-09-21 11:09 水之原 阅读(500) 评论(0) 推荐(0) 编辑
摘要:void bubbleSort( int[] values ) { int temp; for ( int i = 0; i values[j + 1] ) { temp = values[j]; values[j] = values[j + 1]; values[j + 1] = temp; } } } } // 改进后的程序如下... 阅读全文
posted @ 2013-09-21 11:05 水之原 阅读(847) 评论(3) 推荐(0) 编辑
摘要:本文会给你们展示50个jquery代码片段,这些代码能够给你的javascript项目提供帮助。其中的一些代码段是从jQuery1.4.2才开始支持的做法,另一些则是真正有用的函数或方法,他们能够帮助你又快又好地把事情完成。如果你发现你任何可以做得更好的地方的话,欢迎把你的版本粘贴在评论中!1. 如何修改jQuery默认编码(例如默认UTF-8改成改GB2312):$.ajaxSetup({ ajaxSettings:{ contentType:"application/x-www-form-urlencoded;chartset=GB2312"} });2. 解决jQue 阅读全文
posted @ 2013-09-03 16:13 水之原 阅读(3556) 评论(0) 推荐(3) 编辑
摘要:function DrawImage(ImgD, FitWidth, FitHeight) { var image = new Image(); image.src = ImgD.src; if (image.width > 0 && image.height > 0) { if (image.width / image.height >= FitWidth / FitHeight) { if (image.width > FitWidth) { ImgD.width = FitWidth; ... 阅读全文
posted @ 2013-09-03 15:14 水之原 阅读(584) 评论(2) 推荐(0) 编辑

点击右上角即可分享
微信分享提示