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
class A { | |
private: | |
A() {}; | |
public: | |
static A factory_A() { reutrn A(); } | |
} | |
// friend declaration for std::make_shared | |
// works on VS2010 | |
friend std::tr1::_Ref_count_obj<T> |
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 gen_rand_num_nondup(int *arr, int cnt, int s_num, int e_num) | |
{ | |
int range = e_num - s_num; | |
int in, im; | |
for (in = 0, im = 0; in < range && im < cnt; ++in) { | |
int rn = range - in; | |
int rm = cnt - im; | |
if (rand() % rn < rm) | |
arr[im++] = in + s_num; | |
} |
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 | |
if [ $# -lt 3 ] | |
then | |
echo "[Usage] $0 <TITLE> <BODY> <URL>" | |
exit 1 | |
fi | |
ACCESS_TOKEN=`cat access_token | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'` | |
TYPE="link" |
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
--[[ | |
Slime War Battle AI by taeguk | |
Recent modified in 2015-07-18 | |
]]-- | |
-- [applied methods] | |
-- Board:moveQSlime(fromx,fromy,tox,toy) | |
-- Board:moveSlime(fromx,fromy,tox,toy,number) | |
-- Board:getSlime(x,y) | |
-- Board:getTerritory(x,y) |
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
from fabric.api import * | |
import sys | |
env.hosts = [] | |
MAX_TRYING_CNT = 3 | |
#trying_cnt = 1 | |
env.password = 'releaseworld' |
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> | |
class B; | |
class A { | |
public: | |
unsigned int checksum; | |
private: | |
B& b; | |
A(B& b) |
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 <algorithm> | |
typedef int Data; | |
// Self assignment : Unsafe | |
// Exception : Unsafe | |
class Unsafe { | |
public: | |
Data *pData; | |
Unsafe& operator=(const Unsafe& 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
#include <iostream> | |
// 특성정보에 대한 tag들. | |
struct walk_ability_tag {}; | |
struct jump_ability_tag {}; | |
struct fly_ability_tag {}; | |
struct run_ability_tag :public walk_ability_tag {}; | |
struct ground_ability_tag :public run_ability_tag, public jump_ability_tag {}; | |
struct all_ability_tag :public ground_ability_tag, public fly_ability_tag {}; |
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> | |
template <unsigned N> | |
struct IsPrime { | |
static_assert(N >= 2, "The number must not be less than 2."); | |
IsPrime() = delete; | |
static bool value() { return static_cast<bool>(_value); } | |
private: |
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
Strong Scalability | |
--------------------- | |
Efficiency = c. (always) | |
c : constant. | |
* n, p can't affect efficiency in strong scalability. | |
Weak Scalablility | |
------------------------ |
OlderNewer