- 博客(21)
- 资源 (1)
- 问答 (2)
- 收藏
- 关注
lucene-1.4入门例子的详细注释
[size=small]才开始学习lucene,所以从网上找了个不错的入门例子来看,并且加了很详细的注释,假如有不对的地方,还请大家指正: Indexer.java [code="java"]// 索引生成类 public class Indexer { // 传入2个参数,一个是索引文件路径,一个是数据文件路径 public static void main(String[] ar...
2008-07-28 10:56:08 90
类和接口的性能方面的建议
[size=small] [list] [*]避免昂贵复杂的构造过程 [/list] [list] [*]内部类对象的创建比一般类的实例要复杂,耗时,所以最好用非public的具体类代替 [/list] [list] [*]尽量使用接口 [/list] [list] [*]使用包装类比使用原数据要低效 [/list] [list] [*]大多数的JVM在搜索接口列表时是...
2008-07-27 15:11:59 143
hibenate.hbm2ddl.auto属性详解
hibernate配置属性中,hibernate.hbm2ddl.auto可以帮助你实现正向工程,即由java代码生成数据库脚本,进而生成具体的表结构. 在hibernate.cfg.xml中: [code="java"] [/code] 它包含4个属性: [list] [*]create : 会根据你的model类来生成表,但是每次运行都会删除上一次的表,重新生成...
2008-07-26 22:28:06 105
配置eclipse,netbeans的运行参数
[size=small] eclipse可以配置一些参数来优化它的运行,运行参数可以在eclipse根目录下的eclipse.ini文件中进行修改: [code="java"] -vmargs //关闭java字节码验证,加快类装入的速度 -Xverify:none //设置java初始堆的大小 -Xms256m ...
2008-07-26 17:31:14 351
schooling and education
[size=small] It is commonly believed in the United States that school is where people go to get an education . [color=red]Nevertheless [/color], it has been said that today chil...
2008-07-23 07:52:35 123
JFig读取配置文件,实现动态加载
通过JFig.jar可以实现读取配置文件,把数据保存到集合中,然后通过代理就可以实现动态加载了. Collection类 [code="java"]/** * @author 42087743 * 功能:读取配置文件,将数据存储到hashmap中 * 说明:为节约版面,省去了set和get方法 */ public class CollectionConfig { //设置...
2008-07-22 09:46:09 251
读取资源文件
首先创建个类FileDirectoryConfig类,需要读取资源文件时,就可以调用这个类. [code="java"] public class FileDirectoryConfig { // value是资源文件中的值,key是资源文件中的键,key需要用户输入 private String value = null; // pro...
2008-07-20 22:50:00 95
static赋值的变态例子
大家看看下面会打印什么: [code="java"] static int first = accessTooSoon(); static int second = 1; static int accessTooSoon() { return (second); } public static void main(String[] args) { ...
2008-07-20 00:51:15 130
内存泄露
javaVM虽然有自己的垃圾回收器,可以回收大部分的内存空间,但还是有部分的内存空间是回收不了的. 内存中饿对象分为3种: 1.无用的对象,但是不可达,这是C或C++中的内存泄露; 2.无用的对象,也可达,这就是java中的内存泄露; 3.有用的对象.这就不是内存泄露了. 为什么java中也会存在内存泄露呢,什么情况下会出现这种情况,下面是一个比较普遍的例子: [code="j...
2008-07-18 17:28:16 83
ArrayList的性能问题,大家看看
ArrayList的特点是可以动态改变长度,但是每次改变长度的时候性能花费是很大的,所以我们可以通过它自身的ensureCapacity()事先就给它决定好长度,这里有个前提,必须大概预测它的长度是多少.但是测试出结果出乎我的意料,大家一起来看看什么原因 [code="java"] final int count = 100000; long startTime, stopTime,...
2008-07-17 11:27:33 202
原创 The Language of Music - 2
Singers and [color=red]instrumentalists[/color] have to get every [color=red]note[/color] perfectly [color=red]in tunes[/color] . the pianists are spared this particular [color...
2008-07-17 07:52:10 134
整了2天的aop-spring2
项目的日志部分由我负责,哎,本来以为spring2的aop能有多难,spring1的会了,2的肯定也手到擒来,没想到,就这个整整花了我2天的时间才摆平,都崩溃了. 下面简单地写下代码和配置: [code="java"]@Transactional //spring事务的支持 @Aspect //声明切面 public class LogSe...
2008-07-16 17:25:28 126
原创 The Language of Music
[size=small] A painter hangs his or her finished picture on a wall , and everyone can see it . A [color=red]composer [/color]writes a work , but no one can hear it until it is [...
2008-07-13 16:06:31 82
原创 Students racking up debt in UK
[size=small] British students are borrowing [color=red]record[/color] amounts to pay for their studies , new goverment [color=red]figures[/color] revealed last week . &...
2008-07-12 12:47:31 120
static方法不能被覆盖
[size=small] 实例方法被覆盖,静态方法被隐藏 [code="java"]public class testStatic { public static void main(String[] args) { Super s = new Sub(); System.out.println(s.g...
2008-07-12 12:33:52 213
原创 struts2的struts.properties配置
[list] [size=small] [*]struts.action.extension The URL extension to use to determine if the request is meant for a Struts action 用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的'do...
2008-07-10 10:09:29 66
struts2的数组显示
[code="java"] [/code]有的时候查询数据库的时候,比如"select a.id , a.name from Account a",查询结果返回的是集合,集合里封装的是数组.用了上面的技术,就可以显示了. 从上面的例子可以看出,status的用处是很大的,所以想不到怎么直接迭代的时候,可以通过status的参数来间接迭代. 下面是转载的内容: ...
2008-07-08 14:08:18 327
原创 Look in the mirror and say
[size=small] As the school year progressed , the teacher was [color=red]distressed[/color] to see that more and more of the students were beginning to [color=red]tease[/color]...
2008-07-08 08:09:06 110
dwr入门
[size=small]dwr配置: 1. 需要在web.xml文件里面加上dwr的过滤器 [code="java"] dwr-invoker org.directwebremoting.servlet.DwrServlet debug true dwr-invoker /dwr/* [/code...
2008-07-05 21:11:33 114
java的存储区
概括而言,java有6个地方可以存储数据: [list] [*]寄存器:存储最快的地方[/list] [list] [*]堆heap:一般new个对象的时候,将对象的数据存储在堆栈中,包括数组的new[/list] [list] [*]栈stack:速度比堆快,声明的变量存储在栈中,不过有区别,变量会把数值也存储在一起,但对象就会再在堆栈中划个区域保存数据,即栈中的对象引用堆中的数...
2008-07-05 17:58:10 106
原创 2008_07_02
" With the rise of netizen population , the leaders are [color=red]attaching [/color]more importance to the Internet as a direct communication channel ." said Wang Sixin , the ...
2008-07-02 08:04:19 69
空空如也
lucene不能查询出结果(初级问题)
2008-08-04
请教,javascript的拖动div代码
2008-07-30
TA创建的收藏夹 TA关注的收藏夹
TA关注的人