double cross(Point a,Point b){ return a.x*b.y-a.y*b.x;}double mul(Point p0,Point p1,Point p2){ return cross(p1-p0,p2-p0);}double dis(Point a){ ...
分类:
其他好文 时间:
2014-07-03 20:28:07
阅读次数:
195
1.析构函数不继承;派生类对象在析构时,基类析构函数的调用顺序与构造函数相反。
注:派生类对象建立时要调用基类构造函数,派生类对象删除时要调用基类析构,顺序与构造函数严格相反。
2.例子
example 1
#include
#include
class Point
{
public:
Point(double a, double b, doule c)
...
分类:
编程语言 时间:
2014-07-02 08:26:49
阅读次数:
298
-(UIColor*)colorOfPoint:(CGPoint)point{unsignedcharpixel[4]={0};CGColorSpaceRefcolorSpace=CGColorSpaceCreateDeviceRGB();CGContextRefcontext=CGBitmapContextCreate(pixel,1,1,8,4,colorSpace,kCGImageAlphaPremultipliedLast);CGContextTranslateCTM(context,-point.x..
分类:
其他好文 时间:
2014-07-02 06:28:29
阅读次数:
194
很久没写博文,今天刚好有同事问到:NGUI为什么做的界面图片那么模糊,比美术给的图片相比不是很清晰。
其实这个问题解决方法很简单,只要把NGUI生成的图集的图片类型改成“GUI”或者“Advance”(去掉generate mip maps),而且Filter Mode都选择(Point)。
这样即可。...
分类:
其他好文 时间:
2014-07-01 09:00:07
阅读次数:
321
/*
* 备忘录模式
*/
#include
//保存值
class mySavevalue
{
public:
mySavevalue(string user_name = "",
int life_value = 100,
int magic_point = 100,
int rank_values =...
分类:
其他好文 时间:
2014-07-01 08:49:27
阅读次数:
203
关键是在检测到手指移动的时候用mPath.quadTo的方法,android sdk解释是:
Add a quadratic bezier from the last point, approaching control point (x1,y1), and ending at (x2,y2). If no moveTo() call has been made fo...
分类:
移动开发 时间:
2014-07-01 08:07:39
阅读次数:
289
题目
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
方法
publi...
分类:
其他好文 时间:
2014-07-01 07:49:33
阅读次数:
186
题目如下:
Maze Exploration
A maze of rectangular rooms is represented on a twodimensional grid as illustrated in figure 1a. Each point of thegrid is represented by a character. ...
分类:
其他好文 时间:
2014-07-01 06:57:08
阅读次数:
231
题目
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
方法
publi...
分类:
其他好文 时间:
2014-06-30 19:36:33
阅读次数:
163
题目
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
方法
每次选择一个点,和其他n - 1个点,进行判断,统计最多的。
double computeSlope(Point a, Point b) {
...
分类:
其他好文 时间:
2014-06-30 15:48:45
阅读次数:
184