標籤

二元樹 (1) 字串常數池 (1) 投資 (3) 每月損益 (37) 例外處理 (1) 泛型 (2) 股票 (15) 指標 (5) 英文 (8) 基本資料型別 (1) 期貨 (1) 程式交易 (10) 量化投資 (5) 亂亂寫 (3) 概念 (3) 資料結構 (3) 演算法 (3) 數學 (3) 轉型 (1) AMA (1) ArrayList (1) assert (1) BeautifulSoup (1) C/C++ (8) casting (1) ClassCastException (1) classpath (1) Collection (4) Comparable (1) comparTo() (1) constructor (1) database (3) Debian (1) Dropbox (2) EA (2) enum (1) equals() (2) exception (3) extends (1) ffmpeg (1) final (1) Git (1) HashMap (1) HashSet (1) hasNext() (1) HTS (3) instanceof (1) IS-A (1) Iterator (1) JAVA (43) length (1) Linux (31) List (1) Mac (6) Map (1) ML (2) MT4 (6) MySQL (2) next() (1) NullPointerException (1) Number (1) Numpy (2) OpenCart (1) OpenCV (3) OSX (1) overloading (1) overriding (3) pandas (2) PHP (8) PriorityQueue (1) Python (11) Queue (1) random() (1) reverse() (1) Samba (1) SCJP (21) sqrt() (1) synchronized (1) talib (1) ufw (1) uTorrent (1) var-args (2) VHF (1) vim (2) Yhoo知識+ (4)

2014年4月27日 星期日

Installing HTTrack on a Mac (Mac OS X)

http://forum.httrack.com/readmsg/15816/15608/index.html?q=httrack+mac

 
To compile httrack on your Mac, you first of all need to install Apple
developer Tools (X-Code). Either download it from
<http://developer.apple.com/tools/download/> or perhaps the Developer Tools are
on your Mac OS X install DVD. 

Then download the newest souce code of HTTrack from
<http://debian.httrack.com/dists/unstable/main/source> (if you want the newest
beta-version). Currently the archive name of the newest version is
httrack_3.41.20.orig.tar.gz. Unpack it using Finder (dobble click the
downloaded file).

Now start the application Terminal (found in /Applications/Utilities/ or by
searching for it with Spotlight). Terminal provides a command line interface.

(1) Type cd <path to httrack folder> (replacing <path...> with the actual path
e.g. Desktop/httrack-3.41.20). 
(2) Type ./configure (plus optionally --prefix=<path you where you want to
install HTTrack> if you for example do not have administrator priviledges to
your Mac).   
(3) Type make (compiles the source to executable commands)
(4) Type make install (the installer puts the files where you told it to by
using --prefix=... of per default in the folder /usr/local/)

Now you can archive with HTTrack by typing /usr/local/bin/httrack <url to
archive> -O ~/<name of local archive folder> -n -j

The above options (i.e. -n -j) are just a couple of the most usefull options
to use. For more options I advice you to read the HTTrack documentation. It is
also often very usefull to add web adresses that the crawler should not
archive and some that it should. This is done simply by adding to the URLs
with a leading - or + (e.g. httrack <http://www.httrack.com/> -O
~/070208_httrack_com -n -j -http://www.httrack.com/page/*
+http://www.httrack.com/page/7/*). 

Please report how the instructions above has helped you or how they did not.
:-)

Kind regards,

2013年10月29日 星期二

於Ubuntu同步Google硬碟

安裝 Grive

$sudo add-apt-repository ppa:nilarimogard/webupd8
$sudo apt-get update
$sudo apt-get install grive

/*
原始碼編譯安裝也可以,首先安裝一些必要套件:
$sudo apt-get install cmake build-essential libgcrypt11-dev libjson0-dev libcurl4-openssl-dev libexpat1-dev libboost-filesystem-dev libboost-program-options-dev binutils-dev

Grive下載原始碼,或直接使用 wget 下載:
$wget http://www.lbreda.com/grive/_media/packages/0.2.0/grive-0.2.0.tar.gz
$tar xvfvz grive-0.2.0.tar.gz
$cd grive-0.2.0
$cmake .
$make
$sudo make install

*/

安裝完成之後,第一次執行:
mkdir ~/google_drive
cd ~/google_drive
grive -a


然後打開連結,按確定,就會出現一個授權碼,再貼回終端機裡,按下 Enter 鍵,就會開始下載GoogleDrive裡的資料。


使用 Grive 進行同步

command進GoogleDrive的資料夾,輸入grive,就會自動同步了.


參考自

2013年10月27日 星期日

ffmpeg mp3 merge and mp3+pic=flv

ffmpeg -i "concat:12-03.mp3|12-04.mp3|12-05.mp3|12-06.mp3|12-07.mp3|12-08.mp3|12-09.mp3|12-10.mp3" -acodec copy merge.mp3

ffmpeg -loop_input -i RedRiver.jpg -i merge.mp3 -f flv -acodec copy -r 1 output.flv

2013年10月23日 星期三

medianBlur


medianBlur

Blurs an image using the median filter.
C++: void medianBlur(InputArray src, OutputArray dst, int ksize)
Python: cv2.medianBlur(src, ksize[, dst]) → dst
Parameters:
  • src – input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
  • dst – destination array of the same size and type as src.
  • ksize – aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
The function smoothes an image using the median filter with the \texttt{ksize} \times \texttt{ksize} aperture. Each channel of a multi-channel image is processed independently. In-place operation is supported.

cvHoughLines2


HoughLines

Finds lines in a binary image using the standard Hough transform.
C++: void HoughLines(InputArray image, OutputArray lines, double rho, double theta, intthreshold, double srn=0, double stn=0 )
Python: cv2.HoughLines(image, rho, theta, threshold[, lines[, srn[, stn]]]) → lines
C: CvSeq* cvHoughLines2(CvArr* image, void* line_storage, int method, double rho, double theta, int threshold, double param1=0, double param2=0 )
Python: cv.HoughLines2(image, storage, method, rho, theta, threshold, param1=0, param2=0) → lines
Parameters:
  • image – 8-bit, single-channel binary source image. The image may be modified by the function.
  • lines – Output vector of lines. Each line is represented by a two-element vector (\rho, \theta) . \rho is the distance from the coordinate origin (0,0) (top-left corner of the image). \theta is the line rotation angle in radians ( 0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line} ).
  • rho – Distance resolution of the accumulator in pixels.
  • theta – Angle resolution of the accumulator in radians.
  • threshold – Accumulator threshold parameter. Only those lines are returned that get enough votes ( >\texttt{threshold} ).
  • srn – For the multi-scale Hough transform, it is a divisor for the distance resolution rho . The coarse accumulator distance resolution is rho and the accurate accumulator resolution is rho/srn . If both srn=0 andstn=0 , the classical Hough transform is used. Otherwise, both these parameters should be positive.
  • stn – For the multi-scale Hough transform, it is a divisor for the distance resolution theta.
  • method –
    One of the following Hough transform variants:
    • CV_HOUGH_STANDARD classical or standard Hough transform. Every line is represented by two floating-point numbers (\rho, \theta) , where \rho is a distance between (0,0) point and the line, and \theta is the angle between x-axis and the normal to the line. Thus, the matrix must be (the created sequence will be) of CV_32FC2 type
    • CV_HOUGH_PROBABILISTIC probabilistic Hough transform (more efficient in case if the picture contains a few long linear segments). It returns line segments rather than the whole line. Each segment is represented by starting and ending points, and the matrix must be (the created sequence will be) of the CV_32SC4 type.
    • CV_HOUGH_MULTI_SCALE multi-scale variant of the classical Hough transform. The lines are encoded the same way asCV_HOUGH_STANDARD.
  • param1 –
    First method-dependent parameter:
    • For the classical Hough transform, it is not used (0).
    • For the probabilistic Hough transform, it is the minimum line length.
    • For the multi-scale Hough transform, it is srn.
  • param2 –
    Second method-dependent parameter:
    • For the classical Hough transform, it is not used (0).
    • For the probabilistic Hough transform, it is the maximum gap between line segments lying on the same line to treat them as a single line segment (that is, to join them).
    • For the multi-scale Hough transform, it is stn.
The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm for a good explanation of Hough transform. See also the example in HoughLinesP() description.

cvCanny


C: void cvCanny(const CvArr* image, CvArr* edges, double threshold1, double threshold2, int aperture_size=3 )
Parameters:
  • image – single-channel 8-bit input image.
  • edges – output edge map; it has the same size and type as image .
  • threshold1 – first threshold for the hysteresis procedure.
  • threshold2 – second threshold for the hysteresis procedure.
  • apertureSize – aperture size for the Sobel() operator.
  • L2gradient – a flag, indicating whether a more accurate L_2 norm=\sqrt{(dI/dx)^2 + (dI/dy)^2} should be used to calculate the image gradient magnitude ( L2gradient=true ), or whether the default L_1 norm=|dI/dx|+|dI/dy| is enough ( L2gradient=false ).