For a period before the recent nationwide gold industry shutdown, Duration was Zimbabwe’s second largest gold producer. Up until that point, it had en...
                            
                            
                                分类:
其他好文   时间:
2014-06-25 23:20:27   
                                阅读次数:
274
                             
                    
                        
                            
                            
                                1.欧拉筛法在线性时间内求素数以及欧拉函数代码: 1 procedure get; 2 var i,j,k:longint; 3 begin 4 tot:=0; 5 fillchar(check,sizeof(check),false); 6 for i:=2 to n do 7 be...
                            
                            
                                分类:
其他好文   时间:
2014-06-25 22:11:51   
                                阅读次数:
574
                             
                    
                        
                            
                            
                                配置环境说明 192.168.3.80-XSCF地址192.168.2.80-solaris操作系统IP地址 (nagios客户端)192.168.2.120-nagios服务器端check_xscf.pl-检查xscf的执行脚本,放在nagios客户端上。check_xscf.cfg-检查xscf...
                            
                            
                                分类:
移动开发   时间:
2014-06-25 21:23:57   
                                阅读次数:
208
                             
                    
                        
                            
                            
                                【问题】
Given n points
 on a 2D plane, find the maximum number of points that lie on the same straight line.
【思路】
对每一个点,分别计算这个点和其他所有点构成的斜率,具有相同斜率最多的点所构成的直线,就是具有最多点的直线。
【代码】
class Point:
	def __in...
                            
                            
                                分类:
编程语言   时间:
2014-06-25 19:34:29   
                                阅读次数:
246
                             
                    
                        
                            
                            
                                create table student
(
	id varchar2(5) primary key,
	name varchar2(20), not null,
	sex char(2) check(sex='男' or sex='女')
)
--向student中插入一条数据,用函数来验证插入是否正确
create or replace function (f_id in varchar2...
                            
                            
                                分类:
数据库   时间:
2014-06-25 00:11:31   
                                阅读次数:
376
                             
                    
                        
                            
                            
                                Intersection
大意:给你一条线段,给你一个矩形,问是否相交。
    相交:线段完全在矩形内部算相交;线段与矩形任意一条边不规则相交算相交。
思路:知道具体的相交规则之后题其实是不难的,但是还有个坑点就是题目里明明说给的是矩形左上角跟右下角的点,但实际上不是,需要重新判断一下...真坑。
struct Point
{
    double x, y;...
                            
                            
                                分类:
其他好文   时间:
2014-06-24 23:49:48   
                                阅读次数:
446
                             
                    
                        
                            
                            
                                (一)
有时候为了让一个对象尽量小,可以把数据放在另外一个辅助的struct中,然后再让一个类去指向它。看下面的代码:
class Point {
public:
	Point(int x, int y);
	void setX(int newVal);
	void setY(int newVal);
};
struct RectData {
	Point ulhc;
	Point lrhc...
                            
                            
                                分类:
编程语言   时间:
2014-06-24 22:17:30   
                                阅读次数:
240
                             
                    
                        
                            
                            
                                Intersecting Lines
大意:给你两条直线的坐标,判断两条直线是否共线、平行、相交,若相交,求出交点。
思路:线段相交判断、求交点的水题,没什么好说的。
struct Point{
    double x, y;
} ;
struct Line{
    Point a, b;
} A, B;
double xmult(Point p1, Point...
                            
                            
                                分类:
其他好文   时间:
2014-06-24 21:16:40   
                                阅读次数:
155
                             
                    
                        
                            
                            
                                安装 http://c-ares.haxx.se/
安装 http://concurrencykit.org/
\cp build/ck.pc  /usr/lib64/pkgconfig/
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
错误1:
修改cpplint.py, def...
                            
                            
                                分类:
其他好文   时间:
2014-06-24 17:34:43   
                                阅读次数:
294
                             
                    
                        
                            
                            
                                题目
Given n non-negative integers a1, a2,
 ..., an, where each represents a point at coordinate (i, ai). n vertical
 lines are drawn such that the two endpoints of line i is at (i, ai) and (...
                            
                            
                                分类:
其他好文   时间:
2014-06-24 16:00:49   
                                阅读次数:
220