묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결실리콘밸리 엔지니어와 함께하는 테라폼(Terraform)
subnet 생성을 terraform으로 하는게 괜찮을지 고민입니다.
resource "aws_instance" "web" { ami = data.aws_ami.ubuntu.id instance_type = "t2.micro" tags = { name = "MyEc2" } depends_on = [aws_default_subnet.default_az1] } resource "aws_default_subnet" "default_az1" { availability_zone = "us-west-2a" tags = { Name = "Default subnet for us-west-2a" } }aws default subnet을 지정해주는 terraform resource가 있는 것 같은데 정상동작했어요 ! 이런 방법은 어떤가요 ? aws cli를 따로 사용해야하니 왠지 terraform에 종속성이 생긴 느낌이들어서요
-
해결됨홍정모의 따라하며 배우는 C++
(과제스포)제가 과제를 똑바로 이해했는지 궁금합니다.
#include<chrono> #include<iostream> #include<mutex> #include<random> #include<thread> #include<utility> #include<vector> #include<atomic> #include<future> #include<numeric> #include<execution> using namespace std; mutex mtx; void dotProductDQThread(const vector<int>& v0, const vector<int>& v1, const unsigned i_start, const unsigned i_end, unsigned long long& sum) { int sum_tmp = 0; //local sum for (unsigned i = i_start; i < i_end; ++i) { sum_tmp += v0[i] * v1[i]; } sum += sum_tmp; } void dotProductProm(const vector<int>& v0, const vector<int>& v1, const unsigned i_start, const unsigned i_end, promise<unsigned long long>&& sum) { int sum_tmp = 0; //local sum for (unsigned i = i_start; i < i_end; ++i) { sum_tmp += v0[i] * v1[i]; } sum.set_value(sum_tmp); } int main() { /*v0 = { 1,2,3 }; v1 = { 4,5,6 }; v0_dot = 1 * 4 + 2 * 5 + 3 * 6;*/ const long long n_data = 100'000'000; const unsigned n_threads = 4; //initialize vectors std::vector<int> v0, v1; v0.reserve(n_data); v1.reserve(n_data); random_device seed; mt19937 engine(seed()); uniform_int_distribution<> uniformDist(1, 10); //v0와 v1에 값 무작위로 넣어줌 for (long long i = 0; i < n_data; ++i) { v0.push_back(uniformDist(engine)); v1.push_back(uniformDist(engine)); //cout << v0[i] << "\t" << v1[i] << endl; } cout << "std::inner_product" << endl; { const auto sta = chrono::steady_clock::now(); const auto sum = std::inner_product(v0.begin(), v0.end(), v1.begin(), 0ull);//0ull = unsigned longlong 0 const chrono::duration<double> dur = chrono::steady_clock::now() - sta; cout << dur.count() << endl; cout << sum << endl; cout << endl; } //TODO: use divde and conquer strategy for std::thread cout << "TODO: use divde and conquer strategy for std::thread" << endl; { const auto sta = chrono::steady_clock::now(); unsigned long long sum = 0; vector<thread> threads; threads.resize(n_threads); const unsigned n_per_thread = n_data / n_threads; for (unsigned t = 0; t < n_threads; ++t) threads[t] = std::thread(dotProductDQThread, std::ref(v0), std::ref(v1), t * n_per_thread, (t + 1) * n_per_thread, std::ref(sum)); for (unsigned t = 0; t < n_threads; ++t) threads[t].join(); const chrono::duration<double> dur = chrono::steady_clock::now() - sta; cout << dur.count() << endl; cout << sum << endl; cout << endl; } //TODO: use promise cout << "TODO: use promise" << endl; { const auto sta = chrono::steady_clock::now(); //std::promise<unsigned long long> sum; auto sum = 0ull; vector<thread> threads; vector<future<unsigned long long>> futures; vector<promise<unsigned long long>> proms; threads.resize(n_threads); futures.resize(n_threads); proms.resize(n_threads); const unsigned n_per_thread = n_data / n_threads; for (unsigned t = 0; t < n_threads; ++t) { futures[t] = proms[t].get_future(); threads[t] = std::thread(dotProductProm, std::ref(v0), std::ref(v1), t * n_per_thread, (t + 1) * n_per_thread, std::move(proms[t])); } for (unsigned t = 0; t < n_threads; ++t) { threads[t].join(); sum += futures[t].get(); } const chrono::duration<double> dur = chrono::steady_clock::now() - sta; cout << dur.count() << endl; cout << sum << endl; cout << endl; } }결과는 제대로 나오지만, 제가 과제를 똑바로 이해했는지 궁금해서 여쭤봅니다.과제1: use divde and conquer strategy for std::thread쓰레드에 sum에 local sum값을 넣어 race condition 해결과제2: prom 사용해보기sum 변수 선언 및 thread, promise, future 모두 쓰레드 크기 만큼의 vector로 만들어줬습니다. 병렬 처리 후 future값을 sum에 더해줬습니다.※추가 궁금증promise 과제 중, std::ref와 std::move 둘 다 해보았습니다. 두 경우 모두 정상 작동하였는데, 어떤 방법을 가장 추천하시나요?
-
미해결HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)
다시 질문 드립니다 ㅠㅠ CSS 키프레임 애니메이션 활용한 실전 예제 제작 01(원형 크기 변경 로딩 애니메이션)
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>도형 로딩 애니메이션</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="loading"> <span></span> <span></span> <span></span> </div> </body> </html> /* Google Web Font */ @import url('http://fonts.googleapis.com/css?family=Raleway&display=swap'); body { font-family: 'Raleway', sans-serif; line-height: 1.5em; margin: 0; font-weight: 300; display: inline; justify-content: center; align-items: center; height: 100vh; } a { text-decoration: none; } .loading {} .loading span { display: inline-block; width: 20px; height: 20px; background-color: gray; border-radius: 50%; animation: loading 1s linear infinite; } .loading span:nth-child(1) { animation-duration: 0s; background-color:crimson; } .loading span:nth-child(2) { animation-duration: 0.2s; background-color:dodgerblue; } .loading span:nth-child(3) { animation-duration: 0.4s; background-color:royalblue; } @keyframes loading { 0% { opacity: 0; transform: scale(0.5); } 50% { opacity: 1; transform: scale(0.5); } 100% { opacity: 0; transform: scale(0.5); } }이렇게 작성했는데 go live 화면에선 이렇게 뜨고 애니메이션이 안나와요.. ㅠㅠ 뭐가 문제일까요??? 몇주동안 안되요..
-
미해결처음 만난 리덕스(Redux)
강의자료문의
ppt 강의 자료는 어디서 받을 수 있나요?
-
해결됨스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
인터셉터의 afterCompletion에서는 예외를 처리해주진 못하나요?
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]afterCompletion 구현 코드 결과 화면사진과 같이 afterCompletion()에서 예외 처리 부분에 response.sendError(200)을 해도 예외가 500으로 나가는 걸 확인할 수 있었습니다.@ControllerAdvice 어노테이션을 지정한 클래스 및 제가 구현한 ExceptionResolver들은 전부 주석처리 하여서 HandlerExceptionResolver 단계에서 예외 처리 실패했으니 500 Internal Error이 나가는 것은 맞지만,최종적인 단계에서 필터링 해주는 인터셉터인 afterCompletion()에서 sendError()을 지정하면 WAS는 지정된 상태 코드의 예외 처리를 해줘야하지 않나요?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
회원 가입 run 했을 시 DB 저장 안돼요
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]영상 속 6분 20초경 @Transactional을 주석 처리 한 후 회원가입 run 했을 시 DB에 데이터가 들어가지 않습니다
-
해결됨스프링 핵심 원리 - 기본편
store에 static을 사용하는 이유
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]OrderServiceTest에서 NullPointerException 오류가 나서 찾아보니 MemoryMeberRepository의 store에 static이 빠져서 오류가 났었더라고요.store에 static을 붙이는 이유와 붙이지 않으면 NullPointerException이 발생하는 이유가 궁금합니다.
-
미해결확률과 통계 기초
6.1 유니폼분포 MGF로 평균구하기
M' =My(s) - My(0) / s = exp(sb) - exp(sa) -1 /(s^2*(b-a) 이걸 어떻게 분리해서 미분값이 나오는지 모르겠습니다.. 분모텀에 0이 두개인걸 처리못하겠는데 풀이알려주시면 감사하겠습니다..
-
미해결Next + React Query로 SNS 서비스 만들기
처음에 패키지 생성만 해도 콘솔에 뜨는 오류가 있던데 이게 뭔가요? Extra attributes from the server
app-index.js:35 Warning: Extra attributes from the server: class at html at RedirectErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:73:9) at RedirectBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/redirect-boundary.js:81:11) at NotFoundErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:76:9) at NotFoundBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-boundary.js:84:11) at DevRootNotFoundBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/dev-root-not-found-boundary.js:33:11) at ReactDevOverlay (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/react-dev-overlay/internal/ReactDevOverlay.js:84:9) at HotReload (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/react-dev-overlay/hot-reloader-client.js:307:11) at Router (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/app-router.js:182:11) at ErrorBoundaryHandler (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:114:9) at ErrorBoundary (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js:161:11) at AppRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/app-router.js:538:13) at ServerRoot (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:129:11) at RSCComponent at Root (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:145:11)프레임 1개 더 표시 패키지 생성만 했는데 콘솔에 찍히는 오류가 있던데그냥 로컬에서 실행해서 뜨는 오류인건가요?
-
미해결HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)
도형 로딩 애니메이션 질문입니다
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>도형 로딩 애니메이션</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="loading"> <span></span> <span></span> <span></span> </div> </body> </html>/* Google Web Font */ @import url('http://fonts.googleapis.com/css?family=Raleway&display=swap'); body { font-family: 'Raleway', sans-serif; line-height: 1.5em; margin: 0; font-weight: 300; display: flex; justify-content: center; align-items: center; height: 100vh; } a { text-decoration: none; } .loading {} .loading span { display: inline-block; width: 20px; height: 20px; background-color: gray; } .loading span:nth-child(1) {} .loading span:nth-child(2) {} .loading span:nth-child(3) {} 지금 이 상태인데 화면에 아무것도 나타나지 않습니다. 이렇게 뜨는데 뭐가 문제일까요?
-
미해결쉽게 시작하는 쿠버네티스(v1.30) - {{ x86-64, arm64 }}
실습환경 세팅 오류
실습 환경 구성중에 있는데요.vagrant up 진행시 아래와 같은 오류가 발생합니다.failure: repodata/repomd.xml from kubernetes: [Errno 256] No more mirrors to try. m-k8s-1.25.0: https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found m-k8s-1.25.0: /tmp/vagrant-shell: line 21: /etc/containerd/config.toml: No such file or directory m-k8s-1.25.0: Failed to execute operation: No such file or directory m-k8s-1.25.0: Failed to execute operation: No such file or directory m-k8s-1.25.0: Failed to execute operation: No such file or directoryThe SSH command responded with a non-zero exit status. Vagrantassumes that this means the command failed. The output for this commandshould be in the log above. Please read the output to determine whatwent wrong. 또한 OVA를 찾을수가 없는데요 어디서 확인가능할까요?..공유되는 자료가 한번에 확인할 수 있는곳이 없어 불편한거 같습니다.
-
해결됨개발자를 위한 컴퓨터공학 1: 혼자 공부하는 컴퓨터구조 + 운영체제
Ram의 기능
강의 제목 : RAM의 특징과 종류 예전에 초반 강의에선RAM을 현재 실행하고있는 프로그램 즉, 프로세스의 데이터와 명령어를 저장한다고 들었습니다. 근데 여기 강의에서는 RAM은 CPU가 실행할 데이터를 저장하는 공간이라고 하셧는데 그럼 RAM은 현재 실행하고있는 데이터와 명령어를 저장하는 기능과 실행"할" 데이터와 명령어를 저장하는 기능 두가지가 있는건가요?
-
미해결설계독학맛비's 실전 Verilog HDL Season 2 (AMBA AXI4 완전정복)
[24장] power_of_8_hs.v 코드 관련 질문
안녕하십니까 맛비님. 코드를 분석하다가 궁금한 점이 생겨서 질문드립니다.power_of_8_hs.v 코드를 분석해보았는데,8승 모듈의 출력 단자인 m_power_of_8과 m_valid에 어떠한 계산 결과를 할당한 할당문이 없는 것으로 분석하였습니다.그러나 시뮬레이션 파형을 돌려보면 파형이 정상적으로 생성되었는데, 할당문이 없었음에도 불구하고 값이 정상적으로 출력이 된 이유가 궁금합니다.답변해주시면 감사하겠습니다. =================현업자인지라 업무때문에 답변이 늦을 수 있습니다. (길어도 만 3일 안에는 꼭 답변드리려고 노력중입니다 ㅠㅠ)강의에서 다룬 내용들의 질문들을 부탁드립니다!! (설치과정, 강의내용을 듣고 이해가 안되었던 부분들, 강의의 오류 등등)이런 질문은 부담스러워요.. (답변거부해도 양해 부탁드려요)개인 과제, 강의에서 다루지 않은 내용들의 궁금증 해소, 영상과 다른 접근방법 후 디버깅 요청, 고민 상담 등..글쓰기 에티튜드를 지켜주세요 (저 포함, 다른 수강생 분들이 함께보는 공간입니다.)서로 예의를 지키며 존중하는 문화를 만들어가요.질문글을 보고 내용을 이해할 수 있도록 남겨주시면 답변에 큰 도움이 될 것 같아요. (상세히 작성하면 더 좋아요! )먼저 유사한 질문이 있었는지 검색해보세요.잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.==================
-
해결됨자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
기타 질문
워밍업 통해 너무 잘 듣고 있습니다😊강의 관련 질문은 아니고 기타적인 질문인데요혹시 이 강의의 후속강의나 스프링 백엔드 관련 강의 더 내실 계획은 없으신가요?강사님 강의 더 듣고 싶어서요..!
-
미해결홍정모의 따라하며 배우는 C++
헤더파일 포함 컴파일 방법
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아헤더 파일을 포함한 파일에 대해 컴파일하는 방법이 궁금합니다.다른 분 답변에서는 makefile을 사용하라고 다른 분께서 말씀하시던데 이해가 되지 않아 남겨봅니다.
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
HTML 변경으로 인한 CSS 선택자 및 줄바꿈 문의
import requests from bs4 import BeautifulSoup response = requests.get('https://search.naver.com/search.naver?ssc=tab.news.all&where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90') html = response.text soup = BeautifulSoup(html, 'html.parser') news_infos = soup.select(' div.info_group') news_num = 1 for news_info in news_infos: news_link = news_info.select('a.info') if len(news_link) >= 2 : url = news_link[1].attrs['href'] news_info = requests.get(url) news = news_info.text news_information = BeautifulSoup(news, 'html.parser') news_text = news_information.select_one('article') print(str(news_num) , "입니다>>>>>>>>>>>>>>>>") print(news_text.text) news_num += 1CSS선택자를 article로 선택하고출력을 하였더니 결과값 사이 사이에 줄바꿈이 있네요없앨 수 있는 방법은 무엇일까요?
-
미해결파이썬 플라스크(Flask) 기반 웹 개발 및 업무 자동화 서비스 활용
[restful API]서버 구성관련 문의드립니다.
restful API 활용하기 관련 문의드립니다. API 파일을 만들 때에,app.run(host='0.0.0.0', port=8000) 으로 서버를 구동할 경우에도, 브라우져 창에서 접속은 localhost:8000 으로 하면 되는건가요? 강의 자료,api_hangul.py또는 api_minus.py 로 API서버를 구동하고, 브라우져에서 접속하거나,http://127.0.0.1:8000/minus?x=3&y=7python resourceGet.py을 실행하더라도동일하게 에러가 나는데요.'error': "415 Unsupported Media Type: Did not attempt to load JSON data because the request Content-Type was not 'application/json'." 왜 그런건가요??
-
해결됨자바 ORM 표준 JPA 프로그래밍 - 기본편
[JPA] 테이블 생성 시, 컬럼 순서
안녕하세요, 강의를 듣던 중 소소한 궁금증이 생겨 아래와 같은 질문을 남깁니다. 사진을 보시면, 영한님의 JPA 실행 결과에서는 선언한 컬럼 순서대로 테이블의 컬럼이 구성되어 있는 것을 확인할 수 있습니다.그런데, 제 실행 결과를 확인하면 알파벳 순서대로 컬럼이 구성되어 있더군요.1-1. 테이블 내 컬럼의 순서를 fix 시킬 수 있는 방법이 존재하는지1-2. 없다면, 어쩔 수 없는 부분으로서 실제 운영 환경에서는 어떻게 처리하는지 위 두 내용을 질문드립니다.감사합니다.
-
미해결
Vue -> Spring : axios.post 시 403 에러 (axios.get은 작동)
FrontTest.vueSimpleController.javavue.config.js Click 버튼 클릭 시 axios.get 실행 -> 1 입력 후 Click 버튼 클릭 시 one 출력 잘됨PostClick 버튼 클릭 시 axios.post 실행-> 1 입력 후 PostClick 버튼 클릭 시 아래 403 에러 발생[왼쪽 에러 내용]Uncaught runtime errors:ERRORRequest failed with status code 403 at createError (webpack-internal:///./node_modules/axios/lib/core/createError.js:16:15) at settle (webpack-internal:///./node_modules/axios/lib/core/settle.js:18:12) at XMLHttpRequest.handleLoad (webpack-internal:///./node_modules/axios/lib/adapters/xhr.js:55:7) [오른쪽 에러 내용]Failed to load resource: the server responded with a status of 403 (Forbidden)createError.js:16 Uncaught (in promise) Error: Request failed with status code 403at createError (createError.js:16:15)at settle (settle.js:18:12)at XMLHttpRequest.handleLoad (xhr.js:55:7)SecurityConfig.java axios.get 요청은 잘 작동하는데 axios.post 요청은 에러가 나는 원인이 뭘까요..?
-
미해결[웹 개발 풀스택 코스] 포트폴리오 - 제품 판매 미니 웹 앱 개발
EditView 파트 관련 질문드립니다
EditView.vue 파일에서 undefined로 수정 데이터값을 못 읽어오는데 최신버전 vue-route 문제인거 같은데 공식 문서를 읽어보고 나름 수정을 해봤는데도 오류를 잡을 수 없어서 질문 드립니다.