묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[개정3판] Node.js 교과서 - 기본부터 프로젝트 실습까지
실시간 채팅방에서 GIF uploads 하면 GIF가 바로 화면에 보이지 않고 새로 고침을 해야 보이는데 어떻게 해야 할까요?
실시간 채팅방 강좌 코드를 작성하여 작동 시켜 본 결과 메시지 전송 까지는 잘 되는 것을 확인 하였는데 GIF 업로드 시 다음 그림과 같은 현상이 발생하고 있습니다그림 하단에 표시한 부분 처럼 처음에 GIF 올리기를 하면 그림이 보이지 않다가 새로 고침을 하면 위의 다른 GIF 처럼 잘 보이긴 하는데 무슨 문제 일까요?참고로 관련 코드를 같이 올립니다chat.html {% extends 'layout.html' %} {% block content %} <h1>{{title}}</h1> <a href="/" id="exit-btn">방 나가기</a> <fieldset> <legend>채팅 내용</legend> <div id="chat-list"> {% for chat in chats %} {% if chat.user === user %} <div class="mine" style="color: {{chat.user}}"> <div>{{chat.user}}</div> {% if chat.gif %}} <img src="/gif/{{chat.gif}}"> {% else %} <div>{{chat.chat}}</div> {% endif %} </div> {% elif chat.user === 'system' %} <div class="system"> <div>{{chat.chat}}</div> </div> {% else %} <div class="other" style="color: {{chat.user}}"> <div>{{chat.user}}</div> {% if chat.gif %} <img src="/gif/{{chat.gif}}"> {% else %} <div>{{chat.chat}}</div> {% endif %} </div> {% endif %} {% endfor %} </div> </fieldset> <form action="/chat" id="chat-form" method="post" enctype="multipart/form-data"> <label for="gif">GIF 올리기</label> <input type="file" id="gif" name="gif" accept="image/gif"> <input type="text" id="chat" name="chat"> <button type="submit">전송</button> </form> <script src="https://unpkg.com/axios/dist/axios.min.js"></script> <script src="/socket.io/socket.io.js"></script> <script> const socket = io.connect('http://localhost:8005/chat', { path: '/socket.io', }); socket.emit('join', new URL(location).pathname.split('/').at(-1)); socket.on('join', function (data) { const div = document.createElement('div'); div.classList.add('system'); const chat = document.createElement('div'); div.textContent = data.chat; div.appendChild(chat); document.querySelector('#chat-list').appendChild(div); }); socket.on('exit', function (data) { const div = document.createElement('div'); div.classList.add('system'); const chat = document.createElement('div'); div.textContent = data.chat; div.appendChild(chat); document.querySelector('#chat-list').appendChild(div); }); socket.on('chat', function (data) { const div = document.createElement('div'); if (data.user === '{{user}}') { div.classList.add('mine'); } else { div.classList.add('other'); } const name = document.createElement('div'); name.textContent = data.user; div.appendChild(name); if (data.chat){ const chat = document.createElement('div'); chat.textContent = data.chat; div.appendChild(chat); } else { const gif = document.createElement('img'); gif.sr = '/gif/' + data.gif; div.appendChild(gif); } div.style.color = data.user; document.querySelector('#chat-list').appendChild(div); }); document.querySelector('#chat-form').addEventListener('submit', function (e) { e.preventDefault(); if (e.target.chat.value) { axios.post('/room/{{room._id}}/chat', { chat: this.chat.value, }) .then( () => { e.target.chat.value = ''; }) .catch( (err) => { console.error(err); }); } }); document.querySelector('#gif').addEventListener('change', function (e) { console.log('******',e.target.files); const formData = new FormData(); formData.append('gif', e.target.files[0]); axios.post('/room/{{room._id}}/gif', formData) .then( () => { e.target.file = null; }) .catch( (err) => { console.error(err); }); }); </script> {% endblock %} routes/index.jsconst express = require('express'); const { renderMain, renderRoom, createRoom, enterRoom, removeRoom, sendChat, sendGif } = require('../controllers'); const multer = require('multer'); const fs = require('fs'); const path = require('path'); const router = express.Router(); router.get('/', renderMain); router.get('/room', renderRoom); router.post('/room', createRoom); router.get('/room/:id', enterRoom); router.delete('/room/:id', removeRoom); router.post('/room/:id/chat', sendChat); try {fs.readdirSync('uploads'); } catch (err) { console.error('uploads 폴더가 없어 uploads 폴더를 생성합니다.'); fs.mkdirSync('uploads'); } const upload = multer({ storage: multer.diskStorage({ destination(req, file, done) { done(null, 'uploads/'); }, filename(req, file, done ) { const ext = path.extname(file.originalname); done(null, path.basename(file.originalname, ext) + Date.now() + ext); }, }), limits: {fileSize: 5 * 1024 *1024 }, }) router.post('/room/:id/gif', upload.single('gif'), sendGif); module.exports = router;controllers/index.jsconst Room = require('../schemas/room'); const Chat = require('../schemas/chat'); const { removeRoom: removeRoomService } = require('../services'); exports.renderMain = async ( req, res, next ) => { try{ const rooms = await Room.find({}); res.render('main', {rooms, title: 'GIF 채팅방'}); } catch (error) { console.error(error); next(error); } }; exports.renderRoom = ( req, res, next ) => { res.render('room', { title: 'GIF 채팅방 생성'}); }; exports.createRoom = async ( req, res, next ) => { try{ const newRoom = await Room.create({ title: req.body.title, max: req.body.max, owner: req.session.color, password: req.body.password, //session data 에서 옮 }); const io = req.app.get('io'); io.of('/room').emit('newRoom', newRoom); // 방에 들어가는 부분 if (req.body.password ) { res.redirect(`/room/${newRoom._id}?password=${req.body.password}`); } else { res.redirect(`/room/${newRoom._id}`); } } catch (error) { console.error(error); next(error); } }; exports.enterRoom = async( req, res, next ) => { try{ const room = await Room.findOne({_id: req.params.id}); if (!room){ return res.redirect('/?error=존재하지 않는 방입니다.'); } if (room.password && room.password !== req.query.password ){ return res.redirect('/?error=비밀번호가 틀렸습니다.'); } const io = req.app.get('io'); const { rooms } = io.of('/chat').adapter; if (room.max <= rooms.get(req.params.id)?.size) { return res.redirect('/?error=허용 인원을 초과하였습니다.'); } const chats = await Chat.find({room: room._id }).sort('createdAt'); res.render('chat', { title: 'GIF 채팅방 생성', chats , room, user: req.session.color }); } catch (error) { console.error(error); next(error); } }; exports.removeRoom = async ( req, res, next ) => { try { await removeRoomService(req.params.id ); res.send('ok'); setTimeout(() => { req.app.get('io').of('/room').emit('removeRoom', req.params.id); }, 2000) } catch (error) { console.error(error); next(error); } }; exports.sendChat = async (req, res, next ) =>{ try { const chat = await Chat.create({ room: req.params.id, user: req.session.color, chat: req.body.chat, }); req.app.get('io').of('/chat').to(req.params.id).emit('chat', chat); res.send('ok'); } catch( error ){ console.error(error); next(error); } } exports.sendGif = async (req, res, next ) => { try { const chat = await Chat.create({ room : req.params.id, user: req.session.color, gif: req.file.filename, }) setTimeout(() => { req.app.get('io').of('/chat').to(req.params.id).emit('chat',chat); }, 1000); res.send('ok'); } catch (error) { console.error(error); next(error); } } [제로초 강좌 질문 필독 사항입니다]질문에는 여러분에게 도움이 되는 질문과 도움이 되지 않는 질문이 있습니다.도움이 되는 질문을 하는 방법을 알려드립니다.https://www.youtube.com/watch?v=PUKOWrOuC0c0. 숫자 0부터 시작한 이유는 1보다 더 중요한 것이기 때문입니다. 에러가 났을 때 해결을 하는 게 중요한 게 아닙니다. 왜 여러분은 해결을 못 하고 저는 해결을 하는지, 어디서 힌트를 얻은 것이고 어떻게 해결한 건지 그걸 알아가셔야 합니다. 그렇지 못한 질문은 무의미한 질문입니다.1. 에러 메시지를 올리기 전에 반드시 스스로 번역을 해야 합니다. 번역기 요즘 잘 되어 있습니다. 에러 메시지가 에러 해결 단서의 90%를 차지합니다. 한글로 번역만 해도 대부분 풀립니다. 그냥 에러메시지를 올리고(심지어 안 올리는 분도 있습니다. 저는 독심술사가 아닙니다) 해결해달라고 하시면 아무런 도움이 안 됩니다.2. 에러 메시지를 잘라서 올리지 않아야 합니다. 입문자일수록 에러메시지에서 어떤 부분이 가장 중요한 부분인지 모르실 겁니다. 그러니 통째로 올리셔야 합니다.3. 코드도 같이 올려주세요. 다만 코드 전체를 다 올리거나, 깃헙 주소만 띡 던지지는 마세요. 여러분이 "가장" 의심스럽다고 생각하는 코드를 올려주세요.4. 이 강좌를 바탕으로 여러분이 응용을 해보다가 막히는 부분, 여러 개의 선택지 중에서 조언이 필요한 부분, 제 경험이 궁금한 부분에 대한 질문은 대환영입니다. 다만 여러분의 회사 일은 질문하지 마세요.5. 강좌 하나 끝날 때마다 남의 질문들을 읽어보세요. 여러분이 곧 만나게 될 에러들입니다.6. 위에 적은 내용을 명심하지 않으시면 백날 강좌를 봐도(제 강좌가 아니더라도) 실력이 늘지 않고 그냥 코딩쇼 관람 및 한컴타자연습을 한 셈이 될 겁니다.
-
해결됨개발자를 위한 쉬운 도커
섹션8-캐싱을 활용한 빌드
안녕하세요 수강 중 궁금한 점이 생겨 질문 드립니다.App.vue파일에서 내용을 바꾼 후 빌드 했을 때 copy 지시어부터 캐싱이 사용되지 않는다고 하셨는데 왜 오른쪽의 나온 시간이 0.0초인지 궁금합니다!
-
해결됨김영한의 실전 자바 - 기본편
함수와 메서드
안녕하세요.수업 정말 잘 듣고 있습니다.입문 편이랑 기본 편 복습 중에 질문 하나 드립니다.인터넷에서 검색해 보니static이 붙은 정적 메서드, 클래스 메서드를 함수라고 부르기도 하고static이 붙지 않은 인스턴스 메서드를 메서드라고라고 부르기도 한다는데요.위와 같이 구분해서 부르는 건 맞는 건가요?
-
미해결견고한 결제 시스템 구축
다음 강의가 너무 기대되요:) 'Sacale-up 하며 배우는 대용량 트래픽 처리'
인프런에서 이런 질문 해도 될지 모르겠네요... fastcampus 에서 준비하고 있는강의 'Sacale-up 하며 배우는 대용량 트래픽 처리' 이부분 질문 및 건의? 사항이 있습니다.이번에 강의 payment 강의 들으면서 정말 유익한 강의라고 생각 합니다!질문 포함해서 조금 아쉬었던 부분이 있어서 개인적인 생각?이니! 참고만...1. 제가 듣기론 최소한 백엔드 측면에서 봤을때 아직까지 코틀린 보다 자바로 개발하신분이 많은거 같은데 굳이 코틀린으로 개발 하셨는지 알고 싶습니다. (참고로 다음 강의에 자바로 해주셨으면 좋겠어요 ㅠㅠ) Webflux 사용한 이유에 대해 https://www.inflearn.com/questions/1281130/%EA%B0%95%EC%9D%98%EB%A5%BC-%EB%93%A3%EA%B3%A0-%EB%AC%B8%EB%93%9D-%EA%B6%81%EA%B8%88%ED%95%9C-%EC%A0%90%EC%9D%B4-%EC%83%9D%EA%B2%BC%EC%8A%B5%EB%8B%88%EB%8B%A4여기서 잘 설명해주셨지만 일단 이 강의를 듣는 수강생들 입장에서는 Webflux 을 이해해야 수강이 가능하니 아무래도 Webflux가 런닝커브가 있는데요 ㅠㅠ 그래서 이 강의 진입하는데 리스크가 있을것 같아요 ㅠ,ㅠ 결제 부분을 가장 강조된 강의인데 Webflux를 알아야 이 강의를 수강 할 수 있다는점 ㅠ,ㅠ 다시한번 말씀드리지만 분명 Webflux 도입 하는것에 있어서 합당성을 이해하지만요 ㅠ,ㅠ fastcampus 에서 출시되는 강의 경우 아무래도 인프런과 비교해서 비용이 만만치가 않아서요 ㅠ,ㅠ 혹시 다음에 출시 되는 'Sacale-up 하며 배우는 대용량 트래픽 처리' 강의 인프런에서도 동일하게 출시가 가능 할까요?.. 다시한번 좋은 강의 기회 주셔서 정말 감사드리고 앞으로 좋은 강의 부탁드립니다 🙂 감사합니다!
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
조합을 이용한 풀이
안녕하세요 선생님 조합을 이용해서 문제 풀이를 시도했는데, 순열 [1,3,9]를 이용 http://boj.kr/2411bc89bcd94ac3baab79fed027f981 순열[-9,-3,-1]을 이용http://boj.kr/8a0f5a03890c4b1cb210f3ef378f238e 각각 시도를 했는데 1번의 경우는 실패하고 2번의 경우는 성공을 하는데 이유를 모르겠습니다.
-
미해결해커를 위한 iOS 앱 모의 해킹 전문 과정
rootless로 탈옥
안녕하세요. 강의 영상과는 다른 도구를 사용해서 탈옥을 했는데, Rootful로 하니 오류가 나서 Rootless로 탈옥을 했습니다. Rootless로 탈옥을 해도 괜찮을까요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형2 모델링 여러개 돌려보고 평가지표 제일 높은걸로 최종제출해야하나요??
안녕하세요, 작업형2 문제를 풀 때 여러 모델로 돌려보고평가지표 제일 높은걸로 최종제출해야 하나요??혹시, 모델 한가지로만 돌려보고 제출하게되면 감점요인이 있는지 궁금합니다.
-
미해결파이썬 무료 강의 (기본편) - 6시간 뒤면 나도 개발자
파일 생성 퀴즈 - 파일 제목에.format 사용
반복문을 이용해서 1~50주차.txt 파일 생성할때 str(i) +"주차.txt" 이렇게 작성해주셨는데이때 str(i)가 아니라 "{0}주차.txt".format(i) 로 하면 코드 실행이 안되더라구요!.format 은 프린트문에만 사용이 가능한건가요? 그리고 파일 내용 작성 시 프린트문 하나안에서 \n 을 사용해 행을 바꾸지 않고 줄 수만큼의 print문을 작성하는 이유가 궁금합니다
-
미해결스프링과 JPA 기반 웹 애플리케이션 개발
postgreSql 연결하여 JPA 를 통해 테이블 생성시 ZONE 테이블 생성에서 에러가 납니다
2024-06-05 08:17:10.986 WARN 86324 --- [ main] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL " create table zone ( id int8 not null, city varchar(255) not null, local_name_of_city varchar(255) not null, province varchar(255), primary key (id) )" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " create table zone ( id int8 not null, city varchar(255) not null, local_name_of_city varchar(255) not null, province varchar(255), primary key (id) )" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:458) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:442) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:325) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:169) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:138) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:124) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:168) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:85) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:335) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.23.jar:5.3.23] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.23.jar:5.3.23] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.23.jar:5.3.23] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.23.jar:5.3.23] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.23.jar:5.3.23] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.23.jar:5.3.23] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.23.jar:5.3.23] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.23.jar:5.3.23] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.4.jar:2.7.4] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-2.7.4.jar:2.7.4] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.4.jar:2.7.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.4.jar:2.7.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.4.jar:2.7.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.4.jar:2.7.4] at com.studyolle.App.main(App.java:10) ~[main/:na]Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for schema public Position: 19 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291) ~[postgresql-42.3.7.jar:42.3.7] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286) ~[postgresql-42.3.7.jar:42.3.7] at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na] at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na] at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.6.11.Final.jar:5.6.11.Final] ... 34 common frames omittedHibernate:
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
1-C 질문
안녕하세요 선생님주차 시간의 범위가 1~100인데배열의 크기를 104로 잡는 이유가 궁금합니다.강의 잘 듣고 있습니다.감사합니다.
-
미해결데이터 분석 SQL Fundamentals
having절에서 alias 사용은 안되는건가요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.Group By 실습 -01 강의 ,1분 20초select deptno, max(sal) as maxsal , min(sal) as minsal, round(avg(sal),2) as avgsal from hr.emp egroup by e.deptno having round(avg(sal), 2) >=2000;avgsal >= 2000 을 사용하려했는데, 안되더군요. 원래 having절에서는 안되나요?
-
해결됨[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
갑자기 실행이 안됩니다..
error: node_modules\react-native-reanimated\src\reanimated2\index.ts: Cannot find module 'babel-plugin-module-resolver'Require stack:- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\@babel\core\lib\config\files\plugins.js- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\@babel\core\lib\config\files\index.js- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\@babel\core\lib\index.js- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\metro-transform-worker\src\index.js- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\metro\src\DeltaBundler\Worker.flow.js- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\metro\src\DeltaBundler\Worker.js- C:\Users\gimse\Documents\dogfoot\dogfeet\front\node_modules\jest-worker\build\workers\processChild.jsMake sure that all the Babel plugins and presets you are using are defined as dependencies or devDependencies in your package.jsonfile. It's possible that the missing plugin is loaded by a presetyou are using that forgot to add the plugin to its dependencies: youcan workaround this problem by explicitly adding the missing packageto your top-level package.json.
-
미해결
Affenhuahua Socialization: Helping Your Dog Make Friends
Do you have an Affenhuahua? These small dogs are a mix of Affenpinscher and Chihuahua. They are full of energy and love to play. But to be their best, they need to meet new people and other dogs. This is called socialization, and it helps them become friendly and well-behaved.Socializing your Affenhuahua is very important. It helps them feel happy and relaxed in different places and with different people. This article will guide you on how to help your Affenhuahua make friends and enjoy life to the fullest.The Importance of Socialization for AffenhuahuasSocialization is crucial for Affenhuahuas because it helps them feel comfortable in various situations. This process starts when they are puppies and continues as they grow. By meeting new people, playing with other dog breeds, and exploring different places, your Affenhuahua learns to be confident and less anxious.Without proper socialization, Affenhuahuas can become fearful or aggressive. This can lead to problems like excessive barking, biting, or hiding. Early and consistent socialization teaches them how to behave appropriately and enjoy the company of others, making them more pleasant companions.Socialization is especially important for Affenhuahuas that serve as emotional support animals (ESAs). These dogs need to be well-behaved and calm in various settings to provide comfort and support to their owners effectively. An ESA letter, which certifies your dog as an emotional support animal, often requires that the animal is well-behaved and can handle different social situations. By ensuring your Affenhuahua is well-socialized, you help them fulfill their role as a supportive ESA, enhancing their ability to assist you and improving their quality of life.The Affenhuahua TemperamentAffenhuahuas is a mix between Affenpinschers and Chihuahuas, inheriting traits from both breeds. They are known for their lively and playful nature, but they can also be a bit stubborn and independent. These small dogs are often very affectionate with their families but can be wary of strangers.Understanding their temperament helps in planning socialization activities. Knowing that they can be cautious with new people and dogs, you can introduce them gradually to new experiences. This approach helps build their confidence and ensures they have positive interactions.The Benefits of Socializing Your AffenhuahuaSocializing your Affenhuahua is crucial for their overall well-being and development. It helps them become well-rounded dogs who are comfortable and confident in various situations. Here are some key benefits of socializing your Affenhuahua:Reduces Fear and Anxiety: Exposure to different people, places, and sounds helps them adapt and feel secure. This reduces the chances of developing phobias or anxiety-related behaviors.Prevents Behavioral Problems: Dogs that are not socialized may become aggressive or overly timid. By meeting other dogs and people, your Affenhuahua learns appropriate behavior, reducing issues like excessive barking or biting.Enhances Physical Health: Playdates and walks with other dogs encourage exercise, which is vital for maintaining a healthy weight and cardiovascular health. Regular physical activity also helps prevent obesity-related problems.Improves Mental Stimulation: New experiences challenge your dog’s brain, keeping them mentally sharp. This can prevent boredom, which often leads to destructive behaviors like chewing or digging.Increases Adaptability: Whether it's moving to a new home or meeting new pets, a well-socialized Affenhuahua can adjust more easily. This adaptability makes them more resilient and less stressed by changes in their environment.Promotes Good Manners: Through positive interactions, your Affenhuahua learns good manners, like greeting people politely and playing gently with other dogs. This makes them more pleasant to be around and welcomed in various settings.Some Resources for Dogs InformationRealESALetter.com: This website provides information on emotional support animals (ESAs) and how to get your dog certified as an ESA. It's a valuable resource for understanding the benefits and requirements of having an ESA, and it offers guidance on housing and travel regulations for pets.AKC.org: The American Kennel Club (AKC) is a well-known and trusted source for information about dog breeds, training, and health. AKC.org offers detailed articles, expert advice, and resources for dog owners. It's an excellent place to learn about breed-specific traits, training tips, and general dog care.Dogtime.com: Dogtime.com provides comprehensive information on various dog breeds, training advice, and health tips. It features articles on dog behavior, grooming, and nutrition. This site is great for both new and experienced dog owners looking for practical advice and interesting articles about dogs.To Sum it Up, Socializing your Affenhuahua is essential for their happiness and well-being. By understanding their temperament and gradually introducing them to new experiences, you help them become well-adjusted and friendly companions. Utilizing resources from reputable websites can provide you with the knowledge and support you need to ensure your dog thrives in social situations. With patience and consistent effort, your Affenhuahua will enjoy making friends and exploring the world around them.Helpful ResourcesEmotional Support Animals in the Workplace: What You Should KnowHow to Obtain an ESA Letter: A Step-by-Step GuideUnderstanding Dog Behavior: What Your Dog is Trying to Tell YouHow to Choose the Right Dog Breed for Your Lifestyle
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
카이제곱 독립성(동질성 검정) 코드에서요~
처음에 노션 이론 부분에서 stats.chi2_contingency(table, 이 담에 correction=True) 로 되어있었는데 코랩 실습에서 "correction=True"를 안 쓰셔서요. 안 써도 되는 건가요???
-
해결됨Next + React Query로 SNS 서비스 만들기
react-query onMutate vs onSuccess / mutate vs mutateasync 가장 적절한 쓰임이 궁금합니다.
안녕하세요. 첫번째 질문은 onMutate vs onSuccess 인데 사실 낙관적 업데이트를 해주냐 안해주냐에 따라서 기호에 따라 다른 경우는 알겠습니다. 제가 궁금한거는 onSuccess invalidatequeries를 무지성으로 사용해도 query-key외 따로 전달 되는 params값이 중요하진 않은 것 같아서 쉽게 적용 했었던 기억이 있는 것 같습니다/ 예를 들면 onSuccess를 해주는 mutation에 invalidatequeries로 invalidatequeries(['key', {...}])를 굳이 안하고 invalidatequeries(['key']) 요거만 해줘도 새로 캐싱된 API를 새로 조회 하는 것 같더라구요. 근데 onMutate를 쓰려는 경우에 getQueryData에 query-key 정보와 그에 매칭하는 파라메터를 정확하게 넘겨주지 않으면 undefined 같은데 애초 설계 할때 getQueryData뒤에 보내는 파라메터를 잘 가져 올 수 있게 해야 할지 혹시 다른 방법이 있는지 궁금합니다. query에서 find해서 찾기는 보장이 안되는 것 같구요? 이건 사용자가 셀렉트 박스로 막 선택해서 조회 다시 이전것 조회 요런식으로 하다보니 마지막으로 선택된 파람 정보가 명확하진 않더라구요. 현재는 혹시 모르니 전부 searchParams로 개편은했지만.... 실제 프로젝트에서는 어드민성(?) 서비스를 제공 해서 ux는 딱히...?????? 엄청 중요한 않기도 했고 지식도 부족해서 onMutate 대신에 onSuccess를 썼지만 보통은 좀 어떻게 잘 써야하는지 궁금합니다. 2번째 질문은 이건 진짜 뭘 더 써야하는지 모르겠습니다.쓰임에 따라 다르게 써야한다면 어떤 경우인지 취향에 차이라면 취향것 쓰면 되는건지 궁금합니다
-
미해결[코드팩토리] [입문] 9시간만에 끝내는 코드팩토리의 Javascript 무료 풀코스
혹시 공부한 내용을 개인 블로그(티스토리 등)에 요약해서 올려도 될까요 ?
제목 그대로입니다. 출처 명시하여 요약된 내용을 정리해서 올려도 될까요 ?
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
bits/stdc++.h 파일을 추가하고 실행을 하려고 하는데 cin, cout 등 기본 함수에 에러가 발생합니다,
stdc++.h를 추가하기 위해서 gcc --version를 통해 경로를 확인하고 해당 경로로 가서 include폴더 안에 bits폴더를 생성해서 stdc++.h파일을 추가하고a.cpp파일을 만들어서 실행을 했는데 가장 기본 함수인 cin, cout그리고 string자체가 에러가 납니다,,,환경은 맥 m2 프로이고 vscode로 실행했습니다추가) #include <iostream>으로 변경했더니 됩니다ㅠㅠ 뭐가 문제일까요?추가22) 해결했습니다!! iostream은 되길래 iostream파일 경로로 가서 확인했더니 /Applications/Xcode.app/contents/Developer/~이 경로가 아니고 다른 경로였고 해당 경로에 있던 bits폴더의 stdc++.h에 넣어놨던 내용들이 다 초기화되서 아무것도 없더라구요,,, 그래서 다시 넣어줬더니 잘 실행이됩니다!!찾아보니까 xcode를 업데이트 하면서 내용들이 날아간것 같더라구욥! 혹시 다른 분들께 도움이 될 수도 있어 해결방법까지 남겨놓겠습니다!
-
해결됨[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
yarn add express 를 해도 Cannot find module 이슈
yarn add express 을 여러번 하고,구글링을 통해 현재는 node_modules 가 생성되지 않는 것까지 파악했습니다.{ "name": "NestJS", "packageManager": "yarn@4.2.2", "dependencies": { "express": "^4.19.2" } } 현재 의존성이 다음과 같이 세팅되어 있는데 맨 위 사진처럼 cannot find modules 가 나오는데, 방법이 있을까요? - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.코드팩토리 통합 링크https://links.codefactory.aiFlutter 강의를 구매하시면 코드팩토리 디스코드 서버 플러터 프리미엄 채널에 들어오실 수 있습니다! 디스코드 서버에 들어오시고 저에게 메세지로 강의를 구매하신 이메일을 보내주시면 프리미엄 채널에 등록해드려요! 프리미엄 채널에 들어오시면 모든 질의응답 최우선으로 답변해드립니다!
-
미해결실리콘밸리 엔지니어와 함께하는 샐러리(Celery)
셀러리 사용에 문의드립니다.
현재상황은 다음과 같습니다. 윈도우 gui 오토메이션을 해야하는 task 가 있습니다.큐(sqs)는 우선큐 일반큐 두개를 스위칭 해야하는 상황입니다.우선큐에 메세지가 없을경우만 일반큐를 컨슘해야합니다.메세지를 처리하는 인스턴스는 윈도우 gui 를 사용하기 때문에 한대의 장비에서 동시에 하나의 task 만 실행될 수 있습니다. 위의 제약조건들로 인하여 gui 기반의 셀레니움 자동화 스크립트를 구성하고 우선큐와 일반큐를 스위칭하면서 10개 이상의 윈도우 장비가 큐를 폴링하고 있습니다. 이를 윈도우 장비 하나에 하나의 스탠드얼론 워커를 띄우는 형태로 구성하고. 예를 들어 열개의 인스턴스에 각각하나씩 열개의 스탠드얼론 셀러리 워커를 띄우려고 합니다. 하나의 스탠드 얼론 워커가 두개의 큐를 priority 따라서 폴링하는게 가능할까요? 스펙상에서는 되는거 같긴한데 문서를 봐도 잘 모르겠어서 혹시나 문의드립니다. 안된다면 각각의 큐를 폴링하는 스탠드 얼론 워커를 인스턴스에 브로커의 개수만큼 띄우고 (하나의 인스턴스 두개의 스탠드얼론워커) 뒤에 별도의 자동화 로직을 구성하고 큐의 우선순윈는 서비스로직으로 풀어야 하나 고민중입니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
6회 기출 유형(작업형1) 문제 질문
좋은 강의 감사드립니다. 기출 문제를 풀던 중 의문사항이 몇 가지 생겨 질문드립니다.<첫 번째 질문>2번 문제의 '전체 교사 수'를 구하라고 되어있는데, 선생님의 풀이를 보면 교사1인당 수가 출력되어 있습니다. 전체 교사 수를 출력해야하니 교사수 열의 값이 답으로 도출되어야 하지 않습니까? 문제의 오타인지, 제가 오해하고 있는 것인지 알려주시면 감사하겠습니다. <두 번째 질문> 총 범죄 건수의 월평균 값을 출력하라고 되어 있는데, 선생님의 풀이를 보면 월합계가 출력되어 있습니다. 해당 연도의 총 범죄 건수의 월평균 값을 구하려면 월합계 / 6이 되어야 하는 것이 아닌가 싶어 질문드립니다. 감사합니다.