일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 파일존재
- 단축키
- 0x
- cocos2d-x
- 점점변하는값
- C++
- mathemetica
- mysql
- Get
- PORTG
- SQL
- array
- Call
- php
- 강좌
- Join
- 하이퍼 터미널
- solution
- unalias
- 월별 카운트
- Java
- function
- halliday
- Avr
- is_array
- Post
- selectc
- application.mk
- 현재언어
- android studio
- Today
- Total
목록분류 전체보기 (119)
코딩도사의 코드정리
Eclipse 팁 #1 (코드 Style 설정) ★★ 팀 프로젝트를 진행할때 개발자별로 Coding Style이 달라서 고생하는 경우가 많습니다. 이를 위해 Eclipse는 코드 형식화를 지원하는데요,아래와 같이 코딩 규칙을 위해바는 코드가 있다고 가정합시다. 해당 코드 위에서 [ Ctrl+Shift+F ] 키만 누르면 아래와 같이 코드가 이쁘게 정리됩니다. 이는 Eclipse에서 설정된 Code Formatter의 설정에 따른 것입니다. 프로젝트에서 개발된 모든 코드에 같은 코딩 규칙을 적용하고 싶다면.. 결정된 Coding Convention에 따라 Code Formatter의 설정을 바꾼 다음, 그것을 XML 파일로 Export하고, 개발자에게 Import 시켜 적용하도록 하면 된답니다.아래 그림은..
함수 정의방법예를 들어, 변수 x에 10을 더한 후 반환하는 단순한 함수를, f(x) 라는 이름으로 정의하려면 f[x_] := x + 10* 정적분(Definite Integral) 구하기 Integrate[x^3, {x, 0, 3}] 구간 a, b 를 0, 3 으로 지정했습니다. 답은 “81/4″ 즉 “4분의 81″이라는 면적이 나옵니다. * 부정적분(Indefinite Integral) 구하기 Integrate[x^3, x] 위의 수식을 입력하면 미분하기한번 미분D[x^5, x]두번미분하기D[x^5, {x, 2}]세번 미분하기D[x^5, {x, 3}]방정식 근 구하기f[x_] = 3 x^2 – 2 x – 5 Solve[f[x] == 0, x]연립방정식 근 구하기f[x_] = 3 x^2 – 2 x – ..
alias리눅스 bash 단축 별칭 조회/지정 명령어alias 설정 조회aliasalias 추가alias 단축명='실행할명령어'unalias리눅스 bash 단축 별칭 해제 명령어단축명 해제unalias 단축이름
생코펌.javascript 프로그래밍 위주의 외계어 스터디 3주차를 어제 진행했습니다. 함수와 객체편인데요, 스터디 자료를 공유합니다. 상세한 문법 보단 코드를 작성하는 생각 방식을 알아가는데 촛점이 맞춘 자료임을 감안하고 봐주시면 좋을 것 같네요.http://www.slideshare.net/ibare/35-function-and-object못보신 분들을 위한,1편 오버뷰 http://www.slideshare.net/ibare/15-overview2편 기본 문법법 http://www.slideshare.net/ibare/expressions-and-statements
java 에서 C 함수 호출하는건 더 간단하다. java 소스 class MyClass{ ... public static native void putInfo(int param1, String param2); // 구현부는 없음 ... } .c 소스 extern"C"{ void Java_com_hapill_lib_MyClass_putInfo(JNIEnv *env, jobject thiz, int param1, jstring param2) { jboolean isCopy = JNI_FALSE; const char* revStr = env->GetStringUTFChars(param2, &isCopy); env->ReleaseStringUTFChars(param2, revStr); } 만약 native 함수의..
cocos2d-x 에서 java 함수를 부르는 완전한 방법 #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #include "platform/android/jni/JniHelper.h" #include "jni.h" #endif JniHelper.h 를 include 한다. 상대경로는 버전마다 다를 수 있으므로 주의. 만약 패키지 이름이 com.hapill.lib.JavaHelper 이고, 그 안의 static function 이 이름이 void javaPrint() 라면 JniMethodInfo t; if (JniHelper::getStaticMethodInfo(t, "com/hapill/lib/JavaHelper", "javaPrint", "()V")) { t.env..
- (void)applicationWillEnterForeground:(UIApplication *)application { [[UIApplication sharedApplication] setIdleTimerDisabled:Yes]; } public Cocos2dxGLSurfaceView onCreateView() { ... ... glSurfaceView.setKeepScreenOn(true); return glSurfaceView; }
#include class KSTimer : public CCNode { protected: std::function f; float m_s; float m_timer; public: virtual ~KSTimer(){} void after() { unscheduleUpdate(); removeFromParent(); f(); } static KSTimer* create(float s, std::function __f) { KSTimer* kt = new KSTimer; kt->init(s, __f); kt->autorelease(); return kt; } bool init(float s, std::function __f) { f = __f; m_s = s; m_timer = 0; scheduleUpd..
template class FromToWithDuration2 { private: T originFrom; T from; T to; float duration; T dx; // bool positive; float flowTime; bool nextTurnIsFinish; public: FromToWithDuration2(){} FromToWithDuration2(T _from, T _to, float _duration) : originFrom(_from), nextTurnIsFinish(false) { nextTurnIsFinish = false; flowTime = 0.f; from = _from; to = _to; duration = _duration; dx = (to - from) / durati..
string getLocalCode() { string tempCode; #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSArray *languages = [defaults objectForKey:@"AppleLanguages"]; NSString *currentLanguage = [languages objectAtIndex:0]; // get the current language code.(such as English is "en", Chinese is "zh" and so on) NSDictionary* temp = [NSLocale componentsF..
bool isExistFile(const std::string& fileName) { return CCFileUtils::sharedFileUtils()->isFileExist(CCFileUtils::sharedFileUtils()->fullPathForFilename(fileName.c_str())); }
void setOpacity(CCObject* object, GLubyte opaque) { CCArray* childs = NULL; CCObject* child = NULL; CCNode* nodeObject = (CCNode*)object; if (nodeObject) { childs = nodeObject->getChildren(); } if (childs) { CCARRAY_FOREACH(childs, child){ CCRGBAProtocol *pRGBAProtocol = dynamic_cast(child); if (pRGBAProtocol) { pRGBAProtocol->setOpacity(opaque); // pRGBAProtocol->setColor(ccc3(opaque, opaque, o..
APP_STL := gnustl_static APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 APP_CPPFLAGS += -fexceptions APP_CPPFLAGS += -std=gnu++0x APP_CFLAGS := -std=c99 APP_TOOLCHAIN_VERSION := 4.6.3 APP_USE_CPP0X := true APP_OPTIM := release APP_TOOLCHAIN_VERSION 는 자기한테 맞는 버전으로.
template class CircularQueue { private: Node* node; // 노드 배열 int capacity; // 큐의 용량 int front; // 전단의 인덱스 int rear; // 후단의 인덱스 public: CircularQueue(int capacity) { this->capacity = capacity + 1; // 노드 배열의 크기는 실제 용량에서 1을 더한 크기 (더미 공간 때문) node = new Node[this->capacity]; // Node 구조체 capacity + 1개를 메모리 공간에 할당한다 front = 0; rear = 0; // 전단과 후단의 초기화 } ~CircularQueue() { delete []node; // 노드 배열 소멸 } v..
일반적으로 new/delete 를 통해서 메모리를 할당하는것은 비용을 발생시키고보기에 위험해 보입니다.C/C++ 에선 메모리를 할당 하기 위해서 시스템 콜(OS 내부 함수를 요청)을 해야만 하는데 이는 생각보다 큰 비용을 발생 시킵니다. 그래서 할당을 미리 해놓고 꺼내오고 해제된 메모리를 다시 쓰는 방식으로 재활용을 해야하는데, 라이브러리를 잘 짜기가 힘이 듭니다.boost 로 해결할 수 있습니다. #include #include #include using namespace std; struct SomeObject { SomeObject() { static int no=0; cout