전체 글821 2022년 16주차 '넓은 시야를 가질 수 있는 사람' Weekly growth '객체지향의 사실과 오해', '너의 내면을 검색하라' 완독 '객체지향의 사실과 오해'는 완독하였습니다. (정리한 내용을 블로그에 포스팅하고 있습니다.) '너의 내면을 검색하라'는 3분의 2정도 읽었습니다. 오는 주에는 모두 읽고 서평을 남기겠습니다. 현재까지 읽은 부분 중에 인상적인 구절을 소개해드리겠습니다. 일에서 동기를 부여받을 수 있는 가장 좋은 방법은 자신의 더 높은 목적을 찾는 것이다. 추가로 이번주부터 이나모리 가즈오의 [왜 일하는가] 책을 읽고 있습니다. 저는 일을 즐기고 싶기 때문에 일을 어떻게 설계하고 어떤 마음으로 접근해야하는지에 대해 관심이 많은데요. 일을 즐기는 마인드셋을 얻기위해 읽기 시작했습니다. TIL 포스팅 5개 TIL을 5개 이상 작성하였습니다. 지.. 2022. 4. 17. Regex validate PIN code Description: ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits. If the function is passed a valid PIN string, return true, else return false. Examples (Input --> Output) Solution: 1. 인자가 숫자인지 확인한다. 2. 인자의 길이가 4 혹은 6이라면 pin을 반환한다. def validate_pin(pin): return pin.isdigit() and len(pin) in (4, 6) 2022. 4. 16. 도메인과 유스케이스, 유지보수하기 쉽고 유연한 객체지향 시스템 * 이 글은 책을 읽고 주관적인 생각과 함께 요약 정리한 글입니다. 제목 : 객체지향의 사실과 오해 저자 : 조영호 범위 : 06 객체지도 요약 정리 설계 객체지향은 자주 변경되는 '기능'이 아니라 안정적인 '구조'를 기반으로 시스템을 구조화한다. (구조 중심 설계) 기능 측면 설계는 사용자를 위해 무엇을 할 수 있는지에 초점을 맞춘다. (충분조건) 구조 측면 설계는 서비스의 형태가 어떠해야 하는지에 초점을 맞춘다. (필요조건) 기능과 구조는 조화를 이루어야 한다. 소프트웨어는 요구사항이 항상 변경된다. 이 '변경' 때문에 설계가 필요한 것이다. 예측 불가능한 변경에 유연하게 대처할 수 있는 안정적인 구조를 설계해야한다. 좋은 설계는 나중에라도 변경할 수 있는 여지를 남겨 놓는 설계다. 즉, 설계의 목표.. 2022. 4. 16. Get the mean of an array Description: It's the academic year's end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to calculate their average for them. Easy ! You just need to write a script. Return the average of the given array rounded down to its nearest integer. The array will never be empty. Solution: 1. Find the average. 2. Rounds down to an inte.. 2022. 4. 15. Sum of Odd Cubed Numbers Description: Find the sum of the odd numbers within an array, after cubing the initial integers. The function should return undefined/None/nil/NULL if any of the values aren't numbers. Note: Booleans should not be considered as numbers. Solution: 1. If the element in the array is not of type 'int', None is returned. 2. If the cube of the remaining elements is odd, the values are added. 3. Retu.. 2022. 4. 14. @pytest.fixture 로 test 데이터 세팅하기 pytest.fixture 는 왜 사용할까? 테스트 코드를 작성하다보면 ‘클라이언트’나 ‘토큰’, ‘객체’ 등이 필요할 수 있습니다. 보통은 setup 이나 teardown 등으로 데이터를 세팅할 수 있지만 pytest에는 fixture 데코레이터를 통해 필요한 데이터를 세팅하고 어떤 테스트 함수든지 재활용할 수 있습니다. 테스트 코드 예시 아래는 로그인 api를 테스트 하는 함수입니다. # test_login.py def test_login_api(client, create_user): data = { "email": "test@test.com", "password": "password", } r = client.post("/api/v1/login", json=data) r_message = r.jso.. 2022. 4. 14. 이전 1 ··· 89 90 91 92 93 94 95 ··· 137 다음