묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결스프링 핵심 원리 - 기본편
강의자료 질문입니다
PPT슬라이드 제목: 스프링과 객체지향 "제어의 역전(IoC), 의존관계 주입(DI)은 다형성을 활용해서 역할과 구현을 편리하게 다룰 수 있도록 지원한다." 위와같은 문장이 있는데, IoC와 DI가 어떻게 다형성을 활용하는지 이해가 가질 않아 질문을 하게 되었습니다.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
lambda 함수를 제외하고 get_category 함수를 적용하는 방법에 대해 알고싶습니다.
강의 코드에 나와있는 titanic_df['Age_cat'] = titanic_df['Age'].apply(lambda x : get_category(x)) 람다함수를 이용해 get_category 함수를 적용하는 방법 외에 다른 방법이 없을까 생각하여 get_category에 곧바로 titanic_df['Age']로 인자를 넣었더니 The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). 라는 에러가 뜹니다. 해당 에러가 어떠한 것이 잘못되어 나타나는 것인지, 람다함수를 사용않고 다른 방법으로 titanic_df["Age_cat] 칼럼을 만들려면 코드를 어떻게 짜야할지 알고싶습니다.
-
미해결자바스크립트 알고리즘 문제풀이 입문(코딩테스트 대비)
unshift를 사용해서 풀어봤습니다
강사님, 안녕하세요? 강의 재미있게 잘 듣고 있습니다. 저는 이번 문제를 unshift를 사용해서 풀어봤는데 이렇게 푸는 것도 문제가 없을까요?
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
자바스크립트 관련 질문입니다.
엑셀에 vlookup, hlookup,lookup같은 기능을 자바스크립트 에서도 사용해 보고 싶은데 사용할수 있는 기능이 있나요? 있다면 어떤 검색을 통해 자료를 찾아보고 공부할수 있는지 궁금합니다.
-
미해결쉽게 시작하는 쿠버네티스(v1.35)
포트번호 관련 질문드립니다.
kubectl get service 명령어에서 PORT(S)가 80:3xxxx/TCP와 같이 출력되고 있습니다. 실습에서 NodePort에서는 3xxxx포트로 접속했고 LoadBalancer에서는 80포트로 접속하였습니다. 타입에 따라 다른 포트를 사용하는 이유가 궁금합니다.
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
pred 의 음주예측값에 대한 rmsle
1. pred 값을 살펴보면 음수인 값이 다수 있는 것으로 확인이 되는데, 이 값을 그대로 rmsle 함수에 넣으면 nan 이 나와야 정상아닌가요?? 음수가 포함된 array 를 넣으면 nan이 나오는데, bike_sharing 실습시에는 정상적으로 산출이 되네요 2. def rmsle(test, pred): log_test = np.log1p(test) log_pred = np.log1p(pred) rmsle = np.sqrt(mean_squared_error(log_test, log_pred)) return rmsle 이런 식으로 rmsle 를 정의하면 안되나요? nan 이슈로 에러가 뜹니다만.... 이유를 잘 모르겠네요 ㅜ 음수를 다루는 방식의 차이인 것 같은데 설명부탁드립니다!!
-
미해결윤재성의 만들면서 배우는 Spring MVC 5
xml과 java 세팅 차이가 뭔가요
어느게 더 효과적이고 현업에서 많이 쓰나요?
-
해결됨홍정모의 따라하며 배우는 C++
delete 질문입니다
#include <iostream> using namespace std; class Base { public: virtual ~Base() { cout << "~Base()" << endl; } }; class Derived : public Base { private: int *m_array; public: Derived(int length) { m_array = new int[length]; } ~Derived() { cout << "~Derived" << endl; delete[] m_array; } }; int main() { //Derived derived(5); Derived *derived = new Derived(5); Base *base = derived; delete[] base; return 0; } 마지막에 delete base; 에서 delete[] base; 로 해도 되는데 똑같이 작동하는건가요?
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
깃헙권한요청
인프런 아이디 : @hyosang yoon 인프런 이메일 : hyosang.yoon2@gmail.com 깃헙 아이디: hyosang.yoon2@gmail.com 깃헙Username : hyosang-yoon
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
p6spy 성능 질문 드립니다.
안녕하세요. 강의를 듣고 사이드 프로젝트를 하면서 `p6spy` 를 잘 활용하고 있는데요. 강의 내용 중에 prod 에서는 성능 관련을 확인 후 사용해야 된다는 내용을 보고 궁금해졌습니다. 처음에는 그냥 `build.gradle` 에서 prod 설정에만 안뜨게 하면 되겠지 (dev, test 에서는 되는 것을 의도) 라고 생각했는데, profile 에 따라 `build.gradle` 이 동적으로 움직이는 건 application.xml 이랑은 다르게 좀 어렵더라구요; 그래서 질문은 2개 입니다. 1. profile 에 따라 `build.gradle` 의 설정 (특히 dependency) 이 동적으로 움직이게 하는 것을 어떻게 하면 좋을까요? 2. `p6spy` 와 같은 외부 라이브러리의 성능 검증은 어떻게 하는 것이 좋을까요?
-
미해결윤재성의 만들면서 배우는 Spring MVC 5
servlet-context.xml 질문입니다.
안에 beans 설정을 하시는데 어떻게 해야되는건가요?만약 개인 프로젝트를 만든다고 하면 이런 환경 설정은 어떻게 해야되는지 궁금합니다.
-
미해결PHP 7+ 프로그래밍
문의드립니다.
안녕하세요. 강의 잘 듣고 있습니다. 게시판만들기 파트에서 2.부트스트랩 강의 중간에 'show databases';를 하시고 데이터베이스 목록이 보여지고 'use phpblog '; 하셨는데 언제 phpblog를 만드셨나요..? 아님 제가 못 본건가요? 저는 show databases;를 하면 phpblog 목록이 없다고 나오는데 어떻게 만드는건가요? 초보적인 질문이지만ㅠ 문의드립니다. 저는 데이터베이스 조회하면 myapp_test랑 phpblog 목록이 없어서 6개만 조회됩니다. 강사님과 똑같이 phpblog 만드는 방법을 자세히 알려주셨으면 합니다.
-
미해결타입스크립트 시작하기
function add
console.log(add(1,'2')); 부분에서 에러가 발생하는데 , 발생하는 이유가 위의 타입 정의된 부분이 number , number string , string 이라서 그런걸까요 ?
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
jsp 질문입니다
7:33초 전송을 누르면 이런 창이 뜨는데 왜 그런건가요? ㅜㅜ Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Thu Jun 10 19:01:17 KST 2021 There was an unexpected error (type=Not Found, status=404).
-
미해결실전! 스프링 데이터 JPA
Thread 처리 관련 질문이 있습니다
@Entity@Getterpublic class Member { @Id @GeneratedValue private Long id;} @SpringBootTest@Rollback(value = false)class MemberRepositoryTest { @Autowired MemberRepository memberRepository; @BeforeEach void prepareData() { memberRepository.save(new Member()); } @Test @Transactional void findMember() throws InterruptedException { Member findMember = memberRepository.findAll().get(0);// Optional<Member> newFindMember = memberRepository.findById(findMember.getId());// System.out.println("newFindMember.isEmpty() = " + newFindMember.isEmpty()); int threadCount = 1; int latchCount = 1; ExecutorService service = Executors.newFixedThreadPool(threadCount); CountDownLatch countDownLatch = new CountDownLatch(latchCount); for(int i = 0; i < latchCount; i++) { service.execute(() -> { Optional<Member> newFindMember = memberRepository.findById(findMember.getId()); System.out.println("newFindMember.isEmpty() = " + newFindMember.isEmpty()); countDownLatch.countDown(); }); } countDownLatch.await(); }} 위에 처럼 테스트 전에 BeforEach 에서 Member 1건을 생성하고 Thread 환경이라는 전제 하에서 가져오는 부분을 샘플로 짰는데요, 위 코드를 실행하면 궁금한 부분이 2가지 있습니다. 1. findById 를 할 경우 select 쿼리가 실행됩니다. @Transactional 로 선언되어 최초 findAll 에서 가져온 객체들이 영속성 컨텍스트에 남아있을테니 findById 시점에는 영속성컨텍스트의 대상을 가져올 것 같은데 왜 select 쿼리가 실행되는 건가요? 2. findById 를 통해 가져온 대상이 빈객체 입니다. isEmpty 가 true 로 나오는데요, 어찌됐건 DB에서 조회를 해왔을테니 대상을 정상적으로 가져와야 할 것 같은데, 왜 아무것도 가져오지 못하는 건가요? @Transactional 어노테이션을 제거하면 정상적으로 가져 옵니다. Thread 환경이 아닌 일반적인 코드에서는 예상대로 잘 실행이 되는데 Thread 환경에서는 왜 그런지 모르겠네요ㅠ
-
미해결작정하고 장고! Django로 Pinterest 따라만들기 : 바닥부터 배포까지
502 bad gateway가 뜹니다
https://github.com/hwd3004/clone_pinterest 오라클 클라우드로 하고 있고 포트 개방은 80, 443, 8080, 8000, 9000, 3306 해주었습니다. 도커 포테이너 - 서비스에서 django_container_gunicorn이 이상한거 같습니다. 이건 django_container_gunicorn 로그입니다. , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:42:42 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:42:42 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:43 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:44 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:45 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:46 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:47 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:42:58 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:42:58 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:59 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:00 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:01 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:02 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:03 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:43:29 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:43:29 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:30 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:31 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:32 +0000] [1] [ERROR] Retrying in 1 second., , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:43:13 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:43:13 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:14 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:15 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:16 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:17 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:18 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:42:27 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:42:27 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:28 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:29 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:30 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:31 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:32 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), 이건 서비스 탭에 있는 nginx 로그입니다. /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration, /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/, /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf, 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf, /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh, /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh, /docker-entrypoint.sh: Configuration complete; ready for start up, 2021/06/10 09:30:42 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 10.0.0.2 - - [10/Jun/2021:09:30:42 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 2021/06/10 09:30:55 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 10.0.0.2 - - [10/Jun/2021:09:30:55 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 10.0.0.2 - - [10/Jun/2021:09:31:09 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 2021/06/10 09:31:09 [error] 34#34: *1 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 2021/06/10 09:32:03 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 10.0.0.2 - - [10/Jun/2021:09:32:03 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 10.0.0.2 - - [10/Jun/2021:09:34:03 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 2021/06/10 09:34:03 [error] 34#34: *7 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration, /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/, /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf, 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf, /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh, /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh, /docker-entrypoint.sh: Configuration complete; ready for start up, 2021/06/10 09:30:05 [emerg] 1#1: host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, nginx: [emerg] host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration, /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/, /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf, 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf, /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh, /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh, /docker-entrypoint.sh: Configuration complete; ready for start up, 2021/06/10 09:30:21 [emerg] 1#1: host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, nginx: [emerg] host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, 질문이 너무 이상해서 죄송합니다.
-
미해결
atom\styles.less Line number: 39 에러
아톰 설정 중 이와 관련한 에러에 대한 설명은 웹에서도 제대로 찾지 못해 질문 남깁니다.\ 기존에 뜨던 에러에 대해선 기존 질답을 보고 해결했는데 그 문제를 해결하자 새로 이런 문제가 생겼는데요ㅠㅠ vs code로 강의를 들을 때에도 지장이 없겠죠? 일단 아톰 에러가 난 라인은 아래와 같습니다... Line number: 39
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
JWT 다중 로그인 처리 질문
user-service에서 AuthenticationFilter를 거치기전 기존에 메모리나, DB에 해당 ID에대한 JWT토큰값이 존재할 경우 기존 토큰은 폐기하고 새로운 토큰값을 발급시켜 새로 로그인한 유저에게 할당해주는 방법으로 하면 괜찮을까요 ??
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
콘솔 검색 단축키 궁금합니다.ㅎㅎ
영상 7분 51초 콘솔 로그에서 검색 단축키가 혹시 뭔지 알려주실수 있나요???ㅎㅎ 항상 강의 잘 보고 있습니다.
-
미해결홍정모의 따라하며 배우는 C++
std::cin.clear() 의 기능에 대한 질문입니다.
안녕하세요. 좋은 강의와 매번 친절한 답변 덕분에 좋은 환경속에서 공부하고 있습니다. 감사합니다. 질문이 있어서 글을 남깁니다. std::cin.clear(); 의 기능에 대한 질문입니다. 해당 기능은 'cin으로 받은 것 중 버퍼에 쌓인 것을 지워준다.' 로 알고 있습니다. 그런데 아래와 같이 코드를 돌렸을 때 std::cin.clear();를 했음에도 불구하고 버퍼에 아직 쌓여있는것 같아서 이렇게 질문을 남깁니다. ---코드 --- #include <iostream> int main() { using namespace std; int x; int y; int z; // 예시로 123 456 789 를 입력함 cin >> x; std::cin.clear(); //퍼버에 쌓인것을 다 지워준다. // 버퍼에 있는 것을 모두 지웠으니 입력되지 않을 것으로 기대함 cin >> y; cin >> z; cout << x <<" " << y << " " << z <<endl; return 0; } 제가 혹시 잘 못 코딩한거라던지 cin.clear() 의 기능에 대해 잘 못 알고 있는게 있을까요?