NAME
stat 获取文件属性
这个函数位于头文件中
函数原型:
int stat(const char *path, struct stat *buf);
参数:
path 文件路径+文件名
buf 指向buffer的指针
返回值:
-1 遇到错误
0 成功返回
函数作用:
把path文件的信息复制到指针buf所指的结构体中。...
分类:
系统相关 时间:
2014-07-18 21:36:18
阅读次数:
263
缓存溢出缓存溢出(Buffer overflow),是指在存在缓存溢出安全漏洞的计算机中,攻击者能够用超出常规长度的字符来填满一个域,一般是内存区地址。这篇文章就是解说简单的缓存溢出问题。文章以x86_32 和 linux 系统平台为蓝本。为了介绍缓存溢出,数据的存储地址、基本的汇编指令、重要的寄存...
分类:
其他好文 时间:
2014-07-18 19:38:37
阅读次数:
316
Xms Xmx PermSize MaxPermSize 区别Eclipse崩溃,错误提示:MyEclipse has detected that less than 5% of the 64MB of PermGen (Non-heap memory) space remains. It is s...
分类:
其他好文 时间:
2014-07-18 14:14:51
阅读次数:
202
解题思路:
有m行,每行n个数,从每行中取出一个数相加一起求出sum,这样的sum有n的m次方个。要求的前n个最小的sum值。
第一次使用STL里面的堆,一开始对pop_heap()有点不太理解,后来明白了,比如对数组heap[n],最大下标为n-1建堆,默认的是建立大顶堆,heap[0]是数组中最大的数,写一条pop_heap()语句,就是把heap[0]和
heap[n...
分类:
其他好文 时间:
2014-07-18 14:11:34
阅读次数:
281
bool iconv_convert(const std::string& in, std::string& out, const char* fromcode, const char* tocode)
{
char buffer[128];
auto cd = iconv_open(tocode, fromcode);
if (cd != nullptr)
{...
分类:
其他好文 时间:
2014-07-18 11:15:10
阅读次数:
188
堆有两种: max-heap 和 min-heap. Max-heap 一般用来排序,Min-heap 用来实现 priority queue.max-heap的定义是:for each i: A[parent(i)] >= A[i]min-heap: for each i: A[parent(i)...
分类:
其他好文 时间:
2014-07-18 10:23:12
阅读次数:
180
1 --查找bad sql的方法: 2 3 select * from (select buffer_gets, sql_text 4 5 from v$sqlarea 6 7 where buffer_gets >500000 8 9 order by buff...
分类:
数据库 时间:
2014-07-18 08:29:41
阅读次数:
252
查看nginx下面两个参数 值是否满足client_header_buffer_size 512k;large_client_header_buffers 4 512k;满足依然出现如果nginx是做反向代理设置gunicorn 参数--limit-request-line 8188 (默认是409...
分类:
其他好文 时间:
2014-07-18 08:15:37
阅读次数:
833
TCMalloc是什么?TCMalloc(Thread-CachingMalloc)与标准glibc库的malloc实现一样的功能,但是TCMalloc在效率和速度效率都比标准malloc高很多。TCMalloc是google-perftools工具中的一个(gperftools四个工具分别是:TCMalloc、heap-checker、heap-profiler和cpu-profiler),这..
分类:
数据库 时间:
2014-07-17 15:34:03
阅读次数:
421
很多人的解释都不一样, 我碰到的问题是,开辟的内存空间小于操作的内存空间.也就是说,我free的内存越界了.这是我开辟链表结构体内存的代码: 1 PNODE Create() { 2 int len; //total count of nodes to be created. 3 ...
分类:
移动开发 时间:
2014-07-17 09:57:34
阅读次数:
279