안녕하세여 "리덕스 실제 구현하기" 까지 인강을 듣다가 로그인 버튼 export const logoutAction 위 부분까지는 데이터 값이 전달이 되는데 AppLayout.js 에서 isLoggedIn이 값을 제대로 못가져 오더라구여. 이런 문제가 있어서 리덕스를 이용해서 문제해결을 하려했는데 개발자모드에서 아래 사진처럼 뜨더라구여 혹시 해결방법좀 알수있을까여? https://github.com/woo1038/react_bird_exam 현재 클릭 이벤트 에러가 뜨는 깃 주소인데 확인 한번만 부탁드려도 될까요?
stackoverflow에서 __iter__ 메소드 관련 질문을 보다 생긴 궁금증인데요 class Item : def __init__ ( self ): self . name = 'James' def __iter__ ( self ): return self 다음과 같은 코드를 작성했을때, 코드상에서 __iter__ 메소드는 self를 리턴하고 있지만 self 자체는 '__next__ 메소드가 구현된 iterator'가 아니므로 . 결국 __iter__ 메소드는 iterator를 리턴하지 못해 클래스 자체가 유효한 iterable 객체가 아니라는 설명을 볼 수 있었습니다. 하지만 a = Item () 다음과 같이 인스턴스를 생성하고 print ( dir ( a )) dir로 속성을 확인해 봤을 때 __iter__ 를 확인할 수 있었는데요, for i in a : print ( i ) 물론 다음과 같이 for문에서 사용했을 때 오류가 발생하는 것으로 보아 클래스 자체가 유효한 iterable 객체가 아님을 확인할 수 있었습니다. 다만 이런 사례처럼 유효하지 않은(invalid) iterable 객체라도 __iter__ 메소드를 가질 수 있는 것인지 궁금합니다.
안녕하세요 강사님. 강의 잘 듣고있습니다! 강의를 보다가 문득 의문이 들어서 질문남깁니다. EntityManager를 @Aurowired로 주입받는 것과 @PersistenceContext로 받았을 때 차이점이 무엇인가요? 둘 다 의존성을 잘 받아오길래 차이점이 궁금합니다!
public static void main (String[] args) { Scanner sc = new Scanner(System. in ) ; int n = sc.nextInt() ; System. out .println( solution (n)) ; } public static int solution ( int n) { int answer = 0 , sum = 0 ; int p1 = 1 ; for ( int i = 1 ; i <= (n / 2 + 1 ) ; i++) { sum += i ; while (sum > n) { sum -= p1++ ; } if (sum == n) answer++ ; } return answer ; } 해당 방법으로 풀이시 다섯 개의 케이스 말고 추가 케이스에서 문제가 다른 답이 나올수도 있을까요 ...?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 일단 수동으로 올려서 쓰고 있는데, 강의에서 처럼 자동으로 된다면 무척 편할거같습니다. 알려주신 플러그인들은 모두 설치한 상태인데 어떤게 빠진걸까요?
궁금한 점이 있습니다. 현재 AWS EC2, 로드밸런서를 설치해서 작동하는 것까지 확인했습니다만 포테이너는 그대로 사용가능한건가요? 제가 포테이너를 사용하지 않고 도커를 연습중에 계속 도커 스택에서 컨테이너가 죽길래 확인해보려고 포테이너를 도중에 설치해서 포트를 9001번을 지정하고 EC2의 인바운드도 9001로 열어줬는데 접근거부가 뜨고 있습니다. 이게 ACL영향도 있을까요?..
안녕하세요 선생님. Ex05_JspUse 예제 실습 시부터 발생하는 오류인데, 학습을 따라간 이후 Boot Dashboard 에서 서버를 시작하려고 하면 포트(8081) 가 실행되지 않습니다. 오류 해결하고자 프로젝트 및 프로그램을 모두 지운 후 재설치 등도 해보았으나 해결이 되지 않아 여쭙습니다. * 참고로 말씀드리면 처음 학습 시 8081 포트가 잘 실행 되었으나 기존 프로젝트 삭제 후 재학습시에는 이와 같은 에러로 웹화면이 뜨지 않습니다. 콘솔창에 보이는 내용은 다음과 같습니다. [콘솔] [콘솔내용 전문] *************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:183) The following method did not exist: 'void org.apache.tomcat.util.modeler.Registry.disableRegistry()' The method's class, org.apache.tomcat.util.modeler.Registry, is available from the following locations: jar:file:/C:/Users/EUNU/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/8.5.38/485668675de7538c5f08c5050377297c93493b59/tomcat-embed-core-8.5.38.jar!/org/apache/tomcat/util/modeler/Registry.class The class hierarchy was loaded from the following locations: org.apache.tomcat.util.modeler.Registry: file:/C:/Users/EUNU/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/8.5.38/485668675de7538c5f08c5050377297c93493b59/tomcat-embed-core-8.5.38.jar Action: Correct the classpath of your application so that it contains a single, compatible version of org.apache.tomcat.util.modeler.Registry
vuex를 사용하여 store를 이용하고 있는데요. A라는 화면에서 state의 값들을 설정해준 후에 B라는 화면을 갔다가 다시 A라는 화면에 오면 state의 값들이 이전에 설정해준 값이 그대로 있습니다. A라는 화면에 왔을 때 state의 값들을 초기화 해주려면 어떻게 해야 하나요?
CompStdRepository.java /** * ID 로 조회 */ public CompStd findOne (Long id) { return em .find(CompStd. class, id) ; } /** * API ID 로 조회 */ public CompStd findOneByApiId (String apiId) { String query = " select c From CompStd c where c.apiId = :apiId " ; return em .createQuery(query , CompStd. class ) .setParameter( "apiId" , apiId) .getSingleResult() ; } CompStdService.java /** * ID 로 조회 */ public CompStd findOne (Long id) { return compStdRepository .findOne(id) ; } /** * API ID 로 조회 */ public CompStd findOneByApiId (String apiId) { return compStdRepository .findOneByApiId(apiId) ; } CompStdServiceTest.java @Test void API_ID 로 _ 조회 () { //given Long createdId = compStdService .insert(getCompStd()) ; CompStd insertedCompStd = compStdRepository .findOne(createdId) ; //when CompStd findCompStd = compStdRepository .findOneByApiId(insertedCompStd.getApiId()) ; //then assertEquals (insertedCompStd , findCompStd) ; } 1. 다음과 같이 테스트를 작성하였는데 이게 JPQL 조회 기능을 테스트하는 코드로서 올바르게 작성된 건지 궁금합니다. 2. 테스트에서 em.find()로 조회한 객체와 JPQL을 통하여 조회한 객체가 같은 이유는 em.find()로 조회하여 영속성 컨텍스트에 저장된 객체를 JPQL로 조회할 때 객체의 기본 키로 확인하여 같은 객체를 가져오기 때문이라고 보면 될까요?