- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 blktap(4)
1.1 blkfront: 注册块设备:xlblk_init()register_blkdev(XENVBD_MAJOR, DEV_NAME) 这里XENVBD_MAJOR为202,DEV_NAME=”xvd” 注册xenbus的frontend: xlblk_init()xenbus_register_frontend(&blkfront_driver)xenbus_register
2017-05-10 22:03:42
343
原创 566. Reshape the Matrix
class Solution { public: vector> matrixReshape(vector>& nums, int r, int c) { int row = nums.size(); int col = nums[0].size(); if (r*c != row*col) return nums; vector> ret(r); for (int i
2017-05-06 11:58:28
198
原创 557. Reverse Words in a String III
听cgl的话,先从简单的刷起。 Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: "Let's
2017-05-06 10:50:42
237
原创 LRU cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of the key if the
2017-05-05 16:08:36
214
原创 blktap(2)
接下来从tapdisk_server_run()入手,看看tapdisk怎么运行的。327 int 328 tapdisk_server_run() 329 { 330 int err; 331 //资源锁? 332 err = tapdisk_set_resource_limits(); 333 if (err) 334
2017-04-19 21:27:22
530
原创 blktap(1)
代码版本是:xen-4.8.1,目的是捋顺blktap2的实现。 tapdisk2.c c = getopt(argc, argv, “s:Dh”) int getopt(int argc, char * const argv[], const c
2017-04-19 10:27:03
400
原创 reverse integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Note: The input is assumed to be a 32-bit signed integer. Your function
2017-04-13 11:10:12
146
原创 Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i
2017-04-07 19:35:59
203
原创 c_struct
结构可以整体拷贝、整体赋值(包括函数传参和函数返回值),访问成员,通过&取地址。 初始化:赋值(值传递,指针)或常量成员值列表。 注意优先级: ++p->len p->len,++len *p->str++ p->str *str str++ *p++->str p->str *str p++ 结构成员、结构标记和普通变量可以采用相同的名字,因为
2017-03-30 20:35:24
199
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人