<?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/"
	>

<channel>
	<title>Fiberglass flowers &#187; blog</title>
	<atom:link href="http://victorsergienko.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://victorsergienko.com</link>
	<description>Software design and development: OOD, C++, .NET, Java, a little this and that</description>
	<lastBuildDate>Fri, 12 Feb 2010 10:09:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Self-update library for .NET using WiX: DotUpdater</title>
		<link>http://victorsergienko.com/self-update-library-for-net-using-wix-dotupdater/</link>
		<comments>http://victorsergienko.com/self-update-library-for-net-using-wix-dotupdater/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 11:48:43 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[WiX]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=97</guid>
		<description><![CDATA[Just published a library I created on one of past jobs out of Updater Application Block and WiX&#8217;s ClichThrough component. Please meet: DotUpdater It can auto-update an application, just create a RSS feed of updates and Windows Installer (MSI) binaries.]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/self-update-library-for-net-using-wix-dotupdater/&title=Self-update+library+for+.NET+using+WiX:+DotUpdater&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>Just published a library I created on one of past jobs out of Updater Application Block and WiX&#8217;s ClichThrough component.<br />
Please meet: <a href="http://dotupdater.codeplex.com/">DotUpdater</a><br />
It can auto-update an application, just create a RSS feed of updates and Windows Installer (MSI) binaries.</p>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/self-update-library-for-net-using-wix-dotupdater/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Link Taxonomy Terms to Views in Drupal</title>
		<link>http://victorsergienko.com/link-taxonomy-terms-to-views-in-drupal/</link>
		<comments>http://victorsergienko.com/link-taxonomy-terms-to-views-in-drupal/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 13:46:30 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=90</guid>
		<description><![CDATA[Imagine a task (actually, quite common), if you have: a nodes (articles, ads, whatever) taxonomy in Drupal, a taxonomy-based url path rewrites, like /monkeys/primates/homosapiens and want to show a block/page View with articles only from current path term (and, maybe, its subterms). It might be a hard time finding out the current term. One could [...]]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/link-taxonomy-terms-to-views-in-drupal/&title=Link+Taxonomy+Terms+to+Views+in+Drupal&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>Imagine a task (actually, quite common), if you have: </p>
<ul>
<li>a nodes (articles, ads, whatever) taxonomy in Drupal, </li>
<li>a taxonomy-based url path rewrites, like <em>/monkeys/primates/homosapiens</em> </li>
<li>and want to show a block/page View with articles <strong>only</strong> from current path term (and, maybe, its subterms).</li>
</ul>
<p>It might be a hard time finding out the current term. One could try <a href="http://www.leveltendesign.com/blog/dustin-currie/link-taxonomy-terms-custom-views-drupal">having two nested views</a>, passing a current term as a parameter to nested view, like Dustin Currie did.</p>
<p>Though, Views has several pre-defined solutions. Just go to /admin/build/views/ and enable this one: <strong>&#8220;Default Node view: taxonomy_term&#8221;</strong>, (clone it to play safe), voila!</p>
<p>You got a View for the current term.</p>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/link-taxonomy-terms-to-views-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diff a Micorosoft Office documents inder SVN?</title>
		<link>http://victorsergienko.com/diff-a-micorosoft-office-documents-inder-svn/</link>
		<comments>http://victorsergienko.com/diff-a-micorosoft-office-documents-inder-svn/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 15:56:28 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=85</guid>
		<description><![CDATA[In case you, like me, need to compare version of Office documents (under Windows), just know that TortoiseSVN got a pretty set of scripts for that. It works out of box! YES! You can compare Office documents just like plaintext files!. Just tried it and it worked. If you were afraid of trying, like me [...]]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/diff-a-micorosoft-office-documents-inder-svn/&title=Diff+a+Micorosoft+Office+documents+inder+SVN?&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>In case you, like me, need to compare version of Office documents (under Windows), just know that <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> got a pretty <a href="http://tortoisesvn.tigris.org/source/browse/tortoisesvn/trunk/contrib/diff-scripts/">set of scripts</a> for that.<br />
It works out of box!<br />
YES!<br />
<strong>You can compare Office documents just like plaintext files!</strong>.<br />
Just tried it and it worked. If you were afraid of trying, like me &#8211; don&#8217;t be.</p>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/diff-a-micorosoft-office-documents-inder-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails: mocking domain objects in unit tests</title>
		<link>http://victorsergienko.com/grails-mocking-domain-objects-in-unit-tests/</link>
		<comments>http://victorsergienko.com/grails-mocking-domain-objects-in-unit-tests/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 09:13:19 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=79</guid>
		<description><![CDATA[We&#8217;re trying Grails, Rails-like web application framework for Java. It&#8217;s fine, just that Groovy debugger support is, er, imperfect, even in the best Gruoovy IDE &#8211; IDEA. And, if you want to unit test, you won&#8217;t have fancy domain class methods addTo* &#8211; like Customer.addToOrders(). They&#8217;re generated by Grails on startup. In order to have [...]]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/grails-mocking-domain-objects-in-unit-tests/&title=Grails:+mocking+domain+objects+in+unit+tests&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>We&#8217;re trying <a href="http://grails.org/">Grails</a>, <a href="http://rubyonrails.org/">Rails</a>-like web application framework for Java.<br />
It&#8217;s fine, just that Groovy debugger support is, er, imperfect, even in the best Gruoovy IDE &#8211; IDEA.</p>
<p>And, if you want to unit test, you won&#8217;t have fancy domain class methods addTo* &#8211; like Customer.addToOrders().<br />
They&#8217;re generated by Grails on startup.<br />
In order to have addTo*(), inherit from GrailsUnitTestCase and call mockDomain(Customer) in setUp().</p>
<p>Oh, if you get <code>"NullPointerException: Cannot invoke method containsKey() on null object"</code>, add super.setUp() to yout testcase&#8217;s setUp().</p>
<p>Having proper save() is more tricky. Implementation from mockDomain() works to some extent: it won&#8217;t save connected objects.<br />
So, in order to get save() working, you have to do something like this:<br />
<span id="more-79"></span></p>
<pre class="ruby">    <span class="color: #0000ff;" >def</span> savedCustomers = []

    void setUp() {
        <span class="color: #0000ff;" >super</span>.setUp()
        Customer.metaClass.save = { saveCustomer(delegate) }
        mockDomain(Customer, savedCustomers)
    }

    private <span class="color: #0000ff;" >def</span> saveCustomer(c) {
        savedCustomers.add(c)
        <span class="color: #0000ff;" >if</span> (c.orders != null) {
            c.orders.<span class="color: #0000ff;" >each</span> { x -&gt; x.save() }
        }
    }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/grails-mocking-domain-objects-in-unit-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;Project Dependencies&#8221; of Visual Studio 2008 broken in MSBuild</title>
		<link>http://victorsergienko.com/project-dependencies-of-visual-studio-2008-broken-in-msbuild/</link>
		<comments>http://victorsergienko.com/project-dependencies-of-visual-studio-2008-broken-in-msbuild/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 15:37:37 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=70</guid>
		<description><![CDATA[Just dealt with another Visual Studio 2008 &#8220;feature&#8221;. You can specify all the necessary &#8220;Project Dependencies&#8221; in Visual Studio, but will get &#8220;CSC : error CS0006: Metadata file FooBar.dll could not be found&#8220;. Even if your csproj files have correct references to other solution projects, msbuild will fail. Maybe it appears only if project output [...]]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/project-dependencies-of-visual-studio-2008-broken-in-msbuild/&title=&#8220;Project+Dependencies&#8221;+of+Visual+Studio+2008+broken+in+MSBuild&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>Just dealt with another Visual Studio 2008 &#8220;feature&#8221;.</p>
<p>You can specify all the necessary &#8220;Project Dependencies&#8221; in Visual Studio, but will get &#8220;<em><strong>CSC : error CS0006: Metadata file FooBar.dll could not be found</strong></em>&#8220;. Even if your csproj files have correct references to other solution projects, <strong>msbuild will fail</strong>.<br />
Maybe it appears only if project output path is outside of project directory.</p>
<p>It appears that Visual Studio keeps the dependencies in two ways, only one of which is read by MSBuild. I see that because I still can specify dependencies in GUI, copy solution to other machine and build it with VS in correct order.</p>
<p>Not with MSBuild.</p>
<p>The data needed by MSBuild is a &#8220;<code>ProjectSection(ProjectDependencies) = postProject</code>&#8221; section of SLN file. Like this:</p>
<p><span id="more-70"></span>
<pre><code>Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_versioninfo", "make_versioninfo.vcproj", "{<strong>F0E0541E-F17D-430B-97C4-93ADF0DD284E</strong>}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"
	ProjectSection(ProjectDependencies) = postProject
		{<strong>F0E0541E-F17D-430B-97C4-93ADF0DD284E</strong>} = {<strong>F0E0541E-F17D-430B-97C4-93ADF0DD284E</strong>}
	EndProjectSection
EndProject</code></pre>
<p>Note where to take the GUID of a referenced project.<br />
If you create this section by hand, your project will build.</p>
<p>Not too much fun, if you have over 20 projects, where you can have up to 190 project dependencies&#8230; Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/project-dependencies-of-visual-studio-2008-broken-in-msbuild/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Algorithmic quiz: check a 3-braces expression</title>
		<link>http://victorsergienko.com/algorithmic-quiz-check-braces/</link>
		<comments>http://victorsergienko.com/algorithmic-quiz-check-braces/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 08:04:24 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=61</guid>
		<description><![CDATA[I just won a bet for $10 by solving a quiz:
Check the correctness of a braces, brackets and parentheses sequence. The solution should be of linear complexity (to say more, it's 1-pass).
It's basically solved in 15 lines, all others being auxiliary. Can you reproduce the algorithm?]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/algorithmic-quiz-check-braces/&title=Algorithmic+quiz:+check+a+3-braces+expression&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>I just won a bet for $10 by solving a quiz:</p>
<p>Check the correctness of a braces, brackets and parentheses sequence. The solution should be of linear complexity (to say more, it&#8217;s 1-pass).</p>
<p>For instance, these expressions are correct: &#8220;()&#8221;, &#8220;()()[]&#8220;, &#8220;([][][]{})&#8221;, &#8220;([])()[]&#8220;, and these are not: &#8220;][", "())(", "(()".</p>
<p><img class="alignnone wp-image-64" style="border-width:5px;" title="Ten dollars" src="http://victorsergienko.com/wp-content/uploads/s_ten_dollars_2.jpg" alt="Ten dollars" width="250" height="188" /></p>
<p>It's basically solved in 15 lines, all others being auxiliary. Can you reproduce the algorithm?</p>
<p>The solution follows.<br />
<span id="more-61"></span></p>
<pre style="color:#000000;background:#ffffff;"><span style="font-weight: bold; color: #800000;">import</span><span style="color: #004a43;"> java</span><span style="color: #808030;">.</span><span style="color: #004a43;">security</span><span style="color: #808030;">.</span><span style="color: #004a43;">InvalidParameterException</span><span style="color: #800080;">;</span>
<span style="font-weight: bold; color: #800000;">import</span><span style="color: #004a43;"> java</span><span style="color: #808030;">.</span><span style="color: #004a43;">util</span><span style="color: #808030;">.</span><span style="color: #004a43;">Stack</span><span style="color: #800080;">;</span>

<span style="font-weight: bold; color: #800000;">public</span> <span style="font-weight: bold; color: #800000;">class</span> Braces
<span style="color: #800080;">{</span>
    <span style="font-weight: bold; color: #800000;">private</span> <span style="font-weight: bold; color: #800000;">static</span> <span style="color: #bb7977;">boolean</span> isClosing<span style="color: #808030;">(</span><span style="color: #bb7977;">char</span> c<span style="color: #808030;">)</span>
    <span style="color: #800080;">{</span>
        <span style="font-weight: bold; color: #800000;">return</span> c <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">')'</span> <span style="color: #808030;">|</span><span style="color: #808030;">|</span> c <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">'}'</span> <span style="color: #808030;">|</span><span style="color: #808030;">|</span> c <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">']&#8216;</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span>

    <span style="font-weight: bold; color: #800000;">private</span> <span style="font-weight: bold; color: #800000;">static</span> <span style="color: #bb7977;">boolean</span> isOpening<span style="color: #808030;">(</span><span style="color: #bb7977;">char</span> c<span style="color: #808030;">)</span>
    <span style="color: #800080;">{</span>
        <span style="font-weight: bold; color: #800000;">return</span> c <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">&#8216;(&#8216;</span> <span style="color: #808030;">|</span><span style="color: #808030;">|</span> c <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">&#8216;{&#8216;</span> <span style="color: #808030;">|</span><span style="color: #808030;">|</span> c <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #0000e6;">&#8216;['</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span>

    <span style="font-weight: bold; color: #800000;">private</span> <span style="font-weight: bold; color: #800000;">static</span> <span style="color: #bb7977;">char</span> matching<span style="color: #808030;">(</span><span style="color: #bb7977;">char</span> c<span style="color: #808030;">)</span>
    <span style="color: #800080;">{</span>
        <span style="font-weight: bold; color: #800000;">switch</span> <span style="color: #808030;">(</span>c<span style="color: #808030;">)</span>
        <span style="color: #800080;">{</span>
        <span style="font-weight: bold; color: #800000;">case</span> <span style="color: #0000e6;">'('</span><span style="color: #808030;">:</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="color: #0000e6;">')'</span><span style="color: #800080;">;</span>
        <span style="font-weight: bold; color: #800000;">case</span> <span style="color: #0000e6;">'['</span><span style="color: #808030;">:</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="color: #0000e6;">']&#8216;</span><span style="color: #800080;">;</span>
        <span style="font-weight: bold; color: #800000;">case</span> <span style="color: #0000e6;">&#8216;{&#8216;</span><span style="color: #808030;">:</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="color: #0000e6;">&#8216;}&#8217;</span><span style="color: #800080;">;</span>
        <span style="font-weight: bold; color: #800000;">case</span> <span style="color: #0000e6;">&#8216;)&#8217;</span><span style="color: #808030;">:</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="color: #0000e6;">&#8216;(&#8216;</span><span style="color: #800080;">;</span>
        <span style="font-weight: bold; color: #800000;">case</span> <span style="color: #0000e6;">&#8216;]&#8217;</span><span style="color: #808030;">:</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="color: #0000e6;">&#8216;['</span><span style="color: #800080;">;</span>
        <span style="font-weight: bold; color: #800000;">case</span> <span style="color: #0000e6;">'}'</span><span style="color: #808030;">:</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="color: #0000e6;">'{'</span><span style="color: #800080;">;</span>
        <span style="font-weight: bold; color: #800000;">default</span><span style="color: #808030;">:</span>
            <span style="font-weight: bold; color: #800000;">throw</span> <span style="font-weight: bold; color: #800000;">new</span> <span style="font-weight: bold; color: #bb7977;">InvalidParameterException</span><span style="color: #808030;">(</span><span style="color: #0000e6;">"Not a brace"</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        <span style="color: #800080;">}</span>
    <span style="color: #800080;">}</span>

    <span style="font-weight: bold; color: #800000;">public</span> <span style="font-weight: bold; color: #800000;">static</span> <span style="color: #bb7977;">boolean</span> isCorrect<span style="color: #808030;">(</span><span style="font-weight: bold; color: #bb7977;">String</span> expression<span style="color: #808030;">)</span>
    <span style="color: #800080;">{</span>
        <span style="font-weight: bold; color: #bb7977;">Stack</span><span style="color: #808030;">&lt;</span><span style="font-weight: bold; color: #bb7977;">Character</span><span style="color: #808030;">&gt;</span> lastBrace <span style="color: #808030;">=</span> <span style="font-weight: bold; color: #800000;">new</span> <span style="font-weight: bold; color: #bb7977;">Stack</span><span style="color: #808030;">&lt;</span><span style="font-weight: bold; color: #bb7977;">Character</span><span style="color: #808030;">&gt;</span><span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        <span style="font-weight: bold; color: #800000;">for</span> <span style="color: #808030;">(</span><span style="color: #bb7977;">int</span> i<span style="color: #808030;">=</span><span style="color: #008c00;">0</span><span style="color: #800080;">;</span> i<span style="color: #808030;">&lt;</span>expression<span style="color: #808030;">.</span>length<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span> i<span style="color: #808030;">+</span><span style="color: #808030;">+</span><span style="color: #808030;">)</span>
        <span style="color: #800080;">{</span>
            <span style="color: #bb7977;">char</span> c <span style="color: #808030;">=</span> expression<span style="color: #808030;">.</span>charAt<span style="color: #808030;">(</span>i<span style="color: #808030;">)</span><span style="color: #800080;">;</span>

            <span style="font-weight: bold; color: #800000;">if</span> <span style="color: #808030;">(</span>isClosing<span style="color: #808030;">(</span>c<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
            <span style="color: #800080;">{</span>
                <span style="font-weight: bold; color: #800000;">if</span> <span style="color: #808030;">(</span>lastBrace<span style="color: #808030;">.</span>size<span style="color: #808030;">(</span><span style="color: #808030;">)</span> <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #808030;">)</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="font-weight: bold; color: #800000;">false</span><span style="color: #800080;">;</span>
                <span style="font-weight: bold; color: #800000;">if</span> <span style="color: #808030;">(</span>lastBrace<span style="color: #808030;">.</span>peek<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">.</span>charValue<span style="color: #808030;">(</span><span style="color: #808030;">)</span> <span style="color: #808030;">!</span><span style="color: #808030;">=</span> matching<span style="color: #808030;">(</span>c<span style="color: #808030;">)</span><span style="color: #808030;">)</span> <span style="font-weight: bold; color: #800000;">return</span> <span style="font-weight: bold; color: #800000;">false</span><span style="color: #800080;">;</span>
                lastBrace<span style="color: #808030;">.</span>pop<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
            <span style="color: #800080;">}</span>
            <span style="font-weight: bold; color: #800000;">else</span> <span style="font-weight: bold; color: #800000;">if</span> <span style="color: #808030;">(</span>isOpening<span style="color: #808030;">(</span>c<span style="color: #808030;">)</span><span style="color: #808030;">)</span>
            <span style="color: #800080;">{</span>
                lastBrace<span style="color: #808030;">.</span>push<span style="color: #808030;">(</span><span style="font-weight: bold; color: #bb7977;">Character</span><span style="color: #808030;">.</span>valueOf<span style="color: #808030;">(</span>c<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
            <span style="color: #800080;">}</span>
            <span style="font-weight: bold; color: #800000;">else</span>
            <span style="color: #800080;">{</span>
                <span style="font-weight: bold; color: #800000;">throw</span> <span style="font-weight: bold; color: #800000;">new</span> <span style="font-weight: bold; color: #bb7977;">InvalidParameterException</span><span style="color: #808030;">(</span>expression <span style="color: #808030;">+</span> <span style="color: #0000e6;">"["</span> <span style="color: #808030;">+</span> i <span style="color: #808030;">+</span> <span style="color: #0000e6;">"]=&#8221;</span> <span style="color: #808030;">+</span> c<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
            <span style="color: #800080;">}</span>
        <span style="color: #800080;">}</span>

        <span style="font-weight: bold; color: #800000;">return</span> lastBrace<span style="color: #808030;">.</span>size<span style="color: #808030;">(</span><span style="color: #808030;">)</span> <span style="color: #808030;">=</span><span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span>
<span style="color: #800080;">}</span></pre>
<pre style="color:#000000;background:#ffffff;"><span style="font-weight: bold; color: #800000;">import</span><span style="color: #004a43;"> junit</span><span style="color: #808030;">.</span><span style="color: #004a43;">framework</span><span style="color: #808030;">.</span><span style="color: #004a43;">TestCase</span><span style="color: #800080;">;</span>

<span style="font-weight: bold; color: #800000;">public</span> <span style="font-weight: bold; color: #800000;">class</span> BracesTest <span style="font-weight: bold; color: #800000;">extends</span> TestCase <span style="color: #800080;">{</span>

    <span style="font-weight: bold; color: #800000;">public</span> <span style="color: #bb7977;">void</span> testIsCorrect<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
    <span style="color: #800080;">{</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"()"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"[]"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"{}"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"([])"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"()()[]"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"([][][]{})"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"(()[()]())"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertTrue<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"([])()[]"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"([]"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"[]]"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"]["</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"(][)"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"(][)"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"(][)"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"[(){}}"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"]["</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"(("</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"(()))"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>

        assertFalse<span style="color: #808030;">(</span>Braces<span style="color: #808030;">.</span>isCorrect<span style="color: #808030;">(</span><span style="color: #0000e6;">"{}{}}{"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span>
<span style="color: #800080;">}</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/algorithmic-quiz-check-braces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IListSource.ContainsListCollection explained</title>
		<link>http://victorsergienko.com/ilistsource-explained-howto/</link>
		<comments>http://victorsergienko.com/ilistsource-explained-howto/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 05:43:25 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/?p=49</guid>
		<description><![CDATA[Whenever you implement own datasource for .NET GUI binding, you&#8217;lll have the choice &#8211; whether to implement IList or IListSource. IListSource is a simplistic interface with two members: IList&#60;T> GetList() and bool ContainsListCollection; MSDN help about IListSource.ContainsListCollection states it&#8217;s &#8220;indicating whether the collection is a collection of IList objects&#8221;. MSDN is not true here. If [...]]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/ilistsource-explained-howto/&title=IListSource.ContainsListCollection+explained&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>Whenever you implement own datasource for .NET GUI binding, you&#8217;lll have the choice &#8211; whether to implement IList or IListSource.</p>
<p>IListSource is a simplistic interface with two members: <strong>IList&lt;T> GetList()</strong> and <strong>bool ContainsListCollection</strong>;</p>
<p>MSDN help <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.ilistsource_members.aspx">about IListSource.ContainsListCollection</a> states it&#8217;s &#8220;indicating whether the collection is a collection of IList objects&#8221;.<br />
<strong>MSDN is not true here</strong>.</p>
<p>If IListSource.ContainsListCollection is <strong>false</strong>, GetList() just returns your IList.</p>
<p>If IListSource.ContainsListCollection is <strong>true</strong>, GetList() is expected to return <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.itypedlist.aspx">ITypedList</a>, which needs to provide a collection of <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.propertydescriptor.aspx">PropertyDescriptor</a>-s for every field of your collection.<br />
Its purpose is to provide field names (including by-name field access) in runtime.</p>
<p>Quoted below is a <a href="http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic2404.aspx">code piece from a Microsoft newsgroup</a> that resolves both cases to a data list (field values list, in second case).</p>
<p>And yes, if you&#8217;re planning to mutate the UI-bound collection, use <strong><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.ibindinglist.aspx">IBindingList</a></strong>&lt;> instead of <strong>IList</strong>&lt;>.<br />
<span id="more-49"></span><br />
<code>
<pre>
<FONT COLOR=RED><B>static</B></FONT> IEnumerable GetResolvedDataSource<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>object dataSource<FONT COLOR=BLUE SIZE=+1><B>,</B></FONT> string dataMember<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>
<FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
    <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>dataSource <FONT COLOR=BLUE SIZE=+1>!</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

    <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
        IListSource source1 <FONT COLOR=BLUE SIZE=+1>=</FONT> dataSource as IListSource<FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
        <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>source1 <FONT COLOR=BLUE SIZE=+1>!</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

        <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
            IList list1 <FONT COLOR=BLUE SIZE=+1>=</FONT> source1.GetList<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
            <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=BLUE SIZE=+1>!</FONT>source1.ContainsListCollection<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

            <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                <FONT COLOR=RED><B>return</B></FONT> list1<FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
            <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
            <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>list1 <FONT COLOR=BLUE SIZE=+1>!</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> <FONT COLOR=BLUE SIZE=+1><FONT COLOR=BLUE SIZE=+1>&amp;</FONT><FONT COLOR=BLUE SIZE=+1>&amp;</FONT></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>list1 is ITypedList<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

            <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                ITypedList list2 <FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>ITypedList<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> list1<FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
                PropertyDescriptorCollection collection1 <FONT COLOR=BLUE SIZE=+1>=</FONT> list2.GetItemProperties<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=RED><B>new</B></FONT> PropertyDescriptor<FONT COLOR=BLUE SIZE=+1><B>[</B></FONT><FONT COLOR=BROWN>0</FONT><FONT COLOR=BLUE SIZE=+1><B>]</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>

                <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>collection1 <FONT COLOR=BLUE SIZE=+1>=</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> <FONT COLOR=BLUE SIZE=+1><FONT COLOR=BLUE SIZE=+1>|</FONT><FONT COLOR=BLUE SIZE=+1>|</FONT></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>collection1.Count <FONT COLOR=BLUE SIZE=+1>=</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=BROWN>0</FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

                <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                    <FONT COLOR=RED><B>throw</B></FONT> <FONT COLOR=RED><B>new</B></FONT> HttpException<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>HttpRuntime<FONT COLOR=BLUE SIZE=+1><B>.</B></FONT>FormatResourceString<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=PURPLE>"ListSource_Without_DataMembers"</FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>

                <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
                PropertyDescriptor descriptor1 <FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
                <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>dataMember <FONT COLOR=BLUE SIZE=+1>=</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> <FONT COLOR=BLUE SIZE=+1><FONT COLOR=BLUE SIZE=+1>|</FONT><FONT COLOR=BLUE SIZE=+1>|</FONT></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>dataMember<FONT COLOR=BLUE SIZE=+1><B>.</B></FONT>Length <FONT COLOR=BLUE SIZE=+1>=</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=BROWN>0</FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

                <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                    descriptor1 <FONT COLOR=BLUE SIZE=+1>=</FONT> collection1<FONT COLOR=BLUE SIZE=+1><B>[</B></FONT><FONT COLOR=BROWN>0</FONT><FONT COLOR=BLUE SIZE=+1><B>]</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
                <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
                <FONT COLOR=RED><B>else</B></FONT>

                <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                    descriptor1 <FONT COLOR=BLUE SIZE=+1>=</FONT> collection1.Find<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>dataMember<FONT COLOR=BLUE SIZE=+1><B>,</B></FONT> true<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
                <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>

                <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>descriptor1 <FONT COLOR=BLUE SIZE=+1>!</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>
                <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                    object obj1 <FONT COLOR=BLUE SIZE=+1>=</FONT> list1<FONT COLOR=BLUE SIZE=+1><B>[</B></FONT><FONT COLOR=BROWN>0</FONT><FONT COLOR=BLUE SIZE=+1><B>]</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>

                    object obj2 <FONT COLOR=BLUE SIZE=+1>=</FONT> descriptor1.GetValue<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>obj1<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
                    <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>obj2 <FONT COLOR=BLUE SIZE=+1>!</FONT><FONT COLOR=BLUE SIZE=+1>=</FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> <FONT COLOR=BLUE SIZE=+1><FONT COLOR=BLUE SIZE=+1>&amp;</FONT><FONT COLOR=BLUE SIZE=+1>&amp;</FONT></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>obj2 is IEnumerable<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>

                    <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
                        <FONT COLOR=RED><B>return</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>IEnumerable<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> obj2<FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
                    <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
                <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>

                <FONT COLOR=RED><B>throw</B></FONT> <FONT COLOR=RED><B>new</B></FONT> HttpException<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>HttpRuntime<FONT COLOR=BLUE SIZE=+1><B>.</B></FONT>FormatResourceString<FONT COLOR=BLUE SIZE=+1><B>(</B></FONT><FONT COLOR=PURPLE>"ListSource_Missing_DataMember"</FONT><FONT COLOR=BLUE SIZE=+1><B>,</B></FONT> dataMember<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>)</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>

            <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
        <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
        <FONT COLOR=RED><B>if</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>dataSource is IEnumerable<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT>
        <FONT COLOR=BLUE SIZE=+1><B>{</B></FONT>
            <FONT COLOR=RED><B>return</B></FONT> <FONT COLOR=BLUE SIZE=+1><B>(</B></FONT>IEnumerable<FONT COLOR=BLUE SIZE=+1><B>)</B></FONT> dataSource<FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>

        <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
    <FONT COLOR=BLUE SIZE=+1><B>}</B></FONT>
    <FONT COLOR=RED><B>return</B></FONT> <FONT COLOR=RED><B>null</B></FONT><FONT COLOR=BLUE SIZE=+1><B>;</B></FONT>
<FONT COLOR=BLUE SIZE=+1><B>}</B></FONT></pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/ilistsource-explained-howto/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>About this blog</title>
		<link>http://victorsergienko.com/this-blog-is-commercial/</link>
		<comments>http://victorsergienko.com/this-blog-is-commercial/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 19:02:13 +0000</pubDate>
		<dc:creator>Victor Sergienko</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://victorsergienko.com/this-blog-is-commercial/</guid>
		<description><![CDATA[I&#8217;m going to start with reposting my older articles written in Russian. To be honest: It&#8217;s a self-promotion blog which has the chance to be commercial. OTOH, this also means the articles will be carefully reviewed, filtered and refined. I promise that I&#8217;m intending to maybe do it]]></description>
			<content:encoded><![CDATA[<a class="google_buzz"style="float: right; padding-top: 10px; margin-left: 20px;"href="http://www.google.com/reader/link?url=http://victorsergienko.com/this-blog-is-commercial/&title=About+this+blog&srcURL=http://victorsergienko.com" target="_blank" rel="nofollow"><img
src="http://victorsergienko.com/wp-content/plugins/google-buzz-button/images/google-buzz.png" alt="Google Buzz" /></a><p>I&#8217;m going to start with reposting my older articles written in Russian.<br />
To be honest: It&#8217;s a self-promotion blog which has the chance to be commercial.<br />
OTOH, this also means the articles will be carefully reviewed, filtered and refined. I promise that I&#8217;m intending to maybe do it <img src='http://victorsergienko.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://victorsergienko.com/this-blog-is-commercial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
