2. www.mongodb.org/display/docs/downloads 에서 windows용 다운로드 및 압축해제
3. c:\data\db 폴더 생성
4. 명령 프롬프트에서, MongoDB다운 받은 폴더로 이동후,
만약 c:\data\db 폴더가 아닌경우 --dbpath 옵션이용
5. 서비스로 등록하기
--install 옵션 이용
주요 소스코드
void koch_line(GLfloat *st, GLfloat *ed){
glVertex2fv(st);
glVertex2fv(ed);
}
void divide_koch_line(GLfloat *st, GLfloat *ed, int n){
GLfloat a[2], b[2], c[2], d[2], e[2];
if( n>0 ){
a[0] = st[0];
a[1] = st[1];
e[0] = ed[0];
e[1] = ed[1];
b[0] = st[0] + (ed[0] - st[0])/3.0;
b[1] = st[1] + (ed[1] - st[1])/3.0;
d[0] = st[0] + (ed[0] - st[0])*2.0/3.0;
d[1] = st[1] + (ed[1] - st[1])*2.0/3.0;
c[0] = b[0]+(d[0]-b[0])*cos(60.0*3.1415/180.0)-(d[1]-b[1])*sin(60.0*3.1415/180.0);
c[1] = b[1]+(d[0]-b[0])*sin(60.0*3.1415/180.0)+(d[1]-b[1])*cos(60.0*3.1415/180.0);
divide_koch_line(a,b,n-1);
divide_koch_line(b,c,n-1);
divide_koch_line(c,d,n-1);
divide_koch_line(d,e,n-1);
}
else{
koch_line(st,ed);
}
}
결과
#3. OpenGL 선 그려보기 (0) | 2011.07.12 |
---|---|
#2. OpenGL 두번째 예제. 사각형 그려보기 (0) | 2011.07.12 |
#1. OpenGL 설치 및 예제 파일 실행 (0) | 2011.07.12 |
Ubuntu에 OpenGL 설치하기 (0) | 2011.07.12 |
The following functions are used to access a console.
Function | Description |
---|---|
AddConsoleAlias | Defines a console alias for the specified executable. |
AllocConsole | Allocates a new console for the calling process. |
AttachConsole | Attaches the calling process to the console of the specified process. |
CreateConsoleScreenBuffer | Creates a console screen buffer. |
FillConsoleOutputAttribute | Sets the text and background color attributes for a specified number of character cells. |
FillConsoleOutputCharacter | Writes a character to the console screen buffer a specified number of times. |
FlushConsoleInputBuffer | Flushes the console input buffer. |
FreeConsole | Detaches the calling process from its console. |
GenerateConsoleCtrlEvent | Sends a specified signal to a console process group that shares the console associated with the calling process. |
GetConsoleAlias | Retrieves the specified alias for the specified executable. |
GetConsoleAliases | Retrieves all defined console aliases for the specified executable. |
GetConsoleAliasesLength | Returns the size, in bytes, of the buffer needed to store all of the console aliases for the specified executable. |
GetConsoleAliasExes | Retrieves the names of all executables with console aliases defined. |
GetConsoleAliasExesLength | Returns the size, in bytes, of the buffer needed to store the names of all executables that have console aliases defined. |
GetConsoleCP | Retrieves the input code page used by the console associated with the calling process. |
GetConsoleCursorInfo | Retrieves information about the size and visibility of the cursor for the specified console screen buffer. |
GetConsoleDisplayMode | Retrieves the display mode of the current console. |
GetConsoleFontSize | Retrieves the size of the font used by the specified console screen buffer. |
GetConsoleHistoryInfo | Retrieves the history settings for the calling process's console. |
GetConsoleMode | Retrieves the current input mode of a console's input buffer or the current output mode of a console screen buffer. |
GetConsoleOriginalTitle | Retrieves the original title for the current console window. |
GetConsoleOutputCP | Retrieves the output code page used by the console associated with the calling process. |
GetConsoleProcessList | Retrieves a list of the processes attached to the current console. |
GetConsoleScreenBufferInfo | Retrieves information about the specified console screen buffer. |
GetConsoleScreenBufferInfoEx | Retrieves extended information about the specified console screen buffer. |
GetConsoleSelectionInfo | Retrieves information about the current console selection. |
GetConsoleTitle | Retrieves the title for the current console window. |
GetConsoleWindow | Retrieves the window handle used by the console associated with the calling process. |
GetCurrentConsoleFont | Retrieves information about the current console font. |
GetCurrentConsoleFontEx | Retrieves extended information about the current console font. |
GetLargestConsoleWindowSize | Retrieves the size of the largest possible console window. |
GetNumberOfConsoleInputEvents | Retrieves the number of unread input records in the console's input buffer. |
GetNumberOfConsoleMouseButtons | Retrieves the number of buttons on the mouse used by the current console. |
GetStdHandle | Retrieves a handle for the standard input, standard output, or standard error device. |
HandlerRoutine | An application-defined function used with the SetConsoleCtrlHandler function. |
PeekConsoleInput | Reads data from the specified console input buffer without removing it from the buffer. |
ReadConsole | Reads character input from the console input buffer and removes it from the buffer. |
ReadConsoleInput | Reads data from a console input buffer and removes it from the buffer. |
ReadConsoleOutput | Reads character and color attribute data from a rectangular block of character cells in a console screen buffer. |
ReadConsoleOutputAttribute | Copies a specified number of foreground and background color attributes from consecutive cells of a console screen buffer. |
ReadConsoleOutputCharacter | Copies a number of characters from consecutive cells of a console screen buffer. |
ScrollConsoleScreenBuffer | Moves a block of data in a screen buffer. |
SetConsoleActiveScreenBuffer | Sets the specified screen buffer to be the currently displayed console screen buffer. |
SetConsoleCP | Sets the input code page used by the console associated with the calling process. |
SetConsoleCtrlHandler | Adds or removes an application-defined HandlerRoutine from the list of handler functions for the calling process. |
SetConsoleCursorInfo | Sets the size and visibility of the cursor for the specified console screen buffer. |
SetConsoleCursorPosition | Sets the cursor position in the specified console screen buffer. |
SetConsoleDisplayMode | Sets the display mode of the specified console screen buffer. |
SetConsoleHistoryInfo | Sets the history settings for the calling process's console. |
SetConsoleMode | Sets the input mode of a console's input buffer or the output mode of a console screen buffer. |
SetConsoleOutputCP | Sets the output code page used by the console associated with the calling process. |
SetConsoleScreenBufferInfoEx | Sets extended information about the specified console screen buffer. |
SetConsoleScreenBufferSize | Changes the size of the specified console screen buffer. |
SetConsoleTextAttribute | Sets the foreground (text) and background color attributes of characters written to the console screen buffer. |
SetConsoleTitle | Sets the title for the current console window. |
SetConsoleWindowInfo | Sets the current size and position of a console screen buffer's window. |
SetCurrentConsoleFontEx | Sets extended information about the current console font. |
SetStdHandle | Sets the handle for the standard input, standard output, or standard error device. |
WriteConsole | Writes a character string to a console screen buffer beginning at the current cursor location. |
WriteConsoleInput | Writes data directly to the console input buffer. |
WriteConsoleOutput | Writes character and color attribute data to a specified rectangular block of character cells in a console screen buffer. |
WriteConsoleOutputAttribute | Copies a number of foreground and background color attributes to consecutive cells of a console screen buffer. |
WriteConsoleOutputCharacter | Copies a number of characters to consecutive cells of a console screen buffer. |
quick sort (0) | 2011.09.08 |
---|---|
키보드 전역 후킹 (0) | 2011.08.29 |
Console API를 이용하여 더블버퍼링 (0) | 2011.07.14 |
쓰레드를 이용한 행렬 곱연산 (0) | 2010.09.16 |
c/c++ 2차원(이차원) 배열 동적할당 방법2 (0) | 2010.08.06 |
CreateConsoleScreenBuffer() 와 SetConsoleActiveScreenBuffer()를 이용하여, 콘솔에서 더블버퍼링을 구현해보았다.
#include <stdio.h>
#include <Windows.h>
#include <tchar.h>
#include <stdlib.h>
void PrintConsoleScreen(const int nCurView, HANDLE hConsoleBuf[2], LPCTSTR lpCharacter, COORD dwWriteCoord);
void UpdateScreen(int *nCurView, HANDLE hConsoleBuf[2]);
void DrawRectangle(){
char Mark[21][3] = { "☆","★","○","●","◎","◇","◆","□","■","△","▲","▽","▼","◈","▣","♤","♠","♡","♥","♧","♣"};
int x,y;
system("cls");
for(y=0; y<20; y++){
for(x=0; x<30; x++){
printf("%s", Mark[rand()%21]);
}
printf("\n");
}
}
void DrawRectangleBuffering(int *nCurView, HANDLE hConsoleBuf[2]){
COORD pos = {0, 0};
int x,y;
LPCTSTR Mark[21] = { _T("☆"),_T("★"),_T("○"),_T("●"),_T("◎"),_T("◇"),_T("◆"),_T("□"),_T("■"),_T("△"),_T("▲"),_T("▽"),_T("▼"),_T("◈"),_T("▣"),_T("♤"),_T("♠"),_T("♡"),_T("♥"),_T("♧"),_T("♣")};
for(y=0; y<20; y++){
pos.Y = y;
for(x=0; x<30; x++){
pos.X = 2*x;
PrintConsoleScreen(*nCurView, hConsoleBuf, Mark[rand()%21], pos);
}
}
UpdateScreen(nCurView, hConsoleBuf);
}
int main(int argc, const char *argv[]){
HANDLE hConsoleBuf[2];
int nCurView=0;
bool bFlag;
int i=0;
hConsoleBuf[0] = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
hConsoleBuf[1] = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
while(i++<100){
//DrawRectangleBuffering(&nCurView, hConsoleBuf);
DrawRectangleA();
Sleep(1000);
}
return 0;
}
void PrintConsoleScreen(const int nCurView, HANDLE hConsoleBuf[2], LPCTSTR lpCharacter, COORD dwWriteCoord)
{
WriteConsoleOutputCharacter(hConsoleBuf[nCurView], lpCharacter, _tcslen(lpCharacter), dwWriteCoord, NULL);
}
void UpdateScreen(int *nCurView, HANDLE hConsoleBuf[2])
{
SetConsoleActiveScreenBuffer(hConsoleBuf[*nCurView]);
*nCurView = (*nCurView+1)%2;
}
키보드 전역 후킹 (0) | 2011.08.29 |
---|---|
Console API 모음 (MSDN) (0) | 2011.07.14 |
쓰레드를 이용한 행렬 곱연산 (0) | 2010.09.16 |
c/c++ 2차원(이차원) 배열 동적할당 방법2 (0) | 2010.08.06 |
c언어 2차원(이차원) 배열 동적 할당 방법 (0) | 2010.08.03 |
#4. OpenGL koch snowflake (코흐 눈송이) (0) | 2011.08.03 |
---|---|
#2. OpenGL 두번째 예제. 사각형 그려보기 (0) | 2011.07.12 |
#1. OpenGL 설치 및 예제 파일 실행 (0) | 2011.07.12 |
Ubuntu에 OpenGL 설치하기 (0) | 2011.07.12 |
#4. OpenGL koch snowflake (코흐 눈송이) (0) | 2011.08.03 |
---|---|
#3. OpenGL 선 그려보기 (0) | 2011.07.12 |
#1. OpenGL 설치 및 예제 파일 실행 (0) | 2011.07.12 |
Ubuntu에 OpenGL 설치하기 (0) | 2011.07.12 |
#4. OpenGL koch snowflake (코흐 눈송이) (0) | 2011.08.03 |
---|---|
#3. OpenGL 선 그려보기 (0) | 2011.07.12 |
#2. OpenGL 두번째 예제. 사각형 그려보기 (0) | 2011.07.12 |
Ubuntu에 OpenGL 설치하기 (0) | 2011.07.12 |