Skip to content

Instantly share code, notes, and snippets.

View j2doll's full-sized avatar
💭
1️⃣ 😄 2️⃣ 😭

Jay Two j2doll

💭
1️⃣ 😄 2️⃣ 😭
View GitHub Profile
@j2doll
j2doll / AsioTCPServer.cpp
Last active August 12, 2017 07:32
AsioTCPServer
// AsioTCPServer.cpp
//
// : Defines the entry point for the console application.
//
#if (_MSC_VER >= 1300) // VC++ 7.0(2003) or over
#include "stdafx.h"
#include <tchar.h>
#include <errno.h>
#else
@j2doll
j2doll / Remotecap.cmd
Last active August 12, 2017 07:24
Remotecap
@REM ----------------------------------------------------
@REM Rewmotecap.cmd
@REM   Example command for captruing eremote network packet
@REM  using wireshark and tcpdump.
@REM   First written by j2doll. September 10th 2016.
@REM https://github.com/j2doll
@REM http://j2doll.tistory.com
@REM ----------------------------------------------------
@REM install putty and wireshark on your windows pc.
@j2doll
j2doll / constparam.cpp
Created August 12, 2017 07:30
constparam
// constparam
// 읽기(R) 쓰기(W) 인자. read/write paramter.
void refparam(int& param)
{
param = 10;
}
// 읽기전용 인자를 const로 설정. set the read-only parameter to const type.
void constparam(const int& param)
@j2doll
j2doll / DB.h
Created August 12, 2017 07:34
DB
// DB.h
// source from leveldb of code.google
class DB
{
public:
DB() { }   
virtual ~DB() {}
private: // No copying allowed   
@j2doll
j2doll / UseDB.cpp
Created August 12, 2017 07:36
UseDB
// UseDB.cpp
#include "DB.h"
DB db1, db2;
db1 = db2; // error
DB db3(db1); // error
@j2doll
j2doll / Qoo1.cpp
Created August 12, 2017 07:38
Qoo1
#ifdef Qoo1
#error ***** ERROR ***** Qoo1 is defined ******
#endif
@j2doll
j2doll / AliasNamespace.h
Last active August 12, 2017 07:42
alias namespace
// alias namespace
// code from : http://www.boost.org/doc/libs/1_41_0/libs/statechart/doc/tutorial.html
namespace sc = boost::statechart;
@j2doll
j2doll / SScc2dx.cpp
Last active August 12, 2017 07:46
Creating and using Sprite Sheets in Cocos2D-X with Texture Packer
// SScc2dx.cpp
// http://www.jesusbosch.com/2012/06/creating-and-using-sprite-sheets-in.html
_batchNode = CCSpriteBatchNode::batchNodeWithFile("gamePlayPack.pvr");this->addChild(_batchNode);
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("gamePlayPack.plist");
_ship = CCSprite::spriteWithSpriteFrameName( "ufo.png" );
CCSize winSize = CCDirector::sharedDirector()->getWinSize();_ship->setPosition( ccp(winSize.width * 0.1, winSize.height * 0.5) );
@j2doll
j2doll / overring.cpp
Created August 12, 2017 08:16
simple overriding example
// overring.cpp
// simple overriding example
#include <iostream>
using namespace std;
class A
{
public:
A() { cout << "A()" << endl; }
@j2doll
j2doll / Exam28.cpp
Created August 12, 2017 08:52
Exam28
// Exam28.cpp
// 9/21/2000 (rk)
// Last modified: 3/10/2002 (RK)
// test the routine KILL_PROC_BY_NAME to terminate a process
#include <windows.h>
#include <tlhelp32.h>
#include <iostream.h>
#ifdef BORLANDC