[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 스프링 빈 등록 방법 중 @Autowired를 사용해 자동으로 등록하는 방법과 자바 코드로 직접 스프링 빈을 등록하는 방법 두 가지를 모두 알아야 한다고 하셨는데, 그 이유가 무엇인가요?
안녕하세요 쿠케님! 현재 구현되어 있는 댓글 삭제 로직을 보면 1. 댓글 조회 2-1. 자식 댓글이 존재하면 deleted=true 로 변경 2-2. 자식 댓글이 존재하지 않으면 댓글을 물리 삭제하고, 부모 댓글을 재귀적으로 삭제 이렇게 구현되어 있는데요. 동시성 문제가 발생할 수 있겠다는 생각이 들었습니다! T1 삭제 트랜잭션 T2 답글 트랜잭션 ──────────────────────────────────────────── SELECT 부모 SELECT 자식 → 없음 SELECT 부모 → ACTIVE INSERT 답글 COMMIT DELETE 부모 COMMIT (제가 잘 분석한게 맞나 모르겠네요 ㅎㅎ) 물론 이렇게 꼬일 확률은 낮지만, 이런 케이스에 대해서는 select for update를 거는 것이 좋을지, 아니면 fk를 추가하여 정합성을 보장해줘야 할지, 쿠케님 의견을 묻고 싶습니다.
========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (모름) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 안녕하세요. 궁금증이 생겨서 질문을 드립니다. 현재 시점(26.8) 에서 강의를 듣고 있는데요. pdf 을 보면, 시간 지남에 따라 assertEquals() 내용이 달라 지듯이, 그 동안 강의 에서 배운 assertj 의 assertThat().isEqualTo()나, 다른 방법 들이 있어서 어떤 것을 쓰는게 맞는지 몰라서 여쭈어 봅니다. 첫 번째는 assertEquals(), assertThat()이고 두번째는 assertThrows() , assertThatThrownBy() 입니다. 영한님 이라면 어떤 것들을 쓰실지 궁금합니다. 답변 부탁 드립니다.
안녕하세요, 강사님. Shape 클래스 실습을 진행한 결과물을 공유드립니다. 실습 내용을 바탕으로 도형의 크기를 부모 클래스에서 관리하고, 각 자식 클래스에서 기본 크기를 지정할 수 있도록 생성자를 구성해 보았습니다. 시간 괜찮으실 때 구현 방향에서 어색한 부분이나 개선하면 좋을 점이 있는지 간단히 봐주시면 감사하겠습니다. 또한 이번 실습에서 추가로 생각해 보면 좋을 내용이 있다면 함께 알려주시면 감사하겠습니다. 감사합니다. package java2_30; import java.util.Scanner; /** * 화면에 출력할 수 있는 도형의 공통 부모 클래스입니다. * * 현재 실습에서는 삼각형과 정사각형만 다루므로, * 가로와 세로를 구분하지 않고 하나의 size 값으로 크기를 관리합니다. */ abstract class Shape { private final int size; protected Shape(int size) { this.size = size; } protected final int getSize() { return size; } /** * 각 도형의 모양을 콘솔에 출력합니다. */ abstract void render(); } class Rectangle extends Shape { private static final int DEFAULT_SIZE = 4; public Rectangle() { this(DEFAULT_SIZE); } public Rectangle(int size) { super(size); } @Override public void render() { for (int i = 0; i < getSize(); i++) { for (int j = 0; j < getSize(); j++) { System.out.print("*\t"); } System.out.println(); } } } class Triangle extends Shape { private static final int DEFAULT_SIZE = 5; public Triangle() { this(DEFAULT_SIZE); } public Triangle(int size) { super(size); } @Override public void render() { for (int i = 0; i < getSize(); i++) { for (int j = 0; j <= i; j++) { System.out.print("*\t"); } System.out.println(); } } } class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("사각형은 0, 삼각형은 그 외 숫자를 입력하세요: "); int input = scanner.nextInt(); Shape shape; if (input == 0) { shape = new Rectangle(); } else { shape = new Triangle(); } shape.render(); scanner.close(); } }
강사님 안녕하세요, 좋은 강의 여러번 반복해서 잘 듣고 있습니다. 재고 감소와 비교했을때 차이점이 궁금하여 문의드립니다. 안녕하세요 강사님 이전 재고 관리 강의와 차이에 대해 궁금합니다. 이전 질문을 참고하였으나 추가로 더 궁금한게 있어서 문의드립니다. 재고 감소와 쿠폰 발급의 차이점이 너무 헷갈려서 정리하고 있습니다. 두 경우 모두 한정된 수량을 여러 요청이 동시에 차지한다는 점에서는 비슷해 보입니다. 그렇다면 쿠폰도 이벤트 테이블에 잔여 수량을 100개나 300개로 설정하고, 재고처럼 수량을 차감한 뒤 사용자 쿠폰을 생성하는 방식으로 구현할 수 있지 않을까요? 강의에서는 쿠폰 발급의 정합성을 위해서 전체 로직에 락을 걸 필요가 없다고 하셨는데, 그러면 반대로 재고 감소 같은 경우도 마찬가지로 재고 감소의 정합성을 위해 전체로직에 락을 걸 필요 없이 다른 방법으로 하는게 더 나은 방법 아닌가요?? 비슷해 보이는 한정 수량 문제를 서로 다르게 푼 이유를 잘 모르겠습니다 ㅠㅠ
안녕하세요, 강의를 꾸준히 따라가면서 듣고 있는데, 공식문서가 너무 많이 바뀌어서 코드를 따라가기가 어려운 것 같아요 ㅠㅠ 혹시 강의의 내용에 따라 따라갈 수 있는 바뀐 공식문서의 링크를 좀 알 수 있을까요? https://www.langchain.com 의 Learn - [How to] - [Document]에 들어간 후, 어디서부터 따라가야 강의의 내용을 보충할 수 있을까요?
안녕하세요, 좋은 강의 감사합니다. 비전공 대학생이지만 덕택에 잘 듣고 있습니다 다름이 아니라, Google AI studio에 결제해놓은 크레딧이 있어서 openai가 아닌 gemini api 로 설정해두었는데요. 이럴 때는 시스템 모델 설정을 할 때에 어떤 수준으로 해두면 되는지 여쭙고 싶습니다. 알려주신대로 openai로 하면 좋겠지만 아직 돈이 넉넉치 않은 대학생이다 보니 gemini api로 해도 가능하다면 비용을 절감하고 싶어서요. 읽어주셔서 감사합니다. 답변 기다리겠습니다.
1. 현재 학습 진도 섹션 3 15강 수강 2. 어려움을 겪는 부분 아직 섹션3 15강밖에 수강하지 않았지만 예전에 배포했을때 설정 문제로 과금이 나간적이있어서 강의는 계속 들으면서 로컬에서 해보고 개인 프로젝트에 적용해보는것이 좋을까요? 아니면 둘 다 하는것이 좋을까요??
for 문에서 초기화 -> 조검검사->참이면 처리->증감->조건검사->조건 감사-> 아닌가요? intc=0; for(I=1; I>3; i++) { c++; } printf("c=%d",c); 정답: ? 답변이 어려운 질문 좋은 질문 예시 3강 12분 35초에서 설명하신 반복문 조건식이 이해되지 않습니다. 왜 i < 10으로 작성하나요? 5강 08분 10초에서 나온 코드 실행 결과가 제 환경에서는 다르게 나옵니다. 아래는 제가 작성한 코드입니다. 정확한 강의 위치와 질문 내용을 함께 남겨주시면 더 빠르고 정확하게 답변드릴 수 있습니다.
[질문 내용] SumTask의 run()메서드 안 for문에서 result += i;를 하지 않고 지역변수인 sum을 사용하여 마지막에 result = sum을 하신 이유가 지역변수(sum)는 스택영역, 멤버변수(result)는 힙 영역에 관리되어, 매번 메인 메모리에 있는 result의 값을 변경하는 것이 아닌 cpu 코어의 캐시 메모리를 사용하는 것이 더 빨라서일까요?
안녕하세요. 001강과 마찬가지로 002강에서도 Gradio 실행 시 에러 뜹니다.. 어떻게 해결해야할까요? ERROR: Exception in ASGI application Traceback (most recent call last): File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_ impl.py ", line 422, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/middleware/proxy_ headers.py ", line 63, in call return await self.app (scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/ applications.py ", line 1163, in call await super().__call__(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/ applications.py ", line 90, in call await self.middleware_stack(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 186, in call raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 164, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain env/lib/python3.11/site-packages/gradio/route_ utils.py ", line 761, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ exceptions.py ", line 63, in call await wrap_app_handling_exceptions( self.app , conn)(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 53, in wrapped_app raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 42, in wrapped_app await app(scope, receive, sender) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/middleware/ asyncexitstack.py ", line 18, in call ... File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/jinja2/ utils.py ", line 515, in getitem rv = self._mapping[key] ~~~~~~~~~~~~~^^^^^ TypeError: unhashable type: 'dict' Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings... Running on local URL: http://127.0.0.1:7862 ERROR: Exception in ASGI application Traceback (most recent call last): File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_ impl.py ", line 422, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/middleware/proxy_ headers.py ", line 63, in call return await self.app (scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/ applications.py ", line 1163, in call await super().__call__(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/ applications.py ", line 90, in call await self.middleware_stack(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 186, in call raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 164, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain env/lib/python3.11/site-packages/gradio/route_ utils.py ", line 761, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ exceptions.py ", line 63, in call await wrap_app_handling_exceptions( self.app , conn)(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 53, in wrapped_app raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 42, in wrapped_app await app(scope, receive, sender) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/middleware/ asyncexitstack.py ", line 18, in call ... File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/jinja2/ utils.py ", line 515, in getitem rv = self._mapping[key] ~~~~~~~~~~~~~^^^^^ TypeError: unhashable type: 'dict' Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
안녕하세요, 강의 내용대로 Gradio를 이용하여 인터페이스를 실행하려는데 아래와 같이 ASGI application 에러가 발생하며 서버가 정상 동작하지 않습니다. 어떡해야할까요? ERROR: Exception in ASGI application Traceback (most recent call last): File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_ impl.py ", line 422, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/middleware/proxy_ headers.py ", line 63, in call return await self.app (scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/ applications.py ", line 1163, in call await super().__call__(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/ applications.py ", line 90, in call await self.middleware_stack(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 186, in call raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 164, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain env/lib/python3.11/site-packages/gradio/route_ utils.py ", line 761, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ exceptions.py ", line 63, in call await wrap_app_handling_exceptions( self.app , conn)(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 53, in wrapped_app raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 42, in wrapped_app await app(scope, receive, sender) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/middleware/ asyncexitstack.py ", line 18, in call ... File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/jinja2/ utils.py ", line 515, in getitem rv = self._mapping[key] ~~~~~~~~~~~~~^^^^^ TypeError: unhashable type: 'dict' Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings... Running on local URL: http://127.0.0.1:**** ERROR: Exception in ASGI application Traceback (most recent call last): File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_ impl.py ", line 422, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/uvicorn/middleware/proxy_ headers.py ", line 63, in call return await self.app (scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/ applications.py ", line 1163, in call await super().__call__(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/ applications.py ", line 90, in call await self.middleware_stack(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 186, in call raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ errors.py ", line 164, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain env/lib/python3.11/site-packages/gradio/route_ utils.py ", line 761, in call await self.app (scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/middleware/ exceptions.py ", line 63, in call await wrap_app_handling_exceptions( self.app , conn)(scope, receive, send) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 53, in wrapped_app raise exc File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/starlette/_exception_ handler.py ", line 42, in wrapped_app await app(scope, receive, sender) File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/fastapi/middleware/ asyncexitstack.py ", line 18, in call ... File "/opt/anaconda3/envs/langchain_env/lib/python3.11/site-packages/jinja2/ utils.py ", line 515, in getitem rv = self._mapping[key] ~~~~~~~~~~~~~^^^^^ TypeError: unhashable type: 'dict' Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...