1) 观察者模式定义略,各种设计模式的书上都有定义。2) 观察者模式一般实现观察者模式一般实现,都是“被观察者”保存一个“观察者”的列表,循环这个列表来通知“观察者”。代码,其中使用了boost的智能指针shared_ptr:[cpp]view plaincopy#include#include#i...
分类:
其他好文 时间:
2015-04-23 23:10:45
阅读次数:
226
题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not poss...
分类:
其他好文 时间:
2015-04-23 17:17:59
阅读次数:
170
题目:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum ...
分类:
其他好文 时间:
2015-04-23 15:16:10
阅读次数:
214
题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't ...
分类:
其他好文 时间:
2015-04-23 15:14:35
阅读次数:
107
效果如图
这是一个非常简略的计算器。。。。
放上代码
class.h
class list
{
public:
list(){ a = 1; b = 1; e = '+'; }
list(double x, CString p, double y) :a(x), e(p), b(y){}
double calculate(void);
private:
double a, ...
分类:
其他好文 时间:
2015-04-23 00:07:33
阅读次数:
153
一、设计思路(1)输入发帖ID记录表(2)从第一个ID开始,与后续的发帖ID进行比较,若相同计数器则加一,否则减一。若计数器的数值被减为零,则重新选取当前ID开始记录比较。(3)输出结果二、源代码 1 // shuiwang.cpp : Defines the entry point for the...
分类:
编程语言 时间:
2015-04-22 23:43:28
阅读次数:
149
2783: [JLOI2012]树Time Limit:1 SecMemory Limit:128 MBSubmit:551Solved:323[Submit][Status][Discuss]Description数列提交文件:sequence.pas/c/cpp输入文件:sequence.in输...
分类:
其他好文 时间:
2015-04-22 20:36:54
阅读次数:
138
代码下下来,用2012编译,
http://developer.download.nvidia.com/SDK/10.5/direct3d/samples.html
找到soft shadowmap的那个例子,缩略图是一个武士拿着剑站在草地上
我的笔记本显卡的glsl版本是 4.3的,
编译完一跑就报错,
修改SoftShadows.cpp 288行
NvSco...
分类:
其他好文 时间:
2015-04-22 18:25:04
阅读次数:
396
提纲题目要求程序代码结果图片题目要求:加载一副多细节图像a、利用cvResize函数缩小图像,每个维度上比例为2,重复三次并显示结果b、利用cvPyrDown函数在原始图像上进行三次降采样,显示结果程序代码: 1 // OpenCVExerciseTesting.cpp : 定义控制台应用程序的入....
分类:
其他好文 时间:
2015-04-22 17:45:49
阅读次数:
122
live555ProxyServer.cpp在live/proxyServer目录下,这个程序展示了如何利用live555来做一个代理服务器转发rtsp视频(例如,IPCamera的视频)。 首先来看一下main函数 1 int main(int argc, char** argv) 2 {...
分类:
其他好文 时间:
2015-04-22 13:35:53
阅读次数:
1158