묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결모두의 깃 & 깃허브
다중 github 계정이 있는 경우 sourcetree의 계정관리
안녕하세요.다중 github 계정이 있는 경우 sourcetree의 계정관리를 어떻게 하면 좋은 지 팁등이 있을까요?예를들면 github 계정이 개인계정이 있고, 회사계정 이 있는 경우 두 계정 스위칭을 문제없이 잘 관리할 수 있는 방법이 있을까요감사합니다.
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
post 요청이 가지 않습니다.
코드를 아래와 같이 제대로 작성하였고, 백엔드 서버도 잘 돌아가는거 확인했습니다. 그런데 서브밋 버튼을 누르고 데브툴 네트워크 탭을 보면 post 리퀘스트가 전혀 뜨지 않습니다. 의심되는 이유는 에러메세지'4. WrappedApp created new store with withRedux(App) {initialState: undefined, initialStateFromGSPorGSSR: undefined}'가 뜨는데, 리덕스의 이니셜 스테이트가 undefined이라니 왜 이렇게 된걸까요? 리듀서에 스테이트들 다 잘 적혀있는데 혹시 이 에러 때문에 디스패치 자체가 안되고 있는 걸까요? 리듀서 문제라기엔 백엔드 서버 없이 더미데이터로 돌리면 잘 됐었기 때문에 왜인지 도통 모르겠습니다.<회원가입 관련 리듀서>import produce from "../util/produce"; export const initialState = { signUpLoading: false, signUpDone: false, signUpError: null, me: null, signUpData: {}, loginData: {}, userList: {}, }; export const SIGN_UP_REQUEST = "SIGN_UP_REQUEST"; export const SIGN_UP_SUCCESS = "SIGN_UP_SUCCESS"; export const SIGN_UP_FAILURE = "SIGN_UP_FAILURE"; const dummyUser = (data) => ({ id: data.id, nickname: "Jin Choi", Posts: [{ id: 1 }], Followings: [ { nickname: "Elle" }, { nickname: "Mazzie" }, { nickname: "Lori" }, ], Followers: [ { nickname: "Coco" }, { nickname: "Mephis" }, { nickname: "WillB" }, ], password: data.password, }); const reducer = (state = initialState, action) => produce(state, (draft) => { switch (action.type) { case SIGN_UP_REQUEST: draft.signUpLoading = true; draft.signUpError = null; draft.signUpDone = false; break; case SIGN_UP_SUCCESS: draft.signUpLoading = false; draft.signUpDone = true; break; case SIGN_UP_FAILURE: draft.signUpLoading = false; draft.signUpError = action.error; break; default: break; } }); export default reducer; <회원가입 관련 사가>import { all, delay, fork, put, takeLatest, call } from "redux-saga/effects"; import axios from "axios"; import { SIGN_UP_FAILURE, SIGN_UP_REQUEST, SIGN_UP_SUCCESS, } from "../reducers/user"; function signUpAPI(data) { return axios.post("https://localhost:3065/user", data); //only post, put, patch can pass data } function* signUp(action) { try { const result = yield call(signUpAPI, action.data); console.log(result); yield put({ type: SIGN_UP_SUCCESS, data: action.data, }); } catch (err) { console.error(err); yield put({ type: SIGN_UP_FAILURE, error: err.response.data, }); } } function* watchSignUp() { yield takeLatest(SIGN_UP_REQUEST, signUp); } export default function* userSaga() { yield all([ fork(watchSignUp), ]); } <백엔드 라우트>const express = require("express"); const router = express.Router(); const bcrypt = require("bcrypt"); const { User } = require("../models"); router.post("/", async (req, res, next) => { try { //email existence check const exUser = await User.findOne({ where: { email: req.body.email, }, }); if (exUser) { return res.status(403).send("The email is in use"); } const hashedPassword = await bcrypt.hash(req.body.password, 10); await User.create({ //inserting data to table asynchronously email: req.body.email, nickname: req.body.nickname, password: hashedPassword, }); res.status(200).send("ok"); } catch (error) { console.error(error); next(error); } }); module.exports = router; 조언부탁드립니다. 감사합니다.
-
해결됨[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
댓글 수정 및 삭제 구현 관련해 질문드립니다
안녕하세요 선생님, [초급편] 안드로이드 커뮤니티 앱 만들기를 완강한 수강생입니다. 게시글 수정/삭제 파트와 아래 두 질문을 참고해가며 현재 댓글 수정/삭제를 구현하기 위해 애쓰는 중인데, 잘 되지 않아 질문드립니다.https://www.inflearn.com/questions/411607https://www.inflearn.com/questions/619233게시글 설정과 마찬가지로 내가 쓴 댓글에만 보이는 설정 버튼을 클릭하면다이얼로그를 통해 수정/삭제로 진입하게끔 만드는 데 까지는 성공했습니다.첫 번째 질문입니다.우선 수정 기능의 경우 아래 ????? 부분에 어떤 값을 넣어야 할지 감이 안 옵니다. BoardReadActivity.kt // 댓글 클릭하면 -> 대화상자 뜸 // 파이어베이스의 댓글 키를 기반으로 댓글 데이터(=본문+uid+시간) 받아옴 cLV.setOnItemClickListener { parent, view, position, id -> // 명시적 인텐트 -> 다른 액티비티 호출 val intent = Intent(baseContext, CommentEditActivity::class.java) // 댓글수정 액티비티로 댓글의 키 값 전달 intent.putExtra("?????", ?????) // 댓글수정 액티비티 시작 startActivity(intent) }"key", key를 넣으면 댓글이 아닌 게시글의 키 값이 되어 댓글이 수정되지 않고,"commentKey", commentKey를 넣으면 앱이 죽습니다. 게시판 프래그먼트에서 리스트뷰 아이템을 클릭하면 게시글로 이동하듯댓글 리스트뷰 아이템을 클릭하면 수정 액티비티로 넘어가는 것도 시도해봤는데요, 빨간색이 게시글의 키, 파란색이 댓글의 키일 때 다행히 댓글의 키는 잘 받아오는데 댓글의 키'만' 알다보니 파이어베이스로부터 기존 댓글 내용을 받아올 수도, 수정한 내용을 업데이트 할 수도 없습니다.BoardReadActivity.kt // 댓글 클릭하면 -> 대화상자 뜸 // 파이어베이스의 댓글 키를 기반으로 댓글 데이터(=본문+uid+시간) 받아옴 cLV.setOnItemClickListener { parent, view, position, id -> // 명시적 인텐트 -> 다른 액티비티 호출 val intent = Intent(baseContext, CommentEditActivity::class.java) // 댓글수정 액티비티로 댓글의 키 값 전달 intent.putExtra("commentKey", commentKeyList[position]) // 댓글수정 액티비티 시작 startActivity(intent) }다이얼로그에서 댓글수정 액티비티로 넘길 때와 마찬가지로 ????? 부분에 어떤 값을 넣어야 할지 모르겠습니다.CommentEditActivity.kt // 댓글을 수정 private fun editCommentData(commentKey: String) { // 수정한 값으로 업데이트 FBRef.commentRef.?????.child(commentKey).setValue(CommentModel( // 제목 및 본문은 직접 수정한 내용으로, binding.commentMainArea.text.toString(), // uid와 시간은 자동 설정됨 FBAuth.getUid(), FBAuth.getTime() )) // 수정 확인 메시지 Toast.makeText(this, "댓글이 수정되었습니다", Toast.LENGTH_SHORT).show() // 댓글수정 액티비티 종료 finish() }혼자 해결하려니 너무 맨 땅에 헤딩이라ㅠㅠ 질문 올립니다.
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
배포가 안되고 상태가 심각으로 나옵니다...
강의를 보고 따라서 진행을 했더니 빨간색으로 심각이 나오네요...그래서 로그에 들어가서 최근 100개의 로그를 보니까오류 원인으로 추정되는 부분이 있었습니다.2022/08/28 17:41:22.790598 [INFO] save docker tag command: docker tag 0370c9c70821 current_backend:latest 2022/08/28 17:41:22.790604 [INFO] save docker tag command: docker tag d942a3872fb6 current_nginx:latest 2022/08/28 17:41:22.790609 [INFO] save docker tag command: docker tag 75708d3d8c71 current_frontend:latest 2022/08/28 17:41:22.790614 [INFO] save docker tag command: docker tag 2b7d6430f78d nginx:latest 2022/08/28 17:41:22.790618 [INFO] save docker tag command: docker tag 5dcd1f6157bd node:16-alpine 2022/08/28 17:41:22.790631 [INFO] Running command /bin/sh -c docker rm `docker ps -aq` 2022/08/28 17:41:22.942159 [INFO] Error response from daemon: You cannot remove a running container 6a0c86ea39e968de428d3d30608a610c32c9250c12390b835b82e2367f1e5329. Stop the container before attempting removal or force remove Error response from daemon: You cannot remove a running container 9c2ffeccce2f1e0b49d4f50e7c5de38e7084d077faf3f19123151adc30de6dcb. Stop the container before attempting removal or force remove Error response from daemon: You cannot remove a running container d4507eceb5d8d6384be032723cbcae38f1a427f9b261cef64c78199ed24595a2. Stop the container before attempting removal or force remove 2022/08/28 17:41:22.942188 [INFO] Running command /bin/sh -c docker rmi `docker images -aq` 2022/08/28 17:41:23.115076 [INFO] Error response from daemon: conflict: unable to delete 968794bfee27 (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete 60a98349297b (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete 0370c9c70821 (cannot be forced) - image is being used by running container d4507eceb5d8 Error response from daemon: conflict: unable to delete 8ad18f4e6824 (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete d942a3872fb6 (cannot be forced) - image is being used by running container 6a0c86ea39e9 Error response from daemon: conflict: unable to delete 69041b2058c4 (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete 75708d3d8c71 (cannot be forced) - image is being used by running container 9c2ffeccce2f Error response from daemon: conflict: unable to delete f9fde158cd3b (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete b91481250af7 (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete a5f559502b12 (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete 2b7d6430f78d (cannot be forced) - image has dependent child images Error response from daemon: conflict: unable to delete 5dcd1f6157bd (cannot be forced) - image has dependent child images이렇게 나오더라구요...뭐가 원인인지 뭘 해결해야 하는건지 혹시 알려주실 수 있으신가요??ㅠㅠ
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
IOS 시뮬레이터 에서만 에러가 납니다.
안드로이드에서는 잘 되는데 아이오에스 시뮬레이터버젼 ios 15.5에서 에러가 나면서 안됩니다.구글맵과 충돌인거 같은데..ㅠㅠ맥북 에어 m2 사용중입니다.Error (Xcode): Building for iOS Simulator, but linking in object file built for iOS, file '/Users/ddur/Documents/flutterDev/mapgogo/ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/GoogleMaps' for architecture arm64Could not build the application for the simulator.Error launching application on iPhone SE (3rd generation).
-
미해결실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
UserLoanHistory.bookName의 nullability
Book.name에 @Column(nullable = false)을 붙였으니 UserLoanHistory.bookName도 논리적으로 null이 될 수 없는데요. 그래서 bookName에는 애노테이션을 붙이지 않으신 건가요? 애노테이션을 붙여서 DDL에 물리적으로 not null을 설정해야 하는 게 아닌가 싶어 질문 드립니다.
-
미해결다양한 사례로 익히는 SQL 데이터 분석
실습자료 복원 오류
안녕하세요 선생님현재 Mac m1 사용 중입니다!백업파일 용량이 너무 커서인지 잘 모르겠지만, ga_sess / ga_sess_hits 등의 파일이 덜들어 온것 같습니다.혹시 해결책이 있을까요?감사합니다!!
-
미해결풀스택을 위한 도커와 최신 서버 기술(리눅스, nginx, AWS, HTTPS, 배포까지) [풀스택 Part3]
nginx.conf 수정관련
많은 개린이분들이 저처럼 시간낭비하지말라고 글을 남깁니다.. 거의 다잉메세지입니다...강사님이 nginx.conf파일을 수정하시는데요실제로 우리가 내려받는 파일의 09폴더에 있는 nginx.conf.http파일에는 고쳐야할 부분이 총 세가지 입니다. (영상과는 다르게 되어 있는 부분들도 있습니다. 그것들까지 포함해서 총 세개!)도메인(총 6개 였습니다.) : funcoding.xyz >> 각자 도메인으로 수정맨 아래 server블락(443포트 https관련) 위아래로 있는 주석(*/, /*)삭제역시 맨 아래 server블락에 servername아래에 있는 네줄의 코드 앞에 있는 #. 역시 주석관련된 건데, #를 모두 삭제다시 되돌아보면 부끄러울정도로 간단한 것들이였는데, nginx나 docker가 처음이다보니 허둥대다가 몇일을 날렸는지 모르겠네요
-
미해결평생 써먹는 데이터 기반 투자법 with 파이썬 퀀트 투자
강의 내에 파이썬 버전과 패키지들 버전이 어떻게 되나요?
강의에 맞는 가상환경을 만들려는데파이썬 버전, 기타 패키지들의 버전은 어떻게 되나요?혹시 패키지 목록을 requirements.txt로 만들어주실 수 있을까요?
-
미해결Svelte.js [Core API] 완벽 가이드
textarea에서 esc 키를 누를 때 오류
13:08 초에서 on:keydown을 통해 event.key가 Escape인지 확인하여 offEditMode()를 실행하는 로직을 짜주셨는데, 결과적으로 작동하지 않았습니다.console.log로 이벤트를 찍어봤는데 Escape의 경우 콘솔창에도 기록되지 않는데, 어떻게 해야 정상적으로 실행이 가능할까요? Enter는 정상적으로 addList를 실행했었습니다.
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
paramMap
안녕하세요 개념이 정립이 잘 안되서 그러는데 결국 paramMap이라는게 http://localhost:8080/request-param?username=hello&age=20이걸 예로 들면 username=hello, age = 20이걸 paramMap에 저장한 다음 꺼내는 건가요?
-
미해결it 취업을 위한 알고리즘 문제풀이 입문 (with C/C++) : 코딩테스트 대비
x도 같고 y도 같고 z도 같다면 어떻게 되나요?
안녕하세요 선생님.이 부분에서 만약에 비교 대상이x도 같고 y도 같고 z도 같아서저 3가지 if에 대해 모두 false일때는위 코드가 어떻게 동작하나요....?실행할 코드가 없어보이는데...
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
5-P 질문 있습니다.
95%에서 틀렸습니다가 나옵니다.. 시뮬레이션인데 예외가 있는지 궁금합니다..확인하는 함수까지 첨부합니다..#include <bits/stdc++.h> using namespace std; // #define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int T, K, cnt; int gears[1001]; int rotRight(int gear) { int temp = gear & 1; int res = (gear >> 1) | (temp << 7); return res; } int rotLeft(int gear) { int temp = gear & (1 << 7); int res = (gear << 1) | (temp >> 7); return res; } void rotate(int idx, int dir) { int low = 1, high = T; for (int i = idx; i > 1; i--) { int rightGear = (gears[i] & (1 << 1)) << 4; int LeftGear = gears[i - 1] & (1 << 5); int dif = rightGear ^ LeftGear; if (!dif) { low = i; break; } } for (int i = idx; i < T; i++) { int LeftGear = (gears[i] & (1 << 5)); int rightGear = (gears[i + 1] & (1 << 1)) << 4; int dif = rightGear ^ LeftGear; if (!dif) { high = i; break; } } if (dir == 1) { for (int i = low; i <= high; i++) { if ((i & 1) == (idx & 1)) { gears[i] = rotRight(gears[i]); } else { gears[i] = rotLeft(gears[i]); } } } else if (dir == -1) { for (int i = low; i <= high; i++) { if ((i & 1) == (idx & 1)) { gears[i] = rotLeft(gears[i]); } else { gears[i] = rotRight(gears[i]); } } } } void printGear(int n) { for (int i = 7; i >= 0; i--) { cout << ((n & (1 << i)) ? 1 : 0); } cout << '\n'; } void printAll() { for (int i = 1; i <= T; i++) { printGear(gears[i]); } cout << '\n'; } int main() { freopen("input.txt", "r", stdin); scanf("%d", &T); for (int i = 1; i <= T; i++) { int gear = 0; for (int j = 0, temp; j < 8; j++) { gear = gear << 1; scanf("%1d", &temp); gear += temp; } gears[i] = gear; } // printAll(); scanf("%d", &K); for (int i = 0, a, b; i < K; i++) { scanf("%d %d", &a, &b); rotate(a, b); // printAll(); } for (int i = 1; i <= T; i++) { if (gears[i] & (1 << 7)) cnt++; } printf("%d", cnt); return 0; }
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
porm.xml 관련 문제가 있는데 질문있습니다
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</artifactId> <version>0.9.1</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.3.176</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bus-amqp</artifactId> </dependency> <dependency> <groupId>org.modelmapper</groupId> <artifactId>modelmapper</artifactId> <version>2.3.8</version> </dependency> <dependency> <groupId>jakarta.validation</groupId> <artifactId>jakarta.validation-api</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> </dependency> 위 패키지들을 추가하고 실행시키면 java: error reading /Users/user/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.65/tomcat-embed-core-9.0.65.jar; zip file is empty아래와 같은 에러가뜨는데 이유를 모르겠습니다 ...
-
미해결Vue.js + TypeScript 완벽 가이드
Chart.js 최신버전(3.9.1) 진행방법 문의드립니다.
Chart.js에서 최신버전인 3.9.1 버전으로 진행하면 그래프가 그려지지 않고있는데 어떻게 해야 그래프를 확인할 수 있을까요?
-
미해결그림으로 배우는 자바, 파트2: 객체지향!
외부로부터 감추기 문제 질문
6번줄에서 System.out.print(wallet.toString()); 라고 출력하는데 toString 메소드를 보면 리턴으로 반환하는데 리턴하면 System.out.print 메소드가 필요없지 않나요?
-
미해결홍정모의 따라하며 배우는 C++
nonstatic 멤버 함수의 포인터 질문
#include <iostream>using namespace std;class Some {private: static int val_; int val2_=2;public: static int getVal() { return val_; //return val2_; } int temp() { return this->val_+this->val2_; }};int Some::val_ = 1;int main() { Some s1; int (Some:: * ptr)() = &Some::temp; cout << ptr << endl; cout << (s1.*ptr)() << endl; return 0;}안녕하세요.위의 코드를 실행시켰을 때 13이라는 결과가 나왔는데요,ptr을 출력했을 때 1이 나왔습니다.왜 ptr출력시 1이란 값이 나오는 걸까요? ptr만 출력했기 때문에 혹시 주소가 나올까 생각했는데 값이 나왔고, 또 왜 1이란 값이 나왔는지 잘 모르겠습니다.
-
미해결함수형 프로그래밍과 JavaScript ES6+
일급함수 방식 중 이터레이터 쓰는 곳에서 조금 헷갈리는 부분이 있어 질문 드립니다
let list=[1,2,3,4]let a=list[Symbol.iterator]()a.next()라고 하면 문제없이 실행되는데let list=[1,2,3,4]let a=list[Symbol.iterator]a().next()라고 하면 왜 에러가 날까요 anonymous 에러면 브라우저에서 인식하는 방식이나 이런 문제일까요 아 혹시 얕은 복사 문제일까요?VM2199:1 Uncaught TypeError: Cannot convert undefined or null to object at <anonymous>:1:1
-
미해결그림으로 배우는 자바, 파트2: 객체지향!
클래스가 다른데 메소드를 어떻게 가져오는건가요?
팀클래스에서 플레이서 클래스에 있는 totalPoint메소드를 사용하던데 클래스가 다른데 어떻게 사용하는건가요?
-
미해결리눅스 커맨드라인 툴 (Full ver.)
질문있습니다.
리눅스 시스템 개발자를 희망하는 것은 아닌데리눅스 환경에서 개발해보는게 오랜 바램이어서 로드맵을 시작하게되었는데요.들어두면 도움 되겠죠?( 지금 3번째 로드맵 강의 듣는중입니다)