2009-05-31

删除一对xml标签内的文字

原来的xdp文件中有很多旧的脚本,都在<script>标签内,如:

<script contentType="application/x-javascript">$.rawValue = ValidateScriptObject.fmtDate(ValidateScriptObject.getPeriod(),1);</script>

LiveCycle Designer不提供一次性删除所有的javascript代码,只好自己动手。在vim下先查找x-javascript,然后执行 cit 来删除标签内的文字,然后击键 n . ,这样下去似乎很快捷,不过后来发现当标签内文字不为空时,命令执行的很好,当这是一对空标签时,cit 命令会删除开始标签,导致XML文件不再well formed,后来在bbs.chinaunix.com一问才知道,这是gvim 7.1的一个bug,7.2修正了这个问题。

2009-05-30

解决无法写入_viminfo文件错误

最近在笔记本上的windows xp上使用gvim时,总是提示无法写入D:\Documents and Settings\dingjun.jia\_viminfo文件。开始以为是文件权限被错误设置。在检查目录Documents and Settings的权限设置时,发现这个文件夹的readonly被阴影选中了,取消保存后该选项仍然显示被选中,不过这个目录确实可写,估计只有微软自己的程序员才知道为什么要把这个文件夹设置为readonly,并且这个设置还不起作用,总之走了一段弯路。网上有人写道有可能是viminfo有太多的临时文件,vim无法知道该把哪个临时文件写入_viminfo中,所以写入失败。查找了一下并没有发现viminfo的临时文件,viminfo的帮助(:help viminfo)说,Unix或OS/2下该文件位于$HOME/.viminfo下,在Windows下位于$HOME\_viminfo。如果windows下没有定义HOME变量,文件被保存到$VIM\_viminfo,如果VIM也没有被定义,就位于c:\_viminfo。可是我使用gvim 7.2总是试图在目录下D:\Documents and Settings\dingjun.jia\下写该文件。定义了VIM变量,问题依旧,在定义HOME变量后,提示消失了。是不是Vim的Help应该更新了?

2009-05-26

在LiveCycle Designer下调试javascript

在Firefox下用惯了用firebug去调试javascript,现在在Livecycle Designer下也希望有一个这样的工具。查了半天文档才发现在Acrobat下打开javascript debugger(Edit -> Preferences, Select Enable Interactive Console and Show Console On Errors And Messages),可以在Livecycle Designer下用control + j打开。让人费解的是如何执行interactive console下的代码,必须先选中要执行的代码,再按control+enter,才能执行。

Using the JavaScript Console from Acrobat, you can to evaluate single or multiple lines of code.
There are three ways to evaluate JavaScript code while using the interactive JavaScript Console:
To evaluate a portion of a line of code, highlight the portion in the console window and press either Enter on the numeric keypad or Ctrl+Enter on the regular keyboard.
To evaluate a single line of code, make sure the cursor is positioned in the appropriate line in the console window and press either Enter on the numeric keypad or Ctrl+Enter on the regular keyboard.
To evaluate multiple lines of code, highlight those lines in the console window and press either Enter on the numeric keypad or Ctrl+Enter on the regular keyboard.

2009-05-20

初识Adobe LiveCycle Designer

写了几天的specification,现在开始动手用Adobe LiveCycle Designer编程了。这个东东的名字就让我费解了半天。程序安装完后在开始菜单里显示为Adobe LiveCycle Designer ES 8.2,启动程序后程序的标签上显示的名字为Adobe LiveCycle Designer,但是在Help下的关于菜单下又显示为Adobe LiveCycle Designer ES。浏览Adobe的网页之后才搞清楚,Adobe提供的一个解决方案被称为LiveCycle ES (Enterprise Solution),其中有服务器组件,也有designer组件,还有一个workbench组件,而Adobe LiveCycle Designer就是designer部分。

用了之后很失望,与其他编程的IDE相差甚远,与之搭配使用的Acrobat Pro9下的debugger窗口也很蠢,鼠标点到Acrobat窗口后,debugger窗口仍然在当前窗口,只有笔记本没有第二个显示器简直是一场恶梦。更惨的是一个form有错之后,必须关掉Acrobat,重新启动,否则Acrobat不能正确解释form内的JavaScript代码!!不知道Adobe什么时候能在这个产品上多花点功夫。

2009-05-14

在Excel下用方向键在单元格间移动光标

今天在使用Excel时,发现使用上下左右方向键(KEYDOWN、KEYUP、KEYLEFT和KEYRIGHT)进行单元格的切换时,发现方向键控制的不是单元格的切换,而是整个Excel工作表的滚动条的移动,而当前焦点的单元格并没有随方向键而改变。解决办法是按下Scroll Lock键。

2009-05-06

自定义另存为对话框中的快捷访问位置

当你在一段时间内要多次点击鼠标才能到你的文件夹时,你会发现这招很有用。使用组策略来添加另存为对话框中的快捷访问方式:

run gpedit.msc

open User Configuration – Administrative Templates – Windows Components – Windows Explorer – Common Open File Dialog - Items displayed in Places Bar

choose enable and add folder to Place to display