전체 글 (30) 썸네일형 리스트형 String은 참조형 변수인가? 아래의 결과를 예측할 수 있는가? public class Main { public static void main(String[] args) { String a1 = new String(); String a2 = a1; a1 = "hello"; a2 = "hi"; System.out.println(a1); System.out.println(a2); } }정답 : hello hi어 ? String은 참조타입이라고 들었는데 왜 Hello가 두번 안나오지? 기본형 타입과 참조 타입의 차이를 알고 있는가? 아래의 선언중 2개는 문제가 있다. //1번 int s1 = 5; int s2 = 10; int ss1 = new int(5); int ss2 = new int(10);//2번 Integer s1 = 5; In.. [Prim] 프림 알고리즘 탐구 최소 신장트리 알고리즘은 크루스칼, 프림 두가지가 있다. 크루스칼보다 이름이 맘에 들어서 이걸로 정함 조건 : 무향 그래프 + 모든 정점이 서로 연결되어 있어야함 음의 가중치 있어도 상관없다. Input [1,2,3] [5,3,2] ... 크게 두가지 작업으로 나눌 수 있다. 1. 그래프를 만든다(노드로 연결된) 2. 프림 알고리즘을 쓴다. import java.util.*; import java.io.*; /* 입력 5 6 1 3 3 1 4 8 4 5 9 1 2 10 2 3 13 2 5 14 답 30 */ public class Prim{ static int V,E; // 그래프 크기 , 주어진 입력 개수 static ArrayList graph; // 2차원 동적 그래프 static boolean[].. [Dijkstra] 다익스트라 알고리즘 탐구 조건 : 그래프 상에서 A 에서 B까지의 최소거리를 구하고싶을때! 단방향 으로 주어졌을때 ! 양방향은 BFS 가 더 빠를듯 start,end,value가 주어져야함 단, 음의 가중치는 사용할 수 없음 벨만포드쓰세요 Input [1,2,3] [4,2,3] ... 크게 두가지 작업으로 나눌 수 있다. 1. 그래프를 만든다(노드로 연결된) 2. Dijkstra 알고리즘을 사용한다. import java.util.*; import java.io.*; /* sample input 5 6 1 5 1 1 1 2 2 1 3 3 2 3 4 2 4 5 3 4 6 */ public class Dijkstra{ static int V, E, start; // 그래프 크기 및 입력갯수 static ArrayList graph;.. [Infra] Jenkins WITH Docker,Git (CI/CD 배포 자동화) 배포 자동화를 위해서는 4가지 환경설정이 필요하다 1. Jenkins 설치 docker run --network deploy --name blue-jenkins -e JENKINS_OPTS="--prefix=/jenkins" -v /var/run/docker.sock:/var/run/docker.sock jenkins/jenkins:lts - 블로그의 글을 읽어본 사람이라면 대부분의 옵션을 이해할 수 있다. - JENKINS_OPTS="--prefix=/jenkins" 는 proxy_pass를 사용할때 필요하다. proxy_pass를 사용하지 않는다면 뺴자. - 서버의 docker.sock와 젠킨스의 sock를 마운트 해야 동일한 Docker daemon에서 동작할 수 있다. 2. Jenkins 내의 D.. [SpringBoot3] WITH Redis on Docker 크게 진행과정을 2가지로 분류 할 수 있다. 1. Running Redis on Docker docker run --name my-redis -d -p 6379:6379 redis 2. Springboot3 connect Redis spring.datasource.url= spring.datasource.username spring.datasource.password= spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=true spring.mvc.contentnegotiation.media-types.json=applicat.. [SpringBoot3] WITH QueryDsl 1. Build.gradle에 아래와 같은 의존성 추가 // JPA 의존성 implementation 'org.springframework.boot:spring-boot-starter-data-jpa' // QueryDsl 종속성 implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta... [Infra] AWS EC2 Server에서 Http통신에서 Https (도메인) 사용하는 방법 전제조건 : EC2 서버내 Docker 설치 (https://hjustin.tistory.com/8) [Infra] EC2 서버에서 Docker 사용하기 ※ 함부로 설치하게되면 Docker 통신에서 오류가 날 수 있으니 설치는 무조건 공식 홈페이지에 나와있는대로 따라하는 것이 좋다. 1. Docker 설치 https://docs.docker.com/engine/install/ubuntu/#install-using-the-rep hjustin.tistory.com 1. Docker내 Nginx에 접속후 인증받기 # Docker에서 nginx를 가져옴 docker pull nginx # HTTP(80)로 들어오면 HTTPS(443)로 redirect sudo docker run --name nginx -d .. [Infra] EC2 서버에서 Docker 사용하기 ※ 함부로 설치하게되면 Docker 통신에서 오류가 날 수 있으니 설치는 무조건 공식 홈페이지에 나와있는대로 따라하는 것이 좋다. 1. Docker 설치 https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository Install Docker Engine on Ubuntu Jumpstart your client-side server applications with Docker Engine on Ubuntu. This guide details prerequisites and multiple methods to install Docker Engine on Ubuntu. docs.docker.com 서버에 들어가서 위의 명령을 그대로 입.. 이전 1 2 3 4 다음