自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 g++需要连接动态库

使用g++想要某个项目想要连接动态库可以用 rpath来做 例子:                   g++ array.cc   -Wl,-rpath=../snowman/game/ext/3rd/lib/  -lzlog  -Wl(l是小写的L):表示后面的参数需要传递给连接器,必须加上。...

2018-03-16 15:37:55 399

原创 二分查找,递归

#include #include int a[10] = {1,2,3,4,5,6,7,8,9,10}; int binarySearch(int left,int right,int key) { int middle = (left+right)/2; if(a[middle] == key) return middle; else if(a[

2016-03-10 11:54:10 265

原创 汉诺塔c++递归

#include #include int count = 0; void hanio(int n,char A,char B,char C) { if(n == 1) { printf("%d : %c -> %c \n",++count,A,C); } else{ hanio(n-1,A,C,B);

2016-03-09 22:58:48 745

原创 typedef 的作用域

//.h class A { public: typedef int size; virtual size ab() = 0; }; class B : public A { virtual size ab(); }; //.cpp virtual A::size B::ab() { } 在public下需要指定A::size. typedef 出现在函数体中,作用域也只限于函数。

2016-01-25 11:44:19 1094

原创 node.js sql 注入攻击防御方法 (sql Injection)

sql 注入的原理和方法应该都知道了,这里记录一下node-mysql提供的现成的api https://github.com/felixge/node-mysql node-mysql 提供了接口 In order to avoid SQL Injection attacks, you should always escape any userprovided data befo

2016-01-05 17:22:38 7488

原创 netstat sysctl 查看tcp连接的当前状态

netstat -tpn | grep '1234\|^[AP]' sysctl -A |grep tcp.*mem 看到别人讲解里面写的在这备注一下。

2015-11-23 23:01:19 861

原创 关闭VIM的错误提示音

可以在 vi/vim 中使用 :set noeb :set vb t_vb= 可以关闭错误提示音

2015-11-23 21:21:35 2980

转载 关闭CentOS的错误提示音

用vi 编辑 /etc/inputrc 文件, 去掉 “set bell-style none”前面的#号,重启动系统即可!

2015-11-23 21:15:36 1456

转载 好用的vimrc

au BufReadPost * if line("'\"") > 0 | if line("'\"") set hlsearch colorscheme evening set formatoptions=tcrqn set nocp set encoding=utf-8 set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp

2015-11-16 22:31:08 433

原创 c语言的不定长数组

struct Dynamic{ int a; char b[0];};Dynamic* dynamic = (Dynamic*)malloc(totalsize);

2015-11-16 21:35:58 1187

原创 数组赋值

#include #include int main() { char a[10]={0}; for(int i = 0 ; i < 10 ; ++i) { a[i] = "ABCDEFG"[i%7]; printf("%c",a[i]); } }

2015-11-16 21:32:58 279

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除