沈阳师范大学投票系统正式启用,首次使用AJAX技术!

Filed Under (系统开发) by 有为 on 22-03-2010

系统介绍:

系统采用通用帐号,登录后进行投票,采用AJAX技术,使系统工作在异步方式,使系统反映更快,使系统操作更具亲和力。

系统抓图:

1.系统登录界面。

师大投票1

2.系统后台管理界面。

师大投票2

3.系统投票界面。

师大投票3

Windows Live Mail接收yahoo邮件的设置方法

Filed Under (问题解答) by 有为 on 17-03-2010

Yahoo邮箱的收费用户才支持pop3,雅虎的yahoo.cn的无限容量邮 箱和yahoo.com.cn邮箱,都是没有开启POP和SMTP功能,

但Yahoo提供了一个免费的“网上直投”功能,可以让你使用客户端收发Yahoo邮件。要使用这项功能,必须先注册成为Yahoo“网上直投”的 成员,具体方法如下:

1.首先登录yahoo邮箱(必需是中国的yahoo):   http://mail.yahoo.cn

2.在地址栏打开如下网址: http://edit.my.yahoo.com/config/set_popfwd?.src=ym

3.填写注册表单,在注册一项中选择“是”,然后选择你感兴趣的内容(可以什么都不选),,然后按”完成”按钮

4.选择“网上阅读邮件和POP功能”,其它选项可根据自己的需要选择,完成后按“提交”按钮。

5. 此时“网上直投”注册成功,系统会告诉你的“服务器设置”:

在WLM里:

接收邮件(POP3)服务器: pop.mail.yahoo.com.cn

发送邮件(SMTP)服务器: smtp.mail.yahoo.com

我的作品之-平衡木(2009年辽宁省第十届教育软件大赛三等奖)

Filed Under (获奖作品) by 有为 on 11-03-2010

平衡木

Js中escape(),encodeURI()和encodeURIComponent()比较

Filed Under (javascript专栏) by 有为 on 05-03-2010

escape(), encodeURI()和encodeURIComponent()是在Javascript中用于编码字符串的三个常用的方法,而他们之间的异同却困扰 了很多的Javascript初学者,在这里对这三个方法详细地分析与比较一下。

escape() 方法

MSDN JScript Reference中如是说:

The escape method returns a string value (in Unicode format) that contains the contents of [the argument]. All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. For example, a space is returned as “%20.”

译:escape方法以Unicode格式返回一个包含传入参数内容的string类型的值。 Escape方法会将传入参数中所有的空格、标点符号、重音字符以及其它任何非ASCII字符替换为%xx的编码形式,其中xx与其所表示的字符的16进 制数表示形式相同。如空格字符的16进制表示形式为0×20,则此时xx应为20,即escape(‘ ’) 返回“%20”。

Mozilla Developer Core Javascript Guide中如是说:

The escape and unescape functions let you encode and decode strings. The escape function returns the hexadecimal encoding of an argument in the ISO Latin character set. The unescape function returns the ASCII string for the specified hexadecimal encoding value.

译:escape和unescape方法能够帮助你编码和解码字符串。escape方法对于ISO Latin字符集中的字符组成的参数,返回其16进制编码。相对应的,unescape方法则能将16进制编码形式的参数转化成为其ASCII码形式。

encodeURI()方法

MSDN JScript Reference中如是说:

The encodeURI method returns an encoded URI. If you pass the result to decodeURI, the original string is returned. The encodeURI method does not encode the following characters: “:”, “/”, “;”, and “?”. Use encodeURIComponent to encode these characters.

译:encodeURI方法返回一个经过编码的URI。如果将encodeURI方法的编码结果传递给decodeURI方法作参数,则能得到原始 的未编码的字符串。需要注意到是encodeURI方法不编码如下字符”:”, “/”, “;”, and “?”。如果想要编码这些字符,请使用encodeURIComponent方法。

Mozilla Developer Core Javascript Guide中如是说:

Encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, or three escape sequences representing the UTF-8 encoding of the character.

译:通过将每个属于特定的字符集合的字符替换为一个、两个或者三个(为什么是“一个、两个或者三个”本人也没有搞懂,望高人赐教)使用UTF-8编 码来表示这个字符的escape序列来编码一个URI。如 ~!@#$%^&*(){}[]=:/,;?+\””\\ 将被替换为 ~!@#$%25%5E&*()%7B%7D%5B%5D=:/,;?+”%22%5C

encodeURIComponent()方法

MSDN JScript Reference中如是说:

The encodeURIComponent method returns an encoded URI. If you pass the result to decodeURIComponent, the original string is returned. Because the encodeURIComponent method encodes all characters, be careful if the string represents a path such as /folder1/folder2/default.html. The slash characters will be encoded and will not be valid if sent as a request to a web server. Use the encodeURI method if the string contains more than a single URI component.

译:encodeURIComponent方法返回一个编码过的URI。如果将encodeURIComponent方法的编码结果传递给 encodeURIComponent方法作参数,则能得到原始的未编码的字符串。因为encodeURIComponent方法会编码所有的字符,所以 如果待编码的字符串是用来表示一个路径(如/dir1/dir2/index.htm)时,就一定要小心使用了。‘/’符号会被其编码之后,将不再是一个 有效的路径标识符,所以不能被web服务器正确地识别。当字符串包含一个单独的URI component(指?后面的请求参数)的时候,请使用此方法。

Mozilla Developer Core Javascript Guide中如是说:

Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, or three escape sequences representing the UTF-8 encoding of the character.

译:通过将每个属于特定的字符集合的字符替换为一个、两个或者三个(为什么是“一个、两个或者三个”本人也没有搞懂,望高人赐教)使用UTF-8编 码来表示这个字符的escape序列来编码一个URIComponent。

有什么区别?何时使用?
通过上面的介绍可以看出,MS的文档明显要比Mozilla详细、易懂一些,但是它们表达的都是一个意思。但是escape(), encodeURI()和 encodeURIComponent()有什么异同,它们分别适用于那种特定的情况呢?

escape方 法并不编码字符+。而我们知道,在用户提交的表单字段中,如果有空格,则会被转化为+字符,而服务器解析的时候则会认为+号代表空格。由于这个缺 陷,escape方法并不能正确地处理所有的非ASCII字符,你应当尽量避免使用escape方法,取而代之,你最好选择 encodeURIComponent()方法。
escape()不编码的字符:@*/+

相对于使用escape方法,使用encodeURI方法会显得更专业一些。当你需要编码一整个URI的时候,你可以使用此方法,因为URI中的合 法字符都不会被编码转换。需要注意到是字符’也是URI中的合法字符,所以也不会被编码转换。
encodeURI() 不编码的字符: ~!@#$&*()=:/,;?+”

encodeURIComponent方法在编码单个URIComponent(指请求参数)应当是最常用的。需要注意到是字符’也是URI中的合 法字符,所以也不会被编码转换。
encodeURIComponent()不编码的字符: ~!*()”

Debug命令清除硬盘数据操作指南

Filed Under (网管员之路) by 有为 on 01-03-2010

操作步骤

1.使用软盘引导到DOS模式下,在系统提示符A:\> 后键入命令“Debug”并按“Enter”键确认。此时系统将出现短横线提示符,然后仔细键入以下命令行(字母没有大小写分别), 以第一行为例:依次输入 字母F,空格,字母L,数字100,空格,数字0Enter

2.命令行全文如下:
A:\> debug“Enter”
-F200L1000“Enter”
-ACS:100“Enter”
xxxx:0100MOVAX,301“Enter”
注:xxxx:0100 为系统提示,不需要输入
xxxx:0103MOVBX,200“Enter”
xxxx:0106MOVCX,1“Enter”
xxxx:0109MOVDX,80“Enter”
注:如需要清除机器内第二硬盘的数据,只需将80改为81即可
xxxx:010CINT13“Enter”
xxxx:010EINT20“Enter”
xxxx:0110 “Enter”
-G“Enter”

3.程序执行成功后,系统将提示“Program terminated normally”,表明此时硬盘数据已经完全清除。

4.重新启动电脑并安装操作系统。