묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결홍정모의 따라하며 배우는 C++
copy constructor 안에서 length constructor 호출을 했는데 워닝이 나오는 이유가 궁금합니다.
안녕하세요. visual studio 사용하고 있습니다. 24번째 줄에서 Warning이 뜹니다. C26444 Don't try to declare a local variable with no name (es.84) copy constructor 안에서 length constructor 호출을 했는데 워닝이 나오는 이유가 궁금합니다. #pragma once #include <iostream> class Resource { public: int* m_data = nullptr; unsigned int m_length = 0; public: Resource() { std::cout << "Resource default constructed\n"; } Resource(unsigned int length) { std::cout << "Resource length constructed\n"; this->m_data = new int[length]; this->m_length = length; } Resource(const Resource& res) { std::cout << "Resource copy constructed\n"; // 1. ... Resource(res.m_length); //// 2 ... //this->m_data = new int[res.m_length]; //this->m_length = res.m_length; for (unsigned i = 0; i < m_length; ++i) { m_data[i] = res.m_data[i]; } } ~Resource() { std::cout << "Resource destroyed\n"; if (m_data != nullptr) { delete[] m_data; } } Resource& operator = (Resource& res) { std::cout << "Resource copy assignmnet\n"; if (&res == this) { return *this; } if (this->m_data != nullptr) { delete[] m_data; } m_length = res.m_length; m_data = new int[m_length]; for (unsigned int i = 0; i < m_length; ++i) { m_data[i] = res.m_data[i]; } return *this; } void print() { for (unsigned int i = 0; i < m_length; ++i) { std::cout << m_data[i] << " "; } std::cout << '\n'; } };
-
해결됨설계독학맛비's 실전 Verilog HDL Season 1 (Clock부터 Internal Memory까지)
Pipeline에서 질문
`timescale 1ns / 1ps module power_of_8( input clk, input reset_n, input i_valid, input [31:0] i_value, output o_valid, output [63:0] o_power_of_8 ); /////// Type //////// reg [2:0] r_valid; reg [63:0] r_power_of_2; reg [63:0] r_power_of_4; reg [63:0] r_power_of_8; wire [63:0] power_of_2; wire [63:0] power_of_4; wire [63:0] power_of_8; // flow of valid always @(posedge clk or negedge reset_n) begin if(!reset_n) begin r_valid <= 3'd0; end else begin r_valid <= {r_valid[1:0], i_valid}; end end // data buffer (f/f) always @(posedge clk or negedge reset_n) begin if(!reset_n) begin r_power_of_2 <= 64'd0; r_power_of_4 <= 64'd0; r_power_of_8 <= 64'd0; end else begin r_power_of_2 <= power_of_2; r_power_of_4 <= power_of_4; r_power_of_8 <= power_of_8; end end // Power Operation assign power_of_2 = i_value * i_value; assign power_of_4 = r_power_of_2 * r_power_of_2; assign power_of_8 = r_power_of_4 * r_power_of_4; assign o_valid = r_valid[2]; assign o_power_of_8 = r_power_of_8; endmodule ==================================== 테스트벤치 ============================== `timescale 1ns / 1ps module tb_power_of_8; reg clk , reset_n; reg i_valid; reg [31:0] i_value; wire o_valid; wire [63:0] o_power_of_8; // clk gen always #5 clk = ~clk; integer i; integer fd; initial begin //initialize value $display("initialize value [%d]", $time); reset_n = 1; clk = 0; i_valid = 0; i_value = 0; fd = $fopen("rtl_v.txt","w"); // reset_n gen $display("Reset! [%d]", $time); # 10 reset_n = 0; # 10 reset_n = 1; # 10 @(posedge clk); $display("Start! [%d]", $time); for(i=0; i<100; i = i+1) begin @(negedge clk); i_valid = 1; i_value = i; @(posedge clk); end @(negedge clk); i_valid = 0; i_value = 0; # 500 $display("Finish! [%d]", $time); $fclose(fd); $finish; end // file write always @(posedge clk) begin if(o_valid) begin $fwrite(fd,"result = %0d\n", o_power_of_8); end end // Call DUT power_of_8 u_power_of_8( .clk (clk), .reset_n (reset_n), .i_valid (i_valid), .i_value (i_value), .o_valid (o_valid), .o_power_of_8 (o_power_of_8) ); endmodule 위 코드는 맛비님이 주신 코드입니다(테스트벤치에서는 #숫자만 바꾸고 나머지는 동일합니다) 해당 코드를 vivado에서 돌리면 아래와 같이 i_valid와 i 의 값이 99까지 나오지 않습니다 제가 아무리 테스트벤치에서 # 숫자를 조작해도 맛비님이 보여주신 것처럼 i가 99까지 돌지를 않는데 왜 그런지 궁금합니다 테스트벤치에서 # 숫자를 조작하지 않고 맛비님이 주신 오리지날 코드로 돌렸을 때는 i가 88에서 그래프가 멈췄습니다
-
미해결해킹 대회를 위한 시스템 해킹 프로토스타 완벽 풀이집
현재 올려놓으신 사이트도 접속이 안되는데 어디서 문제를 확인할 수 있을까요?
제목과 같습니다. 라이브오버플로 홈페이지의 프로토스타 백업된 사이트 부분이 접속이 안되네요 ㅠㅠ 다른 방법이 있을까요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
유레카와 spring cloud gateway ?
둘다 로드밸런서가 될 수 있는데, 각각 어떤 차이점이 존재할까요?
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
RESTAPI에서 requestParam대신 modelParameter 사용
RESTAPI에서 @requestParam 대신에 @modelAttribute를 사용해도 되는지 궁금합니다. view를 사용하지 않기때문에 modelAttribute를 사용하는것은 뭔가 부적절해 보이는데, 무관하게 사용해도되는지 여쭤보고 싶습니다. --- 추가적으로 클라이언트한테 어떤 상황에서 requestParam, modelAttribute, pathParam, JsonBody를 적절히 사용해야 하는지 잘 모르겠습니다. --- 서치해본결과 pathParam은 식별자를 인풋으로 받는 경우 ex> 게시글 조회 시 /posts/{postId} requestParam은 같은 리소스에 대해 추가적인 액션이 있는경우 --- 이외의 경우(요구하는 인풋이 많다던가할때) jsonBody를 사용하는게 적절해 보이는데 이렇게 사용하면될까요? 답변주시면 감사드리겠습니다.
-
미해결
Connect with techies to resolve yahoo premium service related issues
Ifyou are in some sort of technical trouble with yahoo premium service then avails of the tech support. Through this, you’ll be able to rectify all the glitches of Yahoo that are troubling you. You only have to get connected with the technical team so as to fix the glitches instantly.
-
미해결
Should I Reconnect eBay Customer Service If Looking For Aid?
Are you not getting an appropriate mode of fixing the whole host of your problems permanently from the root? If yes, do not worry! You have to get in touch with the troubleshooting experts who will provide you with the right aid to get an optimum assistance through eBay Customer Service phone number
-
미해결
How To Block An Account Via Google Customer Service With Ease?
Blocking a particular email address on your Gmail account is not a big deal. Apart from that, you will also have to take help from the troubleshooting professionals. For that, you will need to make use of Google Customer Service through which you can find out the feasible aid along with the best treatment in no time
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
요청, 응답 시 annotaion, httpEntity 사용 관련
요청, 응답시 관련해서 몇가지 질문 사항이 있습니다. 1. 응답코드를 주고자 할때 , 어노테이션 // 리스폰스 엔티티 둘다 사용가능한데 어떤 경우에 어떤걸 사용하는게 더 좋은지 2. 마찬가지로 헤더 값이 필요한경우 어노테이션 // 리퀘스트 엔티티 둘다 사용가능한데 어떤 경우에 어떤걸 사용하는게 더 좋은지 3. modelAttribute 사용시 dto로 parameter들을 받을때 dto니까 setter를 그냥 사용하는게 좋은지아니면 entity처럼 setter를 사용하지 않고 필드 억세스 하도록 만들어 주는게 좋은지, 그렇다면 왜 그런지 3가지가 궁급합니다. 강의들 다시 복습하면서 요즘 이것저것 여쭤보는데 항상 친절히 답변해주셔서 감사합니다.
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
created() 훅 실행 시점과 기준
created() 훅 실행 시점과 기준 질문 드립니다. HOC가 아닌 일반 vue 컴포넌트를 적용하면, 페이지 진입 시에만 created() 훅이 실행되고 이후에는 route가 변경되더라도 실행되지 않는 것을 발견했습니다. vue 내부적으로 렌더링된 컴포넌트를 캐싱한다고 보면 되는지, 캐싱이 된다면 이런 옵션은 어떻게 설정하면 되는지 궁금합니다. 관련 자료를 찾아보려고 했는데 잘 안나오네요. 답변 부탁드리고 혹시 관련된 참고 자료가 있다면 같이 전달 해주시면 감사하겠습니다. <route 설정> export const router = new VueRouter({ mode: 'history', routes: [ { path: '/', redirect: '/news', }, { path: '/news', name: 'news', component: ListView, }, { path: '/ask', name: 'ask', component: ListView, }, { path: '/jobs', name: 'jobs', component: ListView, }, ] }); <ListView.vue> <template> <div> <list-item></list-item> </div> </template> <script> import ListItem from '../components/ListItem.vue'; export default { components: { ListItem }, }; </script> <ListItem.vue> <script> export default { created() { const pathName = this.$route.name; const actionMapper = { news: "FETCH_NEWS", ask: "FETCH_ASKS", jobs: "FETCH_JOBS", }; this.$store.dispatch(actionMapper[pathName]); }, computed: { listItems() { const pathName = this.$route.name; const state = this.$store.state; const stateMapper = { news: state.news, ask: state.asks, jobs: state.jobs, }; return stateMapper[pathName]; }, }, }; </script>
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
강사님 npm run start를 실행하니 아래와 같이 에러가 뜹니다.
위와 같이 에러가 뜨고 bodyParser에 커서를 가져가 보면 문구가 뜨고 한줄로 끄여져 있습니다. 어떻게 해결해야 하나요???... ('bodyParser'은(는) 더 이상 사용되지 않습니다.ts(6385))
-
해결됨풀스택 리액트 토이프로젝트 - REST, GraphQL (for FE개발자)
TypeError: Cannot read property 'nickname' of undefined
저도 똑같은 에러가 발생하여 MsgItem이나 MsgList 전부 깃허브에 올려주신 코드 그대로 복붙도 해보았는데, 그래도 안됩니다. MacOS 사용중입니다. 왜 안되는지 모르겠습니다..
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
아직도 Eslint 가 안돼요
저 동그란부분을 클릭하고 저렇게 팝업이 뜹니다 그리고 오케이 버튼을 눌러도 사라지지않은데 그이유를 모르겠어요
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
혹시 버전중에 리엑트
리엑트 버전이 { "name": "react-nodebird-front", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "dev": "next" }, "author": "PK", "license": "ISC", "dependencies": { "@ant-design/icons": "^4.6.4", "antd": "^4.16.13", "next": "^9.5.5", "prop-types": "^15.7.2", "react": "^17.0.2", "react-dom": "^17.0.2", "styled-components": "^5.3.1" }, "devDependencies": { "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", "eslint-plugin-react-hooks": "^4.2.0" }}괜찮은가요 ? 17이라고 되어있는데
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
실행을 하면 앱을 중지하였습니다. 라고 뜨고 실행이 안됩니다.
안녕하세요 좋은 강의 제공해 주셔서 감사합니다. 화면 클릭 이벤트 처리 - findViewById, Toast 이 강의 까지 듣고 핸드폰으로 실행을 했는데요 (가상 단말로 안하고 핸드폰으로 ) Bts_lecture 앱을 중지하였습니다. 라고 뜨고 실행이 안되는데 해결 방법이 있을까요?? 핸드폰 문제인 줄 알고 다른 핸드폰으로도 해보았는데 똑같은 메세지가 뜹니다. (예전에 다른 수업을 듣고 만든 적 있었는데 그건 잘 실행이 됩니다. 핸드폰 문제는 아닌 것 같아요)
-
미해결[2026년 출제기준] 웹디자인개발기능사 실기시험 완벽 가이드
시험때 공지사항 말줄임
시험때 공지사항이 만약에 세로 최종본 c타입에서처럼 내용이 길경우에 제공텍스트중에 임의로 잘라서 하면 감정인가요?
-
해결됨설계독학맛비's 실전 FPGA를 이용한 HW 가속기 설계 (LED 제어부터 Fully Connected Layer 가속기 설계까지)
delay 질문.
안녕하세요 맛비님! data mover bram... 정말 어려웠습니다.. 하하.. 궁금한 점이 생겨서 질문 드립니다! delay가 생기는 지점(?) 이라고 표현을 해야할까요? 잘 모르겠지만.. 저장공간에서 값을 읽거나 쓰게되는 것 처럼 사용하게 될 때 delay는 무조건 생기게 되는건가요?? 곱셈 코어에서도 값을 읽어오고 계산을 하는 결과값을 확인하는 부분에 delay 가 생기는 것을 확인했는데 제가 이해한게 맞을까요?? 그리고 현업에서 delay 가 생길 수 있는 예시로는 또 뭐가 있을까요?? delay 의 가장 큰 이유? 원인? 도 궁금합니다.. 질문이 너무 많은가요?? ㅠㅠ 항상 감사드립니다. 추가적으로 결과 값이 concatenation 된다고 하면 결과 값이 111 123 이렇게 나온다면 저장 될때는 111123 으로 저장되는게 맞을까요??
-
미해결스프링 핵심 원리 - 기본편
@AllArgsConstructor, @RequiredArgsConstructor 사용금지를 권하는 글을 보았습니다.
https://kwonnam.pe.kr/wiki/java/lombok/pitfall파라미터 선언 순서 변경에 따른 생성자에서 파라미터 순서로 변화로 인해 발생할 수 있는 치명적인 오류를 사전에 방지하기 위해 @AllArgsConstructor, @RequiredArgsConstructor 의 사용은 자제하는 것을 권하던데Spring 프로젝트에서도 마찬가지로 적용되는 경우가 있을까요?예를 들어, 컨테이너 안에 같은타입의 빈이 여러개인 충돌 문제가 아니라하나의 클라이언트에서 같은 타입의 의존성을 두개 주입을 요구할 경우가 있을까요? private final DiscountPolicy discountPolicyFirst; private final DiscountPolicy discountPolicySecond; 이렇게 될 경우, 순서가 중요할거 같지만@Qulifier 같은 방식을 사용하지 않으면 같은 의존성만 주입될거 같고@Qulifier를 사용하면 의존성을 요구하는 필드의 순서 문제가 자동으로 해결될거 같기도 하구요아니면 현실적으로 이런 방식을 쓰기보단Map이나 List를 사용하여 자체적으로 로직을 만들어 상속하는 같은 계열의 빈을모두 가져와서 선택적으로 여러개의 의존성을 사용하는게 맞을까요?추가적으로 궁금한 점이 있습니다.@Qualifier를 사용하여 같은 타입의 빈이 두개 이상 있을때 선택할 수 있다고 하셨는데@RequiredArgsConstructor를 사용한 경우엔 자동으로 생성자를 만들어줘서 @Qualifier를 사용하여 의존성을 주입할 수 없는건가요?
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
mainPosts
제로초님 reducer 부분에서 변수이름으로 사용한 mainPosts 는 꼭 변수명이 mainPosts여야 하나요?? case ADD_COMMENT_SUCCESS: { ~나머지 코드들~ const mainPosts = [...state.mainPosts]; //이부분이요 mainPosts[postIndex] = posts; return { ...state, mainPosts, commentIsBeingAdded: false, commentIsAdded: true, }; } ㅇ
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
영속성 컨텍스트 질문
이전 자바 ORM 표준 JPA - 기본 강의에서 EntityManagerFactory(이하 emf) 와 EntityManager(이하 em) 가 1:N로 관리되며, 당시에 제가 이해하기론 emf가 트랜잭션당 하나의 em을 생성해서 작동하는 것으로 이해했는데, 이번 강의에서보니 emf 인스턴스를 생성하지 않더라고요. 그래서 @PersistenceContext 어노테이션에서 가상의 emf를 생성해서 em을 관리해주나 싶어서 대충 찾아봤는데 @PersistenceUnit 이라는 어노테이션이 별도로 있고 이 어노테이션이 emf에 많이 붙히더라고요. 더 자세하게 찾아볼수있으면 좋겠지만, 아직 문서보는 능력이 부족해서 이해가 힘들었습니다. 이번 예제에서 emf가 어떻게 만들어지는지 em은 반드시 emf가 필요한건 아닌지 궁금합니다. 그리고 찾아보면서 별도로 궁금한게 생겼는데, Spring이 기본적으로 싱글톤 전략을 사용해서 속성값을 공유하므로 쓰레드간의 공유 문제가 em에서 발생할수 있다고 하더라고요. 그래서 @PersistenceContext 어노테이션이 em을 프록시 객체로 만들어서 이 문제를 해결한다는 내용을 봤습니다. 그런데 emf가 em과 1:N 관계라면 em은 쓰레드 동시 공유 문제를 신경써야하지만 emf는 그럴 필요가 없나요?