묻고 답해요
167만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결Node.js 웹개발로 알아보는 백엔드 자바스크립트의 이해
DB에 새로운 계정으로 입력해도 id가 계속 0입니다T_T; (증가하지 않음)
//join.js passport.serializeUser((user, done)=>{ console.log('passport session saved:', user) done(null, user) // <- used deserialze for first arg }) passport.deserializeUser((user, done)=>{ console.log('passport session get id:', user) done(null, user) // }) passport.use('local-join', new LocalStrategy({ usernameField: 'email', // *form 의 input name과 일치해야함 passwordField: 'password', // *form 의 input name과 일치해야함 passReqToCallback: true, }, function(req, email, password, done){ // 인증 처리 DB 접속 row 존재 여부 조회 등... const query = connection.query('select * from user where email=?', [email], (err,rows)=>{ if(err) return done(err); if(rows.length){ console.log('your email is already exist') return done(null, false, {message: 'your email is already used'}) }else{ //insert const sql = {email: email, password: password}; const query = connection.query('insert into user set ?', sql, (err,rows)=>{ if(err) throw err return done(null, {'email': email, 'id': rows.insertId}) //session에 담을 정보를 넣을수있음 -> serialize 하지 않으면 에러 발생 }) } }) })) [Terminal] Listening on the port 3001 passport session saved: { email: 'hello@gmail.com', id: 0 } passport session get id: { email: 'hello@gmail.com', id: 0 } main.js loaded: { email: 'hello@gmail.com', id: 0 } passport session get id: { email: 'hello@gmail.com', id: 0 }
-
미해결React로 NodeBird SNS 만들기
redux에서 state의 값이 바뀌었을때 화면단에서 바뀐값 바로 보이도록 하기.
redux에서 state의 값이 계속 바뀌는 값일때 어떻게 바뀐값만 계속 가져올수 있을까요 const {testValue} = useSelector(state => state.test) useEffect( () => { // state.test 에 testValue dispatch },[testValue]) 이렇게 하면 되려나 했는데, 안되더라구요 ㅠㅠ setInterval 같은거 안쓰고 바뀐값만 수정되면 좋겠는데 모르겠어요...
-
미해결혼자 공부하는 C 언어 저자에게 배우는 C 언어의 모든 것
struct address
struct address 구조체에서 전체 크기가 124이니깐 메모리에서 번지가 100부터 시작하면 223번지까지 아닌가요?? 왜 123번지까지 인가요??
-
미해결예제로 배우는 스프링 입문 (개정판)
Util 클래스를 사용하는 방법 질문드립니다.
전역으로 사용되는 Util 클래스를 어떤 방식으로 가져다 쓰는 것이 나은지 고민해보다가 질문드립니다. 예를 들면 원하는 날짜 형식으로 변화해주는 Util이 필요합니다. 전역에서 해당 Util 클래스의 특정 메소드를 호출하여 사용할 텐데요. 여기서 특정 메소드를 static으로 선언할 수도 있고, Util 클래스를 Bean으로 등록하여 의존성 주입을 받아 사용할 수도 있다고 생각해요. 스프링에서 두 방법의 차이점과 장단점을 정확히 모르겠어서 질문드립니다 !
-
미해결코틀린 기반 안드로이드 앱개발 기본 1단계
Intel HAXM is required to run this AVD라는 오류가 뜨네요
Intel HAXM is required to run this AVD. HAXM device is not found. Enable VT-x in your BIOS security settings, ensure that HAXM is installed properly. Try disabling 3rd party security software if the problem still occurs. 오류 경고창 원문. VT-x를 활성화 하는 방법, HAXM를 설치하는 방법을 알고싶습니다.
-
해결됨파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
test1에 python이 설치 안됩니다.
찾아봐도 잘 모르겠습니다...
-
미해결웹, 앱 풀스택개발 Boot Camp - 입문부터 서비스 개발까지
이부분 메뉴만들기 똑같이 해도 메뉴바가 생성이 안됩니다.
이부분 메뉴만들기 똑같이 해도 메뉴바가 생성이 안됩니다. 코드가 바뀐건지 왜그런지 모르겠네요. 확인좀 해주실수 있을까요.
-
미해결스프링 프레임워크 핵심 기술
소스 볼 수 있나요?
실습에서 작성한 코드를 github에서 볼 수 있나요?
-
해결됨React로 NodeBird SNS 만들기
dispatch 관련질문
useEffect 안에서는 왜 return dispatch 를 할 수 없는건가요? 간혹 여러번 dispatch가 되기도 해서 곤혹스럽습니다 ㅠㅠ
-
미해결파이썬 사용자를 위한 웹개발 입문 A to Z Django + Bootstrap
콘솔장에 이런 오류가 뜨는데요 왜 그럴까요?
SCRIPT1002: SCRIPT1002: Syntax error popper.min.js (8,1) SCRIPT438: SCRIPT438: Object doesn't support property or method 'popover' custom.js (14,5)
-
React로 NodeBird SNS 만들기
프론트 백 연동
삭제된 글입니다
-
프로그래밍, 데이터 과학을 위한 파이썬 입문
강의 13:16 에서 왜 str(total)이 12인가요?
삭제된 글입니다
-
미해결Vue.js 시작하기 - Age of Vue.js
computed 를 이용한 class 변경관련
안녕하세요. 강의를 보다가 궁금한 점이있어서 질문 남기게되었습니다. v-bind:class="errorTextColor" 로 warning 이라는 클래스를 주었는데 그럼 클래스가 두개일때는 어떻게 해야하나요? <p class="text warning"> 이렇게 이미 text라는 class가 있고 warning만 넣었다가 뺐다가 하는 동작을 하고 싶은데 v-bind:class 안에 어떻게 넣어야할까요? errorTextColor : function() { return this.isError? 'text warning' : 'text'? 이런식으로 class를 넣는것은 확인했는데 이렇게 말고 html태그안에서 할수있는 방법이 없는지 질문드려요 답변 부탁드립니다.
-
미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
number of cases 코드
def number_of_cases(list_data): list_permutation=[] for i in list_data: for j in list_data: num1=str(i) num2=str(j) list_permutation.append(num1+num2) result = list_permutation return result 테스트 해 봤을때 결과도 맞게 나오는데 숙제 제출하면 failed라고 나오네요... 뭐가 문제인지 잘 모르겠습니다 ㅠㅠ
-
React로 NodeBird SNS 만들기
AWS ROUTE
삭제된 글입니다
-
미해결React로 NodeBird SNS 만들기
질문이요
배열에 jsx 값을 쓰면 키값을 주라고 하셨는데, 1. 키값을 안 주면 뭐가 안 좋죠?? 2. 배열에 jsx 값을 넣을때만 , 키값을 주는건가요? 아니면 모든 jsx값에 키를 주어야 하나요 ? 3. Button, Input에 키값은 왜 안주나요?? renderItem= {item => ( <List.Item style={{marginTop:'20px'}}> <Card actions ={[ <Icon key="stop" type="stop"/> ]} > <Card.Meta description ={item}/> </Card> 4. renderItem 에서 dataSource값들이 하나하나 돌면서 Icon 들이 같이 생기잖아요. 그런데 모든 Icon의 값이 stop인데 상관 없는건가요 ?? 5. 팔로워 목록 과 팔로잉 목록의 키값이 stop 으로 똑같던데 상관은 없는건가요?
-
해결됨React로 NodeBird SNS 만들기
왜 user/0가 본인이 검색되는 거죠 ?
req.params.id가 0이면 req.user && req.user.id로 검색하는건 알겠습니다 하지만 왜 (req.user && req.user.id) 뒤에 || 0 도 붙이는거죠 ? user가 0이면 본인이 검색되는것 같은데 왜 그렇게 되는거죠 ? 감사합니다 router.get('/:id/posts', async (req, res, next) => { try { const posts = await db.Post.findAll({ where: { UserId: parseInt(req.params.id, 10) || (req.user && req.user.id) || 0, RetweetId: null, }, include: [{ model: db.User, attributes: ['id', 'nickname'], }, { model: db.Image, }, { model: db.User, through: 'Like', as: 'Likers', attributes: ['id'], }], }); res.json(posts); } catch (e) { console.error(e); next(e); } });
-
미해결공도리의 HTML5와 CSS3를 이용한 홈페이지 개발
http://www.gongdori.co.kr/ 접속이 안됩니다
15강 듣고 있는데 홈피에 접속이 안되어 질문 남깁니다강의 잘 듣고 있습니다
-
미해결스프링 부트 개념과 활용
intellij community version에서 springboot 실행오류
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.tutorial.sprinboottutorial.Application]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration due to org/springframework/dao/DataAccessException not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) Maven project로 생성하여서 springboot를 실행하면 위와 같은 에러가 발생합니다. 에러 이유를 좀 알려주시면 감사하겠습니다.
-
미해결[리뉴얼] 처음하는 SQL과 데이터베이스(MySQL) 부트캠프 [입문부터 활용까지]
학습자료
학습자료는 어디서 받을수 있나요??