728x90

๐Ÿ“š Computer Science 24

[Unity][๋””์ž์ธ ํŒจํ„ด] Observer Pattern

ํ•œ ๊ฐ์ฒด์˜ ์ƒํƒœ๊ฐ€ ๋ฐ”๋€Œ๋ฉด ๊ทธ ๊ฐ์ฒด์— ์˜์กดํ•˜๋Š” ๋‹ค๋ฅธ ๊ฐ์ฒด๋“ค์—๊ฒŒ ์—ฐ๋ฝ์ด ๊ฐ€๊ณ  ์ž๋™์œผ๋กœ ๋‚ด์šฉ์ด ๊ฐฑ์‹ ๋˜๋Š” ๋ฐฉ์‹. ์ฃผ์ œ์™€ ์˜ต์ €๋ฒ„๊ฐ€ ๋Š์Šจํ•˜๊ฒŒ ๊ฒฐํ•ฉ๋˜์–ด ์žˆ๋Š” ๊ฐ์ฒด ๋””์ž์ธ. Subject๊ฐ€ Observer์— ๋Œ€ํ•ด์„œ ์•„๋Š” ๊ฒƒ์€ Observer๊ฐ€ ํŠน์ • ์ธํ„ฐํŽ˜์ด์Šค(Observer ์ธํ„ฐํŽ˜์ด์Šค)๋ฅผ ๊ตฌํ˜„ํ•œ๋‹ค๋Š” ๊ฒƒ ๋ฟ. Observer๋Š” ์–ธ์ œ๋“ ์ง€ ์ƒˆ๋กœ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Œ. ์ƒˆ๋กœ์šด ํ˜•ํƒœ์˜ Observer๋ฅผ ์ถ”๊ฐ€ํ•˜๋ ค ํ•ด๋„ Subject๋ฅผ ์ „ํ˜€ ๋ณ€๊ฒฝํ•  ํ•„์š”๊ฐ€ ์—†์Œ. ์ƒˆ๋กœ์šด ํด๋ž˜์Šค์—์„œ Observer ์ธํ„ฐํŽ˜์ด์Šค๋งŒ ๊ตฌํ˜„ํ•ด์ฃผ๋ฉด ๋จ. Subject๋‚˜ Observer๊ฐ€ ๋ฐ”๋€Œ๋”๋ผ๋„ ์„œ๋กœ์—๊ฒŒ ์ „ํ˜€ ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š์Œ. ๊ทธ๋ž˜์„œ Subject์™€ Observer๋Š” ์„œ๋กœ ๋…๋ฆฝ์ ์œผ๋กœ ์žฌ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ. 1. ๊ธฐ๋ณธ ํ˜ธ์ถœ //์˜ต์ €๋ฒ„ ์ถ”์ƒํด๋ž˜์Šค //: ์˜ต์ €๋ฒ„๋“ค์ด ๊ตฌํ˜„..

[SQLD ์ž๊ฒฉ์ฆ] ์ž๊ฒฉ ์˜๊ตฌ๊ฐฑ์‹  ๋ฐ ๋ณด์ˆ˜๊ต์œก ์ˆ˜๋ฃŒ ๋ฐฉ๋ฒ•

SQLD ์ž๊ฒฉ์ฆ์€ 1๋…„ 6๊ฐœ์›” ์ดํ›„๋ถ€ํ„ฐ 2๋…„ ์ด๋‚ด์— ๋ณด์ˆ˜๊ต์œก์„ ์ถ”๊ฐ€๋กœ ๋ฐ›์•„์•ผ ์œ ํšจ๊ธฐ๊ฐ„ 2๋…„ -> ์˜๊ตฌ๋กœ ์ž๊ฒฉ์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ €๋„ 2๋…„์ด ๋‹ค๋˜์–ด๊ฐ€์„œ ๋ณด์ˆ˜๊ต์œก ๋ฐ›๊ณ  ์˜๊ตฌ ๊ฐฑ์‹ ํ–ˆ์–ด์š”. ์ž๊ฒฉ ์˜๊ตฌ๊ฐฑ์‹  ๋ฐ ๋ณด์ˆ˜๊ต์œก ์ˆ˜๋ฃŒ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. 1. ๋ฐ์ดํ„ฐ์ž๊ฒฉ์‹œํ—˜ ์‚ฌ์ดํŠธ ๋กœ๊ทธ์ธ https://www.dataq.or.kr/ https://www.dataq.or.kr/ www.dataq.or.kr 2. ๋งˆ์ดํŽ˜์ด์ง€ > ๋ณด์ˆ˜๊ต์œก์—์„œ ํ•ด๋‹น ์ž๊ฒฉ์ฆ ๋ณด์ˆ˜๊ต์œก ์ง„ํ–‰ 3. 4์‹œ๊ฐ„์งœ๋ฆฌ ๊ฐ•์˜ ๋“ฃ๊ธฐ ์ค‘๊ฐ„์— ๋ณด๊ณ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š”๊ฑฐ ์—†๊ณ  ๋„˜๊ธฐ๋Š”๊ฑฐ ์—†์–ด์„œ ๊ฑ ๋ผ๋””์˜ค์ฒ˜๋Ÿผ ํ‹€์–ด๋†“์œผ๋ฉด๋จ ํ—ฟ. 4. ๊ฐฑ์‹ ์™„~

[Git] Commit ํ•ฉ์น˜๊ธฐ & Commit ๋ฉ”์„ธ์ง€ ์ˆ˜์ •(rebase)

rebase๋ฅผ ์‚ฌ์šฉํ•ด์„œ 11๊ฐœ์˜ ์ปค๋ฐ‹์„ ํ•ฉ์ณ๋ด…์‹œ๋‹น. [๋กœ์ปฌ ์ €์žฅ์†Œ์— Commit ํ•œ๊ฑฐ ํ•ฉ์น˜๊ธฐ] 1. ํ„ฐ๋ฏธ๋„์„ ์—ด์–ด์„œ ์•„๋ž˜ ๊ตฌ๋ฌธ ์ž…๋ ฅ git rebase -i HEAD~3 2. ํ•ฉ์น  commit ์„ ํƒํ•ด์„œ ํ‚ค์›Œ๋“œ๋ฅผ s ๋กœ ๋ฐ”๊ฟ”์ค๋‹ˆ๋‹ค. : ๋งจ ์œ„ commit ๋ฉ”์„ธ์ง€(๋งจ ๋งˆ์ง€๋ง‰ ์ปค๋ฐ‹)๋Š” pick์œผ๋กœ ๋ƒ…๋‘๊ณ  ํ•ฉ์น  commit ๋ฉ”์„ธ์ง€๋“ค(๋‚˜๋จธ์ง€)๋Š” s๋กœ ๋ฐ”๊พผ๋‹ค. : vi ํŽธ์ง‘ํ•  ๋• esc ํ‚ค ๋ˆ„๋ฅด๊ณ  i ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋˜๊ณ , :wq ๋ฅผ ์ž…๋ ฅํ•ด์„œ ์ €์žฅํ›„ ์ข…๋ฃŒํ•ด์ค€๋‹ค. 3. ์ปค๋ฐ‹ ๋ฉ”์„ธ์ง€๋ฅผ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. : ์ปค๋ฐ‹์„ ํ•ฉ์ณค์„ ๋•Œ commit ๋ฉ”์„ธ์ง€๋ฅผ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋Œ€๋กœ ์ €์žฅ์ข…๋ฃŒํ•˜๋ฉด ๋ชจ๋“  ์ปค๋ฐ‹ ๋ฉ”์„ธ์ง€๊ฐ€ ์‹น ๋‚˜์˜จ๋‹ค. ํ•„์š”์—†๋Š” ์ปค๋ฐ‹ ๋ฉ”์„ธ์ง€๋ฅผ ์ง€์›Œ์ฃผ๊ณ  ํ•œ์ค„๋กœ ์ •๋ฆฌํ•ด์ฃผ์ž. 4. ์ €์žฅํ›„ ์™„๋ฃŒํ•ด์„œ ๊ฒฐ๊ณผ ํ™•์ธํ•˜๊ณ  push ํ•˜๊ธฐ ! : 11๊ฐœ..

[Git] git commit ๋ฉ”์„ธ์ง€ ์ˆ˜์ • ๋ฐฉ๋ฒ•

1. ๊ฐ€์žฅ ์ตœ๊ทผ์˜ commit ์ˆ˜์ • git commit --amend vi ํ„ฐ๋ฏธ๋„์—์„œ ๋ฉ”์‹œ์ง€ ์ˆ˜์ •ํ›„ :wq(์ €์žฅ ํ›„ ์ฐฝ ๋‹ซ๊ธฐ) ๋ฅผ ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. 2. ์˜ค๋ž˜๋œ commit ์ˆ˜์ • or ํ•œ ๋ฒˆ์— ์—ฌ๋Ÿฌ commit ์ˆ˜์ • ์œ„์—์„œ๋ถ€ํ„ฐ ์„ธ ๋ฒˆ์งธ ์ปค๋ฐ‹์„ ์ˆ˜์ •ํ•ด์•ผ ํ•œ๋‹ค๋ฉด git rebase -i HEAD~3 1) ์œ„ ์ปค๋งจ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ˜„์žฌ ์ž‘์—…์ค‘์ธ ๋ธŒ๋žœ์น˜์˜ ๊ฐ€์žฅ ์ตœ๊ทผ commit 3๊ฐœ๋ฅผ ๋ณด์—ฌ์ฃผ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. 2) ์ฐฝ์ด ๋œจ๋ฉด, ์ˆ˜์ •ํ•˜๊ณ  ์‹ถ์€ ์ปค๋ฐ‹ ์˜†์˜ pick ์ด๋ผ๋Š” ๋ฌธ๊ตฌ๋ฅผ reword ๋กœ ๋ฐ”๊ฟ” ์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. 3) esc -> :wq ๋ฅผ ํ†ตํ•ด ์ปค๋ฐ‹ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ €์žฅ์„ ํ•ด์ฃผ๊ณ  ๋‚˜๋ฉด, ๋‘ ๊ฐœ์˜ ์ปค๋ฐ‹์„ ๊ฐ๊ฐ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋Š” ์ฐฝ์ด ์ˆœ์„œ๋Œ€๋กœ ๋„์›Œ์ง‘๋‹ˆ๋‹ค. ์›ํ•˜๋Š”๋Œ€๋กœ ์ปค๋ฐ‹์„ ์ˆ˜์ •ํ•˜๊ณ  :wq ๋ฅผ ํ†ตํ•ด ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. 3. remote์— ์ด๋ฏธ p..

[Git Error] fatal: Cannot setup tracking information; starting point 'branch' is not a branch.

์—๋Ÿฌ: ๋กœ์ปฌ ๋ธŒ๋žœ์น˜ ์—†์ด ์›๊ฒฉ ๋ธŒ๋žœ์น˜๋ฅผ ์ถ”์ ํ•˜๋ ค๊ณ  ํ–ˆ๋‹ค๊ฐ€ ๋งŒ๋‚œ ์—๋Ÿฌ. fatal: Cannot setup tracking information; starting point 'branch' is not a branch. ์›์ธ: ๋กœ์ปฌ ๋ธŒ๋žœ์น˜๊ฐ€ ์›๊ฒฉ ๋ธŒ๋žœ์น˜๋ฅผ ์ถ”์ ํ•˜์ง€ ๋ชปํ•ด์„œ ๊ทธ๋Ÿฐ ๊ฒƒ. ์ฆ‰ ์›๊ฒฉ ๋ธŒ๋žœ์น˜๋ฅผ ์ถ”์ ํ•  ๋กœ์ปฌ ๋ธŒ๋žœ์น˜๊ฐ€ ์—†์Œ. ํ•ด๊ฒฐ์ฑ…: ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ์—ฐ๊ฒฐ์„ ๋Š์—ˆ๋‹ค๊ฐ€ ๋‹ค์‹œ ์—ฐ๊ฒฐํ•ด์ฃผ๋ฉฐ ๋œ๋‹ค. #1. ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š” ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ํ™•์ธ git remote -v #2. ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š” ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ๋Š๊ธฐ git remote remove [์›๊ฒฉ ๋ธŒ๋žœ์น˜ ์ด๋ฆ„] #3. ์ž˜ ๋Š๊ฒผ๋Š”์ง€ ํ™•์ธ git remote -v #4. ์›๊ฒฉ์ €์žฅ์†Œ ์ฃผ์†Œ๋ฅผ ์ด์šฉํ•ด ์›๊ฒฉ ๋ธŒ๋žœ์น˜ ๋‹ค์‹œ ์—ฐ๊ฒฐ. git remote add remote [์›๊ฒฉ์ €์žฅ์†Œ ์ฃผ์†Œ] ..

[Git Clone Errror & Solution] curl 18 transfer closed with outstanding read data remaining

Error: error: RPC failed; curl 18 transfer closed with outstanding read data remaining fetch-pack: unexpected disconnect while reading sideband packet fatal: protocol error: bad pack header ๊นƒ ํด๋ก  ์ค‘, ์ฝ๊ธฐ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‚จ์•„์žˆ๋‹ค๋Š” ์—๋Ÿฌ์™€ ํ•จ๊ป˜ ์ €์žฅ์†Œ ๋‚ด์šฉ์ด ๋ฐ›์•„์™€์ง€์ง€ ์•Š์•˜๋‹ค. ์—๋Ÿฌ๋กœ ๊ตฌ๊ธ€๋งํ•ด๋ณด๋‹ˆ, ํŒŒ์ผ์ด ํฌ๊ฑฐ๋‚˜ ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ์ด ๋ถˆ์•ˆ์ •ํ•ด์„œ ๊ทธ๋Ÿฐ๊ฑฐ๋ผ๊ตฌ~ ๊ทธ๋Ÿด ๋•, ์–•์€ ํด๋ก ์„ ํ•ด์„œ ๋ฐ›์•„์•ผ ํ•œ๋‹ค๊ณ  ํ–‡๋‹ค. ๊ทผ๋ฐ ๋‚ด ๊ฒฝ์šฐ์—” ๊ทธ๋ƒฅ ์–•์€ ํด๋ก ์„ ํ•˜๋ฉด ์•ˆ๋˜๊ณ  ํ•œ๋ฒˆ ์••์ถ•ํ•œ ๋‹ด์— ํด๋ก ํ–ˆ์–ด์•ผ ํ–ˆ๋‹ค. ์•„๋ž˜ ์ฝ”๋“œ & ์‚ฌ์ดํŠธ ์ฐธ๊ณ  git config --global core.comp..

[git] fork ํ•œ ์ €์žฅ์†Œ์™€ fetch upstream ์œผ๋กœ ์ตœ์‹ ํ™”ํ•ด์ฃผ๊ธฐ

Forkํ•œ ์ž์‹ ์˜ ๋กœ์ปฌ ์ €์žฅ์†Œ์— remote๋กœ ์›๋ž˜ ์ €์žฅ์†Œ๋ฅผ ๋“ฑ๋กํ•˜๊ณ  ์ตœ์‹ ํ™”ํ•ด์ฃผ๋ฉด ๋œ๋‹ค. 1) ๋“ฑ๋กํ•˜๊ธฐ ์ „์— ํ˜„์žฌ ์›๊ฒฉ ์ €์žฅ์†Œ๊ฐ€ ๋ฌด์—‡์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•ด๋ณด์ž $ git remote -v origin https://github.com/LeeYunSung/beakJoonCodePlus (fetch) origin https://github.com/LeeYunSung/beakJoonCodePlus (push) ํ˜„์žฌ๋Š” ๋‚ด ์›๊ฒฉ ์ €์žฅ์†Œ๋งŒ ๋“ฑ๋ก๋˜์–ด ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. 2) ์›๊ฒฉ ์ €์žฅ์†Œ์— “upstream”์ด๋ž€ ์ด๋ฆ„์„ ์ฃผ๊ณ  ์›๋ž˜ ์†Œ์Šค ์ €์žฅ์†Œ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค. $ git remote add upstream https://github.com/suengwone/beakJoonCodePlus.git 3) ๋‹ค์‹œ ๋“ฑ๋ก๋œ ์›๊ฒฉ ์ €..

์–ธ์–ด๋ณ„ Coding Convention

Java http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html http://www.oracle.com/technetwork/java/codeconventions-150003.pdf ๋””์ž์ธ ํŒจํ„ด https://www.tutorialspoint.com/design_pattern/ C https://users.ece.cmu.edu/~eno/coding/CCodingStandard.html C++ https://users.ece.cmu.edu/~eno/coding/CppCodingStandard.html Google C++ Style Guide Javascript https://www.w3schools.com/js/..

728x90