- 浏览: 411325 次
- 性别:
- 来自: 北京
-
最新评论
-
ahead_zhan:
good good good
flex3控件_ModuleLoader -
lonerzf:
好样的。非常感谢楼主
OpenCV视频教程整理 -
lonerzf:
好样的。谢谢~
OpenCV视频教程整理 -
coding1688:
博主说的不错,我在实现瀑布流布局时也用的masonry插件,有 ...
Javascript 瀑布流式布局及其动态效果的实现 -
snowolf:
除非玩游戏,不然没啥win的事情,或者用win的银行客户端,通 ...
macbook安装操作系统的机理分析
文章列表
翻转位(reverse bits)c++ 实现
- 博客分类:
- 算法设计
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include <iostream>
using namespace std;
typedef unsigned int uint;
uint swap_bi ...
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include <iostream>
#include <vector>
#include <stack>
using namespace ...
STL系列之二 stack栈
- 博客分类:
- 算法设计
栈(statck)这种数据结构在计算机中是相当出名的。栈中的数据是先进后出的(First In Last Out, FILO)。栈只有一个出口,允许新增元素(只能在栈顶上增加)、移出元素(只能移出栈顶元素)、取得栈顶元素等操作。在STL中,栈 ...
(1)管道(Pipe):管道可用于具有亲缘关系进程间的通信,允许一个进程和另一个与它有共同祖先的进程之间进行通信。
(2)命名管道(named pipe):命名管道克服了管道没有名字的限制,因此,除具有管道所具有的功能外,它还允许无亲缘关系进程间的通信。命名管道在文件系统中有对应的文件名。命名管道通过命令mkfifo或系统调用mkfifo来创建。
(3)信号(Signal):信号是比较复杂的通信方式,用于通知接受进程有某种事件发生,除了用于进程间通信外,进程还可以发送信号给进程本身;linux除了支持Unix早期信号语义函数sigal外,还支持语义符合Posix.1标准的信号函数s ...
查找两个有序数组中第K大的元素(C++实现)
- 博客分类:
- 算法设计
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include <iostream>
#include <vector>
using namespace std;
// find the kth ...
查找两个有序数组的交集(C++实现)
- 博客分类:
- 算法设计
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include <iostream>
#include <vector>
using namespace std;
// find the int ...
标准C++中的string类的用法总结
- 博客分类:
- c++
转自:http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html
相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的确,MFC中的CString类使用起来真的非常的方便好用。但是如果离开了MFC框架,还有没有这样使用起来非常方便的类呢?答案是肯定的。也许有人会说,即使不用MFC框架,也可以想办法使用MFC中的API,具体的操作方法在本文最后给出操作方法。其实,可能很多人很可能会忽略掉标准C++中string类的使用。标准C++中提供的string类得功能也是非常强大的,一般都能满足我们开发项目时使 ...
未知长度链表中随机取出其中某一节点的值
- 博客分类:
- 算法设计
转自:
题目描述:有一个单向链表的长度未知,怎样从中随机取出一个节点?要求每个节点被选中的概率相等。
解决方法:
遍历一次链表,用一个临时变量pTemp指向返回的节点,设一个计数器iCount统计已遍历的节点个数,然后生成0到iCount-1之间的随机数;若生成的随机数为0,则将pTemp指针替换为当然节点的地址。可以证明对每一个节点,它被选中的概率为1/n,n为链表的长度。
对于第i个节点,被选中的概率为:p = 1/i *(i /i+1)*(i+1 / i+2)*......(n-1 / n) = 1/n
代码如下:
[cpp] vi ...
从海量数据中找出中位数
- 博客分类:
- 算法设计
转自:http://hi.baidu.com/mcgrady32303/item/d652f2cb886be33498b49834
题目和基本思路都来源网上,本人加以整理。
题目:在一个文件中有 10G 个整数,乱序排列,要求找出中位数。内存限制为 2G。只写出思路即可(内存限制为 2G的意思就 ...
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include <iostream>
#include <algorithm>
using namespace std;
// print ar ...
题目:
a1 a2 a3 …… b1 b2 b3 ……
重排成 :
a1 b1 a2 b2 a3 b3 ……
(无升降序,元素可重复)
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include < ...
1. Windows的窗体交互是基于消息映射机制的,比如我们的编辑框可以映射一个变量,我们在编辑框里输入一个数字后,这个数据就可以传递到映射变量里;而我们的按钮可以映射成一个函数,当我们运行的窗体点击这个按钮时,相应的映射函数就被执行。映射变量的添加在类向导里面。而映射函数的添加比较方便,只需要在资源预览中双击按钮控件,便会弹出一个Add Member Function的对话框。
2. VC中调用延时函数为Sleep(int n),其中的S一定要大写,且n为毫秒的单位。必须包含头文件
二叉树层次遍历C++实现
- 博客分类:
- 算法设计
// Type your C++ code and click the "Run Code" button!
// Your code output will be shown on the left.
// Click on the "Show input" button to enter input data to be read (from stdin).
#include <iostream>
#include <queue>
using namespace std;
typedef struct ...
Some great designers around the web have released great icons, interface PSDs, and other resources that help make designing iOS apps easier. Enjoy and make sure to thank the creator of whichever resources you use!
Templates & PSDs
Icon Template
Michael Flarup’s icon template is the best one a ...
参考:http://software.intel.com/zh-cn/blogs/2013/04/09/?utm_campaign=CSDN&utm_source=intel.csdn.net&utm_medium=Link&utm_content=%20Multicore%20-duoxiancheng
1. Amdahl定律
一个很简单的量化公式,用来计算一个程序中串行部分所占多少对程序加速比的影响或者用来计算计算机硬件配置中某个设备的速度提高能够将整个系统的速度提高多少。
假设一个串行程序执行的总时间为1,不能被并行化的部分占的时间 ...