[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 예 [질문 내용] 3주 정도만에 강의 들어가서 실습하려 하는데 원래 빨간 줄이 생겨 실행해보니 위 에러 코드가 떴습니다. 구글링 하여 Gradle Refresh 첫번째 방법으로 라이브러리가 꼬인 경우가 많으니 Gradle Refresh를 해준다. (IntelliJ 오른쪽 Gradle Tab -> refresh모양 버튼 클릭) Project Structure → Problem build가 깨지면 해당 페이지에 Problem이 표시된다. 라이브러리가 꼬인 케이스인데 여기서 수동으로 삭제해줄 수도 있다. (상위 File 탭 -> Project Structure -> Problem) File → Cache 삭제 IntelliJ Cache를 삭제해보자. (상위 File 탭 -> Invalidate Cache ~ 클릭) 위 3가지 방식을 활용하여 고쳐보려고 하였는데요 빨강 줄은 사라지고 오류 코드는 보이지 않게 되었지만 스프링 부트가 실행이 안되는 것 같습니다(톰캣 서버가 열리지 않습니다) 이유가 너무 궁금합니다.. 알려주시면 감사하겠습니다 수정) 코드의 차이는 전혀 없다고 자신하며 오랜만에 들어왔기에 인텔리제이 업데이트를 한 번 한 것 같습니다. 그 이유 때문일 수도 있을까? 라는 의문이 있지만 답변에 도움이 될 수 있게 추가하였습니다
강사님 안녕하세요 항상 상세한 답변을 주시는 점 감사드립니다. 아래의 코드를 보고 질문을 받아주시면 감사하겠습니다. import './App.css'; import Counter from './Counter'; import Container from './Container'; import {useEffect, useState} from "react"; import MyHeader from './MyHeader.js' export default function App() { const [state, setState] = useState({ a: 0, b: 0 }); const onClick = () => { const c=10; setState(c=>({ a: c + 1 })); }; return ( <div className="App"> <div>a : {state.a}</div> <button onClick={onClick}>증가</button> </div> ); } 1번째 경우 원래는 아래의 코드처럼 setState의 콜백함수의 인자에 state를 넣는 게 맞습니다. const c=10; setState(state=>({ a: c + 1 // 이 줄의 c는 1번째 줄의 c를 가리키므로 a: 10 + 1 과 같습니다. })); 이때는 a:c+1에서의 c가 함수 밖에 선언된 맨위의 const c= 10의 c를 가리킵니다. 2번째 경우 일부러 setState의 콜백함수의 인자를 state가 아닌 c로 적어봤습니다. const c=10; setState(c=>({ //이 부분 변경 state 를 지우고 c로 a: c + 1 // 이 줄에서의 c는 1번째 줄의 c를 가리키지 않습니다. })); 그러자 a: c + 1 에서의 c는 1번째 줄의 c가 아닌, 콜백함수 인자로 들어간 2번째 줄의 c를 가리킵니다. 그래서 변수의 스코프를 공부하고 싶어서 조언을 구하고 싶습니다. 1번째 질문을 드립니다. 변수가 const, let, var 인지에 따라서 스코프가 다른 것으로 아는데 콜백함수의 인자로 들어간 변수는 const인지 let인지, var 인지 질문드리고 싶습니다. 2번째 질문을 드립니다. 이 부분에 대해 학습하면 좋을 자료 링크를 추천해주시면 감사하겠습니다. 저도 현재 변수 스코프에 대해 다시 공부하는 중입니다. 3번째 질문을 드립니다. const c=10; setState(c=>({ //이 부분 변경 state 를 지우고 c로 a: c + 1 // 이 줄에서의 c는 1번째 줄의 c를 가리키지 않습니다. })); 에서 2번째 줄의 콜백함수 인자의 c는 1번째 줄의 c를 가리키지 못하는 이유에 대해 질문드리고 싶습니다. 4번째 질문을 드립니다. const c=10; setState(state=>({ //이 부분 변경 state 를 지우고 c로 a: c + 1 // 이 줄에서의 c는 1번째 줄의 c를 가리키지 않습니다. })); 3번째 줄의 c는 1번째 줄의 c를 가리킬 수 있는 이유에 대해 질문드리고 싶습니다 감사합니다.
안녕하세요 redis-serve 실행까지는 잘되는데 vsCode 에서 yarn test 만 하면 꼭 아래와 같은 에러가 발생합니다. 기본포트로 할때는 되다가 6380 포트로 바꾼이후로 잘안되고 redis 에서도 바뀐포트로 연결하고 비밀번호까지 쳤는데 아래와 같은 에러가 발생합니다. 그리고 제소스가 에러가 나서 제공해주신 express 소스를 압축을 풀어도 같은 에러가 발생을 합니다. 혹시몰라 build 파일을 삭제하고 재빌드후 다시 켜도 아래와 같은 에러가 나는데 혹시 이유를 알 수 있을까요? ● POST /messages › responds with a success message Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) at RedisSocket.<anonymous> (node_modules/@redis/client/dist/lib/client/index.js:396:14) at RedisSocket._RedisSocket_connect (node_modules/@redis/client/dist/lib/client/socket.js:166:18) at Commander.connect (node_modules/@redis/client/dist/lib/client/index.js:184:9) ● GET /messages › responds with all messages Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) at RedisSocket.<anonymous> (node_modules/@redis/client/dist/lib/client/index.js:396:14) at RedisSocket._RedisSocket_connect (node_modules/@redis/client/dist/lib/client/socket.js:166:18) at Commander.connect (node_modules/@redis/client/dist/lib/client/index.js:184:9) ● Test suite failed to run thrown: "Exceeded timeout of 5000 ms for a hook. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 18 | }); 19 | > 20 | afterAll(async () => { | ^ 21 | await client.flushDb(); 22 | await client.quit(); 23 | }); at Object.<anonymous> (app/index.test.ts:20:1) Test Suites: 1 failed, 1 total FAIL app/index.test.ts (101.064 s) ● POST /messages › responds with a success message Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) at RedisSocket.<anonymous> (node_modules/@redis/client/dist/lib/client/index.js:396:14) at RedisSocket._RedisSocket_connect (node_modules/@redis/client/dist/lib/client/socket.js:166:18) at Commander.connect (node_modules/@redis/client/dist/lib/client/index.js:184:9) ● GET /messages › responds with all messages Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) FAIL app/index.test.ts (100.278 s) ● POST /messages › responds with a success message Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) at RedisSocket.<anonymous> (node_modules/@redis/client/dist/lib/client/index.js:396:14) at RedisSocket._RedisSocket_connect (node_modules/@redis/client/dist/lib/client/socket.js:166:18) at Commander.connect (node_modules/@redis/client/dist/lib/client/index.js:184:9) ● GET /messages › responds with all messages Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) at RedisSocket.<anonymous> (node_modules/@redis/client/dist/lib/client/index.js:396:14) at RedisSocket._RedisSocket_connect (node_modules/@redis/client/dist/lib/client/socket.js:166:18) at Commander.connect (node_modules/@redis/client/dist/lib/client/index.js:184:9) ● Test suite failed to run thrown: "Exceeded timeout of 100000 ms for a hook. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 18 | }); 19 | > 20 | afterAll(async () => { | ^ 21 | await client.flushDb(); 22 | await client.quit(); 23 | }, 100000); at Object.<anonymous> (app/index.test.ts:20:1)
답변들이 외부 링크만 알려주고 불친절하다고 생각해 직접 찾아보고 적어봅니다. 시작한지 1주차라 많이 틀릴수도있습니당 일단 이건 제 폴더 화면이구요 ch1.cpp가 메인함수이고, 리소스에 add함수(헤더파일 및 바디)를 넣었습니다. 이제 각각에 main.cpp(저는 ch1.cpp라고함) , add.cpp , add.h입니다. 여기서 명령어를 보통 g++ -std=c++14 -Wall ch1.cpp -o test.out 이렇게 치실텐데 이러면 오류나면서 실행이 되지않죠 왜 안될까요? 링커라는게 각각의 cpp파일들을 컴파일한 후에 obj파일로 만들고 이것들을 실행이 가능한 하나의 exe파일 만드는 과정중에 하나인데 우리는 지금 main함수 cpp파일 하나만 컴파일 해놓은 겁니다. 즉 컴파일러가 exe파일로 만들려는데 main.cpp이 main.o로 만들어진거는 확인이 되었는데 add.cpp파일이 컴파일 안되어있으니까 이 링커과정에 문제가 생기는거죠. 해결방법은 간단합니다 add.cpp파일도 컴파일 해주면 대여g++ -std=c++14 -Wall ch1.cpp add.cpp -o test.out -> 해석하면 g++컴파일러 사용해서 ch1.cpp 파일 컴파일하고 add.cpp파일도 컴파일해서 test.out이라는 실행파일 만들어줘 입니다. 이러면 이제 정상적으로 실행이됩니다. cpp배운지 일주일차라 틀린 부분이 있을수도 있어요. 그래도 실행되죠?
안녕하세요! 전기공학에서 제어를 전공하고 있는 학생입니다. 제가 CAN통신에 대해서 이전까지 직접적으로 배우거나 공부하고 있진 않았지만 이 강의를 통해 자세히 알게 되었고 직무에서 필요한 영역이란 것도 알게 되었습니다. 저는 자동차 관련 회사에서 일하는게 목표인데 어떤 부분을 더 공부해야 하고 전기 제어 관련 연구원이나 사원들도 채용을 많이 하는지 궁금합니다!
강의 보면서 f12에 개발자 도구 켜서 const str = "이 _ 문자열을 _ 이렇게 _ 나누어주었으면 _ 좋겠어."; String.prototype[Symbol.split] = function (string) { let result = ""; let residue = string; let index = 0; do { index = residue.indexOf(this); if (index <= -1) { break; } result += residue.substr(0, index) + "/"; residue = residue.substr(index + this.length); } while (true); result += residue; return result; }; console.log(str.split(" _ ")); 해당 코드 실행 시키면 인프런 팅깁니다. 조심하세요 ㅋㅋ
5회 작업형2 기출문제에서 원핫 인코딩을 train = pd.get_dummies ( train ) test = pd.get_dummies ( test ) 이렇게 하셨는데 앞에서 강의할 때는 train = pd.get_dummies ( train, columns=cols ) test = pd.get_dummies ( test, columns=cols ) 이렇게 했던것으로 기억합니다. 이 두가지 방법의 차이에 대해서 알려주시면 감사하겠습니다!
팝업창에서 하위 ui item 자식들을 삭제하고 생성하고를 반복하다보면 어느순간 삭제된 오브젝트를 참조했다고 Pool.OnGet에서 오류가 출력됩니다. void OnGet(GameObject go)에 go는 null값이들어오는데 이유를 모르겠습니다. 버튼을 누르면 모든자식을 DestroyChilds를 통해 삭제하고 makesubitem을 통해서 다시 여러개를 출력합니다. 어떻게 null값이 나오는지 모르겠습니다. 오류내용은 아래와같습니다, MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. Pool.OnGet (UnityEngine.GameObject go)
[기타 질문] 선생님 3분 20초 쯤에, FORMAT_DATE('%Y', date)에 대한 주석 문에 대해서 int형이 아닌 String형으로 표시를 해야 할 것 같습니다. date between '2022-01-01' and '2022-12-31' -- 2022 -- date between '2022-01-01' and '2022-12-31' EXTRACT(YEAR FROM date) = 2022 -- 2022 -- EXTRACT(YEAR FROM date) -> int로 나온다. -- EXTRACT(날짜 단위 from 날짜 필드) FORMAT_DATE('%Y', date) = '2022' -- 2022 선생님께서 알려주신 3가지 방법으로 모두 적용해보니, SELECT EXTRACT(YEAR FROM date), FORMAT_DATE('%Y', date) FROM project.daily_play WHERE (EXTRACT(YEAR FROM date) = 2023 AND mode = 3) OR (EXTRACT(YEAR FROM date) = 2022 AND mode = 4) 이런 식으로 나오더라구요. EXTRACT의 반환 값은 int형(숫자형)이 나오고, FORMAT_DATE이나 FORMAT_DATETIME의 경우 반환 값은 String 형태로 나오는 것 같습니다.