上一页 1 2 3 4 5 6 7 8 9 ··· 27 下一页
摘要: //数组拷贝 public class Test { public static void main(String[] args) { String[] s = {"Microsoft", "IBM", "Sun", "Oracle", "Apple"}; String[] sCopy = new String[6]; System.arraycopy(s, 0, sCopy, 0, s.length); for(int i = 0; i < s.length; i++) { System 阅读全文
posted @ 2012-04-29 23:23 spring3 阅读(201) 评论(0) 推荐(0) 编辑
摘要: public class ThreeOut { public static void main(String[] args) { boolean[] arr = new boolean[500]; for(int i = 0; i < arr.length; i++) { arr[i] = true; } int leftCount = arr.length; int countNum = 0; int index = 0; while(leftCount > 1) { if(arr[index] == true) { count... 阅读全文
posted @ 2012-04-29 16:02 spring3 阅读(137) 评论(0) 推荐(0) 编辑
摘要: public class TestSort { public static void main(String[] args) { Date[] days = new Date[5]; days[0] = new Date(2004, 8, 6); days[1] = new Date(2007, 4, 6); days[2] = new Date(2007, 4, 9); days[3] = new Date(2004, 4, 6); days[4] = new Date(2004, 4, 5); bubbleSort(days); for(in... 阅读全文
posted @ 2012-04-29 15:23 spring3 阅读(137) 评论(0) 推荐(0) 编辑
摘要: public class Test { public static void main(String[] args) { if(args.length < 3) { System.out.println(" ==!"); System.exit(-1); } double d1 = Double.parseDouble(args[0]); double d2 = Double.parseDouble(args[2]); double d = 0; if(args[1].equals("+")) { d = d1 + d2; } ... 阅读全文
posted @ 2012-04-29 13:49 spring3 阅读(136) 评论(0) 推荐(0) 编辑
摘要: public class Test { public static void main(String[] args) { int a[] = { 3, 9, 8}; //静态初始化 Date days1 [] = { new Date(1, 4, 2004), new Date(2, 4, 2004), new Date(3, 4, 2004) }; //动态初始化 Date [] days2 = new Date[3]; for (int i = 0; i < 3; i++) { days2[i] = ... 阅读全文
posted @ 2012-04-29 11:05 spring3 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 第一步:在goods表格增加一个字段 is_bonus 类型 tinyint 默认为1 (1是可以使用红包)第二步:修改后台模板页 goods_info.htm<tr id=”alone_sale_1″><td id=”alone_sale_2″>{$lang.lab_is_on_sale}</td><td id=”alone_sale_3″><input type=”checkbox” name=”is_on_sale” value=”1″ {if $goods.is_on_sale}checked=”checked”{/if} /> 阅读全文
posted @ 2012-04-28 10:31 spring3 阅读(1275) 评论(0) 推荐(0) 编辑
摘要: 代码暂时不贴:说一下我的结构在tabPanel中放gridpanel,我的列有60列,但是滚动条不能拖动到最边上,有两列不能显示出来原因是我设置了tabpanel的宽度,超过了页面的宽度Ext.getBody.getWidth(),不设置就好了.就不会出现这样的问题. 阅读全文
posted @ 2012-04-27 14:27 spring3 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 第一阶段:练经典常用算法,下面的每个算法给我打上十到二十遍,同时自己精简代码,因为太常用,所以要练到写时不用想,10-15分钟内打完,甚至关掉显示器都可以把程序打出来.1.最短路(Floyd、Dijstra,BellmanFord)2.最小生成树(先写个prim,kruscal要用并查集,不好写)3.大数(高精度)加减乘除4.二分查找. (代码可在五行以内)5.叉乘、判线段相交、然后写个凸包.6.BFS、DFS,同时熟练hash表(要熟,要灵活,代码要简)7.数学上的有:辗转相除(两行内),线段交点、多角形面积公式.8.调用系统的qsort,技巧很多,慢慢掌握.9.任意进制间的转换第二阶段:练 阅读全文
posted @ 2012-04-26 22:51 spring3 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 问题1:给定一个单项链表,设计一个时间优化并且时间优化的算法,找出该链表的倒数第m个元素。当m=0时,返回链表的最后一个元素。[分析:用双指针来实现,两指针间隔m。同步移动两指针,当前一个指针为该链表tail时,后一个指针就为要找的元素]Element * FindMToLastElement( Element * head, int m){Element * current, * mBehind;int i;current = head;for( i = 0; i < m; i++){if(current->next){current = current->next;}el 阅读全文
posted @ 2012-04-26 22:46 spring3 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 下面通过一个例子来说明java类中不同代码块的执行顺序.class B {//静态变量 static int a = 0;//非静态代码块{ System.out.println("B.scope is running"); a = 10 ; }//静态代码块 static { System.out.println("B.static scope is running"); a = 20; }//构造函数 public B() {System.out.println("B.Constructor is running"); } pub 阅读全文
posted @ 2012-04-26 22:41 spring3 阅读(287) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 27 下一页