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

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ

(81)
[Algoritm] ํ–‰๋ ฌ ํšŒ์ „ (Python ๊ตฌํ˜„) ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์—์„œ ์ œ๊ณตํ•˜๋Š” ์นด์นด์˜ค 2020๋…„ ์‹ ์ž… ๊ฐœ๋ฐœ์ž ๋ธ”๋ผ์ธ๋“œ ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ 1์ฐจ ๋ฌธ์ œ 3๋ฒˆ์„ ํ’€์–ด ๋ณด์•˜๋‹ค. https://programmers.co.kr/learn/courses/30/lessons/60059 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ์ž๋ฌผ์‡ ์™€ ์—ด์‡  [[0, 0, 0], [1, 0, 0], [0, 1, 1]] [[1, 1, 1], [1, 1, 0], [1, 0, 1]] true programmers.co.kr ํ•ด๋‹น ๋ฌธ์ œ๋Š” ์–ด๋–ค ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•  ๊ฒƒ์ธ๊ฐ€๋ฅผ ์•Œ์•„๋‚ด๋Š” ๊ฒƒ๋ณด๋‹ค ๊ตฌํ˜„๋ ฅ์ด ํ•„์š”ํ•œ ๋ฌธ์ œ์˜€๋‹ค๊ณ  ์ƒ๊ฐํ•œ๋‹ค. ํ•ด๋‹น ๋ฌธ์ œ์˜ ๊ฒฝ์šฐ ์ œํ•œ ์‚ฌํ•ญ์˜ ํฌ๊ธฐ๊ฐ€ ์ž‘๊ธฐ ๋•Œ๋ฌธ์— ๋ชจ๋“  ๊ฒฝ์šฐ๋ฅผ ํ™•์ธํ•˜๋Š” ์™„์ „ ํƒ์ƒ‰์œผ๋กœ ํ’€์ด๊ฐ€ ๊ฐ€๋Šฅํ•œ๋ฐ, ํ–‰๋ ฌ์˜ ํšŒ์ „๊ณผ ๋ฒ”์œ„๋ฅผ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ–ˆ๋‹ค. ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” 2์ฐจ์› ํ–‰๋ ฌ์˜ ํšŒ์ „์„ ๊ตฌํ˜„ํ•ด์•ผ ..
[Algorithm] ์ตœ๋Œ€ ๊ณต์•ฝ์ˆ˜, ์ตœ์†Œ ๊ณต๋ฐฐ์ˆ˜ ๊ตฌํ•˜๊ธฐ GCD(Greatest Common Divisor) ์ตœ๋Œ€ ๊ณต์•ฝ์ˆ˜ ๊ตฌํ•˜๊ธฐ ์œ ํด๋ฆฌ๋“œ ํ˜ธ์ œ๋ฒ• ์‚ฌ์šฉ def gcd(a, b): while b: a, b = b, a % b return a a = b x q + r ์ด๋ผ๊ณ  ํ–ˆ์„ ๋•Œ, GCD(a, b) = GCD(b, r)๋ฅผ ๋งŒ์กฑํ•œ๋‹ค. ๊ฐ„๋‹จ ์ฆ๋ช…: ์ˆ˜ํ•™์ ์œผ๋กœ ์ฆ๋ช…ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์ง€๋งŒ ์ดํ•ด๋ฅผ ์œ„ํ•ด์„œ ๊ฐ„๋‹จํžˆ ์„ค๋ช…ํ•˜์ž๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. b = r x m + n์œผ๋กœ ํ‘œํ˜„ํ•  ๋•Œ, n์ด 0์ด๋ผ๋ฉด b = rm์œผ๋กœ ํ‘œํ˜„๋œ๋‹ค. ์ฆ‰, b์™€ r์˜ ์ตœ๋Œ€ ๊ณต์•ฝ์ˆ˜ GCD(b, r) = m์ด ๋œ๋‹ค. a = bq + r = rmq + r = r(mq + 1) ์ด๋ฏ€๋กœ GCD(a, b) = r ์ด๋‹ค. => GCD(a, b) = GCD(b, r) = GCD(r, 0) = r LCM(Lo..
[Java] ์ž๋ฐ”์—์„œ ์ธ์ž์˜ ์‹ค์ œ ๊ฐ’์ด ๋ณ€๊ฒฝ๋˜๋Š” ์ด์œ  Java๋Š” ์ธ์ž๋กœ ๋„˜๊ฒจ์ค€ ๊ฐ์ฒด์˜ ๊ฐ’์„ ๋ณ€๊ฒฝํ•˜๋ฉด ํ•ด๋‹น ๊ฐ์ฒด์˜ ์‹ค์ œ ๊ฐ’์ด ๋ณ€๊ฒฝ๋œ๋‹ค. add ํ•จ์ˆ˜๋Š” ์ธ์ž๋กœ ๋ฐ›๋Š” model ๊ฐ์ฒด ์•ˆ์˜ number ํ•„๋“œ์˜ ๊ฐ’์„ 1 ๋”ํ•˜๋Š” ํ•จ์ˆ˜์ด๋‹ค. ์ฒ˜์Œ์— ์žˆ๋Š” model ๊ฐ์ฒด๋ฅผ add ํ•จ์ˆ˜์˜ ์ธ์ž๋กœ ๋„˜๊ฒจ์„œ ์‹คํ–‰ํ•˜๋ฉด ์ฒ˜์Œ model์˜ ํ•„๋“œ ๊ฐ’์ด ๋ณ€๊ฒฝ๋œ๋‹ค. C์–ธ์–ด๋‚˜ python์—์„œ ํ•จ์ˆ˜์— ์ธ์ž๋ฅผ ๋„˜๊ธฐ๋ฉด ์‹ค์ œ ๊ฐ’(ํ˜น์€ ๊ฐ์ฒด์˜ ์ฃผ์†Œ ๊ฐ’)์ด ์•„๋‹Œ ์ธ์ž์˜ ๊ฐ’์„ ๋ณต์‚ฌ ๊ฐ’์ด ๋„˜์–ด๊ฐ„๋‹ค. ์ด๋ ‡๊ฒŒ ์›๋ณธ์˜ ๋ณต์‚ฌ ๊ฐ’์„ ์ธ์ž์— ๋„˜๊ฒจ์ฃผ๋Š” ๋ฐฉ๋ฒ•์„ "Call By Value"๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค. ์‹ค์ œ๋กœ ์›๋ณธ A๋ฅผ ๋ณ€๊ฒฝํ•˜๊ธฐ ์œ„ํ•ด์„œ addํ•จ์ˆ˜์˜ return ๊ฐ’์ธ B ๋‹ค์‹œ ๋Œ€์ž…ํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค. Model model = new Model() model = add(model)// add ํ•จ์ˆ˜์˜ return์€ Model cl..
[42 Seoul] Norminette ์„ค์น˜ํ•˜๊ธฐ(ft. Homebrew) Norminette๋Š” 42 ์•„์นด๋ฐ๋ฏธ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ฌธ๋ฒ• ๊ทœ์น™ ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค. ์ด ๊ธ€์€ ๊ฐœ์ธ ๋กœ์ปฌ ํ™˜๊ฒฝ์— norminette๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค. mac os์ „์šฉ ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์ž์ธ homebrew๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ window ์‚ฌ์šฉ์ž๋Š” ์•„๋ž˜ ๊ณต์‹ ๊นƒํ—™์„ ํ™•์ธํ•˜์—ฌ ์„ค์น˜ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. โฌ‡๏ธ 42 ๊ณต์‹ norminette github https://github.com/42School/norminette GitHub - 42School/norminette Contribute to 42School/norminette development by creating an account on GitHub. github.com โฏ Norminette ์„ค์น˜ํ•˜๊ธฐ 1. homebrew ์„ค์น˜ ํ™ˆ๋ธŒ๋ฃจ๊ฐ€ ์„ค์น˜ ๋˜์–ด์žˆ์ง€ ์•Š๋‹ค๋ฉด, ..
postgresql Homebrew๋กœ ์„ค์น˜๋ถ€ํ„ฐ DBeaver ์—ฐ๊ฒฐ๊นŒ์ง€ ํŒจํ‚ค์ง€ ์„ค์น˜ ๋„๊ตฌ์ธ homebrew๋ฅผ ์ด์šฉํ•ด์„œ postgresql์„ ์„ค์น˜ํ•˜๊ณ  DBMS ๋„๊ตฌ์ธ DBeaver์— ์—ฐ๊ฒฐํ•˜๋Š” ๊ฒƒ๊นŒ์ง€ ์ •๋ฆฌํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Homebrew๋‚˜ DBeaver๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ถ€๋ถ„์€ ์ƒ๋žตํ•ฉ๋‹ˆ๋‹ค. โ˜๏ธhomebrew๋กœ postgresql ์„ค์น˜ํ•˜๊ธฐ 1. ํ„ฐ๋ฏธ๋„์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค. 2. ๋ฒ„์ „ ํ™•์ธํ•˜๊ธฐ brew search postgresql ์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด homebrew์—์„œ ์„ค์น˜ ๊ฐ€๋Šฅํ•œ postgresql์˜ ๋ฒ„์ ผ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. @ ๋’ค์— ์žˆ๋Š” ์ˆซ์ž๊ฐ€ ๋ฒ„์ „์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. 3. ์„ค์น˜ํ•˜๊ธฐ brew install postgresql ์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์ตœ์‹  ๋ฒ„์ „์˜ posrgresql์„ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ, ํŠน์ • ๋ฒ„์ „์„ ์„ค์น˜ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, @๊นŒ์ง€ ํฌํ•จํ•œ ์ „์ฒด ์ด๋ฆ„์„ ์ ์–ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ex)..
๊นƒํ—™ ํŠน์ • ๋ธŒ๋žœ์น˜ ํด๋ก  ํ•˜๊ธฐ / github branch clone ํŒ€์œผ๋กœ ์ง„ํ–‰๋˜์—ˆ๋˜ ํ”„๋กœ์ ํŠธ์—์„œ ์ž์‹ ์˜ ๋ธŒ๋žœ์น˜ ๊ฐ€์ ธ์˜ฌ ๋•Œ, ์‚ฌ์šฉํ•˜๊ธฐ ์ข‹์Šต๋‹ˆ๋‹ค. ๐Ÿ“ ํŠน์ • branch cloneํ•˜๊ธฐ git clone -b [๋ธŒ๋žœ์น˜ ์ด๋ฆ„] --single-branch [๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ] ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ๋Š” HTTPS, SSH ์ฃผ์†Œ ๋ชจ๋‘ ๊ฐ€๋Šฅ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ์‹œ git clone -b space_jin --single-branch https://github.com/space-team/toy-proj space-team ๊นƒํ—™์˜ toy-proj ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ space_jin ๋ธŒ๋žœ์น˜๋งŒ ํด๋ก  ํ•ฉ๋‹ˆ๋‹ค.
M1 CocoaPods install ์˜ค๋ฅ˜ ํ•ด๊ฒฐ(ft. lottie-ios) You may have encountered a bug in the Ruby interpreter or extension libraries. ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• IOS๋ฅผ ๊ณต๋ถ€ํ•˜๋ฉด์„œ CocoaPods๋ฅผ ์ด์šฉํ•ด lottie-ios๋ฅผ ์„ค์น˜ํ•˜๋ ค๋Š”๋ฐ ๋ฐ”๋กœ ์œ„ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์™”๋‹ค. ์—ญ์‹œ ์˜ค๋ฅ˜ ๋„˜์–ด ์˜ค๋ฅ˜... ๋‹คํ–‰์ด ๊ธˆ๋ฐฉ ํ•ด๊ฒฐ ํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๐Ÿฅธ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• sudo arch -x86_64 gem install ffi arch -x86_64 pod install ํ„ฐ๋ฏธ๋„๋กœ Podfile์ด ์žˆ๋Š” ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•˜์‹  ํ›„ ์œ„ ๋ช…๋ น์–ด๋ฅผ ์ฐจ๋ก€๋กœ ์ž…๋ ฅํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. M1 ํ™˜๊ฒฝ๊ณผ ๊ธฐ์กด์˜ ๋ฃจ๋น„๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ๋˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ํ˜ธํ™˜์„ฑ ๋ฌธ์ œ์˜€๊ธฐ์— ์•„ํ‚คํ…์ณ๋ฅผ ์ง€์ •ํ•ด์„œ ์„ค์น˜ํ•ด์ฃผ๋ฉด์„œ ํ•ด๊ฒฐํ•œ ๊ฒƒ ๊ฐ™๋‹ค. ๊ฐ„๋‹จ๋ช…๋ฃŒํ•˜๊ฒŒ ํ•ด๊ฒฐ๋ฒ•์„ ์ฐพ์•„ ๊ธ€์„ ์ž‘์„ฑํ•ด์ฃผ์‹  doka..
42 ์„œ์šธ(42 Seoul) 6๊ธฐ ์ง€์›๋ถ€ํ„ฐ ์ตœ์ข…ํ•ฉ๊ฒฉ๊นŒ์ง€ 42 ์„œ์šธ์— ๋Œ€ํ•œ ๊ธ€์„ ์“ธ์ง€ ๋ง์ง€ ๊ณ ๋ฏผํ•˜๋‹ค๊ฐ€ ๋‚˜์ค‘์— ์ข‹์€ ์ถ”์–ต์„ ์ƒ๊ธฐ์‹œํ‚ฌ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์„œ ๋‚จ๊ฒจ๋ด…๋‹ˆ๋‹ค... ์ˆœ์„œ ์ง€์› ๋ฐฐ๊ฒฝ ์ง€์› ๊ณผ์ • + ์†Œ์†Œํ•œ ํŒ ๋ผํ”ผ์‹  42 ์„œ์šธ ์ตœ์ข… ํ•ฉ๊ฒฉ ๐Ÿค” ์ง€์› ๋ฐฐ๊ฒฝ ๋น„์ „๊ณต์ž์ธ ๋‚˜๋Š” ์ปดํ“จํ„ฐ์™€ ๊ด€๋ จ๋œ ๋Œ€ํ•™๊ต ๊ฐ™์€ ๊ฒฝํ—˜์„ ์Œ“๊ณ  ์‹ถ์—ˆ๋‹ค. ๊ฐœ๋ฐœ์„ ์ข‹์•„ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค๊ณผ ๊ฐ™์ด ์นœ๋ถ„์„ ์Œ“๊ณ  ๊ฐ™์€ ๋ชฉํ‘œ๋ฅผ ์žก๊ณ  ๊ณต๋ถ€ํ•˜๋Š” ์†Œ์†๊ฐ์„ ๋Š๋ผ๊ณ  ์‹ถ์—ˆ๋‹ค. ํ˜„์žฌ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ๋“ค ์ค‘ ๊ฐ€์žฅ ์ข‹์€ ์„ ํƒ์€ ๋ถ€ํŠธ์บ ํ”„๋ผ๊ณ  ์ƒ๊ฐ์ด ๋“ค์—ˆ๋‹ค. ์†Œ์œ„ ๋ถ€ํŠธ์บ ํ”„๋ผ๊ณ  ๋ถˆ๋ฆฌ๋Š” 42 ์„œ์šธ, ์‹ธํ”ผ(ssafy), ์†Œ๋งˆ(Software Academy) ๋“ฑ ๊ฒƒ๋“ค ์ค‘ ๊ฐ€์žฅ ํฌ๋งํ•˜๋˜ ๊ณณ์ด 42 ์„œ์šธ์ด์—ˆ๋‹ค. 1. ์ ‘๊ทผ์„ฑ์ด ์ข‹๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ 42 ์„œ์šธ์—๋Š” ์ง€์›์„œ, ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ ๋“ฑ์˜ ์กฐ๊ฑด์ด ์—†๋‹ค. ๋Œ€์‹  ์‚ฌ์ „์— ๊ฐ„๋‹จํ•œ ์ ์„ฑ๊ฒ€์‚ฌ์™€ ์ฒดํฌ์ธ ๋ฏธํŒ…, ๋ผํ”ผ์‹  ..

728x90