본문 바로가기

Project & Module

[WebMagic] Analyze 1. Spider1. addUrl1. addRequest(url)1. scheduler.push(request, this) (** 2.1 이동 **)2. thread1. checkIfRunning1. 실행중인지 체크2. 입력 파라미터 threadNum 값 세팅3. run1. checkRunningStat1. state 체크 (STAT_RUNNING 이면 예외 처리)2. initComponent1. downloader 세팅2. pipelines 세팅3. downloader 스레드 세팅4. threadPool 세팅5. startRequest 세팅3. while loop (조건 interrupted 상태가 아닌지, 실행중인지)1. Queue 에서 Request 하나 poll 해옴.2. request 여부에 따.. 더보기
[Unix Shell] 아규먼트 파싱 쉘 https://gist.github.com/jehiah/855086 참조 #!/bin/sh # # a simple way to parse shell script arguments # # please edit and use to your hearts content # ENVIRONMENT="dev" DB_PATH="/data/db" function usage() { echo "if this was a real script you would see something useful here" echo "" echo "./simple_args_parsing.sh" echo "\t-h --help" echo "\t--environment=$ENVIRONMENT" echo "\t--db-path=$DB_PATH" e.. 더보기
[BashShell] vi, ls color 제거 1, ls color 제거https://www.cyberciti.biz/faq/how-to-turn-on-or-off-colors-in-bash/ 2. vi color 제거https://www.cyberciti.biz/faq/turn-on-or-off-color-syntax-highlighting-in-vi-or-vim/ vimrc 에 colorschema 없애거나 syntax off 시키면 됨. 더보기
[Crawler] 구현 시 주의사항 구현 시 주의사항 http://jakarta.tistory.com/37 더보기
[Crawler] Robots.txt 설명 https://korea.googleblog.com/2008/04/robotstxt.html 참조 요약하자면 Robots.txt 를 통해 Crawler 가 Cralwing 할 때 Allow, DisAllow 에 대해 알려줌. 해당 사이트의 Root 위치에 Robots.txt 가 있어야 함. 더보기
Btree 구현 reference : http://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/BTree.java.html 1. Java Source 전체적 설명 * BTree를 Key, Value 로 Generic 선언해줌. 이렇게 선언해주면 Key, Value 라는 것이 T, E 이런걸 의미함. 즉, 어떤 타입이든 받을 수 있고 그걸로 명시되어서 컴파일시 에러를 잡아내는 것이다.* public class BTree 이렇게 선언함으로써 Key는 Comparable을 상속받는 것이며, Comparable을 통해 Compare를 사용할 수 있다. 쉽게 비교가 가능한거지.* 전체적인 구조를 보면 Node, Entry가 있으며, Node는 Entry를 관리하는 개념. Entry는.. 더보기
SimpleTrading Design -----------------------------------------------------------------------------------------------------------------------------------------------****** 프로그램 아키텍처 1. 추천종목, 매수, 매도에 대한 공통 메소드를 만들고 끼워넣었을 때 바로 적용되게 만들기 (클래스명만 넣어주면 나머지는 자동으로 작동되게)----------------------------------------------------------------------------------------------------------------------------------------------- ---------------.. 더보기
procContentInFile 1. 프로그램 목적 : - 파일의 내용을 추가, 수정, 삭제 등 수행하는 Shell 2. Source 2.1 procFileContent.sh #!/bin/ksh################################################ Desc# ################################################ Import. ./deleteContentInFile.sh. ./addContentInFile.sh ################################################ Inputcontent = $1addedValue=$2file_name=$3 ################################################ logic#d.. 더보기
Custom ClassLoader 1. Title : Custom ClassLoader 2. Purpose : ClassLoader Customizing 하기 3. function : 1) 각 폴더 마다 classLoader 생성 2) Hot - deploy 기능 ( 구현중 ) 4. Algorithm : 5. Supplement point : 6. Source : 더보기
Excel을 읽어들여 Source Generation 1. Title : Excel import and source generation 2. Purpose : 엑셀을 읽어들여 자바 Source 생성 확장성을 위해 Properties로 관리. 3. function : 4. Algorithm : 5. Supplement point : 6. Source : 더보기