
2010年10月10日
最近有customer說收不到我們系統發的email,查了一段時間,總算有所收獲,對SMTP也有了些許了解。
一開始以為是我們郵件服務器IP被blacklist了或對方把我們的IP給禁了。于是就試了下用telnet SMTP測試下:
telnet #customer.domain.com# 25
EHCO sdfa
MAIL FROM: <
from@xxx.com>
RCPT TO: <
to@xxxxxx.com>
DATA
.
QUIT
結果測試我們是可以telnet到對方的SMTP server的,這樣發是可以發送成功的,即排除了對方把我們禁了的可能。可如果telnet到我們自己的SMTP server的話,就失敗了。
telnet #own.domain.com# 25
...
后來查了很久,原來是因為timeout的原因:我們用的IMSS gateway有timeout機制。查Log發現,連接對方SMTP SERVER無問題,MAIL FROM command也無問題,可就在RCPT TO 這個command超時了,超過30s都沒有response從對方SMTP SERVER回來,估計對方的SMTP SERVER不怎么好,parse和查找個email address (end user:
to@xxxx.com)都要花很長時間。后來我們就timeout的參數,從30s調到60s,果然就可以了,估計對方SMTP server之行RCPT TO這個命令都花了30-40s。
問題解決
posted @
2011-12-30 00:24 li40204 閱讀(190) |
評論 (0) |
編輯 收藏
Ubuntu vi 默認不支持鍵盤的方向鍵和Backspace鍵,很不方便,可以修改/etc/vim下面動vimrc.tiny,使其支持。
vi /etc/vim/vimrc.tiny
set compatible -> change to
set nocompatible
And add
set backspace=2
posted @
2011-04-20 00:06 li40204 閱讀(348) |
評論 (1) |
編輯 收藏
1. Always keep data private.
2. Always initialize data.
3. Don't use too many basic types in a class.
4. Not all fields need individual field accessors and mutators.
5. Use a standard form for class definitions.
6. Break up classes with too many responsibilities.
7. Make the names of your classes and methods reflect their responsibilities.
posted @
2010-12-10 13:41 li40204 閱讀(172) |
評論 (0) |
編輯 收藏
不知不覺又停了N天學習,看來堅持對偶來說真是難于登天啊。。。
The javac compiler always looks for files in the current directory, but the java interpreter only looks into the current directory if the "." directory is on the class path. If you have no class path set, this is not a problem—the default class path consists of the "." directory. But if you have set the class path and forgot to include the "." directory, then your programs will compile without error, but they won't run.
Features tagged as public can be used by any class. Private features can be used only by the class that defines them. If you don't specify either public or private, then the feature (that is, the class, method, or variable) can be accessed by all methods in the same package.
Comment Extraction
Here, docDirectory is the name of the directory where you want the HTML files to go. Follow these steps:
1.
|
Change to the directory that contains the source files you want to document. If you have nested packages to document, such as com.horstmann.corejava, you must be working in the directory that contains the subdirectory com. (This is the directory that contains the overview.html file if you supplied one.)
|
2.
|
Run the command
javadoc -d docDirectory nameOfPackage
for a single package. Or run
javadoc -d docDirectory nameOfPackage1 nameOfPackage2...
to document multiple packages. If your files are in the default package, then instead run
javadoc -d docDirectory *.java
|
posted @
2010-12-10 12:00 li40204 閱讀(162) |
評論 (0) |
編輯 收藏
用System.out.printf方法進行格式化輸出;也可用String.format方法創建一個格式化的String, 而不需要打印輸出。
日期格式設置參考Core Java, Volumn 1的P55頁,許多格式化規則與本地環境有關。
java.util.Arrays類包含了用來操作數組(例如排序與搜索)的各種方法,常用方法如下:
static String toString(type[] a)
static void sort(type[] a) //Quick Sort
static int binarySearcch(type[] a, type v)
static void fill(type[] a, type v) //將數組的所有數據元素值設為v
....
End of Chapter 3
posted @
2010-10-10 18:10 li40204 閱讀(166) |
評論 (0) |
編輯 收藏