8월 달부터 취업해서 업무랑 공부랑 같이 병행 해야하는데 죄송합니다. 수강기간 연장 부탁드립니다. - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 주문 서비스에서 주문, 주문 취소 메서드 비즈니스 로직이 엔티티에 있는데 이렇게 엔티티가 비즈니스 로직을 가지는 도메인 모델 패턴과 서비스에서 비즈니스 로직을 처리하는 트랜잭션 스크립트 패턴 중에 실무에서는 보통 어떤 것을 사용하나요? 각각의 장단점이 있는지도 궁금합니다
public class Subsets { List<List<Integer>> ans = new ArrayList<>(); List<List<Integer>> solution(int[] nums, int m) { dfs(nums, m, 0, new ArrayList<>()); return ans; } void dfs(int[] nums, int m, int start, List<Integer> curr) { //base case ans.add(new ArrayList<>(curr)); // 매순간 ans에 추가 //상태 전이 for(int i=start; i< nums.length; i++) { curr.add(nums[i]); dfs(nums, m, i+1, curr); curr.remove(curr.size()-1); } } } ans를 전역변수로 설정하고 for문으로 상태 전이할때마다 ans값을 수정하는 방식으로 구현할때 addAll(dfs(nums, m, i+1, curr));으로 하니 dfs가 void로 리턴돼서 에러가 나는데 위의 코드 블럭과 같이 dfs(nums, m, i+1, curr);로 실행하고 basecase에서만 ans에 curr을 추가하는 방식으로 하면 되는걸까요? 질문 봐주셔서 감사합니다!
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 김영한님은 이렇게 푸셨는데 저는 이렇게 풀었습니다. 이게 문제가 있는 건지 알고 싶습니다. package operator.ex; public class OperationEx3 { static void main(String[] args) { int score = 88; System.out.println(80 <= score && score <= 100); } }
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] synchronized 이전 강의에서 join 을 활용하여 순서를 쓰레드의 순서를 보장하여 실행하는 방법에 대해 배웠습니다. 만약 동시에 같은 값에 대해 접근하는 것이 문제 라고 가정 할 경우 join 을 활용하여 특정 쓰레의 종료 이전 까지 다음 쓰레드 를 시작하는 것을 막는 다면 해결할수 있는 문제가 아닌가 생각합니다. 예를들어 다음과 같이 t1.join() 을 사용하면 t1 의 쓰레드가 종료 이전 까지는 t2 는 대기 상태가 될 것이고 t1 에서 최종 결과가 나오기 전까지는 t2 는 실행하지 못할 것 입니다. public class BankMain { public static void main(String[] args) throws InterruptedException { //BankAccount account = new BankAccountV1(1000); BankAccount account = new BankAccountV1(1000); Thread t1 = new Thread(new WithdrawTask(account, 800), "t1"); Thread t2 = new Thread(new WithdrawTask(account, 800), "t2"); t1.start(); t1.join(); sleep(500); log("t1 state :"+t1.getState()); log("t2 state :"+t2.getState()); t2.start(); //t2.join(); log("최종 잔액 : "+account.getBalance()); } }
47. (실습포함) EC2 사이즈 변경 과정 중 실패 하여 글 남깁니다. 아래 과정에서 실패가 발생하였습니다. t2.medium 인스턴스 중지 -> 스냅샷 -> AMI 생성 AMI -> ami 로 인스턴스 시작 -> m7g.medium 선택 후 생성(기타 인바운드, 아웃바운드는 모두 열림으로 생성) 인스턴스 -> 생성된 인스턴스(m7g.medium) 선택 -> 연결 -> 실패(아래 로그) 연결 실패로, 시스템 로그 확인(아래 4번 인스턴스 로그) 3번 실패 에러 Failed to connect to your instance Error establishing SSH connection to your instance. Try again later. 4번 인스턴스 로그 UEFI firmware (version built at 09:00:00 on Nov 1 2018) [2J[01;01H[=3h[2J[01;01H[2J[01;01H[=3h[2J[01;01H[2J[01;01H[=3h[2J[01;01H[0m[35m[40m[0m[37m[40mNo bootable device found. Dropping to the EFI Shell. Exiting the UEFI shell will restart the system.[2J[01;01H[01;01HUEFI Interactive Shell v2.2 EDK II UEFI v2.70 (EDK II, 0x00010000) [1m[33m[40mMapping table[0m[37m[40m [1m[33m[40m FS0:[0m[37m[40m [1m[37m[40mAlias(s):[0m[37m[40mHD0fd:;BLK3: PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(128,GPT,6757D47D-EB20-4D37-B258-B2BBDAC921FF,0x800,0x5000) [1m[33m[40m BLK0:[0m[37m[40m [1m[37m[40mAlias(s):[0m[37m[40m PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00) [1m[33m[40m BLK1:[0m[37m[40m [1m[37m[40mAlias(s):[0m[37m[40m PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,GPT,3DDB972E-155C-4F75-A42C-4007A119B4C1,0x6000,0xFF9FDF) [1m[33m[40m BLK2:[0m[37m[40m [1m[37m[40mAlias(s):[0m[37m[40m PciRoot(0x0)/Pci(0x4,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(127,GPT,AF191D5A-F9A1-40A8-9164-B216701312F3,0x5800,0x800) [16;01HPress [1m[37m[40mESC[0m[37m[40m in 5 seconds to skip [1m[33m[40mstartup.nsh[0m[37m[40m or any other key to continue.[16;01HPress [1m[37m[40mESC[0m[37m[40m in 4 seconds to skip [1m[33m[40mstartup.nsh[0m[37m[40m or any other key to continue.[16;01HPress [1m[37m[40mESC[0m[37m[40m in 3 seconds to skip [1m[33m[40mstartup.nsh[0m[37m[40m or any other key to continue.[16;01HPress [1m[37m[40mESC[0m[37m[40m in 2 seconds to skip [1m[33m[40mstartup.nsh[0m[37m[40m or any other key to continue.[16;01HPress [1m[37m[40mESC[0m[37m[40m in 1 seconds to skip [1m[33m[40mstartup.nsh[0m[37m[40m or any other key to continue. [17;01HThe system will reboot in 60 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 59 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 58 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 57 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 56 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 55 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 54 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 53 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 52 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 51 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 50 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 49 seconds. Press any key [2025-12-27T13:17:04.737361]to run interactive shell.[17;01HThe system will reboot in 48 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 47 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 46 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 45 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 44 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 43 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 42 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 41 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 40 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 39 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 38 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 3[2025-12-27T13:17:16.737450]7 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 36 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 35 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 34 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 33 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 32 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 31 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 30 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 29 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 28 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 27 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 26 seconds. Press any key to run interactive shell.[17;01HTh[2025-12-27T13:17:28.737525]e system will reboot in 25 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 24 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 23 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 22 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 21 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 20 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 19 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 18 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 17 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 16 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 15 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 14 seconds. Press any key to run int[2025-12-27T13:17:39.837609]eractive shell.[17;01HThe system will reboot in 13 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 12 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 11 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 10 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 9 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 8 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 7 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 6 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 5 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 4 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 3 seconds. Press any key to run interactive shell.[17;01HThe system will reboot in 2 seconds.[2025-12-27T13:17:51.837681] Press any key to run interactive shell.[17;01HThe system will reboot in 1 seconds. Press any key to run interactive shell. UEFI firmware (version built at 09:00:00 on Nov 1 2018) [2J[01;01H[=3h[2J[01;01H[2J[01;01H[=3h[2J[01;01H[2J[01;01H[=3h[2J[01;01H[0m[35m[40m[0m[37m[40mNo bootable device found. Dropping to the EFI Shell. Exiting the UEFI shell will restart the system.[2J[01;01H[01;01HUEFI Interactive Shell v2.2 EDK II
========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 메모리 가시성 문제 가 발생하는 이유는 쓰레드가 공유 된 runFlag 값에 대해 반영이 않되어서 발생하는 문제라고 설명을 해주셨습니다. 예를들어 main 쓰레드에서는 false 를 true 로 변경하였으나 work 쓰레드에서는 해당 값이 변경되었는지 모르기 때문에 계속 동작하는 상태 입니다. 여기서 이해가 않가는 부분이 모든 프로그램은 보조기억 장치에서 실행을 하고 실행에 필요한 변수가 값 들은 모두 ram 과 같은 주 기억 장치에 저장되고 사용되는 걸로 알고 있습니다. 그렇다면 이 과정에서 쓰레드는 캐시메모리가 아닌 주기억 장치에서 값을 읽어서 사용해야 합니다. 지금 과정으로 설명된 것을 이해 하면 주기억 장치 또한 단순히 값을 저장하는 것 뿐이고 실제로는 캐시 메모리에서 한번더 데이터를 저장하고 cpu 는 캐시메모리에 접근하여 데이터를 연산한다고 이해 했습니다. 맞을까요?
질문이 조금 많아서 죄송합니다. 다음 테스트 코드에서 commit()과 flush()의 위치가 이상해보였습니다. async def test_user_detail_for_real_user(client: TestClient, db_session: AsyncSession): user = User( username="test", password="test", email="test@example.com", display_name="test", is_host=True, ) db_session.add(user) await db_session.commit() await db_session.flush() commit()은 DB에 반영된 트랜잭션의 변경사항을 영속적으로 만들고 트랜잭션을 종료하는 코드로 이해하고 있고, flush()는 트랜잭션의 변경사항을 실제 DB에 SQL 구문을 통해 반영하는 것으로 알고 있습니다. 그래서 이 둘의 순서가 변경된 것이 아닌지 혹은 다른 의도가 있는 것인지 궁금합니다.
default_deps에서 기본 값으로 Depends 함수가 반환하는 객체가 할당되는 것까지는 이해했는데, 해당 동작이 왜 의도하지 않은 동작 인 건지가 이해되지 않습니다. 오히려 아래 쪽이 기본값이 적용되니 더 편리해 보이기만해서 Annotated를 권장하는 이유가 와닿지 않더라구여. 이에 대해서 조금 더 구체적으로 알고 싶습니다. DbSeDep = Annotated[AsyncSession, Depends(use_session)] async def annotated_deps(session: DbSeDep): pass annotated_deps() async def default_deps(session: AsyncSession = Depends(use_session)): pass default_deps()
현재 spring boot 버전 설치에서 JAVA 버전을 선택해야 되는데요, 현재 24, 21, 17 버전만 제공되고 있습니다. 그리고 스프링 부트드 3.4.0 버전은 없고 아래와 같은데요, 혹시 21버전이나 17버전으로 진행해도 관계없을까요? Spring boot 버전은 몇으로 하는게 좋을지 궁금합니다. 그리고 intellij 말고 VS code 로 진행해도 관계없을까요?
1. 현재 학습 진도 몇 챕터/몇 강을 수강 중이신가요? 6-4. 캐싱의 개념 3 2. 어려움을 겪는 부분 어떤 개념이 헷갈리시나요? 수업 자료를 보면 "Cache Aside는 구현이 간단하고 캐시 효율이 뛰어납니다. 하지만 데이터가 변경되었을 때 실시간으로 반영되지 않아 데이터 불일치 가능성이 있습니다."고 하는데, 왜 Cache Aside가 구현이 간단하고 캐시 효율이 뛰어난지 잘 이해가 가지 않습니다. Cache Aside에서는 애플리케이션 단에서 컨트롤을 다 해야 해서 구현이 길어지지 않나요? Cache Aside가 다른 전략과 비교했을 때 캐시 효율이 뛰어난 이유가 있을까요? 3. 시도해보신 내용 문제 해결을 위해 어떤 시도를 해보셨나요? 데이터 변경시 데이터 불일치에 대한 설명이 있는 것을 보면 혹시 해당 부분 설명은 Cache Aside보다는 Write Around Aside 에 대한 설명에 더 가깝지 않을까하는 생각도 해보았습니다.
1. 현재 학습 진도 몇 챕터/몇 강을 수강 중이신가요? 6- 12 여기까지 이해하신 내용은 무엇인가요? RedisTemplate으로 SETNX를 할 수 있고, 이 때의 리턴값은 boolean이다. 2. 어려움을 겪는 부분 어떤 개념이 헷갈리시나요? 수업 자료에는 RedisTemplate을 통해 SETNX 요청시 키 존재 유무와 상관없이 모두 True를 리턴한다고 설명 3. 시도해보신 내용 문제 해결을 위해 어떤 시도를 해보셨나요? 혹시 키가 이미 존재하면 RedisTemplate에서는 False 를 리턴하는 것이 아닐까요?
5.4.3 Alembic 설정하기 부분에서 다음 문장이 잘 이해되지 않습니다. "우리는 그동안 appserver 디렉터리 안을 시작점(root)으로 해왔습니다. 그래서 프로젝트 내 다른 패키지에 접근하는 경로도 from appserver.apps.account 나 from appserver.apps.calendar 또는 from appserver.db import DSN 처럼 접근했었죠." appserver 디렉터리 안이 시작점이 아니고 release-your-project-with-fastapi가 시작점(루트)이 되어야 하는 것 아닌가요? fastapi-dev를 실행한 것이 appserver 디렉터리가 위치한 곳이니 루트는 현재 위치한 폴더(release-your-project-with-fastapi)이지 appserver가 아니지 않나? 라는 의문이 들었습니다.