买卖街又添新服务了!:)

买卖街本着“用户至上”的服务原则,从用户的实际需要出发,增加了更多人性化的贴心服务。为了方便您更加流畅地使用买卖街,也为了买卖街能更好地为您服务,我们特设立了QQ讨论群,实现了我们与您的实时交流,解答您在使用过程中遇到的问题,听取您对买卖街的意见和建议;同时您还可以与其他用户交流使用买卖街的心得。
加入QQ 讨论群,畅所欲言买卖街!让我们了解您的心声,您的需求就是我们的追求!
群号:55200511

快速使用CoolCode-WordPress代码着色插件

第一次发布还失败了,原因是代码里有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-includesjsquicktags.js”里进行修改,
添加要显示的按钮:

edButtons[edButtons.length] =
new edButton(‘ed_coolcode’
,’mycodes’
,”
,’</mycodes>’
);

将这个按钮增加到“edShowButton”函数里:

function edShowButton(button, i) {
if (button.id == ‘ed_img’) {
document.write(‘
‘);
}
else if (button.id == ‘ed_link’) {
document.write(‘
‘);
}
else if(button.id == ‘ed_coolcode’) {
document.write(‘
‘);
}
else {
document.write(‘
‘);
}
}

因为这个按钮需要接收弹出框的信息,所以要单独写。 Continue reading

HMailServer-免费邮件服务器

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…

JS jscript做小数乘法运算出现浮点错误的解决办法

在Javascript里计算小数乘法,容易出现浮点错误,例如:



输出结果:

1.4300000000000001
1.32

解决问题的思路就是,先把因数放大为整数,最后再除以相应的倍数,这样就能得到正确的结果了。解决办法如下:
1、 在算式中解决



2、添加到Number的原型方法里


使用方法:假如11*22.9,可以这样写tran(11,22.9),这样,问题就解决了。

Ajax and JSON

关于JSON,是很久以前就听说了,但是一直没有真正的去研究,去使用。

关于AJAX,也是很久以前就听说了,而且一直也在研究,在使用。

关于AJAX and JSON,是刚刚开始研究和使用。

JSON,JavaScript Object Notation, 我理解为Javascript 对象标记,可能不太准确,但是这样有助自己理解和使用。高人们都说JSON使用起来要比XML更灵活,更方便,是吗,带着这样的疑问,自己写了个小例子。

Continue reading