目前openstack提供了raw,qcow2,lvm,rbd四种类型的image后端。
所谓后端,即image/临时卷root盘的管理存储方式。
nova/virt/libvirt/imagebackend.py:
中有四个Raw,Qcow2,Lvm,Rbd四个类,均继承了image类,主要提供create_image方法和snapshot_extract方法。
image父类提供...
分类:
其他好文 时间:
2014-05-15 15:14:32
阅读次数:
350
有时候运行结果错误,但是vs没抛异常,这时可以用trycatch来帮我们捕捉异常。
例如:bug的情况是treeview只显示一个根节点和一个子节点,还不报错,我擦~
private void f_script_Load(object sender, EventArgs e)
{
List parents = new t_scriptsBLL().g...
分类:
其他好文 时间:
2014-05-15 07:06:00
阅读次数:
202
题意:判断一个链表中是否有环
思路:快慢指针,如果有环,最终快慢指针会在非NULL相遇
注:用到fast->next前先要确保fast非NULL,要用fast->next->next前先要确保fast,fast->next非NULL
复杂度:时间O(n), 空间O(1)
相关题目:Linked List CycleII...
分类:
其他好文 时间:
2014-05-15 07:01:57
阅读次数:
219
题意:从一个已排序的数组中移除掉重复的元素
思路:用下标i扫描旧数组,用下标j来保存新数组的尾部
如果旧数组的当前元素与新数组的最后一个元素相同,则继续扫描旧数组
如果不同,新数组的下标前移一们,将旧数组的当前元素赋给新数组,继续扫描旧数组
相关题目:
Remove Element
Remove Duplicates from Sorted List
Remove Duplicates from Sorted List II...
分类:
其他好文 时间:
2014-05-15 06:57:53
阅读次数:
249
题意:去掉已排序的链表里重复的元素
思路:
1.遍历链表,用一个变量保存当前链表节点的值
2.如果当前链表节点值与前面的一样,则删除当前链表节点
3.否则用当前节点值更新该变量
复杂度:时间O(n), 空间O(1)...
分类:
其他好文 时间:
2014-05-15 06:46:24
阅读次数:
218
【题目】
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Out...
分类:
其他好文 时间:
2014-05-15 05:13:49
阅读次数:
306
题目
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
解答
本题考察进位问题,注...
分类:
其他好文 时间:
2014-05-15 04:16:56
阅读次数:
245
在 O(nlogn)的时间内对一个链表进行排序。。明显是要用归并或者快排
第一次知道说原来归并也可以用链表来写,被刷了下三观。。。。。用快慢指针的方法找分界点。
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNod...
分类:
其他好文 时间:
2014-05-14 15:03:49
阅读次数:
230
本文记录Git.Framework之ORM中最为浓墨重彩的一篇,查询集合。根据自己做的项目统计这个是使用频率最高的一个。 一. 查询集合方法简介(1)List
GetList();(2)List GetList(bool isOpenTrans);(3)List GetList(T entit...
分类:
其他好文 时间:
2014-05-14 10:44:11
阅读次数:
374