묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨스프링 핵심 원리 - 기본편
Test작성 시 미리 선언
안녕하세요 강사님, 강의 재밌게 잘 듣고 있습니다. MemberServiceTest.java 작성시 두가지 궁금한 점이 생겼습니다. MemberService memberService; @BeforeEach public void beforeEach(){ AppConfig appconfig = new AppConfig(); memberService = appConfig.memberService(); } 와 같이 작성해주셨는데 1. memberService를 사용전에 미리 명시하신 이유가 있을까요? 2. 만약 여러개의 테스트를 진행할때 매번 new AppConfig 객체를 생성해서 진행하면 비효율적이지 않나요? beforeEach가 아니라, MemberService memberService; 와 같이 각각의 테스트 함수 밖에 공통 정의해서 사용하면 문제가 있나요? 감사합니다.
-
미해결파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
이렇게 풀면 어디가 잘못된건지 잘모르겠습니다...
n = 100 m = 100 s = '3 3 1 4 5 2 2 5 2 1 2 2 1 1 4 1 4 3 3 5 1 5 1 3 4 5 4 5 2 4 2 1 1 4 2 1 5 3 1 3 1 1 1 2 4 4 5 5 5 5 3 2 5 5 3 2 3 4 1 3 3 4 5 1 3 1 3 2 3 1 2 3 2 5 5 4 2 3 1 2 3 2 4 5 2 4 4 4 4 3 1 5 2 2 1 3 2 5 4 1' a = list(map(int, s.split())) lt = 0 rt = 1 cnt = 0 while(True): temp = sum(a[lt:rt]) if lt >= n: break elif rt >= n: lt += 1 rt = lt + 1 elif temp < m: rt += 1 elif temp >= m: if temp == m: cnt += 1 lt += 1 rt = lt + 1 print(cnt) 혹시 이런방식으로 구현을 하면 어느부분에서 틀린걸까요ㅠㅠ 몇가지 케이스에선 정답이 나오는데 위의 케이스에선 오류가납니다
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
질문있습니다
LoginFom.js에서는 input의 id와 password는 useState를 사용하지 않고 useInput을 사용했는데 const [id, onChangeId] = useInput(''); const [password, onChangePassword] = useInput(''); <div> <label htmlFor="user-id">아이디</label> <br /> <Input name="user-id" value={id} onChange={onChangeId} required /> </div> <div> <label htmlFor="user-password">비밀번호</label> <br /> <Input name="user-password" value={password} onChange={onChangePassword} type="password" required /> </div> PostForm.js 의 const [text, setText] = useState(''); <Input.TextArea value={text} onChange={onChangeText} maxLength={140} placeholder="어떤 신기한 일이 있었나요?" /> 이부분과 CommentForm.js의 const [commentText, setCommentText] = useState(''); <Input.TextArea rows={4} value={commentText} onChange={onChangeCommentText} /> input에는 왜 useInput에서 불러오지 않는고 useState를 사용하는지 궁금합니다. 또한 어떨때 쓰임새가 다르게 쓰이는지도 궁금합니다!
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
시작 실행부터 막혀서 질문드립니다 ㅠㅠ;
프로젝트환경설정 - 프로젝트생성이라는 강의에서 메인메소드를 실행하고 localhost:8080에서 에러페이지를 확인하는 부분에서 막힙니다. 처음에는 제가 오라클db를 사용중이라 포트번호가 겹치는거인줄알고 구글검색해서 application.properties에 server.port = 포트번호 로 수정해봣는데 안되더라구요 다른문제인거 같은데 제가 해결하지를 못해서 질문남깁니다. 메인메소드 실행 콘솔창 첨부합니다. /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.3.7.RELEASE) 2020-12-19 20:40:17.477 INFO 20140 --- [ main] h.hellospring.HelloSpringApplication : Starting HelloSpringApplication on DESKTOP-3I38L64 with PID 20140 (F:\springInflearn\hello-spring\out\production\classes started by oaoa in F:\springInflearn\hello-spring) 2020-12-19 20:40:17.481 INFO 20140 --- [ main] h.hellospring.HelloSpringApplication : No active profile set, falling back to default profiles: default 2020-12-19 20:40:18.837 WARN 20140 --- [ main] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration) 2020-12-19 20:40:18.870 INFO 20140 --- [ main] h.hellospring.HelloSpringApplication : Started HelloSpringApplication in 2.121 seconds (JVM running for 3.071) Process finished with exit code 0
-
미해결스프링 시큐리티
질문 있습니다!
antMatcher("/admin/**") .authorizeRequests() .anyRequest().authenticated() .and() .httpBasic(); 이라는 구문이 /admin 으로 들어온 모든 요청에 대해 인증된 사용자만 접근을 허용하고, 인증은 httpBasic() 방식 (request에 id, password를 받아 사용자 인증 처리)으로 수행한다 라고 해석해도 되나요?? 그리고 최초 admin 접근 시에는 id, password 입력 요청창이 뜨는데, 인증 성공 이후 서버를 재시작하거나, 서버에게 발급받은 Jsession Id를 쿠키에서 지워보아도 별다른 인증 처리 없이 admin 화면으로 이동합니다.. 제 생각대로라면 재시작된 서버의 시큐리티 컨텍스트에는 인증 정보가 없을 뿐더러, 클라이언트에서 온 JsessionID 또한 Null이니 당연히 재 인증을 받아야 한다고 생각해는데요.. 왜 인증 절차 없이 넘어가는 건지 궁금합니다.
-
미해결실전 자바스크립트
마지막 예제 질문드립니다.
일반적으로 this는 함수 호출을 할 때, 일종의 규칙들을 따라 this 바인딩이 일어나잖아요. arrow function에서의 this는 함수 호출시, 호출부가 아니라, 호출시에 lexical scope에 따라 this가 바인딩 된다고 알고 있습니다. 마지막예제는 객체내부의 메서드를 호출할때, this는 전역을 가리키기 때문에 그렇겠죠. 하지만 리액트에서 아래와 같이 this 바인딩을 하기도 하잖아요? class Foo { bar = () =>{ } } 이 경우는 그냥 일반적인 생성자 함수(객체 생성) 규칙에 의해서 생성된 객체를 this로 가리키기 때문에 바인딩이 되는것인가요? 헷갈리네요 갑자기..
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
함수설명창 표시
강의 영상에서 보면 print라고 치면 하단에 함수에 대한 설명이 뜨는데 제 컴퓨터에서는 이런 창이 표시되지 않습니다. 혹시 별도 옵션 설정을 해야하나요?
-
미해결스프링 프레임워크 핵심 기술
greeting 한글 영어 다 만들어 줬는데.. 한글만 나옵니다.
번들로 인식 됐고 AppRunner에서 System.out.println(messageSource.getMessage("greeting", new String[]{"keesun"}, Locale.KOREA)); System.out.println(messageSource.getMessage("greeting", new String[]{"keesun"}, Locale.getDefault())); 두개 실행 시켜줬을 때 한글로 2가지 나옵니다. 의심해볼 부분이 있을까요? 코드내에서?
-
미해결실전 리액트 프로그래밍
makeFetchSaga 문의드립니다.
강사님 안녕하세요.제가 강사님 강의를 동료들에게 추천해서 현재 3명이 이 강의를 더 듣고 있답니다.그런데 저 혼자 열심히 듣고 있는 거 같아서 협업이 잘 안되고 있네요 ㅠ 오늘은 강의해서 설명해 주신 makeFetchSaga 를 보면서 응용을 해보고 있습니다.makeFetchSaga 에서는 하나의 Action 에 하나의 callApi 만 포함되어 있다고 가정하고 작성된 관리법 같습니다. 즉, Action 기준으로 API 상태관리가 이뤄지고 있는 듯 한데요.그런데 하나의 Action 을 통해 동시에 2-3건의 callApi 를 호출해야 하는 경우도 있을테고 (all 안에 2건의 call 을 넣어서...)아니면 callApi 를 순서대로 2-3번 호출해야 하는 경우도 있을 거 같아요..이럴 경우에는 Action 단위로 상태관리가 어려워질 것 같은데 현업에서는 어떻게 활용하고 계신지요?
-
미해결따라하며 배우는 TDD 개발 [2023.11 업데이트]
Model Class, Model Instance
테스팅 수업인데 다른질문을 남기게 되었습니다..ㅎㅎ Model class = mongoose.model() Model instance = new mongoose.Schema() 를 의미하는 것인가요 ? 잘 이해가 가지 않습니다 ㅠ
-
해결됨테스트주도개발(TDD)로 만드는 NodeJS API 서버
데이터베이스연동문제
안녕하세요 질문드립니다. 아마 구문오류인것 같은데 계속 오류가 나서 질문드립니다. 아래와 같습니다. 답변주시면 감사하겠습니다.
-
미해결코어 자바스크립트
안녕하세요
좋은 강의 유익하게 잘 듣고 있습니다. 프론트앤드를 지망하며 자바스크립트에 대한 코어부터 확실히 잡기 위해 수강하게 되었는데 정말 잘 듣고 있습니다. 공부 내용을 개인 블로그에 기록하며 복습을 하려 하는데 출처를 밝히고 작성해도 괜찮을지 여쭙고 싶습니다
-
미해결[리뉴얼] 처음하는 MongoDB(몽고DB) 와 NoSQL(빅데이터) 데이터베이스 부트캠프 [입문부터 활용까지] (업데이트)
AND 조건이 적용되지 않아요~
강사님 질문이 있습니다. 다음 쿼리에서 AND 조건이 적용되지 않아요. db_actor.find({'흥행지수': {'$nin': [9625, 8850]}, '흥행지수': {'$lt': 10000}}) 를 실행하면 흥행지수가 9625, 8850 인 배우가 포함됩니다. 10000 이하인 것들이 그냥 $nin 조건 무시하고 다 나옵니다. 그래서 $and 를 직접 넣어서 돌려봤더니 9625, 8850 이 빠진 데이터가 제대로 나오더라고요. ㅜㅜ db_actor.find({ '$and': [{'흥행지수': {'$nin': [9625, 8850]}}, {'흥행지수': {'$lt': 10000}}]}) 어디 물어볼데도 없고 답답해서 여기에 질문 올립니다. ㅜㅜ 답변 좀 부탁드려요~ ^0^
-
미해결홍정모의 따라하며 배우는 C++
마지막 friend member 함수에 대해 질문합니다.
마지막 friend에 대한 질문입니다. class B 안에 void doSomething(A &a)가 있고 그 다음 class A 에 friend void B::doSomething(A &a)가 있어서 이것을 따로 떼어낸 void B::doSomething(A &a)가 작동되는 것은 이해 하였습니다. 그래서 응용해 보았는데요. 위에 있던 class B와 아래에 있던 class A의 순서를 위의 class A, 아래의 class B로 바꾸고, 전방선언 되어있던 class A를 class B로 바꾸었는데도 잘 안됩니다. class A와 class B의 순서를 바꾸었을 때는 어떻게 하면 그 전과 같이 결과를 낼 수 있을까요?
-
해결됨쉽고 빠르게 익히는 Excel 파워 쿼리
예제파일 출처 문의
안녕하세요. 강의에서 사용하는 엑셀파일은 어디서 다운받을 수 있을까요?
-
미해결초보자도 만들 수 있는 스크롤 인터렉션. 1편 자바스크립트
톱니바퀴 배경화면을 다른 페이지에서도 사용
톱니바퀴 배경 애니메이션 효과를 다른 html 페이지에서도 적용시키고 싶은데 불러와지지 않습니다. 어떻게 하면 될까요?
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
안녕하세요. App.vue shadow
안녕하세요! 각 인스턴스마다 scope를 줘서 각 인스턴스끼리 영향을 주지않게 했는데요. - 제가 이해한 흐름입니다. 맞는 흐름일까요? App.vue같은 경우 모든 인스턴스를 갖고와서 이제 조합하는 단계입니다. 그 App.vue에서 shadow를 갖는 모든 인스턴스에 적용하기위해 App.vue style에 shadow를 설정했다. 즉, a,b,c 라는 인스턴스에 루트 노드에 shadow를 갖는 모든 인스턴스는 app.vue의 shadow에 영향을 받는다. 맞나요? 항상감사합니다.
-
미해결실전! 웹사이트제작! Step by Step! (와이스튜디오_반응형웹)
reset txt
reset에 관한 txt가 없어서 붙여넣을수가 없네용
-
해결됨[리뉴얼] React로 NodeBird SNS 만들기
https 발급 시 snap과 nginx를 통해서 letsencrypt를 설치하기 질문입니다
제로초님 블로그에서 snap과 nginx를 통해서 letsencrypt를 설치하기를 따라하던 중 백서버에서 먼저 도메인주소를 api.ymillonga.xyz 로 https를 발급받았습니다. 그리고 프론트서버에서도 ymillonga.xyz라는 도메인주소로 발급받으려 했더니 api.ymillonga.xyz가 이미 발급된 상태이더군요.. 처음부터 와일드카드로 발급받아야했던 것 같은데 혹시 이런 경우 다시 초기화할 수 있는 방법이 있나요? 아니면 nginx의 /etc/nginx/nginx.conf 설정파일에서 server_name을 블로그와 같이 ymillonga.xyz, api.ymillonga.xyz수정하면 자동으로 해결되는 문제인가요? 1. letsencrypt설치 후 직접 수정한 /etc/nginx/nginx.conf 설정파일 상태 http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # SSL Settings ## ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; server { server_name ymillonga.xyz www.ymillonga.xyz; return 301 https://ymillonga.xyz$request_uri; } server { server_name api.nodebird.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name ymillonga.xyz; ssl_certificate /etc/letsencrypt/live/api.ymillonga.xyz/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/api.ymillonga.xyz/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://127.0.0.1:3050; proxy_redirect off; } } server { listen 443 ssl; server_name api.ymillonga.xyz; ssl_certificate /etc/letsencrypt/live/api.ymillonga.xyz/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/api.ymillonga.xyz/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://127.0.0.1:3051; proxy_redirect off; } } } 2. 프론트 서버 sudo certbot --nginx 입력 시 옵션 창 ubuntu@ip-172-31-44-138:~/ymillonga-sns/front$ sudo certbot - Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: api.ymillonga.xyz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spa input blank to select all options shown (Enter 'c' to cancel): 1 Cert not yet due for renewal You have an existing certificate that has exactly the same doficate name you requested and isn't close to expiry. (ref: /etc/letsencrypt/renewal/api.ymillonga.xyz.conf) What would you like to do? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: Attempt to reinstall this existing certificate 2: Renew & replace the cert (may be subject to CA rate limits - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' t Renewing an existing certificate for api.ymillonga.xyz Deploying Certificate to VirtualHost /etc/nginx/sites-enabled Traffic on port 80 already redirecting to ssl in /etc/nginx/sefault - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Your existing certificate has been successfully renewed, and icate has been installed. #mail { # # See sample authentication script at: 9. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le 3. 설정파일 수정 후 서버 재시작 상태 프론트서버 상태 ubuntu@ip-172-31-44-138:~/ymillonga-sns/front$ sudo lsof -i tcp:3050 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 9977 root 18u IPv6 153759 0t0 TCP *:gds-db (LISTEN) ubuntu@ip-172-31-44-138:~/ymillonga-sns/front$ sudo lsof -i tcp:80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 10070 root 8u IPv4 154727 0t0 TCP *:http (LISTEN) nginx 10070 root 9u IPv6 154728 0t0 TCP *:http (LISTEN) nginx 10075 www-data 8u IPv4 154727 0t0 TCP *:http (LISTEN) nginx 10075 www-data 9u IPv6 154728 0t0 TCP *:http 백서버 상태 ubuntu@ip-172-31-44-138:~/ymillonga-sns/back$ sudo lsof -i tcp:80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 10070 root 8u IPv4 154727 0t0 TCP *:http (LISTEN) nginx 10070 root 9u IPv6 154728 0t0 TCP *:http (LISTEN) nginx 10075 www-data 8u IPv4 154727 0t0 TCP *:http (LISTEN) nginx 10075 www-data 9u IPv6 154728 0t0 TCP *:http (LISTEN) ubuntu@ip-172-31-44-138:~/ymillonga-sns/back$ sudo lsof -i tcp:3051 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 9928 root 20u IPv6 153760 0t0 TCP *:3051 (LISTEN)
-
미해결RPA로 자동화 천재되기 (UiPath 응용편)
IF 구문 오류
안녕하세요. 아래 오류 문제 확인 부탁드리겠습니다.