Sunday, July 22, 2007

WTP Europa Release

Eclipse Europa is the annual release of Eclipse projects of 2007. Here are some of my experience about it. Since I am using WTP mostly, my experience is mainly concerned with WTP.

Interesting, my WTP 2.0 can not start up with -Xmx1024m. But it is able to start up with a smaller maximum heap size, for instance, -Xmx768m. While my other Java application, such as Tomcat, has no problem with -Xmx1024m. I am using JDK 1.6.0_01. I posted a message at the eclipse.webtools newsgroup. I will follow this issue.

It is desirable that WS explorer has an extension point to support application domain service description document (non WSDL). WS explorer can be used as a UDDI browser. In UDDI data model, the service entity can be associated with a tModel, which is simply a link to some non-registered document that further describes the service, for instance, the WSDL of the service. WS explorer supports to retrieve the WSDL, visually display it, and even invoke its operations.

I am working on the Grimoires project, which is an extended UDDI service registry supporting metadata annotation and service discovery by interface signature. In our practice, we very often see that users design their own service description language, instead of WSDL, to describe their services. For instance, the myGrid project, an influential service-oriented bioinformatics experiment environment, uses its own Feta schema. GLUE is a popular schema to describe services and resources in grid computing.

explorer has an extension point to support application domain service description document (non- explorer to open it; if it points to some non-This is understandable. First, it is cheap to design an XML schema for their XML-based service description language. Second, it improves usability with a DSL (domain specific language) in place. According to UDDI' data model, the URL of domain specific service description documents can be put into a tModel, then associated with the service entity. Thus it is desirable that WSWSDL). That is, if the tModel points to WSDL, then WS explorer uses its embedded WSDLWSDL document, the WS explorer uses some extension registered corresponding explorer to visually handle it. Somehow UDDI's tModel can be considered as an extension point of UDDI data model, because it allows any document with a URL to be associated with a service.

The benefit of such an extension point in WS explorer is to improve usability by supporting domain-specific service description documents, which further enhances the expressiveness of service description: whether the description document is WSDL or non-WSDL, standard based or domain specific, current supported or emerging, all can be handled by WS explorer.

Another desirable feature is about being able to print visualized XSD/WSDL supports visualizing . WTPXSD/WSDL. The visualized result is very informative and is a good source to be put into documentation. But this is not supported a couple of years ago. It is very good that now WTP 2.0 supports printing visualized XSD! (Although I am not sure exactly since which version WTP has implemented this.) But the printed visualized XSD loses its icons standing for XSD attribute and element. And it still does not allow to print visualized WSDL. I am not sure whether there is some technical difficulty for printing contents of arbitrary editors.

Thursday, June 14, 2007

"An open source project would be nothing without a supporting community"

"An open source project would be nothing without a supporting community."
- from Eclipse' FAQ

Wednesday, May 30, 2007

Selling Data Through Web Service

StrikeIron, "data as a service", provides a marketplace where people can put web services or purchase hits on web services that make available data which value is dependent on time, for instance, foreign currency exchange rates.

The key of business model is to sell valuable real time streamed data. And WS is adopted to simplify the data service implementation. The idea is cool and simple. And seems it works. I mean StrikeIron does have quite a few customers.

By googling "web serivces marketplace", I am aware Amazon has filed a patent of web services marketplace on 2005.

If someone is able to build up valuable data by doing data mining on Internet with the help of tools like google, and use StrikeIron to host a WS to provide the data, then (s)he can make money!

Tuesday, May 29, 2007

AJAX Enabled GrimoiresScript Interpreter

I implemented a toy language to handle Grimoires registry, which now I renamed as GrimoiresScript. Now I created a web-based GrimoiresScript interpreter, using AJAX to communicate between HTML page that takes in user input, and server-side JSP that invokes GrimoiresScript interpretation engine. The implementation follows the example in w3schools' AJAX tutorial.

AJAX is nothing but, or mostly a JavaScript RMI, which enables HTML pages to invoke remote methods.

Friday, May 25, 2007

Web Services Explorer in Eclipse

Web services explorer in eclipse can be used to browse UDDI registries, to parse services' WSDLs, and even to invoke service operations by sending them SOAP messages. It is implemented as a web application running on eclipse' embeded application server. So I am thinking to turn it into a standalone web application to act as Grimoires' web-based interface. As Chris Brealey pointed out, the WTP team also has this idea, but it is not easy to do this and the WTP team simply has no resource to be allocated on this. I played web services explorer today. It relies on quite a lot eclipse plug-ins. Even it could be turned into a standalone web application, it would be of a large footprint.

Thursday, May 24, 2007

Monitor Memory Usage in Java

There is no "sizeof" in Java. Originally there was no way to check or estimate how much memory has been used in Java. But since Java 1.5, we can use the Monitoring and Management facility to monitor memory usage. The following code

MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
System.out.println(mbean.getHeapMemoryUsage().toString();
System.out.println(mbean.getNonHeapMemoryUsage().toString();

will print out

init = 0(0K) used = 319360(311K) committed = 2031616(1984K) max = 66650112(65088K)
init = 8585216(8384K) used = 2379416(2323K) committed = 8880128(8672K) max = 100663296(98304K)
MemoryMXBean is also able to send out notification when some memory usage threshold is met.

Call Google AJAX Search Service in Java

Google has both a SOAP style service and an AJAX style for search. But it seems google focuses on the AJAX style rather than the SOAP style. For instance, the AJAX style has more functionalities than the SOAP style.

At the client side, the AJAX style is implemented as Javascripts embeded in a HTML page, which makes it impossible to be called from JDK script engine, at least not in a straightforward way.

Davanum Srinivas has published an interesting blog on how to call google ajax search service in Java. He used an reverse engineering approach to capture the url that the javascript sent to the google server, by some TCP/IP monitor. By manipulate the captured url, it is able to call google search in Java. The url looks like:

"http://www.google.com/uds/GwebSearch?"callback=GwebSearch.RawCompletion&context=0&
lstkp=0&
rsz=small&
hl=en&
sig=8656f49c146c5220e273d16b4b6978b2&
q=Axis2&
key=xxxxxxxxxxxxxxxxxx&
v=1.0"

When rsz is set to small, four records are returned; when large, eight are returned.

The search result contains result objects in JSON format, which can be parsed using some JSON parser.

It is easy to call google AJAX search service in Java. The challenge is when we have the capability to google repeatedly, untiredly, in brute force, or in a massive way, anything interesting can we achieve then?

Wednesday, May 23, 2007

Bridge GLUE LDAP schema and GLUE XML schema

GLUE is an information model to describe Grid resources. It has both an LDAP schema and an XML schema as its concrete data models. Usually GLUE data is in LDAP DIT in Grids. I need to read the LDAP data, convert to XML data according to GLUE schema, and then publish into Grimoires registry. What I am doing is:

  1. Use JAXB to generate Java bean classes according to GLUE XML schema;
  2. Parse GLUE LDAP schema with the help of an ANTLR-based LDAP schema parser, and generate Java code that converts LDAP entries to Java beans using the classes generated in step 1;
  3. Use JNDI to read GLUE LDAP DIT, call the code generated in step 2 to create beans that are further serialized to XML (in GLUE schema) by JAXB;
  4. Publish GLUE XML to Grimoires through the XMLView interface, which takes the configuration of XSLT between GLUE schema and Grimoires schema.

A Toy Language to Handle Grimoires Registry

I created a toy language to handle Grimoires registry using ANTLR. It also has a simple GUI to type and run the script. So I can type something like:

publish business (name="BusinessAA", desc="a business") -> $bk.

publish service (name="ServiceAA", desc="a service",bkey=$bk, wsdl="http://a/b/c.wsdl", address="http://a/b/") -> $sk.

attach metadata (type="http://www.grimoires.org/QoS", value="very good") to service (skey=$sk).

If run this script, it will first publish a business with name and description, and save the business key to a variable $bk, which will later be used in publishing service. It then will publish a service and attach a metadata to the published service.

Monday, April 02, 2007

Google launches TiSP — Free wireless broadband

Google launches free wireless broadband which makes use of local plumbing and sewage systems.

The reason it is free is "We believe that all users deserve free, fast and sanitary online access. To offset the cost of providing the TiSP service, we use information gathered by discreet DNA sequencing of your personal bodily output to display online ads that are contextually relevant to your culinary preferences, current health status and likelihood of developing particular medical conditions going forward. "

Friday, March 16, 2007

Sun's Blackbox

Thursday, March 15, 2007

Wednesday, March 14, 2007

[摘自www.popyard.org] 国家机密文件:最新流行官场口诀

现代企业职位新解:

总是在裁人,简称总裁;老是板着脸,所以称老板;总想监视人,

所以叫总监;经常没道理,就叫经理;让领导秘密舒服,称为秘书。

四清四不清:

开啥会不清楚,开会坐哪清楚;

谁送礼不清楚,谁没送清楚;

谁干得好不好不清楚,该提拔谁清楚;

和谁睡不清楚,睡觉干什么清楚。

当代八乱:

大棚把季节搞乱了,关系把程序搞乱了,

级别把能力搞乱了,法官把法律搞乱了,

公安把治安搞乱了,银子把官场搞乱了,

事故把交通搞乱了,小姐把辈份搞乱了。

最引人注目的哥哥──伟哥;

最年轻的奶奶──二奶;

最难设防的偷窃──偷情;

最热闹的走廊──发廊 ;

最畅销的书──女秘书。

办公室守则:

苦干实干,做给天看;东混西混,一帆风顺;

任劳任怨,永难如愿;会捧会献,杰出贡献;

尽职尽责,必遭指责;推托栽赃,邀功领赏!

中央机关出上联:上级压下级,一级压一级级级加码马到成功;

地方政府对下联:下层蒙上层,一层蒙一层层层掺水水到渠成。

横批:和谐社会。

官场日志:

清晨起床,打拳;上午开会,打盹;

中午吃饭,打嗝;下午上班,打哈;

傍晚加班,打牌;晚上娱乐,打炮;

半夜回家,打架。

百姓语录:

狠抓就是开会,管理就是收费,

重视就是标语,落实就是动嘴,

验收就是宴会,检查就是喝醉,

研究就是扯皮,政绩就是神吹,

汇报就是掺水。

官场之最;

最难找的地方──有关部门;

最难捉摸的官话──研究研究;

最神秘的机构──组织上;

最大的官──一把手;

最难管的东西──一张嘴;

最谦虚的时候──在上级面前;

最冠冕堂皇的语言──工作需要;

最易接受的行贿──您讲得真好!

最关心的信息──自己这次能否升迁;

最傻的高兴──你的问题组织上也考虑了 ;

最无奈的选择──因为年龄!

组织就是......

在你遇到难事时对你说:我们无能为力!

在你遭遇用人不公时对你说:你要正确对待!

在你合法权益受侵时对你说:你要顾全大局!

在你受到诬陷时对你说 :你要相信组织!

组织部长:谁关心我 我就关心谁;

纪委书记:谁不关心我 我就关心谁;

宣传部长:谁关心我, 我就关心他的正面,谁不关心我, 我就关心他的反面;;

市委书记:谁关心我 我就让组织部长关心他,谁不关心我 我就让纪委书记关心他。

忙碌的公仆在包厢里,重要的工作在宴会里,

干部的任免在交易里,工程的发包在暗箱里,

该抓的工作在口号里,须办的急事在会议里,

妥善的计划在抽屉里,应煞的歪风在通知里,

扶贫的干部在奥迪里,宝贵的人才在悼词里,

优质的商品在广告里,辉煌的数字在总结里。

公务员素描:

满腔热血投身社会,摸爬滚打终日疲惫;

低三下四谋取地位,常年奔波天天喝醉;

收入可怜啥都嫌贵,交往叩头处处破费;

有用本事已经作废,不学无术擅长开会;

口是心非阳奉阴违,溜须拍马寻找机会;

青春年华如此狼狈,苟且偷生窝囊一辈!

做人的难处:

有钱吧,说你准变坏;没钱吧,说你真失败;

有成就吧,说你会投机;没成就吧,说你没出息;

有情人吧,说你真坏;没有情人吧,说你变态!

中年烦恼:

职务不高,工资不高,血压血脂血糖高;

政治不突出,业务不突出,腰椎盘突出;

大会不发言,小会不发言,前列腺发炎;

炒菜糊,烧饭糊,麻将不胡。

批评上级,官位难保;批评同级,关系难搞;

批评下级,选票减少;批评自己,自寻烦恼;

批评老婆,她就乱跑;批评老公,他就乱搞;

唉,麻烦透了!

领导用过的叫文物,百姓用过的叫废物;

领导强词夺理叫坚持真理,百姓据理力争叫无理取闹;

领导握百姓的手叫关怀,百姓握领导的手叫巴结;

领导做蠢事叫轶事,百姓做错事叫傻子;

领导情人叫小蜜,百姓情人叫破鞋。

CCTV新闻联播的惊人发现:

开会没有不隆重的,闭幕没有不胜利的,讲话没有不重要的,决议没有不通过的,

鼓掌没有不热烈的,人心没有不鼓舞的,领导没有不重视的,进展没有不顺利的,

问题没有不解决的,完成没有不超额的,成就没有不巨大的,竣工没有不提前的,

接见没有不亲切的,中日没有不友好的,中美没有不合作的,交涉没有不严正的,

会谈没有不圆满的。

男女有别定律:

男人爱上女人会做诗,女人爱上男人会做梦;

女人对男人往往朝思暮想,男人对女人往往朝秦暮楚;

女人看家本领是撒娇,男人拿手好戏是撒谎。

女人的幸福在于:他真的爱我,

女人吻男人算是一种幸福,

男人吻女人算是一种口福;

当女人走投无路时她会和一个男人结婚,

当男人走投无路时一个女人会和他离婚;

做情人的时候女人会让男人心疼,

做妻子的时候女人会让男人头疼。

穷人富人论:

欠个人的钱是穷人,欠国家的钱是富人;

喝酒看度数的是穷人,喝酒看牌子的是富人;

写书的是穷人,盗版的是富人;

吃家禽的是穷人,吃野兽的是富人;

耕种土地的是穷人,买卖土地的是富人;

女人给别人睡的是穷人,睡别人女人的是富人。

贫穷与富裕的新解:

贫穷时养猪,富裕后养狗;

贫穷时种稻,富裕后种草;

贫穷时想娶老婆,富裕后想找情人;

贫穷时老婆兼秘书,富裕后秘书兼老婆。

水调歌头:重上酒楼

应酬复应酬,天天忙不休。

社交公关人情事,尽在酒里头。

泱泱五千年,底蕴多丰厚,帝王墨客江湖汉,江山美人酒。

改革大潮涌,迂腐全荡走,惟有美女权钱欲,兴盛遍神州。

工厂变歌厅,书店改酒楼,失业大军数百万,桑拿歌与酒。

上面常来人,视察加旅游,小心陪侍别出错,工作有成就。

世事多变幻,官场巧运筹,相互照应方便多,公酒交私友 。

人生苦且短,工作多烦忧,哥们姐们再进一杯酒,泡完脚再走。

这年头,到处都是错别字:

植树造零;白收起家;

勤捞致富;择油录取;

得财兼币;检查宴收;

大力支吃;为民储害;

提钱释放;攻官小姐。

今日菜根谭



I created a news feeder (RSS), quote of the day from Chinese wisdom: Vegetable Root (菜根谭), which can be added into Google personal homepage.
Add to Google