2011年12月28日 星期三

Telerik Grid Item 的客制化文件

http://www.telerik.com/help/aspnet/grid/grdinsertingvaluesusercontrolformtemplate.html

2011年12月17日 星期六

生活哲學


好好活,慢慢拖,一年還有幾萬多;
不要攀,不要比,不要自己氣自己;
少吃鹽,多吃醋,少打麻將多散步;
按時睡,按時起,跑步跳舞健身體;
父是天,母是地,盡孝父母要牢記;
夫妻愛,子女孝,家和比啥都重要;
行點善,積點德,多做善事多積德;
只要能吃飯,錢就不會斷;
不怕賺錢少,就怕走得早;
官再大,錢再多,閻王照樣土裡拖;

2011年12月14日 星期三

利用 Trigger 來限制登錄 SQL Server


網路找到的文章

不從特定 IP 不准某帳號登入 SQL Server

CREATE TRIGGER [connection_limit_trigger]
ON ALL SERVER
WITH EXECUTE AS 'I7Administrator'
FOR LOGON
AS
BEGIN
IF ORIGINAL_LOGIN()= 'sa' AND
not exists  (SELECT * FROM sys.dm_exec_connections
            WHERE client_net_address = ’127.0.0.1′
            and session_id=@@SPID)
    ROLLBACK;
END;

–ENABLE TRIGGER [connection_limit_trigger] ON ALL SERVER

其中
ORIGINAL_LOGIN() -- 系統函數, 目前登錄的 帳號
sYS.DM_EXEC_CONNECTIONS -- 目前連線的動態表格
@@SPID -- 目前登錄的 Session ID

2011年12月13日 星期二

Web Performance Tips


Useful page from WE

While developing any web site, one should keep some points in mind.

1) Set debug=false under compilation as follows:
<compilation default Language="c#" debug="false">
2) Use Server.Transfer instead of Response.Redirect.
3) Always check Page.IsValid when using Validator Controls
4) Use Foreach loop instead of For loop for String Iteration.
5) Use Client-Side Validation. (but not all the time you have to validate even on the server side)
6) Check “Page.IsPostBack”. To avoid repetition code execution.
7) GIF and PNG are similar, but PNG typically produces a lower file size. (True, but some browsers not supporting PNG format)
8) Use the AppOffline.htm when updating binaries
9) Turn off Tracing unless until required. (by default it's off, use on the pages where it's required)
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
10) Precompiled pages and disable AutoEventWireup; setting the AutoEventWireup attribute to false in the Machine.config file.
11) Turn off Session State, if not required.
<sessionstate timeout="20" cookieless="false" mode="Off" stateconnectionstring="tcpip=127.0.0.1:42424" sqlconnectionstring="data source=127.0.0.1;Trusted_Connection=no">
12) Select the Release mode before making the final Build for your application.
This option is available in the Top Frame just under the Window Menu option. By default, the Mode is Debug
13) Disable ViewState when not required.
EnableViewState="false"
14) Avoid frequent round trips to the Database.
15) Use Caching to improve the performance of your application.
16) Validate all Input received from the Users.
17) Use Finally Method to kill resources. (But not in the case of using)
18) The String and Stringbuilder Magic.
It is nice to use Stringbuilder instead of String when string are Amended. Strings occupy different memory location in every time of amended where stringbuilder use single memory location
19) Never use object value directly; first get object value in local variable and then use. It takes more time then variable reading.
20) Avoid Exceptions: Use If condition (if it is check proper condition)
21) Code optimization:  Avoid using code like x = x +1; it is always better to use x+=1.
22) Data Access Techniques: DataReaders provide a fast and efficient method of data retrieval. DataReader is much faster than DataSets as far as performance is concerned
23) Before doing a bulky ASP code processing, you can check to make sure Response.IsClientConnected.
24) As always, avoid session variables because each ASP page runs in a different thread and session calls will be serialized one by one. So, this will slow down the application. Instead of session variables you can use the QueryString collection or hidden variables in the form which holds the values.
25) Enabling buffering will improve the performance, like
<% response.buffer=true %>
Then use:
<% response.flush=true %> 
26) Use Repeater control instead of DataGrid , DataList, Because It is efficient, customizable, and programmable.
27) Data listing is more time consume when large data are retrieve from database.
Paging will display only particular data but take load of all data.
Fetch only data that is needed for current page.
28) Avoid Inline JavaScript and CSS
29) Use single css file instead of multiple css file.
Try your best to combine all your CSS based classes into a single .css file as lot of .css files will cause a large amount of requests, regardless of the file sizes.
.css files are normally cached by browsers, so a single and heavy .css file doesn’t cause a long wait on each page request.
Inline .css classes could make HTML heavy, so again: go ahead with a single.css file.
30) Reduce cookie size
31) Compress CSS, JavaScript and Images
Online compressors are available; to compress file please refers following web and Replace your file content with optimize code.
32 .Use Cache appropriately
i. Page output caching:
<%@ OutputCache Duration="3600" VaryByParam="none" %>
ii. Page fragment caching:
Write a Page output caching code into each User Control
iii. Data caching:
<script language="C#" runat="server">
Protected void Page_Load (Object src, EventArgs e) {
DataView dv = (DataView) Cache. Get ("EmployeesDataView");
If (dv == null) { // wasn't thereSqlConnection conn =
new SqlConnection ("server=localhost;uid=sa;pwd=;database=Test");
SqlDataAdapter da =new SqlDataAdapter ("select * from Employees", conn);
Dataset ds = new DataSet();da.Fill(ds, "Employees");
dv = ds.Tables["Employees"].DefaultView;
Cache.Insert ("EmployeesDataView", dv);conn.Close();}
Else
Response.Write ("<h2>Loaded employees from data cache! </h2>");
lb1.DataSource = dv;
lb1.DataTextField = "Name";
lb1.DataValueField = "Age";
DataBind () ;}
</script>
33) Use server side compression software such as Port80shttp://www.port80software.com/products/httpzip/  
34) Usage of "using" and I don't know why it's not yet published.
35) Don't make the member variables public or proteted, try to keep private and use public/protected as properties.
36) Use strString=string.Empty instead of strString="" . [And perhaps instead of strString=null also (?)]
37) Make your page files as light as possible. That is try to avoid unnecessary markups, e.g. use div elements instead of tables.
38) Write static messages in div and make it visible when necessary. This is faster than letting server set Text property of your label or div.
39) Retrieve data from database at once, if possible. Don't add up to database trip as far as possible. For this, combine the datafields from different tables and select them.
40) Use short ID name for WebControl.

2011年11月29日 星期二

網路看到的, 目前社交的投資好像太少, 不知道未來的投資是啥.. 
其他都有投資..


無論你的收入是多少,記得分成五份進行規劃投資:


增加對身體的投資,讓身體始終好用;
增加對社交的投資,擴大你的人脈;
增加對學習的投資,加強你的自信;
增加對旅遊的投資,擴大你的見聞;
增加對未來的投資,增加你的收益。


好好規劃落實,你會發現你的人生逐步會有大量盈餘。

2011年11月19日 星期六

Google Chome Cache Setting

在桌面 Google 瀏覽器的捷徑按下右鍵選擇內容, 並且在目標 chrome.exe 空一格加入 --disk-cache-dir="T:\Cache\Google Chrome" --disk-cache-size=262144000 並套用到捷徑中, 重新啟動即可套用參數指定值


其中 
--disk-cache-dir 指向 Ramdisk 所在的位置
--disk-cache-size 為 cache size 單位為 byte

2011年11月5日 星期六

EnableViewState


所有靜態頁面(純粹顯示資料用的頁面,並且沒有submit按鈕),務必將整個Page的 EnableViewState 設定為 false,用以減少Page大小,以增加效能

2011年11月2日 星期三

需求分析常被 Review 的問題

. The write-up merely describes what is going on currently.
所提的需求僅是在描述現況
. It is not a requirements definition.
所提的需求不是真正的需求定義
. It only documents the current system, process, or business flow.
需求文件僅將現行的系統, 作業流程及企業流程描述出來
. It describes a process rather than requirements.
僅將流程作一描述, 而非需求
. We’d have to interpret and extract the requirements from the write-up.
從文件中無法萃取出需求
. It doesn’t describe the “should be.”
從文件中沒有看到 TO-BE/ Should Be 
. It doesn’t identify business objectives, expected benefits, or value.
從文件中沒有看到企業目標、預期效益、或是帶來新的價值
. It doesn’t describe a problem that needs to be addressed.
從文件中沒有看到要解決的問題
. It doesn’t say what’s good and bad now.
從文件中沒有看到現有的優缺點
. It doesn’t explain why we need to replace the order entry system.
無法說明為何要取代現有的系統
. It should suggest other, less manual, ways to do things more efficiently.
文件中應強調透過哪些方法, 技術可以提升系統效率
. The write-up is not clear and would lead to misinterpretation.
文件交待不清, 容易造成誤導
. It needs to be more detailed.
文件需要寫的更詳細一點
. It needs to be higher level and identify functions that are needed.
須要有高階一點的部份, 並說明哪些功能是需要的
. It’s not a requirements document in the format we use in our organization.
文件格式與公司規定不符合
. It doesn’t identify the budget, time frame, or available resources.
預算, 時程及相關資源都沒有提到
. The write-up does not describe whats.
內容沒有提到需求為何
. It does describe some hows that limit options.
沒有提到系統的限制條件
. It’s not clear how the customer information system fits in.
新的系統如何與需求關聯度不夠明確
. It doesn’t identify what software would be available for order entry.
沒有提到使用那種軟體可以把資料完成出來
. It doesn’t adequately describe a system to implement.
寫出來的東西是無法被實作出來
. The write-up needs to be sent back so it can be redone better.
這份需求文件看來還是重寫吧!

2011年10月11日 星期二

社會哲學


01、人生最重要的不是努力,不是奮鬥,而是抉擇。
02、老闆只能給一個位置,不能給一個未來。舞臺再大,人走茶涼。
03、意外和明天不知道哪個先來。沒有危機是最大的危機,滿足現狀是最大的陷阱。
04、所見所聞改變一生,不知不覺斷送一生。
05、生意,可以掌控努力與投資,卻無法掌控結果。人生得意時找出路,失意時才有退路,寶馬都有備胎,您的人生呢?
06、世界上有多少有才華的失敗者,世界上有很多高學歷的無業遊民是因為選擇錯誤。
07、下對注,贏一次;跟對人,贏一世。
08、學識不如知識,知識不如做事,做事不如做人。
09、不識貨,半世苦;不識人,一世苦。
10、生命不在於活得長與短,而在於頓悟的早與晚。
11、做人處事,待人接物:重師者王,重友者霸,重己者亡。
12、沒有目標的人永遠為有目標的人去努力。
13、人生三階段:比才華;比財力;比境界。
14、人若把自己框在一定的範圍內,就容易限制了自己的思維和格局。
15、今天的優勢會被明天的趨勢代替,把握趨勢,把握未來。
16、讀萬卷書不如行千里路,行千里路不如閱人無數,閱人無數不如名師指路。經師易得,人師難求。
17、學歷代表過去,財力代表現在,學習力代表將來。
18、人生能走多遠,看與誰同行;有多大成就,看有誰指點。
19、聰明的人看得懂,精明的人看得准,高明的人看得遠。
20、做人不成功,成功是暫時的;做人成功,不成功也是暫時的。

讀20年書,不如讀懂這些話

網路看到的, 特別記下來

1、蜘蛛:能坐享其成,靠的就是那張關係網
2、蝦:大紅之日,便是大悲之時。
3、天平:誰多給一點,就偏向誰。
4、瀑布:因居高臨下,才口若懸河。
5、鋸子:伶牙俐齒,專做離間行為。
6、氣球:只要被人一吹,便飄飄然了。
7、鐘錶:可以回到起點,卻已不是昨天。
8、核桃:沒有華麗的外表,卻有充實的大腦。
9、指南針:思想穩定,東西再好也不被誘惑。
10、花瓶:外表再漂亮,也掩不住內心的空虛。
11、樹葉:得勢時趾高氣揚,失意時威風掃地。
12、歷史的標點全是問號,歷史的幕後全是驚嘆號!
13、年輕人以為教育可以取代經驗,年長者以為經驗可以取代教育。
14、飯桌上批孩子,大人傷神,孩子傷胃,全家傷心
15、父母想念子女就像流水一樣,一直在流;
  而子女想念父母就像風吹樹葉,風吹一下,就動一下,風不吹,就不動。
16、夫妻倆過日子要像一雙筷子:
  一是誰也離不開誰; 二是什麼酸甜苦辣都能一起嘗。
17、揮不去的是記憶,留不住的是年華,
18、因為電話,信箋少了;
   因為時尚,布料少了;
       因為空調,汗水少了;
       因為應酬,親情少了;
   因為宴會,食欲少了;
       因為競爭,悠閒少了......

2011年9月25日 星期日

魔鬼在細節

今天的標案又給我上了一堂課
明知道 H/W 的規格 RFP 沒有提
但是就是沒有寫進建議書
明知道環保專案登錄沒有寫的清楚
但是在投影片中還是沒有交待進去
好像在考驗評審讀 Proposal 的功力
其實
自己對這種疏忽就是放過去
表示時間真的不夠
或許是準備功夫還是不夠到家

像上次的專案中
站位站牌傻傻搞不清
也在過程中被評審抓到弱點
這是讀 Proposal 不細

下次再遇到
一定要提醒自己
(1) 主題沒有徹底破題, 像這次的環保專案登錄
(2) 題目有沒有看不懂的, 像站位站牌
(3) Solution 要完整的搭配, 像 H/W (Spec), S/W (Spec), Architecute 就是要交待清楚
(4) 驗收依據的章節是如何完成
(5) 確定有沒有 Domain 關係是否影響專案的 awarding, 例如沒有林農的背景卻要去做實驗林地的 GIS Project
(6) 回答評審答案還是一個一個按步就班的回答 (像刑事警察局的專案/ 實驗林地的專案答的 2266也許是緊張)
(7) Demo 會是一個加分效果,也許 CAM 的效果會是個 plus
魔鬼就在細節處...


Cheat sheet

Cheat Sheet 表面翻譯為小抄
但是在電腦用語方面則比較多見為"快查表"

2011年9月20日 星期二

Failed to access IIS metabase

今天安裝 ASP.NET 到 Windows XP Sp3 上
由於 Windows XP 只能裝到 IIS 5.1, 殘念!! (IIS 6 只能到 Windows Server 2003 才能 Install)


由於在安裝 IIS 5.1 已經裝了 .NET 2.0, 3.5, 4.0 在系統中
好不容易裝完 IIS 之後
啟動應用程式
系統不客氣丟出這個錯誤訊息
System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase


查了一下網路各說紛紜


首先先將 IIS 的 ASP.NET .NET 指定到 .NET 4.0 (因為應用系統是 .NET 4.0 開發的)
接著
到 %window%\Microsoft.NET\Framework\v4.0.30319 的目錄
執行 
重新 install .net library
(1) aspnet_regiis -i    <enter>
移去 IIS cache
(2) aspnet_regiis -e   <enter>


之後就可以應用程式就正常的執行了!! 

2011年9月13日 星期二

Stop the Dopamine loop

In contrast to wanting to setup dopamine loops, you might be tired of being in one yourself. The constant stimulation of the dopamine system can be exhausting. To break a dopamine loop you need to get away from the information0seeking environment, i.e., turn off your computer and leave your phone out of sight and reach. One of the most powerful things you can do to end a dopamine loop is to turn off the bells and rings and cues that tell you that a message or text has arrived.

2011年8月22日 星期一

行遠自邇,登高自卑



行遠必自邇,登高必自卑

a journey of a thousand miles begins with a single step

2011年8月2日 星期二

SOLID Design

SOLID Object Oriented Design Principles
SSRP
Single responsibility principle
the notion that an object should have only a single responsibility.
OOCP
Open/closed principle
the notion that “software entities … should be open for extension, but closed for modification”.
LLSP
Liskov substitution principle
the notion that “objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program”. See also design by contract.
IISP
Interface segregation principle
the notion that “many client specific interfaces are better than one general purpose interface.”[5]
DDIP
Dependency inversion principle
the notion that one should “Depend upon Abstractions. Do not depend upon concretions.”[5]
Dependency injection is one method of following this principle.

2011年3月12日 星期六

SQL Server Restore 失敗

SQL Server 資料庫 Restore 時, 有時會回報以下的問題

Server: Msg 3201, Level 16, State 2, Line 1
Cannot open backup device '\\foo\bar.bak. Operating system error 5(Access is denied.).
error 5(error not found).
RESTORE HEADERONLY

之前總是以為是資料庫備份時檔案沒有寫入完成
但是明明這次就是正確寫入備份檔
仔細的閱讀問題以及 Google 了一下原因
才發現到是權限的問題
目前執行的 SQL Server 的身份是 NETWORK_SERVICE
但是備份檔的權限沒有開給 NETWORK_SERVICE
因此系統反應 Access is denied.

解決方式:
授權給 backupfile 或 NETWORK_SERVICE 所對應的資料庫 instance OS owner 吧

2011年3月8日 星期二

設定 Oracle User 的連線上限


利用 User Profile 的功能

-- 首先利用 system 帳號檢查是否系統的 resource_limit 的狀態
SQL> show parameter resource_limit
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
resource_limit                       boolean     FALSE 

-- 將 resource_limit 啟動
SQL> alter system set resource_limit=true;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
resource_limit                       boolean     TRUE

-- 建立一個 profile 來限定 csims 的連線上限 (假設 20), session_limit20 隨便您定義

SQL> create profile session_limit20 limit sessions_per_user 20;
Profile created.

-- 把新建的 profile apply 到 csims 帳號
SQL> alter user csims profile session_limit20;

User altered.

-- 移去該 profile
SQL> drop profile session_limit20 cascade;

-- 回復 Account 對應的 profile
SQL> alter user csims profile default;


CREATE PROFILE profile
LIMIT { resource_parameters
         | password_parameters
         }
           [ resource_parameters
           | password_parameters
           ]... ;
           
可限定的有一大堆,   
<resource_parameters>
{ { SESSIONS_PER_USER
 | CPU_PER_SESSION
 | CPU_PER_CALL
 | CONNECT_TIME
 | IDLE_TIME
 | LOGICAL_READS_PER_SESSION
 | LOGICAL_READS_PER_CALL
 | COMPOSITE_LIMIT
 }
 { integer | UNLIMITED | DEFAULT }
| PRIVATE_SGA
 { integer [ K | M ] | UNLIMITED | DEFAULT }
}
< password_parameters >
{ { FAILED_LOGIN_ATTEMPTS
 | PASSWORD_LIFE_TIME
 | PASSWORD_REUSE_TIME
 | PASSWORD_REUSE_MAX
 | PASSWORD_LOCK_TIME
 | PASSWORD_GRACE_TIME
 }
 { expr | UNLIMITED | DEFAULT }
| PASSWORD_VERIFY_FUNCTION
     { function | NULL | DEFAULT }
}

可設定 User 的最多連線 (SESSIONS_PER_USER), 連線時間  (CONNECT_TIME)

2011年2月18日 星期五

電信業者還能做什麼

這篇寫的真好 (原文)

一年一度的Mobile World Congress 在巴塞隆納展開了。今年會是歷年來最熱的一年,因為智慧型手機及平板電腦的大舉入侵改寫了行動應用生態,Mobile 真正從「無線」走向「無限」扉頁即將正式展開。Twitter CEO Dick Costlo在MWC 上發表演說,也正式宣告網路服務無所不在的王者地位。

在眾多載具中,被視為如革命般重要的行動設備,因著iPhone 所創造的ecosystem 打敗了純粹規格取向的手機大廠,也狠狠的打了所有電信業者一巴掌:在這個生態圈裡,擁有「最後一哩」(last mile)的電信業者,不過就是個隨時可以被更換的頻寬提供者,成為行動業的陪襯角色。

電信業者在這波市場洗牌中玩完了嗎?
Telecom TV 訪問了世界排名第三的Telefonica人員以及市場分析師Emma Mohr McClune 、開發者社群WAC 的VP,從手機Application 的角度切入,探討電信業者在這個新領域何去何從。從AppStore 在2007的混沌未明開始,沒有任何人能預料到今天Apple 及 Android 兩大陣營得以發展的如此蓬勃。電信公司在這場誰與爭鋒的競賽裡,並未扮演任何重要角色。Android Market、Apple AppStore 全都可以繞過電信業者,自行運作apps 的營運買賣,Emma 提到,Apps 是行動數據( Mobile data)前所未見最快速成長的類別。

看完這段訪談才發現,原來電信業者的財大氣粗現象,不是只有台灣才有(苦笑)。來自電信公司的先進們可能非常不習慣被挑戰,不順從的聲音本來就不悅耳,卻是能指出機器壞在哪裡的顯著線索。總結該段談話,整理出幾個給Operators的建議:

1. 改變與 developer 的關係:

Telefonica 的Jose 自己提到,電信業者跟developers 從來就沒關係「和諧」過,Jose 知道developer 普遍認為電信業者「傲慢、無趣、官僚、動作慢,甚至貪婪、刻薄。」(原文:Arrogant, boring, slow, bureaucratic, mean and greedy. 不過我接觸過的窗口多半都很認真負責,也相當友善。(汗)) 這是Telefonica 積極想改變的,這改變可以先從把developer 視為生意對象,視為接觸客戶的新管道開始。以前都是developer 跟電信業者提案,其實電信業者也可以主動跟開發者提案,Jose 提到Chainr 就是一例。Emma 也提到,Orange 電信也積極嘗試跟developer 重新建立關係的路子。拓展開發者是電信業者在這場遊戲中的重要課題。

2. 開放與協助:

Jose說道,早先使用電信業者的API是需要付費的(台灣沒有聽說,但是手續重重就是了)。現在Telefonica不但會免費開放API,甚至有可能付費給開發者來接自己的API,例如從app發送SMS。(這就對了,revenue sharing 可以提供developer動力,而且誰開的條件好當然就接誰的。)

此外,電信業者也會提供開發者協助。Developer通常資源跟資金都有限,如果可以提供數據跟參考資料,幫助開發者選擇適合自己的作業系統跟apps類別,間接也提供電信業者多接觸優秀開發者的機會,並掌握市場的脈動。

3. 飛上雲端:

以Evernote作為例子,他提供了很棒的跨平台使用者經驗,無論你使用web、使用iPad、用iPhone或用Android,都能得到很好的使用經驗,這是之前完全沒有過的。Jose 提到跟某開發者的合作經驗,剛開始對方接了SMS API,後來更因為將服務拓展到不同devices便更進一步介接語音及MMS。因為用戶的朋友們可能使用完全不同作業系統的手機,在social network如此重要的今日只服務一種device的用戶是很難拓展服務的。電信業者可以扮演NaaS(Network as a Service)的角色、提供雲端服務,協助這些developer 創造更佳跨平台使用經驗,並得以從有限的用戶身上獲取合理利潤。

4. 重新發明規則、創造市場

Emma認為,電信業者要打破現況的最大挑戰,就是重新發明遊戲。趨勢已無法回頭,完全不能跟前些年同日而語。電信業者必須創造新的生態系統、找到新夥伴、導入創新的思考及規則。事實上,電信業者可以利用提供API在開放市場中提供自己專有的服務,例如行動付費、廣告,或是創造在iOS及Android之外、只有電信業者作的到的ecosystem。

除了訪談裡提到的建議之外,個人認為台灣的電信業者如果也希望在apps的遊戲中突破現況,還需要熱情(Passion)。這不是什麼大話。試想,就拓展開發者、引進創新這兩個課題而言,既有的組織結構跟人員是否足以應付?「熱情」會讓人尋找願景、勇於突破,而在長期穩定台灣電信市場裡這樣的組織或人員可能反而是個麻煩。相信各家電信公司裡都有這樣的人,也請諸位高層們少些報告、多些交流,跟這些人聊聊,也許一杯咖啡換一個「Wow」的點子,絕對值得。

2011年2月15日 星期二

SQL Server Performance Tuning Tips

避免遇到以下的 SQL Server Performance 殺手
  •     Poor Indexing
  •     Inaccurate Statistics
  •     Excessive Blocking and Deadlocks
  •     Non-Set-Based Operations
  •     Poor Query Design
  •     Poor Database Design
  •     Excessive Fragmentation
  •     Nonreusable Execution Plans
  •     Poor Execution Plans
  •     Frequent Recompilation of Execution Plans
  •     Improper Use of Cursors
  •     Improper Configuration of the Database Log
  •     Excessive Use or Improper Configuration of tempdb

2011年2月11日 星期五

SQL Server Installation Notes

Check lists will vary for everyone but there are a few configurations that will be
common to all lists. For example:
• Data and Log File Standard Location
• Data: E:\DataFiles
• Logs: F:\TLogs
• Service Account: (Created service account and grant local privileges)
• TempDB Location
• T:\TempDB
• Special Permissions (memory – AWE)
• Lock Pages in Memory
• Boot.ini
• Configure for /PAE switch if 32 bit Windows 2003 and SQL
Server Standard or Enterprise
• Additional vendor-supplied (Non SQL) applications
• Defragmentation
• SQL Backup Compression

利用 VS 2008 建立 SQL Server 2008 Stored function

首先在資料庫端需要先設定相容屬性,否則在 VS 2008 Deploy 時會出現相容的問題
EXEC SP_DBCMPTLEVEL '您的資料庫', '100';

接著設定 SQL Server 能執行 CLR 功能

EXEC sp_configure 'clr enabled', 1
GO
RECONFIGURE
GO

這兩關設定後,應用程式就可以直接 Deploy 到您的 SQL Server 了


2011年2月8日 星期二

Java For Debug Remote

1. Use a text editor to open the StartWebLogic.cmd script for your development domain.

set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n

2. In the last line of the file, add the %DEBUG_OPTS% variable in the place indicated below:
%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %DEBUG_OPTS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy" weblogic.Server


3. To attach the debugger from within Eclipse select the Run > Open debug dialog
4. Create a new "Remote Java Application"
5. Enter the host and port corresponding to the DEBUG_OPTS.

2011年1月17日 星期一

WiMAX2及LTE 雙軌並進

好久前就說過 LTE 會起來吧.

2011-01-17 工商時報 【記者林淑惠/台北報導】

 電信產業政策急轉彎,經濟部定調同步押寶WiMAX2及LTE,定調4G為台灣未來電信產業發展政策主軸,WiMAX2及LTE並軌推動!

 台灣在以「M台灣」主導推動WiMAX技術、於2010年告一段落後,經濟部透露,政府持續推動WiMAX,但同時推動LTE,讓目前已經發展WiMAX的台廠,透過上週在台通過技術標準的802.16m(WiMAX2)、儘速升級發展並接軌推展LTE,採取雙軌並進策略,讓台商在全球兩個4G技術都能雨露均霑。

 WiMAX Forum工作小組會議預定今(16)在台召開,在WiMAX Forum上週在台確定802.16m技術標準備之後,電信技術中心及台灣立德桃園公司將從16e的認證中心躍升成為16m全球測試認證中心。

 由於16m支援下載330Mbps、相較16e的10Mbps快速數十倍,使得WiMAX2正式納入ITU的4G技術標準,與LTE並列全球4G標準。

 為此,經濟部已調整過去全力壓寶在WiMAX的策略,從今年開始,將以廣義的4G做為未來台灣電信產業技術發展主軸,這項產業政策的轉折,也代表台灣在未來幾年的電信產業政策,將同步押寶WiMAX2及LTE,不再偏執WiMAX一方。

 正文科技執行董事楊正任率先表示,WiMAX和LTE技術雷同度約達80%,WiMAX和LTE對台灣廠商來說,並不是選邊站的戰爭,台廠累積WiMAX的能量,將有助於切入LTE。他強調,「台灣在LTE市場也不會缺席」,但能在WiMAX先行卡位,也能在LTE領域,搶先一步敲開國際電信大客戶大門,獲得進入4G的門票。

 工研院資通所副主長黃文傑引用資策會MIC預估表示,3年後,WiMAX全球軟硬體商機將超過新台幣8,000億元,2011年到2014年的年複合成長率36%。

 黃文傑強調,截至2010年底為止,全球WiMAX用戶已達1,300萬,預估2011年達到1,800萬,其中,全球WiMAX龍頭Clearwire在2010年12月底的用戶總數已經達到400萬,Sprint預定2011年2月引進宏達電平價智慧型手機EVO Shift、在售價還比EVO套價價150美元還低之後,預估WiMAX的美國用戶將以每月新增30萬用戶快速成長。

2011年1月13日 星期四

The S.O.L.I.D. Design Principles

The S.O.L.I.D. design principles are a collection of best practices for object-oriented design. All
of the Gang of Four design patterns adhere to these principles in one form or another. The term
S.O.L.I.D. comes from the initial letter of each of the five principles that were collected in the book
Agile Principles, Patterns, and Practices in C# by Robert C. Martin, or Uncle Bob to his friends.
The following sections look at each one in turn.
Single Responsibility Principle (SR P)
The principle of SRP is closely aligned with SoC. It states that every object should only have one
reason to change and a single focus of responsibility. By adhering to this principle, you avoid the
problem of monolithic class design that is the software equivalent of a Swiss army knife. By having
concise objects, you again increase the readability and maintenance of a system.
Open-Closed Principle (OCP)
The OCP states that classes should be open for extension and closed for modification, in that you
should be able to add new features and extend a class without changing its internal behavior. The
principle strives to avoid breaking the existing class and other classes that depend on it, which
would create a ripple effect of bugs and errors throughout your application.
Liskov Substitution Principle (LS P)
The LSP dictates that you should be able to use any derived class in place of a parent class and have it
behave in the same manner without modification. This principle is in line with OCP in that it ensures
that a derived class does not affect the behavior of a parent class, or, put another way, derived classes
must be substitutable for their base classes.
Interface Segregation Principle (IS P)
The ISP is all about splitting the methods of a contract into groups of responsibility and assigning
interfaces to these groups to prevent a client from needing to implement one large interface and a
host of methods that they do not use. The purpose behind this is so that classes wanting to use the
same interfaces only need to implement a specific set of methods as opposed to a monolithic interface
of methods.
Dependency Inversion Principle (DIP)
The DIP is all about isolating your classes from concrete implementations and having them depend on
abstract classes or interfaces. It promotes the mantra of coding to an interface rather than an implementation,
which increases flexibility within a system by ensuring you are not tightly coupled to one
implementation.