上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页
摘要: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.出现这个问题,主要是因为没有在 php.ini 里面对时区进行设置造成的,解决方法是,修改 php.ini,加入:date.timezone="Asia/Chongqing"重启 apache,搞掂! 阅读全文
posted @ 2012-11-12 13:48 DavidHHuan 阅读(315) 评论(0) 推荐(0)
摘要: here is the code for example:#!/bin/bashecho-e"your_password\nyour_password"|sudo/home/davidhhuan/the_shell_you_want_to_run.sh 阅读全文
posted @ 2012-11-12 11:34 DavidHHuan 阅读(275) 评论(0) 推荐(0)
摘要: 原文地址:http://www.myhack58.com/Article/sort099/sort0102/2011/31794.htm一、搭建环境:1、CentOS 6.0虚拟机(最小安装)2、putty3、ssh shell二、准备工作:1、源码包autoconf ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xzfreetype http://nchc.dl.sourceforge.net/project/freetype/freetype2/2.4.10/freetype-2.4.10.tar.bz2gd http://case... 阅读全文
posted @ 2012-10-29 19:05 DavidHHuan 阅读(563) 评论(0) 推荐(0)
摘要: 一、安装并配置MySQL1.1 执行yum命令安装MySQLyum -y install mysql mysql-server1.2 把添加MySQL进开机启动项,并立即启动MySQLchkconfig --levels 235 mysqld on/etc/init.d/mysqld start1.3 设置MySQL root帐号密码mysql_secure_installation二、安装Apache2.1 使用yum命令安装Apacheyum –y install httpd2.2 设置开机启动Apachechkconfig --levels 235 httpd on2.3 启动Apach 阅读全文
posted @ 2012-10-29 18:57 DavidHHuan 阅读(400) 评论(0) 推荐(0)
摘要: gvim是一个神器,不过用它来管理项目的话,有点麻烦,主要是每次关闭了gvim,里面打开的文件记录都会没了,下次打开的时候,又要重新去打开。下面介绍一种方法,用来保存整个项目的文件打开情况。1. 建立文件夹 /home/your_home_folder/.vimsession2. 编辑 /etc/vim/gvimrc"保存/加载项目letg:sessionPath="/home/davidhhuan/.vimsession/""保存当前项目的文件打开情况functionSaveProject()letprojectName=input("ple 阅读全文
posted @ 2012-10-15 18:03 DavidHHuan 阅读(510) 评论(0) 推荐(0)
摘要: All the content of this article only happend in Yii Framework!As we know, with a form, we can both use post and get to send the data. But in Yii, when creating a form as below:<?phpechoCHtml::beginForm('user/index','get');?><?phpechoCHtml::label('User','user01 阅读全文
posted @ 2012-10-15 10:10 DavidHHuan 阅读(693) 评论(0) 推荐(0)
摘要: 情景一,通过 define 定义全局常量//首先定义了一个叫做MAXSIZE的常量define("MAXSIZE",100);//定义一个变量,它的值就是'MAXSIZE'这个字符串$str='MAXSIZE';//通过输出$str这个变量可以得到100这个值echoconstant($str);情景二,类或者接口里面通过 const 定义的常量interfacebar{consttest='foobar!';}classfoo{consttest='foobar!';}$const='test' 阅读全文
posted @ 2012-10-11 11:46 DavidHHuan 阅读(1575) 评论(0) 推荐(1)
摘要: As we know, in Yii, we can set the error handler to display some useful message to the user.But, when i want to display different views in different modules, how to do it?Here is the way.In your module, here let say we have a admin module, there isAdminModule.php in it,then add the code as below:pub 阅读全文
posted @ 2012-10-03 16:55 DavidHHuan 阅读(701) 评论(0) 推荐(0)
摘要: After updated the Ubuntu12.04 with the update-package, i run the virtualbox with Win7, then igot these errors: Failedtoopenasessionforthevirtualmachinewin7.Thevirtualmachine'win7'hasterminatedunexpectedlyduringstartupwithexitcode1.ResultCode:NS_ERROR_FAILURE(0x80004005)Component:MachineInter 阅读全文
posted @ 2012-10-02 10:05 DavidHHuan 阅读(1007) 评论(0) 推荐(0)
摘要: 当使用一些开源的分享按钮,如 jiathis,我们可以在分享的时候,加入一些图片,如以 jiathis 为例,可以通过设置参数varjiathis_config={boldNum:0,siteNum:7,showClose:false,sm:"t163,kaixin001,renren,douban,tsina,tqq,tsohu",imageUrl:"http://v2.jiathis.com/code/images/r5.gif",imageWidth:26,marginTop:150,url:"http://www.jiathis.com 阅读全文
posted @ 2012-09-20 15:10 DavidHHuan 阅读(855) 评论(0) 推荐(0)
摘要: From the code generated by the yiic, as we know, using these code can only get id and username from Yii::app()->user after logined:$identity=newUserIdentity($_POST['LoginForm']['username'],$_POST['LoginForm']['password']);Yii::app()->user->login($identity);bu 阅读全文
posted @ 2012-09-07 14:01 DavidHHuan 阅读(445) 评论(0) 推荐(0)
摘要: Virtualbox实现虚拟机与主机互相访问,并且虚拟机成为主机所在局域网的一台可访问机器主机A:window XP sp3虚拟机B:window XP sp3在A使用VirtualBox里面搭建B,实现B与A互相访问,并且B成为A所在局域网的一台可访问机器,目的是为了测试不同的IE(纯净的IE,非使用那些IEtester,IEcollection)下面的网站显示,同时为了方便其它同事也能够使用B,所以才写下这篇文章来记录一下。安装VirtualBox在A里面安装VirtualBox,然后按照常规做法安装好B(详细过程可google之)。设置B的网络网卡1:网卡2:也就是说,网卡1使用桥接模式 阅读全文
posted @ 2012-08-31 11:54 DavidHHuan 阅读(959) 评论(0) 推荐(0)
摘要: i am developing a plugin for getting rss from a website which is utf-8, when loading the code from the site, i got these error:<type'exceptions.UnicodeDecodeError'>:'ascii'codeccan'tdecodebyte0xe5inposition9here is the code what i used before: title=entry_rss.title.encode(& 阅读全文
posted @ 2012-08-24 10:56 DavidHHuan 阅读(1774) 评论(0) 推荐(0)
摘要: 比如说,我有一个启动程序,想在桌面上面放一个图标,直接双击就可以打开。在桌面建立文件 my_app.desktop,注意后缀名是 .desktop,然后如下的代码:[DesktopEntry]Encoding=UTF-8Name=MyAPPComment=MyAPPiswonderfulExec=/bin/sh"/home/davidhhuan/Software/myapp/bin/myapp"Icon=/home/davidhhuan/Software/myapp/myapp.pngCategories=Application;Development;Java;IDEVe 阅读全文
posted @ 2012-08-15 11:02 DavidHHuan 阅读(425) 评论(0) 推荐(1)
摘要: 再谈Yii Framework中的事件event,我写过的关于Yii事件event的另一篇文章[Yii Framework] Yii中事件和行为的区别和应用 http://www.cnblogs.com/davidhhuan/archive/2012/01/19/2326123.html假设有类MyComponent,它是继承于CComponent,通过查看 CComponent 的 __set() 方法,publicfunction__set($name,$value){$setter='set'.$name;if(method_exists($this,$setter))r 阅读全文
posted @ 2012-07-23 16:28 DavidHHuan 阅读(739) 评论(0) 推荐(2)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页