전체 글
-
완전탐색 - 백준[2840] 행운의 바퀴자료구조와 알고리즘/문제풀기 2024. 4. 16. 13:38
import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main (String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); char[] ans = new char[N]; Arrays.fill(ans, '?'); int curIndex = 0; while (K-- > 0) { int backStep = sc.nextInt(); char backAlphabet = sc.next().charAt(0); int nextIndex = ((curIndex - backStep) % N + N) % ..
-
완전탐색 - 백준(10250) ACM 호텔자료구조와 알고리즘/문제풀기 2024. 4. 16. 13:14
- 풀이 import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Integer.parseInt(br.readLine()); while (n-- > 0){ String[] input = br.readLine().split(" "); int h = Integer.parseInt(input[0]); int w = ..
-
완전탐색 - 백준 (10448) 유레카 문제자료구조와 알고리즘/문제풀기 2024. 4. 16. 12:49
- 풀이 import java.io.*; public class Main{ static boolean[] isEurekaNumber = new boolean[1001]; public static void main(String[] args) throws IOException{ int[] triangleNumber = new int[50]; int triagleCnt = 0; for(int i =1;;i++){ int number = i*(i+1)/2; if(number > 1000) break; triangleNumber[triagleCnt++] = number; } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int ..
-
비밀입니다카테고리 없음 2024. 2. 13. 00:18
동작 흐름 - OAuth2 login //OAuth login OAuth2LoginAuthenticationFilter -> attemptAuthentication(request,response) 메서드 동작 -> AuthenticationManager에 authenticate메서드 호출 -> OAuth2LoginAuthenticationProvider의 authenticate메서드가 다시 호출됨 -> 로그인 시도를 통해 발급받은 외부인증서버에 대한 access 토큰 정보, 혹은 유저 정보를 OAuth2UserRequest에 담아서 UserService.loadUser()메서드 호출 -> 여기서 UserService는 Custom으로 만든 UserService를 의미함! -> 원래 기능은 외부에서 주어진..
-
Docker (6) - 도커 볼륨Infra/Docker 2024. 1. 25. 17:02
1. 볼륨의 기초 개념 - 컨테이너는 기본적으로 stateless (상태없음)이다. 컨테이너가 실행 된 후 발생하는 모든 변경 사항은 컨테이너 레이어에 만 있다 -> 컨테이너가 종료되면 변경 사항이 모두 사라진다. - 컨테이너는 Stateless하기 때문에 쉽게 개수를 증가시킬 수 있으며, 다른 환경에서도 빠르게 배포할 수 있습니다. - 소프트웨어의 버전 등 컨테이너의 상태 변경이 필요한 경우 새로운 버전의 이미지를 만들어서 배포합니다. - 클라우드 네이트브 환경에서는 MSA 아키텍처에 따라 서버의 개수가 매우 많아집니다. - 모던 애플리케이션의 요구사항을 충족시키기 위해 서버 관리 방법론이 변화했습니다. - 전통적인 서버 방법론은 서버 한대를 중요하게 생각하는 Pet 방식입니다. - 컨테이너를 활용한 ..
-
Docker (5) - 도커 네트워크Infra/Docker 2024. 1. 25. 15:46
1. 네트워크 기본 - 네트워크는 기계와 기계사이를 물리적 케이블로 연결 - 집과 도로의 관계 집과 집사이를 도로를 통해 연결하듯 기계들이 인터넷 선으로 연결 - 네트워크는 ip주소로 장치의 주소를 관리한다. (공인 ip와 사설 ip로 나뉜다) - 하나의 공인ip는 다시 내부의 사설 ip로 나뉜다. 이와 같이 ip주소를 나누기 위해선 네트워크 장비가 필요하다. (라우터,공유기 등) - 공유기기를 보면, WAN포트가 공인 ip가 들어오는 곳이고, 나머지 LAN은 사설 ip를 구성하는 포트이다. - 각 장비는 네트워크 인터페이스를 가지고 있다. 네트워크 인터페이스는 인터넷에 연결하기 위해 컴퓨터에 장착하는 부품 중 하나이다. (NIC,LAN카드) - 네트워크 인터페이스는 ip를 가질 수 있다. 네트워크 인터..
-
Docker (3) - 이미지 빌드Infra/Docker 2024. 1. 24. 23:14
1. 이미지와 레이어 - 도커 이미지는 저장소 공간을 효율적으로 사용하기 위해 레이어드 파일 시스템을 채택 - 레이어드 구조가 재사용에 유리하다. 저장 및 전송에서 스토리지와 네트워크 사용량을 절약할 수 있다. - 또한 변경사항에 있어서 재활용이 유리하다. 동일한 부분은 하나로 공유하고 다른 부분만 가지고 있으면 된다. - 두개의 이미지이지만, html파일을 수정한 것 외에는 모두 동일하다면, 나머지 설정은 공유되고, 변경사항만 기록한다. - 이미지에 한번 저장된 레이어는 변경 불가하다 -> 변경시 새로운 레이어가 생긴다. 2. 이미지 레이어와 컨테이너 레이어 - 컨테이너 실행 중 발생하는 모든 변경 사항은 컨테이너 레이어에 생긴다. - 컨테이너 레이어는 이미지 레이어에 영향을 주지 않는다. 컨테이너별로..
-
Docker(4) - 레지스트리Infra/Docker 2024. 1. 24. 21:26
1. 레지스트리 - 레지스트리는 이미지를 저장하는 공간이다. 프라이빗 레지스트리와 퍼블릭 레지스트리로 나뉜다. - 이미지를 가동시킬 때 로컬에 해당 이미지가 없다면, 레지스트리에서 이미지를 찾아본다. (코드를 저장하는 깃허브를 생각해보자) 2. 이미지 이름 규칙 - 레지스트리주소/프로젝트명/이미지명:이미지태그 - 위와같이 이루어진다. 레지스트리 주소 값은 비어있으면 기본값 (docker.io)가 사용된다. - 프로젝트명은 이미지 관리 폴더명 정도이다. 생략시 가입자명이다. - 태그는 보통 버전정보가 담긴다. jawon.com/project/myImage:2.1.0-alpine docker.io/jangwon/myImage:2.1.0-alpine - 도커에서 지정한 offical 이미지는 위와같은 태그들 ..