강의와 관련있는 질문 을 남겨주세요. • 강의와 관련이 없는 질문은 지식공유자가 답변하지 않을 수 있습니다. (사적 상담, 컨설팅, 과제 풀이 등) • 질문을 남기기 전, 비슷한 내용을 질문한 수강생이 있는지 먼저 검색 을 해주세요. (중복 질문을 자제해주세요.) • 서비스 운영 관련 질문은 인프런 우측 하단 ‘문의하기’ 를 이용해주세요. (영상 재생 문제, 사이트 버그, 강의 환불 등) 질문 전달 에도 요령이 필요합니다. • 지식공유자가 질문을 좀 더 쉽게 확인할 수 있게 도와주세요. • 강의실 페이지 (/lecture) 에서 '질문하기'를 이용해주시면 질문과 연관된 수업 영상 제목이 함께 등록됩니다. • 강의 대시보드에서 질문을 남길 경우, 관련 섹션 및 수업 제목을 기재 해주세요. • 수업 특정 구간에 대한 질문은 꼭 영상 타임코드 를 남겨주세요! 구체적인 질문 일수록 명확한 답을 받을 수 있어요. • 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요. • 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요 . • 정확한 질문 내용과 함께 코드 를 적어주시거나, 캡쳐 이미지 를 첨부하면 더욱 좋습니다. 기본적인 예의 를 지켜주세요. • 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. • 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. • 반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용 은 스팸 처리 등 제재를 가할 수 있습니다. 강의 시청중입니다. pdf 파일이 있으면 더 도움이 될거같습니다. jeffyoo2430@gmail.com 감사합니다.
안녕하세요 jpa까지 듣고 test돌리는데 findByName에서 널포인트가 뜹니다ㅠ 오타는 없는 것 같은데.. 어디서 전달이 안되는걸까요ㅠㅠ @Override public Optional<Member> findByName (String name) { List<Member> result = em .createQuery( "select m from Member m where m. name = :name" , Member. class ) .setParameter( "name" , name) .getResultList() ; return result.stream().findAny() ; } private void validateDuplicateMember (Member member) { System. out .println(member.getName()) ; memberRepository .findByName(member.getName()) .ifPresent(m -> { throw new IllegalStateException( "이미 존재하는 회원입니다." ) ; }) ; } public Long join (Member member){ // 같은 이름이 있는 중복 회원 X validateDuplicateMember(member) ; // 중복 회원 검증 memberRepository .save(member) ; return member.getId() ; } java.lang.NullPointerException at com.spring.login.repository.JpaMemberRepository.findByName(JpaMemberRepository.java:31) at com.spring.login.service.MemberService.validateDuplicateMember(MemberService.java:33) at com.spring.login.service.MemberService.join(MemberService.java:26) at com.spring.login.service.MemberService$$FastClassBySpringCGLIB$$84dd2189.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692) at com.spring.login.service.MemberService$$EnhancerBySpringCGLIB$$ceeacdcd.join(<generated>) at com.spring.login.service.MemberServiceIntegrationTest.회원가입(MemberServiceIntegrationTest.java:30) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
클라에서 서버로 요청 할 경우, 1. header에 cache-control의 max-age의 시간은 이미 만료 2. last modified date의 시점이 아직 변경되지 않은 시점일 때 서버에서 클라이언트로 보내주는 header 정보에 cache meta 데이터는 어떤 식으로 갱신이 되는건가요?
안녕하세요 c# 개발에서 자바 웹 개발자로 넘어온 초급 개발자 입니다. 넘어 오기 전에 제가 독학으로 공부할때는 oracle 1.8 jdk를 설치 해서 java_home 및 path 설정을 잡았었는데요 강좌에서는 openjdk11로 설명을 하시더라구요. 그래서 java_home 경로를 11 경로로 잡아 준 뒤에 cmd 상에서 버전을 확인해 봤는데 계속 1.8 로만 잡히더라구요.. 그래서 혹시나 ...11 버전 사용하는데 문제 되는게 없는지 궁금합니다
다음과 같이 코드 작성하였는데요 답과는 다르게 나옵니다. 어느 부분인지 찾지를 못하겠어서 도움 요청드립니다. from collections import deque import sys sys . setrecursionlimit ( 10 ** 6 ) dx = [ - 1 , 0 , 1 , 0 ] dy = [ 0 , 1 , 0 , - 1 ] n = int ( input ( ) ) area = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( n ) ] Q = deque ( ) res = 0 for h in range ( 100 ) : ch = [ [ 0 ] *n for _ in range ( n ) ] cnt = 0 for i in range ( n ) : for j in range ( n ) : if area [ i ] [ j ] > h and ch [ i ] [ j ] == 0 : ch [ i ] [ j ] = 1 cnt+ = 1 Q. append ( ( i , j ) ) while Q: tmp = Q. popleft ( ) for i in range ( 4 ) : xx = tmp [ 0 ] +dx [ i ] yy = tmp [ 1 ] +dy [ i ] if 0 <= xx < n and 0 <= yy < n and ch [ xx ] [ yy ] == 0 and area [ xx ] [ yy ] > h: ch [ xx ] [ yy ] = 1 Q. append ( ( xx , yy ) ) res = max ( res , cnt ) if cnt == 0 : break print ( res )
def closure_ex1(): series = [] def averager(v): series.append(v) print('inner >> {} / {}'.format(series, len(series))) return sum(series) / len(series) (return averager) avg_closure1 = closure_ex1() avg_closure2 = closure_ex1 위의 클로저 예제에서 closure_ex1 함수의 return averager를 제거하고 두가지 방식으로 변수 할당을 해보았습니다. 그리고 아래와 같이 타입을 출력해보았는데 NoneType과 function이라는 결과값이 나왔습니다. print(type(avg_closure1)) -> NoneType print(type(avg_closure2)) -> function avg_closure1 = closure_ex1() 이렇게 변수를 할당하는 것은 avg_closure1에 closure_ex1 함수가 실행된 상태로 할당되어 있는 것을 의미하는 건가요? 그래서 함수의 실행 결과인 리턴값이 없기 때문에 NonType이라고 출력되는 건가요? 계속 (return 부분)을 return averager, return series, 생략 이렇게 넣어서 결과를 출력해보니 값이 다 다르게 나오고, 느낌은 오는데 명확히 정리가 잘 안됩니다 ㅠㅠ 항상 친절한 답변 감사드립니다.
java: Illegal char <:> at index 106: C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.4\jbr\bin\Could not find com.h2databases:h2:. Required by: project : 이런 오류가 뜨는데요 구글에 검색을 해봐도 답이 나오지않습니다.. 영상 그대로 한것같은데 이 문제 때문에 실행을 못하고있습니다 ㅠㅠ
str1 = input () str2 = input () dict1 = {} dict2 = {} for x in str1: dict1[x] = dict1.get(x, 0 ) + 1 for x in str2: dict2[x] = dict2.get(x, 0 ) + 1 for i in dict1.keys(): if i in dict2.keys(): if dict1[i] != dict2[i]: print ( 'NO' ) break else : print ( 'NO' ) break else : print ( 'YES' ) 이 코드는 강의에 있는 개선 전의 딕셔너리 풀이 코드입니다. 개선의 문제가 아니라 이 코드 자체에 오류가 있는 거 같아요! str1이 AaBb이거 str2가 AaBbCc이면 답이 'NO' 여야하는데 'YES'로 나와요. 즉 dic1이 dict2에 포함관계이면 무조건 'YES'가 나오는 것 같습니다