<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MtRock.cs Paradise 16</title>
	<atom:link href="http://mtrockcs.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mtrockcs.wordpress.com</link>
	<description>Qingshuan's Programming Blog</description>
	<lastBuildDate>Mon, 18 Aug 2008 10:37:36 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='mtrockcs.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/686f4c162e022e3ec244002ee293c3fa?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>MtRock.cs Paradise 16</title>
		<link>http://mtrockcs.wordpress.com</link>
	</image>
			<item>
		<title>use glui in VS</title>
		<link>http://mtrockcs.wordpress.com/2008/08/18/use-glui-in-vs/</link>
		<comments>http://mtrockcs.wordpress.com/2008/08/18/use-glui-in-vs/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 10:35:16 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>
		<category><![CDATA[Computer Graphics]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/?p=46</guid>
		<description><![CDATA[


glui in VC:
1. unzip glui-2.36.zip
2. build (i used batch build and selected all)
3. copy lib/glui32.lib  to %VS2005_DIR%\VC\platformSDK\Lib
4. copy include/glui.h to %VS2005_DIR%\VC\platformSDK\Include\GL. finish. (further  work for compiling projects):
 Project-&#62;settings-&#62;General -&#62;Microsoft Foundation Classes(DropList)-&#62;Select&#8221;Use MFC in a Shared DLL&#8221;




..
Errors Like：msvcrt.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBC.lib (crt0dat.obj) Solution：ADD msvcrt.lib libc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=46&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><table class="FCK__ShowTableBorders" style="table-layout:fixed;" border="0">
<tbody>
<tr>
<td><span style="font-size:10pt;"><strong>glui in VC:<br />
1. unzip glui-2.36.zip<br />
2. build (i used batch build and selected all)<br />
3. copy lib/glui32.lib  to %VS2005_DIR%\VC\platformSDK\Lib<br />
4. copy include/glui.h to %VS2005_DIR%\VC\platformSDK\Include\GL. finish. (further  work for compiling projects):</strong></span></p>
<div><span style="font-size:10pt;"><strong> Project-&gt;settings-&gt;General -&gt;Microsoft Foundation Classes(DropList)-&gt;Select&#8221;Use MFC in a Shared DLL&#8221;</strong></span></div>
</td>
</tr>
</tbody>
</table>
<p><span style="color:#ffffff;">..</span></p>
<p><strong>Errors Like：msvcrt.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBC.lib (crt0dat.obj) Solution：ADD msvcrt.lib libc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib </strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=46&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/08/18/use-glui-in-vs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
		<item>
		<title>BOOST/CGAL/QT installation with Microsoft Visual Studio 2005</title>
		<link>http://mtrockcs.wordpress.com/2008/08/18/boostcgalqt-installation-with-microsoft-visual-studio-2005/</link>
		<comments>http://mtrockcs.wordpress.com/2008/08/18/boostcgalqt-installation-with-microsoft-visual-studio-2005/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 07:38:28 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>
		<category><![CDATA[Computer Graphics]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/?p=42</guid>
		<description><![CDATA[
Quoted from CGAL3.3安装过程介绍 by wiarw @Monday, August 18 2008
sfasafCGAL采用QT作为它的GUI，并利用了boost、GMP、TAUCS等库，因此在安装CGAL前需要配置好这些依赖库。这里我装的是CGAL3.3版本，平台是Windows XP sp2。
1. 安装Boost. boost的安装比较简单，我得到的是boost 1.33.1版本（http://sourceforge.net/project/showfiles.php?group_id=7586）由于是exe文件，直接运行即可。此时会添加“BOOSTROOT”环境变量。
2. 安装QT。CGAL3.3需要的是QT3，QT4和QT3相比在结构上存在较大改动，因此与CGAL并不兼容，这个问题可能在以后CGAL的更新版中会解决。如果想得到QT4可访问官网http://www.trolltech.com。QT3则需要通过http://webdev.cegit.de/snapshots/qtwin/得到。先将得到的qt-win-free-3.3-2007-06-07-src.tar.bz2解压至不包含空格的路径下某一目录中（比如D:\QT-3）。下面就是设置环境变量。在我的例子中，环境变量如下：
QTDIR = D:\QT-3
QMAKESPEC = win32-msvc2005
PATH= %QTDIR%\bin;%PATH%
然后更改VS2005的环境变量设置脚本vsvars32.bat（我的是在D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat），其关键内容如下：
@set DevEnvDir=D:\Program Files\Microsoft Visual Studio 8\Common7\IDE
@set QTDIR=D:\qt-3
@set QMAKESPEC=win32-msvc2005 
@set PATH=%QTDIR%\bin;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE;D:\Program Files\Microsoft Visual Studio 8\VC\BIN;D:\Program Files\Microsoft Visual Studio 8\Common7\Tools;D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;D:\Program Files\Microsoft Visual [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=42&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div id="blog_text" class="cnt">
<p>Quoted from <a href="http://hi.baidu.com/wiarw/blog/item/f3a06660d6cb65dc8db10d9c.html" target="_blank">CGAL3.3安装过程介绍 <strong>by wiarw</strong></a> @Monday, August 18 2008</p>
<p><span style="font-size:small;">sfasafCGAL采用QT作为它的GUI，并利用了boost、GMP、TAUCS等库，因此在安装CGAL前需要配置好这些依赖库。这里我装的是CGAL3.3版本，平台是Windows XP sp2。</span></p>
<p><span style="font-size:small;">1. 安装Boost. boost的安装比较简单，我得到的是boost 1.33.1版本（</span><a href="http://sourceforge.net/project/showfiles.php?group_id=7586"><span style="font-size:small;">http://sourceforge.net/project/showfiles.php?group_id=7586</span></a><span style="font-size:small;">）由于是exe文件，直接运行即可。此时会添加“BOOSTROOT”环境变量。</span></p>
<p><span style="font-size:small;">2. 安装QT。CGAL3.3需要的是QT3，QT4和QT3相比在结构上存在较大改动，因此与CGAL并不兼容，这个问题可能在以后CGAL的更新版中会解决。如果想得到QT4可访问官网</span><a href="http://www.trolltech.com/"><span style="font-size:small;">http://www.trolltech.com</span></a><span style="font-size:small;">。QT3则需要通过</span><a href="http://webdev.cegit.de/snapshots/qtwin/"><span style="font-size:small;">http://webdev.cegit.de/snapshots/qtwin/</span></a><span style="font-size:small;">得到。先将得到的<span style="color:#339966;">qt-win-free-3.3-2007-06-07-src.tar.bz2</span>解压至<span style="color:#ff0000;">不包含空格</span>的路径下某一目录中（比如D:\QT-3）。下面就是设置环境变量。在我的例子中，环境变量如下：</span></p>
<p><span style="font-size:small;">QTDIR = D:\QT-3</span></p>
<p><span style="font-size:small;">QMAKESPEC = win32-msvc2005</span></p>
<p><span style="font-size:small;">PATH= %QTDIR%\bin;%PATH%</span></p>
<p><span style="font-size:small;">然后更改VS2005的环境变量设置脚本<span style="color:#339966;">vsvars32.bat</span>（我的是在D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat），其关键内容如下：</span></p>
<p><span style="font-size:small;">@set DevEnvDir=D:\Program Files\Microsoft Visual Studio 8\Common7\IDE<br />
</span><span style="font-size:small;"><span style="color:#ff0000;">@set QTDIR=D:\qt-3<br />
@set QMAKESPEC=win32-msvc2005</span> </span></p>
<p><span style="font-size:small;">@set PATH<span style="color:#ff0000;">=%QTDIR%\bin;</span>D:\Program Files\Microsoft Visual Studio 8\Common7\IDE;D:\Program Files\Microsoft Visual Studio 8\VC\BIN;D:\Program Files\Microsoft Visual Studio 8\Common7\Tools;D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;D:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;%PATH%<br />
@set INCLUDE<span style="color:#ff0000;">=%QTDIR%\include;</span>D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE;D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include;D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include;%INCLUDE%<br />
@set LIB<span style="color:#ff0000;">=%QTDIR%\lib;</span>D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB;D:\Program Files\Microsoft Visual Studio 8\VC\LIB;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib;D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%LIB%<br />
其中红色部分为要添加的内容。</span></p>
<p><span style="font-size:small;">然后打开VS2005提供的命令提示符工具Visual Studio 2005 Command Prompt，转至QT根目录下(我的是D:\QT-3)，运行<span style="color:#339966;">configure-msvc2005.bat</span>，大概40分钟后即可安装完成。</span></p>
<p><span style="font-size:small;">3.安装CGAL。CGAL的安装过程相对简单，在Wizard中会要求填写Boost的根目录，并且会安装GMP和TAUCS的头文件和库文件。安装过程中需要保证网络畅通无阻，因为会从网络下载CGALCore、CGAL、CGALQt等对应VC80的库文件。</span></p>
<p><span style="font-size:small;">4.测试是否安装成功。在CGAL的安装目录下有很多的example和demo，打开某个.vcproj文件，经VS2005转换为.sln后，更改项目配置，将Linker-&gt;Input中的库<span style="color:#ff0000;">qt-mt.lib</span>改为<span style="color:#ff0000;">qt-mt3.lib</span>保存。在Tools-&gt;Options下，添加Boost的Include和Library路径。编译运行即可成功。</span></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=42&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/08/18/boostcgalqt-installation-with-microsoft-visual-studio-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
		<item>
		<title>A typo in &#8220;Triangulations in CGAL&#8221;</title>
		<link>http://mtrockcs.wordpress.com/2008/08/08/a-typo-in-triangulations-in-cgal/</link>
		<comments>http://mtrockcs.wordpress.com/2008/08/08/a-typo-in-triangulations-in-cgal/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 04:59:09 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[Computer Graphics]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/?p=39</guid>
		<description><![CDATA[P7 from &#8220;Triangulations in CGAL&#8221; by Jean-Daniel Boissonnat Olivier Devillers Sylvain Pion Monique Teillaud Mariette Yvinec:

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=39&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>P7 from &#8220;Triangulations in CGAL&#8221; by Jean-Daniel Boissonnat Olivier Devillers Sylvain Pion Monique Teillaud Mariette Yvinec:</p>
<p><a href="http://mtrockcs.files.wordpress.com/2008/08/untitled.jpg"><img class="aligncenter size-full wp-image-40" src="http://mtrockcs.files.wordpress.com/2008/08/untitled.jpg?w=701&#038;h=245" alt="" width="701" height="245" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=39&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/08/08/a-typo-in-triangulations-in-cgal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>

		<media:content url="http://mtrockcs.files.wordpress.com/2008/08/untitled.jpg" medium="image" />
	</item>
		<item>
		<title>Pirate game</title>
		<link>http://mtrockcs.wordpress.com/2008/07/14/pirate-game/</link>
		<comments>http://mtrockcs.wordpress.com/2008/07/14/pirate-game/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 14:48:54 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[Algo]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/07/14/pirate-game/</guid>
		<description><![CDATA[Sometimes you find a puzzle really messy, and you just put it aside. Next time when you pick it up, however, it magically becomes all clear.
Computing people all heard of the pirate game, and the following is some kind of the solution.
 
1, (100)                               1s
2, (0 ,100)                           1a,2s
3, (1 ,0 ,99 )                        1s,2a,3s
4, (0 ,1 ,0 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=37&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes you find a puzzle really messy, and you just put it aside. Next time when you pick it up, however, it magically becomes all clear.</p>
<p>Computing people all heard of the pirate game, and the following is some kind of the solution.</p>
<p> </p>
<blockquote><p>1, (100)                               1s</p>
<p>2, (0 ,100)                           1a,2s</p>
<p>3, (1 ,0 ,99 )                        1s,2a,3s</p>
<p>4, (0 ,1 ,0 , 99)                    1a,2s,3a,4s</p>
<p>5, (1 ,0 ,1 , 0, 98)                1s,2a,3s,4a,5s</p>
<p>………………………………</p></blockquote>
<p> </p>
<p>So for N<sup>th</sup>, his solution would be:</p>
<p> </p>
<ol>
<blockquote>
<li><span style="font-size:10pt;font-family:Courier New;">(N)p    := 100 – (n-1)/2     <span style="color:#00b050;">// himself</span><br />
</span></li>
<li><span style="font-size:10pt;font-family:Courier New;">(N-1)p  := 0               <span style="color:#00b050;">// next to him</span><br />
</span></li>
<li>
<div><span style="font-size:10pt;font-family:Courier New;">For i from 0 to N-2<br />
</span></div>
<p><span style="font-size:10pt;font-family:Courier New;">      i := 1 – (i+1)<br />
</span></li>
<li><span style="font-size:10pt;font-family:Courier New;">End<br />
</span></li>
</blockquote>
</ol>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=37&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/07/14/pirate-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
		<item>
		<title>[C#/.NET] Convert Integer to C# Enums</title>
		<link>http://mtrockcs.wordpress.com/2008/03/05/cnet-convert-integer-to-c-enums/</link>
		<comments>http://mtrockcs.wordpress.com/2008/03/05/cnet-convert-integer-to-c-enums/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 06:45:59 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/03/05/cnet-convert-integer-to-c-enums/</guid>
		<description><![CDATA[Enum DayOfWeek {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}
	
DayOfWeek wednesday = (DayOfWeek)Enum.ToObject(typeof(DayOfWeek), (int)DayOfWeek.Wednesday);

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=36&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">Enum</span><span style="color:black;"> DayOfWeek {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}</span></span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">DayOfWeek wednesday = (DayOfWeek)Enum.ToObject(</span><span style="color:blue;">typeof</span><span style="color:black;">(DayOfWeek), (</span><span style="color:blue;">int</span><span style="color:black;">)DayOfWeek.Wednesday);<br />
</span></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=36&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/03/05/cnet-convert-integer-to-c-enums/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
		<item>
		<title>[C#/.NET] Return in try block &amp; Play in “finally”</title>
		<link>http://mtrockcs.wordpress.com/2008/02/21/cnet-return-in-try-block-play-in-%e2%80%9cfinally%e2%80%9d/</link>
		<comments>http://mtrockcs.wordpress.com/2008/02/21/cnet-return-in-try-block-play-in-%e2%80%9cfinally%e2%80%9d/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 03:15:07 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/02/21/cnet-return-in-try-block-play-in-%e2%80%9cfinally%e2%80%9d/</guid>
		<description><![CDATA[Code:


	

 
Output:

Initialized

Output i in
			finally

j =  Assignment in
			return statement in
			try / i = Assignment in Finally
	
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=28&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="color:blue;font-family:Courier New;font-size:9pt;">Code:<br />
</span></p>
<p><img src="http://mtrockcs.files.wordpress.com/2008/02/022108-0315-cnetretur16.png">
	</p>
<p>
 </p>
<p><span style="color:#00b050;font-family:Courier New;font-size:10pt;">Output:<br />
</span></p>
<p style="background:#d9d9d9;margin-left:36pt;"><span style="font-family:Courier New;font-size:9pt;">Initialized<br />
</span></p>
<p style="background:#d9d9d9;margin-left:36pt;"><span style="font-family:Courier New;font-size:9pt;">Output i <span style="color:blue;">in</span><br />
			<span style="color:blue;">finally<br />
</span></span></p>
<p style="background:#d9d9d9;margin-left:36pt;"><span style="font-family:Courier New;font-size:9pt;">j =  Assignment <span style="color:blue;">in</span><br />
			<span style="color:blue;">return</span> statement <span style="color:blue;">in</span><br />
			<span style="color:blue;">try</span> / i = Assignment <span style="color:blue;">in</span> Finally</span>
	</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=28&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/02/21/cnet-return-in-try-block-play-in-%e2%80%9cfinally%e2%80%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>

		<media:content url="http://mtrockcs.files.wordpress.com/2008/02/022108-0315-cnetretur16.png" medium="image" />
	</item>
		<item>
		<title>[C++/.NET] Wrapping Exceptions</title>
		<link>http://mtrockcs.wordpress.com/2008/02/19/cnet-wrapping-exceptions-2/</link>
		<comments>http://mtrockcs.wordpress.com/2008/02/19/cnet-wrapping-exceptions-2/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 02:18:44 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/02/19/cnet-wrapping-exceptions-2/</guid>
		<description><![CDATA[From:
		ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/dv_fxdesignguide/html/96b5277a-e256-48a4-83e2-43f833d4f66b.htm
		
To wrap an exception, you specify it as the inner exception of a new exception and then throw the new exception. This practice should be used only in situations where the original exception is not meaningful to the person who receives the exception, or the call stack for the exception is misleading or uninteresting. For [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=26&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="color:black;font-family:Verdana;font-size:8pt;">From:</span><br />
		<a href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/dv_fxdesignguide/html/96b5277a-e256-48a4-83e2-43f833d4f66b.htm"><span style="font-family:Verdana;font-size:8pt;">ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/dv_fxdesignguide/html/96b5277a-e256-48a4-83e2-43f833d4f66b.htm</span></a><span style="color:black;font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;">To wrap an exception, you specify it as the inner exception of a new exception and then throw the new exception. This practice should be used only in situations where the original exception is not meaningful to the person who receives the exception, or the call stack for the exception is misleading or uninteresting. For example, consider a library that provides functionality for managing XML-based configuration files. Internally, the configuration file manager uses an XML reader to read files. If a configuration file is incorrectly formatted, the XML reader could throw an exception that includes a message and call stack details for the XML reader and its supporting types, which are meaningless to the application user. In this scenario it is appropriate for the configuration file manager to wrap the XML reader exception and re-throw a new exception that indicates the true nature of the problem.<br />
</span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;">The following guidelines help ensure that you wrap exceptions correctly and only when appropriate.<br />
</span></p>
<p><span style="color:black;font-family:Verdana;font-size:10pt;"><strong>Consider wrapping specific exceptions thrown from a lower layer in a more appropriate exception, if the lower layer exception does not make sense in the context of the higher-layer operation.<br />
</strong></span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;">This should be done rarely because it makes debugging more difficult. It is appropriate when you are certain that the lower layer is never the true source of the error.<br />
</span></p>
<p><span style="color:black;font-family:Verdana;font-size:10pt;"><strong>Avoid catching and wrapping non-specific exceptions.<br />
</strong></span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;">This practice should be avoided because it hides errors. Exceptions to this rule include cases where the wrapper exception communicates a severe condition that is much more interesting to the caller than the actual type of the original exception. For example, the TypeInitializationException exception wraps all exceptions thrown from static constructors.<br />
</span></p>
<p><span style="color:black;font-family:Verdana;font-size:10pt;"><strong>Do specify the inner exception when wrapping exceptions.<br />
</strong></span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;">This allows tools to display the underlying details of the problem and can aid in debugging code. The following code example demonstrates wrapping an exception.<br />
</span></p>
<div>
<table style="border-collapse:collapse;" border="0">
<col>
<col>
<tbody valign="top">
<tr style="background:#efeff7;">
<td colspan="2" style="padding-left:5px;padding-right:5px;border-bottom:solid #c8cdde 0.75pt;">
<p><span style="color:#000066;font-family:Verdana;font-size:10pt;"><strong>C# </strong></span> </p>
</td>
<td style="padding-left:5px;padding-right:5px;border-bottom:solid #c8cdde 0.75pt;">
<p><img src="http://mtrockcs.files.wordpress.com/2008/02/021908-0218-cnetwrap11.gif"><span style="color:blue;font-family:Verdana;">Copy Code</span></p>
</td>
</tr>
<tr style="background:#f7f7ff;">
<td colspan="2" style="padding-top:5px;padding-left:5px;padding-right:5px;border-top:none;border-bottom:solid #d5d5d3 0.75pt;">
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">public void SendMessages()<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">{<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">    try<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">    {<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">        EstablishConnection();<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">    }<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">    catch (System.Net.Sockets.SocketException e)<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">    {<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">        throw new CommunicationFailureException(<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">            &#8220;Cannot access remote computer.&#8221;,<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">            e);<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">    }<br />
</span></p>
<p><span style="color:#000066;font-family:Courier New;font-size:10pt;">}</span> </p>
</td>
</tr>
</tbody>
</table>
</div>
<p><span style="color:black;font-family:Verdana;font-size:9pt;"><em>Portions Copyright 2005 Microsoft Corporation. All rights reserved.</em><br />
		</span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;"><em>Portions Copyright Addison-Wesley Corporation. All rights reserved.</em><br />
		</span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;"><em>For more information on design guidelines, see the &#8220;Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries&#8221; book by Krzysztof Cwalina and Brad Abrams, published by Addison-Wesley, 2005.</em><br />
		</span></p>
<p><span style="color:#003399;font-family:Verdana;"><strong>See Also<br />
</strong></span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;"><strong>Concepts<br />
</strong></span></p>
<p><a href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/dv_fxdesignguide/html/5388e02b-52f5-460e-a2b5-eeafe60eeebe.htm"><span style="color:blue;font-family:Verdana;font-size:8pt;text-decoration:underline;">Exception Throwing</span></a><span style="color:black;font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p><span style="color:black;font-family:Verdana;font-size:9pt;"><strong>Other Resources<br />
</strong></span></p>
<p><a href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/dv_fxdesignguide/html/5fbcaf4f-ea2a-4d20-b0d6-e61dee202b4b.htm"><span style="color:blue;font-family:Verdana;font-size:8pt;text-decoration:underline;">Design Guidelines for Developing Class Libraries</span></a><span style="font-family:Verdana;font-size:8pt;"><span style="color:black;"><br /><a></span><span style="color:blue;text-decoration:underline;">Design Guidelines for Exceptions</span></span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=26&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/02/19/cnet-wrapping-exceptions-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>

		<media:content url="http://mtrockcs.files.wordpress.com/2008/02/021908-0218-cnetwrap11.gif" medium="image" />
	</item>
		<item>
		<title>[.NET] Create custom Exception in .NET</title>
		<link>http://mtrockcs.wordpress.com/2008/02/15/net-create-custom-exception-in-net/</link>
		<comments>http://mtrockcs.wordpress.com/2008/02/15/net-create-custom-exception-in-net/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 07:07:18 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/02/15/net-create-custom-exception-in-net/</guid>
		<description><![CDATA[Quoted from http://blog.gurock.com/articles/creating-custom-exceptions-in-dotnet/

Introduction
Although the .NET framework contains all kinds of exception types which are sufficient in most cases, it can make sense to define custom exceptions in your own applications. They can greatly simplify and improve the error handling and thus increase the overall code quality. Whatever your reasons are for using custom exceptions, this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=22&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="color:#00b050;">Quoted from </span>http://blog.gurock.com/articles/creating-custom-exceptions-in-dotnet/<span style="color:#00b050;"><br />
</span></p>
<h2>Introduction</h2>
<p>Although the .NET framework contains all kinds of exception types which are sufficient in most cases, it can make sense to define custom exceptions in your own applications. They can greatly simplify and improve the error handling and thus increase the overall code quality. Whatever your reasons are for using custom exceptions, this article shows you how to create them and what to pay attention to when it comes to serialization, .NET guidelines and analysis tools.</p>
<h2>System or Application?</h2>
<p>Any custom exception you create needs to derive from the System.Exception class. You can either derive directly from it or use an intermediate exception like <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsystemexceptionclasstopic.asp">SystemException</a> or <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemapplicationexceptionclasstopic.asp">ApplicationException</a> as base class. According to the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemapplicationexceptionclasstopic.asp">.NET framework documentation</a>, SystemException is meant only for those exceptions defined by the common language runtime whereas ApplicationException is intended to be used by user code:</p>
<p>&#8220;ApplicationException is thrown by a user program, not by the common language runtime. If you are designing an application that needs to create its own exceptions, derive from the ApplicationException class. ApplicationException extends Exception, but does not add new functionality. This exception is provided as means to differentiate between exceptions defined by applications versus exceptions defined by the system.&#8221;</p>
<p>So, ApplicationException seems like a good choice as base class for custom exceptions at first. But there has been quite a lot of discussion about this topic and according to <a href="http://blogs.msdn.com/brada/archive/2004/03/25/96251.aspx">this posting</a> by a Microsoft employee working on .NET, the usage of ApplicationException is no longer recommended. It seems that the current .NET framework and its documentation is already outdated when it comes to the ApplicationException class:</p>
<p>&#8220;We added ApplicationException thinking it would add value by grouping exceptions declared outside of the .NET Framework, but there is no scenario for catching ApplicationException and it only adds unnecessary depth to the hierarchy. […] You should not define new exception classes derived from ApplicationException; use Exception instead. In addition, you should not write code that catches ApplicationException.&#8221;</p>
<p>So, the ApplicationException exception class will eventually be deprecated. I therefore let the custom exceptions here in this article derive directly from the Exception class.</p>
<h2>Minimal Exceptions Types</h2>
<p>The absolute minimum a new custom exception class needs to have is a name. Let&#8217;s say you are designing the login mechanism for a database application and as part of this job you need to create a custom exception which is thrown if a login attempt fails. A good name for such an exception would be LoginFailedException. An absolute minimum implementation in C# then looks like:  </p>
<pre><code><strong>public </strong><strong>class</strong> LoginFailedException: <em>System.Exception</em></code><code>{ </code><code>}

</code></pre>
<p>As you can see, all you need to do to create a basic custom exception is to derive from the Exception class. There&#8217;s only one problem with this definition. Since C# unfortunately doesn&#8217;t inherit constructors of base classes, this new type only has the standard constructor with no parameters and is therefore relatively useless. So, we need to add at least one constructor which does something useful:</p>
<pre><code><strong>public </strong><strong>class</strong> LoginFailedException: System.Exception

</code> <code>{

</code> <code>   // The default constructor needs to be defined

</code> <code>   // explicitly now since it would be gone otherwise.

</code> <code><strong>   public</strong> LoginFailedException()

</code> <code>   {

</code> <code>   }

</code> <code><strong>   public </strong><em>LoginFailedException</em>(<strong>string</strong> message): <strong>base</strong>(message)

</code> <code>   {

</code> <code>   }

</code> <code>}

</code></pre>
<p>By now we can use our custom exception like most other exceptions. We can throw an instance of LoginFailedException and pass a message which describes the occurred error. But .NET exceptions can do more. You can normally pass a so called <em>inner exception</em> to one of the constructors which indicates that the created exception is a direct result of a previous one. This inner exception can then be retrieved via the InnerException property. This way you can build entire exceptions chains. Since this can be quite useful sometimes, we extend our existing implementation with this additional constructor:</p>
<pre><code><strong>public</strong> <strong>class</strong> LoginFailedException: System.Exception

</code> <code>{

</code> <code>   // …

</code> <code><strong>   public</strong> LoginFailedException(<strong>string</strong> message, <em>Exception innerException</em>): <strong>base</strong>(message, <em>innerException</em>)

</code> <code>   {

</code> <code>   }

</code> <code>}

</code></pre>
<p>Looks good so far. We now have a working custom exception which is capable of handling error messages and inner exceptions. Great!</p>
<h2>Serialization Basics</h2>
<p>Let&#8217;s now have a look at what <a href="http://www.gotdotnet.com/team/fxcop/">FxCop</a> says to our exception type. In case you don&#8217;t know what FxCop is, it&#8217;s a nice analysis tool which checks .NET assemblies for conformance to the .NET framework design guidelines. FxCop doesn&#8217;t seem to like our exception yet:</p>
<ul>
<li>
<div>Error for ImplementStandardExceptionConstructors:<br />
Add the following constructor:</div>
<p><span style="font-size:9pt;font-family:Courier New;">LoginFailedException(SerializationInfo, StreamingContext) </span></li>
<li>Error for MarkISerializableTypesWithSerializable:<br />
Add [Serializable] as this type implements ISerializable</li>
</ul>
<p>Doesn&#8217;t look that great anymore, does it? However, the good news is that this can be fixed quite easily. Both errors deal with the serialization mechanism of .NET in some way. In case you don&#8217;t know what serialization is, it&#8217;s basically a way to convert an object into a form which can easily be transported or persisted. The counter part to serialization is the deserialization which is responsible for restoring the original object.</p>
<p>Let&#8217;s begin with the second error. Any class that is intended to be serializable needs to be marked with the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemserializableattributeclasstopic.asp">Serializable attribute</a> and since our base class Exception implements the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemruntimeserializationiserializableclasstopic.asp">ISerializable interface</a> which is used to customize the serialization process, FxCop wonders why we didn&#8217;t add it. So, in order to comply with the serialization guidelines, we simply need to add the Serializable attribute and the second error is already fixed:</p>
<p><em>[Serializable]</em><span style="font-size:10pt;font-family:Courier New;">        <br />
</span></p>
<pre><code><strong>public</strong> <strong>class</strong> LoginFailedException: System.Exception

</code> <code>{

</code> <code>   // …

</code> <code>}

</code></pre>
<p>Correcting the first error is a bit more tedious. FxCop complains that we forgot to add an additional standard exception constructor. This constructor is used to customize the serialization process of objects. And since the base Exception class defines such a constructor and C# still lacks the support of constructor inheritance, we are better off adding such a beast:</p>
<pre><code>[Serializable]

</code> <code><strong>public</strong> <strong>class</strong> LoginFailedException: System.Exception

</code> <code>{

</code> <code>   // …

</code> <code><strong>   protected</strong> LoginFailedException(<em>SerializationInfo info</em>, <em>StreamingContext context</em>): <strong>base</strong>(<em>info</em>, <em>context</em>)

</code> <code>   {

</code> <code>   }

</code> <code>}

</code></pre>
<p>Looks good. FxCop keeps quiet now and we finally have a fully functional exception type which can be used like any predefined exception. It can handle simple error messages and inner exceptions and can even be serialized and deserialized correctly.</p>
<h2>Customizing Serialization</h2>
<p>Let&#8217;s pretend we want to extend our exception by being able to store no only the error message why the login attempt failed, but also which username caused the error. This is pretty straightforward. We just add a new field and a new property to our existing class:</p>
<p> <span style="font-size:9pt;font-family:Courier New;">[Serializable]<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">public</span> <span style="color:blue;">class</span> LoginFailedException: System.Exception</span><span style="font-size:9pt;font-family:Courier New;">{</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">   private</span> string fUserName;</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:green;">   // …</span></span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">   public</span> string UserName{</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"></span><span style="font-size:9pt;font-family:Courier New;">      get { <span style="color:blue;">return </span><span style="color:blue;">this</span>.fUserName; }</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      set { <span style="color:blue;">this</span>.fUserName = value; }</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   }<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">}<br />
</span></p>
<p>We are now able to set and get the name of the user specified during the login sequence. So far so good, but what about the serialization now? Does it still work as expected, that is, will the username be preserved when being serialized and deserialized? Unfortunately, the answer is &#8216;no&#8217;. You need to take care of it yourself.</p>
<p>Before we extend our exception to do exactly this, I tell you how the customization of the serialization and deserialization works in general. At first, you need to implement the ISerializable interface. This interface contains a single method, named GetObjectData, which is responsible for storing object fields during the serialization process. To do this, you just need to populate a passed SerializationInfo object.</p>
<p>The deserialization process works exactly the other way round. When an object is being deserialized, the previously filled SerializationInfo object is passed to the constructor of your class in which you are responsible for restoring the original object fields. Translated to our example exception, this looks like:</p>
<p><span style="font-size:9pt;font-family:Courier New;">[Serializable]<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">public </span><span style="color:blue;">class</span> LoginFailedException: System.Exception<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">{</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">   private</span> string fUserName;</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:green;">   // …</span></span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">   protected</span> LoginFailedException(SerializationInfo info,</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">            </span><span style="font-size:9pt;font-family:Courier New;">StreamingContext context): base(info, context) {</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">      if</span> (info != null){</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">         this</span>.fUserName = info.GetString(<span style="color:#a31515;">&#8220;fUserName&#8221;</span>);</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      </span><span style="font-size:9pt;font-family:Courier New;">}</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   }<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">   public </span><span style="color:blue;">override </span><span style="color:blue;">void</span> GetObjectData(SerializationInfo info,<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">        StreamingContext context)    {<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      base.GetObjectData(info, context);</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">      if</span> (info != null) {<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">         info.AddValue(<span style="color:#a31515;">&#8220;fUserName&#8221;</span>, <span style="color:blue;">this</span>.fUserName);</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      </span><span style="font-size:9pt;font-family:Courier New;">}<br />
</span><span style="font-size:9pt;font-family:Courier New;">   }</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"></span><span style="font-size:9pt;font-family:Courier New;">}<br />
</span></p>
<p>Let&#8217;s begin with the serialization. Since our base Exception class already implements the ISerializable interface we can omit it in the list of implemented interfaces and base classes and only need to override and fill the GetObjectData method. At first, we call the GetObjectData method of the base class. This is needed to save the fields common to all exceptions, like the error message, stacktrace information or the inner exception. Then we simply store our username by adding it to the passed SerializationInfo object.</p>
<p>The deserialization works similarly. We just restore our username field in the constructor with the aid of the previously filled SerializationInfo object. To verify that our custom exception works like expected and to demonstrate how an entire serialization and deserialization process looks like, I wrote the following unit test:</p>
<p><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">using</span> System.Runtime.Serialization.Formatters.Binary;<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:green;">// …<br />
</span></span></p>
<p><span style="font-size:9pt;font-family:Courier New;">[Test]    <br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">public </span><span style="color:blue;">void</span> TestUserName()</span><span style="font-size:9pt;font-family:Courier New;">{<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   LoginFailedException e = <span style="color:blue;">new</span> LoginFailedException();<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   e.UserName = <span style="color:#a31515;">&#8220;dotnet user&#8221;</span>;</span><span style="font-size:9pt;font-family:Courier New;"><br />
<span style="color:blue;">   using</span> (Stream s = <span style="color:blue;">new</span> MemoryStream())<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   {<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      BinaryFormatter formatter = <span style="color:blue;">new</span> BinaryFormatter();<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      formatter.Serialize(s, e);<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      s.Position = 0; <span style="color:green;">// Reset stream position<br />
</span></span></p>
<p><span style="font-size:9pt;font-family:Courier New;">      e = (LoginFailedException) formatter.Deserialize(s);<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   }<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">   Assert.AreEqual(e.UserName, <span style="color:#a31515;">&#8220;dotnet user&#8221;</span>);<br />
</span></p>
<p><span style="font-size:9pt;font-family:Courier New;">}<br />
</span></p>
<p><span style="font-size:9pt;color:green;font-family:Courier New;">// …</span><strong><br />
</strong></p>
<p>During the serialization and deserialization process, the username field is now preserved correctly and thus the Assert class remains silent and the test passes. That this is not the case if we haven&#8217;t customized the serialization process can be confirmed quite easily. Simply comment out the GetObjectData method and the call to GetString in the constructor, rerun the test and you&#8217;ll see it failing since the UserName property will now return null instead of the correct username.</p>
<h2>Closing Words</h2>
<p>Aside from the ApplicationException versus Exception discussion, this article has been written with the .NET 1.1 version in mind. However, I don&#8217;t expect upcoming versions of the .NET framework to differ (greatly) from the techniques described here in this article, so that the information given here should still be of value in the future. As usual, if you have any comments or questions feel free to contact me at <a href="mailto:tg@gurock.com">tg@gurock.com</a>. Oh, and by the way, you can download the source of the LoginFailedException class and its test <a href="/wp-content/uploads/2006/02/LoginFailedException.zip">here</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/22/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/22/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=22&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/02/15/net-create-custom-exception-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
		<item>
		<title>Put your forward declaration inside the namespace symbol</title>
		<link>http://mtrockcs.wordpress.com/2008/02/14/put-your-forward-declaration-inside-the-namespace-symbol/</link>
		<comments>http://mtrockcs.wordpress.com/2008/02/14/put-your-forward-declaration-inside-the-namespace-symbol/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 02:06:46 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/02/14/put-your-forward-declaration-inside-the-namespace-symbol/</guid>
		<description><![CDATA[A stupid forward declaration made one of my whole day miserable.

At the time it says the class cannot be found, I put the forward declaration in the front of the header file. And that, turned out, still, not working. As a result of no result from googling, I put off all that-class-related method wrapping and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=21&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A stupid forward declaration made one of my whole day miserable.
</p>
<p>At the time it says the class cannot be found, I put the forward declaration in the front of the header file. And that, turned out, still, not working. As a result of no result from googling, I put off all that-class-related method wrapping and continued on other part of my work.
</p>
<p>Now the reason comes to surface. Stupid ME put the stupid forward declaration outside the namespace symbol. THAT is the reason, and that is THE reason, why I wasted that much time.
</p>
<p>Stupid me, learn, and go forward.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=21&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/02/14/put-your-forward-declaration-inside-the-namespace-symbol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
		<item>
		<title>[C++/.NET] Conversion from System::String ^ to CString</title>
		<link>http://mtrockcs.wordpress.com/2008/02/12/cnet-conversion-from-systemstring-to-cstring/</link>
		<comments>http://mtrockcs.wordpress.com/2008/02/12/cnet-conversion-from-systemstring-to-cstring/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 09:37:57 +0000</pubDate>
		<dc:creator>linuxprogram</dc:creator>
				<category><![CDATA[C/C++/C#]]></category>

		<guid isPermaLink="false">http://mtrockcs.wordpress.com/2008/02/12/cnet-conversion-from-systemstring-to-cstring/</guid>
		<description><![CDATA[For conversion from System::String to CString:

Most Efficient:

using
namespace System::Runtime::InteropServices;

System::String^ str = &#8220;A test string.&#8221;;

char* str2 = (char*)(void*)Marshal::StringToHGlobalAnsi(str);

CString target = str2;

Marshal::FreeHGlobal((IntPtr)str2);

Simplest but least Efficient：

CString target2 = CString(str);
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=20&subd=mtrockcs&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-size:9pt;color:#666666;font-family:Verdana;">For conversion from System::String to CString:<br />
</span></p>
<p><span style="font-size:9pt;color:#666666;font-family:Verdana;">Most Efficient:<br />
</span></p>
<p style="margin-left:36pt;"><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">using</span><br />
<span style="color:blue;">namespace</span> System::Runtime::InteropServices;<br />
</span></p>
<p style="margin-left:36pt;"><span style="font-size:9pt;font-family:Courier New;">System::String^ str = <span style="color:#a31515;">&#8220;A test string.&#8221;</span>;<br />
</span></p>
<p style="margin-left:36pt;"><span style="font-size:9pt;font-family:Courier New;"><span style="color:blue;">char</span>* str2 = (<span style="color:blue;">char</span>*)(<span style="color:blue;">void</span>*)Marshal::StringToHGlobalAnsi(str);<br />
</span></p>
<p style="margin-left:36pt;"><span style="font-size:9pt;font-family:Courier New;">CString target = str2;<br />
</span></p>
<p style="margin-left:36pt;"><span style="font-size:9pt;font-family:Courier New;">Marshal::FreeHGlobal((IntPtr)str2);<br />
</span></p>
<p><span style="font-size:9pt;color:#666666;"><span style="font-family:Verdana;">Simplest but least Efficient</span><span style="font-family:宋体;">：</span><span style="font-family:Verdana;"><br />
</span></span></p>
<p><span style="font-size:9pt;font-family:Courier New;">CString target2 = CString(str);</span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mtrockcs.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mtrockcs.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mtrockcs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mtrockcs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mtrockcs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mtrockcs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mtrockcs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mtrockcs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mtrockcs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mtrockcs.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mtrockcs.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mtrockcs.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mtrockcs.wordpress.com&blog=1368322&post=20&subd=mtrockcs&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mtrockcs.wordpress.com/2008/02/12/cnet-conversion-from-systemstring-to-cstring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/68f0b8eb3c4f7617e8ea6681a955a6b4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">linuxprogram</media:title>
		</media:content>
	</item>
	</channel>
</rss>