2016년 목표 중 하나인 Javascript 계산기를 만들기 시작했다
Chrome의 디버깅 기능을 첨 써보고 감동 받았다. ^^;
'Coding > JavsScript 삽질기' 카테고리의 다른 글
Samll lisp by Javascript (0) | 2016.09.12 |
---|---|
글자수 세는 자바 스크립트 (2) | 2011.11.15 |
Google chart API를 이용한 QR CODE 생성기 (3) | 2010.11.30 |
2016년 목표 중 하나인 Javascript 계산기를 만들기 시작했다
Chrome의 디버깅 기능을 첨 써보고 감동 받았다. ^^;
Samll lisp by Javascript (0) | 2016.09.12 |
---|---|
글자수 세는 자바 스크립트 (2) | 2011.11.15 |
Google chart API를 이용한 QR CODE 생성기 (3) | 2010.11.30 |
가장 넓은 직사각형 구하는 알고리즘 ( O(MN) )
/* From : http://stackoverflow.com/questions/7245/puzzle-find-largest-rectangle-maximal-rectangle-problem */ int findMaxRect (int rect[XSIZE][YSIZE]) { int ret = 0; unsigned int x = 0, y = 0, k = 0; int sum[YSIZE+1] = { 0, }; int stack[YSIZE][2] = { 0, }; int stIdx = -1; int width = 0; int y0 = 0, w0 = 0, tempArea = 0; for ( x = 0; x < XSIZE; ++x ) { for ( y = 0; y <= YSIZE; ++y ) { sum[y] = rect[y][x] ? ++sum[y] : 0; } sum[YSIZE] = 0; width = 0; stIdx = -1; for ( y = 0; y <= YSIZE; ++y) { if ( sum[y] > width ) { stack[++stIdx][0] = y; stack[ stIdx][1] = width; width = sum[y]; } else if ( sum[y] < width ) { while(1) { y0 = stack[stIdx ][0]; w0 = stack[stIdx--][1]; tempArea = width * (y - y0); ret = tempArea > ret ? tempArea : ret; width = w0; if( sum[y] >= width) break; } width = sum[y]; if ( width != 0 ) { stack[++stIdx][0] = y0; stack[ stIdx][1] = w0; } } } } return ret; }
Bit 연산 정리 (0) | 2016.08.20 |
---|---|
printf로 디버깅 하기 (0) | 2016.04.13 |
C++ 컴파일러 (0) | 2016.03.30 |
#define DEBUG
#ifdef DEBUG
#define cprintf(...) printf(__VA_ARGS__)
#else
#define cprintf(...)
#endif
가장 넓은 직사각형 구하는 알고리즘 ( O(MN) ) (0) | 2016.04.13 |
---|---|
C++ 컴파일러 (0) | 2016.03.30 |
Lambda function (1) | 2016.03.17 |
무료 C++ 컴파일러
1. 구름 IDE ( https://ide.goorm.io/ )
웹기반 IDE 이며, 기본 사용은 무료 이다.
웹 브라우져만 있으면 손쉽게 다양한 언어로 개발이 가능 하다.
2. C++ shell ( http://cpp.sh )
무료이며, 웹브라우져만 띄우면 짧은 코드를 쉽게 실행 할 수 있다.
3. Cygwin ( http://cygwin.com/install.html )
자세한 설명은 Cygwin 홈페이지를 참고하시면 됩니다.
4. Visual studio Express ( https://www.visualstudio.com/ko-kr/products/visual-studio-community-vs.aspx )
너무 유명하므로 설명은 생략 합니다.
printf로 디버깅 하기 (0) | 2016.04.13 |
---|---|
Lambda function (1) | 2016.03.17 |
Lambda function (0) | 2016.03.16 |
심심해서 다시 만들어 보는 테트리스
Android studio 디바이스 연결 (0) | 2016.08.20 |
---|---|
1. 온라인 테트리스 만들기 ( 이클립스 설치 ) (1) | 2014.01.03 |
초간단 보이스 레코더 (0) | 2013.03.08 |
[ C++ Lambda 함수 설명 ]
https://msdn.microsoft.com/ko-kr/library/dd293608.aspx
https://msdn.microsoft.com/ko-kr/library/dd293599.aspx
http://en.cppreference.com/w/cpp/language/lambda
C++ 컴파일러 (0) | 2016.03.30 |
---|---|
Lambda function (0) | 2016.03.16 |
짝수만 출력하기 (0) | 2016.03.03 |
#include <iostream>
using namespace std;
int main()
{
int num = 2;
auto sum = [](int n) -> int{ return n*n; }(num);
cout << num << " " << sum << endl;
return 0;
}
2 4
Lambda function (1) | 2016.03.17 |
---|---|
짝수만 출력하기 (0) | 2016.03.03 |
Couple (0) | 2015.12.23 |
#include <iostream>
using namespace std;
int main()
{
for (int i = 0; i < 100; i++) {
i % 2 || cout << i << endl;
}
return 0;
}
Lambda function (0) | 2016.03.16 |
---|---|
Couple (0) | 2015.12.23 |
사각형 개수 구하기 (0) | 2014.11.12 |
#include <stdio.h>
#include <stdlib.h>
#define FALSE 0
#define TRUE 1
int IsSheBeautiful() { return (rand() % 101 > 99); }
int IsSheLikeMe() { return (rand() % 51 > 49); }
int MeetGirl(int count) {
int amIcouple = FALSE;
// printf ("%d : I meet a girl!\n", count);
if ( IsSheBeautiful() && IsSheLikeMe() ) {
amIcouple = TRUE;
}
return amIcouple;
}
int Process() {
int amIcouple = FALSE;
int count = 0;
while ( amIcouple == FALSE ) {
amIcouple = MeetGirl(++count);
}
printf ("I met %d girls\n", count);
return amIcouple;
}
int main(int argc, char **argv) {
printf("%s\n", Process() == TRUE ? "I am not a single!" : "I am a sigle");
return 0;
}
짝수만 출력하기 (0) | 2016.03.03 |
---|---|
사각형 개수 구하기 (0) | 2014.11.12 |
Mirror (0) | 2014.10.27 |
Web 에서 Trello login -> 프린트할 카드 선택 -> Share and more ... -> Print 선택
삼성 노트북 삼성 TV와 무선 연결 하기 (0) | 2017.05.03 |
---|---|
[Mac] Screen shot 을 Drop box 에 저장되게 하기 (0) | 2014.11.29 |
Sinppely ( Code snippet tool ) (0) | 2013.05.19 |