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

๐Ÿ’ป

(31)
Could not find method testCompile() for arguments [{group=junit, name=junit, version=4.12}] ๋ฒ„์ „ ๋ณ€๊ฒฝ build.gradle plugins { id 'java' } group 'cleancode-study' version '1.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' } dependencies { testCompile('org.junit.jupiter:junit-jupiter:5.4.2') testCompile('org.assertj:assertj-core:3.11.1') } test { useJUnitPlatform() }
char to int / ASCII CODE Char > int char - '0'; ASCII CODE (int)char
์™„์ „ ํƒ์ƒ‰/DFS/BFS ์™„์ „ ํƒ์ƒ‰ (๋ธŒ๋ฃจํŠธ ํฌ์Šค) ๊ฐ€๋Šฅํ•œ ๋ชจ๋“  ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ๋‹ค ์‹œ๋„ํ•ด ๋‹ต์„ ์ฐพ๋Š” ๋ฐฉ๋ฒ• ์ •ํ™•ํ•˜๊ณ  ํ™•์‹คํ•˜๊ฒŒ ๋‹ต์„ ์ฐพ์„ ์ˆ˜๋Š” ์žˆ์ง€๋งŒ, ์‹œ๊ฐ„์ด ์˜ค๋ž˜ ๊ฑธ๋ฆฐ๋‹ค. ๋ชจ๋“  ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ๋ฌธ์ œ ๊ฐ™์€ ๋ถ€๋ถ„์—์„œ ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” ์•Œ๊ณ ๋ฆฌ์ฆ˜ - ์™„์ „ ํƒ์ƒ‰ ๊ธฐ๋ฒ• ์ข…๋ฅ˜ DFS(๊นŠ์ด ์šฐ์„  ํƒ์ƒ‰) : ๋ฃจํŠธ ๋…ธ๋“œ์—์„œ ์‹œ์ž‘ํ•ด์„œ ๋‹ค์Œ ๋ถ„๊ธฐ(branch)๋กœ ๋„˜์–ด๊ฐ€๊ธฐ ์ „์— ํ•ด๋‹น ๋ถ„๊ธฐ๋ฅผ ์™„๋ฒฝํ•˜๊ฒŒ ํƒ์ƒ‰ํ•˜๋Š” ๋ฐฉ๋ฒ• ์–ด๋–ค ๋…ธ๋“œ๋ฅผ ๋ฐฉ๋ฌธํ–ˆ์—ˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ๋ฐ˜๋“œ์‹œ ๊ฒ€์‚ฌ 1. ์ˆœํ™˜ ํ˜ธ์ถœ ์ด์šฉ(์ž๊ธฐ ์ž์‹ ์„ ํ˜ธ์ถœํ•˜๋Š”์ˆœํ™˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ํ˜•ํƒœ) 2. ๋ช…์‹œ์ ์ธ ์Šคํƒ ์‚ฌ์šฉ ๋ช…์‹œ์ ์ธ ์Šคํƒ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐฉ๋ฌธํ•œ ์ •์ ๋“ค์„ ์Šคํƒ์— ์ €์žฅํ•˜์˜€๋‹ค๊ฐ€ ๋‹ค์‹œ ๊บผ๋‚ด์–ด ์ž‘์—…ํ•œ๋‹ค. ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ: ๋ชจ๋“  ๋…ธ๋“œ๋ฅผ ๋ฐฉ๋ฌธ ํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒฝ์šฐ์— ์ด ๋ฐฉ๋ฒ•์„ ์„ ํƒํ•œ๋‹ค. ๊นŠ์ด ์šฐ์„  ํƒ์ƒ‰(DFS)์ด ๋„ˆ๋น„ ์šฐ์„  ํƒ์ƒ‰(BFS)๋ณด๋‹ค..
Stack/Queue/Deque/PriorityQueue Stack Last-In, First-Out -> LIFO ๋‚˜์ค‘์— ๋“ค์–ด๊ฐ„ ๊ฒƒ์ด ๋จผ์ € ๋‚˜์˜ค๋Š” ๊ตฌ์กฐ push: ๋ฐ์ดํ„ฐ ์‚ฝ์ž… pop: ๋ฐ์ดํ„ฐ ์กฐํšŒ + ์‚ญ์ œ peek: ๋ฐ์ดํ„ฐ ์กฐํšŒ clear: ๋ฐ์ดํ„ฐ ์ „์ฒด ์‚ญ์ œ size: stack ์‚ฌ์ด์ฆˆ empty: stack ๋น„์–ด์žˆ๋Š”์ง€ ์—ฌ๋ถ€ contains: ํŠน์ • ๋ฐ์ดํ„ฐ ํฌํ•จ ์—ฌ๋ถ€ search: ํŠน์ • ๋ฐ์ดํ„ฐ ์œ„์น˜ ๋ฐ˜ํ™˜ Queue First-In, First-Out -> FIFO ๋จผ์ € ๋“ค์–ด๊ฐ„ ๊ฒƒ์ด ๋จผ์ € ๋‚˜์˜ค๋Š” ๊ตฌ์กฐ LinkedList๋กœ ์ƒ์„ฑ ex) Queue queue = new LinkedList(); add / offer: ๋ฐ์ดํ„ฐ ์‚ฝ์ž… remove / poll: ๋ฐ์ดํ„ฐ ์‚ญ์ œ peek: ๋ฐ์ดํ„ฐ ์กฐํšŒ clear: ๋ฐ์ดํ„ฐ ์ „์ฒด ์‚ญ์ œ Deque queue์˜ ์–‘์ชฝ์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฝ์ž…..
React - State์™€ Props React๋ž€? : ์‚ฌ์šฉ์ž ์ •์˜ ํƒœ๊ทธ (html ํƒœ๊ทธ์™€ ๋‹ค๋ฅด๊ฒŒ ๋ฐ˜๋“œ์‹œ ๋Œ€๋ฌธ์ž๋กœ ์‹œ์ž‘) === Component props: ์šฐ๋ฆฌ๊ฐ€ ๋งŒ๋“  component์— html ํƒœ๊ทธ๋“ค์ฒ˜๋Ÿผ ์†์„ฑ์„ ๊ฐ–๊ฒŒ ํ•˜๋Š” ๊ฒƒ ์‚ฌ์šฉ์ž ํƒœ๊ทธ์— ์ •์˜ํ•œ ์†์„ฑ๋“ค์„ ๋ชจ๋‘ ์‚ฌ์šฉ์ž ์ปดํฌ๋„ŒํŠธ์˜ ์ฒซ๋ฒˆ์งธ ์ธ์ž๋กœ object๋ฅผ ๋„˜๊ฒจ์คŒ. (์ฒซ๋ฒˆ์งธ์ด์ž ์œ ์ผํ•œ ์ธ์ž, props) >> ์žฌ์‚ฌ์šฉ์„ฑ state ๋ฆฌ์•กํŠธ๋ฅผ ์œ ๋™์ ์œผ๋กœ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด ์กด์žฌํ•˜๋Š” ๊ฐ์ฒด useState() ๋ผ๋Š” ๋ฆฌ์•กํŠธ ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ State๋ผ๋Š” ์ €์žฅ๊ณต๊ฐ„์— ๋‹ด์•„ ์‚ฌ์šฉ setValue๋Š” ๊ฐ’์„ ๋ฐ”๊ฟ€ ๋•Œ ์‚ฌ์šฉ. ์ด๋ฅผ ํ˜ธ์ถœํ•˜๋ฉด value๊ฐ€ ๋ณ€๊ฒฝ๋œ ๊ฐ’์œผ๋กœ setting๋˜์–ด App ์ปดํฌ๋„ŒํŠธ๊ฐ€ reRender. ๋‘ ๊ฐ์ฒด ๋ชจ๋‘ ๋ Œ๋”๋ง ๊ฒฐ๊ณผ๋ฌผ์— ์˜ํ–ฅ์„ ์ฃผ๋Š” ์ •๋ณด๋ฅผ ๊ฐ–๊ณ  ์žˆ์ง€๋งŒ props(์™ธ๋ถ€์ž๋ฅผ ์œ„ํ•œ)๋Š” (ํ•จ์ˆ˜..
CSS - display: flex ๋ถ€๋ชจ ์š”์†Œ์ธ Flex Container์™€ ์ž์‹ ์š”์†Œ์ธ Flex Item Flxe ๊ธฐ๋Šฅ์˜ ์˜ํ–ฅ์„ ๋ฐ›๋Š” ์ „์ฒด ๊ณต๊ฐ„์€ ๋ถ€๋ชจ ์š”์†Œ์ธ Container ์„ค์ •๋œ Flex ์†์„ฑ์— ๋”ฐ๋ผ Container ์† ์ž์‹ ์š”์†Œ์ธ Item๋“ค์ด ์—ฌ๋Ÿฌ ํ˜•ํƒœ๋กœ ๋ฐฐ์น˜ * ๋ฐฐ์น˜ ๋ฐฉํ–ฅ ์†์„ฑ _ flex-direction .container { flex-direction: row; /* flex-direction: column; */ /* flex-direction: row-reverse; */ /* flex-direction: column-reverse; */ } * ์ •๋ ฌ ์†์„ฑ ๋ฉ”์ธ์ถ• ๋ฐฉํ–ฅ ์„ค์ • justify-content .container { justify-content: center; /* justify-content: flex-st..
HTML Form input์˜ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ์ž‘๋™์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„œ๋Š” input์ด form์•ˆ์— ์กด์žฌํ•ด์•ผ ํ•จ. input์„ form์•ˆ์— ์œ„์น˜์‹œ์ผฐ์„๋•Œ ์—”ํ„ฐ๋ฅผ ๋ˆ„๋ฅผ๋•Œ๋งˆ๋‹ค form์€ ์ž๋™์ ์œผ๋กœ submit form์•ˆ์˜ button ๋˜๋Š” type์ด submit์ธ input์„ ํด๋ฆญํ•˜๊ฑฐ๋‚˜ enter๋ฅผ ๋ˆ„๋ฅด๋ฉด ์ž‘์„ฑํ•œ form์ด "submit" submit์€ ์—”ํ„ฐ๋ฅผ ๋ˆ„๋ฅด๊ฑฐ๋‚˜ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•  ๋•Œ ๋ฐœ์ƒ > ๊ธฐ๋ณธ ๋™์ž‘์ธ ๋ธŒ๋ผ์šฐ์ € ์ƒˆ๋กœ๊ณ ์นจ > form submit ๊ธฐ๋ณธ ๋™์ž‘์„ ๋งž๋Š” ํ•จ์ˆ˜ preventDefault();
vanilla JS Challenges 2022/03/07~2022/03/21 ๊ฐ์ฒด ์•ˆ์— ๋ฉ”์„œ๋“œ ์„ ์–ธํ•˜๊ธฐ const object = { handleMousEnter: function(){ /// }, handleMouseLeave: function(){ /// } }; ์‚ฌ์šฉํ•œ Event - mouseenter, mouserleave, resize, contextmenu h2.addEventListener("mouseenter", superEventHandler.handleEnter); h2.addEventListener("mouseleave", superEventHandler.handleLeave); window.addEventListener("resize", superEventHandler.handleResize); window.addEventListener("contextmen..