๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๊ฐœ๋ฐœ์ƒํ™œ42

Clone์œผ๋กœ ์ƒ์„ฑํ•œ ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐํ™” ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋งŒ๋“ค๊ณ  ์ƒˆ๋กœ ๊ตฌ์„ฑํ•ด์„œ ์˜ฌ๋ฆฌ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ์ง€๋งŒ, ๊ธฐ์กด ํ”„๋กœ์ ํŠธ๋ฅผ Clone ํ•˜์—ฌ, ๊ธฐ์กด Git ์—ฐ๊ฒฐ์„ ๋Š๊ณ  Commit๋“ค์„ ์ดˆ๊ธฐํ™” ํ•œ ํ›„ ํ•„์š” ํŒŒ์ผ๋“ค๋งŒ ์ถ”๋ ค์„œ ์ปค๋ฐ‹ ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ƒˆ๋กœ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•. Clone ๋œฌ ์›๊ฒฉ ๋ถ€ํ„ฐ ๋Š๊ธฐ git remote -v git remote remove origin ์›๊ฒฉ ์—ฐ๊ฒฐ ๋Š๊ณ  ๋‚œ ํ›„ Git ์ดˆ๊ธฐํ™” rm -rf .git git init ์ฒซ Commit ์ž‘์„ฑ git add . git commit -m "Initial Commit" ์›๊ฒฉ ์ €์žฅ์†Œ(Bitbucket, github ...)์— ์ƒˆ๋กœ์šด Repository ์ƒ์„ฑ git ์ €์žฅ์†Œ ์—ฐ๊ฒฐ ํ›„ ํ‘ธ์‰ฌ git remote add origin {remoteUrl} git push -u --force or.. 2022. 5. 28.
[Java] List ๋‚˜๋ˆ„๊ธฐ As-Is ํž˜๋“ค๊ฒŒ ๋‚˜๋ˆ„๋Š” ๋ฒ• (subList) public static void main(String[] args) { List integerList = new ArrayList(); for(int i = 0; i 2022. 5. 23.
[Java] Null String Casting Null์„ String์œผ๋กœ Castingํ•  ๋•Œ, Null Pointer Exception ์•ˆ๋ฐœ์ƒํ•จ. ์ž˜ ์บ์ŠคํŒ…๋จ 2022. 4. 29.
[Java] Map ์ œ๊ณต ๋ฉ”์„œ๋“œ๋“ค ์ •๋ฆฌ map.getOrDefault(key,0) null ์ธ ๊ฒฝ์šฐ Default ๊ฐ’ 0์œผ๋กœ ์ง€์ • map.containsKey('A') ํ‚ค ๊ฐ’์— ํ•ด๋‹น ๊ฐ’(A)๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ๋Š”์ง€ ์ฒดํฌ map.size() ๋งต ํฌ๊ธฐ ์ฒดํฌ map.isEmpty() ๋งต์ด ๋น„์–ด์žˆ๋Š”์ง€ ์ฒดํฌ map.remove('A') ๋งต์—์„œ ํ‚ค๊ฐ€ A์ธ ํ•ญ๋ชฉ ์‚ญ์ œ A๋ผ๋Š” ํ‚ค์˜ value๊ฐ’ ๋ฆฌํ„ด 2022. 4. 26.
OOM์˜ ์›์ธ๊ณผ ์•„์ฃผ ๊ฐ„๋‹จํ•˜๊ฒŒ OOM ๋ฐœ์ƒ ์‹œํ‚ค๊ธฐ outofmemory๊ฐ€ ๋‚˜๋Š” ์ด์œ  ์„ค์ •๋œ ๋ฉ”๋ชจ๋ฆฌ ๋Œ€๋น„ ์š”์ฒญ๋˜๋Š” ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋งŽ๊ธฐ ๋•Œ๋ฌธ์— ๋‚˜ํƒ€๋‚˜๋Š” JVM์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ ์„ค์ •์˜ ์˜ค๋ฅ˜๋‚˜ ์‚ฌ์šฉ๋Ÿ‰ ์ดˆ๊ณผ๋กœ ์ธํ•ด jdk 5 ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” jdk hotspot ๋ฒ„๊ทธ๋กœ ์ธํ•ด oom์ด ๋‚ฌ๋˜ ๊ฒฝ์šฐ๋„ ์žˆ์—ˆ์Œ oom ์˜ˆ์‹œ Application์˜ oom(์ˆœ๊ฐ„์ ) ๊ณผ๋„ํ•œ ๋ฐ์ดํ„ฐ ์กฐํšŒ(100๋งŒ๊ฑด 200๋งŒ๊ฑด์”ฉ ์กฐํšŒํ•ด์„œ ๋ฉ”๋ชจ๋ฆฌ ๋“ค๊ณ  ์žˆ๋Š” ๊ฒฝ์šฐ, ์—…๋กœ๋“œ ํŒŒ์ผ์„ ํ›„์ฒ˜๋ฆฌ ํ•˜๊ธฐ๋กœ ํ•ด์„œ ๋ฉ”๋ชจ๋ฆฌ์— ๋“ค๊ณ  ์žˆ๋Š” ๊ฒฝ์šฐ) ์ž˜๋ชป๋œ ๋ฐ์ดํ„ฐ ์กฐ์ž‘(string) ์žฅ์‹œ๊ฐ„์— ๊ฑธ์ณ์„œ ์„œ์„œํžˆ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ์žฅ์‹๋˜๋Š” ๊ฒฝ์šฐ(memory leak) Cache(์–ด๋–ค ๋ฐ์ดํ„ฐ๋ฅผ ์—ฌ๋Ÿฌ ์“ฐ๋ ˆ๋“œ๊ฐ€ ๊ณต์œ ํ•ด์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ) leak Pool(๋ฐฐํƒ€์ ์œผ๋กœ ์‚ฌ์šฉํ•  ๋•Œ) leak (oom ๊ฐ€๊ธฐ ์ด์ „์— ํ’€ ๋ถ€์กฑ์œผ๋กœ 2์ฐจ ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ๋„ ๋งŽ์Œ.. 2022. 4. 16.
[Spring] boot์—์„œ Spring ๋ฒ„์ „ ํ™•์ธ Spring Boot ์‚ฌ์šฉ์ค‘์ธ๋ฐ Spring ๋ฒ„์ „ ์•Œ๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ, boot ๋ฒ„์ „์ด์•ผ pomํŒŒ์ผ์ด๋‚˜ ๋‹ค๋ฅธ ์„ค์ • ํŒŒ์ผ์— ์žˆ๋Š”๋ฐ ์Šคํ”„๋ง ๋ฒ„์ „์€ ์ฐพ์ง€ ๋ชปํ–ˆ๋‹ค. SpringBootVersion, SpringVersion ์‚ฌ์šฉ import org.springframework.boot.SpringBootVersion; import org.springframework.core.SpringVersion; ... String springVersion = SpringVersion.getVersion(); String bootVersion = SpringBootVersion.getVersion(); ... 2022. 3. 30.
[GIT] Reset ๋ช…๋ น์–ด git reset –hard b1f78bc ๋‹ค ๋‚ ๋ ค๋ฒ„๋ฆผ git reset –soft b1f78bc ์ž‘์—… ์ด๋ ฅ ๋‹ค ๋ณด์กด ๋ฐ stage์— ๊ณ ๋Œ€๋กœ ์žˆ์Œ git reset –mixed b1f78bc (default) ์ž‘์—… ์ด๋ ฅ ๋ณด์กด์ด๋‚˜ ์ปค๋ฐ‹์„ ์œ„ํ•ด ๋‹ค์‹œ ์ง€์ •ํ•ด์•ผํ•จ git reset HEAD~1 : ํ˜„์žฌ๋ถ€ํ„ฐ 1๊ฐœ ์ „ 2022. 3. 29.
[JAVA] String ์ค‘๋ณต์ œ๊ฑฐ Stream String str = "asdgaassdf"; - ๋ฌธ์ž์—ด์„ Character[]์œผ๋กœ ๋ณ€ํ™˜ํ•ด์ค˜์•ผํ•จ char[] -> Chcaracter[]๋ณด๋‹ค string -> Character[]์ด ๋” ๊ฐ„๋‹จํ•œ๊ฑฐ ๊ฐ™์€ ์ด์œ ๋Š” ๋ญ˜๊นŒ Character[] charObjectArray = str.chars().mapToObj(c -> (char)c).toArray(Character[]::new); - ์ค‘๋ณต ์ œ๊ฑฐ Stream characterStream = Arrays.stream(charObjectArray).distinct(); - String์œผ๋กœ ๋ฆฌํ„ด String result2 = characterStream.map(String::valueOf).collect(Collectors.joining()); - ํ•œ๋ฐฉ์— ํ•ฉ์น˜๋ฉด? .. 2022. 3. 22.
[JAVA] Case Format ๋ณ€๊ฒฝ (UPPER_CAMEL, LOWER_HYPEN...) google guava ์‚ฌ์šฉ google CaseFormat import import com.google.common.base.CaseFormat; ์›ํ•˜๋Š” ํฌ๋งท์œผ๋กœ ๋ณ€๊ฒฝ String upperCamelVndr = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, "text_test"); //TextTest ํฌ๋งท ์ข…๋ฅ˜ //CaseFormat enum ๊ฐ€๋ณด๋ฉด ์ž์„ธํ•˜๊ฒŒ ํ™•์ธ ๊ฐ€๋Šฅ LOWER_HYPHEN(CharMatcher.is('-'), "-") { String normalizeWord(String word) { return Ascii.toLowerCase(word); } String convert(CaseFormat format, String s) { if (for.. 2022. 3. 22.