묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[웹 개발 풀스택 코스] Vue.js 프로젝트 투입 일주일 전 - 기초에서 실무까지
mixins/index.js 'application/json;charset=utf-8' 부분을 선언 안해도 잘 동작 되는데 안하면 어떤 문제가 발생하는지 궁금합니다.
mixins/index.js 에서아래 부분을 선언하지 않아도 정상 작동 하는데,아래 부분을 선언하지 않으면어떤 문제가 발생하는지 궁금합니다.답변 주시면 감사하겠습니다axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
-
미해결[웹 개발 풀스택 코스] Node.js 프로젝트 투입 일주일 전 - 기초에서 실무까지
개발자님이 예시로 해서 Mysql에 넣은 데이터들을 알수있을까요?
안녕하세요. 현재 mysql 연동하기 강의를 듣고 있는데, 개발자님이 예시로 해서 Mysql에 넣은 데이터들을 알수있을까요?
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
config.json 파일을 불러올 수 없습니다.
안녕하세요 선생님npm start 실행하면 config파일이 잘 불러와지는데npm run test를 실행하면 config 파일이 불러와지지 않는 것 같습니다. routes/auth.test.js ● Test suite failed to run TypeError: Cannot read properties of undefined (reading 'database') 10 | const db = {}; 11 | const sequelize = new Sequelize( > 12 | config.database, config.username, config.password, config, | ^ 13 | ); 14 | 15 | db.sequelize = sequelize; at Object.database (models/index.js:12:12) at Object.require (app.js:17:21) at Object.<anonymous> (routes/auth.test.js:1:30) npm run test를 했을 때 뜨는 오류입니다.{ "development": { "username": "root", "password": "비밀번호", "database": "nodebird", "host": "127.0.0.1", "dialect": "mysql" },config/config.json 파일에 developmont도 존재합니다.const Sequelize = require('sequelize'); const fs = require('fs'); const path = require('path'); const env = process.env.NODE_ENV || 'development'; console.log(env); const config = require('../config/config')[env]; console.log(config) const db = {}; const sequelize = new Sequelize( config.database, config.username, config.password, config, );models/index.js 파일입니다.npm start를 실행하면 에러없이 실행되고, console.log도 실행되어서 env, config 다 undefined가 아님을 확인했습니다.어떤 부분이 문제인지 감을 잘 잡지 못하겠습니다.힌트 좀 주실 수 있을까요?
-
미해결자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
7강. 유저 생성 API 개발 질문있습니다.
안녕하세요현재 7강. 유저 생성 API 개발 의 9분 듣고있습니다.국비 프로젝트에서 dto에 직접 저장을 했던 경험이 있습니다.선생님께서는 dto에 패키지의 UserCreateRequest에 저장하지 않고 domain패키지에 User라는 객체를 따로 만들어서 저장하시더라구요.그렇게 하는 이유를 알려주실 수 있을까요?
-
해결됨이미지 관리 풀스택(feat. Node.js, React, MongoDB, AWS)
react-router-dom v6 useHistory 이슈
react-router-dom v6 이상에서는 useHistory 대신 useNavigate 를 사용하여야 합니다.v5import { useHistory } from "react-router-dom";const history = useHistory(); history.push("/");v6import { useNavigate } from "react-router-dom";const navigate = useNavigate(); navigate("/");
-
해결됨ElasticSearch Essential
데이터 노드에 할당되는 인덱스
안녕하세요, 강의와 책 모두 구매해서 듣고있습니다^^다름이 아니라, 제가 데이터 노드를 es-data-0~4까지 총 5개 클러스터를 구동하고있는데 인덱스 생성시 4개밖에 할당이 안되더라구요ㅠ 컴포넌트 세팅설정시, number_of_shards는 2개로 주었습니다.혹시나 해서 cluster.routing.allocation.enable = primaries로 변경후 노드 셧다운 -> 재실행 후 cluster.routing.allocation.enable = null 로 바꾸어 샤드 할당 설정을 활성화 했는데도 똑같이 4개밖에 안되네요.. 5개 모두 할당할 수 있는 방법이 있을까요??
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
2-h 반례가 궁금합니다..
큰돌님 코드가 더 간결하고 깔끔하지만 제가 처음에 짰던 코드가 왜 틀렸는지 궁금합니다. 테스트케이스는 잘 나와서요.. 한번봐주시며누감사하겠습니다@@ http://boj.kr/1226e9fbc2ea4ec9b509842b79f41ecf
-
미해결
React에서 FCM 사용
안녕하세요 !FCM으로 푸시 기능을 짜다가,, 도저히 모르겠어서 글 남깁니다 ..! 문제는 콘솔에는 푸시 알림이 왔다는 게 찍히는데,푸시가 보이지 않습니다 ... ㅠㅠ[ 폴더 구조 ][ firebase-messaging-sw.js ]self.addEventListener('push', function (e) { console.log('push: ', e.data.json()) if (!e.data.json()) return const resultData = e.data.json().notification const notificationTitle = resultData.title const notificationOptions = { body: resultData.body, icon: resultData.image, tag: resultData.tag, ...resultData } console.log('push: ', { resultData, notificationTitle, notificationOptions }) registration.showNotification(notificationTitle, notificationOptions) }) [ messaging_init_in_sw.js ] import { initializeApp } from 'firebase/app' import { getMessaging, getToken } from 'firebase/messaging' const firebaseConfig = { apiKey: process.env.REACT_APP_FIREBASE_API_KEY, authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN, projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID, storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET, messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID, appId: process.env.REACT_APP_FIREBASE_APP_ID, measurementId: process.env.REACT_APP_FIREBASE_MEASUREMENT_ID } function requestPermission() { console.log('푸시 허가 받는 중 ...') void Notification.requestPermission().then((permission) => { if (permission === 'granted') { console.log('푸시 알림이 허용되었습니다.') } else { console.log('푸시 알림이 허용되지 않았습니다') } }) const app = initializeApp(firebaseConfig) const messaging = getMessaging(app) void getToken(messaging, { vapidKey: process.env.REACT_APP_FIREBASE_VAPID_KEY }).then((token) => { if (token.length > 0) { console.log('푸시 토큰 : ', token) } else { console.log('푸시 토큰 실패 !') } }) } requestPermission() 토큰은 제대로 잘 받아와지는데,,, 혹시 서비스워커 코드에 문제가 있는 걸까요 ..?
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
3-D 반례 질문
선생님 제가 정말 많은 반례를 넣어봤는데 다 실행이 되지만 백준에서 실행시켜보면 2%에서 실패됩니다. 반례 찾아주시면 정말 감사하겠습니다!http://boj.kr/06c2448042e64476b47b0a2dd5c7eeb0
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
listview adapter 오류
inflate에 빨간 밑줄이 사라지지 않는데 어디가 잘못된 것 일까요??
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
백준 1012 유기농 배추 문제
안녕하세요 큰돌님,제가 작성한 코드가 큰돌님의 예시 답안 코드와 로직이 거의 비슷하다고 느끼는데 제 코드는 백준에서 패스가 안되서 한번 의견을 구하고자 합니다.혹시 왜 accept이 안되는지 이유가 보이시면 답변 부탁드립니다~! #include<bits/stdc++.h> using namespace std; int tc, n, m, k, a, b, ny, nx, cnt; int cabbage[51][51], visited[51][51]; const int dy[4] = {-1, 0, 1, 0}; const int dx[4] = {0, 1, 0, -1}; void dfs(int y, int x){ visited[y][x] = 1; for(int i=0; i<4; i++){ ny = y + dy[i]; nx = x + dx[i]; if(ny < 0 || ny >= n || nx < 0 || nx >= m) continue; if(visited[ny][nx] == 1) continue; if(cabbage[ny][nx] == 0) continue; dfs(ny, nx); } return; } int main(){ cin.tie(NULL); cout.tie(NULL); //tc 개수 받기 cin >> tc; for(int e=0; e<tc; e++){ // n, m, k 받기 cin >> n >> m >> k; // 초기화 cnt = 0; fill(&cabbage[0][0], &cabbage[n-1][m], 0); fill(&visited[0][0], &visited[n-1][m], 0); // 배추의 위치 입력 for(int i =0; i<k; i++){ cin >> a >> b; cabbage[b][a] = 1; } for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ if(cabbage[i][j] == 1 && visited[i][j]==0){ dfs(i,j); cnt++; } } } cout << cnt << "\n"; } return 0; }
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
tailwindcss 라이브러리 받은 후 실행이 안됩니다.
npm i -D postcss autoprefixer tailwindnpx tailwindcss init -p 모두 작업을 마치고 /** @type {import('tailwindcss').Config} */ export default { content: [ "./index.html", "./src/**/*.{js,jsx,ts,tsx}" ], theme: { extend: {}, }, plugins: [], } index.css@tailwind base; @tailwind components; @tailwind utilities; npm run dev 를 돌리면,node:internal/process/promises:246triggerUncaughtException(err, true /* fromPromise */);[Failed to load PostCSS config: Failed to load PostCSS config (searchPath: C:/WebStudy/WebDevelement/React/fullstack-react/front): [Error] Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'라는 오류가 뜹니다.원인파악이 어려운데 문의드립니다!
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
inline css
혹시 4번째 줄에서 inline css style을 적용할 때 {} 중괄호로 한번 더 감싸는 이유가 무엇인가요?
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
5.9 bike sharing demand에서 standardScaler
bike sharing demand예제에서 LinearRegression모델이 다른 모델에 비해 RMSLE가 큰 것이 Scaler문제는 아닌가 해서 StandardScaler를 다음과 같이 적용시켜 봤습니다만, 성능이 좋아지질 않는 것 같습니다.X_train, X_test, y_train, y_test = train_test_split(X_features_ohe, y_target_log, test_size = 0.3, random_state = 0) from sklearn.compose import ColumnTransformer from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline def get_model_predict(model, X_train, X_test, y_train, y_test, is_expm1 = False, sts = False): if sts: ct = ColumnTransformer([ ('standard', StandardScaler(), ['temp', 'atemp', 'humidity', 'windspeed']) ], remainder = 'passthrough') model = Pipeline([ ('ct', ct), ('model', model) ]) model.fit(X_train, y_train) pred = model.predict(X_test) if is_expm1: y_test = np.expm1(y_test) pred = np.expm1(pred) print(model.__class__.__name__) evaluate_regr(y_test, pred)선형 모델임에도 불구하고 이게 통하지 않는것이 좀 의문입니다. 게다가 다른 모델에서는 성능이 나빠지기도 합니다.그리고 StandardScaler를 적용하기 전과 후의 coef_가 많이 다릅니다. 다음 그래프는 StandardScaler를 적용했을 때 LinearRegression의 coef_입니다.feature중요도 측면에서, StandardScaler를 적용한 후의 coef_가 더 믿을만 한지, 아니면 적용하지 않은게 더 믿을만 하다고 봐야하는지 궁금합니다.그래프 출력하는 코드는 다음과 같습니다.# X_features_ohe_sts ct = ColumnTransformer([ ('standard', StandardScaler(), ['temp', 'atemp', 'humidity', 'windspeed']) ], remainder = 'passthrough') model = Pipeline([ ('ct', ct), ('model', LinearRegression()) ]) # model = LinearRegression() model.fit(X_train, y_train) series = pd.Series(np.abs(model[-1].coef_), index = X_features_ohe.columns) series = series.sort_values(ascending = False)[:20] sns.barplot(series.values, series.index)
-
미해결Three.js로 시작하는 3D 인터랙티브 웹
Chapter 9의 커스텀 모델 로드하기에서 오류가 뜹니다.
안녕하세요 1분코딩님 강의에서처럼import * as THREE from 'three'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; // gltf loader const loader= new THREE.GLTFLoader; GLTFLoader.load( '/models/ilbuni.gltf', gltf => { console.log(gltf) } ); 이렇게 입력했는데, localhost:8080에서export 'GLTFLoader' (imported as 'THREE') was not found in 'three' 와 같은 오류가 뜹니다. three.js의 폴더는 평소에 잘 실행 된 것 처럼 위치해 있는 거 같은데, 무엇이 잘못되었는지를 모르겠습니다.
-
미해결
spring boot에서 h2 데이터베이스 사용 관련
제가 알기론 스프링 부트에 h2 데이터베이스가 내장되어 있어 h2를 별도로 설치할 필요 없이 의존성 추가만 하여 사용할 수 있는것으로 아는데 왜 spring data JPA 강의에서는 h2 를 별도로 설치 하여 하는 건가요? 별도로 설치후 기존 설치 없이 하던 방법으로도 안되고 있어 곤욕입니다.
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
3-F 질문있습니다.
안녕하세요 큰돌님bfs로 최단거리를 탐색하여 문제를 풀어 보았습니다.q에서 뺄때, 방문처리를 할때는 맞는데,https://www.acmicpc.net/source/61392099q에 넣을때 방문처리를 할때는 틀립니다.https://www.acmicpc.net/source/61392143최단거리라 q에 넣을때 바로 방문처리를 해줘서 더 높은 cnt일때 방문한 값이 다시 큐에 들어갈일이 없도록 하는것이 맞는것 같은데, 어떤 경우에서 틀린지 모르겠습니다.
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
3-H 질문합니다
안녕하세요 큰돌님!벡터에 trace를 저장하여 k에 도달하면 trace를 출력하는 방식으로 풀었습니다.벡터의 push_back()은 시간 복잡도 O(1)으로 알고 있습니다.때문에 왜 시간 초과가 나는지 궁금합니다!https://www.acmicpc.net/source/61394001
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
6-L 시간복잡도 질문
http://boj.kr/75cc76adfce24cbd88595ea4ea999a5d안녕하세요 강사님 ㅎㅎ해당 강의 초반에 무식하게 풀었을 때의 시간복잡도가 (n * n-1 / 2)*n 이라고 설명하시는데 제가 혼자 문제풀 때는 다르게 계산을 했거든요...저는 연속된 수들의 곱이니까 이중 for문으로 for(int i=0; i<n; i++){ for(int j=i+1; j<n; j++){식의 연산이 필요하다 생각했고 여기다가 백트래킹으로 == 0일때 break 정도하는 조건까지만 넣었습니다. 이러면 등차수열의 합 정도의 시간복잡도가 되니 O(n^2)이고 n의 최대범위가 10000 -> 제곱은 1억 -> 1억에서 천만까지는 해볼만하다고 알려주셔서 위 생각의 흐름대로 문제를 풀었습니다. 혹시 제가 시간복잡도 계산을 잘못한건가요..?
-
미해결홍정모의 따라하며 배우는 C++
fixed 관련 질문이 있습니다
#include <iostream> #include <iomanip> using namespace std; int main() { float x = 79; cout << showpoint << fixed << x << endl; cout << noshowpoint << x << endl; }showpoint를 쓰다가 noshowpoint 조정자를 쓰면 리셋돼서 소수점이 다시 출력되지 않는 것처럼 fixed도 리셋할 수 있는 방법이 있나요?