在平时写代码的过程中,我一个推荐带有n系列的字符串函数,如strcat ->strncatsprintf->snprintf我们有类似的一个函数void dump_kid(std::string* str, uint32_t kid){ char buffer[16]; int len; ...
分类:
其他好文 时间:
2014-07-10 11:27:58
阅读次数:
279
最近刚刚接手同事的OpenResty的项目,发现对mysql,redis的操作没有用连接池,故对此进行了改造。MYSQL主要是通过mysql_pool.lua 和 dbutil.lua 来封装对数据库的操作mysql_pool.lua: 1 module("mysql_pool", package....
分类:
数据库 时间:
2014-07-07 21:44:07
阅读次数:
591
使用数据连接池(TIWDataModulePool).新建工程时勾选 Pool Data Connections:新增的 Pool(TIWDataModulePool) 被放在 ServerController 的窗体上(其实它也是个数据模块), 需要知道的变化是它增加了两个函数:function ...
分类:
数据库 时间:
2014-07-07 20:37:22
阅读次数:
204
/*
本文章由 莫灰灰 编写,转载请注明出处。
作者:莫灰灰 邮箱: minzhenfei@163.com
*/
1. 漏洞描述
音频驱动acdb提供了一个ioctl的系统接口让应用层调用,然而,其在处理传进来的参数时没有做有效的边界检查。应用程序可以通过/dev/msm_acdb设备文件就能达到提升权限的目的。
2. 漏洞分析
原始代码如下
if...
分类:
数据库 时间:
2014-07-01 09:04:04
阅读次数:
355
Before I owned a pool I always thought that pool maintenance was going to be a real pain and troublesome. I had heard many horror stories from friends...
分类:
其他好文 时间:
2014-06-30 21:58:20
阅读次数:
316
Buffer Cache 原理当一个进程需要访问数据时, 首先需要确定数据在内存中是否存在, 如果数据在Buffer中存在, 则需要根据数据的状态来判断是否可以直接访问还是需要构造一致性读取; 如果数据不在Buffer中, 则需要再Buffer Cache中寻找足够的空间来装载需要的数据, 如果Bu...
分类:
其他好文 时间:
2014-06-30 21:45:06
阅读次数:
283
源程序:
#include
#include
using namespace std;
int main()
{
int n;char buffer[6];
int count=0;
int len;
cin>>n;
for(int i=1;i<=n;i++)
{
if((i%7)==0)count++;
else
{
itoa(i,buffer,10);
...
分类:
其他好文 时间:
2014-06-30 20:16:38
阅读次数:
246
最近公司产品需要增加一个功能,就是版本自动更新,使用apt-get 实现。apt-get 软件源配置的方法,参见本人资源里的共享。下面是代码中作为升级的一部分。 FILE *fp;
char buffer[256];
char source_ok[] = "Reading package lists...";
if(0 > system("mv -f /etc/apt/sources....
分类:
其他好文 时间:
2014-06-30 08:37:47
阅读次数:
228
Protobuf详解按:新公司前端后端,使用的数据化方式是protobuf(ProtocolBuffer)。一,什么是Protobuf官方文档给出的是:alanguage-neutral,platform-neutral,extensiblewayofserializingstructureddataforuseincommunicationsprotocols,datastorage,andmore.二,Protobuf的优点..
分类:
其他好文 时间:
2014-06-29 21:08:01
阅读次数:
347
苹果系统下面有个LaTeXiT软件,可以方便地生成LaTeX公式,然后拖拽到别的程序中直接使用。在Windows下这方面的工具就比较少了。不过如果装有CTeX中文套装和Emacs的话,倒不妨自己做一个简易的版本。思路很简单:开一个Emacs buffer,编辑好公式,执行自编的texify函数调用相...
分类:
其他好文 时间:
2014-06-29 19:38:44
阅读次数:
581