묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨웹 프론트엔드를 위한 자바스크립트 첫걸음
setBookmarkItem 함수 내 deleteBookmarkItem 함수 선언 방식에 대하여
효빈님, 안녕하세요. 강의를 들으면서 궁금한 점이 있어서 질문 드립니다.북마크 아이템 추가하기 강의에서 setBookmarkItem 함수 내에서 deleteBookmarkItem 함수를 선언할 때 애로우펑션을 사용하는 이유가 있을까요? 그냥 함수를 호출하면 안되는건지 궁금해서요..애로우펑션을 사용했을 때의 이점이 어떤건지 간략하게나마 알 수 있을까요? // 예제 코드 bookmarkDelBtn.addEventListener("click",()=>{ deleteBookmarkItem(item.createAt); }); // 궁금한 코드 bookmarkDelBtn.addEventListener("click", deleteBookmarkItem(item.createAt));
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
분류 모델 평가 관련
안녕하세요 빠른 답변 주셔서 공부에 많은 도움이 되고 있어 감사드립니다.roc_auc_score 평가 시에만 accuracy, precision, recall, f1 과 다르게 predict_proba를 사용하는 이유 궁금합니다
-
미해결[아파치 카프카 애플리케이션 프로그래밍] 개념부터 컨슈머, 프로듀서, 커넥트, 스트림즈까지!
카프카 컨슈머 그룹에 대하여
카프카 컨슈머 그룹을 공부하면서 어플리케이션을 만들다가 질문이 있어 글을 썼습니다.컨슈머 그룹 안에 여러개의 컨슈머들이 있고 그 컨슈머들이 토픽 안에 있는 파티션어 각각 붙어서 저장되어 있는 메세지를 받아오고 그 각각의 컨슈머들의 로직은 같다고 하셨는데 그러면 컨슈머 어플리케이션은 그 갯수만큼 서버에 올려서 만들어줘야 하나요?
-
미해결재고시스템으로 알아보는 동시성이슈 해결방법
Redisson import
안녕하세요.Build.gradle에 Redisson을 import하는 과정에서 궁금증이 생겨서 질문합니다.처음에 Redisson을 검색해서 import를 했는데 Facade에서 생성자를 만들때 빨간줄이 뜨고, test를 돌려보니 에러가 나더라구요.importimplementation group: 'org.redisson', name: 'redisson', version: '3.2.0'import한 페이지https://mvnrepository.com/artifact/org.redisson/redisson/3.2.0생성자 경고 test errorjava.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@3f908a10 testClass = com.example.stock.facade.RedissonLockFacadeTest, locations = [], classes = [com.example.stock.StockApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceLocations = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@9da1, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@16a0ee18, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@bd4dc25, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@71def8f8, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@1da2cb77, org.springframework.boot.test.context.SpringBootTestAnnotation@818c3651], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:142) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:127) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:191) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:130) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:241) at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:377) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:382) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:377) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:376) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:289) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:288) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:278) at java.base/java.util.Optional.orElseGet(Optional.java:364) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:277) at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:105) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:104) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redissonLockFacade' defined in file [/Users/jialee/inflearn/stock/out/production/classes/com/example/stock/facade/RedissonLockFacade.class]: Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'org.redisson.api.RedissonClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798) 그래서 다시 검색해서 import 하니 생성자쪽에서 빨간줄은 뜨지 않지만, 테스트를 돌리면 동일한 에러가 나더라구요.importimplementation 'org.redisson:redisson-spring-boot-starter:3.17.4'혹시 두 inport의 차이점은 무엇이며, 왜 계속 테스트가 실패하는건지도 문의드립니다. + 추가로 git 주소도 남깁니다.https://github.com/uiop9900/stock.git
-
해결됨Jenkins를 이용한 CI/CD Pipeline 구축
AWS에서 Amazon Linux 2023 AMI를 사용 하면 안되나요?
안녕하세요. Amazon Linux 2 AMI를 사용해서 다시 인스턴스 만들기 직전입니다..Amazon Linux 2023이 최신이길래 이걸로 셋팅 했더니 amazon-linux-extras 사용이 안되고어떻게 tomcat 설치 까지는 실습 했는데 ansible 설치가 안되네요. 이건 인스턴스를 Amazon Linux 2 AMI로 새로 만들어야 할 수 밖에 없나요?
-
해결됨한 입 크기로 잘라먹는 타입스크립트(TypeScript)
함수 매개변수 타입의 호환성
함수의 매개변수 타입에서 업캐스팅은 에러가 발생하고, 다운캐스팅은 실행 되는 이유가 슈퍼타입에서 서브타입으로 상속 받았기 때문이라고 이해해도 될까요?
-
미해결유니티 Addressable 을 이용한 패치 시스템 구현
카탈로그 질문..
제가 잘못해서 previous build를 안하고 default build를 해서지금 이렇게 됐고, 앱의 버전은 1.0.7인데, 이 버전의 setting.json은이거인데요...제가 이걸 누르고 previous build를 하고..aws s3 서버에 덮어 씌우기 했는데도...업데이트가 되지 않아요...뭐가 문제인걸까요?...어떻게 해결하면 될까요?ㅠ... 그리고 1.0.1~1.0.6 버전에는 예전 카탈로그를 썼는데,default build 해서 최신 카탈로그로 하고, 1.0.7 버전으로 앱 빌드 하면.1.0.7 버전의 최신 카탈로그로 업데이트 되는거 맞나요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 영화 사이트 만들기
npm run dev 오류
npm run dev 명령어를 실행했을 때 다음과 같은 에러 로그가 생성됩니다.react-boiler-plate@1.0.0 dev> concurrently "npm run backend" "npm run start --prefix client"sh: concurrently: command not found
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
비동기를 동기로 처리하는 이유
비동기 함수를 왜 굳이 동기처럼 실행시키기 위해 await을 사용하는 건가요?처음부터 함수를 만들때 동기로 만들면 되는거 아닌가요?동기, 비동기가 잘이해가 안가네요..
-
미해결확률과 통계 기초
8.4 ex01 random sameple size질문입니다.
Normal distribution일려면 RV size가 30 이상이었던 것으로 기억하는데 ex1처럼 20인 경우에도 적용 가능한가요?제가 놓치는 부분이 있는거 같아서 질문드리게 되었습니다
-
미해결캐글 Advanced 머신러닝 실전 박치기
깃허브 주소 문의드립니다.
안녕하세요! 선생님 강의 열심히 듣고 있는 학생입니다 "Anaconda와 Jupyter notebook 셋업하기"를 보면 선생님 깃허브에 들어가서 DLCV 파일을 다운받으라고 하셨는데, 깃허브 주소가 어떻게 되시나요? 아무리 찾아도 나오지 않아 문의드립니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
엔티티 클래스 개발2 h2 db 업데이트 오류 및 intellij 자동 종료
엔티티 클래스 개발2 강의 8분까지의 내용을 따라하는 중인데cmd로 db실행해도 db과 최신화 되어있지 않습니다.그리고 intellij에서 메인 클래스 실행하면 강의와 다르게 자동 종료됩니다.해결 방법 문의 드립니다. https://drive.google.com/drive/folders/1UcqCYHfwffTcVLU7QlbHylGEY2djBH9f?usp=sharing
-
미해결재고시스템으로 알아보는 동시성이슈 해결방법
섹션 3에서의 모든 테스트 케이스가 동작하지 않는데 문제점을 모르겠습니다.
안녕하세요.섹션 3의 세 가지 락들을 따라하면서 코드를 작성했습니다.그런데 세 가지 모두 테스트 케이스가 동작하지 않습니다.PessimisticLock과 NamedLock 경우 재고가 감소하지 않습니다.. OptimisticLock의 경우는에서 동작하지 않습니다.사용한 자바 버전은 17입니다.소스코드 주소는https://github.com/torissi/synchronism-issue입니다.
-
미해결따라하면서 배우는 3D Human Pose Estimation과 실전 프로젝트
prepare_data에서 질문있습니다.
3분 14초쯤에 load_data_hm36.py 파일에서prepare_data에 56줄에서 pos_3d[:, 1:] -= pos_3d[:, :1]을 빼주는데각 subject중에서, 어느 한 action에 해당하는 3차원 point배열에서 첫번째 값들만 빼오고 그 값들을 전체 pos_3d에 빼주는 과정을 해주는데, 이 과정을 해주는 이유가 normalization 때문에 해주는 것인가요? 맞다면, 보통 normalization을 하는 과정이 데이터들의 평균값으로 빼주는 것으로 알고 있는데, 첫번째 값을 빼주신이유가 궁금합니다!!
-
미해결15일간의 빅데이터 파일럿 프로젝트
고사양 VM3 수업자료는 어디까지 설치되어 있는 상태인가요?
저사양 자료를 받아서 Cluster 1 구성을 하다가 지우고 고사양 자료를 받아서 Cloudera의 클러스터를 구성하려고 보니 이미 Cluster 1이 존재한다고 해서 server01.hadoop.com/cmf 에 접속해 봤더니 컴포넌트들까지 Cluster 1이른 이름으로 모두 설치되어 있는 것처럼 보입니다.고사양 자료를 받은 경우 어디서부터 제가 직접 수업을 들으며 따라 해야 할 지 모르겠습니다.
-
미해결애플 웹사이트 인터랙션 클론!
scrollLoop 함수 질문
const scrollLoop = () => { prevScroll = 0; // 스크롤값이 다시 0으로 시작하게 for (let i = 0; i < current; i++) { prevScroll += sceneInfo[i].scrollHeight; } console.log('prev', prevScroll) if (currentScroll > prevScroll + sceneInfo[current].scrollHeight) { current++; alert() } console.log('next', prevScroll) if (currentScroll < prevScroll) { current--; } };선생님 여기서 prevScroll에 for문으로 돌때 sceneInfo[i].scrollHeight; 여기서 이미 값을 더해줄텐데 왜 if (currentScroll > prevScroll) { current++; alert() }조건문에 저렇게 하면 작동이 안돼나요 제가 이해를 잘못하고 있는지 ...
-
미해결자바스크립트 알고리즘 문제풀이 입문(코딩테스트 대비)
이렇게 풀어봤는데, 시간 복잡도가 많이 증가하는 코드 일까요?
(사진)
-
미해결입문자를 위한 코딩테스트 핵심(이론과 문제풀이) [Python]
이렇게 푸는건 효율적이지 못할까요?
def solution(nums): answer = -1 count = [0] * 1001 for x in nums: count[x] += 1 for y in range(len(count)): if count[y] == 1: if answer < y: answer = y return answer안녕하세요.선생님 코드와는 두번째 for문의 구현이 조금 다른데 이런 방식도 문제 없는지 궁금합니다.
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
6-D 시간복잡도 질문입니다.
안녕하세요 선생님.lower_bound나 upper_bound의 경우 vector의 크기가 n이면 시간복잡도가 n일 것 같은데이 문제의 경우에for(int i = 0; i < n; i++){ auto pos = lower_bound(v.begin()~~~)~~~`}이면 시간 복잡도가 n^2로 이분탐색하는 것보다 더 클 것 같은데 맞나요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
[시험환경에 적응하기:작업형2] 'DataConversionWarning'이유 알려주세요
작업형2를 아래와 같이 했는데 DataConversionWarning 나왔습니다검색해보니 y_train 변경때문이며 ravel()을 사용하라고하는데 이유 설명 부탁 드립니다[error명]DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples,), for example using ravel().[작성내용]import pandas as pdX_test = pd.read_csv("data/X_test.csv")X_train = pd.read_csv("data/X_train.csv")y_train = pd.read_csv("data/y_train.csv")pd.set_option('display.max_columns',None)# 사용자 코딩#print(X_train.shape,X_test.shape,y_train.shape)#print(y_train.isnull().sum())#print(X_train['환불금액'].describe())X_train['환불금액']=X_train['환불금액'].fillna(X_train['환불금액'].mean())X_test['환불금액']=X_test['환불금액'].fillna(X_train['환불금액'].mean())#print(X_train.isnull().sum())X_train=X_train.drop('cust_id',axis=1)X_test_id=X_test.pop('cust_id')y_train=y_train.drop('cust_id',axis=1)#print(X_test.head(2))#print(X_train.select_dtypes(exclude='object').columns)# '주구매상품', '주구매지점'# '총구매액', '최대구매액', '환불금액', '내점일수', '내점당구매건수', '주말방문비율', '구매주기'from sklearn.preprocessing import LabelEncodercols=['주구매상품', '주구매지점']for col in cols: le=LabelEncoder() X_train[col]=le.fit_transform(X_train[col]) X_test[col]=le.transform(X_test[col])#print(X_train.head()) from sklearn.preprocessing import MinMaxScalercols2=['총구매액', '최대구매액', '환불금액', '내점일수', '내점당구매건수', '주말방문비율', '구매주기']scaler=MinMaxScaler()X_train[cols2]=scaler.fit_transform(X_train[cols2])X_test[cols2]=scaler.transform(X_test[cols2])#print(X_train.head(2))from sklearn.model_selection import train_test_splitX_tr,X_val,y_tr,y_val=train_test_split(X_train,y_train, test_size=0.3, random_state=2023)#print(X_tr.shape,X_val.shape,y_tr.shape,y_val.shape)#(2450, 9) (1050, 9) (2450, 1) (1050, 1)from sklearn.metrics import roc_auc_scorefrom sklearn.ensemble import RandomForestClassifierrf=RandomForestClassifier(random_state=2023)rf.fit(X_tr,y_tr)pred=rf.predict_proba(X_val)print(roc_auc_score(y_val,pred[:,1]))#0.654227735236709