把对象当参数传递给方法,在方法里改过对象后,影响到外面的对象
因为对象是引用传递过去的class Book { public $name; public function __construct($name) {
$this->name = (string)$n...
分类:
Web程序 时间:
2014-05-12 03:34:37
阅读次数:
386
在开发的过程中,我们经常要输出一下变量看看得到的结果是什么,我们就要根据变量的类型选择使用echo,print_r或者var_dump,brophp框架中的p()函数会自动根据变量类型选择用什么方法为我们输出变量,所以我收藏了
function p() { $args=func_...
分类:
其他好文 时间:
2014-05-12 02:59:51
阅读次数:
298
javascript解释器中存在一种变量声明被提升(hoisting)的机制,即变量(函数)的声明会被提升到作用域的最前面。即使把声明代码写在最后面。
alert(foo); //function foo(){} alert(bar); //undefined var bar = func...
分类:
编程语言 时间:
2014-05-12 00:42:19
阅读次数:
369
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare,
//node为Element时返回node所属document
//node为Document时返回node
//node为空时返回window.document
doc = node ? node.ownerDocument || node...
分类:
Web程序 时间:
2014-05-11 22:41:15
阅读次数:
459
Option Explicit
Function stripHTML(strtext)
dim arysplit,i,j, strOutput
arysplit=split(strtext,"
if len(arysplit(0))>0 then j=1 else j=0
for i=j to ubound(arysplit)
if instr(arysplit(i),">") ...
分类:
其他好文 时间:
2014-05-11 21:56:06
阅读次数:
355
右键弹出自定义菜单,很有意思呀!
右键菜单
function showmenuie5(){
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY
if (rightedge
ie5menu.style.left=d...
分类:
其他好文 时间:
2014-05-11 20:20:35
阅读次数:
240
$(document).ready(function () { var
tag=$(".tags"); tag.mouseover(function(){
$(this).addClass("tagOn").siblings().removeClass("tagOn"); var index ...
分类:
Web程序 时间:
2014-05-11 18:22:45
阅读次数:
415
function getElementsByClassName(str,root,tag){
if(root){ root = typeof root == "string" ? document.getElementById(root) : root;
} els...
分类:
编程语言 时间:
2014-05-11 18:20:00
阅读次数:
316
【题目描述】给你一张无向图G(V,E)。每个顶点都有一个标号,它是一个[0,2^31-1]内的整数。不同的顶点可能会有相同的标号。对每条边(u,v),我们定义其费用cost(u,v)为u的标号与v的标号的异或值。现在我们知道一些顶点的标号。你需要确定余下顶点的标号使得所有边的费用和尽可能小。【输入格...
分类:
其他好文 时间:
2014-05-11 18:13:16
阅读次数:
305
C++语言的对象化模型.封装,隐藏内部实现.继承,复用现有代码.多态,改写对象行为本文描述了一个C++实现的继承和多态的场景,然后用C语言编写了一种对等的实现。//
A typical example of inheritance and virtual function use.// We wou...
分类:
编程语言 时间:
2014-05-11 18:03:47
阅读次数:
412