最近魔兽进展

作为忘川公会的一员,我们的到了会员朋友们的大力支持,在上周日晚(欧洲时间)完成了卡拉赞的钥匙任务之十八摸,只用了 33 分钟。在此我们强烈感谢各位在我们的卡拉赞钥匙之旅中给予支持的每一位朋友。希望复活节期间,能给大家的小号服务一下。

上周和朋友去逛了 LEFDAL,发现了特价的 WOW BattleChest,只有 199 NOK,含一个月,再加上 10 天的试玩,就是 40 天了。hoho,下半年,进军欧服。回到家一看,还有两本精美的小册子,可以作为英语学习资料仔细研读了。

相关链接
忘川:水木清华二站搜索“忘川”。
卡拉赞:英文版中文版

终于 70 级了

从圣诞节前,又开始了国服的魔兽世界。就是有些卡,下了一次副本,野队,后来人家不带我们玩了。之后就再也没下过副本了。

还好一直都是 200% 的经验,一般是一周一级,最快的时候一周两级。上周六终于 70 了,也买了飞行坐骑玩了一下,好慢呀,60%。不过没钱学 70 级的技能了。

再玩一阵子吧,争取下半年开始欧服吧,不知道什么时候新的资料片发布呢,明年?

QtWebKit 已经支持中文输入法了(Qt 4 每日快照)

ftp://ftp.trolltech.com/qt/snapshots/

从上周起,QtWebKit 已经支持输入法了。

我测试过了 openSUSE Linux 10.3/KDE 4/scim、WINXP SP2/微软 IME 3.0 & 紫光华宇、Mac OS X 10.5.2/默认中文输入法。

可以输入中文了,但是好像在 Linux 和 Windows 下只支持 root window 模式,on the spot 模式还没有支持。

欢迎大家测试。

参考:
有关输入法的一些专业知识,大家可以参考Seamonkey Input Method Specification

QtWebKit 已经支持中文输入法了(Qt 4 每日快照)

ftp://ftp.trolltech.com/qt/snapshots/

从上周起,QtWebKit 已经支持输入法了。

我测试过了 openSUSE Linux 10.3/KDE 4/scim、WINXP SP2/微软 IME 3.0 & 紫光华宇、Mac OS X 10.5.2/默认中文输入法。

可以输入中文了,但是好像在 Linux 和 Windows 下只支持 root window 模式,on the spot 模式还没有支持。

欢迎大家测试。

参考:
有关输入法的一些专业知识,大家可以参考Seamonkey Input Method Specification

Qt and omniORB

PREFACE

About CORBA, please have a look at http://en.wikipedia.org/wiki/Corba.

omniORB is one of the CORBA implementations, please have a look at http://omniorb.sourceforge.net/.

About Qt, please have a look at http://en.wikipedia.org/wiki/Qt_%28toolkit%29.

And there is one add-on, QtCorba, http://trolltech.com/products/qt/addon/solutions/catalog/4/Utilities/qtcorba/, which is for the integration Qt 4.x with ACE/TAO or MICO(another two CORBA implementations). Then main concept in QtCorba is to convert ACE/TAO or MICO events into Qt event, just because they need the main thread to run their own event loop. QtCorba is not open source(it’s commercial product).

I had inquried the omniORB mailing list how to integrate omniORB with Qt 4.x. The core developer of omniORB, Duncan Grisby, gave me a reply on it.

http://www.omniorb-support.com/pipermail/omniorb-list/2008-February/029227.html
omniORB doesn’t have an application-hookable event loop like Mico. it
always uses its own threads to dispatch CORBA calls. You can just use
the main thread to service Qt’s event loop and it will work fine.

Then I tried some code, it works fine.

1. Install omniORB 4.1.1 and run the examples

I am using openSUSE 10.3, gcc 4.2.1 on 32bit PC.

Download: omniORB-4.1.1.tar.gz
http://sourceforge.net/project/showfiles.php?group_id=51138

There are four parts, BUILD omniORB, RUN omniORB EXAMPLES, BUILD Qt, RUN Qt&omniORB EXAMPLES in this article.

BUILD omniORB

cd ~/tmp
mkdir build
tar zxvf omniORB-4.1.1.tar.gz
cd omniORB-4.1.1
./configure -prefix /user
make
sudo make install

Build examples:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
make

Please read Chapter 2 in doc/omniORB.pdf at first.

RUN omniORB EXAMPLES

(1) eg1 is an example which creates a corba object and invokes the method of it in same code.

cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
./eg1

The result should be:
I said, “Hello!”.
The Echo object replied, “Hello!”.

(2) eg2_impl is the server, eg2_clt is the client, they are based on IOR, not need to run omniNames.

In terminal 1, run the server:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
./eg2_impl
IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000068000000010102000f0000003133342e33322e3138352e3232300000f96600000e000000fe23aab24700000562000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100

In terminal 2, run the client:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
./eg2_clt IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000068000000010102000f0000003133342e33322e3138352e3232300000f96600000e000000fe23aab24700000562000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100

Yeap, you should use the IOR:01000…. string as the parameter of client side.

The output of server side:
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!
Upcall Hello!

The output of client side:
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.
I said, “Hello!”.
The Echo object replied, “Hello!”.

And you also can separately run server and client on different machines.

(3) eg3_impl is the server, eg3_clt is the client, they are based on omniNames(the nameing service).

Now we need do something about config file. There is a sample.cfg in ~/tmp/omniORB-4.1.1.

We create a server3.cfg and a client3.cfg in ~/tmp/cfg/.

diff -c sample.cfg server3.cfg
*** sample.cfg 2008-02-13 09:34:57.000000000 +0100
— server3.cfg 2008-02-13 09:54:42.000000000 +0100
***************
*** 329,334 ****
— 329,335 —-
# corbaname URI:
#
# InitRef = NameService=corbaname::my.host.name
+ InitRef = NameService=corbaname::localhost
#
#
# Specify the Trading service and the interface repository using corbaloc:

diff -c sample.cfg client3.cfg
*** sample.cfg 2008-02-13 09:34:57.000000000 +0100
— client3.cfg 2008-02-12 14:27:59.000000000 +0100
***************
*** 329,334 ****
— 329,335 —-
# corbaname URI:
#
# InitRef = NameService=corbaname::my.host.name
+ InitRef = NameService=corbaname::localhost
#
#
# Specify the Trading service and the interface repository using corbaloc:

We create a log directory for omniNames.
cd ~/tmp
mkdir log

In terminal 1, run the omniNames:
export OMNIORB_CONFIG=~/tmp/cfg/server3.cfg
omniNames -start -log ~/tmp/log
(This is for first time to run.)
omniName -log ~/tmp/log
(This is for not first time to run.)

In terminal 2, run the server:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
unset OMNIORB_CONFIG
./eg3_impl

In terminal 3, run the client:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
export OMNIORB_CONFIG=~/tmp/cfg/client3.cfg
./eg3_clt

The output of client side is same as previous case.

If the Nameing Service(omniNames) is not running, then you will get:
./eg3_clt
Caught system exception TRANSIENT — unable to contact the server.

And you also can separately run server and client on different machines.
Please make sure to edit the config file correctly, for example:
You can replace “localhost” with your server’s ip or domain name in server3.cfg and client3.cfg.

(4) The applications are same with previous, but the config file are different, follow an old way.

diff -c sample.cfg server4.cfg
*** sample.cfg 2008-02-13 10:07:09.000000000 +0100
— server4.cfg 2008-02-13 10:23:49.000000000 +0100
***************
*** 329,334 ****
— 329,335 —-
# corbaname URI:
#
# InitRef = NameService=corbaname::my.host.name
+ InitRef = NameService=corbaname::192.168.249.130
#
#
# Specify the Trading service and the interface repository using corbaloc:
***************
*** 1041,1044 ****
# bootstrap agent protocol. This enables interoperability between omniORB
# servers and Sun’s javaIDL clients. When this option is enabled, an
# omniORB server will respond to a bootstrap agent request.
! supportBootstrapAgent = 0
— 1042,1045 —-
# bootstrap agent protocol. This enables interoperability between omniORB
# servers and Sun’s javaIDL clients. When this option is enabled, an
# omniORB server will respond to a bootstrap agent request.
! supportBootstrapAgent = 1

diff -c sample.cfg client4.cfg
*** sample.cfg 2008-02-13 09:34:57.000000000 +0100
— client4.cfg 2008-02-13 10:24:48.000000000 +0100
***************
*** 1042,1044 ****
— 1042,1046 —-
# servers and Sun’s javaIDL clients. When this option is enabled, an
# omniORB server will respond to a bootstrap agent request.
supportBootstrapAgent = 0
+ bootstrapAgentHostname = 192.168.249.130
+ bootstrapAgentPort = 2809

In terminal 1, run the omniNames:
export OMNIORB_CONFIG=~/tmp/cfg/server4.cfg
omniNames -start -log ~/tmp/log
(This is for first time to run.)
omniName -log ~/tmp/log
(This is for not first time to run.)

In terminal 2, run the server:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
unset OMNIORB_CONFIG
./eg3_impl

In terminal 3, run the client:
cd ~/tmp/omniORB-4.1.1
cd src/examples/echo
export OMNIORB_CONFIG=~/tmp/cfg/client4.cfg
./eg3_clt

The output of client side is same as previous case.

BUILD Qt

4.3.3 X11(Open Source or Commercial)

Ignore.

RUN Qt&omniORB EXAMPLES

Based on Duncan Grisby’s reply, first I tried to run the omniORB code in a QThread, it works fine. Then I just run the omniORB code in my GUI code, it also works fine.

(1) eg1.tar.gz, just like the first example in echo.

cd ~/tmp
tar zxvf eg1.tar.gz
cd eg1
ls
echo.cpp echo.h echo.idl eg1.pro main.cpp omniorbthread.cpp omniorbthread.h

echo.h and echo.cpp are generated from echo.idl with omniidl.

omniidl -bcxx echo.idl

It will generate echo.hh and echoSK.cc.

mv echo.hh echo.h
mv echoSK.cc echo.cpp

Then you need to modify the echo.cpp to include “echo.h”, not “echo.hh”.

qmake
make

unset OMNIORB_CONFIG
./eg1

I said, “Hello!”.
The Echo object replied, “Hello!”.
OmniORBThread is over!

(2) eg3.tar.gz, just like the third example in echo.

cd ~/tmp
tar zxvf eg3.tar.gz
cd eg3
qmake
make

ls
client echo.cpp echo.h echo.idl eg3.pro guiclient guiclient2 server

server is a console server application which runs the omniORB code in a thread.
client is a console client application which runs the omniORB code in a thread.
guiclient is a gui client application which runs the omniORB code in a thread.
guiclient2 is a gui client application which runs the omniORB code in main thread.

You can use server3.cfg/client3.cfg or server4.cfg/client4.cfg to run these examples application.

Files
README
cfg
eg1
eg3

体验了一下 openSUSE 的 Build Service

因为看到了别人(swyear)构建的用于 openSUSE 的 wqy 安装包,于是也就体会了一下,hehe。

还是很强大的呀,可以支持 openSUSE 10.3, 10.2、SUSE 10.1、SLE 10, 9、openSUSE Factory、Debian Etch、Fedora 8, 7, 6 with Extras、RHEL 5、CentOS 5、Mandriva 2007, 2006、xUbuntu 7.10, 7.04, 6.06。

openSUSE Build Service

我的目录,hoho。