JS中每创建一个函数,该函数就会自动拥有一个prototype属性,为什么那??
因为最根上的object拥有一个prototype属性,而js中所有的对象又都继承自object,所以js中所有的对象都拥有一个prototype属性,而在js中函数也是对象,所以js中每个函数也都有一个prototype属性。
例如:function Person(){...} 和function Dog()...
分类:
Web程序 时间:
2015-05-18 09:07:25
阅读次数:
298
You probably have played the game “Throwing Balls into the Basket”. It is a simple game. You have to throw a ball into a basket from a certain distance. One day we (the AIUB ACMMER) were playing the ga...
--创建存储过程point_diatancecreate or replace procedure point_distance Authid Current_User is --定义变量 net1 float; net2 float; net3 int; net4 int; net5 int; l...
分类:
数据库 时间:
2015-05-17 18:15:55
阅读次数:
195
题意:甲乙两条狗分别沿着一条折线奔跑,两只狗的速度未知,但已知他们同时出发,同时到达,并且都是匀速奔跑,试求甲和乙在奔跑过程中最远距离和最近距离之差。
思路:因为运动是相对的,因此也可以认为甲静止不动,乙自己沿着直线走,因此问题转化为求点到线段的最小或最大距离。然后模拟求解。大白P262
#include
#include
#include
#include
#include ...
分类:
其他好文 时间:
2015-05-17 13:48:36
阅读次数:
158
复杂模式: *分组: var reDogDog=/dogdog/g;---------------var reDogDog=/(dog){2}/g; *引用:(注意带括号和不带括号) var sMatch="#123456789"; var reNum=/(#(\d+))/; reNum....
分类:
Web程序 时间:
2015-05-16 18:06:57
阅读次数:
104
Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX.
Now Petya is wondering in how many ways he can choose three distinct points so that the distance be...
分类:
其他好文 时间:
2015-05-16 16:33:10
阅读次数:
138
题目大意:和poj 1741的那题和类似,求树上节点之间的距离小于等于k的节点对有多少对解题思路:具体可参考:《分治算法在树的路径问题中的应用——漆子超》
给这题的输入坑了,注意输入,不然会超时#include
#include
#include
using namespace std;
#define maxn 40010
int vis[m...
分类:
其他好文 时间:
2015-05-16 09:10:52
阅读次数:
111
要是让你实现一只狗,输出它吃骨头,这个程序很简单。新建一个Dog类: 1 public class Dog 2 { 3 public string name; 4 5 public void Show() 6 { 7 ...
作用:可以简单地引用一个类简单使用@class Dog; //类的引入 #import "Dog.h"仅仅是告诉编译器:Dog是一个类;并不会包含Dog这个类的所有内容 具体使用在.h文件中使用@class引用一个类在.m文件中使用#import包含这个类的.h文件#import和@class的.....
分类:
其他好文 时间:
2015-05-14 15:43:23
阅读次数:
256
题目链接:http://poj.org/problem?id=2689题意:给出一个区间[L, R],找出区间内相连的,距离最近和距离最远的两个素数对。其中(1 2 #include 3 typedef long long LL; 4 const int MAXN = 50000; 5 const....
分类:
其他好文 时间:
2015-05-14 13:50:40
阅读次数:
126