묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결홍정모의 따라하며 배우는 C언어
부호 있는 정수, 부호 없는 정수
예를 들어 8비트 2진수1010 1110 이 있을 때컴퓨터가 어떻게 맨 앞 비트가 부호비트인지 아닌지 아는 것인가요?양수 174가 될수도 있고 음수 -46이 될 수 있는데 컴퓨터가 어떻게 그것을 구분하는 것인지 궁금합니다..
-
해결됨AWS 배포 완벽가이드 (feat. Lightsail, Docker, ECS)
redis Unhandled error. ([ErrorReply: ERR wrong number of arguments for 'auth' command]) 에러
안녕하세요 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)
-
미해결홍정모의 따라하며 배우는 C++
맥에서 Makfefile 사용하지 않고, vscode를 사용하여 헤더파일 포함해 실행시키는 법
답변들이 외부 링크만 알려주고 불친절하다고 생각해 직접 찾아보고 적어봅니다. 시작한지 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배운지 일주일차라 틀린 부분이 있을수도 있어요. 그래도 실행되죠?
-
해결됨Javascript ES6+ 제대로 알아보기 - 중급
궁금한게 있어서 질문 남겨봅니다!
희안하게 set에서는 forEach를 사용 할 수 있는데, map이랑 filter, reduce등은 안되더라고요. forEach만 되는 이유가 혹시 따로 있는건가요?
-
미해결[리뉴얼] 코딩자율학습 제로초의 자바스크립트 입문
쿵쿵따 만들엇는데 갠찬은가요 ??
샘 직접 만들어 봣습니다 며칠 고민하면서 근데 공지에는 코드전체를 올리지말라햇는데 피드백을 받으려면 올릴수박에 없어서요 만든게 어떤지 평가나 피드백좀주실수잇나여 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> </style> </head> <body> <div><span id="order">1</span>번쨰 쿵쿵따 참가자</div> <div>제시어:<span id="word"></span></div> <input type="text"> <button>입력</button> <script> const number = Number(prompt('몇명인지 입력을 받는다:')); const $input = document.querySelector('input'); // 인풋울 자스로 기능을 넣어야 하기떄문이다 const $button = document.querySelector('button'); // 버튼 을 자스기능으로 넣어야 하기떄문 const $order = document.querySelector('#order'); // 몇번쨰인지 자스기능으로 값을 조절해야하기떄문 이다 const $word = document.querySelector('#word'); // 제시어의 저장및 잇는지 확인 하기 위해 자스기능으로 넣어야 하기떄문이다; let word; let newWord; // 인풋에 적혓을떄 세글자인지 판단한다 // 그와반대로 버튼에 눌럿을떄 이벤트가 발생되면 // 제시어값이 잇는채로 버튼이 눌리면 #word와 끝자리가 맞는지도 확인 작업을 해야하고 // const onClick = () => //버튼을 눌럿을떄 { if(newWord.length===3) // 버튼을 누르고 세글자 일떄 { if(!word) // 세글자이면서 제시어가 비어잇다 첫사람이다 { //제시어를 입력한 상태로 그값을 저장 해주어야 한다 word=newWord; $word.textContent = word; // word 변수에 담긴 내용이 $word라는 HTML 요소의 텍스트 내용으로 들어가게 될 거예요. // 그래서 워드 안에 입력된 뉴월드 단어값이 $word. 에 저장이 되서 제시어가 저장이 되는원리이다 $input.value =''; const order= Number($order.textContent); if(order + 1 >number) // 세글자이면서 제시어가 비어잇으면서 전체보다 크면 // 크면 1로초기화 시켜야 하고 { $order.textContent=1; } else // 세글자이면서 제시어가 비어잇으면서 전체보다 작으면 ; { $order.textContent=order+1; } } else //세글자이면서 제시어가 잇는 즉 이미 한명이 시작한단계 { if(word[word.length-1]===newWord[0]) // 세글자이면서 제시어가 잇으며 마지막 단어와 시작단어가 같을떄 //둘다 값이 같을떄 제시어를 받는다 { word=newWord; /// 워드에 인풋 입력값을 저장해놈 단어를 저장 해둠 $word.textContent = word; // 이 해석을 연구해봐야 한다; $input.value =''; const order= Number($order.textContent); if(order + 1 >number) // 세글자이면서 제시어가 비어잇으면서 전체보다 크면 // 크면 1로초기화 시켜야 하고 { $order.textContent=1; } else // 세글자이면서 제시어가 비어잇으면서 전체보다 작으면 ; { $order.textContent=order+1; } } else // 자리수 값이 다를떄 올바르지 않는단어임을 알려준다 { alert('입력을 다시하십시오 올바르지않는단어입니다'); } } } // 세글자 일떄 실행 else // 버튼을 눌럿을대 세글자가 아닐떄 들어가지지도 못하게 하면된다 { alert('세글자가 아니므로 다시 세글자를 입력해주세요'); } } const writing =(event) => // 인풋 글자입력란 이벤트 리스너와 연결된 함수 { newWord= event.target.value; // 인풋의 값이입력되면 저장 할껏 뉴월드에 ; } $input.addEventListener('input',writing); // 인푹에 이벤트 발생됫을떄 함수로 연결해서 단어를 저장한다; $button.addEventListener('click',onClick); // 버튼 이벤트 </script> </body> </html><!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> </style> </head> <body> <div><span id="order">1</span>번쨰 쿵쿵따 참가자</div> <div>제시어:<span id="word"></span></div> <input type="text"> <button>입력</button> <script> const number = Number(prompt('몇명인지 입력을 받는다:')); const $input = document.querySelector('input'); // 인풋울 자스로 기능을 넣어야 하기떄문이다 const $button = document.querySelector('button'); // 버튼 을 자스기능으로 넣어야 하기떄문 const $order = document.querySelector('#order'); // 몇번쨰인지 자스기능으로 값을 조절해야하기떄문 이다 const $word = document.querySelector('#word'); // 제시어의 저장및 잇는지 확인 하기 위해 자스기능으로 넣어야 하기떄문이다; let word; let newWord; // 인풋에 적혓을떄 세글자인지 판단한다 // 그와반대로 버튼에 눌럿을떄 이벤트가 발생되면 // 제시어값이 잇는채로 버튼이 눌리면 #word와 끝자리가 맞는지도 확인 작업을 해야하고 // const onClick = () => //버튼을 눌럿을떄 { if(newWord.length===3) // 버튼을 누르고 세글자 일떄 { if(!word) // 세글자이면서 제시어가 비어잇다 첫사람이다 { //제시어를 입력한 상태로 그값을 저장 해주어야 한다 word=newWord; $word.textContent = word; // word 변수에 담긴 내용이 $word라는 HTML 요소의 텍스트 내용으로 들어가게 될 거예요. // 그래서 워드 안에 입력된 뉴월드 단어값이 $word. 에 저장이 되서 제시어가 저장이 되는원리이다 $input.value =''; const order= Number($order.textContent); if(order + 1 >number) // 세글자이면서 제시어가 비어잇으면서 전체보다 크면 // 크면 1로초기화 시켜야 하고 { $order.textContent=1; } else // 세글자이면서 제시어가 비어잇으면서 전체보다 작으면 ; { $order.textContent=order+1; } } else //세글자이면서 제시어가 잇는 즉 이미 한명이 시작한단계 { if(word[word.length-1]===newWord[0]) // 세글자이면서 제시어가 잇으며 마지막 단어와 시작단어가 같을떄 //둘다 값이 같을떄 제시어를 받는다 { word=newWord; /// 워드에 인풋 입력값을 저장해놈 단어를 저장 해둠 $word.textContent = word; // 이 해석을 연구해봐야 한다; $input.value =''; const order= Number($order.textContent); if(order + 1 >number) // 세글자이면서 제시어가 비어잇으면서 전체보다 크면 // 크면 1로초기화 시켜야 하고 { $order.textContent=1; } else // 세글자이면서 제시어가 비어잇으면서 전체보다 작으면 ; { $order.textContent=order+1; } } else // 자리수 값이 다를떄 올바르지 않는단어임을 알려준다 { alert('입력을 다시하십시오 올바르지않는단어입니다'); } } } // 세글자 일떄 실행 else // 버튼을 눌럿을대 세글자가 아닐떄 들어가지지도 못하게 하면된다 { alert('세글자가 아니므로 다시 세글자를 입력해주세요'); } } const writing =(event) => // 인풋 글자입력란 이벤트 리스너와 연결된 함수 { newWord= event.target.value; // 인풋의 값이입력되면 저장 할껏 뉴월드에 ; } $input.addEventListener('input',writing); // 인푹에 이벤트 발생됫을떄 함수로 연결해서 단어를 저장한다; $button.addEventListener('click',onClick); // 버튼 이벤트 </script> </body> </html>
-
해결됨Kevin의 알기 쉬운 Spring Reactive Web Applications: Reactor 1부
Sinks multicast의 subscribe에 질문있습니다.
안녕하세요.Sinks multicast 예제에서 질문이 있습니다. 질문1Many<String> sinks = Sinks.many().multicast().onBackpressureBuffer(); Flux<String> flux = sinks.asFlux(); sinks.emitNext("1", EmitFailureHandler.FAIL_FAST); sinks.emitNext("2", EmitFailureHandler.FAIL_FAST); flux.subscribe(data -> System.out.println("Subscribe1 : " + data)); flux.subscribe(data -> System.out.println("Subscribe2 : " + data)); sinks.emitNext("3", EmitFailureHandler.FAIL_FAST);위 코드를 실행하면 결과는 아래와 같이 출력됩니다.Subscribe1 : 1Subscribe1 : 2Subscribe1 : 3Subscribe2 : 3강사님이 말씀하신대로면 Subscribe1 : 1Subscribe1 : 2Subscribe2 : 1Subscribe2 : 2Subscribe1 : 3Subscribe2 : 3이렇게 동작될것같은데 다르게 출력되어 질문올립니다. 질문2sinks.emitNext("3", EmitFailureHandler.FAIL_FAST);마지막 emitNext는 2개의 subscribe()가 동작이되고 다음에 동작되는데 어떻게 subscribe를 할 수 있는걸까요?
-
해결됨스프링부트 시큐리티 & JWT 강의
JwtAuthorizationFilter에서 오류가 뜹니다.
안녕하세요.. 저는 spring legacy 로 jwt를 구현했습니다.로그인 기능까지는 되었는데 인증과정에서 질문이 있습니다.@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { System.out.println("인증이나 권한이 필요한 주소 요청이 됨."); String header = request.getHeader(JwtProperties.HEADER_STRING); System.out.println("jwtHeader : " + header); // header 유무 확인 if (header == null || !header.startsWith(JwtProperties.TOKEN_PREFIX)) { chain.doFilter(request, response); // 필터를 타겟에 넘겨버리고 리턴 return; } // JWT 토큰 검증 String token = request.getHeader(JwtProperties.HEADER_STRING) .replace(JwtProperties.TOKEN_PREFIX, ""); System.out.println(token); String username = JWT.require(Algorithm.HMAC256(JwtProperties.SECRET)).build() .verify(token).getClaim("username").asString(); System.out.println("토큰 검증 완료");위의 코드는 JwtAuthorizationFilter에 있는 doFilterInternal 입니다.header 까지는 잘 들어오는데 알고리즘이 자꾸 맞지 않는다고 합니다.. 포스트맨으로 테스트할 때 login 후 header 값을 복사해 인증이 필요한 페이지에 접근할 때 header에 넣어주었습니다.. 제가 뭘 잘못한 건지 잘 모르겠습니다...ㅠㅠ
-
미해결CAN 통신 - 자동차 신입이 알아야 할 모든 것
자동차 관련 회사를 위한 준비
안녕하세요! 전기공학에서 제어를 전공하고 있는 학생입니다. 제가 CAN통신에 대해서 이전까지 직접적으로 배우거나 공부하고 있진 않았지만 이 강의를 통해 자세히 알게 되었고 직무에서 필요한 영역이란 것도 알게 되었습니다. 저는 자동차 관련 회사에서 일하는게 목표인데 어떤 부분을 더 공부해야 하고 전기 제어 관련 연구원이나 사원들도 채용을 많이 하는지 궁금합니다!
-
해결됨독하게 시작하는 C 프로그래밍
표준입출력 강의를 마치고 질문을 드립니다
printf 함수 같은 경우에는 데이터 Size를 정하지 않고, 어디에 저장 될지를 지정 하지도 않는데,Printf 함수는_getch() or_getche() 와같은 Non buffered I/O같은 방식인가요???
-
해결됨스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
hello=??, utf-8로 변경해도 안되면...
기본 언어는 ko로 되어있고인코딩은 3군데 모두 utf-8로 변경하고인텔리제이를 아예 껐다가 키니까 되는거 같아요
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
newaccessToken 질문드립니다
만약에 지금 발급된 accessToken 이 만료되지 않은 상황이라면 해당 강의에서의 aaa.toPromise().then((newAccessToekn) =>{}) 함수 실행시에 newAccessToken 이 발급되지 않는 걸까요?
-
미해결Javascript ES6+ 제대로 알아보기 - 중급
엌ㅋㅋ 인프런에 개발자 도구 켜서 console에 하면
강의 보면서 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(" _ "));해당 코드 실행 시키면 인프런 팅깁니다. 조심하세요 ㅋㅋ
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
원핫인코딩에 관해서 질문이 있습니다!
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)이렇게 했던것으로 기억합니다.이 두가지 방법의 차이에 대해서 알려주시면 감사하겠습니다!
-
미해결[라이브 멘토링] 유니티 뱀파이어 서바이벌 장르 모작
PoolManager Pool.OnGet에러질문드립니다.
팝업창에서 하위 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)
-
해결됨[SQL Quest] 실전 문제 풀이로 SQL 역량 강화 하기 (Basic)
3분 20초 FORMAT_DATE 반환 타입에 관하여
[기타 질문]선생님 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 형태로 나오는 것 같습니다.
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 챗봇 사이트 만들기
dialogflow 줄바꿈
dialogflow에서 작성한 text reaponse에서 줄바꿈은 shift+enter로 무사히 되어있고, postman으로 확인했을 때도 되어있는데요노드리액트로 만든 localhost페이지에서는 자꾸 줄바꿈이 안되고 통째로 떠요,,왜 이럴까요ㅠ
-
미해결[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
탭 간 상태 유지 관련 하여 문의 드립니다.
홈 리스트 화면 중간 정도 보다가 음식 탭으로 이동 해서 리스트 스크롤 후에 다시 홈 화면으로 탭 하면 홈 리스트가 처음 부터 보여 집니다. 음식 탭으로 이동 해도 처음부터 보여지는데 상태 유지 할 수 있는 방법에는 어떤게 있는지 궁금 해서 문의 드립니다. 현재 Go router 강의 중간 정도 진행했습니다.감사합니다.
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
시간초과
우선 순위 큐를 쓰는 대신에 보석을 넣는 벡터(J)에서 erase로 가방에 넣을 수 있는 보석은 바로 제거하는 알고리즘으로 작성하였는데 시간초과가 뜨네요.. erase를 사용해서 시간복잡도가 높아진 것일까요? 이런 방법으로는 문제를 풀 수 없을까요?http://boj.kr/2136c28d9e844ba1b1d04a5e369dada0 또한 j를 초기화 할 때 for문 안에서 초기화 해야하는 것 아닌가요? 가방 크기가 작아 못 들어간 보석도 다시 처음부터 탐색해야하니까요. 근데 for 문안에서 j를 초기화 하면 메모리 초과가 뜨네용 ㅜㅜ #include<bits/stdc++.h>using namespace std; typedef long long ll;ll n, k, ret, temp1, temp;int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL); cin >> n >> k; vector<pair<ll,ll>> v(n); vector<ll> vv(k); for(int i = 0; i < n; i++){ cin >> v[i].first >> v[i].second; } for(int i = 0; i < k; i++) cin >> vv[i]; sort(v.begin(), v.end()); sort(vv.begin(), vv.end()); priority_queue<ll> pq; // 여기 자리에 있던 int j = 0;를 아래로 옮겼습니다. for(int i = 0; i < k; i++){ int j = 0; while(j < n && v[j].first <= vv[i]) pq.push(v[j++].second); if(pq.size()){ ret += pq.top(); pq.pop(); } } cout << ret << "\n"; return 0;}
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기
npm run dev 동작에러납니다...
PS C:\Users\Desktop\boilerplate-mern-stack> yarn dev yarn run v1.22.19 $ concurrently "npm run backend" "npm run start --prefix client" [1] [1] > client@0.1.0 start [1] > react-scripts start [1] [0] [0] > react-boiler-plate@1.0.0 backend [0] > nodemon server/index.js [0] [0] [nodemon] 1.19.4 [0] [nodemon] to restart at any time, enter `rs` [0] [nodemon] watching dir(s): *.* [0] [nodemon] watching extensions: js,mjs,json [0] [nodemon] starting `node server/index.js` [0] Server Listening on 5000 [0] MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string. [0] at Connection.openUri (C:\Users\Desktop\boilerplate-mern-stack\node_modules\mongoose\lib\connection.js:694:11) [0] at C:\Users\Desktop\boilerplate-mern-stack\node_modules\mongoose\lib\index.js:351:10 [0] at C:\Users\Desktop\boilerplate-mern-stack\node_modules\mongoose\lib\helpers\promiseOrCallback.js:32:5 [0] at new Promise (<anonymous>) [0] at promiseOrCallback (C:\Users\Desktop\boilerplate-mern-stack\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:10) [0] at Mongoose._promiseOrCallback (C:\Users\Desktop\boilerplate-mern-stack\node_modules\mongoose\lib\index.js:1149:10) [0] at Mongoose.connect (C:\Users\Desktop\boilerplate-mern-stack\node_modules\mongoose\lib\index.js:350:20) [0] at Object.<anonymous> (C:\Users\Desktop\boilerplate-mern-stack\server\index.js:19:4) [0] at Module._compile (node:internal/modules/cjs/loader:1233:14) [0] at Module._extensions..js (node:internal/modules/cjs/loader:1287:10) [0] at Module.load (node:internal/modules/cjs/loader:1091:32) [0] at Module._load (node:internal/modules/cjs/loader:938:12) [0] at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) [0] at node:internal/main/run_main_module:23:47 [1] [HPM] Proxy created: / -> http://localhost:5000 [1] i 「wds」: Project is running at http://192.999.111.116/ [1] i 「wds」: webpack output is served from [1] i 「wds」: Content not from webpack is served from C:\Users\Desktop\boilerplate-mern-stack\client\public [1] i 「wds」: 404s will fallback to / [1] Starting the development server... [1] [1] Error: error:0308010C:digital envelope routines::unsupported [1] at new Hash (node:internal/crypto/hash:69:19) [1] at Object.createHash (node:crypto:138:10) [1] at module.exports (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\util\createHash.js:135:53) [1] at NormalModule._initBuildHash (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:417:16) [1] at handleParseError (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:471:10) [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:503:5 [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:358:12 [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\loader-runner\lib\LoaderRunner.js:373:3 [1] at iterateNormalLoaders (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\loader-runner\lib\LoaderRunner.js:214:10) [1] at iterateNormalLoaders (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\loader-runner\lib\LoaderRunner.js:221:10) [1] C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\react-scripts\scripts\start.js:19 [1] throw err; [1] ^ [1] [1] Error: error:0308010C:digital envelope routines::unsupported [1] at new Hash (node:internal/crypto/hash:69:19) [1] at Object.createHash (node:crypto:138:10) [1] at module.exports (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\util\createHash.js:135:53) [1] at NormalModule._initBuildHash (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:417:16) [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:452:10 [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\webpack\lib\NormalModule.js:323:13 [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\loader-runner\lib\LoaderRunner.js:367:11 [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\loader-runner\lib\LoaderRunner.js:233:18 [1] at context.callback (C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\loader-runner\lib\LoaderRunner.js:111:13) [1] at C:\Users\Desktop\boilerplate-mern-stack\client\node_modules\react-scripts\node_modules\babel-loader\lib\index.js:59:103 { [1] opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], [1] library: 'digital envelope routines', [1] reason: 'unsupported', [1] code: 'ERR_OSSL_EVP_UNSUPPORTED' [1] } [1] [1] Node.js v20.5.1 [1] npm run start --prefix client exited with code 1반나절 넘게 이 오류만 붙잡고 있었는데 해결이 안되네요...사이트에 연결할 수 없음연결이 재설정되었습니다.다음 방법을 시도해 보세요.연결 확인프록시 및 방화벽 확인Windows 네트워크 진단 프로그램 실행브라우저에서 위와 같이 뜨는데 이유가 뭘까요....
-
미해결[아파치 카프카 애플리케이션 프로그래밍] 개념부터 컨슈머, 프로듀서, 커넥트, 스트림즈까지!
커스텀 elasticsearch sink connector를 만들었는데 class를 찾지 못하고 있어요
{ "error_code": 500, "message": "Error trying to forward REST request: Failed to find any class that implements Connector and which name matches com.example.connector.kafka.ElasticsearchSinkConnector, available connectors are: PluginDesc{klass=class com.github.jcustenborder.kafka.connect.spooldir.SpoolDirCsvSourceConnector, name='com.github.jcustenborder.kafka.connect.spooldir.SpoolDirCsvSourceConnector', version='0.0.0.0', encodedVersion=0.0.0.0, type=source, typeName='source', location='file:/data01/connectors/spooldir_source/'}, PluginDesc{klass=class com.github.jcustenborder.kafka.connect.spooldir.SpoolDirJsonSourceConnector, name='com.github.jcustenborder.kafka.connect.spooldir.SpoolDirJsonSourceConnector', version='0.0.0.0', encodedVersion=0.0.0.0, type=source, typeName='source', location='file:/data01/connectors/spooldir_source/'}, PluginDesc{klass=class com.github.jcustenborder.kafka.connect.spooldir.SpoolDirLineDelimitedSourceConnector, name='com.github.jcustenborder.kafka.connect.spooldir.SpoolDirLineDelimitedSourceConnector', version='0.0.0.0', encodedVersion=0.0.0.0, type=source, typeName='source', location='file:/data01/connectors/spooldir_source/'}, PluginDesc{klass=class com.github.jcustenborder.kafka.connect.spooldir.SpoolDirSchemaLessJsonSourceConnector, name='com.github.jcustenborder.kafka.connect.spooldir.SpoolDirSchemaLessJsonSourceConnector', version='0.0.0.0', encodedVersion=0.0.0.0, type=source, typeName='source', location='file:/data01/connectors/spooldir_source/'}, PluginDesc{klass=class com.github.jcustenborder.kafka.connect.spooldir.elf.SpoolDirELFSourceConnector, name='com.github.jcustenborder.kafka.connect.spooldir.elf.SpoolDirELFSourceConnector', version='0.0.0.0', encodedVersion=0.0.0.0, type=source, typeName='source', location='file:/data01/connectors/spooldir_source/'}, PluginDesc{klass=class io.confluent.connect.elasticsearch.ElasticsearchSinkConnector, name='io.confluent.connect.elasticsearch.ElasticsearchSinkConnector', version='11.0.0', encodedVersion=11.0.0, type=sink, typeName='sink', location='file:/data01/connectors/elasticsearch_sink/'}, PluginDesc{klass=class io.debezium.connector.sqlserver.SqlServerConnector, name='io.debezium.connector.sqlserver.SqlServerConnector', version='1.7.1.Final', encodedVersion=1.7.1.Final, type=source, typeName='source', location='file:/data01/connectors/mssql_source/'}, PluginDesc{klass=class org.apache.kafka.connect.file.FileStreamSinkConnector, name='org.apache.kafka.connect.file.FileStreamSinkConnector', version='2.8.2', encodedVersion=2.8.2, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.file.FileStreamSourceConnector, name='org.apache.kafka.connect.file.FileStreamSourceConnector', version='2.8.2', encodedVersion=2.8.2, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorCheckpointConnector, name='org.apache.kafka.connect.mirror.MirrorCheckpointConnector', version='1', encodedVersion=1, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorHeartbeatConnector, name='org.apache.kafka.connect.mirror.MirrorHeartbeatConnector', version='1', encodedVersion=1, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.mirror.MirrorSourceConnector, name='org.apache.kafka.connect.mirror.MirrorSourceConnector', version='1', encodedVersion=1, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockConnector, name='org.apache.kafka.connect.tools.MockConnector', version='2.8.2', encodedVersion=2.8.2, type=connector, typeName='connector', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSinkConnector, name='org.apache.kafka.connect.tools.MockSinkConnector', version='2.8.2', encodedVersion=2.8.2, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSourceConnector, name='org.apache.kafka.connect.tools.MockSourceConnector', version='2.8.2', encodedVersion=2.8.2, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.SchemaSourceConnector, name='org.apache.kafka.connect.tools.SchemaSourceConnector', version='2.8.2', encodedVersion=2.8.2, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSinkConnector, name='org.apache.kafka.connect.tools.VerifiableSinkConnector', version='2.8.2', encodedVersion=2.8.2, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.VerifiableSourceConnector, name='org.apache.kafka.connect.tools.VerifiableSourceConnector', version='2.8.2', encodedVersion=2.8.2, type=source, typeName='source', location='classpath'}" }connector 등록 api를 날리면 이런 에러가 뜹니다.그런데 /connector-plugins request를 날리면 plugin으로 인식하고 있어요.SinkConnector를 상속한 클래스의 path도 맞는데 왜 동작하지 않는 건지 모르겠어요[ { "class": "com.example.connector.kafka.ElasticsearchSinkConnector", "type": "sink", "version": "1.0" }, { "class": "com.github.jcustenborder.kafka.connect.spooldir.SpoolDirCsvSourceConnector", "type": "source", "version": "0.0.0.0" }, { "class": "com.github.jcustenborder.kafka.connect.spooldir.SpoolDirJsonSourceConnector", "type": "source", "version": "0.0.0.0" }, { "class": "com.github.jcustenborder.kafka.connect.spooldir.SpoolDirLineDelimitedSourceConnector", "type": "source", "version": "0.0.0.0" }, { "class": "com.github.jcustenborder.kafka.connect.spooldir.SpoolDirSchemaLessJsonSourceConnector", "type": "source", "version": "0.0.0.0" }, { "class": "com.github.jcustenborder.kafka.connect.spooldir.elf.SpoolDirELFSourceConnector", "type": "source", "version": "0.0.0.0" }, { "class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector", "type": "sink", "version": "11.0.0" }, { "class": "io.debezium.connector.sqlserver.SqlServerConnector", "type": "source", "version": "1.8.1.Final" }, { "class": "org.apache.kafka.connect.file.FileStreamSinkConnector", "type": "sink", "version": "2.8.2" }, { "class": "org.apache.kafka.connect.file.FileStreamSourceConnector", "type": "source", "version": "2.8.2" }, { "class": "org.apache.kafka.connect.mirror.MirrorCheckpointConnector", "type": "source", "version": "1" }, { "class": "org.apache.kafka.connect.mirror.MirrorHeartbeatConnector", "type": "source", "version": "1" }, { "class": "org.apache.kafka.connect.mirror.MirrorSourceConnector", "type": "source", "version": "1" } ]로그를 봐도 커넥트 로그만 나오고 등록한 커넥터의 로그는 나오지 않는 것 같은데 혹시 카프카와 연결해서 커넥터를 ide에서 디버깅할 수 있는 방법이 있을까요?