- <br />
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
- <html xmlns="http://www.w3.org/1999/xhtml"><br />
- <head><br />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></p>
- <p></head></p>
- <p><body><br />
- <script type="text/javascript">
- /*
- * author:Jena.want
- * web:www.AOBODO.com
- * last edit:2008.11.11
- * 谨以此送给正在享受光棍节的哥们们!祝今年节日快乐!祝明年不再过此节!
- */
- //<![data[
- checkInstalled = function(m) {
- switch(m){
- case 'msn':
- try {
- new ActiveXObject("MSNMessenger.P4QuickLaunch");
- return true;
- }
- catch (e) {
- return false;
- }
- case 'skype':
- try{
- new ActiveXObject("Skype.Detection");
- return true;
- }catch(e){
- return false;
- }
- case 'qq':
- try {
- new ActiveXObject("TimwpDll.TimwpCheck");
- return true;
- }
- catch (e) {
- return false;
- }
- }
- }</p>
- <p> //]]-->
- </script></p>
- <input type="button" value="检测有没有安装MSN" onclick="alert(checkInstalled('msn'))" />
- <input type="button" value="检测有没有安装QQ" onclick="alert(checkInstalled('qq'))" />
- <input type="button" value="检测有没有安装SKYPE" onclick="alert(checkInstalled('skype'))" />
- </body><br />
- </html><br />
测试环境:WIN SERVER 2008,IE6+,Firefox2.0+,Opera,Chorme
Posted in
javascript at November 11th, 2008.
2 Comments.
PclZip介绍
PclZip library能够压缩与解压缩Zip格式的压缩档(WinZip、PKZIP);且能对此类类档案进行处理,包括产生压缩档、列出压缩档的内容以及解压缩档案等等。由于能够在伺服器端进行压缩与解压缩的动作,所以相当方便使用。
PclZip定义一个PclZip类别,其类别物件可视为一个ZIP档案,亦提供method来进行处理。
如何使用PclZip
1.基础
所有的功能都由pclzip.lib.php这个档案提供,PclZip library可于其首页(www.phpconcept.net/pclzip/index.en.php)下载,(PS:但是目前打不开了,我上传了一个文件class-pclzip)。所有的PKZIP档案其实就是一个 PclZip的类别物件。当产生一个PclZip档案(ie, PclZip类别物件),就会先产生一个压缩档,且档名已经指定,但此压缩档的内容尚未存在:
- < ?PHP
- require_once('pclzip.lib.php');
- $archive = new PclZip("archive.zip");
- ?>
此物件提供了一些public method可用来处理此档案。
Read More…
Posted in
keyboard's joy at November 6th, 2008.
No Comments.
以前的程序是把图片通过ASP以二进制的格式存储到MSSQLSERVER中的,现在需要用PHP把它显示出来,
- $id = $_GET['id'];
- $conn = dbo_connect();
- $query = "select f.Data from Files f,Products p where p.PhotoSN=f.SN and p.ID=$id";
- $result = mssql_query($query, $conn);
- if (mssql_num_rows($result)) {
- $row = mssql_fetch_assoc($result);
- if (!empty($row['Data'])) {
- echo $row['Data'];
- }
- }
- mssql_close($conn);
但是读取出来的图片都只有开头一小部分,其它部分是空白,全选以后看到的图片大小似乎也是正常的,就是有一部分显示不出来,好一个纳闷。质量高的图片显示的部分还要小,质量低的或者图片尺寸小的就要显示的多一些,看样子是读取的数据大小是一致的。后来一看$row['Data']的长度,果然清一色的4096,原来如此。
上网查资料,费了好大劲,才看到一句有价值的话“是配置错了”。配置错了?难道PHP读取MSSQL的image数据还有大小限制?赶紧打开php.ini,搜索image,没有相关的,搜索4096,还没有相关的,不会吧?!哈哈,原来是已经搜索到文件末尾,还在向下搜索,难怪没有。赶紧改方向,找到了!但是无关,再搜,OK,终于找到了:
- ; Valid range 0 - 2147483647. Default = 4096.
- ;mssql.textlimit = 4096
-
- ; Valid range 0 - 2147483647. Default = 4096.
- ;mssql.textsize = 4096
原来如此,把mssql.textlimit和mssql.textsize后面的值都改成最大,2147483647,然后再把前面的分号去掉,保存,重启IIS。再去看刚才的程序显示出来的图片,成了,全部显示!
真亲啊!GOOD!
Posted in
keyboard's joy at October 29th, 2008.
No Comments.
这年头估计用VB6做开发的人已经不多了吧。公司有个项目,需要用到VB6,每次都为在编辑器里不能滑动滚轮而烦恼,实在是不方便啊,也难怪,有点年头了。今天在网上找资料,碰巧看到一篇文章就是解决这个问题的,呵呵,太好了。操作步骤如下:
1、下载http://download.microsoft.com/download/e/f/b/efb39198-7c59-4ace-a5c4-8f0f88e00d34/vb6mousewheel.exe,这是一个自解压的包,其中包含VB6IDEMouseWheelAddin.dll和其源程序,或者在附件里下载,我已经上传了,vb6idemousewheeladdin-dll。
2、将包中的VB6IDEMouseWheelAddin.dll或者将源程序编译出一个新的VB6IDEMouseWheelAddin.dll COPY到系统目录或者VB安装目录(防止被删除)。
3、运行regsvr32 <path>\VB6IDEMouseWheelAddin.dll,注册这个dll。
4、运行Visual Basic 6.0。
5、单击“外接程序”菜单下的“外接程序管理器”,弹出“外接程序管理器”对话框。
6、在“可用外接程”序列表中,选择“MouseWheel Fix”,在加载行为栏中单击选中“加载/卸载和在启动中加载”复选框。
7、确定,完成。
这时,你的Visual Basic6.0 IDE已经支持滚轮了
Posted in
keyboard's joy at September 25th, 2008.
No Comments.
mssql默认以系统时间格式输出,你可以调整系统的时间格式来解决
当然是在程序里解决比较灵活,例如:
“select convert(char,日期字段,120) as date2 from table”
convert(char,date,N)输出的各中样式
N 日期样式
0 04 2 2005 9:06AM
1 04/02/05
2 05.04.02
3 02/04/05
4 02.04.05
Read More…
Posted in
keyboard's joy at September 9th, 2008.
No Comments.
代码如下:
<script type=”text/javascript”>
loadURL = function(){
location.href = “http://www.aobodo.com”;
}
</script>
<a href=”javascript:void(0);” onclick=”javascript:loadURL();”>Link1</a>
<a href=”#” onclick=”javascript:loadURL();”>Link2</a>
<a href=”javascript:loadURL();”>Link3</a>
以上三种方式在IE7+,Firefox下可以正常执行,第一种方式在IE6-没有响应。
第一种方式要想在IE6-下正常执行,需要修改成<a href=”javascript:void(0);” onclick=”javascript:loadURL();return false”>Link1</a>。
Posted in
keyboard's joy at September 4th, 2008.
No Comments.
买卖街本着“用户至上”的服务原则,从用户的实际需要出发,增加了更多人性化的贴心服务。为了方便您更加流畅地使用买卖街,也为了买卖街能更好地为您服务,我们特设立了QQ讨论群,实现了我们与您的实时交流,解答您在使用过程中遇到的问题,听取您对买卖街的意见和建议;同时您还可以与其他用户交流使用买卖街的心得。
加入QQ 讨论群,畅所欲言买卖街!让我们了解您的心声,您的需求就是我们的追求!
群号:55200511
Posted in
买卖街 at July 16th, 2008.
No Comments.
第一次发布还失败了,原因是代码里有coolcode标签,结果让编辑器给替换了 :( 再发一次,这次把coolcode标签替换成mycodes,实际使用中要替换回来。
今天为WP增加了一个插件CoolCode,作用就是让内容里的代码能够高亮显示,经常写些程序代码,但是以前只是普通的文字,没有相应的颜色,有了这个插件,写出来的代码加上颜色,就好看多了。
经过测试,在编辑器Visual模式下写的代码不能被正常的的解析,只有在HTML模式下写出来的代码才能被正常的解析到。然而每次都要写上<mycodes lang=”javascript”></mycodes>,虽然字数不多,但是像这样简单的代码就懒得写了,于是,决定在HTML模式下,增加一个快捷按钮,就像已有的link,code一样,点击一下,输入几个参数就可以了。
CoolCode有三个参数,lang,指定被包含的程序代码是哪种语言,支持actionscript cpp css diff dtd html java javascript mysql perl php python ruby sql xml;linenum,指定是否显示行号,值是true或者false,默认是true;download,指定要下载的文件的路径加文件名。这三个参数都是可选的。了解了这些,就开始写代码了。
首先是在“\wp-includes\js\quicktags.js”里进行修改,
添加要显示的按钮:
- edButtons[edButtons.length] =
- new edButton('ed_coolcode'
- ,'mycodes'
- ,''
- ,'</mycodes>'
- );
将这个按钮增加到“edShowButton”函数里:
- function edShowButton(button, i) {
- if (button.id == 'ed_img') {
- document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertImage(edCanvas);" value="' + button.display + '" />');
- }
- else if (button.id == 'ed_link') {
- document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />');
- }
- else if(button.id == 'ed_coolcode') {
- document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertCoolCode(edCanvas, ' + i + ',true);" value="' + button.display + '" />');
- }
- else {
- document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertTag(edCanvas, ' + i + ');" value="' + button.display + '" />');
- }
- }
因为这个按钮需要接收弹出框的信息,所以要单独写。 Read More…
Posted in
keyboard's joy at July 16th, 2008.
No Comments.
HMailServer is a free, GNU GPL licensed email server for Windows. It runs as a service with a management tool that connects to allow configuration of settings similar to the way Exchange works. It has support for the IMAP, POP3, and SMTP open email standard protocols, and stores index data in MySQL or MS SQL but the actual e-mail content is still stored as files in a format similar to Maildir (the contents are the same but the directory structure is different). It is updated frequently and has active support and development forums.
All common features such as multiple-domain support, aliases (catch-all and specific ones for addresses and also for domains themselves) and basic mailing lists are present. Users can be authenticated against both the local system and other servers, including domain controllers.
It offers a variety of anti-spam options such as:-
- Host based DNS Blacklisting (DNSBL)
- URL based DNS blacklisting (SURBL)
- Greylisting (must retry sending for the message to succeed)
And provides basic support for using JScript or VBScript to modify the behaviour of the server on receipt of messages and at a variety of other events (including client connection).
HMailServer in current versions does not include SSL or TLS support, however this can be easily added using a third party application called STunnel which uses the OpenSSL libraries to add secure connection support. IPv6 support can also be added using STunnel, it is not included.
There is recent discussion that further releases of the software will not be open source visible on the forums by the developer.
Some features that may be of interest to businesses but are commonly missing in other servers are also available and easy to configure, such as:-
- Compulsory signatures (for legal and advertising footers)
- Server side rules
- External account retrieval
- Quotas on domain, mailbox, and individual message sizes
- Plus addressing (using + to make a virtual alias for an account specific to a task, as seen in Gmail)
- Attachment blocking
- E-Mail mirroring (all messages sent to a particular address)
- Custom SMTP routes for specific domains
Integration is supported for many related applications, including:-
- SquirrelMail for webmail, (requires IIS or Apache); spell-checking available
- ClamAV anti-virus software
- SpamAssassin spam filtering
- and more…
Posted in
keyboard's joy at July 15th, 2008.
No Comments.
在Javascript里计算小数乘法,容易出现浮点错误,例如:
- <script>
- document.write (1.1*1.3);
- document.write ("<br>");
- document.write (1.2*1.1);
- </script>
输出结果:
解决问题的思路就是,先把因数放大为整数,最后再除以相应的倍数,这样就能得到正确的结果了。解决办法如下:
1、 在算式中解决
- <script>
- alert(1.1*(1.3*10)/10);
- </script>
2、添加到Number的原型方法里
- <script>
- Number.prototype.rate=function(){
- var oStr=this.toString();
- if(oStr.indexOf(".")==-1)
- return 1;
- else
- return Math.pow(10,parseInt(oStr.length-oStr.indexOf(".")-1));
- }
- function tran(){
- args=tran.arguments;
- var temp=1;
- for(i=0;i < args.length;i++)
- temp*=args[ i ]*args[ i ].rate();
- for(i=0;i < args.length;i++)
- temp/=args[ i ].rate();
- return temp;
- }
- </script>
使用方法:假如11*22.9,可以这样写tran(11,22.9),这样,问题就解决了。
Posted in
javascript at July 15th, 2008.
1 Comment.