์ ์ฒด ๊ธ
[JavaScript] document.getElementsByClassName() - ํน์ class๋ฅผ ๊ฐ์ง๊ณ ์๋ dom ์์๋ค์ ์ฐพ๊ธฐ/๊ฐ์ ธ์ค๊ธฐ
https://mine-it-record.tistory.com/494 [JavaScript] document.getElementsByClassName() - ํน์ class๋ฅผ ๊ฐ์ง๊ณ ์๋ dom ์์๋ค์ ์ฐพ๊ธฐ/๊ฐ์ ธ์ค๊ธฐ (ft. elem javascript๋ก dom ์์๋ฅผ ์ ์ดํ ๋ ์ฌ์ฉ๋๋ ๋ฉ์๋์ค ํ๋์ธ document.getElementByClassName()์ ๋ํด ์์๋ณด์. ๋ฉ์๋๋ช ๊ทธ ์๋ฏธ๋ฅผ ๊ทธ๋๋ก ๊ฐ์ง๊ณ ์์ด, ํน์ class๋ฅผ ๊ฐ์ง๊ณ ์๋ ๋ชจ๋ dom ์์์ ์ ๊ทผํ๊ธฐ mine-it-record.tistory.com https://developer.mozilla.org/ko/docs/Web/API/Node/insertBefore Node.insertBefore() - Web API | MDN N..
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ์ ํ ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ
์ ํ ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ์ด๋ ๋ฐ์ดํฐ ํ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ๋๋จธ์ง ๋ฐ์ดํฐ์ ๋น๊ตํ์ฌ ๊ฐ์ฅ ์๊ฑฐ๋ ํฐ ๋ฐ์ดํฐ์ ์๋ฆฌ๋ฅผ ๋ฐ๊พธ๋ ์์ผ๋ก ๋ฐ๋ณต ๋น๊ตํ๋ ์ ๋ ฌ ๋ฐฉ๋ฒ์ด๋ค. ์ ํ ์ ๋ ฌ์ ๋ฐ์ดํฐ์ ๊ฐ์๊ฐ n๊ฐ์ด๋ฉด ์ ์ฒด ํ์ ์๋ n-1ํ์ด๋ค. ์ ํ ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ์ด ์ค๋ฆ์ฐจ์์ด๋ผ๋ฉด ๋ฐฐ์ด์ ์ฒ์๋ถํฐ ๊ฐ์ฅ ์์ ๋ฐ์ดํฐ๊ฐ ์ฑ์์ง๋ค. 1ํ์ : 0๋ฒ์งธ ์ธ๋ฑ์ค๋ฅผ ๊ธฐ์ค์ผ๋ก ๋๋จธ์ง ๋ฐ์ดํฐ์ ๋น๊ตํ์ฌ ๊ฐ์ฅ ์์ ๊ฐ๊ณผ ์๋ฆฌ๋ฅผ ๋ฐ๊พธ๋ ๊ณผ์ ์ ๋ฐ๋ณตํ์ฌ 0๋ฒ์งธ ์ธ๋ฑ์ค์๋ ๊ฐ์ฅ ์์ ๊ฐ์ด ๋ค์ด๊ฐ๋ ๊ฒ์ด๋ค. 2ํ์ : 1๋ฒ์งธ ์ธ๋ฑ์ค๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ค์ ๋จ์ ๋๋จธ์ง ๋ฐ์ดํฐ์ ๋น๊ตํ์ฌ ๊ฐ์ฅ ์์ ๊ฐ๊ณผ ์๋ฆฌ๋ฅผ ๋ฐ๊พธ๋ ๊ณผ์ ์ ๋ฐ๋ณตํ์ฌ 1๋ฒ์งธ ์ธ๋ฑ์ค์๋ ๋๋ฒ์งธ๋ก ์์ ๊ฐ์ด ๋ค์ด๊ฐ๋ ๊ฒ์ด๋ค. ์๋ฐ ์ฝ๋ public class App { public static void ma..
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ์์ ์๊ณ ๋ฆฌ์ฆ
int[] scores = { 100, 33, 44, 55, 66, 77, 88 }; 100 1๋ฑ 33 7๋ฑ 44 6๋ฑ 55 5๋ฑ 66 4๋ฑ 77 3๋ฑ 88 2๋ฑ ์๋ฐ public class Hello { public static void main(String[] args) { // [1] Input : ์๋ฃ๊ตฌ์กฐ int[] scores = { 100, 33, 44, 55, 66, 77, 88 }; int[] rankings = new int[scores.length]; // [2] Process : RANK for (int i = 0; i < scores.length; i++) { rankings[i] = 1; //1๋ฑ์ผ๋ก ์ด๊ธฐํ, ์์ ๋ฐฐ์ด์ ๋งค ํ์ ๋ง๋ค 1๋ฑ์ผ๋ก ์ด๊ธฐํ for (int j = 0; j..
[node] express ์ค์น ํ๊ฒฝ ์กฐ์ฑํด๋ณด๊ธฐ
ํด๋ ๋ง๋ค๊ณ 1. npm init --yes 2. npm install express 3. package.json ์ ์๋์ ๊ฐ์ด ๋ณ๊ฒฝ { "name": "1.express-basic", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start":"nodemon app" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "express": "^4.18.2" } } 4. npm i nodemon --save-dev ํ๊ณ (๋ด ํผ์จ์ ๋ ธ๋๋ชฌ์ด ์ ์ญ์ผ๋ก ๊น๋ ค์..
[์คํ๋ง๋ถํธ] STS ์ค์น : Spring Tool Sulte 4
STS๋ ์คํ๋ง๋ถํธ ์ ์ฉ ๊ฐ๋ฐ ํด์ด๋ค. ์ฒ์ ์คํ๋ง๋ถํธ ๊ฐ๋ฐ์ ์ ํ ๋ ๋ง์ด ๊ถ์ฅ๋๋ ํด์ด๋ค. ์ค์ ๋ ๋งค์ฐ ์ฝ๊ณ ํธ๋ฆฌํ๋ค๋ ์ฅ์ ์ด ์๋ค. ํนํ ์์กด์ฑ ๊ด๋ฆฌ๊ฐ ๋งค์ฐ ํธ๋ฆฌํ๊ณ ๊ฑฐ์ ์ค์ ์ ํ๋ ๊ฒ ์์ ์ ๋~! ํฐ์บฃ๊ณผ ๊ฐ์ ์๋ฒ๋ ๋ค ๋ด์ฅ๋์ด ์์ผ๋ฏ๋ก ๋ฐ๋ก ์ค์นํ ํ์๊ฐ ์๋ค ^^ * ์ฐธ๊ณ ๋ก, ์๋ฐ๊ฐ ์ด๋ฏธ ์ค์น๋ ์ํ์ฌ์ผ ํด๋น ํฌ์คํ ์ ์ ๋ฐ๋ผํ์ค ์ ์์ต๋๋ค. * ์๋ ๋งํฌ๋ก ๋ค์ด๊ฐ์ Spring Tools 4 is the next generation of Spring tooling Largely rebuilt from scratch, Spring Tools 4 provides world-class support for developing Spring-based enterprise applications,..
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ๊ทผ์ฟ๊ฐ ์๊ณ ๋ฆฌ์ฆ
TIP ์ฐจ์ด๊ฐ์ ์ ๋๊ฐ์ ์ต์๊ฐ ์๊ณ ๋ฆฌ์ฆ์ ์ ์ฉํด์ฃผ๋ฉด ๋๋ค. ์ฐจ์ด๊ฐ์ ์ ๋๊ฐ์ ๋ด์์ค min ๋ณ์์ ๊ฒฐ๊ณผ๊ฐ ๋ด๊ธธ near ๋ณ์๊ฐ ํ์ํ๋ค๋ ๊ฒ์ด ์ค์ ํฌ์ธํธ์ธ ์๊ณ ๋ฆฌ์ฆ! ์๋ฐ import java.util.Arrays; public class App { public static void main(String[] args) throws Exception { //[1] Initialize int min = Integer.MAX_VALUE; //[2] Input int [] numbers = {23,56,65,2,2,3,3}; int target = 25; int near = 0; //[3] Process : MAX for(int x : numbers) { if(Math.abs(target - x) < min..
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ์ต๋๊ฐ ์๊ณ ๋ฆฌ์ฆ
๋ก์ง ํ๋ฆ //[1] Initialize //[2] Input //[3] Process : MAX //[4] Output ์๋ฐ public class App { public static void main(String[] args) throws Exception { //[1] Initialize int max = Integer.MIN_VALUE; //[2] Input int[] nums = {3,56,65,2,2,3,3}; //[3] Process : MAX for(int x : nums) { if(x > max){ max = x; } } //[4] Output System.out.println(max); } } ํ์ด์ฌ nums = [3,56,65,2,2,3,3] max = 0 for x in range(..