본문 바로가기

전체 글

(147)
Selenium 간단 정리 파이썬으로 웹 크롤링 하기 위해서 사용하는 모듈. 설치 방법 pip install selenium 해당하는 브라우저에 맞는 웹드라이버 설치 필요 Chrome: https://sites.google.com/a/chromium.org/chromedriver/downloads Edge: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ Firefox: https://github.com/mozilla/geckodriver/releases Safari: https://webkit.org/blog/6900/webdriver-support-in-safari-10/ 사용법 크롬을 사용하여 해봤는데, 개발자도구를 사용하여 HTML을 보면서 진행 ..
네트워크 이중화 종류 Active - Active 각각 서비스를 제공하다가 장애노드가 발생하면 다른노드에서 해당 서비스까지 병행처리해주는 방식 즉, 모든 노드는 서비스를 제공하면서 동시에 대기 노드 역할을 함 Active - Active는 가능한 최대로 Stateless 하는게 좋음. 데이터 정합성 유지하기 위해 동기화 작업을 하게되는데 이때 동작이 느려짐. Active - Standby 서비스를 제공하는 노드에 대한 대기 노드 존재하는 방식. 대기노드는 어플리케이션을 미리 로드해놓을 수 있지만 서비스를 위한 접속점(ip address, listener)은 활성화 되어선안됨. Standby에는 3개의 종류가 있다. Hot Standby 가동 후 즉시 이용 가능한 구성 Warm Standby 가동 후 즉시 이용은 불가능 하지만..
파이썬 multiprocessing 모듈 (map_async, apply_async) map(), map_async() map_async()는 인자를 넘겨줄때 하나의 튜플로 묶어야한다. ex) ((a),) or (a,b) map은 block, map_async는 non-block map_Async(), apply_async() 사용 시 사용할 수 있는 함수들 설명 get([timeout=x]) 결과가 도착할 때 반환. timeout 안에 도착하지 않으면 timeoutError 발생. timeout이 없을때, 결과가 도착하지 않는 경우를 경험했는데, 서브 프로세스의 결과가 도착할때 까지 메인 프로세스에서 다음으로 진행되지 못하고 계속 기다리는 현상 발생(hang). wait([timeout=x]) 결과가 사용가능할때까지 또는 timeout이 지날때까지 기다린다. timeout이 지났는데도 ..
c++ malloc new 차이점? malloc , new 차이점 malloc은 소멸자를 부르지않는다.예제코드는 아래와같다.#include #include class test { public: test(void) { printf("생성자\n"); } ~test(void) { printf("소멸자\n"); } }; int main() { test test1; test* test2 = (test*)malloc(sizeof(test)); test* test3 = new test(); return 0; }
python logging 예제 logging debug < info < warning < error < critical파이썬 로깅의 기본 설정은 warning이다. 그래서 import logging을 했을 경우, warning ~ 만 출력이 된다. 로깅의 기본설정을 바꿔야 debug, info level를 출력할 수 있다. 기본설정을 바꾸는 방법은 아래와 같다.import logging mylogger = logging.getLogger("my") mylogger.setLevel(logging.DEBUG) 출력 형식을 변경할 수도 있다. 하는방법은 아래와 같다.import logging ''' 생성 시간 : %(acstime)s 로깅 레벨 : %(levelname)s 라인 번호 : %(lineno)s 로그 내용 : %(message)..
python chrome password import os, sys import win32crypt import sqlite3 sys.path.append(os.path.abspath(os.path.dirname(__file__)) + "\\..\\") import common def getpath(_browser): if (_browser == "chrome"): path = os.getenv('localappdata') + "\\Google\\chrome\\User Data\\Default\\" if (_browser == "whale"): path = os.getenv('localappdata') + "\\Naver\\Naver Whale\\User Data\\Default\\" return path def decryp(_path): tr..
c++ thread, mutex, atomic C++ Thread#include // 선언. using namesapce std; void somefunction() { for (int cnt =0; cnt < 1000; ++cnt) cout
c++ vector capacity vector capacityvector에 할당되는 메모리크기를 알아보는 방법이다.#include #include using namespace std; int main() { vector v1; for (int cnt = 0; cnt