现在位置: 首页 > RochelleRoxon发表的所有文章
2.type Status report   message HTTP method GET is not supported by this URL   description The specified HTTP method is not allowed for the requested resource (HTTP    method GET is not supported by this URL). 访问时,一直报错: type: Status report message: HTTP method GET is not supported by this URL description: The specified HTTP method is not allowed for the requested resource (HTTP  method GET is not supported by this URL). 经过上网查询,原因如下: 1,继承自HttpServlet的Servlet......
阅读全文
  • 08月
  • 02日
综合 ⁄ 共 562字 评论关闭
首先使用vconfig创建vlan虚拟接口,并分别在两个接口上增加vlan100\vlan200\vlan300 vconfig add eth0 100 vconfig add eth0 200 vconfig add eth0 300 vconfig add eth1 100 vconfig add eth1 200 vconfig add eth1 300 启用vlan端口 ifconfig eth0.100 up ifconfig eth0.200 up ifconfig eth0.300 up ifconfig eth1.100 up ifconfig eth1.200 up ifconfig eth1.300 up 创建网桥(名称为br0) brctl addbr br0 //加入端口(分别将两个Vlan加入网桥中)切记:不是将eth0和eth1添加到网桥中brctl addif br0 eth0.100 brctl a......
阅读全文
我们在对前面的几个聚集类进行分析的时候,我们发现,聚集类是一个curd很频繁的类,那么,他就不可避免的涉及到线程安全的问题,我们知道Vector是线程安全的,但是,其他的类,怎么能让他达到线程安全的地步呢,我们就不得不拉出Collections类来;其中有三个精彩的方法:   public static <T> Set<T> synchronizedSet(Set<T> s) {     return new SynchronizedSet<T>(s);     }  static class SynchronizedSet<E>       extends SynchronizedCollection<E>       implements Set<E&g......
阅读全文
  • 03月
  • 11日
综合 ⁄ 共 1049字 评论关闭
Suppose there're odd number of elements in a linked-list, how to get the middle element in it? I find a clever way to achieve this on internet. Two pointers point to the linked-list. One is slow pointer and the other is quick pointer. Each time slow pointer moves one step, while the quick pointer moves two steps. When the quick pointer reaches the end of the list, the slow pointer is pointing to the middle of the list.   The slow and quick pointers solution can also be used to check whet......
阅读全文
  • 03月
  • 09日
移动开发 ⁄ 共 827字 评论关闭
想在android2.* 下面使用actionbar 我们可以使用JakeWharton写的support library扩展 ActionBarSherlock 1.ActionBarSherlock主页http://actionbarsherlock.com/index.html,下载地址https://github.com/JakeWharton/ActionBarSherlock/archive/4.2.0.zip 2.将下载下来的ActionBarSherlock下的library导入到eclipse,成为一个4.0+的android库项目 3.在你的项目中引用,项目上右击properties->android->Library->add, 选择ActionBarSherlock 4.删除你项目中的support v4包,因为ActionBarSherlock中已经包含了这个包,不然......
阅读全文
  • 08月
  • 12日
数据库 ⁄ 共 1303字 评论关闭
最近做了个项目,实现对存在千万条记录的库表进行插入、查询操作。原以为对数据库的插入、查询是件很容易的事,可不知当数据达到百万甚至千万条级别的时候,这一切似乎变得相当困难。几经折腾,总算完成了任务。在此做些简单的小结,不足之处,还望javaeye的高手们帮忙补充补充! 1、 避免使用Hibernate框架   Hibernate用起来虽然方便,但对于海量数据的操作显得力不从心。   关于插入:   试过用Hibernate一次性进行5万条左右数据的插入,若ID使用sequence方式生成,Hibernate将分5万次从数据库取得5万个sequence,构造成......
阅读全文
  • 05月
  • 22日
综合 ⁄ 共 1211字 评论关闭
学习Android,了解一些基本概念将有助更深入的去学习和理解Android。在这里,所要讲述的是Android里三个比较基础的概念:Android  Application、Activity Stack 和 Task。   1. 什么是Android Application?   Android Application就是一个android应用程序。 简单的理解就是一个apk就是一个Android Application。例如Android平台下自带的应用程序:Browser、Contacts、camera等。   每一个Application都是由Activity、Service、content Provider和Broadcast Receiver等Android的基本组件所组成,其中Activity是实现应用......
阅读全文
  • 05月
  • 18日
综合 ⁄ 共 3669字 评论关闭
C3P0在最近的demo中也用了(我用的是0.9.2.1版本),因为单例很难应付大量并发。 【引用请注明出处http://blog.csdn.net/bhq2010/article/details/9219947】 用法详见文档:http://www.mchange.com/projects/c3p0/ 基本的用法在http://www.mchange.com/projects/c3p0/#quickstart,以及http://www.mchange.com/projects/c3p0/#using_c3p0中。 在项目中更为方便的做法是将配置写在配置文件中。 C0P0的配置文件名为c3p0-config.xml,详见http://www.mchange.com/projects/c3p0/#configuration_files 一个示例的配置文件如下: 【引用......
阅读全文
  • 05月
  • 16日
综合 ⁄ 共 875字 评论关闭
举例说明java中 list转换为其它类型数组的实现方式,即调用list的toArray函数。 1. 代码: package com.myjava.test; import java.util.ArrayList; import java.util.List; public class JavaTest { /*** @param args*/JavaTest t = new JavaTest();public static void main(String[] args) {test(); }private static void test() {List<model> list = new ArrayList<model>();for (int ii = 0; ii< 3; ii++) {model m= new model(ii + 5,"s1");list.add(m);}final int size =  list.size();//test case1: String......
阅读全文
  • 05月
  • 04日
综合 ⁄ 共 2773字 评论关闭
 http://topic.csdn.net/u/20080924/13/9614b56e-7817-44da-b6ac-7abf2c60d5a7.html 昨天写存储过程时遇到一个麻烦,再搜寻答案时搜到了“通用存储过程”,但只看到部分残缺代码,多方参考后,鄙人对其进行总结规范,得出以下规范存储过程,竟然把本人项目里50多个查询存储过程代替!不敢独享,遂贴出与大家分享,希望对大家有所帮助!! 该存储过程几乎可以涵盖所有查询存储过程(目前本人还没有发现不能使用的) 参数:分页大小,第几页,需要得到的字段 ,需要查询的表 , 查询条件,排序的字段名,排序的类型,主键名称 输入......
阅读全文
  • 05月
  • 02日
综合 ⁄ 共 2002字 评论关闭
题目大意:给出一个无向边,很多询问,问x,y两地之间的最长路最短是多少。 思路:乍一看好像是二分啊。的确这个题二分可以做,但是时间会慢很多,有的题直接就T掉(NOIP2013货车运输)。其实这个题的模型就是最小瓶颈路模型。解法就是把无向图变成一个最小生成树,然后两点之间的最长路就是满足题意的答案。 CODE: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define MAX 15010 #define INF 0x7f7f7f7f using namespace std; struct Complex{ int x,y,len; ......
阅读全文
  • 04月
  • 15日
综合 ⁄ 共 1450字 评论关闭
input.xml   <?xml version="1.0" encoding="UTF-8"?> <UserRegisterReq> <Sequence>2345</Sequence> <TimeStamp>20110609222215</TimeStamp> <channelID>4</channelID> <Sign>53fd2ebccb45fb287aa4c172ccc8e73b</Sign> <UserID>444</UserID> <UserMSISDN>13501315080</UserMSISDN> <UsereMail>abc@test.com</UsereMail> </UserRegisterReq>     发请求,将input.xml内容作为body cat input.xml | curl -X POST -H 'Conten......
阅读全文