set enc=utf-8centos修改
/etc/vimrcubuntu修改:/etc/vim/vimrc
分类:
其他好文 时间:
2014-05-15 14:33:51
阅读次数:
200
POJ2533#include #include #define max(a, b)
(((a) > (b)) ? (a) : (b))void GetMaxIncLen(int *data, int *maxLen, int
size){ int i, j; for(i = 2; i max) ....
分类:
其他好文 时间:
2014-05-15 13:52:57
阅读次数:
259
简单点说其实Segment Tree就是二分法的灵活运用。
需要的基础知识:
1 二分法
2 二叉树
3 最好熟悉堆排序
操作就是二分法和堆排序巧妙地合并起来。
有了这些基础知识Segment Tree就没有任何难度了。
参考原文:
http://www.geeksforgeeks.org/segment-tree-set-1-sum-of-given-range/
...
分类:
其他好文 时间:
2014-05-15 13:33:33
阅读次数:
250
【题目】
原文:
1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.
译文:
写一个函数处理一个MxN的矩阵,如果矩阵中某个元素为0,那么把它所在的行和列都置为0.
【分析】
【思路一】
遍历一次矩阵...
分类:
其他好文 时间:
2014-05-15 12:27:37
阅读次数:
293
(一)
当多个进程企图对共享数据进行某种处理,而最后的结果又取决于进程运行的顺序时,就认为它们发生了竞争关系。避免竞争的条件,给出apue上的一个代码吧:
#include "apue.h"
static void charatatime(char *);
int
main(void)
{
pid_t pid;
TELL_WAIT(); /*set things up for TEL...
分类:
系统相关 时间:
2014-05-15 12:20:22
阅读次数:
408
几个单词
Hierarchy
['ha??rɑ?k?]
n. 层级
思考:每个视图有一个父视图,有0个或者多个子视图
Manipulation
[m?,n?pj?'le??(?)n] n.
操纵;操作
Descendant
[d?'send(?)nt]
n. 后裔;子孙
UIWindow
Feature:
1、UIWindow set up...
分类:
其他好文 时间:
2014-05-15 12:13:20
阅读次数:
430
好奇心来源于下面的一段代码, 一个是unordered_map, 这是c++11新加的container. 另外还有unordered_set,
unordered_multimap, unordered_multiset.另外在for循环中, 可以使用下列形式:1 for (auto
&eleme...
分类:
编程语言 时间:
2014-05-15 12:03:28
阅读次数:
339
一般的windows复杂的界面需要使用多层窗口而且要用贴图来美化,所以不可避免在窗口移动或者改变大小的时候出现闪烁。先来谈谈闪烁产生的原因原因一:如果熟悉显卡原理的话,调用GDI函数向屏幕输出的时候并不是立刻就显示在屏幕上只是写到了显存里,而显卡每隔一段时间把显存的内容输出到屏幕上,这就是刷新周期。...
分类:
编程语言 时间:
2014-05-15 11:42:31
阅读次数:
352
git出现error: bad signature fatal: index file
corruptgit的index被损坏解决方法:需要重新生成index文件,rm -f .git/indexgit reset --mixed HEAD
分类:
其他好文 时间:
2014-05-15 11:41:50
阅读次数:
2932
void GregorianDay(struct rtc_time * tm){ int
leapsToDate; int lastYear; int day; int MonthOffset[] = {
0,31,59,90,120,151,181,212,243,273,304,334 }; l...
分类:
其他好文 时间:
2014-05-15 11:38:36
阅读次数:
488