asp vbscript报错“字符串空间不够”

asp vbscript报错"字符串空间不够"

写一个新产品的rss,把所有xml拼接到一个字符串里,然后一并response.write输出,但在服务器上运行时,出错了,asp/vbscript报错"字符串空间不够",出错的行,也确实是拼接字符串的行。

字符串还会空间不够,只有几百条产品的rss,感觉最大也只不过几十K的样子。怀疑是否是程序有错,但这样简单的程序,应该不会写错的,google一下,好像没有看到有用的东西,有两篇也是没有解决的“死”问题。看来还得自己解决。

根据错误提示,像是说字符串长度问题,也是是超出了vbs字符串允许的最大长度,印像中vbs不该这样超过长度——不是科班出身,没有系统的学过vbscript,不知道vbs的字符串是否有长度限制——

那就姑且当它是超过了允许最大长度,修改一下:既然是超过最大长度,那就让它分批输出,加上如下面代码中标红代码。

上传运行,正常,问题解决。

看来真的vbscript真的有字符串最大长度限制。

i=1
do while not rs.eof
if i mod 30=0 then
response.Write(str)
str=""
end if

str = str + "<item id="""&i&"""><title><![CDATA["&rs("title")&"]]></title>"& vbcrlf
str = str + "<link>"&linkurl&rs("id")&"</link>"& vbcrlf
str = str + "<description><![CDATA["&rs("title")&"<br>Number:"&rs("number")&"<br>"&left(rs("intro"),500)&"]]></description>"& vbcrlf
str = str + "<pubDate>"&rs("date")&"</pubDate>"& vbcrlf
str = str + "</item>"& vbcrlf
rs.movenext
i=i+1
loop
rs.close

php的文档里有这样一段话:

"注: 一个字符串变得非常巨大也没有问题,PHP 没有给字符串的大小强加实现范围,所以完全没有理由担心长字符串。"

但vbscript没有见过这样的说法,也可能是记串了。

windows下安装多个不同版本的apache+php/多版本共存

这个办法事实上有缺陷的,印象中后来实际使用中发现过问题,大概是php读取php.ini文件的目录、还有PATH环境变量的问题,具体不记得了,是好几年前的东西。windows下还是不折腾了。或者可以试试fast cgi模式。(补记于 161011 13:16)

如下几个php根目录下文件,拷到apache的/bin/目录

php5ts.dll

libmysql.dll

apache配置文件里
LoadModule php5_module "G:/Program Files/php5/php5apache2.dll"
PHPIniDir "G:/Program Files/php5"  ##这一条很重要

在命令行下运行apache/bin/Apache.exe,后面不需要带apache配置文件路径等参数就可以,如果有错误,把报错的.dll文件拷到apache/bin里,直到没有错误为止

先简单的写一下,主要的核心步骤,具体内容稍后再完善。

wordpress启用新主题zBench

wordpress启用新主题zBench,花了老长时间,总体比较满意。

下班后在公司找主题,因为以前用的INove使用的人太多,的确是款很经典的主题,wp升级到3.0后,就换用自带主题twentyten,然而实在不够美观,于是找新主题。在公司里,在一个测试用的wp后台里共看到52页的主题,一页一页翻到28页,找到了几个感觉比较好一点的,试过不好的直接就删掉了。只留少数几个,然后再行比较,明显相对较差的,也删除,基本也锁定在zBench。回来后,对几个主题再试用一下,还是这个好点,于是到这个正式的wp安装。要调侧边栏,GA配置等好几项,忙了老久,快一点,才算是到一段落,其它还有些功能,没有完整检测是否正常。不过大问题应该没有。现在已经01:03了,非常困,睡觉了。

IE9 preview试用,很垃圾,很失望

或许毕竟还只是preview版本的原因,也或许是IE实在垃圾的原因,试用了一个ie9 preview4版本,当然是m$官方下载了,google搜索ie9,第一条就是,下载,用上网本的windows7下的firefox下载,速度不快,开始50K,半分钟就隆到10K以下了,于是在frdora下使用jigsaw下载,速度平均在40K左右的样子,2M的带宽,下载只有这么40K,可能是ms他们的下载服务器没搞好,或者考虑到只是下预览版,没有考虑大量下载负荷的问题。拷到上网本的win7下,安装,照例是傻瓜安装,也照例是安装微软程序习惯的“重启”电电脑。重启吧,是多系统,win7只是其中一个,不是默认进入,还要选择。启动过程中,又出现“windows update正在配置”的提示,还要下载3个更新包,应该并不大,几分钟完成了,进入windows画面。桌面上多出来傻傻的IE图标,点击进去,果然跟网上别人发的图片一样,没有地址栏,要从菜单里打开一个输入地址的小对话框。菜单也简陋得不成样子,但里面第二个菜单项就是debug,看来微软意识到他自己浏览器的问题了,要附带上一下调试工具,不然,鬼才能搞懂那变态的、诡异的css支持。没有仔细看是否调试里有IE5,7,8几个版本的兼容选项,就是没有IE6。打开google首页随便搜索个关键词,机器猫css,想看看IE9preview对css的支持如何,是否真的如网上的篇文章里说的、连google都有称赞它的地方。然而结果列表链接去好像无法打开,试几次都不知,于是直接关掉,然后卸载ie9,实在比较垃圾,这个ie9.虽然maxthon等浏览器也基于ie的内核,但加入了很多实用的功能,可ie,却像头老病牛一样,一点一点的挪动着,缓缓的,比散步都慢,堪称牛步。

垃圾114的程序错误

垃圾的流氓114,劫持dns,突然它的页面上显示了一大堆出错消息。

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_parser_set_option(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 63

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 64

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 64

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_element_handler(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 65

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_character_data_handler(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 66

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_parser_free(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 68

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_parse(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 73

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_parse(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /usr/local/apache2/htdocs/web/xml.php on line 73

fedora 12,13,14,15,16/centOS/redhat EL 使用第三方yum 源rpmfusion.org

以下内容来源于rpmfusion.org官方网站的使用说明

通过命令行注册并启用rpmfusion.org yum 源/Command Line Setup using rpm

To enable access to both the free and the nonfree repository use the following command:

  • Fedora 12 and 13 and 14 and 15:
    su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
  • Fedora Rawhide and what will become Fedora 16 (Alpha, Beta and snapshots):
    su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-rawhide.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-rawhide.noarch.rpm'
  • RHEL5 or compatible like CentOS:
    su -c 'rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm'

官方网站的说明上好像还有使用浏览器安装rpm源的,没有试过,还是习惯使用命令行操作,毕竟命令行才是根本。

http://rpmfusion.org/Configuration

rpmfusion.org yum 源简介

RPM Fusion 是为 Fedora 及 Red Hat Enterprise Linux 用户提供的一个软件包仓库。各位 Fedora/RHEL /centOS朋友要是想要安装的软件在官方的仓库中找不到,不要泄气,兴许通过 RPM Fusion 你就找到了。

新启动的 RPM Fusion 合并了原有的 Dribble、Freshrpms、Livna 等软件包仓库,将成为最大的第三方软件包仓库。

通过 RPM Fusion 软件包仓库,你将找到 ATI/NVIDIA 显卡驱动、私有的音频/视频编码/解码器、游戏、模拟器、以及其他软件包等。