2014年2月26日
2014年1月14日
開發注意事項
Log裡面個資是否為明碼
text Log => Web、AP Server => 都應該依子系統(大分類)分資料夾
找回 密碼 http://my.oschina.net/zhengyun/blog/192693
(管) 確認每個功能會用到的 API 當 API有修改時,通知所有會用到的功能的負責工程師
難字 post AllowHtml
text Log => Web、AP Server => 都應該依子系統(大分類)分資料夾
找回 密碼 http://my.oschina.net/zhengyun/blog/192693
(管) 確認每個功能會用到的 API 當 API有修改時,通知所有會用到的功能的負責工程師
難字 post AllowHtml
2014年1月9日
null.Equals(string) v.s. string.Equals(null)
errorMessage.Equals("系統錯誤")
比較好的方式:
"系統錯誤".Equals(errorMessage)
可以預防 errorMessage為 null時出 exception
看到問題了 以後怎麼預防
Terry Chien
看到遠通 web server被駭
mail詢問怎麼預防
Jonathon
通行費 errorMessage null
佈版流程
以後怎麼預防
Jerry: check-in > 上 uat > user 測試 > 上 prod
緊急佈版 要先跟 user講沒有測
2014年1月8日
讀取檔案 中文字處理
最近在處理文字檔的時候 遇到比對每一行的長度時 如果該行中有中文字存在 長度取得就會出錯
用 Substring取字串時也會取錯位子
需要在讀檔時指定用 BIG5編碼
處理字串的時候要加用 GetBytes().ToString
用 Substring取字串時也會取錯位子
需要在讀檔時指定用 BIG5編碼
處理字串的時候要加用 GetBytes().ToString
File.ReadAllLines(filePath, Encoding.GetEncoding("BIG5"))
...
...
...
byte[] sContentByte = Encoding.Default.GetBytes(line);
string tmp = Encoding.Default.GetString(sContentByte, 11, 22)
2013年10月8日
jqGrid 展開 subGrid by other columns
ondblClickRow: function (rowid, iRow, iCol, e) {
alert("rowid: " + rowid + ", iRow: " + iRow + ", iCol: " + iCol);
if (iCol == 2) {
$(this).jqGrid("toggleSubGridRow", rowid);
}
},
onCellSelect: function (rowid, iCol, cellcontent, e) {
alert("rowid: " + rowid + ", iCol: " + iCol + ", cellcontent" + cellcontent);
if (iCol == 2) {
$(this).jqGrid("toggleSubGridRow", rowid);
}
},
2013年9月13日
WebService Test soapUI
http://sourceforge.net/projects/soapui/files/
host/WebService.asmx?WSDL
<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:body>
<etagservice xmlns="http://tempuri.org/">
<strtx>
xml string
</strtx>
</etagservice>
</soap:body>
</soap:envelope>
host/WebService.asmx?WSDL
<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:body>
<etagservice xmlns="http://tempuri.org/">
<strtx>
xml string
</strtx>
</etagservice>
</soap:body>
</soap:envelope>
2013年8月14日
執行錯誤的選擇
時程不會因為你下了錯誤的決定並執行而往後延
除了這次補救回來
以後必須避免錯誤的判斷
如同昨天在測試 css設定是否只在 IE7會有問題
堅持使用自己修改瀏覽器模式的 IE7去找問題
後來請他人開 VM用 IE7測就沒問題
等於做白工 ...
2013年8月13日
jQuery v.s. IE9 相同性
IE預設在 intranet的時候會使用 Document mode =IE 7的相容性
這樣會造成許多不可預期的 js錯誤
目前CSS使用的解法是在 master page head的部份加上以下 meta data使得他強迫使用ie10的文件模式(實測ie9也是ok)
<meta http-equiv="Content-Type;" content="IE=10" />
如果本來就有資料的話可以用分號加上IE=10即可
這樣會造成許多不可預期的 js錯誤
目前CSS使用的解法是在 master page head的部份加上以下 meta data使得他強迫使用ie10的文件模式(實測ie9也是ok)
<meta http-equiv="Content-Type;" content="IE=10" />
如果本來就有資料的話可以用分號加上IE=10即可
jqGrid 換頁後, formatter失效
http://stackoverflow.com/questions/3807623/jqgrid-paging-question
用 bind綁定 click事件
$("#list").setGridParam({page:1}).trigger('reloadGrid');
$("#list").trigger("reloadGrid", [{page:1}]);
$("#list").trigger("reloadGrid", [{current:true}]);
使用無效?用 bind綁定 click事件
$('td[id$=_pager]').click(function () {
$('.buttonDownload').bind('click', Download);
});
function downloadButton(cellvalue, options, rowObject) {
return "<input type='button' class='buttonDownload' value='列印' data-formTypeId='" +@Model.formTypeId +"' data-formNumber='" + cellvalue + "' />";
}
function Download() {
var formTypeId = $(this).attr('data-formTypeId');
var formNumber = $(this).attr('data-formNumber');
}
或 ...function downloadButton(cellvalue, options, rowObject) {
return "<input type='button' class='buttonDownload' onclick='javascript:Download(" + @Model.formTypeId + ", " + cellvalue + ");' value='列印' data-formTypeId='" +@Model.formTypeId +"' data-formNumber='" + cellvalue + "' />";
}
2013年7月3日
將 IIS Log匯入資料庫
- 下載 Log Parser 2.2
- script LogParser to Database
"C:\Program Files (x86)\Log Parser 2.2\LogParser.exe" "SELECT * INTO IISLogs FROM C:\inetpub\logs\LogFiles\W3SVC2145945211\u_ex*.log" -i:W3C -o:SQL -server:MORTIZ-HY -database:Logs -driver:"SQL Server" -username:moz -password:moz123 -createTable:ON
"C:\Program Files (x86)\Log Parser 2.2\LogParser.exe" "SELECT TO_LOCALTIME(TO_TIMESTAMP([date], [time])), [s-sitename], [s-computername], [s-ip], [cs-method], [cs-uri-stem], [cs-uri-query], [s-port], [cs-username], [c-ip], [cs-version], [cs(User-Agent)], [cs(Cookie)], [cs(Referer)], [cs-host], [sc-status], [sc-substatus], [sc-win32-status], [sc-bytes], [cs-bytes], [time-taken] INTO IISLogs FROM C:\inetpub\logs\LogFiles\W3SVC2145945211\u_ex130222.log " -o:SQL -server:MORTIZ-HY -database:Logs -driver:"SQL Server" -username:moz -password:moz123 -createTable:ON
"C:\Program Files (x86)\Log Parser 2.2\LogParser.exe" "SELECT * INTO IISLogs FROM C:\inetpub\logs\LogFiles\SelectedLogs\u_ex*.log" -i:W3C -o:SQL -server:210.65.10.173 -database:Logs -driver:"SQL Server" -username:sa -password:SQLpw1064MS -createTable:ON
- 清掉 IISLogs無用的 data
DELETE Logs.dbo.IISLogs WHERE csUriStem LIKE '%txt' OR csUriStem LIKE '%jpg' OR csUriStem LIKE '%png' OR csUriStem LIKE '%css' OR csUriStem LIKE '%js' OR csUriStem LIKE '%ico' OR csUriStem LIKE '%gif' OR csUriStem LIKE '/Scripts%' OR csUriStem LIKE '/TrendgoAdmin%' GO
- temp
2013年6月18日
SA文件的意外
在完成 TWM的檔案同步系統(考試系統 Phase II)的 SA文件時
寄信給客戶,結果是由客戶自行轉成 v1.0 且還有添加新的內容
我也沒仔細檢查
應該要這樣表達:確認沒有問題後,我會轉成 v1.0正式版
2013年6月4日
2013年5月14日
List for survey
Excel Utility (use Factory Method with EPPlus, ClosedXML)
Design Pattern
Event & Delegate
Enterprise Library
KnockoutJS
AngularJS
NodeJs
Entity Framework
Dojotoolkit.org
Cupoy
Icenium 雲端開發 App
Markdown
Octopress
OpenCart
NoSQL
Mango DB
Perl
LISP
Design Pattern
Event & Delegate
Enterprise Library
KnockoutJS
AngularJS
NodeJs
Entity Framework
Dojotoolkit.org
Cupoy
Icenium 雲端開發 App
Markdown
Octopress
OpenCart
Mango DB
Perl
LISP
2013年5月3日
修復計畫
- 程式怎麼改
資料怎麼補 - 取得同意
- 修改 & 補資料
ex:
全國意向
bug五月才修完
所以應該是要補四月的資料
把要補的帳號、登入記錄、使用記錄, 列給對方
詢問對方是否要採用
並告知對方補進去的資料可能會跟已經被下載的報表有誤差
取得同意後
再把資料補進去