java.sql.SQLException: Unable to connect to any hosts due to exception: java.lang.ArrayIndexOutOfBoundsException: 40 at com.mysql.jdbc.Connection.createNewIO(Connection.java:1797) at com.mysql.jdbc.Connection.<init>(Connection.java:562) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegiste ...
2008-04-25

window+lighttpd+php 配置经验简谈

关键字: window lighttpd php
网上找了很多资料,但都不是很全,这里汇总一下 准备工作: 1 从 lighttpd 的官方网下载window版的exe安装版 2 php 的可以是 window下的安装版或解压版都可以 安装步骤: 1 安装lighttpd,安装到指定目录下比如C:\Server\lighttp1.4.19-1\,本人装的LightTPD-1.4.19-1-Win32-SSL.exe 2 解压或安装php到指定目录下,比如C:/Server/php5/ 接下来就是配置了 第一步把 C:\Server\lighttp1.4.19-1\conf\lighttpd-inc.conf打开 把cgi的modules放 ...
2008-04-23

Share methods in Controller and Helper (Rails)

关键字: helper method
在Ruby on Rails里面,首先应该明确的一点 —– Helper是view的helper,根据这个原则,在默认实现下,controller是不允许访问helper里面的方法的。当然helper在本质上是一个module,所以要在controller和helper之间共享一些方法的办法还是很多的。因为是双方都拥有的方法,所以就面临一个问题 —— 方法放在那里比较合理?controller还是helper?我阐述一下我的原则: 如果方法中需要引入其他helper方法,那么我们建议该方法放在helper中;否则,可以放在controller中或者写一个公共module。放在controll ...
#i 原始数 n 要保留的小数位数,flag=1 四舍五入 flag=0 不四舍五入 def f(i,n,flag) y = 1 n.times do |x| y = y*10 end if flag==1 (i*y).round/(y*1.0) else (i*y).floor/(y*1.0) end end
qsky
搜索本博客
我的相册
321b365c-1af4-3331-8b30-a64f0bc28d44-thumb
63dad6c7-7277-4b29-a306-7ee133078881
共 1 张
存档
最新评论