2009-07-15
LiveCycle Designer中事件顺序
f为表单名称,p为第一页页面名称,txtField是一个text field的名称。
f.p.txtField::initialize
f::initialize
f.p.txtField::validate
f::validate
f.p.txtField::ready:form
f::ready:form
f.p.txtField::docReady
f::docReady
2009-07-14
解决无法访问dashboard的错误
You do not have sufficient permissions to access this page.
网上有不少类似错误,但很少有仅仅出现在dashboard页面上。后来突然想到有可能是plugin不兼容导致的错误,发现曾经安装过一个名为Admin Drop Down Menu的插件。这个正好与管理界面内的菜单相关,禁用后立即可以访问dashboard页面了。
2009-07-13
2009-07-12
转换mysqldump文件编码
以前就为mysqldump导出的文件编码折腾过,这一次没费那么大的劲。因为blog的备份是以前从系里mysql服务器dump出来的,并且系里的mysql服务器版本比较低是4.0 (-- Server version 4.0.24_Debian-10sarge2-lo),导出文件的默认编码不是utf8。使用iconv转换总失败,只好用来方法,用notepad++打开sql文件,然后选择format -> convert to utf8,保存为utf8编码的文件。中间notepad++假死很长时间,耐心等待之后才成功保存。这样把utf8编码的sql文件上传到新的mysql服务器(版本为v5.0.81)后,中文和变音才正常显示。
2009-07-04
无法启动windows上的cygwin sshd
/var/empty must be owned by root and not group or world-writable.
执行/usr/sbin/sshd -D -d -d -d得到更详尽的信息:
$ /usr/sbin/sshd -D -d -d -d
debug2: load_server_config: filename /etc/sshd_config
debug2: load_server_config: done config len = 196
debug2: parse_server_config: config /etc/sshd_config len 196
debug3: /etc/sshd_config:13 setting Port 22
debug3: /etc/sshd_config:38 setting StrictModes no
debug3: /etc/sshd_config:92 setting UsePrivilegeSeparation yes
debug3: /etc/sshd_config:106 setting Subsystem sftp /usr/sbin/sftp-server
debug1: sshd version OpenSSH_5.1p1
debug1: private host key: #0 type 0 RSA1
debug3: Not a RSA1 key file /etc/ssh_host_rsa_key.
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug3: Not a RSA1 key file /etc/ssh_host_dsa_key.
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
/var/empty must be owned by root and not group or world-writable.
记得以前的版本中var目录在cygwin的安装目录下,现在var目录被自动创建到了C:\var下。
试着在var下创建了empty目录并修改其权限,仍然不能启动。最后重新启动cygwin安装程序,在Install for选项中选择for all,在组件中选择reinstall cygwin,cygrunserv, openssh,安装完毕后马上就可以启动ssh服务了!
Update: 在台式机上遇到同样的问题,这次与在笔记本上不同。不能启动windows里的服务,但却能够在命令行下启动sshd,并且能登陆。采用上面的办法重装后仍然不见效果。重新运行ssh-host-config后sshd.log仍然出现
/var/empty must be owned by root and not group or world-writable.
执行:$ chown SYSTEM empty
jia@swhtw78190 /cygdrive/e/cygwin/var
$ ls -al empty/
total 0
drwxr-xr-x+ 2 SYSTEM Benutzer 0 Jul 7 12:36 .
drwxrwxrwx+ 8 jia Benutzer 0 Jul 7 12:36 ..
jia@swhtw78190 /cygdrive/e/cygwin/var
$ net start sshd
CYGWIN sshd wird gestartet.
CYGWIN sshd wurde erfolgreich gestartet.
估计是ssh-host-config程序没有正确设置/var/empty目录的owner。
2009-06-17
Live Cycle Designer下text object和text field object的区别
当把表单中的数据导出成XML文件时,text object的数据不会出现在XML文件中,而text field object的数据会出现在XML文件中。
可以设置tab order忽略text object,但不能跳过text field object,尽管它的属性设置为invisible或hidden。
2009-06-16
清除radionbutton group的选择状态
通过脚本来清除radiobutton group 的选择状态不能通过设置其值为null,而必须设置其值为空,如
F.P.radioButtonGroup.rawValue = ""; 而不是F.P.radioButtonGroup.rawValue = null;
javascript中的比较
如果把一个string和一个number相比较,javascript会自动试着将string转换为number,所以 "1.010" == 1.01 表达式返回true。
空和空格会被转换为数字0,所以不管是"" == 0,还是" " == 0 都会返回true。
这也与使用的比较操作符 == 有关。更严格的比较使用 ===,参看javascript reference
2009-06-14
2009-06-10
删除一对XML标签内的文字2
我的尝试:
:%s/\(<script \a*="\a*\/x-javascript">\)\([^<]*\)\(<\/script>\)/\1\3/
或者
:%s#\(<script contentType="application/x-javascript">\)[^<]*\(</script>\)#\1\2#
用sed来处理:
sed -rn 's#(<script contentType="application/x-javascript">)[^<]*(</script>)#\1\2#g;p' myfile.xdp
如果脚本有多行,需要处理换行的情况:
%s#\(<script contentType="application/x-javascript">\)\([^<]*\n\)*[^<]*\(</script>\)#\1\3#g
或者用awk来处理换行的情况:
awk -v RS="<script contentType=\"application/x-javascript\">" 'NR!=1{gsub("^[^<]*</script>","</script>")}{printf NR==1?$0:RS""$0}' myfile.xdp
Update: (2009-06-24 )
要干净删除已有的脚本代码,仅仅删除<script>标签内的代码还不够。这样会留下很多空的不包含脚本的event标签,当再次添加脚本文件时,如果新生成的event标签连同script标签在原来那个标签之后,那么代码将不会在design view下显示出来,而只在XML source中显示出来,在执行时,代码仍会被执行。也就是说,一个不包含任何代码代码的form的xml source里面应该有不会有event标签出现。
2009-06-03
xdp文件变大问题
网上google的结果是,这是Livecycle Designer ES 8.2的一个Bug造成的。
A bug introduced with LiveCycle Designer ES Update 1 (8.2) is now fixed in LiveCycle service pack 2 and the Acrobat 9.1 update. The bug causes a processing instruction ex. <?templateDesigner StyleID aped3?> to get copied repeatedly while working with the form. This can lead to extremely large file sizes and sometime causes crashes. The fix removes duplicate StyleID's found in existing forms and prevents them from being created.
http://blogs.adobe.com/livecycle/2009/03/post.html
2009-05-31
删除一对xml标签内的文字
<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
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
用了之后很失望,与其他编程的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
2009-04-17
IT职业规划
http://www.microsoft.com/china/technet/webcasts/class/career.mspx
2009-04-07
下载IGO 8.3.2.71348
http://rapidshare.com/files/175240934/i83264go.part01.rar
文件一共有20个,一个个去copy link location太麻烦了。于是选中了所有的链接,在Firefox先选中selection source,再把html source复制到一个文本文件里,再用grep过滤一下就行了
grep -s -o -E http:\/\/rapidshare\.com\/files\/[0123456789]{9}\/i83264go\.part[0123456789]{2}.rar igo8.txt
安装RSD和RouterControl程序。在RSD程序中Einstellung -> Methode 下给出RouterControl程序的正确路径,并填写参数/MULTI /d /c /q。把上面grep得到的结果复制到RSD中,启动下载。
Enjoy it!
2009-04-03
HP打印机端口
gk公司内IP地址是通过DHCP分配的,并且楼内因为有多家公司办公,共同使用网络设施。gk的电脑上安装的打印机使用的就是standard TCP/IP port。她的办公地点挪动到另一间屋子时,能上网,但不能打印了。一看分配到的IP地址,不再是以前的C类地址 192.168,而是一个A类地址10.0,而打印机得到仍然是C类地址。打完一圈电话后才知道楼里有两个DHCP server。机器启动时,哪个DHCP server响应快,机器就得到一个相应的A类或C类地址。可是她的同事的电脑也获得了一个A类地址,却仍然可以打印。区别就在于她的同事电脑上安装的打印机使用的是HP打印机标准端口,其中有一个选项是: 当IP地址改变时也打印到这个设备上。我猜测是直接使用打印机的MAC地址与打印机的网络模块通信,而不再需要IP地址解析,所以能把要打印的数据发过去。