This file contains 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
/*! | |
simple encrypt | |
*/ | |
#include <string> | |
#include <assert.h> | |
std::string encrypt(const std::string &src, bool encrypt) | |
{ | |
assert(!src.empty()); | |
std::string ret; |
This file contains 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
/*! | |
jgg encrypt | |
*/ | |
#include <string> | |
#include <assert.h> | |
#define JGG_CONST_STRING " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" | |
//#define CONST_STRING " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\r\n\t" | |
#define JGG_SIZE (sizeof(JGG_CONST_STRING)-1) |
This file contains 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
/*! | |
dispatch message. | |
copy from https://github.com/chenshuo/recipes/blob/master/protobuf/dispatcher.cc | |
*/ | |
#include <map> | |
#include <assert.h> | |
#include <iostream> | |
#include <functional> | |
class Message |
This file contains 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 "Jgg.h" | |
#define REAL_SHIFT(i) (i%8+1) | |
#define KEY_BYTE 0xE9 | |
JGG_KEY jggSetup(unsigned char *key, int len) | |
{ | |
JGG_KEY jk; | |
int i=0, j=0, k=0; |
This file contains 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 "thread.h" | |
#include <memory> | |
int main() | |
{ | |
struct UR_STRUCT | |
{ | |
int a; | |
//... | |
}; |
This file contains 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
#ifndef SCLOUD_SCOPE_GUARD_H_ | |
#define SCLOUD_SCOPE_GUARD_H_ | |
#include <functional> | |
namespace scloud{ | |
class ScopeGuard | |
{ | |
public: | |
explicit ScopeGuard(std::function<void(void)> onExitScope) |
This file contains 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
#ifndef MVC_H_ | |
#define MVC_H_ | |
#include <set> | |
#include <list> | |
#include <memory> | |
#include <functional> | |
template <typename T> | |
class observer | |
{ |
This file contains 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
#ifndef MVC_H_ | |
#define MVC_H_ | |
#include <set> | |
#include <memory> | |
#include <functional> | |
template <typename T> | |
class observer | |
{ | |
public: |
This file contains 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 "httpdownload.h" | |
#include <windows.h> | |
#include <wininet.h> | |
#include <shlwapi.h> | |
#include <tchar.h> | |
#include "scope.h" | |
#pragma comment(lib, "wininet") | |
#pragma comment(lib, "shlwapi") |
This file contains 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 "curl_httpdownload.h" | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <curl/curl.h> | |
#include "scope.h" | |
#ifdef _DEBUG | |
#pragma comment(lib, "libcurl-d.lib") | |
#else | |
#pragma comment(lib, "libcurl.lib") |
OlderNewer