星期六 2004年07月03日
Seti@home and thinging
About two year ago, I have used several pc and my laptop computing seti for about one year, and finish computing 1982 units and need near 13 hours one unit.
Two months ago, I use another mail account to start new computing set units. and now the average time for one unit is less than 2 hours.
The hardware is evolving quickly than you can think. So as to the technique java related. The most attention two years ago maybe design pattern, mvc framework, EJB2.0 or so. Now it's very different, everyone is talking about POJO, IOC, Spring, AOP.
Will we chase new tech for ever? Will the J2EE fields too crowd? Will the client need so much tech?
七月 03, 2004 11:53 下午 GMT+08:00
Permalink
Never use hibernate JTATransaction implemention because it's wrong
Commonly, JTATransaction shall be used as
the following:
Lookup
UserTransaction and begin transaction
get Connection
from DS and do something and close the connection
get Connection
from DS and do something and close the connection
...
commit or
roolback
So, you can see only the connection as
opened after jtaTransaction started will be managed by the Transaction.
But In Hibernate, The Transaction is new by
a parameter Session.
JTATransaction(SessionImplementor session)
You can see the JTATransaction is based on
the session.
So if the session has already connected,
the connection can't been managed by the transaction.
So it is realy realy wrong.
The right flow to use JTATransaction
through hibernate shall like the following:
Lookup UserTransaction
and begin transaction
get hibernate session
and do something and flush
...
commit or rollback
So the better way is use cmt SessionBean.
七月 03, 2004 01:06 上午 GMT+08:00
Permalink
This blogs not support Chinese Character????
When in edit mode, The Chinese character can be displayed OK. But in view
mode, The title is OK, but when click and enter, the content is not right.
Just as Frederic Jean said, When i set the utf-8 encoding of my browser,
the content display OK! But This is not convenient for most Chinese
people because there default character encoding is GBK.
Now found it can be se by myself at the header part of setting.
Thanks for Frederic Jean.
七月 02, 2004 04:09 下午 GMT+08:00
Permalink
ZipInputStream不能正确处理中文文件名
java的java.uti.zip包中,对中文文件名的处理都是按照Unicode的方式去处理的
它内部在取ZipInputStream.getNextEntry()时是调用的getUTF8String()取文件名。
因此如果压缩包中的文件名是非unicode编码的,则不可避免的回抛出异常
IllegalArgumentException
而就目前所知:
winRAR、winzip等压缩软件都是将中文文件名按照GBK进行的编码,因此会出现这样的错误。
说来也有趣,本来这里写的就是java.util.zip关于中文的的问题,结果它自己也是有中文的问题。
归根到底还是unicode没有成为大家通用的缺省的字符集。
昨天不用utf-8的encoding,还是乱码,今天就好了。
在今天的header中有如下:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
最后发现,是在自己的settings中,可以自己修改各个header、footer、css等,只需在header中将utf-8设置好即可。
应cytihuntor要求,把我的理解描述一下,也不知是否正确:
在Setting->Themms先设置自己的theme.
然后在Pages中分别选择_header和Weblog,看起header中有无以下类似的,没有则自己添加:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
七月 02, 2004 03:32 下午 GMT+08:00
Permalink