This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <windows.h> | |
int main() | |
{ | |
//获取进程ID,因为你希望是多个进程运行同时写一个文件,所以,我们打印出进程ID | |
DWORD dwProcessID = GetCurrentProcessId(); | |
//初始化我们要写入文件中的内容,及该内容长度; | |
//为了让每次写入内容变化,此处只声明,需要时候再写。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
class MyClass | |
{ | |
public : | |
MyClass() | |
{ | |
printf("my class inited\n"); | |
} | |
~MyClass() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> // for system xxx | |
#include <string.h> | |
#include <sys/stat.h> // for int mkdir(const char *path, mode_t mode); | |
#define MATCH(a,b) (strcmp(a,b) == 0) | |
void fdel(const char * name); | |
void fadd(const char * name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MappingDict.cc | |
* | |
* Created on: May 28, 2013 | |
* Author: zhangjing0544 | |
*/ | |
#include "MappingDict.h" | |
int MappingDict::GetId(const string& key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.argcv.util; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class CSVParser { | |
final static int defaultMaxWidth = 20; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void file_copy(const char * dest, const char* src) | |
{ | |
FILE * fsrc = fopen(src,"rb"); | |
FILE * fdest = fopen(dest,"wb"); | |
fseek(fsrc,0L,SEEK_END); | |
long sz = ftell(fsrc); | |
rewind(fsrc); | |
unsigned char * buff = (unsigned char *)malloc(sizeof(unsigned char) * sz); | |
fread(buff,sz,sizeof(unsigned char),fsrc); | |
fwrite(buff,sz,sizeof(unsigned char),fdest); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
static unsigned long crypt[0x500]; | |
void crypt_init(); | |
#define PRIME_SIZE 32 | |
static const unsigned long prime_list[PRIME_SIZE] = | |
{ | |
0ul, 3ul, 11ul, 23ul, 53ul, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MersenneTwister.h | |
// Mersenne Twister random number generator -- a C++ class MTRand | |
// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus | |
// Richard J. Wagner v1.1 28 September 2009 [email protected] | |
// The Mersenne Twister is an algorithm for generating random numbers. It | |
// was designed with consideration of the flaws in various other generators. | |
// The period, 2^19937-1, and the order of equidistribution, 623 dimensions, | |
// are far greater. The generator is also fast; it avoids multiplication and | |
// division, and it benefits from caches and pipelines. For more information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get start from http://leveldb.googlecode.com/svn/trunk/doc/index.html | |
#include <iostream> | |
#include <algorithm> | |
#include <string> | |
#include "leveldb/db.h" | |
#include "leveldb/cache.h" | |
#include "leveldb/options.h" | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Author: Jim Westergren & Jeedo Aquino | |
File: index-with-redis.php | |
Updated: 2012-10-25 | |
This is a redis caching system for wordpress. | |
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/ |