Archive of original



  • From Taiwan, living and working at Tokyo, Japan.

Recent Posts


Site Info

Locations of visitors to this page

Logos & Chicklets


Rex's Certifications
Rex's Certifications

Creative Commons授權條款
本 著作 係採用
Creative Commons 授權條款

January 2005 - Posts

Replace CR/LF in SQL DB with T-SQL Commands...

While transferring my old blog to this system, I had problem converting strings in database.
In the past time I just wrote VB programs to convert my blogs into static html pages, and during the convertion I did necessary string replacement like make CR/LF into tags, that's about 2 years ago.

Now I am no longer using that program but I still need to convert my content of each blog entries' CR/LF into
tag so that my posts will display properly. I like to just use Query Analyzer with simple INSERT command to do it.

actually the problem can use T-SQL command Replace function to solve, question is , how to represent CR/LF in T-SQL?

after a little search of Google, I found a post about how to solve this problem. it said:

Sounds like you need to replace the carriage return and and/or line feed characters (CHAR(13) and CHAR(10) respectively) with a blank space. Depending on the client application, you may get CRLF, LFCR, CR or LF, so to cover all possibilities, here's a catch-all expression:

CHAR(10) + CHAR(13), ' '), CHAR(13), ' '), CHAR(10), ' ')

This should solve my problems too!
It's good to have Google around.... ;)

Posted: 2005/1/30 19:08 by rextangtw | with 2 comment(s)
Filed under:
Post your code in colorful html format!

Wes Haggard posted his code in a very colorful html format in his blog that just like what you've seen in IDE, I was wondering how he could do it. After more browse of his post, I found that actually he wrote a program doing the translation of the code.

it's called Code Htmler and you can find at , with source code!

for example, if you want to post a code like this:

/// <summary>
/// Summary description for Main.
/// </summary>
static void Main(string[] args)
  // string variable
  string myString = "myString";

  /* integer 
     variable */
  int myInt = 2;

it can become like this:

  1 /// <summary>
  2 /// Summary description for Main.
  3 /// </summary>
  4 static void Main(string[] args)
  5 {
  6   // string variable
  7   string myString = "myString";
  9   /* integer 
 10      variable */
 11   int myInt = 2;
 12 }

this will help people reading your code more easily!
thanks, Wes!


How NERDY you are!? I am 94.

I am nerdier than 94% of all people. Are you nerdier? Click here to find out! <-- click to score yours!

What does this mean? Your nerdiness is:
Supreme Nerd. Apply for a professorship at MIT now!!!.

Tell me your score! ^_^

Posted: 2005/1/30 16:36 by rextangtw
Filed under:
A free counter that's easy to use...
I was reading Wes' Puzzling Blog who is also using .Text for his blog, he had used a counter on his blog from , After read the website and then I created my own free account starting using it's counter function on my blog. in fact this site do provide a comperhensive stats about the usage of a website, it's nice if you want to have a simple counter but don't just want only a page load number!

Wes' Puzzling Blog also points out some useful link about .NET resources, for me, it helps!



那至少, 要把自己的豬窩清一清吧!


Posted: 2005/1/29 12:00 by rextangtw
Filed under: ,
Join the community of CS, the next of .Text Project...

Scott Watermasysk, the creator of .Text project, should be also the creator of ASP.NET Forum I guess, wrote a very structural code and made it open-sourced, he is now creating CommunityServer 1.0, that contains forums, blogs, and photo gallaries in one application. althouth those are gathered into one app, but as Scott wrote in his blog, each functions could be run seperately without problems, and current data in .Text database can also upgraded to future CS DB. there are currently many hackers in his forums discussing about those projects. if you are also interesting in creating your own blog, discussing forums, as well as photo gallaries, you should take a look of thoe pure .NET enabled web applications.

I personally think this is a very good learning matetrial and a small but useful application that as an developer, solution architect, it's worth to dig in.

for the first time, I started feel that OpenSource can be a very helpful way to make self and the whole world keep running.

I'll dig in further in to that N Gallaries open-source project, and I am looking for Scott releasing his CS 1.0 code. join the community, and discuss with other developers with the same interests is a happy thing to do, and it make the software more better...


Sending email via System.Web.Mail in .Text ...
While debugging .Text source code, Scott commented a place which is really useful for those who wants to get deeper understanding of sending email via System.Web.Mail.

got many tips about using System.Web.Mail namespace.

But as this site said, if there are requirements about encoding non-ASCII characters such like Chinese or Japanese, then simply use this will not send properly. I've tried some other way to change the encoding on MailMessage class, Chinese should be ok cause I am using a Chinese OS, but Japanese always fail of it's 8-bit encoding type (should be base64 or quoted-printable type). it seems not able to use this way to send Japanese characters, still working on other ways!

this is a good website that worth reading, go for it!


我還在寫程式把我 2003 年以前發的電子報, 以及在其他網站寫的東西匯入到我這個 blog 網站中, 希望過年後能搞定,到時候在告訴大家!

blog 的好處在於你可以用 RSS 的功能,"訂閱" 你有興趣的某個人的某個主題。因此,請善用這個功能喔!

我自己是用一個叫做 newsgator 的讀 RSS 文章的工具, 他可以跟 outlook 整合,我覺得很方便。相關網站在 , 可以參考一下!


BugFix: Admin -> Options -> Preferences won't save!

When editing the options in admin page, noticed that the preference page won't save.
this will majorly affect that if you want to turn off the comment function.

this .Text blog now fix the problem that preference won't save.

the major problem is at Preference.aspx.cs file, someone commented out the whole Page_Load() event.
there is a LoadUI function that should only be run at the first time entering the page
( when Page.IsPostBack is false) , the original file just mark out the check if-statement so that the LoadUI function always run regardless if it is  the first time post back or not, therefore no matter you click the button or not to let it post back, it always read the database's value again without remember what you really selected.

to fix the bug, just let that LoadUI function to run on the first time entering the page and prevent it run on later post backs. that is, put an if statement to check the Page.IsPostBack value. then the bug will be fixed!

and now you can turn off the comment function without going into database and put the Flag's fifth bit to 0 (16 is the Comment function flag, check the Flag enum file)!

Happy Blogging! ^_^


closer 是裘德洛跟珠利亞羅蔔絲演的外遇電影!


Blog 系統的 bug 修的差不多了,

發 email 這件事, 看來輕鬆,


Posted: 2005/1/28 12:00 by rextangtw
Filed under: ,

星期天, 電腦還是一直當,
星期一, 華碩工程師說原價買回主機板,
星期二, 我換了另一張華碩比較以前的主機板,
星期三, 好像沒問題了, 慶幸中...
星期三早上, 要洽公先把主機板拿回公司準備讓快遞帶走,
上去辦公室下來不到十分鐘, 停在公車候車處的小白被拖走了...

星期四, 好不容易氣有點消了,
連續講了四天的技術課程, 終於要結束了,
結果, 上課前一小時號稱有備援能力資料庫叢集,
趕在上課沒系統用開天窗前 20 分鐘,
使用超強危機處理能力, 先把系統弄回來了,
但離線的磁碟陣列怎麼弄回來, 找廠商中, 傷腦筋!

每天發生一件麻煩事, 我已經快不敢出門了...
Posted: 2005/1/27 22:28 by rextangtw
Filed under:
ASUS P5GDC-V Deluxe Issues, I.T 的東西, 還是不要用最新的比較好...


這邊來討論一下這次的 Issue 吧!

ASUS P5GDC-V Deluxe MotherBoard, built-in Intel 915G Video chip,
Intel Pentium 4 3.4GHz LGA775 CPU,
Transend 512mb DDR400 non-ECC RAM x 4,
Pioneer DVD-ROM.

1. 瞬斷, 系統跑到某個時間點,會直接好像被 Power-Off 再 Power-On 一樣的重開機,
沒有藍色畫面,Event Log 裡沒有任何訊息,重開機的時間不定,找不到相關原因。
2. 系統 hang 在聽音樂的時候。使用 line-in 將音源輸入主機板內建 HD Audio 音效中,
hang 在那邊,滑鼠鍵盤沒反應,螢幕 Freeze 在那邊,系統不會重開機,沒有藍色畫面,
只能按 Reset 按鈕重開。

外接的 PCI-Express 16 顯示卡 (ASUS EAX 300),並且我把 OnBoard HD Audio disable 掉,
情況才好一點,但是,外接顯示卡後,因為 BIOS 沒有將內建 VGA (Intel 915G Video) 關掉
的功能,所以常常會發生在 restart OS 時,會自動去抓 915G 的 Video 而不用外接的顯示卡,
除非你 power-off 再 power-on 才會抓外接的, 實在很麻煩.

另一個音效的問題,查了一些資料以後,我覺得是 HD Audio 規格跟 driver 的問題,
Microsoft 到現在在 HD Audio 的部分都還是用 hotfix 的方式在上 driver,所以我覺得這樣的 driver
應該不會太穩定,而且也證明了常常會當,雖然不確定是不是 driver 的問題就是了。

所以,在試了兩個多月沒辦法 identify 出問題後,我放棄了!
放棄了 915G 晶片組,不太敢再花時間試 915P 晶片組的情況下,我退而求其次的使用了 865PE 晶片組。

我買了 ASUS P5P800 MotherBoard + ASUS V9520 Magic AGP8X,配上原來的各個元件,

另外有一個 Issue 一定要提一下,好像是因為晶片組的關係,現在用 SATA 介面的話,在 P-ATA 的部分好像都只能支援一個 IDE BUS 而已,所以這個時間點看到還有貨的主機板,都沒有兩個 IDE 的 bus。

為了這個 issue 也是找了好久,剛好 P5P800 有兩個 IDE BUS + 2個 SATA BUS, 才解決了問題。很慶幸。



Posted: 2005/1/26 13:17 by rextangtw
Filed under:

不到十分鐘,拖車廠淨賺 1000 元,台北市淨賺 900元,

頗不順的最近... 不是破財就是一堆雜七雜八搞不定的事情,

實在是他 X 的很 FxxK!!!

Posted: 2005/1/26 12:06 by rextangtw
Filed under:
我要換主機板了... 真糟...
測了兩個多月, 還是不行! 還是會一直當!
不過, 我還是想用 ASUS 的就是了...
Posted: 2005/1/25 2:41 by rextangtw
Filed under:



Posted: 2005/1/21 4:30 by rextangtw
Filed under:
More Posts Next page »