안녕하세요. 아래의 코드에서 isnan(posinf)는 왜 1이 나오고, isnan(neginf)는 왜 0이 나오는 지 모르겠습니다. posinf는 양의 무한대로 발산하고, neginf는 음의 무한대로 발산하는 것 아닌가요? 왜 둘의 결괏값이 다른 건지 이해가 가지 않는데, 자세한 설명해주시면 정말 감사하겠습니다. #include <iostream> #include <iomanip> #include <limits> #include <cmath> using namespace std; int main() { double zero = 0.0; double posinf = 5.0 / zero; double neginf = - 5.0 / zero; cout << std::isnan(posinf) << endl; cout << std::isnan(neginf) << endl; }
선생님께서 올려주신 SQL 문 기준으로 확인해보니 하기와 같습니다. SQL 문에서 order_list 테이블에는 VARCHAR(100) 타입의 cust_id 열이 있으며, 이것은 cust_info 테이블의 cust_id 열을 참조하려고 합니다. 이 cust_id 열도 VARCHAR(100) 타입입니다. 따라서 데이터 유형이 일치하므로 이건 패스... 그러나 외래 키에는 기본적인 규칙이 있고, 해당 규칙은: 참조하려는 열(상위 테이블의)은 고유 제약 조건을 가져야 하거나 기본 키여야 합니다. cust_info 테이블에서 cust_id 열은 고유 제약 조건이 없습니다. 이 문제를 해결하려면 cust_info 테이블의 cust_id 열에 고유 제약 조건을 추가해야 합니다. 다음과 같이 할 수 있습니다: ALTER TABLE cust_info ADD UNIQUE (cust_id); 위의 문장을 실행한 후 외래 키를 추가하기 위해 ALTER TABLE 문을 실행할 수 있습니다: ALTER TABLE order_list ADD CONSTRAINT fk_cust_id FOREIGN KEY (cust_id) REFERENCES cust_info(cust_id); 이 단계를 거치면 해당 제약 조건에 대한 "Foreign key constraint is incorrectly formed" 오류를 더 이상 만나지 않아야 합니다. 즉 cust_info의 cust_id를 유니크 상태로 만들고 나서 늦부장님께서 올려주신 DB작성하면 해결 됩니다.
강의를 보면 젠킨스 마스터 서버에서 slave 서버로 ssh 접속하기 위해 ssh keygen 과 copy-id 를 해서 비밀번호 없이 ssh 접속을 할 수 있도록 설정했습니다. 근데 젠킨스 웹페이지에서 slave 노드 정보를 추가할 때 계정과 패스워드를 또 추가하는 이유가 무엇인가요?? 어차피 없어도 이미 ssh 정보가 있어서 들어갈 수 있지 않나요 ? bash 끼리 통신하는거랑 어플리케이션에서 통신하는 거랑은 별도의 계정 정보가 필요한 걸까요?? 아니면 그냥 젠킨스 페이지에서만 설정하면 되는데 굳이 copy-id 를 하는 이유가 궁금합니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. http://boj.kr/39c15e9338ad4585955d4d9f7453c741 나름의 방법대로 구현해봤는데, 반례를 찾기 어려워 질문드립니다. 좋은 강의 감사드립니다!
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
안녕하세요. 강의를 듣고 변형해서 개발해 보고 있습니다. drifrt를 통한 insert 시에 오류가 발생합니다. [ERROR:flutter/runtime/dart_vm_ initializer.cc (41)] Unhandled Exception: Bad state: GetIt: Object/factory with type LocalDataBase is not registered inside GetIt. 어떤 오류인지 검색을 해도 나오지가 않네요. 문제가 뭐인지 확인 좀 부탁드립니다. 감사합니다.
Hibernate5Module 애가 빈으로 등록되어 있기 때문에 아래 코드에서 프록시 객체인 상태를 getUsername()로 프록시 초기화 시켜 바로 api로 반환 가능한건가요? List<Order> all = orderRepository.findAllByCriteria(new OrderSearch()); for (Order order : all) { order.getMember().getUsername(); } return all; }
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 여기에 질문 내용을 남겨주세요. package hello.core; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; @Configuration @ComponentScan( basePackages = "hello.core", excludeFilters = @ ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Configuration.class)) public class AutoAppConfig { } package hello.core; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class CoreApplication { public static void main(String[] args) { SpringApplication.run(CoreApplication.class, args); } } package hello.core; import hello.core.discount.DiscountPolicy; import hello.core.discount.FixDiscountPolicy; import hello.core.discount.RateDiscountPolicy; import hello.core.member.MemberRepository; import hello.core.member.MemberService; import hello.core.member.MemberServiceImpl; import hello.core.member.MemoryMemberRepository; import hello.core.order.OrderService; import hello.core.order.OrderServiceImpl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class AppConfig { @Bean //MemoryMemberRespository 객체로 초기화된 MemberServiceImpl 객체 반환 public MemberService memberService() { System.out.println("call AppConfig.memberService"); return new MemberServiceImpl(memberRepository()); } @Bean public OrderService orderService() { System.out.println("call AppConfig.orderService"); return new OrderServiceImpl ( memberRepository(), discountPolicy() ); } @Bean public MemberRepository memberRepository() { System.out.println("call AppConfig.memberRepository"); return new MemoryMemberRepository(); } @Bean public DiscountPolicy discountPolicy() { return new RateDiscountPolicy(); } } ㅇCoreApplicaton 클래스(@SpringBootApplicaton) 을 실행하면, @SpringBootApplicaton 에 @ComponentScan이 포함되어 있기 때문에 CoreApplication 의 패키지 하위를 전부 scan 합니다. 그 과정에서 AppConfig 와 AutoAppConfig 를 만날텐데 @ ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Configuration.class)) AutoAppConfig에 @Configuration 은 스캔하지 말라고 되어있습니다. Q1. 그러면 AppConfig 는 스캔 되지 않고 빈으로 생성되지 않는 건가요? Q2. AutoAppConfig도 @Configuration이 등록되어있는데 그렇다면 AutoAppConfig도 빈으로 생성되지 않는건가요? Q3. @Configuration public class AppConfig { @Bean //MemoryMemberRespository 객체로 초기화된 MemberServiceImpl 객체 반환 public MemberService memberService() { System.out.println("call AppConfig.memberService"); return new MemberServiceImpl(memberRepository()); } @Bean public OrderService orderService() { System.out.println("call AppConfig.orderService"); return new OrderServiceImpl ( memberRepository(), discountPolicy() ); } @Bean public MemberRepository memberRepository() { System.out.println("call AppConfig.memberRepository"); return new MemoryMemberRepository(); } @Bean public DiscountPolicy discountPolicy() { return new RateDiscountPolicy(); } } AppConfig 를 컴포넌트 스캔 대상에서 제외해버리면 AppConfig의 수동 빈 등록 내용도 전부 무시되어 얘네들이 빈으로 생성되지 않는건가요? Q4.CoreApplicaotn 에도 @Configuration 이, AutoAppConfig에도 @Configuration이 설정되어있는데 이 경우 충돌이 일어나지는 않나요? Q5. 만약 Q4에서 충돌이 일어나지 않는다면, 두개의 Configuraiton 내용이 둘다 프로젝트에 적용되는 건가요?
삼항 연산자를 이용하여 가장 큰 수 를 구하고, 전체 수를 더한값을 뺀 후 나머지 2개의 숫자의 합을 구해서 비교하여 "YES"와"NON"를 구해 보았습니다. <!-- 삼각형 판별하기 --> <html> <head> <meta charset="UTF-8" /> <title>출력결과</title> </head> <body> <script> function solution(a, b, c) { let answer; const longLine = a > b ? (a > c ? a : c) : b > c ? b : c; const totalLine = a + b + c; const remainder = totalLine - longLine; answer = longLine < remainder ? "YES" : "NO"; return answer; } console.log(solution(7, 5, 2)); </script> </body> </html>
안녕하세요! 강의를 들으면서 데이터와 관련된 기술 스택들을 익히는데 많은 도움을 받고 있습니다. 다름이 아니라 수강 연장 이벤트를 신청하려고 하는데, 구글 설문 링크가 보이지 않아서 이렇게 커뮤니티에 글을 남깁니다. 혹시 이벤트 기간이 종료가 된건지 아니라면 어떻게 신청하면 되는지 궁금합니다. 좋은 강의 만들어주셔서 감사합니다!
안녕하세요 제가 미리보기 강의들을 보다가 수업 방식도 마음에 들었고 미리보기 예제 코드를 다운 받기 위해서 그냥 바로 수업 신청을 했습니다. 근데 초반에서 지속적으로 전에 수업에서 다 배웠다고 많은 부분들을 그냥 넘어가셔서 제가 이해가 잘 가지가 않습니다. 혹시 배우지 못했던 부분만을 따로 빼서 저렴하게 강의를 올리실 의향이나 아니면 제가 따로 공부하고 와야 할 부분을 알려주실 수 있을까요? 좀 많이 당황스럽습니다.
제가 아직 초보 개발자라 막연히 setter 사용은 지양하는게 좋다고 배워서 실무에서는 다른지 궁금합니다. setter 를 열어두면 빈으로 등록된 AppConfig 의 불변성을 보장할 수 없게 되는게 아닌가 해서 질문드립니다. https://mangkyu.tistory.com/189 위 블로그를 보면 @ConfigurationProperties 를 setter 없이 생성자로 할 수도 있는것 같아서요. 혹시 제가 너무 setter 사용을 지양하라는 말에 매몰돼있는건 아닐까 고민도 되네요.
안녕하세요. '데이트 스트림과 스크립트 설치방법'을 듣고있습니다. 강의에서 요즘은 스크립트를 웹사이트 head에 삽입하기보다 태그매니저를 먼저 설치하고 ga4와 연결시키는 편이라고했는데 기존 회사 계정의경우 태그매니저 없이 head에 스크립트가 들어가있는 상황입니다. 이 경우 뒤늦게 구글 태그매니저와 ga4를 연결해도 충돌이라던지 문제가 일어나지는 않을까요 ?
수정 버튼을 클릭하면 기존 값의 작성자와 내용이 작성되어 있는데 별점도 똑같이 유지 시키고 싶어서 다음과 같이 작성 했습니다. <S.Star onChange={props.setStar} value={props.star !== 0 ? props.star : props.el?.rating ?? 0} /> 별점을 선택하고 댓글 등록하기 클릭하면 함수를 통해 setStar(0) 초기화도 해주었고 수정 아이콘을 클릭했을 때 기존 등록한 별점도 유지되게 했는데 수정하기 버튼을 클릭하면 별점이 0으로 수정이 됩니다. 여기서 어느 부분을 건들어야 할지 모르겠어요.