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

๐ŸŸข [Spring] ์Šคํ”„๋ง ํŒŒ์ผ ์—…๋กœ๋“œ

๐Ÿšฉ ์Šคํ”„๋ง์—์„œ ํŒŒ์ผ ์—…๋กœ๋“œ ๊ตฌํ˜„ ์Šคํ”„๋ง์—์„œ ํŒŒ์ผ ์—…๋กœ๋“œ๋ฅผ ๊ตฌํ˜„ํ•˜๋ ค๋ฉด ๋ช‡ ๊ฐ€์ง€ ์„ค์ •์„ ํ•ด์ค˜์•ผํ•œ๋‹ค. commons-fileupload ๋ฅผ ๋ฉ”์ด๋ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์˜์กด์„ฑ ์„ค์ •์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์›น ์ปดํฌ๋„ŒํŠธ ์„ค์ • ํŒŒ์ผ(servlet-context.xml)์— MultipartResolver ๋นˆ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด์•ผํ•œ๋‹ค. 1. ๋ฉ”์ด๋ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์˜์กด์„ฑ ์„ค์ • commons-fileupload commons-fileupload 1.4 ๋ฒ„์ „์€ ์ž์‹ ์˜ ํ”„๋กœ์ ํŠธ์— ๋งž๊ฒŒ ์„ค์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค. 2. ์›น ์ปดํฌ๋„ŒํŠธ ์„ค์ • ํŒŒ์ผ MultipartResolver ๋นˆ์„ ์ƒ์„ฑํ•ด์ฃผ๋„๋ก ํ•œ๋‹ค. ํŒŒ์ผ์˜ ํฌ๊ธฐ๋Š” ๋„ˆ๋ฌด ํฌ๋ฉด ์•ˆ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์ตœ๋Œ“๊ฐ’์„ ์ง€์ •ํ•ด์ค€๋‹ค. ๋‚˜๋Š” bean id๋ฅผ ์„ค์ •ํ•ด์ฃผ์ง€ ์•Š์•„์„œ form ์—์„œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋„˜์–ด๊ฐ€์ง€ ์•Š์•„์„œ ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ๊ฐ’์„ ๋ฐ›์ง€ ๋ชปํ•˜๋Š” ์˜ค..

๐ŸŸฉ [๋ฐฑ์ค€] [Python] [Silver1] 13335๋ฒˆ_ํŠธ๋Ÿญ

๋ฌธ์ œ https://www.acmicpc.net/problem/13335 13335๋ฒˆ: ํŠธ๋Ÿญ ์ž…๋ ฅ ๋ฐ์ดํ„ฐ๋Š” ํ‘œ์ค€์ž…๋ ฅ์„ ์‚ฌ์šฉํ•œ๋‹ค. ์ž…๋ ฅ์€ ๋‘ ์ค„๋กœ ์ด๋ฃจ์–ด์ง„๋‹ค. ์ž…๋ ฅ์˜ ์ฒซ ๋ฒˆ์งธ ์ค„์—๋Š” ์„ธ ๊ฐœ์˜ ์ •์ˆ˜ n (1 ≤ n ≤ 1,000) , w (1 ≤ w ≤ 100) and L (10 ≤ L ≤ 1,000)์ด ์ฃผ์–ด์ง€๋Š”๋ฐ, n์€ ๋‹ค๋ฆฌ๋ฅผ ๊ฑด๋„ˆ๋Š” ํŠธ www.acmicpc.net ํ’€์ด # ๋ฐฑ์ค€ 13335๋ฒˆ ๋ฌธ์ œ - ํŠธ๋Ÿญ n, w, l = map(int, input().split()) trucks = list(map(int, input().split())) bridge = [0] * w time = 0 while bridge: time += 1 bridge.pop(0) if trucks: if sum(bridge) + t..

๐ŸŸข [Spring] ์Šคํ”„๋ง ์„ค์ • ํŒŒ์ผ (XML)

๐Ÿ“Œ ์Šคํ”„๋ง ํ”„๋กœ์ ํŠธ ์„ค์ • ํŒŒ์ผ ๊ด€๋ฆฌ ์Šคํ”„๋ง ํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ ์Šคํ”„๋ง์€ ์„ค์ • ํŒŒ์ผ์„ ์„ค์ •ํ•˜๋Š” ๋ถ€๋ถ„์ด ์–ด๋ ค์šด ํŽธ์ด๋‹ค. Node.js ๋กœ๋งŒ ํ”„๋กœ์ ํŠธ๋ฅผ ํ•ด๋ดค๋˜ ๋‚˜๋กœ์จ๋Š” ๊ฝค ํž˜๋“  ์ž‘์—…๋“ค์ด์—ˆ๋‹ค. XML ํŒŒ์ผ๋“ค๋„ ์ฒ˜์Œ์ด์—ˆ๊ณ  JSP ์‚ฌ์šฉ๋„ ์ฒ˜์Œ์ด์–ด์„œ ๊ฝค๋‚˜ ๋งŽ์€ ์‹œ๊ฐ„์„ ์†Œ๋น„ํ•˜์˜€๋‹ค. ์ง€๊ธˆ๊นŒ์ง€ ๋ฐฐ์šด ์„ค์ • ํŒŒ์ผ์„ web.xml / servlet-context.xml / pom.xml / application-config.xml ํŒŒ์ผ์ด๋‹ค. ์—ฌ๊ธฐ์„œ ๋‚˜๋Š” ๋”ฐ๋กœ config ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด ๊ฒฝ๋กœ๋ฅผ ๋ณ€๊ฒฝํ•ด์ฃผ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— application-config.xml ์€ root-context.xml ๊ณผ ๊ฐ™๋‹ค๊ณ  ๋ณด๋ฉด๋œ๋‹ค. ์ด ๋‚ด์šฉ์€ ์•„๋ž˜์—์„œ ์„ค๋ช…ํ•œ๋‹ค. 1. Web.xml contextConfigLocation classpath:appl..

๐Ÿ“Š [DataBase] Oracle Rownum ์‚ฌ์šฉํ•˜๊ธฐ

๐Ÿšฉ Oracle์—์„œ Rownum ์‚ฌ์šฉํ•˜๊ธฐ Oracle์€ limit๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š”๋‹ค(11g ๊นŒ์ง€๋Š” ์ง€์›ํ•˜์ง€ ์•Š๊ณ  12๋ถ€ํ„ฐ๋Š” ์ง€์›ํ•œ๋‹ค). ๋”ฐ๋ผ์„œ limit ๋Œ€์‹  ๋‹ค๋ฅธ ๋ฐฉ์‹์œผ๋กœ ์›ํ•˜๋Š” ํ–‰์„ ๊ฐ€์ ธ์™€์•ผ ํ•˜๋Š”๋ฐ ๋ฐ”๋กœ rownum์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ์˜ˆ์‹œ๋ฅผ ๋“ค๊ธฐ ์œ„ํ•ด oracle์˜ hr ์Šคํ‚ค๋งˆ์— ์žˆ๋Š” ๊ธฐ๋ณธ ํ…Œ์ด๋ธ”์„ ๊ฐ€์ง€๊ณ  SQL์„ ์‹คํ–‰ํ•ด ๋ณผ ๊ฒƒ์ด๋‹ค. MySQL SELECT * FROM EMPLOYEES LIMIT 10; SELECT * FROM EMPLOYEES LIMIT 0, 10; SELECT * FROM EMPLOYEES LIMIT 0 OFFSET 10; MySQL์€ ๊ทธ๋ƒฅ Limit ์•ˆ์— ์›ํ•˜๋Š” ํ–‰์„ ๋„ฃ์œผ๋ฉด ๋œ๋‹ค. Oracle SELECT * FROM ( SELECT ROWNUM AS rn, employee_..

๐ŸŸฉ [๋ฐฑ์ค€] [Python] [Gold4] 15685๋ฒˆ_๋“œ๋ž˜๊ณค ์ปค๋ธŒ

๋ฌธ์ œ https://www.acmicpc.net/problem/15685 15685๋ฒˆ: ๋“œ๋ž˜๊ณค ์ปค๋ธŒ ์ฒซ์งธ ์ค„์— ๋“œ๋ž˜๊ณค ์ปค๋ธŒ์˜ ๊ฐœ์ˆ˜ N(1 ≤ N ≤ 20)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์—๋Š” ๋“œ๋ž˜๊ณค ์ปค๋ธŒ์˜ ์ •๋ณด๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๋“œ๋ž˜๊ณค ์ปค๋ธŒ์˜ ์ •๋ณด๋Š” ๋„ค ์ •์ˆ˜ x, y, d, g๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค. x์™€ y๋Š” ๋“œ๋ž˜๊ณค ์ปค www.acmicpc.net ํ’€์ด #๋ฐฑ์ค€ 15685๋ฒˆ ๋ฌธ์ œ - ๋“œ๋ž˜๊ณค ์ปค๋ธŒ import sys input = sys.stdin.readline n = int(input()) dx = [1,0,-1,0] dy = [0,-1,0,1] # ์ขŒํ‘œ๊ฐ€ ๋“œ๋ž˜๊ณค ์ปค๋ธŒ์— ํฌํ•จ์ด ๋˜๋Š”์ง€ ์ฒดํฌํ•ด์ค„ ๋ฆฌ์ŠคํŠธ check = [[0] * (101) for _ in range(101)] for _ in range(n): ..

๐ŸŸข [Spring] ์Šคํ”„๋ง ๋นˆ(Bean) ์ด๋ž€?

๐Ÿ“Œ ์Šคํ”„๋ง ๋นˆ(Bean) ์ด๋ž€? ๋นˆ(Bean)์€ ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ์— ์˜ํ•ด ๊ด€๋ฆฌ๋˜๋Š” ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์†Œํ”„ํŠธ์›จ์–ด ์ปดํฌ๋„ŒํŠธ์ด๋‹ค. ์ฆ‰, ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ๊ด€๋ฆฌํ•˜๋Š” ์ž๋ฐ” ๊ฐ์ฒด๋ฅผ ๋œปํ•˜๋ฉฐ, ํ•˜๋‚˜ ์ด์ƒ์˜ ๋นˆ(Bean)์„ ๊ด€๋ฆฌํ•œ๋‹ค. ๋นˆ์€ ์ธ์Šคํ„ด์Šคํ™”๋œ ๊ฐ์ฒด๋ฅผ ์˜๋ฏธํ•˜๋ฉฐ, ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ์— ๋“ฑ๋ก๋œ ๊ฐ์ฒด๋ฅผ ์Šคํ”„๋ง ๋นˆ์ด๋ผ๊ณ  ํ•œ๋‹ค. ์‰ฝ๊ฒŒ ์ดํ•ดํ•˜์ž๋ฉด new ํ‚ค์›Œ๋“œ ๋Œ€์‹  ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ๋ณด๋ฉด๋œ๋‹ค. IHelloService helloService = new IHelloService() IHelloService ๋ผ๋Š” ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ์กด์žฌํ•˜๊ณ  helloService ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ๋Š” new ๋ผ๋Š” ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•˜์˜€๋‹ค. ์Šคํ”„๋ง ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ๊ด€๋ฆฌํ•˜๋„๋ก ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋นˆ ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. ์ด๋ ‡๊ฒŒ xml ํŒŒ์ผ ๋นˆ ํƒœ๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด h..

๐ŸŸฉ [๋ฐฑ์ค€] [Python] [Gold5] 14719๋ฒˆ_๋น—๋ฌผ

๋ฌธ์ œ https://www.acmicpc.net/status?user_id=wnstjd9701&problem_id=14719&from_mine=1 ์ฑ„์  ํ˜„ํ™ฉ www.acmicpc.net ํ’€์ด # ๋ฐฑ์ค€ 14719๋ฒˆ ๋ฌธ์ œ - ๋น—๋ฌผ h, w = map(int, input().split()) world = list(map(int, input().split())) answer = 0 for i in range(1, w-1): left_max = max(world[:i]) right_max = max(world[i+1:]) compare = min(left_max, right_max) if world[i] < compare: answer += compare - world[i] print(answer) ๊ฐ€์žฅ ์ฒ˜์Œ๊ณผ ..

๐ŸŸจ [Java] [Project] ๊ฐ„๋‹จํ•œ ์‡ผํ•‘๋ชฐ ํ”„๋กœ์ ํŠธ ๋งŒ๋“ค๊ธฐ

๐Ÿ“Œ ์‡ผํ•‘๋ชฐ ํ”„๋กœ์ ํŠธ ์ด์ „์— ๊ธ€์„ ์“ธ ๋•Œ ์‡ผํ•‘๋ชฐ ํ”„๋กœ์ ํŠธ๋ฅผ ์ •๋ฆฌํ•˜๋ ค๊ณ  ํ–ˆ์œผ๋‚˜ ์‹œ๊ฐ„์ด ์—†์–ด์„œ ์ด์ œ์„œ์•ผ ์“ฐ๊ฒŒ ๋˜์—ˆ๋‹ค. ์ˆœ์„œ๋Š” ์•„๋ž˜์—์„œ ์„ค๋ช…ํ•˜๋„๋ก ํ•˜๊ฒ ๋‹ค. ์ž๋ฐ”๋ฅผ ์ฒ˜์Œ ์‚ฌ์šฉํ•ด์„œ ๋ถ€์กฑํ•œ ๋ถ€๋ถ„๋„ ๋งŽ์•˜๊ณ  ์‹œ๊ฐ„๋„ ๊ฝค ๊ฑธ๋ ธ๋‹ค. ๊ทผ๋ฐ ํ™•์‹คํžˆ ๊ฐ์ฒด์ง€ํ–ฅ ์–ธ์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋‹ˆ ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ์šฉ์ดํ•จ์„ ๋Š๊ผˆ๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•  ๋•Œ DTO๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ๋งค์šฐ ํŽธํ•˜๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ๋‹ค. ๐Ÿ“Œ ๋ชฉ์ฐจ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์š”๊ตฌ์‚ฌํ•ญ ์ •์˜ ๋ฐ ๋ชจ๋ธ๋ง ์š”๊ตฌ์‚ฌํ•ญ ์ •์˜์„œ ๋ฉ”๋‰ดํŠธ๋ฆฌ ERD ์„œ๋น„์Šค ํ”Œ๋กœ์šฐ ์ฐจํŠธ ์ฃผ์š” ์ฝ”๋“œ ์„ค๋ช… ๋ชฉ์ฐจ๋Š” ์ด๋ ‡๊ฒŒ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค. ์ฃผ์š” ์ฝ”๋“œ ์„ค๋ช…๋งŒ ํ• ๊นŒ ํ•˜๋‹ค๊ฐ€ ์ „์ฒด์ ์ธ ๋‚ด์šฉ์„ ๋‹ค๋ฃจ๋ฉด์„œ ๋ณต์Šตํ•˜๋ ค๊ณ  ํ•œ๋‹ค. ๐Ÿ“‘ 1 . ๊ฐœ๋ฐœ ํ™˜๊ฒฝ IDE : Eclipse Configuration : Github [ https://github.com/wnstjd9701/s..

๐ŸŸฉ [๋ฐฑ์ค€] [Python] [Gold3] 14890๋ฒˆ_๊ฒฝ์‚ฌ๋กœ

๋ฌธ์ œ https://www.acmicpc.net/problem/14890 14890๋ฒˆ: ๊ฒฝ์‚ฌ๋กœ ์ฒซ์งธ ์ค„์— N (2 ≤ N ≤ 100)๊ณผ L (1 ≤ L ≤ N)์ด ์ฃผ์–ด์ง„๋‹ค. ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์— ์ง€๋„๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๊ฐ ์นธ์˜ ๋†’์ด๋Š” 10๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ž์—ฐ์ˆ˜์ด๋‹ค. www.acmicpc.net ํ’€์ด # ๋ฐฑ์ค€ 14890๋ฒˆ ๋ฌธ์ œ - ๊ฒฝ์‚ฌ๋กœ n, l = map(int, input().split()) graph = [list(map(int, input().split())) for _ in range(n)] ans = 0 def check_line(line): for i in range(1, n): if abs(line[i] - line[i - 1]) > 1: return False if line[i] < lin..

๐ŸŸฉ [๋ฐฑ์ค€] [Python] [Silver2] 2477๋ฒˆ_์ฐธ์™ธ๋ฐญ

๋ฌธ์ œ https://www.acmicpc.net/problem/2477 2477๋ฒˆ: ์ฐธ์™ธ๋ฐญ ์ฒซ ๋ฒˆ์งธ ์ค„์— 1m2์˜ ๋„“์ด์— ์ž๋ผ๋Š” ์ฐธ์™ธ์˜ ๊ฐœ์ˆ˜๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์–‘์˜ ์ •์ˆ˜ K (1 ≤ K ≤ 20)๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ฐธ์™ธ๋ฐญ์„ ๋‚˜ํƒ€๋‚ด๋Š” ์œก๊ฐํ˜•์˜ ์ž„์˜์˜ ํ•œ ๊ผญ์ง“์ ์—์„œ ์ถœ๋ฐœํ•˜์—ฌ ๋ฐ˜์‹œ๊ณ„๋ฐฉํ–ฅ์œผ๋กœ ๋‘˜๋ ˆ๋ฅผ ๋Œ๋ฉด์„œ ์ง€ www.acmicpc.net ํ’€์ด # ๋ฐฑ์ค€ 2477๋ฒˆ ๋ฌธ์ œ - ์ฐธ์™ธ๋ฐญ melon = int(input()) # ์ฐธ์™ธ ๊ฐœ์ˆ˜ K values = [input().split() for _ in range(6)] # ๋‚˜๋จธ์ง€ 2~7 line์˜ 6 ์ค„์„ ์ž…๋ ฅ ๋ฐ›๋Š”๋‹ค. directions = [int(v[0]) for v in values] # ๋ฐฉํ–ฅ์„ ๋ฝ‘์•„๋‚ด์„œ ์ €์žฅํ•œ๋‹ค. lengths = [int(v[1]) for v in val..