์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- ๋ ์
- ์๋ฐ์คํฌ๋ฆฝํธ
- ๋ฐ์ํ
- ๋ผํ๋ผ์ค์๋ง๋
- ๊นํ๋จ
- ComputerScience
- ๊ฐ๋ฐ
- Java
- ์ํ
- ๊น๋ฏธ๊ฒฝ
- ํ๋ก๊ทธ๋๋ฐ
- ๊น๋ฏธ๊ฒฝ์๋งํ์์
- Python
- ์นํผ๋ธ๋ฆฌ์ฑ
- ๋ง์ผ๋ด๊ฐ์ธ์์๋ค์์ฐ๋ค๋ฉด
- ์นํ์ด์ง๋ง๋ค๊ธฐ
- html
- ์ค๋ผํด
- database
- ํ์ด์ฌ
- K๋ฐฐํฐ๋ฆฌ
- ์ฝ๋ฉ
- ์ปดํจํฐ๊ณผํ
- ์ฅํธ์์ค
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- K๋ฐฐํฐ๋ฆฌ๋ ๋ณผ๋ฃจ์
- ์ฑ
- JavaScript
- ์๋ฐ
- css
- Today
- Total
๋ชฉ๋กQuestion (18)
JiYoung Dev ๐ฅ
REST API(Representational State Transfer API) ๊ตฌ์ฑ 1. ์์(RESOURCE) - URI 2. ํ์(Verb) - HTTP METHOD 3. ํํ(Representations) REST API ๋์์ธ ๊ฐ์ด๋ REST API ์ค๊ณ์ ๊ฐ์ฅ ์ค์ํ ํญ๋ชฉ 2๊ฐ์ง : URI, HTTP Method 1. URI๋ ์ ๋ณด์ ์์์ ํํํด์ผ ํ๋ค. - ๋ฆฌ์์ค๋ช ์ ๋์ฌ๋ณด๋ค๋ ๋ช ์ฌ๋ฅผ ์ฌ์ฉ - ์ข์ง ์์ ์ : GET /members/delete/1 --> delete์ ๊ฐ์ ํ์์ ๋ํ ํํ์ด ๋ค์ด๊ฐ์๋ ์๋จ - ์ข์ ์ : DELETE /members/1 2. ์์์ ๋ํ ํ์๋ HTTP Method(GET, POST, PUT, DELETE ๋ฑ)๋ก ํํ - GET /members/de..
@SeverEndPoint๊ฐ ์๋ ์ปจํธ๋กค๋ฌ์์ @Autowired ์ฌ์ฉ ์ ์ค๋ฅ ๋ฐ์ ์ ํด๊ฒฐ ๋ฐฉ๋ฒ @ServerEndPoint๋ก ์ด๋ ธํ ์ด์ ์ด ๋ฌ๋ฆฐ ํด๋์ค๋ WebSocket์ด ์ฐ๊ฒฐ๋ ๋๋ง๋ค ์ธ์คํด์ค๊ฐ ์์ฑ๋๊ณ JWA๊ตฌํ์ ์ํด ๊ด๋ฆฌ๊ฐ ๋์ด ๋ด๋ถ์ @Autowired๊ฐ ์ค์ ๋ ๋ฉค๋ฒ๊ฐ ์ ์์ ์ผ๋ก ์ด๊ธฐํ ๋์ง ์๋๋ค. @Autowired๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์ ServerEndpointConfig.Configurator๋ฅผ ์์๋ฐ์ ServerEndPoint์ ์ปจํ ์คํธ์ BeanFactory ๋๋ ApplicationContext๋ฅผ ์ฐ๊ฒฐํด ์ฃผ๋ ์์ ์ ํ๋ ์ค์ ์ ์ถ๊ฐํด์ผ ํ๋ค. MyServerEndPointConfig package com.sjy.chat.websocket; import org.springfram..
List.toArray() - ๊ธฐ๋ณธ ํ์ ์ ์๋ฃํ (ex. int[])๋ก๋ ๋ณํ ๋ถ๊ฐ๋ฅ Integer[] answer = arr.toArray(new Integer[arr.size()]); public Integer[] solution(int[] numbers) { ArrayList arr = new ArrayList(); int idx = 0; for(int i = 0 ; i < numbers.length ; i++){ for(int j = i + 1 ; j < numbers.length ; j++){ int sum = numbers[i] + numbers[j]; if(!arr.contains(sum)) { arr.add(sum); }; } } arr.sort(Comparator.naturalOrder..
.sort() - ์ค๋ฆ์ฐจ์ ์ ๋ ฌ : Comparator.naturalOrder() - ๋ด๋ฆผ์ฐจ์ ์ ๋ ฌ : Comparator.reverseOrder() public Integer[] solution(int[] numbers) { ArrayList arr = new ArrayList(); int idx = 0; for(int i = 0 ; i < numbers.length ; i++){ for(int j = i + 1 ; j < numbers.length ; j++){ int sum = numbers[i] + numbers[j]; if(!arr.contains(sum)) { arr.add(sum); }; } } arr.sort(Comparator.naturalOrder()); Integer[] answer ..
Spring boot - JPA ํ์ฉ ๊ฒ์ํ ์ฒจ๋ถํ์ผ ๊ธฐ๋ฅ ์ถ๊ฐํ๊ธฐ FIleStore ์ฝคํฌ๋ํธ ์ถ๊ฐ ์ฒจ๋ถํ์ผ ์ ์ฅ ๊ฒฝ๋ก ์ง์ ์ฒจ๋ถํ์ผ ์ด๋ฆ ๋ณํ (์์ฑ์๊ฐ ์ ๋ก๋ํ ํ์ผ๋ช → ์๋ฒ ๋ด๋ถ์์ ๊ด๋ฆฌํ๋ ํ์ผ๋ช ) ํ์ผ ์ ์ฅ package com.sjy.shopping.attachfile; import java.io.File; import java.io.IOException; import java.util.UUID; import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; import com.sjy.shopping.model.entity.UploadFile; @Component pu..
round() ํจ์ ์ฌ์ฉ round(number, ์๋ฆฟ์) def solution(num1, num2): answer = round(num1 / num2 * 1000, 0) return answer
String.valueOf() public String solution(String s) { String answer = ""; char[] arr = s.toCharArray(); int idx = 0; for(int i = 0 ; i < arr.length ; i++) { if(arr[i] != 32) { if(idx % 2 == 0) { answer += String.valueOf(arr[i]).toUpperCase(); } else { answer += String.valueOf(arr[i]).toLowerCase(); } idx++; }else { idx=0; answer += " "; } } return answer; }
Arrays.copyOf(๋ฐฐ์ด, ๋ณ๊ฒฝํ๊ณ ์ ํ๋ ํฌ๊ธฐ) copyOf๋ก ๋ฐฐ์ด ๋ณตํํ๊ณ ์ํ๋ ํฌ๊ธฐ๋ก ์ง์ class Solution { public int[] solution(int []arr) { int idx = 1; int[] answer = new int[arr.length]; answer[0] = arr[0]; for(int i = 1 ; i < arr.length ; i++) { if(arr[i] != arr[i-1]) { answer[idx] = arr[i]; idx++; } } int[] copy = Arrays.copyOf(answer, idx); return copy; } }
string.substring(start idx, end idx) ์์ idx๋ง ์ ๋ ฅํ๋ฉด ์๋์ผ๋ก ๋ง์ง๋ง idx๊น์ง ์๋ผ์ค class Solution { public String solution(String phone_number) { String answer = ""; int size = phone_number.length(); String str = phone_number.substring(size-4); for(int i = 0 ; i < size - 4 ; i++){ answer += "*"; } answer += str; return answer; } }
System.Threading.Timer ํ์ฉํ์ฌ Thread ๊ตฌํํ๊ธฐ System.Threading.Timer ์ง์ ๋ ๊ฐ๊ฒฉ์ผ๋ก ๋ฉ์๋๋ฅผ ์คํํ๋ ๋ฉ์ปค๋์ฆ์ ์ ๊ณต ์ฌ์ฉ๋ฒ ์ ์ธ System.Threading.Timer thread; ๊ฐ์ฒด ์์ฑ ๋ฐ ์ฐ๋ ๋ ์คํ ๊ฐ์ฒด ์์ฑ์ ๋ฐ๋ณต์ ์ผ๋ก ์คํํ๊ฒ ๋ ๋ฉ์๋๋ฅผ ์ฝ๋ฐฑ ๋ฉ์๋๋ก ๋ฑ๋กํด์ผ ํจ (ThreadRandNum) thread.Change(num1, num2)์์ num1 ์ ์์ํ๊ธฐ ์ ๋๊ธฐ(์ง์ฐ) ์๊ฐ, num2๋ ๋ฐ๋ณต ์ฃผ๊ธฐ thread = new System.Threading.Timer(ThreadRandNum); thread.Change(0, 2000); BeginInvoke ์ฌ์ฉ ์๋์ฐ ์์ฉํ๋ก๊ทธ๋จ์ UI Thread์ ์ฐ๊ด๋ ๊ฒฝ์ฐ Cross Thread..