2007年5月31日星期四

compatibility options

1. compatibility options in word8 filter
ww8par.cxx: rDoc.set(IDocumentSettingAccess::PARA_SPACE_MAX, pWDop->fDontUseHTMLAutoSpacing);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES, true );
ww8par.cxx: rDoc.set(IDocumentSettingAccess::TAB_COMPAT, true);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::USE_VIRTUAL_DEVICE, !pWDop->fUsePrinterMetrics);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::USE_HIRES_VIRTUAL_DEVICE, true);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::ADD_FLY_OFFSETS, true );
ww8par.cxx: rDoc.set(IDocumentSettingAccess::ADD_EXT_LEADING, !pWDop->fNoLeading);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::OLD_NUMBERING, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::OLD_LINE_SPACING, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS, true);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::USE_FORMER_OBJECT_POS, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION, true);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING, false);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::TABLE_ROW_KEEP, true); //SetTableRowKeep( true );
ww8par.cxx: rDoc.set(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, true);
ww8par.cxx: rDoc.set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION, rTypo.fKerningPunct);

2. in writer setting:
search IDocumentSettingAccess in sw/source/ui/config, got:
source/ui/config/optcomp.cxx
SwCompatibilityOptPage

search COMPATIBILITY_DEFAULT_NAME in go-oo.org, got:
svtools/inc/svtools/compatibility.hxx

search ConsiderWrappingStyle in user directory for oo, got:
registry/data/org/openoffice/Office/Compatibility.xcu:

2007年5月30日星期三

text grid bug2 2007-05-30

1. when switch page mode, the page area is change now

2. when import the old document, the page mode is not right

有所为

人过留名,鸟过留声,
作为男人,更有所为,有所不为。
如果才能做到有所为,有所不为呢?

2007年5月29日星期二

Word 2003、Word 2002 和 Word 2000 中“选项”对话框中的“兼容性”选项说明

http://support.microsoft.com/kb/288792/zh-cn

概要

本文介绍了在 Microsoft Word 中选项对话框中的兼容性选项。

注意:要更改兼容性选项,请单击工具菜单上的选项,然后单击兼容性选项卡。

回到顶端

更多信息

字体替换

使用此选项可用系统中提供的字体替换当前文档中不可用的字体。

回到顶端

推荐的选项用于

使 用此选项可更改 Word 用于显示和打印当前文档的格式规则。可以从下拉列表中选择与以前版本的 Word 或其他文字处理程序的行为相匹配的选项集,也可以对本文后面列出的个别选项做出自定义选择。兼容性选项将与 Word 文档一起保存。“兼容性”选项只能控制 Word 对文档的布局方式。这些选项不会将文档转换为其他文字处理程序的格式,也不会更改文档的结构。

回到顶端

选项

选择您想要在活动文档中显示的选项。只有在 Word 中处理文档时,选定的选项才会影响该文档的显示。文档不会被永久更改。

为下划线添加间距:使用此选项可为下划线添加额外的间距。

在表格中将行高调至网格高度:此选项打开时,表格的行高将与文档网格对齐。在中文文本中使用。

独立对齐表格行: 未选择此选项时,居中排列或右对齐的不换行表格将整体对齐,而不更改各行之间的相对位置。选中此选项时,居中排列或右对齐的不换行表格中的各个行将单独地 居中排列或右对齐。例如,右对齐的不换行表格中各行的右边缘会对齐 -- 即使该表格为左对齐时右边缘未对齐亦是如此。

允许表格行分开展示:使用此选项可将不换行表格的行为确定为:在换行对象的右侧进行布局并扩展到换行对象的下方。如果未选择此选项,则表格的其余部分将放置到该表格第一部分的右外侧。如果选择了此选项,则允许该表格的其余部分回到左侧。

允许表格扩充边距: 此选项是 Microsoft Office Word 2003 的新增选项。使用此选项将会保留扩展到文档边距之外的表格设置,而不使用自动调整功能将表格放在边距之内。在除 Word 2003(已内置此选项)之外的所有列出的 Word 版本的工具->选项->兼容性下,都自动启用了此选项。

按 Word 95 方式自动调整间距:使用此选项可确定在中文 Word 95 文档中文本行的分行方式(自动换行)。

区分半角字符和全角字符:在美国英语版 Word 中不使用。

按 Word 5.x for the Macintosh 的方式合并表格边框:如果某个表格包含两个连续的单元格,而其边框的格式各不相同,则最左侧的单元格将以最右侧单元格的边框宽度显示。

将反斜杠字符转换为日元符:在美国英语版 Word 中不使用。

按 WordPerfect 6.x for Windows 进行全面调整:为了进行全面调整,WordPerfect 会在 Word 扩展文字时压缩文字间的空格。这通常会产生不同的分行符和不同的分页符。要实现 WordPerfect 调整方法,请在选项列表中选择“按 WordPerfect 6.x for Windows 进行全面调整”。

不为悬挂式缩进添加自动制表位:使用此选项可忽略 Word 6.0 在创建悬挂式缩进时所使用的自动制表位。

不为升高或降低的字符添加空格:使用此选项可防止 Word 为了容纳升高或降低的字符而在行间插入多余空格。

不在正文行之间添加前导字符(多余空格):使用此选项,在显示文本时将不会在行间添加前导字符。此功能与 Word 5.x for the Macintosh 版本中的功能相同。

对字符网格不允许标点溢出边界:使用此选项可防止在启用了字符网格时,在中文文本中使用标点符号。此选项适用于 Microsoft Word 2002 和 Word 2003。

不在接续节的起始位置平衡栏:使用此选项可防止 Word 在某一节或文档的结尾位置平衡栏。

不将图元文件图片后的区域清空:使用此选项可防止 Word 将已插入图元文件周围的任何文本或图片遮蔽起来。选择此选项会降低编辑速度。

不允许表格跨页分断:这是 Word 2002 和 Word 2003 中的一个选项。使用此选项可防止换行表格跨页分断。注意:“允许跨页断行”选项在换行表格中无效。

不将设有“固定行高”的行居中:使用此选项可更改文本在行距的顶端和底部之间的垂直位置。在关闭此选项的情况下,任何额外间距都在上行字母与下伸字母之间平分。在打开此选项的情况下,所有额外间距都归于下伸字母。

不加宽以 Shift + Enter 结尾的行中的字符间距:如果“对齐的”文本行以 Shift + Enter 结尾,则 Word 可防止字词之间出现额外间距,而且可使该行显示为“左对齐”。

在带有内嵌对象的表格内不将文字与网格线对齐:这是 Word 2002 和 Word 2003 中的一个选项。使用此选项可防止 Word 在表单元格中插入“文本内嵌”对象时允许表单元格中的中文文字与字符网格对齐。

对字符网格不使用中文规则分行:这是 Word 2002 和 Word 2003 中的一个选项。使用此选项可使中文文本在打开字符网格时,按照较早版本的 Word 中的方式进行分行。

不使用 HTML 段落自动调整间距:此选项有两个功能:
如果将段前/段后间距设置为自动,并打开了此选项,则 Word 会将段前/段后间距调整为 5 磅。
在此选项关闭(默认设置)的情况下,Word 会将段落之间的间距设置为段前/段后间距中较大的值。在此选项打开的情况下,Word 会在段落之间同时使用段前/段后间距的值。此功能与较早版本的 Word 中的功能相同。
为尾部空格添加下划线:在美国英语版 Word 中不使用。

按点阵加宽或紧缩:使用此选项可通过紧缩或加宽间距,将对字符间距的测量四舍五入到最近的整数。

忽略上一制表位对齐方式:使用此选项可强制行结尾处的制表位设置按照 Word 97 中的方式设置。

按 Word 97 的方式排放自选图形:当应用了“顶部和底部”环绕样式的自选图形显示在页面底部时,Word 会强制该自选图形位于文本下方。

按 Word 6.x/95/97 的方式排放脚注:使用此选项可按照较早版本的 Word 中的方式放置脚注。

用原始宽度规划表格:使用此选项可使 Word 确定表格的宽度(表宽度 + 表缩进)并防止在过小的区域中规划表格。使用此选项可防止表格在浮动对象旁边对齐时被剪短(在边上被切断)或者脱离页面。

按 Word 6.0 的方式换行:在美国英语版 Word 中不使用。

先打印正文,然后打印页眉/页脚:使用此选项,可先打印正文层,然后打印页眉/页脚层,这样便允许对文本层中 PostScript 代码的处理与 Word 5.x for the Macintosh 的处理方式相同。(此功能是对默认顺序的颠倒。)

在普通打印机上将彩色打印为黑色:使用此选项,可在使用不能打印彩色的打印机时,将所有彩色打印为黑色,而不使用灰度(灰度梯度)。

选定带有首尾字符的整个域:这是 Word 2002 和 Word 2003 中的一个选项。使用此选项,可在选择域结果的首字符或尾字符时选择整个域。在显示域代码时,此选项不起作用。

按 WordPerfect 5.x 设置空格宽度:WordPerfect 计算比例字体的空格宽度的方式与 Word 不同。在 WordPerfect 界面中,此默认字间距被称为 WordPerfect Optimal。Word 97 文字转换器可对间距使用 WordPerfect 公式。

在图文框中显示硬分页或分栏符:如果某个帧包含一个手动的或硬的分页符或分栏符,则 Word 可以显示它。

根据字号替换字体:WordPerfect 6.x 转换器使用此选项可首先根据字体大小生成一个字体请求,如果找不到匹配项,则实际映射该字体。

在页面底部取消多余行距:WordPerfect 可从页面的最后一行中取消任何多余行距。例如,如果将行距设置为双倍,则该页的最后一行将不在其下显示空白。要实现行距功能,请在选项列表中选择“在页面底部取消多余行距”。

取消页面顶部的附加行距:使用此选项可防止 Word 在页面顶部添加多余的行距。如果将页面顶部行的行距设置为大于单倍行距,则 Word 会忽略多余行距,这样上边距就不会增加。

按 Word 5.x for the Mac 的方式取消页面顶部多余的行距:使用此选项可防止 Word 在页面顶部添加多余的行距。如果将页面顶部行的行距设置为大于单倍行距,则 Word 会忽略多余行距,这样上边距就不会增加。

按 WordPerfect 5.x 的方式取消多余行距:使用此选项,可确保使用自动行高进行格式化的已转换 WordPerfect 文档的布局与原始文档的布局非常接近。

取消硬分页符或分栏符前后的空格:使用此选项,可取消在使用段前间距选项进行格式化的段落中分页符或分栏符后面的空格。

在奇数对开页上交换左右边界:如果某一段落具有左边界(不是框)并且选中了奇数页/偶数页页眉不同对称页边距复选框,则 Word 会打印奇数页上的右边界。

在邮件合并数据源中将 \" 视为 "":在数据源中,使用此选项可将由一个反斜杠和一个双引号组成的分隔符 (\") 转换为两个双引号 (" "),这样 Word 就可以识别双引号。

截断字体高度:使用此选项可将字体大小四舍五入,与 WordPerfect 6.x for Windows 中相同。

按 Word 5.x for the Macintosh 的方式使用较大的小型大写字母:使用此选项可将 Word 6.0 for the Macintosh 版本中的小型大写字母格式按照 Word 5.x for the Macintosh 版本中的方式应用,这样可以生成稍大的小型大写字母。

使用换行规则:这是 Word 2002 和 Word 2003 中的一个选项。使用此选项可控制泰语文档中的换行符。

用打印机标准设计文档版式:如果选择了此选项,则 Word 将使用已安装的打印机驱动程序中的信息,与某些较早版本的 Word 相同。如果关闭了此选项(默认),则 Word 将使用内置标准来设计文档版式。这意味着您的文档看起来是相同的,不论安装了什么样的打印机驱动程序。

使用 Word 2002 表格样式规则:此选项是 Word 2003 中的新增选项。使用此选项将保留在 Word 2002 中使用的表格样式的布局兼容性。

使用 Word 6.x/95 边框规则:使用此选项,可在段落与窗体相交或围绕绘图对象时取消段落边框。

对中文文字使用 Word 97 换行规则:使用此选项可对中文文字使用 Word 97 换行规则。

将尾部空格移入下一行:使用此选项,可自动将行末尾处的字后面的边距中的尾部空格移到下一行的开头。

回到顶端

默认

使用此选项可将选项列表中的当前设置存储为新的默认兼容性选项。

回到顶端

2007年5月28日星期一

自暴自弃

li最近一段时间,感觉自己越来越堕落,什么都不想干,没有目标,没有行动,没有激情,任时间一秒一妙地过去,让生命一天一天地流逝。

1. blog uof-ooxml project announce by MS
2. plan for UOF-filter

2007年5月25日星期五

python tutorial 1

环境变量
系统shell查找路径(用于发现“python"): PATH
python模块查找路径(用于导入):PYTHONPATH
python交互启动文件路径:PYTHONSTARTUP
GUI扩展变量(Tkinter): TCL_LIBARAY, TK_LIBRARY


内置类型对象
number : 123, 3.12, 99L, 0x9ff, 0177, 4+3j, 4.0e+10
string: 'spam', "don't"
list: [1, [2, 'three'], 4]
dictionary: {'food':'spam', 'taste': 'yum'}
tuple: (1, 'spam', 4, 'U')
file: text = open('egg', 'r').read()

text grid bug fixed

1. type are changes when switch page mode
sw/source/core/layout/atrfrm.cxx

2. Modify SwDoc::SetDefaultPageMode
sw/source/core/doc/docdesc.cxx

2007年5月24日星期四

厚积薄发

已当人父,但每天还是跟以前一样,没有上进。为什么呢?
1. 没有目标,更没有理想
2. 自控能力差
3. 没有坚定的信念,很多事情总是半途而废

2007年5月23日星期三

2007年5月22日星期二

linux下强大的编辑器工具vi使用技巧

一、vi基本命令

1)光标命令

左h 上j 下k 右l

nG ——n为行数,该命令立即使光标跳到指定行;n为空,光标跳到文件最后一行。

Ctrl+G——光标所在位置的行数和列数报告

w,b——使光标向前或向后跳过一个单词

2)编辑命令

(n)dd 删除

(n)yy 复制

i 光标前插入

a 当前字母后插入

r 在当前光标处替换

cw 替换光标所在处的单词(从光标开始处)

dw 删除光标所在处的单词

x 删除(右)

X 删除(左)

u 撤销

. 重复上次操作

o 插入新行

J 合并两行

A 行尾

:.,3w /tmp/xx

:r /tmp/xx

3)查找命令

f 查找

/ 查找

4)复制粘贴命令

(n)yy 拷贝n行到剪切板

p 粘贴(后)

P 粘贴(当前)

二、vi选项设置

vi是一个强大的编辑器,它不仅可以用来处理我们平时的文本工作,还可以用来写程序文件。在用vi进行程序编辑时,它可以实现语法加亮显示、自动缩进、括号匹配等编辑功能。为控制不同的编辑功能,vi 提供了很多内部选项。

利用 :set 命令可以设置选项。基本语法为:

: set option 设置选项 option

常见的功能选项包括:

autoindent 设置该选项,则正文自动缩进

ignorecase 设置该选项,则忽略规则表达式中大小写字母的区别

number 设置该选项,则显示正文行号

ruler 设置该选项,则在屏幕底部显示光标所在行、列的位置

tabstop 设置按 Tab 键跳过的空格数。例如:set tabstop=n,n默认值为8

1)语法加亮显示

: syntax on 该命令在vi中打开语法加亮显示的功能。这样以后在输入的字符中,vi就会自动的识别出关键字,字符串以及其他的一些语法元素,并以不同的颜色来显示出来。

2)自动缩进

在vi中自动缩进的选项一般有以下的几种:

autoindent: 在这种缩进形式中,新增加的行和前一行有相同的缩进形式。

smartindent: 在这种缩进模式中,每一行都和前一行有相同的缩进量,同时能够正确的识别出{和},当遇到右花括号(}),则取消了缩进形式。此外还增加了识别C语言关键 字的功能。如果一行是以#开头的,那么这种格式将会被特殊对待而不采用缩进格式。这种缩进格式强于autoindent。

cindent:这是C语言的缩进形式,采用这样的缩进方式的程序语言有:C,C++,Java等。当采用这种缩进格式时,vi就会自动的采用标准的C语言形式。这种缩进格式强于smartindent。

可以用如下命令进行缩进形式的设置:

:set autoindent(ai)

:set smartindent(si)

:set cindent(ci)

3)显示行号

:set number(nu) 显示行号

: set nonumber (nonu) 不显示行号

在每个用户的目录下,都有一个vi的配置文件".vimrc"(没有的话可以自己创建)。用户可以编辑它,输入以上命令,使这些设置在每次vi时都有效。例如:在.vimrc文件中加入如下设置行:

set nu #显示行号

set nonu #不显示行号

set ic #查找时不考虑大小写

set noic #查找时考虑大小写

set smartindent #自动缩进

syntax on #语法加亮

2007年5月22日 星期二

* vi setttings
** set number
** syntax on

* 好习惯 1 的示例:使用一个命令来定义目录树
mkdir -p tmp/a/c

* 好习惯 1 的另一个示例:使用一个命令来定义复杂的目录树
mkdir -p project/{lib/ext, bin, src, doc/{html, pdf, xml}, demo/stat/a}

* 解压缩到指定目录
tar xvf -C tmp/a newdoc.tar.gz

* 当第一个命令成功,才执行下一个命令
~ $ cd tmp/a/b/c && tar xvf ~/archive.tar

* 当第一个命令失败后,才执行下一个命令

cd tmp/a/b/c || mkdir tmp/a/b/c

Meeting:
Last week, I commited the codes of text grid to my cws. and waited for Sun guy's review. today, I got Sun guy gave his comments.
and I will fix the bugs this week.
Lask week, I began to work on other CJK functions. such as compatibility tab page. I called Zhang Yun
for more information about these cjk functions. He will give me some documents in the coming days.




2007年5月21日星期一

2007年5月21日 星期一

* ooo-build break in x64
* odfpy
** unicode problem
* setup vmware
* compatibility tag page
** investigate the behavior

* Python
** unicode( [object[, encoding [, errors]]]) : return the Unicode string version of object
*** If no optional parameters are given, unicode() will mimic the behaviour of str() except that it returns Unicode strings instead of 8-bit strings.

What is encoding, unicode, decoding:
encoding
unicode ------> a sequences of bytes
<------
decoding

2007年5月17日星期四

Python : Modules

* create a file called fibo.py
# Fibonacci numbers module

def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < b =" b," result =" []" b =" 0," b =" b,">>> import fibo
>>> fibo.fib(1000)
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
>>> fibo.fib2(100)
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
>>> fibo.__name__
'fibo'

>>> from fibo import fib, fib2
>>> fib(500)
1 1 2 3 5 8 13 21 34 55 89 144 233 377

* Modules search path
PYTHONPATH

* Standard modules
** sys
** dir
>>> import fibo, sys
>>> dir(fibo)

* Packages
Sound/ Top-level package
__init__.py Initialize the sound package
Formats/ Subpackage for file format conversions
__init__.py
wavread.py
wavwrite.py
aiffread.py
aiffwrite.py
auread.py
auwrite.py
...
Effects/ Subpackage for sound effects
__init__.py
echo.py
surround.py
reverse.py
...
Filters/ Subpackage for filters
__init__.py
equalizer.py
vocoder.py
karaoke.py
...

The __init__.py files are required to make Python treat the directories as containing packages;

两种方法 增强OpenOffice的扩展功能

http://publish.it168.com/2007/0516/20070516004201.shtml
【IT168 软件技巧】像Firefox一样,我们也可以为OpenOffice.org 安装扩展软件来增强其功能。本文将介绍两个OpenOffice.org Writer 的扩展。

首先以扩展 Annotation Tool 为例,介绍OpenOffice.org 的扩展如何安装。(点击此处下载文件)。在OpenOffice.org Writer中,打开“工具——扩展管理器”对话框,点击“添加”按钮,找到刚才下载的文件,确定,扩展即安装成功,重启OpenOffice.org Writer 后生效。

Annotation Tool 解决了OpenOffice.org 内置的“插入——备注”功能的两个不足:不能将添加备注的文字标记为高亮字体,不能一次删除所有的备注。安装这个扩展后,这两个问题得到了解决。

微软Office 2007中增加了将文档发布到博客中的功能,OOOBlogger 就是能让OpenOffice.org也具有同样功能的扩展。(点击此处下载)

安装重启OpenOffice.org 后,就能在顶部看到“Blog”下拉菜单:

点击“Blog Settings”将会出现如下设置对话框。

Python: Design pattern

* The Singleton
#: c01:SingletonPattern.py

class OnlyOne:
class __OnlyOne:
def __init__(self, arg):
self.val = arg
def __str__(self):
return ´self´ + self.val
instance = None
def __init__(self, arg):
if not OnlyOne.instance:
OnlyOne.instance = OnlyOne.__OnlyOne(arg)
else:
OnlyOne.instance.val = arg
def __getattr__(self, name):
return getattr(self.instance, name)

x = OnlyOne('sausage')
print x
y = OnlyOne('eggs')
print y
z = OnlyOne('spam')
print z
print x
print y
print ´x´
print ´y´
print ´z´
output = '''
<__main__.__OnlyOne instance at 0076B7AC>sausage
<__main__.__OnlyOne instance at 0076B7AC>eggs
<__main__.__OnlyOne instance at 0076B7AC>spam
<__main__.__OnlyOne instance at 0076B7AC>spam
<__main__.__OnlyOne instance at 0076B7AC>spam
<__main__.OnlyOne instance at 0076C54C>
<__main__.OnlyOne instance at 0076DAAC>
<__main__.OnlyOne instance at 0076AA3C>
'''
#:~

#: c01:NewSingleton.py

class OnlyOne(object):
class __OnlyOne:
def __init__(self):
self.val = None
def __str__(self):
return ´self´ + self.val
instance = None
def __new__(cls): # __new__ always a classmethod
if not OnlyOne.instance:
OnlyOne.instance = OnlyOne.__OnlyOne()
return OnlyOne.instance
def __getattr__(self, name):
return getattr(self.instance, name)
def __setattr__(self, name):
return setattr(self.instance, name)

x = OnlyOne()
x.val = 'sausage'
print x
y = OnlyOne()
y.val = 'eggs'
print y
z = OnlyOne()
z.val = 'spam'
print z
print x
print y
#

output = '''
<__main__.__OnlyOne instance at 0x00798900>sausage
<__main__.__OnlyOne instance at 0x00798900>eggs
<__main__.__OnlyOne instance at 0x00798900>spam
<__main__.__OnlyOne instance at 0x00798900>spam
<__main__.__OnlyOne instance at 0x00798900>spam
'''
#:~

#: c01:BorgSingleton.py
# Alex Martelli's 'Borg'

class Borg:
_shared_state = {}
def __init__(self):
self.__dict__ = self._shared_state

class Singleton(Borg):
def __init__(self, arg):
Borg.__init__(self)
self.val = arg
def __str__(self): return self.val

x = Singleton('sausage')
print x
y = Singleton('eggs')
print y
z = Singleton('spam')
print z
print x
print y
print ´x´
print ´y´
print ´z´
output = '''
sausage
eggs
spam
spam
spam
<__main__.Singleton instance at 0079EF2C>
<__main__.Singleton instance at 0079E10C>
<__main__.Singleton instance at 00798F9C>
'''
#:~

2007年5月17日 星期四

* Setup 64-bit system
** backup my personal files
** try to resize the partision, but failed, prompt to umount /home
** reboot and login as root, success to umount /home
* Python

2007年5月16日星期三

Python: A quick start

* Python overview
#: c01:if.py
response = "yes"
if response == "yes":
print "affirmative"
val = 1
print "continuing..."
#:~

* Built-in containers
#: c01:list.py
list = [ 1, 3, 5, 7, 9, 11 ]
print list
list.append(13)
for x in list:
print x
#:~

* Functions
#: c01:myFunction.py
def myFunction(response):
val = 0
if response == "yes":
print "affirmative"
val = 1
print "continuing..."
return val

print myFunction("no")
print myFunction("yes")
#:~

#: c01:differentReturns.py
def differentReturns(arg):
if arg == 1:
return "one"
if arg == "one":
return 1

print differentReturns(1)
print differentReturns("one")
#:~

#: c01:sum.py
def sum(arg1, arg2):
return arg1 + arg2

print sum(42, 47)
print sum('spam ', "eggs")
#:~

* String
#: c01:strings.py
print "That isn't a horse"
print 'You are not a "Viking"'
print """You're just pounding two
coconut halves together."""
print '''"Oh no!" He exclaimed.
"It's the blemange!"'''
print r'c:\python\lib\utils'
#:~

#: c01:stringFormatting.py
val = 47
print "The number is %d" % val
val2 = 63.4
s = "val: %d, val2: %f" % (val, val2)
print s
#:~

* Class
#: c01:SimpleClass.py
class Simple:
def __init__(self, str):
print "Inside the Simple constructor"
self.s = str
# Two methods:
def show(self):
print self.s
def showMsg(self, msg):
print msg + ':',
self.show() # Calling another method

if __name__ == "__main__":
# Create an object:
x = Simple("constructor argument")
x.show()
x.showMsg("A message")
#:~

** Inheritance
#: c01:Simple2.py
from SimpleClass import Simple

class Simple2(Simple):
def __init__(self, str):
print "Inside Simple2 constructor"
# You must explicitly call
# the base-class constructor:
Simple.__init__(self, str)
def display(self):
self.showMsg("Called from display()")
# Overriding a base-class method
def show(self):
print "Overridden show() method"
# Calling a base-class method from inside
# the overridden method:
Simple.show(self)

class Different:
def show(self):
print "Not derived from Simple"

if __name__ == "__main__":
x = Simple2("Simple2 constructor argument")
x.display()
x.show()
x.showMsg("Inside main")
def f(obj): obj.show() # One-line definition
f(x)
f(Different())
#:~

2007年5月16日 星期三

* Status report

* Read GullFOSS
** presentation for linux build
http://de.openoffice.org/files/documents/66/3980/build-ooo-howto-linux-x86-pres-en.odp

* English
** non-profit association
** attendees
** a short introduction into sth
** give a brief review
** talk about
** a brilliant demonstration
** that was really well done
** in general, 总之
** productive, informative,富有成效, 大开眼界的
** manageable, 可控的
** a descruptive technology,制造混乱的
** stumble over : 绊倒
** counter A with B, 用B来反击A

* 企业应该专注,个人也更应该专注:
企业应当专注,轻易“多元化”会稀释品牌的力量,妨碍强势品牌的诞生,“典型案例就是戴尔专注于个人电脑,英特尔专注于芯片,微软专注于电脑软件,而日本富士通则个人电脑、芯片、软件都做,相当于戴尔、英特尔和微软的结合体。结果呢?在过去的20年中,戴尔的利润与总体销售额之比是6%,英特尔是20%,微软是30%,而富士通的营业额却下降了17亿美元”

* What is design pattern
Design pattern helps you learn from others success instead of you failure.

2007年5月15日星期二

2007年5月15日 星期二

* Beijing OOo Summit
** Talk with Peter Junger after meeting.
**
* Work status
* ODF Workshop, http://opendocument.xml.org/node/32
** interesting odf toolkits:
odfpy: http://opendocumentfellowship.org/projects/odfpy
ooopy: http://ooopy.sourcefouge.net
pyopenoffice:www.bezirksreiter.de/pyopenoffice.htm

Notes: want to start have a look at odfpy once I complete to read the LPI.
** Download odfpy: http://opendocumentfellowship.org/projects/odfpy
svn export http://opendocumentfellowship.org/repos/odfpy/trunk odfpy

* UOML
** read UOML draft and sample

* Cyclone3.org
** interesting, Cyclone3.org is the official website of Cyclone3 community project, an Open-Source Web 2.0 & Application Framework based primary on Perl and XUL.

61.14.130.209 192.168.1.254 255.255.255.255 UGH 1436 0 0 eth0
147.2.207.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.61.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
172.16.191.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
151.155.128.0 0.0.0.0 255.255.128.0 U 1436 0 0 eth0
149.44.0.0 0.0.0.0 255.255.0.0 U 1436 0 0 eth0
137.65.0.0 0.0.0.0 255.255.0.0 U 1436 0 0 eth0
147.2.0.0 0.0.0.0 255.255.0.0 U 1436 0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 1436 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth0

* Team meeting.
Last week, I fix the bugs from Sun and commit to my cws. Tomorrow, I will ask Sun to review again. During these time, I will begin to work on CJK compatibility tab page of paragraph attributes.

Sun just announce to make good collabration with .
It seems that They were so busy, so I just saiy hello to them.
I also talked with Peter Junge from Redflag about how to work together better in CJK features. He told me he would blog what they would contribute.

** Feel not good, my spoken english has no make progress in the past 5 months. How to improve it? My god. tell me! help me! Only you can help yourself.
**

2007年5月14日星期一

2007年5月14日 星期一

* Poked mail. job detail description for Alex. Status report.
* R&D meeting to talk about the features in SLE 11
* Text grid
** bugs in non-snap to characters mode. Fixed
** sw debug build.
*

* engagement with

2007年5月11日星期五

Linux tutorial 4 - hardware

In this tutorial, you learn how to add and configure hardware to Linux system, including RAID arrays, PCMCIA cards, other storage devices, displays, video controlers, and other components.

Linux tutorial 3 -- Filesystem

* creating partitions
on x86 machines, hard disks may be divided into 4 primary partitions, but the last one may contain a number of extended partitions.

list partition table

fong:/home/fong/ebooks/linux/LPI # fdisk -l

Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 1913 15366141 83 Linux
/dev/hda2 1914 7296 43238947+ f W95 Ext'd (LBA)
/dev/hda5 1914 2175 2104483+ 82 Linux swap / Solaris
/dev/hda6 2176 4134 15735636 83 Linux
/dev/hda7 4135 7296 25398733+ 83 Linux

List the mounted filesystem tab
fong:/home/fong/ebooks/linux/LPI # cat /etc/fstab
/dev/hda6 / reiserfs acl,user_xattr 1 1
/dev/hda7 /home reiserfs acl,user_xattr 1 2
/dev/hda5 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
/dev/hda1 /local reiserfs acl,user_xattr 1 2

or
fong:/home/fong/ebooks/linux/LPI # mount
/dev/hda6 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda7 on /home type reiserfs (rw,acl,user_xattr)
/dev/hda1 on /local type reiserfs (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)

create a filesystem
fong:/home/fong/ebooks/linux/LPI # fdisk /dev/hda


* Make a filesystem in a partition
mkfs -t

* Make an ISO filesystem with mkisofs
% mkisofs -o ProjectCD.iso -r ~/project-files ~/project-extras

* Make an ISO filesystem with cdrecord
finding a recordable device
% cdrecord -scanbus

% sudo cdrecord -overburn -v speed=16 dev=1,0,0
/media/KNOPPIX_V3.6-2004-08-16-EN.iso

* Make an ISO filesystem with dd
% dd if=/dev/cdrom of=project-cd.iso

* Default mounting /etc/fstab
#
proc /proc proc defaults 0 0
/dev/sda3 / reiserfs notail 0 1
/dev/sda5 none swap sw 0 0
/dev/sda6 /home ext3 rw 0 2
/dev/scd0 /media/cdrom0 udf,iso9660 ro,user,noauto 0 0
/media/Ubuntu-5.04-install-i386.iso /media/Ubuntu_5.04 iso9660
rw,loop 0 0

:
:
: 1 for root fs, 2 for other fs.

* Automounting with AMD and automount
/etc/auto.master

* Fixing a fs with fsck

* checking fs with badblocks

Linux tutorial 2 -- System startup and boot processes

There are nigh steps that occur in Linux boot proccess
1. The bios or firmwire system reads the Master Boot Recorde on the harddisk or other boot device.
2. a boot load runs. (LILO: /etc/lilo.conf, or Grub: /boot/grub/menu.lst) to look for the linux kernel.
3. the kernel loads
4. The root filesystem is mounted.
5. Start the process init. the parent of all other processes
6. read the content of /etc/inittab to configure the remaining boot steps. one important thing is to specify the runlevel the system will boot to.
7. runlevel-neutral system initialization. This initialization will be performed regardless of runlevel.
8 runlevel-specific system initialization
9. login in at the prompt.

2007年5月11日 星期五

* Update status
* textgrid
** Uninstall and reinstall OOo.org
** More test to find bug
*** crash when input chars, in order to find the root cause, download m211 source code and rebuild it with non-product

* English word
** IMHO: in my humble opinion 恕我直言
** OTOH: on the other hand

2007年5月10日星期四

2007年5月10日 星期四

* Read mails.
** Download the PRD from JP and prepare to review it today.

* PRD review
** Ask for more infomation about compatility tab page from Zhang Yun.
** 5 types of requirement

M Mandatory—if this capability is not available, the solution won't work and won't be considered in the market place

I Important—the capability provides substantial competitive differentiation; without this capability, the product competitiveness will be negatively impacted in the market place

D Desirable—the capability provides differentiable market value, but does not affect the overall competitive position of the product (in the short term)

F Future—the capability can safely be implemented in future editions of the product without affecting the competitive position of the product (in the short term)

R Rejected—the capability should not be provided; it either has no impact on the product now or in the future, or has a negative impact on the product

** There are many feature need to work. Try to find some intersting stuff.
*** Document management: WEBDAV support
*** Access support?
*** Wiki/Browser support
*** Multimedia embedding in document
*** Template rewritten
*** File dialog: Group/Sort format
*** keybinding compability

* Write status report.

* CWS bits:
** resync my cws to m211, got errors. Continue to work on it.
** Download and apply the patch, go on resyncing, hope to success, my god.
** Oh, my god, the patch attached in i#76821 is not accurate. The full patch has committed to SRC680 (HEAD) and OOF680 (mws_oof680). Check out solenv from mws_oof680. It is OK. now.

* English learning:
** bootstrap:引导程序
** tweak?: To make minor adjustments in an electronic system or in a software program in order to improve performance

* 感悟
** 软件需要复杂的代码,更需要简单的运行

2007年5月9日星期三

2007年5月9日 星期三

1. Continue to learn Linux programming.
2. compare the codes between old and new tab page.
3. Download all the LPI tutorials and make up my mind to learn Linux very well in one month.
http://www-128.ibm.com/developerworks/linux/lpi/201.html?S_TACT=105AGX03&S_CMP=ZHP
First I learn Linux Kernel. This tutorial includes Kernel components, Compile kernel, patch a kernel and customize kernel.

Kernel components
The base kernel is created by Linus Torvalds.

4 English learning:
I sent a mail about Jianhua was hurt by accident.

Micheal responds:
urgh; send him our commiseration (同情) & best wishes, sorry for hear that.

2007年5月8日星期二

Back from Labor holiday

Back from labor holiday. A great holiday to me for I went to my wife's family to see my daughter. I missed her.

Mail bits: many mails after 7-days holiday. most of mails are unused. only two mails make sense. one is that team meeting will be hold tonight. the other is that Rob ( from ibm) suggested a interop SC in ODF TC).

See the discussion about List proposal:
I'd like to extend the invitataion to everyone that feels he needs it to explain things in private mail if they so wish.

I say this as I see a comment on the vote that raised on my eysbrow this morning; it says this:
Two is a lot better than zero.

OOo build. some build break for src680_m211, fix it and continue to build. Try to figure out the "serious assertion" mensioned by fme.

Restore the behavior when the grid mode is "square mode". Compare the two versions the figure out the difference.

resync the cws to m211:
* run cwsresync -f -m m211 all, meet the issue same as: http://www.openoffice.org/issues/show_bug.cgi?id=76821
download and apply the patch
* meet some conflicts when resyncing, but don't know what the conflicts are as some many logs.
* run cwsresync -f -c all, got the following erros:
Commit 'registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu': move tag: cwsresync: ERROR: Tagging 'registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu': tag operation returned: 'invalidoption'.
failed!

Don't know how to fix it. just waitting.

Today, Create a blog for my daughter. linrunhua.blogspot.com.