๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

์ „์ฒด ๊ธ€60

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๊ณ ๋“์ Kit] ์œ„์žฅ(ํ•ด์‹œ) - Javascript ์‹ค์ œ ์กฐํ•ฉ์„ ์ผ์ผํžˆ ๊ตฌํ•ด์„œ ๊ณ„์‚ฐํ•˜๋ฉด ์•„๋งˆ ํ†ต๊ณผํ•˜์ง€ ๋ชปํ• ๊ฒƒ์ด๋‹ค. ์ฒ˜์Œ์— ์กฐํ•ฉ์œผ๋กœ ํ’€๊ณ  ์ œ์ถœํ–ˆ๋”๋‹ˆ ํ…Œ์ผ€ 1๋ฒˆ์ด ์˜ค๋‹ต์ด ๋–ด๊ณ  ์งˆ๋ฌธํ•˜๊ธฐ๋ฅผ ๊ฐ€๋ณด๋‹ˆ๊นŒ ๋‚˜๊ฐ™์€ ์‚ฌ๋žŒ๋“ค์ด ์šฐ๊ธ€๋Œ€๊ณ ์žˆ์—ˆ๋‹ค. ์ฐพ์•„๋ณด๋‹ˆ๊นŒ ํ›จ์”ฌ ๋” ๊ฐ„๋‹จํ•˜๊ฒŒ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์—ˆ๋‹ค. function solution(clothes) { var type = new Map(); var arr = []; var i=0; clothes.map((value, idx) => { if(type.get(value[1])===undefined){ arr[i]=2; type.set(value[1], i++) } else { arr[type.get(value[1])]+=1; } }) var answer = 1; arr.map(value => { answer*=value; }).. 2021. 9. 16.
BOJ 4179 ) ๋ถˆ! (C++) 4179๋ฒˆ: ๋ถˆ! ์ž…๋ ฅ์˜ ์ฒซ์งธ ์ค„์—๋Š” ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„๋œ ๋‘ ์ •์ˆ˜ R๊ณผ C๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๋‹จ, 1 ≤ R, C ≤ 1000 ์ด๋‹ค. R์€ ๋ฏธ๋กœ ํ–‰์˜ ๊ฐœ์ˆ˜, C๋Š” ์—ด์˜ ๊ฐœ์ˆ˜์ด๋‹ค. ๋‹ค์Œ ์ž…๋ ฅ์œผ๋กœ R์ค„๋™์•ˆ ๊ฐ๊ฐ์˜ ๋ฏธ๋กœ ํ–‰์ด ์ฃผ์–ด์ง„๋‹ค. ๊ฐ๊ฐ์˜ ๋ฌธ www.acmicpc.net BFS๋กœ ํ’€๋ฆฌ๋Š” ๋ฌธ์  ๋ฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ํ•˜๋Š” ๋ถ€๋ถ„์—์„œ ๋ฏธ์ฒ˜ ๊ณ ๋ คํ•˜์ง€ ๋ชปํ•œ ๋ถ€๋ถ„์ด ์žˆ์–ด ์ข€ ํ—ค๋งธ๋‹ค. 1. ๋ถˆ์˜ ์ด๋™๊ฒฝ๋กœ์— ๋Œ€ํ•œ ํ์™€ ์ง€ํ›ˆ์ด์˜ ์ด๋™ ๊ฒฝ๋กœ์— ๋Œ€ํ•œ ํ๋ฅผ ๊ฐ๊ฐ ๋งŒ๋“ค์–ด์ฃผ๊ณ  ์ž…๋ ฅ์„ ๋ฐ›์œผ๋ฉด์„œ ์‹œ์ž‘์ ๋“ค์„ ๊ฐ ํ์— ์ž…๋ ฅํ•ด์ค€๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ง€ํ›ˆ์ด์˜ ์ด๋™ ์‹œ๊ฐ„์„ ์ฒดํฌํ•  ๋ฐฐ์—ด(dist)๊ณผ ๋ถˆ์˜ ์ด๋™ ์‹œ๊ฐ„์„ ์ฒดํฌํ•  ๋ฐฐ์—ด(burn)์— ์ด๋™ ๊ฐ€๋Šฅํ•œ ์ขŒํ‘œ๋ฅผ -1๋กœ ์ฒดํฌํ•ด์ค€๋‹ค. (๋”ฐ๋กœ ์ฒดํฌํ•˜์ง€ ์•Š์€ ์ขŒํ‘œ๋Š” 0์œผ๋กœ ์ดˆ๊ธฐํ™” ๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ ์ถ”ํ›„ ๋ฐฉ๋ฌธ์—ฌ๋ถ€ ์ฒดํฌ ์‹œ ํ•ด๋‹น ์ขŒํ‘œ๊ฐ€ .. 2021. 7. 28.
[Node.js]Reverse Geocoding with Naver Map API Naver Map API๋ฅผ ์ด์šฉํ•˜์—ฌ GPS ์ขŒํ‘œ๋ฅผ ์ฃผ์†Œ๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ๋‹ค. NAVER CLOUD PLATFORM cloud computing services for corporations, IaaS, PaaS, SaaS, with Global region and Security Technology Certification www.ncloud.com ์œ„์˜ ๋งํฌ์—์„œ ์‹ ์ฒญ ๋ฐ ์ด์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. ์ผ๋ถ€ ์„œ๋น„์Šค๋Š” ์ด์šฉ ์š”๊ธˆ์ด ๋ถ€๊ณผ๋˜์ง€๋งŒ ์ง€๊ธˆ ์•Œ์•„๋ณผ Reverse Geocoding์˜ ๊ฒฝ์šฐ ๋ฌด๋ฃŒ๋กœ ์ด์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค. (๋‹ค๋งŒ ์›”๊ฐ„ ์„œ๋น„์Šค ์ด์šฉ ํ•œ๋„๊ฐ€ ์ •ํ•ด์ ธ ์žˆ๋‹ค.) Reverse Geocoding ๊ฐœ์š” - Reverse Geocoding api.ncloud-docs.com //longitude, latitude ์ขŒํ‘œ let.. 2021. 7. 27.
React) ๋ถˆํ•„์š”ํ•œ ๋ Œ๋”๋ง์„ ์—†์• ๋ณด์ž! ๋ฆฌ์•กํŠธ์—์„œ setState๊ฐ€ ํ˜ธ์ถœ๋  ๋•Œ ๋งˆ๋‹ค ๋ Œ๋”๋ง์ด ์ผ์–ด๋‚œ๋‹ค. ๊ณผ๋„ํ•œ ๋ Œ๋”๋ง์€ ํŽ˜์ด์ง€ ์„ฑ๋Šฅ ์ €ํ•˜๋ฅผ ์•ผ๊ธฐํ•  ์ˆ˜ ์žˆ๋‹ค. ๋”ฐ๋ผ์„œ๋ถˆํ•„์š”ํ•œ ๋ Œ๋”๋ง์„ ์ตœ์†Œํ™” ํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค. Class๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ 1. shouldComponentUpdate() shouldComponentUpdate(nextProps, nextState, nextContext){ if(this.state.counter !== nextState.counter){ return true; } return false; } shouldComponentUpdate()๋ฅผ ์ด์šฉํ•ด ๋ Œ๋”๋ง์ด ๋ฐœ์ƒํ•˜๋Š” ์กฐ๊ฑด์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ์œ„์˜ ์ฝ”๋“œ์—์„œ๋Š” state์˜ counter ๋ณ€์ˆ˜์˜ ๊ฐ’์ด ๋ณ€๊ฒฝ๋œ ๊ฒฝ์šฐ์—๋งŒ ๋ Œ๋”๋ง์ด ์ผ์–ด๋‚˜๋„๋ก ํ•˜๊ณ  ์žˆ๋‹ค. 2. PureComponent .. 2021. 6. 28.
VSCode ์ฝ”๋“œ ์ž๋™์™„์„ฑ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•(Snippet) ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ณต๋ถ€๋ฅผ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜๋ฉด์„œ ์—ฌ๋Ÿฌ ๋ฌธ์ œ๋ฅผ ํ’€๋‹ค๋ณด๋‹ˆ ์ƒˆ ๋ฌธ์ œ๋ฅผ ํ’€๋•Œ๋งˆ๋‹ค ๊ฐ™์€ ๋‚ด์šฉ์„ ํƒ€์ดํ•‘ ํ•ด์ฃผ๋Š”๊ฒŒ ๊ท€์ฐฎ๊ฒŒ ๋Š๊ปด์กŒ๋‹ค. ์Šค๋‹ˆํŽซ์„ ์ด์šฉํ•ด์„œ ๊ท€์ฐฎ์Œ์„ ๋œ์–ด๋ณด์ž. C++ #include using namespace std; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); return 0; } 1. VSCode์—์„œ Ctrl + Shift + P 2. Configure User Snippets ๊ฒ€์ƒ‰ 3. cpp.json ๊ฒ€์ƒ‰ 4. cpp.json ํŒŒ์ผ์˜ ๋‚ด์šฉ ์ˆ˜์ • { "cppps": { "prefix": "cppps",// trigger word "body": [ "#include ", "using namespace std;", "", "int main.. 2021. 6. 18.
ํด๋ผ์ด์–ธํŠธ์—์„œ ์„œ๋ฒ„๋กœ ์š”์ฒญ ๋ณด๋‚ด๊ธฐ (+ CORS) ํด๋ผ์ด์–ธํŠธ๋Š” 3000๋ฒˆ ํฌํŠธ, ์„œ๋ฒ„๋Š” 8002๋ฒˆ ํฌํŠธ์—์„œ ์‹คํ–‰์ค‘์ด๋‹ค. ๋”ฐ๋ผ์„œ ํด๋ผ์ด์–ธํŠธ์—์„œ ์„œ๋ฒ„๋กœ ๋ฐ”๋กœ ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์—†๊ณ  ํ”„๋ก์‹œ๋ฅผ ํ†ตํ•ด ์š”์ฒญ์„ ๋ณด๋‚ด์•ผ ํ•œ๋‹ค. 'http-proxy-middleware'๋ฅผ ์ด์šฉํ•œ๋‹ค. ํด๋ผ์ด์–ธํŠธ์— setupProxy.js ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด ์ฃผ๊ณ  ์•„๋ž˜์™€ ๊ฐ™์ด ์ž‘์„ฑํ–ˆ๋‹ค. (http://localhost:3000/api/auth/login ์œผ๋กœ ์š”์ฒญ์„ ๋ณด๋‚ด๋ฉด http://localhost:8002/api/auth/login ์š”์ฒญ์ด ์„œ๋ฒ„๋กœ ์ „๋‹ฌ๋œ๋‹ค.) const proxy = require('http-proxy-middleware'); module.exports = function(app) { app.use( '/api', proxy({ target:'http://localhost:.. 2021. 6. 17.
๋ฐ˜์‘ํ˜•