묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
올려주신 코트 그대로 실행하는데 실행이 안됩니다.
강의자료에 있는 코드 chapter02_02.py를 vscode로 실행하는데 문법이 틀렸다고 나오는데 어디가 문제인지 모르겠습니다.
-
미해결스프링 핵심 원리 - 기본편
스프링 빈 조회 - 동일한 타입 둘 이상 강의 질문 입니다.
스프링 빈 조회 - 동일한 타입 둘 이상 강의 질문 입니다. SameBeanConfig 내부 클래스 같은 경우 왜 static으로 해야만 하나요?? static으로 하지 않으면 에러가 발생하는데원인을 찾지 못해서요 ㅜ.ㅜ기본 자바로 봤을 때는 static으로 안해도 전혀 문제가 없어야 하는데 말이에요 ㅜ.ㅜ
-
해결됨Node.js에 TypeScript 적용하기(feat. NodeBird)
passport관련 에러가 있습니다
안녕하세요! 제로초님! 좋은 강의 항상 감사드립니다. < passport/index.ts > 질문과 답변란에 저와 같은 passport 에러가 있는 분이 있어 저렇게 제너릭을 사용했었습니다. 그래도 안되서, 제로초님이 질문란에 조언주신대로 tsc돌리고 에러확인해봤는데, console창에 ts파일에서의 에러와 같은 에러가 출력됩니다. 일단 계속 구글링 해보고 있습니다..! < model/user.ts >
-
미해결자바 입문자를 위한 강의
강사님 질문드립니다!
강사님의 강의를 듣기 시작한 열정 불타오르는 학생입니다! 머나먼 이야기지만 제 목표는 풀스택 개발자입니다. 현재 학원에서는 프론트 엔드수업으로 html css javascript jquery에 대하여 배우면서 포트폴리오를 만드는 요령에 대해 배우고 있습니다. 저녁시간에는 자바에 입문하고 나중에는 스프링까지 배우면서 포트폴리오를 두가지 유형으로 만들 생각을 하고있습니다. (6개월 목표) 학업 시간은 평일 9~6시까지 학원수업, 9시부터 12시까지 자바강의듣기 입니다 제가 6개월안에 두개의 포트폴리오를 현실적으로 만들 수 있을지 궁금합니다!
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
Address 관련 질문입니다.
안녕하세요, 강의 잘 듣고 있습니다. Address의 경우, 값 변경이 불가능하게 하기 위해 Setter를 제공하지 않고 전체 필드를 사용하는 생성자를 통해서만 값을 변경할 수 있도록 설계하셨는데요. 이와 같은 방법이 @Embeddable을 사용하지 않고 Member와 Delivery에 city, street, zipcode를 직접 매핑해서 사용하는 방법과 비교해 어떤 장점이 있는지 혹은 어떤 차이가 있는지 궁금합니다. 제가 현재 이해한 바로는 @Embeddable을 사용하더라도 결국, Address객체를 새로 만들어서 Member와 Delivery의 주소정보를 변경할 수 있고, 이는 @Embeddable을 사용하지 않았을때와 다른 점이 없어보여서 궁금증이 생겼습니다. @Embeddable을 사용하는 이유에 대해서 좀 더 자세히 알고 싶습니다. (추가로 이뮤터블하게 설계한다는 것이 구체적으로 와닿지 않아 해당 부분도 설명해주시면 감사하겠습니다.)
-
미해결스프링과 JPA 기반 웹 애플리케이션 개발
springboot sign-up test 질문드립니다.
안녕하세요 백기선선생님. 현재 강좌를 잘보고 있습니다. 저는 타임리프를 사용하지 않고 기존에 만든 프로젝트가 있어서 jsp로 예제를 따라하는 중인데요 스프링시큐리티 적용하고 jsp 페이지를 컨트롤러에서 호출해서 정상적으로 로드되는 것은 확인 하였습니다. 그런데 테스트를 진행시에 404에러가 뜨면서 호출이 되지 않는데요 원인을 잘 모르겠습니다. application.properties 파일 spring.mvc.view.prefix= /WEB-INF/views/spring.mvc.view.suffix= .jsp 따라서/user/sign-up 을 리턴하구요 @GetMapping("/sign-up")public String signUpForm(Model model) { return "/user/sign-up";} 컨드롤러에서는 위에 url을 호출시에 정상적으로 페이지가 열립니다. 아래는 컨트롤러 테스트입니다. package com.seongbindb.recipe.controller;import org.junit.jupiter.api.DisplayName;import org.junit.jupiter.api.Test;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;import org.springframework.boot.test.context.SpringBootTest;import org.springframework.test.web.servlet.MockMvc;import static org.junit.jupiter.api.Assertions.*;import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;@SpringBootTest@AutoConfigureMockMvcclass UserControllerTest { @Autowired private MockMvc mockMvc; @DisplayName("회원 가입 화면 보이는지 테스트") @Test void signUpForm() throws Exception { mockMvc.perform(get("/sign_up")) .andExpect(status().isOk()) .andExpect(view().name("/user/sign-up")); }} 아래는 콘솔 로그입니다. java.lang.AssertionError: Status expected:<200> but was:<404> Expected :200 Actual :404 <Click to see difference> at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59) at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122) at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:627) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:196) at com.seongbindb.recipe.controller.UserControllerTest.signUpForm(UserControllerTest.java:24) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) 2021-02-15 21:20:56.279 INFO 11843 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' Process finished with exit code 255
-
미해결파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
동전분배하기 (DFS)
안녕하세요 동전분배하기 문제를 풀고 있는데 in1.txt 에서 [5, 300, 10, 10, 10, 10]이 주어진다면 (300), (10, 10, 5), (10, 10)으로 분배해서 최소차가 280인게 가장 작은 차 아닌가요? 제가 착각한거 일 수 있는데 답이 290이라 어떻게 이렇게 나오는지 궁금합니다.
-
미해결페이스북 클론 - full stack 웹 개발
class 와 id 의 차이
전부다 클래스 혹은 아이디로 써도 되나요? 저렇게 구분지어서 사용하는 이유가 무엇인가요!?
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part5: 데이터베이스
안녕하세요 선생님 lock과 spinlock에 대해서 질문드립니다.
예전 스핀락 설명 하실때 메모한 내용입니다. 락을 걸고 있는 상대방이 조금만 기다리면 놔줄 것 같다는 확신이 있을 때는 굳이 Context-Switching까지 가지 않고 무식하게 대기하는 SpinLock이 좋습니다. 비행기 1인 화장실 앞에서 대기하는데, 안에서 손 씻고 있는 소리가 들린다면, 굳이 자리에 돌아가서 대기하기 보단 문앞에서 조금만 더 기다리는게 현명합니다. MMO에서 lock을 쓰는 경우는 대부분 컨텐츠의 멀티쓰레드 경합 처리에서 사용하게 되는데, 어마어마하게 오래 걸리는 작업이 아닌 경우가 많기 때문에 SpinLock이 대부분의 경우에서 유리합니다. 질문 컨텍스트 스위칭이라는게 a쓰레드가 공유 자원을 다쓰고 쓰레드 풀로 들어가면 b라는 쓰레드가 공유자원을 획득해서 사용하는 걸로 알고 있는데 그러니까 프로세스 내부에 stack 공간만 바뀌는 스핀락이라는게 무한 반복 타고 들어가서 계속 기다리잖아요 상대방이 빠져나올떄 까지 lock은 접근 했다가 a라는 쓰레드가 사용중이네 글멈 나는 다른 작업 하고 이따 한번 더와바야지 이 개념이 아닌가요? 여기서 왜 컨텍스트 스위칭이라는 표현을 쓰셨는지 여쭤봅니다? a가 가고 b가 들어가야 컨텍스트 스위칭이 성립되는 게 아닌가요?
-
미해결iOS 개발을 위한 swift5 완벽 가이드
drop while 문제
drop while 에서 Character 대신 ch 로 써도 동일한 결과가 나옵니다!ㅜㅜ
-
미해결정말 쉽게 풀어보는 코딩 테스트 top 기본 문제 (with 자바)
안녕하세요. int n = grid[0].length가 궁금합니다.
현재 문제에서는 row, column이 정해진 사이즈라서 grid[0]으로 하신건가요? 만약에 변수를 이용한다면... 재귀를 탈출하려는 조건문 즉, if(i<0||i>=m ....) return; 이 다음에 int n = grid[i].length 와 같이해도 되겠죠?
-
미해결웹 게임을 만들며 배우는 React
이미지 div 부분의 style 템플릿 리터럴 부분이 적용이 되지 않습니다.
render() { const {result, score, imgCoord} = this.state; return ( <> {imgCoord} <div id="computer" style={{ background : `url('https://en.pimg.jp/023/182/267/1/23182267.jpg') ${imgCoord} 0` }}/> <div> <button id="rock" className="btn" onClick={() => this.onClick('바위')}>바위</button> <button id="scissor" className="btn" onClick={() => this.onClick('가위')}>가위</button> <button id="paper" className="btn" onClick={() => this.onClick('보')}>보</button> </div> <div>결과 {result}</div> <div>현재 {score}</div> </> ); } 1. 선생님 방식대로 따라했으나 이미지가 변경되지 않습니다. {imgCoord}를 별도로 꺼내서 찍어보면 변경이 되는데 <div id ="computer" 의 `${imgCoord}`여기에 넣을 경 해당 태그의 속성에서는 값이 변경이 되지 않습니다 .왜그럴까요 ?
-
미해결얄팍한 GraphQL과 Apollo
npm start 에러가 나와서 여쭙고 싶습니다
(사진)
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
use effect 부분에서 에러가나는 건지요...
import React ,{useEffect, useState} from 'react' import axios from 'axios'; import ProductImage from './Sections/ProductImage'; import ProductInfo from './Sections/ProductInfo'; import {Row, Col} from 'antd'; function DetailProductPage(props) { const productId = props.match.params.productId const [Product, setProduct] = useState({}) useEffect(() => { axios.get(`/api/product/products_by_id?id=${productId}&type=single`) .then(response =>{ if(response.data.success){ setProduct(response.data.product[0]) }else { alert('상세 정보 가져오기를 실패했습니다.') } }) }, []) return ( <div style={{widht: '100%', padding : '3rem 4rem'}}> <div style = {{display : 'flex', justifyContent:'center'}}> <h1>{Product.title}</h1> </div> <br /> <Row gutter={[16,16]}> <Col lg={12} sm= {24}> {/* Product image */} <ProductImage detail={Product} /> </Col> <Col lg={12} sm= {24}> {/* Product Info */} <ProductInfo detail={Product} /> </Col> </Row> </div> ) } export default DetailProductPage 우선 상세페이지 버튼 눌렀을때 나는 에러입니다,,, 뭔가 터미널에 찍히는것도 그렇고 hook에 관한 내용이 나오는 것 같은데 ..
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
format의 등장이유
*args언패킹 할 때 format이 등장하는 이유? 가 무엇인가요 뒤에 v에는 format 없이 출력할 수 있는 이유가 무었인가요
-
미해결[라즈베리파이] IoT 딥러닝 Computer Vision 실전 프로젝트
크리애플 사이트에 현재 수강중인 자료가 보이질 않습니다.
[라즈베리파이] IoT 딥러닝 Computer Vision 실전 프로젝트의 자료를 다운로드해야 하는데 크리애플 사이트에서 다운받는 방법으로 보니 보이질 않습니다. 이전 강의에 대한 자료가 다 지워졌을까요?
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
서버(백앤드)에서 다른 서버로 요청 관련 질문입니다.
express에서는 프론트에서 백앤드로 요청하는것과 동일하게 짰고 잘 작동했습니다. router.post("/add", async (req, res) => { const { videoId, category, tags } = req.body; const ENDPOINT = getEndpointFromVideoId(videoId); try { if (!videoId) { return res.status(404).send(ADD_YOUTUBE_VIDEO_FAIL.ko); } const response = await axios.get(ENDPOINT); const result = getVideoDataFromVideoId(response.data, true); // 중략.... nest.js는 express 노드버드 구조랑 다소 다른 것 같은데, 다른 서버로 데이터 요청 시 방법은 동일하게 쓰면 되는건가요?
-
미해결남박사의 파이썬 기초부터 실전 100% 활용
결과값이 나오질 않습니다.
import requests from bs4 import BeautifulSoup import re def get_hotdeal(items): url ="https://slickdeals.net/newsearch.php?src=SearchBarV2&q={}".format(items) r= requests.get(url) bs = BeautifulSoup(r.text,"lxml") rows = bs.select("div.resultRow") results = [] for r in rows: link= r.select("a.dealTitle.bp-p-dealLink.bp-c-link")[0] href = link.get("href") if href is None: continue href = "https://slickdeals.net" + href title = link.text price = r.select("span.price")[0].text.replace("$"," ").replace("from"," ").replace("off"," ").replace("each"," ").strip() if price.find("/") >= 0 or price == "": continue price = float(price) hot = len(r.select("span.icon-fire")) results.append((title,href,price, hot)) return results get_hotdeal("ipad") #이렇게 만들었는데 터미널에 아무런 값이 반환되지 않습니다. #리턴값을 프린트하면 값이 나오는데, 왜 함수로 하면 아무값도 나오질 않을까요? #평소에는 껏다 키면 될때가 있었는데 껏다 켜도 안됩니다 #에러 메세지도 안떠서 어디서 잘못된건지 모르겟어요.
-
미해결따라하며 배우는 TDD 개발 [2023.11 업데이트]
500에러가 아닌 200이 리턴되네요
{name: phone}만 했을때요.. 스펙이 바뀐걸까요 제 코드가 잘못된걸까요?
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
이제는 자동링크가 모두 되는것 같아요.
파스칼, 케밥 모두 링크로 연결되어보여지는데 파스칼 유지해도 좋은것 인가요?