Coding/Java 삽질기2013. 1. 26. 03:35



'Coding > Java 삽질기' 카테고리의 다른 글

ChoboSMS  (0) 2013.02.26
ChoboAlarm V0.39  (0) 2012.12.01
ChoboCalendar V0.19  (0) 2012.11.15
Posted by chobocho
Coding/Java 삽질기2012. 12. 1. 01:02



'Coding > Java 삽질기' 카테고리의 다른 글

Time stamp app  (0) 2013.01.26
ChoboCalendar V0.19  (0) 2012.11.15
이클립스 실행 오류  (0) 2012.11.15
Posted by chobocho
Coding/Java 삽질기2012. 11. 15. 01:23



'Coding > Java 삽질기' 카테고리의 다른 글

ChoboAlarm V0.39  (0) 2012.12.01
이클립스 실행 오류  (0) 2012.11.15
ChoboCalendar V0.16  (0) 2012.10.07
Posted by chobocho
Coding/Java 삽질기2012. 11. 15. 01:00

[ SDK update 후 에러 ]

"the file dx.jar was not loaded from the SDK folder!"

=> Android SDK manager 실행 후 tools 제거 후 재 인스톨 하면 됨

'Coding > Java 삽질기' 카테고리의 다른 글

ChoboCalendar V0.19  (0) 2012.11.15
ChoboCalendar V0.16  (0) 2012.10.07
ChoboCalendar V0.15  (0) 2012.07.12
Posted by chobocho
Coding/Python 삽질기2012. 11. 7. 01:31

#Python Version

import random

result = []

while ( len(result) < 10000 ):

    x = random.randint(1, 10001)

    y = random.randint(1, 10001)

    result.append( (x, y) )

    result = list(set(result))


/* C++ Version */
#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdlib>
#include <set>
using namespace std;

typedef pair<int, int> Point2D;

class IsSame {
public:
       bool operator()(const Point2D &left, const Point2D &right) {
              return ((left.first < right.first) || ( (left.first == right.first) && (left.second < right.second)));
       }
};

void process();

int main() {
    process();
    return 0;
}

void process() {
    fstream target_fp;
    set<Point2D, IsSame> set_points;
    
    target_fp.open("input2.txt",ios::out);
    
    srand(time(NULL));
    
    int count = 10000; //rand()%10 + 1;
    int x = 0, y = 0;
  
    Point2D tempPoint;
   
    target_fp << count << endl;
 
    while ( set_points.size() < count) {
    x = rand()%10000;
    y = rand()%10000;
    tempPoint.first = x;
    tempPoint.second = y;
    set_points.insert(tempPoint);
    }
    set<Point2D, IsSame>::iterator it;
    for ( it = set_points.begin(); it != set_points.end(); it++ ) {
          if ( it != set_points.begin() ) {
            target_fp << endl;
          }
       target_fp << it->first << " " << it->second;
    }
        
    target_fp.close();
}


'Coding > Python 삽질기' 카테고리의 다른 글

KMP algorithm  (0) 2013.05.06
[Python] Undo / Redo 구현하기  (0) 2011.06.16
간단한 반복 작업 매크로  (0) 2011.01.12
Posted by chobocho
Coding/CPP 삽질기2012. 10. 25. 01:08

1. 중복되지 않은 임의의 100개의 점이 있다. 100개의 점을 모두 연결 하여 닫힌 다각형이 되도록 점을 배열 하여라.

    예) (10, 10), (100, 1), ( 200, 300 ), ( 550 , 2) ... ( x, y ) ==> ( 10, 10 ),  ( 100, 1 ), ( 550, 2 ), ( 200, 300 )

    입력값 예)

    입력값 수

    입력 값 { x, y  | x > 0 && y > 0  }

   

   [ Input.txt ]

   4

  10  10

  100  1

  200 300

  550 2


   [ Data file ]

http://www.chobocho.com/wiki/moniwiki/wiki.php?10000%EA%B0%9C%EC%A2%8C%ED%91%9C%EC%83%9D%EC%84%B1&action=UploadedFiles&dummy=1

2. 중복되지 않은 임의의 100개의 점이 있다. 100개의 점을 모두 둘러싸는 경계에 포함 되는 점을 순서대로 배열 하여라.

    예) (10, 10), (100, 1), ( 200, 300 ), (100, 2),  ( 550 , 2) ... ( x, y ) ==> ( 10, 10 ),  ( 100, 1 ), ( 550, 2 ), ( 200, 300 )

    입력값 예)

    입력값 수

    입력 값 { x, y | x > 0 && y > 0 }

   

  [ Input.txt ]

  5

  10  10

  100  1

  100  2  

  200 300

  550 2




3. 임의의 두개의 삼각형이 있다. 겹치는 부분의 넓이를 구하여라.
[ Input.txt ]
10 10
20 20
30 30
15 15
20 20
30 30

4. 중복되지 않은 임의의 10000개의 점이 있다. 10000개의 점들 중 가장 가까운 두개의 점의 좌표를 구하여라.

    예) (10, 10), (10, 11), ( 200, 300 ), (100, 2),  ( 550 , 2) ... ( x, y ) ==> ( 10, 10 ),  ( 10, 11 )

    입력값 예)

    입력값 수

    입력 값 { x, y | x > 0 && y > 0 }

   

  [ Input.txt ]

  5

  10  10

  10  11

  100  2  

  200 300

  550 2


    [ Data file ]

http://www.chobocho.com/wiki/moniwiki/wiki.php?10000%EA%B0%9C%EC%A2%8C%ED%91%9C%EC%83%9D%EC%84%B1&action=UploadedFiles&dummy=1


'Coding > CPP 삽질기' 카테고리의 다른 글

fall-through  (0) 2013.05.13
Unity3D (1)  (0) 2011.09.08
static int box[1000] = {1, };  (0) 2011.04.04
Posted by chobocho
Coding/Java 삽질기2012. 10. 7. 02:56



'Coding > Java 삽질기' 카테고리의 다른 글

이클립스 실행 오류  (0) 2012.11.15
ChoboCalendar V0.15  (0) 2012.07.12
Android Notification 달력  (0) 2012.07.03
Posted by chobocho
Coding/Java 삽질기2012. 7. 12. 02:40



'Coding > Java 삽질기' 카테고리의 다른 글

ChoboCalendar V0.16  (0) 2012.10.07
Android Notification 달력  (0) 2012.07.03
[Android] Image match game ( V 0.21 )  (0) 2011.10.25
Posted by chobocho
Coding/Java 삽질기2012. 7. 3. 03:38


그냥 만들어 본, 안드로이드용 Notification 달력...



'Coding > Java 삽질기' 카테고리의 다른 글

ChoboCalendar V0.15  (0) 2012.07.12
[Android] Image match game ( V 0.21 )  (0) 2011.10.25
[Android] Image match game ( V 0.2 )  (0) 2011.09.12
Posted by chobocho
Coding/Math2012. 6. 1. 00:47



'Coding > Math' 카테고리의 다른 글

23000000000000000 ( 2경 3천조 )  (0) 2013.01.31
[Math] 사선 공식  (0) 2011.09.12
헤론의 공식  (2) 2011.08.30
Posted by chobocho