在Windows上安装Trac并集成SVN
在Windows上安装Trac并集成SVN,原文来自官方的Trac On Windows。Trac是一个wiki和Issue跟踪的项目管理系统,集成SVN能让变更管理和SVN配置管理更加使用。
关于Subversion的安装,可以参考Apache和Subversion集成安装与配置
使用Hibernate Shards来访问多个水平分区数据库
Hibernate Shards is a framework that is designed to encapsulate and minimize this complexity by adding support for horizontal partitioning to Hibernate Core.
即,Shards可以帮助程序透明地访问网络上多个水平划分数据库(分片)。下面主要介绍使用Hibernate Shards来访问多个水平分区数据库的配置。Shards的功能:
Hibernate Shards key features:
- Standard Hibernate programming model - Hibernate Shards allows you to continue using the Hibernate APIs you know and love: SessionFactory, Session, Criteria, Query. If you already know how to use Hibernate, you already know how to use Hibernate Shards.
- Flexible sharding strategies - Distribute data across your shards any way you want. Use one of the default strategies we provide or plug in your own application-specific logic.
- Support for virtual shards - Think your sharding strategy is never going to change? Think again. Adding new shards and redistributing your data is one of the toughest operational challenges you will face once you've deployed your shard-aware application. Hibernate Sharding supports virtual shards, a feature designed to simplify the process of resharding your data.
- Free/open source - Hibernate Shards is licensed under the LGPL (Lesser GNU Public License)
我收藏的链接(32)
我收藏的链接(31)
如何用Java识别中文和国际音标
How to identify Chinese and IPA using java?
Java Code:
public class UnicodeTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String sentence = "国际ɳʅ";
for (int i = 0; i < sentence.length(); i++) {
char c = sentence.charAt(i);
if ((c >= 0x4e00) && (c <= 0x9fbb)) {
System.out.println("This is Chinese");
}
if (java.lang.Character.UnicodeBlock.of(c).equals(java.lang.Character.UnicodeBlock.IPA_EXTENSIONS)) {
System.out.println("This is IPA");
}
}}
}
Resource:
Code Charts - Scripts
Derby Performance
Derby/Java DB性能测试评估,最近想选择一个轻量、可伸缩、高性能的嵌入式数据库,所以对Derby纯Java数据库进行了测试评估。从结果看来Derby还是挺不错的,和db4o,Perst,Berkeley DB是一个级别的,每秒能插入10000个对象,10000次对象查询能在1秒内完成,删除10000个对象也大约能在1-2秒内完成。
版本:
Apache Derby 10.4(1.0):derby.jar
结果:
Elapsed time for inserting 100000 records: 10563 milliseconds
Elapsed time for update 100000 records: 10422 milliseconds
Elapsed time for select 100000 records: 6250 milliseconds
Elapsed time for deleteing 100000 records: 9046 milliseconds
Jisp Java Database Performance
Jisp,A small, embedded database engine written in Pure Java.Jisp Performance is slower than Perst,db4o,jdbm,Berkeley DB Java Database.
The TestIndex benchmark measures the performance of such basic operations as storing/fetching objects and locating objects using an index. This test contains three steps:
- Create a specified number of records with random long integers and string keys and include them in long integer and string indices. After inserting of all records, a commit is performed.
- Search for each record using a long integer and string key.
- Search for and remove each record from the indices and deallocate it from storage.
JDBM纯Java数据库性能测试评估
JDBM性能测试评估,最近想选择一个轻量、可伸缩、高性能的嵌入式数据库,所以对JDBM 纯Java数据库进行了测试评估。从结果看来JDBM还是挺不错的,和db4o,Perst,Berkeley DB是一个级别的,每秒能插入10000个对象,10000次对象查询能在1秒内完成,删除10000个对象也大约能在1-2秒内完成。看来表现最差的JISP,insert、search、delete差不多都需要30秒。
版本:
jdbm-unspecified.jar(1.0)
结果:
Elapsed time for inserting 100000 records: 12282 milliseconds
Elapsed time for performing 100000 index searches: 7125 milliseconds
Elapsed time for deleting 100000 records: 16203 milliseconds
How to read all the data from an Lucene index?
How to read all the data from a Lucene index?
Document numbers start at 0. You will never get a document marked "deleted" from either IndexReader or IndexSearcher.
IndexReader reader = IndexReader.open(....);
for (int i = 0; i < reader.maxDoc(); i++) {
if (reader.isDeleted(i)) {
continue;
}
Document doc = reader.document(i);
...
}
Hint: if you have an unoptimized index with deleted documents, and you want to retrieve also the content of these deleted documents, call first IndexReader.undeleteAll().
Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.
Apache Lucene is an open source project available for free download. Please use the links on the left to access Lucene.
补充另一个方法:
TermDocs td = IndexReader.termDocs(null);
然后迭代td
金融危机下软件企业的机遇
虽然觉得中国的软件企业效率比较低,软件产品质量也不出色,中国自身的软件研发技术和管理技术需要大步的提升。但是,在金融危机下中国软件企业仍然有一些机遇。
从19世纪60年代以来,信息科技已经对几乎所有的行业进行了洗礼,这次金融危机将会对许多行业的风险管理、信息管理提出更高的要求;而企业对降低成本将有更高的要求;这些对中国的软件企业尤其是软件外包企业都是重大的机遇。高人力成本地区也将会更多考虑将事情放到低成本的地区去做。
Perst Java版性能测试评估
Perst性能测试评估,最近想选择一个轻量、可伸缩、高性能的嵌入式数据库,所以对Perst Java版数据库进行了测试评估。从结果看来Perst Java版还是值得试一试,Perst的性能是db4o,Perst,Jisp,Berkeley DB,JDBM中最出众的。
版本:
perst15-271.jar
结果:
Elapsed time for inserting 100000 records: 3359 milliseconds
Elapsed time for performing 200000 index searches: 1578 milliseconds
Elapsed time for deleting 100000 records: 2094 milliseconds
db4o Java版性能测试评估
db4o性能测试评估,最近想选择一个轻量、可伸缩、高性能的嵌入式数据库,所以对db4o Java版数据库进行了测试评估。从结果看来db4o Java版还是值得试一试,插入和删除记录性能和Berkeley DB Java版差不多,但是查询性能似乎差一些。
版本:
db4o-6.4.54.11278-java5.jar
结果:
Elapsed time for inserting 100000 records: 8063 milliseconds
Elapsed time for performing 200000 index searches: 28312 milliseconds
Elapsed time for deleting 100000 records: 11265 milliseconds
Berkeley DB Java版性能测试评估
Berkeley DB 性能测试评估,最近想选择一个轻量、可伸缩、高性能的嵌入式数据库,所以对Berkeley DB Java版数据库进行了测试评估。从结果看来Berkeley DB Java版还是值得试一试。
版本:
je-3.3.75.zip
结果:
Elapsed time for inserting 100000 records: 12672 milliseconds
Elapsed time for performing 200000 index searches: 10844 milliseconds
Elapsed time for iterating through 200000 records: 5297 milliseconds
Elapsed time for deleting 100000 records: 15859 milliseconds
Elapsed time for database close 1593 milliseconds
