Free Lines Arrow
본문 바로가기
728x90

전체 글381

[Spring] Bean Scope Web: part4 웹스코프 특징 웹 환경에서만 동작 스프링이 스코프의 종류 시점까지 관리 종료메서드 호출됨. 웹스코프종류 Request: HTTP 요청 하나가 들어오고 나갈 때 까지 유지되는 스코프 HTTP 요청마다 빈 인스턴스 생성 및 관리 된다. Session: HTTP Session과 동일한 생명주기를 가지는 스코프 Application 서블릿 컨텍스트 와 동이한 생명주기를 가지는 스코프 websocket: 웹 소켓과 동일한 생명주기를 가지는 스코프 request 당 할당 되는 request scope 그림예제 Request 스코프 예제 만들기 준비 웹 환경 추가 build.gradle 에 추가 // web 라이브러리 추가 implementation 'org.springframework.boot:spring-boot.. 2021. 6. 15.
[프로그래머스] 이진변환 반복 문제 분석 따로 크게 분석할게 없었다. 단 중요한건 제목부터 이진변환 반복이라는것. 즉 나는 2진변환로직 구현 -> 재귀로 반복 해주었다. 재귀로 계속 반복하다가 더이상 변환할게 없을때 중단 하였다. 구현 #include #include #include using namespace std; void solve(int size, int &delCnt, int &cnvCnt ); vector solution(string s) { vector answer; vector binVector; int delCnt = 0; int cnvCnt = 1; for(int i = 0 ; i < s.size(); i++){ if( s.at(i) == '0'){ delCnt++; } else { binVector.push_ba.. 2021. 6. 14.
[Spring] Bean Scope Prototype: part3 싱글톤과 프로토타입을 같이 사용했을때 문제점 해결 앞에서 싱글톤과 프로토타입을 같이 사용하면 발생되는 문제점을 봤다. https://vprog1215.tistory.com/79 [Spring] Bean Scope Prototype: part2 싱글톤과 프로토타입을 같이 사용했을때 문제점 Bean Scope Prototype: Part1 은 아래 페이지에서 확인하자. https://vprog1215.tistory.com/71 [Spring] Bean Scope Prototype: part1 Bean Scope Prototype: part.. vprog1215.tistory.com Provider 로 해결하는 방법을 알아보자 Spring 의 Provider 기능 사용. 스프링에서 제공해 주는 Provider.. 2021. 6. 14.
[C++] string contains string contains c++ 에는 아쉽게도 String 의 contains 기능이 없다. 간단하게 한줄로 구현이 가능하다. 1. cplusplus 에서 사용한 방법 std::string str ("Who Am I"); std::string str2 ("Am"); // different member versions of find in the same order as above: std::size_t found = str.find(str2); if (found!=std::string::npos) std::cout 2021. 6. 12.
728x90
반응형