css width height not working

sometimes you may find that css width height does not working for html tag b, span,div i came across it also i set the position: absolute, then it do work well below is my css, you can test .loading { left: 25px; position: absolute; top: 20px; background-image: url(“./Resources/loading.gif”); overflow: hidden; height: 40px; width: 40px; background-repeat: no-repeat; }  

how to assign var to php template view file

 the function below demo how to assign var to php template view file 下面的函数显示怎么传递变量到模板文件里 public function renderInternal($_viewFile_,$_data_=null,$_return_=false) { // we use special variable names here to avoid conflict when extracting data if(is_array($_data_)) extract($_data_,EXTR_PREFIX_SAME,’data’); else $data=$_data_; if($_return_) { ob_start(); ob_implicit_flush(false); require($_viewFile_); return ob_get_clean(); } else require($_viewFile_); }

安装watir gem install watir 出了好多错

安装watir   gem install watir 出了好多错

例如:too many connection resets

SocketError: getaddrinfo:

Unable to resolve dependencies:

the installation aborts because of the network issue, but i don’t know why, the only thing i can do is that retry over and over again, it finally install successfully,  below is my retry history

但有时好像又可以进行下去, 可能是由于网络的原因, 中途会失败,也不知道是为什么, 只能一次一次进重试,最终还是成功啦, 花了不少时间

C:\Users\guangjun>gem install watir
ERROR:  While executing gem … (Gem::RemoteFetcher::FetchError)
too many connection resets (http://production.cf.rubygems.org/gems/win32-a
-1.4.8-x86-mingw32.gem)

C:\Users\guangjun>gem install watir
ERROR:  While executing gem … (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: No such host is known.  (http://rubygems.org/gem
win32-api-1.4.8-x86-mingw32.gem)

C:\Users\guangjun>gem system –update
ERROR:  While executing gem … (RuntimeError)
Unknown command system

C:\Users\guangjun>gem update –system
Latest version currently installed. Aborting.
C:\Users\guangjun>gem install watir –no-ri –no-rdoc
Fetching: windows-pr-1.2.0.gem (100%)Fetching: windows-pr-1.2.0.gem
Fetching: win32-process-0.6.5.gem (100%)
Fetching: xml-simple-1.0.15.gem (100%)
Fetching: hoe-2.9.4.gem ( 37%)ERROR:  While executing gem … (Gem::RemoteFetc
r::FetchError)
too many connection resets (http://production.cf.rubygems.org/gems/hoe-2.9
.gem)

Read more

xdebug调试php,断点不起作用

在xp上装了eclipse和VMware, 在VMware上装了redhat, 在redhat上装了apache,php,xdebug,在php.ini里配置xdebug如下: zend_extension=/usr/lib/php/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so xdebug.remote_enable=On xdebug.remote_autostart=On xdebug.remote_handler=dbgp xdebug.remote_host=xx.xx.xx.xx xdebug.remote_port=9000 xdebug.remote_mode=req 然后在eclipse里设置断点,发现断点不起作用,直接所有的代码一次性运行完了,到xdebug官网仔细看了下配置的说明, 原来xdebug.remote_host并不是apache所在服务器的IP, 而是远程调试机的IP, 我的情况,也就是xp的ip, 而不是VMware上redhat的IP,可原来我却把xx.xx.xx.xx配成了redhat的IP, 修改xx.xx.xx.xx为xp的IP,重启apache, 一试,果然单步调试成功了。

zend studio打不开页面

今天想试一下zend studio, 在官方网下载好在win7下安装后,发现zend server其实就是apache, zend studio就是扩展了eclipse,但zend server/studio却还要收钱,真不知道是怎么遵守开源协议的。 创建一个test项目后,结果页面都打不开,返回的错误是这样的:Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about … Read more

window live writer wordpress出错

当出现下面的问题时: The response to the metaWeblog.getRecentPosts method received from the blog server was invalid: Invalid response document returned from XmlRpc server 可以用下面的方法解决: 因为wordpress本身的一个bug,在utf-8编码下,在wp-includes文件夹下, xml-rpc返回的格式不正确,缺了三个字节,要修正这个问题,按如下操作即可: 用一个文本编辑工具打开class.ixr.php,查找: $length = strlen($xml); 替换为:<!–more –> $length = strlen($xml)+3; 就可以解决这个问题了!

ruby版本的discuz自动注册机

概要:
为了让别人以为你discuz网站的注册用户比较多,你可能需要注册大量虚假用户来伪造discuz网站的人气,如果手动地注册,那效率肯定会很低,势必需要一个工具来帮我们自动化地完成这个工作,本人就用ruby写了这样一个自动为discuz注册用户的工具.

Read more

ruby watir安装

照官方网站上说的安装[http://watir.com/installation/#win],老是在运行

gem update --system
gem install watir

的时候出错,错误如下:

C:\ruby\bin>gem update –system
Updating RubyGems…
Attempting remote update of rubygems-update
Install required dependency builder? [Yn]  Y
ERROR:  While executing gem … (Gem::GemNotFoundException)
    Could not find builder (>= 0) in any repository

Read more

discuz Access denied

由于在把PHP 版本的discuz从7.0升级到7.2中忘记了备份config.inc.php而直接覆盖掉了原来的,升级完了之后出现了Access denied的问题,经过查找,发现了解决方法: 把ucenter目录的下的config.php里的UC_XXX配置部分复制到config.inc.php里,然后刷新就可以了。 原因可能是UC配置部分是程序在安装的时候自动生成的,但我却用最原始的配置文件覆盖了。 我复制内容如下: //应用的UCenter配置信息(可以到UCenter后台->应用管理->查看本应用->复制里面对应的配置信息进行替换) define(‘UC_CONNECT’, ‘mysql’); // 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen(), mysql 是直接连接的数据库, 为了效率, 建议采用 mysql define(‘UC_DBHOST’, ‘localhost’); // UCenter 数据库主机 define(‘UC_DBUSER’, xxx); // UCenter 数据库用户名 define(‘UC_DBPW’, xxx); // UCenter 数据库密码 define(‘UC_DBNAME’, xx); // UCenter 数据库名称 define(‘UC_DBCHARSET’, ‘gbk’); // UCenter 数据库字符集 define(‘UC_DBTABLEPRE’, ‘`xxx`.uc_’); // UCenter 数据库表前缀 define(‘UC_DBCONNECT’, ‘0’); // UCenter … Read more