博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年11月14日

摘要: php文件置于httpd服务器下有时候会出现无法解析,此时将文件执行权限x全部去掉试一下可以解决问题 阅读全文

posted @ 2011-11-14 16:16 douyamumu 阅读(117) 评论(0) 推荐(0)

2011年10月28日

摘要: Double quotes will remove the special meaning of all characters except the following: $ variable Substitution. ` Backquotes \$ Literal Dollar Sign. \´ Literal Backquote. \” Embedded Doublequote. \\ Embedded Backslashes.echo $var, echo "$var", echo '$var'区别echo $var会将$var内的内容用空 阅读全文

posted @ 2011-10-28 09:20 douyamumu 阅读(121) 评论(0) 推荐(0)

2011年10月22日

摘要: 1.PHP数据类型为动态类型,由它存储的值自动确定类型,类型可以变换;声明变量时不需指定变量类型,2.define函数定义常量时常量变量全大写(惯例)3.使用常量变量时常量变量前边不需药加$符号。4.变量类型可以测试并重新设置 5.switch可以支持int, float, string。(比C/C++范围广) 6.对一个string变量赋值时值中的空白符(换行 空格 制表)都会按所见即所得的方式保存,如: $var = "This sentence has two lines." 这里string型变量$var中含有换行符,这点与C/C++不一样。在C++中string变 阅读全文

posted @ 2011-10-22 19:14 douyamumu 阅读(176) 评论(0) 推荐(0)

2011年10月13日

摘要: There are many ways to install LAMP.Here shows the most easiest way to install LAMP using yum program.1)Install the CentOS OS. 2)yum install httpd php mysql mysql-server3)service httpd start4)service mysqld start5)Once both services is running, you can point your browser to http://localhost and you. 阅读全文

posted @ 2011-10-13 09:44 douyamumu 阅读(128) 评论(0) 推荐(0)

2011年9月30日

摘要: 1.需要使用常量值时使用const变量(在头文件中定义),不要使用#define。2. 不要使用#define max(a, b) ((a) > (b)) ? (a) : ( b)这类宏,而是采取在头文件中定义相同功能的inline函数,inline函数可以同样实现高效率并保证类型安全,若要支持泛型只需将inline函数定义为模板。3.内存分配上使用new和delete,不要使用malloc跟free。最重要的是不要二者混用。(malloc在分配内存时不会使用构造函数,分配的内存没有初始化,free释放内存时也不会调用对象的destructor,这对于自身还分配其他内存的对象来说会造成内 阅读全文

posted @ 2011-09-30 10:36 douyamumu 阅读(158) 评论(0) 推荐(0)

2011年9月23日

摘要: 函数模板要指明为inline时将inline置于模板型参表之后,返回值之前,比如: template <class T> inline T min(const T& a, const T& b); //最好将其放在头文件中直接定义。 阅读全文

posted @ 2011-09-23 10:30 douyamumu 阅读(110) 评论(0) 推荐(0)

2011年9月21日

摘要: To substitute new for the first old in a line: type :s/old/newTo substitute new for all old on a line: type :s/old/new/gTo substitute phrases between two line #'s: type :#,#s/old/new/gTo substitute all occurrences in the file: type :%s/old/new/gTo ask for confirmation each time add 'c': 阅读全文

posted @ 2011-09-21 21:15 douyamumu 阅读(128) 评论(0) 推荐(0)

2011年9月20日

摘要: 对于序列A[p,p+1,p+2,...,q],indexOfMiddle = floor((p+q)/2) (对p<=q恒成立,即使p<0) 阅读全文

posted @ 2011-09-20 23:12 douyamumu 阅读(103) 评论(0) 推荐(0)

摘要: In general, if Foo is a subtype (subclass or subinterface) of Bar, and G is some generic type declaration, it is not the case that G<Foo> is a subtype of G<Bar>. This is probably the hardest thing you need to learn about generics, because it goes against our deeply held intuitions. e.g. 阅读全文

posted @ 2011-09-20 09:42 douyamumu 阅读(202) 评论(0) 推荐(0)

摘要: 大多数情况,只需要安装MySQL-server和MySQL-client软件包来安装MySQL. 想要运行含更多功能的MySQL-Max服务器,还应当安装MySQL-Max RPM。必须先安装M MySQL-server RPM再安装该模块. 要想执行标准最小安装,运行: shell> rpm -i MySQL-server-VERSION.i386.rpm shell> rpm -i MySQL-client-VERSION.i386.rpm 要想只安装客户端软件包,运行: shell> rpm -i MySQL-client-VERSION.i386.rpm 阅读全文

posted @ 2011-09-20 09:39 douyamumu 阅读(103) 评论(0) 推荐(0)