diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000000..f0c49846ff --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + 10.12.2 + JavaOnly + true + + + \ No newline at end of file diff --git a/image-processing/src/main/java/com/baeldung/imageprocessing/opencv/OpencvVersion.java b/image-processing/src/main/java/com/baeldung/imageprocessing/opencv/OpencvVersion.java new file mode 100644 index 0000000000..9a16a87a57 --- /dev/null +++ b/image-processing/src/main/java/com/baeldung/imageprocessing/opencv/OpencvVersion.java @@ -0,0 +1,28 @@ +package com.baeldung.imageprocessing.opencv; + +import org.opencv.core.Core; + +/** + * Print OpenCV Version Number + */ +public class OpencvVersion { + static { + System.loadLibrary(Core.NATIVE_LIBRARY_NAME); + } + + public static void main(String[] args) { + + if ((1 == args.length) && (0 == args[0].compareTo("--build"))) { + + System.out.println(Core.getBuildInformation()); + } else if ((1 == args.length) && (0 == args[0].compareTo("--help"))) { + + System.out.println("\t--build\n\t\tprint complete build info"); + System.out.println("\t--help\n\t\tprint this help"); + } else { + + System.out.println("Welcome to OpenCV " + Core.VERSION); + } + } + +} \ No newline at end of file diff --git a/toolkits/codebank/src/test/java/com/ossez/toolkits/codebank/tests/lintcode/LintCode0035BitOperationTest.java b/toolkits/codebank/src/test/java/com/ossez/toolkits/codebank/tests/lintcode/LintCode0035BitOperationTest.java new file mode 100644 index 0000000000..3a5f46ed88 --- /dev/null +++ b/toolkits/codebank/src/test/java/com/ossez/toolkits/codebank/tests/lintcode/LintCode0035BitOperationTest.java @@ -0,0 +1,45 @@ +package com.ossez.toolkits.codebank.tests.lintcode; + +import com.ossez.toolkits.codebank.tests.EmptyQuickTest; +import org.apache.commons.math3.util.FastMath; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *

+ * 35 + *

+ *

+ * + * @author YuCheng + */ + +public class LintCode0035BitOperationTest { + + private final static Logger logger = LoggerFactory.getLogger(EmptyQuickTest.class); + + /** + * 35 + */ + @Test + public void testInt2Bit() { + logger.debug("BEGIN"); + System.out.println(Integer.toBinaryString(5)); + System.out.println(Integer.toBinaryString(2)); + + System.out.println(Integer.toBinaryString(2 << 2)); + + System.out.println(Integer.parseInt(Integer.toBinaryString(2 << 2), 2)); + + System.out.println(5 / 3); + System.out.println(5 % 3); + FastMath.pow(2, 3); + + } + +}