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

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

posted @ 2008-04-22 12:50 wqwqwqwqwq 阅读(1452) | 评论 (1)编辑 收藏
     摘要: 昨天写了个关于图库的总结mail 在这贴下,以供参考,当然望不吝赐教  阅读全文
posted @ 2008-04-21 18:09 wqwqwqwqwq 阅读(1410) | 评论 (0)编辑 收藏
     摘要: 前两天写了一个处理逻辑表达式的小程序,可以用来处理专家系统实事等逻辑关系表达式。  阅读全文
posted @ 2008-02-26 19:05 wqwqwqwqwq 阅读(2571) | 评论 (2)编辑 收藏
     摘要: EasyMock 是一套通过简单的方法对于指定的接口或类生成 Mock 对象的类库,它能利用对接口或类的模拟来辅助单元测试。本文将对 EasyMock 的功能和原理进行介绍,并通过示例来说明如何使用 EasyMock 进行单元测试。   阅读全文
posted @ 2008-02-18 22:14 wqwqwqwqwq 阅读(720) | 评论 (0)编辑 收藏
     摘要: Craigslist的网站上没有图片,只有密密麻麻的文字,标着各种生活信息,是个巨大无比的网上分类广告加BBS的组合...  阅读全文
posted @ 2008-01-21 13:06 wqwqwqwqwq 阅读(2519) | 评论 (0)编辑 收藏
posted @ 2007-12-25 20:25 wqwqwqwqwq 阅读(425) | 评论 (0)编辑 收藏
     摘要: Trie树是一棵度 m ≥ 2 的树,它的每一层分支不是靠整个关键码的值来确定,而是由关键码的一个分量来确定。  阅读全文
posted @ 2007-12-13 20:07 wqwqwqwqwq 阅读(1728) | 评论 (0)编辑 收藏
     摘要: For myself learning.
Personal Mastery  阅读全文
posted @ 2007-12-09 18:28 wqwqwqwqwq 阅读(1443) | 评论 (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 阅读(965) | 评论 (5)编辑 收藏
     摘要: IBM Dump Analyzer for Java是来分析虚拟机稳定性的一种可扩展框架。对Java虚拟机生成的产物进行自动诊断。  阅读全文
posted @ 2007-11-16 15:36 wqwqwqwqwq 阅读(1237) | 评论 (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 阅读(2232) | 评论 (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 阅读(1173) | 评论 (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 阅读(1194) | 评论 (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 阅读(1042) | 评论 (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 阅读(1448) | 评论 (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 阅读(903) | 评论 (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 阅读(1250) | 评论 (1)编辑 收藏
     摘要: 好长时间没写程序了感觉,忘了很多东西,呵呵,今天打开Eclipse写了一个Struts的小应用,也回顾了一遍它的主要内容,这篇随笔就把整理的一些东西贴出来吧。  阅读全文
posted @ 2007-10-07 16:55 wqwqwqwqwq 阅读(989) | 评论 (0)编辑 收藏
     摘要: 本程序为优化,比较好的方法是,进行曲线积分,算误差比进行方程约束,由于时间比较少,稍候会给出优化程序。  阅读全文
posted @ 2007-08-14 17:27 wqwqwqwqwq 阅读(994) | 评论 (0)编辑 收藏
     摘要: A simple implement of own stack  阅读全文
posted @ 2007-08-03 18:14 wqwqwqwqwq 阅读(984) | 评论 (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 阅读(833) | 评论 (0)编辑 收藏
     摘要: 今天很早的来到公司,首先查收了一下邮箱,发现5封新邮件,仔细的看了下都是关于我前天申请一个IBM USA那边的一个DB访问权限的邮件。  阅读全文
posted @ 2007-07-27 08:55 wqwqwqwqwq 阅读(281) | 评论 (2)编辑 收藏
     摘要: Sun has just announced the winners of netbeans plugin competition  阅读全文
posted @ 2007-07-21 23:34 wqwqwqwqwq 阅读(1127) | 评论 (0)编辑 收藏
PMI
     摘要: PMI(Performance MonitoringInfrastructure)   阅读全文
posted @ 2007-07-13 17:32 wqwqwqwqwq 阅读(1174) | 评论 (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 阅读(505) | 评论 (0)编辑 收藏
     摘要: 首先说点别的:),今天google adsense给我回信关于blog头搜索不好用的原因是嵌在了里。我评论的前两条是表扬google...  阅读全文
posted @ 2007-06-02 23:16 wqwqwqwqwq 阅读(1501) | 评论 (8)编辑 收藏
     摘要: 好长时间没写随笔了^^,主要是因为这几天很忙,ibm的、学校的、还有sun的插件大赛,但是这段时间自己确一直在学习,在继续关注技术的进展,随着这篇关注焦点,在之后的几天里,我会继续写一些,IBM SOA、SOAP、RBD、EGL还有我们HotJava的 SmallWorld等内容。
JavaFX当前是备受SUN推崇和重点推广的项目之一,也是Java技术继续演化的内容之一。  阅读全文
posted @ 2007-05-31 11:03 wqwqwqwqwq 阅读(1206) | 评论 (0)编辑 收藏
     摘要: 今天浏览网页,看见篇写JNDI比较基础,也比较详细的文章,又自己整理了一下,post到新手区了,。。。。:)JNDI是java访问名字和目录服务的接口,与JDBC一样,它仅仅只定义了一套服务接口,实现由具体厂商提供。作为j2ee核心组件之一,它为应用程序查找其他程序组件和资源提供了统一的接口,其中最常见的用途就是数据源的配置、EJB名字查找、JMS相关配置等。JNDI的架构如下图。在JDK1.3中...  阅读全文
posted @ 2007-05-14 23:33 wqwqwqwqwq 阅读(799) | 评论 (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 阅读(946) | 评论 (0)编辑 收藏
     摘要: CLI command line interface ...  阅读全文
posted @ 2007-05-10 23:23 wqwqwqwqwq 阅读(980) | 评论 (0)编辑 收藏
     摘要: 据说极有可能迅速取代目前流行的SWING和SWT技术。  阅读全文
posted @ 2007-05-07 22:30 wqwqwqwqwq 阅读(977) | 评论 (1)编辑 收藏
北京今天有些风,但是依然挡不住本有的闷热。傍晚下楼吃饭,就像突然走进蒸笼一样的感觉,想象着眼前如果是大海该多好啊,说到这真是惭愧,我在大连待了20多年,居然不会游泳,哎~...吃完饭,我从上地佳园溜达到公司,休息了一下。本想着看点书,但是这个时候似乎是快到下班的时间了,看着白领一族的匆匆离去、联想围栏旁悠然自得的粉刷小匠,我突然萌生要离开这儿,去高校转转的念头。
绕过DASCOM沿着信息路来到了五街,在路牌下等者656...我真的实在受不了了太阳的直射和等车的烦躁,终于决定今天也学一次抗日前的长征,学一次开学前的军训,...自己走到北大,也算熟悉熟悉一路的环境。现在回来我真的发现这是一个了不起的决定,因为这实在太累,走去五环-北大-四环,又跑回上地,即使在地图上只能算作一指之距。想想先前走到北京体校时看见一个学生绕学校跑时的窃窃思绪,我更敬佩自己。脚累得很,但我也算是准备好了这段时间出门在外的辛苦...RuiRui,你说得很好,坚持久了,也就好了。

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

posted @ 2007-05-06 12:24 wqwqwqwqwq 阅读(411) | 评论 (0)编辑 收藏
     摘要: 这两天找了一些portal相关的资料,也从中学到了很多东西。据说我们学校还有个portal,不过现在不知为什么down掉了...  阅读全文
posted @ 2007-04-27 20:48 wqwqwqwqwq 阅读(2766) | 评论 (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 阅读(1345) | 评论 (2)编辑 收藏
ANT
     摘要: ANT是一个基于JAVA的自动化脚本引擎,脚本格式为XML。除了做JAVA编译相关任务外,ANT还可以通过插件实现很多应用的调用。  阅读全文
posted @ 2007-04-19 14:56 wqwqwqwqwq 阅读(229) | 评论 (0)编辑 收藏
     摘要: 软件开发习惯中一个细微更改都可能会对软件质量产生巨大改进。将单元测试合并到开发过程中,然后从长远角度来看它可以节省多少时间和精力。本文通过使用代码样本说明了单元测试的种种好处,特别是使用 Ant 和 JUnit 带来的各种方便。  阅读全文
posted @ 2007-04-19 14:52 wqwqwqwqwq 阅读(459) | 评论 (0)编辑 收藏
     摘要: 在Ant出现之前,构建和部署Java应用需要使用包括特定平台的脚本、Make文件、各种版本的IDE甚至手工操作的“大杂烩”。现在,几乎所有的开源 Java项目都在使用Ant,大多数公司的内部项目也在使用Ant。Ant在这些项目中的广泛使用自然导致了读者对一整套Ant最佳实践的迫切需求。  阅读全文
posted @ 2007-04-19 14:45 wqwqwqwqwq 阅读(465) | 评论 (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 阅读(1261) | 评论 (0)编辑 收藏
     摘要: 昨晚同学找我帮忙写一个利用GOOGLE API的小程序,也比较感兴趣所以就应下了。下载了GOOGLE提供的googleapi.jar,大约花了20多分钟,写了这个小程序,由于需要提供GOOGLE key所以也懒得去申请,就没有测试~~呵呵  阅读全文
posted @ 2007-04-14 15:22 wqwqwqwqwq 阅读(3542) | 评论 (9)编辑 收藏
     摘要: 元数据是利用JDBC创建和操作数据库对象的一个很重要的概念和应用,所以今天我特地的找了一些详细解析个概念的资料,和利用java来操作的实例。  阅读全文
posted @ 2007-04-12 23:58 wqwqwqwqwq 阅读(1704) | 评论 (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 阅读(547) | 评论 (0)编辑 收藏
     摘要: 可供程序利用的资源(内存、CPU时间、网络带宽等)是有限的,优化的目的就是让程序用尽可能少的资源完成预定的任务。优化通常包含两方面的内容:减小代码的体积,提高代码的运行效率。本文讨论的主要是如何提高代码的效率。  阅读全文
posted @ 2007-04-09 11:12 wqwqwqwqwq 阅读(455) | 评论 (0)编辑 收藏
1.变量引用的时候,空指针情况的防止,即为空检查.
2.数学运算异常,如除0的情况.数组越界异常,字符串访问过界
3.数据库检索记录,结果记录行数状况的处理.
4.画面显示项目的确认.
5.画面显示项目达到上限时情况的处理.
6.系统出错的时候,异常信息是否正确.
7.数据库连接,游标的处理.
8.数学运算时,数据精度的处理.
posted @ 2007-04-09 11:06 wqwqwqwqwq 阅读(203) | 评论 (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 阅读(455) | 评论 (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 阅读(850) | 评论 (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 阅读(465) | 评论 (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 阅读(463) | 评论 (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 阅读(423) | 评论 (0)编辑 收藏
这几天忙忙乱乱的,也没顾及这个blog,其实说句实话,自己也好几天没在研究技术的东西了,只是在看看IBM的一些个产品,哎~所以今天还是没打算写写技术,只是来post自己这几天的一些琐琐碎碎。还算高兴的事情是自己的小队伍获得了国际数学建模竞赛2等奖,虽然不是很理想,但自己还是满足了,毕竟带的娘子(当然是除了我了)队伍实力不是很强,况且大过年的我原来的伙伴早飞回温暖的南方了。其实我本身早厌倦了那种比赛,不过还是比较欣赏美国人的精明和对中国人明知故犯的无奈,也许吧,其实还是要庆祝一下自己的最后一次这种竞赛...
这周学校组织无偿献血,虽然我并不在乎学校不给什么所谓的补偿,我也不会因为献血怎么怎么的就有所目的,只是感觉这种行为还算是对社会作出了一点贡献。最岖奇的是导员居然不让我献血,当然他的劝告算能让我接受,但是自己还是很固执的感觉,无奈的导员也只好应下了。哎~我这个人真是经不起别人的劝告发现,在好些个朋友的“吓唬”下,终于作出了心虚的妥协...哎~,不过也算给我的母亲一个很好的交代了。
不说这些令人扫兴的话题了,还有一件好事,就是跟我关系很铁的一个老师有了21个月的小宝宝,其实他才告诉我的,还是在网上。不过早应该猜到了,因为这几天就发现他“不误正业”,整天不在办公室,往家里一个劲的跑,不过在这里,虽然他不会知道,还是祝愿他博士论文顺利通过吧,双喜临门...
想早些休息了,Good night&& Good dream.
posted @ 2007-03-22 23:18 wqwqwqwqwq 阅读(431) | 评论 (0)编辑 收藏
刚刚看看过鲁豫有约的两期节目,是采访的年轻轻但身价过亿的李想、高燃、戴志和茅侃侃。其实,我并不因为他们的年轻或是很有钱,而感到任何诧异,但自己却很欣常他们各自所持有的信念和创业过程中对资金的运营勇气,我真的不知道随着他们事业的增长、社会的变更,他们还是否会是浪潮的宠儿、是否会和原来一样,对待更多的运营资本同样的保持清醒地头脑,但我还是很祝福他们...

看过之后,我的感触很深,在这个社会上,或许是因为随着一个人学历的渐渐增长,他也会变得懒惰,因为他再也不会像社会地位很卑微的人一样为生计担心,我本也相信,人在骨子里是懒惰的。其实,我自己也曾想过,以后能找个比较大的外企工作,几年之后一个月拿个几W块就ok了,然后就是一辈子平平淡淡的生活...:),或许我的思想还不够先进吧。他们的经历,也让我重新思考,说句实话,其实他们并没什么,只是在坎坷的社会中,为了自己的信念坚持了下来,并一直做到了现在。我想我也该在为别人打工的同时,定位自己的目标,并坚定的追求。高燃是我很佩服的一个人,完全是因为他的执著,无论是他考清华、追GirlFriend 还是去找投资人,最后到办好公司。人的天赋很重要,但我还是更喜欢执著...
posted @ 2007-03-18 23:32 wqwqwqwqwq 阅读(616) | 评论 (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 阅读(155) | 评论 (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 阅读(454) | 评论 (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 阅读(600) | 评论 (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 阅读(457) | 评论 (0)编辑 收藏
刚刚结束了IBM的电面,一个GG和JJ,问的主要问题都放在我的项目上了,尤其是Netbeans的插件。由于我申请的实习生,所以在之中也问了很多实习时间的问题,感觉IBM问问题很不含糊,甚至要问出几月几号......这一点可以说明IBM是一个很值得人去的地方。英文问题我感觉我答得不是很好,先问得IBM的文化之类的,之后居然问得IBM person惭愧啊 本来还知道几个的,一紧张都忘了。在角色兑换时,我问得我的表现,和职业生涯建议,好小子,他们居然还反问我职业生涯,说了一通......整个电面是从4:10-4:45,最后GG说面试表现还好,只是我能实习的时间比他们要求的时间要少,唉~~ 我的系主任啊,等待结果中....希望自己能去IBM体验一下蓝色巨人的风范吧。
posted @ 2007-03-02 17:05 wqwqwqwqwq 阅读(790) | 评论 (0)编辑 收藏
一会4:30要参加北京IBM研究院的一个电面,快到时间了,不免心里稍有些紧张,不知道先前积累的一点英语一会是否会奏效,呵呵,,,,不过,无论如何我会尽可能抓住这次来之不易的机会的。
posted @ 2007-03-02 14:44 wqwqwqwqwq 阅读(524) | 评论 (0)编辑 收藏
     摘要: This post had been writen long before,...but  阅读全文
posted @ 2007-02-15 23:36 wqwqwqwqwq 阅读(450) | 评论 (1)编辑 收藏
     摘要: Java SE 6.0(代号Mustang,野马)已经发布,详情请见 野马奔腾而出,Java SE 6 正式版发布 ,它给我们带来了哪些新的特性了。     首先,我们看看JDK 6.0包含了大量的JSR,分为四组,分别为:     在简化开发方面: 199: Compiler API...  阅读全文
posted @ 2007-02-08 11:18 wqwqwqwqwq 阅读(2025) | 评论 (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 阅读(468) | 评论 (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 阅读(617) | 评论 (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 阅读(620) | 评论 (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 阅读(351) | 评论 (0)编辑 收藏
jar2exe是国产软件,看来这方面的需求还是很旺盛的。点击这里下载。
过程极为简单,第一步
第二步,选择应用程序类型

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

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

posted @ 2006-12-04 13:18 wqwqwqwqwq 阅读(1570) | 评论 (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 阅读(406) | 评论 (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 阅读(3845) | 评论 (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 阅读(2753) | 评论 (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 阅读(528) | 评论 (0)编辑 收藏
<2006年12月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456




常用链接

留言簿(10)

随笔分类(95)

随笔档案(97)

文章档案(10)

相册

J2ME技术网站

java技术相关

mess

搜索

  •  

最新评论

阅读排行榜

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