# Quiz) 사이트별로 비밀번호를 만들어주는 프로그램을 작성하시오 # 예) http://naver.com # 규칙1 : http:// 부분은 제외 => naver.com # 규칙2 : 처음 만나는 점(.) 이후 부분은 제외 => naver # 규칙3 : 남은 글자 중 처음 세자리 + 글자 갯수 + 글자 내 'e' 갯수 + "!"로 구성 # 예) 생성된 비밀번호 : nav51! domain = "http://naver.com" sitename = domain[7:(domain.find("."))] first3 = sitename[:3] length = len(sitename) count_e = sitename.count("e") print(f"생성된 비밀번호 : {first3}{length}{count_e}!")
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? ( 예 /아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? ( 예 /아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? ( 예 /아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 안녕하세요 강의 잘 보고 있습니다! 강의를 수강하다 몇가지 궁금한게 생겨 이렇게 질문 남깁니다. 1. BooleanExpression - where 다중 파라미터 사용 강의에서 강사님이 'where 다중 파라미터 사용'이라는 제목으로 이야기 하실 때 BooleanExpression 을 소개하시는데 아래와 같이 구현하면 BooleanBuilder 로도 where 다중 파라미터가 가능한 것 아닌가요?? private List<Member> searchMember1(String usernameCond, Integer ageCond) { return queryFactory .selectFrom(member) .where(usernameBuilder(usernameCond), ageBuilder(ageCond)) .fetch(); } private BooleanBuilder usernameBuilder(String usernameCond) { if (usernameCond != null) { return new BooleanBuilder(member.username.eq(usernameCond)); } else return new BooleanBuilder(); } private BooleanBuilder ageBuilder(Integer ageCond) { if (ageCond != null) { return new BooleanBuilder(member.age.eq(ageCond)); } else return new BooleanBuilder(); } 2. BooleanExpression 을 선호하시는 이유 다음과 같이 BooleanExpression 으로 allEq() 구현시 BooleanExpression은 추상클래스라 객체생성이 안되기 때문에 NPE가 발생할 수 있는데 private BooleanExpression usenameEq(String usernameCond) { return usernameCond != null ? member.username.eq(usernameCond) : null; } private BooleanExpression ageEq(Integer ageCond) { return ageCond != null ? member.age.eq(ageCond) : null; } private BooleanExpression allEq(String usernameCond, Integer ageCond) { return usenameEq(usernameCond).and(ageEq(ageCond)); // NPE 조심 } 반면 BooleanBuilder 은 실제 클래스라 객체 생성이 되기 때문에 NPE도 방지가 가능합니다. private BooleanBuilder usernameBuilder(String usernameCond) { if (usernameCond != null) { return new BooleanBuilder(member.username.eq(usernameCond)); } else return new BooleanBuilder(); } private BooleanBuilder ageBuilder(Integer ageCond) { if (ageCond != null) { return new BooleanBuilder(member.age.eq(ageCond)); } else return new BooleanBuilder(); } private BooleanBuilder allBuilder(String usernameCond, Integer ageCond) { return usernameBuilder(usernameCond).and(ageBuilder(ageCond)); } 이렇게만 보면 사실 BooleanExpression을 쓸 이유가 없어보이는데 BooleanExpression을 선호하시는 이유가 있으신가요??
안녕하세요 스타트코딩님! 수업 잘 듣고 있는 학생입니다. 질문이 있어 글 남깁니다. 수업 듣기 전에 혼자 해볼 때 저는 soup를 사용하지 않고 find_element를 사용해서 이렇게 코드를 작성했는데 뭐가 다른 걸까요? from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import time import pandas as pd driver = webdriver.Chrome() driver.get('https://search.shopping.naver.com/search/all?query=%EB%8B%AD%EA%B0%80%EC%8A%B4%EC%82%B4') # 스크롤 전 높이 last_height = driver.execute_script('return document.body.scrollHeight') while True: # 스크롤 끝까지 내리기 driver.execute_script('window.scrollTo(0, document.body.scrollHeight)') # 대기 시간 줘야됨 !!! time.sleep(1) # 스크롤 후 높이 after_height = driver.execute_script('return document.body.scrollHeight') # 비교 (if, break) if last_height == after_height: break # 스크롤 전 높이 업데이트 last_height = after_height products = driver.find_elements(By.CSS_SELECTOR, '.product_item__MDtDF') data = [] for product in products: name = product.find_element(By.CSS_SELECTOR, '.product_title__Mmw2K').text link = product.find_element(By.CSS_SELECTOR, '.product_title__Mmw2K > a').get_attribute('href') price = product.find_element(By.CSS_SELECTOR, '.price_num__S2p_v').text.split('원')[0].replace(',', '') data.append([name, link, int(price)]) df = pd.DataFrame(data, columns = ['상품명', '상세페이지링크', '가격']) df.to_excel('네이버쇼핑.xlsx')
안녕하세요, 제가 제조업쪽이라 서비스가 원활한 회사에서 근무를 하고 있지 않아서, 일반적인 IT 업계에선 Helm Chart 관리를 어떻게 하는지 궁금해서 문의드리게 되었습니다. 일반적으로 적당한 프로젝트를 배포할 때 Front End 와 Back End Application 두가지 나눠서 배포한다고 해보겠습니다. Vue 와 Spring Boot 를 사용하는데, 이 때 프로젝트 루트 경로에 예제에서 관리한 바와 같이 deploy 폴더를 만들어서 관리를 하도록 했습니다. 이 때, 기존 구성상 Ingress 가 다음과 같이 되어 있습니다. rules: - host: hello.foo.com http: paths: - path: / pathType: Prefix backend: service: name: svc-fe port: number: 8080 - path: /api pathType: Prefix backend: service: name: svc-be port: number: 80 위와같이 되어 있을 경우, 이 ingress 는 두 영역 모두 의존성이 있습니다. fe 패키지에서 관리해야 할지, be 패키지에서 관리해야 할지 의문이 들었습니다. 아니면 Helm 은 IaC 도구로서 이며 원하는 인프라를 빠르게 셋업해줘야 하기 때문에 FE, BE 모두 한번에 관리하는게 맞는걸까요? 그렇다면 이런 경우에는 FE, BE 깃 레포가 아닌, 별도의 Helm Chart 레포를 만들어서 관리를 하는 걸까요?
https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.7/docs/install/iam_policy.json 에서 "elasticloadbalancing:DescribeListenerCertificates", 윗줄에 "elasticloadbalancing:DescribeLoadBalancerAttributes" 그러지 않으면 targetgroupbinding 이 만들어지지 않는것 같습니다. 분명 대상 그룹도 만들어졌는데 kubernetes resource 로 만들어져있지 않아서 중간에 오류가 생겼거니 했습니다. kubectl describe svc svc-nlb-ip-type 로 오류 디버깅시 elasticloadbalancing:DescribeLoadBalancerAttributes 가 포함되지 않아 403 에러가 났다고 합니다. 처음 가이드에서는 모두 정상동작했을텐데, 이것이 시간이 지나 AWS 가 버전이 업데이트되며 생긴 변화인것일까요? 혹은 제 환경만 이상한 것일까요?ㅎㅎ; 혹은 추가 가이드가 있는데 제가 놓친것일까요?ㅎㅎ;
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 안녕하세요 캐스팅 배우면서 헷갈리는 부분이 있어 문의 드립니다 Parent poly = new Child(); poly에는 Child의 참조값을 가지게 되는데 참조값을 가지고 자식 클래스에 접근을 할 수 없는 부분이 이해가 잘 안갑니다 ㅜㅜ 참조값을 통해 해당 객체 메모리에 접근을 할 수있는데 왜 부모 클래스는 확인이 안되는건가요? 메모리에 접근을 해도 해당변수 타입만 확인을 할 수 있는건가용?
안녕하세요. 강의를 듣고 pyside로 데스크톱 어플리케이션을 만들고 있는 중에 있습니다. QGridLayout 안에 위젯들을 2열로 배치하였는데요, 이 위젯들이 위젯 아이템들 중 가장 너비가 넓은 것에 맞춰 같은 너비를 차지하면서도 위젯들이 윈도우 전체를 차지하지 않는(=커지거나 작아지지 않는) 방법이 있나요..? 생각보다 어려워서 며칠 째 끙끙대다 결국 질문남겨봅니다.
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 안녕하세요, 메서드 강의를 듣는 중 메서드 선언부, 본문에 대해 궁금한 점이 생겨 여쭤보게 됩니다. 메서드 선언부와 본문에 등장하는 메서드 타입, 파라미터 타입, 리턴 타입이 모두 같아야 한다고 강의 도중 말씀하신 것 같아 형변환 원리가 적용되나 싶어 인텔리제이로 실행을 해보니 말씀 그대로 하나라도 다르면 적용이 안되었습니다. 형변환 원리가 적용되지 않는 것이 확실한지 싶어 구글링하여 찾아보았는데 형변환 원리가 일부 적용된다고 하여서 질문을 작성하게 되었습니다. 메서드 선언부(본문) - 호출부 간에는 자료형이 달라도 형변환 원리가 적용되는 것은 이해가 되었는데, 메서드 선언부와 본문에 등장하는 변수 타입은 형변환 원리가 적용되지 않는게 맞을까요 ? 좋은 강의 제공해주셔서 항상 감사드립니다 !!
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 오버라이드 자체가 부모의 메서드를 재정의 하는 것 즉 오버라이드 하면 부모 메서드에 영향을 주는게 아닌데 final을 사용 하지 못하는 이유는 설계 의도가 맞지 않아서 사용하지 못하는게 맞을까요?
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
1..2일차 영상 보면서... 환경을 만드는데.... 서버 구동이 안됩니다. 초초초보입니다....... A problem occurred configuring root project 'library-app'. > Could not resolve all files for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.1 > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.1 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but: - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.1 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.1 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')