본문 바로가기

Java

(56)
Apache POI library excel file, Mat in OpenCV to Excel file / 아파치 POI 라이브러리 엑셀파일 쓰기 OpenCV Mat 에서 엑셀파일 만들기 (java, c++) Apache POI library excel file, Mat in OpenCV to Excel file / 아파치 POI 라이브러리 엑셀파일 쓰기 OpenCV Mat 에서 엑셀파일 만들기 (java, c++) Java 에서 OpenCV 를 이용하여 Mat data를 만들었을 때 POI로 엑셀 저장을 하기 위한 메소드 Method for saving Mat data in Java OpenCV using POI 설명 저장할 excel 파일 경로+이름(absolutePath) 과, 저장할 Mat 을 입력받는다.Mat 의 channel 은 sheetrows 는 rowcols 는 cell (엑셀에서) 저장 잘된다. Description Input absolutePath of file we wanna save (..
Java Math class - squareRoot, power num example / 자바 - 루트, 제곱 값 예제 Java Math class - squareRoot, power num example / 자바 - 루트, 제곱 값 예제 squareRoot - 제곱근 (루트 씌운 값) power - 거듭제곱 두개 다 Math 클래스에서 바로 호출해서 사용 가능하다. Both can be used in Math class in Java e.g. Math.sqrt(value); Math.pow(value, intNum); Code.. lemme see code..... 코드.. 코드를 보자......... public static void main(String[] args) { int testNum1 = 16;float testNum2 = 625f;double testNum3 = 169;System.out.println("..
Aracade Intro #22 avoidObstacles. Algorithm, 알고리즘, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #22 avoidObstacles. Algorithm, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Q. You are given an array of integers representing coordinates of obstacles situated on a straight line. Assume that you are jumping from the point with coordinate 0 to the right. You are allowed only to make jumps of the same length represented by some integer. Find the minimal len..
Aracade Intro #21 isIPv4Address. Algorithm, 알고리즘, Codefights, CodeSignal, regx, 정규표현식, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #21 isIPv4Address. Algorithm, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. An IP address is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. There are two versions of the Internet protocol, and thus two versions of addresses. One of them is the IPv4 address. IP주소..
Aracade Intro #20 arrayMaximalAdjacentDifference. Algorithm, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #20 arrayMaximalAdjacentDifference. Algorithm, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q.Given an array of integers, find the maximal absolute difference between any two of its adjacent elements. 주어진 정수 배열 중에서, 인접한 정수끼리 최대의 차이값(절대값) 을 구하여라 e.g.Input -> inputArray = [2, 4, 1, 0]Output -> arrayMaximalAdjacentDifference(inputArray) = 3. ? index 1, 2 -> 4 and 1 -> 3 //..
Difference between String, StringBuilder, and StringBuffer Class 차이점 / Java c++ 문자열, example 예제 Difference between String, StringBuilder, and StringBuffer Class 차이점 / Java c++ 문자열, example 예제 Difference Between String , StringBuilder And StringBuffer Classes (영어 원문 사이트) 확인은 여기로 String String is immutable ( once created can not be changed )object . The object created as aString is stored in the Constant String Pool.Every immutable object in Java is thread safe ,that implies String is also t..
Design pattern - Singleton (디자인패턴 - 싱글턴) Design pattern - Singleton (디자인패턴 - 싱글턴) It's used alot because it's easy to use. Example would be written in Java or C++, maybe in Java. And it's simple if you understand the whole context. If you wonder the classdiagram, then just search. Important things.. 1. It's the only instance using specific class, in heap memory 2. This class has a self instance as a attribute(static) 3. Private constru..
Java parse double dataType after dot, 자바 소수점 이하 출력개수 조절 자바 소수점 이하 출력개수 조절 Java parse double dataType after dot 자바의 기본 자료형 doubleDouble class 의 parseDouble 메소드와 String class 의 format 메소드를 사용한다. primitive data type "double" in java.Use Double class to use parseDouble method, and String class to use format method. - 문자로 나오는 소수점을 원하는 만큼 잘라내고 파싱해서 double 값을 얻어낸다. - Get double value after parsing from string format double which you wanna get e.g. public st..