2011年10月12日 星期三

swf 檔案的修改器(SWiX)

萬一 flash 做出來的 swf 裡有內容(圖片或Action Script)要修改怎麼辦?
可以先安裝 SWiX 來幫忙. URL:http://www.swixkit.com/

假設 action script 裡有一個常數的內容是 index02.html 要修改成 index03.html



修改後, 請存成 swix 的格式, 然後再轉存成 swf 格式, 為什麼要醬子做? 經我測試, 只有醬子才能正確修改到swf 的檔案...



如果, 是要修改 frame 裡的圖片, 可以使用 swfmodify, URL: http://www.swfmodify.com/

2011年10月11日 星期二

css 在 IE 與 chrome 相衝突的寫法

假設, 您有一個 CSS 的設定如下, 在 chrome 的世界裡可以正常顯示:



但, 上面的寫法, 用 IE 來執行卻會跑版, 把該屬性刪掉, 在IE 即可正常顯示:




為了讓2個瀏覽器都ok, 改寫成下面醬子, 就都ok了:



.className {
font-size:12px; \*這一行所有瀏覽器都看得懂,所以是給Firefox套用的*\
font-size:14px \9; \*這一行則是所有的ie都看得懂*\
[;font-size:16px;] \*這一行專門給Chrome跟Safari用,不過IE6跟7也看得懂喔*\
*font-size:18px; \*這一行給ie7*\
_font-size:20px; \*這一行給ie6*\
}
上面的設定中,壞掉的印表機提醒各位要注意到順序的問題,給Google Chrome跟Apple Safari使用的css hack一定要寫在ie8的設定後面,
若是沒有依照此種順序,將會造成後續ie6與ie7的css hack設定無效


結論: 要重覆寫2次, 第2次加一個星號給他.

附註: 會衝的到原因超級多, 這個只是茫茫大海裡的一個小小的個案.

相關文章: [CSS Hack]解決IE6、IE7、IE8、Firefox的瀏覽器相容性問題!
http://sofree.cc/ie6-ie7-ie8-firefox-css-hack/

動態修改frameset cols 或 rows 大小的建議寫法

假設您有一個 frameset 的 tag 如下:



動態修改frameset cols 或 rows 大小的建議寫法如下:


綠色被註角的部份, 是不建議使用的舊寫法, 因為只相容於 IE 系列, chrome 不會跑...

2011年9月27日 星期二

舊系統裡的address 轉到新的5都的 SQL

舊系統裡的address 轉到新的5都的 SQL

使用SQL更換方法,將table改成你的table名稱及address改為你的欄位名稱
由於現在起“台”要換成“臺”,所以我們先將“台”換成“臺”。
update table set address = replace(address, '台', '臺');

update table set address = replace(address, '臺北縣', '新北市');
update table set address = replace(address, '臺中縣', '臺中市');
update table set address = replace(address, '臺南縣', '臺南市');
update table set address = replace(address, '高雄縣', '高雄市');


村改為「里」:
先檢查路名有沒有村字,以免掩蓋錯誤!排除過後,再進行更換。
select address from table where `address` like '%村%' and `address` like '%新北市%';
update table set address = replace(address, '村', '里') where `address` like '%村%' and `address` like '%新北市%';
select address from table where `address` like '%村%' and `address` like '%臺中市%';
update table set address = replace(address, '村', '里') where `address` like '%村%' and `address` like '%臺中市%';
select address from table where `address` like '%村%' and `address` like '%臺南市%';
update table set address = replace(address, '村', '里') where `address` like '%村%' and `address` like '%臺南市%';
select address from table where `address` like '%村%' and `address` like '%高雄市%';
update table set address = replace(address, '村', '里') where `address` like '%村%' and `address` like '%高雄市%';


臺北縣:
update table set address = replace(address, '萬里鄉', '萬里區');
update table set address = replace(address, '金山鄉', '金山區');
update table set address = replace(address, '板橋市', '板橋區');
update table set address = replace(address, '汐止市', '汐止區');
update table set address = replace(address, '深坑鄉', '深坑區');
update table set address = replace(address, '石碇鄉', '石碇區');
update table set address = replace(address, '瑞芳鎮', '瑞芳區');
update table set address = replace(address, '平溪鄉', '平溪區');
update table set address = replace(address, '雙溪鄉', '雙溪區');
update table set address = replace(address, '貢寮鄉', '貢寮區');
update table set address = replace(address, '新店市', '新店區');
update table set address = replace(address, '坪林鄉', '坪林區');
update table set address = replace(address, '烏來鄉', '烏來區');
update table set address = replace(address, '永和市', '永和區');
update table set address = replace(address, '中和市', '中和區');
update table set address = replace(address, '土城市', '土城區');
update table set address = replace(address, '三峽鎮', '三峽區');
update table set address = replace(address, '樹林市', '樹林區');
update table set address = replace(address, '鶯歌鎮', '鶯歌區');
update table set address = replace(address, '三重市', '三重區');
update table set address = replace(address, '新莊市', '新莊區');
update table set address = replace(address, '泰山鄉', '泰山區');
update table set address = replace(address, '林口鄉', '林口區');
update table set address = replace(address, '蘆洲市', '蘆洲區');
update table set address = replace(address, '五股鄉', '五股區');
update table set address = replace(address, '八里鄉', '八里區');
update table set address = replace(address, '淡水鎮', '淡水區');
update table set address = replace(address, '三芝鄉', '三芝區');
update table set address = replace(address, '石門鄉', '石門區');


臺中縣:
update table set address = replace(address, '太平市', '太平區');
update table set address = replace(address, '大里市', '大里區');
update table set address = replace(address, '霧峰鄉', '霧峰區');
update table set address = replace(address, '烏日鄉', '烏日區');
update table set address = replace(address, '豐原市', '豐原區');
update table set address = replace(address, '后里鄉', '后里區');
update table set address = replace(address, '石岡鄉', '石岡區');
update table set address = replace(address, '東勢鎮', '東勢區');
update table set address = replace(address, '和平鄉', '和平區');
update table set address = replace(address, '新社鄉', '新社區');
update table set address = replace(address, '潭子鄉', '潭子區');
update table set address = replace(address, '大雅鄉', '大雅區');
update table set address = replace(address, '神岡鄉', '神岡區');
update table set address = replace(address, '大肚鄉', '大肚區');
update table set address = replace(address, '沙鹿鎮', '沙鹿區');
update table set address = replace(address, '龍井鄉', '龍井區');
update table set address = replace(address, '梧棲鎮', '梧棲區');
update table set address = replace(address, '清水鎮', '清水區');
update table set address = replace(address, '大甲鎮', '大甲區');
update table set address = replace(address, '外埔鄉', '外埔區');
update table set address = replace(address, '大安鄉', '大安區');


臺南縣:
update table set address = replace(address, '永康市', '永康區');
update table set address = replace(address, '歸仁鄉', '歸仁區');
update table set address = replace(address, '新化鎮', '新化區');
update table set address = replace(address, '左鎮鄉', '左鎮區');
update table set address = replace(address, '玉井鄉', '玉井區');
update table set address = replace(address, '楠西鄉', '楠西區');
update table set address = replace(address, '南化鄉', '南化區');
update table set address = replace(address, '仁德鄉', '仁德區');
update table set address = replace(address, '關廟鄉', '關廟區');
update table set address = replace(address, '龍崎鄉', '龍崎區');
update table set address = replace(address, '官田鄉', '官田區');
update table set address = replace(address, '麻豆鎮', '麻豆區');
update table set address = replace(address, '佳里鎮', '佳里區');
update table set address = replace(address, '西港鄉', '西港區');
update table set address = replace(address, '七股鄉', '七股區');
update table set address = replace(address, '將軍鄉', '將軍區');
update table set address = replace(address, '學甲鎮', '學甲區');
update table set address = replace(address, '北門鄉', '北門區');
update table set address = replace(address, '新營市', '新營區');
update table set address = replace(address, '後壁鄉', '後壁區');
update table set address = replace(address, '白河鎮', '白河區');
update table set address = replace(address, '東山鄉', '東山區');
update table set address = replace(address, '六甲鄉', '六甲區');
update table set address = replace(address, '下營鄉', '下營區');
update table set address = replace(address, '柳營鄉', '柳營區');
update table set address = replace(address, '鹽水鎮', '鹽水區');
update table set address = replace(address, '善化鎮', '善化區');
update table set address = replace(address, '大內鄉', '大內區');
update table set address = replace(address, '山上鄉', '山上區');
update table set address = replace(address, '新市鄉', '新市區');
update table set address = replace(address, '安定鄉', '安定區');


高雄縣:
update table set address = replace(address, '仁武鄉', '仁武區');
update table set address = replace(address, '大社鄉', '大社區');
update table set address = replace(address, '岡山鎮', '岡山區');
update table set address = replace(address, '路竹鄉', '路竹區');
update table set address = replace(address, '阿蓮鄉', '阿蓮區');
update table set address = replace(address, '田寮鄉', '田寮區');
update table set address = replace(address, '燕巢鄉', '燕巢區');
update table set address = replace(address, '橋頭鄉', '橋頭區');
update table set address = replace(address, '梓官鄉', '梓官區');
update table set address = replace(address, '彌陀鄉', '彌陀區');
update table set address = replace(address, '永安鄉', '永安區');
update table set address = replace(address, '湖內鄉', '湖內區');
update table set address = replace(address, '鳳山市', '鳳山區');
update table set address = replace(address, '大寮鄉', '大寮區');
update table set address = replace(address, '林園鄉', '林園區');
update table set address = replace(address, '鳥松鄉', '鳥松區');
update table set address = replace(address, '大樹鄉', '大樹區');
update table set address = replace(address, '旗山鎮', '旗山區');
update table set address = replace(address, '美濃鎮', '美濃區');
update table set address = replace(address, '六龜鄉', '六龜區');
update table set address = replace(address, '內門鄉', '內門區');
update table set address = replace(address, '杉林鄉', '杉林區');
update table set address = replace(address, '甲仙鄉', '甲仙區');
update table set address = replace(address, '桃源鄉', '桃源區');
update table set address = replace(address, '茂林鄉', '茂林區');
update table set address = replace(address, '茄萣鄉', '茄萣區');
update table set address = replace(address, '那瑪夏鄉', '那瑪夏區');


資料來源: http://www.aoron.com/%E6%96%B0%E4%BA%94%E9%83%BD%E5%9C%B0%E5%9D%80%E5%90%8D%E7%A8%B1%E6%9B%B4%E6%8F%9B%E5%88%97%E8%A1%A8.php

2011年9月26日 星期一

CDONTS.NewMail 改寫成 CDO.Message 的建議寫法

CDONTS.NewMail 改寫成 CDO.Message 的建議寫法:
把舊的 Send_Email副程式改寫成 Object, 透過 Object 讀取 SMTP 相關設定來寄信.

建議增加 ContentType 屬性到 Attachment Tag 中

建議增加 ContentType 屬性到 Attachment Tag 中, 方便 xsl 進行套版的判斷.




我寫了一個小小小的副程式, 依檔名來傳回 MIME Type.

2011年9月19日 星期一

備份M$ SQL Server 的database 請使用 back/restore, 不要直接copy mdf 檔案

備份M$ SQL Server 的database 請使用 back/restore, 不要直接copy mdf 檔案, 不然就會有版本的問題, 如下圖所示:




檢查目前正在使用的 Database 的版本的 SQL:
select DATABASEPROPERTYEX('master','Version')


我執行出來的結果:

(說明: 版本是 611)


常見的情況:程式設計師的開發環境,安裝的是 SQL Server 2008 R2 express 版本,但是客戶端伺服器機器是:SQL Server 2008 版本。

聽說: 在新版本 SQL Server 2008 R2 上的資料庫,是沒辦法直接使用附加、還原的方式,將資料庫搬移到舊版本的 SQL Server 2008上。

Facebook 留言板