Perl/Tkx:Tk风格 VS Perl OO 风格

Posted on 2012年10月17日 21:30

  •  

原文地址:http://www.tkdocs.com/tutorial/concepts.html

What's somewhat scary about the Tkx module is that it implements all of this on a purely syntactic level. That is, it has no clue about buttons and entries and grid. It just knows that if it sees a method "new_something" it's creating a widget using the Tcl command "something", or if you call a method "g_otherthing", that it's going to invoke a Tcl command "otherthing", and pass the widget pathname associated with the object as a first parameter (followed by any other parameters passed to the method).

Tcl 命令 "somwthing" 写成 $父元件->new_something,也可以用 g_something(pathname)

继续阅读

Js解析URL参数

Posted on 2012年7月17日 23:52
function getQueryStr(str){
                var url=location.href;
                var rs = new RegExp("(^|)"+str+"=([^\&]*)(\&|$)","gi").exec(url), tmp;

                if(tmp=rs){
                    return tmp[2];
                }

                // parameter cannot be found
                return "";
            }
function parseUrl(){
                var url=location.href;
                var i=url.indexOf('?');
                if(i==-1)return;
                var querystr=url.substr(i+1);
                var arr1=querystr.split('&');
                var arr2=new Object();
                for  (i in arr1){
                    var ta=arr1[i].split('=');
                    arr2[ta[0]]=ta[1];
                }
                return arr2;
            }

MySQL 笔记

Posted on 2011年3月07日 04:52

1、set names `utf8`,不是 utf-8, 就这个问题害我测试了好久!

FireBird 笔记

Posted on 2011年3月04日 15:25

1、和MySQL可以使用没有表的Select 语句不同,FB必须使用表,如果需要用SQL做运算的时候,表名可用 rdb$database

 

select 1+2 from  rdb$database

2、改变用户密码:

 

gsec -user sysdba -password masterkey –mo sysdba –pw abc1234

3、增加一个用户:

 

gsec –user sysdba –password masterkey –add zhangsan –pw ab123

 

SWI Prlog format 谓词说明

Posted on 2011年1月03日 05:49

SWI Prolog的format类似于c语言的printf语句,用于格式化输出数据。它的格式是:

format(+Format, +Arguments).

其中Format是格式描述,用~作为描述符的开头(类似于C语言的 %)然后是一个可选的数字(可用ASCII码、`字符、*三种方式),最后是格式符号。Arguments 是需要输出的数据,如果多于1项,需要把输出数据放在列表中。

继续阅读

Flex正则表达式验证组件中{}需转义

Posted on 2010年10月22日 00:28

原因是Flex会把MXML中{}包围的内容解释为绑定变量,所以在表示正则表达式的范围时候,需要把正则表达式中的{}转义成\{\}。害我折腾半个小时!

SmartDraw 2009 中文字体不能显示的解决方法

Posted on 2010年10月16日 09:10

SmartDraw 2009是一个非常棒的绘图工具,可不知道设计程序的人是怎么弄的,凡是字体名称是中文的就显示为乱码甚至不在字体列表框中显示。这样在使用汉字的时候非常不方便,解决的办法就是安装字体名称为英文的汉字字体,比如 uming(字体名:AR PL ShanHeiSun Uni) 和 ukai等。

带权限设置的Access数据库文件的打开

Posted on 2010年10月16日 08:49

1、用 AccessPassword 打开权限文件查看用户和密码。

2、打开数据库文件的时候用命令行打开

MSACCESS.EXE 数据库文件名 /wrkgrp 权限文件

相关网站:http://www.access911.net