Single Responsibility Principle 하나의 클래스는 하나의 목적만 Open Close Principle 확장에는 열려있고 변경에는 닫혀있게 Liskov Substitution Principle 상속받은 하위 클래스는 언제나 자신의 상위 클래스로 교체할 수 있어야 함 Interface Segregation Principle 한 클래스는 자신이 사용하지 않는 인터페이스는 구현하지 않아야함 Dependency Inversion Principle 추상을 매개로 메세지를 주고 받으면서 관계를 최대한 느슨하게 만듦
GoF 디자인 패턴 Creational Pattern(생성 패턴) Singleton Abstract Factory Factory Method Prototype Builder Structual Pattern(구조 패턴) Bridge Decorator Facade Flyweight Proxy Composite Adapter Behavioral Pattern Mediator Interpreter Iterator Template Method Observer State Visitor Command Strategy Memento Chain of Responsibility
https://skillsforall.com/resources/lab-downloads?courseLang=en-US Skills for All Resource Hub Your one-stop for learning resources used within our courses such as hands-on practice activities and our network simulation tool, Cisco Packet Tracer. skillsforall.com:443 가입하고 이 링크로 들어가면 된다.
import ijson import json with open(filePath, 'r') as json_file: print('hello') data = ijson.items(json_file, 'item') papers = (o for o in data) pp= [] index = 0 for p in papers: with open(writePath, 'w') as f: json.dump(p, f, ensure_ascii=False) index += 1
'screen'이라는 툴을 사용하면 ssh 원격 환경에서 딥러닝 학습 코드를 돌려놓고 ssh커넥션이 끊어져도 여전히 터미널이 돌아갈 수 있도록 해준다. tmux는 screen의 기능도 포함하고, 터미널을 여러개로 분할해서 UI를 관리하는 것도 도와주는 종합적 세션 관리 툴이다. 설치 왠지 모르게 되어 있었다. 없다면 sudo apt install tmux tmux new -s session_name Tmux 세션 분리 다음을 입력하여 Tmux 세션에서 분리하고 일반 쉘로 돌아갈 수 있습니다. Ctrl+b d Tmux 세션에 다시 연결 세션에 먼저 연결하려면 세션 이름을 찾아야 합니다. 현재 실행 중인 세션 목록을 가져오려면 다음을 입력합니다. tmux ls 출력에서 볼 수 있듯이 Tmux 세션은 2개가 ..
CSV 파일 문법 1. csv파일은 column을 comma로 분리한다. 따라서 데이터 안에 comma가 들어간다면 ""로 묶어주는 과정이 필요하다. 2. 배열 처리하기 "raw_text","aspectTerms" "I charge it at night and skip taking the cord with me because of the good battery life .","[{'term':'cord', 'polarity':'negative'}]" 이러한 데이터가 있을 때, 처리를 위해서 3. 따옴표 처리하기 작은 따옴표는 괜찮지만 큰 따옴표 "는 ""로 처리해줘야 한다. 파이썬 문법 1. 대괄호 작성: f-string 작성 시 두번 써줘야 한다. {{}} sentence = f'"{line_1}","..
Airflow란? Apache Airflow는 초기 에어비엔비(Airfbnb) 엔지니어링 팀에서 개발한 워크플로우 오픈 소스 플랫폼 ** 워크플로우란? : 의존성으로 연결된 작업(Task)들의 집합 (ex) ETL의 경우 Extractaction > Transformation > Loading 의 작업의 흐름 프로그래밍 방식으로 워크플로우를 작성, 예약 및 모니터링 설치 dependency 문제가 많으므로 virtualenv에 설치하는 것을 추천한다. pip install apache-airflow 실행 원하는 위치에서 airflow initdb 따로 설정 없이도 홈 디렉토리의 airflow 디렉토리에 airflow db파일이 생성된다. 127.0.0.1:8080 접속 시 initialize가 제대로 된..
Airflow란? Apache Airflow는 초기 에어비엔비(Airfbnb) 엔지니어링 팀에서 개발한 워크플로우 오픈 소스 플랫폼 ** 워크플로우란? : 의존성으로 연결된 작업(Task)들의 집합 (ex) ETL의 경우 Extractaction > Transformation > Loading 의 작업의 흐름 프로그래밍 방식으로 워크플로우를 작성, 예약 및 모니터링 설치 dependency 문제가 많으므로 virtualenv에 설치하는 것을 추천한다. pip install apache-airflow 실행 원하는 위치에서 airflow initdb 따로 설정 없이도 홈 디렉토리의 airflow 디렉토리에 airflow db파일이 생성된다. 127.0.0.1:8080 접속 시 initialize가 제대로 된..
do-try-catch문에서 throw를 하기 위한 error 타입을 가장 간단하게 어떻게 정의할 수 있을까? enum VendingMachineError: Error { case invalidSelection case insufficientFunds(coinsNeeded: Int) case outOfStock } 공식 문서에서는 enum 타입으로 정하길 권장한다. Default: 별도로 정의하지 않고 NSError을 사용하는 방법 import Foundation do { throw NSError(domain: "my error domain", code: 42, userInfo: ["ui1":12, "ui2":"val2"] ) } catch let error as NSError { print("Caugh..