posts - 97,  comments - 93,  trackbacks - 0
  2007年3月16日
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 阅读(2493) | 评论 (4)编辑 收藏
     摘要: org.eclipse.jface.viewers.TreeViewer

的继承关系是  阅读全文
posted @ 2008-04-23 00:10 wqwqwqwqwq 阅读(4824) | 评论 (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 阅读(734) | 评论 (0)编辑 收藏
     摘要: Craigslist的网站上没有图片,只有密密麻麻的文字,标着各种生活信息,是个巨大无比的网上分类广告加BBS的组合...  阅读全文
posted @ 2008-01-21 13:06 wqwqwqwqwq 阅读(2529) | 评论 (0)编辑 收藏
posted @ 2007-12-25 20:25 wqwqwqwqwq 阅读(432) | 评论 (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 阅读(1453) | 评论 (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 阅读(2243) | 评论 (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 阅读(1050) | 评论 (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 阅读(1457) | 评论 (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 阅读(913) | 评论 (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 阅读(1003) | 评论 (0)编辑 收藏
     摘要: 本程序为优化,比较好的方法是,进行曲线积分,算误差比进行方程约束,由于时间比较少,稍候会给出优化程序。  阅读全文
posted @ 2007-08-14 17:27 wqwqwqwqwq 阅读(1001) | 评论 (0)编辑 收藏
     摘要: A simple implement of own stack  阅读全文
posted @ 2007-08-03 18:14 wqwqwqwqwq 阅读(992) | 评论 (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 阅读(289) | 评论 (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 阅读(1182) | 评论 (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 阅读(519) | 评论 (0)编辑 收藏
     摘要: 首先说点别的:),今天google adsense给我回信关于blog头搜索不好用的原因是嵌在了里。我评论的前两条是表扬google...  阅读全文
posted @ 2007-06-02 23:16 wqwqwqwqwq 阅读(1513) | 评论 (8)编辑 收藏
     摘要: 好长时间没写随笔了^^,主要是因为这几天很忙,ibm的、学校的、还有sun的插件大赛,但是这段时间自己确一直在学习,在继续关注技术的进展,随着这篇关注焦点,在之后的几天里,我会继续写一些,IBM SOA、SOAP、RBD、EGL还有我们HotJava的 SmallWorld等内容。
JavaFX当前是备受SUN推崇和重点推广的项目之一,也是Java技术继续演化的内容之一。  阅读全文
posted @ 2007-05-31 11:03 wqwqwqwqwq 阅读(1218) | 评论 (0)编辑 收藏
     摘要: 今天浏览网页,看见篇写JNDI比较基础,也比较详细的文章,又自己整理了一下,post到新手区了,。。。。:)JNDI是java访问名字和目录服务的接口,与JDBC一样,它仅仅只定义了一套服务接口,实现由具体厂商提供。作为j2ee核心组件之一,它为应用程序查找其他程序组件和资源提供了统一的接口,其中最常见的用途就是数据源的配置、EJB名字查找、JMS相关配置等。JNDI的架构如下图。在JDK1.3中...  阅读全文
posted @ 2007-05-14 23:33 wqwqwqwqwq 阅读(812) | 评论 (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 阅读(985) | 评论 (1)编辑 收藏
北京今天有些风,但是依然挡不住本有的闷热。傍晚下楼吃饭,就像突然走进蒸笼一样的感觉,想象着眼前如果是大海该多好啊,说到这真是惭愧,我在大连待了20多年,居然不会游泳,哎~...吃完饭,我从上地佳园溜达到公司,休息了一下。本想着看点书,但是这个时候似乎是快到下班的时间了,看着白领一族的匆匆离去、联想围栏旁悠然自得的粉刷小匠,我突然萌生要离开这儿,去高校转转的念头。
绕过DASCOM沿着信息路来到了五街,在路牌下等者656...我真的实在受不了了太阳的直射和等车的烦躁,终于决定今天也学一次抗日前的长征,学一次开学前的军训,...自己走到北大,也算熟悉熟悉一路的环境。现在回来我真的发现这是一个了不起的决定,因为这实在太累,走去五环-北大-四环,又跑回上地,即使在地图上只能算作一指之距。想想先前走到北京体校时看见一个学生绕学校跑时的窃窃思绪,我更敬佩自己。脚累得很,但我也算是准备好了这段时间出门在外的辛苦...RuiRui,你说得很好,坚持久了,也就好了。

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

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

看过之后,我的感触很深,在这个社会上,或许是因为随着一个人学历的渐渐增长,他也会变得懒惰,因为他再也不会像社会地位很卑微的人一样为生计担心,我本也相信,人在骨子里是懒惰的。其实,我自己也曾想过,以后能找个比较大的外企工作,几年之后一个月拿个几W块就ok了,然后就是一辈子平平淡淡的生活...:),或许我的思想还不够先进吧。他们的经历,也让我重新思考,说句实话,其实他们并没什么,只是在坎坷的社会中,为了自己的信念坚持了下来,并一直做到了现在。我想我也该在为别人打工的同时,定位自己的目标,并坚定的追求。高燃是我很佩服的一个人,完全是因为他的执著,无论是他考清华、追GirlFriend 还是去找投资人,最后到办好公司。人的天赋很重要,但我还是更喜欢执著...
posted @ 2007-03-18 23:32 wqwqwqwqwq 阅读(627) | 评论 (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 阅读(161) | 评论 (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)编辑 收藏
<2007年3月>
25262728123
45678910
11121314151617
18192021222324
25262728293031
1234567




常用链接

留言簿(10)

随笔分类(95)

随笔档案(97)

文章档案(10)

相册

J2ME技术网站

java技术相关

mess

搜索

  •  

最新评论

阅读排行榜

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