끝자리 연산자 더하고 빼는 부분 변경을 하면
해결됨
남박사의 파이썬 기초부터 실전 100% 활용
if lop < len(user_input) : string_list.append(user_input[lop:len(user_input)]) 이렇게 lop의 값이 문자열의 길이와 다르면 그만큼 짤라서 넣으면 되지 않나요???
- python
- 웹-크롤링
172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
남박사의 파이썬 기초부터 실전 100% 활용
if lop < len(user_input) : string_list.append(user_input[lop:len(user_input)]) 이렇게 lop의 값이 문자열의 길이와 다르면 그만큼 짤라서 넣으면 되지 않나요???
해결됨
남박사의 파이썬 기초부터 실전 100% 활용
밖으로 빼야 하는거 아닌가요??
미해결
[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
Hello, We have received your quota request for smiling-parser-275018. Unfortunately, we are unable to grant you additional quota at this time. If this is a new project please wait 48h until you resubmit the request or until your Billing account has additional history. Your Sales Rep is a good Escalation Path for these requests, and we highly recommend you to reach out to them. If you have any further questions, please reply to this thread or feel free to reach out to us at gc-team@google.com . Thanks. gpu서버 할당받으려고 메일을 보냈는데 48시간을 기다리는 말인가요?ㅠ
미해결
React로 NodeBird SNS 만들기
6버전 이상부턴 default export가 없어서 import {Helmet} from 'react-helmet'; 이렇게 받아와야 하는거 같아요 버전 업데이트를 하면서 default export를 안쓰고 {}로 감싸고 import 해와야 하는데, 질문) 패키지에 어떤 기능추가를 위해서 저렇게 default export를 안쓰고 바꾸는 건가요?? 보통 어떤경우에 패키지 개발자가 저렇게 바꾸는지 궁금합니다.
미해결
따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
userSchema.pre("save", function (next) { var user = this; if (user.isModified("password")) { bcrypt.genSalt(saltRounds, function (err, salt) { ... var user = this 를 하면 user 에는 뭐가 담기게 되는거죠?ㅠㅠ 또 여기서 var user = this 를 선언을 했는데 userSchema.methods.generateToken = function (callback) { var user = this; var token = jwt.sign(user._id.toHexString(), "secretToken"); ... 왜 여기서 또 선언을 하는 거에요? User.js 에서 user 이라는 변수가 뭔지 정확히 모르겠습니다ㅠㅠ
미해결
인스타그램 클론 - full stack 웹 개발
마지막 완성된 페이지를 구동시켜보고 싶습니다. 최소한으로 필요한 세팅과 다운해야하는 첨부파일을 정리해서 알려주세요! 완성된 페이지를 통해 작동하는 원리를 배우면서 하고 싶습니다. 해당 강의 번호 및 페이지를 작동시키는 순서 알려주시면 감사하겠습니다.
미해결
페이스북 클론 - full stack 웹 개발
마지막 완성된 페이지를 구동시켜보고 싶습니다. 최소한으로 필요한 세팅과 다운해야하는 첨부파일을 정리해서 알려주세요! 완성된 페이지를 통해 작동하는 원리를 배우면서 하고 싶습니다. 해당 강의 번호 및 페이지를 작동시키는 순서 알려주시면 감사하겠습니다.
미해결
파이썬 무료 강의 (기본편) - 6시간 뒤면 나도 개발자
cabinet을 clear 할때 키값은 놔두고 벨류값만 삭제하는 방법이 있나요?
미해결
공공데이터로 파이썬 데이터 분석 시작하기
강사님이 하시는대로 따라서 했는데 lmplot 사용할 때 회귀선이 안나타납니다...
미해결
React로 NodeBird SNS 만들기
middleware.js exports.postExist = async(req,res,next)=>{ const post = await db.Post.findOne({ where: { id: req.params.id } }); if (!post) { return res.status(404).send("해당 페이지가 존재하지 않습니다"); } next(); } post.js router.delete('/:id', isLoggedIn, postExist, async(req,res,next)=>{ try{ await db.Post.destroy({ where: {id: req.params.id}}); res.send(req.params.id); }catch(e){ console.error(e); next(e); } }) next()만 추가해서 다음 동작으로 갈수있게 해주었는데 더 추가할게 있는지 궁금합니다..!
해결됨
[개정판] 파이썬 머신러닝 완벽 가이드
안녕하세요. 판다스(Pandas) 개요와 기본 API - 01 편에서 9분24초에 나오는 부분에 대한 질문입니다. 영상에서 함수의 원형이라고 말씀 하시면서 함수에 쓸수 있는 옵션을 전부 보여 주셨는데요. 어떻게 하면 그렇게 함수의 쓸 수 있는 옵션을 볼 수 있는지 궁금 합니다. 그리고 그것을 볼 수 있는 단축키 같은 것도 존재 한다면 알려 주세요. 감사합니다.
해결됨
따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
추가적으로 궁금한점이 있어서 이렇게 남깁니다. 로그아웃 버튼을 클릭하면 mongoDB에 token이 "" 사라지게 구현해놓으셨는데, ie에서 application > cookies에서는 아직 token이 계속 있더라구요.. 상관이 없을까요?
미해결
프로그래밍, 데이터 과학을 위한 파이썬 입문
(사진)
해결됨
따라하며 배우는 노드, 리액트 시리즈 - 유튜브 사이트 만들기
파일필터 정상작동여부 판단을 위해서 mp4가 아닌 png를 올려보앗는데 업로드폴더에 들어갑니다 ㅠㅠ
미해결
따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
저도 postman에서 계속 로딩만 뜨길래 오타났나 계속 찾다가, 강사님 답변 보고 해결해서 여기에 글 남겨요. /User.js 파일 에서 userSchema.methods.comparePassword 구문 안 bcrypt.compare 안에 있는 if문 수정하시면 잘 됩니다. if(err) return cb(err); // 맨 끝에 ,(콤마)아니고 ;(세미콜론)으로 해주셔야 합니다! cb(null,isMatch);
미해결
React로 NodeBird SNS 만들기
1. 프론트에서 넥스트와 익스프레스를 연결했는데, 그러면 프론트에서도 익스프레스로 서버를 돌리고 백엔드에서도 익스프레스로 서버를 돌리면, 각각의 익스프레스로 프론트,백 서버를 돌리는것이 맞나요?? 2. 프론트에서 넥스트와 익스프레스를 연결한건 동적라우팅을 쓰려하는데, 넥스트에서 안되니 그저 익스프레스를 동적라우팅을 쓰기위한 수단으로 사용하는 건가요??
미해결
파이썬으로 영화 예매 오픈 알리미 만들기
.
미해결
프로그래밍, 데이터 과학을 위한 파이썬 입문
이 검색해도 패키지로 안나오는데요 어떻게 해야하나요
미해결
따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
https://github.com/ryun3433/inf-todo.git 깃헙주소입니다. 이런 에러가 계속 납니다 ㅠ.ㅠ 뭐가 문제인지 잘 모르겠습니다.. 도와주시면 정말 감사하겠습니다 TypeError: Cannot read property 'prototype' of undefined (anonymous function) C:/Users/patmo/Documents/myProject/inf-todo/client/node_modules/express/lib/response.js:42 39 | * @ public var res = Object . create ( http . ServerResponse . prototype )
미해결
따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
계속 붙잡고 있어도 안되서 헬프를 칩니다.. 뭐가 문제인거죠..? auth.js 파일에서 findbytoken을 만드는데 계속 안되기만 합니다. TypeError: User.findByTokenis not a function at auth (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\middleware\auth.js:8:10) at Layer.handle [as handle_request] (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\layer.js:95:5) at C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:275:10) at cookieParser (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\cookie-parser\index.js:71:5) at Layer.handle [as handle_request] (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:317:13) at C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\express\lib\router\index.js:275:10) at C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\body-parser\lib\read.js:130:5 at invokeCallback (C:\Users\AndrewLee\Desktop\node_basic\boilerPlate\node_modules\raw-body\index.js:224:16) ㄱ계속 이 문구만 뜨고요 함수가 아니라는데 저는 함수를 user.js에 만들었고.. 아 이게 무슨 문제일까요.. auth.js const { User } = require ( '../models/user' ); let auth = ( req , res , next ) => { // 이곳에서 인증처리를 하는 곳 // 클라이언트 쿠리에서 토큰을 가져온다 ==> 쿠키 파서를 이용한다. let token = req . cookies . x_auth ; console . log ( 'auth/token :' + token ); // 토큰을 복호화한 후 유저를 찾는다. User . findByToken ( token , ( err , user ) => { if ( err ) throw err ; if (! user ) { return res . json ({ isAuth : false , error : true }) // 유저가 없으니까 } else { // 유저가 있으면 req . token = token ; // 이렇게 설정해주는 이유는 콜러에서 req.token , req.user와 같이 사용할 수 있게 하기 위해서이다. req . user = user ; next (); } }); // 유저가 있으면 인증 오케이 // 유저가 없으면 인증 노노 } module . exports = { auth }; user.js const mongoose = require ( '../node_modules/mongoose' ); const bcrypt = require ( 'bcrypt' ); const saltRounds = 10 ; const myPlaintextPassword = 's0/ \/\P 4$$w0rD' ; const someOtherPlaintextPassword = 'not_bacon' ; var jwt = require ( 'jsonwebtoken' ); const userSchema = 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 , defalut : 0 }, image : String , token : { // 토큰을 이용해서 유효성등을 나중에 관리함 type : String }, tokenExp : { // 토큰의 유효기간 type : Number } }) userSchema . pre ( 'save' , function ( next ) { var user = this ; console . log ( '1' ); if ( user . isModified ( 'password' )) { console . log ( '2' ); bcrypt . genSalt ( saltRounds , function ( err , salt ) { console . log ( '3' ); if ( err ) return next ( err ); console . log ( '4' ); bcrypt . hash ( user . password , salt , function ( err , hash ) { console . log ( '5' ); if ( err ) return next ( err ); console . log ( '6' ); console . log ( hash ); user . password = hash ; next (); }); }); } else { next (); } }) userSchema . methods . comparePassword = function ( planPassword , cb ){ bcrypt . compare ( planPassword , this . password , function ( err , isMatch ){ if ( err ) return cb ( err ); cb ( null , isMatch ); } ); } userSchema . methods . generateToken = function ( cb ){ var user = this ; // json웹토큰을 이용해서 토큰을 생성하기 var token = jwt . sign ( user . _id . toHexString (), 'hihello' ); // 이렇게 토큰을 만들면 ,, // user._id + hihello = token이 되고, 나중에는 token과 hihello로 user._id를 만들 수 있다. user . token = token ; user . save ( function ( err , user ){ if ( err ) return cb ( err ); // 에러가 났으면 에러를 전달 cb ( null , user ); // 문제가 없으면 에러는 없고 유저를 전달 자 그럼 index.js로 넘어가서~ }); } userSchema . methods . B = function ( token , cb ){} userSchema . methods . findByToken = function ( token , cb ){ var user = this ; // 토큰을 디코드 한다. user_id + '' = token console . log ( "1 : " + token ); jwt . verify ( token , 'hihello' , function ( err , decoded ){ // 유저 아이디를 이용해서 유저를 찾은 다음에 // 클라이언트에서 가져온 token과 db에 보관된 토큰이 일치하는지 확인 user . findOne ({ "_id" : decoded , "token" : token }, function ( err , user ){ if ( err ){ return cb ( err ); } else { cb ( null , user ); } }) }) } const User = mongoose . model ( 'User' , userSchema ); console . log ( User . comparePassword ); module . exports = { User }; 좋은 강의 항상 감사드립니다.