Skip to content

Instantly share code, notes, and snippets.

@pjc0247
pjc0247 / CCAnimateWithBlending.cpp
Created February 18, 2014 08:23
CCAnimate with ccBlendFunc
#include "CCAnimateWithBlending.h"
using namespace cocos2d;
CCAnimateWithBlending *CCAnimateWithBlending::create(
CCAnimation *animation, ccBlendFunc blendFunc){
CCAnimateWithBlending *p = new CCAnimateWithBlending();
if( p != NULL && p->initWithAnimation(animation, blendFunc) ){
p->autorelease();
#ifndef _THREAD_SAFE_SINGLETON_H
#define _THREAD_SAFE_SINGLETON_H
#include <atomic>
#include <mutex>
template <typename T>
class ThreadSafeSingleton{
public:
ThreadSafeSingleton(void){
def to_binary_u(n, fit=8)
bin = ""
while n > 0
bin = (n % 2).to_s + bin
n /= 2
end
return bin.rjust(fit, '0')
end
@pjc0247
pjc0247 / c.cpp
Created December 7, 2014 14:14
루비 스타일 C++ getter/setter
#define attr_writer(name) \
void set_##name(const decltype(name) &v){ \
this->name = v; \
}
#define attr_reader(name) \
decltype(name) get_##name(){ \
return this->name; \
}
#define attr_accessor(name) \
attr_reader(name); \
@pjc0247
pjc0247 / aa.md
Last active August 29, 2015 14:12
  • 그래픽

    • 세이더 지원 (GLSL)(partial)
    • 스프라이트, 이미지, 텍스쳐의 분리
    • 스트리밍 텍스쳐 지원(partial)
    • 텍스쳐를 PNG로 저장 가능 (스크린샷 등)
    • Render-To-Texture 인터페이스 개선
  • 윈도우

    • 렌더러와 윈도우의 분리
  • 멀티 윈도우 지원(partial)

/* SELECT * FROM account */
auto rows = accounts.all();
for(auto &row : rows)
cout<<row.get("level").as_int();
/* SELECT * FROM account WHERE user_id='pjc0247' AND user_pw='asdf1234' */
auto rows = accounts
.begin()
.match("user_id", "pjc0247")
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
int main(int argc, char* argv[]){
FILE *fp = _popen("dir", "r");
std::string buffer;
#include "BigNumber.h"
#include <vector>
#include <algorithm>
using namespace std;
BigNumber::BigNumber(){
}
BigNumber::BigNumber(int n){
package com.example.pjc.echoclient;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
selector {
.size(30px, 40px); /* set default */
.size('tablet', 25px, 35px);
.size('mobile', 20px, 30px);
.position(100px, 40px);
.position('tablet', 120px, 50px);
.position('mobile', 130px, 60px);
}