묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[초급] 찍어먹자! 코틀린과 Spring Security + JWT로 회원가입 만들기
4.1강 마지막 회원가입 실행
모든 코드를 다 작성하고 db실행도 다 한 상태로 send룰 눌렀는데 이렇게 빈 실행화면이 뜨고 디비에 회원정보가 생기지 않습니다. 오탈자가 있나 살펴보았지만 도저히 찾지 못하였습니다.
-
미해결견고한 결제 시스템 구축
R2DBC 관련해서 질문 드립니다.
안녕하세요.강의 잘 듣고 있습니다.R2DBC로 실습 환경을 구축해주셨는데요. R2DBC 이용하면서 DatabaseClient 를 이용해주셨는데요.혹시 Jooq 를 이용안하신 이유가 있을까요?그리고 실무에서도 DatabaseClient 를 이용하시는지 궁금합니다. 추가로 DatabaseClient 를 사용시에 동적 쿼리를 어떻게 작성을 해야 하는지 팁 주시면 감사하겠습니다! (where 절 고정이 아닌 특정값이 있을 경우에만 where절 생성 이라던지 ㅎ ) 감사합니다!
-
미해결호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
collaboator로 초대받을 수 있을까요??
당연히 구글링 해보셨져? 원하는 결과를 못찾으셨나요? 어떤 검색어를 입력했는지 알려주세문제가 발생한 코드(프로젝트)를 Github에 올리시고 링크를 알려주세요.안녕하세요 호돌맨님.덕분에 강의 잘 듣고있습니다.깃헙 collaboator로 초대받을 수 있을까요?깃헙 아이디는 sol4854@naver.com 입니다!감사합니다.
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
백엔드 서버 외부 접속 차단
백엔드를 "https://api.example.com" 프론트엔드를 "https://example.com"이렇게 배포했습니다. 그런데 백엔드 서버는 example.com 이 주소에서 api 요청만 가능하고, https://api.example.com/graphql 은 주소창에 검색해도 접속 못하게 하고 싶습니다. 어떻게 해야할까요?
-
미해결[리뉴얼] 코딩자율학습 제로초의 자바스크립트 입문
클로저 관련해서 질문있습니다.
안녕하세요.강의 도중 클로저를 설명해주셨는데 의문점이 있습니다.익명 함수를 실행할 때 i를 인자로 넣어주고,함수 내부에서는 j로 그 값을 받습니다.그런데 setTimeout의 2번째 인자로 j가 아닌 i를 넣어주었는데도 올바르게 실행됩니다.익명 함수 내부에서의 i는 어디서 가져오고, j로 바꾸지 않아도 올바르게 작동하는지 궁금합니다.for (var i = 0; i < 6; i++) { (function (j) { console.log(i); setTimeout(() => { drawBall(balls[j], $result); }, 1000 * (i + 1)); })(i); }
-
해결됨한 입 크기로 잘라먹는 Next.js(v15)
2.8) 레이아웃 설정시 getLayout 메서드말고 if문 써서 이렇게 해도 될까요?
레이아웃 컴포넌트의 경우 여러 페이지에 공통적으로 들어가야 하는 것이기 때문에, _app.tsx에 넣어야 하는 것은 이해했습니다. 그리고 모든 페이지에 들어가는 레이아웃이 아닌 특정 페이지만 들어가는 레이아웃의 경우에 정환님 같은 경우에는 getLayout이라는 메서드를 해당 레이아웃을 필요로 하는 페이지 컴포넌트 함수에 메서드로 주시고 _app.tsx에서는 그 메서드를 불러오게끔 하셨는데요. 제가 머리가 나빠서인지는 모르겠지만, 뭔가 이런 메서드로 레이아웃을 관리하니까 이해하기 어렵고 뭔가 직관적으로 다가오는 느낌이 없어서 힘들더라구요.. 그래서 그냥 router와 if문을 이용해서 특정 페이지의 경우에만 searchable 레이아웃이 나오게 하고, 아닌 경우에는 그냥 페이지를 리턴하도록 하는 게 저한테는 뭔가 더 직관적..? 으로 다가오는데 이런 식으로 사용해도 되는지 궁금해서 여쭈어봅니다.. (코드는 밑에 같이 써놓았습니다!) export default function App({ Component, pageProps }: AppProps) { const router = useRouter(); const isSearchableLayoutPage = router.pathname === '/' || router.pathname === '/search'; return ( <GlobalLayout> {isSearchableLayoutPage ? ( <SearchableLayout> <Component {...pageProps} /> </SearchableLayout> ) : ( <Component {...pageProps} /> )} </GlobalLayout> ); }
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
bindingResult 질문입니다
MVC2 강의를 듣고 복습하는 겸 직접 상품관리 페이지를 만들어보고 있습니다.validation 부분에서 상품 추가까지는 잘 작동하게 되었는데, 수정 부분에서 문제가 생겼습니다.어느 부분이 문제인지 아무리 찾아봐도 모르겠어서 질문드립니다.@Data public class ItemUpdateForm { @NotNull private Long id; @NotBlank private String itemName; @NotNull @Range(min = 1000, max = 1000000) private Integer price; private Integer quantity; public ItemUpdateForm(Long id, String itemName, Integer price, Integer quantity) { this.id = id; this.itemName = itemName; this.price = price; this.quantity = quantity; } }@PostMapping("/edit/{itemId}") public String editItem(@PathVariable Long itemId, @Validated @ModelAttribute("item") ItemUpdateForm form, BindingResult bindingResult) { log.info("*** edit post 요청 ***"); log.info("itemUpdateForm: {}", form); if (bindingResult.hasErrors()) { log.info("bindingResult= {}", bindingResult); return "item/edit"; } itemService.updateItem(itemId, form); return "redirect:/item/detail/{itemId}"; }<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .field-error { border-color: red; color: red; } </style> </head> <body> <div> <div th:replace="fragment/bodyHeader :: bodyHeader" /> <div> <h2>상품 수정</h2> </div> <form method="post" th:object="${item}" th:action> <div> <label>ID</label> <input type="text" th:field="*{id}" readonly> </div> <div> <label>상품명</label> <input type="text" th:field="*{itemName}" th:errorclass="field-error" placeholder="상품명을 입력하세요."> <div class="field-error" th:errors="*{itemName}"> 상품명 오류 </div> </div> <div> <label>가격</label> <input type="text" th:field="*{price}" th:errorclass="field-error" placeholder="가격을 입력하세요."> <div class="field-error" th:errors="*{price}"> 가격 오류 </div> </div> <div> <label>수량</label> <input type="text" th:field="*{quantity}" th:errorclass="field-error" placeholder="수량을 입력하세요."> <div class="field-error" th:errors="*{quantity}"> 수량 오류 </div> </div> <button type="submit">저장</button> </form> </div> </body> </html>상품 수정 페이지에서 다른 경우에는 잘 작동하는데, typeMismatch가 발생한 경우에는 bindingResult에 다른 에러는 담기지 않고 typeMismatch 에러만 담기고 있습니다.다음은 에러 코드입니다.2024-08-25T17:50:41.455+09:00 INFO 15096 --- [nio-8080-exec-3] community.demo.web.ItemController : *** edit post 요청 ***2024-08-25T17:50:41.455+09:00 INFO 15096 --- [nio-8080-exec-3] community.demo.web.ItemController : itemUpdateForm: ItemUpdateForm(id=1, itemName=, price=10, quantity=null)2024-08-25T17:50:41.455+09:00 INFO 15096 --- [nio-8080-exec-3] community.demo.web.ItemController : bindingResult= org.springframework.validation.BeanPropertyBindingResult: 1 errorsField error in object 'item' on field 'quantity': rejected value [100a]; codes [typeMismatch.item.quantity,typeMismatch.quantity,typeMismatch.java.lang.Integer,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [item.quantity,quantity]; arguments []; default message [quantity]]; default message [Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; For input string: "100a"]2024-08-25T17:50:41.456+09:00 WARN 15096 --- [nio-8080-exec-3] actStandardFragmentInsertionTagProcessor : [THYMELEAF][http-nio-8080-exec-3][item/edit] Deprecated unwrapped fragment expression "fragment/bodyHeader :: bodyHeader" found in template item/edit, line 15, col 10. Please use the complete syntax of fragment expressions instead ("~{fragment/bodyHeader :: bodyHeader}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf. 다음은 코드파일입니다.https://drive.google.com/file/d/1aDFEYzno4e6slRN8K2Tm5EFEYUb5WDJP/view?usp=sharing
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]https://drive.google.com/drive/folders/1jHYkBAHDuUoSr5hjn0Kp5CzTAWLem3Zu?usp=drive_link 코드를 쭉 작성해봤는데 마지막에 submit할 때 whiteError페이지가 나옵니다. gpt에 해결책을 물어봤을 때에러 로그를 보면, Thymeleaf 템플릿을 처리하는 동안 문제가 발생한 것을 알 수 있습니다. 특히, item.orderItems[0].item.name라는 표현식에서 문제가 발생했습니다.에러의 원인에러 메시지 중에서 가장 중요한 부분은 다음과 같습니다:Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1025E: The collection has '0' elements, index '0' is invalid 이 메시지는 item.orderItems[0]에서 인덱스를 사용하여 컬렉션의 첫 번째 요소에 접근하려고 했지만, orderItems 컬렉션이 비어 있어서 인덱스 0이 유효하지 않다는 것을 의미합니다. 즉, orderItems 컬렉션이 비어있거나 null일 때 이 표현식을 평가하려다가 오류가 발생한 것입니다.해결 방법컬렉션이 비어있을 경우에 대한 처리:Thymeleaf 템플릿에서 컬렉션이 비어있는 경우를 대비하여 조건문을 추가할 수 있습니다. 예를 들어, orderItems가 비어있지 않은 경우에만 접근하도록 할 수 있습니다.<div th:if="${item.orderItems.size() > 0}"> <span th:text="${item.orderItems[0].item.name}">Item Name</span> </div> 안전한 접근을 위한 기본값 제공:orderItems 컬렉션이 비어있을 때 안전하게 처리하기 위해, th:text 속성에서 기본값을 제공할 수 있습니다.<span th:text="${item.orderItems.size() > 0 ? item.orderItems[0].item.name : 'No items'}">Item Name</span> 서버 측에서 데이터 처리:서버 코드에서 orderItems가 비어있는 경우에 대해 적절히 처리하도록 할 수도 있습니다. 예를 들어, orderItems가 비어있다면 기본값을 설정하거나, 비어있음을 표시하는 별도의 로직을 추가할 수 있습니다.템플릿 구조 개선:템플릿 구조를 개선하여, orderItems가 비어있을 때는 특정 HTML 요소를 렌더링하지 않도록 할 수 있습니다.결론에러의 원인은 item.orderItems[0].item.name에서, orderItems 컬렉션이 비어있을 때 인덱스 0에 접근하려고 했기 때문입니다. 이를 해결하려면 위의 방법 중 하나를 사용하여, orderItems가 비어있는 경우를 안전하게 처리해야 합니다. 템플릿에서 Thymeleaf의 조건문이나 기본값 제공 기능을 사용하여 이 문제를 해결할 수 있습니다. 이런식으로 나왔고 h2데이터베이스의 order자체에 값이 잘 저장된 것은 확인했는데 무엇이 문제인지 잘 모르겠어서 질문드립니다
-
미해결
비주얼 스튜디오에서 install부터가 안됩니다.
따라하며 배우는 노드, 리액트 시리즈 - 챗봇 사이트 만들기 | 학습 페이지 (inflearn.com) 여기도 질문을 했는데 답을 못받을까봐 씁니다. 지금 "dialogflow-fulfillment": "^0.6.1",얘가 최신버전인데, 얘와 호환되는 애가 node6이라고 합니다. 지금 10버전이상이 나오고 있는데 6버전을 쓸 수는 없는 것 같아요. 최신버전에 맞처서 진행을 하고 싶습니다.npm install을 하면 버전이 자꾸 안맞다고 합니다.그렇다고 dialogflow-fulfillment이거를 최신노드버전이랑 호화되는 것을 찾으려고 하니... 저게 최신이라고 합니다. 6년전께요. 얼마전까지 인스톨해서 포스트맨까지확인하고, 채팅까지 했었고 이벤트 적용하다가 자꾸 에러가 처음부터 다시 작업하는데 이번에도 버전문제라고 하네요 모듈의 버전을 현재 안정적인 최신버전으로 (제 컴퓨터에깔린)바뀌어서 인스톨을 진행하지만 자꾸 에러가 납니다 어떻게 하면 인스톨하고, 작업을 할까요?얼마전 까지 인스톨을 지나서 기능만들고, css 적용하고 있는데 갑자기갑자기 버전 문제라고 에러가 계속 뜨기시작합니다. { "name": "chatbot-app", "version": "1.0.0", "description": "chatbot-app", "main": "index.js", "engines": { "node": ">=20.16.0", "npm": ">=10.2.0" }, "scripts": { "start": "react-scripts --openssl-legacy-provider start", "build": "react-scripts --openssl-legacy-provider build", "test": "react-scripts test", "eject": "react-scripts eject", "backend": "nodemon index.js", "frontend": "npm run front --prefix client", "dev": "concurrently \"npm run backend\" \"npm run start --prefix client\"" }, "author": "Jaewon Ahn", "license": "ISC", "dependencies": { "@google-cloud/dialogflow": "^6.8.0", "actions-on-google": "^2.6.0", "body-parser": "^1.18.3", "dialogflow": "^4.0.3", "dialogflow-fulfillment": "^0.6.1", "express": "^4.16.4", "mongoose": "^5.4.20" }, "devDependencies": { "concurrently": "^8.2.2", "nodemon": "^3.1.4" } } C:\project\vswork\chatbot-app> C:\project\vswork\chatbot-app>npm install npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: 'dialogflow-fulfillment@0.6.1', npm warn EBADENGINE required: { node: '6' }, npm warn EBADENGINE current: { node: 'v20.16.0', npm: '10.8.2' } npm warn EBADENGINE } npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated npmlog@5.0.1: This package is no longer supported. npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported. npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated gauge@3.0.2: This package is no longer supported. npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 npm warn deprecated grpc@1.24.11: This library will not receive further updates other than security fixes. We recommend using @grpc/grpc-js instead.
-
해결됨서버개발자 과제전형 완벽가이드 - 1편
포트폴리오 질문
이 강의를 기반으로 포트폴리오도 만들어보려고합니다. 포트폴리오 만들때 여러가지 기술들을 더 적용해보는게 좋을까요 아니면 강의에 나온 기술만 활용해도 충분할까요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 챗봇 사이트 만들기
npm install 이 안됩니다
지금 "dialogflow-fulfillment": "^0.6.1",얘가 최신버전인데, 얘와 호환되는 에가 node6이라고 합니다. 지금 10버전이상이 나오고 있는데 6버전을 쓸 수는 없는 것 같아요. npm install을 하면 버전이 자꾸 안맞다고 합니다.최신버전에 맞처서 진행을 하고 싶습니다.그렇다고 dialogflow-fulfillment이거를 최신노드버전이랑 호화되는 것을 찾으려고 하니... 저게 최신이라고 합니다. 6년전께요. 얼마전까지 인스톨해서 포스트맨까지확인하고, 채팅까지 했었고 이벤트 적용하다가 자꾸 에러가 처음부터 다시 작업하는데 이번에도 버전문제라고 하네요 모듈의 버전을 현재 안정적인 최신버전으로 (제 컴퓨터에깔린)바뀌어서 인스톨을 진행하지만 자꾸 에러가 납니다 { "name": "chatbot-app", "version": "1.0.0", "description": "chatbot-app", "main": "index.js", "engines": { "node": ">=20.16.0", "npm": ">=10.2.0" }, "scripts": { "start": "react-scripts --openssl-legacy-provider start", "build": "react-scripts --openssl-legacy-provider build", "test": "react-scripts test", "eject": "react-scripts eject", "backend": "nodemon index.js", "frontend": "npm run front --prefix client", "dev": "concurrently \"npm run backend\" \"npm run start --prefix client\"" }, "author": "Jaewon Ahn", "license": "ISC", "dependencies": { "@google-cloud/dialogflow": "^6.8.0", "actions-on-google": "^2.6.0", "body-parser": "^1.18.3", "dialogflow": "^4.0.3", "dialogflow-fulfillment": "^0.6.1", "express": "^4.16.4", "mongoose": "^5.4.20" }, "devDependencies": { "concurrently": "^8.2.2", "nodemon": "^3.1.4" } } C:\project\vswork\chatbot-app> C:\project\vswork\chatbot-app>npm install npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: 'dialogflow-fulfillment@0.6.1', npm warn EBADENGINE required: { node: '6' }, npm warn EBADENGINE current: { node: 'v20.16.0', npm: '10.8.2' } npm warn EBADENGINE } npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated npmlog@5.0.1: This package is no longer supported. npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported. npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated google-p12-pem@1.0.5: Package is no longer maintained npm warn deprecated gauge@3.0.2: This package is no longer supported. npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 npm warn deprecated grpc@1.24.11: This library will not receive further updates other than security fixes. We recommend using @grpc/grpc-js instead.
-
미해결스프링 핵심 원리 - 기본편
스프링부트 질문이 있습니다
제가 현재 자바와 스프링 부트를 함께 배우는 비전공자 부트 캠프를 다니는 중인데부트캠프에서 자세한 내용은 배우기 시간이 촉박한 관계로 강사님이 자세한 설명은 스킵합니다. 이로 인해 비전공자임에도 개발자의 꿈을 꾸는 저는 추가로 강의를 들어서 보충학습을 하고자하는데현재 제가 강의로 배우고 있는 내용은 스프링으로 심화적인 스프링부트의 이해를 위해서 필요한지 아니면 스킵하고 바로 스프링 부트쪽으로 넘어갈지 고민이되서 질문드립니다
-
해결됨직장인에게 꼭 필요한 파이썬-아래아한글 자동화 레시피
바탕쪽, 머리말, 꼬리말, 미주 장식, 두 줄이상의 빈 줄 삭제
hwp 파일에서 바탕쪽, 머리말, 꼬리말, 미주 장식, 두 줄이상의 빈 줄을 자동으로 없애고자 강의를 수강합니다. 힌트를 얻고 싶습니다.
-
미해결
activityMainBinding을 사용하는 이유는 무엇인지요?
기존에 있는 setContentView(R.layout.activity_main);이것을 그대로 사용해도 되는데 굳이 buildFeatures{ viewBinding = true}글 세팅하고 activityMainBinding을 사용하는 이유는 무엇인지요?질문을 올리면 해결좀 부탁드립니다. 너무 답이 없으십니다. public class MainActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String[] items = { "CSI-뉴욕", "CSI-라스베가스", "CSI-마이애미", "Friends", "Fringe", "Lost" }; AutoCompleteTextView auto = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, items); auto.setAdapter(adapter); MultiAutoCompleteTextView multi = (MultiAutoCompleteTextView) findViewById(R.id.multiAutoCompleteTextView1); CommaTokenizer token = new MultiAutoCompleteTextView.CommaTokenizer(); multi.setTokenizer(token); multi.setAdapter(adapter); }}
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
1차원 배열 회전 관련 질문
안녕하세요알고리즘 교안 > 1.12 코딩테스트 필수로직 > 1차원 배열회전 관련 공부를 하다 질문사항이 생겨 문의 드립니다. // 반시계방향 문제 //{1, 2, 3, 4, 5, 6} -> {1, 3, 4, 5, 2, 6} rotate(v.begin() + 1, v.begin() + 2, v.begin() + 5);// 시계방향 문제 // {1, 2, 3, 4, 5, 6, 7} -> {5, 6, 7, 1, 2, 3, 4} rotate(v.rbegin(), v.rbegin() + 2, v.rend()) // 6 7 1 2 3 4 5저는 반시계방향 문제에서는 middle값이 v.begin()이 1을 가리키고 두칸 이동해서 3을 가리킨다고 이해했고시계방향에서도 동일하게 v.rbegin()이 7을 가리키고 두칸 이동해서 5를 가리켜서 결과가 5, 6, 7, 1, 2, 3, 4 가 나올 것으로 기대했는데, 6, 7, 1, 2, 3, 4, 5 가 나오더라구요 .. 반시계방향 문제는 제가 이해한 방식으로 여러 다른 문제 풀어도 결과가 동일하게 나오는데 시계방향 문제에서는 제가 이해한 방식으로는 원하는 결과값이 나오지를 않는데, 어느 부분이 잘못된건지 알 수 있을까요?
-
해결됨한 입 크기로 잘라먹는 Next.js(v15)
2.20) vercel에 프로젝트 배포 시 fetch failed 에러가 발생합니다
안녕하세요!다름이 아니라 2.20 실습을 진행하면서 vercel에 앱을 배포하려고 하는데Error: Command "npm run build" exited with 1에러가 발생했습니다. [cause]: Error: connect ECONNREFUSED 127.0.0.1:12345 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 12345 }vercel 에서 에러 로그를 살펴보니 book/1, book/2, book/3 페이지를 prerendering 할 때 위와 같은 에러가 발생했습니다.로컬에서 앱을 빌드한 후 실행했을 때엔 문제가 발생하지 않았습니다 ㅠㅠ export default async function fetchBookById(id: number): Promise<BookData | null> { const url = `http://127.0.0.1:12345/book/${id}`; try { const response = await fetch(url); if (!response.ok) { throw new Error(); } return response.json(); } catch (error) { console.error(error); return null; } }위 코드는 book/{id}페이지로 들어왔을 때 실행하는 함수입니다! import { useRouter } from "next/router"; import style from "./[id].module.css"; import fetchBookById from "@/lib/fetch-book-by-id"; import { GetStaticPropsContext, InferGetStaticPropsType } from "next"; import Head from "next/head"; export const getStaticPaths = () => { return { paths: [{ params: { id: "1" } }, { params: { id: "2" } }, { params: { id: "3" } }], fallback: true, }; }; export const getStaticProps = async (context: GetStaticPropsContext) => { const id = context.params!.id; const data = await fetchBookById(Number(id)); return { props: { data, }, }; }; export default function Page({ data }: InferGetStaticPropsType<typeof getStaticProps>) { const router = useRouter(); if (router.isFallback) { return ( <> <Head> <title>한입북스</title> <meta property="og:image" content="/thumbnail.png" /> <meta property="og:title" content="한입북스" /> <meta property="og:description" content="한입 북스에 등록된 도서들을 만나보세요" /> </Head> <div>로딩중입니다.</div> </> ); } if (!data) { return { notFound: true, }; } const { id, title, subTitle, author, coverImgUrl, description, publisher } = data; return ( <> <Head> <title>{title}</title> <meta property="og:image" content={coverImgUrl} /> <meta property="og:title" content={title} /> <meta property="og:description" content={description} /> </Head> <div className={style.container}> <div className={style.cover_img_container} style={{ backgroundImage: `url('${coverImgUrl}')` }}> <img src={coverImgUrl} /> </div> <div className={style.title}>{title}</div> <div className={style.subTitle}>{subTitle}</div> <div className={style.author}> {author} | {publisher} </div> <div className={style.description}>{description}</div> </div> </> ); } 혹시 몰라 해당 페이지의 전체 코드 같이 남겨봅니다 😭감사합니다!
-
미해결실무자를 위한 구글애널리틱스(GA4+GTM) 활용법(25년 Update)
GTM으로 이벤트 설계 후 실시간 보고서에 쌓이는 데이터를 확인할 때
안녕하세요, 실무 기반의 수업을 해주셔서 GA4 강의를 정말 열심히 듣고 있고, 도움이 되는 내용이 많아 너무나 감사히 듣고 있습니다. 현재 이벤트 관련 수업을 듣는 중인데, 직접 실습하는 과정에서 몇가지 궁금한 점이 생겨 질문 드립니다.1. 위시리스트에서 상품명을 CSS로 함께 수집하는 실습 진행 중인데, 상품명(텍스트)이 위치한 곳에서 정확하게 CSS copy selector 해서 복사하여 매개변수로 입력해 주고 있음에도 태그 작동 후 실시간 보고서에 들어가 보면 상품명이 "null"로 수집되는 걸 확인하였습니다. 아래 이미지와 같이 속성 이름 값은 비워두었음에도 null로 수집되고 있어 어떠한 경우에 상품명이 제대로 수집되지 않는 것인지 궁금합니다. 스크롤 이벤트를 만들 때, GA에서 디폴트로 제공하는 스크롤 이벤트는 "향상된 측정" 값에서 off 시켜두고, 선생님께서 진행하신 것처럼 직접 GTM에서 트리거와 태그를 만들어 스크롤 depth로 이벤트를 작동시키도록 만들었습니다. 25, 50, 75, 90으로 비율 값도 정확히 입력했는데, 이번에도 실시간 보고서에 가서 확인해보니 매개 변수에 25, 50, 75, 90이라는 값 외에 vertical25 vertical50 vertical75 vertical90이라는 값이 추가로 생성되어 있는 것을 확인했습니다. 어떠한 이유에서 위와 같은 매개변수가 추가된 것인지, 그리고 해결할 수 있는 방법은 무엇인지 질문 드립니다.마지막으로, 선생님께서 강의하던 때와 달리 이벤트 매개변수를 설정할 때 좀 달라진 부분이 있어 질문 드립니다. Event Setting Variable이라는 드롭다운은 어떤 기능을 하는 것일까요? 우선은 "없음"으로 해두고 매게변수 추가 버튼을 눌러 매개변수를 추가하고 있는데, 이 기능을 없음으로 해두는 게 맞는 건지 설명을 봐도 헷갈려서 다시 한번 문의 드립니다. 감사합니다!!
-
해결됨이득우의 언리얼 프로그래밍 Part2 - 언리얼 게임 프레임웍의 이해
NextPatrolPos 질문드립니다
오리진에서 5미터 내의 x,y값이 패트롤에 저장하고 성공하면 true 로 바뀌고 패트롤 위치까지 이동하는 함수를 수행한다고 이해했는대 재대로 이해한게 맞을까요? 만약 맞다면 이 함수가 실패를 하는대 왜그런건가요?? NavMeshBoundsVolume 에서 조정이 잘못된건가요?
-
미해결Vue3 완벽 마스터: 기초부터 실전까지 - "실전편"
history mode로 배포 시 404 페이지 반환 관련
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요, 매번 빠르고 친절한 답변 주셔서 감사합니다!짐코딩님 덕분에 밥 벌어먹고 삽니다..ㅎㅎ 강의 내용 중에 대부분의 서버는 root로 요청하면 index.html 파일을 돌려준다그런데, 전체 경로(ex. localhost:3000/posts)로 요청했을 때, 해당 경로에 index.html 파일이 있지 않는 이상 404 오류를 만나게 된다history mode로 요청 시 전체 경로로 요청한다따라서, history mode로 배포할 때는 서버에 추가 설정이 필요하다 요러한 내용이 있었습니다.제가 의아한 부분은..여기서 말하는 '서버'는 웹서버를 의미하는 걸까요? 이 부분에 대해 신경쓰지 않고, history mode로 build, deploy한 개인 프로젝트가 있습니다. 저는 history mode 배포를 위해 특별한 설정을 하지 않았으나 문제 없이 동작하고 있습니다. (여기서 문제가 없다는 건, root 요청이 아니더라도 404를 돌려주지 않고 제가 설정한 Router 정보대로 페이지를 보여줍니다). 그래서 아리까리 한데요.. 제가 이 부분에 대해 조금 더 알아볼 수 있는 학습자료를 공유해주실 수 있을까요?
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
테스트코드 데이터소스 분리
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]테스트 application.properties와 메인의 application.properties의 설정으로테스트와 실제 어플의 db 동작을 분리 할수 있는데만약에 테스트에서도 테스트 패키지 혹은 테스트 별로db를 다르게 사용하려면 어떻게 해야하나요?단위 테스트 할 기능중에 db종속적인 부분이 있어서질문 드려요!