網頁

2014年10月2日 星期四

網頁升級

replaceNode -> replaceChild

removeNode -> removeChild

event.srcElement -> event.target

<bgSound>還可以在 IE 上運作,Chrome 則要用 <audio>

iframe.style.pixelWidth -> iframe.style.width

<center> -> <div style="text-align:center;"> 和 <table style="margin:auto;">

document.all.name -> document.getElementsByName('name')[0]

if (event.keyCode == 13) {
  event.keyCode = 9; // 失效了
}
直接尋找下一個元件 focus()

table 內會自動加入無效的 space & enter

Grid.jsFixHeader // 失效了
不要在 TR 內設 style.position = "relative"
改在每個 TH 內設定, style.top 也是如此

showModalDialog() // 失效了

rtMethod.value = "parent.window.jsMethodRt";



2014年9月29日 星期一

微軟的網頁 Behaviors 和 HTC檔,已經被淘汰了

慘慘慘...

Eclipse 搬家

因為 Omondo 之 EclipseUML 不能在 Eclipse 4.4 中執行
直接搬舊的版本到新電腦

1.按 Menu/Window/Preferences
2.選 Server/Runtime Environments
3.選擇 Apache Tomcat v6.0
4.按 Edit...
5.按 Browse...
6.重新選擇 Tomcat installation directory

1.按 Menu/Project/Properties
2.選 Java Build Path
3.選 Libraries 頁簽
4.移除 Apache Tomcat v6.0, 並重新安裝
5.移除 JRE System Library, 並重新安裝

執行時出現 "The archive: C:/Program Files/Apache Software Foundation/Tomcat 6.0/bin/bootstrap.jar..." 錯誤
1.按 Menu/Run/Run Configurations...
2.選 Apache Tomcat/Tomcat v6.0 Server at localhost
3.選 Classpath
4.刪除 User Entries 之錯誤的 bootstrap.jar

執行時出現 "Could not load the Tomcat server configuration..." 錯誤
按 Detail 顯示 "resource is out of sync with the filesystem"
1.按 Menu/Window/Preferences
2.選 General/Workspace
3.勾選 Refresh automatically
4.按 OK
5.重新取消勾選 Refresh automatically

網址:
http://localhost:8080/DigiChance/LightLog/index.html
http://localhost:8080/Kennel/ym/util/Program.xml

因為要與 64bits Java 共存
新增 exlipse.bat, 指定 32bits Java 所在
PATH=C:\Program Files (x86)\Java\jre7\bin;%PATH%
start c:\eclipse3_32\eclipse.exe


2014年9月25日 星期四

MySQL 的替代者 MariaDB

MySQL 有閉源的風險,用 MariaDB 取代

安裝時在 Custom Setup 時可以設定資料庫位置
MariaDB Server/Database instance

執行 HeidiSQL
按 Menu/文件/加載SQL文件
選擇 sql 檔 和 UTF-8編碼

Linux 下搬移資料位置
1.Stop MariaDB using the following command:
 service mariadb stop
2.Copy the existing data directory using the following command:
 sudo cp -R -p /oldpath /newpath
3.edit the MariaDB configuration file /etc/my.cnf.d/server.cnf(my.ini)
4.Restart MariaDB with the command:
 service mariadb start


使用命令安裝,指定資料位置
msiexec /i path-to-package.msi [PROPERTY_1=VALUE_1 ... PROPERTY_N=VALUE_N] /qn
INSTALLDIR:%ProgramFiles%\MariaDB<version>\
DATADIR:INSTALLDIR\data

2014年9月24日 星期三

Export apk from Eclipse

1.在專案上按右鍵 > Android Tools > Export Signed Application Package...
2.預設專案名稱,不要動
3.選擇 Create new keystore(因為之前尚未建立)
4.記住 password,等一下要用
5.輸入 Alias, Password, Validity(使用年限), First and Last Name 等
6.選擇apk的位置

JSP in Eclipse

1.進 Eclipse
2.選擇 Help/Install New Software
3.選擇Indigo - http://download.eclipse.org/release/indigo
4.勾選 Pending...
5.勾選 Web, XML, Java EE and OSGi Enterprise Develepment
6.安裝 Tomcat
7.再進Eclipse
8.選擇 Windows/Preference
9.選擇 Server/Runtime Environments
10.選擇 Add...
11.選擇 Tomcat 版本
12.填入 Tomcat 安裝路徑
13.按 Finish


2014年9月23日 星期二

Android in Eclipse

1.下載並安裝 Java SE 7
2.至 http://developer.android.com/sdk 下載 SDK Tools Only 並解壓縮
3.下載並安裝 Eclipse Standard 4.4, 使用 zip
4.執行 eclipse
5.按功能表 Help/Install New Software
6.按 Add, Name 輸入 ADT Plugin, Location 輸入 http://dl-ssl.google.com/android/eclipse
7.勾選 Developer Tools, 按 Next
8.選擇 I accept the terms of the license agreements, 按 Finish
9.按 OK, 再按 Yes, 重新啟動 Eclipse
10.重新啟動 Eclipse 後按 Open Preferences, 再按 Proceed
11.按 Browse 選擇步驟2的解壓縮目錄
12.按OK, 按Close, 按Close
13.按Cancel
14.按功能表 Window/Android SDK Manager
15.安裝所需的 Packages
16.按功能表 Window/Android Virtual Device Manager
17.按 New 建立 Android 模擬裝置

以上參考 準備 Android 開發環境

設定環境變數 ANDROID_SDK_HOME=D:\Users\mark
改變 Android Virtual Device Manager 位置