묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
try catch문이 있는데 if문으로 에러처리를 따로 하는 이
router.get("/", async (req, res, next) => { try { if (req.user) { // findOne에서 에러가 생기는 거는 try catch문으로 처리가 안된 const user = await User.findOne({ where: { id: req.user.id }, }); res.status(200).json(user); } else { res.status(200).json(null); } } catch (error) { console.error(error); next(error); } });이부분에서 아직 로그인을 하지 않아서 유저 정보가 없을때 User.findOne에서 에러가 나기 때문에 if문으로 감싸서 아직 유저정보가 없을 때를 예외 처리 해주셨는데 어차피 User.findOne에서 에러가 나면 catch문으로 이동해서 에러가 처리가 되는데 굳이 if else로 예외 처리 하신 이유가 있나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
homebrew와 m1 맥북으로 설치했다면 아래 명령어로 경로 확인 가능
mysql 접속 후 아래 명령어 2가지를 통해 알 수 있음.show variables like 'datadir';select @@datadir;
-
미해결딥러닝을 활용한 자연어 처리 (NLP) 과정 (기초부터 ChatGPT/생성 모델까지)
Decoder 의 Output Probablilities 계산하는 부분 RNN과 관련하여 질문드립니다.
RNN Decoder의 경우, time step 별로 해당 input 단어에 대한 vocab 사전의 확률분포가 나오면, argmax 하거나, beam searching 하여 output을 최종 산출한다는 것으로 이해했었습니다.강의에서 트랜스포머 Decoder의 경우도 개념은 똑같다고 하셨는데, 트랜스포머도 time step 이 있는건가요? 예를들어,'I love you' 를 '난 널 사랑해' 로 번역할 때,decoder에 attention계산과정 및 Feed Forward 계산과정을 거쳐 나온 최종 attetion vector (seq_len x d model 차원) 가 첫번째 단어 '난' 부터 시작해서 greedy 하게, 혹은 beam search 전략 통하여 확률분포를 구한다고 보면 될까요?
-
해결됨외워서 끝내는 네트워크 핵심이론 - 응용
4:52 대리 한다는 의미가 뭔지 잘 모르겠습니다
알려주시면 감사드리겠습니다
-
미해결딥러닝을 활용한 자연어 처리 (NLP) 과정 (기초부터 ChatGPT/생성 모델까지)
트랜스포머 Encoder Output이 Decoder Input으로 들어갈 때 관련 질문 드립니다.
Encoder의 Output은 attention vector (seq_len x d model) 하나가 나오는데, Decoder의 인풋으로 들어갈 땐 이를 encoder에서 배웠던 Q, K, V 로 나눈뒤, 이중에서 K, V 가 Decoder의 Encoder-Decoder attention layer에서의 K, V로 사용된다고 보면 될까요?
-
미해결[리뉴얼] 타입스크립트 올인원 : Part1. 기본 문법편
Omit 타입에서 K extends keyof any에 대해서 질문있습니다.
Omit에서 K extends keyof any로 키값만 들어올 수 있도록 제한을 주었는데 이전 강의때 말씀해주셨던 타입은 정확할수록 좋다는 말씀이 생각나서 질문드립니다. 키 값중에서도 T의 키값이 들어와야 더 정확하다고 생각해서 K extends keyof T 가 더 올바르다고 생각하는데 any로 쓴 이유가 있을까요??type E<T, U> = T extends U ? never : T; type P<T, K extends keyof T> = { [P in K]: T[P]; }; type O<T, K extends keyof T> = P<T, E<keyof T, K>>;
-
해결됨[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
섹션 16. 근태관리 앱 세팅하기 에러
버전이 맞지 않다고 뜨네요강의보면서 멈춰가면서 그대로 따라했습니다 C:\flutter\bin\flutter.bat --no-color pub getRunning "flutter pub get" in chool_check...Resolving dependencies...The current Dart SDK version is 2.19.6.Because chool_check requires SDK version >=3.0.0 <4.0.0, version solving failed.pub get failedcommand: "C:\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub --directory . get --example"pub env: { "FLUTTER_ROOT": "C:\flutter", "PUB_ENVIRONMENT": "flutter_cli:get", "PUB_CACHE": "C:\Users\manjin han\AppData\Local\Pub\Cache",}exit code: 1Process finished with exit code 1
-
미해결피그마(Figma)를 활용한 UI디자인 입문부터 실전까지 A to Z
안녕하세요 질문 드립니다!
화면과 같은 아이콘 제작을연습하고 있습니다.화살표를 만들려 하는데아이콘 아래 방법들 처럼 진행해서 화살표를 만들 생각을 했습니다.이 화살표의 크기가 무족건 소수점이 되어서아이콘상으로 옮겼을때 keyline 프레임상에 딱 중심으로 가게할수가 없더라고요, 위치랑 크기가 소수점으로 떨어집니다.소수점 이동해서 최대한 중앙으로 맞춰도 끝부분은 약간 빗나가게 되버립니다.이방법으로 화살표 만드는게 맞는지 여쭈어 봅니다.또한 딱 중앙으로 맞추는 방법이 있을까요??
-
미해결홍정모의 따라하며 배우는 C++
19.4 [14:04] std::lock_guard, std::scoped_lock 컴파일 오류
#include <iostream> #include <thread> #include <atomic> #include <mutex> #include <chrono> using namespace std; mutex mtx; int main() { int shared_memory(0); //atomic<int> shared_memory(0); auto count_func = [&]() { for (int i = 0; i < 1000; ++i) { this_thread::sleep_for(chrono::milliseconds(1)); //shared_memory++; //shared_memory.fetch_add(1); /*mtx.lock(); shared_memory++; mtx.unlock();*/ //std::lock_guard lock(mtx); //std::scoped_lock lock(mtx); shared_memory++; } }; thread t1 = thread(count_func); thread t2 = thread(count_func); thread t3 = thread(count_func); thread t4 = thread(count_func); t1.join(); t2.join(); t3.join(); t4.join(); cout << "After" << endl; cout << shared_memory << endl; return 0; } Debug 모드로 진행시 std::lock_guard랑 scoped_lock이 정상적으로 compile되고 작동이 되는데,Release 모드로 변경하니 해당 lock_guard는 missing template이 뜨고, scoped_lock은 member가 존재하지 않는다고 뜨는데어떤 점이 문제일까요?..교수님 강의에서는 Release 모드에서도 잘 작동하는 거로 보였습니다.
-
미해결스프링부트 JUnit 테스트 - 시큐리티를 활용한 Bank 애플리케이션
Service 단 Test Code 작성 요령
안녕하세요~ 예전에 TC 를 작성하면서 발생한 궁금점들이 이번 강의를 통해서 다시 한번 생기게 되어서 질문 올리게 되었습니다!!UserSerivce 를 Test 하기 위해 UserRepository 모킹주입을 하였습니다. 이 때, stub 을 사용하여 모킹 객체의 동작을 정의해주는데, 제가 예전에 이렇게 했을 때 (강의 예제와 같은) UserRepository 의 동작을 일괄적으로 관리하기 위해 @BeforeEach 를 사용하였습니다. |이렇게 했더니 실제로 많은 일을 수행하는 Repository 에 들어가는 when 절이 정말 많아지고 BeforeEach 가 매우 길어져서(필요한 연관 객체들 User 와 연관된 A,B,C 등의 Entity 모두 그 때 그 때 생성해주는 코드까지 다 결합되어 있었음), 이게 과연 맞는가? 싶은 생각이 들었습니다. 해당 강의를 통해서 그냥 그렇게 하는게 맞았었나보네 싶은데 , 보통 그렇게 BeforeEach 혹은 각 TC 코드가 길어져도 이렇게 Test 하는게 관례적인 모습일까요?그간 물어볼 사람이 없어서 못 물어봤는데 이렇게 질문드릴 수 있게 되어서 다행입니다 ㅠ
-
미해결
아나콘다 파이썬 환경에서 GloVe 실행하기
안녕하세요, 아나콘다 파이썬 환경에서 글로브(GloVe)를 실행하는 것 관련해서 문의드립니다.올해 초(2023년 5월) 정도까지는 아래의 코드로 아나콘다 파이썬 환경에서 GloVe 패캐지가 실행되었는데, 현재는 오류가 납니다. 혹시 해결책이 있을까요?!pip install glove-python-binary# 라이브러리를 import 합니다.from glove import Glove, Corpus오류 화면은 아래와 같습니다.감사합니다.
-
미해결예제로 배우는 스프링부트 입문
33강 jpa 질문입니다
33강 하고 있는데요..디비 설정부분에서 에러가 납니다.데이터소스 설정이 안되어있다고 하는거 같은데...몇 번을 뒤져봤는데도 제 눈에는 안 보네요..ㅠFailed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction:Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).build,gradle의 디펜던시입니다dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' testImplementation 'org.springframework.boot:spring-boot-starter-test' runtimeOnly 'com.oracle.database.jdbc:ojdbc8' }의존성은 dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' testImplementation 'org.springframework.boot:spring-boot-starter-test' runtimeOnly 'com.oracle.database.jdbc:ojdbc8' }persistence 설정은 아래와 같습니다..<properties> <property name="jakarta.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver" /> <property name="jakarta.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:xe" /> <property name="jakarta.persistence.jdbc.user" value="scott" /> <property name="jakarta.persistence.jdbc.password" value="tiger" /> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
graphql 궁금한게 있습니다
선생님께서는type Mutation { createBoard(createBoardInput: CreateBoardInput!):String }밸류 CretaBoardInput !을 그룹으로 묶어서input CreateBoardInput{ writer:String title:String contents: String }이렇게 나타내셨는데 ,그런데 키 createBoardInput은 뭘 나타내는 건가요?혹시, 객체를 그룹으로 묶으면 키,밸류를 똑같은 이름으로 지어야 하나요>?
-
미해결[하루 10분|C++] 누구나 쉽게 배우는 C++ 프로그래밍 입문
[클래스 및 분할 컴파일 질문]undefined reference to
클래스를 헤더 파일(stock.h)와 func.cpp 파일에 분할해서 작성 후 컴파일 했는데 C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x74): undefined reference to `Stock::Stock(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, float)'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0xac): undefined reference to `Stock::Stock()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0xfa): undefined reference to `Stock::show()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x107): undefined reference to `Stock::show()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x162): undefined reference to `Stock::Stock(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, float)'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x185): undefined reference to `Stock::~Stock()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x1ba): undefined reference to `Stock::show()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x1cc): undefined reference to `Stock::~Stock()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x1d9): undefined reference to `Stock::~Stock()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x20d): undefined reference to `Stock::~Stock()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x23a): undefined reference to `Stock::~Stock()'C:\Users\PC-202~1\AppData\Local\Temp\ccEPMb0b.o:practice.cpp:(.text+0x24b): undefined reference to `Stock::~Stock()'collect2.exe: error: ld returned 1 exit status이런 오류가 발생했습니다.인터넷을 찾아봐도 잘 모르겠어서 원인이 무엇인지 질문드립니다.
-
미해결비전공자의 전공자 따라잡기 - 네트워크, HTTP
OSI 7 계층 전체 프로세스 작동 방식
물리->데이커링크->네트워크->트랜스포트->세표응 이런 일련의 과정을 CHUNK로 봤을 때 예를 들어 클라이언트->서버로 보낼 때 물리부터 세표응까지 한번 일어나고 다시 서버-> 클라이언트로 갈 때 다시 물리부터 세표응까지의 과정이 일어나나요?궁금합니다..
-
미해결쉽고 빠르게 끝내는 GO언어 프로그래밍 핵심 기초 입문 과정
atom 서비스 종료 관련
안녕하세요, 최근에 강의를 구입해서 듣고 있는 수강생입니다. 지금 동영상을 보면서 공부하는 도중에 atom 서비스 부분에 막혀 진도를 못나가고 있는 상태입니다. 인터넷에 찾아보니 아톰서비스는 작년에 종료되었다고 하는데 추후 다른 서비스를 통한 개발 환경 강의 업데이트 예정인가요? 예정이라면 언제쯤 업로드 가능한지 궁금합니다.
-
해결됨스프링 DB 2편 - 데이터 접근 활용 기술
jpa_pdf 객체 조회 부분에서..
memberId를 파라미터로 받고 해당하는 단일 Member 객체를 반환하는 find 메소드와 연관지었을 때JOIN 뒤에 있어야 할 WHERE M.MEMBER_ID = ? 와 같은 where 절이 없는데.. 생략된 것인가요?
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
2-R 데이터 저장
http://boj.kr/1c07c3f4f76347e791816ea1d051396b 위의 코드에서 5 -1 0 0 1 1 0 다음과 같은 테스트케이스를 넣어주면 deleteChildren()에서 1번 노드가 들어갈때 데이터가 온전히 전달이 안됩니다... 확인해보니 1번 노드에서는 자식이 2개여야 하는데 0개로 나옵니다. deleteChildren를 호출하기전에는 2개로 잘 나오는데 이유가 뭘까요..? 아래 사진은 deleteChildren을 호출하기전 데이터 사진입니다. deleteChildren(node& nd) 으로 해도 데이터가 안넘어가지더라구요... 우선은 node가 아닌 int idx를 받아 함수 안에서 tree[idx] 이렇게 직접 찾게 바꿔서 해결은 했습니다만 데이터가 제대로 안넘어가는 이유가 너무 궁금합니다!!
-
미해결다양한 사례로 익히는 SQL 데이터 분석
컬럼의 뜻에 대해 질문 드립니다.
채널별 고유/주문 사용자 건수와 매출 금액 및 비율 SQL로 구하기 2 를 학습하면서/************************************ 채널별 고유 사용자 건수와 매출금액 및 비율, 주문 사용자 건수와 주문 매출 금액 및 비율 채널별로 고유 사용자 건수와 매출 금액을 구하고 고유 사용자 건수 대비 매출 금액 비율을 추출. 또한 고유 사용자 중에서 주문을 수행한 사용자 건수를 추출 후 주문 사용자 건수 대비 매출 금액 비율을 추출 *************************************/ with temp_01 as ( select a.sess_id, a.user_id, a.channel_grouping , b.order_id, b.order_time, c.product_id, c.prod_revenue from ga_sess a left join orders b on a.sess_id = b.sess_id left join order_items c on b.order_id = c.order_id where a.visit_stime >= (:current_date - interval '30 days') and a.visit_stime < :current_date ) select channel_grouping , sum(prod_revenue) as ch_amt -- 채널별 매출 --, count(distinct sess_id) as ch_sess_cnt -- 채널별 고유 세션 수 , count(distinct user_id) as ch_user_cnt -- 채널별 고유 사용자 수 --, count(distinct case when order_id is not null then sess_id end) as ch_ord_sess_cnt -- 채널별 주문 고유 세션수 , count(distinct case when order_id is not null then user_id end) as ch_ord_user_cnt -- 채널별 주문 고유 사용자수 --, sum(prod_revenue)/count(distinct sess_id) as ch_amt_per_sess -- 접속 세션별 주문 매출 금액 , sum(prod_revenue)/count(distinct user_id) as ch_amt_per_user -- 접속 고유 사용자별 주문 매출 금액 -- 주문 세션별 매출 금액 --, sum(prod_revenue)/count(distinct case when order_id is not null then sess_id end) as ch_ord_amt_per_sess -- 주문 고유 사용자별 매출 금액 , sum(prod_revenue)/count(distinct case when order_id is not null then user_id end) as ch_ord_amt_per_user from temp_01 group by channel_grouping order by ch_user_cnt desc;위 쿼리의 쿼리 뜻이 잘 이해가 안되어 질문 드립니다., sum(prod_revenue)/count(distinct user_id) as ch_amt_per_user -- 접속 고유 사용자별 주문 매출 금액, sum(prod_revenue)/count(distinct case when order_id is not null then user_id end) as ch_ord_amt_per_user이 두 항목은 각각 접속 고유 사용자별 주문 매출 금액,주문 고유 사용자별 매출 금액이라 명칭 되어 있는데, 어떤 의미를 가지고 있는 것인지 잘 이해가 되지 않아 질문 드립니다.접속 고유 사용자별 주문 매출 금액 : 사용자 대비 30일이내 매출 금액주문 고유 사용자별 매출 금액 : 주문 대비 30일 이내 매출 금액이렇게 이해를 하면 될런지요?
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
4-A map 관련 질문입니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요 강사님, 제가 map<int, vector<vector<int>>> ret_v; 의 형태에 대해 이해가 잘 안됩니당 강의에서 설명해주신대로 벡터의 벡터를 이용하는것 까지는 이해를 했습니다.근데 출력부분이 왜for(int a : ret_v[ret][0]){ cout << a << " "; } 이렇게 작성 되는지가 이해가 안가네용 ... 제 생각엔 ret_v[ret]면 될거같은데 [0]이 왜 있고 무슨의미인지 이해가 안되네요