1、添加辅助方法``template.helper(name, callback)``辅助方法一般用来进行字符串替换,如 UBB 替换、脏话替换等。例如扩展一个UBB替换方法: template.helper('$ubb2html', function (content) { ret...
分类:
其他好文 时间:
2015-06-09 16:44:05
阅读次数:
141
/*** 获取指定目录内所有文件大小总和 单位为字节* @param dir* @param callback*/function getdirsize(dir,callback){ var size = 0; fs.stat(dir,function(err,stats){ if(err) ret...
分类:
Web程序 时间:
2015-06-09 16:20:29
阅读次数:
151
#include#include#include#define MAXN 60using namespace std;int max_clique(int n, int * * mat, int *ret) ;int main(){ //freopen("acm.acm","r",stdin)...
分类:
其他好文 时间:
2015-06-09 15:45:02
阅读次数:
126
1 class Solution { 2 public: 3 int trailingZeroes(int n) { 4 int ret = 0; 5 while(n) 6 { 7 ret += n/5; 8 ...
分类:
其他好文 时间:
2015-06-09 11:22:39
阅读次数:
137
/*下面程序利用openssl库,实现了dh算法,产生密钥以及计算sessionkey*/
#include
#include
int main() {
DH *d1,*d2;
BIO *b;
int ret,size,i,len1,len2;
char sharekey1[128],sharekey2[128];...
分类:
编程语言 时间:
2015-06-08 23:26:50
阅读次数:
1067
public class Solution { public int singleNumber(int[] nums) { int ret = nums[0]; for (int i = 1; i < nums.length; i++) { ret ^= nums[i]; ...
分类:
编程语言 时间:
2015-06-08 18:59:18
阅读次数:
164
#include#include#define LL __int64LL mult_mod(LL a,LL b,LL c){ a%=c; b%=c; LL ret=0; while(b) { if(b&1){ret+=a;ret%=c;} a=c)a%=c; b>>=1; } return ret;...
分类:
其他好文 时间:
2015-06-08 18:51:16
阅读次数:
150
int strlen(char* s){ int ret = 0; while(*s != 0) { ret++; *s++; } return ret;}char* strcpy(char* dest, char* src){ cha...
分类:
其他好文 时间:
2015-06-07 21:28:49
阅读次数:
114
createorreplacefunctiondecode(p_conditionboolean,p_fist_valtext,P_last_valtext)
returnstext
as
$$
declare
v_ret_valtext;
begin
/*
*功能说明:模拟三元表达式(condition?value1:value2);
*参数说明:p_condition接收boolean类型的表达式如:1=1,2>1等;后两个值是根据p_..
分类:
数据库 时间:
2015-06-05 17:50:47
阅读次数:
249
大家一般觉得名不见经传strcpy函数实现不是非常难,流行的strcpy函数写法是:char *my_strcpy(char *dst,const char *src){ assert(dst != NULL); assert(src != NULL); char *ret = dst; while...
分类:
其他好文 时间:
2015-06-04 19:00:57
阅读次数:
127