2007年6月28日 星期四

Lyrics of “Way Back Into Love” — From “Music and Lyrics”

五月時去了一趟日本,去程時在飛機上看了K歌情人。 日文字幕,看不太懂。可是覺的很好看,回程時又看了一遍。 還是很好看。 於是,又租來看一次。 這大概是我在最短時間內看最多次的電影了。 其中的 way back into love 這首歌非常動聽。 於是將找到的歌詞轉貼在此。參考處 I’ve been living with a shadow overhead I’ve been sleeping with a cloud above my bed I’ve been lonely for so long Trapped in the past, I just can’t seem to move on I’ve been hiding all my hopes and dreams away Just in case I ever need them again someday I’ve been setting aside time To clear a little space in the corners of my mind All I want to do is find a way back into love I can’t make it through without a way back into love Oh oh oh I’ve been watching but the stars refuse to shine I’ve been searching but I just don’t see the signs I know that it’s out there There’s got to be something for my soul somewhere I’ve been looking for someone to shed some light Not just somebody just to get me through the night I could use some direction And I’m open to your suggestions All I want to do is find a way back into love I can’t make it through without a way back into love And if I open my heart again I guess I’m hoping you’ll be there for me in the end There are moments when I don’t know if it’s real Or if anybody feels the way I feel I need inspiration Not just another negotiation All I want to do is find a way back into love I can’t make it through without a way back into love And if I open my heart to you I’m hoping you’ll show me what to do And if you help me to start again You know that I’ll be there for you in the end

2007年6月20日 星期三

Asynchronous Pages in ASP.NET 2.0

Please refer to

http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/

ACID rules for transactions

  • Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions)
  • Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t)
  • Isolated (no transaction sees the intermediate results of the current transaction)
  • Durable (the values persist if the data had been committed even if the system crashes right after).

2007年6月15日 星期五

SQL Server 2005 vs Oracle

        這個網站http://www.tpc.org/ 是資料庫系統的競技場。

        當然,微軟的 SQL Server 2005 並不是champion

        效能來看,前十名,只有一個是微軟的。第一名是 Oracle 10g R2。但是,看它的規格,天哪! 64 CPU。總造價11,987,716 US $,相當於3,9559,4628 NT,近四億新台幣。這是跑車界中鑽石,是全世界最高等級富豪才需要的「身份表徵」。我們平民等級所需要的,是貨真價實的代步用轎車。

 

        如果由價格/效能比來看,前十名有九名是微軟的產品。看看其硬體規格,會發現這才是符合平常百姓家的等級。

有趣的是第一名的Oracle,其價格/效能比,硬是比234 名更便宜上近兩成。我覺得是Oracle 特意打造出來的成果在行銷上有好的交待。

由天瓏書局排行,看國內技術趨勢

     由天瓏書局的中文書暢銷排行http://tlsj.tenlong.com.tw/WebModule/TopSale/topSaleDispAction.do?chi=1 ,可以看到目前最流行的,就是 ASP.NET AJAX , 10本內有三本是講 ASP.NET AJAX

 

其他,ASP.NET 2.0 有一本。

以前10 名來看各個主題的比例,結果如下

 

主題

比例 (%)

ASP.NET AJAX

30

ASP.NET

40

AJAX

40

Microsoft 產品

50

Web

70

 

台灣的開發人員的習性是:看來不得不用的時候,才會去認真學。因此由前十大中文暢銷書,可以看到一些趨勢。

 

因此得到一個結論:

台灣市場目前最流行的是做 AJAX 的網站,而使用微軟技術的佔大宗。而市場上的需求,也是建置Web 網站。

 

2007年6月8日 星期五

Identity in asp.net 2.0

It's realy complicated. Please make sure the difference between the Application_BeginRequest event and duration page excution //operation system thread identity (win32) System.Security.Principal.WindowsIdentity.GetCurrent(); //managed thread identity System.Threading.Thread.CurrentPrincipal.Identity; //asp.net user identity (may be GenericPricipal) HttpContext.Current.User.Identity; // consider the client user windows identity that logon to iis Request.LogonUserIdentity; 再加上多種變化
  1. 使用者有無 windows identity (ex:有無登入domain?)
  2. IIS 上有無勾選 anonymous?有無勾選windows intergration?
  3. application pool 上的 identity 是跑哪一個?(network service? local system? domain user?)
  4. web.config 上設的authentication mode (None, Winows, Forms)
  5. web.config 上有無設 ? 是否有指定 username, password?
這些變化,在Request 進行的過程中(befault autentication, page execution, async thread),上述四種identtity都可能有不同的值。而這些值都是有意義的。 It's really complicated.

enum description

When i make an enum like following public enum SalaryType { ByHour, ByMonth }; I ususaly need to describe the meaning by text. So I need the following code switch( employee.EmployeeType) { case Employee.ByHour: Console.WriteLine("By hour"); break; .... } the code was seperated by definition and client code. I found some code , and it so useful public enum SalaryType { [Description("By hour')]ByHour, [Description("By month")] ByMonth }; public static string GetDescription(Enum value) { FieldInfo fi= value.GetType().GetField(value.ToString()); DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes( typeof(DescriptionAttribute), false); return (attributes.Length>0)?attributes[0].Description:value.ToString(); }

Enterprise Library 3.1

Enterprise Library 3.1 又發佈了。 改版愈來愈快。對於我來說,真是件好事。 也希望 Web Client Software Factory 也能快點改用 EL 3.1 的版本,這樣才一致。

2007年6月5日 星期二

Restore dabase 時,磁碟路徑改變

當將Production 資料庫備份後,想還原到開發的資料庫伺服器時,發現開發與正式機器的磁碟代號不同,結果無法restore

怎麼辦呢?查了一下語法,是可以解決的。
語法如下
RESTORE DATABASE [EInvoice] FROM DISK = N'E:\EInvoice.bak' WITH FILE = 1, NOUNLOAD, STATS = 10
, MOVE 'EInvoice2_Log' TO 'E:\DB\EInvoice_log.ldf'
, MOVE 'EInvoice2_Data' TO 'E:\DB\EInvoice_log.mdf'

2007年6月1日 星期五

Event "EntryDelayCreated" on interface type "TimeSheetNotification.Services.Contracts.IEntryDelayService" for instance id "8f3ff2ac-ef5a-4e0c-a6e9-7f1b6ce33df1" cannot be delivered.

在開發WF ,且使用 SqlPersistenceService 時,一直出現這個錯誤
Event "EntryDelayCreated" on interface type "TimeSheetNotification.Services.Contracts.IEntryDelayService" for instance id "8f3ff2ac-ef5a-4e0c-a6e9-7f1b6ce33df1" cannot be delivered.

而其InnerException 的 message 卻為
Workflow with id "90541a57-f759-4baa-84c5-8e613f59f46d" not found in state persistence store.

怎麼看也看不懂!

使用profiler追蹤了 sql statements 後,發現有一段如下

declare @p10 int
set @p10=0
declare @p11 uniqueidentifier
set @p11=NULL
exec InsertInstanceState @uidInstanceID='8F3FF2AC-EF5A-4E0C-A6E9-7F1B6CE33DF1',@state=0x,@status=3,@unlocked=1,@blocked=0,@info=N'Type
''TimeSheetNotification.Entities.ProjResource'' in Assembly ''TimeSheetNotification.Entities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'' is not marked as
serializable. Type ''TimeSheetNotification.Entities.ProjResource'' in Assembly ''TimeSheetNotification.Entities, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'' is not marked as serializable.',@ownedUntil=''9999-12-31 23:59:59:997'',@ownerID=default,@nextTimer=''9999-12-31 23:59:59:997'',@result=@p10
output,@currentOwnerID=@p11 output
select @p10, @p11

原來,我在workflow 中,有使用了ProjResource的business entity,但卻未給定 Serializable 的屬性,以致於當workflowruntime 在序列化我的workflow 時失敗了,因此,無法再找回來。

話又說回來,為何當初序列化失敗時,不是直接出現錯誤,而是將錯誤訊息寫到資料庫呢?

務必將Windows 保持到最新狀態

        剛剛看了一篇文章,針對木馬程式做了一些剖析。http://blog.darkthread.net/blogs/darkthreadtw/archive/2007/06/01/816.aspx

 

        結論是,不要以為您沒有開過奇怪的email 附件、沒有下載過好像無害卻是木馬的程式,也沒有執行之。就以為不會中標了。

       

        事實上,只要不了心開了某個網頁,然後攻擊您的作業系統漏洞,就有可能中毒。

        也有可能是正常的網站,被植入了一小段javascript,然後您開啟該網站,就暗地裡被開啟到有問題的網頁。

 

因此,務必將Windows 保持到最新狀態。

同時,也必須更新您的防毒程式病毒特徵碼。最好自行檢查一下。

 

 

 

PS:  不要好奇地去開啟該 blog 中描述的問題網站。一旦開啟,而您的防毒程式沒有動作,您就可能中毒了。當然,沒有防毒程式就更慘了。

 

Share with Facebook