关键知识点:断言1 const Option OptTable::getOption(OptSpecifier Opt) const {2 unsigned id = Opt.getID();3 if (id == 0)4 return Option(0, 0);5 assert...
分类:
编程语言 时间:
2014-07-28 21:22:24
阅读次数:
290
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,...
分类:
其他好文 时间:
2014-07-28 19:17:14
阅读次数:
245
一, map #基本的map运用都可以用解析去替代,复杂的仍然需要定义函数,利用map去做map(函数, 序列) 将序列的各项经过函数处理, 然后返回到一个新列表中。 #itertools.imap()>>> s['a', 'b', 'c', 'd']>>> exp1 = map(ord, s) #...
分类:
编程语言 时间:
2014-07-28 19:16:44
阅读次数:
227
# QVTKRenderWindowInteractor要求必须有初始化好的parent ? ? def CreateScene(self, parent): ? ? ? ? view = QVTKRenderWindowInteractor(parent) ? ? ? ? renderer = vtkRenderer() ? ? ?...
分类:
其他好文 时间:
2014-07-28 17:00:34
阅读次数:
333
<?phpheader(‘Content-type:text/html;charset=utf-8‘);/***[checkFilename检验文件名的合法性]*@param[string]$filename[文件名]*@return[bool][合法返回真]*/functioncheckFilename($filename){ $pattern=‘/[\/,\*,<>,\?\|]/‘; if(preg_match($pattern,$filename)){..
分类:
Web程序 时间:
2014-07-28 16:49:34
阅读次数:
318
# include
# include
# include
# include
using namespace std;
struct point
{
double left,right;
}p[2010],temp;
bool cmp(point a,point b)
{
return a.left<b.left;
}
int main()
{
int n,i,count,fla...
分类:
其他好文 时间:
2014-07-28 16:20:33
阅读次数:
208
考察的是结构体的二次快排
#include
#include
typedef struct Node{
int fir;
int end;
}Node;
Node node[110];
int cmp(const void *a,const void *b)
{
return (*(node *)a).end>(*(node *)b).end?1:-1;
}
i...
分类:
其他好文 时间:
2014-07-28 16:15:23
阅读次数:
218
Python 3.X新增加了一个特性(Feature),叫作函数注释 Function Annotations
它的用途虽然不是语法级别的硬性要求,但是顾名思义,它可做为函数额外的注释来用。
Python中普通的函数定义如下:
def func(a, b, c):
return a + b + c
>>> func(1, 2, 3)
6
添加了函数注释的函数会变成如下形式...
分类:
编程语言 时间:
2014-07-28 16:05:23
阅读次数:
251
题目:在桌子边上罗扑克,使得扑克不掉下去,并且申处桌面最长,一直扑克数量求长度。
分析:简单题。第一个扑克一定摆在中间位置,长度是0.5;
每次,将前面的看成整体,下一个扑克当做上次的桌子,这样一定是最大,因为都在平衡边界;
整体i个扑克的重心在桌子的边沿位置即可,这时前i-1的整体重心一定在桌外,最后一重心在内...
分类:
其他好文 时间:
2014-07-28 15:50:23
阅读次数:
270
public class Circle {
private PointF centerPoint;
private float radius;
public PointF getCenterPoint() {
return centerPoint;
}
public void setCenterPoint(PointF centerPoint) {
this.centerPoin...
分类:
移动开发 时间:
2014-07-28 15:46:53
阅读次数:
239