본문 바로가기

Java

(56)
Aracade Intro #39 knapsackLight. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #39 knapsackLight. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. You found two items in a treasure chest! The first item weighs weight1 and is worth value1, and the second item weighs weight2 and is worth value2. What is the total maximum value of the items you can take with you, assuming that your max weight capacity is maxW and you can'..
Aracade Intro #38 growingPlant. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #38 growingPlant. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Each day a plant is growing by upSpeed meters. Each night that plant's height decreases by downSpeed meters due to the lack of sun heat. Initially, plant is 0 meters tall. We plant the seed at the beginning of a day. We want to know when the height of the plant will reach a c..
OpenCV How to get min/max value from matrix, 매트릭스 최소값/최대값. Java,c++,cpp,imageprocessing - Core 함수에서 minMaxLoc(Matrix) 를 호출하면 MinMaxLocResult 객체를 반환한다. 반환받은 객체에서 다양한 값들을 뽑아낼 수 있는데, 최소/최대 값을 뽑는 것은.. If you call "minMaxLoc(Matrix)" method in Core class, you could get MinMaxLocResult instance. And we could get various val from it, anyway, the way to get min/max val... 코드.. 코드를 보자!!!! Code.. lemme see code!!!!!! example public double getMax(final Mat inputMat) { return Core.minMaxLoc(in..
OpenCV How to handle single channel image matrix each pixel, add/subtract/multiply/division (1), 이미지 매트릭스 각 픽셀단위 값 조정하기 (영상처리, image processing) (1) OpenCV How to handle single channel image matrix each pixel, add/subtract/multiply/division (1) 이미지 매트릭스 각 픽셀단위 값 조정하기 (영상처리, image processing) (1) Handling each pixel in matrix using put/get in OpenCV 1) / 2) both worked well, but second one did better performance. I changed to 3) using Core in OpenCV, and i'll post later. You can use any operator, but example code is about append. 1/2 둘다 동작하고,..
Aracade Intro #34 extractEachKth. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #34 extractEachKth. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given array of integers, remove each kth element from it. 주어진 정수 배열에서, e.g. Input -> inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and k = 3 Output -> extractEachKth(inputArray, k) = [1, 2, 4, 5, 7, 8, 10]. // Process// 1. Input vector// 2. Iterate from begin to end// 2.1. c..
Aracade Intro #33 stringsRearrangement. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #33 stringsRearrangement. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given an array of equal-length strings, check if it is possible to rearrange the strings in such a way that after the rearrangement the strings at consecutive positions would differ by exactly one character. 주어진 같은 길이의 string 배열들에서, 한개의 char 씩만 교체 가능해서 연속적으로 이어지는 자리로 ..
Arithmetic of complex number(1) multiply example code, 복소수 사칙연산(1) 곱셈 코드, real/imaginary, java, opencv, matrix (1) Arithmetic of complex number(1) multiply example code, 복소수 사칙연산(1) 곱셈 코드, real/imaginary, java, opencv, matrix (1) 공식은..Formula.. i^2 = -1, (a + bi) * (c + di) -> (ac - bd) + (ad + bc)i 나눗셈은 아래에Division formula is below 2018/11/26 - [Programming/Java] - Arithmetic of complex number(2) division example code, 복소수 사칙연산(2) 나눗셈 코드, real/imaginary, java, opencv, matrix (2) Lemme see code.. 코드를 보자.. 예제..
Java foreach statement (advanced for iteration statement) 자바 향상된 for문 문법 Java foreach statement (advanced for iteration statement) 자바 향상된 for문 문법 Main function process //Process//1. Make new integer list for sample//2. Iterate using normal for statement (printout)//3. Iterate using foreach statement (printout)//4. Finish //처리과정//1. 확인할 샘플 정수리스트를 만든다.//2. 일반 for문을 사용하여 출력해본다.//3. foreach문을 사용하여 출력해본다.//4. 끝낸다. Example code below public class TestForeach { public stati..