03 2014 档案
fedorea19安装redis
摘要:Redis安装:$wgethttp://redis.googlecode.com/files/redis-2.4.5.tar.gz$tarxzfredis-2.4.5.tar.gz$cdredis-2.4.5$make&makeinstall测试:$src/redis-server$src/redis-cliauthhaojg//haojg是密码redis>setfoobarOKredis>getfoo"bar"将redis.conf中的daemonizeno变成daemonizeyes$cd../utils/$./install_server//安装启 阅读全文
posted @ 2014-03-28 14:02 zhaofeng555 阅读(159) 评论(0) 推荐(0)
java下载csv文件,中文标题
摘要:@RequestMapping(value = "/export.do")public void exportpushuserByareacode(HttpServletRequest req, HttpServletResponse rsp) throws Exception { List list = .....; String name="导出的文件.csv"; name = new String(name.getBytes("GBK"), "ISO8859-1"); rsp.setContentType(& 阅读全文
posted @ 2014-03-26 10:40 zhaofeng555 阅读(1871) 评论(0) 推荐(0)
java排序算法-归并排序
摘要:public class MergeSort { private static void mergeSortTest() { int[] in = { 2, 5, 3, 8, 6, 7, 1, 4, 0, 9 }; Utils.printArray("归并排序前:",in); int a[] = mergeSort(in); Utils.printArray("归并排序后:",a); } private static int[] mergeSort(int[] arr) { if (arr.length == 1) { return arr; } els 阅读全文
posted @ 2014-03-11 21:00 zhaofeng555 阅读(141) 评论(0) 推荐(0)
java排序算法-插入排序
摘要:public class InsertSortUtils { public static void main(String[] args) { insertSortTest(); shellSortTest(); } private static void insertSortTest() { int[] values = { 5, 2, 4, 1, 3 }; System.out.print("直接插入排序前: "); Utils.printArray(values); insertSort(values); System.out.print("直接插入排序后: 阅读全文
posted @ 2014-03-11 20:59 zhaofeng555 阅读(147) 评论(0) 推荐(0)
java排序算法-交换排序
摘要:public class ExchangeSortUtils { // 冒泡 public static void bubbleSort(int[] array) { int length = array.length; int temp; boolean isSort; for (int i = 1; i array[j + 1]) { // 交换 temp = array[j]; array[j] = array[j + 1]; array[j + 1] = temp; isSort = true; } } if (!isSo... 阅读全文
posted @ 2014-03-11 20:58 zhaofeng555 阅读(302) 评论(0) 推荐(0)
java排序算法-选择排序
摘要:public class SelectionSort { private static void selectSortTest() { int[] sortArray = { 5, 2, 4, 1, 3 }; System.out.print("选择排序前: "); Utils.printArray(sortArray); selectSort(sortArray); System.out.print("选择排序后: "); Utils.printArray(sortArray); } public static void selectSort(int[ 阅读全文
posted @ 2014-03-11 20:56 zhaofeng555 阅读(143) 评论(0) 推荐(0)