2011年7月22日 星期五

轉換程式碼為HTML

備忘一下~線上程式碼語法高亮產生器 - Online syntax highlighting
http://jsgears.com/thread-120-1-1.html

還有另一個網站也有
http://tohtml.com/java/

2011年7月6日 星期三

Play Framework 實驗筆記 5- 上傳到GAE

專案在本地端測試完成之後,接下來就把專案部署到GAE裡面去吧~

1. 先修改 N:\PlayFramework\play-1.1\members\war\WEB-INF\appengine-web.xml
將GAE設定的Application ID 和版本號填入
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
	<application>arthur201104</application>
	<version>1</version>
</appengine-web-app>

再將專案匯出成WAR目錄架構
N:\PlayFramework\play-1.1>play war members -o members.war

~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.1, http://www.playframework.org
~
00:44:41,359 INFO  ~ Starting N:\PlayFramework\play-1.1\members
00:44:41,390 INFO  ~ Module siena is available (N:\PlayFramework\play-1.1\module
s\siena-1.5)
00:44:41,390 INFO  ~ Module gae is available (N:\PlayFramework\play-1.1\modules\
gae-1.4)
00:44:42,187 WARN  ~
00:44:42,187 WARN  ~ Google App Engine module
00:44:42,187 WARN  ~ ~~~~~~~~~~~~~~~~~~~~~~~
00:44:42,203 WARN  ~ No Google App Engine environment found. Setting up a develo
pment environement
00:44:42,218 WARN  ~ Don't forget to define your GAE application id in the 'war/
WEB-INF/appengine-web.xml' file
00:44:42,218 WARN  ~
00:44:42,218 INFO  ~ Precompiling ...
00:44:48,218 INFO  ~ Done.

~ Packaging current version of the framework and the application to N:\PlayFrame
work\play-1.1\members.war ...
~ Done !
~
~ You can now load N:\PlayFramework\play-1.1\members.war as a standard WAR into
your servlet container
~ You can't use play standard commands to run/stop/debug the WAR application...
~ ... just use your servlet container commands instead
~
~ Have fun!
~


最後上傳至GAE,第一次上傳過程中需要輸入Google的帳號和密碼...
M:\appengine-java-sdk-1.4.3\bin>appcfg update N:\PlayFramework\play-1.1\members.
war
Reading application configuration data...
2011/7/6 上午 12:59:14 com.google.apphosting.utils.config.AppEngineWebXmlReader
readAppEngineWebXml
資訊: Successfully processed N:/PlayFramework/play-1.1/members.war\WEB-INF/appen
gine-web.xml
2011/7/6 上午 12:59:14 com.google.apphosting.utils.config.AbstractConfigXmlReade
r readConfigXml
資訊: Successfully processed N:/PlayFramework/play-1.1/members.war\WEB-INF/web.x
ml
2011/7/6 上午 12:59:14 com.google.apphosting.utils.config.IndexesXmlReader readC
onfigXml
資訊: Successfully processed N:\PlayFramework\play-1.1\members.war\WEB-INF\appen
gine-generated\datastore-indexes-auto.xml
Beginning server interaction for arthur201104...
0% Creating staging directory
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Scanned 250 files.
28% Initiating update.
31% Cloning 252 application files.
33% Cloned 100 files.
34% Cloned 200 files.
40% Uploading 70 files.
52% Uploaded 17 files.
61% Uploaded 34 files.
68% Uploaded 51 files.
73% Uploaded 68 files.
77% Initializing precompilation...
90% Deploying new version.
95% Will check again in 1 seconds.
98% Will check again in 2 seconds.
99% Will check again in 4 seconds.
99% Closing update: new version is ready to start serving.
99% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...

M:\appengine-java-sdk-1.4.3\bin>


完成之後連到你在GAE設定的Application網址,就可以看見成果了~
http://arthur201104.appspot.com/basicmemberoperation/index


http://arthur201104.appspot.com/enhancememberoperation/index

2011年7月4日 星期一

離線讀取註冊檔內容

之前發生過Windows 作業系統異常,重裝之後發現有些軟體的設定不見了(ex. PUTTY)
主要的原因是因為那些設定存於系統註冊檔裡面。所以找了一些方法將資訊挖出來...

我用的是 MiTeC Windows Registry File Viewer 可以將註冊表資訊由檔案中擷取出來。

Putty 的資訊是放在 HKEY_CURRENT_USER\Software\SimonTatham 下面,所以只要開啟 C:\Documents and Settings\UserName\NTUSER.DAT 就可以讀取設定。

至於註冊表資訊放在哪個實體檔案中,可以參閱下面連結:

資訊來源:介绍两款读注册表文件的软件