赤壁怀古
苏 轼
大江东去,浪淘尽、千古风流人物。故垒西边,人道是、三国周郎赤壁。乱石崩云,惊涛裂岸,卷起千堆雪。江山如画,一时多少豪杰!
遥想公瑾当年,小乔初嫁了,雄姿英发。羽扇纶巾,谈笑间、樯橹灰飞烟灭。故国神游,多情应笑我、早生华发,人生如梦,一尊还酹江月。
Thursday, November 26, 2009
Wednesday, November 04, 2009
解决linux下firefox中flash插件乱码问题
解决linux下firefox中flash插件乱码问题, 转自: http://roclinux.cn/?p=1189
在Linux下用Firefox浏览有Flash的网页时,经常碰到有些文字不能正常显示,有些还可能显示乱码,比如Google 的在线音乐播放音乐时,完全显示不了文字。
解决方法很简单,操作如下:
修改/etc/fonts/conf.d/49-sansserif.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- If the font still has no generic name, add sans-serif --> <match target="pattern"> <test qual="all" name="family" compare="not_eq"> <string>sans-serif</string> </test> <test qual="all" name="family" compare="not_eq"> <string>serif</string> </test> <test qual="all" name="family" compare="not_eq"> <string>monospace</string> </test> <edit name="family" mode="append_last"> <string>sans-serif</string> </edit> </match> </fontconfig>
将上面的红色的内容改为:
<string>sans</string>
保存一下,在firefox里刷新一下,问题就解决了。
Sunday, November 01, 2009
雪
《沁园春•雪》(1936年2月) | |
北国风光,千里冰封,万里雪飘。 江山如此多娇,引无数英雄竞折腰。 |
Saturday, October 24, 2009
Tuesday, October 20, 2009
自动构建java jar library path命令
在指定目录运行此命令:
find ./ -name '*.jar'|paste -s -d :
find ./ -name '*.jar'|paste -s -d :
输出:
./spider.jar:./lib/nekohtml.jar:./lib/poi-scratchpad-3.0.1-FINAL.jar:./lib/jdom.jar:./lib/hessian-3.1.5.jar:./lib/hibernate3.jar:./lib/dom4j-1.6.1.jar:./lib/htmlparser.jar:./lib/jetty-6.1.9.jar:./lib/jstl.jar:./lib/log4j-1.2.11.jar:./lib/commons-pool-1.3.jar:./lib/cglib-2.1.3.jar:./lib/mysql-connector-java-5.0.5.jar:./lib/jaas.jar:./lib/chardet.jar:./lib/commons-validator.jar:./lib/standard.jar:./lib/FontBox-0.1.0.jar:./lib/jakarta-oro.jar:./lib/commons-fileupload.jar:./lib/jboss-common.jar:./lib/PDFBox-0.7.3.jar:./lib/commons-httpclient-3.1-rc1.jar:./lib/antlr-2.7.5H3.jar:./lib/antlr.jar:./lib/jboss-cache.jar:./lib/struts.jar:./lib/asm.jar:./lib/connector.jar:./lib/xml-apis.jar:./lib/asm-attrs.jar:./lib/jboss-jmx.jar:./lib/rome-0.9.jar:./lib/c3p0-0.9.0.jar:./lib/jetty-util-6.1.9.jar:./lib/ehcache-1.1.jar:./lib/servlet-api-2.5-6.1.9.jar:./lib/commons-digester.jar:./lib/commons-logging.jar:./lib/cpdet.jar:./lib/bcprov-jdk14-132.jar:./lib/ibatis-2.3.0.677.jar:./lib/jacc-1_0-fr.jar:./lib/eucita-common-0.7.1.jar:./lib/lucene-core-2.3.0.jar:./lib/commons-collections-2.1.1.jar:./lib/xerces-2.6.2.jar:./lib/commons-dbcp-1.2.2.jar:./lib/commons-lang-2.3.jar:./lib/poi-3.0.1-FINAL.jar:./lib/icu4j-3_8.jar:./lib/proxool-0.8.3.jar:./lib/jboss-system.jar:./lib/oscache-2.1.jar:./lib/db4o-6.3-java5.jar:./lib/concurrent-1.3.2.jar:./lib/commons-logging-1.0.4.jar:./lib/jgroups-2.2.8.jar:./lib/mail-1.4.jar:./lib/commons-beanutils.jar:./lib/swarmcache-1.0rc2.jar:./lib/jdbc2_0-stdext.jar:./lib/log4j-1.2.9.jar:./lib/jaxen-1.1-beta-7.jar:./lib/commons-codec-1.3.jar:./lib/bcmail-jdk14-132.jar:./lib/jta.jar
这样就可以自动构建java 的library path
Saturday, October 10, 2009
Wednesday, October 07, 2009
Saturday, October 03, 2009
宝宝出生了
09-27(农历8月初九), 宝宝出生了, 顺产的, 男婴,3880g,51cm,
很激动, 升级了!
名字暂定:李涵予
就在这里记录宝宝的成长吧
--
BeiJing China
小楼听雨
Blog: http://xlty.blogspot.com
很激动, 升级了!
名字暂定:李涵予
就在这里记录宝宝的成长吧
--
BeiJing China
小楼听雨
Blog: http://xlty.blogspot.com
Friday, September 25, 2009
更改Trac同步发送mail问题
修改: trac/notification.py文件, 找到Notify.notify(self, resid)行: 改为:
trigger = self
from threading import Thread
def run():
Notify.notify(trigger, resid)
Thread(target=run).start()
Tuesday, September 15, 2009
进度条简单实现
<html>
<body>
<style>
.lhcl_storagecluster_gauge {
background-color:#F4F6FF;
border:1px solid #668CD9;
height:20px;
width:50px;
}
</style>
<div class="lhcl_storagecluster_gauge" id="lhid_storagecluster_gauge" style="width: 56.75px; border-left-width: 11.25px;"/>
</body>
</html>
Wednesday, September 02, 2009
shelve
import shelve d = shelve.open(filename) # open -- file may get suffix added by low-level # library d[key] = data # store data at key (overwrites old data if # using an existing key) data = d[key] # retrieve a COPY of data at key (raise KeyError if no # such key) del d[key] # delete data stored at key (raises KeyError # if no such key) flag = d.has_key(key) # true if the key exists klist = d.keys() # a list of all existing keys (slow!) # as d was opened WITHOUT writeback=True, beware: d['xx'] = range(4) # this works as expected, but... d['xx'].append(5) # *this doesn't!* -- d['xx'] is STILL range(4)! # having opened d without writeback=True, you need to code carefully: temp = d['xx'] # extracts the copy temp.append(5) # mutates the copy d['xx'] = temp # stores the copy right back, to persist it # or, d=shelve.open(filename,writeback=True) would let you just code # d['xx'].append(5) and have it work as expected, BUT it would also # consume more memory and make the d.close() operation slower. d.close() # close it
Thursday, August 13, 2009
Wednesday, August 05, 2009
trac源代码阅读 - 5 python operators
__add__ == +
>>> class a(object):
... def __or__(self, t):
... return id(t)
... def __add__(self, t):
... return id(t)
...
>>> c = a()
>>> a()+c
13041552
>>> id(c)
13041552
__sub__ == -
>>> class a(object):
... def __or__(self, t):
... return id(t)
... def __add__(self, t):
... return id(t)
...
>>> c = a()
>>> a()+c
13041552
>>> id(c)
13041552
__sub__ == -
>>> class a(object):
... def __or__(self, t):
... return id(t)
... def __add__(self, t):
... return id(t)
... def __sub__(self, t):
... return id(t)
...
>>> c = a()
>>> a()-c
13041552
>>> id(c)
13041552
>>> a()-c
13041552
>>> id(c)
13041552
why? will continue in next post.
trac源代码阅读 - 4 ("|" or operator)
__or__ == |
Error:
>>> a={'a':1, }
>>> b = lambda x: x*2
>>> a | b
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'dict' and 'function'
the first object must has "__or__" method
Right:
>>> class a(object):
... def __or__(self, t):
... return id(t)
...
>>> c = a()
>>> d = a()
>>> c|d
13041232
>>> id(c)
13041264
>>> id(d)
13041232
>>> c|""
12492856
Example: (Transformer)
Tuesday, August 04, 2009
innerHTML中, p包含ul的问题
一个dom节点给他innerHTML="<p class='temp'><ul><li>test</li></ul></p>", 其中temp的样式为: .temp {display:none;}, 此时ul元素会被解析到p标签之外, IE, FF, Chrome都是如此, BUG or Standard?
Wednesday, July 22, 2009
trac代码阅读3 - upgrade database
重写IEnvironmentSetupParticipant中的三个方法, 然后记得在__init__.py中import 你的IEnvironmentSetupParticipant实现, 此时安装并启用插件之后, 就会出现: trac-admin /path/to/trac upgrade的提示
Saturday, July 18, 2009
trac代码阅读2 - yield expressions
例:
def test(value = None):
i = value or 0
while i < 100:
yield i
i += 1
=============>>>>>
>>> s.next()
0
>>> s.next()
1
>>> s.next()
2
>>> s.next()
3
由外部逻辑控制此generator function的执行, we called it: Semi-Coroutine
Thursday, July 16, 2009
Tuesday, June 30, 2009
Automatic change your IP address in windows
netsh interface ip set address name="本地连接" source=static addr=192.168.0.8 mask=255.255.255.0
netsh interface ip set address name="本地连接" gateway=192.168.0.1 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=202.106.0.20 register=PRIMARY
netsh interface ip add dns name="本地连接" addr=202.102.152.3 index=2
netsh interface ip add dns name="本地连接" addr=210.82.5.1 index=3
netsh interface ip set wins name="本地连接" source=static addr=none
netsh interface ip set address name="本地连接" gateway=192.168.0.1 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=202.106.0.20 register=PRIMARY
netsh interface ip add dns name="本地连接" addr=202.102.152.3 index=2
netsh interface ip add dns name="本地连接" addr=210.82.5.1 index=3
netsh interface ip set wins name="本地连接" source=static addr=none
Saturday, June 20, 2009
selenium 1.0发布了
一直关注selenium, 但是他的脚本录制功能对js的操作始终是无能为力, selenium 1.0发布之后, 通过试用, 对效果依然感到失望:(,
倒是HtmlUnit, 他的js支持, 包括js框架的支持都是相当不错的, 缺点就是要用java写UI测试用例:(,
自己动手写一个?
Sunday, May 31, 2009
Thursday, May 28, 2009
Sunday, April 05, 2009
Sunday, March 22, 2009
Sunday, March 15, 2009
Friday, March 13, 2009
Sunday, March 08, 2009
Saturday, March 07, 2009
Friday, February 27, 2009
Java编码转换核心
String encoding = "gb2312";
byte b[] = "你".getBytes("gb2312");
byte b[] = "你".getBytes("gb2312");
ByteToCharConverter convertor =
ByteToCharConverter.getConverter(encoding);
//将byte转到制定编码
char[] c = convertor.convertAll(b);
for (int i = 0; i < c.length; i++) {
System.out.println(c[i]+"--");
}
Saturday, February 14, 2009
Tuesday, January 06, 2009
使用 Google Gears 开发离线应用
具体参见: http://docs.google.com/Doc?id=df2zxqbz_437dfp48jgq, google
blog的格式太烂了, 还是用docs好点.
blog的格式太烂了, 还是用docs好点.
Thursday, January 01, 2009
Subscribe to:
Posts (Atom)