๋ถ๋ฅ ์ ์ฒด๋ณด๊ธฐ
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ์์ ์๊ณ ๋ฆฌ์ฆ
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 ์ค์น ํ๊ฒฝ ์กฐ์ฑํด๋ณด๊ธฐ](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FwqHpO%2FbtrTReLRtGI%2FVthnjyLyKHMyVGNfZjtkA0%2Fimg.png)
[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](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcqN0z4%2FbtrTRFCeAmg%2FkoXkkMjWhrlhWMvK3ePTD0%2Fimg.png)
[์คํ๋ง๋ถํธ] 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(..
[JAVA] ์๋ฐ์ Array : Compare, fill, sort
1. ํฅ์๋ loop public class App { public static void main(String[] args) throws Exception { //[1] Input : n๋ช ์ ๊ตญ์ด ์ ์ int[] scores = {100, 75, 3 ,5 ,3, 22, 34}; int sum = 0; //[2] Process for (int i = 0; i < scores.length; i++) { sum += scores[i]; } //[3] Output System.out.println(sum); int sum1 = 0; for (int x : scores) { sum1 += x; } System.out.println(sum1); } } int[] scores = {100, 75, 3 ,5 ,3, 2..
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ํฉ๊ณ ์๊ณ ๋ฆฌ์ฆ
์๋ฐ public class App { public static void main(String[] args) throws Exception { //[1] Input : n๋ช ์ ๊ตญ์ด ์ ์ int[] scores = {100, 75, 3 ,5 ,3, 22, 34}; int sum = 0; //[2] Process for (int i = 0; i < scores.length; i++) { sum += scores[i]; } //[3] Output System.out.println(sum); } } ํ์ด์ฌ my_list = [100, 75, 3,5,3,22,34] sum = 0 for x in range(len(my_list)): sum = sum + my_list[x] print(sum) ํํฐ๋ง์ ์๋์ ๊ฐ์ด..
[์๋ฐ/ํ์ด์ฌ ์๊ณ ๋ฆฌ์ฆ] ํ์ต ์์
์๋ฐ๋ ํ์ด์ฌ์ ๊ด์ฌ์ด ์๊ฒผ๋๋ฐ, ์ ์ธ์ด๋ฅผ ๊ฐ์ฅ ๋นจ๋ฆฌ ํก์ํ๋ ๋ฐฉ๋ฒ์ ๊ทธ ์ธ์ด๋ก ์๊ณ ๋ฆฌ์ฆ์ ์ง๋ ๊ฒ์ด๋ผ๋ ์๊ฐ์ ์๋ฐ/ํ์ด์ฌ์ผ๋ก ์๊ณ ๋ฆฌ์ฆ์ ๋๋๋ ค๋ณด๋ฉด์ ์ฒด๋ํ ์๊ฐ์ด๋ค. ์๋ฐ๋ฅผ ๊ธฐ์ค์ผ๋ก ์๊ณ ๋ฆฌ์ฆ์ ์ง๊ณ ํ์ด์ฌ์ผ๋ก ๋๊ฐ์ ๋ก์ง์ ๋๋ค๊ฒจ๋ณด๋ ์์ผ๋ก ์งํํ ์์ ์ด๋ค. (๋ฑ๋ฑํ ์๋ฐ๋ก ์งค ์ ์๋ ๋ก์ง์ด๋ฉด ๋น๋จ๋ฑ๊ฐ์ ํ์ด์ฌ์ ๋ฅ์ด ์งค ์ ์๋๋ฐ ์ญ์ผ๋ก๋ ์ฑ๋ฆฝํ์ง ์์ ์ ์๊ธฐ ๋๋ฌธ^_^;) ์๊ณ ๋ฆฌ์ฆ์ ๋ฌธ์ ํด๊ฒฐ๋ฅ๋ ฅ์ด๋ค. - ํฉ๊ณ ์๊ณ ๋ฆฌ์ฆ : tnduf - ๊ฐ์ ์๊ณ ๋ฆฌ์ฆ - ํ๊ท ์๊ณ ๋ฆฌ์ฆ - ์ต๋๊ฐ ์๊ณ ๋ฆฌ์ฆ : max - ์ต์๊ฐ ์๊ณ ๋ฆฌ์ฆ : min - ๊ทผ์ฟ๊ฐ ์๊ณ ๋ฆฌ์ฆ : ๊ฐ๊น์ด ๊ฐ - ์์ ์๊ณ ๋ฆฌ์ฆ : ๋ฑ์ - ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ : ์ ํ ์ ๋ ฌ, ๋ฒ๋ธ ์ํธ, ํต ์ํธ ๋ฑ - ๊ฒ์ ์๊ณ ๋ฆฌ์ฆ : ์์ฐจ๊ฒ์, ์ด์ง๊ฒ์(์ด๋ถ..
Linux - ํ์ผ, ๋๋ ํ ๋ฆฌ ์ญ์ ๋ช ๋ น์ด(rm -rf, rmdir)
https://not-to-be-reset.tistory.com/430 [Jenkins] publish over SSH๋ฅผ ์ด์ฉํ Docker ์๋น์ค ๋ฐฐํฌ(4) ์ด์ ๊ฒ์๋ฌผ์์๋ ๋จ์ํ echo hello world > helloworld.txt ์ปค๋งจ๋๋ฅผ ์ด์ฉํด ๋จ์ํ 'publish over SSH'๋ฅผ ์ด์ฉํด build ๊ณผ์ ์ด ๋์ํ๋์ง๋ง ์ฒดํฌํ๋ค. ์ด์ ์ค์ ๋ก ๊ฐ๋จํ nodejs ์๋น์ค๋ฅผ Docker ์ปจํ ์ด๋ ํ not-to-be-reset.tistory.com ๋์ปค ์๋น์ค ๋ฐฐํฌ์ ๋ํ ํฅ๋ฏธ๋ก์ด ๋ธ๋ก๊ทธ๋ฅผ ๋ฐ๊ฒฌํ์๋ค. Linux - ํ์ผ, ๋๋ ํ ๋ฆฌ ์ญ์ ๋ช ๋ น์ด(rm -rf, rmdir) ๋ฆฌ๋ ์ค(์ฐ๋ถํฌ)์ ํฐ๋ฏธ๋์์ ํ์ผ์ด๋ ๋๋ ํ ๋ฆฌ๋ฅผ ์ญ์ ํ๋ ๋ช ๋ น์ด๋ค์ ์๊ฐํฉ๋๋ค. ๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ์ ๋ฐ๋ผ์, ์ฌ์ฉํด์ผํ..
![[React] ๋ฆฌ์กํธ ๋ผ์ฐํฐ์ ๊ด๋ จ Hooks ์ ๋ฆฌ](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDJJjf%2FbtrTChtybYn%2FJyb4ubItibevyIXaYt4no0%2Fimg.png)
[React] ๋ฆฌ์กํธ ๋ผ์ฐํฐ์ ๊ด๋ จ Hooks ์ ๋ฆฌ
- ๋ผ์ฐํฐ ๊ฐ๋ ์ดํด + Link ๊ฐ๋ - restful route ๊ฐ๋ ์ดํด - react hook ์ค์์ useNavigate, useParams, useSearchParams์ดํด Route๋ ๊ฒฝ๋ก๋ ๋ป์ด๋ค. ์นํ์ด์ง๋ฅผ ์ฌ๋ฌ๊ฐ ๋ง๋ค๊ณ , ์ด ๊ฐ๊ฐ์ ์นํ์ด์ง๋ฅผ ๊ฐ๊ธฐ ์ํ ๊ฒฝ๋ก๊ฐ ํ์ํ๋ค. ์ค์น ๋ช ๋ น์ด npm install react-router-dom BrowserRouter ๋ค๋ฅธ ์ฐฝ์ URL์ ๋ํ ๋ณ๊ฒฝ ์ฌํญ์ ์ถ์ ํ๋ ๋ฐ ์ฌ์ฉํ ์๋ ์๋ค import * as React from "react"; import * as ReactDOM from "react-dom"; import { BrowserRouter } from "react-router-dom"; ReactDOM.render( , root ); R..