Almaviva 2001~2008

January 10th, 2012 Phanix

2011/10/22, @市長官邸沙龍

Read the rest of this entry / 繼續閱讀 »

Decanter 2011 World Wine Award Tasting

January 4th, 2012 Phanix

2011/12/30, 當天很忙,所以只有速記

未成年請勿飲酒,飲酒過量有礙身體健康
Read the rest of this entry / 繼續閱讀 »

吃飯閒聊品酒會

January 3rd, 2012 Phanix

2010/10/9
忘記是為什麼四五個人聚在一起吃飯喝酒,地點是令人緬懷的孔雀

未成年請勿飲酒,飲酒過量有礙身體健康
Read the rest of this entry / 繼續閱讀 »

WS 7x 的波爾多級數酒

January 1st, 2012 Phanix

Chateau Croizet Bages 2001
未成年請勿飲酒,飲酒過量有礙身體健康
IMG_5327
Read the rest of this entry / 繼續閱讀 »

Chardonnay Tasting

December 29th, 2011 Phanix

2011/12/19, @品集生活
燈光偏昏暗,外觀顏色部分或許不準確 / Light is not so good for a tasting event, so the appearance might be incorrect.

未成年請勿飲酒,飲酒過量有礙身體健康
Read the rest of this entry / 繼續閱讀 »

[C#][Maya][Python] Maya commandPort for external communication / 利用 commandPort 命令讓外部程式與 Maya 溝通

December 28th, 2011 Phanix

利用 tcp client connection 或 socket connection 來跟 Maya 溝通
Read the rest of this entry / 繼續閱讀 »

[C#] XMLWriter Encoding Issue / XMLWriter 控制文字編碼

December 26th, 2011 Phanix

一般狀況下,如果不是很在意使用 XMLWriter 後輸出的文字編碼是哪一種的話,可以很簡單地用下面的方式完成

StringBuilder sb = new StringBuilder();
XmlWriter writer = XmlWriter.Create(sb);

writer.WriteStartDocument();
//補上 xml 內容, 用 writer.WriteStartElement() 等完成
writer.WriteEndDocument();

writer.Flush();

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(sb.ToString());

但是可以發現到這樣子所輸出的 XML 文件是變成 UTF-16 encoding。雖然有 XmlWriterSettings 這東西可以去設定 XMLWriter 的編碼,不過看起來好像是有些問題,輸出的 XML 結果依舊是 UTF-16。

解決的方法是用 MemoryStream 與 XMLTextWriter。

MemoryStream stream = new MemoryStream();
XmlWriter writer = new XmlTextWriter(stream, Encoding.UTF8);

writer.WriteStartDocument();
//補上 xml 內容, 用 writer.WriteStartElement() 等完成
writer.WriteEndDocument();

writer.Flush();

StreamReader reader = new StreamReader(stream, Encoding.UTF8, true);
stream.Seek(0, SeekOrigin.Begin);
string result = reader.ReadToEnd();

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(result);

強者我朋友 2011 Geisai 展拿金賞!

December 13th, 2011 Phanix

強者還是個正妹 XD
Read the rest of this entry / 繼續閱讀 »

Jarret’s Birthday

November 9th, 2011 Phanix

吃好撐… =___=
_MG_0100
Read the rest of this entry / 繼續閱讀 »

Lucaris Glassware

November 3rd, 2011 Phanix

R0019575
Read the rest of this entry / 繼續閱讀 »