HomeMove cursor to the beginning of the line currently on.EndMove cursor to the end of the line currently on.Ctrl + UpScroll up one line.Ctrl + DownSc...
分类:
其他好文 时间:
2015-04-28 13:33:59
阅读次数:
119
#include
using namespace std;
struct Node
{
char value;
Node *left;
Node *right;
};
//重构函数核心
Node *Constructcore(char *start_preorder,char *end_preorder,char *start_inorder,char *end_inorder)
{
ch...
分类:
其他好文 时间:
2015-04-28 11:54:27
阅读次数:
128
1.打印short、long、long long和unsigned#include int main(void) { unsigned int un = 3000000000; short end = 200; long big = 65537; ...
分类:
其他好文 时间:
2015-04-28 11:26:44
阅读次数:
111
(1)awk-F,‘{a[$2]++}END{for(iina)printi""a[i]}‘文件名.txt(2)cat文件名.txt|cut-d,-f2|sort|uniq-c|sort-n
分类:
系统相关 时间:
2015-04-27 23:58:14
阅读次数:
242
ruby中有实例变量这个语法,有点类似java的对象的属性,但是ruby中类也有实力变量,class Person @name = 'hello' def initialize(name,age) @name = name @age = age end def self.talk...
分类:
其他好文 时间:
2015-04-27 23:31:47
阅读次数:
108
我们知道lambda表达式的行为很像是是一个匿名函数,我们常常在标准算法中使用lambda表达式。比如需要打印一个向量,可能会这样写:vector v(10, 10);std::for_each(v.begin(), v.end(), [](int n){
cout << n << " ";
});使用了for_each算法针对 v 中的每一个元素使用lambda表达式,并且成功的...
分类:
编程语言 时间:
2015-04-27 21:57:47
阅读次数:
407
二分查找,应用的场景是在一个排序的序列中,查找指定的数的位置。复杂度为O(logn).常用的包括递归的方法,如下:def binarySearch(data, x, start, end): if start>end: return -1 mid = start + (end-start)/2 #....
分类:
其他好文 时间:
2015-04-27 21:25:51
阅读次数:
84
1.归并排序
void merge(int *result, int begin, int mid, int end, int *temp)
{
int k = begin;
int i = begin;
int j = mid + 1;
while (i <= mid&&j <= end){
temp[k++] = result[i] < result[j] ? result[i+...
分类:
编程语言 时间:
2015-04-27 20:09:43
阅读次数:
155
直接看代码:#import "CMoveView.h"@interface CMoveView ()//记录上一次父视图@property (nonatomic, strong) UIView* oldSuperview;@end@implementation CMoveView//当自己重写一个U...
分类:
移动开发 时间:
2015-04-27 18:21:47
阅读次数:
201
Objective-c中某个实例对象是否支持copy操作,要看这个对象是否实现了NSCopying协议:@protocol NSCopying- (id)copyWithZone:(NSZone *)zone;@end对于mutableCopy操作对应的有NSMutableCopying协议:@pr...
分类:
其他好文 时间:
2015-04-27 15:00:24
阅读次数:
118