三、注册PMEM设备这里我们除了描述PMEM设备,还将注册一个拥有memory空间和IRQ资源的示例设备example_device。对于example_device,定义如下结构体:static struct resource example_resources[] = {[0] = {.star...
分类:
移动开发 时间:
2014-07-09 19:38:37
阅读次数:
182
glusterfs中的内存管理方式: 1 struct mem_pool * 2 mem_pool_new_fn (unsigned long sizeof_type, 3 unsigned long count, char *name) 4 { 5 ...
分类:
其他好文 时间:
2014-07-08 21:50:47
阅读次数:
441
线段树应用:
有一个数列,初始时为 a1,a2,… aN (N
1) 将 ai 的值加上 val ;
2) 对于一个区间[l,r],该区间的和。
3) 对于一个区间[l,r],求该区间的最大值。
数据结构:
//Node Type
struct Node{
int left, right;
int max, sum;
} tree[maxn];
/*
tree[k]'...
分类:
其他好文 时间:
2014-07-08 21:31:33
阅读次数:
237
代码注释比较详细:
#include
#include
using namespace std;
struct Node{
int data;
Node* next;
};
Node* head = NULL;
bool create() {
head = (Node*)malloc(sizeof(Node));
if(NULL == head) return false;...
分类:
其他好文 时间:
2014-07-08 21:05:05
阅读次数:
238
区间颜色不一致就更新到底,否则lazy标记
#include
#include
#include
#include
using namespace std;
#define lc l,m,index<<1
#define rc m+1,r,index<<1|1
#define N 100005
#define ll __int64
struct node
{
bool same;
ll c...
分类:
其他好文 时间:
2014-07-08 18:00:56
阅读次数:
226
2014-7-6 flyfish
在初始阶段会有大量数据增删改,而后期很少有更改,后期大部分是查询操作。
建立索引,使用排序的vector,使用二分法查找
以用户信息为例
用户信息包括,ID,名字,性别,手机号码
class CGender
{
public:
enum
{
Female=0,
Male=1,
NotSpecified=2
};
};
clas...
分类:
编程语言 时间:
2014-07-08 17:15:16
阅读次数:
237
1.先序遍历非递归算法
#define maxsize 100
typedef struct {
Bitree Elem[maxsize];
int top;
} SqStack;
void PreOrderUnrec(Bitree t) {
SqStack s;
StackInit(s);
p=t;
while (p!=...
分类:
其他好文 时间:
2014-07-08 17:13:18
阅读次数:
267
通用标签和控制标签
第一部分;代码
//前端
Insert title here
访问属性
/tags.action?username=u&password=p">tags
//struct.xml
/tags.jsp
//类包
package com.struts2.tags;
import com.opensymphony.xwork2.Action...
分类:
Web程序 时间:
2014-07-08 16:21:33
阅读次数:
251
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace C_编辑基础
{
//枚举的意义就是限定变量的取值范围
enum gender{Male,Female,Unkown}; //声明一个类型,它是枚举类型(定义一个枚举),这个枚举有三个值。...
分类:
其他好文 时间:
2014-07-08 13:38:36
阅读次数:
191
2014.7.8fb#include using namespace std;struct TreeNode{ int val; TreeNode *left; TreeNode *right; TreeNode(int val) { left = NUL...
分类:
其他好文 时间:
2014-07-08 11:50:56
阅读次数:
147