Skip to content

Instantly share code, notes, and snippets.

View icedac's full-sized avatar

임지혁 | GShock Im icedac

  • perplay.io
  • Seoul, Korea, Earth, Sun, Our Galaxy, M-0xa5fc
  • X @icedac
View GitHub Profile
@icedac
icedac / generic_lambda.cpp
Last active August 29, 2015 14:26
generic lambda에 대한 고찰
// lambda 고찰 #1
// generic lambda의 타입은 어떻게 되는가?
void test1()
{
auto f = [](auto x, auto y) // c++14: generic lambda
{ static int count = 0; printf("(%s) count:%d\n", __func__, count++);
return x + y;
};
auto v = f(5, 1.5); // count:0
@icedac
icedac / gist:79038d86f84ca915298d
Created June 4, 2015 08:36
char vs signed char vs unsigned char
void foo(unsigned char c)
{
printf("void test( unsigned char c ): %d\n", c);
}
void foo(signed char c)
{
printf("void test( signed char c ): %d\n", c );
}
void test()
@icedac
icedac / client_code.cpp
Created May 26, 2015 16:40
server_code.cpp, client_code.cpp
using namespace T_ms_db;
/****************************************************************************
* main server
*/
class MS_ClientSession : public ITDBToTMSHandler { // 생성된 handler class에서 상속
/*...*/
template < typename T >
void QueueSend(const T&) {} // 테스트 코드용 dummy Send
int On_DM_GetAccountRes(const Recv_DM_GetAccountRes *packet) override;
@icedac
icedac / db_schema.h
Created May 26, 2015 16:19
generated_code
// generated by SQL COMPILER
// time : 2015-05-27 01:02:42.811
// do not modify
// contact: icedac@gmail.com
#pragma once
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
namespace test_db {
@icedac
icedac / game_db.xml
Created May 26, 2015 16:05
sql_code_gen/packet_code_gen xml
<xml>
<config>
<db name="test_db" version="9"/> <!-- increment version if backward compatibility broken -->
<output type="cpp" code="GameDB.h"/>
<output type="MySQL" code="GameDB_MySQL.sql"/>
</config>
<error>
<code value="0" name="SUCCESS" desc="success"/>
<code value="1" name="ERR_NOT_IMPLEMENTED"/>
// Timesync.cpp : time resync from NTP server
// ref: http://www.abnormal.com/~thogard/ntp/
// ref: http://stackoverflow.com/a/19815921
#include <winsock2.h>
#include <time.h>
#include <strsafe.h>
#pragma comment( lib, "ws2_32.lib" )