摘要: 看了http://www.cnblogs.com/fuhongxue2011/archive/2011/05/25/2056775.html的文章我自己也写了个冒泡排序<script>var temp;var arr=new Array(7,3,9,5,4,1);for (var i=0;i<arr.length;i++){ for(var j=i+1;j<arr.length;j++){ if(arr[i]<arr[j]){ temp=arr[i]; arr[i]=arr[j]; arr[j]=temp;}}}for (var i=0;i<arr.leng 阅读全文
posted @ 2011-05-25 18:34 一个土豆一棵青菜 阅读(235) 评论(0) 推荐(0)
摘要: <div style="position: fixed; top: 100px; left: 60px; width: 180px; background-color: red;">This div is using a fixed position of 100 pixels from the top and 60 pixels from the left of its containing block. When this page scrolls, this box will remain in a fixed position - it won' 阅读全文
posted @ 2011-05-25 14:54 一个土豆一棵青菜 阅读(3154) 评论(0) 推荐(0)
摘要: <div style="position:absolute;top:500px;left:60px;height:2000px;background-color:yellow;">This tall div is absolutely positioned 500 pixels from the top and 60 pixels from the left of its containing block.</div><div style="position:fixed;top:100px;left:60px;width:180px; 阅读全文
posted @ 2011-05-25 14:41 一个土豆一棵青菜 阅读(5819) 评论(0) 推荐(1)
摘要: /把一个日期字符串如“2007-2-28 10:18:30”转换为Date对象var strArray=str.split(" "); var strDate=strArray[0].split("-"); var strTime=strArray[1].split(":"); var a=new Date(strDate[0],(strDate[1]-parseInt(1)),strDate[2],strTime[0],strTime[1],strTime[2]) 2:第二种方法真是简单啊var s = "2005-12- 阅读全文
posted @ 2011-05-25 14:15 一个土豆一棵青菜 阅读(2172) 评论(0) 推荐(0)
摘要: 看了几篇文章 虽然不是很懂 我也小总结了下第一:自己调用自己第二:有大到小的顺序第三:当变量=1的时候 推出递归 if(temp==1) return 1; 就是 一定要设置出口 要不然会一直循环下去第四:当函数调用自己时,在栈中为新的局部变量和参数分配内存,函数的代码用这些变量和参数重新运行。递归调用并不是把函数代码重新复制一遍,仅仅参数是新的。当每次递归调用返回时,老的局部变量和参数就从栈中消除,从函数内此次函数调用点重新启动运行。可递归的函数被说成是对自身的“推入和拉出”。第五:递归运行速度慢,耗内存第六:动态规划能有效的--不会造成重复运end在命令式编程中,我们解决一些问题往往可以使 阅读全文
posted @ 2011-05-25 00:00 一个土豆一棵青菜 阅读(256) 评论(4) 推荐(0)