묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기
간단한거 같은데, 몇시간동안 이유를 못찾아서 이렇게 글 남깁니다..
console log 찍으면 false 와 true 값은 변하는데, 클라이언트에서 뎁스에 있는 코멘트를 펼치는게 작동하지 않는데, 왜 그런건지 이유를 찾을 수가 없어서요.. https://github.com/lhj1004ss/youtube_clone
-
미해결[백문이불여일타] 데이터 분석을 위한 고급 SQL
강의완 관련없지만 중급sql강의 만료되서 연장가능한가요?
업무하다가 union 이랑 join group by에서 막혀서 초급/ 중급 강의 다시 찾아갔는데알고보니 3개월만료기간이있던강의들이었더라구요그래서 만료됬는데기존강의구매자들에한해서 만료기간없애거나 하실생각은없나요?
-
미해결홍정모의 따라하며 배우는 C언어
10.16 2차원 배열 arr2d의 역참조 횟수가 이해가 잘 안됩니다.
arr2d[0][0]와 **arr2d가 같다고 말씀하시는 부분에서 의문이 들어 질문드립니다. arr2d 자체가 전에 강의에서 설명 하신것처럼 이중포인터가 아니라 그냥 2차원 배열이라 주소자체가 따로 저장되는게 아니라서 주소가 한단계 밖에 없는데 arr2d의 역참조(*)가 두번이나 될수 있는게 이해가 잘안되네요ㅠ 설명부탁드립니다!
-
해결됨스프링과 JPA 기반 웹 애플리케이션 개발
패키지 구조 관련 질문입니다.
안녕하세요. 어제 라이브 재밌었습니다.신세경.. 미국엔 잘 돌아가셨는지 궁금하네요..ㅎㅎ 다름이 아니고, 강의를 보고 개인 프로젝트를 진행하려고 하는데 패키지 구조를 도메인형으로 해야할지, 계층형으로 해야 할지에서 부터 고민이 되어 질문드립니다. 기선님 강의에서는 도메인으로 나뉘었고, 펫클리닉 프로젝트도 찾아보니 도메인으로 나눠놓았더라구요 제가 본 여타 다른 강의들에서는 컨트롤러/서비스/레포지토리/exception/ 등등으로 나눠놓은 걸 보아 어떤 것이 정답이다 라는 것은 없는것 같기도하고.. 해서 블로그 글을 참고해서 보니https://cheese10yun.github.io/spring-guide-directory/도메인이 더 낫다는 글을 보았습니다. 기선님 강의들에서는 더 나은 패키지구조 선택에 관해서 언급하셨던 기억이 없어서 질문드려요! 너무 좋은 강의 만들어주셔서 감사합니다. 많은 도움이 되고 있어요 :)
-
미해결실시간 트렌드 홈페이지 개발(파이썬 크롤링 + Flask)
네이버 쇼핑 핫딜 크롤링 문제
네이버 쇼핑 핫딜 데이터를 크롤링하는 과정에서 강의에서는 핫딜 버튼의 ClassName이 '_productSet_hotdeal'로 되어있어 driver.find_element_by_class_name("_productSet_hotdeal").click() 코드를 사용하여 버튼을 클릭했지만, 현재는 네이버 쇼핑 소스가 변경되어 모든 버튼의 ClassName이 'subFilter_filter__3Y-uy'로 되어있어 driver.find_element_by_css_selector("#__next > div > div.container > div.style_inner__18zZX > div.style_content_wrap__1PzEo > div.style_content__2T20F > div.seller_filter_area > ul > li:nth-child(5) > button").click() 코드를 사용하여 버튼을 클릭하였습니다. 문제는, 버튼 클릭까지는 문제 없이 진행 되었지만 핫딜 페이지의 데이터를 출력하는 과정에서 핫딜 데이터를 출력하는 것이 아닌 기존의 데이터를 출력합니다. 어떻게 해결해야 될까요? - app.py from flask import Flask, render_template, request app = Flask(__name__) # crawling module import import requests from bs4 import BeautifulSoup # excel module import from openpyxl import Workbook write_wb = Workbook() write_ws = write_wb.active # 셀리니움 사용 전 크롬 웹드라이버 설치 # Web automation module import from selenium import webdriver @app.route("/") def hello_world(): return render_template("index.html") @app.route("/result", methods=["POST"]) def result(): keyword = request.form['input1'] page = request.form['input2'] daum_list = [] # crawling for i in range(1, int(page) + 1): req = requests.get("https://search.daum.net/search?nil_suggest=btn&w=news&DA=PGD&cluster=y&q=" + keyword + "&p=" + str(i)) soup = BeautifulSoup(req.text, "html.parser") for i in soup.find_all("a", class_="f_link_b"): daum_list.append(i.text) # excel for i in range(1, len(daum_list) + 1): write_ws.cell(i, 1, daum_list[i-1]) write_wb.save("static/result.xlsx") return render_template("result.html", daum_list = daum_list) @app.route('/naver_shopping') def naver_shopping(): driver = webdriver.Chrome('./chromedriver.exe') driver.implicitly_wait(3) driver.get("https://search.shopping.naver.com/search/all?query=%EA%B3%B5%EA%B8%B0%EC%B2%AD%EC%A0%95%EA%B8%B0&frm=NVSHATC&prevQuery=%EA%B3%B5%EA%B8%B0%EC%B2%AD%EC%A0%95%EA%B8%B0") soup = BeautifulSoup(driver.page_source, "html.parser") for i in soup.select("#__next > div > div.container > div.style_inner__18zZX > div.style_content_wrap__1PzEo > div.style_content__2T20F > ul > div > div > li"): print(i.find("a", class_="basicList_link__1MaTN").text) print("---------------------------") driver.find_element_by_css_selector("#__next > div > div.container > div.style_inner__18zZX > div.style_content_wrap__1PzEo > div.style_content__2T20F > div.seller_filter_area > ul > li:nth-child(5) > button").click() soup = BeautifulSoup(driver.page_source, 'html.parser') for i in soup.select("#__next > div > div.container > div.style_inner__18zZX > div.style_content_wrap__1PzEo > div.style_content__2T20F > ul > div > div > li"): # 핫딜 페이지로 정상적으로 이동되어 있지만 기존의 페이지의 데이터를 출력함 print(i.find("a", class_="basicList_link__1MaTN").text) return render_template("shopping.html") if __name__ == "__main__": app.run() - 실행결과
-
해결됨홍정모의 따라하며 배우는 C언어
빌드 에러
프로젝트를 생성한 후에 실행시키기 위해 Build Solution을 눌렀더니 아래 사진과 같이 에러가 잔뜩 뜹니다.. 프로젝트 지우고 다시 만들어봐도 여전히 에러가 뜨네요 어떻게 해결해야 할까요?
-
미해결공공데이터로 파이썬 데이터 분석 시작하기
선생님 isnull과 isna의 차이는 무엇인가요?
선생님 isnull과 isnan의 차이는 무엇인가요?
-
미해결[리뉴얼] 처음하는 MongoDB(몽고DB) 와 NoSQL(빅데이터) 데이터베이스 부트캠프 [입문부터 활용까지] (업데이트)
jupyter notebook에서 pymongo import가 안 돼요...
mac이고 terminal에서 pip3.8 install pymongo 해서 인스톨 했고 vscode에서는 pymongo 사용이 아주 잘 됩니다. 그런데 쥬피터 노트북에선 아무리 컴퓨터를 껐다 켜도 pymongo 임포트가 안 되네요... 무엇이 문제일까요?
-
미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 확인 부탁드립니다.
dic은 처음에 주어진다고 가정을 하고 작성을 해 보았습니다. def value_key_back(i): user_dic = {"America": 1, "Korea": 82, "China": 86, "Japan": 81} user_key_list = list(user_dic.keys()) user_value_list = list(user_dic.values()) key_index_num = user_value_list.index(i) result = user_key_list[key_index_num] return result print('user_dic = {"America": 1, "Korea": 82, "China": 86, "Japan": 81}') dic_value = int(input("Input any value: ")) print("The Key is {0}". format(value_key_back(dic_value)))
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
Connect를 이용하여 여러소켓 생성후 문제점
안녕하세요 루키스님 정말 강의 도움 많이 받고 있어요 !!소켓을 10번 생성과함께 커넥트를 요청하는 부분에0.1초 딜레이를 주면 (*대부분*) 잘작동하더라구요 하지만, 저 딜레이를 빼면 아래 그림과같은 에러가 나와요! 저는 이것을 비동기에서 발생하는 문제점이라고 생각했습니다. 그래서 Receive에 _lock을 걸어서 실험도해봤지만여전히 같은 오류를 내고 있더라구요 혹시 이런 에러가 발생하는 부분의 가능성이나해결방법이 어떤게 있을까요? 딜레이를 주는경우대부분 잘되는것은 비동기 문제가 맞는걸까요?
-
미해결홍정모의 따라하며 배우는 C++
멀티쓰레딩 예제 실행시간 재질문
말씀하신 코드는 다음과 같습니다 #include<iostream> #include<chrono> #include<mutex> #include<random> #include<thread> #include<utility> #include<vector> #include<atomic> #include<future> #include<numeric> //std::inner_product #include<execution> // parallel_execution using namespace std; mutex mtx; void dotProducNaive(const vector<int>& v0, const vector<int>& v1, const unsigned i_start, const unsigned i_end, unsigned long long& sum) { for (unsigned i = i_start; i < i_end ; i++) { sum += (v0[i] * v1[i]); //내적 구현 한 것 } } void dotProductLock(const vector<int>& v0, const vector<int>& v1, const unsigned i_start, const unsigned i_end, unsigned long long& sum) { //cout<<"Thread start"<<endl; for (unsigned i = i_start; i < i_end; i++) { std::scoped_lock lock(mtx); //c++17 sum += v0[i] * v1[i]; } } void dotProducAtomic(const vector<int>& v0, const vector<int>& v1, const unsigned i_start, const unsigned i_end, atomic<unsigned long long>& sum) { for (unsigned i = i_start; i < i_end ; i++) { sum += (v0[i] * v1[i]); //내적 구현 한 것 } } int main() { const long long n_data = 100'000'000; const unsigned n_threads = 8; //initialize vectors std::vector<int> v0, v1; v0.reserve(n_data); v1.reserve(n_data); random_device seed; mt19937 engine(seed()); uniform_int_distribution <> uniformDist(1, 10); for (long long i = 0; i < n_data; i++) { v0.push_back(uniformDist(engine)); v1.push_back(uniformDist(engine)); } cout << "std::inner_product" << endl; { const auto sta = chrono::steady_clock::now(); //시간 재는중 const auto sum = std::inner_product(v0.begin(), v0.end(), v1.begin(), 0ull); const chrono::duration<double> dur = chrono::steady_clock::now() - sta; //시간 재는 중 //계산한 시간 출력 cout << dur.count() << endl; cout << sum << endl; cout << endl; } cout << "Native" << endl; { const auto sta = chrono::steady_clock::now(); unsigned long long sum = 0; vector<thread> threads; threads.resize(n_threads); //쓰레드 마다 맡길 일의 양을 결정 const unsigned n_per_thread = n_data / n_threads; //assumes remainder=0 //쓰레드 할당 중 + 쓰레드에 값을 넣어주는 중 for (unsigned t = 0; t < n_threads; t++) { threads[t] = std::thread(dotProducNaive,std::ref(v0),std::ref(v1), t* n_per_thread, (t + 1)* n_per_thread, std::ref(sum)); } //join으로 기다리는 코드 for (unsigned t = 0; t < n_threads; t++) { threads[t].join(); } const chrono::duration<double> dur = chrono::steady_clock::now() - sta; cout << dur.count() << endl; cout << sum << endl; cout << endl; } cout << "Lock guard" << endl; { const auto sta = chrono::steady_clock::now(); unsigned long long sum = 0; vector<thread> threads; threads.resize(n_threads); //쓰레드 마다 맡길 일의 양을 결정 const unsigned n_per_thread = n_data / n_threads; //assumes remainder=0 //쓰레드 할당 중 + 쓰레드에 값을 넣어주는 중 for (unsigned t = 0; t < n_threads; t++) { threads[t] = std::thread(dotProductLock, std::ref(v0), std::ref(v1), t * n_per_thread, (t + 1) * n_per_thread, std::ref(sum)); } //join으로 기다리는 코드 for (unsigned t = 0; t < n_threads; t++) { threads[t].join(); } const chrono::duration<double> dur = chrono::steady_clock::now() - sta; cout << dur.count() << endl; cout << sum << endl; cout << endl; } cout << "atomic" << endl; { const auto sta = chrono::steady_clock::now(); atomic<unsigned long long> sum = 0; vector<thread> threads; threads.resize(n_threads); //쓰레드 마다 맡길 일의 양을 결정 const unsigned n_per_thread = n_data / n_threads; //assumes remainder=0 //쓰레드 할당 중 + 쓰레드에 값을 넣어주는 중 for (unsigned t = 0; t < n_threads; t++) { threads[t] = std::thread(dotProducAtomic, std::ref(v0), std::ref(v1), t * n_per_thread, (t + 1) * n_per_thread, std::ref(sum)); } //join으로 기다리는 코드 for (unsigned t = 0; t < n_threads; t++) { threads[t].join(); } const chrono::duration<double> dur = chrono::steady_clock::now() - sta; cout << dur.count() << endl; cout << sum << endl; cout << endl; } return 0; }
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
ssr 관련 질문
styled-component들은 서버사이드렌더링이 안되서 적용이 안된다고 하셨는데 현재 이 강의 기준으로 서버사이드 렌더링이 적용되고 있는건가요? pages폴더안에 파일들만 코드스플릿팅만 적용되고 있는줄알았습니다. 자동으로 서버사이드렌더링이 적용중인건지 궁금합니다.
-
미해결홍정모의 따라하며 배우는 C++
레이스 컨디션 재질문
#include<iostream> #include<thread> #include<atomic> #include<mutex> #include<chrono> using namespace std; int main() { mutex mtx; int shared_momory(0); auto count_func = [&]() { for (int i = 0; i < 1000; i++) { //this_thread::sleep_for(chrono::milliseconds(1)); //std::scoped_lock lock(mtx); shared_momory++; } }; thread t1 = thread(count_func); thread t2 = thread(count_func); t1.join(); t2.join(); cout << "After" << endl; cout << shared_momory << endl; return 0; } 코드는 이렇습니다.
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
예제문제
예제문제는 어디있는건가요... 교재 파일인 PDF 는 강의 초반 주제부분만 나오는 2장이고 소스파일을 열어도 나오지 않네요..
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
강의 관련 정리.
안녕하세요. 강의를 잘보고 있는 학생입니다. 도커에 대한 내용을 잊지 않기 위해 기록을 남기려고 합니다. 강의와 같이 도표형식을 사용하여 비슷하게 블로그에 남겨도 될까요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
unresolved methods
안녕하세요 user.js에서 userSchema.pre userScema.methods var token = jwt.sign(user._id.toHexString(), secretToken) 에서 pre, methods, toHexString() 세 부분에 밑줄이 뜨며 unresolved methods or functions 등 unresolved 라는 에러가 뜹니다. 작동에는 오류가 없지만 왜 뜨는건지 궁금해서 질문드립니다. 웹스톰 사용하고 있고, 위의 사진과 같습니다. 감사합니다!! //user.js const mongoose = require('mongoose'); const bcrypt = require('bcrypt'); const saltRounds = 10; const jwt = require('jsonwebtoken'); const userSchema = new mongoose.Schema({ name: { type: String, maxlength: 50 }, email: { type: String, trim: true, //공백을 제거 unique: 1 //이메일은 하나. 유니크 했으면 좋겠음. }, password: { type: String, minlength:5 }, lastname: { type: String, maxlength: 50 }, role: { type: Number, default: 0 }, image: String, //오브젝트를 사용하지 않고 이렇게 하나로 줘도 된다. token: { type: String //유효성 검사를 위해 }, tokenExp: { type: Number //유효기간. } }) userSchema.pre('save', function(next){ //비밀번호를 암호화 시킨다 //index.js 의 save를 하기 전에, function을 하면서 암호화 시킨다. //이때 salt를 이용해서 비밀번호를 암호화한다. 그 전에 salt를 먼저 생성해야함. //saltround는 salt가 몇글자인지임 //genSalt: salt를 만든다. var user = this; //this는 이때 위의 user 객체를 가리킨다. if(user.isModified('password')){ bcrypt.genSalt(saltRounds, function(err, salt){ if (err) return next(err); bcrypt.hash(user.password, salt, function (err, hash){ //user.password : this, 즉 객체의 password. 암호화 되기 전의 패스워드 //hash : 암호화된 비밀번호 //store hash in your password DB if (err) return next(err) user.password = hash }) }) } else{ next() } next() }) userSchema.methods.comparePassword = function(plainPassword, cb) { //plainpassword와 암호화된 비밀번호가 같은지 확인하기 -> plainpassword를 암호화 해서 암호화한 password와 같은지 확인하기. bcrypt.compare(plainPassword, this.password, function(err, isMatch){ if(err) return cb(err), cb(null, isMatch) }) } userSchema.methods.generateToken = function(cb){ var user = this; //jsonwebtoken을 이용해서 token을 생성하기 var token = jwt.sign(user._id.toHexString(), 'secretToken') user.token = token user.save(function(err, user){ if(err) return cb(err) cb(null, user) }) } const User = mongoose.model('User', userSchema) //스키마를 모델로 감싸준다 module.exports = { User } //다른 파일에서도 쓸 수 있도록 export
-
미해결데이터 자동화(with VBA)
혹시
교집합 범위내의 타겟에 문자를 입력 하면 타겟 왼쪽에 현재 시간을 넣겟다고 구문을 만드는데요 중간에 if VBA.Len(targer) > 1 then target.offset( , 1) = 현재시간 이렇게 응용해보려는데 안되네요..
-
미해결[텐서플로2] 파이썬 딥러닝 완전정복 - GAN, BERT, RNN, CNN 최신기법
코드를 그대로 돌렸는데 애로가 나오는 이유가 알고 싶습니다
안녕하십니까 선생님 코드를 그대로 붙여서 실행했는데 다음과 같은 애로 사항이 발생했습니다 tensorflow도 2.3이고 keras도 설치 되어있는데 어떤 제반 사항이 잘못되었는지 알려주시면 감사드리겠습니다. ImportError Traceback (most recent call last) ~\anaconda3\lib\site-packages\keras\__init__.py in <module> 2 try: ----> 3 from tensorflow.keras.layers.experimental.preprocessing import RandomRotation 4 except ImportError: ~\anaconda3\lib\site-packages\tensorflow\__init__.py in <module> 40 ---> 41 from tensorflow.python.tools import module_util as _module_util 42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader ~\anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module> 45 from tensorflow.python import data ---> 46 from tensorflow.python import distribute 47 from tensorflow.python import keras ~\anaconda3\lib\site-packages\tensorflow\python\distribute\__init__.py in <module> 27 from tensorflow.python.distribute import one_device_strategy ---> 28 from tensorflow.python.distribute.experimental import collective_all_reduce_strategy 29 from tensorflow.python.distribute.experimental import parameter_server_strategy ~\anaconda3\lib\site-packages\tensorflow\python\distribute\experimental\__init__.py in <module> 24 from tensorflow.python.distribute import parameter_server_strategy ---> 25 from tensorflow.python.distribute import tpu_strategy 26 # pylint: enable=unused-import ~\anaconda3\lib\site-packages\tensorflow\python\distribute\tpu_strategy.py in <module> 42 from tensorflow.python.tpu import device_assignment as device_assignment_lib ---> 43 from tensorflow.python.tpu import tpu 44 from tensorflow.python.tpu import tpu_strategy_util ~\anaconda3\lib\site-packages\tensorflow\python\tpu\tpu.py in <module> 27 from tensorflow.python.compat import compat as api_compat ---> 28 from tensorflow.python.compiler.xla import xla 29 from tensorflow.python.framework import device as pydev ~\anaconda3\lib\site-packages\tensorflow\python\compiler\xla\__init__.py in <module> 22 from tensorflow.python.compiler.xla import jit ---> 23 from tensorflow.python.compiler.xla import xla 24 # pylint: enable=unused-import ~\anaconda3\lib\site-packages\tensorflow\python\compiler\xla\xla.py in <module> 24 ---> 25 from tensorflow.compiler.jit.ops import xla_ops 26 from tensorflow.compiler.jit.ops import xla_ops_grad # pylint: disable=unused-import ~\anaconda3\lib\site-packages\tensorflow\compiler\jit\ops\xla_ops.py in <module> 7 ----> 8 from tensorflow.python import pywrap_tfe as pywrap_tfe 9 from tensorflow.python.eager import context as _context ~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py in <module> 28 from tensorflow.python import pywrap_tensorflow ---> 29 from tensorflow.python._pywrap_tfe import * ImportError: DLL load failed: 지정된 프로시저를 찾을 수 없습니다. During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) <ipython-input-1-210029f2541c> in <module> 1 from __future__ import print_function ----> 2 import keras 3 from keras.datasets import mnist 4 from keras.models import Sequential 5 from keras.layers import Dense, Dropout, Flatten ~\anaconda3\lib\site-packages\keras\__init__.py in <module> 4 except ImportError: 5 raise ImportError( ----> 6 'Keras requires TensorFlow 2.2 or higher. ' 7 'Install TensorFlow via `pip install tensorflow`') 8 ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
401에러 관련 질문드립니다
401 에러가 발생하여 문제 찾아보던 중에 서버사이드렌더링 방식으로 axios 통신을 했을때 headers에 쿠키를 담아줘서 그런지 백서버 미들웨어에서 isLoggedIn에 로그인 정보가 잘 넘어오는 것을 확인하였습니다. 하지만 브라우저에서 백서버로 요청을 할때는 isLoggedIn에 로그인 정보가 넘어오지 않았는 것 같아 문의 드립니다. req.isAuthenticated()가 false 여서 401에러가 뜨는 장면입니다.
-
미해결페이스북 클론 - full stack 웹 개발
ajax 통신이 안 되는 것 같습니다!
저는 지금 구름IDE 에서 컨테이너를 만들어서 공부하고 있는데요! 좋아요 버튼을 눌러도 ajax 통신이 잘 안 되는 것 같습니다! 첫번째 사진은 여기 사이트에서 올려진 선생님의 소스 코드를 실행해봤을 때의 사진이고 두번째 사진은 제가 직접 작성해서 시도해봤을 때의 사진입니다! 어떻게 문제를 해결해야 하나요? 이러한 경우가 로컬서버를 설치하지 않아서 ajax 통신을 못하는 경우라면 웹스톰을 사용하지 않고 로컬서버를 설치를 하는 방법이 있을까요?