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
/* | |
* filename: SetConsoleCtrlHandler.c | |
* description: | |
* This is a example of the SetConsoleCtrlHandler function that is used to | |
* install a control handler. | |
* via http://msdn.microsoft.com/en-us/library/ms685049(v=VS.85).aspx | |
* author: uhziel(uhziel@gmail.com) | |
* history: | |
* version date ps | |
* ------- ---------- -------------------------------- |
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
#!/bin/bash | |
REPOS="$1" | |
TXN="$2" | |
SVNLOOK=svnlook | |
MAGICWORD='The Shawshank Redemption' | |
# Magic Word: The Shawshank Redemption. | |
# via http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-repository-hooks.html |
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 <iostream> // std::cout | |
enum FruitType | |
{ | |
Apple, | |
Pear, | |
}; | |
int main () { | |
FruitType enum_type = Pear; |
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
void Bin2Hex(const char* buf, size_t len, std::string& out) | |
{ | |
std::ostringstream ostr; | |
ostr << std::hex; | |
ostr.fill('0'); | |
for (size_t i = 0; i < len; i++) | |
{ | |
unsigned char tmp = buf[i]; | |
ostr << std::setw(2) << static_cast<short>(tmp); | |
} |
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 <iostream> | |
#include <windows.h> | |
int main() { | |
DWORD t1 = 4294967295; | |
DWORD t2 = 2; | |
DWORD delta = t2 - t1; | |
std::cout << "DWORD delta:" << delta << std::endl; | |
unsigned long long lt1 = 4294967295; |
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 "gmock/gmock.h" | |
#include <gtest/gtest.h> | |
using ::testing::AtLeast; | |
using ::testing::InSequence; | |
class Turtle { | |
public: | |
virtual ~Turtle() {} | |
virtual void PenUp() = 0; | |
virtual void PenDown() = 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 "traverse.h" | |
struct Point { | |
int32_t x; | |
int32_t y; | |
}; | |
TRAVERSE_STRUCT(Point, FIELD(x) FIELD(y)) | |
/* Expand to | |
* void visit(traverse::CoutWriter& visitor, Point& obj) { |
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
@echo off | |
rem 脚本传入参数(按顺序): <BIN_DIR> | |
setlocal EnableDelayedExpansion | |
rem echo BIN_DIR:%1 | |
rem =========== 配置 =========== | |
rem SYMSTOREPATH 符号服务器地址 | |
rem PRODUCT 你的产品名 | |
rem VERSION 你产品的版本 | |
rem COMMENT 你想加的注释 |
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
--return netpack.filter( queue, msg, sz) | |
local results = table.pack(netpack.filter( queue, msg, sz)) | |
skynet.error("un", table.unpack(results)) | |
return table.unpack(results) |
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
# -*- coding: utf-8 -*- | |
import socket | |
import struct | |
import threading | |
TCP_IP = '192.168.1.133' | |
TCP_PORT = 31436 | |
BUFFER_SIZE = 102400 |
NewerOlder