묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결공공데이터로 파이썬 데이터 분석 시작하기
시작부터 총체적 난국입니다. 쌤~~
주피터랩 셋팅 > 런타임 > 셀렉트 커널에 파이썬2만 나오네용!!맥에서 파이선3.6을 기본 패스 설정을 해줘야 하나용???
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
과제 질문드립니다
conn.cursor().execute("""CREATE TABLE IF NOT EXISTS users(id bigint(20) NOT NULL,name varchar(50),username varchar(30),index1 bigint(20),index2 double(20, 3),index3 double(20, 3),index4 double(20, 3),location varchar(50),type varchar(30),per float(10, 3),regdate varchar(30),PRIMARY KEY(id))""")try: with conn.cursor() as c: for i in (exl['id']-1) : user = (int(exl.ix[i]['id']), exl.ix[i]['name'], exl.ix[i]['username'], int(exl.ix[i]['index1']), float(exl.ix[i]['index2']), float(exl.ix[i]['index3']), float(exl.ix[i]['index4']), exl.ix[i]['location'], exl.ix[i]['type'],float(exl.ix[i]['per']), nowtime) c.execute("INSERT INTO users(id, name, username, index1, index2, index3, index4, location, type, per, regdate) VALUES \ (%s, %s, %s, %s, %s, %s, %s, %s, %s ,%s ,%s)" , user) c.commit()finally: conn.close()과제중에 excel파일을 역직렬화해서 Mysql sever의 데이터베이스 테이블에 INSERT 하는데직렬화된 데이터를 그냥 튜플형식으로 넣으면 'numpy.int64' object has no attribute 'translate' 에러가 떠서, 위 코드처럼 형변환을 수동적으로 해서 넣었더니 pymysql.err.InternalError: (1054, "Unknown column 'nan' in 'field list'") 에러가 뜨네요.문제가 뭘까요?
-
미해결실전 파이썬 게임 만들기 (Pygame)
...
이미지는 어느 경로에 넣어야 하나요?
-
미해결홍정모의 따라하며 배우는 C++
안녕하세요. value type 에 대해서 질문드려요.
안녕하세요. value type과 reference type에 대해서 찾아보다가https://en.m.wikipedia.org/wiki/Value_type_and_reference_type링크를 발견했는데요.value 타입중에서 배열만 call by value로 동작하지 않고 call by address로 동작하는 것이라고 생각하면 될까요?그렇다면 배열을 멤버로 지니고 있는 struct나 class의 경우는 call by value로 값 전달이 되는 건가요?
-
미해결신입 프로그래머를 위한 실전 JSP 강좌
db 연동 에러
강의는 잘 듣고 있습니다. 디비 연동전 까지의 실습은 아무 문제없이 잘 진행되고 있습니다.디비 연동 부분부터 실습이 안되는데 문제는 디비 연결인거 같습니다.선생님께서 하라고 하는대로 하였는데 디비 연결이 계속 안되에요. ping 테스트를 해도 실패가 되는데 무엇이 문제인지 모르겠네요도움 부탁드립니다.
-
미해결웹 게임을 만들며 배우는 자바스크립트
function 의 인자에 대한 질문
forEach 등에 function을 인자로 주는데, 그 무명 function의 인자로 card, index, key 등의 값이 들어가던데요. 이러한 값들이 예약어 같지는 않은데, 어떻게 정해지는 건가요? forEach의 객체에 따라 정해져 있는 값인가요?
-
미해결스프링 부트 개념과 활용
강의듣다가 안되는게 있어서 질문드립니다.
spring.datasource.url=jdbc:postgresql://localhost:5433/testspring.datasource.username=postgresspring.datasource.password=123456spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=truespring.jpa.hibernate.ddl-auto=validatespring.jpa.generate-ddl=falsespring.jpa.show-sql=true이렇게 application.properties 파일을 설정 해놓았구요POM.XML파일은 현재<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --></parent><groupId>com.antMart.com</groupId><artifactId>antMall</artifactId><version>0.0.1-SNAPSHOT</version><name>antMall</name><description>Demo project for Spring Boot</description><properties> <java.version>1.8</java.version></properties><dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.restdocs</groupId> <artifactId>spring-restdocs-mockmvc</artifactId> <scope>test</scope> </dependency></dependencies><build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins></build><repositories> <repository> <id>spring-snapshots</id> <name>Spring Snapshots</name> <url>https://repo.spring.io/snapshot</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> </repository></repositories><pluginRepositories> <pluginRepository> <id>spring-snapshots</id> <name>Spring Snapshots</name> <url>https://repo.spring.io/snapshot</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> </pluginRepository></pluginRepositories>이러한 상태이구요/resource/db/migration/V1__init.sql에 강의내용이랑 같은 sql를 넣었구요postsql 에서 database만 만들어놓은 상태입니다 이경우에 aplication을 run 돌리면 스키마를 만들지를 않아요 아무 에러도 없구요그래서 V1__init.sql을 v1으로 바꿔서 에러라도 내볼려고 해도 그마저도 에러가 없어요 아에 작동을 안하는거 같은데 어디를 봐야할까요 ??
-
미해결홍정모의 따라하며 배우는 C++
6분30초경에 말씀하신 스택오버플로우
스택오버플로우가 생길수 있는게 스택에 int count 변수가 계속 생성되기 때문인건가요?그러니까 처음에 int count가 생기고 재귀함수호출로 인해 똑같은 이름이지만 다른 주소를 가지는 int count 가 또 스택에 생기고 이게 반복되서 오버플로우가 생긴다는 말씀인건가요?보통은 함수가 종료되면 지역변수같은 경우 사라지게 될텐데 이런 재귀함수호출은 실제로 종료조건이 성립안되면 함수가 종료되지 않기에 그런건지가 궁금합니다.
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
Query BOX에서 접속이 안되요
파이썬 코드로도 접속이되고, cmd를 통해서도 접속이 잘되는데Query Box에서 호스트를 localhost 등 제대로 값을 넣어도만든 python 사용자에 접속이안되네요.뭔가 따로 설정해줘야하는게 있나요?
-
미해결자바 스프링 프레임워크(renew ver.) - 신입 프로그래머를 위한 강좌
커맨드 객체를 이용한 부분에서 질문입니다
커맨드 객체를 이용해서 MemberController.java에서 member.getMemId()....member.getMemPhone3()을 이용하는데뷰단 즉 memberJoinOk.jsp에서도 똑같이 get 매서드를 이용해야 하는게 아닌가 싶어서 질문 드려요커맨드 객체 클래스를 보면 필드는 private 걸려있는데 member.memId로 접근이 안될거 같은데 사용을 해서 질문합니다
-
미해결스프링 웹 MVC
Request body가 압축되어 있을 수 있는 경우에 대한 해결책이 궁금합니다.
안녕하세요. 기선님 강의를 잘 수강하고 있습니다. 현재 스프링 MVC 설정부분까지 강의를 들었습니다. 강의 내용에 대한 직접적인 질문은 아니지만 request body를 다루는 설정 같은 것과 관련이 있는 것 같아 이 시점에 제가 갖고 있는 문제에 대한 질문을 드리려 합니다. 문제 상황은 이렇습니다. client에서 request를 보낼 때 경우에 따라 request body를 gzip으로 압축해서 보낼 수 있다. gzip으로 압축한 경우에 http header의 content-encoding 값을 gzip으로 설정해 보낸다. https://github.com/spring-projects/spring-boot/issues/11827 이런 이슈의 내용을 보면 HTTP spec이 아니기 때문에 tomcat 에선 지원하지 않는 것 같습니다. 처음엔 많은 사람들이 비슷한 기능을 원할 것이라 생각해 스프링에 관련 기능이 있을줄 알았는데 없는 것 같습니다. (찾아보았는데 현재까지 찾지 못했습니다.) 질문은 1) spring mvc에 관련 기능이 있는데 제가 못 찾은 것인지 2) 관련 기능이 없다면 기선님께선 이러한 문제를 어떻게 해결하실지 궁금합니다. spring app의 어느 단계에서 어떤 방식으로 request body의 압축을 푸는 선택을 하실지 궁금합니다. 답변을 기다리겠습니다. 감사합니다.
-
미해결스프링 프레임워크 핵심 기술
@Autowired에서 @Resource는 잘 사용되지 않나요?
서비스나 DAO 에서 빈 만들때 @Service/@Repository("name..") 이렇게 이름을 지정해 주고사용할때 @Resource("name..") 이렇게 사용하는데 이 방법이 아래 보다 심플해서 괜찮다 싶었는데 타입safe하지 않아서 추천하지 않는건가요?@Autowired@Qualifier("name..")보통의 경우는 @Autowired 이렇게만 사용하고는 있습니다.
-
미해결웹 게임을 만들며 배우는 자바스크립트
엔터....
var dap = promt('dap') # 엔터를 치면VM499:1 Uncaught ReferenceError: promt is not definedat :1:11 #이렇게 자꾸 뜨는데 다른분들은 소스를 넣을때 엔터를 안치시는 건가요???
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
Vuex의 state 및 mutations를 사용한다면..
강의 정말 잘 보고 있습니다 강사님.해당 섹션까지 보고 난 후 궁금사항이 생겼습니다.앞서 배운데로 props와 emit를 이용하여 컴포넌트간 데이터 교환방법을 익혔는데,Vuex의 state와 mutations로 리팩토링을 하는 것을 보면서실무에서 props와 emit은 사용할 일이 없어보이는데,두가지 데이터 전송방법이 어떤 경우에 각각 사용이 되고, 사용하는 것이 유리한지 궁금합니다.질문을 제대로 한건지 모르겠네요.. ^^;
-
미해결아이폰 앱 개발 입문 2편
딕셔너리 관련 질문입니다.
딕셔너리 실습을 진행하던 중처음 딕셔너리를 생성할 때 값이 입력된 순서와 다르게 출력되고값을 추가해도 위치가 일정하지 않게 들어갑니다.키 값이 있기 때문에 이것들은 상관이 없는 건가요?
-
미해결[R을 R려줘] R 문법 기초
이 강의에 부속된 퀴즈 문제에 오류가 있습니다.
이 강의에 부속된 퀴즈 문제에 오류가 있습니다.첫 번째 문제는, '틀린 것' 을 고르라고 되어 있는 문제인데, 실제로는 한 개의 보기를 제외하고 다른 모든 보기가 틀린 것입니다. 그래서, 맞는 한 개의 보기를 선택하니 정답이라고 판정이 나오네요. 수정이 필요ㅏㄹ 것 같습니다.
-
미해결홍정모의 따라하며 배우는 C++
따라하는 중에 클래스 B에 있는데 m_b값을 출력하고 싶은데...안되네요ㅠㅠ
'''include include using namespace std;class B{int m_b;public:B(const int& m_b_in): m_b(m_b_in){}void print(){cout << m_b << endl;}};class Something{int m_i;double m_d;char m_c;int m_arr[5];B m_b;public:Something(): m_i(1), m_d(3.14), m_c('a'), m_arr{1,2,3,4,5}, m_b(m_i - 1){m_i = 4;m_d = 5;m_c += 10;}void print(){cout << m_i << " " << m_d << " " << m_c << endl;//cout << << m_i << " " << m_d << " " << m_c << " " << m_b.print() << endl;//(이렇게도 해봤는데 이러한 피연산자와 일치하는 "<<"연산자가 없습니다. 라고 뜹니다ㅠㅠ)for (auto &ele : m_arr)cout << ele << " ";cout << endl;}};int main(){Something som;som.print();B bb; //B클래스의 기본 생성자가 없습니다.bb.print();system("pause");return 0;}'''B bb;로 클래스 B형식의 인스턴스 bb를 만들었는데 "B클래스의 기본 생성자가 없습니다.' 라는 에러메세지가 뜹니다. B클래스의 생성자가B(const int& m_b_in): m_b(m_b_in){}이거 아닌가요??
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
지금 강의시 사용하시는 판서 프로그램이 무엇인지 알려주실수 있으세요?
지금 강의시 사용하시는 판서 프로그램이 무엇인지 알려주실수 있으세요?파워 포인트 위에 특정 프로그램을 사용해서 밑줄을 그으시는 것 같은데 알려주세욤.오늘 부터 강의 듣기 시작입니다.
-
미해결스프링 기반 REST API 개발
MockMvc를 활용하는 테스트에서 403 에러가 발생하는 문제
안녕하세요 기선님,강의를 따라하다가 잘 되지 않는 부분이 있어서 질문 남깁니다.강의 내용과 정말 똑같이 따라치고 있는데--github의 코드와도 대조해보았습니다--이상하게 mockMvc를 통해 테스트를 하는 부분 전체에서 결과값이 403으로 떨어지네요.구글링 해보니 @WebMvcTest를 사용하는 경우 webapplicationcontext를 가져오도록 하라는 가이드만 나오고, @AutoConfigureMockMvc를 사용하는 경우는 사례를 찾기가 좀 어렵습니다.제가 어떤 부분을 좀 살펴보아야 할 지 도움을 주실 수 있을까요?에러 메시지는 다음과 같습니다.MockHttpServletRequest: HTTP Method = POST Request URI = /api/events/ Parameters = {} Headers = [Content-Type:"application/json;charset=UTF-8", Accept:"application/hal+json"] Body = {"id":100,"name":"Spring","description":"REST API Development with Spring","beginEnrollmentDateTime":"2018-11-23T14:21:00","closeEnrollmentDateTime":"2018-11-24T14:21:00","beginEventDateTime":"2018-11-25T14:21:00","endEventDateTime":"2018-11-26T14:21:00","location":"강남역 D2 스타텁 팩토리","basePrice":100,"maxPrice":200,"limitOfEnrollment":100,"offline":false,"free":true,"eventStatus":"PUBLISHED"} Session Attrs = {org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@553d828a}Handler: Type = nullAsync: Async started = false Async result = nullResolved Exception: Type = nullModelAndView: View name = null View = null Model = nullFlashMap: Attributes = nullMockHttpServletResponse: Status = 403 Error message = Forbidden Headers = [X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = []MockHttpServletRequest: HTTP Method = POST Request URI = /api/events/ Parameters = {} Headers = [Content-Type:"application/json;charset=UTF-8", Accept:"application/hal+json"] Body = {"id":100,"name":"Spring","description":"REST API Development with Spring","beginEnrollmentDateTime":"2018-11-23T14:21:00","closeEnrollmentDateTime":"2018-11-24T14:21:00","beginEventDateTime":"2018-11-25T14:21:00","endEventDateTime":"2018-11-26T14:21:00","location":"강남역 D2 스타텁 팩토리","basePrice":100,"maxPrice":200,"limitOfEnrollment":100,"offline":false,"free":true,"eventStatus":"PUBLISHED"} Session Attrs = {org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@553d828a}Handler: Type = nullAsync: Async started = false Async result = nullResolved Exception: Type = nullModelAndView: View name = null View = null Model = nullFlashMap: Attributes = nullMockHttpServletResponse: Status = 403 Error message = Forbidden Headers = [X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = []java.lang.AssertionError: Status Expected :400Actual :403 <Click to see difference> at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:55) at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:82) at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:619) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:195) at com.rest.api.events.EventControllerTests.createEvent_Bad_Request(EventControllerTests.java:151) 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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
아나콘다 네비게이터UI와 프롬포트 모드에서의 생성된 계정 차이
안녕하세요강의 열심히 보고 있습니다강의 내용을 실습하며 따라하던 도중에 아나콘다 프롬포트 모드에서 test1, 2 계정을 생성하고 아나콘다 네비게이터UI를 실행하면 강사님께서는 UI모드에서 프롬포트에서 만든 test1,2 계정이 보이고 있는데 저는 보이지 않고 있습니다.. UI모드에서 create해도 프롬포트모드에서는 보이는데 (anaconda info --envs) UI에서는 안보이는 이유가 무엇일까요 ㅜㅜ