Skip to content

Instantly share code, notes, and snippets.

View namkyu's full-sized avatar

Namkyu Lee namkyu

View GitHub Profile
@namkyu
namkyu / thymeleafTest.md
Last active August 17, 2018 07:22
basic #thymeleaf

페이지 레이아웃

<div class="col-md-3 left_col" th:replace="fragments/left :: left">
    left 메뉴
</div>

fragments 디렉토리에 left.html 파일 생성 후 다음의 코드 추가
<div class="col-md-3 left_col" th:fragment="left">...</div>
public class DeadLockTest {
public void method1() {
String name = new Thread().getName();
synchronized (String.class) {
System.out.println("[" + new Thread().getName() + "] Aquired lock on String.class object in the method1");
try { Thread.sleep(100); } catch (InterruptedException e) {}
synchronized (Integer.class) {
@namkyu
namkyu / lambda.md
Last active November 7, 2018 06:13
lambda #java8

람다식

(int n, String str) -> { return str + n; }
(int n, String str) -> str + n
(n, str) -> str + n
str -> str + 1
() -> "Hello, World!"
() -> {}
@namkyu
namkyu / File.java
Created June 1, 2018 04:56
파일 read #java
// webApp 스타일
String templatePath = "excel/template_delivery.xls";
System.out.println("클래스 로더 : " + getClass().getClassLoader().getResource(templatePath).toString());
// spring boot 스타일
ClassPathResource classPathResource = new ClassPathResource(templatePath);
System.out.println("클래스 패스 리소스 getPath : " + classPathResource.getPath());
System.out.println("클래스 패스 리소스 getURL : " + classPathResource.getURL());
System.out.println("클래스 패스 리소스 toString : " + classPathResource.toString());
@namkyu
namkyu / excel.md
Last active May 30, 2018 00:47
excel #excel

열고정

보기 > 고정 > 현재 열까지 고정

특정셀 고정값

$ 를 추가해 준다. ($N$3)
=(E6 * F6) * ($N$3 / 100)
@namkyu
namkyu / Android.md
Last active August 3, 2021 08:14
android #android

코틀린 안드로이드 개발환경 설정

> 안드로이드 스튜디오 설치 (version : 3.1.2)
> 안드로이드 스튜디오 시작 하면 Setup Wizard에서 SDK 설치 가능 하다.
> Start a new Android Studio project
  - Include Kotlin support 체크
> kotlin 플러그인 설치 (안드로이드 스튜디오 3버전 이후부터는 kotlin 기본 탑재)
> 새 프로젝트
> Include Kotlin support 체크
> IDE 상단의 Run 실행
@namkyu
namkyu / annotaion.kt
Last active May 23, 2018 08:28
kotlin test #kotlin
@AnnoClass("nklee")
class AnnoClassImple {
}
@namkyu
namkyu / JsoupTest.java
Created May 16, 2018 00:50
Jsoup #jsoup
package com.kyu.app;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.safety.Cleaner;
import org.jsoup.safety.Whitelist;
import org.jsoup.select.Elements;
import org.junit.Test;
@namkyu
namkyu / algorithm.md
Last active May 8, 2018 01:27
algorithm #algorithm

selection sort

@Test
public void selectionSort() {
    int[] array = {10, 8, 99, 7, 1, 5, 88, 9};
    selection_sort(array);
    System.out.println(Arrays.toString(array));
}

private static void selection_sort(int[] input) {
@namkyu
namkyu / springboot2.0.md
Last active May 8, 2018 01:06
spring boot 2.0 정리 #spring_boot

시작하기

maven은 pom 파일을 상속받는다.
<parent> 안에 부모를 선언한다.
<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.0.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>