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
【问题】
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
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
前段时间学习EJB,接触到了JMS(Java消息服务),JMS支持两种消息模型:Point-to-Point(P2P)和Publish/Subscribe(Pub/Sub),即点对点和发布订阅模型。
个人觉得这两个模型挺容易理解的,因为生活中的例子还挺多的。
1, P2P模型
有以下概念:消息队列(Queue)、发送者(Sender)、接收者(Receiver)。每个消息都被发送到一个特定...
分类:
其他好文 时间:
2014-06-22 22:41:24
阅读次数:
319
定制操作_2
完整的biggies
好吧上一章是有点2B了,我的,昨天可能是刚考完心情有点小激动就不想学习了,我错了!!
/**
* 功能:定制操作
* 时间:2014年6月19日07:32:03
* 作者:cutter_point
*/
#include
#include
#include
#include
#include
using namespace std;
vo...
分类:
编程语言 时间:
2014-06-22 19:24:25
阅读次数:
222
以下的一段代码:
#include
greeting()
{
printf("Hello, world!\n");
}
main()
{
greeting();
}
经过gcc、ld(链接、编译)之后,生成一个elf可执行文件,再使用objdump处理,生成的反汇编代码如下:
08048368 :
8048368: 55 push %ebp
8048369: 89 e5 mov %esp,...
分类:
系统相关 时间:
2014-06-22 17:34:39
阅读次数:
351
PMON: Process Monitor 用自动注册动态监听,处理异常进程。
SMON: System Monitor 用于instance recovery。
LCKn:仅使用于RAC数据库,用于instance之间的封锁。
RECO:用于分布式数据库的恢复,全称是Distributed Database Recovery。
CKPT: Check Point 由ORACLE的FAST...
分类:
数据库 时间:
2014-06-22 12:22:00
阅读次数:
232
POJ 3304 Segments
大意:给你一些线段,找出一条直线能够穿过所有的线段,相交包括端点。
思路:遍历所有的端点,取两个点形成直线,判断直线是否与所有线段相交,如果存在这样的直线,输出Yes,但是注意去重。
struct Point
{
double x, y;
} P[210];
struct Line
{
Point a, b;
} L...
分类:
其他好文 时间:
2014-06-22 12:06:30
阅读次数:
225
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2014-06-22 10:45:17
阅读次数:
258