본문 바로가기

프로그래밍38

비트연산 정리 메모리가 부족한 환경이나, 좀 더 나은 속도, 짧은 코딩을 하기 위해서 비트연산자를 사용하게 됩니다. 하지만 그와 반대로 대부분 코드를 이해하기가 더 힘들어지게 됩니다. 그러나 네이밍을 잘 한다면, 좀 더 보기가 나을 것 입니다. 비트연산자 & : AND | : OR ^ : XOR ~ : NOT 아래 방법의 하나의 방법일 뿐 입니다. 참고는 하셔도 되지만, 성능이 정확도는 장담하지 않습니다. 좀 더 나은 방법들을 알고 계신분들은 댓글로 부탁드립니다. ※ 참고사항 LED 레지스터는 1byte이고, 각 비트가 하나의 LED로 가정합니다. 그러므로 LED 개수는 8개 미만 입니다. 의미를 두기 위해 unsigned char로 선언하였습니다. 마이크로프로그래밍에서는 P[Num]과 동일하다고 생각하시면 됩니다. .. 2011. 11. 21.
SQLite 속도 비교 (PostgreSQL, MySQL, SQLite, SQLite<nosync>) 원문 : http://www.sqlite.org/speed.html Database Speed ComparisonNote: This document is very very old. It describes a speed comparison between archaic versions of SQLite, MySQL and PostgreSQL. The numbers here are old enough to be nearly meaningless. Until it is updated, use this document only as proof that SQLite is not a sluggard. Executive Summary A series of tests were run to measure the relat.. 2011. 11. 10.
데이터베이스 명명법 원문 : http://purumae.tistory.com/8 ABSTRACT This document defines the naming rules of database objects. CONVENTIONS All Objects 1. Do not use numbers, spaces, reserved keywords and special characters in the DB object name. Databases 1. For all parts of the database name use Pascal Case. 2. Examples § Account, Statistics, Sale Tables 1. Table names should be plural. 2. For table names with multipl.. 2011. 10. 31.
printf 출력 서식 원문 : http://devanix.tistory.com/283 "%[parameter][flags][width][.precision][length]type" Parameter Character Description n$ 파라미터 지정 This is a POSIX extension and not in C99. Example: printf("%2$d %1$#x %1$d",16,17) produces "17 0x10 16" Flags Character Description + 양수 '+', 음수 '-' 기호 출력. (디폴트 : 아무것도 표시 안함) - 좌측 정렬 # 8진수, 16진수 출력시 각각 0과 0x를, 실수의 경우 소수점 이하 0을 출력 ' '공백 출력할 크기가 0보다 클 때 수의 앞에 빈 칸 하나 .. 2011. 10. 18.
C 언어 레퍼런스 - localtime 함수 링크 : http://itguru.tistory.com/120 localtime #include // C++ 에서는 struct tm * localtime ( const time_t * timer ); time_t 값을 이용하여 지역 시간을 기준으로 tm 구조체를 초기화한다. timer 가 가리키는 time_t 형 변수의 값을 이용하여 tm 구조체의 멤버들을 초기화 한 뒤 이를 가리키는 포인터를 리턴한다. 참고적으로 현재 시간을 구해와야 하는 경우 십중 팔구 이 함수를 사용하게 된다. 현재 시각을 구해오는 가장 간단한 방법 time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); 를 통해 timei.. 2011. 10. 13.
trigger를 이용해 sqlite에서 foreign key를 사용하자! 원문 : http://nineye.com/blog/archives/444?replytocom=2006 sqlite에서 특정 column의 검색 속도를 향상 시키기 위해 foreign key를 사용하려고 했다. 이를 위해, sqlite 공식 홈페이지에서 foreign key에 관한 정보를 얻으려고 뒤져보다가… 컥.. 아래와 같은 내용을 발견했다. FOREIGN KEY constraints FOREIGN KEY constraints are parsed but are not enforced. However, the equivalent constraint enforcement can be achieved using triggers. 즉, query문에서 foreign key에 대해 오류없이 파싱은 하지만 실제 .. 2011. 8. 16.