묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
optimize-anchors 문의
안녕하세요. 매번 초보적인 질문인듯 하여 부끄럽지만 또 문의 드립니다. 앵커박스를 최적화하는 코드를 알려주시는 부분에서 관련된 github으로 이동했더니 업데이트가 되어 있더군요. 업데이트로 인해 폴더 구조도 조금 변경되었더라구요. 요점은 그냥 업데이트 된 상태 그대로 클론해서 설치하고 최종적으로 python ~으로 실행을 시켰는데 아래와 같은 오류 메세지가 발생하네요.
-
미해결[리뉴얼] 파이썬입문과 크롤링기초 부트캠프 [파이썬, 웹, 데이터 이해 기본까지] (업데이트)
뉴스 크롤링 코드 관련 문의합니다.
크롤링하기 수업을 듣는 중에 크롤링을 하는 과정에서 import requests from bs4 import BeautifulSoup res=requests.get('http://www.hani.co.kr/arti/society/health/965832.html') soup=BeautifulSoup(res.content,'html.parser') data=soup.find('h4') data.get_text() 결과가 \n\n코로나19 신규 확진자 110명…요양병원 집단감염 영향\n\n' 글자 옆에 돈표시같은게 같이 나와서 import requests from bs4 import BeautifulSoup res=requests.get('http://www.hani.co.kr/arti/society/health/965832.html') soup=BeautifulSoup(res.content,'html.parser') data=soup.find('span', 'title') data.get_text() 하니까 '코로나19 신규 확진자 110명…요양병원 집단감염 영향' 으로 나오는데요. h4와 span의 차이가 궁금합니다. 크롤링한 뉴스 html이미지로 첨부합니다. 크롤링한 뉴스url입니다. http://www.hani.co.kr/arti/society/health/965832.html 그리고 뉴스의 텍스트 추출하는 과정에서 import requests from bs4 import BeautifulSoup res=requests.get('http://www.hani.co.kr/arti/society/health/965832.html') soup=BeautifulSoup(res.content,'html.parser') mydata=soup.find('div', 'text') mydata.get_text() 이렇게 했는데 아무것도 안뜹니다. 왜 아무것도 안뜰까요? 오류메시지도 안뜨고 아무것도 안떠요
-
실전! 스프링 데이터 JPA
postman으로 테스트 시 접근권한 설정에 대해
삭제된 글입니다
-
미해결자바스크립트 비기너: 튼튼한 기본 만들기
강의 내용 관련하여 질문사항입니다!
안녕하세요. 이직을 준비하면서 기본기를 다지기 위해서 강의를 결제하여 듣고있는 학생입니다. 혹시 해당 내용을 공부하면서 제 벨로그에 기재하여도 될까요?? 상업적인 목적이 아닌 순수하게 저의 공부를 기록해두는 목적입니다. 답변 부탁드리겠습니다^^ 감사합니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
원초적인게 궁금합니다
1. em.find(Member.class, id) 부분에서 Member.class는 Member 클래스 자체를 반환하는 건가요?? 2. member 객체에 username만 저장된 상태애서 save메서드를 실행시킴으로써 id가 반환되고 반환된 id로 find메서드를 통해 findMember 객체에 id에 해당되는 정보를 넘겨줍니다. 제가 이해한게 맞나요??
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
nextjs 사이클방식이 헷갈립니다.
제로초님 nextjs 사이클이 헷갈려서 질문 드려도 될까요??? 함수형 컴포넌트에서 return 전에 함수 또는 변수는 serverd와 브라우저 둘다 실행되는 건가요?? (useEffect함수는 브라우저에서만 실행되는걸로 알고 있습니다 하지만 커스텀으로 만든 함수는 서버에서도 실행되는것 같더라구요) 어떤건 브라우저 서버 둘다 실행되고 어떤건 서버만 또는 브라우저만 실행되는거 같아 헷갈립니다...ㅠ
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
@Embeddable 사용시 질문 입니다.
안녕하세요 강사님 @Embeddable 어노테이션 관련 부분을 실습 하고 있는데요 @Getter@Setter@Embeddablepublic class Ex18Period {// @Column(name = "STARTDATE") private LocalDateTime startDate; private LocalDateTime endDate; public Ex18Period() { } public Ex18Period(LocalDateTime startDate, LocalDateTime endDate) { this.startDate = startDate; this.endDate = endDate; } public boolean isWork(){ return startDate.isAfter(endDate); }} 위와 같이 코드를 구성하고 실습 중입니다. 빌드 및 테이블 생성은 모두 잘 되고 있는데 인텔리 J에서 메서드 이름에 에러를 표시하고 있어서요; 에러 문구 For property-based access both setter and getter should be present 관련되서 찾아 보았는데 Preferences -> Editor -> Inspections -> JPA 검색 후 Persistent attribute signature checks 옵션을 체크 해제 하면 더 이상 에러 메시지는 출력 되지 않습니다. 이렇게 하면 에러 메시지가 출력이 되지 않더라구요 인텔리J Persistent attribute signature checks 디스크립션을 보면 아래와 같이 설명 되어 있구요 This inspection checks for the following JPA specification errors: More than one attribute configured for method/field Attribute cannot be used in Embeddable object (JPA 1.0) Persistent attribute metadata should be specified on field or property getter For property-based access both setter and getter should be present 실행은 잘 되고 메소드 호출도 잘 되는데; IDE에서 저렇게 메시지를 출력해 주는데 혹시 강사님도 똑같이 발생하시나요? 혹시 해당 메시지가 문제가 있는것은 아닌지 궁금하기도 해서 문의 드려 봅니다. 제가 사용하는 인텔리J 버전은 아래와 같습니다. IntelliJ IDEA 2020.1.4 (Ultimate Edition) Build #IU-201.8743.12, built on July 21, 2020
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
데이터베이스에서 받아온 데이터를 to.JSON() 다시 감싸는 이유가 무엇인가요?
데이터베이스에서 가져온 데이터를 다시 to.JSON 메서드에 감싸는 이유는 무엇인가요?? 그리고 to.JSON 메서드가 정확히 어떤 역할을 하는지 궁금합니다.
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
reducer에 ADD_COMMENT_SUCCESS 부분 코드가 실행이안되는데요
댓글입력창에서 입력하고 삐약버튼누르면 계속 로딩중으로 떠서 콘솔 찍어보니 위의 부분에서 에러가 뜨는것같습니다. 해당코드를 주석처리하면 콘솔에 '실행완료'가 뜨는데 주석풀면 안뜨고요 에러 내용은 이렇게 뜨는데 혹시 어떤게 문제인지 알수있을까요,,? 어제부터 고통받고있습니다 ㅠ
-
미해결파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
공주구하기
공주구하기 문제에 대해 질문있습니다. 저는 강사님과 조금 다르게 풀었습니다. input_list에 들어있는 요소의 개수가 k보다 작을 때, k가 짝수라면 input_list[1]이 답이 되고 k가 홀수라면 input_list[-1]이 답이 되는 규칙을 찾았습니다. 임의의 예시를 만들어 해당 규칙을 적용시켜보니, 모든 사례에 이 규칙이 성립하는 것을 발견하였습니다. 해당 규칙을 토대로 알고리즘을 작성하여 채점기를 돌려보았는데, in3.txt에 대해서만 wrong answer를 유발합니다. 제가 찾은 규칙이 잘못된 것인지, 아니면 코드의 다른 부분에 문제가 있는지 궁금합니다. 자세한 답변 부탁드립니다. 감사합니다. import sys sys.stdin = open(r"C:\Users\my\Desktop\Documents\파이썬 알고리즘 문제풀이(코딩테스트 대비)\섹션 5\5. 공주구하기\in3.txt") n, k = list(map(int, input().split())) input_list = list(range(1, n + 1)) def save_princess(input_list, k): while True: if len(input_list) >= k: input_list.pop(k-1) for i in range(k-1): input_list.append(input_list.pop(0)) else: if k % 2 == 0: result = input_list[1] print(result) break else: result = input_list[-1] print(result) break save_princess(input_list, k)
-
미해결초보자도 만들 수 있는 스크롤 인터렉션. 1편 자바스크립트
왜 data 값을 못 찾는 걸까요?
강의를 보고 이해한거 토대로 직접 코드를 작성해보았는데요. 다 맞게 작성한 것 같은데 무한스크롤이 안됩니다.ㅠㅠ 로그를 찍어보니 data 변수가 제대로 선언되지 않은 것 같은데 왜 그런걸까요?... 선언하는 위치상으로도 문제가 없는 것 같은데 왜 안되는지 도통 모르겠네요 ㅠㅠ <!doctype html> <html lang="ko"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-compatible" content="chrome=1,IE=edge"> <title>깡코딩 - 초보자도 만들 수 있는 스크를인터렉션1편</title> <link rel="stylesheet" type="text/css" href=""> <link rel="stylesheet" type="text/css" href="../../library/css/common.css"> <script type="text/javascript" src="../../library/js/jquery.1.12.4.js"></script> </head> <style type="text/css"> .com_tit {margin:100px 0 80px; font-size:70px; text-align: center;} .sc_infinity {} .sc_infinity .list {} .sc_infinity .list:after {clear:both; display:block; content:'';} .sc_infinity .list li {float:left; width:25%;} .sc_infinity .list li figure {padding:10px;} .footer {height:200px; background-color: #ddd;} .footer p {padding:50px 20px;} </style> <body> <div class="wrap"> <section class="sec01"> <h2 class="com_tit">INFINITE SCROLL</h2> <article class="sc_infinity"> <ul class="list"> <li> <figure> <img src="../images/1.jpg"> </figure> </li> <li> <figure> <img src="../images/2.jpg"> </figure> </li> <li> <figure> <img src="../images/3.jpg"> </figure> </li> <li> <figure> <img src="../images/1.jpg"> </figure> </li> <li> <figure> <img src="../images/2.jpg"> </figure> </li> <li> <figure> <img src="../images/3.jpg"> </figure> </li> </ul> </article> <div class="footer"> <p>FOOTER</p> </div> </section> </div> <script> $(function(){ var target = $('.list'), winTop = $(window).scrollTop(), onTop = $(document).height() - $(window).height() - $('.footer').height(), breakList = 10, listCount = 0; function getList(){ var list; listCount++; if(listCount > breakList){ list = null; } else{ list = '<li><figure><img src="../images/1.jpg"></figure></li>'; list += '<li><figure><img src="../images/2.jpg"></figure></li>'; list += '<li><figure><img src="../images/3.jpg"></figure></li>'; } return list; } function listCall(){ if(winTop >= onTop){ var data = getList(); if(data !== null){ target.append(data); } else{ return false; } } } console.log(data); $(window).scroll(function(){ listCall(); }); function init(){ listCall(); } init(); }); </script> </body> </html>
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
제로초님 제가 블로그를 타입스크립트와 next.js로 만들려고하는데요
안녕하십니까 !! 제가 개인 블로그를 제로초님의 교육 덕분에 만들긴 만들었습니다. 그런데 cra를 이용해서 만들었어서 몇일 전에 배포하고 난 뒤 조금 아쉬운거 같아서 이번에는 제대로 typescript와 next.js로 만들어서 다시 배포하려고합니다.!! 그런데 next의 여기 리듀서 설정하는 곳에서 좀 헷갈려서 질문을 드립니다. import { HYDRATE } from 'next-redux-wrapper'; import { combineReducers } from 'redux'; import user from './user' const rootReducer = combineReducers({ index: (state: {} = {}, action) => { switch (action.type) { case HYDRATE: return { ...state, ...action.payload }; default: return state; } }, user }); export type RootState = ReturnType<typeof rootReducer> export default rootReducer; 제가 검색을 해보아도 원하는 답이 안나와서 그런데 혹시 여기서 고칠점이 있나요?? 감사합니다.!!
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
editable 구현 관련 문의 드립니다.
antd 의 테이블 구현 관련 궁금한 부분을 문의 드리고 싶습니다. antd 의 EditableTable, ResizableTitle, infinite scroll(react)를 적용해 보려하고 있습니다. 1. 테이블 헤드 가로 사이즈 변경이 먹지 않습니다. (예제 코드를 약간 변경해서 적용했습니다.) 2. 편집시 <td> padding과 Edit button 클릭시 td 안에 <input> padding 을 유지시 셀의 세로 높이가 바뀌는 문제가 있어서 Edit button 클릭시에도 동일하게 padding를 유지하도록 <td> className을 주어 padding를 주려고 합니다. 어느 부분이 잘못되어 있는지 코드 체크 부탁드립니다. // import { VariableSizeGrid as Grid } from 'react-window'; // import ResizeObserver from 'rc-resize-observer'; // import classNames from 'classnames'; import React, { useState, useEffect, useRef } from 'react'; import { Resizable } from 'react-resizable'; import { Table, Input, InputNumber, Popconfirm, Form } from 'antd'; import styled, { createGlobalStyle } from 'styled-components'; const Global = createGlobalStyle` .editable-row, .ant-form-item-explain { position: absolute; top: 100%; font-size: 12px; } table thead tr th { height: 10px;} table tbody tr th { height: 10px;} .editable row { height: 10px;} #components-table-demo-resizable-column .react-resizable { position: relative; background-clip: padding-box; } #components-table-demo-resizable-column .react-resizable-handle { position: absolute; right: -5px; bottom: 0; z-index: 1; width: 10px; height: 100%; cursor: col-resize; } .antd-table > tr > td { padding: 0; } .antd-form-control-input-content > input { padding: 11px 11px; } `; const originData = []; for (let i = 0; i < 100; i++) { originData.push({ key: i.toString(), name: `Edrward ${i}`, age: i, address: `London Park no. ${i}`, // description: name + ' ' + age +' '+ address, }); } const ResizableTitle = props => { const { onResize, width, ...restProps } = props; if (!width) { return <th {...restProps} />; } return ( <Resizable width={width} height={0} handle={ <span className="react-resizable-handle" onClick={e => { e.stopPropagation(); }} /> } onResize={onResize} draggableOpts={{ enableUserSelectHack: false }} > <th {...restProps} /> </Resizable> ); }; const EditableCell = ({ editing, dataIndex, title, inputType, record, index, children, ...restProps }) => { const inputNode = inputType === 'number' ? <InputNumber /> : <Input />; return ( ======================================== {editing ? ( <td {...restProps} className="padding0"> <Form.Item name={dataIndex} style={{ margin: 0, }} rules={[ { required: true, message: `Please Input ${title}!`, }, ]} > {inputNode} </Form.Item> </td> ) : ( <td {...restProps}> children </td> ) } ); }; ============================================ const EditableTable = () => { const [form] = Form.useForm(); const [data, setData] = useState(originData); const [editingKey, setEditingKey] = useState(''); const isEditing = (record) => record.key === editingKey; const edit = (record) => { form.setFieldsValue({ name: '', age: '', address: '', ...record, }); setEditingKey(record.key); }; const cancel = () => { setEditingKey(''); }; const save = async (key) => { try { const row = await form.validateFields(); const newData = [...data]; const index = newData.findIndex((item) => key === item.key); if (index > -1) { const item = newData[index]; newData.splice(index, 1, { ...item, ...row }); setData(newData); setEditingKey(''); } else { newData.push(row); setData(newData); setEditingKey(''); } } catch (errInfo) { console.log('Validate Failed:', errInfo); } }; const columns = [ { title: 'name', dataIndex: 'name', width: 100, editable: true, sorter: (a, b) => a.name.length - b.name.length, }, { title: 'age', dataIndex: 'age', width: 80, editable: true, sorter: (a, b) => a.age - b.age, }, { title: 'address', dataIndex: 'address', width: 200, editable: true, sorter: (a, b) => a.address.length - b.address.length, }, { title: 'operation', dataIndex: 'operation', render: (_, record) => { const editable = isEditing(record); return editable ? ( <span> <a href="javascript:;" onClick={() => save(record.key)} style={{ marginRight: 8, }} > Save </a> {/* <Popconfirm title="Sure to cancel?" onConfirm={cancel}> <a>Cancel</a> </Popconfirm> */} <a href="javascript:;" onClick={cancel} style={{ marginRight: 8 }}> Cancel </a> </span> ) : ( <a disabled={editingKey !== ''} onClick={() => edit(record)}> Edit </a> ); }, }, ]; const handleResize = index => (e, { size }) => { this.setState(({ columns }) => { const nextColumns = [...columns]; nextColumns[index] = { ...nextColumns[index], width: size.width, }; return { columns: nextColumns }; }); }; const mergedColumns = columns.map((col, index) => { if (!col.editable) { return col; } return { ...col, onHeaderCell: column => ({ width: column.width, onResize: handleResize(index), }), onCell: (record) => ({ record, inputType: col.dataIndex === 'age' ? 'number' : 'text', dataIndex: col.dataIndex, title: col.title, editing: isEditing(record), }), }; }); const onChange = (pagination, filters, sorter, extra) => { console.log('params', pagination, filters, sorter, extra); } return ( <Form form={form} component={false}> <Table components={{ header: { cell: ResizableTitle, }, body: { cell: EditableCell, }, }} expandable={{ expandedRowRender: record => <p style={{ margin: 0 }}>{record.description}</p>, rowExpandable: record => record.name !== 'Not Expandable', }} bordered dataSource={data} columns={mergedColumns} rowClassName="editable-row" onChange={onChange} scroll={{ y: 400 }} pagination={false} /> </Form> ); }; export default EditableTable;
-
미해결단 두 장의 문서로 데이터 분석과 시각화 뽀개기
colab에서 to_csv하면 저장이 안되나요?
강의 잘 듣고 있습니다. 강사님 실습데이터를 다운로드후 제 구글드라이브의 colab에 저장해놓고 실행하였습니다. to_csv 후 read_csv결과도 제대로 확인했는데 이상하게 제 구글드라이브에서 생성되어야하는 csv는 찾을 수 없네요. 혹시 이에 대해 아시는게 있으신가요?
-
해결됨Vue.js - Django 연동 웹 프로그래밍 (실전편)
wsgi 실행 참조
manage.py 대신, wsgi.py 설정으로 실행하는 방법에 대한 참조입니다. https://wayhome25.github.io/django/2018/03/04/django-deploy-04-uwsgi/
-
미해결MQTT 사물인터넷 통신 프로젝트 (Arduino, MQTT, Node.js, mongoDB, Android)
npm insatll을 눌러도 자꾸 아래 메시지가 떠요 ㅠ cmd로도 했는데 똑같아요..
audited 101 packages in 0.684s found 4 vulnerabilities (3 low, 1 critical) run `npm audit fix` to fix them, or `npm audit` for details
-
미해결윤재성의 만들면서 배우는 Spring MVC 5
오전에 사진업로드 질문한 사람입니다.
업로드 폼이 브라우저 마다 다르다고 하셔서 지금까지 이클립스에서 작업하던걸 멈추고 크롬으로 했더니 정상 작동 했습니다. 정말로 감사합니다.
-
미해결초보를 위한 도커 안내서
mysql 이 작동하질않습니다.
설명자료에 있는 명령어를 복사해서 입력했는데 정상작동하질 않네요 ㅠㅠ
-
미해결홍정모의 게임 만들기 연습 문제 패키지
factory pattern의 스마트 포인터화 시켜봤는대 이게 맞는지 모르겠네요
//Example클래스는 변함이 없고 namespace jm { class Example : public Game2D { float time = 0.0f; std::vector<std::shared_ptr <Shape>> my_objs; public: Example() : Game2D() { my_objs.push_back(Shape::makeTriangle(Colors::gold, vec2{ -0.5f,0.2f }, 0.25f)); my_objs.push_back(Shape::makeCircle(Colors::olive, vec2{ -0.1f,0.1f }, 0.2f)); my_objs.push_back(Shape::makeBox(Colors::black, vec2{ 0.0f,0.5f }, 0.1f, 0.3f)); my_objs.push_back(Shape::makeStar(Colors::gold, vec2{ 0.0f,-0.5f }, 0.25f,0.15f)); //my_objs.push_back(new Triangle(Colors::gold, { -0.5f,0.2f }, 0.25f)); //my_objs.push_back(new Circle(Colors::olive, { -0.1f,0.1f }, 0.2f)); //my_objs.push_back(new Box(Colors::black, { 0.0f,0.5f }, 0.1f, 0.3f)); } ~Example() { } void update() override { for (const auto &obj : my_objs) { obj->draw(); } } }; //shape.h의 static 함수들을 shared_ptr화 시켜주는 작업 #pragma once #include "Game2D.h" #include "Shape.h" namespace jm { class Shape { public: vec2 pos; RGB color; void init(const RGB& _color, const vec2& _pos,float _r=0.0f) { this->color = _color; this->pos = _pos; } virtual ~Shape() { } virtual void drawShape() const = 0; //pure virtual classes void draw() { beginTransformation(); { translate(this->pos); drawShape(); } endTransformation(); } static std::shared_ptr<Shape> makeTriangle(const RGB& _color, const vec2& _pos, const float& _size); static std::shared_ptr <Shape> makeCircle(const RGB& _color, const vec2& _pos, const float& _size); static std::shared_ptr<Shape> makeBox(const RGB& _color, const vec2& _pos, const float& _width, const float& _height); static std::shared_ptr<Shape> makeStar(const RGB& _color, const vec2& _pos, const float& _outer_radius, const float& _inner_radius); }; } //이렇게 해준 후 //Shape.cpp #include "Shape.h" #include"Triangle.h" #include"Circle.h" #include"Box.h" #include"Star.h" namespace jm { std::shared_ptr<Shape> Shape::makeTriangle(const RGB& _color, const vec2& _pos, const float& _size) { return std::make_shared<Triangle>(_color, _pos, _size); } std::shared_ptr <Shape> Shape::makeCircle(const RGB& _color, const vec2& _pos, const float& _size) { return std::make_shared<Circle>(_color, _pos, _size); } std::shared_ptr <Shape> Shape::makeBox(const RGB& _color, const vec2& _pos, const float& _width, const float& _height) { return std::make_shared <Box>(_color, _pos, _width, _height); } std::shared_ptr <Shape> Shape::makeStar(const RGB& _color, const vec2& _pos, const float& _outer_radius, const float& _inner_radius) { return std::make_shared <Star>(_color, _pos, _outer_radius, _inner_radius); } } //위에처럼 바꿔주면 돼는거 같은대 //소멸자가 정상적으로 호출되는거 같거든요 cout 찍어보니까 //맞나요?
-
미해결요즘 누가 유료로 웹서비스 구축 하나, Firebase의 모든것
Uncaught ReferenceError: firebase is not defined 오류
Firebase가 선언되지 않았다는 오류가 뜹니다... 해결방법 알려주시면 감사하겠습니다! var firebaseConfig = {...}; // Initialize Firebase firebase.initializeApp(firebaseConfig); $(document).ready(function (user){ firebase.auth().onAuthStateChanged(function (user){ if (user) {console.log('log',user);} else {console.log('err','not yet')} }); }); function login(){ firebase.auth().createUserWithEmailAndPassword($("txtemail").val(), $("txtpasswd")).catch(function(error) { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; // ... }); }