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

์ „์ฒด ๊ธ€

(407)
[JAVA] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๊ธฐ์ดˆ๋ฌธ์ œ Day7 https://school.programmers.co.kr/learn/challenges/training?order=acceptance_desc&languages=java ์ฝ”๋”ฉ ๊ธฐ์ดˆ ํŠธ๋ ˆ์ด๋‹ | ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์Šค์ฟจ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์ฒ˜์Œ ์ ‘ํ•˜๊ฑฐ๋‚˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์— ์ต์ˆ™ํ•ด์ง€๊ณ  ์‹ถ๋‹ค๋ฉด? ์ฝ”๋”ฉ ์—ญ๋Ÿ‰์„ ํƒ„ํƒ„ํ•˜๊ฒŒ ๊ธธ๋Ÿฌ์ฃผ๋Š” ์ฝ”๋”ฉ ๊ธฐ์ดˆ ํŠธ๋ ˆ์ด๋‹์œผ๋กœ ์ฐจ๊ทผ์ฐจ๊ทผ ์ฝ”๋”ฉ์— ๋Œ€ํ•œ ๊ธฐ์ดˆ ๊ฐ๊ฐ์„ ๊ธธ๋Ÿฌ ๋ณด์„ธ์š”. school.programmers.co.kr Day 7 - ๋ฐ˜๋ณต๋ฌธ ์ˆ˜์—ด๊ณผ ๊ตฌ๊ฐ„ ์ฟผ๋ฆฌ 4 class Solution { public int[] solution(int[] arr, int[][] queries) { for(int[] q:queries){ for(int i=q[0];ii>1, i->i%2==0?i/2:i*3+1), ..
[JAVA] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๊ธฐ์ดˆ๋ฌธ์ œ Day4 ~ Day6 https://school.programmers.co.kr/learn/challenges/training?order=acceptance_desc&languages=java ์ฝ”๋”ฉ ๊ธฐ์ดˆ ํŠธ๋ ˆ์ด๋‹ | ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์Šค์ฟจ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์ฒ˜์Œ ์ ‘ํ•˜๊ฑฐ๋‚˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์— ์ต์ˆ™ํ•ด์ง€๊ณ  ์‹ถ๋‹ค๋ฉด? ์ฝ”๋”ฉ ์—ญ๋Ÿ‰์„ ํƒ„ํƒ„ํ•˜๊ฒŒ ๊ธธ๋Ÿฌ์ฃผ๋Š” ์ฝ”๋”ฉ ๊ธฐ์ดˆ ํŠธ๋ ˆ์ด๋‹์œผ๋กœ ์ฐจ๊ทผ์ฐจ๊ทผ ์ฝ”๋”ฉ์— ๋Œ€ํ•œ ๊ธฐ์ดˆ ๊ฐ๊ฐ์„ ๊ธธ๋Ÿฌ ๋ณด์„ธ์š”. school.programmers.co.kr Day 4 - ์—ฐ์‚ฐ, ์กฐ๊ฑด๋ฌธ n์˜ ๋ฐฐ์ˆ˜ class Solution { public int solution(int num, int n) { return (num % n == 0) ? 1 : 0; } } ๊ณต๋ฐฐ์ˆ˜ class Solution { public int solution(int n..
[JAVA] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๊ธฐ์ดˆ๋ฌธ์ œ Day1 ~ Day3 https://school.programmers.co.kr/learn/challenges/training?order=acceptance_desc&languages=java ์ฝ”๋”ฉ ๊ธฐ์ดˆ ํŠธ๋ ˆ์ด๋‹ | ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์Šค์ฟจ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์ฒ˜์Œ ์ ‘ํ•˜๊ฑฐ๋‚˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์— ์ต์ˆ™ํ•ด์ง€๊ณ  ์‹ถ๋‹ค๋ฉด? ์ฝ”๋”ฉ ์—ญ๋Ÿ‰์„ ํƒ„ํƒ„ํ•˜๊ฒŒ ๊ธธ๋Ÿฌ์ฃผ๋Š” ์ฝ”๋”ฉ ๊ธฐ์ดˆ ํŠธ๋ ˆ์ด๋‹์œผ๋กœ ์ฐจ๊ทผ์ฐจ๊ทผ ์ฝ”๋”ฉ์— ๋Œ€ํ•œ ๊ธฐ์ดˆ ๊ฐ๊ฐ์„ ๊ธธ๋Ÿฌ ๋ณด์„ธ์š”. school.programmers.co.kr Day 1 ๋ฌธ์ž์—ด ์ถœ๋ ฅํ•˜๊ธฐ import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.n..
HTTP header - referer http ํ—ค๋” ์ค‘ ํ•˜๋‚˜์ธ ๋ ˆํผ๋Ÿฌ๋Š” ํ˜„์žฌ ํ‘œ์‹œํ•˜๋Š” ์›น ํŽ˜์ด์ง€๊ฐ€ ์–ด๋–ค ์›น ํŽ˜์ด์ง€์—์„œ ์š”์ฒญ๋˜์—ˆ๋Š”์ง€ ์•Œ ์ˆ˜ ์žˆ๋‹ค. ๋˜ํ•œ ์„œ๋ฒ„๋Š” ํ˜„์žฌ ์›นํŽ˜์ด์ง€๊ฐ€ ์–ด๋–ค ์›นํŽ˜์ด์ง€์—์„œ ์š”์ฒญ๋˜์—ˆ๋Š”์ง€ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, ์‚ฌ์ดํŠธ 1์—์„œ ์‚ฌ์ดํŠธ 2 ๋กœ ์ด๋™ํ•˜์˜€์„ ๋•Œ referer์€ ์‚ฌ์ดํŠธ 1์ด ๋œ๋‹ค. referer ์€ ๋„คํŠธ์›Œํฌ -> ํ—ค๋”์—์„œ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ฝ”๋“œ์—์„œ referer ๋ฐ์ดํ„ฐ ์ถ”์ถœํ•˜๊ธฐ ํด๋ผ์ด์–ธํŠธ if (document.referrer) { var myReferer = document.referrer; document.write(myReferer); } node.js const { headers: { referer } } = req console.log(referer); php if (isset ($_SERVER ['H..
[MYSQL] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ์ค‘์„ฑํ™” ์—ฌ๋ถ€ ํŒŒ์•…ํ•˜๊ธฐ ๋ฌธ์ œ ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ์ค‘์„ฑํ™” ์—ฌ๋ถ€ ํŒŒ์•…ํ•˜๊ธฐ | ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์Šค์ฟจ (programmers.co.kr) ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ํ’€์ด SELECT ANIMAL_ID,NAME, CASE WHEN SEX_UPON_INTAKE LIKE 'Neutered%' or SEX_UPON_INTAKE LIKE 'Spayed%' THEN 'O' ELSE 'X' END FROM ANIMAL_INS case when ์กฐ๊ฑด์„ ์‚ฌ์šฉํ•ด์ฃผ์–ด์•ผํ•œ๋‹ค. case when์„ ์‚ฌ์šฉํ•˜๊ณ  like๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ค‘์„ฑํ™” ์—ฌ๋ถ€๋ฅผ ๋ณด์—ฌ์ค€๋‹ค. case when ์‚ฌ์šฉ๋ฒ• CASE WHEN..
[MYSQL] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๊ณ ๋“์  ํ‚คํŠธ SUM, MAX, MIN ์ตœ๋Œ“๊ฐ’ ๊ตฌํ•˜๊ธฐ select DATETIME as '์‹œ๊ฐ„' from ANIMAL_INS order by DATETIME desc limit 1 ์ตœ์†Ÿ๊ฐ’ ๊ตฌํ•˜๊ธฐ select min(DATETIME) as '์‹œ๊ฐ„' from ANIMAL_INS ๋™๋ฌผ ์ˆ˜ ๊ตฌํ•˜๊ธฐ select count(*) from ANIMAL_INS ์ค‘๋ณต ์ œ๊ฑฐํ•˜๊ธฐ select count(distinct name) from ANIMAL_INS where name is not null
[MYSQL] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๊ณ ๋“์  ํ‚คํŠธ SELECT ๋ชจ๋“  ๋ ˆ์ฝ”๋“œ ์กฐํšŒํ•˜๊ธฐ select * from ANIMAL_INS order by ANIMAL_ID; ์—ญ์ˆœ ์ •๋ ฌํ•˜๊ธฐ select NAME,DATETIME from ANIMAL_INS order by ANIMAL_ID desc; ์•„ํ”ˆ ๋™๋ฌผ ์ฐพ๊ธฐ select ANIMAL_ID,NAME from ANIMAL_INS where INTAKE_CONDITION = "Sick" order by ANIMAL_ID ; ์–ด๋ฆฐ ๋™๋ฌผ ์ฐพ๊ธฐ select ANIMAL_ID,NAME from ANIMAL_INS where INTAKE_CONDITION != "Aged" order by ANIMAL_ID; ๋™๋ฌผ์˜ ์•„์ด๋””์™€ ์ด๋ฆ„ select ANIMAL_ID,NAME from ANIMAL_INS order by ANIMAL_ID; ์—ฌ..
[JAVA] String VS StringBuilder VS StringBuffer String VS StringBuilder/StringBuffer String๊ณผ StringBuilder/StringBuffer ํด๋ž˜์Šค์˜ ๊ฐ€์žฅ ํฐ ์ฐจ์ด์ ์€ String์€ ๋ถˆ๋ณ€์˜ ์†์„ฑ์„ ๊ฐ€์ง„๋‹ค๋Š” ์ ์ด๋‹ค. String์€ .concat(๊ฐ’) or +"๊ฐ’"์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•˜์ง€๋งŒ String์€ ๋ถˆ๋ณ€ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ’์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์–ด ๊ธฐ์กด String์— ๋“ค์–ด์žˆ๋˜ ๊ฐ’์„ ๋ฒ„๋ฆฌ๊ณ  ์ƒˆ๋กœ ๊ฐ’์„ ํ• ๋‹นํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ๊ทธ๋ ‡๊ธฐ ๋•Œ๋ฌธ์— concat , +๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ์†๋„๊ฐ€ ๋Š๋ ค์ง„๋‹ค. StringBuilder, StringBuffer๋Š” String๊ณผ ๋ฌธ์ž์—ด์„ ๋”ํ•  ๋•Œ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ๊ธฐ์กด์˜ ๋ฐ์ดํ„ฐ์— ๋”ํ•˜๋Š” ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์†๋„๋„ ๋น ๋ฅด๋ฉฐ ์ƒ๋Œ€์ ์œผ๋กœ ๋ถ€ํ•˜๊ฐ€ ์ ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด StringBuilder์™€ StringBu..