posts - 97,  comments - 93,  trackbacks - 0
  2006年10月30日
Rank 1:


       SIGMOD: ACM SIGMOD Conf on Management of Data
       PODS: ACM SIGMOD Conf on Principles of DB Systems
       VLDB: Very Large Data Bases
       ICDE: Intl Conf on Data Engineering

       CIKM: Intl. Conf on Information and Knowledge Management
       ICDT: Intl Conf on Database Theory


Rank 2:

SSD: Intl Symp on Large Spatial Databases
DEXA: Database and Expert System Applications
FODO: Intl Conf on Foundation on Data Organization
EDBT: Extending DB Technology
DOOD: Deductive and Object-Oriented Databases
DASFAA: Database Systems for Advanced Applications
SSDBM: Intl Conf on Scientific and Statistical DB Mgmt
CoopIS - Conference on Cooperative Information Systems
ER - Intl Conf on Conceptual Modeling (ER)


参考 http://www3.ntu.edu.sg/home/assourav/crank.htm

posted @ 2009-09-25 00:02 wqwqwqwqwq 阅读(269) | 评论 (0)编辑 收藏
     摘要: That’s why I don’t want to hear people’s ideas.
I’m not interested until I see their execution.  阅读全文
posted @ 2008-08-11 11:21 wqwqwqwqwq 阅读(1294) | 评论 (1)编辑 收藏
     摘要: 这两天在学习python,主要参考简明教程http://www.swaroopch.com/byteofpython/ , 入门很不错,有兴趣推荐参考。
在16章中,作者建议读者写一个地址簿程序,还记得写它都是在大一学c语言的年代了,不过下午还是抽出了一点时间来写这个程序,写了两个版本,一个是使用python 字典来存储名字和地址,另一个版本则使用python的面向对象特性,来链式存储联系人对象。  阅读全文
posted @ 2008-07-24 17:51 wqwqwqwqwq 阅读(1549) | 评论 (3)编辑 收藏
     摘要: 据说最近psp最近要升值了~无论是因为破解的原因还是什么,但总之估计sony还是很难想到,当然我们也很值得庆幸的是这帮hack的大牛已然将kvm,python stackless等移植到了psp平台,强大的ppc支持,可足以媲美几年前的personal computer,这一点毋庸置疑,更不用去与手机平台相对比了。  阅读全文
posted @ 2008-07-24 12:21 wqwqwqwqwq 阅读(2490) | 评论 (4)编辑 收藏
     摘要: org.eclipse.jface.viewers.TreeViewer

的继承关系是  阅读全文
posted @ 2008-04-23 00:10 wqwqwqwqwq 阅读(4821) | 评论 (3)编辑 收藏
目前 ext已经全面升级了主站,而且也release2.1版本,并新增了一些例子。
最近发布的Firefox3 beta 5版本,个人认为还是比较不错,运行JS的也更快、上网速度也快了很多。
但经原来做的一些js程序测试,ext2.0版本运行在FF3Beta5上还存在一些显示问题。

posted @ 2008-04-22 12:50 wqwqwqwqwq 阅读(1456) | 评论 (1)编辑 收藏
     摘要: 昨天写了个关于图库的总结mail 在这贴下,以供参考,当然望不吝赐教  阅读全文
posted @ 2008-04-21 18:09 wqwqwqwqwq 阅读(1415) | 评论 (0)编辑 收藏
     摘要: 前两天写了一个处理逻辑表达式的小程序,可以用来处理专家系统实事等逻辑关系表达式。  阅读全文
posted @ 2008-02-26 19:05 wqwqwqwqwq 阅读(2577) | 评论 (2)编辑 收藏
     摘要: EasyMock 是一套通过简单的方法对于指定的接口或类生成 Mock 对象的类库,它能利用对接口或类的模拟来辅助单元测试。本文将对 EasyMock 的功能和原理进行介绍,并通过示例来说明如何使用 EasyMock 进行单元测试。   阅读全文
posted @ 2008-02-18 22:14 wqwqwqwqwq 阅读(731) | 评论 (0)编辑 收藏
     摘要: Craigslist的网站上没有图片,只有密密麻麻的文字,标着各种生活信息,是个巨大无比的网上分类广告加BBS的组合...  阅读全文
posted @ 2008-01-21 13:06 wqwqwqwqwq 阅读(2529) | 评论 (0)编辑 收藏
posted @ 2007-12-25 20:25 wqwqwqwqwq 阅读(431) | 评论 (0)编辑 收藏
     摘要: Trie树是一棵度 m ≥ 2 的树,它的每一层分支不是靠整个关键码的值来确定,而是由关键码的一个分量来确定。  阅读全文
posted @ 2007-12-13 20:07 wqwqwqwqwq 阅读(1734) | 评论 (0)编辑 收藏
     摘要: For myself learning.
Personal Mastery  阅读全文
posted @ 2007-12-09 18:28 wqwqwqwqwq 阅读(1449) | 评论 (3)编辑 收藏
     摘要: Have you read Jess In Action by Earnest J. Freedman-Hill? It's one of the better books out there on rule engines, though it does require some experience to get the most out of the book.
A variation on the bookstore could be recommendation engine. That would provide an opportunity to use a rule engine for direct matching on category/subcategory and aggregations.  阅读全文
posted @ 2007-11-29 10:42 wqwqwqwqwq 阅读(970) | 评论 (5)编辑 收藏
     摘要: IBM Dump Analyzer for Java是来分析虚拟机稳定性的一种可扩展框架。对Java虚拟机生成的产物进行自动诊断。  阅读全文
posted @ 2007-11-16 15:36 wqwqwqwqwq 阅读(1243) | 评论 (1)编辑 收藏
     摘要: 实在忍受不了sun的做事风格和它的开发工具了,nb的beta6一踏糊涂一堆bug,唉~想着就想起来sun中国弄个nb插件的比赛不仅过程糟糕,获奖了居然还不兑现承诺,到现在也杳无音信,估计是证书也不想发了,真是让大家对它越发感到没有信心~~~~~~~~~不提这个了,还是讲讲Europa 和 myeclipse, 最近在写一个基于规则的引擎,用的Europa 和myeclipse6 感觉非常舒服,myeclipse的功能也大大加强了比如改进了javaEE5 提高了EJB3开发效率可以支持从数据模型到bean的转换,java的持久化程度及其Spring-JPA的高度集成。开发ajax的朋友可以发现 myeclipse对ajax的开发和测试做的也非常好,尤其是对js的调试。Web开发的另一个特点是支持RAD web。nb原来喊的一项特色是集成了matisse,在myeclipse目前也集成了它而且对于可视化swing开发非常方便,当然你也可以自己按照,不直接更新。
myeclipse中集成的derby和tomcat也大大加速了服务器的连接和部署,调试等。至于db视图个人使用oracle  阅读全文
posted @ 2007-11-11 15:11 wqwqwqwqwq 阅读(2240) | 评论 (11)编辑 收藏
     摘要: Given a picture composed entirely of horizontal and vertical line segments, calculate the minimum number of times you must lift your pen to trace every line segment in the picture exactly n times.
Each line segment will be of the form " " (quotes for clarity), representing a segment from (x1,y1) to (x2,y2). Segments may cross each other. Segments may also overlap, in which case you should count the overlapping region as appearing in the drawing only once. For example, say t  阅读全文
posted @ 2007-10-30 21:36 wqwqwqwqwq 阅读(1183) | 评论 (0)编辑 收藏
     摘要: In most states, gamblers can choose from a wide variety of different lottery games. The rules of a lottery are defined by two integers (choices and blanks) and two boolean variables (sorted and unique). choices represents the highest valid number that you may use on your lottery ticket. (All integers between 1 and choices, inclusive, are valid and can appear on your ticket.) blanks represents the number of spots on your ticket where numbers can be written.  阅读全文
posted @ 2007-10-24 21:20 wqwqwqwqwq 阅读(1202) | 评论 (1)编辑 收藏
     摘要:
Let's say you have a binary string such as the following:
011100011
One way to encrypt this string is to add to each digit the sum of its adjacent digits. For example, the above string would become:
123210122  阅读全文
posted @ 2007-10-23 13:34 wqwqwqwqwq 阅读(1049) | 评论 (1)编辑 收藏
     摘要: People enjoy mazes, but they also get them dirty. Arrows, graffiti, and chewing gum are just a few of the souvenirs people leave on the walls. You, the maze keeper, are assigned to whiten the maze walls. Each face of the wall requires one liter of paint, but you are only required to paint visible faces. You are given a map of the maze, and you must determine the amount of paint needed for the job.  阅读全文
posted @ 2007-10-21 21:28 wqwqwqwqwq 阅读(1456) | 评论 (1)编辑 收藏
     摘要: In written languages, some symbols may appear more often than others. Expected frequency tables have been defined for many languages. For each symbol in a language, a frequency table will contain its expected percentage in a typical passage written in that language. For example, if the symbol "a" has an expected percentage of 5, then 5% of the letters in a typical passage will be "a". If a passage contains 350 letters, then 'a' has an expected count of 17.5 for that passage (17.5 = 350 * 5%). Pl  阅读全文
posted @ 2007-10-21 20:14 wqwqwqwqwq 阅读(912) | 评论 (1)编辑 收藏
     摘要: A speed radar is installed in a highway zone where the maximum speed limit is maxLimit mph, and the minimum speed limit is minLimit mph.  阅读全文
posted @ 2007-10-20 13:25 wqwqwqwqwq 阅读(1258) | 评论 (1)编辑 收藏
     摘要: 好长时间没写程序了感觉,忘了很多东西,呵呵,今天打开Eclipse写了一个Struts的小应用,也回顾了一遍它的主要内容,这篇随笔就把整理的一些东西贴出来吧。  阅读全文
posted @ 2007-10-07 16:55 wqwqwqwqwq 阅读(996) | 评论 (0)编辑 收藏
     摘要: 本程序为优化,比较好的方法是,进行曲线积分,算误差比进行方程约束,由于时间比较少,稍候会给出优化程序。  阅读全文
posted @ 2007-08-14 17:27 wqwqwqwqwq 阅读(1001) | 评论 (0)编辑 收藏
     摘要: A simple implement of own stack  阅读全文
posted @ 2007-08-03 18:14 wqwqwqwqwq 阅读(989) | 评论 (0)编辑 收藏
     摘要: To find a max segment in a array which includes negative and positive no.There r several methods to solve this question.  阅读全文
posted @ 2007-07-31 12:45 wqwqwqwqwq 阅读(839) | 评论 (0)编辑 收藏
     摘要: 今天很早的来到公司,首先查收了一下邮箱,发现5封新邮件,仔细的看了下都是关于我前天申请一个IBM USA那边的一个DB访问权限的邮件。  阅读全文
posted @ 2007-07-27 08:55 wqwqwqwqwq 阅读(288) | 评论 (2)编辑 收藏
     摘要: Sun has just announced the winners of netbeans plugin competition  阅读全文
posted @ 2007-07-21 23:34 wqwqwqwqwq 阅读(1133) | 评论 (0)编辑 收藏
PMI
     摘要: PMI(Performance MonitoringInfrastructure)   阅读全文
posted @ 2007-07-13 17:32 wqwqwqwqwq 阅读(1181) | 评论 (2)编辑 收藏
there r so many sundries during these days and almost every point is focussing on papers\projects\ ...\recommending data for my next master degree, but my thought just is in a mess, i cannot describe the stage && status except paying more attention,well,just feeling time is out of my hand.the only thing I am looking forward is the result of nb plugin competition and i will send the request and willing letter to the professors later but then.I m believing that though  have lost the opportunity of my target ~~God, it's so pity for a sudden change,at the same time, I stood with everything.I have got another time now and have prepared all the condition for the coming applying.thx in advance for my friends, because u have give a stage and some suporting.especially to stand^-^.TracyYan now has just rushing in && strangely,I find~~~~after six years,why not then, I have also no answers, may be pretty but not really for the feeling,~~~~~.
Yestoday I have collected some data about computer science department professors of pku, bless.
benny is a so kind person though he(she is a judge, but i really want to say,actually not to him.here the only puzzlement is why now after a month asking the method how to use the tool and why dont know the document which has contains all the info he want to know, I know, really, each guy is busy, busy with one's sundries,so many! Symptom.


posted @ 2007-07-11 22:19 wqwqwqwqwq 阅读(518) | 评论 (0)编辑 收藏
     摘要: 首先说点别的:),今天google adsense给我回信关于blog头搜索不好用的原因是嵌在了里。我评论的前两条是表扬google...  阅读全文
posted @ 2007-06-02 23:16 wqwqwqwqwq 阅读(1509) | 评论 (8)编辑 收藏
     摘要: 好长时间没写随笔了^^,主要是因为这几天很忙,ibm的、学校的、还有sun的插件大赛,但是这段时间自己确一直在学习,在继续关注技术的进展,随着这篇关注焦点,在之后的几天里,我会继续写一些,IBM SOA、SOAP、RBD、EGL还有我们HotJava的 SmallWorld等内容。
JavaFX当前是备受SUN推崇和重点推广的项目之一,也是Java技术继续演化的内容之一。  阅读全文
posted @ 2007-05-31 11:03 wqwqwqwqwq 阅读(1214) | 评论 (0)编辑 收藏
     摘要: 今天浏览网页,看见篇写JNDI比较基础,也比较详细的文章,又自己整理了一下,post到新手区了,。。。。:)JNDI是java访问名字和目录服务的接口,与JDBC一样,它仅仅只定义了一套服务接口,实现由具体厂商提供。作为j2ee核心组件之一,它为应用程序查找其他程序组件和资源提供了统一的接口,其中最常见的用途就是数据源的配置、EJB名字查找、JMS相关配置等。JNDI的架构如下图。在JDK1.3中...  阅读全文
posted @ 2007-05-14 23:33 wqwqwqwqwq 阅读(807) | 评论 (0)编辑 收藏
ITM
     摘要: 开篇,哈哈哈,我喜欢这句话“NO MONEY ONLY WORK DADADI”。
ITM provides out of box uses to quickly deploy and active the app with the best ibm practice.admins can define the user's views,threshold and so on.Tivoli Enterprise Monitoring Agents are available for monitoring different types of platforms and applications, including mainframes,middleware,distributed,and database...  阅读全文
posted @ 2007-05-11 23:00 wqwqwqwqwq 阅读(954) | 评论 (0)编辑 收藏
     摘要: CLI command line interface ...  阅读全文
posted @ 2007-05-10 23:23 wqwqwqwqwq 阅读(985) | 评论 (0)编辑 收藏
     摘要: 据说极有可能迅速取代目前流行的SWING和SWT技术。  阅读全文
posted @ 2007-05-07 22:30 wqwqwqwqwq 阅读(983) | 评论 (1)编辑 收藏
北京今天有些风,但是依然挡不住本有的闷热。傍晚下楼吃饭,就像突然走进蒸笼一样的感觉,想象着眼前如果是大海该多好啊,说到这真是惭愧,我在大连待了20多年,居然不会游泳,哎~...吃完饭,我从上地佳园溜达到公司,休息了一下。本想着看点书,但是这个时候似乎是快到下班的时间了,看着白领一族的匆匆离去、联想围栏旁悠然自得的粉刷小匠,我突然萌生要离开这儿,去高校转转的念头。
绕过DASCOM沿着信息路来到了五街,在路牌下等者656...我真的实在受不了了太阳的直射和等车的烦躁,终于决定今天也学一次抗日前的长征,学一次开学前的军训,...自己走到北大,也算熟悉熟悉一路的环境。现在回来我真的发现这是一个了不起的决定,因为这实在太累,走去五环-北大-四环,又跑回上地,即使在地图上只能算作一指之距。想想先前走到北京体校时看见一个学生绕学校跑时的窃窃思绪,我更敬佩自己。脚累得很,但我也算是准备好了这段时间出门在外的辛苦...RuiRui,你说得很好,坚持久了,也就好了。

posted @ 2007-05-07 21:40 wqwqwqwqwq 阅读(440) | 评论 (0)编辑 收藏
     摘要: 今天自己突然想起来整理一下标准的charset,感觉还算有必要。当然java...  阅读全文
posted @ 2007-05-06 19:50 wqwqwqwqwq 阅读(608) | 评论 (0)编辑 收藏
昨天来得北京,准备我以后几个月的实习生活。北京还是和我原来来的感觉一样,到处都是人流车流,太阳总是离得很近,风吹起的扬尘让我透不过气...唯一使人感觉现代感的和不很疲惫的就是坐着北京的城铁和地铁,起码它们不会因为宣泄而停滞。有些安慰的是坐在IBM的办公大厅,我喜欢IT深邃的魅力,和品茶的悠然...
昨天一天十分疲倦,或许正如跟个远方的小弟在instantChat上所谈的,这一天真的让我品到了生活的很多酸涩和劳苦,我渐渐发现走路也是一件非常非常累得事情,渐渐发现与人相处的道理和囊中的羞涩。其实昨天一天就花了我3千多,房屋的中介赚得很多感觉,1200的房子,中介费也要得1200,还有押金。不过房子我到是感觉还好,在上地佳园,至少感觉这的环境和保安还算可以,只是与人合租,不是很自在。
昨天也累坏了我一个高中同学,她陪我到处转了一天,真的很谢谢她。
不知道下一步会如何,但是我得准备好在这煎熬闷热、运筹自己的生活、学会太多太多...

posted @ 2007-05-06 12:24 wqwqwqwqwq 阅读(423) | 评论 (0)编辑 收藏
     摘要: 这两天找了一些portal相关的资料,也从中学到了很多东西。据说我们学校还有个portal,不过现在不知为什么down掉了...  阅读全文
posted @ 2007-04-27 20:48 wqwqwqwqwq 阅读(2772) | 评论 (6)编辑 收藏
     摘要: Sun has rolled out the Temple of Sun Contest with a US$5,000 cash prize. This is a great vehicle to promote Sun Studio on campus.  阅读全文
posted @ 2007-04-24 11:00 wqwqwqwqwq 阅读(1349) | 评论 (2)编辑 收藏
ANT
     摘要: ANT是一个基于JAVA的自动化脚本引擎,脚本格式为XML。除了做JAVA编译相关任务外,ANT还可以通过插件实现很多应用的调用。  阅读全文
posted @ 2007-04-19 14:56 wqwqwqwqwq 阅读(238) | 评论 (0)编辑 收藏
     摘要: 软件开发习惯中一个细微更改都可能会对软件质量产生巨大改进。将单元测试合并到开发过程中,然后从长远角度来看它可以节省多少时间和精力。本文通过使用代码样本说明了单元测试的种种好处,特别是使用 Ant 和 JUnit 带来的各种方便。  阅读全文
posted @ 2007-04-19 14:52 wqwqwqwqwq 阅读(468) | 评论 (0)编辑 收藏
     摘要: 在Ant出现之前,构建和部署Java应用需要使用包括特定平台的脚本、Make文件、各种版本的IDE甚至手工操作的“大杂烩”。现在,几乎所有的开源 Java项目都在使用Ant,大多数公司的内部项目也在使用Ant。Ant在这些项目中的广泛使用自然导致了读者对一整套Ant最佳实践的迫切需求。  阅读全文
posted @ 2007-04-19 14:45 wqwqwqwqwq 阅读(476) | 评论 (0)编辑 收藏
     摘要: By the way,there is a tool,Sun Device Detection Tool ,which is based on jnlp protocol, can tell us in just a few minutes whether the Solaris OS supports the devices that are detected in our x86 system, in advance.  阅读全文
posted @ 2007-04-14 23:52 wqwqwqwqwq 阅读(1264) | 评论 (0)编辑 收藏
     摘要: 昨晚同学找我帮忙写一个利用GOOGLE API的小程序,也比较感兴趣所以就应下了。下载了GOOGLE提供的googleapi.jar,大约花了20多分钟,写了这个小程序,由于需要提供GOOGLE key所以也懒得去申请,就没有测试~~呵呵  阅读全文
posted @ 2007-04-14 15:22 wqwqwqwqwq 阅读(3553) | 评论 (9)编辑 收藏
     摘要: 元数据是利用JDBC创建和操作数据库对象的一个很重要的概念和应用,所以今天我特地的找了一些详细解析个概念的资料,和利用java来操作的实例。  阅读全文
posted @ 2007-04-12 23:58 wqwqwqwqwq 阅读(1712) | 评论 (0)编辑 收藏
出于java的安全限制,System.getProperty("line.seperator")是不能够直接取得的。可以这样做:
String lineSeparator = (String) java.security.AccessController.doPrivileged(
               
new sun.security.action.GetPropertyAction("line.separator"));
具体参考java.io.BufferedWriter的源代码就可以找到上面这行代码。 DriverManager里也有
 1     private static void loadInitialDrivers() {
 2         String drivers;
 3 
 4         try {
 5             drivers = (String) java.security.AccessController
 6                     .doPrivileged(new sun.security.action.GetPropertyAction(
 7                             "jdbc.drivers"));
 8         } catch (Exception ex) {
 9             drivers = null;
10         }
11         println("DriverManager.initialize: jdbc.drivers = " + drivers);
12         if (drivers == null) {
13             return;
14         }
15         while (drivers.length() != 0) {
16             int x = drivers.indexOf(':');
17             String driver;
18             if (x < 0) {
19                 driver = drivers;
20                 drivers = "";
21             } else {
22                 driver = drivers.substring(0, x);
23                 drivers = drivers.substring(x + 1);
24             }
25             if (driver.length() == 0) {
26                 continue;
27             }
28             try {
29                 println("DriverManager.Initialize: loading " + driver);
30                 Class.forName(driver, true, ClassLoader.getSystemClassLoader());
31             } catch (Exception ex) {
32                 println("DriverManager.Initialize: load failed: " + ex);
33             }
34         }
35     }
sun.security.action.GetPropertyAction() hasn't been publiced.actually and exactly,it's not be doced,which reflects that sun doesn't surport us to use these class or method which is lower class,usually, we use the classes api tells us is proier and maybe has called these undoc class  but usually for us ,it's not necessary.so in the program of us or even others ,we could and i think it's really better for us to neglect  them which u can find out in the jar file of rt.jar.

posted @ 2007-04-11 16:35 wqwqwqwqwq 阅读(556) | 评论 (0)编辑 收藏
     摘要: 可供程序利用的资源(内存、CPU时间、网络带宽等)是有限的,优化的目的就是让程序用尽可能少的资源完成预定的任务。优化通常包含两方面的内容:减小代码的体积,提高代码的运行效率。本文讨论的主要是如何提高代码的效率。  阅读全文
posted @ 2007-04-09 11:12 wqwqwqwqwq 阅读(461) | 评论 (0)编辑 收藏
1.变量引用的时候,空指针情况的防止,即为空检查.
2.数学运算异常,如除0的情况.数组越界异常,字符串访问过界
3.数据库检索记录,结果记录行数状况的处理.
4.画面显示项目的确认.
5.画面显示项目达到上限时情况的处理.
6.系统出错的时候,异常信息是否正确.
7.数据库连接,游标的处理.
8.数学运算时,数据精度的处理.
posted @ 2007-04-09 11:06 wqwqwqwqwq 阅读(210) | 评论 (0)编辑 收藏
Today with tomcat admin, a Graphic interface for us to config the JNDI for our program,I configured the context and connection pool jioning IBM DB2 ExC-9.Actually,JNDI is an API specified in Java technology that provides naming and directory functionality to applications written in the Java programming language. It is designed especially for the Java platform using Java's object model. Using JNDI, applications based on Java technology can store and retrieve named Java objects of any type. In addition, JNDI provides methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes (Name-Value,context).JNDI is also defined independent of any specific naming or directory service implementation. It enables applications to access different, possibly multiple, naming and directory services using a common API. Different naming and directory service providers can be plugged in seamlessly behind this common API. This enables Java technology-based applications to take advantage of information in a variety of existing naming and directory services, such as LDAP, NDS, DNS, and NIS(YP), as well as enabling the applications to coexist with legacy software and systems. Using JNDI as a tool, we can build new powerful and portable applications that not only take advantage of Java's object model but are also well-integrated with the environment in which they are deployed.
A directory is typically used to associate attributes with objects. A person object, for example, can have a number of attributes, such as the person's surname, fisrtName,telephone numbers, electronic mail address and so on. Using JNDI, to retrieve the email address of a person object, the code looks as follows.
1 Attribute personAttribute=directory.getAttributes(personName).get("email");
2 String email = (String)personAttribute.get();
(Recently,finding that blogjava can help us format our code,that's perfect,but if can max the editor area which will enhance the function and coursely be better:).)
An intuitive model for the Java programmer is to be able to lookup objects like printers and databases from the naming/directory service. Using JNDI, to lookup a printer object, the code looks as follows. (it's important and most used)
1 Printer printer =(Printer)namespace.lookup(printerName);
2 printer.print(document);

posted @ 2007-04-08 15:10 wqwqwqwqwq 阅读(462) | 评论 (0)编辑 收藏

//*******************The Log class
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.uitl.Date;
import java.text.DateFormat;

public class Log{
   private static final String filePath = PropertyReader.getResource("Log_File_Path");//Supposing we have define in the last ProperyReader class and the file
  
   public static final String EXCEPTION                  =   "Exception";
   public static final String CREATE_STAFF           =   "Create Staff";
   public static final String EDIT_STAFF                 =   "Edit Staff";
   public static final String DELETE_STAFF            =   "Delete Staff";
   public static final String RECORD_HAS_EXIST  =   "Record Has Exist";

   public static void log(String msg_type, Exception e){
      StringBuffer errMsg = new StringBuffer(e.toString);
     
      for(int i=0;i<e.getStackTrace().length;i++){
         errMsg.append("\n\t at");
         errMsg.append(e.getStackTrace()[i].toString);
      }
      log(msg_type,errMsg.toString());
      OptionPanel.showErrMsg("Sorry,System may have an error \n System will exit");
      System.exit(-1);
   }

  public static void log(String msg.type,Staff staff){
     String msg = null;
     if(msg_type == CREATE_STAFF){
         msg = staff.toString() + "has benn created";
     }else if(msg_type == EDIT_STAFF){
         msg = staff.toString() + "has been Changed";
     }else if(msg_type == DELETE_STAFF){
         msg = staff.toString() + "has been Deleted";
     }else if(msg_type == RECORD_HAS_EXIST){
         msg = staff.toString() + "has exist in the database";
     }
     log(msg_type,msg);
  }

  private static void log(String msg_type,String msg){
      BufferedWriter out = null;
      DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
     
      try{
        out = new BufferedWriter(new FileWriter(getLogFilePath(),true));//如果为 true,则将字节写入文件末尾处,而不是写入文件开始处
        out.write("["+df.format(new Date()) + "] <" + msg_type + "> :" + msg);
        out.newline();
        out.newline();
      }catch(IOException e){
          e.printStackTrace();
      }finally{
         try{
           if(out!=null){
              out.close();
           }
         }catch(IOException e){
            e.printStackTrace();
         }
      }
  }

  private static String getLogFilePath(){
     File logDir = new File(filePath);
     if(!logDir.exists()){
       logDir.mkdir();
     }
    
     int i = 1;
     String fileName = filePath + "log_";
     File file = new File(fileName + i + ".txt");
   
     while(file.exists() && file.length() > 30000L) {
         i++;
         file = new File(fileName + i + ".txt");
     }
   
      return fileName + i + ".txt"
  }
}

//*****************************The OptionPanel Dialog Class for the Log Class
import javax.swing.JOptionPane;

public class OptionPanel {
   private static final String appTitle = PropertyReader.getResource("App_Title");//suposing the file has been established and the property app-title stands for the name of application
   private static final MainFrame frame = MainFrame.getMainFrame();

   public static void showWarningMsg(String msg){
      JOptionPane.showMessageDialog(frame,msg,appTitle,JOptionPane.WARNING_MESSAGE);
   }
   public static void showErrMsg(String msg){
       JOptionPane.showMessageDialog(frame,msg,appTitle,JOptionPane.Error_MESSAGE);
   }
   public static int showConfirmMsg(String msg){
        return JOptionPane.showConfirmDialog(frame,msg,appTitle,JOptionPane.YES_NO_OPTON,JOptionPane.QUESTION_MESSAGE);
   }
}

posted @ 2007-04-05 10:01 wqwqwqwqwq 阅读(861) | 评论 (1)编辑 收藏

In a project, we can write a class to read the properties.As following,

import java.io.InputStream;
import java.io.IOException;
import java.util.Properties;

public class PropertyReader{
   private static Properties property = null;
  
   static{
      InputSteam stream = null;
      try{
        stream=PropertyReader.class.getResourceAsStream("/resource/properties.properties");
        property = new Properties();
        property.load(stream);
      }catch(IOException e){
          e.printStackTrace();
      }finally{
          if(stream != null){
             try{
                stream.close();
             }catch(IOException e){
                e.printStackTrace();
             }           
          }
      }
   }
   public static String getResource(String key){
     if(property == null){
       return null;// init error;
     }
     
     return property.getProperty(key);
   }
}

posted @ 2007-04-05 08:13 wqwqwqwqwq 阅读(473) | 评论 (0)编辑 收藏
These days I want to review some java classes and post them,cos i come to realize that i hava been coming to forget some of them, my god,Katrina,....:) it's really the sound,and u ? ...regarding MVC,cos be delayed, and may be will better.

List a class to use the title Properties.

import java.util.Properties;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FirstDayTestProperties {
   public static void main(String[] args) throws Exception{
       Properties ProTest = new Properties();
       String  fileName="PropertiesTest.properties";
      
       try{
          ProTest.setProperty("lastDir","C:\\PropertyTest");
          ProTest.store(new FileOutputStream(fileName),null);
       }catch(IOException e){
            e.printStackTrace();
       }

       try{
          FileInputStream inStream=new FileInputStream(fileName);
          ProTest.load(inStream);
          ProTest.list(System.out);
       }catch(FileNotFoundException e){
          e.printStackTrace();
       }
   }
}
The class I just write now without any testing,but i think it seems no errors:).Share.

posted @ 2007-04-04 21:32 wqwqwqwqwq 阅读(471) | 评论 (0)编辑 收藏
U may come across model view controller desigh pattern.It was first introduced by  Trygve Reenskaug. More details,MVC can be broken down into three elements.
<1>Module  Usually,in enterprise software,it presents the logic of the commercial bean.To the SE Swing GUI,it contains data and the rules that govern access to and updates of this data.
<2>View  It specifies exactly how the module data should be presented,changing with the model data.
<3>Controller   Controller defines all the methods connecting to the user action which are called by the View.
Especially,the model doesn't carry a reference to the view but instead uses an event-notification model to notify insteaded parties of a change.One of the consequences of this powerful design is that many views can have the same model.When a change in the data model occurs,each view is notified by a property change event and can change itself accordingly.Hence, the controller may mediate the data flow between the model and the view in both directions,which helps to more completely decouple the model from the view,and the controller may also provide the methods which effect the model's property changes for one or more views that are registered with it.

....Next,may be the two days after tomorrow ,I ll give a real example to explain this schema in details.......
posted @ 2007-03-26 23:16 wqwqwqwqwq 阅读(429) | 评论 (0)编辑 收藏
这几天忙忙乱乱的,也没顾及这个blog,其实说句实话,自己也好几天没在研究技术的东西了,只是在看看IBM的一些个产品,哎~所以今天还是没打算写写技术,只是来post自己这几天的一些琐琐碎碎。还算高兴的事情是自己的小队伍获得了国际数学建模竞赛2等奖,虽然不是很理想,但自己还是满足了,毕竟带的娘子(当然是除了我了)队伍实力不是很强,况且大过年的我原来的伙伴早飞回温暖的南方了。其实我本身早厌倦了那种比赛,不过还是比较欣赏美国人的精明和对中国人明知故犯的无奈,也许吧,其实还是要庆祝一下自己的最后一次这种竞赛...
这周学校组织无偿献血,虽然我并不在乎学校不给什么所谓的补偿,我也不会因为献血怎么怎么的就有所目的,只是感觉这种行为还算是对社会作出了一点贡献。最岖奇的是导员居然不让我献血,当然他的劝告算能让我接受,但是自己还是很固执的感觉,无奈的导员也只好应下了。哎~我这个人真是经不起别人的劝告发现,在好些个朋友的“吓唬”下,终于作出了心虚的妥协...哎~,不过也算给我的母亲一个很好的交代了。
不说这些令人扫兴的话题了,还有一件好事,就是跟我关系很铁的一个老师有了21个月的小宝宝,其实他才告诉我的,还是在网上。不过早应该猜到了,因为这几天就发现他“不误正业”,整天不在办公室,往家里一个劲的跑,不过在这里,虽然他不会知道,还是祝愿他博士论文顺利通过吧,双喜临门...
想早些休息了,Good night&& Good dream.
posted @ 2007-03-22 23:18 wqwqwqwqwq 阅读(435) | 评论 (0)编辑 收藏
刚刚看看过鲁豫有约的两期节目,是采访的年轻轻但身价过亿的李想、高燃、戴志和茅侃侃。其实,我并不因为他们的年轻或是很有钱,而感到任何诧异,但自己却很欣常他们各自所持有的信念和创业过程中对资金的运营勇气,我真的不知道随着他们事业的增长、社会的变更,他们还是否会是浪潮的宠儿、是否会和原来一样,对待更多的运营资本同样的保持清醒地头脑,但我还是很祝福他们...

看过之后,我的感触很深,在这个社会上,或许是因为随着一个人学历的渐渐增长,他也会变得懒惰,因为他再也不会像社会地位很卑微的人一样为生计担心,我本也相信,人在骨子里是懒惰的。其实,我自己也曾想过,以后能找个比较大的外企工作,几年之后一个月拿个几W块就ok了,然后就是一辈子平平淡淡的生活...:),或许我的思想还不够先进吧。他们的经历,也让我重新思考,说句实话,其实他们并没什么,只是在坎坷的社会中,为了自己的信念坚持了下来,并一直做到了现在。我想我也该在为别人打工的同时,定位自己的目标,并坚定的追求。高燃是我很佩服的一个人,完全是因为他的执著,无论是他考清华、追GirlFriend 还是去找投资人,最后到办好公司。人的天赋很重要,但我还是更喜欢执著...
posted @ 2007-03-18 23:32 wqwqwqwqwq 阅读(626) | 评论 (2)编辑 收藏
Yestoday night,CA coordinator emailed and phoned me for Sunstudio running and test the ping-home function,I m sorry that I really didn't know what's this really mean under Unix,I am not sure,maybe about to edit the file of host,but I just ping -s localhost,well,maybe another ip destination.more awful,I cannot run the #./SUNWspro/bin/f95, #./SUNWspro/bin/cc, #./SUNWspro/bin/CC...I have sent the first test result,and continue to learn more about it,but I m really sorry.

 


 


posted @ 2007-03-17 07:36 wqwqwqwqwq 阅读(159) | 评论 (0)编辑 收藏
The day before yestoday,I have received the intern offer letter from IBM CDL...to my surprise,cos of my little time,only can support 3-4ms.it's too absurd that when the assistant
ask my IdCard num,well,God,I forgot it...:) During the time,not so along,exactly,only a few days ago,I met a manager in the IBM(BJ)CRL,She is a very kind person,also a manager(i think),she has recommended me to her colleagues,which I really thank her.so yestoday,these persons phoned me and asked if wanted to do some QA jobs,if though,they knew that i was admired by CDL.To the manners,I think today I should take their phone test though I will not accept their opportunity as to my promise to the CDL,That's important I think.
Now I was a junior student,coming to realize that the campus life will be end,I was lucky I think,especailly about so many friends,can be ambassador of Sun Microsystems.lnc,can be a intern of IBM and so on.Now in my dream,hope that I can be a recommend student to get the master degree of tsingHua or BJUniversity this Sep.,then can go aboard for future research,last,back to the motherland to have a peace life,for which I will try my hard and best.
posted @ 2007-03-16 12:19 wqwqwqwqwq 阅读(461) | 评论 (0)编辑 收藏
Maybe,u are tied of Windows and come to thinking of trying Linux,so many good Operation Systems,like,Suse Redhat ...or Novell have all enterprise u might need,as well,support communities.well,it's true enough--Solaris is also available and as a OpenSolaris form with AMD and Intel friends,with a pretty community going && more and more third-party supporting.U may download the Solaris form www.opentech.org.cn, www.opensolaris.org, ...Sun.
I very like OpenSolaris not only its security,its creative,convinient...whereas,its all:).The Java Desktop is cool and we may also use click to operate,well,I like the terminal more.Now I use Solaris as a developer desktop,it integrates the Netbeans to develop Java which is also a excellent enviroment to develop others after u plug in,Sun Studio,a platform to develop C/C++ &&fortan,with sun compiler,efficient.If u think Solaris is too big and Enterprise-heavy,u will make a mistake,Solaris is very small but excellent perform,:),U can try urself.
yestoday i make a techtalk about Sun openSolaris and Java,C/C++ development under it in my campus(DaLian University of Technology).To my surprise There were more students from the  disrelated computer science Department,more,even more girls.I saw a Linux teachers attending,I was very pleased,cos of Solaris is sure to attract the fancy of the Linux users,at least,It's better in my...our's eyes.:),as following I attach some of pics of my tech-talking to share with u.
   
posted @ 2007-03-12 11:01 wqwqwqwqwq 阅读(604) | 评论 (0)编辑 收藏

Most developers have heard of, and possibly used, scripting languages such as Ruby, JavaScript, and Python. These dynamic languages are enjoying a resurgence in popularity, largely because of their flexibility and simplicity, and the productivity gains they promise.

Java 6 comes with built-in support for scripting languages. You can embed scripts in various scripting languages into your Java applications, passing parameters, evaluating expressions, and retrieving results. And you can do it all pretty seamlessly.

First of all, you obtain a new ScriptEngine object from a ScriptEngineManager, as shown here:

ScriptEngineManager manager = new ScriptEngineManager();

ScriptEngine engine = manager.getEngineByName("js");

Each scripting language has its own unique identifier. The "js" here means you're dealing with JavaScript.

Now you can start having some fun. Interacting with a script is easy and intuitive. You can assign scripting variables using the put() method and evaluate the script using the eval() method,. which returns the most recently evaluated expression processed by the script. And that pretty much covers the essentials. Here's an example that puts it all together:

engine.put("cost", 1000);
String decision = (String) engine.eval(
"if ( cost >= 100){ " +
"decision = 'Ask the boss'; " +
"} else {" +
"decision = 'Buy it'; " +
"}");
assert ("Ask the boss".equals(decision));

You can do more than just pass variables to your scripts— you can also invoke Java classes from within your scripts. Using the importPackage() function enables you to import Java packages, as shown here:

				

engine.eval("importPackage(java.util); " +
"today = new Date(); " +
"print('Today is ' + today);");

Another cool feature is the Invocable interface, which lets you invoke a function by name within a script. This lets you write libraries in scripting languages, which you can use by calling key functions from your Java application. You just pass the name of the function you want to call, an array of Objects for the parameters, and you're done! Here's an example:

				

engine.eval("function calculateInsurancePremium(age) {...}");
Invocable invocable = (Invocable) engine;
Object result = invocable.invokeFunction("calculateInsurancePremium",
new Object[] {37});

You actually can do a fair bit more than what I've shown here. For example, you can pass a Reader object to the eval() method, which makes it easy to store scripts in external files, or bind several Java objects to JavaScript variables using a Map-like Binding object. You can also compile some scripting languages to speed up processing. But you probably get the idea that the integration with Java is smooth and well thought-out.

posted @ 2007-03-07 21:49 wqwqwqwqwq 阅读(461) | 评论 (0)编辑 收藏
刚刚结束了IBM的电面,一个GG和JJ,问的主要问题都放在我的项目上了,尤其是Netbeans的插件。由于我申请的实习生,所以在之中也问了很多实习时间的问题,感觉IBM问问题很不含糊,甚至要问出几月几号......这一点可以说明IBM是一个很值得人去的地方。英文问题我感觉我答得不是很好,先问得IBM的文化之类的,之后居然问得IBM person惭愧啊 本来还知道几个的,一紧张都忘了。在角色兑换时,我问得我的表现,和职业生涯建议,好小子,他们居然还反问我职业生涯,说了一通......整个电面是从4:10-4:45,最后GG说面试表现还好,只是我能实习的时间比他们要求的时间要少,唉~~ 我的系主任啊,等待结果中....希望自己能去IBM体验一下蓝色巨人的风范吧。
posted @ 2007-03-02 17:05 wqwqwqwqwq 阅读(797) | 评论 (0)编辑 收藏
一会4:30要参加北京IBM研究院的一个电面,快到时间了,不免心里稍有些紧张,不知道先前积累的一点英语一会是否会奏效,呵呵,,,,不过,无论如何我会尽可能抓住这次来之不易的机会的。
posted @ 2007-03-02 14:44 wqwqwqwqwq 阅读(528) | 评论 (0)编辑 收藏
     摘要: This post had been writen long before,...but  阅读全文
posted @ 2007-02-15 23:36 wqwqwqwqwq 阅读(462) | 评论 (1)编辑 收藏
     摘要: Java SE 6.0(代号Mustang,野马)已经发布,详情请见 野马奔腾而出,Java SE 6 正式版发布 ,它给我们带来了哪些新的特性了。     首先,我们看看JDK 6.0包含了大量的JSR,分为四组,分别为:     在简化开发方面: 199: Compiler API...  阅读全文
posted @ 2007-02-08 11:18 wqwqwqwqwq 阅读(2029) | 评论 (1)编辑 收藏

前几天好不容易下到了JDK6mustang,今天恰好有时间升级了一下Netbeans默认的JDK版本。这里简单的说明一下升级的方法。如果我 们不修改Netbeans的属性,需要在JavaPlatform manager中加入另一版本的类库。新建工程后如果要修改类库,还需要修改项目的类库属性,现在通过修改默认的JDK类库,便可方便很多,更不需要重新 安装NB。

我的NB装在D盘中,可以在该路径找到文件D:\Netbeans-5.5\etc\Netbeans.conf,我们将原有的默认类库netbeans_jdkhome="D:\Java\jdk1.5.0_07"修改为 netbeans_jdkhome="D:\Java\jdk1.6.0"便轻松的完成了升级,当然在tools-〉JavaPlatform manager〉中当然也可以将我们惯用的D:\Java\jdk1.5.0_07加入为可选用类库。

posted @ 2007-01-30 23:01 wqwqwqwqwq 阅读(471) | 评论 (0)编辑 收藏
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>拖拽Demo</title>
<style type="text/CSS">
body

{

    margin:0px;

}

 

#aim

{

    position:absolute;

    width:200px;

    height:30px;

    border:1px solid #666666;

    background-color:#FFCCCC;

}

 

#sourceLayer, #cloneLayer

{

    position:absolute;

    width:300px;

    height:50px;

    border:1px solid #666666;

    background-color:#CCCCCC;

    cursor:move;

}

 

.docked

{

    display:none;

    filter:alpha(opacity=100);

}

 

.actived

{

    display:block;

    filter:alpha(opacity=70);

}

</style>

</head>

 

<body >

 

<div id="aim">locate</div>

<div id="sourceLayer" unselectable="off"><img src="http://www.baidu.com/img/logo.gif" alt="Drag Demo">Source of the demo</div>

<div id="cloneLayer" class="docked" unselectable="off"></div>


<script type="text/javascript" language="javascript">


var aim;

var sourceLayer;

var cloneLayer;

var aimX;

var aimY;

var orgnX;

var orgnY;

var draging = false;

var offsetX = 0;    

var offsetY = 0;    

var back;        

var thisX ;        

var thisY ;        

var time ;

var stepX ;        

var stepY ;       



 

function getLayer(inAim,inSource,inClone)

{

    aim = document.getElementById(inAim);

    sourceLayer = document.getElementById(inSource);

    cloneLayer = document.getElementById(inClone);

}

 

function initDrag(initAimX,initAimY,initOrgnX,initOrgnY)

{

    aimX = initAimX;

    aimY = initAimY;

    orgnX = initOrgnX;

    orgnY = initOrgnY;

    aim.style.pixelLeft = aimX;

    aim.style.pixelTop = aimY;

    sourceLayer.style.pixelLeft = orgnX;

    sourceLayer.style.pixelTop = orgnY;

    cloneLayer.style.pixelLeft = orgnX;

    cloneLayer.style.pixelTop = orgnY;

}


function BeforeDrag()

{

    if (event.button != 1)

    {

        return;

    }

    cloneLayer.innerHTML = sourceLayer.innerHTML; 容

    offsetX = document.body.scrollLeft + event.clientX - sourceLayer.style.pixelLeft;

    offsetY = document.body.scrollTop + event.clientY - sourceLayer.style.pixelTop;

    cloneLayer.className = "actived";

    draging = true;

}



function OnDrag()

{

    if(!draging)

    {

        return;

    }

    event.returnValue = false;

    cloneLayer.style.pixelLeft = document.body.scrollLeft + event.clientX - offsetX;

    cloneLayer.style.pixelTop = document.body.scrollTop + event.clientY - offsetY;

}

function EndDrag()

{

    if (event.button != 1)

    {

        return;

    }

    draging = false;

 

    if (event.clientX >= aim.style.pixelLeft && event.clientX <= (aim.style.pixelLeft + aim.offsetWidth) &&

        event.clientY >= aim.style.pixelTop && event.clientY <= (aim.style.pixelTop + aim.offsetHeight))

    {


        sourceLayer.style.pixelLeft = aim.style.pixelLeft;

        sourceLayer.style.pixelTop = aim.style.pixelTop;

         cloneLayer.className = "docked";



    }

    else

    {

     thisX = cloneLayer.style.pixelLeft;

     thisY = cloneLayer.style.pixelTop;

     offSetX = Math.abs(thisX - orgnX);

     offSetY = Math.abs(thisY - orgnY);

     time = 500;

     stepX = Math.floor((offSetX/time)*20);

     stepY = Math.floor((offSetY/time)*20);

     if(stepX == 0)

         stepX = 2;

     if(stepY == 0)

         stepY = 2;

     moveStart();

    }   

}

 

 

function moveStart()

{

     back = setInterval("MoveLayer();",15);

}

 

function MoveLayer()

{


     if(cloneLayer.style.pixelLeft <= orgnX && cloneLayer.style.pixelTop <= orgnY)

     {

         cloneLayer.style.pixelLeft += stepX;

         cloneLayer.style.pixelTop += stepY;


         if(cloneLayer.style.pixelLeft > orgnX)

         {

              stepX = 1;

         }

         if(cloneLayer.style.pixelTop > orgnY)

         {

              stepY = 1;

         }

         //if the coordinate of X Y  are  same

         if(cloneLayer.style.pixelLeft == orgnX)

         {

              stepX = 0;

         }

         if(cloneLayer.style.pixelTop == orgnY)

         {

              stepY = 0;

         }

         if(cloneLayer.style.pixelLeft == orgnX && cloneLayer.style.pixelTop == orgnY)

         {

              EndMove();

         }

     }

    

     //locate to the downleft of the object

     else if(cloneLayer.style.pixelLeft <= orgnX && cloneLayer.style.pixelTop >= orgnY)

     {

         cloneLayer.style.pixelLeft += stepX;

         cloneLayer.style.pixelTop -= stepY;

         if(cloneLayer.style.pixelLeft > orgnX)

         {

              stepX = 1;

         }

         if(cloneLayer.style.pixelTop < orgnY)

         {

              stepY = 1;

         }

         if(cloneLayer.style.pixelLeft == orgnX)

         {

              stepX = 0;

         }

         if(cloneLayer.style.pixelTop == orgnY)

         {

              stepY = 0;

         }

         if(cloneLayer.style.pixelLeft == orgnX && cloneLayer.style.pixelTop == orgnY)

         {

              EndMove();

         }

     }



     else if(cloneLayer.style.pixelLeft >= orgnX && cloneLayer.style.pixelTop <= orgnY)

     {

         cloneLayer.style.pixelLeft -= stepX;

         cloneLayer.style.pixelTop += stepY;

         if(cloneLayer.style.pixelLeft < orgnX)

         {

              stepX = 1;

         }

         if(cloneLayer.style.pixelTop > orgnY)

         {

              stepY = 1;

         }

         if(cloneLayer.style.pixelLeft == orgnX)

         {

              stepX = 0;

         }

         if(cloneLayer.style.pixelTop == orgnY)

         {

              stepY = 0;

         }

         if(cloneLayer.style.pixelLeft == orgnX && cloneLayer.style.pixelTop == orgnY)

         {

              EndMove();

         }

     }

    

     //locate to the right of the object

     else if(cloneLayer.style.pixelLeft >= orgnX && cloneLayer.style.pixelTop >= orgnY)

     {

         cloneLayer.style.pixelLeft -= stepX;

         cloneLayer.style.pixelTop -= stepY;

         if(cloneLayer.style.pixelLeft < orgnX)

         {

              stepX = 1;

         }

         if(cloneLayer.style.pixelTop < orgnY)

         {

              stepY = 1;

         }

         if(cloneLayer.style.pixelLeft == orgnX)

         {

              stepX = 0;

         }

         if(cloneLayer.style.pixelTop == orgnY)

         {

              stepY = 0;

         }

         if(cloneLayer.style.pixelLeft == orgnX && cloneLayer.style.pixelTop == orgnY)

         {

              EndMove();

         }

     }

    

     //to the design

     else

     {

         EndMove();

     }

}

 

//stop and then back to the state ()carton

function EndMove()

{

         sourceLayer.style.pixelLeft = orgnX;

         sourceLayer.style.pixelTop = orgnY;

         cloneLayer.style.pixelLeft = orgnX;

         cloneLayer.style.pixelTop = orgnY;

         cloneLayer.className = "docked";

         clearInterval(back);

}

 

//Main function of this demo

function startDraging(inAim,inSource,inClone,initAimX,initAimY,initOrgnX,initOrgnY)

{

    getLayer(inAim,inSource,inClone)

    initDrag(initAimX,initAimY,initOrgnX,initOrgnY);

    sourceLayer.onmousedown = BeforeDrag;

    document.onmousemove = OnDrag; //if we use cloneLayer,then the content will be draged ,and well a bug

    cloneLayer.onmouseup = EndDrag;   

}

 

//transfer

startDraging("aim","sourceLayer","cloneLayer",600,500,50,50);

//-->

</script>

</body>

</html>
posted @ 2007-01-29 14:42 wqwqwqwqwq 阅读(625) | 评论 (0)编辑 收藏
As beginning,still don't know how to begin this post~but really should begin to write something about tech.Sometimes some one like to talk that A good bazoo can
make a good bussiness card~,may be so,may be not,I really want to throw it away,but cannot,just can to learn and write ...off topics...
  From now I propose to write a route about js tech with my learning steps.Ajax is a good thing maybe the world just like it some good but really short. Js is called for the full JavaScriptlanguage,it's welcomed because it can be run at the piont of client and also effective.when we talk about java object orientation is the focus piont which attracts our attention.we can define a class and then a function.But to JS ,when we create a function and make a instance of this function,we just regard it as a class,so we may say a newable function was a class.The class may have its own attributes or methods,but now we can use the sign["~"]to quote it(refer to).
Now I give a simple example about this
{449D36E0-28B6-4914-B96E-37606AA5E247}.BMP
Of course,u can express with arr.push("Eric").After this,I want to say,we can insert,update & delete attributes or methods when we need.As following
user.name="Eric";
user.age="21";
user.sex="male";
//we insert 3 Atts/
user.show=function(){
  alert("Name is"+this.name);
}
//we insert 1 Mes/
delete is very very easy,a old story.. we use undefined
user.name=undefined;
user.show=undefined;
//....
This is js today's post,easiness goes,.~ ..
posted @ 2007-01-27 23:17 wqwqwqwqwq 阅读(628) | 评论 (0)编辑 收藏
I/O
java的i/o恐怕是java体系里最复杂的内容之一了,有时候这个之一可以去了。不像c语言一个fopen()就可以解决一大堆问题。到了java 呢,又是stream又是reader,读一个文件的方式不下十种,造成很多人因此而放弃了java,当初刚学java的时候班里很多人都对java有很 高的热情,可到了现在,不知道还有多少人坚持下来了。具有讽刺意味的事java i/o的设计者的初衷是让i/o变得简单一点,哪知道若干年后,弄出这么一大摊子来。现在又加了一个nio----就是newio,不知道日后还会弄出什 么东西来。
 
用i/o可以解决文件,网络通讯等几乎所io问题。功能强大,唯一的缺点就是复杂。但仔细一分析,还是有门路可走的。整个io体系主要分为两大门派。一派 为流类也就是用于字节的InputStream和OutputStream,另一派为用于字符的Reader和Writer派(简称rw派)。认清了这两 派就知道*Stream的东东全都是流派的,不是继承而来就是通过实现接口而来。如此,*Reader,*Writer那就是出身于rw派了。还有一个 File派来处理文件创建,删除,修改,属性问题。对文件的内容进行操作不是他的工作。搞清楚这两大派一小派那么解决io指日可待。
 
那么说了这么多怎么创建文件呢?举例说明(主函数就不写了)
File newfile = new File("text.txt");
newfile.createNewFile();
这样就在同一个文件夹下创建了一个名为text.txt的文本文件,那枚怎么删除呢?
File newfile = new File("text.txt");
newfile.delete();
这样就把这个文件删除了。是不是很简单呢。那么怎么把文件写入这个文本文件呢?
File writetext = new File("text.txt");
[readtext.createNewFile();]//可有可无,因为文件不存在的话,会自动创建
FileWriter fw = new FileWriter(writetext);//就像创建打印机
PrintWriter pw = new PrintWriter(fw);//这个呢打印针头了。
pw.println("this is a new file for read");//这个是说,把这些东西给我写进去吧
fw.close();//然后关闭打印机
有点复杂,当懂了以后,也就感觉不到什么了,那么如何读取这个文本文件呢?
File readtext = new File("text.txt");
FileReader fr = new FileReaer(readtext);//创建一个扫描仪
BufferedReader br = new BufferedReader(fr);//这是扫描仪内的缓存
String content = br.readLine(); //读一行文本
 
用熟练了之后可以这么写:
BufferedReader in = new BufferedReader(new FileReader("text.txt");
String content="";
while((content=in.readLine())!=null){
    System.out.println(content);//读一行输出一行
}
posted @ 2006-12-04 13:27 wqwqwqwqwq 阅读(357) | 评论 (0)编辑 收藏
jar2exe是国产软件,看来这方面的需求还是很旺盛的。点击这里下载。
过程极为简单,第一步
第二步,选择应用程序类型

第三步,输入启动类。输入带有 main 方法的类名

第四步,输入要生成的 Exe 文件名:

posted @ 2006-12-04 13:18 wqwqwqwqwq 阅读(1580) | 评论 (0)编辑 收藏
正则表达式主要应用于文本的处理,如检索,替换,检查错误,文字拆分...实在是一言难尽,如果要全部写出来,一本书都不差不多。还好oreilly已经为我们出了一本了。
 
讲具体内容以前先给个完整的例子,这样能有个感性的认识。
import java.util.regex.*;
public class Regex{
   public static void main(String[] args){
        String text = "my email address is "nicky.jcoder@gmail.com";
        Pattern pattern = Pattern.compile("\\w+@\\w+.\\w+");
        Matcher matcher = pattern.matcher(text);
        if(matcher.find()){
            System.out.println(matcher.group());
        }
 
   }
}
把这段程序用jdk或jcreator或水腻的便了。反正运行起来就是了
输出结果:xhinker@163.com
当你看完下面的东西回头再看看这段程序就会发现,这不过是小菜一碟
 
字符和字符类

表格 A: 字符匹配

操作

解释

例子

结果

.

单个字符匹配

   .ord

匹配 “ford”, “lord”, “2ord”,

[ ]

多个字符列表

   [cng]

只会匹配 “cord”, “nord”, 和 “gord”

[^ ]

不出现字符列表

   [^cn]

匹配 “lord”, “2ord”, 等. 但不会匹配 “cord” or “nord”



  [a-zA-Z]

匹配 “aord”, “bord”, “Aord”, “Bord”等



   [^0-9]

匹配 “Aord”, “aord”, 等. 但不会匹配“2ord”, 等.

 

表格 B: 重复操作符

操作

解释

例子

结果

?

匹配0次或1次

 “?erd”

匹配 “berd”, “herd”“erd”等

*

匹配0次以上

“n*rd”

匹配 “nerd”, “nrd”, “neard”, 等.

+

匹配1次以上

“[n]+erd”

匹配 “nerd”, “nnerd”, 等., 但不匹配 “erd”

{n}

匹配n次

“[a-z]{2}erd”

匹配“cherd”, “blerd”, 等. 但不匹配 “nerd”, “erd”, “buzzerd”, 等.

{n,}

匹配n次以上

“.{2,}erd”

匹配 “cherd” and “buzzerd”, but not “nerd”

{n,N}

匹配n-N次

 “n[e]{1,2}rd”

匹配 “nerd” and “neerd”等

 
常用符号:
\d:[0-9]
\D:[^0-9]
\w:[a-zA-Z0-9]
\W:[^a-zA-Z0-9]
 
{?i):大小写无关
 
\b和\B分别表示词边界和非词边界
当然上面这些只不过是最常用的,写出几个正则表达式是没有问题了。接下来说说java。
在java里\有其自身的意义,所以在用\s,\d的时候要加上一个\也就是\\s 、\\d \\(等
java自1.4后开始支持正则表达式,东西都放在java.util.regex包里,用Pattern生成一个模式对象,然后用matcher进行匹 配。如果要输出匹配结果的话,一定要记得写上matcher.find();否则会出错。当然也可以用替换,这就要看你的喜好拉。想看更多的例子就去 jdk帮助文档。
posted @ 2006-12-04 13:16 wqwqwqwqwq 阅读(416) | 评论 (0)编辑 收藏
如何在java swing里使用JTree,就像下面这样的树

A tree

手工创建:
首先,你需要创建一个JScrollPane,然后创建一个JTree,再然后创建节点TreeNode
JScrollPane是盛放JTree的容器,JTree是一个结构相当于一个房子的钢筋框架,真正的内容是节点node。学过数据结构里的树的话可能会好理解一点。写代码的时候,三个过程的创建顺序不一定,也可以倒着过来写。
比如,创建一个简单的初始化 树的方法
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.JTree;
import javax.swing.tree.*;
public class NewTree {
    public NewTree() {
        JFrame jframe=new JFrame();//创建窗体
        Container c=jframe.getContentPane();//创建容器
       
        JScrollPane scrollPane=new JScrollPane();//创建一个用于树的容器
        DefaultMutableTreeNode root=new DefaultMutableTreeNode("root");//创建树根节点
        DefaultMutableTreeNode file=new DefaultMutableTreeNode("file1");//创建一个文件节点
        root.add(file);//将文件节点添加到根节点下
        JTree tree=new JTree(root);//以根节点为参数创建一个树对象
        scrollPane.setViewportView(tree);//将树添加到scrollPane里面,并显示

       
        c.add(scrollPane);//将scrollPane添加到窗体里
        jframe.pack();
        jframe.setVisible(true);
        jframe.addWindowListener(new WindowAdapter(){//这段代码用于默认关闭
            public void windowClosing(WindowEvent e){
                    System.exit(0);   
            }
        });
    }
    public static void main(String[] args){
        new NewTree();
    }
}
结果是这样的:注意关键的是斜体的代码,其他的都是swing的东西

那么如何在netbeans里,创建和使用树呢?好多人看到的都是下面这样的:

这是为什么呢?我找过代码结果没找到,后来发现这都是假的,你还是可以通过该改变代码来创建和使用你的树:改什么?改TreeModel.
到源代码界面下创建一个初始化树的方法:
public void treeInitialize(){
   JScrollPane scrollPane=new JScrollPane();
   DefaultMutableTreeNode root=new DefaultMutableTreeNode("root");
   DefaultMutableTreeNode file=new DefaultMutableTreeNode("file1");
   root.add(file);
   JTree tree=new JTree(root);
   TreeModel treeModel = new DefaultTreeModel(root);
   tree.setModel(treeModel);
}
注意黑体代码,这样在窗体的构造方法中调用treeInitialize()方法,你的树就被改变了,tree是你用netbeans生成树对象的引用或者名字,一般会是jTree1。
接下来就是对树的操作了,限于篇幅不能再讲了
posted @ 2006-12-04 13:11 wqwqwqwqwq 阅读(3853) | 评论 (2)编辑 收藏
今天在sun的网站上转了一圈,等了好几天的Visual Web Pack终于出来了.
先介绍一下
Creates a new Visual Web Pack project containing an empty web application. This project enables you to use Visual Web Pack features like the Visual Designer to drag and drop JSF components, visual and dialog box support for binding components to data providers, and generation of Java code and Web XML files. The project uses the IDE-generated build script to build, run, and debug your project.
创建一个可视化页面工程包 包含一个空白页面应用程序.这个工程能让你使用可视化开发包的各种属性,诸如用可视化设计工具拖放JSF(java server face)组件,可视化的对话框支持将组件数据源(或者数据提供者)绑定在一起,并且生成java代码和xml页面文件。这一工程由集成开发环境(IDE)生成的构建脚本来构造,执行和调试你的项目。
(翻译的不好请见谅)
还支持ajax,呵~~呵~~~。
最终装好的效果图:
全面支持拖放,呵呵,上次装了一个java studio creator结果运行死慢死慢的,这一次把这一功能转移到了netbeans挺好用,速度也不错,我这台笔记本都能挺过来,台式机估计没什么问题。
安装时要注意的地方:
1.netbeans必须为5.5正式版本,beta版本的检测不到。点击进入netbeans首页
2.下载JDK 5_60或者以后的版本我用的是JDK 5_09版本,安装的时候最好不要把原来的卸载,有时候老程序不认新的JDK。点击进入JDK下载页面
点击这里进入Visual Web Pack 的下载页面。
posted @ 2006-12-04 13:07 wqwqwqwqwq 阅读(2795) | 评论 (2)编辑 收藏

October 20, 2006 - Anyone who believes college students today are lacking in initiative, creativity, or work ethic should take a close look at the recent accomplishments of a team of students at the Ecole de Technologie Superieure (ETS) in Montreal, Quebec. Over the past three years, this team of 12 has been heads-down working on the mechanical design, electrical system, and Java™ control and navigation software for an AUV—a submarine—and preparing it for the International Autonomous Underwater Competition sponsored by the Association for Unmanned Vehicles Systems International (AUVSI) and the Office of Naval Research (ONR) in San Diego, California.

SONIA Team
Click here for more images

For no college credits, no pay, and no guarantee of success, the ETS team designed and built an AUV that could meet the complex and demanding mission requirements of the competition. Detailed in an 18-page document, these requirements included the ability to autonomously pass through a gate, detect a flashing light, find and connect with a docking station, locate a pipe and drop material into a bin—all underwater and with no communication with the team.

The submarine is called SONIA, which stands for Système d’Opérations Nautiques Intelligent et Autonome, and is just over one meter long, with a dry weight of 20 kg and a unique box-shaped design. It is equipped with sensors and two color video cameras. Navigation data input is provided by a compass and two gyroscopes as well as active and passive sonar arrays.

SONIA outperformed all but two of the 21 entries in the student competition, securing a place for ETS on the podium for a fourth year in a row. With an overall budget of just $15,000 U.S. (provided by ETS and a variety of corporate sponsors), the ETS team scored higher than teams with six-figure budgets. The competition was won by the University of Florida, but the ETS team came out ahead of renowned engineering schools such as MIT, Georgia Tech, and Virginia Tech.

Innovative Design, Expert Software Engineering

Two of the characteristics that set SONIA apart from competitors were its innovative box-shaped design and the sophistication of its core software systems.

SONIA underwater
Click here for more images
“The traditional tube shape requires a lot of extra design work because electronics boards are square,” said David Mercier, technical leader of the ETS team. “The only disadvantage of the box shape is how it moves through the water, and we overcame that by making the hull out of machined aluminum and hand-polishing it for 25 hours to make it glide through the water more easily.”

The ETS team’s expertise with Java software proved a decisive advantage. Martin Morissette, software team leader of the SONIA team, is currently entering his third year in software engineering, and recently completed a six-month internship at Sun Labs, where he worked on the “Squawk VM,” a small J2ME™ virtual machine (VM) written almost entirely in Java. The Squawk VM provides the ability to run wireless transducer applications directly on the CPU without any underlying OS, saving overhead and improving performance.

“I learned a great deal during my time with Sun Labs that was extremely useful in the development of the navigation software for SONIA,” said Morissette. “The fact is, Java is an excellent programming language for robotics. All schools teach Java, so everyone on the software team knows how to use it. It’s object-oriented; it’s portable so it runs on Macs, PCs, Linux, whatever; it’s very efficient so we don’t have to worry about memory management; and there are lots of APIs available. And if you know how to write your applications properly, it can be very fast.”

The ETS team used Java for mission control and SONIA’s control systems, Java Management Extensions (JMX) for management, and a Java 3-D Simulator to simulate a broad range of mission scenarios. The team is now investigating the possibilities of Real-time Java, introduced at this year’s JavaOne Conference, for AUV and other robotics applications.

Consensus Building and Peer Review

According to Mr. Mercier, teamwork was every bit as important as technology in the ETS team’s success. “I can’t stress strongly enough that our ability to work together was the key to our success in the competition,” he said. “This is not about 12 individuals working on separate tasks by themselves. Every step of the way, we worked as a team and built consensus, so in the end everyone learned more. And that’s what this is really all about.”

For example, each software change was subject to peer review. All team members would receive an e-mail containing the previous version of the software, the new version incorporating a proposed change, and the rationale behind the change. Far from slowing the process down, the peer review concept got more team members more actively engaged, and ultimately resulted in far higher quality, according to Mr. Mercier. These peer reviews also ease the integration of new team members. Being a volunteer based project, volunteers come and go on a regular basis.

At the same time, the team shared tips and tricks with peers at other educational institutions. “This is more of a friendly rivalry than a dog-eat-dog competition,” said Tennessee Carmel-Veilleux, electrical team leader of the SONIA team. “We like to exchange information with some of the other teams, keep in touch with them. Who knows—we may all be working together some day.”

In recognition of the team’s willingness to work with other teams, and for achievements at the Unmanned Underwater Vehicle Competition, Felix Pageau, team captain, won the Andy Estabrook Award for "initiative and vision in the unmanned underwater systems.” Given for the first time to a student, the award was presented by the Lindbergh Chapter, San Diego, CA, of the AUVSI. Andy Estabrook was a pioneer in unmanned robotics and this award was created to honor his accomplishments in the advance of unmanned systems technology.

What’s next for the ETS team? The team itself is growing rapidly, thanks in part to the success at this year’s competition. The team leaders now find themselves in management roles as the team’s ranks have swollen to 34. “We’re going to compete again next year, and we’re going to focus on making our software more stable, more reliable, and faster,” said Mr. Morissette. In the mean time, the team leaders will be presenting their work at a variety of conferences worldwide—from Florida and Washington D.C. to Cologne, Germany.

And when will they get around to more traditional college activities such as frat parties and beer runs? “Probably never,” said Mr. Mercier. “We’re geeks. We’re doing what we love.”

For more information:

posted @ 2006-12-01 20:57 wqwqwqwqwq 阅读(537) | 评论 (0)编辑 收藏
   Sun Microsystems公司宣布,其免费提供的适用于Solaris和Linux 操作系统的开发工具――Sun Studio 11软件,再次就标准性能评测公司(SPEC)提出的新的基准性能标准创立了破记录的性能记录。此外,Sun还发布了Sun Studio Express项目,采用C、C++和Fortan等编程语言的开发者可以通过该项目预览Sun Studio未来版本准备提供的新特性。在过去的6个月内,对Sun Studio 11软件的注册下载次数已超过50,000次,Sun Studio Express项目的创立响应了业界对Sun Studio 11软件的极大兴趣和迅速采用的需求。

Sun在基于AMD Opteron和UltraSPARC®处理器的系统上,采用Sun Studio 11和Solaris 10软件,创立了四大基准性能测试中的三项性能测试(SPECint2006、SPECfp2006和SPECint_rate2006)的最高记录,确 立了Sun在标准性能方面的领导地位。采用Sun Studio 11软件所具有的先进性能,如自平行技术(Auto-Parallelism Technology),基于AMD Opteron处理器的Sun Fire X4200服务器,其性能超越了基于Intel处理器的竞争对手的系统,如HP ProLiant DL380 G4服务器和HP ProLiant DL385服务器。Sun还公布了其旗舰产品Sun Fire E25K服务器的优异性能,兑现了它曾对高端商务计算领域做出的承诺。据IDC公司2006年第二季度全球服务器市场季度报告得知,Sun的高端系统针对 Sun Studio软件做了优化,这帮助Sun成为了这一季度内取得市场份额增长的唯一的服务器厂商。

所创立的SPEC CPU2006基准性能的测试记录是2006年8月24日发布的。这一记录是上个最高记录的4倍。该基准性能测试针对了各种各样的负载,得到了实际应用中 更好的适用性结果。这一新的基准性能测试在各种计算密集的负载上测试了计算机处理器、内存架构和编译器的性能,这些负载应用包括有,蛋白质排序、MPEG -4编码、XML处理、流体动力学、结构性力学和语音识别等。

“Sun Studio软件继续显示了在帮助开发商最大化其应用程序性能的能力上的领导地位,”Sun公司开发工具高级总监Don Kretsch说,“6个月内50,000次下载,使采用Sun Studio 11软件的企业开源开发者们获得了诸多好处:减少了开发时间,提高了便携性,还改善了他们所开发的应用程序的性能。”

Sun Studio 11软件为开发者带来的最大好处之一就是各个组件之间的集成性非常好,这些组件包括有:编译器优化组件、多线程警示调试器、性能分析工具和一个基于 NetBeans的集成开发环境(IDE)。这些工具组件还可以在其他的编译器上工作,这就使开发者们可以很容易地将Sun Studio工具与他们现有的开发环境混和在一起使用。新发布的Sun Studio Express项目对正在研发中的Sun Studio未来版本的主要特性将定期予以提供。包括针对Linux的编译器优化组件在内的最新的一些性能在最近于旧金山举行的2006 LinuxWorld上做了演示。此外,新的Data Race Detection Tool(数据族探查工具)对现有的多线程库、多线程工具和编译器优化等特性是一个重要的补充,可使多线程应用的开发变得更加简化和容易。

开发者可从网站http://developers.sun.com/sunstudio下载免费的、无限制的Sun Studio软件。

技术规格
  • 产品系统要求:

    SPARC 平台

    • 内存:至少为 512 MB 内存;建议使用 1 GB
    • 磁盘空间:1.7 GB
    • 安装光盘

    x86/x64 平台

    • 内存:至少为 512 MB 内存;建议使用 1 GB
    • 磁盘空间 (Solaris OS):1.1 GB
    • 磁盘空间 (Linux OS):0.6 GB
    • 安装光盘
  • 支持的操作系统::

    Solaris OS

    Solaris 8、9 和 10 操作系统整个 Solaris 软件组、整个 Solaris 软件组加 OEM 支持或者开发人员 Solaris 软件组

    Linux OS

    • Sun Java Desktop System,版本 3
    • SUSE Linux Enterprise Server 9
    • Red Hat Enterprise Linux 4
  • 许可要求::

    免许可费的运行时库 (.so) 分发

  • 使用限制::

    您应承诺软件不会被设计、许可或计划用于任何核设施的设计、修建、操作或维护。

  • 支持的相关标准::

    C:

    • ISO/IEC 9899:1999,编程语言 - C ("C99")
    • ISO/IEC 9899:1996,C
    • FIPS 160 标准。
    • K&R C
    • OpenMP C API Version 2.5

    C++:

    • ISO/IEC 14992:2003 C++ 标准
    • OpenMP C++ API 2.5 版

    Fortran:

    • ANSI X3.198-1992 Fortran 90
    • ISO 1539:1991 Fortran
    • ISO/IEC 1539-1:1997 Fortran 95
    • OpenMP Fortran API 2.5 版
  • 第三方兼容应用程序::

    GNU Compiler Collection(Linux 平台)

  • 升级计划::

    源和目标级与以前版本的兼容性以及 GNU C/C++ 兼容性功能,简化升级和采用。


posted @ 2006-11-17 23:22 wqwqwqwqwq 阅读(630) | 评论 (0)编辑 收藏
     摘要: 今天翻译了一篇实录,先发到自己的blog上吧,呵呵 开放Java平台(Micro Edition,微型版)源码:对话Sun公司移动&嵌入式平台高级主管香农.林奇 在2006年5月的JavaOne会议上,Sun微系统公司宣布即将开放Java技术的源码。目前,Sun已经计划开放大部分Java平台的源码,包括在2006年末之前开放Micro Edition (Java ME)和Java平...  阅读全文
posted @ 2006-11-15 19:46 wqwqwqwqwq 阅读(415) | 评论 (5)编辑 收藏

Sun发布Solaris ZFS-全球最先进的文档系统
Solaris 10 OS最新升级版包括Solaris ZFS 1.0文档系统
提供了端到端的数据完整性,重新定义缩放能力,大大降低数据管理成本


(2006年5月25日讯) Sun Microsystems公司发布了一个具有革命性的新的文档系统Solaris ZFS 1.0,它提供了多项突破性的功能,包括公共管理任务的自动化、保护数据免受非法行为的侵害,以及提供实际上无限的缩放能力。Solaris ZFS 1.0将作为我们这个星球上最先进的操作系统Solaris 10 OS的下一个商业版本的一个组成部分在今年6月份对外正式提供。此外,Solaris 10 OS的最新版本Solaris 10 6/06将先进的前摄性自愈技术和联网技术,与对PostgreSQL开源数据库的全面支持结合起来,进一步强化了Solaris 10 OS作为宿主高性能的关键数据库解决方案的首选平台的地位。

作为世界上最先进的文档系统,Solaris ZFS可以自动检测和修改细小的数据错误或遭遇意外侵害的数据,以提供信息的完整性。Solaris ZFS还因为不需要卷宗管理器而大大简化了数据的管理,而卷宗管理器是今天数据管理事务中最耗时、最费钱的部分。例如,今天,一项典型的系统管理任务可能 需要40多分钟来完成,但是采用Solaris ZFS,仅仅需要几秒钟的时间,且没有系统宕机的危险,从而大大降低了数据管理的成本费用。此外,Solaris ZFS还是世界上第一个128位的文档系统,这使系统具有了实际上无限的数据容量。Solaris ZFS提供的先进的缩放能力和管理能力,使它成为许许多多传统UNIX?文档系统的理想替代品。

Solaris是宿主高性能数据库的杰出平台。最近,Oracle指名Solaris 10 OS作为其开源64位开发和部署环境的理想平台。现在,Sun还将开源PostgreSQL数据库集成在Solaris 10 OS的最新版本内,对PostgreSQL数据库提供全面支持。Sun与PostgreSQL社团开展合作,让他们采用Solaris 10 OS提供的各种先进技术,如前摄性自愈技术、Solaris分区特性和Solaris动态跟踪能力(DTrace)等。

“面对不断增长的依顺性要求,今天的数据量每9~12个月就要翻番,但今天的文档系统还植根在上世纪70年代的技术之中,”Sun公司主管系统软件部的 副总裁Tom Goguen说,“Solaris ZFS从设计之初就是要迎接今天数据管理的挑战,它的预期寿命是20~30年。这一128位的文档系统所能存储的自愈数据是今天已有文档系统的160亿 倍,同时还大大简化了卷宗的管理。Solaris ZFS将是今年内发布的最重要的创新技术之一。”

Solaris 10是我们这个星球上最先进的操作系统,它可在650多款SPARC和x64/x86平台上运行,获得来自独立软件厂商的2,200多种应用程序的支持。 其无与伦比的功能性和硬件平台的支持,加上它所提供的行业唯一的应用兼容性保证,加快了Solaris 10 OS在全球的应用步伐,目前Solaris 10 OS的注册许可数已超过450万。

具有革命性的新的文档系统技术

Solaris ZFS 1.0具有任何其他商用文档系统技术所无法匹敌的优异性能。客户可以从Solaris ZFS技术中享用到先进的数据完整性技术、使用和管理的简易性、难以置信的高性能,以及实际上无限的缩放能力。

  • 端到端的数据完整性―― 基于校验和与事务性写入复制(copy-on-write)机制的突破性的结合,Solaris ZFS可提供满足CIO和系统管理员要求的数据准确性。Solaris ZFS拥有先进的错误检测机制,能识别被损坏的数据,并将之在运行中修改过来。例如,镜像的一侧被意外地重写,ZFS可以对之检测、修补和恢复,且完全不 干扰服务的进行。
  • 简化的管理――Solaris ZFS提供了一种基于共享的架构模式,使所有的共享数据和功能纳入虚拟内存管理。Solaris ZFS文档系统可以自动地增长或收缩,而无需占据额外存储空间的卷宗管理器。Solaris ZFS还提供了在任何时间点上对文档系统进行瞬间快照的能力,这就大大节约了一般系统管理员手工恢复文档所花费的时间和资源。
  • 性能的巨大提升――Solaris ZFS的架构设计有助于提高速度。写入复制的设计可将随意写入转变为快速连续写入。其输入/输出(I/O)带宽在有数据存储时可自动加大。无论工作量如 何,多种字区尺寸会自动做出最佳配合。智能化的预取感式读取可加快运行速度。而且,它的高级的、可扩展的I/O子系统设计采用了记分板式的流水线操作和依 赖性时序安排,同样提供了极大的性能提升。
  • 无限的数据容量――Solaris ZFS是世界上第一个128位文档系统,具有实际上无限的数据容量。
Solaris 10 OS是Solaris Enterprise System的组成部分。Solaris Enterprise System还包括Sun Java Enterprise System (Java ES)、Sun N1 System Manager软件和Sun Studio Software Developer工具,这些软件都可免费提供用于开发和部署。正是具有这么多软件,使Solaris Enterprise System成为今天可采用的唯一的综合性开放架构的软件平台。欲了解更多的相关信息或得到相关新闻稿件,请访问http: //www.sun.com/aboutsun/media/presskits/networkcomputing06q2。

Sun公司简介

一个独具特色的理念――“网络就是计算机”,指引着Sun各项技术的发展,为全球各个重要的市场增添活力。Sun共享创新和创建社团的思想体系处于新 一代网络计算-参与时代-的最前沿。Sun的足迹遍及全球100多个国家和地区,其互联网的网址为http://www.sun.com。Sun公司的中 文网址为http://www.sun.com.cn

ZFS是第一个128位的文件系统,同时ZFS又被Sun Microsystems称作史上最后一个文件系统。因为这个文件系统含有多项创新技术,不仅成功地解决现有文件系统的问题和陋习,而且前瞻性地考量了未 来对存储空间的需求,单个文件系统可以达到256 quadrillion(264) Zettabytes(221)。 ZFS不仅符合POSIX文件系统的标准,而且提供了许多高级功能比如:Quota(配额),Reservation(预留), Compression(压缩), Snapshot(快照),Clone(克隆)等。如果你还在坚持使用现有32位或者64位的文件系统,如果你还在“痛并不快乐着”地用着各式各样的 Volume Manager,那就很值得看看这里列出的使用ZFS的十条理由。

1. 再也不需要fsck, scandisk

不管你是在用Linux,UNIX还是Windows,相信大家都有过类似的体会:当系统意外断电或者非法关机,系统重起后发现文件系统有 inconsistent的问题,这时 候就需要fsck或者scandisk 来修复,这段时间是非常耗时而且最后不一定能够修复成功。更糟糕的是,如果这是一台服务器需要做fsck的时候,只能offline(下线),而且现有应 用往往都是大硬盘,相应fsck修 复时间也很长,这对许多使用该服务器的用户来说几乎不能忍受的。而使用ZFS后大家可以彻底抛弃fsck这种工具,因为ZFS是一个基于COW(Copy on Write)机制的文件系统。COW是不会对硬盘上现有的文件进行重写,保证所有硬盘上的文件都是有效的。所以不会有这种inconsistent的概 念,自然就不需要这种工具了。

2. 管理简单

  ZFS作为一个全新的文件系统,全面抛弃传统File System + Volume Manager + Storage的架构,所有的存储设备是通过ZFS Pool进行管理,只要把各种存储设备加 入同一个ZFS Pool,大家就可以轻松的在这个ZFS Pool管理配置文件系统。大家再也不用牢记各种专业概念,各种命令newfs, metinit及各种Volume Manager的用法。在ZFS中我们只需要两个命令,zpool(针 对ZFS Pool管理)和zfs(针对ZFS文件系统的管理),就可以轻松管理128位的文件系统。举个例子,我们经常会遇到系统数据增长过 快,现有存储容量不够,需要添加硬盘,如果依照传统的Volume Manager管理方式,那我 们需要预先要考虑很多现有因素,还要预先根据应用计算出需要配置的各种参数。在ZFS情况下,我们的系统管理员可以彻底解放,再也不需要这种人为的复杂 考虑和计算,我们可以把这些交给ZFS,因为ZFS Pool会自动调节,动态适应需求。我们只需一个简单的命令为 这个ZFS Pool加入新的硬盘就可以了:

zpool add zfs_pool mirror c4t0d0 c5t0d0

  基于这个动态调节的ZFS Pool之上的所有的文件系统就可以立即使用到这个新的硬盘,并且会自动的选择最优化的参数。

  而且ZFS同时也提供图形化的管理界面,下面是一个ZFS图形化管理的一个截屏:

[attachment=2119]

3. 没有任何容量限制

ZFS(Zettabyte File System)文件系统就如其名字所预示,可以提供真正的海量存储,在现实中几乎不可能遇到容量问题。在现有的64位kernel(内 核)下,它可以容纳达到16 Exabytes(264)大小的单个文件,可以使用264个存储设备,可以创建264个文件系统。

4. 完全保证 数据 的正确和完整

由于ZFS所有的数据操作都是基 于Transaction(事务),一组相应的操作会被ZFS解 析为一个事务操作,事务的操作就代表着一组操作要么一起失败,要么一起成功。而且如前所说,ZFS对 所有的操作是基于COW(Copy on Write), 从而保证设备上的数 据始终都是有效的,再也不会因为系统崩溃或者意外掉电导致数据文件的inconsistent。

还有一种潜在威胁 数据的可能是来自于硬件设备的问题,比如磁 盘,RAID卡的硬件问题或者驱动bug。现有文件系统通常遇到这个问题,往往只是简单的把错误数据直接交给上层应用,通常我们把这个问题称作 Silent Data Corruption。而在ZFS中,对所有数据不管是用户数据还是文件系统自身的metadata数 据都进行256位的Checksum(校 验),当ZFS在提交数据时会进行校验,彻底杜绝这种Silent Data Corruption情况。

5. 提供优异 性能和扩展性

  和传统File System + Volume Manager + Storage架构不同,ZFS则是直接基于存储设备提供所有的功能,因此有自己独有的创新特性,性能自然非比寻常。

  * Dynamic Striping vs. Static Striping

由于ZFS是基于COW和一个全局动态的ZFS Pool,任何一次写 操作,都是对一块新数据块(Block)的一次写操作。ZFS从ZFS Pool中动态挑选出一个最优的设备,并且以一个transaction(事 务)线性写入,充分有效地利用了现有设备的带宽,我们把这个特性称为Dynamic Striping。而相对应的Static Striping则是传统文件系统所使用的方式,Static Striping需要管理员预先对这组Stripe进行正确地计算人为 设置,而且如果加入新的设备则需要再次人为的计算和设置,更为严重的是如果人为计算错误,则会直接影响系统的性能。而在使用Dynamic Striping这种特性之后,我们根本不需要人为介入,ZFS会自动调整,智能的为你 提供最佳的设备,最快的操作方式。

  * 支持多种 大小的数据块(Multiple Block Size)

  ZFS支持多种大小的数据块定义,从512字节到1M字节。和传统文件系统往往都是固定大小数据块不同,ZFS则是可以动态的根据不同 大小的文件进行计算,动态的选择最佳的数据块。

因为不同大小数据 块,直接影响到实际使用硬盘容量和读取速度。如果使用较小的数据块,存储文件所导致的碎片则较少,读写小文件更快一些,但是会导致需要创建更多的 metadata,读写大文件则会更费时。如果使用较大的数据块,使用的metadata较少,更利于读写大文件,但是会导致更多的碎片。ZFS根据实际 调查现有文件使 用的情况,分析出一个选择数据块大小的算法,动态的根据实际文件大小确定最佳的数据块。所以ZFS是 非常智能的,在不需要系统管理员介入,就可以得到一个自我调优的结果。当然ZFS也支持用户对单个文件或者整个文件系统 所使用的数据块大小的自定义设置。

  * 智能预读取(Intelligent Prefetch)

  多数的操作系 统都 有这种将数据预先读取的功能,而ZFS则是建立在文件系统上直接提供的一种更加智能的数据预读取功能。它不仅可以智能地识别出多种读取模式, 进 行提前读取数据,而且可以对每个读取数据流进行这种预读取智能识别,这个对许多流媒体提供者来说是件非常好的事情。

  在扩展性上,和现有文件系统多是基于一个受限的静态模型不同,ZFS是采用ZFS Pool这个动态概念,它的metadata也是动态,并且读写操作都是可并行的,并且具有优先级概念,所以即使在大数据量,多设备的情况下仍可以保证性能的线性增长。

6. 自我修复功能

  * ZFS Mirror 和 RAID-Z

传统的硬盘Mirror及RAID 4,RAID 5阵列方式都会遇到前面提到过的问题:Silent Data Corruption。如果发生了某块硬盘物理问题导致数据错误,现有的Mirror,包括RAID 4,RAID 5阵列会默默地把这个错误数据提交给上层应用。如果这个错误发生在Metadata中,则会直接导致系统的Panic。 而且还有一种更为严重的情况是:在RAID 4和RAID 5阵列中,如果系统正在计算Parity数值,并再次写入新数据和新Parity值的时候发生断电,那么整个阵列的所有存储的数据都毫无意义了。

在ZFS中则提出了相对应的ZFS Mirror和RAID-Z方式,它在负责读取数据的时候会自动和256位校验码进行校验,会主动发现这种Silent Data Corruption,然后通过相应的Mirror硬 盘或者通过RAID-Z阵列中其他硬盘得到正确的数据返回给上层应用,并且同时自动修复原硬盘的Data Corruption 。

  * Fault Manager

在Solaris 10中,包含 一个ZFS诊断引擎和Solaris的 Fault Manager(这也是Solaris 10的 另一个新特性)交互,可以实时地诊断分析并且报告ZFS Pool和存储设备的错误,用户可以通过Fault Manager及时得到一个非常友善的消息。这个诊断引擎虽然不会采取主动的行为去修复或者解决 问题,但是会在消息中提示系统管理员可采取的动作。类似下面一个ZFS报错消息,其中REC-ACTION就是建议采取的动作:

SUNW-MSG-ID: ZFS-8000-D3, TYPE: Fault, VER: 1, SEVERITY: Major

EVENT-TIME: Fri Mar 10 11:09:06 MST 2006

PLATFORM: SUNW,Ultra-60, CSN: -, HOSTNAME: neo

SOURCE: zfs-diagnosis, REV: 1.0

EVENT-ID: b55ee13b-cd74-4dff-8aff-ad575c372ef8

DESC: A ZFS device failed. Refer to http://sun.com/msg/ZFS-8000-D3 for more information.

AUTO-RESPONSE: No automated response will occur.

IMPACT: Fault tolerance of the pool maybe compromised.

REC-ACTION: Run ’zpool status -x’ and replace the bad device.

7. 安全

  在安全上,ZFS支持类似NT风格NFSv4版的ACL(读取控制列表)。而且前面所提到的256位验证码,用户可选择多种验证方式,包括SHA-256验证算法,从而在物理存储单元级别上保证数据的安全性。

8. 超强功能

ZFS作为“最后一个文件系统”,涵盖了基本的文件系统和Volume管理的功能,同时 一并提供许多企业级别的超强功能:Quota(配额),Reservation(预留), Compression(压 缩), Snapshot(快照),Clone(克隆)。并且速度非常快。有了这个文件系统,大家再也不需要任何Volume Manager了。

9. 兼容性

ZFS是一个完全兼容POSIX规范的文件系统,所以处于上层的应用程序是完全不受影响。ZFS也提供一个Emulated Volume模块,可以把任何一个ZFS文件系统作为普通的块设备使用。同时ZFS也可以使用基于Volume Manager构建的Volume作为存储设备单 元。这样在不需要修改应用程序,不修改已有文件系统下,给了大家最大的自由度去获得ZFS提供的各 种特性。

10. 开源

  ZFS是Sun Microsystems公 司作为OpenSolaris的一个开源项目运作并且完全免费使用,点击这里(http://www.opensolaris.org/os/community/zfs/source/) 可以直接浏览到ZFS的代码。 这就代表着我们不仅同时可以享受商业公司的高质量,也可以获得开源模式的优点。

虽然目前只有Solaris支持该文件系统,但是这种开源的模式必定会促进更多基于ZFS的应用。现在已经有国外开发者正在将ZFS移植到Linux和 Mac OS上来。如果想要体验一下ZFS,由于目前它和Solaris 10绑定在一起,所以需要下载最新版的Solaris 10 6/06 (http://www.sun.com/software/solaris/get.jsp)。

参考:

Solaris ZFS Administration Guide: http://docs.sun.com/app/docs/doc/819-5461?l=zh&q=ZFS

Solaris 10 Zone FAQ: http://www.sun.com/software/solaris/faqs/zfs.xml

Automatic Performance Tuning in the Zettabyte File System: http://tesla.hpl.hp.com/self-manage03/Finals/henson-self-tune.pdf



posted @ 2006-10-30 10:19 wqwqwqwqwq 阅读(1489) | 评论 (0)编辑 收藏
<2006年10月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234




常用链接

留言簿(10)

随笔分类(95)

随笔档案(97)

文章档案(10)

相册

J2ME技术网站

java技术相关

mess

搜索

  •  

最新评论

阅读排行榜

校园梦网网络电话,中国最优秀的网络电话