'Programming'에 해당되는 글 1711건

  1. 2014.06.28 opencv2 웹캠 관련 문서
  2. 2014.06.27 순열생성관련
  3. 2014.06.27 predefined annotation /java
  4. 2014.06.27 JUnit tutorial
  5. 2014.06.19 포트란 변수 타입
  6. 2014.06.19 포트란77 문법 테스트
  7. 2014.06.18 fortran 첫 실행 >_<
  8. 2014.06.17 quantumDB csv import / date
  9. 2014.06.08 fortran 문법
  10. 2014.06.08 swift 문법(함수/변수)
Programming/openCV2014. 6. 28. 23:41
윈도우에서 비쥬얼 스튜디오로 하려니 또 막막... ㅠㅠ
튜토리얼 읽으면서 차근차근 해봐야겠다

아무튼.. TBB도 깔아야 하고 Cmake도 깔아야 하고 은근 윈도우에서는 더 귀찮아 진듯?

[링크 : http://hxr99.blogspot.kr/2011/12/opencv-examples-camera-capture.html]
[링크 : http://thinkpiece.tistory.com/246]
[링크 : http://thinkpiece.tistory.com/65]

'Programming > openCV' 카테고리의 다른 글

openCV visual studio 프로젝트 생성하기  (0) 2014.06.30
OpenNI - Open Natural Interaction  (0) 2014.06.30
opencv docs  (0) 2014.02.17
Interoperability with OpenCV 1  (0) 2014.02.08
opencv2 on ubuntu  (2) 2013.11.10
Posted by 구차니
Programming/C Win32 MFC2014. 6. 27. 17:03
Junit이나 CUnit 등에서 테스트 시 입력값들을 생성해서
경우의 수대로 입력하기 위해서는 순열을 생성하는게 유리하다.

아무튼..
Unit Test시 Range로 테스트 하려면 순열을 쓰기에는..
int 나 float / double에는 맞지 않는것 같고.. 어떻게 해야하려나? 

'Programming > C Win32 MFC' 카테고리의 다른 글

include guard  (0) 2014.11.05
vc++ vector와 Vector 차이점?  (0) 2014.07.03
2중 포인터 사용이유  (0) 2014.03.19
typeof  (0) 2014.03.11
const / pointer  (0) 2014.02.25
Posted by 구차니
Programming/Java2014. 6. 27. 16:47
annotation 기본 정의된 녀석들
@Override
@Deprecated
@SuppressWarnings
@SafeVarargs
@FunctionalInterface 

'Programming > Java' 카테고리의 다른 글

자바 유료화?  (10) 2018.11.05
자바 임베디드 JRE 라이센스?  (0) 2015.05.12
JUnit tutorial  (0) 2014.06.27
java unchecked/checked exception  (0) 2014.05.15
Class.forName  (0) 2014.05.09
Posted by 구차니
Programming/Java2014. 6. 27. 13:29
음.. 그러고 보니 이클립스에서 JUnit / Maven 사용시
war 파일로 빼내면은 JUnit이 제대로 작동하지 않았던거 같은 기억이 드는데...


JUnit은 assert로 시작하는 녀석들로 주로 테스트를 하는 것 같다.
[링크 : http://using.tistory.com/entry/JUnit-테스트-하기]

API를 뒤져보니 참/거짓/동일/Null 이정도로 축약되는 것 같고..
static void assertEquals(java.lang.Object expected, java.lang.Object actual) // Asserts that two objects are equal.

static void assertTrue(boolean condition) // Asserts that a condition is true.
static void assertFalse(boolean condition) // Asserts that a condition is false.

static void assertSame(java.lang.Object expected, java.lang.Object actual) // Asserts that two objects refer to the same object.
static void assertNotSame(java.lang.Object unexpected, java.lang.Object actual) //Asserts that two objects do not refer to the same object.

static void assertNull(java.lang.Object object) // Asserts that an object is null.

static <T> void  assertThat(T actual, org.hamcrest.Matcher<T> matcher) // Asserts that actual satisfies the condition specified by matcher.

static void fail() //Fails a test with no message.
 
[링크 : http://junit.sourceforge.net/javadoc/org/junit/Assert.html] API 

pdf 파일은 일단 찾아 놓으면 피가 되고 살이 되니...
[링크 : http://www.tutorialspoint.com/junit/]
    [링크 : http://www.tutorialspoint.com/junit/junit_tutorial.pdf] PDF 파일
[링크 : http://www.mkyong.com/tutorials/junit-tutorials/]

'Programming > Java' 카테고리의 다른 글

자바 임베디드 JRE 라이센스?  (0) 2015.05.12
predefined annotation /java  (0) 2014.06.27
java unchecked/checked exception  (0) 2014.05.15
Class.forName  (0) 2014.05.09
JDNI - Java Directory & Naming Interface  (0) 2014.05.09
Posted by 구차니
Programming/fortran2014. 6. 19. 22:34

FORTRAN 77 supports six data types:

LOGICAL            
boolean (true or false)
CHARACTER          character
INTEGER            integer
COMPLEX            single precision complex number 
REAL               single precision floating point number
DOUBLE PRECISION   double precision floating point number
 
[링크 : http://www.obliquity.com/computer/fortran/datatype.html


complex는 a+ib의 허수 표현으로 ()를 사용하지만 엄밀하게 배열은 아니라고 해야 하려나?
복소수 상수 complex constant이다. 이 때는 (real 또는 integer) 상수 한 쌍을 쉼표(comma)로 분리하고 괄호 (paranthese)로 둘러싸서 나타낸다.

      (2, -3)
      (1., 9.9E-1)
 
첫 번째 숫자는 실수부, 두번째 숫자는 허수부이다.
 
[링크 : http://seismic.yonsei.ac.kr/fortran/expressions.html] ]


문자열은 c가 그러하듯 character형 배열로 선언하면 된다.
Character Arrays

When a dummy argument is a character array the passed-length mechanism can be used in the same way as for a character variable. Every element of the dummy array has the length that was passed in from the actual argument.

For example, a subroutine designed to sort an array of character strings into ascending order might start with specification statements like these:

       SUBROUTINE SORT(NELS, NAMES) 
       INTEGER NELS 
       CHARACTER NAMES(NELS)*(*) 

Alternatively the actual argument can be a character variable or substring. In such cases it usually makes more sense not to use the passed-length mechanism. For example an actual argument declared:
CHARACTER*80 LINE
could be passed to a subroutine which declared it as an array of four 20-character elements:
       SUBROUTINE SPLIT(LINE) 
       CHARACTER LINE(4)*20 

Although this is valid Fortran, it is not a very satisfactory programming technique to use a procedure call to alter the shape of an item so radically.
 
[링크 : http://www.star.le.ac.uk/~cgp/prof77.html

'Programming > fortran' 카테고리의 다른 글

포트란77 문법 테스트  (0) 2014.06.19
fortran 첫 실행 >_<  (0) 2014.06.18
fortran 문법  (0) 2014.06.08
Posted by 구차니
Programming/fortran2014. 6. 19. 22:12
첫줄에 바로 program이라는 키워드를 입력하면 에러가 발생한다.
반드시 7칸 째에 입력해야 한다 -_-a 
또한, 탭으로도 7번 넣어줘도 안되고 반드시 스페이스로 해야한다. 
  1 program circle
  2       real r, area 

$ fort77 simple.f
Error on line 1: illegal continuation card (starts "progra")
   MAIN:
/usr/bin/fort77: aborting compilation 

4칸을 띄울 경우 컴파일 에러가 발생한다.
  7       write (*,*)
  8     + 'Give radius r:' 

$ fort77 simple.f
   MAIN circle:
Error on line 8: nondigit in statement label field "    +"
Error on line 8: unclassifiable statement (starts "")
/usr/bin/fort77: aborting compilation 

5칸 째에는 어떤 문자가 들어가던 상관없지만 문장이 이어짐을 나타내기 위해 +를 주로 쓰는게 좋다고 한다.
  7       write (*,*)
  8      s  'Give radius r:' 

  7       write (*,*)
  8      + 'Give radius r:' 

[링크 : http://seismic.yonsei.ac.kr/fortran/basics.html]


+ 아무래도.. 포트란이 구석기 시대(!) 프로그래밍 언어이다 보니
천공카드로 뚫어 쓰던 관습(?)으로 인해 칸으로 구분을 하는 듯?



[링크 : http://blog.daum.net/osh535/11247020 ]


몇가지 C언어와의 차이점이 C언어는 [행][열] 인데 반해 포트란은 [열][행] 이란 점? 
그런데 메모리 할당상으로도 차이가 있으려나? 

재밌게도 포트란77은 c와 다르다죠. 
dimension a(4,3)이라고 변수가 선언되었다면
a(1,1) a(2,1) a(3,1) a(4,1) a(1,2) a(2,2) ... 순서로 저장됩니다.
포트란9x에서는 row major인지 column major인지 지정할 수 있다는군요.
 
[링크 : https://kldp.org/node/75640

'Programming > fortran' 카테고리의 다른 글

포트란 변수 타입  (0) 2014.06.19
fortran 첫 실행 >_<  (0) 2014.06.18
fortran 문법  (0) 2014.06.08
Posted by 구차니
Programming/fortran2014. 6. 18. 22:41
조금은.. 귀찮아서 대충 날로먹는 글? ㅋㅋ

최소한이 키워드는 이렇게 하이라이팅 되니 천천히 공부를 해봐야겠다. 
일단 c로 시작하면 주석이고..
나머지는 탭이나 스페이스로 넣어 주는데 문법상으로 몇칸을 해야 한다는게 있어서 실험적으로 찾아봐야 익혀질 것 같다.


$ vi simple.f
      program circle
      real r, area

c This program reads a real number r and prints
c the area of a circle with radius r.

      write (*,*) 'Give radius r:'
      read  (*,*) r
      area = 3.14159*r*r
      write (*,*) 'Area = ', area

      stop
      end

$ fort77 simple.f
   MAIN circle:
$ ll
합계 20
drwxrwxr-x  2 minimonk minimonk 4096  6월 18 22:38 ./
drwxr-xr-x 55 minimonk minimonk 4096  6월 18 22:38 ../
-rwxrwxr-x  1 minimonk minimonk 7614  6월 18 22:38 a.out*
-rw-rw-r--  1 minimonk minimonk  267  6월 18 22:38 simple.f

$ ./a.out
 Give radius r:
10
 Area =   314.158997 

칸에 관한 규칙 (Column position rules)

Fortran 77은 정해진 형식이 없이 자유롭게 쓸 수 있는 언어가 아니라 원시 코드라고 하는 source code의 형식에 대한 매우 엄격한 규칙이 있다. 가장 중요한 규칙은 칸 (column)에 관한 규칙이다.
Col. 1    : 빈 칸 또는 설명임을 나타내는 "c" 나 "*"
Col. 2-5  : 문장 label (optional)
Col. 6    : 앞 줄의 연속 (optional)
Col. 7-72 : 문장
Col. 73-80: 일련 번호 (optional, 요즈음은 거의 사용하지 않음)
 
Fortran 77 프로그램의 대부분의 줄은 6 개의 빈칸으로 시작하여 72 번째 칸 이전에 끝나서 문장 영역(statement field)만 사용한다. 반면에 Fortran 90은 형식에 구애받지 않는 free-foramt이 가능하다.

[링크 : http://seismic.yonsei.ac.kr/fortran/basics.html



C언어가 포트란을 많이 계승했다고 하지만
C를 먼저 다룬 입장으로는 포트란이 참 C틱하구나 싶을 정도?
컴파일 이후에 a.out 나오는 걸 보면 참.. 미묘한 느낌이 든다. 

'Programming > fortran' 카테고리의 다른 글

포트란 변수 타입  (0) 2014.06.19
포트란77 문법 테스트  (0) 2014.06.19
fortran 문법  (0) 2014.06.08
Posted by 구차니
Programming/jsp2014. 6. 17. 17:56
심심(?)하진 않고 걍 예전에 실패했던걸 다시 해보는데
csv를 통해 oracle date 포맷을 어떻게 넣을수 있을까 해서

일단 들어있는 녀석을 export 한뒤 다시 import 해보았다.

2014-05-22 01:45:33.0

export 시에 이런식으로 나왔으니 넣을때도 이런식으로 넣으주면 끝!


특이사항으로는
가장 마지막 줄은 입력이 되지 않는 버그(?)가 보였다는 점.
가장 마지막 한 줄은 엔터 쳐서 빈 줄을 추가해주자. 
Posted by 구차니
Programming/fortran2014. 6. 8. 12:18
한번쯤은 봐둬야지 싶었는데..
영손이 안가는 이녀석..

swift관련해서 obejctive-c 이야기에 포트란이 언급되길래 한번 찾아 봄

[링크 : http://seismic.yonsei.ac.kr/fortran/]
[링크 : http://yoonc.tistory.com/40

'Programming > fortran' 카테고리의 다른 글

포트란 변수 타입  (0) 2014.06.19
포트란77 문법 테스트  (0) 2014.06.19
fortran 첫 실행 >_<  (0) 2014.06.18
Posted by 구차니
Programming2014. 6. 8. 11:48
변수는 let과 var로 선언하며 타입을 반드시 선언할 필요는 없는 동적 타입 바인딩 언어이다. 
let varname[ : type]
var varname[ : type] 

대신 암시적 형변환을 지원하지 않으며, 암시적으로 변환하려 할 경우 에러가 발생하게 된다.

[링크 : https://developer.apple.com/.../Swift/Conceptual/Swift_Programming_Language/TheBasics.html]


함수는 컴파일 언어들의 일반적인 형태와 비슷하나 return type이 -> 키워드 뒤에 오게 되며
"tuple" 이라는 개념을 통해 복수개의 값을 리턴할 수 있다.
func fuctionname(type : argname) -> return type
{


return type은 하나의 변수가 될수도
()로 묶어 복수개의 값을 넘겨줄수도 있다
어떻게 보면 클래스나  구조체를 익명으로 사용하는 것으로 흉내낼수 있겠지만

아무래도 문법으로 자원하니 깔끔한듯

[링크: https://developer.apple.com/.../Swift/Conceptual/Swift_Programming_Language/Functions.html]

lisp처럼 nil을 제공한다



 

'Programming' 카테고리의 다른 글

다배장 정수?  (0) 2015.10.21
apple 차세대 언어 swift  (0) 2014.06.03
ARToolKit / openVRML  (0) 2012.12.25
윤년 계산하기  (2) 2012.05.21
TBB/IPP  (2) 2012.02.12
Posted by 구차니