星期一, 六月 25, 2007

如何解决Firefox内存泄漏

1. Open Firefox and go to the Address Bar. Type in about:config and then
press Enter.
2. Right Click in the page and select New -> Boolean.
3. In the box that pops up enter config.trim_on_minimize. Press Enter.
4. Now select True and then press Enter.
5. Restart Firefox.

星期三, 六月 13, 2007

在Eclipse里设置Carrot2

1. Check out Carrot2 source code from the SVN repository:
   svn co https://svn.sourceforge.net/svnroot/carrot2/trunk carrot2

2. Import all Carrot22 projects into your workspace:
   1)From the Package Explorer's context menu choose Import...
   2)In the first step of the Import wizard, choose General -> Existing projects into Workspace and click Next.
   3)In the next step of the wizard, in the Select root directory field provide the path to your local Carrot2 checkout and click Finish.

3. The Eclipse compile process will fail because of undefined classpath variables: ANT_HOME and CARROT2_CHECKOUT_BASE. To define these variables open the Preferences window (Window -> Preferences...) and then go to (Java -> Build Path -> Classpath variables). Make the ANT_HOME variable point to your local Ant installation and CARROT2_CHECKOUT_BASE to your local Carrot2 repository checkout.

4. Clean all projects (Project -> Clean...) and let Eclipse compile everything again, this time without errors.

5. Run Carrot2 browser using the Run... toolbar icon (Eclipse should have automatically created the appropriate launch entry during project import).

星期日, 六月 10, 2007

Lucene语句

TermQuery可以用"field:key"方式,例如"content:lucene"。
BooleanQuery中'与'用'+','或'用' ',例如"content:java contenterl"。
WildcardQuery仍然用'?'和'*',例如"content:use*"。
PhraseQuery用'~',例如"content:\"中日\"~5"。
PrefixQuery用'*',例如"中*"。
FuzzyQuery用'~',例如"content: wuzza ~"。
RangeQuery用'[]'或'{}',前者表示闭区间,后者表示开区间,例如"time:
[20060101 TO 20060130]",注意TO区分大小写。

你可以任意组合query string,完成复杂操作:
例如"标题或正文包括lucene,并且时间在20060101到20060130之间的文章"可以表
示为:"+ (title:lucene content:lucene) +time:[20060101 TO 20060130]"。

星期二, 六月 05, 2007

CCI线买入法

在股票软件中,用CCI指标,当CCI中的CCI线下穿到-100线下,越低越好。均线设
置30日;60日;120日;250日这几条均线,当哪一天,看到CCI线在-100线下从向
下走开始调头向上,而且K线下跌到这几条均线附近,第二天马上买入,不出几
天,该股就会上涨,非常准确。