티스토리

catpark's something new
검색하기

블로그 홈

catpark's something new

www.icatpark.com/m

게으른 개발자... -_-;

구독자
0
방명록 방문하기

주요 글 목록

  • java print api 주의 사항 DocFlavor flavor = DocFlavor.INPUT_STREAM.PDF; FileInputStream fis = null; try { fis = new FileInputStream("sample.pdf"); } catch (FileNotFoundException e) { e.printStackTrace(); } Doc doc = new SimpleDoc(fis, flavor, null); pdfService.createPdfLabel(); try { docPrintJob.print(doc, printRequestAttributeSet); } catch (PrintException e) { e.printStackTrace(); } 생산 현장 프로젝트 중에 제품 생산시 바코드를 프린터로 출력해야하.. 공감수 0 댓글수 0 2021. 1. 15.
  • 왜 돈 연산에는 Floating-point type을 쓰면 안되나? https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html Primitive Data Types (The Java™ Tutorials > Learning the Java Language > Language Basics) The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available. See JDK Release Notes for inf.. 공감수 0 댓글수 0 2020. 6. 30.
  • Lombok @Builder에서 method name 이용 패턴 먼저 이 패턴을 사용하게 된 계기는 api response에서 http status code처럼 result를 return하려고 하려다 보니 이 result라는 놈이 특정 에러에 따라 정해지는 것이라 메소드 이름에 내용을 정해서 파라미터를 정하면 어떨까 하고 사용하게 되었습니다. Result model입니다. builder 패턴에 Success, failWithNotFoundPath같은 이름에 따라 내용이 정해지게 됩니다. @Getter @ToString @Builder(builderClassName = "Builder") public class MyResult { private boolean succeed; private String majorCode; private String minorCode; p.. 공감수 0 댓글수 0 2020. 5. 21.
  • JVM Garbage Collection Basic PermGen은 자바 8에서 Metaspcae로 대체됐다. 이미지 출처: https://help.sap.com/ 읽기 전 주의사항(그림을 보는 법) 그림을 그리다보니 Stack에 있는 동그라미 모양과 힙 메모리에 있는 동그라미 모양이 동일한 그림들이 많이 있습니다. 이건 둘이 동일한 메모리를 의미하는 게 아니라 그냥 스택에서 힙을 참조한다는 걸 그린 건데, 사실 둘의 모양을 다르게 그려야하는데 아무 생각없이 복붙해서 그리다보니 이렇게 그리게 되었고… 되돌리기에는 너무 많이 그림을 그려놔서(히스토리 추적이 안 되게 막 그려서…) 귀챠니즘으로 인해 그림을 수정하지 않았습니다. 이 점 참고하셔서 보시길 바랍니다! 들어가기에 앞서 이 글은 이일웅 님께서 번역하신 자바 최적화란 책을 읽던 도중 공부한 내용을 정리.. 공감수 0 댓글수 0 2019. 5. 10.
  • Non-blocking, Blocking public class HelloWorld { static long start; public static void main(String[] args) throws InterruptedException, ExecutionException { HelloWorld helloWorld = new HelloWorld(); Future hello; System.out.println("[" + System.currentTimeMillis() + "]" + "Start!"); hello = helloWorld.getSayHelloAsync(); System.out.println("[" + System.currentTimeMillis() + "]" + "End!"); System.out.println(hello.get(.. 공감수 0 댓글수 0 2019. 3. 18.
  • Asynchronous (VS Synchronous) 보통 프로그래밍을 하면 동기프로그램을 짜게 됩니다. HelloWorld와 같은 sample 코드들 말입니다. Main 함수에서 호출되는 다른 함수들을 생각해 보세요.public class HelloWorld { public static void main(String[] args) { HelloWorld helloWorld = new HelloWorld(); System.out.println(helloWorld.sayHello()); } public String sayHello() { return "Hello!"; } }sayHello()함수가 호출되고 있고 이 함수는 string을 return하고 있습니다. 아주 짧은 순간이긴 하지만 sayHello()가 실행되는 순간에는 main함수는 멈추고 retur.. 공감수 0 댓글수 0 2019. 3. 18.
    문의안내
    • 티스토리
    • 로그인
    • 고객센터

    티스토리는 카카오에서 사랑을 담아 만듭니다.

    © Kakao Corp.