1 #include 2 #include 3 using namespace std; 4 5 6
int RandomInRange(int start, int end) { 7 srand((unsigned)time(NULL)); 8 int
value = ran...
分类:
编程语言 时间:
2014-06-29 13:00:43
阅读次数:
294
上周尝试用opencl求极大值,在网上查到大多是求和,所谓的reduction算法。不过思路是一样的。CPP: int err = 0; unsigned
long int nNumCount = 102400000; int nLocalSize = 256; int nGr...
分类:
其他好文 时间:
2014-06-29 07:47:56
阅读次数:
1793
构造函数再探
构造函数初始值列表
Sales_data::Sales_data(const string &s, unsigned cnt, double price)
{
bookNo=s;
units_sold=cnt;
revenue=cnt*price;
}
这个构造函数和这个效果是一样的
Sales_d...
分类:
编程语言 时间:
2014-06-20 12:12:09
阅读次数:
370
#include int check_power(unsigned int n){
/**************************************** * 如果n是2的幂,那么(n-1)也就是其二进制全为1的数
********************************...
分类:
其他好文 时间:
2014-06-11 12:45:21
阅读次数:
231
#import const char *name =
class_getName([NSObject class]); printf("%s\n", name);void PrintObjectMethods()
{unsigned int count = 0;Method *methods = ....
分类:
其他好文 时间:
2014-06-11 10:51:59
阅读次数:
210
typedef unsigned char* byte_pointer;
void show_bytes(byte_pointer start, int len)
{
for (int i = 0; i
{
printf("%2x", start[i]);
}
cout
}
int _tmain(int argc, _TCHAR* argv[])
{
char* b...
分类:
其他好文 时间:
2014-06-07 16:22:02
阅读次数:
312
假设有一个表,结构如下:root@localhost : yayun 22:59:43>
create table t1 ( -> id int unsigned not null auto_increment, -> id2 int
unsigned not null default ...
分类:
其他好文 时间:
2014-06-05 15:22:16
阅读次数:
240
本文主要介绍Linux0.12内核memory.c中的函数
1.void free_page(unsigned long addr)
//释放物理地址addr处的一页内存。用于free_page_tables()函数
void free_page(unsigned long addr)
{
//首先判定给定物理地址的合理性。如果物理地址addr小于内存低端1M,对此不///予处理。如果a...
分类:
系统相关 时间:
2014-06-04 21:13:18
阅读次数:
439
时间,给了我们起点,从此,我们开始创造历史
世纪秒:2000年1月1日0时0分0秒到现在的秒数
datetime.h文件:
#ifnded _DATETIME_H_
#define _DATETIME_H_
typedef unsigned char z_u8;
typedef signed char z_...
分类:
其他好文 时间:
2014-06-03 04:08:08
阅读次数:
293
今天看到下面这两个函数:struct resource
*platform_get_resource(struct platform_device *dev, unsigned int type, unsigned
int num){ int i; for (i = 0; i n...
分类:
系统相关 时间:
2014-06-02 22:15:28
阅读次数:
438